@socketsecurity/lib 3.2.3 → 3.2.5

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 (316) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +31 -35
  3. package/dist/abort.js +1 -1
  4. package/dist/agent.js +11 -11
  5. package/dist/ansi.js +1 -1
  6. package/dist/argv/flags.js +1 -1
  7. package/dist/argv/parse.js +1 -1
  8. package/dist/arrays.js +1 -1
  9. package/dist/bin.js +5 -5
  10. package/dist/cacache.js +1 -1
  11. package/dist/cache-with-ttl.js +1 -1
  12. package/dist/constants/agents.js +1 -1
  13. package/dist/constants/core.js +1 -1
  14. package/dist/constants/encoding.js +1 -1
  15. package/dist/constants/github.js +1 -1
  16. package/dist/constants/licenses.js +1 -1
  17. package/dist/constants/node.js +2 -13
  18. package/dist/constants/packages.js +10 -25
  19. package/dist/constants/paths.js +1 -1
  20. package/dist/constants/platform.js +1 -1
  21. package/dist/constants/process.js +3 -7
  22. package/dist/constants/socket.js +1 -1
  23. package/dist/constants/testing.js +1 -1
  24. package/dist/constants/time.js +1 -1
  25. package/dist/constants/typescript.js +1 -1
  26. package/dist/cover/code.js +1 -1
  27. package/dist/cover/formatters.js +1 -1
  28. package/dist/cover/type.js +1 -1
  29. package/dist/cover/types.js +1 -1
  30. package/dist/debug.js +4 -4
  31. package/dist/dlx-binary.js +5 -5
  32. package/dist/dlx-manifest.js +1 -1
  33. package/dist/dlx-package.js +1 -1
  34. package/dist/dlx.js +1 -1
  35. package/dist/effects/pulse-frames.js +4 -4
  36. package/dist/effects/text-shimmer.js +2 -2
  37. package/dist/effects/types.js +1 -1
  38. package/dist/effects/ultra.js +1 -1
  39. package/dist/env/ci.js +3 -3
  40. package/dist/env/debug.js +2 -2
  41. package/dist/env/github.js +2 -2
  42. package/dist/env/helpers.js +1 -1
  43. package/dist/env/home.js +2 -2
  44. package/dist/env/locale.js +2 -2
  45. package/dist/env/node-auth-token.js +2 -2
  46. package/dist/env/node-env.js +2 -2
  47. package/dist/env/npm.js +2 -2
  48. package/dist/env/package-manager.js +2 -2
  49. package/dist/env/path.js +2 -2
  50. package/dist/env/pre-commit.js +3 -3
  51. package/dist/env/rewire.js +1 -1
  52. package/dist/env/shell.js +2 -2
  53. package/dist/env/socket-cli-shadow.js +3 -3
  54. package/dist/env/socket-cli.js +3 -3
  55. package/dist/env/socket.js +3 -3
  56. package/dist/env/temp-dir.js +2 -2
  57. package/dist/env/term.js +2 -2
  58. package/dist/env/test.js +4 -4
  59. package/dist/env/windows.js +2 -2
  60. package/dist/env/xdg.js +2 -2
  61. package/dist/env.js +1 -1
  62. package/dist/external/@inquirer/confirm.js +16 -15
  63. package/dist/external/@inquirer/input.js +16 -15
  64. package/dist/external/@inquirer/password.js +17 -16
  65. package/dist/external/@inquirer/search.js +18 -17
  66. package/dist/external/@inquirer/select.js +19 -18
  67. package/dist/external/@npmcli/package-json/lib/read-package.js +7 -1
  68. package/dist/external/@npmcli/package-json/lib/sort.js +6 -1
  69. package/dist/external/@npmcli/package-json.js +18 -0
  70. package/dist/external/@npmcli/promise-spawn.js +2 -1
  71. package/dist/external/@socketregistry/is-unicode-supported.js +2 -1
  72. package/dist/external/@socketregistry/packageurl-js.js +3 -2
  73. package/dist/external/@socketregistry/yocto-spinner.js +5 -4
  74. package/dist/external/@yarnpkg/extensions.js +2 -1
  75. package/dist/external/cacache.js +10 -9
  76. package/dist/external/debug.js +2 -5
  77. package/dist/external/del.js +3 -2
  78. package/dist/external/fast-glob.js +3 -2
  79. package/dist/external/fast-sort.js +2 -1
  80. package/dist/external/get-east-asian-width.js +2 -1
  81. package/dist/external/libnpmexec.js +6 -0
  82. package/dist/external/libnpmpack.js +64 -63
  83. package/dist/external/make-fetch-happen.js +16 -15
  84. package/dist/external/normalize-package-data.js +3 -2
  85. package/dist/external/npm-package-arg.js +3 -2
  86. package/dist/external/pacote.js +36 -35
  87. package/dist/external/picomatch.js +2 -1
  88. package/dist/external/semver.js +2 -1
  89. package/dist/external/spdx-correct.js +2 -1
  90. package/dist/external/spdx-expression-parse.js +2 -1
  91. package/dist/external/streaming-iterables.js +2 -1
  92. package/dist/external/validate-npm-package-name.js +2 -1
  93. package/dist/external/which.js +2 -1
  94. package/dist/external/yargs-parser.js +2 -1
  95. package/dist/external/yoctocolors-cjs.js +2 -1
  96. package/dist/external/zod.js +10 -9
  97. package/dist/fs.js +3 -3
  98. package/dist/functions.js +1 -1
  99. package/dist/git.js +2 -2
  100. package/dist/github.js +3 -3
  101. package/dist/globs.js +3 -3
  102. package/dist/http-request.js +1 -1
  103. package/dist/ipc.js +1 -1
  104. package/dist/json.js +1 -1
  105. package/dist/lifecycle-script-names.d.ts +2 -0
  106. package/dist/lifecycle-script-names.js +40 -0
  107. package/dist/links/index.js +1 -1
  108. package/dist/logger.d.ts +29 -4
  109. package/dist/logger.js +34 -5
  110. package/dist/maintained-node-versions.js +1 -1
  111. package/dist/memoization.js +1 -1
  112. package/dist/objects.js +2 -2
  113. package/dist/package-default-node-range.d.ts +2 -0
  114. package/dist/package-default-node-range.js +27 -0
  115. package/dist/package-default-socket-categories.d.ts +2 -0
  116. package/dist/package-default-socket-categories.js +25 -0
  117. package/dist/package-extensions.d.ts +2 -0
  118. package/dist/package-extensions.js +66 -0
  119. package/dist/packages/editable.js +1 -1
  120. package/dist/packages/exports.js +2 -2
  121. package/dist/packages/isolation.js +3 -3
  122. package/dist/packages/licenses.js +3 -3
  123. package/dist/packages/manifest.js +4 -4
  124. package/dist/packages/normalize.js +2 -2
  125. package/dist/packages/operations.js +6 -6
  126. package/dist/packages/paths.js +1 -1
  127. package/dist/packages/provenance.js +2 -2
  128. package/dist/packages/specs.js +1 -1
  129. package/dist/packages/validation.js +1 -1
  130. package/dist/packages.js +1 -1
  131. package/dist/path.js +2 -2
  132. package/dist/paths/rewire.js +1 -1
  133. package/dist/paths.js +15 -15
  134. package/dist/performance.js +1 -1
  135. package/dist/process-lock.js +1 -1
  136. package/dist/promise-queue.js +1 -1
  137. package/dist/promises.js +3 -3
  138. package/dist/regexps.js +1 -1
  139. package/dist/sea.js +1 -1
  140. package/dist/shadow.js +1 -1
  141. package/dist/signal-exit.js +1 -1
  142. package/dist/sorts.js +1 -1
  143. package/dist/spawn.js +2 -2
  144. package/dist/spinner.js +3 -3
  145. package/dist/ssri.js +1 -1
  146. package/dist/stdio/clear.js +1 -1
  147. package/dist/stdio/divider.js +1 -1
  148. package/dist/stdio/footer.js +1 -1
  149. package/dist/stdio/header.js +1 -1
  150. package/dist/stdio/mask.js +1 -1
  151. package/dist/stdio/progress.js +1 -1
  152. package/dist/stdio/prompts.js +2 -2
  153. package/dist/stdio/stderr.js +1 -1
  154. package/dist/stdio/stdout.js +1 -1
  155. package/dist/streams.js +1 -1
  156. package/dist/strings.js +1 -1
  157. package/dist/suppress-warnings.js +1 -1
  158. package/dist/tables.js +1 -1
  159. package/dist/temporary-executor.js +2 -2
  160. package/dist/themes/context.js +1 -1
  161. package/dist/themes/index.js +1 -1
  162. package/dist/themes/themes.js +1 -1
  163. package/dist/themes/types.js +1 -1
  164. package/dist/themes/utils.js +1 -1
  165. package/dist/types.js +1 -1
  166. package/dist/url.js +1 -1
  167. package/dist/utils/get-ipc.js +1 -1
  168. package/dist/validation/json-parser.js +1 -1
  169. package/dist/validation/types.js +1 -1
  170. package/dist/versions.js +1 -1
  171. package/dist/words.js +1 -1
  172. package/dist/zod.js +1 -1
  173. package/package.json +18 -2
  174. package/dist/abort.js.map +0 -7
  175. package/dist/agent.js.map +0 -7
  176. package/dist/ansi.js.map +0 -7
  177. package/dist/argv/flags.js.map +0 -7
  178. package/dist/argv/parse.js.map +0 -7
  179. package/dist/arrays.js.map +0 -7
  180. package/dist/bin.js.map +0 -7
  181. package/dist/cacache.js.map +0 -7
  182. package/dist/cache-with-ttl.js.map +0 -7
  183. package/dist/constants/agents.js.map +0 -7
  184. package/dist/constants/core.js.map +0 -7
  185. package/dist/constants/encoding.js.map +0 -7
  186. package/dist/constants/github.js.map +0 -7
  187. package/dist/constants/licenses.js.map +0 -7
  188. package/dist/constants/node.js.map +0 -7
  189. package/dist/constants/packages.js.map +0 -7
  190. package/dist/constants/paths.js.map +0 -7
  191. package/dist/constants/platform.js.map +0 -7
  192. package/dist/constants/process.js.map +0 -7
  193. package/dist/constants/socket.js.map +0 -7
  194. package/dist/constants/testing.js.map +0 -7
  195. package/dist/constants/time.js.map +0 -7
  196. package/dist/constants/typescript.js.map +0 -7
  197. package/dist/cover/code.js.map +0 -7
  198. package/dist/cover/formatters.js.map +0 -7
  199. package/dist/cover/type.js.map +0 -7
  200. package/dist/cover/types.js.map +0 -7
  201. package/dist/debug.js.map +0 -7
  202. package/dist/dlx-binary.js.map +0 -7
  203. package/dist/dlx-manifest.js.map +0 -7
  204. package/dist/dlx-package.js.map +0 -7
  205. package/dist/dlx.js.map +0 -7
  206. package/dist/effects/pulse-frames.js.map +0 -7
  207. package/dist/effects/text-shimmer.js.map +0 -7
  208. package/dist/effects/types.js.map +0 -7
  209. package/dist/effects/ultra.js.map +0 -7
  210. package/dist/env/ci.js.map +0 -7
  211. package/dist/env/debug.js.map +0 -7
  212. package/dist/env/github.js.map +0 -7
  213. package/dist/env/helpers.js.map +0 -7
  214. package/dist/env/home.js.map +0 -7
  215. package/dist/env/locale.js.map +0 -7
  216. package/dist/env/node-auth-token.js.map +0 -7
  217. package/dist/env/node-env.js.map +0 -7
  218. package/dist/env/npm.js.map +0 -7
  219. package/dist/env/package-manager.js.map +0 -7
  220. package/dist/env/path.js.map +0 -7
  221. package/dist/env/pre-commit.js.map +0 -7
  222. package/dist/env/rewire.js.map +0 -7
  223. package/dist/env/shell.js.map +0 -7
  224. package/dist/env/socket-cli-shadow.js.map +0 -7
  225. package/dist/env/socket-cli.js.map +0 -7
  226. package/dist/env/socket.js.map +0 -7
  227. package/dist/env/temp-dir.js.map +0 -7
  228. package/dist/env/term.js.map +0 -7
  229. package/dist/env/test.js.map +0 -7
  230. package/dist/env/windows.js.map +0 -7
  231. package/dist/env/xdg.js.map +0 -7
  232. package/dist/env.js.map +0 -7
  233. package/dist/external/@npmcli/package-json/index.js +0 -1
  234. package/dist/external/@socketregistry/is-unicode-supported.d.ts +0 -2
  235. package/dist/external/@socketregistry/yocto-spinner.d.ts +0 -12
  236. package/dist/external/@yarnpkg/extensions.d.ts +0 -4
  237. package/dist/external/cacache.d.ts +0 -86
  238. package/dist/external/debug.d.ts +0 -22
  239. package/dist/external/del.d.ts +0 -1
  240. package/dist/external/fast-sort.d.ts +0 -3
  241. package/dist/external/get-east-asian-width.d.ts +0 -5
  242. package/dist/external/libnpmexec.d.ts +0 -33
  243. package/dist/external/libnpmpack.d.ts +0 -2
  244. package/dist/external/make-fetch-happen.d.ts +0 -15
  245. package/dist/external/pacote.d.ts +0 -14
  246. package/dist/external/semver.d.ts +0 -2
  247. package/dist/external/yargs-parser.d.ts +0 -2
  248. package/dist/external/yoctocolors-cjs.d.ts +0 -52
  249. package/dist/external/zod.d.ts +0 -1
  250. package/dist/fs.js.map +0 -7
  251. package/dist/functions.js.map +0 -7
  252. package/dist/git.js.map +0 -7
  253. package/dist/github.js.map +0 -7
  254. package/dist/globs.js.map +0 -7
  255. package/dist/http-request.js.map +0 -7
  256. package/dist/ipc.js.map +0 -7
  257. package/dist/json.js.map +0 -7
  258. package/dist/links/index.js.map +0 -7
  259. package/dist/logger.js.map +0 -7
  260. package/dist/maintained-node-versions.js.map +0 -7
  261. package/dist/memoization.js.map +0 -7
  262. package/dist/objects.js.map +0 -7
  263. package/dist/packages/editable.js.map +0 -7
  264. package/dist/packages/exports.js.map +0 -7
  265. package/dist/packages/isolation.js.map +0 -7
  266. package/dist/packages/licenses.js.map +0 -7
  267. package/dist/packages/manifest.js.map +0 -7
  268. package/dist/packages/normalize.js.map +0 -7
  269. package/dist/packages/operations.js.map +0 -7
  270. package/dist/packages/paths.js.map +0 -7
  271. package/dist/packages/provenance.js.map +0 -7
  272. package/dist/packages/specs.js.map +0 -7
  273. package/dist/packages/validation.js.map +0 -7
  274. package/dist/packages.js.map +0 -7
  275. package/dist/path.js.map +0 -7
  276. package/dist/paths/rewire.js.map +0 -7
  277. package/dist/paths.js.map +0 -7
  278. package/dist/performance.js.map +0 -7
  279. package/dist/process-lock.js.map +0 -7
  280. package/dist/promise-queue.js.map +0 -7
  281. package/dist/promises.js.map +0 -7
  282. package/dist/regexps.js.map +0 -7
  283. package/dist/sea.js.map +0 -7
  284. package/dist/shadow.js.map +0 -7
  285. package/dist/signal-exit.js.map +0 -7
  286. package/dist/sorts.js.map +0 -7
  287. package/dist/spawn.js.map +0 -7
  288. package/dist/spinner.js.map +0 -7
  289. package/dist/ssri.js.map +0 -7
  290. package/dist/stdio/clear.js.map +0 -7
  291. package/dist/stdio/divider.js.map +0 -7
  292. package/dist/stdio/footer.js.map +0 -7
  293. package/dist/stdio/header.js.map +0 -7
  294. package/dist/stdio/mask.js.map +0 -7
  295. package/dist/stdio/progress.js.map +0 -7
  296. package/dist/stdio/prompts.js.map +0 -7
  297. package/dist/stdio/stderr.js.map +0 -7
  298. package/dist/stdio/stdout.js.map +0 -7
  299. package/dist/streams.js.map +0 -7
  300. package/dist/strings.js.map +0 -7
  301. package/dist/suppress-warnings.js.map +0 -7
  302. package/dist/tables.js.map +0 -7
  303. package/dist/temporary-executor.js.map +0 -7
  304. package/dist/themes/context.js.map +0 -7
  305. package/dist/themes/index.js.map +0 -7
  306. package/dist/themes/themes.js.map +0 -7
  307. package/dist/themes/types.js.map +0 -7
  308. package/dist/themes/utils.js.map +0 -7
  309. package/dist/types.js.map +0 -7
  310. package/dist/url.js.map +0 -7
  311. package/dist/utils/get-ipc.js.map +0 -7
  312. package/dist/validation/json-parser.js.map +0 -7
  313. package/dist/validation/types.js.map +0 -7
  314. package/dist/versions.js.map +0 -7
  315. package/dist/words.js.map +0 -7
  316. package/dist/zod.js.map +0 -7
@@ -1,65 +1,66 @@
1
+ "use strict";
1
2
  /**
2
3
  * Bundled from pacote
3
4
  * This is a zero-dependency bundle created by esbuild.
4
5
  */
5
- var xj=Object.create;var $u=Object.defineProperty;var Lj=Object.getOwnPropertyDescriptor;var Mj=Object.getOwnPropertyNames;var Bj=Object.getPrototypeOf,kj=Object.prototype.hasOwnProperty;var o=(i,e)=>$u(i,"name",{value:e,configurable:!0});var Fj=(i,e)=>()=>(i&&(e=i(i=0)),e);var d=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),Uj=(i,e)=>{for(var t in e)$u(i,t,{get:e[t],enumerable:!0})},jj=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Mj(e))!kj.call(i,s)&&s!==t&&$u(i,s,{get:()=>e[s],enumerable:!(r=Lj(e,s))||r.enumerable});return i};var $j=(i,e,t)=>(t=i!=null?xj(Bj(i)):{},jj(e||!i||!i.__esModule?$u(t,"default",{value:i,enumerable:!0}):t,i));var bm=d((Mue,FI)=>{"use strict";var qj=Symbol.for("indent"),Vj=Symbol.for("newline"),zj=`
6
- `,Hj=" ",Gj=/^\uFEFF/,Wj=/^\s*[{[]((?:\r?\n)+)([\s\t]*)/,Jj=/^(?:\{\}|\[\])((?:\r?\n)+)?$/,MI=/^Unexpected token '?(.)'?(,)? /i,Kj=o(i=>{let e=i.charCodeAt(0).toString(16).toUpperCase();return`0x${e.length%2?"0":""}${e}`},"hexify"),BI=o(i=>String(i).replace(Gj,""),"stripBOM"),_m=o((i,e,t=0)=>({message:`${i} while parsing ${e}`,position:t}),"makeParsedError"),Zj=o((i,e,t=20)=>{let r=i.message;if(!e)return _m(r,"empty string");let s=r.match(MI),n=r.match(/ position\s+(\d+)/i);s&&(r=r.replace(MI,`Unexpected token ${JSON.stringify(s[1])} (${Kj(s[1])})$2 `));let a;if(n?a=+n[1]:r.match(/^Unexpected end of JSON.*/i)&&(a=e.length-1),a==null)return _m(r,`'${e.slice(0,t*2)}'`);let c=a<=t?0:a-t,u=a+t>=e.length?e.length:a+t,l=`${c?"...":""}${e.slice(c,u)}${u===e.length?"":"..."}`;return _m(r,`${e===l?"":"near "}${JSON.stringify(l)}`,a)},"parseError"),qu=class extends SyntaxError{static{o(this,"JSONParseError")}constructor(e,t,r,s){let n=Zj(e,t,r);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}},kI=o((i,e)=>{let t=JSON.parse(i,e);if(t&&typeof t=="object"){let r=i.match(Jj)||i.match(Wj)||[null,"",""];t[Vj]=r[1]??zj,t[qj]=r[2]??Hj}return t},"parseJson"),Vu=o((i,e,t)=>{let r=BI(i);try{return kI(r,e)}catch(s){if(typeof i!="string"&&!Buffer.isBuffer(i)){let n=Array.isArray(i)&&i.length===0?"an empty array":String(i);throw Object.assign(new TypeError(`Cannot parse ${n}`),{code:"EJSONPARSE",systemError:s})}throw new qu(s,r,t,Vu)}},"parseJsonError");FI.exports=Vu;Vu.JSONParseError=qu;Vu.noExceptions=(i,e)=>{try{return kI(BI(i),e)}catch{}}});var $I=d((kue,jI)=>{var Im=new Set(["dependencies","optionalDependencies","devDependencies","peerDependencies"]),Yj=o(i=>{for(let e of Im)i&&i[e]&&(i[e]=Object.keys(i[e]).sort((t,r)=>t.localeCompare(r,"en")).reduce((t,r)=>(t[r]=i[e][r],t),{}));return i},"orderDeps"),UI=o(({content:i,originalContent:e})=>{let t=Yj({...i});if(t.dependencies&&t.optionalDependencies)for(let c of Object.keys(t.optionalDependencies))delete t.dependencies[c];let r={...e};for(let c of Im)t[c]&&(r[c]=t[c]),t[c]&&typeof t=="object"&&Object.keys(t[c]).length===0&&delete r[c];let{dependencies:s,peerDependencies:n}=e||{},{peerDependencies:a}=r;if(s&&n&&a)for(let c of Object.keys(n))s[c]!==void 0&&a[c]!==void 0&&(r.dependencies=r.dependencies||{},r.dependencies[c]=a[c]);return r},"updateDependencies");UI.knownKeys=Im;jI.exports=UI});var VI=d((Uue,qI)=>{var Xj=o(({content:i,originalContent:e={}})=>{let t=i.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");qI.exports=Xj});var HI=d(($ue,zI)=>{var Qj=o(({content:i,originalContent:e={}})=>{let t=i.workspaces;if(!t)return e;let r=o(()=>t.some(s=>typeof s!="string"),"hasInvalidWorkspaces");if(!t.length||r())throw Object.assign(new TypeError("workspaces should be an array of strings."),{code:"EWORKSPACESINVALID"});return{...e,workspaces:[...t]}},"updateWorkspaces");zI.exports=Qj});var ha=d((Vue,GI)=>{"use strict";var e$=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...i)=>{}:()=>{};GI.exports=e$});var fa=d((zue,WI)=>{"use strict";var t$="2.0.0",i$=Number.MAX_SAFE_INTEGER||9007199254740991,r$=16,s$=250,n$=["major","premajor","minor","preminor","patch","prepatch","prerelease"];WI.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:r$,MAX_SAFE_BUILD_LENGTH:s$,MAX_SAFE_INTEGER:i$,RELEASE_TYPES:n$,SEMVER_SPEC_VERSION:t$,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var cn=d((ii,JI)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Om,MAX_SAFE_BUILD_LENGTH:o$,MAX_LENGTH:a$}=fa(),c$=ha();ii=JI.exports={};var u$=ii.re=[],l$=ii.safeRe=[],R=ii.src=[],h$=ii.safeSrc=[],A=ii.t={},f$=0,vm="[a-zA-Z0-9-]",d$=[["\\s",1],["\\d",a$],[vm,o$]],p$=o(i=>{for(let[e,t]of d$)i=i.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return i},"makeSafeRegex"),B=o((i,e,t)=>{let r=p$(e),s=f$++;c$(i,s,e),A[i]=s,R[s]=e,h$[s]=r,u$[s]=new RegExp(e,t?"g":void 0),l$[s]=new RegExp(r,t?"g":void 0)},"createToken");B("NUMERICIDENTIFIER","0|[1-9]\\d*");B("NUMERICIDENTIFIERLOOSE","\\d+");B("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${vm}*`);B("MAINVERSION",`(${R[A.NUMERICIDENTIFIER]})\\.(${R[A.NUMERICIDENTIFIER]})\\.(${R[A.NUMERICIDENTIFIER]})`);B("MAINVERSIONLOOSE",`(${R[A.NUMERICIDENTIFIERLOOSE]})\\.(${R[A.NUMERICIDENTIFIERLOOSE]})\\.(${R[A.NUMERICIDENTIFIERLOOSE]})`);B("PRERELEASEIDENTIFIER",`(?:${R[A.NONNUMERICIDENTIFIER]}|${R[A.NUMERICIDENTIFIER]})`);B("PRERELEASEIDENTIFIERLOOSE",`(?:${R[A.NONNUMERICIDENTIFIER]}|${R[A.NUMERICIDENTIFIERLOOSE]})`);B("PRERELEASE",`(?:-(${R[A.PRERELEASEIDENTIFIER]}(?:\\.${R[A.PRERELEASEIDENTIFIER]})*))`);B("PRERELEASELOOSE",`(?:-?(${R[A.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${R[A.PRERELEASEIDENTIFIERLOOSE]})*))`);B("BUILDIDENTIFIER",`${vm}+`);B("BUILD",`(?:\\+(${R[A.BUILDIDENTIFIER]}(?:\\.${R[A.BUILDIDENTIFIER]})*))`);B("FULLPLAIN",`v?${R[A.MAINVERSION]}${R[A.PRERELEASE]}?${R[A.BUILD]}?`);B("FULL",`^${R[A.FULLPLAIN]}$`);B("LOOSEPLAIN",`[v=\\s]*${R[A.MAINVERSIONLOOSE]}${R[A.PRERELEASELOOSE]}?${R[A.BUILD]}?`);B("LOOSE",`^${R[A.LOOSEPLAIN]}$`);B("GTLT","((?:<|>)?=?)");B("XRANGEIDENTIFIERLOOSE",`${R[A.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);B("XRANGEIDENTIFIER",`${R[A.NUMERICIDENTIFIER]}|x|X|\\*`);B("XRANGEPLAIN",`[v=\\s]*(${R[A.XRANGEIDENTIFIER]})(?:\\.(${R[A.XRANGEIDENTIFIER]})(?:\\.(${R[A.XRANGEIDENTIFIER]})(?:${R[A.PRERELEASE]})?${R[A.BUILD]}?)?)?`);B("XRANGEPLAINLOOSE",`[v=\\s]*(${R[A.XRANGEIDENTIFIERLOOSE]})(?:\\.(${R[A.XRANGEIDENTIFIERLOOSE]})(?:\\.(${R[A.XRANGEIDENTIFIERLOOSE]})(?:${R[A.PRERELEASELOOSE]})?${R[A.BUILD]}?)?)?`);B("XRANGE",`^${R[A.GTLT]}\\s*${R[A.XRANGEPLAIN]}$`);B("XRANGELOOSE",`^${R[A.GTLT]}\\s*${R[A.XRANGEPLAINLOOSE]}$`);B("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Om}})(?:\\.(\\d{1,${Om}}))?(?:\\.(\\d{1,${Om}}))?`);B("COERCE",`${R[A.COERCEPLAIN]}(?:$|[^\\d])`);B("COERCEFULL",R[A.COERCEPLAIN]+`(?:${R[A.PRERELEASE]})?(?:${R[A.BUILD]})?(?:$|[^\\d])`);B("COERCERTL",R[A.COERCE],!0);B("COERCERTLFULL",R[A.COERCEFULL],!0);B("LONETILDE","(?:~>?)");B("TILDETRIM",`(\\s*)${R[A.LONETILDE]}\\s+`,!0);ii.tildeTrimReplace="$1~";B("TILDE",`^${R[A.LONETILDE]}${R[A.XRANGEPLAIN]}$`);B("TILDELOOSE",`^${R[A.LONETILDE]}${R[A.XRANGEPLAINLOOSE]}$`);B("LONECARET","(?:\\^)");B("CARETTRIM",`(\\s*)${R[A.LONECARET]}\\s+`,!0);ii.caretTrimReplace="$1^";B("CARET",`^${R[A.LONECARET]}${R[A.XRANGEPLAIN]}$`);B("CARETLOOSE",`^${R[A.LONECARET]}${R[A.XRANGEPLAINLOOSE]}$`);B("COMPARATORLOOSE",`^${R[A.GTLT]}\\s*(${R[A.LOOSEPLAIN]})$|^$`);B("COMPARATOR",`^${R[A.GTLT]}\\s*(${R[A.FULLPLAIN]})$|^$`);B("COMPARATORTRIM",`(\\s*)${R[A.GTLT]}\\s*(${R[A.LOOSEPLAIN]}|${R[A.XRANGEPLAIN]})`,!0);ii.comparatorTrimReplace="$1$2$3";B("HYPHENRANGE",`^\\s*(${R[A.XRANGEPLAIN]})\\s+-\\s+(${R[A.XRANGEPLAIN]})\\s*$`);B("HYPHENRANGELOOSE",`^\\s*(${R[A.XRANGEPLAINLOOSE]})\\s+-\\s+(${R[A.XRANGEPLAINLOOSE]})\\s*$`);B("STAR","(<|>)?=?\\s*\\*");B("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");B("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var zu=d((Gue,KI)=>{"use strict";var m$=Object.freeze({loose:!0}),g$=Object.freeze({}),y$=o(i=>i?typeof i!="object"?m$:i:g$,"parseOptions");KI.exports=y$});var Rm=d((Jue,XI)=>{"use strict";var ZI=/^[0-9]+$/,YI=o((i,e)=>{let t=ZI.test(i),r=ZI.test(e);return t&&r&&(i=+i,e=+e),i===e?0:t&&!r?-1:r&&!t?1:i<e?-1:1},"compareIdentifiers"),S$=o((i,e)=>YI(e,i),"rcompareIdentifiers");XI.exports={compareIdentifiers:YI,rcompareIdentifiers:S$}});var De=d((Zue,eO)=>{"use strict";var Hu=ha(),{MAX_LENGTH:QI,MAX_SAFE_INTEGER:Gu}=fa(),{safeRe:Wu,t:Ju}=cn(),E$=zu(),{compareIdentifiers:un}=Rm(),Am=class i{static{o(this,"SemVer")}constructor(e,t){if(t=E$(t),e instanceof i){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>QI)throw new TypeError(`version is longer than ${QI} characters`);Hu("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?Wu[Ju.LOOSE]:Wu[Ju.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Gu||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Gu||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Gu||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){let n=+s;if(n>=0&&n<Gu)return n}return s}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Hu("SemVer.compare",this.version,this.options,e),!(e instanceof i)){if(typeof e=="string"&&e===this.version)return 0;e=new i(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof i||(e=new i(e,this.options)),un(this.major,e.major)||un(this.minor,e.minor)||un(this.patch,e.patch)}comparePre(e){if(e instanceof i||(e=new i(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],s=e.prerelease[t];if(Hu("prerelease compare",t,r,s),r===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(r===void 0)return-1;if(r===s)continue;return un(r,s)}while(++t)}compareBuild(e){e instanceof i||(e=new i(e,this.options));let t=0;do{let r=this.build[t],s=e.build[t];if(Hu("build compare",t,r,s),r===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(r===void 0)return-1;if(r===s)continue;return un(r,s)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(t){let s=`-${t}`.match(this.options.loose?Wu[Ju.PRERELEASELOOSE]:Wu[Ju.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,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let s=Number(r)?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(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(t){let n=[t,s];r===!1&&(n=[t]),un(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}};eO.exports=Am});var ns=d((Xue,iO)=>{"use strict";var tO=De(),w$=o((i,e,t=!1)=>{if(i instanceof tO)return i;try{return new tO(i,e)}catch(r){if(!t)return null;throw r}},"parse");iO.exports=w$});var Tm=d((ele,rO)=>{"use strict";var _$=ns(),b$=o((i,e)=>{let t=_$(i,e);return t?t.version:null},"valid");rO.exports=b$});var Cm=d((ile,sO)=>{"use strict";var I$=ns(),O$=o((i,e)=>{let t=I$(i.trim().replace(/^[=v]+/,""),e);return t?t.version:null},"clean");sO.exports=O$});var St=d((sle,nO)=>{var v$=Symbol("proc-log.meta");nO.exports={META:v$,output:{LEVELS:["standard","error","buffer","flush"],KEYS:{standard:"standard",error:"error",buffer:"buffer",flush:"flush"},standard:o(function(...i){return process.emit("output","standard",...i)},"standard"),error:o(function(...i){return process.emit("output","error",...i)},"error"),buffer:o(function(...i){return process.emit("output","buffer",...i)},"buffer"),flush:o(function(...i){return process.emit("output","flush",...i)},"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(...i){return process.emit("log","error",...i)},"error"),notice:o(function(...i){return process.emit("log","notice",...i)},"notice"),warn:o(function(...i){return process.emit("log","warn",...i)},"warn"),info:o(function(...i){return process.emit("log","info",...i)},"info"),verbose:o(function(...i){return process.emit("log","verbose",...i)},"verbose"),http:o(function(...i){return process.emit("log","http",...i)},"http"),silly:o(function(...i){return process.emit("log","silly",...i)},"silly"),timing:o(function(...i){return process.emit("log","timing",...i)},"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(i,e){process.emit("time","start",i);function t(){return process.emit("time","end",i)}if(o(t,"end"),typeof e=="function"){let r=e();return r&&r.finally?r.finally(t):(t(),r)}return t},"start"),end:o(function(i){return process.emit("time","end",i)},"end")},input:{LEVELS:["start","end","read"],KEYS:{start:"start",end:"end",read:"read"},start:o(function(i){process.emit("input","start");function e(){return process.emit("input","end")}if(o(e,"end"),typeof i=="function"){let t=i();return t&&t.finally?t.finally(e):(e(),t)}return e},"start"),end:o(function(){return process.emit("input","end")},"end"),read:o(function(...i){let e,t,r=new Promise((s,n)=>{e=s,t=n});return process.emit("input","read",e,t,...i),r},"read")}}});var os=d(Zu=>{"use strict";Object.defineProperty(Zu,"__esModule",{value:!0});Zu.LRUCache=void 0;var R$=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,aO=new Set,Nm=typeof process=="object"&&process?process:{},cO=o((i,e,t,r)=>{typeof Nm.emitWarning=="function"&&Nm.emitWarning(i,e,t,r)},"emitWarning"),Ku=globalThis.AbortController,oO=globalThis.AbortSignal;if(typeof Ku>"u"){oO=class{static{o(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,s){this._onabort.push(s)}},Ku=class{static{o(this,"AbortController")}constructor(){e()}signal=new oO;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let s of this.signal._onabort)s(r);this.signal.onabort?.(r)}}};let i=Nm.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=o(()=>{i&&(i=!1,cO("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 A$=o(i=>!aO.has(i),"shouldWarn"),cle=Symbol("type"),fr=o(i=>i&&i===Math.floor(i)&&i>0&&isFinite(i),"isPosInt"),uO=o(i=>fr(i)?i<=Math.pow(2,8)?Uint8Array:i<=Math.pow(2,16)?Uint16Array:i<=Math.pow(2,32)?Uint32Array:i<=Number.MAX_SAFE_INTEGER?ln:null:null,"getUintArray"),ln=class extends Array{static{o(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},Pm=class i{static{o(this,"Stack")}heap;length;static#e=!1;static create(e){let t=uO(e);if(!t)return[];i.#e=!0;let r=new i(e,t);return i.#e=!1,r}constructor(e,t){if(!i.#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]}},Dm=class i{static{o(this,"LRUCache")}#e;#t;#i;#r;#s;#u;#c;#f;get perf(){return this.#f}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#n;#h;#o;#d;#a;#p;#y;#_;#m;#A;#w;#b;#v;#I;#E;#N;#O;#l;static unsafeExposeInternals(e){return{starts:e.#v,ttls:e.#I,sizes:e.#b,keyMap:e.#o,keyList:e.#d,valList:e.#a,next:e.#p,prev:e.#y,get head(){return e.#_},get tail(){return e.#m},free:e.#A,isBackgroundFetch:o(t=>e.#g(t),"isBackgroundFetch"),backgroundFetch:o((t,r,s,n)=>e.#j(t,r,s,n),"backgroundFetch"),moveToTail:o(t=>e.#V(t),"moveToTail"),indexes:o(t=>e.#D(t),"indexes"),rindexes:o(t=>e.#L(t),"rindexes"),isStale:o(t=>e.#T(t),"isStale")}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#h}get size(){return this.#n}get fetchMethod(){return this.#u}get memoMethod(){return this.#c}get dispose(){return this.#i}get onInsert(){return this.#r}get disposeAfter(){return this.#s}constructor(e){let{max:t=0,ttl:r,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:a,updateAgeOnHas:c,allowStale:u,dispose:l,onInsert:h,disposeAfter:f,noDisposeOnSet:p,noUpdateTTL:m,maxSize:y=0,maxEntrySize:g=0,sizeCalculation:S,fetchMethod:E,memoMethod:_,noDeleteOnFetchRejection:b,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:I,allowStaleOnFetchAbort:v,ignoreFetchAbort:N,perf:P}=e;if(P!==void 0&&typeof P?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#f=P??R$,t!==0&&!fr(t))throw new TypeError("max option must be a nonnegative integer");let $=t?uO(t):Array;if(!$)throw new Error("invalid max value: "+t);if(this.#e=t,this.#t=y,this.maxEntrySize=g||this.#t,this.sizeCalculation=S,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(_!==void 0&&typeof _!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#c=_,E!==void 0&&typeof E!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#u=E,this.#N=!!E,this.#o=new Map,this.#d=new Array(t).fill(void 0),this.#a=new Array(t).fill(void 0),this.#p=new $(t),this.#y=new $(t),this.#_=0,this.#m=0,this.#A=Pm.create(t),this.#n=0,this.#h=0,typeof l=="function"&&(this.#i=l),typeof h=="function"&&(this.#r=h),typeof f=="function"?(this.#s=f,this.#w=[]):(this.#s=void 0,this.#w=void 0),this.#E=!!this.#i,this.#l=!!this.#r,this.#O=!!this.#s,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!b,this.allowStaleOnFetchRejection=!!I,this.allowStaleOnFetchAbort=!!v,this.ignoreFetchAbort=!!N,this.maxEntrySize!==0){if(this.#t!==0&&!fr(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!fr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#$()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!c,this.ttlResolution=fr(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=r||0,this.ttl){if(!fr(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 ee="LRU_CACHE_UNBOUNDED";A$(ee)&&(aO.add(ee),cO("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ee,i))}}getRemainingTTL(e){return this.#o.has(e)?1/0:0}#B(){let e=new ln(this.#e),t=new ln(this.#e);this.#I=e,this.#v=t,this.#k=(n,a,c=this.#f.now())=>{if(t[n]=a!==0?c:0,e[n]=a,a!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#T(n)&&this.#M(this.#d[n],"expire")},a+1);u.unref&&u.unref()}},this.#R=n=>{t[n]=e[n]!==0?this.#f.now():0},this.#C=(n,a)=>{if(e[a]){let c=e[a],u=t[a];if(!c||!u)return;n.ttl=c,n.start=u,n.now=r||s();let l=n.now-u;n.remainingTTL=c-l}};let r=0,s=o(()=>{let n=this.#f.now();if(this.ttlResolution>0){r=n;let a=setTimeout(()=>r=0,this.ttlResolution);a.unref&&a.unref()}return n},"getNow");this.getRemainingTTL=n=>{let a=this.#o.get(n);if(a===void 0)return 0;let c=e[a],u=t[a];if(!c||!u)return 1/0;let l=(r||s())-u;return c-l},this.#T=n=>{let a=t[n],c=e[n];return!!c&&!!a&&(r||s())-a>c}}#R=o(()=>{},"#updateItemAge");#C=o(()=>{},"#statusTTL");#k=o(()=>{},"#setItemTTL");#T=o(()=>!1,"#isStale");#$(){let e=new ln(this.#e);this.#h=0,this.#b=e,this.#P=t=>{this.#h-=e[t],e[t]=0},this.#F=(t,r,s,n)=>{if(this.#g(r))return 0;if(!fr(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(r,t),!fr(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.#x=(t,r,s)=>{if(e[t]=r,this.#t){let n=this.#t-e[t];for(;this.#h>n;)this.#U(!0)}this.#h+=e[t],s&&(s.entrySize=r,s.totalCalculatedSize=this.#h)}}#P=o(e=>{},"#removeItemSize");#x=o((e,t,r)=>{},"#addItemSize");#F=o((e,t,r,s)=>{if(r||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#D({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#m;!(!this.#S(t)||((e||!this.#T(t))&&(yield t),t===this.#_));)t=this.#y[t]}*#L({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#_;!(!this.#S(t)||((e||!this.#T(t))&&(yield t),t===this.#m));)t=this.#p[t]}#S(e){return e!==void 0&&this.#o.get(this.#d[e])===e}*entries(){for(let e of this.#D())this.#a[e]!==void 0&&this.#d[e]!==void 0&&!this.#g(this.#a[e])&&(yield[this.#d[e],this.#a[e]])}*rentries(){for(let e of this.#L())this.#a[e]!==void 0&&this.#d[e]!==void 0&&!this.#g(this.#a[e])&&(yield[this.#d[e],this.#a[e]])}*keys(){for(let e of this.#D()){let t=this.#d[e];t!==void 0&&!this.#g(this.#a[e])&&(yield t)}}*rkeys(){for(let e of this.#L()){let t=this.#d[e];t!==void 0&&!this.#g(this.#a[e])&&(yield t)}}*values(){for(let e of this.#D())this.#a[e]!==void 0&&!this.#g(this.#a[e])&&(yield this.#a[e])}*rvalues(){for(let e of this.#L())this.#a[e]!==void 0&&!this.#g(this.#a[e])&&(yield this.#a[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#D()){let s=this.#a[r],n=this.#g(s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,this.#d[r],this))return this.get(this.#d[r],t)}}forEach(e,t=this){for(let r of this.#D()){let s=this.#a[r],n=this.#g(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#d[r],this)}}rforEach(e,t=this){for(let r of this.#L()){let s=this.#a[r],n=this.#g(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#d[r],this)}}purgeStale(){let e=!1;for(let t of this.#L({allowStale:!0}))this.#T(t)&&(this.#M(this.#d[t],"expire"),e=!0);return e}info(e){let t=this.#o.get(e);if(t===void 0)return;let r=this.#a[t],s=this.#g(r)?r.__staleWhileFetching:r;if(s===void 0)return;let n={value:s};if(this.#I&&this.#v){let a=this.#I[t],c=this.#v[t];if(a&&c){let u=a-(this.#f.now()-c);n.ttl=u,n.start=Date.now()}}return this.#b&&(n.size=this.#b[t]),n}dump(){let e=[];for(let t of this.#D({allowStale:!0})){let r=this.#d[t],s=this.#a[t],n=this.#g(s)?s.__staleWhileFetching:s;if(n===void 0||r===void 0)continue;let a={value:n};if(this.#I&&this.#v){a.ttl=this.#I[t];let c=this.#f.now()-this.#v[t];a.start=Math.floor(Date.now()-c)}this.#b&&(a.size=this.#b[t]),e.unshift([r,a])}return e}load(e){this.clear();for(let[t,r]of e){if(r.start){let s=Date.now()-r.start;r.start=this.#f.now()-s}this.set(t,r.value,r)}}set(e,t,r={}){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:u}=r,{noUpdateTTL:l=this.noUpdateTTL}=r,h=this.#F(e,t,r.size||0,c);if(this.maxEntrySize&&h>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#M(e,"set"),this;let f=this.#n===0?void 0:this.#o.get(e);if(f===void 0)f=this.#n===0?this.#m:this.#A.length!==0?this.#A.pop():this.#n===this.#e?this.#U(!1):this.#n,this.#d[f]=e,this.#a[f]=t,this.#o.set(e,f),this.#p[this.#m]=f,this.#y[f]=this.#m,this.#m=f,this.#n++,this.#x(f,h,u),u&&(u.set="add"),l=!1,this.#l&&this.#r?.(t,e,"add");else{this.#V(f);let p=this.#a[f];if(t!==p){if(this.#N&&this.#g(p)){p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=p;m!==void 0&&!a&&(this.#E&&this.#i?.(m,e,"set"),this.#O&&this.#w?.push([m,e,"set"]))}else a||(this.#E&&this.#i?.(p,e,"set"),this.#O&&this.#w?.push([p,e,"set"]));if(this.#P(f),this.#x(f,h,u),this.#a[f]=t,u){u.set="replace";let m=p&&this.#g(p)?p.__staleWhileFetching:p;m!==void 0&&(u.oldValue=m)}}else u&&(u.set="update");this.#l&&this.onInsert?.(t,e,t===p?"update":"replace")}if(s!==0&&!this.#I&&this.#B(),this.#I&&(l||this.#k(f,s,n),u&&this.#C(u,f)),!a&&this.#O&&this.#w){let p=this.#w,m;for(;m=p?.shift();)this.#s?.(...m)}return this}pop(){try{for(;this.#n;){let e=this.#a[this.#_];if(this.#U(!0),this.#g(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#O&&this.#w){let e=this.#w,t;for(;t=e?.shift();)this.#s?.(...t)}}}#U(e){let t=this.#_,r=this.#d[t],s=this.#a[t];return this.#N&&this.#g(s)?s.__abortController.abort(new Error("evicted")):(this.#E||this.#O)&&(this.#E&&this.#i?.(s,r,"evict"),this.#O&&this.#w?.push([s,r,"evict"])),this.#P(t),e&&(this.#d[t]=void 0,this.#a[t]=void 0,this.#A.push(t)),this.#n===1?(this.#_=this.#m=0,this.#A.length=0):this.#_=this.#p[t],this.#o.delete(r),this.#n--,t}has(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:s}=t,n=this.#o.get(e);if(n!==void 0){let a=this.#a[n];if(this.#g(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#T(n))s&&(s.has="stale",this.#C(s,n));else return r&&this.#R(n),s&&(s.has="hit",this.#C(s,n)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{allowStale:r=this.allowStale}=t,s=this.#o.get(e);if(s===void 0||!r&&this.#T(s))return;let n=this.#a[s];return this.#g(n)?n.__staleWhileFetching:n}#j(e,t,r,s){let n=t===void 0?void 0:this.#a[t];if(this.#g(n))return n;let a=new Ku,{signal:c}=r;c?.addEventListener("abort",()=>a.abort(c.reason),{signal:a.signal});let u={signal:a.signal,options:r,context:s},l=o((g,S=!1)=>{let{aborted:E}=a.signal,_=r.ignoreFetchAbort&&g!==void 0;if(r.status&&(E&&!S?(r.status.fetchAborted=!0,r.status.fetchError=a.signal.reason,_&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),E&&!_&&!S)return f(a.signal.reason);let b=m,w=this.#a[t];return(w===m||_&&S&&w===void 0)&&(g===void 0?b.__staleWhileFetching!==void 0?this.#a[t]=b.__staleWhileFetching:this.#M(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,g,u.options))),g},"cb"),h=o(g=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=g),f(g)),"eb"),f=o(g=>{let{aborted:S}=a.signal,E=S&&r.allowStaleOnFetchAbort,_=E||r.allowStaleOnFetchRejection,b=_||r.noDeleteOnFetchRejection,w=m;if(this.#a[t]===m&&(!b||w.__staleWhileFetching===void 0?this.#M(e,"fetch"):E||(this.#a[t]=w.__staleWhileFetching)),_)return r.status&&w.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),w.__staleWhileFetching;if(w.__returned===w)throw g},"fetchFail"),p=o((g,S)=>{let E=this.#u?.(e,n,u);E&&E instanceof Promise&&E.then(_=>g(_===void 0?void 0:_),S),a.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(g(void 0),r.allowStaleOnFetchAbort&&(g=o(_=>l(_,!0),"res")))})},"pcall");r.status&&(r.status.fetchDispatched=!0);let m=new Promise(p).then(l,h),y=Object.assign(m,{__abortController:a,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,y,{...u.options,status:void 0}),t=this.#o.get(e)):this.#a[t]=y,y}#g(e){if(!this.#N)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Ku}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:u=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:h=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:m=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:g,forceRefresh:S=!1,status:E,signal:_}=t;if(!this.#N)return E&&(E.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:E});let b={allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:a,noDisposeOnSet:c,size:u,sizeCalculation:l,noUpdateTTL:h,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:y,ignoreFetchAbort:m,status:E,signal:_},w=this.#o.get(e);if(w===void 0){E&&(E.fetch="miss");let I=this.#j(e,w,b,g);return I.__returned=I}else{let I=this.#a[w];if(this.#g(I)){let ee=r&&I.__staleWhileFetching!==void 0;return E&&(E.fetch="inflight",ee&&(E.returnedStale=!0)),ee?I.__staleWhileFetching:I.__returned=I}let v=this.#T(w);if(!S&&!v)return E&&(E.fetch="hit"),this.#V(w),s&&this.#R(w),E&&this.#C(E,w),I;let N=this.#j(e,w,b,g),$=N.__staleWhileFetching!==void 0&&r;return E&&(E.fetch=v?"stale":"refresh",$&&v&&(E.returnedStale=!0)),$?N.__staleWhileFetching:N.__returned=N}}async forceFetch(e,t={}){let r=await this.fetch(e,t);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,t={}){let r=this.#c;if(!r)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 u=r(e,c,{options:a,context:s});return this.set(e,u,a),u}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:a}=t,c=this.#o.get(e);if(c!==void 0){let u=this.#a[c],l=this.#g(u);return a&&this.#C(a,c),this.#T(c)?(a&&(a.get="stale"),l?(a&&r&&u.__staleWhileFetching!==void 0&&(a.returnedStale=!0),r?u.__staleWhileFetching:void 0):(n||this.#M(e,"expire"),a&&r&&(a.returnedStale=!0),r?u:void 0)):(a&&(a.get="hit"),l?u.__staleWhileFetching:(this.#V(c),s&&this.#R(c),u))}else a&&(a.get="miss")}#q(e,t){this.#y[t]=e,this.#p[e]=t}#V(e){e!==this.#m&&(e===this.#_?this.#_=this.#p[e]:this.#q(this.#y[e],this.#p[e]),this.#q(this.#m,e),this.#m=e)}delete(e){return this.#M(e,"delete")}#M(e,t){let r=!1;if(this.#n!==0){let s=this.#o.get(e);if(s!==void 0)if(r=!0,this.#n===1)this.#z(t);else{this.#P(s);let n=this.#a[s];if(this.#g(n)?n.__abortController.abort(new Error("deleted")):(this.#E||this.#O)&&(this.#E&&this.#i?.(n,e,t),this.#O&&this.#w?.push([n,e,t])),this.#o.delete(e),this.#d[s]=void 0,this.#a[s]=void 0,s===this.#m)this.#m=this.#y[s];else if(s===this.#_)this.#_=this.#p[s];else{let a=this.#y[s];this.#p[a]=this.#p[s];let c=this.#p[s];this.#y[c]=this.#y[s]}this.#n--,this.#A.push(s)}}if(this.#O&&this.#w?.length){let s=this.#w,n;for(;n=s?.shift();)this.#s?.(...n)}return r}clear(){return this.#z("delete")}#z(e){for(let t of this.#L({allowStale:!0})){let r=this.#a[t];if(this.#g(r))r.__abortController.abort(new Error("deleted"));else{let s=this.#d[t];this.#E&&this.#i?.(r,s,e),this.#O&&this.#w?.push([r,s,e])}}if(this.#o.clear(),this.#a.fill(void 0),this.#d.fill(void 0),this.#I&&this.#v&&(this.#I.fill(0),this.#v.fill(0)),this.#b&&this.#b.fill(0),this.#_=0,this.#m=0,this.#A.length=0,this.#h=0,this.#n=0,this.#O&&this.#w){let t=this.#w,r;for(;r=t?.shift();)this.#s?.(...r)}}};Zu.LRUCache=Dm});var fO=d((hle,hO)=>{"use strict";var G=o((...i)=>i.every(e=>e)?i.join(""):"","maybeJoin"),ge=o(i=>i?encodeURIComponent(i):"","maybeEncode"),lO=o(i=>i.toLowerCase().replace(/^\W+/g,"").replace(/(?<!\W)\W+$/,"").replace(/\//g,"").replace(/\W+/g,"-"),"formatHashFragment"),T$={sshtemplate:o(({domain:i,user:e,project:t,committish:r})=>`git@${i}:${e}/${t}.git${G("#",r)}`,"sshtemplate"),sshurltemplate:o(({domain:i,user:e,project:t,committish:r})=>`git+ssh://git@${i}/${e}/${t}.git${G("#",r)}`,"sshurltemplate"),edittemplate:o(({domain:i,user:e,project:t,committish:r,editpath:s,path:n})=>`https://${i}/${e}/${t}${G("/",s,"/",ge(r||"HEAD"),"/",n)}`,"edittemplate"),browsetemplate:o(({domain:i,user:e,project:t,committish:r,treepath:s})=>`https://${i}/${e}/${t}${G("/",s,"/",ge(r))}`,"browsetemplate"),browsetreetemplate:o(({domain:i,user:e,project:t,committish:r,treepath:s,path:n,fragment:a,hashformat:c})=>`https://${i}/${e}/${t}/${s}/${ge(r||"HEAD")}/${n}${G("#",c(a||""))}`,"browsetreetemplate"),browseblobtemplate:o(({domain:i,user:e,project:t,committish:r,blobpath:s,path:n,fragment:a,hashformat:c})=>`https://${i}/${e}/${t}/${s}/${ge(r||"HEAD")}/${n}${G("#",c(a||""))}`,"browseblobtemplate"),docstemplate:o(({domain:i,user:e,project:t,treepath:r,committish:s})=>`https://${i}/${e}/${t}${G("/",r,"/",ge(s))}#readme`,"docstemplate"),httpstemplate:o(({auth:i,domain:e,user:t,project:r,committish:s})=>`git+https://${G(i,"@")}${e}/${t}/${r}.git${G("#",s)}`,"httpstemplate"),filetemplate:o(({domain:i,user:e,project:t,committish:r,path:s})=>`https://${i}/${e}/${t}/raw/${ge(r||"HEAD")}/${s}`,"filetemplate"),shortcuttemplate:o(({type:i,user:e,project:t,committish:r})=>`${i}:${e}/${t}${G("#",r)}`,"shortcuttemplate"),pathtemplate:o(({user:i,project:e,committish:t})=>`${i}/${e}${G("#",t)}`,"pathtemplate"),bugstemplate:o(({domain:i,user:e,project:t})=>`https://${i}/${e}/${t}/issues`,"bugstemplate"),hashformat:lO},dr={};dr.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:o(({auth:i,user:e,project:t,committish:r,path:s})=>`https://${G(i,"@")}raw.githubusercontent.com/${e}/${t}/${ge(r||"HEAD")}/${s}`,"filetemplate"),gittemplate:o(({auth:i,domain:e,user:t,project:r,committish:s})=>`git://${G(i,"@")}${e}/${t}/${r}.git${G("#",s)}`,"gittemplate"),tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://codeload.${i}/${e}/${t}/tar.gz/${ge(r||"HEAD")}`,"tarballtemplate"),extract:o(i=>{let[,e,t,r,s]=i.pathname.split("/",5);if(!(r&&r!=="tree")&&(r||(s=i.hash.slice(1)),t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:s}},"extract")};dr.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:o(({domain:i,user:e,project:t,committish:r,treepath:s,path:n,editpath:a})=>`https://${i}/${e}/${t}${G("/",s,"/",ge(r||"HEAD"),"/",n,a)}`,"edittemplate"),tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}/get/${ge(r||"HEAD")}.tar.gz`,"tarballtemplate"),extract:o(i=>{let[,e,t,r]=i.pathname.split("/",4);if(!["get"].includes(r)&&(t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:i.hash.slice(1)}},"extract")};dr.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}/repository/archive.tar.gz?ref=${ge(r||"HEAD")}`,"tarballtemplate"),extract:o(i=>{let e=i.pathname.slice(1);if(e.includes("/-/")||e.includes("/archive.tar.gz"))return;let t=e.split("/"),r=t.pop();r.endsWith(".git")&&(r=r.slice(0,-4));let s=t.join("/");if(!(!s||!r))return{user:s,project:r,committish:i.hash.slice(1)}},"extract")};dr.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:o(({domain:i,project:e,committish:t})=>`git@${i}:${e}.git${G("#",t)}`,"sshtemplate"),sshurltemplate:o(({domain:i,project:e,committish:t})=>`git+ssh://git@${i}/${e}.git${G("#",t)}`,"sshurltemplate"),edittemplate:o(({domain:i,user:e,project:t,committish:r,editpath:s})=>`https://${i}/${e}/${t}${G("/",ge(r))}/${s}`,"edittemplate"),browsetemplate:o(({domain:i,project:e,committish:t})=>`https://${i}/${e}${G("/",ge(t))}`,"browsetemplate"),browsetreetemplate:o(({domain:i,project:e,committish:t,path:r,hashformat:s})=>`https://${i}/${e}${G("/",ge(t))}${G("#",s(r))}`,"browsetreetemplate"),browseblobtemplate:o(({domain:i,project:e,committish:t,path:r,hashformat:s})=>`https://${i}/${e}${G("/",ge(t))}${G("#",s(r))}`,"browseblobtemplate"),docstemplate:o(({domain:i,project:e,committish:t})=>`https://${i}/${e}${G("/",ge(t))}`,"docstemplate"),httpstemplate:o(({domain:i,project:e,committish:t})=>`git+https://${i}/${e}.git${G("#",t)}`,"httpstemplate"),filetemplate:o(({user:i,project:e,committish:t,path:r})=>`https://gist.githubusercontent.com/${i}/${e}/raw${G("/",ge(t))}/${r}`,"filetemplate"),shortcuttemplate:o(({type:i,project:e,committish:t})=>`${i}:${e}${G("#",t)}`,"shortcuttemplate"),pathtemplate:o(({project:i,committish:e})=>`${i}${G("#",e)}`,"pathtemplate"),bugstemplate:o(({domain:i,project:e})=>`https://${i}/${e}`,"bugstemplate"),gittemplate:o(({domain:i,project:e,committish:t})=>`git://${i}/${e}.git${G("#",t)}`,"gittemplate"),tarballtemplate:o(({project:i,committish:e})=>`https://codeload.github.com/gist/${i}/tar.gz/${ge(e||"HEAD")}`,"tarballtemplate"),extract:o(i=>{let[,e,t,r]=i.pathname.split("/",4);if(r!=="raw"){if(!t){if(!e)return;t=e,e=null}return t.endsWith(".git")&&(t=t.slice(0,-4)),{user:e,project:t,committish:i.hash.slice(1)}}},"extract"),hashformat:o(function(i){return i&&"file-"+lO(i)},"hashformat")};dr.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:o(({domain:i,user:e,project:t,committish:r,path:s})=>`https://${i}/${e}/${t}/blob/${ge(r)||"HEAD"}/${s}`,"filetemplate"),httpstemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}.git${G("#",r)}`,"httpstemplate"),tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}/archive/${ge(r)||"HEAD"}.tar.gz`,"tarballtemplate"),bugstemplate:o(()=>null,"bugstemplate"),extract:o(i=>{let[,e,t,r]=i.pathname.split("/",4);if(!["archive"].includes(r)&&(t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:i.hash.slice(1)}},"extract")};for(let[i,e]of Object.entries(dr))dr[i]=Object.assign({},T$,e);hO.exports=dr});var Lm=d((dle,pO)=>{var C$=require("url"),xm=o((i,e,t)=>{let r=i.indexOf(t);return i.lastIndexOf(e,r>-1?r:1/0)},"lastIndexOfBefore"),dO=o(i=>{try{return new C$.URL(i)}catch{}},"safeUrl"),N$=o((i,e)=>{let t=i.indexOf(":"),r=i.slice(0,t+1);if(Object.prototype.hasOwnProperty.call(e,r)||i.substr(t,3)==="://")return i;let s=i.indexOf("@");return s>-1?s>t?`git+ssh://${i}`:i:`${i.slice(0,t+1)}//${i.slice(t+1)}`},"correctProtocol"),P$=o(i=>{let e=xm(i,"@","#"),t=xm(i,":","#");return t>e&&(i=i.slice(0,t)+"/"+i.slice(t+1)),xm(i,":","#")===-1&&i.indexOf("//")===-1&&(i=`git+ssh://${i}`),i},"correctUrl");pO.exports=(i,e)=>{let t=e?N$(i,e):i;return dO(t)||dO(P$(t))}});var gO=d((mle,mO)=>{"use strict";var D$=Lm(),x$=o(i=>{let e=i.indexOf("#"),t=i.indexOf("/"),r=i.indexOf("/",t+1),s=i.indexOf(":"),n=/\s/.exec(i),a=i.indexOf("@"),c=!n||e>-1&&n.index>e,u=a===-1||e>-1&&a>e,l=s===-1||e>-1&&s>e,h=r===-1||e>-1&&r>e,f=t>0,p=e>-1?i[e-1]!=="/":!i.endsWith("/"),m=!i.startsWith(".");return c&&f&&p&&m&&u&&l&&h},"isGitHubShorthand");mO.exports=(i,e,{gitHosts:t,protocols:r})=>{if(!i)return;let s=x$(i)?`github:${i}`:i,n=D$(s,r);if(!n)return;let a=t.byShortcut[n.protocol],c=t.byDomain[n.hostname.startsWith("www.")?n.hostname.slice(4):n.hostname],u=a||c;if(!u)return;let l=t[a||c],h=null;r[n.protocol]?.auth&&(n.username||n.password)&&(h=`${n.username}${n.password?":"+n.password:""}`);let f=null,p=null,m=null,y=null;try{if(a){let g=n.pathname.startsWith("/")?n.pathname.slice(1):n.pathname,S=g.indexOf("@");S>-1&&(g=g.slice(S+1));let E=g.lastIndexOf("/");E>-1?(p=decodeURIComponent(g.slice(0,E)),p||(p=null),m=decodeURIComponent(g.slice(E+1))):m=decodeURIComponent(g),m.endsWith(".git")&&(m=m.slice(0,-4)),n.hash&&(f=decodeURIComponent(n.hash.slice(1))),y="shortcut"}else{if(!l.protocols.includes(n.protocol))return;let g=l.extract(n);if(!g)return;p=g.user&&decodeURIComponent(g.user),m=decodeURIComponent(g.project),f=decodeURIComponent(g.committish),y=r[n.protocol]?.name||n.protocol.slice(0,-1)}}catch(g){if(g instanceof URIError)return;throw g}return[u,p,h,m,f,y,e]}});var Xu=d((yle,yO)=>{"use strict";var{LRUCache:L$}=os(),M$=fO(),B$=gO(),k$=Lm(),Mm=new L$({max:1e3});function F$(i){try{let{protocol:e,hostname:t,pathname:r}=new URL(i);if(!t)return null;let s=/(?:git\+)http:$/.test(e)?"http:":"https:",n=r.replace(/\.git$/,"");return`${s}//${t}${n}`}catch{return null}}o(F$,"unknownHostedUrl");var Yu=class i{static{o(this,"GitHost")}constructor(e,t,r,s,n,a,c={}){Object.assign(this,i.#e[e],{type:e,user:t,auth:r,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){i.#e[e]=t,i.#e.byDomain[t.domain]=e,i.#e.byShortcut[`${e}:`]=e,i.#t[`${e}:`]={name:e}}static fromUrl(e,t){if(typeof e!="string")return;let r=e+JSON.stringify(t||{});if(!Mm.has(r)){let s=B$(e,t,{gitHosts:i.#e,protocols:i.#t});Mm.set(r,s?new i(...s):void 0)}return Mm.get(r)}static fromManifest(e,t={}){if(!e||typeof e!="object")return;let r=e.repository,s=r&&(typeof r=="string"?r:typeof r=="object"&&typeof r.url=="string"?r.url:null);if(!s)throw new Error("no repository");let n=s&&i.fromUrl(s.replace(/^git\+/,""),t)||null;if(n)return n;let a=F$(s);return i.fromUrl(a,t)||a}static parseUrl(e){return k$(e)}#i(e,t){if(typeof e!="function")return null;let r={...this,...this.opts,...t};r.path||(r.path=""),r.path.startsWith("/")&&(r.path=r.path.slice(1)),r.noCommittish&&(r.committish=null);let s=e(r);return r.noGitPlus&&s.startsWith("git+")?s.slice(4):s}hash(){return this.committish?`#${this.committish}`:""}ssh(e){return this.#i(this.sshtemplate,e)}sshurl(e){return this.#i(this.sshurltemplate,e)}browse(e,...t){return typeof e!="string"?this.#i(this.browsetemplate,e):typeof t[0]!="string"?this.#i(this.browsetreetemplate,{...t[0],path:e}):this.#i(this.browsetreetemplate,{...t[1],fragment:t[0],path:e})}browseFile(e,...t){return typeof t[0]!="string"?this.#i(this.browseblobtemplate,{...t[0],path:e}):this.#i(this.browseblobtemplate,{...t[1],fragment:t[0],path:e})}docs(e){return this.#i(this.docstemplate,e)}bugs(e){return this.#i(this.bugstemplate,e)}https(e){return this.#i(this.httpstemplate,e)}git(e){return this.#i(this.gittemplate,e)}shortcut(e){return this.#i(this.shortcuttemplate,e)}path(e){return this.#i(this.pathtemplate,e)}tarball(e){return this.#i(this.tarballtemplate,{...e,noCommittish:!1})}file(e,t){return this.#i(this.filetemplate,{...t,path:e})}edit(e,t){return this.#i(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[i,e]of Object.entries(M$))Yu.addHost(i,e);yO.exports=Yu});var EO=d(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.range=as.balanced=void 0;var U$=o((i,e,t)=>{let r=i instanceof RegExp?SO(i,t):i,s=e instanceof RegExp?SO(e,t):e,n=r!==null&&s!=null&&(0,as.range)(r,s,t);return n&&{start:n[0],end:n[1],pre:t.slice(0,n[0]),body:t.slice(n[0]+r.length,n[1]),post:t.slice(n[1]+s.length)}},"balanced");as.balanced=U$;var SO=o((i,e)=>{let t=e.match(i);return t?t[0]:null},"maybeMatch"),j$=o((i,e,t)=>{let r,s,n,a,c,u=t.indexOf(i),l=t.indexOf(e,u+1),h=u;if(u>=0&&l>0){if(i===e)return[u,l];for(r=[],n=t.length;h>=0&&!c;){if(h===u)r.push(h),u=t.indexOf(i,h+1);else if(r.length===1){let f=r.pop();f!==void 0&&(c=[f,l])}else s=r.pop(),s!==void 0&&s<n&&(n=s,a=l),l=t.indexOf(e,h+1);h=u<l&&u>=0?u:l}r.length&&a!==void 0&&(c=[n,a])}return c},"range");as.range=j$});var RO=d(Fm=>{"use strict";Object.defineProperty(Fm,"__esModule",{value:!0});Fm.expand=Q$;var wO=EO(),_O="\0SLASH"+Math.random()+"\0",bO="\0OPEN"+Math.random()+"\0",km="\0CLOSE"+Math.random()+"\0",IO="\0COMMA"+Math.random()+"\0",OO="\0PERIOD"+Math.random()+"\0",$$=new RegExp(_O,"g"),q$=new RegExp(bO,"g"),V$=new RegExp(km,"g"),z$=new RegExp(IO,"g"),H$=new RegExp(OO,"g"),G$=/\\\\/g,W$=/\\{/g,J$=/\\}/g,K$=/\\,/g,Z$=/\\./g;function Bm(i){return isNaN(i)?i.charCodeAt(0):parseInt(i,10)}o(Bm,"numeric");function Y$(i){return i.replace(G$,_O).replace(W$,bO).replace(J$,km).replace(K$,IO).replace(Z$,OO)}o(Y$,"escapeBraces");function X$(i){return i.replace($$,"\\").replace(q$,"{").replace(V$,"}").replace(z$,",").replace(H$,".")}o(X$,"unescapeBraces");function vO(i){if(!i)return[""];let e=[],t=(0,wO.balanced)("{","}",i);if(!t)return i.split(",");let{pre:r,body:s,post:n}=t,a=r.split(",");a[a.length-1]+="{"+s+"}";let c=vO(n);return n.length&&(a[a.length-1]+=c.shift(),a.push.apply(a,c)),e.push.apply(e,a),e}o(vO,"parseCommaParts");function Q$(i){return i?(i.slice(0,2)==="{}"&&(i="\\{\\}"+i.slice(2)),da(Y$(i),!0).map(X$)):[]}o(Q$,"expand");function e2(i){return"{"+i+"}"}o(e2,"embrace");function t2(i){return/^-?0\d/.test(i)}o(t2,"isPadded");function i2(i,e){return i<=e}o(i2,"lte");function r2(i,e){return i>=e}o(r2,"gte");function da(i,e){let t=[],r=(0,wO.balanced)("{","}",i);if(!r)return[i];let s=r.pre,n=r.post.length?da(r.post,!1):[""];if(/\$$/.test(r.pre))for(let a=0;a<n.length;a++){let c=s+"{"+r.body+"}"+n[a];t.push(c)}else{let a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),u=a||c,l=r.body.indexOf(",")>=0;if(!u&&!l)return r.post.match(/,(?!,).*\}/)?(i=r.pre+"{"+r.body+km+r.post,da(i)):[i];let h;if(u)h=r.body.split(/\.\./);else if(h=vO(r.body),h.length===1&&h[0]!==void 0&&(h=da(h[0],!1).map(e2),h.length===1))return n.map(p=>r.pre+h[0]+p);let f;if(u&&h[0]!==void 0&&h[1]!==void 0){let p=Bm(h[0]),m=Bm(h[1]),y=Math.max(h[0].length,h[1].length),g=h.length===3&&h[2]!==void 0?Math.abs(Bm(h[2])):1,S=i2;m<p&&(g*=-1,S=r2);let _=h.some(t2);f=[];for(let b=p;S(b,m);b+=g){let w;if(c)w=String.fromCharCode(b),w==="\\"&&(w="");else if(w=String(b),_){let I=y-w.length;if(I>0){let v=new Array(I+1).join("0");b<0?w="-"+v+w.slice(1):w=v+w}}f.push(w)}}else{f=[];for(let p=0;p<h.length;p++)f.push.apply(f,da(h[p],!1))}for(let p=0;p<f.length;p++)for(let m=0;m<n.length;m++){let y=s+f[p]+n[m];(!e||u||y)&&t.push(y)}}return t}o(da,"expand_")});var AO=d(Qu=>{"use strict";Object.defineProperty(Qu,"__esModule",{value:!0});Qu.assertValidPattern=void 0;var s2=1024*64,n2=o(i=>{if(typeof i!="string")throw new TypeError("invalid pattern");if(i.length>s2)throw new TypeError("pattern is too long")},"assertValidPattern");Qu.assertValidPattern=n2});var CO=d(el=>{"use strict";Object.defineProperty(el,"__esModule",{value:!0});el.parseClass=void 0;var o2={"[: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]},pa=o(i=>i.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),a2=o(i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),TO=o(i=>i.join(""),"rangesToString"),c2=o((i,e)=>{let t=e;if(i.charAt(t)!=="[")throw new Error("not in a brace expression");let r=[],s=[],n=t+1,a=!1,c=!1,u=!1,l=!1,h=t,f="";e:for(;n<i.length;){let g=i.charAt(n);if((g==="!"||g==="^")&&n===t+1){l=!0,n++;continue}if(g==="]"&&a&&!u){h=n+1;break}if(a=!0,g==="\\"&&!u){u=!0,n++;continue}if(g==="["&&!u){for(let[S,[E,_,b]]of Object.entries(o2))if(i.startsWith(S,n)){if(f)return["$.",!1,i.length-t,!0];n+=S.length,b?s.push(E):r.push(E),c=c||_;continue e}}if(u=!1,f){g>f?r.push(pa(f)+"-"+pa(g)):g===f&&r.push(pa(g)),f="",n++;continue}if(i.startsWith("-]",n+1)){r.push(pa(g+"-")),n+=2;continue}if(i.startsWith("-",n+1)){f=g,n+=2;continue}r.push(pa(g)),n++}if(h<n)return["",!1,0,!1];if(!r.length&&!s.length)return["$.",!1,i.length-t,!0];if(s.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let g=r[0].length===2?r[0].slice(-1):r[0];return[a2(g),!1,h-t,!1]}let p="["+(l?"^":"")+TO(r)+"]",m="["+(l?"":"^")+TO(s)+"]";return[r.length&&s.length?"("+p+"|"+m+")":r.length?p:m,c,h-t,!0]},"parseClass");el.parseClass=c2});var il=d(tl=>{"use strict";Object.defineProperty(tl,"__esModule",{value:!0});tl.unescape=void 0;var u2=o((i,{windowsPathsNoEscape:e=!1}={})=>e?i.replace(/\[([^\/\\])\]/g,"$1"):i.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),"unescape");tl.unescape=u2});var $m=d(nl=>{"use strict";Object.defineProperty(nl,"__esModule",{value:!0});nl.AST=void 0;var l2=CO(),rl=il(),h2=new Set(["!","?","+","*","@"]),NO=o(i=>h2.has(i),"isExtglobType"),f2="(?!(?:^|/)\\.\\.?(?:$|/))",sl="(?!\\.)",d2=new Set(["[","."]),p2=new Set(["..","."]),m2=new Set("().*{}+?[]^$\\!"),g2=o(i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),jm="[^/]",PO=jm+"*?",DO=jm+"+?",Um=class i{static{o(this,"AST")}type;#e;#t;#i=!1;#r=[];#s;#u;#c;#f=!1;#n;#h;#o=!1;constructor(e,t,r={}){this.type=e,e&&(this.#t=!0),this.#s=t,this.#e=this.#s?this.#s.#e:this,this.#n=this.#e===this?r:this.#e.#n,this.#c=this.#e===this?[]:this.#e.#c,e==="!"&&!this.#e.#f&&this.#c.push(this),this.#u=this.#s?this.#s.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#h!==void 0?this.#h:this.type?this.#h=this.type+"("+this.#r.map(e=>String(e)).join("|")+")":this.#h=this.#r.map(e=>String(e)).join("")}#d(){if(this!==this.#e)throw new Error("should only call on root");if(this.#f)return this;this.toString(),this.#f=!0;let e;for(;e=this.#c.pop();){if(e.type!=="!")continue;let t=e,r=t.#s;for(;r;){for(let s=t.#u+1;!r.type&&s<r.#r.length;s++)for(let n of e.#r){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(r.#r[s])}t=r,r=t.#s}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof i&&t.#s===this))throw new Error("invalid part: "+t);this.#r.push(t)}}toJSON(){let e=this.type===null?this.#r.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#r.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#f&&this.#s?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#s?.isStart())return!1;if(this.#u===0)return!0;let e=this.#s;for(let t=0;t<this.#u;t++){let r=e.#r[t];if(!(r instanceof i&&r.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.#r.length:0;return this.#u===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new i(this.type,e);for(let r of this.#r)t.copyIn(r);return t}static#a(e,t,r,s){let n=!1,a=!1,c=-1,u=!1;if(t.type===null){let m=r,y="";for(;m<e.length;){let g=e.charAt(m++);if(n||g==="\\"){n=!n,y+=g;continue}if(a){m===c+1?(g==="^"||g==="!")&&(u=!0):g==="]"&&!(m===c+2&&u)&&(a=!1),y+=g;continue}else if(g==="["){a=!0,c=m,u=!1,y+=g;continue}if(!s.noext&&NO(g)&&e.charAt(m)==="("){t.push(y),y="";let S=new i(g,t);m=i.#a(e,S,m,s),t.push(S);continue}y+=g}return t.push(y),m}let l=r+1,h=new i(null,t),f=[],p="";for(;l<e.length;){let m=e.charAt(l++);if(n||m==="\\"){n=!n,p+=m;continue}if(a){l===c+1?(m==="^"||m==="!")&&(u=!0):m==="]"&&!(l===c+2&&u)&&(a=!1),p+=m;continue}else if(m==="["){a=!0,c=l,u=!1,p+=m;continue}if(NO(m)&&e.charAt(l)==="("){h.push(p),p="";let y=new i(m,h);h.push(y),l=i.#a(e,y,l,s);continue}if(m==="|"){h.push(p),p="",f.push(h),h=new i(null,t);continue}if(m===")")return p===""&&t.#r.length===0&&(t.#o=!0),h.push(p),p="",t.push(...f,h),l;p+=m}return t.type=null,t.#t=void 0,t.#r=[e.substring(r-1)],l}static fromGlob(e,t={}){let r=new i(null,void 0,t);return i.#a(e,r,0,t),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,r,s,n]=this.toRegExpSource();if(!(s||this.#t||this.#n.nocase&&!this.#n.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let c=(this.#n.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${t}$`,c),{_src:t,_glob:e})}get options(){return this.#n}toRegExpSource(e){let t=e??!!this.#n.dot;if(this.#e===this&&this.#d(),!this.type){let u=this.isStart()&&this.isEnd(),l=this.#r.map(m=>{let[y,g,S,E]=typeof m=="string"?i.#y(m,this.#t,u):m.toRegExpSource(e);return this.#t=this.#t||S,this.#i=this.#i||E,y}).join(""),h="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&p2.has(this.#r[0]))){let y=d2,g=t&&y.has(l.charAt(0))||l.startsWith("\\.")&&y.has(l.charAt(2))||l.startsWith("\\.\\.")&&y.has(l.charAt(4)),S=!t&&!e&&y.has(l.charAt(0));h=g?f2:S?sl:""}let f="";return this.isEnd()&&this.#e.#f&&this.#s?.type==="!"&&(f="(?:$|\\/)"),[h+l+f,(0,rl.unescape)(l),this.#t=!!this.#t,this.#i]}let r=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#p(t);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let u=this.toString();return this.#r=[u],this.type=null,this.#t=void 0,[u,(0,rl.unescape)(this.toString()),!1,!1]}let a=!r||e||t||!sl?"":this.#p(!0);a===n&&(a=""),a&&(n=`(?:${n})(?:${a})*?`);let c="";if(this.type==="!"&&this.#o)c=(this.isStart()&&!t?sl:"")+DO;else{let u=this.type==="!"?"))"+(this.isStart()&&!t&&!e?sl:"")+PO+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;c=s+n+u}return[c,(0,rl.unescape)(n),this.#t=!!this.#t,this.#i]}#p(e){return this.#r.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[r,s,n,a]=t.toRegExpSource(e);return this.#i=this.#i||a,r}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#y(e,t,r=!1){let s=!1,n="",a=!1;for(let c=0;c<e.length;c++){let u=e.charAt(c);if(s){s=!1,n+=(m2.has(u)?"\\":"")+u;continue}if(u==="\\"){c===e.length-1?n+="\\\\":s=!0;continue}if(u==="["){let[l,h,f,p]=(0,l2.parseClass)(e,c);if(f){n+=l,a=a||h,c+=f-1,t=t||p;continue}}if(u==="*"){r&&e==="*"?n+=DO:n+=PO,t=!0;continue}if(u==="?"){n+=jm,t=!0;continue}n+=g2(u)}return[n,(0,rl.unescape)(e),!!t,a]}};nl.AST=Um});var qm=d(ol=>{"use strict";Object.defineProperty(ol,"__esModule",{value:!0});ol.escape=void 0;var y2=o((i,{windowsPathsNoEscape:e=!1}={})=>e?i.replace(/[?*()[\]]/g,"[$&]"):i.replace(/[?*()[\]\\]/g,"\\$&"),"escape");ol.escape=y2});var Mi=d(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.unescape=C.escape=C.AST=C.Minimatch=C.match=C.makeRe=C.braceExpand=C.defaults=C.filter=C.GLOBSTAR=C.sep=C.minimatch=void 0;var S2=RO(),al=AO(),MO=$m(),E2=qm(),w2=il(),_2=o((i,e,t={})=>((0,al.assertValidPattern)(e),!t.nocomment&&e.charAt(0)==="#"?!1:new cs(e,t).match(i)),"minimatch");C.minimatch=_2;var b2=/^\*+([^+@!?\*\[\(]*)$/,I2=o(i=>e=>!e.startsWith(".")&&e.endsWith(i),"starDotExtTest"),O2=o(i=>e=>e.endsWith(i),"starDotExtTestDot"),v2=o(i=>(i=i.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(i)),"starDotExtTestNocase"),R2=o(i=>(i=i.toLowerCase(),e=>e.toLowerCase().endsWith(i)),"starDotExtTestNocaseDot"),A2=/^\*+\.\*+$/,T2=o(i=>!i.startsWith(".")&&i.includes("."),"starDotStarTest"),C2=o(i=>i!=="."&&i!==".."&&i.includes("."),"starDotStarTestDot"),N2=/^\.\*+$/,P2=o(i=>i!=="."&&i!==".."&&i.startsWith("."),"dotStarTest"),D2=/^\*+$/,x2=o(i=>i.length!==0&&!i.startsWith("."),"starTest"),L2=o(i=>i.length!==0&&i!=="."&&i!=="..","starTestDot"),M2=/^\?+([^+@!?\*\[\(]*)?$/,B2=o(([i,e=""])=>{let t=BO([i]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocase"),k2=o(([i,e=""])=>{let t=kO([i]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocaseDot"),F2=o(([i,e=""])=>{let t=kO([i]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTestDot"),U2=o(([i,e=""])=>{let t=BO([i]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTest"),BO=o(([i])=>{let e=i.length;return t=>t.length===e&&!t.startsWith(".")},"qmarksTestNoExt"),kO=o(([i])=>{let e=i.length;return t=>t.length===e&&t!=="."&&t!==".."},"qmarksTestNoExtDot"),FO=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",xO={win32:{sep:"\\"},posix:{sep:"/"}};C.sep=FO==="win32"?xO.win32.sep:xO.posix.sep;C.minimatch.sep=C.sep;C.GLOBSTAR=Symbol("globstar **");C.minimatch.GLOBSTAR=C.GLOBSTAR;var j2="[^/]",$2=j2+"*?",q2="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",V2="(?:(?!(?:\\/|^)\\.).)*?",z2=o((i,e={})=>t=>(0,C.minimatch)(t,i,e),"filter");C.filter=z2;C.minimatch.filter=C.filter;var Et=o((i,e={})=>Object.assign({},i,e),"ext"),H2=o(i=>{if(!i||typeof i!="object"||!Object.keys(i).length)return C.minimatch;let e=C.minimatch;return Object.assign(o((r,s,n={})=>e(r,s,Et(i,n)),"m"),{Minimatch:class extends e.Minimatch{static{o(this,"Minimatch")}constructor(s,n={}){super(s,Et(i,n))}static defaults(s){return e.defaults(Et(i,s)).Minimatch}},AST:class extends e.AST{static{o(this,"AST")}constructor(s,n,a={}){super(s,n,Et(i,a))}static fromGlob(s,n={}){return e.AST.fromGlob(s,Et(i,n))}},unescape:o((r,s={})=>e.unescape(r,Et(i,s)),"unescape"),escape:o((r,s={})=>e.escape(r,Et(i,s)),"escape"),filter:o((r,s={})=>e.filter(r,Et(i,s)),"filter"),defaults:o(r=>e.defaults(Et(i,r)),"defaults"),makeRe:o((r,s={})=>e.makeRe(r,Et(i,s)),"makeRe"),braceExpand:o((r,s={})=>e.braceExpand(r,Et(i,s)),"braceExpand"),match:o((r,s,n={})=>e.match(r,s,Et(i,n)),"match"),sep:e.sep,GLOBSTAR:C.GLOBSTAR})},"defaults");C.defaults=H2;C.minimatch.defaults=C.defaults;var G2=o((i,e={})=>((0,al.assertValidPattern)(i),e.nobrace||!/\{(?:(?!\{).)*\}/.test(i)?[i]:(0,S2.expand)(i)),"braceExpand");C.braceExpand=G2;C.minimatch.braceExpand=C.braceExpand;var W2=o((i,e={})=>new cs(i,e).makeRe(),"makeRe");C.makeRe=W2;C.minimatch.makeRe=C.makeRe;var J2=o((i,e,t={})=>{let r=new cs(e,t);return i=i.filter(s=>r.match(s)),r.options.nonull&&!i.length&&i.push(e),i},"match");C.match=J2;C.minimatch.match=C.match;var LO=/[?*]|[+@!]\(.*?\)|\[|\]/,K2=o(i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),cs=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,al.assertValidPattern)(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||FO,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...n)=>{}),this.debug(this.pattern,this.globSet);let r=this.globSet.map(n=>this.slashSplit(n));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let s=this.globParts.map((n,a,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=n[0]===""&&n[1]===""&&(n[2]==="?"||!LO.test(n[2]))&&!LO.test(n[3]),l=/^[a-z]:/i.test(n[0]);if(u)return[...n.slice(0,4),...n.slice(4).map(h=>this.parse(h))];if(l)return[n[0],...n.slice(1).map(h=>this.parse(h))]}return n.map(u=>this.parse(u))});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 r=0;r<e.length;r++)for(let s=0;s<e[r].length;s++)e[r][s]==="**"&&(e[r][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 r=-1;for(;(r=t.indexOf("**",r+1))!==-1;){let s=r;for(;t[s+1]==="**";)s++;s!==r&&t.splice(r,s-r)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((r,s)=>{let n=r[r.length-1];return s==="**"&&n==="**"?r:s===".."&&n&&n!==".."&&n!=="."&&n!=="**"?(r.pop(),r):(r.push(s),r)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let 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 r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let s=e[r-1];s&&s!=="."&&s!==".."&&s!=="**"&&(t=!0,e.splice(r-1,2),r-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let r of e){let s=-1;for(;(s=r.indexOf("**",s+1))!==-1;){let a=s;for(;r[a+1]==="**";)a++;a>s&&r.splice(s+1,a-s);let c=r[s+1],u=r[s+2],l=r[s+3];if(c!==".."||!u||u==="."||u===".."||!l||l==="."||l==="..")continue;t=!0,r.splice(s,1);let h=r.slice(0);h[s]="**",e.push(h),s--}if(!this.preserveMultipleSlashes){for(let a=1;a<r.length-1;a++){let c=r[a];a===1&&c===""&&r[0]===""||(c==="."||c==="")&&(t=!0,r.splice(a,1),a--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(t=!0,r.pop())}let n=0;for(;(n=r.indexOf("..",n+1))!==-1;){let a=r[n-1];if(a&&a!=="."&&a!==".."&&a!=="**"){t=!0;let u=n===1&&r[n+1]==="**"?["."]:[];r.splice(n-1,2,...u),r.length===0&&r.push(""),n-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let r=t+1;r<e.length;r++){let s=this.partsMatch(e[t],e[r],!this.preserveMultipleSlashes);if(s){e[t]=[],e[r]=s;break}}return e.filter(t=>t.length)}partsMatch(e,t,r=!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(r&&e[s]==="**"&&t[n]===e[s+1])a.push(e[s]),s++;else if(r&&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,r=0;for(let s=0;s<e.length&&e.charAt(s)==="!";s++)t=!t,r++;r&&(this.pattern=e.slice(r)),this.negate=t}matchOne(e,t,r=!1){let s=this.options;if(this.isWindows){let g=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),S=!g&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),E=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),_=!E&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),b=S?3:g?0:void 0,w=_?3:E?0:void 0;if(typeof b=="number"&&typeof w=="number"){let[I,v]=[e[b],t[w]];I.toLowerCase()===v.toLowerCase()&&(t[w]=I,w>b?t=t.slice(w):b>w&&(e=e.slice(b)))}}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,u=e.length,l=t.length;a<u&&c<l;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===C.GLOBSTAR){this.debug("GLOBSTAR",[t,h,f]);var p=a,m=c+1;if(m===l){for(this.debug("** at the end");a<u;a++)if(e[a]==="."||e[a]===".."||!s.dot&&e[a].charAt(0)===".")return!1;return!0}for(;p<u;){var y=e[p];if(this.debug(`
6
+ "use strict";var Mj=Object.create;var $u=Object.defineProperty;var Bj=Object.getOwnPropertyDescriptor;var kj=Object.getOwnPropertyNames;var Fj=Object.getPrototypeOf,Uj=Object.prototype.hasOwnProperty;var o=(i,e)=>$u(i,"name",{value:e,configurable:!0});var jj=(i,e)=>()=>(i&&(e=i(i=0)),e);var d=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),$j=(i,e)=>{for(var t in e)$u(i,t,{get:e[t],enumerable:!0})},qj=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of kj(e))!Uj.call(i,s)&&s!==t&&$u(i,s,{get:()=>e[s],enumerable:!(r=Bj(e,s))||r.enumerable});return i};var Vj=(i,e,t)=>(t=i!=null?Mj(Fj(i)):{},qj(e||!i||!i.__esModule?$u(t,"default",{value:i,enumerable:!0}):t,i));var bm=d((kue,FI)=>{"use strict";var zj=Symbol.for("indent"),Hj=Symbol.for("newline"),Gj=`
7
+ `,Wj=" ",Jj=/^\uFEFF/,Kj=/^\s*[{[]((?:\r?\n)+)([\s\t]*)/,Zj=/^(?:\{\}|\[\])((?:\r?\n)+)?$/,MI=/^Unexpected token '?(.)'?(,)? /i,Yj=o(i=>{let e=i.charCodeAt(0).toString(16).toUpperCase();return`0x${e.length%2?"0":""}${e}`},"hexify"),BI=o(i=>String(i).replace(Jj,""),"stripBOM"),_m=o((i,e,t=0)=>({message:`${i} while parsing ${e}`,position:t}),"makeParsedError"),Xj=o((i,e,t=20)=>{let r=i.message;if(!e)return _m(r,"empty string");let s=r.match(MI),n=r.match(/ position\s+(\d+)/i);s&&(r=r.replace(MI,`Unexpected token ${JSON.stringify(s[1])} (${Yj(s[1])})$2 `));let a;if(n?a=+n[1]:r.match(/^Unexpected end of JSON.*/i)&&(a=e.length-1),a==null)return _m(r,`'${e.slice(0,t*2)}'`);let c=a<=t?0:a-t,u=a+t>=e.length?e.length:a+t,l=`${c?"...":""}${e.slice(c,u)}${u===e.length?"":"..."}`;return _m(r,`${e===l?"":"near "}${JSON.stringify(l)}`,a)},"parseError"),qu=class extends SyntaxError{static{o(this,"JSONParseError")}constructor(e,t,r,s){let n=Xj(e,t,r);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}},kI=o((i,e)=>{let t=JSON.parse(i,e);if(t&&typeof t=="object"){let r=i.match(Zj)||i.match(Kj)||[null,"",""];t[Hj]=r[1]??Gj,t[zj]=r[2]??Wj}return t},"parseJson"),Vu=o((i,e,t)=>{let r=BI(i);try{return kI(r,e)}catch(s){if(typeof i!="string"&&!Buffer.isBuffer(i)){let n=Array.isArray(i)&&i.length===0?"an empty array":String(i);throw Object.assign(new TypeError(`Cannot parse ${n}`),{code:"EJSONPARSE",systemError:s})}throw new qu(s,r,t,Vu)}},"parseJsonError");FI.exports=Vu;Vu.JSONParseError=qu;Vu.noExceptions=(i,e)=>{try{return kI(BI(i),e)}catch{}}});var $I=d((Uue,jI)=>{var Im=new Set(["dependencies","optionalDependencies","devDependencies","peerDependencies"]),Qj=o(i=>{for(let e of Im)i&&i[e]&&(i[e]=Object.keys(i[e]).sort((t,r)=>t.localeCompare(r,"en")).reduce((t,r)=>(t[r]=i[e][r],t),{}));return i},"orderDeps"),UI=o(({content:i,originalContent:e})=>{let t=Qj({...i});if(t.dependencies&&t.optionalDependencies)for(let c of Object.keys(t.optionalDependencies))delete t.dependencies[c];let r={...e};for(let c of Im)t[c]&&(r[c]=t[c]),t[c]&&typeof t=="object"&&Object.keys(t[c]).length===0&&delete r[c];let{dependencies:s,peerDependencies:n}=e||{},{peerDependencies:a}=r;if(s&&n&&a)for(let c of Object.keys(n))s[c]!==void 0&&a[c]!==void 0&&(r.dependencies=r.dependencies||{},r.dependencies[c]=a[c]);return r},"updateDependencies");UI.knownKeys=Im;jI.exports=UI});var VI=d(($ue,qI)=>{var e$=o(({content:i,originalContent:e={}})=>{let t=i.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");qI.exports=e$});var HI=d((Vue,zI)=>{var t$=o(({content:i,originalContent:e={}})=>{let t=i.workspaces;if(!t)return e;let r=o(()=>t.some(s=>typeof s!="string"),"hasInvalidWorkspaces");if(!t.length||r())throw Object.assign(new TypeError("workspaces should be an array of strings."),{code:"EWORKSPACESINVALID"});return{...e,workspaces:[...t]}},"updateWorkspaces");zI.exports=t$});var ha=d((Hue,GI)=>{"use strict";var i$=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...i)=>{}:()=>{};GI.exports=i$});var fa=d((Gue,WI)=>{"use strict";var r$="2.0.0",s$=Number.MAX_SAFE_INTEGER||9007199254740991,n$=16,o$=250,a$=["major","premajor","minor","preminor","patch","prepatch","prerelease"];WI.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:n$,MAX_SAFE_BUILD_LENGTH:o$,MAX_SAFE_INTEGER:s$,RELEASE_TYPES:a$,SEMVER_SPEC_VERSION:r$,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var cn=d((ii,JI)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Om,MAX_SAFE_BUILD_LENGTH:c$,MAX_LENGTH:u$}=fa(),l$=ha();ii=JI.exports={};var h$=ii.re=[],f$=ii.safeRe=[],R=ii.src=[],d$=ii.safeSrc=[],A=ii.t={},p$=0,vm="[a-zA-Z0-9-]",m$=[["\\s",1],["\\d",u$],[vm,c$]],g$=o(i=>{for(let[e,t]of m$)i=i.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return i},"makeSafeRegex"),B=o((i,e,t)=>{let r=g$(e),s=p$++;l$(i,s,e),A[i]=s,R[s]=e,d$[s]=r,h$[s]=new RegExp(e,t?"g":void 0),f$[s]=new RegExp(r,t?"g":void 0)},"createToken");B("NUMERICIDENTIFIER","0|[1-9]\\d*");B("NUMERICIDENTIFIERLOOSE","\\d+");B("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${vm}*`);B("MAINVERSION",`(${R[A.NUMERICIDENTIFIER]})\\.(${R[A.NUMERICIDENTIFIER]})\\.(${R[A.NUMERICIDENTIFIER]})`);B("MAINVERSIONLOOSE",`(${R[A.NUMERICIDENTIFIERLOOSE]})\\.(${R[A.NUMERICIDENTIFIERLOOSE]})\\.(${R[A.NUMERICIDENTIFIERLOOSE]})`);B("PRERELEASEIDENTIFIER",`(?:${R[A.NONNUMERICIDENTIFIER]}|${R[A.NUMERICIDENTIFIER]})`);B("PRERELEASEIDENTIFIERLOOSE",`(?:${R[A.NONNUMERICIDENTIFIER]}|${R[A.NUMERICIDENTIFIERLOOSE]})`);B("PRERELEASE",`(?:-(${R[A.PRERELEASEIDENTIFIER]}(?:\\.${R[A.PRERELEASEIDENTIFIER]})*))`);B("PRERELEASELOOSE",`(?:-?(${R[A.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${R[A.PRERELEASEIDENTIFIERLOOSE]})*))`);B("BUILDIDENTIFIER",`${vm}+`);B("BUILD",`(?:\\+(${R[A.BUILDIDENTIFIER]}(?:\\.${R[A.BUILDIDENTIFIER]})*))`);B("FULLPLAIN",`v?${R[A.MAINVERSION]}${R[A.PRERELEASE]}?${R[A.BUILD]}?`);B("FULL",`^${R[A.FULLPLAIN]}$`);B("LOOSEPLAIN",`[v=\\s]*${R[A.MAINVERSIONLOOSE]}${R[A.PRERELEASELOOSE]}?${R[A.BUILD]}?`);B("LOOSE",`^${R[A.LOOSEPLAIN]}$`);B("GTLT","((?:<|>)?=?)");B("XRANGEIDENTIFIERLOOSE",`${R[A.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);B("XRANGEIDENTIFIER",`${R[A.NUMERICIDENTIFIER]}|x|X|\\*`);B("XRANGEPLAIN",`[v=\\s]*(${R[A.XRANGEIDENTIFIER]})(?:\\.(${R[A.XRANGEIDENTIFIER]})(?:\\.(${R[A.XRANGEIDENTIFIER]})(?:${R[A.PRERELEASE]})?${R[A.BUILD]}?)?)?`);B("XRANGEPLAINLOOSE",`[v=\\s]*(${R[A.XRANGEIDENTIFIERLOOSE]})(?:\\.(${R[A.XRANGEIDENTIFIERLOOSE]})(?:\\.(${R[A.XRANGEIDENTIFIERLOOSE]})(?:${R[A.PRERELEASELOOSE]})?${R[A.BUILD]}?)?)?`);B("XRANGE",`^${R[A.GTLT]}\\s*${R[A.XRANGEPLAIN]}$`);B("XRANGELOOSE",`^${R[A.GTLT]}\\s*${R[A.XRANGEPLAINLOOSE]}$`);B("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Om}})(?:\\.(\\d{1,${Om}}))?(?:\\.(\\d{1,${Om}}))?`);B("COERCE",`${R[A.COERCEPLAIN]}(?:$|[^\\d])`);B("COERCEFULL",R[A.COERCEPLAIN]+`(?:${R[A.PRERELEASE]})?(?:${R[A.BUILD]})?(?:$|[^\\d])`);B("COERCERTL",R[A.COERCE],!0);B("COERCERTLFULL",R[A.COERCEFULL],!0);B("LONETILDE","(?:~>?)");B("TILDETRIM",`(\\s*)${R[A.LONETILDE]}\\s+`,!0);ii.tildeTrimReplace="$1~";B("TILDE",`^${R[A.LONETILDE]}${R[A.XRANGEPLAIN]}$`);B("TILDELOOSE",`^${R[A.LONETILDE]}${R[A.XRANGEPLAINLOOSE]}$`);B("LONECARET","(?:\\^)");B("CARETTRIM",`(\\s*)${R[A.LONECARET]}\\s+`,!0);ii.caretTrimReplace="$1^";B("CARET",`^${R[A.LONECARET]}${R[A.XRANGEPLAIN]}$`);B("CARETLOOSE",`^${R[A.LONECARET]}${R[A.XRANGEPLAINLOOSE]}$`);B("COMPARATORLOOSE",`^${R[A.GTLT]}\\s*(${R[A.LOOSEPLAIN]})$|^$`);B("COMPARATOR",`^${R[A.GTLT]}\\s*(${R[A.FULLPLAIN]})$|^$`);B("COMPARATORTRIM",`(\\s*)${R[A.GTLT]}\\s*(${R[A.LOOSEPLAIN]}|${R[A.XRANGEPLAIN]})`,!0);ii.comparatorTrimReplace="$1$2$3";B("HYPHENRANGE",`^\\s*(${R[A.XRANGEPLAIN]})\\s+-\\s+(${R[A.XRANGEPLAIN]})\\s*$`);B("HYPHENRANGELOOSE",`^\\s*(${R[A.XRANGEPLAINLOOSE]})\\s+-\\s+(${R[A.XRANGEPLAINLOOSE]})\\s*$`);B("STAR","(<|>)?=?\\s*\\*");B("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");B("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var zu=d((Jue,KI)=>{"use strict";var y$=Object.freeze({loose:!0}),S$=Object.freeze({}),E$=o(i=>i?typeof i!="object"?y$:i:S$,"parseOptions");KI.exports=E$});var Rm=d((Zue,XI)=>{"use strict";var ZI=/^[0-9]+$/,YI=o((i,e)=>{let t=ZI.test(i),r=ZI.test(e);return t&&r&&(i=+i,e=+e),i===e?0:t&&!r?-1:r&&!t?1:i<e?-1:1},"compareIdentifiers"),w$=o((i,e)=>YI(e,i),"rcompareIdentifiers");XI.exports={compareIdentifiers:YI,rcompareIdentifiers:w$}});var De=d((Xue,eO)=>{"use strict";var Hu=ha(),{MAX_LENGTH:QI,MAX_SAFE_INTEGER:Gu}=fa(),{safeRe:Wu,t:Ju}=cn(),_$=zu(),{compareIdentifiers:un}=Rm(),Am=class i{static{o(this,"SemVer")}constructor(e,t){if(t=_$(t),e instanceof i){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>QI)throw new TypeError(`version is longer than ${QI} characters`);Hu("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?Wu[Ju.LOOSE]:Wu[Ju.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Gu||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Gu||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Gu||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){let n=+s;if(n>=0&&n<Gu)return n}return s}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Hu("SemVer.compare",this.version,this.options,e),!(e instanceof i)){if(typeof e=="string"&&e===this.version)return 0;e=new i(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof i||(e=new i(e,this.options)),un(this.major,e.major)||un(this.minor,e.minor)||un(this.patch,e.patch)}comparePre(e){if(e instanceof i||(e=new i(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],s=e.prerelease[t];if(Hu("prerelease compare",t,r,s),r===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(r===void 0)return-1;if(r===s)continue;return un(r,s)}while(++t)}compareBuild(e){e instanceof i||(e=new i(e,this.options));let t=0;do{let r=this.build[t],s=e.build[t];if(Hu("build compare",t,r,s),r===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(r===void 0)return-1;if(r===s)continue;return un(r,s)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(t){let s=`-${t}`.match(this.options.loose?Wu[Ju.PRERELEASELOOSE]:Wu[Ju.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,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let s=Number(r)?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(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(t){let n=[t,s];r===!1&&(n=[t]),un(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}};eO.exports=Am});var ns=d((ele,iO)=>{"use strict";var tO=De(),b$=o((i,e,t=!1)=>{if(i instanceof tO)return i;try{return new tO(i,e)}catch(r){if(!t)return null;throw r}},"parse");iO.exports=b$});var Tm=d((ile,rO)=>{"use strict";var I$=ns(),O$=o((i,e)=>{let t=I$(i,e);return t?t.version:null},"valid");rO.exports=O$});var Cm=d((sle,sO)=>{"use strict";var v$=ns(),R$=o((i,e)=>{let t=v$(i.trim().replace(/^[=v]+/,""),e);return t?t.version:null},"clean");sO.exports=R$});var St=d((ole,nO)=>{var A$=Symbol("proc-log.meta");nO.exports={META:A$,output:{LEVELS:["standard","error","buffer","flush"],KEYS:{standard:"standard",error:"error",buffer:"buffer",flush:"flush"},standard:o(function(...i){return process.emit("output","standard",...i)},"standard"),error:o(function(...i){return process.emit("output","error",...i)},"error"),buffer:o(function(...i){return process.emit("output","buffer",...i)},"buffer"),flush:o(function(...i){return process.emit("output","flush",...i)},"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(...i){return process.emit("log","error",...i)},"error"),notice:o(function(...i){return process.emit("log","notice",...i)},"notice"),warn:o(function(...i){return process.emit("log","warn",...i)},"warn"),info:o(function(...i){return process.emit("log","info",...i)},"info"),verbose:o(function(...i){return process.emit("log","verbose",...i)},"verbose"),http:o(function(...i){return process.emit("log","http",...i)},"http"),silly:o(function(...i){return process.emit("log","silly",...i)},"silly"),timing:o(function(...i){return process.emit("log","timing",...i)},"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(i,e){process.emit("time","start",i);function t(){return process.emit("time","end",i)}if(o(t,"end"),typeof e=="function"){let r=e();return r&&r.finally?r.finally(t):(t(),r)}return t},"start"),end:o(function(i){return process.emit("time","end",i)},"end")},input:{LEVELS:["start","end","read"],KEYS:{start:"start",end:"end",read:"read"},start:o(function(i){process.emit("input","start");function e(){return process.emit("input","end")}if(o(e,"end"),typeof i=="function"){let t=i();return t&&t.finally?t.finally(e):(e(),t)}return e},"start"),end:o(function(){return process.emit("input","end")},"end"),read:o(function(...i){let e,t,r=new Promise((s,n)=>{e=s,t=n});return process.emit("input","read",e,t,...i),r},"read")}}});var os=d(Zu=>{"use strict";Object.defineProperty(Zu,"__esModule",{value:!0});Zu.LRUCache=void 0;var T$=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,aO=new Set,Nm=typeof process=="object"&&process?process:{},cO=o((i,e,t,r)=>{typeof Nm.emitWarning=="function"&&Nm.emitWarning(i,e,t,r)},"emitWarning"),Ku=globalThis.AbortController,oO=globalThis.AbortSignal;if(typeof Ku>"u"){oO=class{static{o(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,s){this._onabort.push(s)}},Ku=class{static{o(this,"AbortController")}constructor(){e()}signal=new oO;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let s of this.signal._onabort)s(r);this.signal.onabort?.(r)}}};let i=Nm.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=o(()=>{i&&(i=!1,cO("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 C$=o(i=>!aO.has(i),"shouldWarn"),lle=Symbol("type"),fr=o(i=>i&&i===Math.floor(i)&&i>0&&isFinite(i),"isPosInt"),uO=o(i=>fr(i)?i<=Math.pow(2,8)?Uint8Array:i<=Math.pow(2,16)?Uint16Array:i<=Math.pow(2,32)?Uint32Array:i<=Number.MAX_SAFE_INTEGER?ln:null:null,"getUintArray"),ln=class extends Array{static{o(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},Pm=class i{static{o(this,"Stack")}heap;length;static#e=!1;static create(e){let t=uO(e);if(!t)return[];i.#e=!0;let r=new i(e,t);return i.#e=!1,r}constructor(e,t){if(!i.#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]}},Dm=class i{static{o(this,"LRUCache")}#e;#t;#i;#r;#s;#u;#c;#f;get perf(){return this.#f}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#n;#h;#o;#d;#a;#p;#y;#_;#m;#A;#w;#b;#v;#I;#E;#N;#O;#l;static unsafeExposeInternals(e){return{starts:e.#v,ttls:e.#I,sizes:e.#b,keyMap:e.#o,keyList:e.#d,valList:e.#a,next:e.#p,prev:e.#y,get head(){return e.#_},get tail(){return e.#m},free:e.#A,isBackgroundFetch:o(t=>e.#g(t),"isBackgroundFetch"),backgroundFetch:o((t,r,s,n)=>e.#j(t,r,s,n),"backgroundFetch"),moveToTail:o(t=>e.#V(t),"moveToTail"),indexes:o(t=>e.#D(t),"indexes"),rindexes:o(t=>e.#L(t),"rindexes"),isStale:o(t=>e.#T(t),"isStale")}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#h}get size(){return this.#n}get fetchMethod(){return this.#u}get memoMethod(){return this.#c}get dispose(){return this.#i}get onInsert(){return this.#r}get disposeAfter(){return this.#s}constructor(e){let{max:t=0,ttl:r,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:a,updateAgeOnHas:c,allowStale:u,dispose:l,onInsert:h,disposeAfter:f,noDisposeOnSet:p,noUpdateTTL:m,maxSize:y=0,maxEntrySize:g=0,sizeCalculation:S,fetchMethod:E,memoMethod:_,noDeleteOnFetchRejection:b,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:I,allowStaleOnFetchAbort:v,ignoreFetchAbort:N,perf:P}=e;if(P!==void 0&&typeof P?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#f=P??T$,t!==0&&!fr(t))throw new TypeError("max option must be a nonnegative integer");let $=t?uO(t):Array;if(!$)throw new Error("invalid max value: "+t);if(this.#e=t,this.#t=y,this.maxEntrySize=g||this.#t,this.sizeCalculation=S,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(_!==void 0&&typeof _!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#c=_,E!==void 0&&typeof E!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#u=E,this.#N=!!E,this.#o=new Map,this.#d=new Array(t).fill(void 0),this.#a=new Array(t).fill(void 0),this.#p=new $(t),this.#y=new $(t),this.#_=0,this.#m=0,this.#A=Pm.create(t),this.#n=0,this.#h=0,typeof l=="function"&&(this.#i=l),typeof h=="function"&&(this.#r=h),typeof f=="function"?(this.#s=f,this.#w=[]):(this.#s=void 0,this.#w=void 0),this.#E=!!this.#i,this.#l=!!this.#r,this.#O=!!this.#s,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!b,this.allowStaleOnFetchRejection=!!I,this.allowStaleOnFetchAbort=!!v,this.ignoreFetchAbort=!!N,this.maxEntrySize!==0){if(this.#t!==0&&!fr(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!fr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#$()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!c,this.ttlResolution=fr(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=r||0,this.ttl){if(!fr(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 ee="LRU_CACHE_UNBOUNDED";C$(ee)&&(aO.add(ee),cO("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ee,i))}}getRemainingTTL(e){return this.#o.has(e)?1/0:0}#B(){let e=new ln(this.#e),t=new ln(this.#e);this.#I=e,this.#v=t,this.#k=(n,a,c=this.#f.now())=>{if(t[n]=a!==0?c:0,e[n]=a,a!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#T(n)&&this.#M(this.#d[n],"expire")},a+1);u.unref&&u.unref()}},this.#R=n=>{t[n]=e[n]!==0?this.#f.now():0},this.#C=(n,a)=>{if(e[a]){let c=e[a],u=t[a];if(!c||!u)return;n.ttl=c,n.start=u,n.now=r||s();let l=n.now-u;n.remainingTTL=c-l}};let r=0,s=o(()=>{let n=this.#f.now();if(this.ttlResolution>0){r=n;let a=setTimeout(()=>r=0,this.ttlResolution);a.unref&&a.unref()}return n},"getNow");this.getRemainingTTL=n=>{let a=this.#o.get(n);if(a===void 0)return 0;let c=e[a],u=t[a];if(!c||!u)return 1/0;let l=(r||s())-u;return c-l},this.#T=n=>{let a=t[n],c=e[n];return!!c&&!!a&&(r||s())-a>c}}#R=o(()=>{},"#updateItemAge");#C=o(()=>{},"#statusTTL");#k=o(()=>{},"#setItemTTL");#T=o(()=>!1,"#isStale");#$(){let e=new ln(this.#e);this.#h=0,this.#b=e,this.#P=t=>{this.#h-=e[t],e[t]=0},this.#F=(t,r,s,n)=>{if(this.#g(r))return 0;if(!fr(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(r,t),!fr(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.#x=(t,r,s)=>{if(e[t]=r,this.#t){let n=this.#t-e[t];for(;this.#h>n;)this.#U(!0)}this.#h+=e[t],s&&(s.entrySize=r,s.totalCalculatedSize=this.#h)}}#P=o(e=>{},"#removeItemSize");#x=o((e,t,r)=>{},"#addItemSize");#F=o((e,t,r,s)=>{if(r||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#D({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#m;!(!this.#S(t)||((e||!this.#T(t))&&(yield t),t===this.#_));)t=this.#y[t]}*#L({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#_;!(!this.#S(t)||((e||!this.#T(t))&&(yield t),t===this.#m));)t=this.#p[t]}#S(e){return e!==void 0&&this.#o.get(this.#d[e])===e}*entries(){for(let e of this.#D())this.#a[e]!==void 0&&this.#d[e]!==void 0&&!this.#g(this.#a[e])&&(yield[this.#d[e],this.#a[e]])}*rentries(){for(let e of this.#L())this.#a[e]!==void 0&&this.#d[e]!==void 0&&!this.#g(this.#a[e])&&(yield[this.#d[e],this.#a[e]])}*keys(){for(let e of this.#D()){let t=this.#d[e];t!==void 0&&!this.#g(this.#a[e])&&(yield t)}}*rkeys(){for(let e of this.#L()){let t=this.#d[e];t!==void 0&&!this.#g(this.#a[e])&&(yield t)}}*values(){for(let e of this.#D())this.#a[e]!==void 0&&!this.#g(this.#a[e])&&(yield this.#a[e])}*rvalues(){for(let e of this.#L())this.#a[e]!==void 0&&!this.#g(this.#a[e])&&(yield this.#a[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#D()){let s=this.#a[r],n=this.#g(s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,this.#d[r],this))return this.get(this.#d[r],t)}}forEach(e,t=this){for(let r of this.#D()){let s=this.#a[r],n=this.#g(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#d[r],this)}}rforEach(e,t=this){for(let r of this.#L()){let s=this.#a[r],n=this.#g(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#d[r],this)}}purgeStale(){let e=!1;for(let t of this.#L({allowStale:!0}))this.#T(t)&&(this.#M(this.#d[t],"expire"),e=!0);return e}info(e){let t=this.#o.get(e);if(t===void 0)return;let r=this.#a[t],s=this.#g(r)?r.__staleWhileFetching:r;if(s===void 0)return;let n={value:s};if(this.#I&&this.#v){let a=this.#I[t],c=this.#v[t];if(a&&c){let u=a-(this.#f.now()-c);n.ttl=u,n.start=Date.now()}}return this.#b&&(n.size=this.#b[t]),n}dump(){let e=[];for(let t of this.#D({allowStale:!0})){let r=this.#d[t],s=this.#a[t],n=this.#g(s)?s.__staleWhileFetching:s;if(n===void 0||r===void 0)continue;let a={value:n};if(this.#I&&this.#v){a.ttl=this.#I[t];let c=this.#f.now()-this.#v[t];a.start=Math.floor(Date.now()-c)}this.#b&&(a.size=this.#b[t]),e.unshift([r,a])}return e}load(e){this.clear();for(let[t,r]of e){if(r.start){let s=Date.now()-r.start;r.start=this.#f.now()-s}this.set(t,r.value,r)}}set(e,t,r={}){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:u}=r,{noUpdateTTL:l=this.noUpdateTTL}=r,h=this.#F(e,t,r.size||0,c);if(this.maxEntrySize&&h>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#M(e,"set"),this;let f=this.#n===0?void 0:this.#o.get(e);if(f===void 0)f=this.#n===0?this.#m:this.#A.length!==0?this.#A.pop():this.#n===this.#e?this.#U(!1):this.#n,this.#d[f]=e,this.#a[f]=t,this.#o.set(e,f),this.#p[this.#m]=f,this.#y[f]=this.#m,this.#m=f,this.#n++,this.#x(f,h,u),u&&(u.set="add"),l=!1,this.#l&&this.#r?.(t,e,"add");else{this.#V(f);let p=this.#a[f];if(t!==p){if(this.#N&&this.#g(p)){p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=p;m!==void 0&&!a&&(this.#E&&this.#i?.(m,e,"set"),this.#O&&this.#w?.push([m,e,"set"]))}else a||(this.#E&&this.#i?.(p,e,"set"),this.#O&&this.#w?.push([p,e,"set"]));if(this.#P(f),this.#x(f,h,u),this.#a[f]=t,u){u.set="replace";let m=p&&this.#g(p)?p.__staleWhileFetching:p;m!==void 0&&(u.oldValue=m)}}else u&&(u.set="update");this.#l&&this.onInsert?.(t,e,t===p?"update":"replace")}if(s!==0&&!this.#I&&this.#B(),this.#I&&(l||this.#k(f,s,n),u&&this.#C(u,f)),!a&&this.#O&&this.#w){let p=this.#w,m;for(;m=p?.shift();)this.#s?.(...m)}return this}pop(){try{for(;this.#n;){let e=this.#a[this.#_];if(this.#U(!0),this.#g(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#O&&this.#w){let e=this.#w,t;for(;t=e?.shift();)this.#s?.(...t)}}}#U(e){let t=this.#_,r=this.#d[t],s=this.#a[t];return this.#N&&this.#g(s)?s.__abortController.abort(new Error("evicted")):(this.#E||this.#O)&&(this.#E&&this.#i?.(s,r,"evict"),this.#O&&this.#w?.push([s,r,"evict"])),this.#P(t),e&&(this.#d[t]=void 0,this.#a[t]=void 0,this.#A.push(t)),this.#n===1?(this.#_=this.#m=0,this.#A.length=0):this.#_=this.#p[t],this.#o.delete(r),this.#n--,t}has(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:s}=t,n=this.#o.get(e);if(n!==void 0){let a=this.#a[n];if(this.#g(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#T(n))s&&(s.has="stale",this.#C(s,n));else return r&&this.#R(n),s&&(s.has="hit",this.#C(s,n)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{allowStale:r=this.allowStale}=t,s=this.#o.get(e);if(s===void 0||!r&&this.#T(s))return;let n=this.#a[s];return this.#g(n)?n.__staleWhileFetching:n}#j(e,t,r,s){let n=t===void 0?void 0:this.#a[t];if(this.#g(n))return n;let a=new Ku,{signal:c}=r;c?.addEventListener("abort",()=>a.abort(c.reason),{signal:a.signal});let u={signal:a.signal,options:r,context:s},l=o((g,S=!1)=>{let{aborted:E}=a.signal,_=r.ignoreFetchAbort&&g!==void 0;if(r.status&&(E&&!S?(r.status.fetchAborted=!0,r.status.fetchError=a.signal.reason,_&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),E&&!_&&!S)return f(a.signal.reason);let b=m,w=this.#a[t];return(w===m||_&&S&&w===void 0)&&(g===void 0?b.__staleWhileFetching!==void 0?this.#a[t]=b.__staleWhileFetching:this.#M(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,g,u.options))),g},"cb"),h=o(g=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=g),f(g)),"eb"),f=o(g=>{let{aborted:S}=a.signal,E=S&&r.allowStaleOnFetchAbort,_=E||r.allowStaleOnFetchRejection,b=_||r.noDeleteOnFetchRejection,w=m;if(this.#a[t]===m&&(!b||w.__staleWhileFetching===void 0?this.#M(e,"fetch"):E||(this.#a[t]=w.__staleWhileFetching)),_)return r.status&&w.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),w.__staleWhileFetching;if(w.__returned===w)throw g},"fetchFail"),p=o((g,S)=>{let E=this.#u?.(e,n,u);E&&E instanceof Promise&&E.then(_=>g(_===void 0?void 0:_),S),a.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(g(void 0),r.allowStaleOnFetchAbort&&(g=o(_=>l(_,!0),"res")))})},"pcall");r.status&&(r.status.fetchDispatched=!0);let m=new Promise(p).then(l,h),y=Object.assign(m,{__abortController:a,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,y,{...u.options,status:void 0}),t=this.#o.get(e)):this.#a[t]=y,y}#g(e){if(!this.#N)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Ku}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:u=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:h=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:m=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:g,forceRefresh:S=!1,status:E,signal:_}=t;if(!this.#N)return E&&(E.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:E});let b={allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:a,noDisposeOnSet:c,size:u,sizeCalculation:l,noUpdateTTL:h,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:y,ignoreFetchAbort:m,status:E,signal:_},w=this.#o.get(e);if(w===void 0){E&&(E.fetch="miss");let I=this.#j(e,w,b,g);return I.__returned=I}else{let I=this.#a[w];if(this.#g(I)){let ee=r&&I.__staleWhileFetching!==void 0;return E&&(E.fetch="inflight",ee&&(E.returnedStale=!0)),ee?I.__staleWhileFetching:I.__returned=I}let v=this.#T(w);if(!S&&!v)return E&&(E.fetch="hit"),this.#V(w),s&&this.#R(w),E&&this.#C(E,w),I;let N=this.#j(e,w,b,g),$=N.__staleWhileFetching!==void 0&&r;return E&&(E.fetch=v?"stale":"refresh",$&&v&&(E.returnedStale=!0)),$?N.__staleWhileFetching:N.__returned=N}}async forceFetch(e,t={}){let r=await this.fetch(e,t);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,t={}){let r=this.#c;if(!r)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 u=r(e,c,{options:a,context:s});return this.set(e,u,a),u}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:a}=t,c=this.#o.get(e);if(c!==void 0){let u=this.#a[c],l=this.#g(u);return a&&this.#C(a,c),this.#T(c)?(a&&(a.get="stale"),l?(a&&r&&u.__staleWhileFetching!==void 0&&(a.returnedStale=!0),r?u.__staleWhileFetching:void 0):(n||this.#M(e,"expire"),a&&r&&(a.returnedStale=!0),r?u:void 0)):(a&&(a.get="hit"),l?u.__staleWhileFetching:(this.#V(c),s&&this.#R(c),u))}else a&&(a.get="miss")}#q(e,t){this.#y[t]=e,this.#p[e]=t}#V(e){e!==this.#m&&(e===this.#_?this.#_=this.#p[e]:this.#q(this.#y[e],this.#p[e]),this.#q(this.#m,e),this.#m=e)}delete(e){return this.#M(e,"delete")}#M(e,t){let r=!1;if(this.#n!==0){let s=this.#o.get(e);if(s!==void 0)if(r=!0,this.#n===1)this.#z(t);else{this.#P(s);let n=this.#a[s];if(this.#g(n)?n.__abortController.abort(new Error("deleted")):(this.#E||this.#O)&&(this.#E&&this.#i?.(n,e,t),this.#O&&this.#w?.push([n,e,t])),this.#o.delete(e),this.#d[s]=void 0,this.#a[s]=void 0,s===this.#m)this.#m=this.#y[s];else if(s===this.#_)this.#_=this.#p[s];else{let a=this.#y[s];this.#p[a]=this.#p[s];let c=this.#p[s];this.#y[c]=this.#y[s]}this.#n--,this.#A.push(s)}}if(this.#O&&this.#w?.length){let s=this.#w,n;for(;n=s?.shift();)this.#s?.(...n)}return r}clear(){return this.#z("delete")}#z(e){for(let t of this.#L({allowStale:!0})){let r=this.#a[t];if(this.#g(r))r.__abortController.abort(new Error("deleted"));else{let s=this.#d[t];this.#E&&this.#i?.(r,s,e),this.#O&&this.#w?.push([r,s,e])}}if(this.#o.clear(),this.#a.fill(void 0),this.#d.fill(void 0),this.#I&&this.#v&&(this.#I.fill(0),this.#v.fill(0)),this.#b&&this.#b.fill(0),this.#_=0,this.#m=0,this.#A.length=0,this.#h=0,this.#n=0,this.#O&&this.#w){let t=this.#w,r;for(;r=t?.shift();)this.#s?.(...r)}}};Zu.LRUCache=Dm});var fO=d((dle,hO)=>{"use strict";var G=o((...i)=>i.every(e=>e)?i.join(""):"","maybeJoin"),ge=o(i=>i?encodeURIComponent(i):"","maybeEncode"),lO=o(i=>i.toLowerCase().replace(/^\W+/g,"").replace(/(?<!\W)\W+$/,"").replace(/\//g,"").replace(/\W+/g,"-"),"formatHashFragment"),N$={sshtemplate:o(({domain:i,user:e,project:t,committish:r})=>`git@${i}:${e}/${t}.git${G("#",r)}`,"sshtemplate"),sshurltemplate:o(({domain:i,user:e,project:t,committish:r})=>`git+ssh://git@${i}/${e}/${t}.git${G("#",r)}`,"sshurltemplate"),edittemplate:o(({domain:i,user:e,project:t,committish:r,editpath:s,path:n})=>`https://${i}/${e}/${t}${G("/",s,"/",ge(r||"HEAD"),"/",n)}`,"edittemplate"),browsetemplate:o(({domain:i,user:e,project:t,committish:r,treepath:s})=>`https://${i}/${e}/${t}${G("/",s,"/",ge(r))}`,"browsetemplate"),browsetreetemplate:o(({domain:i,user:e,project:t,committish:r,treepath:s,path:n,fragment:a,hashformat:c})=>`https://${i}/${e}/${t}/${s}/${ge(r||"HEAD")}/${n}${G("#",c(a||""))}`,"browsetreetemplate"),browseblobtemplate:o(({domain:i,user:e,project:t,committish:r,blobpath:s,path:n,fragment:a,hashformat:c})=>`https://${i}/${e}/${t}/${s}/${ge(r||"HEAD")}/${n}${G("#",c(a||""))}`,"browseblobtemplate"),docstemplate:o(({domain:i,user:e,project:t,treepath:r,committish:s})=>`https://${i}/${e}/${t}${G("/",r,"/",ge(s))}#readme`,"docstemplate"),httpstemplate:o(({auth:i,domain:e,user:t,project:r,committish:s})=>`git+https://${G(i,"@")}${e}/${t}/${r}.git${G("#",s)}`,"httpstemplate"),filetemplate:o(({domain:i,user:e,project:t,committish:r,path:s})=>`https://${i}/${e}/${t}/raw/${ge(r||"HEAD")}/${s}`,"filetemplate"),shortcuttemplate:o(({type:i,user:e,project:t,committish:r})=>`${i}:${e}/${t}${G("#",r)}`,"shortcuttemplate"),pathtemplate:o(({user:i,project:e,committish:t})=>`${i}/${e}${G("#",t)}`,"pathtemplate"),bugstemplate:o(({domain:i,user:e,project:t})=>`https://${i}/${e}/${t}/issues`,"bugstemplate"),hashformat:lO},dr={};dr.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:o(({auth:i,user:e,project:t,committish:r,path:s})=>`https://${G(i,"@")}raw.githubusercontent.com/${e}/${t}/${ge(r||"HEAD")}/${s}`,"filetemplate"),gittemplate:o(({auth:i,domain:e,user:t,project:r,committish:s})=>`git://${G(i,"@")}${e}/${t}/${r}.git${G("#",s)}`,"gittemplate"),tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://codeload.${i}/${e}/${t}/tar.gz/${ge(r||"HEAD")}`,"tarballtemplate"),extract:o(i=>{let[,e,t,r,s]=i.pathname.split("/",5);if(!(r&&r!=="tree")&&(r||(s=i.hash.slice(1)),t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:s}},"extract")};dr.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:o(({domain:i,user:e,project:t,committish:r,treepath:s,path:n,editpath:a})=>`https://${i}/${e}/${t}${G("/",s,"/",ge(r||"HEAD"),"/",n,a)}`,"edittemplate"),tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}/get/${ge(r||"HEAD")}.tar.gz`,"tarballtemplate"),extract:o(i=>{let[,e,t,r]=i.pathname.split("/",4);if(!["get"].includes(r)&&(t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:i.hash.slice(1)}},"extract")};dr.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}/repository/archive.tar.gz?ref=${ge(r||"HEAD")}`,"tarballtemplate"),extract:o(i=>{let e=i.pathname.slice(1);if(e.includes("/-/")||e.includes("/archive.tar.gz"))return;let t=e.split("/"),r=t.pop();r.endsWith(".git")&&(r=r.slice(0,-4));let s=t.join("/");if(!(!s||!r))return{user:s,project:r,committish:i.hash.slice(1)}},"extract")};dr.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:o(({domain:i,project:e,committish:t})=>`git@${i}:${e}.git${G("#",t)}`,"sshtemplate"),sshurltemplate:o(({domain:i,project:e,committish:t})=>`git+ssh://git@${i}/${e}.git${G("#",t)}`,"sshurltemplate"),edittemplate:o(({domain:i,user:e,project:t,committish:r,editpath:s})=>`https://${i}/${e}/${t}${G("/",ge(r))}/${s}`,"edittemplate"),browsetemplate:o(({domain:i,project:e,committish:t})=>`https://${i}/${e}${G("/",ge(t))}`,"browsetemplate"),browsetreetemplate:o(({domain:i,project:e,committish:t,path:r,hashformat:s})=>`https://${i}/${e}${G("/",ge(t))}${G("#",s(r))}`,"browsetreetemplate"),browseblobtemplate:o(({domain:i,project:e,committish:t,path:r,hashformat:s})=>`https://${i}/${e}${G("/",ge(t))}${G("#",s(r))}`,"browseblobtemplate"),docstemplate:o(({domain:i,project:e,committish:t})=>`https://${i}/${e}${G("/",ge(t))}`,"docstemplate"),httpstemplate:o(({domain:i,project:e,committish:t})=>`git+https://${i}/${e}.git${G("#",t)}`,"httpstemplate"),filetemplate:o(({user:i,project:e,committish:t,path:r})=>`https://gist.githubusercontent.com/${i}/${e}/raw${G("/",ge(t))}/${r}`,"filetemplate"),shortcuttemplate:o(({type:i,project:e,committish:t})=>`${i}:${e}${G("#",t)}`,"shortcuttemplate"),pathtemplate:o(({project:i,committish:e})=>`${i}${G("#",e)}`,"pathtemplate"),bugstemplate:o(({domain:i,project:e})=>`https://${i}/${e}`,"bugstemplate"),gittemplate:o(({domain:i,project:e,committish:t})=>`git://${i}/${e}.git${G("#",t)}`,"gittemplate"),tarballtemplate:o(({project:i,committish:e})=>`https://codeload.github.com/gist/${i}/tar.gz/${ge(e||"HEAD")}`,"tarballtemplate"),extract:o(i=>{let[,e,t,r]=i.pathname.split("/",4);if(r!=="raw"){if(!t){if(!e)return;t=e,e=null}return t.endsWith(".git")&&(t=t.slice(0,-4)),{user:e,project:t,committish:i.hash.slice(1)}}},"extract"),hashformat:o(function(i){return i&&"file-"+lO(i)},"hashformat")};dr.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:o(({domain:i,user:e,project:t,committish:r,path:s})=>`https://${i}/${e}/${t}/blob/${ge(r)||"HEAD"}/${s}`,"filetemplate"),httpstemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}.git${G("#",r)}`,"httpstemplate"),tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}/archive/${ge(r)||"HEAD"}.tar.gz`,"tarballtemplate"),bugstemplate:o(()=>null,"bugstemplate"),extract:o(i=>{let[,e,t,r]=i.pathname.split("/",4);if(!["archive"].includes(r)&&(t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:i.hash.slice(1)}},"extract")};for(let[i,e]of Object.entries(dr))dr[i]=Object.assign({},N$,e);hO.exports=dr});var Lm=d((mle,pO)=>{var P$=require("url"),xm=o((i,e,t)=>{let r=i.indexOf(t);return i.lastIndexOf(e,r>-1?r:1/0)},"lastIndexOfBefore"),dO=o(i=>{try{return new P$.URL(i)}catch{}},"safeUrl"),D$=o((i,e)=>{let t=i.indexOf(":"),r=i.slice(0,t+1);if(Object.prototype.hasOwnProperty.call(e,r)||i.substr(t,3)==="://")return i;let s=i.indexOf("@");return s>-1?s>t?`git+ssh://${i}`:i:`${i.slice(0,t+1)}//${i.slice(t+1)}`},"correctProtocol"),x$=o(i=>{let e=xm(i,"@","#"),t=xm(i,":","#");return t>e&&(i=i.slice(0,t)+"/"+i.slice(t+1)),xm(i,":","#")===-1&&i.indexOf("//")===-1&&(i=`git+ssh://${i}`),i},"correctUrl");pO.exports=(i,e)=>{let t=e?D$(i,e):i;return dO(t)||dO(x$(t))}});var gO=d((yle,mO)=>{"use strict";var L$=Lm(),M$=o(i=>{let e=i.indexOf("#"),t=i.indexOf("/"),r=i.indexOf("/",t+1),s=i.indexOf(":"),n=/\s/.exec(i),a=i.indexOf("@"),c=!n||e>-1&&n.index>e,u=a===-1||e>-1&&a>e,l=s===-1||e>-1&&s>e,h=r===-1||e>-1&&r>e,f=t>0,p=e>-1?i[e-1]!=="/":!i.endsWith("/"),m=!i.startsWith(".");return c&&f&&p&&m&&u&&l&&h},"isGitHubShorthand");mO.exports=(i,e,{gitHosts:t,protocols:r})=>{if(!i)return;let s=M$(i)?`github:${i}`:i,n=L$(s,r);if(!n)return;let a=t.byShortcut[n.protocol],c=t.byDomain[n.hostname.startsWith("www.")?n.hostname.slice(4):n.hostname],u=a||c;if(!u)return;let l=t[a||c],h=null;r[n.protocol]?.auth&&(n.username||n.password)&&(h=`${n.username}${n.password?":"+n.password:""}`);let f=null,p=null,m=null,y=null;try{if(a){let g=n.pathname.startsWith("/")?n.pathname.slice(1):n.pathname,S=g.indexOf("@");S>-1&&(g=g.slice(S+1));let E=g.lastIndexOf("/");E>-1?(p=decodeURIComponent(g.slice(0,E)),p||(p=null),m=decodeURIComponent(g.slice(E+1))):m=decodeURIComponent(g),m.endsWith(".git")&&(m=m.slice(0,-4)),n.hash&&(f=decodeURIComponent(n.hash.slice(1))),y="shortcut"}else{if(!l.protocols.includes(n.protocol))return;let g=l.extract(n);if(!g)return;p=g.user&&decodeURIComponent(g.user),m=decodeURIComponent(g.project),f=decodeURIComponent(g.committish),y=r[n.protocol]?.name||n.protocol.slice(0,-1)}}catch(g){if(g instanceof URIError)return;throw g}return[u,p,h,m,f,y,e]}});var Xu=d((Ele,yO)=>{"use strict";var{LRUCache:B$}=os(),k$=fO(),F$=gO(),U$=Lm(),Mm=new B$({max:1e3});function j$(i){try{let{protocol:e,hostname:t,pathname:r}=new URL(i);if(!t)return null;let s=/(?:git\+)http:$/.test(e)?"http:":"https:",n=r.replace(/\.git$/,"");return`${s}//${t}${n}`}catch{return null}}o(j$,"unknownHostedUrl");var Yu=class i{static{o(this,"GitHost")}constructor(e,t,r,s,n,a,c={}){Object.assign(this,i.#e[e],{type:e,user:t,auth:r,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){i.#e[e]=t,i.#e.byDomain[t.domain]=e,i.#e.byShortcut[`${e}:`]=e,i.#t[`${e}:`]={name:e}}static fromUrl(e,t){if(typeof e!="string")return;let r=e+JSON.stringify(t||{});if(!Mm.has(r)){let s=F$(e,t,{gitHosts:i.#e,protocols:i.#t});Mm.set(r,s?new i(...s):void 0)}return Mm.get(r)}static fromManifest(e,t={}){if(!e||typeof e!="object")return;let r=e.repository,s=r&&(typeof r=="string"?r:typeof r=="object"&&typeof r.url=="string"?r.url:null);if(!s)throw new Error("no repository");let n=s&&i.fromUrl(s.replace(/^git\+/,""),t)||null;if(n)return n;let a=j$(s);return i.fromUrl(a,t)||a}static parseUrl(e){return U$(e)}#i(e,t){if(typeof e!="function")return null;let r={...this,...this.opts,...t};r.path||(r.path=""),r.path.startsWith("/")&&(r.path=r.path.slice(1)),r.noCommittish&&(r.committish=null);let s=e(r);return r.noGitPlus&&s.startsWith("git+")?s.slice(4):s}hash(){return this.committish?`#${this.committish}`:""}ssh(e){return this.#i(this.sshtemplate,e)}sshurl(e){return this.#i(this.sshurltemplate,e)}browse(e,...t){return typeof e!="string"?this.#i(this.browsetemplate,e):typeof t[0]!="string"?this.#i(this.browsetreetemplate,{...t[0],path:e}):this.#i(this.browsetreetemplate,{...t[1],fragment:t[0],path:e})}browseFile(e,...t){return typeof t[0]!="string"?this.#i(this.browseblobtemplate,{...t[0],path:e}):this.#i(this.browseblobtemplate,{...t[1],fragment:t[0],path:e})}docs(e){return this.#i(this.docstemplate,e)}bugs(e){return this.#i(this.bugstemplate,e)}https(e){return this.#i(this.httpstemplate,e)}git(e){return this.#i(this.gittemplate,e)}shortcut(e){return this.#i(this.shortcuttemplate,e)}path(e){return this.#i(this.pathtemplate,e)}tarball(e){return this.#i(this.tarballtemplate,{...e,noCommittish:!1})}file(e,t){return this.#i(this.filetemplate,{...t,path:e})}edit(e,t){return this.#i(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[i,e]of Object.entries(k$))Yu.addHost(i,e);yO.exports=Yu});var EO=d(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.range=as.balanced=void 0;var $$=o((i,e,t)=>{let r=i instanceof RegExp?SO(i,t):i,s=e instanceof RegExp?SO(e,t):e,n=r!==null&&s!=null&&(0,as.range)(r,s,t);return n&&{start:n[0],end:n[1],pre:t.slice(0,n[0]),body:t.slice(n[0]+r.length,n[1]),post:t.slice(n[1]+s.length)}},"balanced");as.balanced=$$;var SO=o((i,e)=>{let t=e.match(i);return t?t[0]:null},"maybeMatch"),q$=o((i,e,t)=>{let r,s,n,a,c,u=t.indexOf(i),l=t.indexOf(e,u+1),h=u;if(u>=0&&l>0){if(i===e)return[u,l];for(r=[],n=t.length;h>=0&&!c;){if(h===u)r.push(h),u=t.indexOf(i,h+1);else if(r.length===1){let f=r.pop();f!==void 0&&(c=[f,l])}else s=r.pop(),s!==void 0&&s<n&&(n=s,a=l),l=t.indexOf(e,h+1);h=u<l&&u>=0?u:l}r.length&&a!==void 0&&(c=[n,a])}return c},"range");as.range=q$});var RO=d(Fm=>{"use strict";Object.defineProperty(Fm,"__esModule",{value:!0});Fm.expand=t2;var wO=EO(),_O="\0SLASH"+Math.random()+"\0",bO="\0OPEN"+Math.random()+"\0",km="\0CLOSE"+Math.random()+"\0",IO="\0COMMA"+Math.random()+"\0",OO="\0PERIOD"+Math.random()+"\0",V$=new RegExp(_O,"g"),z$=new RegExp(bO,"g"),H$=new RegExp(km,"g"),G$=new RegExp(IO,"g"),W$=new RegExp(OO,"g"),J$=/\\\\/g,K$=/\\{/g,Z$=/\\}/g,Y$=/\\,/g,X$=/\\./g;function Bm(i){return isNaN(i)?i.charCodeAt(0):parseInt(i,10)}o(Bm,"numeric");function Q$(i){return i.replace(J$,_O).replace(K$,bO).replace(Z$,km).replace(Y$,IO).replace(X$,OO)}o(Q$,"escapeBraces");function e2(i){return i.replace(V$,"\\").replace(z$,"{").replace(H$,"}").replace(G$,",").replace(W$,".")}o(e2,"unescapeBraces");function vO(i){if(!i)return[""];let e=[],t=(0,wO.balanced)("{","}",i);if(!t)return i.split(",");let{pre:r,body:s,post:n}=t,a=r.split(",");a[a.length-1]+="{"+s+"}";let c=vO(n);return n.length&&(a[a.length-1]+=c.shift(),a.push.apply(a,c)),e.push.apply(e,a),e}o(vO,"parseCommaParts");function t2(i){return i?(i.slice(0,2)==="{}"&&(i="\\{\\}"+i.slice(2)),da(Q$(i),!0).map(e2)):[]}o(t2,"expand");function i2(i){return"{"+i+"}"}o(i2,"embrace");function r2(i){return/^-?0\d/.test(i)}o(r2,"isPadded");function s2(i,e){return i<=e}o(s2,"lte");function n2(i,e){return i>=e}o(n2,"gte");function da(i,e){let t=[],r=(0,wO.balanced)("{","}",i);if(!r)return[i];let s=r.pre,n=r.post.length?da(r.post,!1):[""];if(/\$$/.test(r.pre))for(let a=0;a<n.length;a++){let c=s+"{"+r.body+"}"+n[a];t.push(c)}else{let a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),u=a||c,l=r.body.indexOf(",")>=0;if(!u&&!l)return r.post.match(/,(?!,).*\}/)?(i=r.pre+"{"+r.body+km+r.post,da(i)):[i];let h;if(u)h=r.body.split(/\.\./);else if(h=vO(r.body),h.length===1&&h[0]!==void 0&&(h=da(h[0],!1).map(i2),h.length===1))return n.map(p=>r.pre+h[0]+p);let f;if(u&&h[0]!==void 0&&h[1]!==void 0){let p=Bm(h[0]),m=Bm(h[1]),y=Math.max(h[0].length,h[1].length),g=h.length===3&&h[2]!==void 0?Math.abs(Bm(h[2])):1,S=s2;m<p&&(g*=-1,S=n2);let _=h.some(r2);f=[];for(let b=p;S(b,m);b+=g){let w;if(c)w=String.fromCharCode(b),w==="\\"&&(w="");else if(w=String(b),_){let I=y-w.length;if(I>0){let v=new Array(I+1).join("0");b<0?w="-"+v+w.slice(1):w=v+w}}f.push(w)}}else{f=[];for(let p=0;p<h.length;p++)f.push.apply(f,da(h[p],!1))}for(let p=0;p<f.length;p++)for(let m=0;m<n.length;m++){let y=s+f[p]+n[m];(!e||u||y)&&t.push(y)}}return t}o(da,"expand_")});var AO=d(Qu=>{"use strict";Object.defineProperty(Qu,"__esModule",{value:!0});Qu.assertValidPattern=void 0;var o2=1024*64,a2=o(i=>{if(typeof i!="string")throw new TypeError("invalid pattern");if(i.length>o2)throw new TypeError("pattern is too long")},"assertValidPattern");Qu.assertValidPattern=a2});var CO=d(el=>{"use strict";Object.defineProperty(el,"__esModule",{value:!0});el.parseClass=void 0;var c2={"[: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]},pa=o(i=>i.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),u2=o(i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),TO=o(i=>i.join(""),"rangesToString"),l2=o((i,e)=>{let t=e;if(i.charAt(t)!=="[")throw new Error("not in a brace expression");let r=[],s=[],n=t+1,a=!1,c=!1,u=!1,l=!1,h=t,f="";e:for(;n<i.length;){let g=i.charAt(n);if((g==="!"||g==="^")&&n===t+1){l=!0,n++;continue}if(g==="]"&&a&&!u){h=n+1;break}if(a=!0,g==="\\"&&!u){u=!0,n++;continue}if(g==="["&&!u){for(let[S,[E,_,b]]of Object.entries(c2))if(i.startsWith(S,n)){if(f)return["$.",!1,i.length-t,!0];n+=S.length,b?s.push(E):r.push(E),c=c||_;continue e}}if(u=!1,f){g>f?r.push(pa(f)+"-"+pa(g)):g===f&&r.push(pa(g)),f="",n++;continue}if(i.startsWith("-]",n+1)){r.push(pa(g+"-")),n+=2;continue}if(i.startsWith("-",n+1)){f=g,n+=2;continue}r.push(pa(g)),n++}if(h<n)return["",!1,0,!1];if(!r.length&&!s.length)return["$.",!1,i.length-t,!0];if(s.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let g=r[0].length===2?r[0].slice(-1):r[0];return[u2(g),!1,h-t,!1]}let p="["+(l?"^":"")+TO(r)+"]",m="["+(l?"":"^")+TO(s)+"]";return[r.length&&s.length?"("+p+"|"+m+")":r.length?p:m,c,h-t,!0]},"parseClass");el.parseClass=l2});var il=d(tl=>{"use strict";Object.defineProperty(tl,"__esModule",{value:!0});tl.unescape=void 0;var h2=o((i,{windowsPathsNoEscape:e=!1}={})=>e?i.replace(/\[([^\/\\])\]/g,"$1"):i.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),"unescape");tl.unescape=h2});var $m=d(nl=>{"use strict";Object.defineProperty(nl,"__esModule",{value:!0});nl.AST=void 0;var f2=CO(),rl=il(),d2=new Set(["!","?","+","*","@"]),NO=o(i=>d2.has(i),"isExtglobType"),p2="(?!(?:^|/)\\.\\.?(?:$|/))",sl="(?!\\.)",m2=new Set(["[","."]),g2=new Set(["..","."]),y2=new Set("().*{}+?[]^$\\!"),S2=o(i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),jm="[^/]",PO=jm+"*?",DO=jm+"+?",Um=class i{static{o(this,"AST")}type;#e;#t;#i=!1;#r=[];#s;#u;#c;#f=!1;#n;#h;#o=!1;constructor(e,t,r={}){this.type=e,e&&(this.#t=!0),this.#s=t,this.#e=this.#s?this.#s.#e:this,this.#n=this.#e===this?r:this.#e.#n,this.#c=this.#e===this?[]:this.#e.#c,e==="!"&&!this.#e.#f&&this.#c.push(this),this.#u=this.#s?this.#s.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#h!==void 0?this.#h:this.type?this.#h=this.type+"("+this.#r.map(e=>String(e)).join("|")+")":this.#h=this.#r.map(e=>String(e)).join("")}#d(){if(this!==this.#e)throw new Error("should only call on root");if(this.#f)return this;this.toString(),this.#f=!0;let e;for(;e=this.#c.pop();){if(e.type!=="!")continue;let t=e,r=t.#s;for(;r;){for(let s=t.#u+1;!r.type&&s<r.#r.length;s++)for(let n of e.#r){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(r.#r[s])}t=r,r=t.#s}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof i&&t.#s===this))throw new Error("invalid part: "+t);this.#r.push(t)}}toJSON(){let e=this.type===null?this.#r.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#r.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#f&&this.#s?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#s?.isStart())return!1;if(this.#u===0)return!0;let e=this.#s;for(let t=0;t<this.#u;t++){let r=e.#r[t];if(!(r instanceof i&&r.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.#r.length:0;return this.#u===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new i(this.type,e);for(let r of this.#r)t.copyIn(r);return t}static#a(e,t,r,s){let n=!1,a=!1,c=-1,u=!1;if(t.type===null){let m=r,y="";for(;m<e.length;){let g=e.charAt(m++);if(n||g==="\\"){n=!n,y+=g;continue}if(a){m===c+1?(g==="^"||g==="!")&&(u=!0):g==="]"&&!(m===c+2&&u)&&(a=!1),y+=g;continue}else if(g==="["){a=!0,c=m,u=!1,y+=g;continue}if(!s.noext&&NO(g)&&e.charAt(m)==="("){t.push(y),y="";let S=new i(g,t);m=i.#a(e,S,m,s),t.push(S);continue}y+=g}return t.push(y),m}let l=r+1,h=new i(null,t),f=[],p="";for(;l<e.length;){let m=e.charAt(l++);if(n||m==="\\"){n=!n,p+=m;continue}if(a){l===c+1?(m==="^"||m==="!")&&(u=!0):m==="]"&&!(l===c+2&&u)&&(a=!1),p+=m;continue}else if(m==="["){a=!0,c=l,u=!1,p+=m;continue}if(NO(m)&&e.charAt(l)==="("){h.push(p),p="";let y=new i(m,h);h.push(y),l=i.#a(e,y,l,s);continue}if(m==="|"){h.push(p),p="",f.push(h),h=new i(null,t);continue}if(m===")")return p===""&&t.#r.length===0&&(t.#o=!0),h.push(p),p="",t.push(...f,h),l;p+=m}return t.type=null,t.#t=void 0,t.#r=[e.substring(r-1)],l}static fromGlob(e,t={}){let r=new i(null,void 0,t);return i.#a(e,r,0,t),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,r,s,n]=this.toRegExpSource();if(!(s||this.#t||this.#n.nocase&&!this.#n.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let c=(this.#n.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${t}$`,c),{_src:t,_glob:e})}get options(){return this.#n}toRegExpSource(e){let t=e??!!this.#n.dot;if(this.#e===this&&this.#d(),!this.type){let u=this.isStart()&&this.isEnd(),l=this.#r.map(m=>{let[y,g,S,E]=typeof m=="string"?i.#y(m,this.#t,u):m.toRegExpSource(e);return this.#t=this.#t||S,this.#i=this.#i||E,y}).join(""),h="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&g2.has(this.#r[0]))){let y=m2,g=t&&y.has(l.charAt(0))||l.startsWith("\\.")&&y.has(l.charAt(2))||l.startsWith("\\.\\.")&&y.has(l.charAt(4)),S=!t&&!e&&y.has(l.charAt(0));h=g?p2:S?sl:""}let f="";return this.isEnd()&&this.#e.#f&&this.#s?.type==="!"&&(f="(?:$|\\/)"),[h+l+f,(0,rl.unescape)(l),this.#t=!!this.#t,this.#i]}let r=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#p(t);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let u=this.toString();return this.#r=[u],this.type=null,this.#t=void 0,[u,(0,rl.unescape)(this.toString()),!1,!1]}let a=!r||e||t||!sl?"":this.#p(!0);a===n&&(a=""),a&&(n=`(?:${n})(?:${a})*?`);let c="";if(this.type==="!"&&this.#o)c=(this.isStart()&&!t?sl:"")+DO;else{let u=this.type==="!"?"))"+(this.isStart()&&!t&&!e?sl:"")+PO+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;c=s+n+u}return[c,(0,rl.unescape)(n),this.#t=!!this.#t,this.#i]}#p(e){return this.#r.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[r,s,n,a]=t.toRegExpSource(e);return this.#i=this.#i||a,r}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#y(e,t,r=!1){let s=!1,n="",a=!1;for(let c=0;c<e.length;c++){let u=e.charAt(c);if(s){s=!1,n+=(y2.has(u)?"\\":"")+u;continue}if(u==="\\"){c===e.length-1?n+="\\\\":s=!0;continue}if(u==="["){let[l,h,f,p]=(0,f2.parseClass)(e,c);if(f){n+=l,a=a||h,c+=f-1,t=t||p;continue}}if(u==="*"){r&&e==="*"?n+=DO:n+=PO,t=!0;continue}if(u==="?"){n+=jm,t=!0;continue}n+=S2(u)}return[n,(0,rl.unescape)(e),!!t,a]}};nl.AST=Um});var qm=d(ol=>{"use strict";Object.defineProperty(ol,"__esModule",{value:!0});ol.escape=void 0;var E2=o((i,{windowsPathsNoEscape:e=!1}={})=>e?i.replace(/[?*()[\]]/g,"[$&]"):i.replace(/[?*()[\]\\]/g,"\\$&"),"escape");ol.escape=E2});var Mi=d(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.unescape=C.escape=C.AST=C.Minimatch=C.match=C.makeRe=C.braceExpand=C.defaults=C.filter=C.GLOBSTAR=C.sep=C.minimatch=void 0;var w2=RO(),al=AO(),MO=$m(),_2=qm(),b2=il(),I2=o((i,e,t={})=>((0,al.assertValidPattern)(e),!t.nocomment&&e.charAt(0)==="#"?!1:new cs(e,t).match(i)),"minimatch");C.minimatch=I2;var O2=/^\*+([^+@!?\*\[\(]*)$/,v2=o(i=>e=>!e.startsWith(".")&&e.endsWith(i),"starDotExtTest"),R2=o(i=>e=>e.endsWith(i),"starDotExtTestDot"),A2=o(i=>(i=i.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(i)),"starDotExtTestNocase"),T2=o(i=>(i=i.toLowerCase(),e=>e.toLowerCase().endsWith(i)),"starDotExtTestNocaseDot"),C2=/^\*+\.\*+$/,N2=o(i=>!i.startsWith(".")&&i.includes("."),"starDotStarTest"),P2=o(i=>i!=="."&&i!==".."&&i.includes("."),"starDotStarTestDot"),D2=/^\.\*+$/,x2=o(i=>i!=="."&&i!==".."&&i.startsWith("."),"dotStarTest"),L2=/^\*+$/,M2=o(i=>i.length!==0&&!i.startsWith("."),"starTest"),B2=o(i=>i.length!==0&&i!=="."&&i!=="..","starTestDot"),k2=/^\?+([^+@!?\*\[\(]*)?$/,F2=o(([i,e=""])=>{let t=BO([i]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocase"),U2=o(([i,e=""])=>{let t=kO([i]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocaseDot"),j2=o(([i,e=""])=>{let t=kO([i]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTestDot"),$2=o(([i,e=""])=>{let t=BO([i]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTest"),BO=o(([i])=>{let e=i.length;return t=>t.length===e&&!t.startsWith(".")},"qmarksTestNoExt"),kO=o(([i])=>{let e=i.length;return t=>t.length===e&&t!=="."&&t!==".."},"qmarksTestNoExtDot"),FO=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",xO={win32:{sep:"\\"},posix:{sep:"/"}};C.sep=FO==="win32"?xO.win32.sep:xO.posix.sep;C.minimatch.sep=C.sep;C.GLOBSTAR=Symbol("globstar **");C.minimatch.GLOBSTAR=C.GLOBSTAR;var q2="[^/]",V2=q2+"*?",z2="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",H2="(?:(?!(?:\\/|^)\\.).)*?",G2=o((i,e={})=>t=>(0,C.minimatch)(t,i,e),"filter");C.filter=G2;C.minimatch.filter=C.filter;var Et=o((i,e={})=>Object.assign({},i,e),"ext"),W2=o(i=>{if(!i||typeof i!="object"||!Object.keys(i).length)return C.minimatch;let e=C.minimatch;return Object.assign(o((r,s,n={})=>e(r,s,Et(i,n)),"m"),{Minimatch:class extends e.Minimatch{static{o(this,"Minimatch")}constructor(s,n={}){super(s,Et(i,n))}static defaults(s){return e.defaults(Et(i,s)).Minimatch}},AST:class extends e.AST{static{o(this,"AST")}constructor(s,n,a={}){super(s,n,Et(i,a))}static fromGlob(s,n={}){return e.AST.fromGlob(s,Et(i,n))}},unescape:o((r,s={})=>e.unescape(r,Et(i,s)),"unescape"),escape:o((r,s={})=>e.escape(r,Et(i,s)),"escape"),filter:o((r,s={})=>e.filter(r,Et(i,s)),"filter"),defaults:o(r=>e.defaults(Et(i,r)),"defaults"),makeRe:o((r,s={})=>e.makeRe(r,Et(i,s)),"makeRe"),braceExpand:o((r,s={})=>e.braceExpand(r,Et(i,s)),"braceExpand"),match:o((r,s,n={})=>e.match(r,s,Et(i,n)),"match"),sep:e.sep,GLOBSTAR:C.GLOBSTAR})},"defaults");C.defaults=W2;C.minimatch.defaults=C.defaults;var J2=o((i,e={})=>((0,al.assertValidPattern)(i),e.nobrace||!/\{(?:(?!\{).)*\}/.test(i)?[i]:(0,w2.expand)(i)),"braceExpand");C.braceExpand=J2;C.minimatch.braceExpand=C.braceExpand;var K2=o((i,e={})=>new cs(i,e).makeRe(),"makeRe");C.makeRe=K2;C.minimatch.makeRe=C.makeRe;var Z2=o((i,e,t={})=>{let r=new cs(e,t);return i=i.filter(s=>r.match(s)),r.options.nonull&&!i.length&&i.push(e),i},"match");C.match=Z2;C.minimatch.match=C.match;var LO=/[?*]|[+@!]\(.*?\)|\[|\]/,Y2=o(i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),cs=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,al.assertValidPattern)(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||FO,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...n)=>{}),this.debug(this.pattern,this.globSet);let r=this.globSet.map(n=>this.slashSplit(n));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let s=this.globParts.map((n,a,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=n[0]===""&&n[1]===""&&(n[2]==="?"||!LO.test(n[2]))&&!LO.test(n[3]),l=/^[a-z]:/i.test(n[0]);if(u)return[...n.slice(0,4),...n.slice(4).map(h=>this.parse(h))];if(l)return[n[0],...n.slice(1).map(h=>this.parse(h))]}return n.map(u=>this.parse(u))});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 r=0;r<e.length;r++)for(let s=0;s<e[r].length;s++)e[r][s]==="**"&&(e[r][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 r=-1;for(;(r=t.indexOf("**",r+1))!==-1;){let s=r;for(;t[s+1]==="**";)s++;s!==r&&t.splice(r,s-r)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((r,s)=>{let n=r[r.length-1];return s==="**"&&n==="**"?r:s===".."&&n&&n!==".."&&n!=="."&&n!=="**"?(r.pop(),r):(r.push(s),r)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let 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 r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let s=e[r-1];s&&s!=="."&&s!==".."&&s!=="**"&&(t=!0,e.splice(r-1,2),r-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let r of e){let s=-1;for(;(s=r.indexOf("**",s+1))!==-1;){let a=s;for(;r[a+1]==="**";)a++;a>s&&r.splice(s+1,a-s);let c=r[s+1],u=r[s+2],l=r[s+3];if(c!==".."||!u||u==="."||u===".."||!l||l==="."||l==="..")continue;t=!0,r.splice(s,1);let h=r.slice(0);h[s]="**",e.push(h),s--}if(!this.preserveMultipleSlashes){for(let a=1;a<r.length-1;a++){let c=r[a];a===1&&c===""&&r[0]===""||(c==="."||c==="")&&(t=!0,r.splice(a,1),a--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(t=!0,r.pop())}let n=0;for(;(n=r.indexOf("..",n+1))!==-1;){let a=r[n-1];if(a&&a!=="."&&a!==".."&&a!=="**"){t=!0;let u=n===1&&r[n+1]==="**"?["."]:[];r.splice(n-1,2,...u),r.length===0&&r.push(""),n-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let r=t+1;r<e.length;r++){let s=this.partsMatch(e[t],e[r],!this.preserveMultipleSlashes);if(s){e[t]=[],e[r]=s;break}}return e.filter(t=>t.length)}partsMatch(e,t,r=!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(r&&e[s]==="**"&&t[n]===e[s+1])a.push(e[s]),s++;else if(r&&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,r=0;for(let s=0;s<e.length&&e.charAt(s)==="!";s++)t=!t,r++;r&&(this.pattern=e.slice(r)),this.negate=t}matchOne(e,t,r=!1){let s=this.options;if(this.isWindows){let g=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),S=!g&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),E=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),_=!E&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),b=S?3:g?0:void 0,w=_?3:E?0:void 0;if(typeof b=="number"&&typeof w=="number"){let[I,v]=[e[b],t[w]];I.toLowerCase()===v.toLowerCase()&&(t[w]=I,w>b?t=t.slice(w):b>w&&(e=e.slice(b)))}}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,u=e.length,l=t.length;a<u&&c<l;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===C.GLOBSTAR){this.debug("GLOBSTAR",[t,h,f]);var p=a,m=c+1;if(m===l){for(this.debug("** at the end");a<u;a++)if(e[a]==="."||e[a]===".."||!s.dot&&e[a].charAt(0)===".")return!1;return!0}for(;p<u;){var y=e[p];if(this.debug(`
7
8
  globstar while`,e,p,t,m,y),this.matchOne(e.slice(p),t.slice(m),r))return this.debug("globstar found match!",p,u,y),!0;if(y==="."||y===".."||!s.dot&&y.charAt(0)==="."){this.debug("dot detected!",e,p,t,m);break}this.debug("globstar swallow a segment, and continue"),p++}return!!(r&&(this.debug(`
8
- >>> no match, partial?`,e,p,t,m),p===u))}let g;if(typeof h=="string"?(g=f===h,this.debug("string match",h,f,g)):(g=h.test(f),this.debug("pattern match",h,f,g)),!g)return!1}if(a===u&&c===l)return!0;if(a===u)return r;if(c===l)return a===u-1&&e[a]==="";throw new Error("wtf?")}braceExpand(){return(0,C.braceExpand)(this.pattern,this.options)}parse(e){(0,al.assertValidPattern)(e);let t=this.options;if(e==="**")return C.GLOBSTAR;if(e==="")return"";let r,s=null;(r=e.match(D2))?s=t.dot?L2:x2:(r=e.match(b2))?s=(t.nocase?t.dot?R2:v2:t.dot?O2:I2)(r[1]):(r=e.match(M2))?s=(t.nocase?t.dot?k2:B2:t.dot?F2:U2)(r):(r=e.match(A2))?s=t.dot?C2:T2:(r=e.match(N2))&&(s=P2);let n=MO.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,r=t.noglobstar?$2:t.dot?q2:V2,s=new Set(t.nocase?["i"]:[]),n=e.map(u=>{let l=u.map(h=>{if(h instanceof RegExp)for(let f of h.flags.split(""))s.add(f);return typeof h=="string"?K2(h):h===C.GLOBSTAR?C.GLOBSTAR:h._src});return l.forEach((h,f)=>{let p=l[f+1],m=l[f-1];h!==C.GLOBSTAR||m===C.GLOBSTAR||(m===void 0?p!==void 0&&p!==C.GLOBSTAR?l[f+1]="(?:\\/|"+r+"\\/)?"+p:l[f]=r:p===void 0?l[f-1]=m+"(?:\\/|"+r+")?":p!==C.GLOBSTAR&&(l[f-1]=m+"(?:\\/|\\/"+r+"\\/)"+p,l[f+1]=C.GLOBSTAR))}),l.filter(h=>h!==C.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 r=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 u=n[c],l=s;if(r.matchBase&&u.length===1&&(l=[a]),this.matchOne(l,u,t))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return C.minimatch.defaults(e).Minimatch}};C.Minimatch=cs;var Z2=$m();Object.defineProperty(C,"AST",{enumerable:!0,get:o(function(){return Z2.AST},"get")});var Y2=qm();Object.defineProperty(C,"escape",{enumerable:!0,get:o(function(){return Y2.escape},"get")});var X2=il();Object.defineProperty(C,"unescape",{enumerable:!0,get:o(function(){return X2.unescape},"get")});C.minimatch.AST=MO.AST;C.minimatch.Minimatch=cs;C.minimatch.escape=E2.escape;C.minimatch.unescape=w2.unescape});var te=d(Ve=>{"use strict";var Q2=Ve&&Ve.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.Minipass=Ve.isWritable=Ve.isReadable=Ve.isStream=void 0;var UO=typeof process=="object"&&process?process:{stdout:null,stderr:null},Km=require("node:events"),VO=Q2(require("node:stream")),eq=require("node:string_decoder"),tq=o(i=>!!i&&typeof i=="object"&&(i instanceof pl||i instanceof VO.default||(0,Ve.isReadable)(i)||(0,Ve.isWritable)(i)),"isStream");Ve.isStream=tq;var iq=o(i=>!!i&&typeof i=="object"&&i instanceof Km.EventEmitter&&typeof i.pipe=="function"&&i.pipe!==VO.default.Writable.prototype.pipe,"isReadable");Ve.isReadable=iq;var rq=o(i=>!!i&&typeof i=="object"&&i instanceof Km.EventEmitter&&typeof i.write=="function"&&typeof i.end=="function","isWritable");Ve.isWritable=rq;var Bi=Symbol("EOF"),ki=Symbol("maybeEmitEnd"),pr=Symbol("emittedEnd"),cl=Symbol("emittingEnd"),ma=Symbol("emittedError"),ul=Symbol("closed"),jO=Symbol("read"),ll=Symbol("flush"),$O=Symbol("flushChunk"),Vt=Symbol("encoding"),hn=Symbol("decoder"),ve=Symbol("flowing"),ga=Symbol("paused"),fn=Symbol("resume"),Re=Symbol("buffer"),qe=Symbol("pipes"),Ae=Symbol("bufferLength"),Vm=Symbol("bufferPush"),hl=Symbol("bufferShift"),xe=Symbol("objectMode"),pe=Symbol("destroyed"),zm=Symbol("error"),Hm=Symbol("emitData"),qO=Symbol("emitEnd"),Gm=Symbol("emitEnd2"),ri=Symbol("async"),Wm=Symbol("abort"),fl=Symbol("aborted"),ya=Symbol("signal"),us=Symbol("dataListeners"),ct=Symbol("discarded"),Sa=o(i=>Promise.resolve().then(i),"defer"),sq=o(i=>i(),"nodefer"),nq=o(i=>i==="end"||i==="finish"||i==="prefinish","isEndish"),oq=o(i=>i instanceof ArrayBuffer||!!i&&typeof i=="object"&&i.constructor&&i.constructor.name==="ArrayBuffer"&&i.byteLength>=0,"isArrayBufferLike"),aq=o(i=>!Buffer.isBuffer(i)&&ArrayBuffer.isView(i),"isArrayBufferView"),dl=class{static{o(this,"Pipe")}src;dest;opts;ondrain;constructor(e,t,r){this.src=e,this.dest=t,this.opts=r,this.ondrain=()=>e[fn](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Jm=class extends dl{static{o(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,r){super(e,t,r),this.proxyErrors=s=>t.emit("error",s),e.on("error",this.proxyErrors)}},cq=o(i=>!!i.objectMode,"isObjectModeOptions"),uq=o(i=>!i.objectMode&&!!i.encoding&&i.encoding!=="buffer","isEncodingOptions"),pl=class extends Km.EventEmitter{static{o(this,"Minipass")}[ve]=!1;[ga]=!1;[qe]=[];[Re]=[];[xe];[Vt];[ri];[hn];[Bi]=!1;[pr]=!1;[cl]=!1;[ul]=!1;[ma]=null;[Ae]=0;[pe]=!1;[ya];[fl]=!1;[us]=0;[ct]=!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");cq(t)?(this[xe]=!0,this[Vt]=null):uq(t)?(this[Vt]=t.encoding,this[xe]=!1):(this[xe]=!1,this[Vt]=null),this[ri]=!!t.async,this[hn]=this[Vt]?new eq.StringDecoder(this[Vt]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:o(()=>this[Re],"get")}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:o(()=>this[qe],"get")});let{signal:r}=t;r&&(this[ya]=r,r.aborted?this[Wm]():r.addEventListener("abort",()=>this[Wm]()))}get bufferLength(){return this[Ae]}get encoding(){return this[Vt]}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[xe]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[ri]}set async(e){this[ri]=this[ri]||!!e}[Wm](){this[fl]=!0,this.emit("abort",this[ya]?.reason),this.destroy(this[ya]?.reason)}get aborted(){return this[fl]}set aborted(e){}write(e,t,r){if(this[fl])return!1;if(this[Bi])throw new Error("write after end");if(this[pe])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let s=this[ri]?Sa:sq;if(!this[xe]&&!Buffer.isBuffer(e)){if(aq(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(oq(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[xe]?(this[ve]&&this[Ae]!==0&&this[ll](!0),this[ve]?this.emit("data",e):this[Vm](e),this[Ae]!==0&&this.emit("readable"),r&&s(r),this[ve]):e.length?(typeof e=="string"&&!(t===this[Vt]&&!this[hn]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[Vt]&&(e=this[hn].write(e)),this[ve]&&this[Ae]!==0&&this[ll](!0),this[ve]?this.emit("data",e):this[Vm](e),this[Ae]!==0&&this.emit("readable"),r&&s(r),this[ve]):(this[Ae]!==0&&this.emit("readable"),r&&s(r),this[ve])}read(e){if(this[pe])return null;if(this[ct]=!1,this[Ae]===0||e===0||e&&e>this[Ae])return this[ki](),null;this[xe]&&(e=null),this[Re].length>1&&!this[xe]&&(this[Re]=[this[Vt]?this[Re].join(""):Buffer.concat(this[Re],this[Ae])]);let t=this[jO](e||null,this[Re][0]);return this[ki](),t}[jO](e,t){if(this[xe])this[hl]();else{let r=t;e===r.length||e===null?this[hl]():typeof r=="string"?(this[Re][0]=r.slice(e),t=r.slice(0,e),this[Ae]-=e):(this[Re][0]=r.subarray(e),t=r.subarray(0,e),this[Ae]-=e)}return this.emit("data",t),!this[Re].length&&!this[Bi]&&this.emit("drain"),t}end(e,t,r){return typeof e=="function"&&(r=e,e=void 0),typeof t=="function"&&(r=t,t="utf8"),e!==void 0&&this.write(e,t),r&&this.once("end",r),this[Bi]=!0,this.writable=!1,(this[ve]||!this[ga])&&this[ki](),this}[fn](){this[pe]||(!this[us]&&!this[qe].length&&(this[ct]=!0),this[ga]=!1,this[ve]=!0,this.emit("resume"),this[Re].length?this[ll]():this[Bi]?this[ki]():this.emit("drain"))}resume(){return this[fn]()}pause(){this[ve]=!1,this[ga]=!0,this[ct]=!1}get destroyed(){return this[pe]}get flowing(){return this[ve]}get paused(){return this[ga]}[Vm](e){this[xe]?this[Ae]+=1:this[Ae]+=e.length,this[Re].push(e)}[hl](){return this[xe]?this[Ae]-=1:this[Ae]-=this[Re][0].length,this[Re].shift()}[ll](e=!1){do;while(this[$O](this[hl]())&&this[Re].length);!e&&!this[Re].length&&!this[Bi]&&this.emit("drain")}[$O](e){return this.emit("data",e),this[ve]}pipe(e,t){if(this[pe])return e;this[ct]=!1;let r=this[pr];return t=t||{},e===UO.stdout||e===UO.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this[qe].push(t.proxyErrors?new Jm(this,e,t):new dl(this,e,t)),this[ri]?Sa(()=>this[fn]()):this[fn]()),e}unpipe(e){let t=this[qe].find(r=>r.dest===e);t&&(this[qe].length===1?(this[ve]&&this[us]===0&&(this[ve]=!1),this[qe]=[]):this[qe].splice(this[qe].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let r=super.on(e,t);if(e==="data")this[ct]=!1,this[us]++,!this[qe].length&&!this[ve]&&this[fn]();else if(e==="readable"&&this[Ae]!==0)super.emit("readable");else if(nq(e)&&this[pr])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[ma]){let s=t;this[ri]?Sa(()=>s.call(this,this[ma])):s.call(this,this[ma])}return r}removeListener(e,t){return this.off(e,t)}off(e,t){let r=super.off(e,t);return e==="data"&&(this[us]=this.listeners("data").length,this[us]===0&&!this[ct]&&!this[qe].length&&(this[ve]=!1)),r}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[us]=0,!this[ct]&&!this[qe].length&&(this[ve]=!1)),t}get emittedEnd(){return this[pr]}[ki](){!this[cl]&&!this[pr]&&!this[pe]&&this[Re].length===0&&this[Bi]&&(this[cl]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[ul]&&this.emit("close"),this[cl]=!1)}emit(e,...t){let r=t[0];if(e!=="error"&&e!=="close"&&e!==pe&&this[pe])return!1;if(e==="data")return!this[xe]&&!r?!1:this[ri]?(Sa(()=>this[Hm](r)),!0):this[Hm](r);if(e==="end")return this[qO]();if(e==="close"){if(this[ul]=!0,!this[pr]&&!this[pe])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[ma]=r,super.emit(zm,r);let n=!this[ya]||this.listeners("error").length?super.emit("error",r):!1;return this[ki](),n}else if(e==="resume"){let n=super.emit("resume");return this[ki](),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[ki](),s}[Hm](e){for(let r of this[qe])r.dest.write(e)===!1&&this.pause();let t=this[ct]?!1:super.emit("data",e);return this[ki](),t}[qO](){return this[pr]?!1:(this[pr]=!0,this.readable=!1,this[ri]?(Sa(()=>this[Gm]()),!0):this[Gm]())}[Gm](){if(this[hn]){let t=this[hn].end();if(t){for(let r of this[qe])r.dest.write(t);this[ct]||super.emit("data",t)}}for(let t of this[qe])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[xe]||(e.dataLength=0);let t=this.promise();return this.on("data",r=>{e.push(r),this[xe]||(e.dataLength+=r.length)}),await t,e}async concat(){if(this[xe])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Vt]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(pe,()=>t(new Error("stream destroyed"))),this.on("error",r=>t(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[ct]=!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[Bi])return t();let n,a,c=o(f=>{this.off("data",u),this.off("end",l),this.off(pe,h),t(),a(f)},"onerr"),u=o(f=>{this.off("error",c),this.off("end",l),this.off(pe,h),this.pause(),n({value:f,done:!!this[Bi]})},"ondata"),l=o(()=>{this.off("error",c),this.off("data",u),this.off(pe,h),t(),n({done:!0,value:void 0})},"onend"),h=o(()=>c(new Error("stream destroyed")),"ondestroy");return new Promise((f,p)=>{a=p,n=f,this.once(pe,h),this.once("error",c),this.once("end",l),this.once("data",u)})},"next"),throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[ct]=!1;let e=!1,t=o(()=>(this.pause(),this.off(zm,t),this.off(pe,t),this.off("end",t),e=!0,{done:!0,value:void 0}),"stop"),r=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(zm,t),this.once(pe,t),{next:r,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[pe])return e?this.emit("error",e):this.emit(pe),this;this[pe]=!0,this[ct]=!0,this[Re].length=0,this[Ae]=0;let t=this;return typeof t.close=="function"&&!this[ul]&&t.close(),e?this.emit("error",e):this.emit(pe),this}static get isStream(){return Ve.isStream}};Ve.Minipass=pl});var sv=d(W=>{"use strict";var lq=W&&W.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),hq=W&&W.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),fq=W&&W.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&lq(e,i,t);return hq(e,i),e};Object.defineProperty(W,"__esModule",{value:!0});W.PathScurry=W.Path=W.PathScurryDarwin=W.PathScurryPosix=W.PathScurryWin32=W.PathScurryBase=W.PathPosix=W.PathWin32=W.PathBase=W.ChildrenCache=W.ResolveCache=void 0;var KO=os(),El=require("node:path"),dq=require("node:url"),wa=require("fs"),pq=fq(require("node:fs")),mq=wa.realpathSync.native,ml=require("node:fs/promises"),zO=te(),_a={lstatSync:wa.lstatSync,readdir:wa.readdir,readdirSync:wa.readdirSync,readlinkSync:wa.readlinkSync,realpathSync:mq,promises:{lstat:ml.lstat,readdir:ml.readdir,readlink:ml.readlink,realpath:ml.realpath}},ZO=o(i=>!i||i===_a||i===pq?_a:{..._a,...i,promises:{..._a.promises,...i.promises||{}}},"fsFromOption"),YO=/^\\\\\?\\([a-z]:)\\?$/i,gq=o(i=>i.replace(/\//g,"\\").replace(YO,"$1\\"),"uncToDrive"),yq=/[\\\/]/,_t=0,XO=1,QO=2,si=4,ev=6,tv=8,ls=10,iv=12,wt=15,Ea=~wt,Zm=16,HO=32,ba=64,zt=128,gl=256,Sl=512,GO=ba|zt|Sl,Sq=1023,Ym=o(i=>i.isFile()?tv:i.isDirectory()?si:i.isSymbolicLink()?ls:i.isCharacterDevice()?QO:i.isBlockDevice()?ev:i.isSocket()?iv:i.isFIFO()?XO:_t,"entToType"),WO=new Map,Ia=o(i=>{let e=WO.get(i);if(e)return e;let t=i.normalize("NFKD");return WO.set(i,t),t},"normalize"),JO=new Map,yl=o(i=>{let e=JO.get(i);if(e)return e;let t=Ia(i.toLowerCase());return JO.set(i,t),t},"normalizeNocase"),Oa=class extends KO.LRUCache{static{o(this,"ResolveCache")}constructor(){super({max:256})}};W.ResolveCache=Oa;var wl=class extends KO.LRUCache{static{o(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:o(t=>t.length+1,"sizeCalculation")})}};W.ChildrenCache=wl;var rv=Symbol("PathScurry setAsCwd"),Ne=class{static{o(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#i;get mode(){return this.#i}#r;get nlink(){return this.#r}#s;get uid(){return this.#s}#u;get gid(){return this.#u}#c;get rdev(){return this.#c}#f;get blksize(){return this.#f}#n;get ino(){return this.#n}#h;get size(){return this.#h}#o;get blocks(){return this.#o}#d;get atimeMs(){return this.#d}#a;get mtimeMs(){return this.#a}#p;get ctimeMs(){return this.#p}#y;get birthtimeMs(){return this.#y}#_;get atime(){return this.#_}#m;get mtime(){return this.#m}#A;get ctime(){return this.#A}#w;get birthtime(){return this.#w}#b;#v;#I;#E;#N;#O;#l;#B;#R;#C;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=_t,r,s,n,a,c){this.name=e,this.#b=n?yl(e):Ia(e),this.#l=t&Sq,this.nocase=n,this.roots=s,this.root=r||this,this.#B=a,this.#I=c.fullpath,this.#N=c.relative,this.#O=c.relativePosix,this.parent=c.parent,this.parent?this.#e=this.parent.#e:this.#e=ZO(c.fs)}depth(){return this.#v!==void 0?this.#v:this.parent?this.#v=this.parent.depth()+1:this.#v=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).#k(s):this.#k(s)}#k(e){let t=this;for(let r of e)t=t.child(r);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.#l&=~Zm,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),s=this.nocase?yl(e):Ia(e);for(let u of r)if(u.#b===s)return u;let n=this.parent?this.sep:"",a=this.#I?this.#I+n+e:void 0,c=this.newChild(e,_t,{...t,parent:this,fullpath:a});return this.canReaddir()||(c.#l|=zt),r.push(c),c}relative(){if(this.isCWD)return"";if(this.#N!==void 0)return this.#N;let e=this.name,t=this.parent;if(!t)return this.#N=this.name;let r=t.relative();return r+(!r||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#O!==void 0)return this.#O;let e=this.name,t=this.parent;if(!t)return this.#O=this.fullpathPosix();let r=t.relativePosix();return r+(!r||!t.parent?"":"/")+e}fullpath(){if(this.#I!==void 0)return this.#I;let e=this.name,t=this.parent;if(!t)return this.#I=this.name;let s=t.fullpath()+(t.parent?this.sep:"")+e;return this.#I=s}fullpathPosix(){if(this.#E!==void 0)return this.#E;if(this.sep==="/")return this.#E=this.fullpath();if(!this.parent){let s=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(s)?this.#E=`//?/${s}`:this.#E=s}let e=this.parent,t=e.fullpathPosix(),r=t+(!t||!e.parent?"":"/")+this.name;return this.#E=r}isUnknown(){return(this.#l&wt)===_t}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.#l&wt)===tv}isDirectory(){return(this.#l&wt)===si}isCharacterDevice(){return(this.#l&wt)===QO}isBlockDevice(){return(this.#l&wt)===ev}isFIFO(){return(this.#l&wt)===XO}isSocket(){return(this.#l&wt)===iv}isSymbolicLink(){return(this.#l&ls)===ls}lstatCached(){return this.#l&HO?this:void 0}readlinkCached(){return this.#R}realpathCached(){return this.#C}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#R)return!0;if(!this.parent)return!1;let e=this.#l&wt;return!(e!==_t&&e!==ls||this.#l&gl||this.#l&zt)}calledReaddir(){return!!(this.#l&Zm)}isENOENT(){return!!(this.#l&zt)}isNamed(e){return this.nocase?this.#b===yl(e):this.#b===Ia(e)}async readlink(){let e=this.#R;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#e.promises.readlink(this.fullpath()),r=(await this.parent.realpath())?.resolve(t);if(r)return this.#R=r}catch(t){this.#S(t.code);return}}readlinkSync(){let e=this.#R;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#e.readlinkSync(this.fullpath()),r=this.parent.realpathSync()?.resolve(t);if(r)return this.#R=r}catch(t){this.#S(t.code);return}}#T(e){this.#l|=Zm;for(let t=e.provisional;t<e.length;t++){let r=e[t];r&&r.#$()}}#$(){this.#l&zt||(this.#l=(this.#l|zt)&Ea,this.#P())}#P(){let e=this.children();e.provisional=0;for(let t of e)t.#$()}#x(){this.#l|=Sl,this.#F()}#F(){if(this.#l&ba)return;let e=this.#l;(e&wt)===si&&(e&=Ea),this.#l=e|ba,this.#P()}#D(e=""){e==="ENOTDIR"||e==="EPERM"?this.#F():e==="ENOENT"?this.#$():this.children().provisional=0}#L(e=""){e==="ENOTDIR"?this.parent.#F():e==="ENOENT"&&this.#$()}#S(e=""){let t=this.#l;t|=gl,e==="ENOENT"&&(t|=zt),(e==="EINVAL"||e==="UNKNOWN")&&(t&=Ea),this.#l=t,e==="ENOTDIR"&&this.parent&&this.parent.#F()}#U(e,t){return this.#g(e,t)||this.#j(e,t)}#j(e,t){let r=Ym(e),s=this.newChild(e.name,r,{parent:this}),n=s.#l&wt;return n!==si&&n!==ls&&n!==_t&&(s.#l|=ba),t.unshift(s),t.provisional++,s}#g(e,t){for(let r=t.provisional;r<t.length;r++){let s=t[r];if((this.nocase?yl(e.name):Ia(e.name))===s.#b)return this.#q(e,s,r,t)}}#q(e,t,r,s){let n=t.name;return t.#l=t.#l&Ea|Ym(e),n!==e.name&&(t.name=e.name),r!==s.provisional&&(r===s.length-1?s.pop():s.splice(r,1),s.unshift(t)),s.provisional++,t}async lstat(){if((this.#l&zt)===0)try{return this.#V(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#L(e.code)}}lstatSync(){if((this.#l&zt)===0)try{return this.#V(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#L(e.code)}}#V(e){let{atime:t,atimeMs:r,birthtime:s,birthtimeMs:n,blksize:a,blocks:c,ctime:u,ctimeMs:l,dev:h,gid:f,ino:p,mode:m,mtime:y,mtimeMs:g,nlink:S,rdev:E,size:_,uid:b}=e;this.#_=t,this.#d=r,this.#w=s,this.#y=n,this.#f=a,this.#o=c,this.#A=u,this.#p=l,this.#t=h,this.#u=f,this.#n=p,this.#i=m,this.#m=y,this.#a=g,this.#r=S,this.#c=E,this.#h=_,this.#s=b;let w=Ym(e);this.#l=this.#l&Ea|w|HO,w!==_t&&w!==si&&w!==ls&&(this.#l|=ba)}#M=[];#z=!1;#G(e){this.#z=!1;let t=this.#M.slice();this.#M.length=0,t.forEach(r=>r(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let r=this.children();if(this.calledReaddir()){let n=r.slice(0,r.provisional);t?e(null,n):queueMicrotask(()=>e(null,n));return}if(this.#M.push(e),this.#z)return;this.#z=!0;let s=this.fullpath();this.#e.readdir(s,{withFileTypes:!0},(n,a)=>{if(n)this.#D(n.code),r.provisional=0;else{for(let c of a)this.#U(c,r);this.#T(r)}this.#G(r.slice(0,r.provisional))})}#H;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.#H)await this.#H;else{let r=o(()=>{},"resolve");this.#H=new Promise(s=>r=s);try{for(let s of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#U(s,e);this.#T(e)}catch(s){this.#D(s.code),e.provisional=0}this.#H=void 0,r()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let r of this.#e.readdirSync(t,{withFileTypes:!0}))this.#U(r,e);this.#T(e)}catch(r){this.#D(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#l&GO)return!1;let e=wt&this.#l;return e===_t||e===si||e===ls}shouldWalk(e,t){return(this.#l&si)===si&&!(this.#l&GO)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#C)return this.#C;if(!((Sl|gl|zt)&this.#l))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#C=this.resolve(e)}catch{this.#x()}}realpathSync(){if(this.#C)return this.#C;if(!((Sl|gl|zt)&this.#l))try{let e=this.#e.realpathSync(this.fullpath());return this.#C=this.resolve(e)}catch{this.#x()}}[rv](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),r=[],s=this;for(;s&&s.parent;)t.add(s),s.#N=r.join(this.sep),s.#O=r.join("/"),s=s.parent,r.push("..");for(s=e;s&&s.parent&&!t.has(s);)s.#N=void 0,s.#O=void 0,s=s.parent}};W.PathBase=Ne;var va=class i extends Ne{static{o(this,"PathWin32")}sep="\\";splitSep=yq;constructor(e,t=_t,r,s,n,a,c){super(e,t,r,s,n,a,c)}newChild(e,t=_t,r={}){return new i(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return El.win32.parse(e).root}getRoot(e){if(e=gq(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,r]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=r;return this.roots[e]=new Ta(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(YO,"$1\\"),e===t}};W.PathWin32=va;var Ra=class i extends Ne{static{o(this,"PathPosix")}splitSep="/";sep="/";constructor(e,t=_t,r,s,n,a,c){super(e,t,r,s,n,a,c)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=_t,r={}){return new i(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}};W.PathPosix=Ra;var Aa=class{static{o(this,"PathScurryBase")}root;rootPath;roots;cwd;#e;#t;#i;nocase;#r;constructor(e=process.cwd(),t,r,{nocase:s,childrenCacheSize:n=16*1024,fs:a=_a}={}){this.#r=ZO(a),(e instanceof URL||e.startsWith("file://"))&&(e=(0,dq.fileURLToPath)(e));let c=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(c),this.#e=new Oa,this.#t=new Oa,this.#i=new wl(n);let u=c.substring(this.rootPath.length).split(r);if(u.length===1&&!u[0]&&u.pop(),s===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=s,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let l=this.root,h=u.length-1,f=t.sep,p=this.rootPath,m=!1;for(let y of u){let g=h--;l=l.child(y,{relative:new Array(g).fill("..").join(f),relativePosix:new Array(g).fill("..").join("/"),fullpath:p+=(m?"":f)+y}),m=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#i}resolve(...e){let t="";for(let n=e.length-1;n>=0;n--){let a=e[n];if(!(!a||a===".")&&(t=t?`${a}/${t}`:a,this.isAbsolute(a)))break}let r=this.#e.get(t);if(r!==void 0)return r;let 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 r=this.#t.get(t);if(r!==void 0)return r;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 Ne||(t=e,e=this.cwd);let{withFileTypes:r}=t;if(e.canReaddir()){let s=await e.readdir();return r?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 Ne||(t=e,e=this.cwd);let{withFileTypes:r=!0}=t;return e.canReaddir()?r?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 Ne||(t=e.withFileTypes,e=this.cwd);let r=await e.readlink();return t?r:r?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ne||(t=e.withFileTypes,e=this.cwd);let r=e.readlinkSync();return t?r:r?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ne||(t=e.withFileTypes,e=this.cwd);let r=await e.realpath();return t?r:r?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ne||(t=e.withFileTypes,e=this.cwd);let r=e.realpathSync();return t?r:r?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ne||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:n,walkFilter:a}=t,c=[];(!n||n(e))&&c.push(r?e:e.fullpath());let u=new Set,l=o((f,p)=>{u.add(f),f.readdirCB((m,y)=>{if(m)return p(m);let g=y.length;if(!g)return p();let S=o(()=>{--g===0&&p()},"next");for(let E of y)(!n||n(E))&&c.push(r?E:E.fullpath()),s&&E.isSymbolicLink()?E.realpath().then(_=>_?.isUnknown()?_.lstat():_).then(_=>_?.shouldWalk(u,a)?l(_,S):S()):E.shouldWalk(u,a)?l(E,S):S()},!0)},"walk"),h=e;return new Promise((f,p)=>{l(h,m=>{if(m)return p(m);f(c)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ne||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:n,walkFilter:a}=t,c=[];(!n||n(e))&&c.push(r?e:e.fullpath());let u=new Set([e]);for(let l of u){let h=l.readdirSync();for(let f of h){(!n||n(f))&&c.push(r?f:f.fullpath());let p=f;if(f.isSymbolicLink()){if(!(s&&(p=f.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(u,a)&&u.add(p)}}return c}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ne||(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 Ne||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:n,walkFilter:a}=t;(!n||n(e))&&(yield r?e:e.fullpath());let c=new Set([e]);for(let u of c){let l=u.readdirSync();for(let h of l){(!n||n(h))&&(yield r?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 Ne||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:n,walkFilter:a}=t,c=new zO.Minipass({objectMode:!0});(!n||n(e))&&c.write(r?e:e.fullpath());let u=new Set,l=[e],h=0,f=o(()=>{let p=!1;for(;!p;){let m=l.shift();if(!m){h===0&&c.end();return}h++,u.add(m);let y=o((S,E,_=!1)=>{if(S)return c.emit("error",S);if(s&&!_){let b=[];for(let w of E)w.isSymbolicLink()&&b.push(w.realpath().then(I=>I?.isUnknown()?I.lstat():I));if(b.length){Promise.all(b).then(()=>y(null,E,!0));return}}for(let b of E)b&&(!n||n(b))&&(c.write(r?b:b.fullpath())||(p=!0));h--;for(let b of E){let w=b.realpathCached()||b;w.shouldWalk(u,a)&&l.push(w)}p&&!c.flowing?c.once("drain",f):g||f()},"onReaddir"),g=!0;m.readdirCB(y,!0),g=!1}},"process");return f(),c}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ne||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:n,walkFilter:a}=t,c=new zO.Minipass({objectMode:!0}),u=new Set;(!n||n(e))&&c.write(r?e:e.fullpath());let l=[e],h=0,f=o(()=>{let p=!1;for(;!p;){let m=l.shift();if(!m){h===0&&c.end();return}h++,u.add(m);let y=m.readdirSync();for(let g of y)(!n||n(g))&&(c.write(r?g:g.fullpath())||(p=!0));h--;for(let g of y){let S=g;if(g.isSymbolicLink()){if(!(s&&(S=g.realpathSync())))continue;S.isUnknown()&&S.lstatSync()}S.shouldWalk(u,a)&&l.push(S)}}p&&!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[rv](t)}};W.PathScurryBase=Aa;var Ta=class extends Aa{static{o(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,El.win32,"\\",{...t,nocase:r}),this.nocase=r;for(let s=this.cwd;s;s=s.parent)s.nocase=this.nocase}parseRootPath(e){return El.win32.parse(e).root.toUpperCase()}newRoot(e){return new va(this.rootPath,si,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}};W.PathScurryWin32=Ta;var Ca=class extends Aa{static{o(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),t={}){let{nocase:r=!1}=t;super(e,El.posix,"/",{...t,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new Ra(this.rootPath,si,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}};W.PathScurryPosix=Ca;var _l=class extends Ca{static{o(this,"PathScurryDarwin")}constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,{...t,nocase:r})}};W.PathScurryDarwin=_l;W.Path=process.platform==="win32"?va:Ra;W.PathScurry=process.platform==="win32"?Ta:process.platform==="darwin"?_l:Ca});var Qm=d(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});bl.Pattern=void 0;var Eq=Mi(),wq=o(i=>i.length>=1,"isPatternList"),_q=o(i=>i.length>=1,"isGlobList"),Xm=class i{static{o(this,"Pattern")}#e;#t;#i;length;#r;#s;#u;#c;#f;#n;#h=!0;constructor(e,t,r,s){if(!wq(e))throw new TypeError("empty pattern list");if(!_q(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,r<0||r>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=t,this.#i=r,this.#r=s,this.#i===0){if(this.isUNC()){let[n,a,c,u,...l]=this.#e,[h,f,p,m,...y]=this.#t;l[0]===""&&(l.shift(),y.shift());let g=[n,a,c,u,""].join("/"),S=[h,f,p,m,""].join("/");this.#e=[g,...l],this.#t=[S,...y],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[n,...a]=this.#e,[c,...u]=this.#t;a[0]===""&&(a.shift(),u.shift());let l=n+"/",h=c+"/";this.#e=[l,...a],this.#t=[h,...u],this.length=this.#e.length}}}pattern(){return this.#e[this.#i]}isString(){return typeof this.#e[this.#i]=="string"}isGlobstar(){return this.#e[this.#i]===Eq.GLOBSTAR}isRegExp(){return this.#e[this.#i]instanceof RegExp}globString(){return this.#u=this.#u||(this.#i===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#i).join("/"))}hasMore(){return this.length>this.#i+1}rest(){return this.#s!==void 0?this.#s:this.hasMore()?(this.#s=new i(this.#e,this.#t,this.#i+1,this.#r),this.#s.#n=this.#n,this.#s.#f=this.#f,this.#s.#c=this.#c,this.#s):this.#s=null}isUNC(){let e=this.#e;return this.#f!==void 0?this.#f:this.#f=this.#r==="win32"&&this.#i===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#c!==void 0?this.#c:this.#c=this.#r==="win32"&&this.#i===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#n!==void 0?this.#n:this.#n=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#i===0?e:""}checkFollowGlobstar(){return!(this.#i===0||!this.isGlobstar()||!this.#h)}markFollowGlobstar(){return this.#i===0||!this.isGlobstar()||!this.#h?!1:(this.#h=!1,!0)}};bl.Pattern=Xm});var tg=d(Il=>{"use strict";Object.defineProperty(Il,"__esModule",{value:!0});Il.Ignore=void 0;var nv=Mi(),bq=Qm(),Iq=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",eg=class{static{o(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:r,noext:s,noglobstar:n,platform:a=Iq}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=a,this.mmopts={dot:!0,nobrace:t,nocase:r,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 nv.Minimatch(e,this.mmopts);for(let r=0;r<t.set.length;r++){let s=t.set[r],n=t.globParts[r];if(!s||!n)throw new Error("invalid pattern object");for(;s[0]==="."&&n[0]===".";)s.shift(),n.shift();let a=new bq.Pattern(s,n,0,this.platform),c=new nv.Minimatch(a.globString(),this.mmopts),u=n[n.length-1]==="**",l=a.isAbsolute();l?this.absolute.push(c):this.relative.push(c),u&&(l?this.absoluteChildren.push(c):this.relativeChildren.push(c))}}ignored(e){let t=e.fullpath(),r=`${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(r))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",r=(e.relative()||".")+"/";for(let s of this.relativeChildren)if(s.match(r))return!0;for(let s of this.absoluteChildren)if(s.match(t))return!0;return!1}};Il.Ignore=eg});var av=d(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.Processor=ni.SubWalks=ni.MatchRecord=ni.HasWalkedCache=void 0;var ov=Mi(),Ol=class i{static{o(this,"HasWalkedCache")}store;constructor(e=new Map){this.store=e}copy(){return new i(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let r=e.fullpath(),s=this.store.get(r);s?s.add(t.globString()):this.store.set(r,new Set([t.globString()]))}};ni.HasWalkedCache=Ol;var vl=class{static{o(this,"MatchRecord")}store=new Map;add(e,t,r){let s=(t?2:0)|(r?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)])}};ni.MatchRecord=vl;var Rl=class{static{o(this,"SubWalks")}store=new Map;add(e,t){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(s=>s.globString()===t.globString())||r.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}};ni.SubWalks=Rl;var ig=class i{static{o(this,"Processor")}hasWalkedCache;matches=new vl;subwalks=new Rl;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new Ol}processPatterns(e,t){this.patterns=t;let r=t.map(s=>[e,s]);for(let[s,n]of r){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 u,l,h=!1;for(;typeof(u=n.pattern())=="string"&&(l=n.rest());)s=s.resolve(u),n=l,h=!0;if(u=n.pattern(),l=n.rest(),h){if(this.hasWalkedCache.hasWalked(s,n))continue;this.hasWalkedCache.storeWalked(s,n)}if(typeof u=="string"){let f=u===".."||u===""||u===".";this.matches.add(s.resolve(u),c,f);continue}else if(u===ov.GLOBSTAR){(!s.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(s,n);let f=l?.pattern(),p=l?.rest();if(!l||(f===""||f===".")&&!p)this.matches.add(s,c,f===""||f===".");else if(f===".."){let m=s.parent||s;p?this.hasWalkedCache.hasWalked(m,p)||this.subwalks.add(m,p):this.matches.add(m,c,!0)}}else u instanceof RegExp&&this.subwalks.add(s,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new i(this.opts,this.hasWalkedCache)}filterEntries(e,t){let r=this.subwalks.get(e),s=this.child();for(let n of t)for(let a of r){let c=a.isAbsolute(),u=a.pattern(),l=a.rest();u===ov.GLOBSTAR?s.testGlobstar(n,a,l,c):u instanceof RegExp?s.testRegExp(n,u,l,c):s.testString(n,u,l,c)}return s}testGlobstar(e,t,r,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()&&(r&&t.checkFollowGlobstar()?this.subwalks.add(e,r):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),r){let n=r.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(e,n,r.rest(),s);else if(n===".."){let a=e.parent||e;this.subwalks.add(a,r)}else n instanceof RegExp&&this.testRegExp(e,n,r.rest(),s)}}testRegExp(e,t,r,s){t.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,s,!1))}testString(e,t,r,s){e.isNamed(t)&&(r?this.subwalks.add(e,r):this.matches.add(e,s,!1))}};ni.Processor=ig});var lv=d(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.GlobStream=mr.GlobWalker=mr.GlobUtil=void 0;var Oq=te(),cv=tg(),uv=av(),vq=o((i,e)=>typeof i=="string"?new cv.Ignore([i],e):Array.isArray(i)?new cv.Ignore(i,e):i,"makeIgnore"),Na=class{static{o(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#i;signal;maxDepth;includeChildMatches;constructor(e,t,r){if(this.patterns=e,this.path=t,this.opts=r,this.#i=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#t=vq(r.ignore??[],r),!this.includeChildMatches&&typeof this.#t.add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#r(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#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 r;if(this.opts.realpath){if(r=e.realpathCached()||await e.realpath(),!r)return;e=r}let n=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let a=await n.realpath();a&&(a.isUnknown()||this.opts.stat)&&await a.lstat()}return this.matchCheckTest(n,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#r(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||e.realpathSync(),!r)return;e=r}let n=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let a=n.realpathSync();a&&(a?.isUnknown()||this.opts.stat)&&a.lstatSync()}return this.matchCheckTest(n,t)}matchFinish(e,t){if(this.#r(e))return;if(!this.includeChildMatches&&this.#t?.add){let n=`${e.relativePosix()}/**`;this.#t.add(n)}let r=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let s=this.opts.mark&&e.isDirectory()?this.#i:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(r){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.#i)?"."+this.#i:"";this.matchEmit(n?a+n+s:"."+s)}}async match(e,t,r){let s=await this.matchCheck(e,r);s&&this.matchFinish(s,t)}matchSync(e,t,r){let s=this.matchCheckSync(e,r);s&&this.matchFinish(s,t)}walkCB(e,t,r){this.signal?.aborted&&r(),this.walkCB2(e,t,new uv.Processor(this.opts),r)}walkCB2(e,t,r,s){if(this.#s(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2(e,t,r,s));return}r.processPatterns(e,t);let n=1,a=o(()=>{--n===0&&s()},"next");for(let[c,u,l]of r.matches.entries())this.#r(c)||(n++,this.match(c,u,l).then(()=>a()));for(let c of r.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;n++;let u=c.readdirCached();c.calledReaddir()?this.walkCB3(c,u,r,a):c.readdirCB((l,h)=>this.walkCB3(c,h,r,a),!0)}a()}walkCB3(e,t,r,s){r=r.filterEntries(e,t);let n=1,a=o(()=>{--n===0&&s()},"next");for(let[c,u,l]of r.matches.entries())this.#r(c)||(n++,this.match(c,u,l).then(()=>a()));for(let[c,u]of r.subwalks.entries())n++,this.walkCB2(c,u,r.child(),a);a()}walkCBSync(e,t,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,t,new uv.Processor(this.opts),r)}walkCB2Sync(e,t,r,s){if(this.#s(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,r,s));return}r.processPatterns(e,t);let n=1,a=o(()=>{--n===0&&s()},"next");for(let[c,u,l]of r.matches.entries())this.#r(c)||this.matchSync(c,u,l);for(let c of r.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;n++;let u=c.readdirSync();this.walkCB3Sync(c,u,r,a)}a()}walkCB3Sync(e,t,r,s){r=r.filterEntries(e,t);let n=1,a=o(()=>{--n===0&&s()},"next");for(let[c,u,l]of r.matches.entries())this.#r(c)||this.matchSync(c,u,l);for(let[c,u]of r.subwalks.entries())n++,this.walkCB2Sync(c,u,r.child(),a);a()}};mr.GlobUtil=Na;var rg=class extends Na{static{o(this,"GlobWalker")}matches=new Set;constructor(e,t,r){super(e,t,r)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}};mr.GlobWalker=rg;var sg=class extends Na{static{o(this,"GlobStream")}results;constructor(e,t,r){super(e,t,r),this.results=new Oq.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}};mr.GlobStream=sg});var og=d(Cl=>{"use strict";Object.defineProperty(Cl,"__esModule",{value:!0});Cl.Glob=void 0;var Rq=Mi(),Aq=require("node:url"),Al=sv(),Tq=Qm(),Tl=lv(),Cq=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ng=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,Aq.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(u=>u.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(u=>u.includes("/")?u:`./**/${u}`)}if(this.pattern=e,this.platform=t.platform||Cq,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 u=t.platform==="win32"?Al.PathScurryWin32:t.platform==="darwin"?Al.PathScurryDarwin:t.platform?Al.PathScurryPosix:Al.PathScurry;this.scurry=new u(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let r=this.platform==="darwin"||this.platform==="win32",s={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:r,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},n=this.pattern.map(u=>new Rq.Minimatch(u,s)),[a,c]=n.reduce((u,l)=>(u[0].push(...l.set),u[1].push(...l.globParts),u),[[],[]]);this.patterns=a.map((u,l)=>{let h=c[l];if(!h)throw new Error("invalid pattern object");return new Tq.Pattern(u,h,0,this.platform)})}async walk(){return[...await new Tl.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 Tl.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 Tl.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 Tl.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()}};Cl.Glob=ng});var ag=d(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.hasMagic=void 0;var Nq=Mi(),Pq=o((i,e={})=>{Array.isArray(i)||(i=[i]);for(let t of i)if(new Nq.Minimatch(t,e).hasMagic())return!0;return!1},"hasMagic");Nl.hasMagic=Pq});var hg=d(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.glob=q.sync=q.iterate=q.iterateSync=q.stream=q.streamSync=q.Ignore=q.hasMagic=q.Glob=q.unescape=q.escape=void 0;q.globStreamSync=Pa;q.globStream=cg;q.globSync=ug;q.globIterateSync=Da;q.globIterate=lg;var hv=Mi(),hs=og(),Dq=ag(),dv=Mi();Object.defineProperty(q,"escape",{enumerable:!0,get:o(function(){return dv.escape},"get")});Object.defineProperty(q,"unescape",{enumerable:!0,get:o(function(){return dv.unescape},"get")});var xq=og();Object.defineProperty(q,"Glob",{enumerable:!0,get:o(function(){return xq.Glob},"get")});var Lq=ag();Object.defineProperty(q,"hasMagic",{enumerable:!0,get:o(function(){return Lq.hasMagic},"get")});var Mq=tg();Object.defineProperty(q,"Ignore",{enumerable:!0,get:o(function(){return Mq.Ignore},"get")});function Pa(i,e={}){return new hs.Glob(i,e).streamSync()}o(Pa,"globStreamSync");function cg(i,e={}){return new hs.Glob(i,e).stream()}o(cg,"globStream");function ug(i,e={}){return new hs.Glob(i,e).walkSync()}o(ug,"globSync");async function fv(i,e={}){return new hs.Glob(i,e).walk()}o(fv,"glob_");function Da(i,e={}){return new hs.Glob(i,e).iterateSync()}o(Da,"globIterateSync");function lg(i,e={}){return new hs.Glob(i,e).iterate()}o(lg,"globIterate");q.streamSync=Pa;q.stream=Object.assign(cg,{sync:Pa});q.iterateSync=Da;q.iterate=Object.assign(lg,{sync:Da});q.sync=Object.assign(ug,{stream:Pa,iterate:Da});q.glob=Object.assign(fv,{glob:fv,globSync:ug,sync:q.sync,globStream:cg,stream:q.stream,globStreamSync:Pa,streamSync:q.streamSync,globIterate:lg,iterate:q.iterate,globIterateSync:Da,iterateSync:q.iterateSync,Glob:hs.Glob,hasMagic:Dq.hasMagic,escape:hv.escape,unescape:hv.unescape});q.glob.glob=q.glob});var fg=d((the,Bq)=>{Bq.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 pv=d((ihe,kq)=>{kq.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 mv=d((rhe,Fq)=>{Fq.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 yv=d((she,gv)=>{"use strict";var Uq=[].concat(fg()).concat(pv()),jq=mv();gv.exports=function(i){var e=0;function t(){return e<i.length}o(t,"hasMore");function r(y){if(y instanceof RegExp){var g=i.slice(e),S=g.match(y);if(S)return e+=S[0].length,S[0]}else if(i.indexOf(y,e)===e)return e+=y.length,y}o(r,"read");function s(){r(/[ ]*/)}o(s,"skipWhitespace");function n(){for(var y,g=["WITH","AND","OR","(",")",":","+"],S=0;S<g.length&&(y=r(g[S]),!y);S++);if(y==="+"&&e>1&&i[e-2]===" ")throw new Error("Space before `+`");return y&&{type:"OPERATOR",string:y}}o(n,"operator");function a(){return r(/[A-Za-z0-9-.]+/)}o(a,"idstring");function c(){var y=a();if(!y)throw new Error("Expected idstring at offset "+e);return y}o(c,"expectIdstring");function u(){if(r("DocumentRef-")){var y=c();return{type:"DOCUMENTREF",string:y}}}o(u,"documentRef");function l(){if(r("LicenseRef-")){var y=c();return{type:"LICENSEREF",string:y}}}o(l,"licenseRef");function h(){var y=e,g=a();if(Uq.indexOf(g)!==-1)return{type:"LICENSE",string:g};if(jq.indexOf(g)!==-1)return{type:"EXCEPTION",string:g};e=y}o(h,"identifier");function f(){return n()||u()||l()||h()}o(f,"parseToken");for(var p=[];t()&&(s(),!!t());){var m=f();if(!m)throw new Error("Unexpected `"+i[e]+"` at offset "+e);p.push(m)}return p}});var Ev=d((ohe,Sv)=>{"use strict";Sv.exports=function(i){var e=0;function t(){return e<i.length}o(t,"hasMore");function r(){return t()?i[e]:null}o(r,"token");function s(){if(!t())throw new Error;e++}o(s,"next");function n(g){var S=r();if(S&&S.type==="OPERATOR"&&g===S.string)return s(),S.string}o(n,"parseOperator");function a(){if(n("WITH")){var g=r();if(g&&g.type==="EXCEPTION")return s(),g.string;throw new Error("Expected exception after `WITH`")}}o(a,"parseWith");function c(){var g=e,S="",E=r();if(E.type==="DOCUMENTREF"&&(s(),S+="DocumentRef-"+E.string+":",!n(":")))throw new Error("Expected `:` after `DocumentRef-...`");if(E=r(),E.type==="LICENSEREF")return s(),S+="LicenseRef-"+E.string,{license:S};e=g}o(c,"parseLicenseRef");function u(){var g=r();if(g&&g.type==="LICENSE"){s();var S={license:g.string};n("+")&&(S.plus=!0);var E=a();return E&&(S.exception=E),S}}o(u,"parseLicense");function l(){var g=n("(");if(g){var S=m();if(!n(")"))throw new Error("Expected `)`");return S}}o(l,"parseParenthesizedExpression");function h(){return l()||c()||u()}o(h,"parseAtom");function f(g,S){return o(function E(){var _=S();if(_){if(!n(g))return _;var b=E();if(!b)throw new Error("Expected expression");return{left:_,conjunction:g.toLowerCase(),right:b}}},"parseBinaryOp")}o(f,"makeBinaryOpParser");var p=f("AND",h),m=f("OR",p),y=m();if(!y||t())throw new Error("Syntax error");return y}});var dg=d((che,wv)=>{"use strict";var $q=yv(),qq=Ev();wv.exports=function(i){return qq($q(i))}});var Cv=d((uhe,Tv)=>{var Vq=dg(),zq=fg();function Pl(i){try{return Vq(i),!0}catch{return!1}}o(Pl,"valid");function Av(i,e){var t=e[0].length-i[0].length;return t!==0?t:i[0].toUpperCase().localeCompare(e[0].toUpperCase())}o(Av,"sortTranspositions");var _v=[["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(Av),Hq=0,Gq=1,bv=[function(i){return i.toUpperCase()},function(i){return i.trim()},function(i){return i.replace(/\./g,"")},function(i){return i.replace(/\s+/g,"")},function(i){return i.replace(/\s+/g,"-")},function(i){return i.replace("v","-")},function(i){return i.replace(/,?\s*(\d)/,"-$1")},function(i){return i.replace(/,?\s*(\d)/,"-$1.0")},function(i){return i.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2")},function(i){return i.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2.0")},function(i){return i[0].toUpperCase()+i.slice(1)},function(i){return i.replace("/","-")},function(i){return i.replace(/\s*V\s*(\d)/,"-$1").replace(/(\d)$/,"$1.0")},function(i){return i.indexOf("3.0")!==-1?i+"-or-later":i+"-only"},function(i){return i+"only"},function(i){return i.replace(/(\d)$/,"-$1.0")},function(i){return i.replace(/(-| )?(\d)$/,"-$2-Clause")},function(i){return i.replace(/(-| )clause(-| )(\d)/,"-$3-Clause")},function(i){return i.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i,"BSD-3-Clause")},function(i){return i.replace(/\bSimplified(-| )?BSD((-| )License)?/i,"BSD-2-Clause")},function(i){return i.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i,"BSD-2-Clause-$1BSD")},function(i){return i.replace(/\bClear(-| )?BSD((-| )License)?/i,"BSD-3-Clause-Clear")},function(i){return i.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i,"BSD-4-Clause")},function(i){return"CC-"+i},function(i){return"CC-"+i+"-4.0"},function(i){return i.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")},function(i){return"CC-"+i.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")+"-4.0"}],pg=zq.map(function(i){var e=/^(.*)-\d+\.\d+$/.exec(i);return e?[e[0],e[1]]:[i,null]}).reduce(function(i,e){var t=e[1];return i[t]=i[t]||[],i[t].push(e[0]),i},{}),Wq=Object.keys(pg).map(o(function(e){return[e,pg[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"));pg=void 0;var Iv=[["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(Wq).sort(Av),Jq=0,Kq=1,Ov=o(function(i){for(var e=0;e<bv.length;e++){var t=bv[e](i).trim();if(t!==i&&Pl(t))return t}return null},"validTransformation"),vv=o(function(i){for(var e=i.toUpperCase(),t=0;t<Iv.length;t++){var r=Iv[t];if(e.indexOf(r[Jq])>-1)return r[Kq]}return null},"validLastResort"),Rv=o(function(i,e){for(var t=0;t<_v.length;t++){var r=_v[t],s=r[Hq];if(i.indexOf(s)>-1){var n=i.replace(s,r[Gq]),a=e(n);if(a!==null)return a}}return null},"anyCorrection");Tv.exports=function(i,e){e=e||{};var t=e.upgrade===void 0?!0:!!e.upgrade;function r(c){return t?Zq(c):c}o(r,"postprocess");var s=typeof i=="string"&&i.trim().length!==0;if(!s)throw Error("Invalid argument. Expected non-empty string.");if(i=i.trim(),Pl(i))return r(i);var n=i.replace(/\+$/,"").trim();if(Pl(n))return r(n);var a=Ov(i);return a!==null||(a=Rv(i,function(c){return Pl(c)?c:Ov(c)}),a!==null)||(a=vv(i),a!==null)||(a=Rv(i,vv),a!==null)?r(a):null};function Zq(i){return["GPL-1.0","LGPL-1.0","AGPL-1.0","GPL-2.0","LGPL-2.0","AGPL-2.0","LGPL-2.1"].indexOf(i)!==-1?i+"-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(i)!==-1?i.replace(/\+$/,"-or-later"):["GPL-3.0","LGPL-3.0","AGPL-3.0"].indexOf(i)!==-1?i+"-or-later":i}o(Zq,"upgradeGPLs")});var xv=d((hhe,Dv)=>{var Yq=dg(),Xq=Cv(),Nv='license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"',Qq=/^SEE LICEN[CS]E IN (.+)$/;function Pv(i,e){return e.slice(0,i.length)===i}o(Pv,"startsWith");function mg(i){if(i.hasOwnProperty("license")){var e=i.license;return Pv("LicenseRef",e)||Pv("DocumentRef",e)}else return mg(i.left)||mg(i.right)}o(mg,"usesLicenseRef");Dv.exports=function(i){var e;try{e=Yq(i)}catch{var t;if(i==="UNLICENSED"||i==="UNLICENCED")return{validForOldPackages:!0,validForNewPackages:!0,unlicensed:!0};if(t=Qq.exec(i))return{validForOldPackages:!0,validForNewPackages:!0,inFile:t[1]};var r={validForOldPackages:!1,validForNewPackages:!1,warnings:[Nv]};if(i.trim().length!==0){var s=Xq(i);s&&r.warnings.push('license is similar to the valid expression "'+s+'"')}return r}return mg(e)?{validForNewPackages:!1,validForOldPackages:!1,spdx:!0,warnings:[Nv]}:{validForNewPackages:!0,validForOldPackages:!0,spdx:!0}}});var Uv=d((dhe,Fv)=>{var{URL:gg}=require("node:url"),Lv=Xu(),eV=xv(),Mv={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"},Bv=o(i=>i.includes("@")&&i.indexOf("@")<i.lastIndexOf("."),"isEmail");function tV(i){let e=i.trim().split(`
9
- `),t=0;for(;e[t]?.trim().match(/^(#|$)/);)t++;let r=t+1;for(;r<e.length&&e[r].trim();)r++;return e.slice(t,r).join(" ").trim()}o(tV,"extractDescription");function kv(i){if(typeof i!="string"){let n=i.name||"",a=i.url||i.web,c=a?" ("+a+")":"",u=i.email||i.mail,l=u?" <"+u+">":"";i=n+l+c}let e=i.match(/^([^(<]+)/),t=i.match(/\(([^()]+)\)/),r=i.match(/<([^<>]+)>/),s={};return e?.[0].trim()&&(s.name=e[0].trim()),r&&(s.email=r[1]),t&&(s.url=t[1]),s}o(kv,"stringifyPerson");function iV(i,e){i.description&&typeof i.description!="string"&&(e?.push("'description' field should be a string"),delete i.description),i.readme&&!i.description&&i.readme!=="ERROR: No README data found!"&&(i.description=tV(i.readme)),i.description===void 0&&delete i.description,i.description||e?.push("No description"),i.modules&&(e?.push("modules field is deprecated"),delete i.modules);let t=i.files;if(t&&!Array.isArray(t)?(e?.push("Invalid 'files' member"),delete i.files):i.files&&(i.files=i.files.filter(function(a){return!a||typeof a!="string"?(e?.push(`Invalid filename in 'files' list: ${a}`),!1):!0})),i.man&&typeof i.man=="string"&&(i.man=[i.man]),!i.bugs&&i.repository?.url){let a=Lv.fromUrl(i.repository.url);a&&a.bugs()&&(i.bugs={url:a.bugs()})}else if(i.bugs){if(typeof i.bugs=="string")Bv(i.bugs)?i.bugs={email:i.bugs}:gg.canParse(i.bugs)?i.bugs={url:i.bugs}:e?.push("Bug string field must be url, email, or {email,url}");else{for(let c in i.bugs)["web","name"].includes(c)&&(e?.push(`bugs['${c}'] should probably be bugs['url'].`),i.bugs.url=i.bugs[c],delete i.bugs[c]);let a=i.bugs;i.bugs={},a.url&&(gg.canParse(a.url)?i.bugs.url=a.url:e?.push("bugs.url field must be a string url. Deleted.")),a.email&&(typeof a.email=="string"&&Bv(a.email)?i.bugs.email=a.email:e?.push("bugs.email field must be a string email. Deleted."))}!i.bugs.email&&!i.bugs.url&&(delete i.bugs,e?.push("Normalized value of bugs field is an empty object. Deleted."))}typeof i.keywords=="string"&&(i.keywords=i.keywords.split(/,\s+/)),i.keywords&&!Array.isArray(i.keywords)?(delete i.keywords,e?.push("keywords should be an array of strings")):i.keywords&&(i.keywords=i.keywords.filter(function(a){return typeof a!="string"||!a?(e?.push("keywords should be an array of strings"),!1):!0}));let r="bundledDependencies",s="bundleDependencies";if(i[r]&&!i[s]&&(i[s]=i[r],delete i[r]),i[s]&&!Array.isArray(i[s])?(e?.push("Invalid 'bundleDependencies' list. Must be array of package names"),delete i[s]):i[s]&&(i[s]=i[s].filter(function(a){return!a||typeof a!="string"?(e?.push(`Invalid bundleDependencies member: ${a}`),!1):(i.dependencies||(i.dependencies={}),Object.prototype.hasOwnProperty.call(i.dependencies,a)||(e?.push(`Non-dependency in bundleDependencies: ${a}`),i.dependencies[a]="*"),!0)})),!i.homepage&&i.repository&&i.repository.url){let a=Lv.fromUrl(i.repository.url);a&&(i.homepage=a.docs())}i.homepage&&(typeof i.homepage!="string"?(e?.push("homepage field must be a string url. Deleted."),delete i.homepage):gg.canParse(i.homepage)||(i.homepage="http://"+i.homepage)),i.readme||(e?.push("No README data"),i.readme="ERROR: No README data found!");let n=i.license||i.licence;n?typeof n!="string"||n.length<1||n.trim()===""?e?.push("license should be a valid SPDX license expression"):eV(n).validForNewPackages||e?.push("license should be a valid SPDX license expression"):e?.push("No license field."),i.author&&(i.author=kv(i.author)),["maintainers","contributors"].forEach(function(a){Array.isArray(i[a])&&(i[a]=i[a].map(kv))});for(let a in Mv)Object.prototype.hasOwnProperty.call(i,a)&&e?.push(`${a} should probably be ${Mv[a]}.`)}o(iV,"normalizeData");Fv.exports={normalizeData:iV}});var $v=d(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});dn.sync=dn.isexe=void 0;var rV=require("fs"),sV=require("fs/promises"),nV=o(async(i,e={})=>{let{ignoreErrors:t=!1}=e;try{return jv(await(0,sV.stat)(i),e)}catch(r){let s=r;if(t||s.code==="EACCES")return!1;throw s}},"isexe");dn.isexe=nV;var oV=o((i,e={})=>{let{ignoreErrors:t=!1}=e;try{return jv((0,rV.statSync)(i),e)}catch(r){let s=r;if(t||s.code==="EACCES")return!1;throw s}},"sync");dn.sync=oV;var jv=o((i,e)=>i.isFile()&&aV(i,e),"checkStat"),aV=o((i,e)=>{let t=e.uid??process.getuid?.(),r=e.groups??process.getgroups?.()??[],s=e.gid??process.getgid?.()??r[0];if(t===void 0||s===void 0)throw new Error("cannot get uid or gid");let n=new Set([s,...r]),a=i.mode,c=i.uid,u=i.gid,l=parseInt("100",8),h=parseInt("010",8),f=parseInt("001",8),p=l|h;return!!(a&f||a&h&&n.has(u)||a&l&&c===t||a&p&&t===0)},"checkMode")});var Vv=d(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.sync=pn.isexe=void 0;var cV=require("fs"),uV=require("fs/promises"),lV=o(async(i,e={})=>{let{ignoreErrors:t=!1}=e;try{return qv(await(0,uV.stat)(i),i,e)}catch(r){let s=r;if(t||s.code==="EACCES")return!1;throw s}},"isexe");pn.isexe=lV;var hV=o((i,e={})=>{let{ignoreErrors:t=!1}=e;try{return qv((0,cV.statSync)(i),i,e)}catch(r){let s=r;if(t||s.code==="EACCES")return!1;throw s}},"sync");pn.sync=hV;var fV=o((i,e)=>{let{pathExt:t=process.env.PATHEXT||""}=e,r=t.split(";");if(r.indexOf("")!==-1)return!0;for(let s=0;s<r.length;s++){let n=r[s].toLowerCase(),a=i.substring(i.length-n.length).toLowerCase();if(n&&a===n)return!0}return!1},"checkPathExt"),qv=o((i,e,t)=>i.isFile()&&fV(e,t),"checkStat")});var Hv=d(zv=>{"use strict";Object.defineProperty(zv,"__esModule",{value:!0})});var Yv=d(Oe=>{"use strict";var Gv=Oe&&Oe.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),dV=Oe&&Oe.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Wv=Oe&&Oe.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&Gv(e,i,t);return dV(e,i),e},pV=Oe&&Oe.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Gv(e,i,t)};Object.defineProperty(Oe,"__esModule",{value:!0});Oe.sync=Oe.isexe=Oe.posix=Oe.win32=void 0;var Jv=Wv($v());Oe.posix=Jv;var Kv=Wv(Vv());Oe.win32=Kv;pV(Hv(),Oe);var mV=process.env._ISEXE_TEST_PLATFORM_||process.platform,Zv=mV==="win32"?Kv:Jv;Oe.isexe=Zv.isexe;Oe.sync=Zv.sync});var yg=d((bhe,oR)=>{var{isexe:gV,sync:yV}=Yv(),{join:SV,delimiter:EV,sep:Xv,posix:Qv}=require("path"),eR=process.platform==="win32",tR=new RegExp(`[${Qv.sep}${Xv===Qv.sep?"":Xv}]`.replace(/(\\)/g,"\\$1")),wV=new RegExp(`^\\.${tR.source}`),iR=o(i=>Object.assign(new Error(`not found: ${i}`),{code:"ENOENT"}),"getNotFoundError"),rR=o((i,{path:e=process.env.PATH,pathExt:t=process.env.PATHEXT,delimiter:r=EV})=>{let s=i.match(tR)?[""]:[...eR?[process.cwd()]:[],...(e||"").split(r)];if(eR){let n=t||[".EXE",".CMD",".BAT",".COM"].join(r),a=n.split(r).flatMap(c=>[c,c.toLowerCase()]);return i.includes(".")&&a[0]!==""&&a.unshift(""),{pathEnv:s,pathExt:a,pathExtExe:n}}return{pathEnv:s,pathExt:[""]}},"getPathInfo"),sR=o((i,e)=>{let t=/^".*"$/.test(i)?i.slice(1,-1):i;return(!t&&wV.test(e)?e.slice(0,2):"")+SV(t,e)},"getPathPart"),nR=o(async(i,e={})=>{let{pathEnv:t,pathExt:r,pathExtExe:s}=rR(i,e),n=[];for(let a of t){let c=sR(a,i);for(let u of r){let l=c+u;if(await gV(l,{pathExt:s,ignoreErrors:!0})){if(!e.all)return l;n.push(l)}}}if(e.all&&n.length)return n;if(e.nothrow)return null;throw iR(i)},"which"),_V=o((i,e={})=>{let{pathEnv:t,pathExt:r,pathExtExe:s}=rR(i,e),n=[];for(let a of t){let c=sR(a,i);for(let u of r){let l=c+u;if(yV(l,{pathExt:s,ignoreErrors:!0})){if(!e.all)return l;n.push(l)}}}if(e.all&&n.length)return n;if(e.nothrow)return null;throw iR(i)},"whichSync");oR.exports=nR;nR.sync=_V});var cR=d((Ohe,aR)=>{"use strict";var bV=o((i,e)=>{if(!i.length)return'""';let t;if(!/[ \t\n\v"]/.test(i))t=i;else{t='"';for(let r=0;r<=i.length;++r){let s=0;for(;i[r]==="\\";)++r,++s;if(r===i.length){t+="\\".repeat(s*2);break}i[r]==='"'?(t+="\\".repeat(s*2+1),t+=i[r]):(t+="\\".repeat(s),t+=i[r])}t+='"'}return t=t.replace(/[ !%^&()<>|"]/g,"^$&"),e&&(t=t.replace(/[ !%^&()<>|"]/g,"^$&")),t},"cmd"),IV=o(i=>i.length?/[\t\n\r "#$&'()*;<>?\\`|~]/.test(i)?`'${i.replace(/'/g,"'\\''")}'`.replace(/^(?:'')+(?!$)/,"").replace(/\\'''/g,"\\'"):i:"''","sh");aR.exports={cmd:bV,sh:IV}});var Dl=d((Rhe,fR)=>{"use strict";var{spawn:OV}=require("child_process"),vV=require("os"),RV=yg(),uR=cR(),Eg=o((i,e,t={},r={})=>{if(t.shell)return hR(i,e,t,r);let s,n,a=new Promise((m,y)=>{s=m,n=y}),c=new Error("command failed"),u=[],l=[],h=o(m=>({cmd:i,args:e,...m,...TV(u,l,t),...r}),"getResult"),f=o((m,y)=>{let g=h(y);n(Object.assign(m,g))},"rejectWithOpts"),p=OV(i,e,t);return a.stdin=p.stdin,a.process=p,p.on("error",f),p.stdout&&(p.stdout.on("data",m=>u.push(m)),p.stdout.on("error",f)),p.stderr&&(p.stderr.on("data",m=>l.push(m)),p.stderr.on("error",f)),p.on("close",(m,y)=>{m||y?f(c,{code:m,signal:y}):s(h({code:m,signal:y}))}),a},"promiseSpawn"),hR=o((i,e,t,r)=>{let s=t.shell;s===!0&&(s=process.platform==="win32"?process.env.ComSpec||"cmd.exe":"sh");let n={...t,shell:!1},a=[],c=i;if(/(?:^|\\)cmd(?:\.exe)?$/i.test(s)){let l=!1,h="",f=!1;for(let m=0;m<i.length;++m){let y=i.charAt(m);if(y===" "&&!f)break;h+=y,(y==='"'||y==="'")&&(f=!f)}let p;try{p=RV.sync(h,{path:n.env&&lR(n.env,"PATH")||process.env.PATH,pathext:n.env&&lR(n.env,"PATHEXT")||process.env.PATHEXT}).toLowerCase()}catch{p=h.toLowerCase()}l=p.endsWith(".cmd")||p.endsWith(".bat");for(let m of e)c+=` ${uR.cmd(m,l)}`;a.push("/d","/s","/c",c),n.windowsVerbatimArguments=!0}else{for(let l of e)c+=` ${uR.sh(l)}`;a.push("-c",c)}return Eg(s,a,n,r)},"spawnWithShell"),AV=o((i,e={},t={})=>{let r={...e,shell:!0},s=[].concat(i),n=process.platform;if(n==="linux"&&vV.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=r.command;return a||(n==="win32"?(r.shell=process.env.ComSpec,a='start ""'):n==="wsl"?a="sensible-browser":n==="darwin"?a="open":a="xdg-open"),hR(a,s,r,t)},"open");Eg.open=AV;var Sg=o((i="pipe",e)=>i==="pipe"||i===null?!0:Array.isArray(i)?Sg(i[e],e):!1,"isPipe"),TV=o((i,e,{stdioString:t=!0,stdio:r})=>{let s={stdout:null,stderr:null};return Sg(r,1)&&(s.stdout=Buffer.concat(i),t&&(s.stdout=s.stdout.toString().trim())),Sg(r,2)&&(s.stderr=Buffer.concat(e),t&&(s.stderr=s.stderr.toString().trim())),s},"stdioResult"),lR=o((i,e)=>{e=e.toLowerCase();for(let t of Object.keys(i).sort())if(t.toLowerCase()===e)return i[t]},"findInObject");fR.exports=Eg});var mR=d((The,pR)=>{"use strict";function dR(i,e){for(let t in e)Object.defineProperty(i,t,{value:e[t],enumerable:!0,configurable:!0});return i}o(dR,"assign");function CV(i,e,t){if(!i||typeof i=="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 dR(i,t)}catch{t.message=i.message,t.stack=i.stack;let s=o(function(){},"ErrClass");return s.prototype=Object.create(Object.getPrototypeOf(i)),dR(new s,t)}}o(CV,"createError");pR.exports=CV});var yR=d((Nhe,gR)=>{function bt(i,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(i)),this._timeouts=i,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(bt,"RetryOperation");gR.exports=bt;bt.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};bt.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};bt.prototype.retry=function(i){if(this._timeout&&clearTimeout(this._timeout),!i)return!1;var e=new Date().getTime();if(i&&e-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(i);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),t=this._timeouts.shift();else return!1;var r=this,s=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},t);return this._options.unref&&s.unref(),!0};bt.prototype.attempt=function(i,e){this._fn=i,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)};bt.prototype.try=function(i){this.attempt(i)};bt.prototype.start=function(i){this.attempt(i)};bt.prototype.start=bt.prototype.try;bt.prototype.errors=function(){return this._errors};bt.prototype.attempts=function(){return this._attempts};bt.prototype.mainError=function(){if(this._errors.length===0)return null;for(var i={},e=null,t=0,r=0;r<this._errors.length;r++){var s=this._errors[r],n=s.message,a=(i[n]||0)+1;i[n]=a,a>=t&&(e=s,t=a)}return e}});var SR=d(fs=>{var NV=yR();fs.operation=function(i){var e=fs.timeouts(i);return new NV(e,{forever:i&&i.forever,unref:i&&i.unref,maxRetryTime:i&&i.maxRetryTime})};fs.timeouts=function(i){if(i instanceof Array)return[].concat(i);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var t in i)e[t]=i[t];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],s=0;s<e.retries;s++)r.push(this.createTimeout(s,e));return i&&i.forever&&!r.length&&r.push(this.createTimeout(s,e)),r.sort(function(n,a){return n-a}),r};fs.createTimeout=function(i,e){var t=e.randomize?Math.random()+1:1,r=Math.round(t*e.minTimeout*Math.pow(e.factor,i));return r=Math.min(r,e.maxTimeout),r};fs.wrap=function(i,e,t){if(e instanceof Array&&(t=e,e=null),!t){t=[];for(var r in i)typeof i[r]=="function"&&t.push(r)}for(var s=0;s<t.length;s++){var n=t[s],a=i[n];i[n]=o(function(u){var l=fs.operation(e),h=Array.prototype.slice.call(arguments,1),f=h.pop();h.push(function(p){l.retry(p)||(p&&(arguments[0]=l.mainError()),f.apply(this,arguments))}),l.attempt(function(){u.apply(i,h)})},"retryWrapper").bind(i,a),i[n].options=e}}});var wR=d((Lhe,ER)=>{ER.exports=SR()});var xa=d((Mhe,bR)=>{"use strict";var PV=mR(),DV=wR(),xV=Object.prototype.hasOwnProperty;function _R(i){return i&&i.code==="EPROMISERETRY"&&xV.call(i,"retried")}o(_R,"isRetryError");function LV(i,e){var t,r;return typeof i=="object"&&typeof e=="function"&&(t=e,e=i,i=t),r=DV.operation(e),new Promise(function(s,n){r.attempt(function(a){Promise.resolve().then(function(){return i(function(c){throw _R(c)&&(c=c.retried),PV(new Error("Retrying"),"EPROMISERETRY",{retried:c})},a)}).then(s,function(c){_R(c)&&(c=c.retried,r.retry(c||new Error))||n(c)})})})}o(LV,"promiseRetry");bR.exports=LV});var Ig=d((khe,IR)=>{var La=class extends Error{static{o(this,"GitError")}shouldRetry(){return!1}},wg=class extends La{static{o(this,"GitConnectionError")}constructor(){super("A git connection error occurred")}shouldRetry(e){return e<3}},_g=class extends La{static{o(this,"GitPathspecError")}constructor(){super("The git reference could not be found")}},bg=class extends La{static{o(this,"GitUnknownError")}constructor(){super("An unknown git error occurred")}};IR.exports={GitConnectionError:wg,GitPathspecError:_g,GitUnknownError:bg}});var vR=d((Uhe,OR)=>{var{GitConnectionError:MV,GitPathspecError:BV,GitUnknownError:kV}=Ig(),FV=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("|")),UV=/pathspec .* did not match any file\(s\) known to git/;function jV(i){let e=i.stderr,t;return FV.test(e)?t=new MV(e):UV.test(e)?t=new BV(e):t=new kV(e),Object.assign(t,i)}o(jV,"makeError");OR.exports=jV});var NR=d(($he,CR)=>{var{hasOwnProperty:Og}=Object.prototype,vg=o((i,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
9
+ >>> no match, partial?`,e,p,t,m),p===u))}let g;if(typeof h=="string"?(g=f===h,this.debug("string match",h,f,g)):(g=h.test(f),this.debug("pattern match",h,f,g)),!g)return!1}if(a===u&&c===l)return!0;if(a===u)return r;if(c===l)return a===u-1&&e[a]==="";throw new Error("wtf?")}braceExpand(){return(0,C.braceExpand)(this.pattern,this.options)}parse(e){(0,al.assertValidPattern)(e);let t=this.options;if(e==="**")return C.GLOBSTAR;if(e==="")return"";let r,s=null;(r=e.match(L2))?s=t.dot?B2:M2:(r=e.match(O2))?s=(t.nocase?t.dot?T2:A2:t.dot?R2:v2)(r[1]):(r=e.match(k2))?s=(t.nocase?t.dot?U2:F2:t.dot?j2:$2)(r):(r=e.match(C2))?s=t.dot?P2:N2:(r=e.match(D2))&&(s=x2);let n=MO.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,r=t.noglobstar?V2:t.dot?z2:H2,s=new Set(t.nocase?["i"]:[]),n=e.map(u=>{let l=u.map(h=>{if(h instanceof RegExp)for(let f of h.flags.split(""))s.add(f);return typeof h=="string"?Y2(h):h===C.GLOBSTAR?C.GLOBSTAR:h._src});return l.forEach((h,f)=>{let p=l[f+1],m=l[f-1];h!==C.GLOBSTAR||m===C.GLOBSTAR||(m===void 0?p!==void 0&&p!==C.GLOBSTAR?l[f+1]="(?:\\/|"+r+"\\/)?"+p:l[f]=r:p===void 0?l[f-1]=m+"(?:\\/|"+r+")?":p!==C.GLOBSTAR&&(l[f-1]=m+"(?:\\/|\\/"+r+"\\/)"+p,l[f+1]=C.GLOBSTAR))}),l.filter(h=>h!==C.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 r=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 u=n[c],l=s;if(r.matchBase&&u.length===1&&(l=[a]),this.matchOne(l,u,t))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return C.minimatch.defaults(e).Minimatch}};C.Minimatch=cs;var X2=$m();Object.defineProperty(C,"AST",{enumerable:!0,get:o(function(){return X2.AST},"get")});var Q2=qm();Object.defineProperty(C,"escape",{enumerable:!0,get:o(function(){return Q2.escape},"get")});var eq=il();Object.defineProperty(C,"unescape",{enumerable:!0,get:o(function(){return eq.unescape},"get")});C.minimatch.AST=MO.AST;C.minimatch.Minimatch=cs;C.minimatch.escape=_2.escape;C.minimatch.unescape=b2.unescape});var te=d(Ve=>{"use strict";var tq=Ve&&Ve.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.Minipass=Ve.isWritable=Ve.isReadable=Ve.isStream=void 0;var UO=typeof process=="object"&&process?process:{stdout:null,stderr:null},Km=require("node:events"),VO=tq(require("node:stream")),iq=require("node:string_decoder"),rq=o(i=>!!i&&typeof i=="object"&&(i instanceof pl||i instanceof VO.default||(0,Ve.isReadable)(i)||(0,Ve.isWritable)(i)),"isStream");Ve.isStream=rq;var sq=o(i=>!!i&&typeof i=="object"&&i instanceof Km.EventEmitter&&typeof i.pipe=="function"&&i.pipe!==VO.default.Writable.prototype.pipe,"isReadable");Ve.isReadable=sq;var nq=o(i=>!!i&&typeof i=="object"&&i instanceof Km.EventEmitter&&typeof i.write=="function"&&typeof i.end=="function","isWritable");Ve.isWritable=nq;var Bi=Symbol("EOF"),ki=Symbol("maybeEmitEnd"),pr=Symbol("emittedEnd"),cl=Symbol("emittingEnd"),ma=Symbol("emittedError"),ul=Symbol("closed"),jO=Symbol("read"),ll=Symbol("flush"),$O=Symbol("flushChunk"),Vt=Symbol("encoding"),hn=Symbol("decoder"),ve=Symbol("flowing"),ga=Symbol("paused"),fn=Symbol("resume"),Re=Symbol("buffer"),qe=Symbol("pipes"),Ae=Symbol("bufferLength"),Vm=Symbol("bufferPush"),hl=Symbol("bufferShift"),xe=Symbol("objectMode"),pe=Symbol("destroyed"),zm=Symbol("error"),Hm=Symbol("emitData"),qO=Symbol("emitEnd"),Gm=Symbol("emitEnd2"),ri=Symbol("async"),Wm=Symbol("abort"),fl=Symbol("aborted"),ya=Symbol("signal"),us=Symbol("dataListeners"),ct=Symbol("discarded"),Sa=o(i=>Promise.resolve().then(i),"defer"),oq=o(i=>i(),"nodefer"),aq=o(i=>i==="end"||i==="finish"||i==="prefinish","isEndish"),cq=o(i=>i instanceof ArrayBuffer||!!i&&typeof i=="object"&&i.constructor&&i.constructor.name==="ArrayBuffer"&&i.byteLength>=0,"isArrayBufferLike"),uq=o(i=>!Buffer.isBuffer(i)&&ArrayBuffer.isView(i),"isArrayBufferView"),dl=class{static{o(this,"Pipe")}src;dest;opts;ondrain;constructor(e,t,r){this.src=e,this.dest=t,this.opts=r,this.ondrain=()=>e[fn](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Jm=class extends dl{static{o(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,r){super(e,t,r),this.proxyErrors=s=>t.emit("error",s),e.on("error",this.proxyErrors)}},lq=o(i=>!!i.objectMode,"isObjectModeOptions"),hq=o(i=>!i.objectMode&&!!i.encoding&&i.encoding!=="buffer","isEncodingOptions"),pl=class extends Km.EventEmitter{static{o(this,"Minipass")}[ve]=!1;[ga]=!1;[qe]=[];[Re]=[];[xe];[Vt];[ri];[hn];[Bi]=!1;[pr]=!1;[cl]=!1;[ul]=!1;[ma]=null;[Ae]=0;[pe]=!1;[ya];[fl]=!1;[us]=0;[ct]=!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");lq(t)?(this[xe]=!0,this[Vt]=null):hq(t)?(this[Vt]=t.encoding,this[xe]=!1):(this[xe]=!1,this[Vt]=null),this[ri]=!!t.async,this[hn]=this[Vt]?new iq.StringDecoder(this[Vt]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:o(()=>this[Re],"get")}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:o(()=>this[qe],"get")});let{signal:r}=t;r&&(this[ya]=r,r.aborted?this[Wm]():r.addEventListener("abort",()=>this[Wm]()))}get bufferLength(){return this[Ae]}get encoding(){return this[Vt]}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[xe]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[ri]}set async(e){this[ri]=this[ri]||!!e}[Wm](){this[fl]=!0,this.emit("abort",this[ya]?.reason),this.destroy(this[ya]?.reason)}get aborted(){return this[fl]}set aborted(e){}write(e,t,r){if(this[fl])return!1;if(this[Bi])throw new Error("write after end");if(this[pe])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let s=this[ri]?Sa:oq;if(!this[xe]&&!Buffer.isBuffer(e)){if(uq(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(cq(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[xe]?(this[ve]&&this[Ae]!==0&&this[ll](!0),this[ve]?this.emit("data",e):this[Vm](e),this[Ae]!==0&&this.emit("readable"),r&&s(r),this[ve]):e.length?(typeof e=="string"&&!(t===this[Vt]&&!this[hn]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[Vt]&&(e=this[hn].write(e)),this[ve]&&this[Ae]!==0&&this[ll](!0),this[ve]?this.emit("data",e):this[Vm](e),this[Ae]!==0&&this.emit("readable"),r&&s(r),this[ve]):(this[Ae]!==0&&this.emit("readable"),r&&s(r),this[ve])}read(e){if(this[pe])return null;if(this[ct]=!1,this[Ae]===0||e===0||e&&e>this[Ae])return this[ki](),null;this[xe]&&(e=null),this[Re].length>1&&!this[xe]&&(this[Re]=[this[Vt]?this[Re].join(""):Buffer.concat(this[Re],this[Ae])]);let t=this[jO](e||null,this[Re][0]);return this[ki](),t}[jO](e,t){if(this[xe])this[hl]();else{let r=t;e===r.length||e===null?this[hl]():typeof r=="string"?(this[Re][0]=r.slice(e),t=r.slice(0,e),this[Ae]-=e):(this[Re][0]=r.subarray(e),t=r.subarray(0,e),this[Ae]-=e)}return this.emit("data",t),!this[Re].length&&!this[Bi]&&this.emit("drain"),t}end(e,t,r){return typeof e=="function"&&(r=e,e=void 0),typeof t=="function"&&(r=t,t="utf8"),e!==void 0&&this.write(e,t),r&&this.once("end",r),this[Bi]=!0,this.writable=!1,(this[ve]||!this[ga])&&this[ki](),this}[fn](){this[pe]||(!this[us]&&!this[qe].length&&(this[ct]=!0),this[ga]=!1,this[ve]=!0,this.emit("resume"),this[Re].length?this[ll]():this[Bi]?this[ki]():this.emit("drain"))}resume(){return this[fn]()}pause(){this[ve]=!1,this[ga]=!0,this[ct]=!1}get destroyed(){return this[pe]}get flowing(){return this[ve]}get paused(){return this[ga]}[Vm](e){this[xe]?this[Ae]+=1:this[Ae]+=e.length,this[Re].push(e)}[hl](){return this[xe]?this[Ae]-=1:this[Ae]-=this[Re][0].length,this[Re].shift()}[ll](e=!1){do;while(this[$O](this[hl]())&&this[Re].length);!e&&!this[Re].length&&!this[Bi]&&this.emit("drain")}[$O](e){return this.emit("data",e),this[ve]}pipe(e,t){if(this[pe])return e;this[ct]=!1;let r=this[pr];return t=t||{},e===UO.stdout||e===UO.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this[qe].push(t.proxyErrors?new Jm(this,e,t):new dl(this,e,t)),this[ri]?Sa(()=>this[fn]()):this[fn]()),e}unpipe(e){let t=this[qe].find(r=>r.dest===e);t&&(this[qe].length===1?(this[ve]&&this[us]===0&&(this[ve]=!1),this[qe]=[]):this[qe].splice(this[qe].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let r=super.on(e,t);if(e==="data")this[ct]=!1,this[us]++,!this[qe].length&&!this[ve]&&this[fn]();else if(e==="readable"&&this[Ae]!==0)super.emit("readable");else if(aq(e)&&this[pr])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[ma]){let s=t;this[ri]?Sa(()=>s.call(this,this[ma])):s.call(this,this[ma])}return r}removeListener(e,t){return this.off(e,t)}off(e,t){let r=super.off(e,t);return e==="data"&&(this[us]=this.listeners("data").length,this[us]===0&&!this[ct]&&!this[qe].length&&(this[ve]=!1)),r}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[us]=0,!this[ct]&&!this[qe].length&&(this[ve]=!1)),t}get emittedEnd(){return this[pr]}[ki](){!this[cl]&&!this[pr]&&!this[pe]&&this[Re].length===0&&this[Bi]&&(this[cl]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[ul]&&this.emit("close"),this[cl]=!1)}emit(e,...t){let r=t[0];if(e!=="error"&&e!=="close"&&e!==pe&&this[pe])return!1;if(e==="data")return!this[xe]&&!r?!1:this[ri]?(Sa(()=>this[Hm](r)),!0):this[Hm](r);if(e==="end")return this[qO]();if(e==="close"){if(this[ul]=!0,!this[pr]&&!this[pe])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[ma]=r,super.emit(zm,r);let n=!this[ya]||this.listeners("error").length?super.emit("error",r):!1;return this[ki](),n}else if(e==="resume"){let n=super.emit("resume");return this[ki](),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[ki](),s}[Hm](e){for(let r of this[qe])r.dest.write(e)===!1&&this.pause();let t=this[ct]?!1:super.emit("data",e);return this[ki](),t}[qO](){return this[pr]?!1:(this[pr]=!0,this.readable=!1,this[ri]?(Sa(()=>this[Gm]()),!0):this[Gm]())}[Gm](){if(this[hn]){let t=this[hn].end();if(t){for(let r of this[qe])r.dest.write(t);this[ct]||super.emit("data",t)}}for(let t of this[qe])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[xe]||(e.dataLength=0);let t=this.promise();return this.on("data",r=>{e.push(r),this[xe]||(e.dataLength+=r.length)}),await t,e}async concat(){if(this[xe])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Vt]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(pe,()=>t(new Error("stream destroyed"))),this.on("error",r=>t(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[ct]=!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[Bi])return t();let n,a,c=o(f=>{this.off("data",u),this.off("end",l),this.off(pe,h),t(),a(f)},"onerr"),u=o(f=>{this.off("error",c),this.off("end",l),this.off(pe,h),this.pause(),n({value:f,done:!!this[Bi]})},"ondata"),l=o(()=>{this.off("error",c),this.off("data",u),this.off(pe,h),t(),n({done:!0,value:void 0})},"onend"),h=o(()=>c(new Error("stream destroyed")),"ondestroy");return new Promise((f,p)=>{a=p,n=f,this.once(pe,h),this.once("error",c),this.once("end",l),this.once("data",u)})},"next"),throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[ct]=!1;let e=!1,t=o(()=>(this.pause(),this.off(zm,t),this.off(pe,t),this.off("end",t),e=!0,{done:!0,value:void 0}),"stop"),r=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(zm,t),this.once(pe,t),{next:r,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[pe])return e?this.emit("error",e):this.emit(pe),this;this[pe]=!0,this[ct]=!0,this[Re].length=0,this[Ae]=0;let t=this;return typeof t.close=="function"&&!this[ul]&&t.close(),e?this.emit("error",e):this.emit(pe),this}static get isStream(){return Ve.isStream}};Ve.Minipass=pl});var sv=d(W=>{"use strict";var fq=W&&W.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),dq=W&&W.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),pq=W&&W.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&fq(e,i,t);return dq(e,i),e};Object.defineProperty(W,"__esModule",{value:!0});W.PathScurry=W.Path=W.PathScurryDarwin=W.PathScurryPosix=W.PathScurryWin32=W.PathScurryBase=W.PathPosix=W.PathWin32=W.PathBase=W.ChildrenCache=W.ResolveCache=void 0;var KO=os(),El=require("node:path"),mq=require("node:url"),wa=require("fs"),gq=pq(require("node:fs")),yq=wa.realpathSync.native,ml=require("node:fs/promises"),zO=te(),_a={lstatSync:wa.lstatSync,readdir:wa.readdir,readdirSync:wa.readdirSync,readlinkSync:wa.readlinkSync,realpathSync:yq,promises:{lstat:ml.lstat,readdir:ml.readdir,readlink:ml.readlink,realpath:ml.realpath}},ZO=o(i=>!i||i===_a||i===gq?_a:{..._a,...i,promises:{..._a.promises,...i.promises||{}}},"fsFromOption"),YO=/^\\\\\?\\([a-z]:)\\?$/i,Sq=o(i=>i.replace(/\//g,"\\").replace(YO,"$1\\"),"uncToDrive"),Eq=/[\\\/]/,_t=0,XO=1,QO=2,si=4,ev=6,tv=8,ls=10,iv=12,wt=15,Ea=~wt,Zm=16,HO=32,ba=64,zt=128,gl=256,Sl=512,GO=ba|zt|Sl,wq=1023,Ym=o(i=>i.isFile()?tv:i.isDirectory()?si:i.isSymbolicLink()?ls:i.isCharacterDevice()?QO:i.isBlockDevice()?ev:i.isSocket()?iv:i.isFIFO()?XO:_t,"entToType"),WO=new Map,Ia=o(i=>{let e=WO.get(i);if(e)return e;let t=i.normalize("NFKD");return WO.set(i,t),t},"normalize"),JO=new Map,yl=o(i=>{let e=JO.get(i);if(e)return e;let t=Ia(i.toLowerCase());return JO.set(i,t),t},"normalizeNocase"),Oa=class extends KO.LRUCache{static{o(this,"ResolveCache")}constructor(){super({max:256})}};W.ResolveCache=Oa;var wl=class extends KO.LRUCache{static{o(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:o(t=>t.length+1,"sizeCalculation")})}};W.ChildrenCache=wl;var rv=Symbol("PathScurry setAsCwd"),Ne=class{static{o(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#i;get mode(){return this.#i}#r;get nlink(){return this.#r}#s;get uid(){return this.#s}#u;get gid(){return this.#u}#c;get rdev(){return this.#c}#f;get blksize(){return this.#f}#n;get ino(){return this.#n}#h;get size(){return this.#h}#o;get blocks(){return this.#o}#d;get atimeMs(){return this.#d}#a;get mtimeMs(){return this.#a}#p;get ctimeMs(){return this.#p}#y;get birthtimeMs(){return this.#y}#_;get atime(){return this.#_}#m;get mtime(){return this.#m}#A;get ctime(){return this.#A}#w;get birthtime(){return this.#w}#b;#v;#I;#E;#N;#O;#l;#B;#R;#C;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=_t,r,s,n,a,c){this.name=e,this.#b=n?yl(e):Ia(e),this.#l=t&wq,this.nocase=n,this.roots=s,this.root=r||this,this.#B=a,this.#I=c.fullpath,this.#N=c.relative,this.#O=c.relativePosix,this.parent=c.parent,this.parent?this.#e=this.parent.#e:this.#e=ZO(c.fs)}depth(){return this.#v!==void 0?this.#v:this.parent?this.#v=this.parent.depth()+1:this.#v=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).#k(s):this.#k(s)}#k(e){let t=this;for(let r of e)t=t.child(r);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.#l&=~Zm,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),s=this.nocase?yl(e):Ia(e);for(let u of r)if(u.#b===s)return u;let n=this.parent?this.sep:"",a=this.#I?this.#I+n+e:void 0,c=this.newChild(e,_t,{...t,parent:this,fullpath:a});return this.canReaddir()||(c.#l|=zt),r.push(c),c}relative(){if(this.isCWD)return"";if(this.#N!==void 0)return this.#N;let e=this.name,t=this.parent;if(!t)return this.#N=this.name;let r=t.relative();return r+(!r||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#O!==void 0)return this.#O;let e=this.name,t=this.parent;if(!t)return this.#O=this.fullpathPosix();let r=t.relativePosix();return r+(!r||!t.parent?"":"/")+e}fullpath(){if(this.#I!==void 0)return this.#I;let e=this.name,t=this.parent;if(!t)return this.#I=this.name;let s=t.fullpath()+(t.parent?this.sep:"")+e;return this.#I=s}fullpathPosix(){if(this.#E!==void 0)return this.#E;if(this.sep==="/")return this.#E=this.fullpath();if(!this.parent){let s=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(s)?this.#E=`//?/${s}`:this.#E=s}let e=this.parent,t=e.fullpathPosix(),r=t+(!t||!e.parent?"":"/")+this.name;return this.#E=r}isUnknown(){return(this.#l&wt)===_t}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.#l&wt)===tv}isDirectory(){return(this.#l&wt)===si}isCharacterDevice(){return(this.#l&wt)===QO}isBlockDevice(){return(this.#l&wt)===ev}isFIFO(){return(this.#l&wt)===XO}isSocket(){return(this.#l&wt)===iv}isSymbolicLink(){return(this.#l&ls)===ls}lstatCached(){return this.#l&HO?this:void 0}readlinkCached(){return this.#R}realpathCached(){return this.#C}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#R)return!0;if(!this.parent)return!1;let e=this.#l&wt;return!(e!==_t&&e!==ls||this.#l&gl||this.#l&zt)}calledReaddir(){return!!(this.#l&Zm)}isENOENT(){return!!(this.#l&zt)}isNamed(e){return this.nocase?this.#b===yl(e):this.#b===Ia(e)}async readlink(){let e=this.#R;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#e.promises.readlink(this.fullpath()),r=(await this.parent.realpath())?.resolve(t);if(r)return this.#R=r}catch(t){this.#S(t.code);return}}readlinkSync(){let e=this.#R;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#e.readlinkSync(this.fullpath()),r=this.parent.realpathSync()?.resolve(t);if(r)return this.#R=r}catch(t){this.#S(t.code);return}}#T(e){this.#l|=Zm;for(let t=e.provisional;t<e.length;t++){let r=e[t];r&&r.#$()}}#$(){this.#l&zt||(this.#l=(this.#l|zt)&Ea,this.#P())}#P(){let e=this.children();e.provisional=0;for(let t of e)t.#$()}#x(){this.#l|=Sl,this.#F()}#F(){if(this.#l&ba)return;let e=this.#l;(e&wt)===si&&(e&=Ea),this.#l=e|ba,this.#P()}#D(e=""){e==="ENOTDIR"||e==="EPERM"?this.#F():e==="ENOENT"?this.#$():this.children().provisional=0}#L(e=""){e==="ENOTDIR"?this.parent.#F():e==="ENOENT"&&this.#$()}#S(e=""){let t=this.#l;t|=gl,e==="ENOENT"&&(t|=zt),(e==="EINVAL"||e==="UNKNOWN")&&(t&=Ea),this.#l=t,e==="ENOTDIR"&&this.parent&&this.parent.#F()}#U(e,t){return this.#g(e,t)||this.#j(e,t)}#j(e,t){let r=Ym(e),s=this.newChild(e.name,r,{parent:this}),n=s.#l&wt;return n!==si&&n!==ls&&n!==_t&&(s.#l|=ba),t.unshift(s),t.provisional++,s}#g(e,t){for(let r=t.provisional;r<t.length;r++){let s=t[r];if((this.nocase?yl(e.name):Ia(e.name))===s.#b)return this.#q(e,s,r,t)}}#q(e,t,r,s){let n=t.name;return t.#l=t.#l&Ea|Ym(e),n!==e.name&&(t.name=e.name),r!==s.provisional&&(r===s.length-1?s.pop():s.splice(r,1),s.unshift(t)),s.provisional++,t}async lstat(){if((this.#l&zt)===0)try{return this.#V(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#L(e.code)}}lstatSync(){if((this.#l&zt)===0)try{return this.#V(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#L(e.code)}}#V(e){let{atime:t,atimeMs:r,birthtime:s,birthtimeMs:n,blksize:a,blocks:c,ctime:u,ctimeMs:l,dev:h,gid:f,ino:p,mode:m,mtime:y,mtimeMs:g,nlink:S,rdev:E,size:_,uid:b}=e;this.#_=t,this.#d=r,this.#w=s,this.#y=n,this.#f=a,this.#o=c,this.#A=u,this.#p=l,this.#t=h,this.#u=f,this.#n=p,this.#i=m,this.#m=y,this.#a=g,this.#r=S,this.#c=E,this.#h=_,this.#s=b;let w=Ym(e);this.#l=this.#l&Ea|w|HO,w!==_t&&w!==si&&w!==ls&&(this.#l|=ba)}#M=[];#z=!1;#G(e){this.#z=!1;let t=this.#M.slice();this.#M.length=0,t.forEach(r=>r(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let r=this.children();if(this.calledReaddir()){let n=r.slice(0,r.provisional);t?e(null,n):queueMicrotask(()=>e(null,n));return}if(this.#M.push(e),this.#z)return;this.#z=!0;let s=this.fullpath();this.#e.readdir(s,{withFileTypes:!0},(n,a)=>{if(n)this.#D(n.code),r.provisional=0;else{for(let c of a)this.#U(c,r);this.#T(r)}this.#G(r.slice(0,r.provisional))})}#H;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.#H)await this.#H;else{let r=o(()=>{},"resolve");this.#H=new Promise(s=>r=s);try{for(let s of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#U(s,e);this.#T(e)}catch(s){this.#D(s.code),e.provisional=0}this.#H=void 0,r()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let r of this.#e.readdirSync(t,{withFileTypes:!0}))this.#U(r,e);this.#T(e)}catch(r){this.#D(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#l&GO)return!1;let e=wt&this.#l;return e===_t||e===si||e===ls}shouldWalk(e,t){return(this.#l&si)===si&&!(this.#l&GO)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#C)return this.#C;if(!((Sl|gl|zt)&this.#l))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#C=this.resolve(e)}catch{this.#x()}}realpathSync(){if(this.#C)return this.#C;if(!((Sl|gl|zt)&this.#l))try{let e=this.#e.realpathSync(this.fullpath());return this.#C=this.resolve(e)}catch{this.#x()}}[rv](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),r=[],s=this;for(;s&&s.parent;)t.add(s),s.#N=r.join(this.sep),s.#O=r.join("/"),s=s.parent,r.push("..");for(s=e;s&&s.parent&&!t.has(s);)s.#N=void 0,s.#O=void 0,s=s.parent}};W.PathBase=Ne;var va=class i extends Ne{static{o(this,"PathWin32")}sep="\\";splitSep=Eq;constructor(e,t=_t,r,s,n,a,c){super(e,t,r,s,n,a,c)}newChild(e,t=_t,r={}){return new i(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return El.win32.parse(e).root}getRoot(e){if(e=Sq(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,r]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=r;return this.roots[e]=new Ta(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(YO,"$1\\"),e===t}};W.PathWin32=va;var Ra=class i extends Ne{static{o(this,"PathPosix")}splitSep="/";sep="/";constructor(e,t=_t,r,s,n,a,c){super(e,t,r,s,n,a,c)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=_t,r={}){return new i(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}};W.PathPosix=Ra;var Aa=class{static{o(this,"PathScurryBase")}root;rootPath;roots;cwd;#e;#t;#i;nocase;#r;constructor(e=process.cwd(),t,r,{nocase:s,childrenCacheSize:n=16*1024,fs:a=_a}={}){this.#r=ZO(a),(e instanceof URL||e.startsWith("file://"))&&(e=(0,mq.fileURLToPath)(e));let c=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(c),this.#e=new Oa,this.#t=new Oa,this.#i=new wl(n);let u=c.substring(this.rootPath.length).split(r);if(u.length===1&&!u[0]&&u.pop(),s===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=s,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let l=this.root,h=u.length-1,f=t.sep,p=this.rootPath,m=!1;for(let y of u){let g=h--;l=l.child(y,{relative:new Array(g).fill("..").join(f),relativePosix:new Array(g).fill("..").join("/"),fullpath:p+=(m?"":f)+y}),m=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#i}resolve(...e){let t="";for(let n=e.length-1;n>=0;n--){let a=e[n];if(!(!a||a===".")&&(t=t?`${a}/${t}`:a,this.isAbsolute(a)))break}let r=this.#e.get(t);if(r!==void 0)return r;let 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 r=this.#t.get(t);if(r!==void 0)return r;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 Ne||(t=e,e=this.cwd);let{withFileTypes:r}=t;if(e.canReaddir()){let s=await e.readdir();return r?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 Ne||(t=e,e=this.cwd);let{withFileTypes:r=!0}=t;return e.canReaddir()?r?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 Ne||(t=e.withFileTypes,e=this.cwd);let r=await e.readlink();return t?r:r?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ne||(t=e.withFileTypes,e=this.cwd);let r=e.readlinkSync();return t?r:r?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ne||(t=e.withFileTypes,e=this.cwd);let r=await e.realpath();return t?r:r?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ne||(t=e.withFileTypes,e=this.cwd);let r=e.realpathSync();return t?r:r?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ne||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:n,walkFilter:a}=t,c=[];(!n||n(e))&&c.push(r?e:e.fullpath());let u=new Set,l=o((f,p)=>{u.add(f),f.readdirCB((m,y)=>{if(m)return p(m);let g=y.length;if(!g)return p();let S=o(()=>{--g===0&&p()},"next");for(let E of y)(!n||n(E))&&c.push(r?E:E.fullpath()),s&&E.isSymbolicLink()?E.realpath().then(_=>_?.isUnknown()?_.lstat():_).then(_=>_?.shouldWalk(u,a)?l(_,S):S()):E.shouldWalk(u,a)?l(E,S):S()},!0)},"walk"),h=e;return new Promise((f,p)=>{l(h,m=>{if(m)return p(m);f(c)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ne||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:n,walkFilter:a}=t,c=[];(!n||n(e))&&c.push(r?e:e.fullpath());let u=new Set([e]);for(let l of u){let h=l.readdirSync();for(let f of h){(!n||n(f))&&c.push(r?f:f.fullpath());let p=f;if(f.isSymbolicLink()){if(!(s&&(p=f.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(u,a)&&u.add(p)}}return c}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ne||(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 Ne||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:n,walkFilter:a}=t;(!n||n(e))&&(yield r?e:e.fullpath());let c=new Set([e]);for(let u of c){let l=u.readdirSync();for(let h of l){(!n||n(h))&&(yield r?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 Ne||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:n,walkFilter:a}=t,c=new zO.Minipass({objectMode:!0});(!n||n(e))&&c.write(r?e:e.fullpath());let u=new Set,l=[e],h=0,f=o(()=>{let p=!1;for(;!p;){let m=l.shift();if(!m){h===0&&c.end();return}h++,u.add(m);let y=o((S,E,_=!1)=>{if(S)return c.emit("error",S);if(s&&!_){let b=[];for(let w of E)w.isSymbolicLink()&&b.push(w.realpath().then(I=>I?.isUnknown()?I.lstat():I));if(b.length){Promise.all(b).then(()=>y(null,E,!0));return}}for(let b of E)b&&(!n||n(b))&&(c.write(r?b:b.fullpath())||(p=!0));h--;for(let b of E){let w=b.realpathCached()||b;w.shouldWalk(u,a)&&l.push(w)}p&&!c.flowing?c.once("drain",f):g||f()},"onReaddir"),g=!0;m.readdirCB(y,!0),g=!1}},"process");return f(),c}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ne||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:n,walkFilter:a}=t,c=new zO.Minipass({objectMode:!0}),u=new Set;(!n||n(e))&&c.write(r?e:e.fullpath());let l=[e],h=0,f=o(()=>{let p=!1;for(;!p;){let m=l.shift();if(!m){h===0&&c.end();return}h++,u.add(m);let y=m.readdirSync();for(let g of y)(!n||n(g))&&(c.write(r?g:g.fullpath())||(p=!0));h--;for(let g of y){let S=g;if(g.isSymbolicLink()){if(!(s&&(S=g.realpathSync())))continue;S.isUnknown()&&S.lstatSync()}S.shouldWalk(u,a)&&l.push(S)}}p&&!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[rv](t)}};W.PathScurryBase=Aa;var Ta=class extends Aa{static{o(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,El.win32,"\\",{...t,nocase:r}),this.nocase=r;for(let s=this.cwd;s;s=s.parent)s.nocase=this.nocase}parseRootPath(e){return El.win32.parse(e).root.toUpperCase()}newRoot(e){return new va(this.rootPath,si,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}};W.PathScurryWin32=Ta;var Ca=class extends Aa{static{o(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),t={}){let{nocase:r=!1}=t;super(e,El.posix,"/",{...t,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new Ra(this.rootPath,si,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}};W.PathScurryPosix=Ca;var _l=class extends Ca{static{o(this,"PathScurryDarwin")}constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,{...t,nocase:r})}};W.PathScurryDarwin=_l;W.Path=process.platform==="win32"?va:Ra;W.PathScurry=process.platform==="win32"?Ta:process.platform==="darwin"?_l:Ca});var Qm=d(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});bl.Pattern=void 0;var _q=Mi(),bq=o(i=>i.length>=1,"isPatternList"),Iq=o(i=>i.length>=1,"isGlobList"),Xm=class i{static{o(this,"Pattern")}#e;#t;#i;length;#r;#s;#u;#c;#f;#n;#h=!0;constructor(e,t,r,s){if(!bq(e))throw new TypeError("empty pattern list");if(!Iq(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,r<0||r>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=t,this.#i=r,this.#r=s,this.#i===0){if(this.isUNC()){let[n,a,c,u,...l]=this.#e,[h,f,p,m,...y]=this.#t;l[0]===""&&(l.shift(),y.shift());let g=[n,a,c,u,""].join("/"),S=[h,f,p,m,""].join("/");this.#e=[g,...l],this.#t=[S,...y],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[n,...a]=this.#e,[c,...u]=this.#t;a[0]===""&&(a.shift(),u.shift());let l=n+"/",h=c+"/";this.#e=[l,...a],this.#t=[h,...u],this.length=this.#e.length}}}pattern(){return this.#e[this.#i]}isString(){return typeof this.#e[this.#i]=="string"}isGlobstar(){return this.#e[this.#i]===_q.GLOBSTAR}isRegExp(){return this.#e[this.#i]instanceof RegExp}globString(){return this.#u=this.#u||(this.#i===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#i).join("/"))}hasMore(){return this.length>this.#i+1}rest(){return this.#s!==void 0?this.#s:this.hasMore()?(this.#s=new i(this.#e,this.#t,this.#i+1,this.#r),this.#s.#n=this.#n,this.#s.#f=this.#f,this.#s.#c=this.#c,this.#s):this.#s=null}isUNC(){let e=this.#e;return this.#f!==void 0?this.#f:this.#f=this.#r==="win32"&&this.#i===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#c!==void 0?this.#c:this.#c=this.#r==="win32"&&this.#i===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#n!==void 0?this.#n:this.#n=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#i===0?e:""}checkFollowGlobstar(){return!(this.#i===0||!this.isGlobstar()||!this.#h)}markFollowGlobstar(){return this.#i===0||!this.isGlobstar()||!this.#h?!1:(this.#h=!1,!0)}};bl.Pattern=Xm});var tg=d(Il=>{"use strict";Object.defineProperty(Il,"__esModule",{value:!0});Il.Ignore=void 0;var nv=Mi(),Oq=Qm(),vq=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",eg=class{static{o(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:r,noext:s,noglobstar:n,platform:a=vq}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=a,this.mmopts={dot:!0,nobrace:t,nocase:r,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 nv.Minimatch(e,this.mmopts);for(let r=0;r<t.set.length;r++){let s=t.set[r],n=t.globParts[r];if(!s||!n)throw new Error("invalid pattern object");for(;s[0]==="."&&n[0]===".";)s.shift(),n.shift();let a=new Oq.Pattern(s,n,0,this.platform),c=new nv.Minimatch(a.globString(),this.mmopts),u=n[n.length-1]==="**",l=a.isAbsolute();l?this.absolute.push(c):this.relative.push(c),u&&(l?this.absoluteChildren.push(c):this.relativeChildren.push(c))}}ignored(e){let t=e.fullpath(),r=`${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(r))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",r=(e.relative()||".")+"/";for(let s of this.relativeChildren)if(s.match(r))return!0;for(let s of this.absoluteChildren)if(s.match(t))return!0;return!1}};Il.Ignore=eg});var av=d(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.Processor=ni.SubWalks=ni.MatchRecord=ni.HasWalkedCache=void 0;var ov=Mi(),Ol=class i{static{o(this,"HasWalkedCache")}store;constructor(e=new Map){this.store=e}copy(){return new i(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let r=e.fullpath(),s=this.store.get(r);s?s.add(t.globString()):this.store.set(r,new Set([t.globString()]))}};ni.HasWalkedCache=Ol;var vl=class{static{o(this,"MatchRecord")}store=new Map;add(e,t,r){let s=(t?2:0)|(r?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)])}};ni.MatchRecord=vl;var Rl=class{static{o(this,"SubWalks")}store=new Map;add(e,t){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(s=>s.globString()===t.globString())||r.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}};ni.SubWalks=Rl;var ig=class i{static{o(this,"Processor")}hasWalkedCache;matches=new vl;subwalks=new Rl;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new Ol}processPatterns(e,t){this.patterns=t;let r=t.map(s=>[e,s]);for(let[s,n]of r){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 u,l,h=!1;for(;typeof(u=n.pattern())=="string"&&(l=n.rest());)s=s.resolve(u),n=l,h=!0;if(u=n.pattern(),l=n.rest(),h){if(this.hasWalkedCache.hasWalked(s,n))continue;this.hasWalkedCache.storeWalked(s,n)}if(typeof u=="string"){let f=u===".."||u===""||u===".";this.matches.add(s.resolve(u),c,f);continue}else if(u===ov.GLOBSTAR){(!s.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(s,n);let f=l?.pattern(),p=l?.rest();if(!l||(f===""||f===".")&&!p)this.matches.add(s,c,f===""||f===".");else if(f===".."){let m=s.parent||s;p?this.hasWalkedCache.hasWalked(m,p)||this.subwalks.add(m,p):this.matches.add(m,c,!0)}}else u instanceof RegExp&&this.subwalks.add(s,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new i(this.opts,this.hasWalkedCache)}filterEntries(e,t){let r=this.subwalks.get(e),s=this.child();for(let n of t)for(let a of r){let c=a.isAbsolute(),u=a.pattern(),l=a.rest();u===ov.GLOBSTAR?s.testGlobstar(n,a,l,c):u instanceof RegExp?s.testRegExp(n,u,l,c):s.testString(n,u,l,c)}return s}testGlobstar(e,t,r,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()&&(r&&t.checkFollowGlobstar()?this.subwalks.add(e,r):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),r){let n=r.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(e,n,r.rest(),s);else if(n===".."){let a=e.parent||e;this.subwalks.add(a,r)}else n instanceof RegExp&&this.testRegExp(e,n,r.rest(),s)}}testRegExp(e,t,r,s){t.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,s,!1))}testString(e,t,r,s){e.isNamed(t)&&(r?this.subwalks.add(e,r):this.matches.add(e,s,!1))}};ni.Processor=ig});var lv=d(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.GlobStream=mr.GlobWalker=mr.GlobUtil=void 0;var Rq=te(),cv=tg(),uv=av(),Aq=o((i,e)=>typeof i=="string"?new cv.Ignore([i],e):Array.isArray(i)?new cv.Ignore(i,e):i,"makeIgnore"),Na=class{static{o(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#i;signal;maxDepth;includeChildMatches;constructor(e,t,r){if(this.patterns=e,this.path=t,this.opts=r,this.#i=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#t=Aq(r.ignore??[],r),!this.includeChildMatches&&typeof this.#t.add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#r(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#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 r;if(this.opts.realpath){if(r=e.realpathCached()||await e.realpath(),!r)return;e=r}let n=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let a=await n.realpath();a&&(a.isUnknown()||this.opts.stat)&&await a.lstat()}return this.matchCheckTest(n,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#r(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||e.realpathSync(),!r)return;e=r}let n=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let a=n.realpathSync();a&&(a?.isUnknown()||this.opts.stat)&&a.lstatSync()}return this.matchCheckTest(n,t)}matchFinish(e,t){if(this.#r(e))return;if(!this.includeChildMatches&&this.#t?.add){let n=`${e.relativePosix()}/**`;this.#t.add(n)}let r=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let s=this.opts.mark&&e.isDirectory()?this.#i:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(r){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.#i)?"."+this.#i:"";this.matchEmit(n?a+n+s:"."+s)}}async match(e,t,r){let s=await this.matchCheck(e,r);s&&this.matchFinish(s,t)}matchSync(e,t,r){let s=this.matchCheckSync(e,r);s&&this.matchFinish(s,t)}walkCB(e,t,r){this.signal?.aborted&&r(),this.walkCB2(e,t,new uv.Processor(this.opts),r)}walkCB2(e,t,r,s){if(this.#s(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2(e,t,r,s));return}r.processPatterns(e,t);let n=1,a=o(()=>{--n===0&&s()},"next");for(let[c,u,l]of r.matches.entries())this.#r(c)||(n++,this.match(c,u,l).then(()=>a()));for(let c of r.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;n++;let u=c.readdirCached();c.calledReaddir()?this.walkCB3(c,u,r,a):c.readdirCB((l,h)=>this.walkCB3(c,h,r,a),!0)}a()}walkCB3(e,t,r,s){r=r.filterEntries(e,t);let n=1,a=o(()=>{--n===0&&s()},"next");for(let[c,u,l]of r.matches.entries())this.#r(c)||(n++,this.match(c,u,l).then(()=>a()));for(let[c,u]of r.subwalks.entries())n++,this.walkCB2(c,u,r.child(),a);a()}walkCBSync(e,t,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,t,new uv.Processor(this.opts),r)}walkCB2Sync(e,t,r,s){if(this.#s(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,r,s));return}r.processPatterns(e,t);let n=1,a=o(()=>{--n===0&&s()},"next");for(let[c,u,l]of r.matches.entries())this.#r(c)||this.matchSync(c,u,l);for(let c of r.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;n++;let u=c.readdirSync();this.walkCB3Sync(c,u,r,a)}a()}walkCB3Sync(e,t,r,s){r=r.filterEntries(e,t);let n=1,a=o(()=>{--n===0&&s()},"next");for(let[c,u,l]of r.matches.entries())this.#r(c)||this.matchSync(c,u,l);for(let[c,u]of r.subwalks.entries())n++,this.walkCB2Sync(c,u,r.child(),a);a()}};mr.GlobUtil=Na;var rg=class extends Na{static{o(this,"GlobWalker")}matches=new Set;constructor(e,t,r){super(e,t,r)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}};mr.GlobWalker=rg;var sg=class extends Na{static{o(this,"GlobStream")}results;constructor(e,t,r){super(e,t,r),this.results=new Rq.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}};mr.GlobStream=sg});var og=d(Cl=>{"use strict";Object.defineProperty(Cl,"__esModule",{value:!0});Cl.Glob=void 0;var Tq=Mi(),Cq=require("node:url"),Al=sv(),Nq=Qm(),Tl=lv(),Pq=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ng=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,Cq.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(u=>u.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(u=>u.includes("/")?u:`./**/${u}`)}if(this.pattern=e,this.platform=t.platform||Pq,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 u=t.platform==="win32"?Al.PathScurryWin32:t.platform==="darwin"?Al.PathScurryDarwin:t.platform?Al.PathScurryPosix:Al.PathScurry;this.scurry=new u(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let r=this.platform==="darwin"||this.platform==="win32",s={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:r,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},n=this.pattern.map(u=>new Tq.Minimatch(u,s)),[a,c]=n.reduce((u,l)=>(u[0].push(...l.set),u[1].push(...l.globParts),u),[[],[]]);this.patterns=a.map((u,l)=>{let h=c[l];if(!h)throw new Error("invalid pattern object");return new Nq.Pattern(u,h,0,this.platform)})}async walk(){return[...await new Tl.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 Tl.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 Tl.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 Tl.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()}};Cl.Glob=ng});var ag=d(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.hasMagic=void 0;var Dq=Mi(),xq=o((i,e={})=>{Array.isArray(i)||(i=[i]);for(let t of i)if(new Dq.Minimatch(t,e).hasMagic())return!0;return!1},"hasMagic");Nl.hasMagic=xq});var hg=d(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.glob=q.sync=q.iterate=q.iterateSync=q.stream=q.streamSync=q.Ignore=q.hasMagic=q.Glob=q.unescape=q.escape=void 0;q.globStreamSync=Pa;q.globStream=cg;q.globSync=ug;q.globIterateSync=Da;q.globIterate=lg;var hv=Mi(),hs=og(),Lq=ag(),dv=Mi();Object.defineProperty(q,"escape",{enumerable:!0,get:o(function(){return dv.escape},"get")});Object.defineProperty(q,"unescape",{enumerable:!0,get:o(function(){return dv.unescape},"get")});var Mq=og();Object.defineProperty(q,"Glob",{enumerable:!0,get:o(function(){return Mq.Glob},"get")});var Bq=ag();Object.defineProperty(q,"hasMagic",{enumerable:!0,get:o(function(){return Bq.hasMagic},"get")});var kq=tg();Object.defineProperty(q,"Ignore",{enumerable:!0,get:o(function(){return kq.Ignore},"get")});function Pa(i,e={}){return new hs.Glob(i,e).streamSync()}o(Pa,"globStreamSync");function cg(i,e={}){return new hs.Glob(i,e).stream()}o(cg,"globStream");function ug(i,e={}){return new hs.Glob(i,e).walkSync()}o(ug,"globSync");async function fv(i,e={}){return new hs.Glob(i,e).walk()}o(fv,"glob_");function Da(i,e={}){return new hs.Glob(i,e).iterateSync()}o(Da,"globIterateSync");function lg(i,e={}){return new hs.Glob(i,e).iterate()}o(lg,"globIterate");q.streamSync=Pa;q.stream=Object.assign(cg,{sync:Pa});q.iterateSync=Da;q.iterate=Object.assign(lg,{sync:Da});q.sync=Object.assign(ug,{stream:Pa,iterate:Da});q.glob=Object.assign(fv,{glob:fv,globSync:ug,sync:q.sync,globStream:cg,stream:q.stream,globStreamSync:Pa,streamSync:q.streamSync,globIterate:lg,iterate:q.iterate,globIterateSync:Da,iterateSync:q.iterateSync,Glob:hs.Glob,hasMagic:Lq.hasMagic,escape:hv.escape,unescape:hv.unescape});q.glob.glob=q.glob});var fg=d((rhe,Fq)=>{Fq.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 pv=d((she,Uq)=>{Uq.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 mv=d((nhe,jq)=>{jq.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 yv=d((ohe,gv)=>{"use strict";var $q=[].concat(fg()).concat(pv()),qq=mv();gv.exports=function(i){var e=0;function t(){return e<i.length}o(t,"hasMore");function r(y){if(y instanceof RegExp){var g=i.slice(e),S=g.match(y);if(S)return e+=S[0].length,S[0]}else if(i.indexOf(y,e)===e)return e+=y.length,y}o(r,"read");function s(){r(/[ ]*/)}o(s,"skipWhitespace");function n(){for(var y,g=["WITH","AND","OR","(",")",":","+"],S=0;S<g.length&&(y=r(g[S]),!y);S++);if(y==="+"&&e>1&&i[e-2]===" ")throw new Error("Space before `+`");return y&&{type:"OPERATOR",string:y}}o(n,"operator");function a(){return r(/[A-Za-z0-9-.]+/)}o(a,"idstring");function c(){var y=a();if(!y)throw new Error("Expected idstring at offset "+e);return y}o(c,"expectIdstring");function u(){if(r("DocumentRef-")){var y=c();return{type:"DOCUMENTREF",string:y}}}o(u,"documentRef");function l(){if(r("LicenseRef-")){var y=c();return{type:"LICENSEREF",string:y}}}o(l,"licenseRef");function h(){var y=e,g=a();if($q.indexOf(g)!==-1)return{type:"LICENSE",string:g};if(qq.indexOf(g)!==-1)return{type:"EXCEPTION",string:g};e=y}o(h,"identifier");function f(){return n()||u()||l()||h()}o(f,"parseToken");for(var p=[];t()&&(s(),!!t());){var m=f();if(!m)throw new Error("Unexpected `"+i[e]+"` at offset "+e);p.push(m)}return p}});var Ev=d((che,Sv)=>{"use strict";Sv.exports=function(i){var e=0;function t(){return e<i.length}o(t,"hasMore");function r(){return t()?i[e]:null}o(r,"token");function s(){if(!t())throw new Error;e++}o(s,"next");function n(g){var S=r();if(S&&S.type==="OPERATOR"&&g===S.string)return s(),S.string}o(n,"parseOperator");function a(){if(n("WITH")){var g=r();if(g&&g.type==="EXCEPTION")return s(),g.string;throw new Error("Expected exception after `WITH`")}}o(a,"parseWith");function c(){var g=e,S="",E=r();if(E.type==="DOCUMENTREF"&&(s(),S+="DocumentRef-"+E.string+":",!n(":")))throw new Error("Expected `:` after `DocumentRef-...`");if(E=r(),E.type==="LICENSEREF")return s(),S+="LicenseRef-"+E.string,{license:S};e=g}o(c,"parseLicenseRef");function u(){var g=r();if(g&&g.type==="LICENSE"){s();var S={license:g.string};n("+")&&(S.plus=!0);var E=a();return E&&(S.exception=E),S}}o(u,"parseLicense");function l(){var g=n("(");if(g){var S=m();if(!n(")"))throw new Error("Expected `)`");return S}}o(l,"parseParenthesizedExpression");function h(){return l()||c()||u()}o(h,"parseAtom");function f(g,S){return o(function E(){var _=S();if(_){if(!n(g))return _;var b=E();if(!b)throw new Error("Expected expression");return{left:_,conjunction:g.toLowerCase(),right:b}}},"parseBinaryOp")}o(f,"makeBinaryOpParser");var p=f("AND",h),m=f("OR",p),y=m();if(!y||t())throw new Error("Syntax error");return y}});var dg=d((lhe,wv)=>{"use strict";var Vq=yv(),zq=Ev();wv.exports=function(i){return zq(Vq(i))}});var Cv=d((hhe,Tv)=>{var Hq=dg(),Gq=fg();function Pl(i){try{return Hq(i),!0}catch{return!1}}o(Pl,"valid");function Av(i,e){var t=e[0].length-i[0].length;return t!==0?t:i[0].toUpperCase().localeCompare(e[0].toUpperCase())}o(Av,"sortTranspositions");var _v=[["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(Av),Wq=0,Jq=1,bv=[function(i){return i.toUpperCase()},function(i){return i.trim()},function(i){return i.replace(/\./g,"")},function(i){return i.replace(/\s+/g,"")},function(i){return i.replace(/\s+/g,"-")},function(i){return i.replace("v","-")},function(i){return i.replace(/,?\s*(\d)/,"-$1")},function(i){return i.replace(/,?\s*(\d)/,"-$1.0")},function(i){return i.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2")},function(i){return i.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2.0")},function(i){return i[0].toUpperCase()+i.slice(1)},function(i){return i.replace("/","-")},function(i){return i.replace(/\s*V\s*(\d)/,"-$1").replace(/(\d)$/,"$1.0")},function(i){return i.indexOf("3.0")!==-1?i+"-or-later":i+"-only"},function(i){return i+"only"},function(i){return i.replace(/(\d)$/,"-$1.0")},function(i){return i.replace(/(-| )?(\d)$/,"-$2-Clause")},function(i){return i.replace(/(-| )clause(-| )(\d)/,"-$3-Clause")},function(i){return i.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i,"BSD-3-Clause")},function(i){return i.replace(/\bSimplified(-| )?BSD((-| )License)?/i,"BSD-2-Clause")},function(i){return i.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i,"BSD-2-Clause-$1BSD")},function(i){return i.replace(/\bClear(-| )?BSD((-| )License)?/i,"BSD-3-Clause-Clear")},function(i){return i.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i,"BSD-4-Clause")},function(i){return"CC-"+i},function(i){return"CC-"+i+"-4.0"},function(i){return i.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")},function(i){return"CC-"+i.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")+"-4.0"}],pg=Gq.map(function(i){var e=/^(.*)-\d+\.\d+$/.exec(i);return e?[e[0],e[1]]:[i,null]}).reduce(function(i,e){var t=e[1];return i[t]=i[t]||[],i[t].push(e[0]),i},{}),Kq=Object.keys(pg).map(o(function(e){return[e,pg[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"));pg=void 0;var Iv=[["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(Kq).sort(Av),Zq=0,Yq=1,Ov=o(function(i){for(var e=0;e<bv.length;e++){var t=bv[e](i).trim();if(t!==i&&Pl(t))return t}return null},"validTransformation"),vv=o(function(i){for(var e=i.toUpperCase(),t=0;t<Iv.length;t++){var r=Iv[t];if(e.indexOf(r[Zq])>-1)return r[Yq]}return null},"validLastResort"),Rv=o(function(i,e){for(var t=0;t<_v.length;t++){var r=_v[t],s=r[Wq];if(i.indexOf(s)>-1){var n=i.replace(s,r[Jq]),a=e(n);if(a!==null)return a}}return null},"anyCorrection");Tv.exports=function(i,e){e=e||{};var t=e.upgrade===void 0?!0:!!e.upgrade;function r(c){return t?Xq(c):c}o(r,"postprocess");var s=typeof i=="string"&&i.trim().length!==0;if(!s)throw Error("Invalid argument. Expected non-empty string.");if(i=i.trim(),Pl(i))return r(i);var n=i.replace(/\+$/,"").trim();if(Pl(n))return r(n);var a=Ov(i);return a!==null||(a=Rv(i,function(c){return Pl(c)?c:Ov(c)}),a!==null)||(a=vv(i),a!==null)||(a=Rv(i,vv),a!==null)?r(a):null};function Xq(i){return["GPL-1.0","LGPL-1.0","AGPL-1.0","GPL-2.0","LGPL-2.0","AGPL-2.0","LGPL-2.1"].indexOf(i)!==-1?i+"-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(i)!==-1?i.replace(/\+$/,"-or-later"):["GPL-3.0","LGPL-3.0","AGPL-3.0"].indexOf(i)!==-1?i+"-or-later":i}o(Xq,"upgradeGPLs")});var xv=d((dhe,Dv)=>{var Qq=dg(),eV=Cv(),Nv='license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"',tV=/^SEE LICEN[CS]E IN (.+)$/;function Pv(i,e){return e.slice(0,i.length)===i}o(Pv,"startsWith");function mg(i){if(i.hasOwnProperty("license")){var e=i.license;return Pv("LicenseRef",e)||Pv("DocumentRef",e)}else return mg(i.left)||mg(i.right)}o(mg,"usesLicenseRef");Dv.exports=function(i){var e;try{e=Qq(i)}catch{var t;if(i==="UNLICENSED"||i==="UNLICENCED")return{validForOldPackages:!0,validForNewPackages:!0,unlicensed:!0};if(t=tV.exec(i))return{validForOldPackages:!0,validForNewPackages:!0,inFile:t[1]};var r={validForOldPackages:!1,validForNewPackages:!1,warnings:[Nv]};if(i.trim().length!==0){var s=eV(i);s&&r.warnings.push('license is similar to the valid expression "'+s+'"')}return r}return mg(e)?{validForNewPackages:!1,validForOldPackages:!1,spdx:!0,warnings:[Nv]}:{validForNewPackages:!0,validForOldPackages:!0,spdx:!0}}});var Uv=d((mhe,Fv)=>{var{URL:gg}=require("node:url"),Lv=Xu(),iV=xv(),Mv={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"},Bv=o(i=>i.includes("@")&&i.indexOf("@")<i.lastIndexOf("."),"isEmail");function rV(i){let e=i.trim().split(`
10
+ `),t=0;for(;e[t]?.trim().match(/^(#|$)/);)t++;let r=t+1;for(;r<e.length&&e[r].trim();)r++;return e.slice(t,r).join(" ").trim()}o(rV,"extractDescription");function kv(i){if(typeof i!="string"){let n=i.name||"",a=i.url||i.web,c=a?" ("+a+")":"",u=i.email||i.mail,l=u?" <"+u+">":"";i=n+l+c}let e=i.match(/^([^(<]+)/),t=i.match(/\(([^()]+)\)/),r=i.match(/<([^<>]+)>/),s={};return e?.[0].trim()&&(s.name=e[0].trim()),r&&(s.email=r[1]),t&&(s.url=t[1]),s}o(kv,"stringifyPerson");function sV(i,e){i.description&&typeof i.description!="string"&&(e?.push("'description' field should be a string"),delete i.description),i.readme&&!i.description&&i.readme!=="ERROR: No README data found!"&&(i.description=rV(i.readme)),i.description===void 0&&delete i.description,i.description||e?.push("No description"),i.modules&&(e?.push("modules field is deprecated"),delete i.modules);let t=i.files;if(t&&!Array.isArray(t)?(e?.push("Invalid 'files' member"),delete i.files):i.files&&(i.files=i.files.filter(function(a){return!a||typeof a!="string"?(e?.push(`Invalid filename in 'files' list: ${a}`),!1):!0})),i.man&&typeof i.man=="string"&&(i.man=[i.man]),!i.bugs&&i.repository?.url){let a=Lv.fromUrl(i.repository.url);a&&a.bugs()&&(i.bugs={url:a.bugs()})}else if(i.bugs){if(typeof i.bugs=="string")Bv(i.bugs)?i.bugs={email:i.bugs}:gg.canParse(i.bugs)?i.bugs={url:i.bugs}:e?.push("Bug string field must be url, email, or {email,url}");else{for(let c in i.bugs)["web","name"].includes(c)&&(e?.push(`bugs['${c}'] should probably be bugs['url'].`),i.bugs.url=i.bugs[c],delete i.bugs[c]);let a=i.bugs;i.bugs={},a.url&&(gg.canParse(a.url)?i.bugs.url=a.url:e?.push("bugs.url field must be a string url. Deleted.")),a.email&&(typeof a.email=="string"&&Bv(a.email)?i.bugs.email=a.email:e?.push("bugs.email field must be a string email. Deleted."))}!i.bugs.email&&!i.bugs.url&&(delete i.bugs,e?.push("Normalized value of bugs field is an empty object. Deleted."))}typeof i.keywords=="string"&&(i.keywords=i.keywords.split(/,\s+/)),i.keywords&&!Array.isArray(i.keywords)?(delete i.keywords,e?.push("keywords should be an array of strings")):i.keywords&&(i.keywords=i.keywords.filter(function(a){return typeof a!="string"||!a?(e?.push("keywords should be an array of strings"),!1):!0}));let r="bundledDependencies",s="bundleDependencies";if(i[r]&&!i[s]&&(i[s]=i[r],delete i[r]),i[s]&&!Array.isArray(i[s])?(e?.push("Invalid 'bundleDependencies' list. Must be array of package names"),delete i[s]):i[s]&&(i[s]=i[s].filter(function(a){return!a||typeof a!="string"?(e?.push(`Invalid bundleDependencies member: ${a}`),!1):(i.dependencies||(i.dependencies={}),Object.prototype.hasOwnProperty.call(i.dependencies,a)||(e?.push(`Non-dependency in bundleDependencies: ${a}`),i.dependencies[a]="*"),!0)})),!i.homepage&&i.repository&&i.repository.url){let a=Lv.fromUrl(i.repository.url);a&&(i.homepage=a.docs())}i.homepage&&(typeof i.homepage!="string"?(e?.push("homepage field must be a string url. Deleted."),delete i.homepage):gg.canParse(i.homepage)||(i.homepage="http://"+i.homepage)),i.readme||(e?.push("No README data"),i.readme="ERROR: No README data found!");let n=i.license||i.licence;n?typeof n!="string"||n.length<1||n.trim()===""?e?.push("license should be a valid SPDX license expression"):iV(n).validForNewPackages||e?.push("license should be a valid SPDX license expression"):e?.push("No license field."),i.author&&(i.author=kv(i.author)),["maintainers","contributors"].forEach(function(a){Array.isArray(i[a])&&(i[a]=i[a].map(kv))});for(let a in Mv)Object.prototype.hasOwnProperty.call(i,a)&&e?.push(`${a} should probably be ${Mv[a]}.`)}o(sV,"normalizeData");Fv.exports={normalizeData:sV}});var $v=d(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});dn.sync=dn.isexe=void 0;var nV=require("fs"),oV=require("fs/promises"),aV=o(async(i,e={})=>{let{ignoreErrors:t=!1}=e;try{return jv(await(0,oV.stat)(i),e)}catch(r){let s=r;if(t||s.code==="EACCES")return!1;throw s}},"isexe");dn.isexe=aV;var cV=o((i,e={})=>{let{ignoreErrors:t=!1}=e;try{return jv((0,nV.statSync)(i),e)}catch(r){let s=r;if(t||s.code==="EACCES")return!1;throw s}},"sync");dn.sync=cV;var jv=o((i,e)=>i.isFile()&&uV(i,e),"checkStat"),uV=o((i,e)=>{let t=e.uid??process.getuid?.(),r=e.groups??process.getgroups?.()??[],s=e.gid??process.getgid?.()??r[0];if(t===void 0||s===void 0)throw new Error("cannot get uid or gid");let n=new Set([s,...r]),a=i.mode,c=i.uid,u=i.gid,l=parseInt("100",8),h=parseInt("010",8),f=parseInt("001",8),p=l|h;return!!(a&f||a&h&&n.has(u)||a&l&&c===t||a&p&&t===0)},"checkMode")});var Vv=d(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.sync=pn.isexe=void 0;var lV=require("fs"),hV=require("fs/promises"),fV=o(async(i,e={})=>{let{ignoreErrors:t=!1}=e;try{return qv(await(0,hV.stat)(i),i,e)}catch(r){let s=r;if(t||s.code==="EACCES")return!1;throw s}},"isexe");pn.isexe=fV;var dV=o((i,e={})=>{let{ignoreErrors:t=!1}=e;try{return qv((0,lV.statSync)(i),i,e)}catch(r){let s=r;if(t||s.code==="EACCES")return!1;throw s}},"sync");pn.sync=dV;var pV=o((i,e)=>{let{pathExt:t=process.env.PATHEXT||""}=e,r=t.split(";");if(r.indexOf("")!==-1)return!0;for(let s=0;s<r.length;s++){let n=r[s].toLowerCase(),a=i.substring(i.length-n.length).toLowerCase();if(n&&a===n)return!0}return!1},"checkPathExt"),qv=o((i,e,t)=>i.isFile()&&pV(e,t),"checkStat")});var Hv=d(zv=>{"use strict";Object.defineProperty(zv,"__esModule",{value:!0})});var Yv=d(Oe=>{"use strict";var Gv=Oe&&Oe.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),mV=Oe&&Oe.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Wv=Oe&&Oe.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&Gv(e,i,t);return mV(e,i),e},gV=Oe&&Oe.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Gv(e,i,t)};Object.defineProperty(Oe,"__esModule",{value:!0});Oe.sync=Oe.isexe=Oe.posix=Oe.win32=void 0;var Jv=Wv($v());Oe.posix=Jv;var Kv=Wv(Vv());Oe.win32=Kv;gV(Hv(),Oe);var yV=process.env._ISEXE_TEST_PLATFORM_||process.platform,Zv=yV==="win32"?Kv:Jv;Oe.isexe=Zv.isexe;Oe.sync=Zv.sync});var yg=d((Ohe,oR)=>{var{isexe:SV,sync:EV}=Yv(),{join:wV,delimiter:_V,sep:Xv,posix:Qv}=require("path"),eR=process.platform==="win32",tR=new RegExp(`[${Qv.sep}${Xv===Qv.sep?"":Xv}]`.replace(/(\\)/g,"\\$1")),bV=new RegExp(`^\\.${tR.source}`),iR=o(i=>Object.assign(new Error(`not found: ${i}`),{code:"ENOENT"}),"getNotFoundError"),rR=o((i,{path:e=process.env.PATH,pathExt:t=process.env.PATHEXT,delimiter:r=_V})=>{let s=i.match(tR)?[""]:[...eR?[process.cwd()]:[],...(e||"").split(r)];if(eR){let n=t||[".EXE",".CMD",".BAT",".COM"].join(r),a=n.split(r).flatMap(c=>[c,c.toLowerCase()]);return i.includes(".")&&a[0]!==""&&a.unshift(""),{pathEnv:s,pathExt:a,pathExtExe:n}}return{pathEnv:s,pathExt:[""]}},"getPathInfo"),sR=o((i,e)=>{let t=/^".*"$/.test(i)?i.slice(1,-1):i;return(!t&&bV.test(e)?e.slice(0,2):"")+wV(t,e)},"getPathPart"),nR=o(async(i,e={})=>{let{pathEnv:t,pathExt:r,pathExtExe:s}=rR(i,e),n=[];for(let a of t){let c=sR(a,i);for(let u of r){let l=c+u;if(await SV(l,{pathExt:s,ignoreErrors:!0})){if(!e.all)return l;n.push(l)}}}if(e.all&&n.length)return n;if(e.nothrow)return null;throw iR(i)},"which"),IV=o((i,e={})=>{let{pathEnv:t,pathExt:r,pathExtExe:s}=rR(i,e),n=[];for(let a of t){let c=sR(a,i);for(let u of r){let l=c+u;if(EV(l,{pathExt:s,ignoreErrors:!0})){if(!e.all)return l;n.push(l)}}}if(e.all&&n.length)return n;if(e.nothrow)return null;throw iR(i)},"whichSync");oR.exports=nR;nR.sync=IV});var cR=d((Rhe,aR)=>{"use strict";var OV=o((i,e)=>{if(!i.length)return'""';let t;if(!/[ \t\n\v"]/.test(i))t=i;else{t='"';for(let r=0;r<=i.length;++r){let s=0;for(;i[r]==="\\";)++r,++s;if(r===i.length){t+="\\".repeat(s*2);break}i[r]==='"'?(t+="\\".repeat(s*2+1),t+=i[r]):(t+="\\".repeat(s),t+=i[r])}t+='"'}return t=t.replace(/[ !%^&()<>|"]/g,"^$&"),e&&(t=t.replace(/[ !%^&()<>|"]/g,"^$&")),t},"cmd"),vV=o(i=>i.length?/[\t\n\r "#$&'()*;<>?\\`|~]/.test(i)?`'${i.replace(/'/g,"'\\''")}'`.replace(/^(?:'')+(?!$)/,"").replace(/\\'''/g,"\\'"):i:"''","sh");aR.exports={cmd:OV,sh:vV}});var Dl=d((The,fR)=>{"use strict";var{spawn:RV}=require("child_process"),AV=require("os"),TV=yg(),uR=cR(),Eg=o((i,e,t={},r={})=>{if(t.shell)return hR(i,e,t,r);let s,n,a=new Promise((m,y)=>{s=m,n=y}),c=new Error("command failed"),u=[],l=[],h=o(m=>({cmd:i,args:e,...m,...NV(u,l,t),...r}),"getResult"),f=o((m,y)=>{let g=h(y);n(Object.assign(m,g))},"rejectWithOpts"),p=RV(i,e,t);return a.stdin=p.stdin,a.process=p,p.on("error",f),p.stdout&&(p.stdout.on("data",m=>u.push(m)),p.stdout.on("error",f)),p.stderr&&(p.stderr.on("data",m=>l.push(m)),p.stderr.on("error",f)),p.on("close",(m,y)=>{m||y?f(c,{code:m,signal:y}):s(h({code:m,signal:y}))}),a},"promiseSpawn"),hR=o((i,e,t,r)=>{let s=t.shell;s===!0&&(s=process.platform==="win32"?process.env.ComSpec||"cmd.exe":"sh");let n={...t,shell:!1},a=[],c=i;if(/(?:^|\\)cmd(?:\.exe)?$/i.test(s)){let l=!1,h="",f=!1;for(let m=0;m<i.length;++m){let y=i.charAt(m);if(y===" "&&!f)break;h+=y,(y==='"'||y==="'")&&(f=!f)}let p;try{p=TV.sync(h,{path:n.env&&lR(n.env,"PATH")||process.env.PATH,pathext:n.env&&lR(n.env,"PATHEXT")||process.env.PATHEXT}).toLowerCase()}catch{p=h.toLowerCase()}l=p.endsWith(".cmd")||p.endsWith(".bat");for(let m of e)c+=` ${uR.cmd(m,l)}`;a.push("/d","/s","/c",c),n.windowsVerbatimArguments=!0}else{for(let l of e)c+=` ${uR.sh(l)}`;a.push("-c",c)}return Eg(s,a,n,r)},"spawnWithShell"),CV=o((i,e={},t={})=>{let r={...e,shell:!0},s=[].concat(i),n=process.platform;if(n==="linux"&&AV.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=r.command;return a||(n==="win32"?(r.shell=process.env.ComSpec,a='start ""'):n==="wsl"?a="sensible-browser":n==="darwin"?a="open":a="xdg-open"),hR(a,s,r,t)},"open");Eg.open=CV;var Sg=o((i="pipe",e)=>i==="pipe"||i===null?!0:Array.isArray(i)?Sg(i[e],e):!1,"isPipe"),NV=o((i,e,{stdioString:t=!0,stdio:r})=>{let s={stdout:null,stderr:null};return Sg(r,1)&&(s.stdout=Buffer.concat(i),t&&(s.stdout=s.stdout.toString().trim())),Sg(r,2)&&(s.stderr=Buffer.concat(e),t&&(s.stderr=s.stderr.toString().trim())),s},"stdioResult"),lR=o((i,e)=>{e=e.toLowerCase();for(let t of Object.keys(i).sort())if(t.toLowerCase()===e)return i[t]},"findInObject");fR.exports=Eg});var mR=d((Nhe,pR)=>{"use strict";function dR(i,e){for(let t in e)Object.defineProperty(i,t,{value:e[t],enumerable:!0,configurable:!0});return i}o(dR,"assign");function PV(i,e,t){if(!i||typeof i=="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 dR(i,t)}catch{t.message=i.message,t.stack=i.stack;let s=o(function(){},"ErrClass");return s.prototype=Object.create(Object.getPrototypeOf(i)),dR(new s,t)}}o(PV,"createError");pR.exports=PV});var yR=d((Dhe,gR)=>{function bt(i,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(i)),this._timeouts=i,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(bt,"RetryOperation");gR.exports=bt;bt.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};bt.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};bt.prototype.retry=function(i){if(this._timeout&&clearTimeout(this._timeout),!i)return!1;var e=new Date().getTime();if(i&&e-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(i);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),t=this._timeouts.shift();else return!1;var r=this,s=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},t);return this._options.unref&&s.unref(),!0};bt.prototype.attempt=function(i,e){this._fn=i,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)};bt.prototype.try=function(i){this.attempt(i)};bt.prototype.start=function(i){this.attempt(i)};bt.prototype.start=bt.prototype.try;bt.prototype.errors=function(){return this._errors};bt.prototype.attempts=function(){return this._attempts};bt.prototype.mainError=function(){if(this._errors.length===0)return null;for(var i={},e=null,t=0,r=0;r<this._errors.length;r++){var s=this._errors[r],n=s.message,a=(i[n]||0)+1;i[n]=a,a>=t&&(e=s,t=a)}return e}});var SR=d(fs=>{var DV=yR();fs.operation=function(i){var e=fs.timeouts(i);return new DV(e,{forever:i&&i.forever,unref:i&&i.unref,maxRetryTime:i&&i.maxRetryTime})};fs.timeouts=function(i){if(i instanceof Array)return[].concat(i);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var t in i)e[t]=i[t];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],s=0;s<e.retries;s++)r.push(this.createTimeout(s,e));return i&&i.forever&&!r.length&&r.push(this.createTimeout(s,e)),r.sort(function(n,a){return n-a}),r};fs.createTimeout=function(i,e){var t=e.randomize?Math.random()+1:1,r=Math.round(t*e.minTimeout*Math.pow(e.factor,i));return r=Math.min(r,e.maxTimeout),r};fs.wrap=function(i,e,t){if(e instanceof Array&&(t=e,e=null),!t){t=[];for(var r in i)typeof i[r]=="function"&&t.push(r)}for(var s=0;s<t.length;s++){var n=t[s],a=i[n];i[n]=o(function(u){var l=fs.operation(e),h=Array.prototype.slice.call(arguments,1),f=h.pop();h.push(function(p){l.retry(p)||(p&&(arguments[0]=l.mainError()),f.apply(this,arguments))}),l.attempt(function(){u.apply(i,h)})},"retryWrapper").bind(i,a),i[n].options=e}}});var wR=d((Bhe,ER)=>{ER.exports=SR()});var xa=d((khe,bR)=>{"use strict";var xV=mR(),LV=wR(),MV=Object.prototype.hasOwnProperty;function _R(i){return i&&i.code==="EPROMISERETRY"&&MV.call(i,"retried")}o(_R,"isRetryError");function BV(i,e){var t,r;return typeof i=="object"&&typeof e=="function"&&(t=e,e=i,i=t),r=LV.operation(e),new Promise(function(s,n){r.attempt(function(a){Promise.resolve().then(function(){return i(function(c){throw _R(c)&&(c=c.retried),xV(new Error("Retrying"),"EPROMISERETRY",{retried:c})},a)}).then(s,function(c){_R(c)&&(c=c.retried,r.retry(c||new Error))||n(c)})})})}o(BV,"promiseRetry");bR.exports=BV});var Ig=d((Uhe,IR)=>{var La=class extends Error{static{o(this,"GitError")}shouldRetry(){return!1}},wg=class extends La{static{o(this,"GitConnectionError")}constructor(){super("A git connection error occurred")}shouldRetry(e){return e<3}},_g=class extends La{static{o(this,"GitPathspecError")}constructor(){super("The git reference could not be found")}},bg=class extends La{static{o(this,"GitUnknownError")}constructor(){super("An unknown git error occurred")}};IR.exports={GitConnectionError:wg,GitPathspecError:_g,GitUnknownError:bg}});var vR=d(($he,OR)=>{var{GitConnectionError:kV,GitPathspecError:FV,GitUnknownError:UV}=Ig(),jV=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("|")),$V=/pathspec .* did not match any file\(s\) known to git/;function qV(i){let e=i.stderr,t;return jV.test(e)?t=new kV(e):$V.test(e)?t=new FV(e):t=new UV(e),Object.assign(t,i)}o(qV,"makeError");OR.exports=qV});var NR=d((Vhe,CR)=>{var{hasOwnProperty:Og}=Object.prototype,vg=o((i,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
  `:`
11
- `,r=e.whitespace?" = ":"=",s=[],n=e.sort?Object.keys(i).sort():Object.keys(i),a=0;e.align&&(a=Fi(n.filter(l=>i[l]===null||Array.isArray(i[l])||typeof i[l]!="object").map(l=>Array.isArray(i[l])?`${l}[]`:l).concat([""]).reduce((l,h)=>Fi(l).length>=Fi(h).length?l:h)).length);let c="",u=e.bracketedArray?"[]":"";for(let l of n){let h=i[l];if(h&&Array.isArray(h))for(let f of h)c+=Fi(`${l}${u}`).padEnd(a," ")+r+Fi(f)+t;else h&&typeof h=="object"?s.push(l):c+=Fi(l).padEnd(a," ")+r+Fi(h)+t}e.section&&c.length&&(c="["+Fi(e.section)+"]"+(e.newline?t+t:t)+c);for(let l of s){let h=AR(l,".").join("\\."),f=(e.section?e.section+".":"")+h,p=vg(i[l],{...e,section:f});c.length&&p.length&&(c+=t),c+=p}return c},"encode");function AR(i,e){var t=0,r=0,s=0,n=[];do if(s=i.indexOf(e,t),s!==-1){if(t=s+e.length,s>0&&i[s-1]==="\\")continue;n.push(i.slice(r,s)),r=s+e.length}while(s!==-1);return n.push(i.slice(r)),n}o(AR,"splitSections");var RR=o((i,e={})=>{e.bracketedArray=e.bracketedArray!==!1;let t=Object.create(null),r=t,s=null,n=/^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i,a=i.split(/[\r\n]+/g),c={};for(let l of a){if(!l||l.match(/^\s*[;#]/)||l.match(/^\s*$/))continue;let h=l.match(n);if(!h)continue;if(h[1]!==void 0){if(s=xl(h[1]),s==="__proto__"){r=Object.create(null);continue}r=t[s]=t[s]||Object.create(null);continue}let f=xl(h[2]),p;e.bracketedArray?p=f.length>2&&f.slice(-2)==="[]":(c[f]=(c?.[f]||0)+1,p=c[f]>1);let m=p&&f.endsWith("[]")?f.slice(0,-2):f;if(m==="__proto__")continue;let y=h[3]?xl(h[4]):!0,g=y==="true"||y==="false"||y==="null"?JSON.parse(y):y;p&&(Og.call(r,m)?Array.isArray(r[m])||(r[m]=[r[m]]):r[m]=[]),Array.isArray(r[m])?r[m].push(g):r[m]=g}let u=[];for(let l of Object.keys(t)){if(!Og.call(t,l)||typeof t[l]!="object"||Array.isArray(t[l]))continue;let h=AR(l,".");r=t;let f=h.pop(),p=f.replace(/\\\./g,".");for(let m of h)m!=="__proto__"&&((!Og.call(r,m)||typeof r[m]!="object")&&(r[m]=Object.create(null)),r=r[m]);r===t&&p===f||(r[p]=t[l],u.push(l))}for(let l of u)delete t[l];return t},"decode"),TR=o(i=>i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"),"isQuoted"),Fi=o(i=>typeof i!="string"||i.match(/[=\r\n]/)||i.match(/^\[/)||i.length>1&&TR(i)||i!==i.trim()?JSON.stringify(i):i.split(";").join("\\;").split("#").join("\\#"),"safe"),xl=o(i=>{if(i=(i||"").trim(),TR(i)){i.charAt(0)==="'"&&(i=i.slice(1,-1));try{i=JSON.parse(i)}catch{}}else{let e=!1,t="";for(let r=0,s=i.length;r<s;r++){let n=i.charAt(r);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 i},"unsafe");CR.exports={parse:RR,decode:RR,stringify:vg,encode:vg,safe:Fi,unsafe:xl}});var LR=d((Vhe,Rg)=>{var PR=require("node:fs"),$V=require("node:os"),qV=require("node:path"),VV=NR(),DR=qV.join($V.homedir(),".gitconfig"),Ma=null,xR=o(()=>{if(Ma===null)try{if(Ma={},PR.existsSync(DR)){let i=PR.readFileSync(DR,"utf-8");Ma=VV.parse(i)}}catch{Ma={}}return Ma},"loadGitConfig"),zV=o(()=>{let i=xR();return{sshCommandSetInConfig:i?.core?.sshCommand!==void 0,askPassSetInConfig:i?.core?.askpass!==void 0}},"checkGitConfigs"),HV=process.env.GIT_SSH_COMMAND!==void 0,GV=process.env.GIT_ASKPASS!==void 0,{sshCommandSetInConfig:WV,askPassSetInConfig:JV}=zV(),KV={...GV||JV?{}:{GIT_ASKPASS:"echo"},...HV||WV?{}:{GIT_SSH_COMMAND:"ssh -oStrictHostKeyChecking=accept-new"}};Rg.exports=(i={})=>({stdioString:!0,...i,shell:!1,env:i.env||{...KV,...process.env}});Rg.exports.loadGitConfig=xR});var BR=d((Hhe,MR)=>{var ZV=yg(),Ag;try{Ag=ZV.sync("git")}catch{}MR.exports=(i={})=>i.git?i.git:!Ag||i.git===!1?Object.assign(new Error("No git binary found in $PATH"),{code:"ENOGIT"}):Ag});var Ba=d((Ghe,kR)=>{var YV=Dl(),XV=xa(),{log:QV}=St(),ez=vR(),tz=LR();kR.exports=(i,e={})=>{let r=BR()(e);if(r instanceof Error)return Promise.reject(r);let s=e.allowReplace||i[0]==="--no-replace-objects"?i:["--no-replace-objects",...i],n=e.retry;return n==null&&(n={retries:e.fetchRetries||2,factor:e.fetchRetryFactor||10,maxTimeout:e.fetchRetryMaxtimeout||6e4,minTimeout:e.fetchRetryMintimeout||1e3}),XV((a,c)=>(c!==1&&QV.silly("git",`Retrying git command: ${s.join(" ")} attempt # ${c}`),YV(r,s,tz(e)).catch(u=>{let l=ez(u);if(!l.shouldRetry(c))throw l;a(l)})),n)}});var Pg=d(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});Ml.LRUCache=void 0;var mn=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,UR=new Set,Tg=typeof process=="object"&&process?process:{},jR=o((i,e,t,r)=>{typeof Tg.emitWarning=="function"&&Tg.emitWarning(i,e,t,r)},"emitWarning"),Ll=globalThis.AbortController,FR=globalThis.AbortSignal;if(typeof Ll>"u"){FR=class{static{o(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,s){this._onabort.push(s)}},Ll=class{static{o(this,"AbortController")}constructor(){e()}signal=new FR;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let s of this.signal._onabort)s(r);this.signal.onabort?.(r)}}};let i=Tg.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=o(()=>{i&&(i=!1,jR("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 iz=o(i=>!UR.has(i),"shouldWarn"),Khe=Symbol("type"),gr=o(i=>i&&i===Math.floor(i)&&i>0&&isFinite(i),"isPosInt"),$R=o(i=>gr(i)?i<=Math.pow(2,8)?Uint8Array:i<=Math.pow(2,16)?Uint16Array:i<=Math.pow(2,32)?Uint32Array:i<=Number.MAX_SAFE_INTEGER?gn:null:null,"getUintArray"),gn=class extends Array{static{o(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},Cg=class i{static{o(this,"Stack")}heap;length;static#e=!1;static create(e){let t=$R(e);if(!t)return[];i.#e=!0;let r=new i(e,t);return i.#e=!1,r}constructor(e,t){if(!i.#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]}},Ng=class i{static{o(this,"LRUCache")}#e;#t;#i;#r;#s;#u;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#c;#f;#n;#h;#o;#d;#a;#p;#y;#_;#m;#A;#w;#b;#v;#I;#E;static unsafeExposeInternals(e){return{starts:e.#w,ttls:e.#b,sizes:e.#A,keyMap:e.#n,keyList:e.#h,valList:e.#o,next:e.#d,prev:e.#a,get head(){return e.#p},get tail(){return e.#y},free:e.#_,isBackgroundFetch:o(t=>e.#S(t),"isBackgroundFetch"),backgroundFetch:o((t,r,s,n)=>e.#L(t,r,s,n),"backgroundFetch"),moveToTail:o(t=>e.#j(t),"moveToTail"),indexes:o(t=>e.#P(t),"indexes"),rindexes:o(t=>e.#x(t),"rindexes"),isStale:o(t=>e.#R(t),"isStale")}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#f}get size(){return this.#c}get fetchMethod(){return this.#s}get memoMethod(){return this.#u}get dispose(){return this.#i}get disposeAfter(){return this.#r}constructor(e){let{max:t=0,ttl:r,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:a,updateAgeOnHas:c,allowStale:u,dispose:l,disposeAfter:h,noDisposeOnSet:f,noUpdateTTL:p,maxSize:m=0,maxEntrySize:y=0,sizeCalculation:g,fetchMethod:S,memoMethod:E,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:I,ignoreFetchAbort:v}=e;if(t!==0&&!gr(t))throw new TypeError("max option must be a nonnegative integer");let N=t?$R(t):Array;if(!N)throw new Error("invalid max value: "+t);if(this.#e=t,this.#t=m,this.maxEntrySize=y||this.#t,this.sizeCalculation=g,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(E!==void 0&&typeof E!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#u=E,S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#s=S,this.#I=!!S,this.#n=new Map,this.#h=new Array(t).fill(void 0),this.#o=new Array(t).fill(void 0),this.#d=new N(t),this.#a=new N(t),this.#p=0,this.#y=0,this.#_=Cg.create(t),this.#c=0,this.#f=0,typeof l=="function"&&(this.#i=l),typeof h=="function"?(this.#r=h,this.#m=[]):(this.#r=void 0,this.#m=void 0),this.#v=!!this.#i,this.#E=!!this.#r,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!_,this.allowStaleOnFetchRejection=!!w,this.allowStaleOnFetchAbort=!!I,this.ignoreFetchAbort=!!v,this.maxEntrySize!==0){if(this.#t!==0&&!gr(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!gr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#C()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!c,this.ttlResolution=gr(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=r||0,this.ttl){if(!gr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#N()}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 P="LRU_CACHE_UNBOUNDED";iz(P)&&(UR.add(P),jR("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",P,i))}}getRemainingTTL(e){return this.#n.has(e)?1/0:0}#N(){let e=new gn(this.#e),t=new gn(this.#e);this.#b=e,this.#w=t,this.#B=(n,a,c=mn.now())=>{if(t[n]=a!==0?c:0,e[n]=a,a!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#R(n)&&this.#g(this.#h[n],"expire")},a+1);u.unref&&u.unref()}},this.#O=n=>{t[n]=e[n]!==0?mn.now():0},this.#l=(n,a)=>{if(e[a]){let c=e[a],u=t[a];if(!c||!u)return;n.ttl=c,n.start=u,n.now=r||s();let l=n.now-u;n.remainingTTL=c-l}};let r=0,s=o(()=>{let n=mn.now();if(this.ttlResolution>0){r=n;let a=setTimeout(()=>r=0,this.ttlResolution);a.unref&&a.unref()}return n},"getNow");this.getRemainingTTL=n=>{let a=this.#n.get(n);if(a===void 0)return 0;let c=e[a],u=t[a];if(!c||!u)return 1/0;let l=(r||s())-u;return c-l},this.#R=n=>{let a=t[n],c=e[n];return!!c&&!!a&&(r||s())-a>c}}#O=o(()=>{},"#updateItemAge");#l=o(()=>{},"#statusTTL");#B=o(()=>{},"#setItemTTL");#R=o(()=>!1,"#isStale");#C(){let e=new gn(this.#e);this.#f=0,this.#A=e,this.#k=t=>{this.#f-=e[t],e[t]=0},this.#$=(t,r,s,n)=>{if(this.#S(r))return 0;if(!gr(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(r,t),!gr(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.#T=(t,r,s)=>{if(e[t]=r,this.#t){let n=this.#t-e[t];for(;this.#f>n;)this.#D(!0)}this.#f+=e[t],s&&(s.entrySize=r,s.totalCalculatedSize=this.#f)}}#k=o(e=>{},"#removeItemSize");#T=o((e,t,r)=>{},"#addItemSize");#$=o((e,t,r,s)=>{if(r||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#P({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#y;!(!this.#F(t)||((e||!this.#R(t))&&(yield t),t===this.#p));)t=this.#a[t]}*#x({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#p;!(!this.#F(t)||((e||!this.#R(t))&&(yield t),t===this.#y));)t=this.#d[t]}#F(e){return e!==void 0&&this.#n.get(this.#h[e])===e}*entries(){for(let e of this.#P())this.#o[e]!==void 0&&this.#h[e]!==void 0&&!this.#S(this.#o[e])&&(yield[this.#h[e],this.#o[e]])}*rentries(){for(let e of this.#x())this.#o[e]!==void 0&&this.#h[e]!==void 0&&!this.#S(this.#o[e])&&(yield[this.#h[e],this.#o[e]])}*keys(){for(let e of this.#P()){let t=this.#h[e];t!==void 0&&!this.#S(this.#o[e])&&(yield t)}}*rkeys(){for(let e of this.#x()){let t=this.#h[e];t!==void 0&&!this.#S(this.#o[e])&&(yield t)}}*values(){for(let e of this.#P())this.#o[e]!==void 0&&!this.#S(this.#o[e])&&(yield this.#o[e])}*rvalues(){for(let e of this.#x())this.#o[e]!==void 0&&!this.#S(this.#o[e])&&(yield this.#o[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#P()){let s=this.#o[r],n=this.#S(s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,this.#h[r],this))return this.get(this.#h[r],t)}}forEach(e,t=this){for(let r of this.#P()){let s=this.#o[r],n=this.#S(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#h[r],this)}}rforEach(e,t=this){for(let r of this.#x()){let s=this.#o[r],n=this.#S(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#h[r],this)}}purgeStale(){let e=!1;for(let t of this.#x({allowStale:!0}))this.#R(t)&&(this.#g(this.#h[t],"expire"),e=!0);return e}info(e){let t=this.#n.get(e);if(t===void 0)return;let r=this.#o[t],s=this.#S(r)?r.__staleWhileFetching:r;if(s===void 0)return;let n={value:s};if(this.#b&&this.#w){let a=this.#b[t],c=this.#w[t];if(a&&c){let u=a-(mn.now()-c);n.ttl=u,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 r=this.#h[t],s=this.#o[t],n=this.#S(s)?s.__staleWhileFetching:s;if(n===void 0||r===void 0)continue;let a={value:n};if(this.#b&&this.#w){a.ttl=this.#b[t];let c=mn.now()-this.#w[t];a.start=Math.floor(Date.now()-c)}this.#A&&(a.size=this.#A[t]),e.unshift([r,a])}return e}load(e){this.clear();for(let[t,r]of e){if(r.start){let s=Date.now()-r.start;r.start=mn.now()-s}this.set(t,r.value,r)}}set(e,t,r={}){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:u}=r,{noUpdateTTL:l=this.noUpdateTTL}=r,h=this.#$(e,t,r.size||0,c);if(this.maxEntrySize&&h>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#g(e,"set"),this;let f=this.#c===0?void 0:this.#n.get(e);if(f===void 0)f=this.#c===0?this.#y:this.#_.length!==0?this.#_.pop():this.#c===this.#e?this.#D(!1):this.#c,this.#h[f]=e,this.#o[f]=t,this.#n.set(e,f),this.#d[this.#y]=f,this.#a[f]=this.#y,this.#y=f,this.#c++,this.#T(f,h,u),u&&(u.set="add"),l=!1;else{this.#j(f);let p=this.#o[f];if(t!==p){if(this.#I&&this.#S(p)){p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=p;m!==void 0&&!a&&(this.#v&&this.#i?.(m,e,"set"),this.#E&&this.#m?.push([m,e,"set"]))}else a||(this.#v&&this.#i?.(p,e,"set"),this.#E&&this.#m?.push([p,e,"set"]));if(this.#k(f),this.#T(f,h,u),this.#o[f]=t,u){u.set="replace";let m=p&&this.#S(p)?p.__staleWhileFetching:p;m!==void 0&&(u.oldValue=m)}}else u&&(u.set="update")}if(s!==0&&!this.#b&&this.#N(),this.#b&&(l||this.#B(f,s,n),u&&this.#l(u,f)),!a&&this.#E&&this.#m){let p=this.#m,m;for(;m=p?.shift();)this.#r?.(...m)}return this}pop(){try{for(;this.#c;){let e=this.#o[this.#p];if(this.#D(!0),this.#S(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#E&&this.#m){let e=this.#m,t;for(;t=e?.shift();)this.#r?.(...t)}}}#D(e){let t=this.#p,r=this.#h[t],s=this.#o[t];return this.#I&&this.#S(s)?s.__abortController.abort(new Error("evicted")):(this.#v||this.#E)&&(this.#v&&this.#i?.(s,r,"evict"),this.#E&&this.#m?.push([s,r,"evict"])),this.#k(t),e&&(this.#h[t]=void 0,this.#o[t]=void 0,this.#_.push(t)),this.#c===1?(this.#p=this.#y=0,this.#_.length=0):this.#p=this.#d[t],this.#n.delete(r),this.#c--,t}has(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:s}=t,n=this.#n.get(e);if(n!==void 0){let a=this.#o[n];if(this.#S(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#R(n))s&&(s.has="stale",this.#l(s,n));else return r&&this.#O(n),s&&(s.has="hit",this.#l(s,n)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{allowStale:r=this.allowStale}=t,s=this.#n.get(e);if(s===void 0||!r&&this.#R(s))return;let n=this.#o[s];return this.#S(n)?n.__staleWhileFetching:n}#L(e,t,r,s){let n=t===void 0?void 0:this.#o[t];if(this.#S(n))return n;let a=new Ll,{signal:c}=r;c?.addEventListener("abort",()=>a.abort(c.reason),{signal:a.signal});let u={signal:a.signal,options:r,context:s},l=o((g,S=!1)=>{let{aborted:E}=a.signal,_=r.ignoreFetchAbort&&g!==void 0;if(r.status&&(E&&!S?(r.status.fetchAborted=!0,r.status.fetchError=a.signal.reason,_&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),E&&!_&&!S)return f(a.signal.reason);let b=m;return this.#o[t]===m&&(g===void 0?b.__staleWhileFetching?this.#o[t]=b.__staleWhileFetching:this.#g(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,g,u.options))),g},"cb"),h=o(g=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=g),f(g)),"eb"),f=o(g=>{let{aborted:S}=a.signal,E=S&&r.allowStaleOnFetchAbort,_=E||r.allowStaleOnFetchRejection,b=_||r.noDeleteOnFetchRejection,w=m;if(this.#o[t]===m&&(!b||w.__staleWhileFetching===void 0?this.#g(e,"fetch"):E||(this.#o[t]=w.__staleWhileFetching)),_)return r.status&&w.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),w.__staleWhileFetching;if(w.__returned===w)throw g},"fetchFail"),p=o((g,S)=>{let E=this.#s?.(e,n,u);E&&E instanceof Promise&&E.then(_=>g(_===void 0?void 0:_),S),a.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(g(void 0),r.allowStaleOnFetchAbort&&(g=o(_=>l(_,!0),"res")))})},"pcall");r.status&&(r.status.fetchDispatched=!0);let m=new Promise(p).then(l,h),y=Object.assign(m,{__abortController:a,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,y,{...u.options,status:void 0}),t=this.#n.get(e)):this.#o[t]=y,y}#S(e){if(!this.#I)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Ll}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:u=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:h=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:m=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:g,forceRefresh:S=!1,status:E,signal:_}=t;if(!this.#I)return E&&(E.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:E});let b={allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:a,noDisposeOnSet:c,size:u,sizeCalculation:l,noUpdateTTL:h,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:y,ignoreFetchAbort:m,status:E,signal:_},w=this.#n.get(e);if(w===void 0){E&&(E.fetch="miss");let I=this.#L(e,w,b,g);return I.__returned=I}else{let I=this.#o[w];if(this.#S(I)){let ee=r&&I.__staleWhileFetching!==void 0;return E&&(E.fetch="inflight",ee&&(E.returnedStale=!0)),ee?I.__staleWhileFetching:I.__returned=I}let v=this.#R(w);if(!S&&!v)return E&&(E.fetch="hit"),this.#j(w),s&&this.#O(w),E&&this.#l(E,w),I;let N=this.#L(e,w,b,g),$=N.__staleWhileFetching!==void 0&&r;return E&&(E.fetch=v?"stale":"refresh",$&&v&&(E.returnedStale=!0)),$?N.__staleWhileFetching:N.__returned=N}}async forceFetch(e,t={}){let r=await this.fetch(e,t);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,t={}){let r=this.#u;if(!r)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 u=r(e,c,{options:a,context:s});return this.set(e,u,a),u}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:a}=t,c=this.#n.get(e);if(c!==void 0){let u=this.#o[c],l=this.#S(u);return a&&this.#l(a,c),this.#R(c)?(a&&(a.get="stale"),l?(a&&r&&u.__staleWhileFetching!==void 0&&(a.returnedStale=!0),r?u.__staleWhileFetching:void 0):(n||this.#g(e,"expire"),a&&r&&(a.returnedStale=!0),r?u:void 0)):(a&&(a.get="hit"),l?u.__staleWhileFetching:(this.#j(c),s&&this.#O(c),u))}else a&&(a.get="miss")}#U(e,t){this.#a[t]=e,this.#d[e]=t}#j(e){e!==this.#y&&(e===this.#p?this.#p=this.#d[e]:this.#U(this.#a[e],this.#d[e]),this.#U(this.#y,e),this.#y=e)}delete(e){return this.#g(e,"delete")}#g(e,t){let r=!1;if(this.#c!==0){let s=this.#n.get(e);if(s!==void 0)if(r=!0,this.#c===1)this.#q(t);else{this.#k(s);let n=this.#o[s];if(this.#S(n)?n.__abortController.abort(new Error("deleted")):(this.#v||this.#E)&&(this.#v&&this.#i?.(n,e,t),this.#E&&this.#m?.push([n,e,t])),this.#n.delete(e),this.#h[s]=void 0,this.#o[s]=void 0,s===this.#y)this.#y=this.#a[s];else if(s===this.#p)this.#p=this.#d[s];else{let a=this.#a[s];this.#d[a]=this.#d[s];let c=this.#d[s];this.#a[c]=this.#a[s]}this.#c--,this.#_.push(s)}}if(this.#E&&this.#m?.length){let s=this.#m,n;for(;n=s?.shift();)this.#r?.(...n)}return r}clear(){return this.#q("delete")}#q(e){for(let t of this.#x({allowStale:!0})){let r=this.#o[t];if(this.#S(r))r.__abortController.abort(new Error("deleted"));else{let s=this.#h[t];this.#v&&this.#i?.(r,s,e),this.#E&&this.#m?.push([r,s,e])}}if(this.#n.clear(),this.#o.fill(void 0),this.#h.fill(void 0),this.#b&&this.#w&&(this.#b.fill(0),this.#w.fill(0)),this.#A&&this.#A.fill(0),this.#p=0,this.#y=0,this.#_.length=0,this.#f=0,this.#c=0,this.#E&&this.#m){let t=this.#m,r;for(;r=t?.shift();)this.#r?.(...r)}}};Ml.LRUCache=Ng});var zR=d((Xhe,VR)=>{"use strict";var qR=De(),rz=o((i,e,t,r,s)=>{typeof t=="string"&&(s=r,r=t,t=void 0);try{return new qR(i instanceof qR?i.version:i,t).inc(e,r,s).version}catch{return null}},"inc");VR.exports=rz});var WR=d((efe,GR)=>{"use strict";var HR=ns(),sz=o((i,e)=>{let t=HR(i,null,!0),r=HR(e,null,!0),s=t.compare(r);if(s===0)return null;let n=s>0,a=n?t:r,c=n?r:t,u=!!a.prerelease.length;if(!!c.prerelease.length&&!u){if(!c.patch&&!c.minor)return"major";if(c.compareMain(a)===0)return c.minor&&!c.patch?"minor":"patch"}let h=u?"pre":"";return t.major!==r.major?h+"major":t.minor!==r.minor?h+"minor":t.patch!==r.patch?h+"patch":"prerelease"},"diff");GR.exports=sz});var KR=d((ife,JR)=>{"use strict";var nz=De(),oz=o((i,e)=>new nz(i,e).major,"major");JR.exports=oz});var YR=d((sfe,ZR)=>{"use strict";var az=De(),cz=o((i,e)=>new az(i,e).minor,"minor");ZR.exports=cz});var QR=d((ofe,XR)=>{"use strict";var uz=De(),lz=o((i,e)=>new uz(i,e).patch,"patch");XR.exports=lz});var tA=d((cfe,eA)=>{"use strict";var hz=ns(),fz=o((i,e)=>{let t=hz(i,e);return t&&t.prerelease.length?t.prerelease:null},"prerelease");eA.exports=fz});var It=d((lfe,rA)=>{"use strict";var iA=De(),dz=o((i,e,t)=>new iA(i,t).compare(new iA(e,t)),"compare");rA.exports=dz});var nA=d((ffe,sA)=>{"use strict";var pz=It(),mz=o((i,e,t)=>pz(e,i,t),"rcompare");sA.exports=mz});var aA=d((pfe,oA)=>{"use strict";var gz=It(),yz=o((i,e)=>gz(i,e,!0),"compareLoose");oA.exports=yz});var Bl=d((gfe,uA)=>{"use strict";var cA=De(),Sz=o((i,e,t)=>{let r=new cA(i,t),s=new cA(e,t);return r.compare(s)||r.compareBuild(s)},"compareBuild");uA.exports=Sz});var hA=d((Sfe,lA)=>{"use strict";var Ez=Bl(),wz=o((i,e)=>i.sort((t,r)=>Ez(t,r,e)),"sort");lA.exports=wz});var dA=d((wfe,fA)=>{"use strict";var _z=Bl(),bz=o((i,e)=>i.sort((t,r)=>_z(r,t,e)),"rsort");fA.exports=bz});var ka=d((bfe,pA)=>{"use strict";var Iz=It(),Oz=o((i,e,t)=>Iz(i,e,t)>0,"gt");pA.exports=Oz});var kl=d((Ofe,mA)=>{"use strict";var vz=It(),Rz=o((i,e,t)=>vz(i,e,t)<0,"lt");mA.exports=Rz});var Dg=d((Rfe,gA)=>{"use strict";var Az=It(),Tz=o((i,e,t)=>Az(i,e,t)===0,"eq");gA.exports=Tz});var xg=d((Tfe,yA)=>{"use strict";var Cz=It(),Nz=o((i,e,t)=>Cz(i,e,t)!==0,"neq");yA.exports=Nz});var Fl=d((Nfe,SA)=>{"use strict";var Pz=It(),Dz=o((i,e,t)=>Pz(i,e,t)>=0,"gte");SA.exports=Dz});var Ul=d((Dfe,EA)=>{"use strict";var xz=It(),Lz=o((i,e,t)=>xz(i,e,t)<=0,"lte");EA.exports=Lz});var Lg=d((Lfe,wA)=>{"use strict";var Mz=Dg(),Bz=xg(),kz=ka(),Fz=Fl(),Uz=kl(),jz=Ul(),$z=o((i,e,t,r)=>{switch(e){case"===":return typeof i=="object"&&(i=i.version),typeof t=="object"&&(t=t.version),i===t;case"!==":return typeof i=="object"&&(i=i.version),typeof t=="object"&&(t=t.version),i!==t;case"":case"=":case"==":return Mz(i,t,r);case"!=":return Bz(i,t,r);case">":return kz(i,t,r);case">=":return Fz(i,t,r);case"<":return Uz(i,t,r);case"<=":return jz(i,t,r);default:throw new TypeError(`Invalid operator: ${e}`)}},"cmp");wA.exports=$z});var bA=d((Bfe,_A)=>{"use strict";var qz=De(),Vz=ns(),{safeRe:jl,t:$l}=cn(),zz=o((i,e)=>{if(i instanceof qz)return i;if(typeof i=="number"&&(i=String(i)),typeof i!="string")return null;e=e||{};let t=null;if(!e.rtl)t=i.match(e.includePrerelease?jl[$l.COERCEFULL]:jl[$l.COERCE]);else{let u=e.includePrerelease?jl[$l.COERCERTLFULL]:jl[$l.COERCERTL],l;for(;(l=u.exec(i))&&(!t||t.index+t[0].length!==i.length);)(!t||l.index+l[0].length!==t.index+t[0].length)&&(t=l),u.lastIndex=l.index+l[1].length+l[2].length;u.lastIndex=-1}if(t===null)return null;let r=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 Vz(`${r}.${s}.${n}${a}${c}`,e)},"coerce");_A.exports=zz});var OA=d((Ffe,IA)=>{"use strict";var Mg=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}};IA.exports=Mg});var Ot=d((jfe,TA)=>{"use strict";var Hz=/\s+/g,Bg=class i{static{o(this,"Range")}constructor(e,t){if(t=Wz(t),e instanceof i)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new i(e.raw,t);if(e instanceof kg)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(Hz," "),this.set=this.raw.split("||").map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter(s=>!RA(s[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let s of this.set)if(s.length===1&&eH(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 r=0;r<t.length;r++)r>0&&(this.formatted+=" "),this.formatted+=t[r].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let r=((this.options.includePrerelease&&Xz)|(this.options.loose&&Qz))+":"+e,s=vA.get(r);if(s)return s;let n=this.options.loose,a=n?Ze[ze.HYPHENRANGELOOSE]:Ze[ze.HYPHENRANGE];e=e.replace(a,lH(this.options.includePrerelease)),ne("hyphen replace",e),e=e.replace(Ze[ze.COMPARATORTRIM],Kz),ne("comparator trim",e),e=e.replace(Ze[ze.TILDETRIM],Zz),ne("tilde trim",e),e=e.replace(Ze[ze.CARETTRIM],Yz),ne("caret trim",e);let c=e.split(" ").map(f=>tH(f,this.options)).join(" ").split(/\s+/).map(f=>uH(f,this.options));n&&(c=c.filter(f=>(ne("loose invalid filter",f,this.options),!!f.match(Ze[ze.COMPARATORLOOSE])))),ne("range list",c);let u=new Map,l=c.map(f=>new kg(f,this.options));for(let f of l){if(RA(f))return[f];u.set(f.value,f)}u.size>1&&u.has("")&&u.delete("");let h=[...u.values()];return vA.set(r,h),h}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Range is required");return this.set.some(r=>AA(r,t)&&e.set.some(s=>AA(s,t)&&r.every(n=>s.every(a=>n.intersects(a,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new Jz(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(hH(this.set[t],e,this.options))return!0;return!1}};TA.exports=Bg;var Gz=OA(),vA=new Gz,Wz=zu(),kg=Fa(),ne=ha(),Jz=De(),{safeRe:Ze,t:ze,comparatorTrimReplace:Kz,tildeTrimReplace:Zz,caretTrimReplace:Yz}=cn(),{FLAG_INCLUDE_PRERELEASE:Xz,FLAG_LOOSE:Qz}=fa(),RA=o(i=>i.value==="<0.0.0-0","isNullSet"),eH=o(i=>i.value==="","isAny"),AA=o((i,e)=>{let t=!0,r=i.slice(),s=r.pop();for(;t&&r.length;)t=r.every(n=>s.intersects(n,e)),s=r.pop();return t},"isSatisfiable"),tH=o((i,e)=>(ne("comp",i,e),i=sH(i,e),ne("caret",i),i=iH(i,e),ne("tildes",i),i=oH(i,e),ne("xrange",i),i=cH(i,e),ne("stars",i),i),"parseComparator"),He=o(i=>!i||i.toLowerCase()==="x"||i==="*","isX"),iH=o((i,e)=>i.trim().split(/\s+/).map(t=>rH(t,e)).join(" "),"replaceTildes"),rH=o((i,e)=>{let t=e.loose?Ze[ze.TILDELOOSE]:Ze[ze.TILDE];return i.replace(t,(r,s,n,a,c)=>{ne("tilde",i,r,s,n,a,c);let u;return He(s)?u="":He(n)?u=`>=${s}.0.0 <${+s+1}.0.0-0`:He(a)?u=`>=${s}.${n}.0 <${s}.${+n+1}.0-0`:c?(ne("replaceTilde pr",c),u=`>=${s}.${n}.${a}-${c} <${s}.${+n+1}.0-0`):u=`>=${s}.${n}.${a} <${s}.${+n+1}.0-0`,ne("tilde return",u),u})},"replaceTilde"),sH=o((i,e)=>i.trim().split(/\s+/).map(t=>nH(t,e)).join(" "),"replaceCarets"),nH=o((i,e)=>{ne("caret",i,e);let t=e.loose?Ze[ze.CARETLOOSE]:Ze[ze.CARET],r=e.includePrerelease?"-0":"";return i.replace(t,(s,n,a,c,u)=>{ne("caret",i,s,n,a,c,u);let l;return He(n)?l="":He(a)?l=`>=${n}.0.0${r} <${+n+1}.0.0-0`:He(c)?n==="0"?l=`>=${n}.${a}.0${r} <${n}.${+a+1}.0-0`:l=`>=${n}.${a}.0${r} <${+n+1}.0.0-0`:u?(ne("replaceCaret pr",u),n==="0"?a==="0"?l=`>=${n}.${a}.${c}-${u} <${n}.${a}.${+c+1}-0`:l=`>=${n}.${a}.${c}-${u} <${n}.${+a+1}.0-0`:l=`>=${n}.${a}.${c}-${u} <${+n+1}.0.0-0`):(ne("no pr"),n==="0"?a==="0"?l=`>=${n}.${a}.${c}${r} <${n}.${a}.${+c+1}-0`:l=`>=${n}.${a}.${c}${r} <${n}.${+a+1}.0-0`:l=`>=${n}.${a}.${c} <${+n+1}.0.0-0`),ne("caret return",l),l})},"replaceCaret"),oH=o((i,e)=>(ne("replaceXRanges",i,e),i.split(/\s+/).map(t=>aH(t,e)).join(" ")),"replaceXRanges"),aH=o((i,e)=>{i=i.trim();let t=e.loose?Ze[ze.XRANGELOOSE]:Ze[ze.XRANGE];return i.replace(t,(r,s,n,a,c,u)=>{ne("xRange",i,r,s,n,a,c,u);let l=He(n),h=l||He(a),f=h||He(c),p=f;return s==="="&&p&&(s=""),u=e.includePrerelease?"-0":"",l?s===">"||s==="<"?r="<0.0.0-0":r="*":s&&p?(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==="<"&&(u="-0"),r=`${s+n}.${a}.${c}${u}`):h?r=`>=${n}.0.0${u} <${+n+1}.0.0-0`:f&&(r=`>=${n}.${a}.0${u} <${n}.${+a+1}.0-0`),ne("xRange return",r),r})},"replaceXRange"),cH=o((i,e)=>(ne("replaceStars",i,e),i.trim().replace(Ze[ze.STAR],"")),"replaceStars"),uH=o((i,e)=>(ne("replaceGTE0",i,e),i.trim().replace(Ze[e.includePrerelease?ze.GTE0PRE:ze.GTE0],"")),"replaceGTE0"),lH=o(i=>(e,t,r,s,n,a,c,u,l,h,f,p)=>(He(r)?t="":He(s)?t=`>=${r}.0.0${i?"-0":""}`:He(n)?t=`>=${r}.${s}.0${i?"-0":""}`:a?t=`>=${t}`:t=`>=${t}${i?"-0":""}`,He(l)?u="":He(h)?u=`<${+l+1}.0.0-0`:He(f)?u=`<${l}.${+h+1}.0-0`:p?u=`<=${l}.${h}.${f}-${p}`:i?u=`<${l}.${h}.${+f+1}-0`:u=`<=${u}`,`${t} ${u}`.trim()),"hyphenReplace"),hH=o((i,e,t)=>{for(let r=0;r<i.length;r++)if(!i[r].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let r=0;r<i.length;r++)if(ne(i[r].semver),i[r].semver!==kg.ANY&&i[r].semver.prerelease.length>0){let s=i[r].semver;if(s.major===e.major&&s.minor===e.minor&&s.patch===e.patch)return!0}return!1}return!0},"testSet")});var Fa=d((qfe,LA)=>{"use strict";var Ua=Symbol("SemVer ANY"),jg=class i{static{o(this,"Comparator")}static get ANY(){return Ua}constructor(e,t){if(t=CA(t),e instanceof i){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Ug("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Ua?this.value="":this.value=this.operator+this.semver.version,Ug("comp",this)}parse(e){let t=this.options.loose?NA[PA.COMPARATORLOOSE]:NA[PA.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new DA(r[2],this.options.loose):this.semver=Ua}toString(){return this.value}test(e){if(Ug("Comparator.test",e,this.options.loose),this.semver===Ua||e===Ua)return!0;if(typeof e=="string")try{e=new DA(e,this.options)}catch{return!1}return Fg(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new xA(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new xA(this.value,t).test(e.semver):(t=CA(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("=")||Fg(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Fg(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};LA.exports=jg;var CA=zu(),{safeRe:NA,t:PA}=cn(),Fg=Lg(),Ug=ha(),DA=De(),xA=Ot()});var yn=d((zfe,MA)=>{"use strict";var fH=Ot(),dH=o((i,e,t)=>{try{e=new fH(e,t)}catch{return!1}return e.test(i)},"satisfies");MA.exports=dH});var kA=d((Gfe,BA)=>{"use strict";var pH=Ot(),mH=o((i,e)=>new pH(i,e).set.map(t=>t.map(r=>r.value).join(" ").trim().split(" ")),"toComparators");BA.exports=mH});var UA=d((Jfe,FA)=>{"use strict";var gH=De(),yH=Ot(),SH=o((i,e,t)=>{let r=null,s=null,n=null;try{n=new yH(e,t)}catch{return null}return i.forEach(a=>{n.test(a)&&(!r||s.compare(a)===-1)&&(r=a,s=new gH(r,t))}),r},"maxSatisfying");FA.exports=SH});var $A=d((Zfe,jA)=>{"use strict";var EH=De(),wH=Ot(),_H=o((i,e,t)=>{let r=null,s=null,n=null;try{n=new wH(e,t)}catch{return null}return i.forEach(a=>{n.test(a)&&(!r||s.compare(a)===1)&&(r=a,s=new EH(r,t))}),r},"minSatisfying");jA.exports=_H});var zA=d((Xfe,VA)=>{"use strict";var $g=De(),bH=Ot(),qA=ka(),IH=o((i,e)=>{i=new bH(i,e);let t=new $g("0.0.0");if(i.test(t)||(t=new $g("0.0.0-0"),i.test(t)))return t;t=null;for(let r=0;r<i.set.length;++r){let s=i.set[r],n=null;s.forEach(a=>{let c=new $g(a.semver.version);switch(a.operator){case">":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!n||qA(c,n))&&(n=c);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),n&&(!t||qA(t,n))&&(t=n)}return t&&i.test(t)?t:null},"minVersion");VA.exports=IH});var qg=d((ede,HA)=>{"use strict";var OH=Ot(),vH=o((i,e)=>{try{return new OH(i,e).range||"*"}catch{return null}},"validRange");HA.exports=vH});var ql=d((ide,KA)=>{"use strict";var RH=De(),JA=Fa(),{ANY:AH}=JA,TH=Ot(),CH=yn(),GA=ka(),WA=kl(),NH=Ul(),PH=Fl(),DH=o((i,e,t,r)=>{i=new RH(i,r),e=new TH(e,r);let s,n,a,c,u;switch(t){case">":s=GA,n=NH,a=WA,c=">",u=">=";break;case"<":s=WA,n=PH,a=GA,c="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(CH(i,e,r))return!1;for(let l=0;l<e.set.length;++l){let h=e.set[l],f=null,p=null;if(h.forEach(m=>{m.semver===AH&&(m=new JA(">=0.0.0")),f=f||m,p=p||m,s(m.semver,f.semver,r)?f=m:a(m.semver,p.semver,r)&&(p=m)}),f.operator===c||f.operator===u||(!p.operator||p.operator===c)&&n(i,p.semver))return!1;if(p.operator===u&&a(i,p.semver))return!1}return!0},"outside");KA.exports=DH});var YA=d((sde,ZA)=>{"use strict";var xH=ql(),LH=o((i,e,t)=>xH(i,e,">",t),"gtr");ZA.exports=LH});var QA=d((ode,XA)=>{"use strict";var MH=ql(),BH=o((i,e,t)=>MH(i,e,"<",t),"ltr");XA.exports=BH});var iT=d((cde,tT)=>{"use strict";var eT=Ot(),kH=o((i,e,t)=>(i=new eT(i,t),e=new eT(e,t),i.intersects(e,t)),"intersects");tT.exports=kH});var sT=d((lde,rT)=>{"use strict";var FH=yn(),UH=It();rT.exports=(i,e,t)=>{let r=[],s=null,n=null,a=i.sort((h,f)=>UH(h,f,t));for(let h of a)FH(h,e,t)?(n=h,s||(s=h)):(n&&r.push([s,n]),n=null,s=null);s&&r.push([s,null]);let c=[];for(let[h,f]of r)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 u=c.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return u.length<l.length?u:e}});var lT=d((hde,uT)=>{"use strict";var nT=Ot(),zg=Fa(),{ANY:Vg}=zg,ja=yn(),Hg=It(),jH=o((i,e,t={})=>{if(i===e)return!0;i=new nT(i,t),e=new nT(e,t);let r=!1;e:for(let s of i.set){for(let n of e.set){let a=qH(s,n,t);if(r=r||a!==null,a)continue e}if(r)return!1}return!0},"subset"),$H=[new zg(">=0.0.0-0")],oT=[new zg(">=0.0.0")],qH=o((i,e,t)=>{if(i===e)return!0;if(i.length===1&&i[0].semver===Vg){if(e.length===1&&e[0].semver===Vg)return!0;t.includePrerelease?i=$H:i=oT}if(e.length===1&&e[0].semver===Vg){if(t.includePrerelease)return!0;e=oT}let r=new Set,s,n;for(let m of i)m.operator===">"||m.operator===">="?s=aT(s,m,t):m.operator==="<"||m.operator==="<="?n=cT(n,m,t):r.add(m.semver);if(r.size>1)return null;let a;if(s&&n){if(a=Hg(s.semver,n.semver,t),a>0)return null;if(a===0&&(s.operator!==">="||n.operator!=="<="))return null}for(let m of r){if(s&&!ja(m,String(s),t)||n&&!ja(m,String(n),t))return null;for(let y of e)if(!ja(m,String(y),t))return!1;return!0}let c,u,l,h,f=n&&!t.includePrerelease&&n.semver.prerelease.length?n.semver:!1,p=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 m of e){if(h=h||m.operator===">"||m.operator===">=",l=l||m.operator==="<"||m.operator==="<=",s){if(p&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===p.major&&m.semver.minor===p.minor&&m.semver.patch===p.patch&&(p=!1),m.operator===">"||m.operator===">="){if(c=aT(s,m,t),c===m&&c!==s)return!1}else if(s.operator===">="&&!ja(s.semver,String(m),t))return!1}if(n){if(f&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===f.major&&m.semver.minor===f.minor&&m.semver.patch===f.patch&&(f=!1),m.operator==="<"||m.operator==="<="){if(u=cT(n,m,t),u===m&&u!==n)return!1}else if(n.operator==="<="&&!ja(n.semver,String(m),t))return!1}if(!m.operator&&(n||s)&&a!==0)return!1}return!(s&&l&&!n&&a!==0||n&&h&&!s&&a!==0||p||f)},"simpleSubset"),aT=o((i,e,t)=>{if(!i)return e;let r=Hg(i.semver,e.semver,t);return r>0?i:r<0||e.operator===">"&&i.operator===">="?e:i},"higherGT"),cT=o((i,e,t)=>{if(!i)return e;let r=Hg(i.semver,e.semver,t);return r<0?i:r>0||e.operator==="<"&&i.operator==="<="?e:i},"lowerLT");uT.exports=jH});var ds=d((dde,dT)=>{"use strict";var Gg=cn(),hT=fa(),VH=De(),fT=Rm(),zH=ns(),HH=Tm(),GH=Cm(),WH=zR(),JH=WR(),KH=KR(),ZH=YR(),YH=QR(),XH=tA(),QH=It(),eG=nA(),tG=aA(),iG=Bl(),rG=hA(),sG=dA(),nG=ka(),oG=kl(),aG=Dg(),cG=xg(),uG=Fl(),lG=Ul(),hG=Lg(),fG=bA(),dG=Fa(),pG=Ot(),mG=yn(),gG=kA(),yG=UA(),SG=$A(),EG=zA(),wG=qg(),_G=ql(),bG=YA(),IG=QA(),OG=iT(),vG=sT(),RG=lT();dT.exports={parse:zH,valid:HH,clean:GH,inc:WH,diff:JH,major:KH,minor:ZH,patch:YH,prerelease:XH,compare:QH,rcompare:eG,compareLoose:tG,compareBuild:iG,sort:rG,rsort:sG,gt:nG,lt:oG,eq:aG,neq:cG,gte:uG,lte:lG,cmp:hG,coerce:fG,Comparator:dG,Range:pG,satisfies:mG,toComparators:gG,maxSatisfying:yG,minSatisfying:SG,minVersion:EG,validRange:wG,outside:_G,gtr:bG,ltr:IG,intersects:OG,simplifyRange:vG,subset:RG,SemVer:VH,re:Gg.re,src:Gg.src,tokens:Gg.t,SEMVER_SPEC_VERSION:hT.SEMVER_SPEC_VERSION,RELEASE_TYPES:hT.RELEASE_TYPES,compareIdentifiers:fT.compareIdentifiers,rcompareIdentifiers:fT.rcompareIdentifiers}});var gT=d((pde,mT)=>{var pT=ds();mT.exports=i=>AG(i.reduce(xG,{versions:{},"dist-tags":{},refs:{},shas:{}}));var AG=o(i=>NG(TG(CG(i))),"finish"),TG=o(i=>(Object.keys(i.refs).forEach(e=>{let t=i.refs[e];i.shas[t.sha]?i.shas[t.sha].push(e):i.shas[t.sha]=[e]}),i),"shaList"),CG=o(i=>(Object.keys(i.refs).filter(e=>e.endsWith("^{}")).forEach(e=>{let t=i.refs[e],r=i.refs[e.replace(/\^\{\}$/,"")];r&&(r.sha=t.sha,delete i.refs[e])}),i),"peelTags"),NG=o(i=>{let e=i.refs.HEAD||{};return Object.keys(i.versions).forEach(r=>{let s=i.versions[r];i.refs.latest&&s.sha===i.refs.latest.sha?i["dist-tags"].latest=r:s.sha===e.sha&&(i["dist-tags"].HEAD=r,i.refs.latest||(i["dist-tags"].latest=r))}),i},"distTags"),PG=o(i=>i.startsWith("refs/tags/")?"tag":i.startsWith("refs/heads/")?"branch":i.startsWith("refs/pull/")?"pull":i==="HEAD"?"head":"other","refType"),DG=o(i=>{let e=i.trim().split(/\s+/,2);if(e.length<2)return null;let t=e[0].trim(),r=e[1].trim(),s=PG(r);if(s==="tag"){let n=r.slice(10);return{sha:t,ref:n,rawRef:r,type:s}}if(s==="branch"){let n=r.slice(11);return{sha:t,ref:n,rawRef:r,type:s}}if(s==="pull"){let n=r.slice(5).replace(/\/head$/,"");return{sha:t,ref:n,rawRef:r,type:s}}return s==="head"?{sha:t,ref:"HEAD",rawRef:r,type:s}:{sha:t,ref:r,rawRef:r,type:s}},"lineToRevDoc"),xG=o((i,e)=>{let t=DG(e);if(!t)return i;if(i.refs[t.ref]=t,i.refs[t.rawRef]=t,t.type==="tag"){let r=!t.ref.endsWith("^{}")&&t.ref.match(/v?(\d+\.\d+\.\d+(?:[-+].+)?)$/);r&&pT.valid(r[1],!0)&&(i.versions[pT.clean(r[1],!0)]=t)}return i},"linesToRevsReducer")});var Wg=d((gde,ST)=>{var LG=Ba(),{LRUCache:MG}=Pg(),BG=gT(),yT=new MG({max:100,ttl:300*1e3});ST.exports=async(i,e={})=>{if(!e.noGitRevCache){let s=yT.get(i);if(s)return s}let{stdout:t}=await LG(["ls-remote",i],e),r=BG(t.trim().split(`
12
- `));return yT.set(i,r),r}});var wT=d(ET=>{var kG=o(i=>(i.fakePlatform||process.platform)==="win32","isWindows");ET.isWindows=kG});var IT=d((Ede,bT)=>{"use strict";var z=o((...i)=>i.every(e=>e)?i.join(""):"","maybeJoin"),ye=o(i=>i?encodeURIComponent(i):"","maybeEncode"),_T=o(i=>i.toLowerCase().replace(/^\W+/g,"").replace(/(?<!\W)\W+$/,"").replace(/\//g,"").replace(/\W+/g,"-"),"formatHashFragment"),FG={sshtemplate:o(({domain:i,user:e,project:t,committish:r})=>`git@${i}:${e}/${t}.git${z("#",r)}`,"sshtemplate"),sshurltemplate:o(({domain:i,user:e,project:t,committish:r})=>`git+ssh://git@${i}/${e}/${t}.git${z("#",r)}`,"sshurltemplate"),edittemplate:o(({domain:i,user:e,project:t,committish:r,editpath:s,path:n})=>`https://${i}/${e}/${t}${z("/",s,"/",ye(r||"HEAD"),"/",n)}`,"edittemplate"),browsetemplate:o(({domain:i,user:e,project:t,committish:r,treepath:s})=>`https://${i}/${e}/${t}${z("/",s,"/",ye(r))}`,"browsetemplate"),browsetreetemplate:o(({domain:i,user:e,project:t,committish:r,treepath:s,path:n,fragment:a,hashformat:c})=>`https://${i}/${e}/${t}/${s}/${ye(r||"HEAD")}/${n}${z("#",c(a||""))}`,"browsetreetemplate"),browseblobtemplate:o(({domain:i,user:e,project:t,committish:r,blobpath:s,path:n,fragment:a,hashformat:c})=>`https://${i}/${e}/${t}/${s}/${ye(r||"HEAD")}/${n}${z("#",c(a||""))}`,"browseblobtemplate"),docstemplate:o(({domain:i,user:e,project:t,treepath:r,committish:s})=>`https://${i}/${e}/${t}${z("/",r,"/",ye(s))}#readme`,"docstemplate"),httpstemplate:o(({auth:i,domain:e,user:t,project:r,committish:s})=>`git+https://${z(i,"@")}${e}/${t}/${r}.git${z("#",s)}`,"httpstemplate"),filetemplate:o(({domain:i,user:e,project:t,committish:r,path:s})=>`https://${i}/${e}/${t}/raw/${ye(r||"HEAD")}/${s}`,"filetemplate"),shortcuttemplate:o(({type:i,user:e,project:t,committish:r})=>`${i}:${e}/${t}${z("#",r)}`,"shortcuttemplate"),pathtemplate:o(({user:i,project:e,committish:t})=>`${i}/${e}${z("#",t)}`,"pathtemplate"),bugstemplate:o(({domain:i,user:e,project:t})=>`https://${i}/${e}/${t}/issues`,"bugstemplate"),hashformat:_T},yr={};yr.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:o(({auth:i,user:e,project:t,committish:r,path:s})=>`https://${z(i,"@")}raw.githubusercontent.com/${e}/${t}/${ye(r||"HEAD")}/${s}`,"filetemplate"),gittemplate:o(({auth:i,domain:e,user:t,project:r,committish:s})=>`git://${z(i,"@")}${e}/${t}/${r}.git${z("#",s)}`,"gittemplate"),tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://codeload.${i}/${e}/${t}/tar.gz/${ye(r||"HEAD")}`,"tarballtemplate"),extract:o(i=>{let[,e,t,r,s]=i.pathname.split("/",5);if(!(r&&r!=="tree")&&(r||(s=i.hash.slice(1)),t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:s}},"extract")};yr.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:o(({domain:i,user:e,project:t,committish:r,treepath:s,path:n,editpath:a})=>`https://${i}/${e}/${t}${z("/",s,"/",ye(r||"HEAD"),"/",n,a)}`,"edittemplate"),tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}/get/${ye(r||"HEAD")}.tar.gz`,"tarballtemplate"),extract:o(i=>{let[,e,t,r]=i.pathname.split("/",4);if(!["get"].includes(r)&&(t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:i.hash.slice(1)}},"extract")};yr.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",httpstemplate:o(({auth:i,domain:e,user:t,project:r,committish:s})=>`git+https://${z(i,"@")}${e}/${t}/${r}.git${z("#",s)}`,"httpstemplate"),tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}/repository/archive.tar.gz?ref=${ye(r||"HEAD")}`,"tarballtemplate"),extract:o(i=>{let e=i.pathname.slice(1);if(e.includes("/-/")||e.includes("/archive.tar.gz"))return;let t=e.split("/"),r=t.pop();r.endsWith(".git")&&(r=r.slice(0,-4));let s=t.join("/");if(!(!s||!r))return{user:s,project:r,committish:i.hash.slice(1)}},"extract")};yr.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:o(({domain:i,project:e,committish:t})=>`git@${i}:${e}.git${z("#",t)}`,"sshtemplate"),sshurltemplate:o(({domain:i,project:e,committish:t})=>`git+ssh://git@${i}/${e}.git${z("#",t)}`,"sshurltemplate"),edittemplate:o(({domain:i,user:e,project:t,committish:r,editpath:s})=>`https://${i}/${e}/${t}${z("/",ye(r))}/${s}`,"edittemplate"),browsetemplate:o(({domain:i,project:e,committish:t})=>`https://${i}/${e}${z("/",ye(t))}`,"browsetemplate"),browsetreetemplate:o(({domain:i,project:e,committish:t,path:r,hashformat:s})=>`https://${i}/${e}${z("/",ye(t))}${z("#",s(r))}`,"browsetreetemplate"),browseblobtemplate:o(({domain:i,project:e,committish:t,path:r,hashformat:s})=>`https://${i}/${e}${z("/",ye(t))}${z("#",s(r))}`,"browseblobtemplate"),docstemplate:o(({domain:i,project:e,committish:t})=>`https://${i}/${e}${z("/",ye(t))}`,"docstemplate"),httpstemplate:o(({domain:i,project:e,committish:t})=>`git+https://${i}/${e}.git${z("#",t)}`,"httpstemplate"),filetemplate:o(({user:i,project:e,committish:t,path:r})=>`https://gist.githubusercontent.com/${i}/${e}/raw${z("/",ye(t))}/${r}`,"filetemplate"),shortcuttemplate:o(({type:i,project:e,committish:t})=>`${i}:${e}${z("#",t)}`,"shortcuttemplate"),pathtemplate:o(({project:i,committish:e})=>`${i}${z("#",e)}`,"pathtemplate"),bugstemplate:o(({domain:i,project:e})=>`https://${i}/${e}`,"bugstemplate"),gittemplate:o(({domain:i,project:e,committish:t})=>`git://${i}/${e}.git${z("#",t)}`,"gittemplate"),tarballtemplate:o(({project:i,committish:e})=>`https://codeload.github.com/gist/${i}/tar.gz/${ye(e||"HEAD")}`,"tarballtemplate"),extract:o(i=>{let[,e,t,r]=i.pathname.split("/",4);if(r!=="raw"){if(!t){if(!e)return;t=e,e=null}return t.endsWith(".git")&&(t=t.slice(0,-4)),{user:e,project:t,committish:i.hash.slice(1)}}},"extract"),hashformat:o(function(i){return i&&"file-"+_T(i)},"hashformat")};yr.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:o(({domain:i,user:e,project:t,committish:r,path:s})=>`https://${i}/${e}/${t}/blob/${ye(r)||"HEAD"}/${s}`,"filetemplate"),httpstemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}.git${z("#",r)}`,"httpstemplate"),tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}/archive/${ye(r)||"HEAD"}.tar.gz`,"tarballtemplate"),bugstemplate:o(()=>null,"bugstemplate"),extract:o(i=>{let[,e,t,r]=i.pathname.split("/",4);if(!["archive"].includes(r)&&(t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:i.hash.slice(1)}},"extract")};for(let[i,e]of Object.entries(yr))yr[i]=Object.assign({},FG,e);bT.exports=yr});var Kg=d((_de,vT)=>{var UG=require("url"),Jg=o((i,e,t)=>{let r=i.indexOf(t);return i.lastIndexOf(e,r>-1?r:1/0)},"lastIndexOfBefore"),OT=o(i=>{try{return new UG.URL(i)}catch{}},"safeUrl"),jG=o((i,e)=>{let t=i.indexOf(":"),r=i.slice(0,t+1);if(Object.prototype.hasOwnProperty.call(e,r))return i;let s=i.indexOf("@");return s>-1?s>t?`git+ssh://${i}`:i:i.indexOf("//")===t+1?i:`${i.slice(0,t+1)}//${i.slice(t+1)}`},"correctProtocol"),$G=o(i=>{let e=Jg(i,"@","#"),t=Jg(i,":","#");return t>e&&(i=i.slice(0,t)+"/"+i.slice(t+1)),Jg(i,":","#")===-1&&i.indexOf("//")===-1&&(i=`git+ssh://${i}`),i},"correctUrl");vT.exports=(i,e)=>{let t=e?jG(i,e):i;return OT(t)||OT($G(t))}});var AT=d((Ide,RT)=>{"use strict";var qG=Kg(),VG=o(i=>{let e=i.indexOf("#"),t=i.indexOf("/"),r=i.indexOf("/",t+1),s=i.indexOf(":"),n=/\s/.exec(i),a=i.indexOf("@"),c=!n||e>-1&&n.index>e,u=a===-1||e>-1&&a>e,l=s===-1||e>-1&&s>e,h=r===-1||e>-1&&r>e,f=t>0,p=e>-1?i[e-1]!=="/":!i.endsWith("/"),m=!i.startsWith(".");return c&&f&&p&&m&&u&&l&&h},"isGitHubShorthand");RT.exports=(i,e,{gitHosts:t,protocols:r})=>{if(!i)return;let s=VG(i)?`github:${i}`:i,n=qG(s,r);if(!n)return;let a=t.byShortcut[n.protocol],c=t.byDomain[n.hostname.startsWith("www.")?n.hostname.slice(4):n.hostname],u=a||c;if(!u)return;let l=t[a||c],h=null;r[n.protocol]?.auth&&(n.username||n.password)&&(h=`${n.username}${n.password?":"+n.password:""}`);let f=null,p=null,m=null,y=null;try{if(a){let g=n.pathname.startsWith("/")?n.pathname.slice(1):n.pathname,S=g.indexOf("@");S>-1&&(g=g.slice(S+1));let E=g.lastIndexOf("/");E>-1?(p=decodeURIComponent(g.slice(0,E)),p||(p=null),m=decodeURIComponent(g.slice(E+1))):m=decodeURIComponent(g),m.endsWith(".git")&&(m=m.slice(0,-4)),n.hash&&(f=decodeURIComponent(n.hash.slice(1))),y="shortcut"}else{if(!l.protocols.includes(n.protocol))return;let g=l.extract(n);if(!g)return;p=g.user&&decodeURIComponent(g.user),m=decodeURIComponent(g.project),f=decodeURIComponent(g.committish),y=r[n.protocol]?.name||n.protocol.slice(0,-1)}}catch(g){if(g instanceof URIError)return;throw g}return[u,p,h,m,f,y,e]}});var CT=d((vde,TT)=>{"use strict";var{LRUCache:zG}=Pg(),HG=IT(),GG=AT(),WG=Kg(),Zg=new zG({max:1e3});function JG(i){try{let{protocol:e,hostname:t,pathname:r}=new URL(i);if(!t)return null;let s=/(?:git\+)http:$/.test(e)?"http:":"https:",n=r.replace(/\.git$/,"");return`${s}//${t}${n}`}catch{return null}}o(JG,"unknownHostedUrl");var Vl=class i{static{o(this,"GitHost")}constructor(e,t,r,s,n,a,c={}){Object.assign(this,i.#e[e],{type:e,user:t,auth:r,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){i.#e[e]=t,i.#e.byDomain[t.domain]=e,i.#e.byShortcut[`${e}:`]=e,i.#t[`${e}:`]={name:e}}static fromUrl(e,t){if(typeof e!="string")return;let r=e+JSON.stringify(t||{});if(!Zg.has(r)){let s=GG(e,t,{gitHosts:i.#e,protocols:i.#t});Zg.set(r,s?new i(...s):void 0)}return Zg.get(r)}static fromManifest(e,t={}){if(!e||typeof e!="object")return;let r=e.repository,s=r&&(typeof r=="string"?r:typeof r=="object"&&typeof r.url=="string"?r.url:null);if(!s)throw new Error("no repository");let n=s&&i.fromUrl(s.replace(/^git\+/,""),t)||null;if(n)return n;let a=JG(s);return i.fromUrl(a,t)||a}static parseUrl(e){return WG(e)}#i(e,t){if(typeof e!="function")return null;let r={...this,...this.opts,...t};r.path||(r.path=""),r.path.startsWith("/")&&(r.path=r.path.slice(1)),r.noCommittish&&(r.committish=null);let s=e(r);return r.noGitPlus&&s.startsWith("git+")?s.slice(4):s}hash(){return this.committish?`#${this.committish}`:""}ssh(e){return this.#i(this.sshtemplate,e)}sshurl(e){return this.#i(this.sshurltemplate,e)}browse(e,...t){return typeof e!="string"?this.#i(this.browsetemplate,e):typeof t[0]!="string"?this.#i(this.browsetreetemplate,{...t[0],path:e}):this.#i(this.browsetreetemplate,{...t[1],fragment:t[0],path:e})}browseFile(e,...t){return typeof t[0]!="string"?this.#i(this.browseblobtemplate,{...t[0],path:e}):this.#i(this.browseblobtemplate,{...t[1],fragment:t[0],path:e})}docs(e){return this.#i(this.docstemplate,e)}bugs(e){return this.#i(this.bugstemplate,e)}https(e){return this.#i(this.httpstemplate,e)}git(e){return this.#i(this.gittemplate,e)}shortcut(e){return this.#i(this.shortcuttemplate,e)}path(e){return this.#i(this.pathtemplate,e)}tarball(e){return this.#i(this.tarballtemplate,{...e,noCommittish:!1})}file(e,t){return this.#i(this.filetemplate,{...t,path:e})}edit(e,t){return this.#i(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[i,e]of Object.entries(HG))Vl.addHost(i,e);TT.exports=Vl});var Yg=d((Ade,NT)=>{"use strict";var{builtinModules:KG}=require("module"),ZG=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),YG=["node_modules","favicon.ico"];function XG(i){var e=[],t=[];if(i===null)return t.push("name cannot be null"),$a(e,t);if(i===void 0)return t.push("name cannot be undefined"),$a(e,t);if(typeof i!="string")return t.push("name must be a string"),$a(e,t);if(i.length||t.push("name length must be greater than zero"),i.startsWith(".")&&t.push("name cannot start with a period"),i.match(/^_/)&&t.push("name cannot start with an underscore"),i.trim()!==i&&t.push("name cannot contain leading or trailing spaces"),YG.forEach(function(a){i.toLowerCase()===a&&t.push(a+" is not a valid package name")}),KG.includes(i.toLowerCase())&&e.push(i+" is a core module name"),i.length>214&&e.push("name can no longer contain more than 214 characters"),i.toLowerCase()!==i&&e.push("name can no longer contain capital letters"),/[~'!()*]/.test(i.split("/").slice(-1)[0])&&e.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(i)!==i){var r=i.match(ZG);if(r){var s=r[1],n=r[2];if(n.startsWith(".")&&t.push("name cannot start with a period"),encodeURIComponent(s)===s&&encodeURIComponent(n)===n)return $a(e,t)}t.push("name can only contain URL-friendly characters")}return $a(e,t)}o(XG,"validate");var $a=o(function(i,e){var t={validForNewPackages:e.length===0&&i.length===0,validForOldPackages:e.length===0,warnings:i,errors:e};return t.warnings.length||delete t.warnings,t.errors.length||delete t.errors,t},"done");NT.exports=XG});var UT=d((Cde,Ha)=>{"use strict";var za=process.platform==="win32",{URL:Xg}=require("node:url"),Sn=za?require("node:path/win32"):require("node:path"),{homedir:QG}=require("node:os"),eW=CT(),PT=ds(),MT=Yg(),{log:tW}=St(),BT=za?/\\|[/]/:/[/]/,kT=/^(?:git[+])?[a-z]+:/i,iW=/^[^@]+@[^:.]+\.[^:]+:.+$/i,ey=/[.](?:tgz|tar.gz|tar)$/i,rW=/:[0-9]+(\/|$)/i,sW=/^(?:[.]|~[/]|[/\\]|[a-zA-Z]:)/,nW=/^(?:[.]|~[/]|[/]|[a-zA-Z]:)/,DT="https://registry.npmjs.org";function qa(i,e){let t,r;if(typeof i=="object")return i instanceof Va&&(!e||e===i.where)?i:i.name&&i.rawSpec?qa.resolve(i.name,i.rawSpec,e||i.where):qa(i.raw,e||i.where);let s=i.indexOf("@",1),n=s>0?i.slice(0,s):i;return kT.test(i)?r=i:iW.test(i)?r=`git+ssh://${i}`:!n.startsWith("@")&&(BT.test(n)||ey.test(n))?r=i:s>0?(t=n,r=i.slice(s+1)||"*"):MT(i).validForOldPackages?(t=i,r="*"):r=i,FT(t,r,e,i)}o(qa,"npa");function oW(i){return i?i.toLowerCase().startsWith("file:")?!0:za?sW.test(i):nW.test(i):!1}o(oW,"isFileSpec");function aW(i){return i?i.toLowerCase().startsWith("npm:"):!1}o(aW,"isAliasSpec");function FT(i,e,t,r){let s=new Va({raw:r,name:i,rawSpec:e,fromArgument:r!=null});if(i&&(s.name=i),t||(t=process.cwd()),oW(e))return LT(s,t);if(aW(e))return gW(s,t);let n=eW.fromUrl(e,{noGitPlus:!0,noCommittish:!0});return n?dW(s,n):e&&kT.test(e)?mW(s):e&&(BT.test(e)||ey.test(e))?LT(s,t):yW(s)}o(FT,"resolve");function cW(i,e=DT){let t=qa(i);if(t.type!=="version")throw hW(t.type,t.raw);let r="pkg:npm/"+t.name.replace(/^@/,"%40")+"@"+t.rawSpec;return e!==DT&&(r+="?repository_url="+e),r}o(cW,"toPurl");function uW(i,e,t){let r=new Error(`Invalid package name "${i}" of package "${t}": ${e.errors.join("; ")}.`);return r.code="EINVALIDPACKAGENAME",r}o(uW,"invalidPackageName");function lW(i,e){let t=new Error(`Invalid tag name "${i}" of package "${e}": Tags may not have any characters that encodeURIComponent encodes.`);return t.code="EINVALIDTAGNAME",t}o(lW,"invalidTagName");function hW(i,e){let t=new Error(`Invalid type "${i}" of package "${e}": Purl can only be generated for "version" types.`);return t.code="EINVALIDPURLTYPE",t}o(hW,"invalidPurlType");var Va=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=MT(e);if(!t.validForOldPackages)throw uW(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 Qg(i,e){if(!e){i.gitCommittish=null;return}for(let t of e.split("::")){if(!t.includes(":")){if(i.gitRange)throw new Error("cannot override existing semver range with a committish");if(i.gitCommittish)throw new Error("cannot override existing committish with a second committish");i.gitCommittish=t;continue}let[r,s]=t.split(":");if(r==="semver"){if(i.gitCommittish)throw new Error("cannot override existing committish with a semver range");if(i.gitRange)throw new Error("cannot override existing semver range with a second semver range");i.gitRange=decodeURIComponent(s);continue}if(r==="path"){if(i.gitSubdir)throw new Error("cannot override existing path with a second path");i.gitSubdir=`/${s}`;continue}tW.warn("npm-package-arg",`ignoring unknown key "${r}"`)}}o(Qg,"setGitAttrs");var fW=new Map([["\0","%00"],[" ","%09"],[`
13
- `,"%0A"],["\r","%0D"],[" ","%20"],['"',"%22"],["#","%23"],["%","%25"],["?","%3F"],["[","%5B"],["\\",za?"/":"%5C"],["]","%5D"],["^","%5E"],["|","%7C"],["~","%7E"]]);function xT(i){let e="";for(let t=0;t<i.length;t++)e=`${e}${fW.get(i[t])??i[t]}`;return e.startsWith("file:")?e:`file:${e}`}o(xT,"pathToFileURL");function LT(i,e){i.type=ey.test(i.rawSpec)?"file":"directory",i.where=e;let t=xT(i.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 r,s;try{r=new Xg(t,`${xT(Sn.resolve(e))}/`),s=new Xg(t)}catch(c){let u=new Error("Invalid file: URL, must comply with RFC 8089");throw Object.assign(u,{raw:i.rawSpec,spec:i,where:e,originalError:c})}let n=decodeURIComponent(s.pathname),a=decodeURIComponent(r.pathname);return za&&(n=n.replace(/^\/+([a-z]:\/)/i,"$1"),a=a.replace(/^\/+([a-z]:\/)/i,"$1")),/^\/~(\/|$)/.test(n)?(i.saveSpec=`file:${n.substr(1)}`,a=Sn.resolve(QG(),n.substr(3))):Sn.isAbsolute(t.slice(5))?i.saveSpec=`file:${Sn.resolve(a)}`:i.saveSpec=`file:${Sn.relative(e,a)}`,i.fetchSpec=Sn.resolve(e,a),i.saveSpec=i.saveSpec.split("\\").join("/"),i.saveSpec.startsWith("file://")&&(i.saveSpec=`file:/${i.saveSpec.slice(7)}`),i}o(LT,"fromFile");function dW(i,e){return i.type="git",i.hosted=e,i.saveSpec=e.toString({noGitPlus:!1,noCommittish:!1}),i.fetchSpec=e.getDefaultRepresentation()==="shortcut"?null:e.toString(),Qg(i,e.committish),i}o(dW,"fromHostedGit");function pW(i,e){let t=new Error(`Unsupported URL Type "${i}": ${e}`);return t.code="EUNSUPPORTEDPROTOCOL",t}o(pW,"unsupportedURLType");function mW(i){let e=i.rawSpec;if(i.saveSpec=e,e.startsWith("git+ssh:")){let r=e.match(/^git\+ssh:\/\/([^:#]+:[^#]+(?:\.git)?)(?:#(.*))?$/i);if(r&&!r[1].match(rW))return i.type="git",Qg(i,r[2]),i.fetchSpec=r[1],i}else e.startsWith("git+file://")&&(e=e.replace(/\\/g,"/"));let t=new Xg(e);switch(t.protocol){case"git:":case"git+http:":case"git+https:":case"git+rsync:":case"git+ftp:":case"git+file:":case"git+ssh:":i.type="git",Qg(i,t.hash.slice(1)),t.protocol==="git+file:"&&/^git\+file:\/\/[a-z]:/i.test(e)?i.fetchSpec=`git+file://${t.host.toLowerCase()}:${t.pathname}`:(t.hash="",i.fetchSpec=t.toString()),i.fetchSpec.startsWith("git+")&&(i.fetchSpec=i.fetchSpec.slice(4));break;case"http:":case"https:":i.type="remote",i.fetchSpec=i.saveSpec;break;default:throw pW(t.protocol,e)}return i}o(mW,"fromURL");function gW(i,e){let t=qa(i.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 i.subSpec=t,i.registry=!0,i.type="alias",i.saveSpec=null,i.fetchSpec=null,i}o(gW,"fromAlias");function yW(i){i.registry=!0;let e=i.rawSpec.trim();i.saveSpec=null,i.fetchSpec=e;let t=PT.valid(e,!0),r=PT.validRange(e,!0);if(t)i.type="version";else if(r)i.type="range";else{if(encodeURIComponent(e)!==e)throw lW(e,i.raw);i.type="tag"}return i}o(yW,"fromRegistry");Ha.exports=qa;Ha.exports.resolve=FT;Ha.exports.toPurl=cW;Ha.exports.Result=Va});var zT=d((Pde,VT)=>{var ps=require("node:process"),SW=require("node:os"),EW=require("node:fs");function wW(i){return i.includes("libc.musl-")||i.includes("ld-musl-")}o(wW,"isMusl");function jT(){return ps.platform}o(jT,"os");function $T(){return ps.arch}o($T,"cpu");var _W="/usr/bin/ldd";function bW(){try{let i=EW.readFileSync(_W,"utf-8");return i.includes("musl")?"musl":i.includes("GNU C Library")?"glibc":null}catch{return}}o(bW,"getFamilyFromFilesystem");function IW(){let i=ps.report.excludeNetwork;ps.report.excludeNetwork=!0;let e=ps.report.getReport();return ps.report.excludeNetwork=i,e.header?.glibcVersionRuntime?Ui="glibc":Array.isArray(e.sharedObjects)&&e.sharedObjects.some(wW)?Ui="musl":Ui=null,Ui}o(IW,"getFamilyFromReport");var Ui;function qT(i){if(i==="linux")return Ui===void 0&&(Ui=bW(),Ui===void 0&&(Ui=IW())),Ui}o(qT,"libc");function OW(i={}){let e=i.os||jT();return{cpu:{name:i.cpu||$T()},libc:{name:i.libc||qT(e)},os:{name:e,version:i.osVersion||SW.release()},packageManager:{name:"npm",version:i.npmVersion},runtime:{name:"node",version:i.nodeVersion||ps.version}}}o(OW,"devEngines");VT.exports={cpu:$T,libc:qT,os:jT,devEngines:OW}});var GT=d((xde,HT)=>{var vW=yn(),RW=qg(),AW=["ignore","warn","error","download"],TW=["name","version","onFail"],CW=["packageManager","runtime","cpu","libc","os"];function NW(i,e,t){let{engine:r}=t;if(typeof i!="object"||i===null||Array.isArray(i))throw new Error(`Invalid non-object value for "${r}"`);let s=Object.keys(i);for(let n of s)if(!TW.includes(n))throw new Error(`Invalid property "${n}" for "${r}"`);if(!s.includes("name"))throw new Error(`Missing "name" property for "${r}"`);if(typeof i.name!="string")throw new Error(`Invalid non-string value for "name" within "${r}"`);if(typeof e.name!="string"||e.name==="")throw new Error(`Unable to determine "name" for "${r}"`);if(s.includes("onFail")){if(typeof i.onFail!="string")throw new Error(`Invalid non-string value for "onFail" within "${r}"`);if(!AW.includes(i.onFail))throw new Error(`Invalid onFail value "${i.onFail}" for "${r}"`)}if(i.name!==e.name)return new Error(`Invalid name "${i.name}" does not match "${e.name}" for "${r}"`);if(s.includes("version")){if(typeof i.version!="string")throw new Error(`Invalid non-string value for "version" within "${r}"`);if(typeof e.version!="string"||e.version==="")throw new Error(`Unable to determine "version" for "${r}" "${i.name}"`);if(RW(i.version)){if(!vW(e.version,i.version,t.semver))return new Error(`Invalid semver version "${i.version}" does not match "${e.version}" for "${r}"`)}else if(i.version!==e.version)return new Error(`Invalid version "${i.version}" does not match "${e.version}" for "${r}"`)}}o(NW,"checkDependency");function PW(i,e={},t={}){if(typeof i!="object"||i===null||Array.isArray(i))throw new Error('Invalid non-object value for "devEngines"');let r=[];for(let s of Object.keys(i)){if(!CW.includes(s))throw new Error(`Invalid property "devEngines.${s}"`);let n=i[s],a=[n].flat(),c=e[s]||{};if(a.length===0)continue;let u=[];for(let h of a){let f=NW(h,c,{...t,engine:s});f&&u.push(f)}if(u.length===a.length){let f=a[a.length-1].onFail||"error";f==="download"&&(f="error");let p=Object.assign(new Error(`Invalid devEngines.${s}`),{errors:u,engine:s,isWarn:f==="warn",isError:f==="error",current:c,required:n});r.push(p)}}return r}o(PW,"checkDevEngines");HT.exports={checkDevEngines:PW}});var KT=d((Mde,JT)=>{var WT=ds(),zl=zT(),{checkDevEngines:DW}=GT(),xW=o((i,e,t,r=!1)=>{let s=r?null:t,n=i.engines,a={includePrerelease:!0};if(!n)return;let c=s&&n.node&&!WT.satisfies(s,n.node,a),u=e&&n.npm&&!WT.satisfies(e,n.npm,a);if(c||u)throw Object.assign(new Error("Unsupported engine"),{pkgid:i._id,current:{node:t,npm:e},required:n,code:"EBADENGINE"})},"checkEngine"),LW=o((i,e=!1,t={})=>{if(e)return;let r=t.os||zl.os(),s=t.cpu||zl.cpu(),n=t.libc||zl.libc(r),a=i.os?ty(r,i.os):!0,c=i.cpu?ty(s,i.cpu):!0,u=i.libc?ty(n,i.libc):!0;if(i.libc&&!n&&(u=!1),!a||!c||!u)throw Object.assign(new Error("Unsupported platform"),{pkgid:i._id,current:{os:r,cpu:s,libc:n},required:{os:i.os,cpu:i.cpu,libc:i.libc},code:"EBADPLATFORM"})},"checkPlatform"),ty=o((i,e)=>{if(typeof e=="string"&&(e=[e]),e.length===1&&e[0]==="any")return!0;let t=0,r=!1;for(let s of e){let n=s.charAt(0)==="!",a=n?s.slice(1):s;if(n){if(t++,i===a)return!1}else r=r||i===a}return r||t===e.length},"checkList");JT.exports={checkEngine:xW,checkPlatform:LW,checkDevEngines:DW,currentEnv:zl}});var Hl=d((kde,XT)=>{var{join:ZT,basename:YT}=require("path"),MW=o(i=>i.bin?typeof i.bin=="string"?BW(i):Array.isArray(i.bin)?kW(i):typeof i.bin=="object"?ry(i):iy(i):iy(i),"normalize"),BW=o(i=>i.name?(i.bin={[i.name]:i.bin},ry(i)):iy(i),"normalizeString"),kW=o(i=>(i.bin=i.bin.reduce((e,t)=>(e[YT(t)]=t,e),{}),ry(i)),"normalizeArray"),iy=o(i=>(delete i.bin,i),"removeBin"),ry=o(i=>{let e=i.bin,t={},r=!1;return Object.keys(e).forEach(s=>{let n=ZT("/",YT(s.replace(/\\|:/g,"/"))).slice(1);if(typeof e[s]!="string"||!n)return;let a=ZT("/",e[s].replace(/\\/g,"/")).replace(/\\/g,"/").slice(1);a&&(t[n]=a,r=!0)}),r?i.bin=t:delete i.bin,i},"normalizeObject");XT.exports=MW});var Jl=d((Ude,eC)=>{"use strict";var QT=UT(),Ga=ds(),{checkEngine:FW}=KT(),UW=Hl(),sy=o((i,e,t)=>{try{return FW(i,e,t),!0}catch{return!1}},"engineOk"),Gl=o((i,e,t)=>!i||!i[e]||Date.parse(i[e])<=t,"isBefore"),jW={includePrerelease:!0,loose:!0},Wl=o((i,e)=>e&&Ga.satisfies(i,e,jW),"shouldAvoid"),ny=o((i,e)=>i&&Wl(i.version,e)?{...i,_shouldAvoid:!0}:i,"decorateAvoid"),Wa=o((i,e,t)=>{let{defaultTag:r="latest",before:s=null,nodeVersion:n=process.version,npmVersion:a=null,includeStaged:c=!1,avoid:u=null,avoidStrict:l=!1}=t,{name:h,time:f}=i,p=i.versions||{};if(l){let P={...t,avoidStrict:!1},$=Wa(i,e,P);if(!$||!$._shouldAvoid)return $;let ee=Wa(i,`^${$.version}`,P);if(!ee||!ee._shouldAvoid)return{...ee,_outsideDependencyRange:!0,_isSemVerMajor:!1};let ti=Wa(i,"*",P);if(!ti||!ti._shouldAvoid)return{...ti,_outsideDependencyRange:!0,_isSemVerMajor:!0};throw Object.assign(new Error(`No avoidable versions for ${h}`),{code:"ETARGET",name:h,wanted:e,avoid:u,before:s,versions:Object.keys(p)})}let m=c&&i.stagedVersions&&i.stagedVersions.versions||{},y=i.policyRestrictions&&i.policyRestrictions.versions||{},g=s&&f?+new Date(s):1/0,E=QT.resolve(h,e||r).type,_=i["dist-tags"]||{};if(E!=="tag"&&E!=="version"&&E!=="range")throw new Error("Only tag, version, and range are supported");if(e&&E==="tag"){let P=_[e];return Gl(f,P,g)?ny(p[P]||m[P]||y[P],u):Wa(i,`<=${P}`,t)}if(e&&E==="version"){let P=Ga.clean(e,{loose:!0}),$=p[P]||m[P]||y[P];return Gl(f,P,g)?ny($,u):null}let b=E==="range"?e:"*",w=_[r];if(w&&(b==="*"||Ga.satisfies(w,b,{loose:!0}))&&!y[w]&&!Wl(w,u)){let P=p[w];if(P&&Gl(f,w,g)&&sy(P,a,n)&&!P.deprecated&&!m[w])return P}let I=Object.entries(p).concat(Object.entries(m)).concat(Object.entries(y)).filter(([P])=>Gl(f,P,g));if(!I.length)throw Object.assign(new Error(`No versions available for ${h}`),{code:"ENOVERSIONS",name:h,type:E,wanted:e,before:s,versions:Object.keys(p)});let v={loose:!0},N=I.filter(([P])=>Ga.satisfies(P,b,{loose:!0})).sort((P,$)=>{let[ee,ti]=P,[ss,oa]=$,Mu=!Wl(ee,u),Bu=!Wl(ss,u),ku=!y[ee],Fu=!y[ss],Uu=!m[ee],ju=!m[ss],aa=!ti.deprecated,ca=!oa.deprecated,ua=sy(ti,a,n),la=sy(oa,a,n);return Bu-Mu||Fu-ku||ju-Uu||(ca&&la)-(aa&&ua)||la-ua||ca-aa||Ga.rcompare(ee,ss,v)});return ny(N[0]&&N[0][1],u)},"pickManifest");eC.exports=(i,e,t={})=>{let r=Wa(i,e,t),s=r&&UW(r),n=i.policyRestrictions,a=n&&n.versions||{};if(s&&!a[s.version])return s;let{before:c=null,defaultTag:u="latest"}=t,l=c?new Date(c).toLocaleString():"",{name:h}=i,f=`${h}@${e}`+(c?` with a date before ${l}`:""),p=s&&!!a[s.version],m=p?n.message:"",y=p?`Could not download ${f} due to policy violations:
14
- ${m}`:`No matching version found for ${f}.`,g=p?"E403":"ETARGET";throw Object.assign(new Error(y),{code:g,type:QT.resolve(i.name,e).type,wanted:e,versions:Object.keys(i.versions??{}),name:h,distTags:i["dist-tags"],defaultTag:u})}});var sC=d(($de,rC)=>{var $W=new Set(["github.com","gist.github.com","gitlab.com","bitbucket.com","bitbucket.org"]),{parse:qW}=require("url"),tC=require("path"),VW=Wg(),Ja=Ba(),{isWindows:Kl}=wT(),zW=Jl(),oy=require("fs/promises");rC.exports=(i,e="HEAD",t=null,r={})=>VW(i,r).then(s=>GW(i,s,e,WW(s,e,r),t||HW(i,r.cwd),r));var ay=o((i,e)=>e.gitShallow===!1||e.gitShallow?e.gitShallow:$W.has(qW(i).host),"maybeShallow"),HW=o((i,e=process.cwd())=>tC.resolve(e,tC.basename(i.replace(/[/\\]?\.git$/,""))),"defaultTarget"),GW=o((i,e,t,r,s,n)=>r?r.sha===e.refs.HEAD.sha?ZW(i,r,s,n):r.type==="tag"||r.type==="branch"?KW(i,r,s,n):JW(i,r,s,n):YW(i,t,s,n),"clone"),WW=o((i,e,t)=>{let{spec:r={}}=t;return e=r.gitCommittish||e,i?r.gitRange?zW(i,r.gitRange,t):e?i.refs[e]?i.refs[e]:i.shas[e]?i.refs[i.shas[e][0]]:null:i.refs.HEAD:null},"resolveRef"),JW=o((i,e,t,r)=>{let s=ay(i,r),n=["fetch","origin",e.rawRef].concat(s?["--depth=1"]:[]),a=o(c=>Ja(c,{...r,cwd:t}),"git");return oy.mkdir(t,{recursive:!0}).then(()=>a(["init"])).then(()=>Kl(r)?a(["config","--local","--add","core.longpaths","true"]):null).then(()=>a(["remote","add","origin",i])).then(()=>a(n)).then(()=>a(["checkout",e.sha])).then(()=>iC(t,r)).then(()=>e.sha)},"other"),KW=o((i,e,t,r)=>{let s=["clone","-b",e.ref,i,t,"--recurse-submodules"];return ay(i,r)&&s.push("--depth=1"),Kl(r)&&s.push("--config","core.longpaths=true"),Ja(s,r).then(()=>e.sha)},"branch"),ZW=o((i,e,t,r)=>{let s=["clone",i,t,"--recurse-submodules"];return ay(i,r)&&s.push("--depth=1"),Kl(r)&&s.push("--config","core.longpaths=true"),Ja(s,r).then(()=>e.sha)},"plain"),iC=o(async(i,e)=>await oy.stat(`${i}/.gitmodules`).then(()=>!0).catch(()=>!1)?Ja(["submodule","update","-q","--init","--recursive"],{...e,cwd:i}):null,"updateSubmodules"),YW=o((i,e,t,r)=>{let s=Kl(r)?["--config","core.longpaths=true"]:[],n=["clone","--mirror","-q",i,t+"/.git"],a=o(c=>Ja(c,{...r,cwd:t}),"git");return oy.mkdir(t,{recursive:!0}).then(()=>a(n.concat(s))).then(()=>a(["init"])).then(()=>a(["checkout",e])).then(()=>iC(t,r)).then(()=>a(["rev-parse","--revs-only","HEAD"])).then(({stdout:c})=>c.trim())},"unresolved")});var cy=d((Vde,nC)=>{var{stat:XW}=require("fs/promises");nC.exports=({cwd:i=process.cwd()}={})=>XW(i+"/.git").then(()=>!0,()=>!1)});var aC=d((zde,oC)=>{var QW=cy(),{dirname:e5}=require("path");oC.exports=async({cwd:i=process.cwd(),root:e}={})=>{for(;;){if(await QW({cwd:i}))return i;let t=e5(i);if(i===e||i===t)return null;i=t}}});var uC=d((Hde,cC)=>{var t5=Ba();cC.exports=(i={})=>t5(["status","--porcelain=v1","-uno"],i).then(e=>!e.stdout.trim().split(/\r?\n+/).map(t=>t.trim()).filter(t=>t).length)});var uy=d((Gde,lC)=>{lC.exports={clone:sC(),revs:Wg(),spawn:Ba(),is:cy(),find:aC(),isClean:uC(),errors:Ig()}});var gC=d((Wde,mC)=>{var i5=Tm(),r5=Cm(),Sr=require("node:fs/promises"),oe=require("node:path"),{log:dC}=St(),s5=require("node:module"),ly;function hC(){return ly||(ly=Xu()),ly}o(hC,"lazyHostedGitInfo");var hy;function Zl(){return hy||(hy=hg().glob),hy}o(Zl,"lazyLoadGlob");function n5(i,e){if(i.bin&&(typeof i.bin=="string"&&i.name?(e?.push('"bin" was converted to an object'),i.bin={[i.name]:i.bin}):Array.isArray(i.bin)&&(e?.push('"bin" was converted to an object'),i.bin=i.bin.reduce((t,r)=>(t[oe.basename(r)]=r,t),{})),typeof i.bin=="object")){for(let t in i.bin){if(typeof i.bin[t]!="string"){delete i.bin[t],e?.push(`removed invalid "bin[${t}]"`);continue}let r=oe.basename(En(t));if(!r){delete i.bin[t],e?.push(`removed invalid "bin[${t}]"`);continue}let s=En(i.bin[t]);if(!s){delete i.bin[t],e?.push(`removed invalid "bin[${t}]"`);continue}r!==t&&(delete i.bin[t],e?.push(`"bin[${t}]" was renamed to "bin[${r}]"`)),s!==i.bin[t]&&e?.push(`"bin[${r}]" script name ${s} was invalid and removed`),i.bin[r]=s}return Object.keys(i.bin).length===0&&(e?.push('empty "bin" was removed'),delete i.bin),i}delete i.bin}o(n5,"normalizePackageBin");function o5(i,e){if(i.man){let t=[];for(let r of Array.isArray(i.man)?i.man:[i.man])typeof r!="string"?e?.push(`removed invalid "man [${r}]"`):t.push(En(r));if(!t.length)e?.push('empty "man" was removed');else return i.man=t,i}delete i.man}o(o5,"normalizePackageMan");function a5(i){return!i.match(/[/@\s+%:]/)&&i===encodeURIComponent(i)}o(a5,"isCorrectlyEncodedName");function c5(i){if(i.charAt(0)!=="@")return!1;let e=i.slice(1).split("/");return e.length!==2?!1:e[0]&&e[1]&&e[0]===encodeURIComponent(e[0])&&e[1]===encodeURIComponent(e[1])}o(c5,"isValidScopedPackageName");function fC(i){return i.replace(/\\|:/g,"/")}o(fC,"unixifyPath");function En(i){let e=fC(oe.join(".",oe.join("/",fC(i))));return e.startsWith("./")?"":e}o(En,"secureAndUnixifyPath");function pC(i,{strict:e,steps:t,changes:r,allowLegacyCase:s}){let n=i.content,a=`${n.name??""}@${n.version??""}`;if(t.includes("fixName")||t.includes("fixNameField")||t.includes("normalizeData"))if(!n.name&&!e)r?.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&&(r?.push('Whitespace was trimmed from "name"'),n.name=c)}if(n.name.startsWith(".")||!(c5(n.name)||a5(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")&&s5.builtinModules.includes(n.name)&&dC.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(!i5(n.version,c))throw new Error(`Invalid version: "${n.version}"`);let u=r5(n.version,c);u!==n.version&&(r?.push(`"version" was cleaned and set to "${u}"`),n.version=u)}}if(t.includes("_attributes"))for(let c in n)c.startsWith("_")&&(r?.push(`"${c}" was removed`),delete i.content[c]);if(t.includes("_id")&&n.name&&n.version&&(r?.push(`"_id" was set to ${a}`),n._id=a),t.includes("bundledDependencies")&&(n.bundleDependencies===void 0&&n.bundledDependencies!==void 0&&(n.bundleDependencies=n.bundledDependencies,r?.push('Deleted incorrect "bundledDependencies"')),delete n.bundledDependencies),t.includes("bundleDependencies")){let c=n.bundleDependencies;c===!1&&!t.includes("bundleDependenciesDeleteFalse")?(r?.push('"bundleDependencies" was changed from "false" to "[]"'),n.bundleDependencies=[]):c===!0?(r?.push('"bundleDependencies" was auto-populated from "dependencies"'),n.bundleDependencies=Object.keys(n.dependencies||{})):c&&typeof c=="object"?Array.isArray(c)||(r?.push('"bundleDependencies" was changed from an object to an array'),n.bundleDependencies=Object.keys(c)):"bundleDependencies"in n&&(r?.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)r?.push(`optionalDependencies."${c}" was removed`),delete n.dependencies[c];Object.keys(n.dependencies).length||(r?.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 u in n.scripts)typeof n.scripts[u]!="string"?(delete n.scripts[u],r?.push(`Invalid scripts."${u}" was removed`)):t.includes("scriptpath")&&c.test(n.scripts[u])&&(n.scripts[u]=n.scripts[u].replace(c,""),r?.push(`scripts entry "${u}" was fixed to remove node_modules/.bin reference`));else r?.push('Removed invalid "scripts"'),delete n.scripts}if(t.includes("funding")&&n.funding&&typeof n.funding=="string"&&(n.funding={url:n.funding},r?.push('"funding" was changed to an object with a url attribute')),(t.includes("fixRepositoryField")||t.includes("normalizeData"))&&(n.repositories&&(r?.push(`"repository" was set to the first entry in "repositories" (${n.repository})`),n.repository=n.repositories[0]),n.repository&&(typeof n.repository=="string"&&(r?.push('"repository" was changed from a string to an object'),n.repository={type:"git",url:n.repository}),n.repository.url))){let c=hC().fromUrl(n.repository.url),u;c&&(c.getDefaultRepresentation()==="shortcut"?u=c.https():u=c.toString(),u!==n.repository.url&&(r?.push(`"repository.url" was normalized to "${u}"`),n.repository.url=u))}if(t.includes("fixDependencies")||t.includes("normalizeData")){for(let c of["dependencies","devDependencies","optionalDependencies"])if(n[c]){let u=!0;if(typeof n[c]=="string"&&(r?.push(`"${c}" was converted from a string into an object`),n[c]=n[c].trim().split(/[\n\r\s\t ,]+/),u=!1),Array.isArray(n[c])){u&&r?.push(`"${c}" was converted from an array into an object`);let l={};for(let h of n[c])if(typeof h=="string"){let f=h.trim().split(/(:?[@\s><=])/),p=f.shift(),m=f.join("").replace(/^@/,"").trim();l[p]=m}n[c]=l}}for(let c of["dependencies","devDependencies"])if(c in n)if(!n[c]||typeof n[c]!="object")r?.push(`Removed invalid "${c}"`),delete n[c];else for(let u in n[c]){typeof n[c][u]!="string"&&(r?.push(`Removed invalid "${c}.${u}"`),delete n[c][u]);let h=hC().fromUrl(n[c][u])?.toString();h&&h!==n[c][u]&&(r?.push(`Normalized git reference to "${c}.${u}"`),n[c][u]=h.toString())}}if(t.includes("normalizeData")){let{normalizeData:c}=Uv();c(n,r)}}o(pC,"syncSteps");async function u5(i,{steps:e,root:t,changes:r}){let s=i.content,n=s.scripts||{},a=`${s.name??""}@${s.version??""}`;if(e.includes("gypfile")&&!n.install&&!n.preinstall&&s.gypfile!==!1&&(await Zl()("*.gyp",{cwd:i.path})).length&&(n.install="node-gyp rebuild",s.scripts=n,s.gypfile=!0,r?.push('"scripts.install" was set to "node-gyp rebuild"'),r?.push('"gypfile" was set to "true"')),e.includes("serverjs")&&!n.start)try{await Sr.access(oe.join(i.path,"server.js")),n.start="node server.js",s.scripts=n,r?.push('"scripts.start" was set to "node server.js"')}catch{}if(e.includes("authors")&&!s.contributors)try{let u=(await Sr.readFile(oe.join(i.path,"AUTHORS"),"utf8")).split(/\r?\n/g).map(l=>l.replace(/^\s*#.*$/,"").trim()).filter(l=>l);s.contributors=u,r?.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,u=await Zl()("{README,README.*}",{cwd:i.path,nocase:!0,mark:!0}),l;for(let h of u)if(!h.endsWith(oe.sep)){if(h.match(c)){l=h;break}h.endsWith("README")&&(l=h)}if(l){let h=await Sr.readFile(oe.join(i.path,l),"utf8");s.readme=h,s.readmeFilename=l,r?.push(`"readme" was set to the contents of ${l}`),r?.push(`"readmeFilename" was set to ${l}`)}s.readme||(s.readme="ERROR: No README data found!")}if(e.includes("mans")){if(s.directories?.man&&!s.man){let c=En(s.directories.man),u=oe.resolve(i.path,c),l=await Zl()("**/*.[0-9]",{cwd:u});s.man=l.map(h=>oe.relative(i.path,oe.join(u,h)).split(oe.sep).join("/"))}o5(s,r)}if(e.includes("binDir")&&s.directories?.bin&&!s.bin){let c=En(s.directories.bin),u=await Zl()("**",{cwd:oe.resolve(i.path,c)});s.bin=u.reduce((l,h)=>{if(h&&!h.startsWith(".")){let f=oe.basename(h);l[f]=`${c}/${En(h)}`}return l},{})}else(e.includes("bin")||e.includes("binDir")||e.includes("binRefs"))&&n5(s,r);if(e.includes("gitHead")&&!s.gitHead){let u=await uy().find({cwd:i.path,root:t}),l;if(u)try{l=await Sr.readFile(oe.resolve(u,".git/HEAD"),"utf8")}catch{}let h;if(l)if(l.startsWith("ref: ")){let f=l.replace(/^ref: /,"").trim(),p=oe.resolve(u,".git",f);try{h=await Sr.readFile(p,"utf8"),h=h.replace(/^ref: /,"").trim()}catch{}if(!h){let m=oe.resolve(u,".git/packed-refs");try{let y=await Sr.readFile(m,"utf8");if(y){y=y.split(`
15
- `);for(let g=0;g<y.length;g++){let S=y[g].match(/^([0-9a-f]{40}) (.+)$/);if(S&&S[2].trim()===f){h=S[1];break}}}}catch{}}}else h=l.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 l=`./${oe.join(oe.dirname(c),oe.basename(c,oe.extname(c)))}.d.ts`;if(!("types"in s||"typings"in s))try{await Sr.access(oe.join(i.path,l)),s.types=l.split(oe.sep).join("/")}catch{}}if(e.includes("binRefs")&&s.bin instanceof Object)for(let c in s.bin)try{await Sr.access(oe.resolve(i.path,s.bin[c]))}catch{dC.warn("package-json",a,`No bin file found at ${s.bin[c]}`)}}o(u5,"asyncSteps");async function l5(i,e){if(!i.content)throw new Error("Can not normalize without content");await u5(i,e),pC(i,e)}o(l5,"normalize");function h5(i,e){pC(i,e)}o(h5,"syncNormalize");mC.exports={normalize:l5,syncNormalize:h5}});var wC=d((Kde,EC)=>{var{readFile:f5}=require("fs/promises"),d5=bm();async function yC(i){try{return await f5(i,"utf8")}catch(e){throw e.message=`Could not read package.json: ${e}`,e}}o(yC,"read");function SC(i){try{return d5(i)}catch(e){throw e.message=`Invalid package.json: ${e}`,e}}o(SC,"parse");async function p5(i){let e=await yC(i);return SC(e)}o(p5,"readPackage");EC.exports={read:yC,parse:SC,readPackage:p5}});var bC=d((Yde,_C)=>{function m5(i){let{name:e,version:t,private:r,description:s,keywords:n,homepage:a,bugs:c,repository:u,funding:l,license:h,author:f,maintainers:p,contributors:m,type:y,imports:g,exports:S,main:E,browser:_,types:b,bin:w,man:I,directories:v,files:N,workspaces:P,scripts:$,config:ee,dependencies:ti,devDependencies:ss,peerDependencies:oa,peerDependenciesMeta:Mu,optionalDependencies:Bu,bundledDependencies:ku,bundleDependencies:Fu,engines:Uu,os:ju,cpu:aa,publishConfig:ca,devEngines:ua,licenses:la,overrides:LI,...Dj}=i;return{...typeof e<"u"?{name:e}:{},...typeof t<"u"?{version:t}:{},...typeof r<"u"?{private:r}:{},...typeof s<"u"?{description:s}:{},...typeof n<"u"?{keywords:n}:{},...typeof a<"u"?{homepage:a}:{},...typeof c<"u"?{bugs:c}:{},...typeof u<"u"?{repository:u}:{},...typeof l<"u"?{funding:l}:{},...typeof h<"u"?{license:h}:{},...typeof f<"u"?{author:f}:{},...typeof p<"u"?{maintainers:p}:{},...typeof m<"u"?{contributors:m}:{},...typeof y<"u"?{type:y}:{},...typeof g<"u"?{imports:g}:{},...typeof S<"u"?{exports:S}:{},...typeof E<"u"?{main:E}:{},...typeof _<"u"?{browser:_}:{},...typeof b<"u"?{types:b}:{},...typeof w<"u"?{bin:w}:{},...typeof I<"u"?{man:I}:{},...typeof v<"u"?{directories:v}:{},...typeof N<"u"?{files:N}:{},...typeof P<"u"?{workspaces:P}:{},...typeof $<"u"?{scripts:$}:{},...typeof ee<"u"?{config:ee}:{},...typeof ti<"u"?{dependencies:ti}:{},...typeof ss<"u"?{devDependencies:ss}:{},...typeof oa<"u"?{peerDependencies:oa}:{},...typeof Mu<"u"?{peerDependenciesMeta:Mu}:{},...typeof Bu<"u"?{optionalDependencies:Bu}:{},...typeof ku<"u"?{bundledDependencies:ku}:{},...typeof Fu<"u"?{bundleDependencies:Fu}:{},...typeof Uu<"u"?{engines:Uu}:{},...typeof ju<"u"?{os:ju}:{},...typeof aa<"u"?{cpu:aa}:{},...typeof ca<"u"?{publishConfig:ca}:{},...typeof ua<"u"?{devEngines:ua}:{},...typeof la<"u"?{licenses:la}:{},...typeof LI<"u"?{overrides:LI}:{},...Dj}}o(m5,"packageSort");_C.exports={packageSort:m5}});var Yl=d((Qde,vC)=>{var{readFile:g5,writeFile:y5}=require("node:fs/promises"),{resolve:IC}=require("node:path"),S5=bm(),OC=$I(),E5=VI(),w5=HI(),{normalize:fy,syncNormalize:_5}=gC(),{read:b5,parse:I5}=wC(),{packageSort:O5}=bC(),v5=new Set([OC,E5,w5]),R5=new Set([...OC.knownKeys,"scripts","workspaces"]),dy=class i{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 r=new i;return await r.create(e),t.data?r.update(t.data):r}static async load(e,t={}){let r=new i;if(!t.create)return r.load(e);try{return await r.load(e)}catch(s){if(!s.message.startsWith("Could not read package.json"))throw s;return await r.create(e)}}static async fix(e,t){let r=new i;return await r.load(e,!0),r.fix(t)}static async prepare(e,t){let r=new i;return await r.load(e,!0),r.prepare(t)}static async normalize(e,t){let r=new i;return await r.load(e),r.normalize(t)}#e;#t;#i="";#r=!0;async load(e,t){this.#e=e;let r;try{this.#i=await b5(this.filename)}catch(s){if(!t)throw s;r=s}if(r){let s=IC(this.path,"index.js"),n;try{n=await g5(s,"utf8")}catch{throw r}try{this.fromComment(n)}catch{throw r}return this.#r=!1,this}return this.fromJSON(this.#i)}fromJSON(e){return this.#t=I5(e),this}fromContent(e){if(!e||typeof e!="object")throw new Error("Content data must be an object");return this.#t=e,this.#r=!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=S5(e),this}get content(){return this.#t}get path(){return this.#e}get filename(){if(this.path)return IC(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 v5)this.#t=t({content:e,originalContent:this.content});for(let[t,r]of Object.entries(e))R5.has(t)||(this.content[t]=r);return this}async save({sort:e}={}){if(!this.#r)throw new Error("No package.json to save to");let{[Symbol.for("indent")]:t,[Symbol.for("newline")]:r,...s}=this.content,n=t===void 0?" ":t,a=r===void 0?`
16
- `:r,c=e?O5(s):s,u=`${JSON.stringify(c,null,n)}
17
- `.replace(/\n/g,a);if(u.trim()!==this.#i.trim()){let l=await y5(this.filename,u);return this.#i=u,l}}syncNormalize(e={}){return e.steps=this.constructor.normalizeSteps.filter(t=>t!=="_attributes"),_5(this,e),this}async normalize(e={}){return e.steps||(e.steps=this.constructor.normalizeSteps),await fy(this,e),this}async prepare(e={}){return e.steps||(e.steps=this.constructor.prepareSteps),await fy(this,e),this}async fix(e={}){return e.steps=this.constructor.fixSteps,await fy(this,e),this}};vC.exports=dy});var yy=d((tpe,gy)=>{var{Minipass:RC}=te(),wn=Symbol("_data"),_n=Symbol("_length"),py=class extends RC{static{o(this,"Collect")}constructor(e){super(e),this[wn]=[],this[_n]=0}write(e,t,r){typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let s=Buffer.isBuffer(e)?e:Buffer.from(e,t);return this[wn].push(s),this[_n]+=s.length,r&&r(),!0}end(e,t,r){typeof e=="function"&&(r=e,e=null),typeof t=="function"&&(r=t,t="utf8"),e&&this.write(e,t);let s=Buffer.concat(this[wn],this[_n]);return super.write(s),super.end(r)}};gy.exports=py;var my=class extends RC{static{o(this,"CollectPassThrough")}constructor(e){super(e),this[wn]=[],this[_n]=0}write(e,t,r){typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let s=Buffer.isBuffer(e)?e:Buffer.from(e,t);return this[wn].push(s),this[_n]+=s.length,super.write(e,t,r)}end(e,t,r){typeof e=="function"&&(r=e,e=null),typeof t=="function"&&(r=t,t="utf8"),e&&this.write(e,t);let s=Buffer.concat(this[wn],this[_n]);return this.emit("collect",s),super.end(r)}};gy.exports.PassThrough=my});var rh=d((rpe,MC)=>{"use strict";var AC=typeof process=="object"&&process?process:{stdout:null,stderr:null},A5=require("events"),TC=require("stream"),CC=require("string_decoder").StringDecoder,ji=Symbol("EOF"),$i=Symbol("maybeEmitEnd"),Er=Symbol("emittedEnd"),Xl=Symbol("emittingEnd"),Ka=Symbol("emittedError"),Ql=Symbol("closed"),NC=Symbol("read"),eh=Symbol("flush"),PC=Symbol("flushChunk"),Ye=Symbol("encoding"),qi=Symbol("decoder"),th=Symbol("flowing"),Za=Symbol("paused"),bn=Symbol("resume"),Te=Symbol("bufferLength"),Sy=Symbol("bufferPush"),Ey=Symbol("bufferShift"),Le=Symbol("objectMode"),Me=Symbol("destroyed"),wy=Symbol("emitData"),DC=Symbol("emitEnd"),_y=Symbol("emitEnd2"),Vi=Symbol("async"),Ya=o(i=>Promise.resolve().then(i),"defer"),xC=global._MP_NO_ITERATOR_SYMBOLS_!=="1",T5=xC&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),C5=xC&&Symbol.iterator||Symbol("iterator not implemented"),N5=o(i=>i==="end"||i==="finish"||i==="prefinish","isEndish"),P5=o(i=>i instanceof ArrayBuffer||typeof i=="object"&&i.constructor&&i.constructor.name==="ArrayBuffer"&&i.byteLength>=0,"isArrayBuffer"),D5=o(i=>!Buffer.isBuffer(i)&&ArrayBuffer.isView(i),"isArrayBufferView"),ih=class{static{o(this,"Pipe")}constructor(e,t,r){this.src=e,this.dest=t,this.opts=r,this.ondrain=()=>e[bn](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},by=class extends ih{static{o(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,r){super(e,t,r),this.proxyErrors=s=>t.emit("error",s),e.on("error",this.proxyErrors)}};MC.exports=class LC extends TC{static{o(this,"Minipass")}constructor(e){super(),this[th]=!1,this[Za]=!1,this.pipes=[],this.buffer=[],this[Le]=e&&e.objectMode||!1,this[Le]?this[Ye]=null:this[Ye]=e&&e.encoding||null,this[Ye]==="buffer"&&(this[Ye]=null),this[Vi]=e&&!!e.async||!1,this[qi]=this[Ye]?new CC(this[Ye]):null,this[ji]=!1,this[Er]=!1,this[Xl]=!1,this[Ql]=!1,this[Ka]=null,this.writable=!0,this.readable=!0,this[Te]=0,this[Me]=!1}get bufferLength(){return this[Te]}get encoding(){return this[Ye]}set encoding(e){if(this[Le])throw new Error("cannot set encoding in objectMode");if(this[Ye]&&e!==this[Ye]&&(this[qi]&&this[qi].lastNeed||this[Te]))throw new Error("cannot change encoding");this[Ye]!==e&&(this[qi]=e?new CC(e):null,this.buffer.length&&(this.buffer=this.buffer.map(t=>this[qi].write(t)))),this[Ye]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[Le]}set objectMode(e){this[Le]=this[Le]||!!e}get async(){return this[Vi]}set async(e){this[Vi]=this[Vi]||!!e}write(e,t,r){if(this[ji])throw new Error("write after end");if(this[Me])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let s=this[Vi]?Ya:n=>n();return!this[Le]&&!Buffer.isBuffer(e)&&(D5(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):P5(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[Le]?(this.flowing&&this[Te]!==0&&this[eh](!0),this.flowing?this.emit("data",e):this[Sy](e),this[Te]!==0&&this.emit("readable"),r&&s(r),this.flowing):e.length?(typeof e=="string"&&!(t===this[Ye]&&!this[qi].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[Ye]&&(e=this[qi].write(e)),this.flowing&&this[Te]!==0&&this[eh](!0),this.flowing?this.emit("data",e):this[Sy](e),this[Te]!==0&&this.emit("readable"),r&&s(r),this.flowing):(this[Te]!==0&&this.emit("readable"),r&&s(r),this.flowing)}read(e){if(this[Me])return null;if(this[Te]===0||e===0||e>this[Te])return this[$i](),null;this[Le]&&(e=null),this.buffer.length>1&&!this[Le]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[Te])]);let t=this[NC](e||null,this.buffer[0]);return this[$i](),t}[NC](e,t){return e===t.length||e===null?this[Ey]():(this.buffer[0]=t.slice(e),t=t.slice(0,e),this[Te]-=e),this.emit("data",t),!this.buffer.length&&!this[ji]&&this.emit("drain"),t}end(e,t,r){return typeof e=="function"&&(r=e,e=null),typeof t=="function"&&(r=t,t="utf8"),e&&this.write(e,t),r&&this.once("end",r),this[ji]=!0,this.writable=!1,(this.flowing||!this[Za])&&this[$i](),this}[bn](){this[Me]||(this[Za]=!1,this[th]=!0,this.emit("resume"),this.buffer.length?this[eh]():this[ji]?this[$i]():this.emit("drain"))}resume(){return this[bn]()}pause(){this[th]=!1,this[Za]=!0}get destroyed(){return this[Me]}get flowing(){return this[th]}get paused(){return this[Za]}[Sy](e){this[Le]?this[Te]+=1:this[Te]+=e.length,this.buffer.push(e)}[Ey](){return this.buffer.length&&(this[Le]?this[Te]-=1:this[Te]-=this.buffer[0].length),this.buffer.shift()}[eh](e){do;while(this[PC](this[Ey]()));!e&&!this.buffer.length&&!this[ji]&&this.emit("drain")}[PC](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[Me])return;let r=this[Er];return t=t||{},e===AC.stdout||e===AC.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this.pipes.push(t.proxyErrors?new by(this,e,t):new ih(this,e,t)),this[Vi]?Ya(()=>this[bn]()):this[bn]()),e}unpipe(e){let t=this.pipes.find(r=>r.dest===e);t&&(this.pipes.splice(this.pipes.indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let r=super.on(e,t);return e==="data"&&!this.pipes.length&&!this.flowing?this[bn]():e==="readable"&&this[Te]!==0?super.emit("readable"):N5(e)&&this[Er]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[Ka]&&(this[Vi]?Ya(()=>t.call(this,this[Ka])):t.call(this,this[Ka])),r}get emittedEnd(){return this[Er]}[$i](){!this[Xl]&&!this[Er]&&!this[Me]&&this.buffer.length===0&&this[ji]&&(this[Xl]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Ql]&&this.emit("close"),this[Xl]=!1)}emit(e,t,...r){if(e!=="error"&&e!=="close"&&e!==Me&&this[Me])return;if(e==="data")return t?this[Vi]?Ya(()=>this[wy](t)):this[wy](t):!1;if(e==="end")return this[DC]();if(e==="close"){if(this[Ql]=!0,!this[Er]&&!this[Me])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[Ka]=t;let n=super.emit("error",t);return this[$i](),n}else if(e==="resume"){let n=super.emit("resume");return this[$i](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let s=super.emit(e,t,...r);return this[$i](),s}[wy](e){for(let r of this.pipes)r.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[$i](),t}[DC](){this[Er]||(this[Er]=!0,this.readable=!1,this[Vi]?Ya(()=>this[_y]()):this[_y]())}[_y](){if(this[qi]){let t=this[qi].end();if(t){for(let r of this.pipes)r.dest.write(t);super.emit("data",t)}}for(let t of this.pipes)t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}collect(){let e=[];this[Le]||(e.dataLength=0);let t=this.promise();return this.on("data",r=>{e.push(r),this[Le]||(e.dataLength+=r.length)}),t.then(()=>e)}concat(){return this[Le]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[Le]?Promise.reject(new Error("cannot concat in objectMode")):this[Ye]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,t)=>{this.on(Me,()=>t(new Error("stream destroyed"))),this.on("error",r=>t(r)),this.on("end",()=>e())})}[T5](){return{next:o(()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[ji])return Promise.resolve({done:!0});let r=null,s=null,n=o(l=>{this.removeListener("data",a),this.removeListener("end",c),s(l)},"onerr"),a=o(l=>{this.removeListener("error",n),this.removeListener("end",c),this.pause(),r({value:l,done:!!this[ji]})},"ondata"),c=o(()=>{this.removeListener("error",n),this.removeListener("data",a),r({done:!0})},"onend"),u=o(()=>n(new Error("stream destroyed")),"ondestroy");return new Promise((l,h)=>{s=h,r=l,this.once(Me,u),this.once("error",n),this.once("end",c),this.once("data",a)})},"next")}}[C5](){return{next:o(()=>{let t=this.read();return{value:t,done:t===null}},"next")}}destroy(e){return this[Me]?(e?this.emit("error",e):this.emit(Me),this):(this[Me]=!0,this.buffer.length=0,this[Te]=0,typeof this.close=="function"&&!this[Ql]&&this.close(),e?this.emit("error",e):this.emit(Me),this)}static isStream(e){return!!e&&(e instanceof LC||e instanceof TC||e instanceof A5&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var In=d((npe,UC)=>{var x5=rh(),L5=require("events"),M5=o(i=>i&&i instanceof L5&&(typeof i.pipe=="function"||typeof i.write=="function"&&typeof i.end=="function"),"isStream"),ms=Symbol("_head"),ut=Symbol("_tail"),Iy=Symbol("_linkStreams"),Oy=Symbol("_setHead"),vy=Symbol("_setTail"),BC=Symbol("_onError"),kC=Symbol("_onData"),Ry=Symbol("_onEnd"),FC=Symbol("_onDrain"),sh=Symbol("_streams"),Ay=class extends x5{static{o(this,"Pipeline")}constructor(e,...t){M5(e)&&(t.unshift(e),e={}),super(e),this[sh]=[],t.length&&this.push(...t)}[Iy](e){return e.reduce((t,r)=>(t.on("error",s=>r.emit("error",s)),t.pipe(r),r))}push(...e){this[sh].push(...e),this[ut]&&e.unshift(this[ut]);let t=this[Iy](e);this[vy](t),this[ms]||this[Oy](e[0])}unshift(...e){this[sh].unshift(...e),this[ms]&&e.push(this[ms]);let t=this[Iy](e);this[Oy](e[0]),this[ut]||this[vy](t)}destroy(e){return this[sh].forEach(t=>typeof t.destroy=="function"&&t.destroy()),super.destroy(e)}[vy](e){this[ut]=e,e.on("error",t=>this[BC](e,t)),e.on("data",t=>this[kC](e,t)),e.on("end",()=>this[Ry](e)),e.on("finish",()=>this[Ry](e))}[BC](e,t){e===this[ut]&&this.emit("error",t)}[kC](e,t){e===this[ut]&&super.write(t)}[Ry](e){e===this[ut]&&super.end()}pause(){return super.pause(),this[ut]&&this[ut].pause&&this[ut].pause()}emit(e,...t){return e==="resume"&&this[ut]&&this[ut].resume&&this[ut].resume(),super.emit(e,...t)}[Oy](e){this[ms]=e,e.on("drain",()=>this[FC](e))}[FC](e){e===this[ms]&&this.emit("drain")}write(e,t,r){return this[ms].write(e,t,r)&&(this.flowing||this.buffer.length===0)}end(e,t,r){return this[ms].end(e,t,r),this}};UC.exports=Ay});var ai=d((ape,oi)=>{"use strict";var Qa=require("crypto"),{Minipass:B5}=te(),Cy=["sha512","sha384","sha256"],Py=["sha512"],k5=/^[a-z0-9+/]+(?:=?=?)$/i,F5=/^([a-z0-9]+)-([^?]+)([?\S*]*)$/,U5=/^([a-z0-9]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)?$/,j5=/^[\x21-\x7E]+$/,ec=o(i=>i?.length?`?${i.join("?")}`:"","getOptString"),Ny=class extends B5{static{o(this,"IntegrityStream")}#e;#t;#i;constructor(e){super(),this.size=0,this.opts=e,this.#r(),e?.algorithms?this.algorithms=[...e.algorithms]:this.algorithms=[...Py],this.algorithm!==null&&!this.algorithms.includes(this.algorithm)&&this.algorithms.push(this.algorithm),this.hashes=this.algorithms.map(Qa.createHash)}#r(){this.sri=this.opts?.integrity?lt(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=ec(this.opts?.options)}on(e,t){return e==="size"&&this.#t?t(this.#t):e==="integrity"&&this.#e?t(this.#e):e==="verified"&&this.#i?t(this.#i):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.#r();let e=lt(this.hashes.map((r,s)=>`${this.algorithms[s]}-${r.digest("base64")}${this.optString}`).join(" "),this.opts),t=this.goodSri&&e.match(this.sri,this.opts);if(typeof this.expectedSize=="number"&&this.size!==this.expectedSize){let r=new Error(`stream size mismatch when checking ${this.sri}.
12
+ `,r=e.whitespace?" = ":"=",s=[],n=e.sort?Object.keys(i).sort():Object.keys(i),a=0;e.align&&(a=Fi(n.filter(l=>i[l]===null||Array.isArray(i[l])||typeof i[l]!="object").map(l=>Array.isArray(i[l])?`${l}[]`:l).concat([""]).reduce((l,h)=>Fi(l).length>=Fi(h).length?l:h)).length);let c="",u=e.bracketedArray?"[]":"";for(let l of n){let h=i[l];if(h&&Array.isArray(h))for(let f of h)c+=Fi(`${l}${u}`).padEnd(a," ")+r+Fi(f)+t;else h&&typeof h=="object"?s.push(l):c+=Fi(l).padEnd(a," ")+r+Fi(h)+t}e.section&&c.length&&(c="["+Fi(e.section)+"]"+(e.newline?t+t:t)+c);for(let l of s){let h=AR(l,".").join("\\."),f=(e.section?e.section+".":"")+h,p=vg(i[l],{...e,section:f});c.length&&p.length&&(c+=t),c+=p}return c},"encode");function AR(i,e){var t=0,r=0,s=0,n=[];do if(s=i.indexOf(e,t),s!==-1){if(t=s+e.length,s>0&&i[s-1]==="\\")continue;n.push(i.slice(r,s)),r=s+e.length}while(s!==-1);return n.push(i.slice(r)),n}o(AR,"splitSections");var RR=o((i,e={})=>{e.bracketedArray=e.bracketedArray!==!1;let t=Object.create(null),r=t,s=null,n=/^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i,a=i.split(/[\r\n]+/g),c={};for(let l of a){if(!l||l.match(/^\s*[;#]/)||l.match(/^\s*$/))continue;let h=l.match(n);if(!h)continue;if(h[1]!==void 0){if(s=xl(h[1]),s==="__proto__"){r=Object.create(null);continue}r=t[s]=t[s]||Object.create(null);continue}let f=xl(h[2]),p;e.bracketedArray?p=f.length>2&&f.slice(-2)==="[]":(c[f]=(c?.[f]||0)+1,p=c[f]>1);let m=p&&f.endsWith("[]")?f.slice(0,-2):f;if(m==="__proto__")continue;let y=h[3]?xl(h[4]):!0,g=y==="true"||y==="false"||y==="null"?JSON.parse(y):y;p&&(Og.call(r,m)?Array.isArray(r[m])||(r[m]=[r[m]]):r[m]=[]),Array.isArray(r[m])?r[m].push(g):r[m]=g}let u=[];for(let l of Object.keys(t)){if(!Og.call(t,l)||typeof t[l]!="object"||Array.isArray(t[l]))continue;let h=AR(l,".");r=t;let f=h.pop(),p=f.replace(/\\\./g,".");for(let m of h)m!=="__proto__"&&((!Og.call(r,m)||typeof r[m]!="object")&&(r[m]=Object.create(null)),r=r[m]);r===t&&p===f||(r[p]=t[l],u.push(l))}for(let l of u)delete t[l];return t},"decode"),TR=o(i=>i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"),"isQuoted"),Fi=o(i=>typeof i!="string"||i.match(/[=\r\n]/)||i.match(/^\[/)||i.length>1&&TR(i)||i!==i.trim()?JSON.stringify(i):i.split(";").join("\\;").split("#").join("\\#"),"safe"),xl=o(i=>{if(i=(i||"").trim(),TR(i)){i.charAt(0)==="'"&&(i=i.slice(1,-1));try{i=JSON.parse(i)}catch{}}else{let e=!1,t="";for(let r=0,s=i.length;r<s;r++){let n=i.charAt(r);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 i},"unsafe");CR.exports={parse:RR,decode:RR,stringify:vg,encode:vg,safe:Fi,unsafe:xl}});var LR=d((Hhe,Rg)=>{var PR=require("node:fs"),VV=require("node:os"),zV=require("node:path"),HV=NR(),DR=zV.join(VV.homedir(),".gitconfig"),Ma=null,xR=o(()=>{if(Ma===null)try{if(Ma={},PR.existsSync(DR)){let i=PR.readFileSync(DR,"utf-8");Ma=HV.parse(i)}}catch{Ma={}}return Ma},"loadGitConfig"),GV=o(()=>{let i=xR();return{sshCommandSetInConfig:i?.core?.sshCommand!==void 0,askPassSetInConfig:i?.core?.askpass!==void 0}},"checkGitConfigs"),WV=process.env.GIT_SSH_COMMAND!==void 0,JV=process.env.GIT_ASKPASS!==void 0,{sshCommandSetInConfig:KV,askPassSetInConfig:ZV}=GV(),YV={...JV||ZV?{}:{GIT_ASKPASS:"echo"},...WV||KV?{}:{GIT_SSH_COMMAND:"ssh -oStrictHostKeyChecking=accept-new"}};Rg.exports=(i={})=>({stdioString:!0,...i,shell:!1,env:i.env||{...YV,...process.env}});Rg.exports.loadGitConfig=xR});var BR=d((Whe,MR)=>{var XV=yg(),Ag;try{Ag=XV.sync("git")}catch{}MR.exports=(i={})=>i.git?i.git:!Ag||i.git===!1?Object.assign(new Error("No git binary found in $PATH"),{code:"ENOGIT"}):Ag});var Ba=d((Jhe,kR)=>{var QV=Dl(),ez=xa(),{log:tz}=St(),iz=vR(),rz=LR();kR.exports=(i,e={})=>{let r=BR()(e);if(r instanceof Error)return Promise.reject(r);let s=e.allowReplace||i[0]==="--no-replace-objects"?i:["--no-replace-objects",...i],n=e.retry;return n==null&&(n={retries:e.fetchRetries||2,factor:e.fetchRetryFactor||10,maxTimeout:e.fetchRetryMaxtimeout||6e4,minTimeout:e.fetchRetryMintimeout||1e3}),ez((a,c)=>(c!==1&&tz.silly("git",`Retrying git command: ${s.join(" ")} attempt # ${c}`),QV(r,s,rz(e)).catch(u=>{let l=iz(u);if(!l.shouldRetry(c))throw l;a(l)})),n)}});var Pg=d(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});Ml.LRUCache=void 0;var mn=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,UR=new Set,Tg=typeof process=="object"&&process?process:{},jR=o((i,e,t,r)=>{typeof Tg.emitWarning=="function"&&Tg.emitWarning(i,e,t,r)},"emitWarning"),Ll=globalThis.AbortController,FR=globalThis.AbortSignal;if(typeof Ll>"u"){FR=class{static{o(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,s){this._onabort.push(s)}},Ll=class{static{o(this,"AbortController")}constructor(){e()}signal=new FR;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let s of this.signal._onabort)s(r);this.signal.onabort?.(r)}}};let i=Tg.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=o(()=>{i&&(i=!1,jR("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 sz=o(i=>!UR.has(i),"shouldWarn"),Yhe=Symbol("type"),gr=o(i=>i&&i===Math.floor(i)&&i>0&&isFinite(i),"isPosInt"),$R=o(i=>gr(i)?i<=Math.pow(2,8)?Uint8Array:i<=Math.pow(2,16)?Uint16Array:i<=Math.pow(2,32)?Uint32Array:i<=Number.MAX_SAFE_INTEGER?gn:null:null,"getUintArray"),gn=class extends Array{static{o(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},Cg=class i{static{o(this,"Stack")}heap;length;static#e=!1;static create(e){let t=$R(e);if(!t)return[];i.#e=!0;let r=new i(e,t);return i.#e=!1,r}constructor(e,t){if(!i.#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]}},Ng=class i{static{o(this,"LRUCache")}#e;#t;#i;#r;#s;#u;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#c;#f;#n;#h;#o;#d;#a;#p;#y;#_;#m;#A;#w;#b;#v;#I;#E;static unsafeExposeInternals(e){return{starts:e.#w,ttls:e.#b,sizes:e.#A,keyMap:e.#n,keyList:e.#h,valList:e.#o,next:e.#d,prev:e.#a,get head(){return e.#p},get tail(){return e.#y},free:e.#_,isBackgroundFetch:o(t=>e.#S(t),"isBackgroundFetch"),backgroundFetch:o((t,r,s,n)=>e.#L(t,r,s,n),"backgroundFetch"),moveToTail:o(t=>e.#j(t),"moveToTail"),indexes:o(t=>e.#P(t),"indexes"),rindexes:o(t=>e.#x(t),"rindexes"),isStale:o(t=>e.#R(t),"isStale")}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#f}get size(){return this.#c}get fetchMethod(){return this.#s}get memoMethod(){return this.#u}get dispose(){return this.#i}get disposeAfter(){return this.#r}constructor(e){let{max:t=0,ttl:r,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:a,updateAgeOnHas:c,allowStale:u,dispose:l,disposeAfter:h,noDisposeOnSet:f,noUpdateTTL:p,maxSize:m=0,maxEntrySize:y=0,sizeCalculation:g,fetchMethod:S,memoMethod:E,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:I,ignoreFetchAbort:v}=e;if(t!==0&&!gr(t))throw new TypeError("max option must be a nonnegative integer");let N=t?$R(t):Array;if(!N)throw new Error("invalid max value: "+t);if(this.#e=t,this.#t=m,this.maxEntrySize=y||this.#t,this.sizeCalculation=g,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(E!==void 0&&typeof E!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#u=E,S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#s=S,this.#I=!!S,this.#n=new Map,this.#h=new Array(t).fill(void 0),this.#o=new Array(t).fill(void 0),this.#d=new N(t),this.#a=new N(t),this.#p=0,this.#y=0,this.#_=Cg.create(t),this.#c=0,this.#f=0,typeof l=="function"&&(this.#i=l),typeof h=="function"?(this.#r=h,this.#m=[]):(this.#r=void 0,this.#m=void 0),this.#v=!!this.#i,this.#E=!!this.#r,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!_,this.allowStaleOnFetchRejection=!!w,this.allowStaleOnFetchAbort=!!I,this.ignoreFetchAbort=!!v,this.maxEntrySize!==0){if(this.#t!==0&&!gr(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!gr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#C()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!c,this.ttlResolution=gr(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=r||0,this.ttl){if(!gr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#N()}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 P="LRU_CACHE_UNBOUNDED";sz(P)&&(UR.add(P),jR("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",P,i))}}getRemainingTTL(e){return this.#n.has(e)?1/0:0}#N(){let e=new gn(this.#e),t=new gn(this.#e);this.#b=e,this.#w=t,this.#B=(n,a,c=mn.now())=>{if(t[n]=a!==0?c:0,e[n]=a,a!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#R(n)&&this.#g(this.#h[n],"expire")},a+1);u.unref&&u.unref()}},this.#O=n=>{t[n]=e[n]!==0?mn.now():0},this.#l=(n,a)=>{if(e[a]){let c=e[a],u=t[a];if(!c||!u)return;n.ttl=c,n.start=u,n.now=r||s();let l=n.now-u;n.remainingTTL=c-l}};let r=0,s=o(()=>{let n=mn.now();if(this.ttlResolution>0){r=n;let a=setTimeout(()=>r=0,this.ttlResolution);a.unref&&a.unref()}return n},"getNow");this.getRemainingTTL=n=>{let a=this.#n.get(n);if(a===void 0)return 0;let c=e[a],u=t[a];if(!c||!u)return 1/0;let l=(r||s())-u;return c-l},this.#R=n=>{let a=t[n],c=e[n];return!!c&&!!a&&(r||s())-a>c}}#O=o(()=>{},"#updateItemAge");#l=o(()=>{},"#statusTTL");#B=o(()=>{},"#setItemTTL");#R=o(()=>!1,"#isStale");#C(){let e=new gn(this.#e);this.#f=0,this.#A=e,this.#k=t=>{this.#f-=e[t],e[t]=0},this.#$=(t,r,s,n)=>{if(this.#S(r))return 0;if(!gr(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(r,t),!gr(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.#T=(t,r,s)=>{if(e[t]=r,this.#t){let n=this.#t-e[t];for(;this.#f>n;)this.#D(!0)}this.#f+=e[t],s&&(s.entrySize=r,s.totalCalculatedSize=this.#f)}}#k=o(e=>{},"#removeItemSize");#T=o((e,t,r)=>{},"#addItemSize");#$=o((e,t,r,s)=>{if(r||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#P({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#y;!(!this.#F(t)||((e||!this.#R(t))&&(yield t),t===this.#p));)t=this.#a[t]}*#x({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#p;!(!this.#F(t)||((e||!this.#R(t))&&(yield t),t===this.#y));)t=this.#d[t]}#F(e){return e!==void 0&&this.#n.get(this.#h[e])===e}*entries(){for(let e of this.#P())this.#o[e]!==void 0&&this.#h[e]!==void 0&&!this.#S(this.#o[e])&&(yield[this.#h[e],this.#o[e]])}*rentries(){for(let e of this.#x())this.#o[e]!==void 0&&this.#h[e]!==void 0&&!this.#S(this.#o[e])&&(yield[this.#h[e],this.#o[e]])}*keys(){for(let e of this.#P()){let t=this.#h[e];t!==void 0&&!this.#S(this.#o[e])&&(yield t)}}*rkeys(){for(let e of this.#x()){let t=this.#h[e];t!==void 0&&!this.#S(this.#o[e])&&(yield t)}}*values(){for(let e of this.#P())this.#o[e]!==void 0&&!this.#S(this.#o[e])&&(yield this.#o[e])}*rvalues(){for(let e of this.#x())this.#o[e]!==void 0&&!this.#S(this.#o[e])&&(yield this.#o[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#P()){let s=this.#o[r],n=this.#S(s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,this.#h[r],this))return this.get(this.#h[r],t)}}forEach(e,t=this){for(let r of this.#P()){let s=this.#o[r],n=this.#S(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#h[r],this)}}rforEach(e,t=this){for(let r of this.#x()){let s=this.#o[r],n=this.#S(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#h[r],this)}}purgeStale(){let e=!1;for(let t of this.#x({allowStale:!0}))this.#R(t)&&(this.#g(this.#h[t],"expire"),e=!0);return e}info(e){let t=this.#n.get(e);if(t===void 0)return;let r=this.#o[t],s=this.#S(r)?r.__staleWhileFetching:r;if(s===void 0)return;let n={value:s};if(this.#b&&this.#w){let a=this.#b[t],c=this.#w[t];if(a&&c){let u=a-(mn.now()-c);n.ttl=u,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 r=this.#h[t],s=this.#o[t],n=this.#S(s)?s.__staleWhileFetching:s;if(n===void 0||r===void 0)continue;let a={value:n};if(this.#b&&this.#w){a.ttl=this.#b[t];let c=mn.now()-this.#w[t];a.start=Math.floor(Date.now()-c)}this.#A&&(a.size=this.#A[t]),e.unshift([r,a])}return e}load(e){this.clear();for(let[t,r]of e){if(r.start){let s=Date.now()-r.start;r.start=mn.now()-s}this.set(t,r.value,r)}}set(e,t,r={}){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:u}=r,{noUpdateTTL:l=this.noUpdateTTL}=r,h=this.#$(e,t,r.size||0,c);if(this.maxEntrySize&&h>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#g(e,"set"),this;let f=this.#c===0?void 0:this.#n.get(e);if(f===void 0)f=this.#c===0?this.#y:this.#_.length!==0?this.#_.pop():this.#c===this.#e?this.#D(!1):this.#c,this.#h[f]=e,this.#o[f]=t,this.#n.set(e,f),this.#d[this.#y]=f,this.#a[f]=this.#y,this.#y=f,this.#c++,this.#T(f,h,u),u&&(u.set="add"),l=!1;else{this.#j(f);let p=this.#o[f];if(t!==p){if(this.#I&&this.#S(p)){p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=p;m!==void 0&&!a&&(this.#v&&this.#i?.(m,e,"set"),this.#E&&this.#m?.push([m,e,"set"]))}else a||(this.#v&&this.#i?.(p,e,"set"),this.#E&&this.#m?.push([p,e,"set"]));if(this.#k(f),this.#T(f,h,u),this.#o[f]=t,u){u.set="replace";let m=p&&this.#S(p)?p.__staleWhileFetching:p;m!==void 0&&(u.oldValue=m)}}else u&&(u.set="update")}if(s!==0&&!this.#b&&this.#N(),this.#b&&(l||this.#B(f,s,n),u&&this.#l(u,f)),!a&&this.#E&&this.#m){let p=this.#m,m;for(;m=p?.shift();)this.#r?.(...m)}return this}pop(){try{for(;this.#c;){let e=this.#o[this.#p];if(this.#D(!0),this.#S(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#E&&this.#m){let e=this.#m,t;for(;t=e?.shift();)this.#r?.(...t)}}}#D(e){let t=this.#p,r=this.#h[t],s=this.#o[t];return this.#I&&this.#S(s)?s.__abortController.abort(new Error("evicted")):(this.#v||this.#E)&&(this.#v&&this.#i?.(s,r,"evict"),this.#E&&this.#m?.push([s,r,"evict"])),this.#k(t),e&&(this.#h[t]=void 0,this.#o[t]=void 0,this.#_.push(t)),this.#c===1?(this.#p=this.#y=0,this.#_.length=0):this.#p=this.#d[t],this.#n.delete(r),this.#c--,t}has(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:s}=t,n=this.#n.get(e);if(n!==void 0){let a=this.#o[n];if(this.#S(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#R(n))s&&(s.has="stale",this.#l(s,n));else return r&&this.#O(n),s&&(s.has="hit",this.#l(s,n)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{allowStale:r=this.allowStale}=t,s=this.#n.get(e);if(s===void 0||!r&&this.#R(s))return;let n=this.#o[s];return this.#S(n)?n.__staleWhileFetching:n}#L(e,t,r,s){let n=t===void 0?void 0:this.#o[t];if(this.#S(n))return n;let a=new Ll,{signal:c}=r;c?.addEventListener("abort",()=>a.abort(c.reason),{signal:a.signal});let u={signal:a.signal,options:r,context:s},l=o((g,S=!1)=>{let{aborted:E}=a.signal,_=r.ignoreFetchAbort&&g!==void 0;if(r.status&&(E&&!S?(r.status.fetchAborted=!0,r.status.fetchError=a.signal.reason,_&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),E&&!_&&!S)return f(a.signal.reason);let b=m;return this.#o[t]===m&&(g===void 0?b.__staleWhileFetching?this.#o[t]=b.__staleWhileFetching:this.#g(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,g,u.options))),g},"cb"),h=o(g=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=g),f(g)),"eb"),f=o(g=>{let{aborted:S}=a.signal,E=S&&r.allowStaleOnFetchAbort,_=E||r.allowStaleOnFetchRejection,b=_||r.noDeleteOnFetchRejection,w=m;if(this.#o[t]===m&&(!b||w.__staleWhileFetching===void 0?this.#g(e,"fetch"):E||(this.#o[t]=w.__staleWhileFetching)),_)return r.status&&w.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),w.__staleWhileFetching;if(w.__returned===w)throw g},"fetchFail"),p=o((g,S)=>{let E=this.#s?.(e,n,u);E&&E instanceof Promise&&E.then(_=>g(_===void 0?void 0:_),S),a.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(g(void 0),r.allowStaleOnFetchAbort&&(g=o(_=>l(_,!0),"res")))})},"pcall");r.status&&(r.status.fetchDispatched=!0);let m=new Promise(p).then(l,h),y=Object.assign(m,{__abortController:a,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,y,{...u.options,status:void 0}),t=this.#n.get(e)):this.#o[t]=y,y}#S(e){if(!this.#I)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Ll}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:u=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:h=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:m=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:g,forceRefresh:S=!1,status:E,signal:_}=t;if(!this.#I)return E&&(E.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:E});let b={allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:a,noDisposeOnSet:c,size:u,sizeCalculation:l,noUpdateTTL:h,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:y,ignoreFetchAbort:m,status:E,signal:_},w=this.#n.get(e);if(w===void 0){E&&(E.fetch="miss");let I=this.#L(e,w,b,g);return I.__returned=I}else{let I=this.#o[w];if(this.#S(I)){let ee=r&&I.__staleWhileFetching!==void 0;return E&&(E.fetch="inflight",ee&&(E.returnedStale=!0)),ee?I.__staleWhileFetching:I.__returned=I}let v=this.#R(w);if(!S&&!v)return E&&(E.fetch="hit"),this.#j(w),s&&this.#O(w),E&&this.#l(E,w),I;let N=this.#L(e,w,b,g),$=N.__staleWhileFetching!==void 0&&r;return E&&(E.fetch=v?"stale":"refresh",$&&v&&(E.returnedStale=!0)),$?N.__staleWhileFetching:N.__returned=N}}async forceFetch(e,t={}){let r=await this.fetch(e,t);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,t={}){let r=this.#u;if(!r)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 u=r(e,c,{options:a,context:s});return this.set(e,u,a),u}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:a}=t,c=this.#n.get(e);if(c!==void 0){let u=this.#o[c],l=this.#S(u);return a&&this.#l(a,c),this.#R(c)?(a&&(a.get="stale"),l?(a&&r&&u.__staleWhileFetching!==void 0&&(a.returnedStale=!0),r?u.__staleWhileFetching:void 0):(n||this.#g(e,"expire"),a&&r&&(a.returnedStale=!0),r?u:void 0)):(a&&(a.get="hit"),l?u.__staleWhileFetching:(this.#j(c),s&&this.#O(c),u))}else a&&(a.get="miss")}#U(e,t){this.#a[t]=e,this.#d[e]=t}#j(e){e!==this.#y&&(e===this.#p?this.#p=this.#d[e]:this.#U(this.#a[e],this.#d[e]),this.#U(this.#y,e),this.#y=e)}delete(e){return this.#g(e,"delete")}#g(e,t){let r=!1;if(this.#c!==0){let s=this.#n.get(e);if(s!==void 0)if(r=!0,this.#c===1)this.#q(t);else{this.#k(s);let n=this.#o[s];if(this.#S(n)?n.__abortController.abort(new Error("deleted")):(this.#v||this.#E)&&(this.#v&&this.#i?.(n,e,t),this.#E&&this.#m?.push([n,e,t])),this.#n.delete(e),this.#h[s]=void 0,this.#o[s]=void 0,s===this.#y)this.#y=this.#a[s];else if(s===this.#p)this.#p=this.#d[s];else{let a=this.#a[s];this.#d[a]=this.#d[s];let c=this.#d[s];this.#a[c]=this.#a[s]}this.#c--,this.#_.push(s)}}if(this.#E&&this.#m?.length){let s=this.#m,n;for(;n=s?.shift();)this.#r?.(...n)}return r}clear(){return this.#q("delete")}#q(e){for(let t of this.#x({allowStale:!0})){let r=this.#o[t];if(this.#S(r))r.__abortController.abort(new Error("deleted"));else{let s=this.#h[t];this.#v&&this.#i?.(r,s,e),this.#E&&this.#m?.push([r,s,e])}}if(this.#n.clear(),this.#o.fill(void 0),this.#h.fill(void 0),this.#b&&this.#w&&(this.#b.fill(0),this.#w.fill(0)),this.#A&&this.#A.fill(0),this.#p=0,this.#y=0,this.#_.length=0,this.#f=0,this.#c=0,this.#E&&this.#m){let t=this.#m,r;for(;r=t?.shift();)this.#r?.(...r)}}};Ml.LRUCache=Ng});var zR=d((efe,VR)=>{"use strict";var qR=De(),nz=o((i,e,t,r,s)=>{typeof t=="string"&&(s=r,r=t,t=void 0);try{return new qR(i instanceof qR?i.version:i,t).inc(e,r,s).version}catch{return null}},"inc");VR.exports=nz});var WR=d((ife,GR)=>{"use strict";var HR=ns(),oz=o((i,e)=>{let t=HR(i,null,!0),r=HR(e,null,!0),s=t.compare(r);if(s===0)return null;let n=s>0,a=n?t:r,c=n?r:t,u=!!a.prerelease.length;if(!!c.prerelease.length&&!u){if(!c.patch&&!c.minor)return"major";if(c.compareMain(a)===0)return c.minor&&!c.patch?"minor":"patch"}let h=u?"pre":"";return t.major!==r.major?h+"major":t.minor!==r.minor?h+"minor":t.patch!==r.patch?h+"patch":"prerelease"},"diff");GR.exports=oz});var KR=d((sfe,JR)=>{"use strict";var az=De(),cz=o((i,e)=>new az(i,e).major,"major");JR.exports=cz});var YR=d((ofe,ZR)=>{"use strict";var uz=De(),lz=o((i,e)=>new uz(i,e).minor,"minor");ZR.exports=lz});var QR=d((cfe,XR)=>{"use strict";var hz=De(),fz=o((i,e)=>new hz(i,e).patch,"patch");XR.exports=fz});var tA=d((lfe,eA)=>{"use strict";var dz=ns(),pz=o((i,e)=>{let t=dz(i,e);return t&&t.prerelease.length?t.prerelease:null},"prerelease");eA.exports=pz});var It=d((ffe,rA)=>{"use strict";var iA=De(),mz=o((i,e,t)=>new iA(i,t).compare(new iA(e,t)),"compare");rA.exports=mz});var nA=d((pfe,sA)=>{"use strict";var gz=It(),yz=o((i,e,t)=>gz(e,i,t),"rcompare");sA.exports=yz});var aA=d((gfe,oA)=>{"use strict";var Sz=It(),Ez=o((i,e)=>Sz(i,e,!0),"compareLoose");oA.exports=Ez});var Bl=d((Sfe,uA)=>{"use strict";var cA=De(),wz=o((i,e,t)=>{let r=new cA(i,t),s=new cA(e,t);return r.compare(s)||r.compareBuild(s)},"compareBuild");uA.exports=wz});var hA=d((wfe,lA)=>{"use strict";var _z=Bl(),bz=o((i,e)=>i.sort((t,r)=>_z(t,r,e)),"sort");lA.exports=bz});var dA=d((bfe,fA)=>{"use strict";var Iz=Bl(),Oz=o((i,e)=>i.sort((t,r)=>Iz(r,t,e)),"rsort");fA.exports=Oz});var ka=d((Ofe,pA)=>{"use strict";var vz=It(),Rz=o((i,e,t)=>vz(i,e,t)>0,"gt");pA.exports=Rz});var kl=d((Rfe,mA)=>{"use strict";var Az=It(),Tz=o((i,e,t)=>Az(i,e,t)<0,"lt");mA.exports=Tz});var Dg=d((Tfe,gA)=>{"use strict";var Cz=It(),Nz=o((i,e,t)=>Cz(i,e,t)===0,"eq");gA.exports=Nz});var xg=d((Nfe,yA)=>{"use strict";var Pz=It(),Dz=o((i,e,t)=>Pz(i,e,t)!==0,"neq");yA.exports=Dz});var Fl=d((Dfe,SA)=>{"use strict";var xz=It(),Lz=o((i,e,t)=>xz(i,e,t)>=0,"gte");SA.exports=Lz});var Ul=d((Lfe,EA)=>{"use strict";var Mz=It(),Bz=o((i,e,t)=>Mz(i,e,t)<=0,"lte");EA.exports=Bz});var Lg=d((Bfe,wA)=>{"use strict";var kz=Dg(),Fz=xg(),Uz=ka(),jz=Fl(),$z=kl(),qz=Ul(),Vz=o((i,e,t,r)=>{switch(e){case"===":return typeof i=="object"&&(i=i.version),typeof t=="object"&&(t=t.version),i===t;case"!==":return typeof i=="object"&&(i=i.version),typeof t=="object"&&(t=t.version),i!==t;case"":case"=":case"==":return kz(i,t,r);case"!=":return Fz(i,t,r);case">":return Uz(i,t,r);case">=":return jz(i,t,r);case"<":return $z(i,t,r);case"<=":return qz(i,t,r);default:throw new TypeError(`Invalid operator: ${e}`)}},"cmp");wA.exports=Vz});var bA=d((Ffe,_A)=>{"use strict";var zz=De(),Hz=ns(),{safeRe:jl,t:$l}=cn(),Gz=o((i,e)=>{if(i instanceof zz)return i;if(typeof i=="number"&&(i=String(i)),typeof i!="string")return null;e=e||{};let t=null;if(!e.rtl)t=i.match(e.includePrerelease?jl[$l.COERCEFULL]:jl[$l.COERCE]);else{let u=e.includePrerelease?jl[$l.COERCERTLFULL]:jl[$l.COERCERTL],l;for(;(l=u.exec(i))&&(!t||t.index+t[0].length!==i.length);)(!t||l.index+l[0].length!==t.index+t[0].length)&&(t=l),u.lastIndex=l.index+l[1].length+l[2].length;u.lastIndex=-1}if(t===null)return null;let r=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 Hz(`${r}.${s}.${n}${a}${c}`,e)},"coerce");_A.exports=Gz});var OA=d((jfe,IA)=>{"use strict";var Mg=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}};IA.exports=Mg});var Ot=d((qfe,TA)=>{"use strict";var Wz=/\s+/g,Bg=class i{static{o(this,"Range")}constructor(e,t){if(t=Kz(t),e instanceof i)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new i(e.raw,t);if(e instanceof kg)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(Wz," "),this.set=this.raw.split("||").map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter(s=>!RA(s[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let s of this.set)if(s.length===1&&iH(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 r=0;r<t.length;r++)r>0&&(this.formatted+=" "),this.formatted+=t[r].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let r=((this.options.includePrerelease&&eH)|(this.options.loose&&tH))+":"+e,s=vA.get(r);if(s)return s;let n=this.options.loose,a=n?Ze[ze.HYPHENRANGELOOSE]:Ze[ze.HYPHENRANGE];e=e.replace(a,fH(this.options.includePrerelease)),ne("hyphen replace",e),e=e.replace(Ze[ze.COMPARATORTRIM],Yz),ne("comparator trim",e),e=e.replace(Ze[ze.TILDETRIM],Xz),ne("tilde trim",e),e=e.replace(Ze[ze.CARETTRIM],Qz),ne("caret trim",e);let c=e.split(" ").map(f=>rH(f,this.options)).join(" ").split(/\s+/).map(f=>hH(f,this.options));n&&(c=c.filter(f=>(ne("loose invalid filter",f,this.options),!!f.match(Ze[ze.COMPARATORLOOSE])))),ne("range list",c);let u=new Map,l=c.map(f=>new kg(f,this.options));for(let f of l){if(RA(f))return[f];u.set(f.value,f)}u.size>1&&u.has("")&&u.delete("");let h=[...u.values()];return vA.set(r,h),h}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Range is required");return this.set.some(r=>AA(r,t)&&e.set.some(s=>AA(s,t)&&r.every(n=>s.every(a=>n.intersects(a,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new Zz(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(dH(this.set[t],e,this.options))return!0;return!1}};TA.exports=Bg;var Jz=OA(),vA=new Jz,Kz=zu(),kg=Fa(),ne=ha(),Zz=De(),{safeRe:Ze,t:ze,comparatorTrimReplace:Yz,tildeTrimReplace:Xz,caretTrimReplace:Qz}=cn(),{FLAG_INCLUDE_PRERELEASE:eH,FLAG_LOOSE:tH}=fa(),RA=o(i=>i.value==="<0.0.0-0","isNullSet"),iH=o(i=>i.value==="","isAny"),AA=o((i,e)=>{let t=!0,r=i.slice(),s=r.pop();for(;t&&r.length;)t=r.every(n=>s.intersects(n,e)),s=r.pop();return t},"isSatisfiable"),rH=o((i,e)=>(ne("comp",i,e),i=oH(i,e),ne("caret",i),i=sH(i,e),ne("tildes",i),i=cH(i,e),ne("xrange",i),i=lH(i,e),ne("stars",i),i),"parseComparator"),He=o(i=>!i||i.toLowerCase()==="x"||i==="*","isX"),sH=o((i,e)=>i.trim().split(/\s+/).map(t=>nH(t,e)).join(" "),"replaceTildes"),nH=o((i,e)=>{let t=e.loose?Ze[ze.TILDELOOSE]:Ze[ze.TILDE];return i.replace(t,(r,s,n,a,c)=>{ne("tilde",i,r,s,n,a,c);let u;return He(s)?u="":He(n)?u=`>=${s}.0.0 <${+s+1}.0.0-0`:He(a)?u=`>=${s}.${n}.0 <${s}.${+n+1}.0-0`:c?(ne("replaceTilde pr",c),u=`>=${s}.${n}.${a}-${c} <${s}.${+n+1}.0-0`):u=`>=${s}.${n}.${a} <${s}.${+n+1}.0-0`,ne("tilde return",u),u})},"replaceTilde"),oH=o((i,e)=>i.trim().split(/\s+/).map(t=>aH(t,e)).join(" "),"replaceCarets"),aH=o((i,e)=>{ne("caret",i,e);let t=e.loose?Ze[ze.CARETLOOSE]:Ze[ze.CARET],r=e.includePrerelease?"-0":"";return i.replace(t,(s,n,a,c,u)=>{ne("caret",i,s,n,a,c,u);let l;return He(n)?l="":He(a)?l=`>=${n}.0.0${r} <${+n+1}.0.0-0`:He(c)?n==="0"?l=`>=${n}.${a}.0${r} <${n}.${+a+1}.0-0`:l=`>=${n}.${a}.0${r} <${+n+1}.0.0-0`:u?(ne("replaceCaret pr",u),n==="0"?a==="0"?l=`>=${n}.${a}.${c}-${u} <${n}.${a}.${+c+1}-0`:l=`>=${n}.${a}.${c}-${u} <${n}.${+a+1}.0-0`:l=`>=${n}.${a}.${c}-${u} <${+n+1}.0.0-0`):(ne("no pr"),n==="0"?a==="0"?l=`>=${n}.${a}.${c}${r} <${n}.${a}.${+c+1}-0`:l=`>=${n}.${a}.${c}${r} <${n}.${+a+1}.0-0`:l=`>=${n}.${a}.${c} <${+n+1}.0.0-0`),ne("caret return",l),l})},"replaceCaret"),cH=o((i,e)=>(ne("replaceXRanges",i,e),i.split(/\s+/).map(t=>uH(t,e)).join(" ")),"replaceXRanges"),uH=o((i,e)=>{i=i.trim();let t=e.loose?Ze[ze.XRANGELOOSE]:Ze[ze.XRANGE];return i.replace(t,(r,s,n,a,c,u)=>{ne("xRange",i,r,s,n,a,c,u);let l=He(n),h=l||He(a),f=h||He(c),p=f;return s==="="&&p&&(s=""),u=e.includePrerelease?"-0":"",l?s===">"||s==="<"?r="<0.0.0-0":r="*":s&&p?(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==="<"&&(u="-0"),r=`${s+n}.${a}.${c}${u}`):h?r=`>=${n}.0.0${u} <${+n+1}.0.0-0`:f&&(r=`>=${n}.${a}.0${u} <${n}.${+a+1}.0-0`),ne("xRange return",r),r})},"replaceXRange"),lH=o((i,e)=>(ne("replaceStars",i,e),i.trim().replace(Ze[ze.STAR],"")),"replaceStars"),hH=o((i,e)=>(ne("replaceGTE0",i,e),i.trim().replace(Ze[e.includePrerelease?ze.GTE0PRE:ze.GTE0],"")),"replaceGTE0"),fH=o(i=>(e,t,r,s,n,a,c,u,l,h,f,p)=>(He(r)?t="":He(s)?t=`>=${r}.0.0${i?"-0":""}`:He(n)?t=`>=${r}.${s}.0${i?"-0":""}`:a?t=`>=${t}`:t=`>=${t}${i?"-0":""}`,He(l)?u="":He(h)?u=`<${+l+1}.0.0-0`:He(f)?u=`<${l}.${+h+1}.0-0`:p?u=`<=${l}.${h}.${f}-${p}`:i?u=`<${l}.${h}.${+f+1}-0`:u=`<=${u}`,`${t} ${u}`.trim()),"hyphenReplace"),dH=o((i,e,t)=>{for(let r=0;r<i.length;r++)if(!i[r].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let r=0;r<i.length;r++)if(ne(i[r].semver),i[r].semver!==kg.ANY&&i[r].semver.prerelease.length>0){let s=i[r].semver;if(s.major===e.major&&s.minor===e.minor&&s.patch===e.patch)return!0}return!1}return!0},"testSet")});var Fa=d((zfe,LA)=>{"use strict";var Ua=Symbol("SemVer ANY"),jg=class i{static{o(this,"Comparator")}static get ANY(){return Ua}constructor(e,t){if(t=CA(t),e instanceof i){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Ug("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Ua?this.value="":this.value=this.operator+this.semver.version,Ug("comp",this)}parse(e){let t=this.options.loose?NA[PA.COMPARATORLOOSE]:NA[PA.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new DA(r[2],this.options.loose):this.semver=Ua}toString(){return this.value}test(e){if(Ug("Comparator.test",e,this.options.loose),this.semver===Ua||e===Ua)return!0;if(typeof e=="string")try{e=new DA(e,this.options)}catch{return!1}return Fg(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new xA(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new xA(this.value,t).test(e.semver):(t=CA(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("=")||Fg(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Fg(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};LA.exports=jg;var CA=zu(),{safeRe:NA,t:PA}=cn(),Fg=Lg(),Ug=ha(),DA=De(),xA=Ot()});var yn=d((Gfe,MA)=>{"use strict";var pH=Ot(),mH=o((i,e,t)=>{try{e=new pH(e,t)}catch{return!1}return e.test(i)},"satisfies");MA.exports=mH});var kA=d((Jfe,BA)=>{"use strict";var gH=Ot(),yH=o((i,e)=>new gH(i,e).set.map(t=>t.map(r=>r.value).join(" ").trim().split(" ")),"toComparators");BA.exports=yH});var UA=d((Zfe,FA)=>{"use strict";var SH=De(),EH=Ot(),wH=o((i,e,t)=>{let r=null,s=null,n=null;try{n=new EH(e,t)}catch{return null}return i.forEach(a=>{n.test(a)&&(!r||s.compare(a)===-1)&&(r=a,s=new SH(r,t))}),r},"maxSatisfying");FA.exports=wH});var $A=d((Xfe,jA)=>{"use strict";var _H=De(),bH=Ot(),IH=o((i,e,t)=>{let r=null,s=null,n=null;try{n=new bH(e,t)}catch{return null}return i.forEach(a=>{n.test(a)&&(!r||s.compare(a)===1)&&(r=a,s=new _H(r,t))}),r},"minSatisfying");jA.exports=IH});var zA=d((ede,VA)=>{"use strict";var $g=De(),OH=Ot(),qA=ka(),vH=o((i,e)=>{i=new OH(i,e);let t=new $g("0.0.0");if(i.test(t)||(t=new $g("0.0.0-0"),i.test(t)))return t;t=null;for(let r=0;r<i.set.length;++r){let s=i.set[r],n=null;s.forEach(a=>{let c=new $g(a.semver.version);switch(a.operator){case">":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!n||qA(c,n))&&(n=c);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),n&&(!t||qA(t,n))&&(t=n)}return t&&i.test(t)?t:null},"minVersion");VA.exports=vH});var qg=d((ide,HA)=>{"use strict";var RH=Ot(),AH=o((i,e)=>{try{return new RH(i,e).range||"*"}catch{return null}},"validRange");HA.exports=AH});var ql=d((sde,KA)=>{"use strict";var TH=De(),JA=Fa(),{ANY:CH}=JA,NH=Ot(),PH=yn(),GA=ka(),WA=kl(),DH=Ul(),xH=Fl(),LH=o((i,e,t,r)=>{i=new TH(i,r),e=new NH(e,r);let s,n,a,c,u;switch(t){case">":s=GA,n=DH,a=WA,c=">",u=">=";break;case"<":s=WA,n=xH,a=GA,c="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(PH(i,e,r))return!1;for(let l=0;l<e.set.length;++l){let h=e.set[l],f=null,p=null;if(h.forEach(m=>{m.semver===CH&&(m=new JA(">=0.0.0")),f=f||m,p=p||m,s(m.semver,f.semver,r)?f=m:a(m.semver,p.semver,r)&&(p=m)}),f.operator===c||f.operator===u||(!p.operator||p.operator===c)&&n(i,p.semver))return!1;if(p.operator===u&&a(i,p.semver))return!1}return!0},"outside");KA.exports=LH});var YA=d((ode,ZA)=>{"use strict";var MH=ql(),BH=o((i,e,t)=>MH(i,e,">",t),"gtr");ZA.exports=BH});var QA=d((cde,XA)=>{"use strict";var kH=ql(),FH=o((i,e,t)=>kH(i,e,"<",t),"ltr");XA.exports=FH});var iT=d((lde,tT)=>{"use strict";var eT=Ot(),UH=o((i,e,t)=>(i=new eT(i,t),e=new eT(e,t),i.intersects(e,t)),"intersects");tT.exports=UH});var sT=d((fde,rT)=>{"use strict";var jH=yn(),$H=It();rT.exports=(i,e,t)=>{let r=[],s=null,n=null,a=i.sort((h,f)=>$H(h,f,t));for(let h of a)jH(h,e,t)?(n=h,s||(s=h)):(n&&r.push([s,n]),n=null,s=null);s&&r.push([s,null]);let c=[];for(let[h,f]of r)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 u=c.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return u.length<l.length?u:e}});var lT=d((dde,uT)=>{"use strict";var nT=Ot(),zg=Fa(),{ANY:Vg}=zg,ja=yn(),Hg=It(),qH=o((i,e,t={})=>{if(i===e)return!0;i=new nT(i,t),e=new nT(e,t);let r=!1;e:for(let s of i.set){for(let n of e.set){let a=zH(s,n,t);if(r=r||a!==null,a)continue e}if(r)return!1}return!0},"subset"),VH=[new zg(">=0.0.0-0")],oT=[new zg(">=0.0.0")],zH=o((i,e,t)=>{if(i===e)return!0;if(i.length===1&&i[0].semver===Vg){if(e.length===1&&e[0].semver===Vg)return!0;t.includePrerelease?i=VH:i=oT}if(e.length===1&&e[0].semver===Vg){if(t.includePrerelease)return!0;e=oT}let r=new Set,s,n;for(let m of i)m.operator===">"||m.operator===">="?s=aT(s,m,t):m.operator==="<"||m.operator==="<="?n=cT(n,m,t):r.add(m.semver);if(r.size>1)return null;let a;if(s&&n){if(a=Hg(s.semver,n.semver,t),a>0)return null;if(a===0&&(s.operator!==">="||n.operator!=="<="))return null}for(let m of r){if(s&&!ja(m,String(s),t)||n&&!ja(m,String(n),t))return null;for(let y of e)if(!ja(m,String(y),t))return!1;return!0}let c,u,l,h,f=n&&!t.includePrerelease&&n.semver.prerelease.length?n.semver:!1,p=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 m of e){if(h=h||m.operator===">"||m.operator===">=",l=l||m.operator==="<"||m.operator==="<=",s){if(p&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===p.major&&m.semver.minor===p.minor&&m.semver.patch===p.patch&&(p=!1),m.operator===">"||m.operator===">="){if(c=aT(s,m,t),c===m&&c!==s)return!1}else if(s.operator===">="&&!ja(s.semver,String(m),t))return!1}if(n){if(f&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===f.major&&m.semver.minor===f.minor&&m.semver.patch===f.patch&&(f=!1),m.operator==="<"||m.operator==="<="){if(u=cT(n,m,t),u===m&&u!==n)return!1}else if(n.operator==="<="&&!ja(n.semver,String(m),t))return!1}if(!m.operator&&(n||s)&&a!==0)return!1}return!(s&&l&&!n&&a!==0||n&&h&&!s&&a!==0||p||f)},"simpleSubset"),aT=o((i,e,t)=>{if(!i)return e;let r=Hg(i.semver,e.semver,t);return r>0?i:r<0||e.operator===">"&&i.operator===">="?e:i},"higherGT"),cT=o((i,e,t)=>{if(!i)return e;let r=Hg(i.semver,e.semver,t);return r<0?i:r>0||e.operator==="<"&&i.operator==="<="?e:i},"lowerLT");uT.exports=qH});var ds=d((mde,dT)=>{"use strict";var Gg=cn(),hT=fa(),HH=De(),fT=Rm(),GH=ns(),WH=Tm(),JH=Cm(),KH=zR(),ZH=WR(),YH=KR(),XH=YR(),QH=QR(),eG=tA(),tG=It(),iG=nA(),rG=aA(),sG=Bl(),nG=hA(),oG=dA(),aG=ka(),cG=kl(),uG=Dg(),lG=xg(),hG=Fl(),fG=Ul(),dG=Lg(),pG=bA(),mG=Fa(),gG=Ot(),yG=yn(),SG=kA(),EG=UA(),wG=$A(),_G=zA(),bG=qg(),IG=ql(),OG=YA(),vG=QA(),RG=iT(),AG=sT(),TG=lT();dT.exports={parse:GH,valid:WH,clean:JH,inc:KH,diff:ZH,major:YH,minor:XH,patch:QH,prerelease:eG,compare:tG,rcompare:iG,compareLoose:rG,compareBuild:sG,sort:nG,rsort:oG,gt:aG,lt:cG,eq:uG,neq:lG,gte:hG,lte:fG,cmp:dG,coerce:pG,Comparator:mG,Range:gG,satisfies:yG,toComparators:SG,maxSatisfying:EG,minSatisfying:wG,minVersion:_G,validRange:bG,outside:IG,gtr:OG,ltr:vG,intersects:RG,simplifyRange:AG,subset:TG,SemVer:HH,re:Gg.re,src:Gg.src,tokens:Gg.t,SEMVER_SPEC_VERSION:hT.SEMVER_SPEC_VERSION,RELEASE_TYPES:hT.RELEASE_TYPES,compareIdentifiers:fT.compareIdentifiers,rcompareIdentifiers:fT.rcompareIdentifiers}});var gT=d((gde,mT)=>{var pT=ds();mT.exports=i=>CG(i.reduce(MG,{versions:{},"dist-tags":{},refs:{},shas:{}}));var CG=o(i=>DG(NG(PG(i))),"finish"),NG=o(i=>(Object.keys(i.refs).forEach(e=>{let t=i.refs[e];i.shas[t.sha]?i.shas[t.sha].push(e):i.shas[t.sha]=[e]}),i),"shaList"),PG=o(i=>(Object.keys(i.refs).filter(e=>e.endsWith("^{}")).forEach(e=>{let t=i.refs[e],r=i.refs[e.replace(/\^\{\}$/,"")];r&&(r.sha=t.sha,delete i.refs[e])}),i),"peelTags"),DG=o(i=>{let e=i.refs.HEAD||{};return Object.keys(i.versions).forEach(r=>{let s=i.versions[r];i.refs.latest&&s.sha===i.refs.latest.sha?i["dist-tags"].latest=r:s.sha===e.sha&&(i["dist-tags"].HEAD=r,i.refs.latest||(i["dist-tags"].latest=r))}),i},"distTags"),xG=o(i=>i.startsWith("refs/tags/")?"tag":i.startsWith("refs/heads/")?"branch":i.startsWith("refs/pull/")?"pull":i==="HEAD"?"head":"other","refType"),LG=o(i=>{let e=i.trim().split(/\s+/,2);if(e.length<2)return null;let t=e[0].trim(),r=e[1].trim(),s=xG(r);if(s==="tag"){let n=r.slice(10);return{sha:t,ref:n,rawRef:r,type:s}}if(s==="branch"){let n=r.slice(11);return{sha:t,ref:n,rawRef:r,type:s}}if(s==="pull"){let n=r.slice(5).replace(/\/head$/,"");return{sha:t,ref:n,rawRef:r,type:s}}return s==="head"?{sha:t,ref:"HEAD",rawRef:r,type:s}:{sha:t,ref:r,rawRef:r,type:s}},"lineToRevDoc"),MG=o((i,e)=>{let t=LG(e);if(!t)return i;if(i.refs[t.ref]=t,i.refs[t.rawRef]=t,t.type==="tag"){let r=!t.ref.endsWith("^{}")&&t.ref.match(/v?(\d+\.\d+\.\d+(?:[-+].+)?)$/);r&&pT.valid(r[1],!0)&&(i.versions[pT.clean(r[1],!0)]=t)}return i},"linesToRevsReducer")});var Wg=d((Sde,ST)=>{var BG=Ba(),{LRUCache:kG}=Pg(),FG=gT(),yT=new kG({max:100,ttl:300*1e3});ST.exports=async(i,e={})=>{if(!e.noGitRevCache){let s=yT.get(i);if(s)return s}let{stdout:t}=await BG(["ls-remote",i],e),r=FG(t.trim().split(`
13
+ `));return yT.set(i,r),r}});var wT=d(ET=>{var UG=o(i=>(i.fakePlatform||process.platform)==="win32","isWindows");ET.isWindows=UG});var IT=d((_de,bT)=>{"use strict";var z=o((...i)=>i.every(e=>e)?i.join(""):"","maybeJoin"),ye=o(i=>i?encodeURIComponent(i):"","maybeEncode"),_T=o(i=>i.toLowerCase().replace(/^\W+/g,"").replace(/(?<!\W)\W+$/,"").replace(/\//g,"").replace(/\W+/g,"-"),"formatHashFragment"),jG={sshtemplate:o(({domain:i,user:e,project:t,committish:r})=>`git@${i}:${e}/${t}.git${z("#",r)}`,"sshtemplate"),sshurltemplate:o(({domain:i,user:e,project:t,committish:r})=>`git+ssh://git@${i}/${e}/${t}.git${z("#",r)}`,"sshurltemplate"),edittemplate:o(({domain:i,user:e,project:t,committish:r,editpath:s,path:n})=>`https://${i}/${e}/${t}${z("/",s,"/",ye(r||"HEAD"),"/",n)}`,"edittemplate"),browsetemplate:o(({domain:i,user:e,project:t,committish:r,treepath:s})=>`https://${i}/${e}/${t}${z("/",s,"/",ye(r))}`,"browsetemplate"),browsetreetemplate:o(({domain:i,user:e,project:t,committish:r,treepath:s,path:n,fragment:a,hashformat:c})=>`https://${i}/${e}/${t}/${s}/${ye(r||"HEAD")}/${n}${z("#",c(a||""))}`,"browsetreetemplate"),browseblobtemplate:o(({domain:i,user:e,project:t,committish:r,blobpath:s,path:n,fragment:a,hashformat:c})=>`https://${i}/${e}/${t}/${s}/${ye(r||"HEAD")}/${n}${z("#",c(a||""))}`,"browseblobtemplate"),docstemplate:o(({domain:i,user:e,project:t,treepath:r,committish:s})=>`https://${i}/${e}/${t}${z("/",r,"/",ye(s))}#readme`,"docstemplate"),httpstemplate:o(({auth:i,domain:e,user:t,project:r,committish:s})=>`git+https://${z(i,"@")}${e}/${t}/${r}.git${z("#",s)}`,"httpstemplate"),filetemplate:o(({domain:i,user:e,project:t,committish:r,path:s})=>`https://${i}/${e}/${t}/raw/${ye(r||"HEAD")}/${s}`,"filetemplate"),shortcuttemplate:o(({type:i,user:e,project:t,committish:r})=>`${i}:${e}/${t}${z("#",r)}`,"shortcuttemplate"),pathtemplate:o(({user:i,project:e,committish:t})=>`${i}/${e}${z("#",t)}`,"pathtemplate"),bugstemplate:o(({domain:i,user:e,project:t})=>`https://${i}/${e}/${t}/issues`,"bugstemplate"),hashformat:_T},yr={};yr.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:o(({auth:i,user:e,project:t,committish:r,path:s})=>`https://${z(i,"@")}raw.githubusercontent.com/${e}/${t}/${ye(r||"HEAD")}/${s}`,"filetemplate"),gittemplate:o(({auth:i,domain:e,user:t,project:r,committish:s})=>`git://${z(i,"@")}${e}/${t}/${r}.git${z("#",s)}`,"gittemplate"),tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://codeload.${i}/${e}/${t}/tar.gz/${ye(r||"HEAD")}`,"tarballtemplate"),extract:o(i=>{let[,e,t,r,s]=i.pathname.split("/",5);if(!(r&&r!=="tree")&&(r||(s=i.hash.slice(1)),t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:s}},"extract")};yr.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:o(({domain:i,user:e,project:t,committish:r,treepath:s,path:n,editpath:a})=>`https://${i}/${e}/${t}${z("/",s,"/",ye(r||"HEAD"),"/",n,a)}`,"edittemplate"),tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}/get/${ye(r||"HEAD")}.tar.gz`,"tarballtemplate"),extract:o(i=>{let[,e,t,r]=i.pathname.split("/",4);if(!["get"].includes(r)&&(t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:i.hash.slice(1)}},"extract")};yr.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",httpstemplate:o(({auth:i,domain:e,user:t,project:r,committish:s})=>`git+https://${z(i,"@")}${e}/${t}/${r}.git${z("#",s)}`,"httpstemplate"),tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}/repository/archive.tar.gz?ref=${ye(r||"HEAD")}`,"tarballtemplate"),extract:o(i=>{let e=i.pathname.slice(1);if(e.includes("/-/")||e.includes("/archive.tar.gz"))return;let t=e.split("/"),r=t.pop();r.endsWith(".git")&&(r=r.slice(0,-4));let s=t.join("/");if(!(!s||!r))return{user:s,project:r,committish:i.hash.slice(1)}},"extract")};yr.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:o(({domain:i,project:e,committish:t})=>`git@${i}:${e}.git${z("#",t)}`,"sshtemplate"),sshurltemplate:o(({domain:i,project:e,committish:t})=>`git+ssh://git@${i}/${e}.git${z("#",t)}`,"sshurltemplate"),edittemplate:o(({domain:i,user:e,project:t,committish:r,editpath:s})=>`https://${i}/${e}/${t}${z("/",ye(r))}/${s}`,"edittemplate"),browsetemplate:o(({domain:i,project:e,committish:t})=>`https://${i}/${e}${z("/",ye(t))}`,"browsetemplate"),browsetreetemplate:o(({domain:i,project:e,committish:t,path:r,hashformat:s})=>`https://${i}/${e}${z("/",ye(t))}${z("#",s(r))}`,"browsetreetemplate"),browseblobtemplate:o(({domain:i,project:e,committish:t,path:r,hashformat:s})=>`https://${i}/${e}${z("/",ye(t))}${z("#",s(r))}`,"browseblobtemplate"),docstemplate:o(({domain:i,project:e,committish:t})=>`https://${i}/${e}${z("/",ye(t))}`,"docstemplate"),httpstemplate:o(({domain:i,project:e,committish:t})=>`git+https://${i}/${e}.git${z("#",t)}`,"httpstemplate"),filetemplate:o(({user:i,project:e,committish:t,path:r})=>`https://gist.githubusercontent.com/${i}/${e}/raw${z("/",ye(t))}/${r}`,"filetemplate"),shortcuttemplate:o(({type:i,project:e,committish:t})=>`${i}:${e}${z("#",t)}`,"shortcuttemplate"),pathtemplate:o(({project:i,committish:e})=>`${i}${z("#",e)}`,"pathtemplate"),bugstemplate:o(({domain:i,project:e})=>`https://${i}/${e}`,"bugstemplate"),gittemplate:o(({domain:i,project:e,committish:t})=>`git://${i}/${e}.git${z("#",t)}`,"gittemplate"),tarballtemplate:o(({project:i,committish:e})=>`https://codeload.github.com/gist/${i}/tar.gz/${ye(e||"HEAD")}`,"tarballtemplate"),extract:o(i=>{let[,e,t,r]=i.pathname.split("/",4);if(r!=="raw"){if(!t){if(!e)return;t=e,e=null}return t.endsWith(".git")&&(t=t.slice(0,-4)),{user:e,project:t,committish:i.hash.slice(1)}}},"extract"),hashformat:o(function(i){return i&&"file-"+_T(i)},"hashformat")};yr.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:o(({domain:i,user:e,project:t,committish:r,path:s})=>`https://${i}/${e}/${t}/blob/${ye(r)||"HEAD"}/${s}`,"filetemplate"),httpstemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}.git${z("#",r)}`,"httpstemplate"),tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}/archive/${ye(r)||"HEAD"}.tar.gz`,"tarballtemplate"),bugstemplate:o(()=>null,"bugstemplate"),extract:o(i=>{let[,e,t,r]=i.pathname.split("/",4);if(!["archive"].includes(r)&&(t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:i.hash.slice(1)}},"extract")};for(let[i,e]of Object.entries(yr))yr[i]=Object.assign({},jG,e);bT.exports=yr});var Kg=d((Ide,vT)=>{var $G=require("url"),Jg=o((i,e,t)=>{let r=i.indexOf(t);return i.lastIndexOf(e,r>-1?r:1/0)},"lastIndexOfBefore"),OT=o(i=>{try{return new $G.URL(i)}catch{}},"safeUrl"),qG=o((i,e)=>{let t=i.indexOf(":"),r=i.slice(0,t+1);if(Object.prototype.hasOwnProperty.call(e,r))return i;let s=i.indexOf("@");return s>-1?s>t?`git+ssh://${i}`:i:i.indexOf("//")===t+1?i:`${i.slice(0,t+1)}//${i.slice(t+1)}`},"correctProtocol"),VG=o(i=>{let e=Jg(i,"@","#"),t=Jg(i,":","#");return t>e&&(i=i.slice(0,t)+"/"+i.slice(t+1)),Jg(i,":","#")===-1&&i.indexOf("//")===-1&&(i=`git+ssh://${i}`),i},"correctUrl");vT.exports=(i,e)=>{let t=e?qG(i,e):i;return OT(t)||OT(VG(t))}});var AT=d((vde,RT)=>{"use strict";var zG=Kg(),HG=o(i=>{let e=i.indexOf("#"),t=i.indexOf("/"),r=i.indexOf("/",t+1),s=i.indexOf(":"),n=/\s/.exec(i),a=i.indexOf("@"),c=!n||e>-1&&n.index>e,u=a===-1||e>-1&&a>e,l=s===-1||e>-1&&s>e,h=r===-1||e>-1&&r>e,f=t>0,p=e>-1?i[e-1]!=="/":!i.endsWith("/"),m=!i.startsWith(".");return c&&f&&p&&m&&u&&l&&h},"isGitHubShorthand");RT.exports=(i,e,{gitHosts:t,protocols:r})=>{if(!i)return;let s=HG(i)?`github:${i}`:i,n=zG(s,r);if(!n)return;let a=t.byShortcut[n.protocol],c=t.byDomain[n.hostname.startsWith("www.")?n.hostname.slice(4):n.hostname],u=a||c;if(!u)return;let l=t[a||c],h=null;r[n.protocol]?.auth&&(n.username||n.password)&&(h=`${n.username}${n.password?":"+n.password:""}`);let f=null,p=null,m=null,y=null;try{if(a){let g=n.pathname.startsWith("/")?n.pathname.slice(1):n.pathname,S=g.indexOf("@");S>-1&&(g=g.slice(S+1));let E=g.lastIndexOf("/");E>-1?(p=decodeURIComponent(g.slice(0,E)),p||(p=null),m=decodeURIComponent(g.slice(E+1))):m=decodeURIComponent(g),m.endsWith(".git")&&(m=m.slice(0,-4)),n.hash&&(f=decodeURIComponent(n.hash.slice(1))),y="shortcut"}else{if(!l.protocols.includes(n.protocol))return;let g=l.extract(n);if(!g)return;p=g.user&&decodeURIComponent(g.user),m=decodeURIComponent(g.project),f=decodeURIComponent(g.committish),y=r[n.protocol]?.name||n.protocol.slice(0,-1)}}catch(g){if(g instanceof URIError)return;throw g}return[u,p,h,m,f,y,e]}});var CT=d((Ade,TT)=>{"use strict";var{LRUCache:GG}=Pg(),WG=IT(),JG=AT(),KG=Kg(),Zg=new GG({max:1e3});function ZG(i){try{let{protocol:e,hostname:t,pathname:r}=new URL(i);if(!t)return null;let s=/(?:git\+)http:$/.test(e)?"http:":"https:",n=r.replace(/\.git$/,"");return`${s}//${t}${n}`}catch{return null}}o(ZG,"unknownHostedUrl");var Vl=class i{static{o(this,"GitHost")}constructor(e,t,r,s,n,a,c={}){Object.assign(this,i.#e[e],{type:e,user:t,auth:r,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){i.#e[e]=t,i.#e.byDomain[t.domain]=e,i.#e.byShortcut[`${e}:`]=e,i.#t[`${e}:`]={name:e}}static fromUrl(e,t){if(typeof e!="string")return;let r=e+JSON.stringify(t||{});if(!Zg.has(r)){let s=JG(e,t,{gitHosts:i.#e,protocols:i.#t});Zg.set(r,s?new i(...s):void 0)}return Zg.get(r)}static fromManifest(e,t={}){if(!e||typeof e!="object")return;let r=e.repository,s=r&&(typeof r=="string"?r:typeof r=="object"&&typeof r.url=="string"?r.url:null);if(!s)throw new Error("no repository");let n=s&&i.fromUrl(s.replace(/^git\+/,""),t)||null;if(n)return n;let a=ZG(s);return i.fromUrl(a,t)||a}static parseUrl(e){return KG(e)}#i(e,t){if(typeof e!="function")return null;let r={...this,...this.opts,...t};r.path||(r.path=""),r.path.startsWith("/")&&(r.path=r.path.slice(1)),r.noCommittish&&(r.committish=null);let s=e(r);return r.noGitPlus&&s.startsWith("git+")?s.slice(4):s}hash(){return this.committish?`#${this.committish}`:""}ssh(e){return this.#i(this.sshtemplate,e)}sshurl(e){return this.#i(this.sshurltemplate,e)}browse(e,...t){return typeof e!="string"?this.#i(this.browsetemplate,e):typeof t[0]!="string"?this.#i(this.browsetreetemplate,{...t[0],path:e}):this.#i(this.browsetreetemplate,{...t[1],fragment:t[0],path:e})}browseFile(e,...t){return typeof t[0]!="string"?this.#i(this.browseblobtemplate,{...t[0],path:e}):this.#i(this.browseblobtemplate,{...t[1],fragment:t[0],path:e})}docs(e){return this.#i(this.docstemplate,e)}bugs(e){return this.#i(this.bugstemplate,e)}https(e){return this.#i(this.httpstemplate,e)}git(e){return this.#i(this.gittemplate,e)}shortcut(e){return this.#i(this.shortcuttemplate,e)}path(e){return this.#i(this.pathtemplate,e)}tarball(e){return this.#i(this.tarballtemplate,{...e,noCommittish:!1})}file(e,t){return this.#i(this.filetemplate,{...t,path:e})}edit(e,t){return this.#i(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[i,e]of Object.entries(WG))Vl.addHost(i,e);TT.exports=Vl});var Yg=d((Cde,NT)=>{"use strict";var{builtinModules:YG}=require("module"),XG=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),QG=["node_modules","favicon.ico"];function eW(i){var e=[],t=[];if(i===null)return t.push("name cannot be null"),$a(e,t);if(i===void 0)return t.push("name cannot be undefined"),$a(e,t);if(typeof i!="string")return t.push("name must be a string"),$a(e,t);if(i.length||t.push("name length must be greater than zero"),i.startsWith(".")&&t.push("name cannot start with a period"),i.match(/^_/)&&t.push("name cannot start with an underscore"),i.trim()!==i&&t.push("name cannot contain leading or trailing spaces"),QG.forEach(function(a){i.toLowerCase()===a&&t.push(a+" is not a valid package name")}),YG.includes(i.toLowerCase())&&e.push(i+" is a core module name"),i.length>214&&e.push("name can no longer contain more than 214 characters"),i.toLowerCase()!==i&&e.push("name can no longer contain capital letters"),/[~'!()*]/.test(i.split("/").slice(-1)[0])&&e.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(i)!==i){var r=i.match(XG);if(r){var s=r[1],n=r[2];if(n.startsWith(".")&&t.push("name cannot start with a period"),encodeURIComponent(s)===s&&encodeURIComponent(n)===n)return $a(e,t)}t.push("name can only contain URL-friendly characters")}return $a(e,t)}o(eW,"validate");var $a=o(function(i,e){var t={validForNewPackages:e.length===0&&i.length===0,validForOldPackages:e.length===0,warnings:i,errors:e};return t.warnings.length||delete t.warnings,t.errors.length||delete t.errors,t},"done");NT.exports=eW});var UT=d((Pde,Ha)=>{"use strict";var za=process.platform==="win32",{URL:Xg}=require("node:url"),Sn=za?require("node:path/win32"):require("node:path"),{homedir:tW}=require("node:os"),iW=CT(),PT=ds(),MT=Yg(),{log:rW}=St(),BT=za?/\\|[/]/:/[/]/,kT=/^(?:git[+])?[a-z]+:/i,sW=/^[^@]+@[^:.]+\.[^:]+:.+$/i,ey=/[.](?:tgz|tar.gz|tar)$/i,nW=/:[0-9]+(\/|$)/i,oW=/^(?:[.]|~[/]|[/\\]|[a-zA-Z]:)/,aW=/^(?:[.]|~[/]|[/]|[a-zA-Z]:)/,DT="https://registry.npmjs.org";function qa(i,e){let t,r;if(typeof i=="object")return i instanceof Va&&(!e||e===i.where)?i:i.name&&i.rawSpec?qa.resolve(i.name,i.rawSpec,e||i.where):qa(i.raw,e||i.where);let s=i.indexOf("@",1),n=s>0?i.slice(0,s):i;return kT.test(i)?r=i:sW.test(i)?r=`git+ssh://${i}`:!n.startsWith("@")&&(BT.test(n)||ey.test(n))?r=i:s>0?(t=n,r=i.slice(s+1)||"*"):MT(i).validForOldPackages?(t=i,r="*"):r=i,FT(t,r,e,i)}o(qa,"npa");function cW(i){return i?i.toLowerCase().startsWith("file:")?!0:za?oW.test(i):aW.test(i):!1}o(cW,"isFileSpec");function uW(i){return i?i.toLowerCase().startsWith("npm:"):!1}o(uW,"isAliasSpec");function FT(i,e,t,r){let s=new Va({raw:r,name:i,rawSpec:e,fromArgument:r!=null});if(i&&(s.name=i),t||(t=process.cwd()),cW(e))return LT(s,t);if(uW(e))return SW(s,t);let n=iW.fromUrl(e,{noGitPlus:!0,noCommittish:!0});return n?mW(s,n):e&&kT.test(e)?yW(s):e&&(BT.test(e)||ey.test(e))?LT(s,t):EW(s)}o(FT,"resolve");function lW(i,e=DT){let t=qa(i);if(t.type!=="version")throw dW(t.type,t.raw);let r="pkg:npm/"+t.name.replace(/^@/,"%40")+"@"+t.rawSpec;return e!==DT&&(r+="?repository_url="+e),r}o(lW,"toPurl");function hW(i,e,t){let r=new Error(`Invalid package name "${i}" of package "${t}": ${e.errors.join("; ")}.`);return r.code="EINVALIDPACKAGENAME",r}o(hW,"invalidPackageName");function fW(i,e){let t=new Error(`Invalid tag name "${i}" of package "${e}": Tags may not have any characters that encodeURIComponent encodes.`);return t.code="EINVALIDTAGNAME",t}o(fW,"invalidTagName");function dW(i,e){let t=new Error(`Invalid type "${i}" of package "${e}": Purl can only be generated for "version" types.`);return t.code="EINVALIDPURLTYPE",t}o(dW,"invalidPurlType");var Va=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=MT(e);if(!t.validForOldPackages)throw hW(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 Qg(i,e){if(!e){i.gitCommittish=null;return}for(let t of e.split("::")){if(!t.includes(":")){if(i.gitRange)throw new Error("cannot override existing semver range with a committish");if(i.gitCommittish)throw new Error("cannot override existing committish with a second committish");i.gitCommittish=t;continue}let[r,s]=t.split(":");if(r==="semver"){if(i.gitCommittish)throw new Error("cannot override existing committish with a semver range");if(i.gitRange)throw new Error("cannot override existing semver range with a second semver range");i.gitRange=decodeURIComponent(s);continue}if(r==="path"){if(i.gitSubdir)throw new Error("cannot override existing path with a second path");i.gitSubdir=`/${s}`;continue}rW.warn("npm-package-arg",`ignoring unknown key "${r}"`)}}o(Qg,"setGitAttrs");var pW=new Map([["\0","%00"],[" ","%09"],[`
14
+ `,"%0A"],["\r","%0D"],[" ","%20"],['"',"%22"],["#","%23"],["%","%25"],["?","%3F"],["[","%5B"],["\\",za?"/":"%5C"],["]","%5D"],["^","%5E"],["|","%7C"],["~","%7E"]]);function xT(i){let e="";for(let t=0;t<i.length;t++)e=`${e}${pW.get(i[t])??i[t]}`;return e.startsWith("file:")?e:`file:${e}`}o(xT,"pathToFileURL");function LT(i,e){i.type=ey.test(i.rawSpec)?"file":"directory",i.where=e;let t=xT(i.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 r,s;try{r=new Xg(t,`${xT(Sn.resolve(e))}/`),s=new Xg(t)}catch(c){let u=new Error("Invalid file: URL, must comply with RFC 8089");throw Object.assign(u,{raw:i.rawSpec,spec:i,where:e,originalError:c})}let n=decodeURIComponent(s.pathname),a=decodeURIComponent(r.pathname);return za&&(n=n.replace(/^\/+([a-z]:\/)/i,"$1"),a=a.replace(/^\/+([a-z]:\/)/i,"$1")),/^\/~(\/|$)/.test(n)?(i.saveSpec=`file:${n.substr(1)}`,a=Sn.resolve(tW(),n.substr(3))):Sn.isAbsolute(t.slice(5))?i.saveSpec=`file:${Sn.resolve(a)}`:i.saveSpec=`file:${Sn.relative(e,a)}`,i.fetchSpec=Sn.resolve(e,a),i.saveSpec=i.saveSpec.split("\\").join("/"),i.saveSpec.startsWith("file://")&&(i.saveSpec=`file:/${i.saveSpec.slice(7)}`),i}o(LT,"fromFile");function mW(i,e){return i.type="git",i.hosted=e,i.saveSpec=e.toString({noGitPlus:!1,noCommittish:!1}),i.fetchSpec=e.getDefaultRepresentation()==="shortcut"?null:e.toString(),Qg(i,e.committish),i}o(mW,"fromHostedGit");function gW(i,e){let t=new Error(`Unsupported URL Type "${i}": ${e}`);return t.code="EUNSUPPORTEDPROTOCOL",t}o(gW,"unsupportedURLType");function yW(i){let e=i.rawSpec;if(i.saveSpec=e,e.startsWith("git+ssh:")){let r=e.match(/^git\+ssh:\/\/([^:#]+:[^#]+(?:\.git)?)(?:#(.*))?$/i);if(r&&!r[1].match(nW))return i.type="git",Qg(i,r[2]),i.fetchSpec=r[1],i}else e.startsWith("git+file://")&&(e=e.replace(/\\/g,"/"));let t=new Xg(e);switch(t.protocol){case"git:":case"git+http:":case"git+https:":case"git+rsync:":case"git+ftp:":case"git+file:":case"git+ssh:":i.type="git",Qg(i,t.hash.slice(1)),t.protocol==="git+file:"&&/^git\+file:\/\/[a-z]:/i.test(e)?i.fetchSpec=`git+file://${t.host.toLowerCase()}:${t.pathname}`:(t.hash="",i.fetchSpec=t.toString()),i.fetchSpec.startsWith("git+")&&(i.fetchSpec=i.fetchSpec.slice(4));break;case"http:":case"https:":i.type="remote",i.fetchSpec=i.saveSpec;break;default:throw gW(t.protocol,e)}return i}o(yW,"fromURL");function SW(i,e){let t=qa(i.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 i.subSpec=t,i.registry=!0,i.type="alias",i.saveSpec=null,i.fetchSpec=null,i}o(SW,"fromAlias");function EW(i){i.registry=!0;let e=i.rawSpec.trim();i.saveSpec=null,i.fetchSpec=e;let t=PT.valid(e,!0),r=PT.validRange(e,!0);if(t)i.type="version";else if(r)i.type="range";else{if(encodeURIComponent(e)!==e)throw fW(e,i.raw);i.type="tag"}return i}o(EW,"fromRegistry");Ha.exports=qa;Ha.exports.resolve=FT;Ha.exports.toPurl=lW;Ha.exports.Result=Va});var zT=d((xde,VT)=>{var ps=require("node:process"),wW=require("node:os"),_W=require("node:fs");function bW(i){return i.includes("libc.musl-")||i.includes("ld-musl-")}o(bW,"isMusl");function jT(){return ps.platform}o(jT,"os");function $T(){return ps.arch}o($T,"cpu");var IW="/usr/bin/ldd";function OW(){try{let i=_W.readFileSync(IW,"utf-8");return i.includes("musl")?"musl":i.includes("GNU C Library")?"glibc":null}catch{return}}o(OW,"getFamilyFromFilesystem");function vW(){let i=ps.report.excludeNetwork;ps.report.excludeNetwork=!0;let e=ps.report.getReport();return ps.report.excludeNetwork=i,e.header?.glibcVersionRuntime?Ui="glibc":Array.isArray(e.sharedObjects)&&e.sharedObjects.some(bW)?Ui="musl":Ui=null,Ui}o(vW,"getFamilyFromReport");var Ui;function qT(i){if(i==="linux")return Ui===void 0&&(Ui=OW(),Ui===void 0&&(Ui=vW())),Ui}o(qT,"libc");function RW(i={}){let e=i.os||jT();return{cpu:{name:i.cpu||$T()},libc:{name:i.libc||qT(e)},os:{name:e,version:i.osVersion||wW.release()},packageManager:{name:"npm",version:i.npmVersion},runtime:{name:"node",version:i.nodeVersion||ps.version}}}o(RW,"devEngines");VT.exports={cpu:$T,libc:qT,os:jT,devEngines:RW}});var GT=d((Mde,HT)=>{var AW=yn(),TW=qg(),CW=["ignore","warn","error","download"],NW=["name","version","onFail"],PW=["packageManager","runtime","cpu","libc","os"];function DW(i,e,t){let{engine:r}=t;if(typeof i!="object"||i===null||Array.isArray(i))throw new Error(`Invalid non-object value for "${r}"`);let s=Object.keys(i);for(let n of s)if(!NW.includes(n))throw new Error(`Invalid property "${n}" for "${r}"`);if(!s.includes("name"))throw new Error(`Missing "name" property for "${r}"`);if(typeof i.name!="string")throw new Error(`Invalid non-string value for "name" within "${r}"`);if(typeof e.name!="string"||e.name==="")throw new Error(`Unable to determine "name" for "${r}"`);if(s.includes("onFail")){if(typeof i.onFail!="string")throw new Error(`Invalid non-string value for "onFail" within "${r}"`);if(!CW.includes(i.onFail))throw new Error(`Invalid onFail value "${i.onFail}" for "${r}"`)}if(i.name!==e.name)return new Error(`Invalid name "${i.name}" does not match "${e.name}" for "${r}"`);if(s.includes("version")){if(typeof i.version!="string")throw new Error(`Invalid non-string value for "version" within "${r}"`);if(typeof e.version!="string"||e.version==="")throw new Error(`Unable to determine "version" for "${r}" "${i.name}"`);if(TW(i.version)){if(!AW(e.version,i.version,t.semver))return new Error(`Invalid semver version "${i.version}" does not match "${e.version}" for "${r}"`)}else if(i.version!==e.version)return new Error(`Invalid version "${i.version}" does not match "${e.version}" for "${r}"`)}}o(DW,"checkDependency");function xW(i,e={},t={}){if(typeof i!="object"||i===null||Array.isArray(i))throw new Error('Invalid non-object value for "devEngines"');let r=[];for(let s of Object.keys(i)){if(!PW.includes(s))throw new Error(`Invalid property "devEngines.${s}"`);let n=i[s],a=[n].flat(),c=e[s]||{};if(a.length===0)continue;let u=[];for(let h of a){let f=DW(h,c,{...t,engine:s});f&&u.push(f)}if(u.length===a.length){let f=a[a.length-1].onFail||"error";f==="download"&&(f="error");let p=Object.assign(new Error(`Invalid devEngines.${s}`),{errors:u,engine:s,isWarn:f==="warn",isError:f==="error",current:c,required:n});r.push(p)}}return r}o(xW,"checkDevEngines");HT.exports={checkDevEngines:xW}});var KT=d((kde,JT)=>{var WT=ds(),zl=zT(),{checkDevEngines:LW}=GT(),MW=o((i,e,t,r=!1)=>{let s=r?null:t,n=i.engines,a={includePrerelease:!0};if(!n)return;let c=s&&n.node&&!WT.satisfies(s,n.node,a),u=e&&n.npm&&!WT.satisfies(e,n.npm,a);if(c||u)throw Object.assign(new Error("Unsupported engine"),{pkgid:i._id,current:{node:t,npm:e},required:n,code:"EBADENGINE"})},"checkEngine"),BW=o((i,e=!1,t={})=>{if(e)return;let r=t.os||zl.os(),s=t.cpu||zl.cpu(),n=t.libc||zl.libc(r),a=i.os?ty(r,i.os):!0,c=i.cpu?ty(s,i.cpu):!0,u=i.libc?ty(n,i.libc):!0;if(i.libc&&!n&&(u=!1),!a||!c||!u)throw Object.assign(new Error("Unsupported platform"),{pkgid:i._id,current:{os:r,cpu:s,libc:n},required:{os:i.os,cpu:i.cpu,libc:i.libc},code:"EBADPLATFORM"})},"checkPlatform"),ty=o((i,e)=>{if(typeof e=="string"&&(e=[e]),e.length===1&&e[0]==="any")return!0;let t=0,r=!1;for(let s of e){let n=s.charAt(0)==="!",a=n?s.slice(1):s;if(n){if(t++,i===a)return!1}else r=r||i===a}return r||t===e.length},"checkList");JT.exports={checkEngine:MW,checkPlatform:BW,checkDevEngines:LW,currentEnv:zl}});var Hl=d((Ude,XT)=>{var{join:ZT,basename:YT}=require("path"),kW=o(i=>i.bin?typeof i.bin=="string"?FW(i):Array.isArray(i.bin)?UW(i):typeof i.bin=="object"?ry(i):iy(i):iy(i),"normalize"),FW=o(i=>i.name?(i.bin={[i.name]:i.bin},ry(i)):iy(i),"normalizeString"),UW=o(i=>(i.bin=i.bin.reduce((e,t)=>(e[YT(t)]=t,e),{}),ry(i)),"normalizeArray"),iy=o(i=>(delete i.bin,i),"removeBin"),ry=o(i=>{let e=i.bin,t={},r=!1;return Object.keys(e).forEach(s=>{let n=ZT("/",YT(s.replace(/\\|:/g,"/"))).slice(1);if(typeof e[s]!="string"||!n)return;let a=ZT("/",e[s].replace(/\\/g,"/")).replace(/\\/g,"/").slice(1);a&&(t[n]=a,r=!0)}),r?i.bin=t:delete i.bin,i},"normalizeObject");XT.exports=kW});var Jl=d(($de,eC)=>{"use strict";var QT=UT(),Ga=ds(),{checkEngine:jW}=KT(),$W=Hl(),sy=o((i,e,t)=>{try{return jW(i,e,t),!0}catch{return!1}},"engineOk"),Gl=o((i,e,t)=>!i||!i[e]||Date.parse(i[e])<=t,"isBefore"),qW={includePrerelease:!0,loose:!0},Wl=o((i,e)=>e&&Ga.satisfies(i,e,qW),"shouldAvoid"),ny=o((i,e)=>i&&Wl(i.version,e)?{...i,_shouldAvoid:!0}:i,"decorateAvoid"),Wa=o((i,e,t)=>{let{defaultTag:r="latest",before:s=null,nodeVersion:n=process.version,npmVersion:a=null,includeStaged:c=!1,avoid:u=null,avoidStrict:l=!1}=t,{name:h,time:f}=i,p=i.versions||{};if(l){let P={...t,avoidStrict:!1},$=Wa(i,e,P);if(!$||!$._shouldAvoid)return $;let ee=Wa(i,`^${$.version}`,P);if(!ee||!ee._shouldAvoid)return{...ee,_outsideDependencyRange:!0,_isSemVerMajor:!1};let ti=Wa(i,"*",P);if(!ti||!ti._shouldAvoid)return{...ti,_outsideDependencyRange:!0,_isSemVerMajor:!0};throw Object.assign(new Error(`No avoidable versions for ${h}`),{code:"ETARGET",name:h,wanted:e,avoid:u,before:s,versions:Object.keys(p)})}let m=c&&i.stagedVersions&&i.stagedVersions.versions||{},y=i.policyRestrictions&&i.policyRestrictions.versions||{},g=s&&f?+new Date(s):1/0,E=QT.resolve(h,e||r).type,_=i["dist-tags"]||{};if(E!=="tag"&&E!=="version"&&E!=="range")throw new Error("Only tag, version, and range are supported");if(e&&E==="tag"){let P=_[e];return Gl(f,P,g)?ny(p[P]||m[P]||y[P],u):Wa(i,`<=${P}`,t)}if(e&&E==="version"){let P=Ga.clean(e,{loose:!0}),$=p[P]||m[P]||y[P];return Gl(f,P,g)?ny($,u):null}let b=E==="range"?e:"*",w=_[r];if(w&&(b==="*"||Ga.satisfies(w,b,{loose:!0}))&&!y[w]&&!Wl(w,u)){let P=p[w];if(P&&Gl(f,w,g)&&sy(P,a,n)&&!P.deprecated&&!m[w])return P}let I=Object.entries(p).concat(Object.entries(m)).concat(Object.entries(y)).filter(([P])=>Gl(f,P,g));if(!I.length)throw Object.assign(new Error(`No versions available for ${h}`),{code:"ENOVERSIONS",name:h,type:E,wanted:e,before:s,versions:Object.keys(p)});let v={loose:!0},N=I.filter(([P])=>Ga.satisfies(P,b,{loose:!0})).sort((P,$)=>{let[ee,ti]=P,[ss,oa]=$,Mu=!Wl(ee,u),Bu=!Wl(ss,u),ku=!y[ee],Fu=!y[ss],Uu=!m[ee],ju=!m[ss],aa=!ti.deprecated,ca=!oa.deprecated,ua=sy(ti,a,n),la=sy(oa,a,n);return Bu-Mu||Fu-ku||ju-Uu||(ca&&la)-(aa&&ua)||la-ua||ca-aa||Ga.rcompare(ee,ss,v)});return ny(N[0]&&N[0][1],u)},"pickManifest");eC.exports=(i,e,t={})=>{let r=Wa(i,e,t),s=r&&$W(r),n=i.policyRestrictions,a=n&&n.versions||{};if(s&&!a[s.version])return s;let{before:c=null,defaultTag:u="latest"}=t,l=c?new Date(c).toLocaleString():"",{name:h}=i,f=`${h}@${e}`+(c?` with a date before ${l}`:""),p=s&&!!a[s.version],m=p?n.message:"",y=p?`Could not download ${f} due to policy violations:
15
+ ${m}`:`No matching version found for ${f}.`,g=p?"E403":"ETARGET";throw Object.assign(new Error(y),{code:g,type:QT.resolve(i.name,e).type,wanted:e,versions:Object.keys(i.versions??{}),name:h,distTags:i["dist-tags"],defaultTag:u})}});var sC=d((Vde,rC)=>{var VW=new Set(["github.com","gist.github.com","gitlab.com","bitbucket.com","bitbucket.org"]),{parse:zW}=require("url"),tC=require("path"),HW=Wg(),Ja=Ba(),{isWindows:Kl}=wT(),GW=Jl(),oy=require("fs/promises");rC.exports=(i,e="HEAD",t=null,r={})=>HW(i,r).then(s=>JW(i,s,e,KW(s,e,r),t||WW(i,r.cwd),r));var ay=o((i,e)=>e.gitShallow===!1||e.gitShallow?e.gitShallow:VW.has(zW(i).host),"maybeShallow"),WW=o((i,e=process.cwd())=>tC.resolve(e,tC.basename(i.replace(/[/\\]?\.git$/,""))),"defaultTarget"),JW=o((i,e,t,r,s,n)=>r?r.sha===e.refs.HEAD.sha?XW(i,r,s,n):r.type==="tag"||r.type==="branch"?YW(i,r,s,n):ZW(i,r,s,n):QW(i,t,s,n),"clone"),KW=o((i,e,t)=>{let{spec:r={}}=t;return e=r.gitCommittish||e,i?r.gitRange?GW(i,r.gitRange,t):e?i.refs[e]?i.refs[e]:i.shas[e]?i.refs[i.shas[e][0]]:null:i.refs.HEAD:null},"resolveRef"),ZW=o((i,e,t,r)=>{let s=ay(i,r),n=["fetch","origin",e.rawRef].concat(s?["--depth=1"]:[]),a=o(c=>Ja(c,{...r,cwd:t}),"git");return oy.mkdir(t,{recursive:!0}).then(()=>a(["init"])).then(()=>Kl(r)?a(["config","--local","--add","core.longpaths","true"]):null).then(()=>a(["remote","add","origin",i])).then(()=>a(n)).then(()=>a(["checkout",e.sha])).then(()=>iC(t,r)).then(()=>e.sha)},"other"),YW=o((i,e,t,r)=>{let s=["clone","-b",e.ref,i,t,"--recurse-submodules"];return ay(i,r)&&s.push("--depth=1"),Kl(r)&&s.push("--config","core.longpaths=true"),Ja(s,r).then(()=>e.sha)},"branch"),XW=o((i,e,t,r)=>{let s=["clone",i,t,"--recurse-submodules"];return ay(i,r)&&s.push("--depth=1"),Kl(r)&&s.push("--config","core.longpaths=true"),Ja(s,r).then(()=>e.sha)},"plain"),iC=o(async(i,e)=>await oy.stat(`${i}/.gitmodules`).then(()=>!0).catch(()=>!1)?Ja(["submodule","update","-q","--init","--recursive"],{...e,cwd:i}):null,"updateSubmodules"),QW=o((i,e,t,r)=>{let s=Kl(r)?["--config","core.longpaths=true"]:[],n=["clone","--mirror","-q",i,t+"/.git"],a=o(c=>Ja(c,{...r,cwd:t}),"git");return oy.mkdir(t,{recursive:!0}).then(()=>a(n.concat(s))).then(()=>a(["init"])).then(()=>a(["checkout",e])).then(()=>iC(t,r)).then(()=>a(["rev-parse","--revs-only","HEAD"])).then(({stdout:c})=>c.trim())},"unresolved")});var cy=d((Hde,nC)=>{var{stat:e5}=require("fs/promises");nC.exports=({cwd:i=process.cwd()}={})=>e5(i+"/.git").then(()=>!0,()=>!1)});var aC=d((Gde,oC)=>{var t5=cy(),{dirname:i5}=require("path");oC.exports=async({cwd:i=process.cwd(),root:e}={})=>{for(;;){if(await t5({cwd:i}))return i;let t=i5(i);if(i===e||i===t)return null;i=t}}});var uC=d((Wde,cC)=>{var r5=Ba();cC.exports=(i={})=>r5(["status","--porcelain=v1","-uno"],i).then(e=>!e.stdout.trim().split(/\r?\n+/).map(t=>t.trim()).filter(t=>t).length)});var uy=d((Jde,lC)=>{lC.exports={clone:sC(),revs:Wg(),spawn:Ba(),is:cy(),find:aC(),isClean:uC(),errors:Ig()}});var gC=d((Kde,mC)=>{var s5=Tm(),n5=Cm(),Sr=require("node:fs/promises"),oe=require("node:path"),{log:dC}=St(),o5=require("node:module"),ly;function hC(){return ly||(ly=Xu()),ly}o(hC,"lazyHostedGitInfo");var hy;function Zl(){return hy||(hy=hg().glob),hy}o(Zl,"lazyLoadGlob");function a5(i,e){if(i.bin&&(typeof i.bin=="string"&&i.name?(e?.push('"bin" was converted to an object'),i.bin={[i.name]:i.bin}):Array.isArray(i.bin)&&(e?.push('"bin" was converted to an object'),i.bin=i.bin.reduce((t,r)=>(t[oe.basename(r)]=r,t),{})),typeof i.bin=="object")){for(let t in i.bin){if(typeof i.bin[t]!="string"){delete i.bin[t],e?.push(`removed invalid "bin[${t}]"`);continue}let r=oe.basename(En(t));if(!r){delete i.bin[t],e?.push(`removed invalid "bin[${t}]"`);continue}let s=En(i.bin[t]);if(!s){delete i.bin[t],e?.push(`removed invalid "bin[${t}]"`);continue}r!==t&&(delete i.bin[t],e?.push(`"bin[${t}]" was renamed to "bin[${r}]"`)),s!==i.bin[t]&&e?.push(`"bin[${r}]" script name ${s} was invalid and removed`),i.bin[r]=s}return Object.keys(i.bin).length===0&&(e?.push('empty "bin" was removed'),delete i.bin),i}delete i.bin}o(a5,"normalizePackageBin");function c5(i,e){if(i.man){let t=[];for(let r of Array.isArray(i.man)?i.man:[i.man])typeof r!="string"?e?.push(`removed invalid "man [${r}]"`):t.push(En(r));if(!t.length)e?.push('empty "man" was removed');else return i.man=t,i}delete i.man}o(c5,"normalizePackageMan");function u5(i){return!i.match(/[/@\s+%:]/)&&i===encodeURIComponent(i)}o(u5,"isCorrectlyEncodedName");function l5(i){if(i.charAt(0)!=="@")return!1;let e=i.slice(1).split("/");return e.length!==2?!1:e[0]&&e[1]&&e[0]===encodeURIComponent(e[0])&&e[1]===encodeURIComponent(e[1])}o(l5,"isValidScopedPackageName");function fC(i){return i.replace(/\\|:/g,"/")}o(fC,"unixifyPath");function En(i){let e=fC(oe.join(".",oe.join("/",fC(i))));return e.startsWith("./")?"":e}o(En,"secureAndUnixifyPath");function pC(i,{strict:e,steps:t,changes:r,allowLegacyCase:s}){let n=i.content,a=`${n.name??""}@${n.version??""}`;if(t.includes("fixName")||t.includes("fixNameField")||t.includes("normalizeData"))if(!n.name&&!e)r?.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&&(r?.push('Whitespace was trimmed from "name"'),n.name=c)}if(n.name.startsWith(".")||!(l5(n.name)||u5(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")&&o5.builtinModules.includes(n.name)&&dC.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(!s5(n.version,c))throw new Error(`Invalid version: "${n.version}"`);let u=n5(n.version,c);u!==n.version&&(r?.push(`"version" was cleaned and set to "${u}"`),n.version=u)}}if(t.includes("_attributes"))for(let c in n)c.startsWith("_")&&(r?.push(`"${c}" was removed`),delete i.content[c]);if(t.includes("_id")&&n.name&&n.version&&(r?.push(`"_id" was set to ${a}`),n._id=a),t.includes("bundledDependencies")&&(n.bundleDependencies===void 0&&n.bundledDependencies!==void 0&&(n.bundleDependencies=n.bundledDependencies,r?.push('Deleted incorrect "bundledDependencies"')),delete n.bundledDependencies),t.includes("bundleDependencies")){let c=n.bundleDependencies;c===!1&&!t.includes("bundleDependenciesDeleteFalse")?(r?.push('"bundleDependencies" was changed from "false" to "[]"'),n.bundleDependencies=[]):c===!0?(r?.push('"bundleDependencies" was auto-populated from "dependencies"'),n.bundleDependencies=Object.keys(n.dependencies||{})):c&&typeof c=="object"?Array.isArray(c)||(r?.push('"bundleDependencies" was changed from an object to an array'),n.bundleDependencies=Object.keys(c)):"bundleDependencies"in n&&(r?.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)r?.push(`optionalDependencies."${c}" was removed`),delete n.dependencies[c];Object.keys(n.dependencies).length||(r?.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 u in n.scripts)typeof n.scripts[u]!="string"?(delete n.scripts[u],r?.push(`Invalid scripts."${u}" was removed`)):t.includes("scriptpath")&&c.test(n.scripts[u])&&(n.scripts[u]=n.scripts[u].replace(c,""),r?.push(`scripts entry "${u}" was fixed to remove node_modules/.bin reference`));else r?.push('Removed invalid "scripts"'),delete n.scripts}if(t.includes("funding")&&n.funding&&typeof n.funding=="string"&&(n.funding={url:n.funding},r?.push('"funding" was changed to an object with a url attribute')),(t.includes("fixRepositoryField")||t.includes("normalizeData"))&&(n.repositories&&(r?.push(`"repository" was set to the first entry in "repositories" (${n.repository})`),n.repository=n.repositories[0]),n.repository&&(typeof n.repository=="string"&&(r?.push('"repository" was changed from a string to an object'),n.repository={type:"git",url:n.repository}),n.repository.url))){let c=hC().fromUrl(n.repository.url),u;c&&(c.getDefaultRepresentation()==="shortcut"?u=c.https():u=c.toString(),u!==n.repository.url&&(r?.push(`"repository.url" was normalized to "${u}"`),n.repository.url=u))}if(t.includes("fixDependencies")||t.includes("normalizeData")){for(let c of["dependencies","devDependencies","optionalDependencies"])if(n[c]){let u=!0;if(typeof n[c]=="string"&&(r?.push(`"${c}" was converted from a string into an object`),n[c]=n[c].trim().split(/[\n\r\s\t ,]+/),u=!1),Array.isArray(n[c])){u&&r?.push(`"${c}" was converted from an array into an object`);let l={};for(let h of n[c])if(typeof h=="string"){let f=h.trim().split(/(:?[@\s><=])/),p=f.shift(),m=f.join("").replace(/^@/,"").trim();l[p]=m}n[c]=l}}for(let c of["dependencies","devDependencies"])if(c in n)if(!n[c]||typeof n[c]!="object")r?.push(`Removed invalid "${c}"`),delete n[c];else for(let u in n[c]){typeof n[c][u]!="string"&&(r?.push(`Removed invalid "${c}.${u}"`),delete n[c][u]);let h=hC().fromUrl(n[c][u])?.toString();h&&h!==n[c][u]&&(r?.push(`Normalized git reference to "${c}.${u}"`),n[c][u]=h.toString())}}if(t.includes("normalizeData")){let{normalizeData:c}=Uv();c(n,r)}}o(pC,"syncSteps");async function h5(i,{steps:e,root:t,changes:r}){let s=i.content,n=s.scripts||{},a=`${s.name??""}@${s.version??""}`;if(e.includes("gypfile")&&!n.install&&!n.preinstall&&s.gypfile!==!1&&(await Zl()("*.gyp",{cwd:i.path})).length&&(n.install="node-gyp rebuild",s.scripts=n,s.gypfile=!0,r?.push('"scripts.install" was set to "node-gyp rebuild"'),r?.push('"gypfile" was set to "true"')),e.includes("serverjs")&&!n.start)try{await Sr.access(oe.join(i.path,"server.js")),n.start="node server.js",s.scripts=n,r?.push('"scripts.start" was set to "node server.js"')}catch{}if(e.includes("authors")&&!s.contributors)try{let u=(await Sr.readFile(oe.join(i.path,"AUTHORS"),"utf8")).split(/\r?\n/g).map(l=>l.replace(/^\s*#.*$/,"").trim()).filter(l=>l);s.contributors=u,r?.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,u=await Zl()("{README,README.*}",{cwd:i.path,nocase:!0,mark:!0}),l;for(let h of u)if(!h.endsWith(oe.sep)){if(h.match(c)){l=h;break}h.endsWith("README")&&(l=h)}if(l){let h=await Sr.readFile(oe.join(i.path,l),"utf8");s.readme=h,s.readmeFilename=l,r?.push(`"readme" was set to the contents of ${l}`),r?.push(`"readmeFilename" was set to ${l}`)}s.readme||(s.readme="ERROR: No README data found!")}if(e.includes("mans")){if(s.directories?.man&&!s.man){let c=En(s.directories.man),u=oe.resolve(i.path,c),l=await Zl()("**/*.[0-9]",{cwd:u});s.man=l.map(h=>oe.relative(i.path,oe.join(u,h)).split(oe.sep).join("/"))}c5(s,r)}if(e.includes("binDir")&&s.directories?.bin&&!s.bin){let c=En(s.directories.bin),u=await Zl()("**",{cwd:oe.resolve(i.path,c)});s.bin=u.reduce((l,h)=>{if(h&&!h.startsWith(".")){let f=oe.basename(h);l[f]=`${c}/${En(h)}`}return l},{})}else(e.includes("bin")||e.includes("binDir")||e.includes("binRefs"))&&a5(s,r);if(e.includes("gitHead")&&!s.gitHead){let u=await uy().find({cwd:i.path,root:t}),l;if(u)try{l=await Sr.readFile(oe.resolve(u,".git/HEAD"),"utf8")}catch{}let h;if(l)if(l.startsWith("ref: ")){let f=l.replace(/^ref: /,"").trim(),p=oe.resolve(u,".git",f);try{h=await Sr.readFile(p,"utf8"),h=h.replace(/^ref: /,"").trim()}catch{}if(!h){let m=oe.resolve(u,".git/packed-refs");try{let y=await Sr.readFile(m,"utf8");if(y){y=y.split(`
16
+ `);for(let g=0;g<y.length;g++){let S=y[g].match(/^([0-9a-f]{40}) (.+)$/);if(S&&S[2].trim()===f){h=S[1];break}}}}catch{}}}else h=l.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 l=`./${oe.join(oe.dirname(c),oe.basename(c,oe.extname(c)))}.d.ts`;if(!("types"in s||"typings"in s))try{await Sr.access(oe.join(i.path,l)),s.types=l.split(oe.sep).join("/")}catch{}}if(e.includes("binRefs")&&s.bin instanceof Object)for(let c in s.bin)try{await Sr.access(oe.resolve(i.path,s.bin[c]))}catch{dC.warn("package-json",a,`No bin file found at ${s.bin[c]}`)}}o(h5,"asyncSteps");async function f5(i,e){if(!i.content)throw new Error("Can not normalize without content");await h5(i,e),pC(i,e)}o(f5,"normalize");function d5(i,e){pC(i,e)}o(d5,"syncNormalize");mC.exports={normalize:f5,syncNormalize:d5}});var wC=d((Yde,EC)=>{var{readFile:p5}=require("fs/promises"),m5=bm();async function yC(i){try{return await p5(i,"utf8")}catch(e){throw e.message=`Could not read package.json: ${e}`,e}}o(yC,"read");function SC(i){try{return m5(i)}catch(e){throw e.message=`Invalid package.json: ${e}`,e}}o(SC,"parse");async function g5(i){let e=await yC(i);return SC(e)}o(g5,"readPackage");EC.exports={read:yC,parse:SC,readPackage:g5}});var bC=d((Qde,_C)=>{function y5(i){let{name:e,version:t,private:r,description:s,keywords:n,homepage:a,bugs:c,repository:u,funding:l,license:h,author:f,maintainers:p,contributors:m,type:y,imports:g,exports:S,main:E,browser:_,types:b,bin:w,man:I,directories:v,files:N,workspaces:P,scripts:$,config:ee,dependencies:ti,devDependencies:ss,peerDependencies:oa,peerDependenciesMeta:Mu,optionalDependencies:Bu,bundledDependencies:ku,bundleDependencies:Fu,engines:Uu,os:ju,cpu:aa,publishConfig:ca,devEngines:ua,licenses:la,overrides:LI,...Lj}=i;return{...typeof e<"u"?{name:e}:{},...typeof t<"u"?{version:t}:{},...typeof r<"u"?{private:r}:{},...typeof s<"u"?{description:s}:{},...typeof n<"u"?{keywords:n}:{},...typeof a<"u"?{homepage:a}:{},...typeof c<"u"?{bugs:c}:{},...typeof u<"u"?{repository:u}:{},...typeof l<"u"?{funding:l}:{},...typeof h<"u"?{license:h}:{},...typeof f<"u"?{author:f}:{},...typeof p<"u"?{maintainers:p}:{},...typeof m<"u"?{contributors:m}:{},...typeof y<"u"?{type:y}:{},...typeof g<"u"?{imports:g}:{},...typeof S<"u"?{exports:S}:{},...typeof E<"u"?{main:E}:{},...typeof _<"u"?{browser:_}:{},...typeof b<"u"?{types:b}:{},...typeof w<"u"?{bin:w}:{},...typeof I<"u"?{man:I}:{},...typeof v<"u"?{directories:v}:{},...typeof N<"u"?{files:N}:{},...typeof P<"u"?{workspaces:P}:{},...typeof $<"u"?{scripts:$}:{},...typeof ee<"u"?{config:ee}:{},...typeof ti<"u"?{dependencies:ti}:{},...typeof ss<"u"?{devDependencies:ss}:{},...typeof oa<"u"?{peerDependencies:oa}:{},...typeof Mu<"u"?{peerDependenciesMeta:Mu}:{},...typeof Bu<"u"?{optionalDependencies:Bu}:{},...typeof ku<"u"?{bundledDependencies:ku}:{},...typeof Fu<"u"?{bundleDependencies:Fu}:{},...typeof Uu<"u"?{engines:Uu}:{},...typeof ju<"u"?{os:ju}:{},...typeof aa<"u"?{cpu:aa}:{},...typeof ca<"u"?{publishConfig:ca}:{},...typeof ua<"u"?{devEngines:ua}:{},...typeof la<"u"?{licenses:la}:{},...typeof LI<"u"?{overrides:LI}:{},...Lj}}o(y5,"packageSort");_C.exports={packageSort:y5}});var Yl=d((tpe,vC)=>{var{readFile:S5,writeFile:E5}=require("node:fs/promises"),{resolve:IC}=require("node:path"),w5=bm(),OC=$I(),_5=VI(),b5=HI(),{normalize:fy,syncNormalize:I5}=gC(),{read:O5,parse:v5}=wC(),{packageSort:R5}=bC(),A5=new Set([OC,_5,b5]),T5=new Set([...OC.knownKeys,"scripts","workspaces"]),dy=class i{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 r=new i;return await r.create(e),t.data?r.update(t.data):r}static async load(e,t={}){let r=new i;if(!t.create)return r.load(e);try{return await r.load(e)}catch(s){if(!s.message.startsWith("Could not read package.json"))throw s;return await r.create(e)}}static async fix(e,t){let r=new i;return await r.load(e,!0),r.fix(t)}static async prepare(e,t){let r=new i;return await r.load(e,!0),r.prepare(t)}static async normalize(e,t){let r=new i;return await r.load(e),r.normalize(t)}#e;#t;#i="";#r=!0;async load(e,t){this.#e=e;let r;try{this.#i=await O5(this.filename)}catch(s){if(!t)throw s;r=s}if(r){let s=IC(this.path,"index.js"),n;try{n=await S5(s,"utf8")}catch{throw r}try{this.fromComment(n)}catch{throw r}return this.#r=!1,this}return this.fromJSON(this.#i)}fromJSON(e){return this.#t=v5(e),this}fromContent(e){if(!e||typeof e!="object")throw new Error("Content data must be an object");return this.#t=e,this.#r=!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=w5(e),this}get content(){return this.#t}get path(){return this.#e}get filename(){if(this.path)return IC(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 A5)this.#t=t({content:e,originalContent:this.content});for(let[t,r]of Object.entries(e))T5.has(t)||(this.content[t]=r);return this}async save({sort:e}={}){if(!this.#r)throw new Error("No package.json to save to");let{[Symbol.for("indent")]:t,[Symbol.for("newline")]:r,...s}=this.content,n=t===void 0?" ":t,a=r===void 0?`
17
+ `:r,c=e?R5(s):s,u=`${JSON.stringify(c,null,n)}
18
+ `.replace(/\n/g,a);if(u.trim()!==this.#i.trim()){let l=await E5(this.filename,u);return this.#i=u,l}}syncNormalize(e={}){return e.steps=this.constructor.normalizeSteps.filter(t=>t!=="_attributes"),I5(this,e),this}async normalize(e={}){return e.steps||(e.steps=this.constructor.normalizeSteps),await fy(this,e),this}async prepare(e={}){return e.steps||(e.steps=this.constructor.prepareSteps),await fy(this,e),this}async fix(e={}){return e.steps=this.constructor.fixSteps,await fy(this,e),this}};vC.exports=dy});var yy=d((rpe,gy)=>{var{Minipass:RC}=te(),wn=Symbol("_data"),_n=Symbol("_length"),py=class extends RC{static{o(this,"Collect")}constructor(e){super(e),this[wn]=[],this[_n]=0}write(e,t,r){typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let s=Buffer.isBuffer(e)?e:Buffer.from(e,t);return this[wn].push(s),this[_n]+=s.length,r&&r(),!0}end(e,t,r){typeof e=="function"&&(r=e,e=null),typeof t=="function"&&(r=t,t="utf8"),e&&this.write(e,t);let s=Buffer.concat(this[wn],this[_n]);return super.write(s),super.end(r)}};gy.exports=py;var my=class extends RC{static{o(this,"CollectPassThrough")}constructor(e){super(e),this[wn]=[],this[_n]=0}write(e,t,r){typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let s=Buffer.isBuffer(e)?e:Buffer.from(e,t);return this[wn].push(s),this[_n]+=s.length,super.write(e,t,r)}end(e,t,r){typeof e=="function"&&(r=e,e=null),typeof t=="function"&&(r=t,t="utf8"),e&&this.write(e,t);let s=Buffer.concat(this[wn],this[_n]);return this.emit("collect",s),super.end(r)}};gy.exports.PassThrough=my});var rh=d((npe,MC)=>{"use strict";var AC=typeof process=="object"&&process?process:{stdout:null,stderr:null},C5=require("events"),TC=require("stream"),CC=require("string_decoder").StringDecoder,ji=Symbol("EOF"),$i=Symbol("maybeEmitEnd"),Er=Symbol("emittedEnd"),Xl=Symbol("emittingEnd"),Ka=Symbol("emittedError"),Ql=Symbol("closed"),NC=Symbol("read"),eh=Symbol("flush"),PC=Symbol("flushChunk"),Ye=Symbol("encoding"),qi=Symbol("decoder"),th=Symbol("flowing"),Za=Symbol("paused"),bn=Symbol("resume"),Te=Symbol("bufferLength"),Sy=Symbol("bufferPush"),Ey=Symbol("bufferShift"),Le=Symbol("objectMode"),Me=Symbol("destroyed"),wy=Symbol("emitData"),DC=Symbol("emitEnd"),_y=Symbol("emitEnd2"),Vi=Symbol("async"),Ya=o(i=>Promise.resolve().then(i),"defer"),xC=global._MP_NO_ITERATOR_SYMBOLS_!=="1",N5=xC&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),P5=xC&&Symbol.iterator||Symbol("iterator not implemented"),D5=o(i=>i==="end"||i==="finish"||i==="prefinish","isEndish"),x5=o(i=>i instanceof ArrayBuffer||typeof i=="object"&&i.constructor&&i.constructor.name==="ArrayBuffer"&&i.byteLength>=0,"isArrayBuffer"),L5=o(i=>!Buffer.isBuffer(i)&&ArrayBuffer.isView(i),"isArrayBufferView"),ih=class{static{o(this,"Pipe")}constructor(e,t,r){this.src=e,this.dest=t,this.opts=r,this.ondrain=()=>e[bn](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},by=class extends ih{static{o(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,r){super(e,t,r),this.proxyErrors=s=>t.emit("error",s),e.on("error",this.proxyErrors)}};MC.exports=class LC extends TC{static{o(this,"Minipass")}constructor(e){super(),this[th]=!1,this[Za]=!1,this.pipes=[],this.buffer=[],this[Le]=e&&e.objectMode||!1,this[Le]?this[Ye]=null:this[Ye]=e&&e.encoding||null,this[Ye]==="buffer"&&(this[Ye]=null),this[Vi]=e&&!!e.async||!1,this[qi]=this[Ye]?new CC(this[Ye]):null,this[ji]=!1,this[Er]=!1,this[Xl]=!1,this[Ql]=!1,this[Ka]=null,this.writable=!0,this.readable=!0,this[Te]=0,this[Me]=!1}get bufferLength(){return this[Te]}get encoding(){return this[Ye]}set encoding(e){if(this[Le])throw new Error("cannot set encoding in objectMode");if(this[Ye]&&e!==this[Ye]&&(this[qi]&&this[qi].lastNeed||this[Te]))throw new Error("cannot change encoding");this[Ye]!==e&&(this[qi]=e?new CC(e):null,this.buffer.length&&(this.buffer=this.buffer.map(t=>this[qi].write(t)))),this[Ye]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[Le]}set objectMode(e){this[Le]=this[Le]||!!e}get async(){return this[Vi]}set async(e){this[Vi]=this[Vi]||!!e}write(e,t,r){if(this[ji])throw new Error("write after end");if(this[Me])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let s=this[Vi]?Ya:n=>n();return!this[Le]&&!Buffer.isBuffer(e)&&(L5(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):x5(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[Le]?(this.flowing&&this[Te]!==0&&this[eh](!0),this.flowing?this.emit("data",e):this[Sy](e),this[Te]!==0&&this.emit("readable"),r&&s(r),this.flowing):e.length?(typeof e=="string"&&!(t===this[Ye]&&!this[qi].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[Ye]&&(e=this[qi].write(e)),this.flowing&&this[Te]!==0&&this[eh](!0),this.flowing?this.emit("data",e):this[Sy](e),this[Te]!==0&&this.emit("readable"),r&&s(r),this.flowing):(this[Te]!==0&&this.emit("readable"),r&&s(r),this.flowing)}read(e){if(this[Me])return null;if(this[Te]===0||e===0||e>this[Te])return this[$i](),null;this[Le]&&(e=null),this.buffer.length>1&&!this[Le]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[Te])]);let t=this[NC](e||null,this.buffer[0]);return this[$i](),t}[NC](e,t){return e===t.length||e===null?this[Ey]():(this.buffer[0]=t.slice(e),t=t.slice(0,e),this[Te]-=e),this.emit("data",t),!this.buffer.length&&!this[ji]&&this.emit("drain"),t}end(e,t,r){return typeof e=="function"&&(r=e,e=null),typeof t=="function"&&(r=t,t="utf8"),e&&this.write(e,t),r&&this.once("end",r),this[ji]=!0,this.writable=!1,(this.flowing||!this[Za])&&this[$i](),this}[bn](){this[Me]||(this[Za]=!1,this[th]=!0,this.emit("resume"),this.buffer.length?this[eh]():this[ji]?this[$i]():this.emit("drain"))}resume(){return this[bn]()}pause(){this[th]=!1,this[Za]=!0}get destroyed(){return this[Me]}get flowing(){return this[th]}get paused(){return this[Za]}[Sy](e){this[Le]?this[Te]+=1:this[Te]+=e.length,this.buffer.push(e)}[Ey](){return this.buffer.length&&(this[Le]?this[Te]-=1:this[Te]-=this.buffer[0].length),this.buffer.shift()}[eh](e){do;while(this[PC](this[Ey]()));!e&&!this.buffer.length&&!this[ji]&&this.emit("drain")}[PC](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[Me])return;let r=this[Er];return t=t||{},e===AC.stdout||e===AC.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this.pipes.push(t.proxyErrors?new by(this,e,t):new ih(this,e,t)),this[Vi]?Ya(()=>this[bn]()):this[bn]()),e}unpipe(e){let t=this.pipes.find(r=>r.dest===e);t&&(this.pipes.splice(this.pipes.indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let r=super.on(e,t);return e==="data"&&!this.pipes.length&&!this.flowing?this[bn]():e==="readable"&&this[Te]!==0?super.emit("readable"):D5(e)&&this[Er]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[Ka]&&(this[Vi]?Ya(()=>t.call(this,this[Ka])):t.call(this,this[Ka])),r}get emittedEnd(){return this[Er]}[$i](){!this[Xl]&&!this[Er]&&!this[Me]&&this.buffer.length===0&&this[ji]&&(this[Xl]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Ql]&&this.emit("close"),this[Xl]=!1)}emit(e,t,...r){if(e!=="error"&&e!=="close"&&e!==Me&&this[Me])return;if(e==="data")return t?this[Vi]?Ya(()=>this[wy](t)):this[wy](t):!1;if(e==="end")return this[DC]();if(e==="close"){if(this[Ql]=!0,!this[Er]&&!this[Me])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[Ka]=t;let n=super.emit("error",t);return this[$i](),n}else if(e==="resume"){let n=super.emit("resume");return this[$i](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let s=super.emit(e,t,...r);return this[$i](),s}[wy](e){for(let r of this.pipes)r.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[$i](),t}[DC](){this[Er]||(this[Er]=!0,this.readable=!1,this[Vi]?Ya(()=>this[_y]()):this[_y]())}[_y](){if(this[qi]){let t=this[qi].end();if(t){for(let r of this.pipes)r.dest.write(t);super.emit("data",t)}}for(let t of this.pipes)t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}collect(){let e=[];this[Le]||(e.dataLength=0);let t=this.promise();return this.on("data",r=>{e.push(r),this[Le]||(e.dataLength+=r.length)}),t.then(()=>e)}concat(){return this[Le]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[Le]?Promise.reject(new Error("cannot concat in objectMode")):this[Ye]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,t)=>{this.on(Me,()=>t(new Error("stream destroyed"))),this.on("error",r=>t(r)),this.on("end",()=>e())})}[N5](){return{next:o(()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[ji])return Promise.resolve({done:!0});let r=null,s=null,n=o(l=>{this.removeListener("data",a),this.removeListener("end",c),s(l)},"onerr"),a=o(l=>{this.removeListener("error",n),this.removeListener("end",c),this.pause(),r({value:l,done:!!this[ji]})},"ondata"),c=o(()=>{this.removeListener("error",n),this.removeListener("data",a),r({done:!0})},"onend"),u=o(()=>n(new Error("stream destroyed")),"ondestroy");return new Promise((l,h)=>{s=h,r=l,this.once(Me,u),this.once("error",n),this.once("end",c),this.once("data",a)})},"next")}}[P5](){return{next:o(()=>{let t=this.read();return{value:t,done:t===null}},"next")}}destroy(e){return this[Me]?(e?this.emit("error",e):this.emit(Me),this):(this[Me]=!0,this.buffer.length=0,this[Te]=0,typeof this.close=="function"&&!this[Ql]&&this.close(),e?this.emit("error",e):this.emit(Me),this)}static isStream(e){return!!e&&(e instanceof LC||e instanceof TC||e instanceof C5&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var In=d((ape,UC)=>{var M5=rh(),B5=require("events"),k5=o(i=>i&&i instanceof B5&&(typeof i.pipe=="function"||typeof i.write=="function"&&typeof i.end=="function"),"isStream"),ms=Symbol("_head"),ut=Symbol("_tail"),Iy=Symbol("_linkStreams"),Oy=Symbol("_setHead"),vy=Symbol("_setTail"),BC=Symbol("_onError"),kC=Symbol("_onData"),Ry=Symbol("_onEnd"),FC=Symbol("_onDrain"),sh=Symbol("_streams"),Ay=class extends M5{static{o(this,"Pipeline")}constructor(e,...t){k5(e)&&(t.unshift(e),e={}),super(e),this[sh]=[],t.length&&this.push(...t)}[Iy](e){return e.reduce((t,r)=>(t.on("error",s=>r.emit("error",s)),t.pipe(r),r))}push(...e){this[sh].push(...e),this[ut]&&e.unshift(this[ut]);let t=this[Iy](e);this[vy](t),this[ms]||this[Oy](e[0])}unshift(...e){this[sh].unshift(...e),this[ms]&&e.push(this[ms]);let t=this[Iy](e);this[Oy](e[0]),this[ut]||this[vy](t)}destroy(e){return this[sh].forEach(t=>typeof t.destroy=="function"&&t.destroy()),super.destroy(e)}[vy](e){this[ut]=e,e.on("error",t=>this[BC](e,t)),e.on("data",t=>this[kC](e,t)),e.on("end",()=>this[Ry](e)),e.on("finish",()=>this[Ry](e))}[BC](e,t){e===this[ut]&&this.emit("error",t)}[kC](e,t){e===this[ut]&&super.write(t)}[Ry](e){e===this[ut]&&super.end()}pause(){return super.pause(),this[ut]&&this[ut].pause&&this[ut].pause()}emit(e,...t){return e==="resume"&&this[ut]&&this[ut].resume&&this[ut].resume(),super.emit(e,...t)}[Oy](e){this[ms]=e,e.on("drain",()=>this[FC](e))}[FC](e){e===this[ms]&&this.emit("drain")}write(e,t,r){return this[ms].write(e,t,r)&&(this.flowing||this.buffer.length===0)}end(e,t,r){return this[ms].end(e,t,r),this}};UC.exports=Ay});var ai=d((upe,oi)=>{"use strict";var Qa=require("crypto"),{Minipass:F5}=te(),Cy=["sha512","sha384","sha256"],Py=["sha512"],U5=/^[a-z0-9+/]+(?:=?=?)$/i,j5=/^([a-z0-9]+)-([^?]+)([?\S*]*)$/,$5=/^([a-z0-9]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)?$/,q5=/^[\x21-\x7E]+$/,ec=o(i=>i?.length?`?${i.join("?")}`:"","getOptString"),Ny=class extends F5{static{o(this,"IntegrityStream")}#e;#t;#i;constructor(e){super(),this.size=0,this.opts=e,this.#r(),e?.algorithms?this.algorithms=[...e.algorithms]:this.algorithms=[...Py],this.algorithm!==null&&!this.algorithms.includes(this.algorithm)&&this.algorithms.push(this.algorithm),this.hashes=this.algorithms.map(Qa.createHash)}#r(){this.sri=this.opts?.integrity?lt(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=ec(this.opts?.options)}on(e,t){return e==="size"&&this.#t?t(this.#t):e==="integrity"&&this.#e?t(this.#e):e==="verified"&&this.#i?t(this.#i):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.#r();let e=lt(this.hashes.map((r,s)=>`${this.algorithms[s]}-${r.digest("base64")}${this.optString}`).join(" "),this.opts),t=this.goodSri&&e.match(this.sri,this.opts);if(typeof this.expectedSize=="number"&&this.size!==this.expectedSize){let r=new Error(`stream size mismatch when checking ${this.sri}.
18
19
  Wanted: ${this.expectedSize}
19
- Found: ${this.size}`);r.code="EBADSIZE",r.found=this.size,r.expected=this.expectedSize,r.sri=this.sri,this.emit("error",r)}else if(this.sri&&!t){let r=new Error(`${this.sri} integrity checksum failed when using ${this.algorithm}: wanted ${this.digests} but got ${e}. (${this.size} bytes)`);r.code="EINTEGRITY",r.found=e,r.expected=this.digests,r.algorithm=this.algorithm,r.sri=this.sri,this.emit("error",r)}else this.#t=this.size,this.emit("size",this.size),this.#e=e,this.emit("integrity",e),t&&(this.#i=t,this.emit("verified",t))}},zi=class{static{o(this,"Hash")}get isHash(){return!0}constructor(e,t){let r=t?.strict;this.source=e.trim(),this.digest="",this.algorithm="",this.options=[];let s=this.source.match(r?U5:F5);if(!s||r&&!Cy.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 r=lt(e,t);if(!r)return!1;if(r.isIntegrity){let s=r.pickAlgorithm(t,[this.algorithm]);if(!s)return!1;let n=r[s].find(a=>a.digest===this.digest);return n||!1}return r.digest===this.digest?r:!1}toString(e){return e?.strict&&!(Cy.includes(this.algorithm)&&this.digest.match(k5)&&this.options.every(t=>t.match(j5)))?"":`${this.algorithm}-${this.digest}${ec(this.options)}`}};function jC(i,e,t,r){let s=i!=="",n=!1,a="",c=r.length-1;for(let l=0;l<c;l++){let h=zi.prototype.toString.call(r[l],t);h&&(n=!0,a+=h,a+=e)}let u=zi.prototype.toString.call(r[c],t);return u&&(n=!0,a+=u),s&&n?i+e+a:i+a}o(jC,"integrityHashToString");var gs=class{static{o(this,"Integrity")}get isIntegrity(){return!0}toJSON(){return this.toString()}isEmpty(){return Object.keys(this).length===0}toString(e){let t=e?.sep||" ",r="";if(e?.strict){t=t.replace(/\S+/g," ");for(let s of Cy)this[s]&&(r=jC(r,t,e,this[s]))}else for(let s of Object.keys(this))r=jC(r,t,e,this[s]);return r}concat(e,t){let r=typeof e=="string"?e:Xa(e,t);return lt(`${this.toString(t)} ${r}`,t)}hexDigest(){return lt(this,{single:!0}).hexDigest()}merge(e,t){let r=lt(e,t);for(let s in r)if(this[s]){if(!this[s].find(n=>r[s].find(a=>n.digest===a.digest)))throw new Error("hashes do not match, cannot update integrity")}else this[s]=r[s]}match(e,t){let r=lt(e,t);if(!r)return!1;let s=r.pickAlgorithm(t,Object.keys(this));return!!s&&this[s]&&r[s]&&this[s].find(n=>r[s].find(a=>n.digest===a.digest))||!1}pickAlgorithm(e,t){let r=e?.pickAlgorithm||J5,s=Object.keys(this).filter(n=>t?.length?t.includes(n):!0);return s.length?s.reduce((n,a)=>r(n,a)||n):null}};oi.exports.parse=lt;function lt(i,e){if(!i)return null;if(typeof i=="string")return Ty(i,e);if(i.algorithm&&i.digest){let t=new gs;return t[i.algorithm]=[i],Ty(Xa(t,e),e)}else return Ty(Xa(i,e),e)}o(lt,"parse");function Ty(i,e){if(e?.single)return new zi(i,e);let t=i.trim().split(/\s+/).reduce((r,s)=>{let n=new zi(s,e);if(n.algorithm&&n.digest){let a=n.algorithm;r[a]||(r[a]=[]),r[a].push(n)}return r},new gs);return t.isEmpty()?null:t}o(Ty,"_parse");oi.exports.stringify=Xa;function Xa(i,e){return i.algorithm&&i.digest?zi.prototype.toString.call(i,e):typeof i=="string"?Xa(lt(i,e),e):gs.prototype.toString.call(i,e)}o(Xa,"stringify");oi.exports.fromHex=$5;function $5(i,e,t){let r=ec(t?.options);return lt(`${e}-${Buffer.from(i,"hex").toString("base64")}${r}`,t)}o($5,"fromHex");oi.exports.fromData=q5;function q5(i,e){let t=e?.algorithms||[...Py],r=ec(e?.options);return t.reduce((s,n)=>{let a=Qa.createHash(n).update(i).digest("base64"),c=new zi(`${n}-${a}${r}`,e);if(c.algorithm&&c.digest){let u=c.algorithm;s[u]||(s[u]=[]),s[u].push(c)}return s},new gs)}o(q5,"fromData");oi.exports.fromStream=V5;function V5(i,e){let t=Dy(e);return new Promise((r,s)=>{i.pipe(t),i.on("error",s),t.on("error",s);let n;t.on("integrity",a=>{n=a}),t.on("end",()=>r(n)),t.resume()})}o(V5,"fromStream");oi.exports.checkData=z5;function z5(i,e,t){if(e=lt(e,t),!e||!Object.keys(e).length){if(t?.error)throw Object.assign(new Error("No valid integrity hashes to check against"),{code:"EINTEGRITY"});return!1}let r=e.pickAlgorithm(t),s=Qa.createHash(r).update(i).digest("base64"),n=lt({algorithm:r,digest:s}),a=n.match(e,t);if(t=t||{},a||!t.error)return a;if(typeof t.size=="number"&&i.length!==t.size){let c=new Error(`data size mismatch when checking ${e}.
20
+ Found: ${this.size}`);r.code="EBADSIZE",r.found=this.size,r.expected=this.expectedSize,r.sri=this.sri,this.emit("error",r)}else if(this.sri&&!t){let r=new Error(`${this.sri} integrity checksum failed when using ${this.algorithm}: wanted ${this.digests} but got ${e}. (${this.size} bytes)`);r.code="EINTEGRITY",r.found=e,r.expected=this.digests,r.algorithm=this.algorithm,r.sri=this.sri,this.emit("error",r)}else this.#t=this.size,this.emit("size",this.size),this.#e=e,this.emit("integrity",e),t&&(this.#i=t,this.emit("verified",t))}},zi=class{static{o(this,"Hash")}get isHash(){return!0}constructor(e,t){let r=t?.strict;this.source=e.trim(),this.digest="",this.algorithm="",this.options=[];let s=this.source.match(r?$5:j5);if(!s||r&&!Cy.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 r=lt(e,t);if(!r)return!1;if(r.isIntegrity){let s=r.pickAlgorithm(t,[this.algorithm]);if(!s)return!1;let n=r[s].find(a=>a.digest===this.digest);return n||!1}return r.digest===this.digest?r:!1}toString(e){return e?.strict&&!(Cy.includes(this.algorithm)&&this.digest.match(U5)&&this.options.every(t=>t.match(q5)))?"":`${this.algorithm}-${this.digest}${ec(this.options)}`}};function jC(i,e,t,r){let s=i!=="",n=!1,a="",c=r.length-1;for(let l=0;l<c;l++){let h=zi.prototype.toString.call(r[l],t);h&&(n=!0,a+=h,a+=e)}let u=zi.prototype.toString.call(r[c],t);return u&&(n=!0,a+=u),s&&n?i+e+a:i+a}o(jC,"integrityHashToString");var gs=class{static{o(this,"Integrity")}get isIntegrity(){return!0}toJSON(){return this.toString()}isEmpty(){return Object.keys(this).length===0}toString(e){let t=e?.sep||" ",r="";if(e?.strict){t=t.replace(/\S+/g," ");for(let s of Cy)this[s]&&(r=jC(r,t,e,this[s]))}else for(let s of Object.keys(this))r=jC(r,t,e,this[s]);return r}concat(e,t){let r=typeof e=="string"?e:Xa(e,t);return lt(`${this.toString(t)} ${r}`,t)}hexDigest(){return lt(this,{single:!0}).hexDigest()}merge(e,t){let r=lt(e,t);for(let s in r)if(this[s]){if(!this[s].find(n=>r[s].find(a=>n.digest===a.digest)))throw new Error("hashes do not match, cannot update integrity")}else this[s]=r[s]}match(e,t){let r=lt(e,t);if(!r)return!1;let s=r.pickAlgorithm(t,Object.keys(this));return!!s&&this[s]&&r[s]&&this[s].find(n=>r[s].find(a=>n.digest===a.digest))||!1}pickAlgorithm(e,t){let r=e?.pickAlgorithm||Z5,s=Object.keys(this).filter(n=>t?.length?t.includes(n):!0);return s.length?s.reduce((n,a)=>r(n,a)||n):null}};oi.exports.parse=lt;function lt(i,e){if(!i)return null;if(typeof i=="string")return Ty(i,e);if(i.algorithm&&i.digest){let t=new gs;return t[i.algorithm]=[i],Ty(Xa(t,e),e)}else return Ty(Xa(i,e),e)}o(lt,"parse");function Ty(i,e){if(e?.single)return new zi(i,e);let t=i.trim().split(/\s+/).reduce((r,s)=>{let n=new zi(s,e);if(n.algorithm&&n.digest){let a=n.algorithm;r[a]||(r[a]=[]),r[a].push(n)}return r},new gs);return t.isEmpty()?null:t}o(Ty,"_parse");oi.exports.stringify=Xa;function Xa(i,e){return i.algorithm&&i.digest?zi.prototype.toString.call(i,e):typeof i=="string"?Xa(lt(i,e),e):gs.prototype.toString.call(i,e)}o(Xa,"stringify");oi.exports.fromHex=V5;function V5(i,e,t){let r=ec(t?.options);return lt(`${e}-${Buffer.from(i,"hex").toString("base64")}${r}`,t)}o(V5,"fromHex");oi.exports.fromData=z5;function z5(i,e){let t=e?.algorithms||[...Py],r=ec(e?.options);return t.reduce((s,n)=>{let a=Qa.createHash(n).update(i).digest("base64"),c=new zi(`${n}-${a}${r}`,e);if(c.algorithm&&c.digest){let u=c.algorithm;s[u]||(s[u]=[]),s[u].push(c)}return s},new gs)}o(z5,"fromData");oi.exports.fromStream=H5;function H5(i,e){let t=Dy(e);return new Promise((r,s)=>{i.pipe(t),i.on("error",s),t.on("error",s);let n;t.on("integrity",a=>{n=a}),t.on("end",()=>r(n)),t.resume()})}o(H5,"fromStream");oi.exports.checkData=G5;function G5(i,e,t){if(e=lt(e,t),!e||!Object.keys(e).length){if(t?.error)throw Object.assign(new Error("No valid integrity hashes to check against"),{code:"EINTEGRITY"});return!1}let r=e.pickAlgorithm(t),s=Qa.createHash(r).update(i).digest("base64"),n=lt({algorithm:r,digest:s}),a=n.match(e,t);if(t=t||{},a||!t.error)return a;if(typeof t.size=="number"&&i.length!==t.size){let c=new Error(`data size mismatch when checking ${e}.
20
21
  Wanted: ${t.size}
21
- Found: ${i.length}`);throw c.code="EBADSIZE",c.found=i.length,c.expected=t.size,c.sri=e,c}else{let c=new Error(`Integrity checksum failed when using ${r}: Wanted ${e}, but got ${n}. (${i.length} bytes)`);throw c.code="EINTEGRITY",c.found=n,c.expected=e,c.algorithm=r,c.sri=e,c}}o(z5,"checkData");oi.exports.checkStream=H5;function H5(i,e,t){if(t=t||Object.create(null),t.integrity=e,e=lt(e,t),!e||!Object.keys(e).length)return Promise.reject(Object.assign(new Error("No valid integrity hashes to check against"),{code:"EINTEGRITY"}));let r=Dy(t);return new Promise((s,n)=>{i.pipe(r),i.on("error",n),r.on("error",n);let a;r.on("verified",c=>{a=c}),r.on("end",()=>s(a)),r.resume()})}o(H5,"checkStream");oi.exports.integrityStream=Dy;function Dy(i=Object.create(null)){return new Ny(i)}o(Dy,"integrityStream");oi.exports.create=G5;function G5(i){let e=i?.algorithms||[...Py],t=ec(i?.options),r=e.map(Qa.createHash);return{update:o(function(s,n){return r.forEach(a=>a.update(s,n)),this},"update"),digest:o(function(){return e.reduce((n,a)=>{let c=r.shift().digest("base64"),u=new zi(`${a}-${c}${t}`,i);if(u.algorithm&&u.digest){let l=u.algorithm;n[l]||(n[l]=[]),n[l].push(u)}return n},new gs)},"digest")}}o(G5,"createIntegrity");var W5=Qa.getHashes(),$C=["md5","whirlpool","sha1","sha224","sha256","sha384","sha512","sha3","sha3-256","sha3-384","sha3-512","sha3_256","sha3_384","sha3_512"].filter(i=>W5.includes(i));function J5(i,e){return $C.indexOf(i.toLowerCase())>=$C.indexOf(e.toLowerCase())?i:e}o(J5,"getPrioritizedHash")});var qC=d((upe,xy)=>{(function(){var i;function e(t,r){var s=this instanceof e?this:i;if(s.reset(r),typeof t=="string"&&t.length>0&&s.hash(t),s!==this)return s}o(e,"MurmurHash3"),e.prototype.hash=function(t){var r,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(r=this.h1;s=s*11601+(s&65535)*3432906752&4294967295,s=s<<15|s>>>17,s=s*13715+(s&65535)*461832192&4294967295,r^=s,r=r<<13|r>>>19,r=r*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=r}return this.k1=s,this},e.prototype.result=function(){var t,r;return t=this.k1,r=this.h1,t>0&&(t=t*11601+(t&65535)*3432906752&4294967295,t=t<<15|t>>>17,t=t*13715+(t&65535)*461832192&4294967295,r^=t),r^=this.len,r^=r>>>16,r=r*51819+(r&65535)*2246770688&4294967295,r^=r>>>13,r=r*44597+(r&65535)*3266445312&4294967295,r^=r>>>16,r>>>0},e.prototype.reset=function(t){return this.h1=typeof t=="number"?t:0,this.rem=this.k1=this.len=0,this},i=new e,typeof xy<"u"?xy.exports=e:this.MurmurHash3=e})()});var zC=d((hpe,VC)=>{"use strict";var K5=qC();VC.exports=function(i){if(i){var e=new K5(i);return("00000000"+e.result().toString(16)).slice(-8)}else return(Math.random().toString(16)+"0000000").slice(2,10)}});var Ly=d((fpe,HC)=>{var Z5=require("path"),Y5=zC();HC.exports=function(i,e,t){return Z5.join(i,(e?e+"-":"")+Y5(t))}});var My=d((dpe,X5)=>{X5.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 By=d((ppe,GC)=>{"use strict";GC.exports=Q5;function Q5(i){return[i.slice(0,2),i.slice(2,4),i.slice(4)]}o(Q5,"hashToSegments")});var On=d((gpe,ky)=>{"use strict";var e3=My()["cache-version"].content,t3=By(),WC=require("path"),i3=ai();ky.exports=r3;function r3(i,e){let t=i3.parse(e,{single:!0});return WC.join(JC(i),t.algorithm,...t3(t.hexDigest()))}o(r3,"contentPath");ky.exports.contentDir=JC;function JC(i){return WC.join(i,`content-v${e3}`)}o(JC,"contentDir")});var Fy=d((Spe,KC)=>{var s3=o((i,{copy:e,wrap:t})=>{let r={};if(i&&typeof i=="object")for(let s of e)i[s]!==void 0&&(r[s]=i[s]);else r[t]=i;return r},"getOptions");KC.exports=s3});var YC=d((wpe,ZC)=>{var n3=ds(),o3=o(i=>n3.satisfies(process.version,i,{includePrerelease:!0}),"satisfies");ZC.exports={satisfies:o3}});var XC=d((Ope,jy)=>{"use strict";var{inspect:a3}=require("util"),Uy=class{static{o(this,"SystemError")}constructor(e,t,r){let s=`${t}: ${r.syscall} returned ${r.code} (${r.message})`;r.path!==void 0&&(s+=` ${r.path}`),r.dest!==void 0&&(s+=` => ${r.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:r,enumerable:!0,configurable:!0,writable:!1},errno:{get(){return r.errno},set(n){r.errno=n},enumerable:!0,configurable:!0},syscall:{get(){return r.syscall},set(n){r.syscall=n},enumerable:!0,configurable:!0}}),r.path!==void 0&&Object.defineProperty(this,"path",{get(){return r.path},set(n){r.path=n},enumerable:!0,configurable:!0}),r.dest!==void 0&&Object.defineProperty(this,"dest",{get(){return r.dest},set(n){r.dest=n},enumerable:!0,configurable:!0})}toString(){return`${this.name} [${this.code}]: ${this.message}`}[Symbol.for("nodejs.util.inspect.custom")](e,t){return a3(this,{...t,getters:!0,customInspect:!1})}};function Hi(i,e){jy.exports[i]=class extends Uy{static{o(this,"NodeError")}constructor(r){super(i,e,r)}}}o(Hi,"E");Hi("ERR_FS_CP_DIR_TO_NON_DIR","Cannot overwrite directory with non-directory");Hi("ERR_FS_CP_EEXIST","Target already exists");Hi("ERR_FS_CP_EINVAL","Invalid src or dest");Hi("ERR_FS_CP_FIFO_PIPE","Cannot copy a FIFO pipe");Hi("ERR_FS_CP_NON_DIR_TO_DIR","Cannot overwrite non-directory with directory");Hi("ERR_FS_CP_SOCKET","Cannot copy a socket file");Hi("ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY","Cannot overwrite symlink in subdirectory of self");Hi("ERR_FS_CP_UNKNOWN","Cannot copy an unknown file type");Hi("ERR_FS_EISDIR","Path is a directory");jy.exports.ERR_INVALID_ARG_TYPE=class extends Error{static{o(this,"ERR_INVALID_ARG_TYPE")}constructor(e,t,r){super(),this.code="ERR_INVALID_ARG_TYPE",this.message=`The ${e} argument must be ${t}. Received ${typeof r}`}}});var y1=d((Rpe,g1)=>{"use strict";var{ERR_FS_CP_DIR_TO_NON_DIR:c3,ERR_FS_CP_EEXIST:u3,ERR_FS_CP_EINVAL:nh,ERR_FS_CP_FIFO_PIPE:l3,ERR_FS_CP_NON_DIR_TO_DIR:h3,ERR_FS_CP_SOCKET:f3,ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY:d3,ERR_FS_CP_UNKNOWN:p3,ERR_FS_EISDIR:m3,ERR_INVALID_ARG_TYPE:g3}=XC(),{constants:{errno:{EEXIST:y3,EISDIR:S3,EINVAL:Gi,ENOTDIR:E3}}}=require("os"),{chmod:w3,copyFile:_3,lstat:a1,mkdir:c1,readdir:b3,readlink:QC,stat:vn,symlink:$y,unlink:u1,utimes:I3}=require("fs/promises"),{dirname:tc,isAbsolute:e1,join:t1,parse:O3,resolve:ic,sep:v3,toNamespacedPath:i1}=require("path"),{fileURLToPath:R3}=require("url"),A3={dereference:!1,errorOnExist:!1,filter:void 0,force:!0,preserveTimestamps:!1,recursive:!1};async function T3(i,e,t){if(t!=null&&typeof t!="object")throw new g3("options",["Object"],t);return C3(i1(r1(i)),i1(r1(e)),{...A3,...t})}o(T3,"cp");function r1(i){return i!=null&&i.href&&i.origin?R3(i):i}o(r1,"getValidatedPath");async function C3(i,e,t){t.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended","TimestampPrecisionWarning");let r=await l1(i,e,t),{srcStat:s,destStat:n}=r;return await f1(i,s,e),t.filter?d1(s1,n,i,e,t):s1(n,i,e,t)}o(C3,"cpFn");async function l1(i,e,t){let{0:r,1:s}=await N3(i,e,t);if(s){if(h1(r,s))throw new nh({message:"src and dest cannot be the same",path:e,syscall:"cp",errno:Gi});if(r.isDirectory()&&!s.isDirectory())throw new c3({message:`cannot overwrite directory ${i} with non-directory ${e}`,path:e,syscall:"cp",errno:S3});if(!r.isDirectory()&&s.isDirectory())throw new h3({message:`cannot overwrite non-directory ${i} with directory ${e}`,path:e,syscall:"cp",errno:E3})}if(r.isDirectory()&&qy(i,e))throw new nh({message:`cannot copy ${i} to a subdirectory of self ${e}`,path:e,syscall:"cp",errno:Gi});return{srcStat:r,destStat:s}}o(l1,"checkPaths");function h1(i,e){return e.ino&&e.dev&&e.ino===i.ino&&e.dev===i.dev}o(h1,"areIdentical");function N3(i,e,t){let r=t.dereference?s=>vn(s,{bigint:!0}):s=>a1(s,{bigint:!0});return Promise.all([r(i),r(e).catch(s=>{if(s.code==="ENOENT")return null;throw s})])}o(N3,"getStats");async function s1(i,e,t,r){let s=tc(t);return await P3(s)||await c1(s,{recursive:!0}),oh(i,e,t,r)}o(s1,"checkParentDir");function P3(i){return vn(i).then(()=>!0,e=>e.code==="ENOENT"?!1:Promise.reject(e))}o(P3,"pathExists");async function f1(i,e,t){let r=ic(tc(i)),s=ic(tc(t));if(s===r||s===O3(s).root)return;let n;try{n=await vn(s,{bigint:!0})}catch(a){if(a.code==="ENOENT")return;throw a}if(h1(e,n))throw new nh({message:`cannot copy ${i} to a subdirectory of self ${t}`,path:t,syscall:"cp",errno:Gi});return f1(i,e,s)}o(f1,"checkParentPaths");var n1=o(i=>ic(i).split(v3).filter(Boolean),"normalizePathToArray");function qy(i,e){let t=n1(i),r=n1(e);return t.every((s,n)=>r[n]===s)}o(qy,"isSrcSubdir");async function d1(i,e,t,r,s,n){if(await s.filter(t,r))return i(e,t,r,s,n)}o(d1,"handleFilter");function D3(i,e,t,r){return r.filter?d1(oh,i,e,t,r):oh(i,e,t,r)}o(D3,"startCopy");async function oh(i,e,t,r){let n=await(r.dereference?vn:a1)(e);if(n.isDirectory()&&r.recursive)return U3(n,i,e,t,r);if(n.isDirectory())throw new m3({message:`${e} is a directory (not copied)`,path:e,syscall:"cp",errno:Gi});if(n.isFile()||n.isCharacterDevice()||n.isBlockDevice())return x3(n,i,e,t,r);if(n.isSymbolicLink())return $3(i,e,t);throw n.isSocket()?new f3({message:`cannot copy a socket file: ${t}`,path:t,syscall:"cp",errno:Gi}):n.isFIFO()?new l3({message:`cannot copy a FIFO pipe: ${t}`,path:t,syscall:"cp",errno:Gi}):new p3({message:`cannot copy an unknown file type: ${t}`,path:t,syscall:"cp",errno:Gi})}o(oh,"getStatsForCopy");function x3(i,e,t,r,s){return e?L3(i,t,r,s):p1(i,t,r,s)}o(x3,"onFile");async function L3(i,e,t,r){if(r.force)return await u1(t),p1(i,e,t,r);if(r.errorOnExist)throw new u3({message:`${t} already exists`,path:t,syscall:"cp",errno:y3})}o(L3,"mayCopyFile");async function p1(i,e,t,r){return await _3(e,t),r.preserveTimestamps?M3(i.mode,e,t):ah(t,i.mode)}o(p1,"_copyFile");async function M3(i,e,t){return B3(i)&&await k3(t,i),o1(i,e,t)}o(M3,"handleTimestampsAndMode");function B3(i){return(i&128)===0}o(B3,"fileIsNotWritable");function k3(i,e){return ah(i,e|128)}o(k3,"makeFileWritable");async function o1(i,e,t){return await F3(e,t),ah(t,i)}o(o1,"setDestTimestampsAndMode");function ah(i,e){return w3(i,e)}o(ah,"setDestMode");async function F3(i,e){let t=await vn(i);return I3(e,t.atime,t.mtime)}o(F3,"setDestTimestamps");function U3(i,e,t,r,s){return e?m1(t,r,s):j3(i.mode,t,r,s)}o(U3,"onDir");async function j3(i,e,t,r){return await c1(t),await m1(e,t,r),ah(t,i)}o(j3,"mkDirAndCopy");async function m1(i,e,t){let r=await b3(i);for(let s=0;s<r.length;s++){let n=r[s],a=t1(i,n),c=t1(e,n),{destStat:u}=await l1(a,c,t);await D3(u,a,c,t)}}o(m1,"copyDir");async function $3(i,e,t){let r=await QC(e);if(e1(r)||(r=ic(tc(e),r)),!i)return $y(r,t);let s;try{s=await QC(t)}catch(a){if(a.code==="EINVAL"||a.code==="UNKNOWN")return $y(r,t);throw a}if(e1(s)||(s=ic(tc(t),s)),qy(r,s))throw new nh({message:`cannot copy ${r} to a subdirectory of self ${s}`,path:t,syscall:"cp",errno:Gi});if((await vn(e)).isDirectory()&&qy(s,r))throw new d3({message:`cannot overwrite ${s} with ${r}`,path:t,syscall:"cp",errno:Gi});return q3(r,t)}o($3,"onLink");async function q3(i,e){return await u1(e),$y(i,e)}o(q3,"copyLink");g1.exports=T3});var E1=d((Tpe,S1)=>{var V3=require("fs/promises"),z3=Fy(),H3=YC(),G3=y1(),W3=H3.satisfies(">=16.7.0"),J3=o(async(i,e,t)=>{let r=z3(t,{copy:["dereference","errorOnExist","filter","force","preserveTimestamps","recursive"]});return W3?V3.cp(i,e,r):G3(i,e,r)},"cp");S1.exports=J3});var _1=d((Npe,w1)=>{var{join:K3,sep:Z3}=require("path"),Y3=Fy(),{mkdir:X3,mkdtemp:Q3,rm:e4}=require("fs/promises"),t4=o(async(i,e,t)=>{let r=Y3(t,{copy:["tmpPrefix"]});await X3(i,{recursive:!0});let s=await Q3(K3(`${i}${Z3}`,r.tmpPrefix||"")),n,a;try{a=await e(s)}catch(c){n=c}try{await e4(s,{force:!0,recursive:!0})}catch{}if(n)throw n;return a},"withTempDir");w1.exports=t4});var v1=d((Dpe,O1)=>{var{readdir:b1}=require("fs/promises"),{join:I1}=require("path"),i4=o(async i=>{let e=[];for(let t of await b1(i))if(t.startsWith("@"))for(let r of await b1(I1(i,t)))e.push(I1(t,r));else e.push(t);return e},"readdirScoped");O1.exports=i4});var P1=d((Lpe,N1)=>{var{dirname:R1,join:A1,resolve:T1,relative:r4,isAbsolute:s4}=require("path"),ci=require("fs/promises"),n4=o(async i=>{try{return await ci.access(i),!0}catch(e){return e.code!=="ENOENT"}},"pathExists"),C1=o(async(i,e,t={},r=!0,s=[])=>{if(!i||!e)throw new TypeError("`source` and `destination` file required");if(t={overwrite:!0,...t},!t.overwrite&&await n4(e))throw new Error(`The destination file exists: ${e}`);await ci.mkdir(R1(e),{recursive:!0});try{await ci.rename(i,e)}catch(n){if(n.code==="EXDEV"||n.code==="EPERM"){let a=await ci.lstat(i);if(a.isDirectory()){let c=await ci.readdir(i);await Promise.all(c.map(u=>C1(A1(i,u),A1(e,u),t,!1,s)))}else a.isSymbolicLink()?s.push({source:i,destination:e}):await ci.copyFile(i,e)}else throw n}r&&(await Promise.all(s.map(async({source:n,destination:a})=>{let c=await ci.readlink(n);s4(c)&&(c=T1(a,r4(n,c)));let u="file";try{u=await ci.stat(T1(R1(n),c)),u.isDirectory()&&(u="junction")}catch{}await ci.symlink(c,a,u)})),await ci.rm(i,{recursive:!0,force:!0}))},"moveFile");N1.exports=C1});var ch=d((Bpe,D1)=>{"use strict";var o4=E1(),a4=_1(),c4=v1(),u4=P1();D1.exports={cp:o4,withTempDir:a4,readdirScoped:c4,moveFile:u4}});var uh={};Uj(uh,{default:()=>x1,pMapIterable:()=>l4,pMapSkip:()=>rc});async function x1(i,e,{concurrency:t=Number.POSITIVE_INFINITY,stopOnError:r=!0,signal:s}={}){return new Promise((n,a)=>{if(i[Symbol.iterator]===void 0&&i[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof i})`);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=[],u=[],l=new Map,h=!1,f=!1,p=!1,m=0,y=0,g=i[Symbol.iterator]===void 0?i[Symbol.asyncIterator]():i[Symbol.iterator](),S=o(()=>{b(s.reason)},"signalListener"),E=o(()=>{s?.removeEventListener("abort",S)},"cleanup"),_=o(I=>{n(I),E()},"resolve"),b=o(I=>{h=!0,f=!0,a(I),E()},"reject");s&&(s.aborted&&b(s.reason),s.addEventListener("abort",S,{once:!0}));let w=o(async()=>{if(f)return;let I=await g.next(),v=y;if(y++,I.done){if(p=!0,m===0&&!f){if(!r&&u.length>0){b(new AggregateError(u));return}if(f=!0,l.size===0){_(c);return}let N=[];for(let[P,$]of c.entries())l.get(P)!==rc&&N.push($);_(N)}return}m++,(async()=>{try{let N=await I.value;if(f)return;let P=await e(N,v);P===rc&&l.set(v,P),c[v]=P,m--,await w()}catch(N){if(r)b(N);else{u.push(N),m--;try{await w()}catch(P){b(P)}}}})()},"next");(async()=>{for(let I=0;I<t;I++){try{await w()}catch(v){b(v);break}if(p||h)break}})()})}function l4(i,e,{concurrency:t=Number.POSITIVE_INFINITY,backpressure:r=t}={}){if(i[Symbol.iterator]===void 0&&i[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof i})`);if(typeof e!="function")throw new TypeError("Mapper function is required");if(!(Number.isSafeInteger(t)&&t>=1||t===Number.POSITIVE_INFINITY))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${t}\` (${typeof t})`);if(!(Number.isSafeInteger(r)&&r>=t||r===Number.POSITIVE_INFINITY))throw new TypeError(`Expected \`backpressure\` to be an integer from \`concurrency\` (${t}) and up or \`Infinity\`, got \`${r}\` (${typeof r})`);return{async*[Symbol.asyncIterator](){let s=i[Symbol.asyncIterator]===void 0?i[Symbol.iterator]():i[Symbol.asyncIterator](),n=[],a=0,c=!1,u=0;function l(){if(c||!(a<t&&n.length<r))return;let h=(async()=>{let{done:f,value:p}=await s.next();if(f)return{done:!0};a++,l();try{let m=await e(await p,u++);if(a--,m===rc){let y=n.indexOf(h);y>0&&n.splice(y,1)}return l(),{done:!1,value:m}}catch(m){return c=!0,{error:m}}})();n.push(h)}for(o(l,"trySpawn"),l();n.length>0;){let{error:h,done:f,value:p}=await n[0];if(n.shift(),h)throw h;if(f)return;l(),p!==rc&&(yield p)}}}}var rc,lh=Fj(()=>{o(x1,"pMap");o(l4,"pMapIterable");rc=Symbol("skip")});var Rn=d((Upe,ht)=>{"use strict";var h4=require("crypto"),{appendFile:f4,mkdir:Hy,readFile:d4,readdir:p4,rm:L1,writeFile:m4}=require("fs/promises"),{Minipass:g4}=te(),ui=require("path"),y4=ai(),S4=Ly(),E4=On(),w4=By(),_4=My()["cache-version"].index,{moveFile:b4}=ch(),Vy=5;ht.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}};ht.exports.compact=I4;async function I4(i,e,t,r={}){let s=sc(i,e),n=await hh(s),a=[];for(let p=n.length-1;p>=0;--p){let m=n[p];if(m.integrity===null&&!r.validateEntry)break;(!r.validateEntry||r.validateEntry(m)===!0)&&(a.length===0||!a.find(y=>t(y,m)))&&a.unshift(m)}let c=`
22
+ Found: ${i.length}`);throw c.code="EBADSIZE",c.found=i.length,c.expected=t.size,c.sri=e,c}else{let c=new Error(`Integrity checksum failed when using ${r}: Wanted ${e}, but got ${n}. (${i.length} bytes)`);throw c.code="EINTEGRITY",c.found=n,c.expected=e,c.algorithm=r,c.sri=e,c}}o(G5,"checkData");oi.exports.checkStream=W5;function W5(i,e,t){if(t=t||Object.create(null),t.integrity=e,e=lt(e,t),!e||!Object.keys(e).length)return Promise.reject(Object.assign(new Error("No valid integrity hashes to check against"),{code:"EINTEGRITY"}));let r=Dy(t);return new Promise((s,n)=>{i.pipe(r),i.on("error",n),r.on("error",n);let a;r.on("verified",c=>{a=c}),r.on("end",()=>s(a)),r.resume()})}o(W5,"checkStream");oi.exports.integrityStream=Dy;function Dy(i=Object.create(null)){return new Ny(i)}o(Dy,"integrityStream");oi.exports.create=J5;function J5(i){let e=i?.algorithms||[...Py],t=ec(i?.options),r=e.map(Qa.createHash);return{update:o(function(s,n){return r.forEach(a=>a.update(s,n)),this},"update"),digest:o(function(){return e.reduce((n,a)=>{let c=r.shift().digest("base64"),u=new zi(`${a}-${c}${t}`,i);if(u.algorithm&&u.digest){let l=u.algorithm;n[l]||(n[l]=[]),n[l].push(u)}return n},new gs)},"digest")}}o(J5,"createIntegrity");var K5=Qa.getHashes(),$C=["md5","whirlpool","sha1","sha224","sha256","sha384","sha512","sha3","sha3-256","sha3-384","sha3-512","sha3_256","sha3_384","sha3_512"].filter(i=>K5.includes(i));function Z5(i,e){return $C.indexOf(i.toLowerCase())>=$C.indexOf(e.toLowerCase())?i:e}o(Z5,"getPrioritizedHash")});var qC=d((hpe,xy)=>{(function(){var i;function e(t,r){var s=this instanceof e?this:i;if(s.reset(r),typeof t=="string"&&t.length>0&&s.hash(t),s!==this)return s}o(e,"MurmurHash3"),e.prototype.hash=function(t){var r,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(r=this.h1;s=s*11601+(s&65535)*3432906752&4294967295,s=s<<15|s>>>17,s=s*13715+(s&65535)*461832192&4294967295,r^=s,r=r<<13|r>>>19,r=r*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=r}return this.k1=s,this},e.prototype.result=function(){var t,r;return t=this.k1,r=this.h1,t>0&&(t=t*11601+(t&65535)*3432906752&4294967295,t=t<<15|t>>>17,t=t*13715+(t&65535)*461832192&4294967295,r^=t),r^=this.len,r^=r>>>16,r=r*51819+(r&65535)*2246770688&4294967295,r^=r>>>13,r=r*44597+(r&65535)*3266445312&4294967295,r^=r>>>16,r>>>0},e.prototype.reset=function(t){return this.h1=typeof t=="number"?t:0,this.rem=this.k1=this.len=0,this},i=new e,typeof xy<"u"?xy.exports=e:this.MurmurHash3=e})()});var zC=d((dpe,VC)=>{"use strict";var Y5=qC();VC.exports=function(i){if(i){var e=new Y5(i);return("00000000"+e.result().toString(16)).slice(-8)}else return(Math.random().toString(16)+"0000000").slice(2,10)}});var Ly=d((ppe,HC)=>{var X5=require("path"),Q5=zC();HC.exports=function(i,e,t){return X5.join(i,(e?e+"-":"")+Q5(t))}});var My=d((mpe,e3)=>{e3.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 By=d((gpe,GC)=>{"use strict";GC.exports=t3;function t3(i){return[i.slice(0,2),i.slice(2,4),i.slice(4)]}o(t3,"hashToSegments")});var On=d((Spe,ky)=>{"use strict";var i3=My()["cache-version"].content,r3=By(),WC=require("path"),s3=ai();ky.exports=n3;function n3(i,e){let t=s3.parse(e,{single:!0});return WC.join(JC(i),t.algorithm,...r3(t.hexDigest()))}o(n3,"contentPath");ky.exports.contentDir=JC;function JC(i){return WC.join(i,`content-v${i3}`)}o(JC,"contentDir")});var Fy=d((wpe,KC)=>{var o3=o((i,{copy:e,wrap:t})=>{let r={};if(i&&typeof i=="object")for(let s of e)i[s]!==void 0&&(r[s]=i[s]);else r[t]=i;return r},"getOptions");KC.exports=o3});var YC=d((bpe,ZC)=>{var a3=ds(),c3=o(i=>a3.satisfies(process.version,i,{includePrerelease:!0}),"satisfies");ZC.exports={satisfies:c3}});var XC=d((Rpe,jy)=>{"use strict";var{inspect:u3}=require("util"),Uy=class{static{o(this,"SystemError")}constructor(e,t,r){let s=`${t}: ${r.syscall} returned ${r.code} (${r.message})`;r.path!==void 0&&(s+=` ${r.path}`),r.dest!==void 0&&(s+=` => ${r.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:r,enumerable:!0,configurable:!0,writable:!1},errno:{get(){return r.errno},set(n){r.errno=n},enumerable:!0,configurable:!0},syscall:{get(){return r.syscall},set(n){r.syscall=n},enumerable:!0,configurable:!0}}),r.path!==void 0&&Object.defineProperty(this,"path",{get(){return r.path},set(n){r.path=n},enumerable:!0,configurable:!0}),r.dest!==void 0&&Object.defineProperty(this,"dest",{get(){return r.dest},set(n){r.dest=n},enumerable:!0,configurable:!0})}toString(){return`${this.name} [${this.code}]: ${this.message}`}[Symbol.for("nodejs.util.inspect.custom")](e,t){return u3(this,{...t,getters:!0,customInspect:!1})}};function Hi(i,e){jy.exports[i]=class extends Uy{static{o(this,"NodeError")}constructor(r){super(i,e,r)}}}o(Hi,"E");Hi("ERR_FS_CP_DIR_TO_NON_DIR","Cannot overwrite directory with non-directory");Hi("ERR_FS_CP_EEXIST","Target already exists");Hi("ERR_FS_CP_EINVAL","Invalid src or dest");Hi("ERR_FS_CP_FIFO_PIPE","Cannot copy a FIFO pipe");Hi("ERR_FS_CP_NON_DIR_TO_DIR","Cannot overwrite non-directory with directory");Hi("ERR_FS_CP_SOCKET","Cannot copy a socket file");Hi("ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY","Cannot overwrite symlink in subdirectory of self");Hi("ERR_FS_CP_UNKNOWN","Cannot copy an unknown file type");Hi("ERR_FS_EISDIR","Path is a directory");jy.exports.ERR_INVALID_ARG_TYPE=class extends Error{static{o(this,"ERR_INVALID_ARG_TYPE")}constructor(e,t,r){super(),this.code="ERR_INVALID_ARG_TYPE",this.message=`The ${e} argument must be ${t}. Received ${typeof r}`}}});var y1=d((Tpe,g1)=>{"use strict";var{ERR_FS_CP_DIR_TO_NON_DIR:l3,ERR_FS_CP_EEXIST:h3,ERR_FS_CP_EINVAL:nh,ERR_FS_CP_FIFO_PIPE:f3,ERR_FS_CP_NON_DIR_TO_DIR:d3,ERR_FS_CP_SOCKET:p3,ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY:m3,ERR_FS_CP_UNKNOWN:g3,ERR_FS_EISDIR:y3,ERR_INVALID_ARG_TYPE:S3}=XC(),{constants:{errno:{EEXIST:E3,EISDIR:w3,EINVAL:Gi,ENOTDIR:_3}}}=require("os"),{chmod:b3,copyFile:I3,lstat:a1,mkdir:c1,readdir:O3,readlink:QC,stat:vn,symlink:$y,unlink:u1,utimes:v3}=require("fs/promises"),{dirname:tc,isAbsolute:e1,join:t1,parse:R3,resolve:ic,sep:A3,toNamespacedPath:i1}=require("path"),{fileURLToPath:T3}=require("url"),C3={dereference:!1,errorOnExist:!1,filter:void 0,force:!0,preserveTimestamps:!1,recursive:!1};async function N3(i,e,t){if(t!=null&&typeof t!="object")throw new S3("options",["Object"],t);return P3(i1(r1(i)),i1(r1(e)),{...C3,...t})}o(N3,"cp");function r1(i){return i!=null&&i.href&&i.origin?T3(i):i}o(r1,"getValidatedPath");async function P3(i,e,t){t.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended","TimestampPrecisionWarning");let r=await l1(i,e,t),{srcStat:s,destStat:n}=r;return await f1(i,s,e),t.filter?d1(s1,n,i,e,t):s1(n,i,e,t)}o(P3,"cpFn");async function l1(i,e,t){let{0:r,1:s}=await D3(i,e,t);if(s){if(h1(r,s))throw new nh({message:"src and dest cannot be the same",path:e,syscall:"cp",errno:Gi});if(r.isDirectory()&&!s.isDirectory())throw new l3({message:`cannot overwrite directory ${i} with non-directory ${e}`,path:e,syscall:"cp",errno:w3});if(!r.isDirectory()&&s.isDirectory())throw new d3({message:`cannot overwrite non-directory ${i} with directory ${e}`,path:e,syscall:"cp",errno:_3})}if(r.isDirectory()&&qy(i,e))throw new nh({message:`cannot copy ${i} to a subdirectory of self ${e}`,path:e,syscall:"cp",errno:Gi});return{srcStat:r,destStat:s}}o(l1,"checkPaths");function h1(i,e){return e.ino&&e.dev&&e.ino===i.ino&&e.dev===i.dev}o(h1,"areIdentical");function D3(i,e,t){let r=t.dereference?s=>vn(s,{bigint:!0}):s=>a1(s,{bigint:!0});return Promise.all([r(i),r(e).catch(s=>{if(s.code==="ENOENT")return null;throw s})])}o(D3,"getStats");async function s1(i,e,t,r){let s=tc(t);return await x3(s)||await c1(s,{recursive:!0}),oh(i,e,t,r)}o(s1,"checkParentDir");function x3(i){return vn(i).then(()=>!0,e=>e.code==="ENOENT"?!1:Promise.reject(e))}o(x3,"pathExists");async function f1(i,e,t){let r=ic(tc(i)),s=ic(tc(t));if(s===r||s===R3(s).root)return;let n;try{n=await vn(s,{bigint:!0})}catch(a){if(a.code==="ENOENT")return;throw a}if(h1(e,n))throw new nh({message:`cannot copy ${i} to a subdirectory of self ${t}`,path:t,syscall:"cp",errno:Gi});return f1(i,e,s)}o(f1,"checkParentPaths");var n1=o(i=>ic(i).split(A3).filter(Boolean),"normalizePathToArray");function qy(i,e){let t=n1(i),r=n1(e);return t.every((s,n)=>r[n]===s)}o(qy,"isSrcSubdir");async function d1(i,e,t,r,s,n){if(await s.filter(t,r))return i(e,t,r,s,n)}o(d1,"handleFilter");function L3(i,e,t,r){return r.filter?d1(oh,i,e,t,r):oh(i,e,t,r)}o(L3,"startCopy");async function oh(i,e,t,r){let n=await(r.dereference?vn:a1)(e);if(n.isDirectory()&&r.recursive)return $3(n,i,e,t,r);if(n.isDirectory())throw new y3({message:`${e} is a directory (not copied)`,path:e,syscall:"cp",errno:Gi});if(n.isFile()||n.isCharacterDevice()||n.isBlockDevice())return M3(n,i,e,t,r);if(n.isSymbolicLink())return V3(i,e,t);throw n.isSocket()?new p3({message:`cannot copy a socket file: ${t}`,path:t,syscall:"cp",errno:Gi}):n.isFIFO()?new f3({message:`cannot copy a FIFO pipe: ${t}`,path:t,syscall:"cp",errno:Gi}):new g3({message:`cannot copy an unknown file type: ${t}`,path:t,syscall:"cp",errno:Gi})}o(oh,"getStatsForCopy");function M3(i,e,t,r,s){return e?B3(i,t,r,s):p1(i,t,r,s)}o(M3,"onFile");async function B3(i,e,t,r){if(r.force)return await u1(t),p1(i,e,t,r);if(r.errorOnExist)throw new h3({message:`${t} already exists`,path:t,syscall:"cp",errno:E3})}o(B3,"mayCopyFile");async function p1(i,e,t,r){return await I3(e,t),r.preserveTimestamps?k3(i.mode,e,t):ah(t,i.mode)}o(p1,"_copyFile");async function k3(i,e,t){return F3(i)&&await U3(t,i),o1(i,e,t)}o(k3,"handleTimestampsAndMode");function F3(i){return(i&128)===0}o(F3,"fileIsNotWritable");function U3(i,e){return ah(i,e|128)}o(U3,"makeFileWritable");async function o1(i,e,t){return await j3(e,t),ah(t,i)}o(o1,"setDestTimestampsAndMode");function ah(i,e){return b3(i,e)}o(ah,"setDestMode");async function j3(i,e){let t=await vn(i);return v3(e,t.atime,t.mtime)}o(j3,"setDestTimestamps");function $3(i,e,t,r,s){return e?m1(t,r,s):q3(i.mode,t,r,s)}o($3,"onDir");async function q3(i,e,t,r){return await c1(t),await m1(e,t,r),ah(t,i)}o(q3,"mkDirAndCopy");async function m1(i,e,t){let r=await O3(i);for(let s=0;s<r.length;s++){let n=r[s],a=t1(i,n),c=t1(e,n),{destStat:u}=await l1(a,c,t);await L3(u,a,c,t)}}o(m1,"copyDir");async function V3(i,e,t){let r=await QC(e);if(e1(r)||(r=ic(tc(e),r)),!i)return $y(r,t);let s;try{s=await QC(t)}catch(a){if(a.code==="EINVAL"||a.code==="UNKNOWN")return $y(r,t);throw a}if(e1(s)||(s=ic(tc(t),s)),qy(r,s))throw new nh({message:`cannot copy ${r} to a subdirectory of self ${s}`,path:t,syscall:"cp",errno:Gi});if((await vn(e)).isDirectory()&&qy(s,r))throw new m3({message:`cannot overwrite ${s} with ${r}`,path:t,syscall:"cp",errno:Gi});return z3(r,t)}o(V3,"onLink");async function z3(i,e){return await u1(e),$y(i,e)}o(z3,"copyLink");g1.exports=N3});var E1=d((Npe,S1)=>{var H3=require("fs/promises"),G3=Fy(),W3=YC(),J3=y1(),K3=W3.satisfies(">=16.7.0"),Z3=o(async(i,e,t)=>{let r=G3(t,{copy:["dereference","errorOnExist","filter","force","preserveTimestamps","recursive"]});return K3?H3.cp(i,e,r):J3(i,e,r)},"cp");S1.exports=Z3});var _1=d((Dpe,w1)=>{var{join:Y3,sep:X3}=require("path"),Q3=Fy(),{mkdir:e4,mkdtemp:t4,rm:i4}=require("fs/promises"),r4=o(async(i,e,t)=>{let r=Q3(t,{copy:["tmpPrefix"]});await e4(i,{recursive:!0});let s=await t4(Y3(`${i}${X3}`,r.tmpPrefix||"")),n,a;try{a=await e(s)}catch(c){n=c}try{await i4(s,{force:!0,recursive:!0})}catch{}if(n)throw n;return a},"withTempDir");w1.exports=r4});var v1=d((Lpe,O1)=>{var{readdir:b1}=require("fs/promises"),{join:I1}=require("path"),s4=o(async i=>{let e=[];for(let t of await b1(i))if(t.startsWith("@"))for(let r of await b1(I1(i,t)))e.push(I1(t,r));else e.push(t);return e},"readdirScoped");O1.exports=s4});var P1=d((Bpe,N1)=>{var{dirname:R1,join:A1,resolve:T1,relative:n4,isAbsolute:o4}=require("path"),ci=require("fs/promises"),a4=o(async i=>{try{return await ci.access(i),!0}catch(e){return e.code!=="ENOENT"}},"pathExists"),C1=o(async(i,e,t={},r=!0,s=[])=>{if(!i||!e)throw new TypeError("`source` and `destination` file required");if(t={overwrite:!0,...t},!t.overwrite&&await a4(e))throw new Error(`The destination file exists: ${e}`);await ci.mkdir(R1(e),{recursive:!0});try{await ci.rename(i,e)}catch(n){if(n.code==="EXDEV"||n.code==="EPERM"){let a=await ci.lstat(i);if(a.isDirectory()){let c=await ci.readdir(i);await Promise.all(c.map(u=>C1(A1(i,u),A1(e,u),t,!1,s)))}else a.isSymbolicLink()?s.push({source:i,destination:e}):await ci.copyFile(i,e)}else throw n}r&&(await Promise.all(s.map(async({source:n,destination:a})=>{let c=await ci.readlink(n);o4(c)&&(c=T1(a,n4(n,c)));let u="file";try{u=await ci.stat(T1(R1(n),c)),u.isDirectory()&&(u="junction")}catch{}await ci.symlink(c,a,u)})),await ci.rm(i,{recursive:!0,force:!0}))},"moveFile");N1.exports=C1});var ch=d((Fpe,D1)=>{"use strict";var c4=E1(),u4=_1(),l4=v1(),h4=P1();D1.exports={cp:c4,withTempDir:u4,readdirScoped:l4,moveFile:h4}});var uh={};$j(uh,{default:()=>x1,pMapIterable:()=>f4,pMapSkip:()=>rc});async function x1(i,e,{concurrency:t=Number.POSITIVE_INFINITY,stopOnError:r=!0,signal:s}={}){return new Promise((n,a)=>{if(i[Symbol.iterator]===void 0&&i[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof i})`);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=[],u=[],l=new Map,h=!1,f=!1,p=!1,m=0,y=0,g=i[Symbol.iterator]===void 0?i[Symbol.asyncIterator]():i[Symbol.iterator](),S=o(()=>{b(s.reason)},"signalListener"),E=o(()=>{s?.removeEventListener("abort",S)},"cleanup"),_=o(I=>{n(I),E()},"resolve"),b=o(I=>{h=!0,f=!0,a(I),E()},"reject");s&&(s.aborted&&b(s.reason),s.addEventListener("abort",S,{once:!0}));let w=o(async()=>{if(f)return;let I=await g.next(),v=y;if(y++,I.done){if(p=!0,m===0&&!f){if(!r&&u.length>0){b(new AggregateError(u));return}if(f=!0,l.size===0){_(c);return}let N=[];for(let[P,$]of c.entries())l.get(P)!==rc&&N.push($);_(N)}return}m++,(async()=>{try{let N=await I.value;if(f)return;let P=await e(N,v);P===rc&&l.set(v,P),c[v]=P,m--,await w()}catch(N){if(r)b(N);else{u.push(N),m--;try{await w()}catch(P){b(P)}}}})()},"next");(async()=>{for(let I=0;I<t;I++){try{await w()}catch(v){b(v);break}if(p||h)break}})()})}function f4(i,e,{concurrency:t=Number.POSITIVE_INFINITY,backpressure:r=t}={}){if(i[Symbol.iterator]===void 0&&i[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof i})`);if(typeof e!="function")throw new TypeError("Mapper function is required");if(!(Number.isSafeInteger(t)&&t>=1||t===Number.POSITIVE_INFINITY))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${t}\` (${typeof t})`);if(!(Number.isSafeInteger(r)&&r>=t||r===Number.POSITIVE_INFINITY))throw new TypeError(`Expected \`backpressure\` to be an integer from \`concurrency\` (${t}) and up or \`Infinity\`, got \`${r}\` (${typeof r})`);return{async*[Symbol.asyncIterator](){let s=i[Symbol.asyncIterator]===void 0?i[Symbol.iterator]():i[Symbol.asyncIterator](),n=[],a=0,c=!1,u=0;function l(){if(c||!(a<t&&n.length<r))return;let h=(async()=>{let{done:f,value:p}=await s.next();if(f)return{done:!0};a++,l();try{let m=await e(await p,u++);if(a--,m===rc){let y=n.indexOf(h);y>0&&n.splice(y,1)}return l(),{done:!1,value:m}}catch(m){return c=!0,{error:m}}})();n.push(h)}for(o(l,"trySpawn"),l();n.length>0;){let{error:h,done:f,value:p}=await n[0];if(n.shift(),h)throw h;if(f)return;l(),p!==rc&&(yield p)}}}}var rc,lh=jj(()=>{o(x1,"pMap");o(f4,"pMapIterable");rc=Symbol("skip")});var Rn=d(($pe,ht)=>{"use strict";var d4=require("crypto"),{appendFile:p4,mkdir:Hy,readFile:m4,readdir:g4,rm:L1,writeFile:y4}=require("fs/promises"),{Minipass:S4}=te(),ui=require("path"),E4=ai(),w4=Ly(),_4=On(),b4=By(),I4=My()["cache-version"].index,{moveFile:O4}=ch(),Vy=5;ht.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}};ht.exports.compact=v4;async function v4(i,e,t,r={}){let s=sc(i,e),n=await hh(s),a=[];for(let p=n.length-1;p>=0;--p){let m=n[p];if(m.integrity===null&&!r.validateEntry)break;(!r.validateEntry||r.validateEntry(m)===!0)&&(a.length===0||!a.find(y=>t(y,m)))&&a.unshift(m)}let c=`
22
23
  `+a.map(p=>{let m=JSON.stringify(p);return`${fh(m)} ${m}`}).join(`
23
- `),u=o(async()=>{let p=S4(ui.join(i,"tmp"),r.tmpPrefix);return await Hy(ui.dirname(p),{recursive:!0}),{target:p,moved:!1}},"setup"),l=o(async p=>{if(!p.moved)return L1(p.target,{recursive:!0,force:!0})},"teardown"),h=o(async p=>{await m4(p.target,c,{flag:"wx"}),await Hy(ui.dirname(s),{recursive:!0}),await b4(p.target,s),p.moved=!0},"write"),f=await u();try{await h(f)}finally{await l(f)}return a.reverse().map(p=>dh(i,p,!0))}o(I4,"compact");ht.exports.insert=M1;async function M1(i,e,t,r={}){let{metadata:s,size:n,time:a}=r,c=sc(i,e),u={key:e,integrity:t&&y4.stringify(t),time:a||Date.now(),size:n,metadata:s};try{await Hy(ui.dirname(c),{recursive:!0});let l=JSON.stringify(u);await f4(c,`
24
- ${fh(l)} ${l}`)}catch(l){if(l.code==="ENOENT")return;throw l}return dh(i,u)}o(M1,"insert");ht.exports.find=O4;async function O4(i,e){let t=sc(i,e);try{return(await hh(t)).reduce((s,n)=>n&&n.key===e?dh(i,n):s,null)}catch(r){if(r.code==="ENOENT")return null;throw r}}o(O4,"find");ht.exports.delete=v4;function v4(i,e,t={}){if(!t.removeFully)return M1(i,e,null,t);let r=sc(i,e);return L1(r,{recursive:!0,force:!0})}o(v4,"del");ht.exports.lsStream=B1;function B1(i){let e=Gy(i),t=new g4({objectMode:!0});return Promise.resolve().then(async()=>{let{default:r}=await Promise.resolve().then(()=>(lh(),uh)),s=await zy(e);return await r(s,async n=>{let a=ui.join(e,n),c=await zy(a);await r(c,async u=>{let l=ui.join(a,u),h=await zy(l);await r(h,async f=>{let p=ui.join(l,f);try{let y=(await hh(p)).reduce((g,S)=>(g.set(S.key,S),g),new Map);for(let g of y.values()){let S=dh(i,g);S&&t.write(S)}}catch(m){if(m.code==="ENOENT")return;throw m}},{concurrency:Vy})},{concurrency:Vy})},{concurrency:Vy}),t.end(),t}).catch(r=>t.emit("error",r)),t}o(B1,"lsStream");ht.exports.ls=R4;async function R4(i){return(await B1(i).collect()).reduce((t,r)=>(t[r.key]=r,t),{})}o(R4,"ls");ht.exports.bucketEntries=hh;async function hh(i,e){let t=await d4(i,"utf8");return A4(t,e)}o(hh,"bucketEntries");function A4(i){let e=[];return i.split(`
25
- `).forEach(t=>{if(!t)return;let r=t.split(" ");if(!r[1]||fh(r[1])!==r[0])return;let s;try{s=JSON.parse(r[1])}catch{}s&&e.push(s)}),e}o(A4,"_bucketEntries");ht.exports.bucketDir=Gy;function Gy(i){return ui.join(i,`index-v${_4}`)}o(Gy,"bucketDir");ht.exports.bucketPath=sc;function sc(i,e){let t=k1(e);return ui.join.apply(ui,[Gy(i)].concat(w4(t)))}o(sc,"bucketPath");ht.exports.hashKey=k1;function k1(i){return F1(i,"sha256")}o(k1,"hashKey");ht.exports.hashEntry=fh;function fh(i){return F1(i,"sha1")}o(fh,"hashEntry");function F1(i,e){return h4.createHash(e).update(i).digest("hex")}o(F1,"hash");function dh(i,e,t){return!e.integrity&&!t?null:{key:e.key,integrity:e.integrity,path:e.integrity?E4(i,e.integrity):void 0,size:e.size,time:e.time,metadata:e.metadata}}o(dh,"formatEntry");function zy(i){return p4(i).catch(e=>{if(e.code==="ENOENT"||e.code==="ENOTDIR")return[];throw e})}o(zy,"readdirOrEmpty")});var nc=d(($pe,An)=>{"use strict";var{LRUCache:T4}=os(),ph=new T4({max:500,maxSize:50*1024*1024,ttl:180*1e3,sizeCalculation:o((i,e)=>e.startsWith("key:")?i.data.length:i.length,"sizeCalculation")});An.exports.clearMemoized=C4;function C4(){let i={};return ph.forEach((e,t)=>{i[t]=e}),ph.clear(),i}o(C4,"clearMemoized");An.exports.put=N4;function N4(i,e,t,r){mh(r).set(`key:${i}:${e.key}`,{entry:e,data:t}),U1(i,e.integrity,t,r)}o(N4,"put");An.exports.put.byDigest=U1;function U1(i,e,t,r){mh(r).set(`digest:${i}:${e}`,t)}o(U1,"putDigest");An.exports.get=P4;function P4(i,e,t){return mh(t).get(`key:${i}:${e}`)}o(P4,"get");An.exports.get.byDigest=D4;function D4(i,e,t){return mh(t).get(`digest:${i}:${e}`)}o(D4,"getDigest");var Wy=class{static{o(this,"ObjProxy")}constructor(e){this.obj=e}get(e){return this.obj[e]}set(e,t){this.obj[e]=t}};function mh(i){return!i||!i.memoize?ph:i.memoize.get&&i.memoize.set?i.memoize:typeof i.memoize=="object"?new Wy(i.memoize):ph}o(mh,"pickMem")});var Ln=d(ac=>{"use strict";var{Minipass:x4}=te(),L4=require("events").EventEmitter,Xe=require("fs"),M4=Xe.writev,Dn=Symbol("_autoClose"),Ht=Symbol("_close"),oc=Symbol("_ended"),Z=Symbol("_fd"),j1=Symbol("_finished"),_r=Symbol("_flags"),Jy=Symbol("_flush"),Zy=Symbol("_handleChunk"),Yy=Symbol("_makeBuf"),wh=Symbol("_mode"),gh=Symbol("_needDrain"),Nn=Symbol("_onerror"),xn=Symbol("_onopen"),Ky=Symbol("_onread"),Tn=Symbol("_onwrite"),br=Symbol("_open"),Wi=Symbol("_path"),Ss=Symbol("_pos"),li=Symbol("_queue"),Cn=Symbol("_read"),$1=Symbol("_readSize"),wr=Symbol("_reading"),yh=Symbol("_remain"),q1=Symbol("_size"),Sh=Symbol("_write"),ys=Symbol("_writing"),Eh=Symbol("_defaultFlag"),Pn=Symbol("_errored"),_h=class extends x4{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[Pn]=!1,this[Z]=typeof t.fd=="number"?t.fd:null,this[Wi]=e,this[$1]=t.readSize||16*1024*1024,this[wr]=!1,this[q1]=typeof t.size=="number"?t.size:1/0,this[yh]=this[q1],this[Dn]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[Z]=="number"?this[Cn]():this[br]()}get fd(){return this[Z]}get path(){return this[Wi]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[br](){Xe.open(this[Wi],"r",(e,t)=>this[xn](e,t))}[xn](e,t){e?this[Nn](e):(this[Z]=t,this.emit("open",t),this[Cn]())}[Yy](){return Buffer.allocUnsafe(Math.min(this[$1],this[yh]))}[Cn](){if(!this[wr]){this[wr]=!0;let e=this[Yy]();if(e.length===0)return process.nextTick(()=>this[Ky](null,0,e));Xe.read(this[Z],e,0,e.length,null,(t,r,s)=>this[Ky](t,r,s))}}[Ky](e,t,r){this[wr]=!1,e?this[Nn](e):this[Zy](t,r)&&this[Cn]()}[Ht](){if(this[Dn]&&typeof this[Z]=="number"){let e=this[Z];this[Z]=null,Xe.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[Nn](e){this[wr]=!0,this[Ht](),this.emit("error",e)}[Zy](e,t){let r=!1;return this[yh]-=e,e>0&&(r=super.write(e<t.length?t.slice(0,e):t)),(e===0||this[yh]<=0)&&(r=!1,this[Ht](),super.end()),r}emit(e,t){switch(e){case"prefinish":case"finish":break;case"drain":typeof this[Z]=="number"&&this[Cn]();break;case"error":return this[Pn]?void 0:(this[Pn]=!0,super.emit(e,t));default:return super.emit(e,t)}}},Xy=class extends _h{static{o(this,"ReadStreamSync")}[br](){let e=!0;try{this[xn](null,Xe.openSync(this[Wi],"r")),e=!1}finally{e&&this[Ht]()}}[Cn](){let e=!0;try{if(!this[wr]){this[wr]=!0;do{let t=this[Yy](),r=t.length===0?0:Xe.readSync(this[Z],t,0,t.length,null);if(!this[Zy](r,t))break}while(!0);this[wr]=!1}e=!1}finally{e&&this[Ht]()}}[Ht](){if(this[Dn]&&typeof this[Z]=="number"){let e=this[Z];this[Z]=null,Xe.closeSync(e),this.emit("close")}}},bh=class extends L4{static{o(this,"WriteStream")}constructor(e,t){t=t||{},super(t),this.readable=!1,this.writable=!0,this[Pn]=!1,this[ys]=!1,this[oc]=!1,this[gh]=!1,this[li]=[],this[Wi]=e,this[Z]=typeof t.fd=="number"?t.fd:null,this[wh]=t.mode===void 0?438:t.mode,this[Ss]=typeof t.start=="number"?t.start:null,this[Dn]=typeof t.autoClose=="boolean"?t.autoClose:!0;let r=this[Ss]!==null?"r+":"w";this[Eh]=t.flags===void 0,this[_r]=this[Eh]?r:t.flags,this[Z]===null&&this[br]()}emit(e,t){if(e==="error"){if(this[Pn])return;this[Pn]=!0}return super.emit(e,t)}get fd(){return this[Z]}get path(){return this[Wi]}[Nn](e){this[Ht](),this[ys]=!0,this.emit("error",e)}[br](){Xe.open(this[Wi],this[_r],this[wh],(e,t)=>this[xn](e,t))}[xn](e,t){this[Eh]&&this[_r]==="r+"&&e&&e.code==="ENOENT"?(this[_r]="w",this[br]()):e?this[Nn](e):(this[Z]=t,this.emit("open",t),this[ys]||this[Jy]())}end(e,t){return e&&this.write(e,t),this[oc]=!0,!this[ys]&&!this[li].length&&typeof this[Z]=="number"&&this[Tn](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[oc]?(this.emit("error",new Error("write() after end()")),!1):this[Z]===null||this[ys]||this[li].length?(this[li].push(e),this[gh]=!0,!1):(this[ys]=!0,this[Sh](e),!0)}[Sh](e){Xe.write(this[Z],e,0,e.length,this[Ss],(t,r)=>this[Tn](t,r))}[Tn](e,t){e?this[Nn](e):(this[Ss]!==null&&(this[Ss]+=t),this[li].length?this[Jy]():(this[ys]=!1,this[oc]&&!this[j1]?(this[j1]=!0,this[Ht](),this.emit("finish")):this[gh]&&(this[gh]=!1,this.emit("drain"))))}[Jy](){if(this[li].length===0)this[oc]&&this[Tn](null,0);else if(this[li].length===1)this[Sh](this[li].pop());else{let e=this[li];this[li]=[],M4(this[Z],e,this[Ss],(t,r)=>this[Tn](t,r))}}[Ht](){if(this[Dn]&&typeof this[Z]=="number"){let e=this[Z];this[Z]=null,Xe.close(e,t=>t?this.emit("error",t):this.emit("close"))}}},Qy=class extends bh{static{o(this,"WriteStreamSync")}[br](){let e;if(this[Eh]&&this[_r]==="r+")try{e=Xe.openSync(this[Wi],this[_r],this[wh])}catch(t){if(t.code==="ENOENT")return this[_r]="w",this[br]();throw t}else e=Xe.openSync(this[Wi],this[_r],this[wh]);this[xn](null,e)}[Ht](){if(this[Dn]&&typeof this[Z]=="number"){let e=this[Z];this[Z]=null,Xe.closeSync(e),this.emit("close")}}[Sh](e){let t=!0;try{this[Tn](null,Xe.writeSync(this[Z],e,0,e.length,this[Ss])),t=!1}finally{if(t)try{this[Ht]()}catch{}}}};ac.ReadStream=_h;ac.ReadStreamSync=Xy;ac.WriteStream=bh;ac.WriteStreamSync=Qy});var tS=d((Hpe,Mn)=>{"use strict";var cc=require("fs/promises"),B4=Ln(),eS=ai(),k4=On(),V1=In();Mn.exports=F4;var z1=64*1024*1024;async function F4(i,e,t={}){let{size:r}=t,{stat:s,cpath:n,sri:a}=await uc(i,e,async(u,l)=>({stat:r?{size:r}:await cc.stat(u),cpath:u,sri:l}));if(s.size>z1)return H1(n,s.size,a,new V1).concat();let c=await cc.readFile(n,{encoding:null});if(s.size!==c.length)throw $4(s.size,c.length);if(!eS.checkData(c,a))throw q4(a,n);return c}o(F4,"read");var H1=o((i,e,t,r)=>(r.push(new B4.ReadStream(i,{size:e,readSize:z1}),eS.integrityStream({integrity:t,size:e})),r),"readPipeline");Mn.exports.stream=G1;Mn.exports.readStream=G1;function G1(i,e,t={}){let{size:r}=t,s=new V1;return Promise.resolve().then(async()=>{let{stat:n,cpath:a,sri:c}=await uc(i,e,async(u,l)=>({stat:r?{size:r}:await cc.stat(u),cpath:u,sri:l}));return H1(a,n.size,c,s)}).catch(n=>s.emit("error",n)),s}o(G1,"readStream");Mn.exports.copy=U4;function U4(i,e,t){return uc(i,e,r=>cc.copyFile(r,t))}o(U4,"copy");Mn.exports.hasContent=j4;async function j4(i,e){if(!e)return!1;try{return await uc(i,e,async(t,r)=>{let s=await cc.stat(t);return{size:s.size,sri:r,stat:s}})}catch(t){if(t.code==="ENOENT")return!1;if(t.code==="EPERM"){if(process.platform!=="win32")throw t;return!1}}}o(j4,"hasContent");async function uc(i,e,t){let r=eS.parse(e),s=r.pickAlgorithm(),n=r[s];if(n.length<=1){let a=k4(i,n[0]);return t(a,n[0])}else{let a=await Promise.all(n.map(async l=>{try{return await uc(i,l,t)}catch(h){return h.code==="ENOENT"?Object.assign(new Error("No matching content found for "+r.toString()),{code:"ENOENT"}):h}})),c=a.find(l=>!(l instanceof Error));if(c)return c;let u=a.find(l=>l.code==="ENOENT");throw u||a.find(l=>l instanceof Error)}}o(uc,"withContentSri");function $4(i,e){let t=new Error(`Bad data size: expected inserted data to be ${i} bytes, but got ${e} instead`);return t.expected=i,t.found=e,t.code="EBADSIZE",t}o($4,"sizeError");function q4(i,e){let t=new Error(`Integrity verification failed for ${i} (${e})`);return t.code="EINTEGRITY",t.sri=i,t.path=e,t}o(q4,"integrityError")});var Z1=d((Wpe,Ki)=>{"use strict";var W1=yy(),{Minipass:J1}=te(),K1=In(),Es=Rn(),Ji=nc(),ws=tS();async function V4(i,e,t={}){let{integrity:r,memoize:s,size:n}=t,a=Ji.get(i,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 Es.find(i,e,t);if(!c)throw new Es.NotFoundError(i,e);let u=await ws(i,c.integrity,{integrity:r,size:n});return s&&Ji.put(i,c,u,t),{data:u,metadata:c.metadata,size:c.size,integrity:c.integrity}}o(V4,"getData");Ki.exports=V4;async function z4(i,e,t={}){let{integrity:r,memoize:s,size:n}=t,a=Ji.get.byDigest(i,e,t);if(a&&s!==!1)return a;let c=await ws(i,e,{integrity:r,size:n});return s&&Ji.put.byDigest(i,e,c,t),c}o(z4,"getDataByDigest");Ki.exports.byDigest=z4;var H4=o(i=>{let e=new J1;return e.on("newListener",function(t,r){t==="metadata"&&r(i.entry.metadata),t==="integrity"&&r(i.entry.integrity),t==="size"&&r(i.entry.size)}),e.end(i.data),e},"getMemoizedStream");function G4(i,e,t={}){let{memoize:r,size:s}=t,n=Ji.get(i,e,t);if(n&&r!==!1)return H4(n);let a=new K1;return Promise.resolve().then(async()=>{let c=await Es.find(i,e);if(!c)throw new Es.NotFoundError(i,e);a.emit("metadata",c.metadata),a.emit("integrity",c.integrity),a.emit("size",c.size),a.on("newListener",function(l,h){l==="metadata"&&h(c.metadata),l==="integrity"&&h(c.integrity),l==="size"&&h(c.size)});let u=ws.readStream(i,c.integrity,{...t,size:typeof s!="number"?c.size:s});if(r){let l=new W1.PassThrough;l.on("collect",h=>Ji.put(i,c,h,t)),a.unshift(l)}return a.unshift(u),a}).catch(c=>a.emit("error",c)),a}o(G4,"getStream");Ki.exports.stream=G4;function W4(i,e,t={}){let{memoize:r}=t,s=Ji.get.byDigest(i,e,t);if(s&&r!==!1){let n=new J1;return n.end(s),n}else{let n=ws.readStream(i,e,t);if(!r)return n;let a=new W1.PassThrough;return a.on("collect",c=>Ji.put.byDigest(i,e,c,t)),new K1(n,a)}}o(W4,"getStreamDigest");Ki.exports.stream.byDigest=W4;function J4(i,e,t={}){let{memoize:r}=t,s=Ji.get(i,e,t);return s&&r!==!1?Promise.resolve(s.entry):Es.find(i,e)}o(J4,"info");Ki.exports.info=J4;async function K4(i,e,t,r={}){let s=await Es.find(i,e,r);if(!s)throw new Es.NotFoundError(i,e);return await ws.copy(i,s.integrity,t,r),{metadata:s.metadata,size:s.size,integrity:s.integrity}}o(K4,"copy");Ki.exports.copy=K4;async function Z4(i,e,t,r={}){return await ws.copy(i,e,t,r),e}o(Z4,"copyByDigest");Ki.exports.copy.byDigest=Z4;Ki.exports.hasContent=ws.hasContent});var Ih=d((Kpe,eN)=>{var Y4=rh(),Y1=Symbol("_flush"),X1=Symbol("_flushed"),Q1=Symbol("_flushing"),iS=class extends Y4{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[Y1]=e.flush||this.flush}emit(e,...t){if(e!=="end"&&e!=="finish"||this[X1])return super.emit(e,...t);if(this[Q1])return;this[Q1]=!0;let r=o(n=>{this[X1]=!0,n?super.emit("error",n):super.emit("end")},"afterFlush"),s=this[Y1](r);s&&s.then&&s.then(()=>r(),n=>r(n))}};eN.exports=iS});var nN=d((Ype,oS)=>{"use strict";var tN=require("events"),X4=On(),hc=require("fs/promises"),{moveFile:Q4}=ch(),{Minipass:eJ}=te(),iN=In(),tJ=Ih(),rS=require("path"),sS=ai(),iJ=Ly(),rJ=Ln();oS.exports=sJ;var lc=new Map;async function sJ(i,e,t={}){let{algorithms:r,size:s,integrity:n}=t;if(typeof s=="number"&&e.length!==s)throw cJ(s,e.length);let a=sS.fromData(e,r?{algorithms:r}:{});if(n&&!sS.checkData(e,n,t))throw uJ(n,a);for(let c in a){let u=await rN(i,t),l=a[c].toString();try{await hc.writeFile(u.target,e,{flag:"wx"}),await sN(u,i,l,t)}finally{u.moved||await hc.rm(u.target,{recursive:!0,force:!0})}}return{integrity:a,size:e.length}}o(sJ,"write");oS.exports.stream=nJ;var nS=class extends tJ{static{o(this,"CacacheWriteStream")}constructor(e,t){super(),this.opts=t,this.cache=e,this.inputStream=new eJ,this.inputStream.on("error",r=>this.emit("error",r)),this.inputStream.on("drain",()=>this.emit("drain")),this.handleContentP=null}write(e,t,r){return this.handleContentP||(this.handleContentP=oJ(this.inputStream,this.cache,this.opts),this.handleContentP.catch(s=>this.emit("error",s))),this.inputStream.write(e,t,r)}flush(e){this.inputStream.end(()=>{if(!this.handleContentP){let t=new Error("Cache input stream was empty");return t.code="ENODATA",Promise.reject(t).catch(e)}this.handleContentP.then(t=>{t.integrity&&this.emit("integrity",t.integrity),t.size!==null&&this.emit("size",t.size),e()},t=>e(t))})}};function nJ(i,e={}){return new nS(i,e)}o(nJ,"writeStream");async function oJ(i,e,t){let r=await rN(e,t);try{let s=await aJ(i,e,r.target,t);return await sN(r,e,s.integrity,t),s}finally{r.moved||await hc.rm(r.target,{recursive:!0,force:!0})}}o(oJ,"handleContent");async function aJ(i,e,t,r){let s=new rJ.WriteStream(t,{flags:"wx"});if(r.integrityEmitter){let[l,h]=await Promise.all([tN.once(r.integrityEmitter,"integrity").then(f=>f[0]),tN.once(r.integrityEmitter,"size").then(f=>f[0]),new iN(i,s).promise()]);return{integrity:l,size:h}}let n,a,c=sS.integrityStream({integrity:r.integrity,algorithms:r.algorithms,size:r.size});return c.on("integrity",l=>{n=l}),c.on("size",l=>{a=l}),await new iN(i,c,s).promise(),{integrity:n,size:a}}o(aJ,"pipeToTmp");async function rN(i,e){let t=iJ(rS.join(i,"tmp"),e.tmpPrefix);return await hc.mkdir(rS.dirname(t),{recursive:!0}),{target:t,moved:!1}}o(rN,"makeTmp");async function sN(i,e,t){let r=X4(e,t),s=rS.dirname(r);return lc.has(r)||lc.set(r,hc.mkdir(s,{recursive:!0}).then(async()=>(await Q4(i.target,r,{overwrite:!1}),i.moved=!0,i.moved)).catch(n=>{if(!n.message.startsWith("The destination file exists"))throw Object.assign(n,{code:"EEXIST"})}).finally(()=>{lc.delete(r)})),lc.get(r)}o(sN,"moveToDestination");function cJ(i,e){let t=new Error(`Bad data size: expected inserted data to be ${i} bytes, but got ${e} instead`);return t.expected=i,t.found=e,t.code="EBADSIZE",t}o(cJ,"sizeError");function uJ(i,e){let t=new Error(`Integrity check failed:
24
+ `),u=o(async()=>{let p=w4(ui.join(i,"tmp"),r.tmpPrefix);return await Hy(ui.dirname(p),{recursive:!0}),{target:p,moved:!1}},"setup"),l=o(async p=>{if(!p.moved)return L1(p.target,{recursive:!0,force:!0})},"teardown"),h=o(async p=>{await y4(p.target,c,{flag:"wx"}),await Hy(ui.dirname(s),{recursive:!0}),await O4(p.target,s),p.moved=!0},"write"),f=await u();try{await h(f)}finally{await l(f)}return a.reverse().map(p=>dh(i,p,!0))}o(v4,"compact");ht.exports.insert=M1;async function M1(i,e,t,r={}){let{metadata:s,size:n,time:a}=r,c=sc(i,e),u={key:e,integrity:t&&E4.stringify(t),time:a||Date.now(),size:n,metadata:s};try{await Hy(ui.dirname(c),{recursive:!0});let l=JSON.stringify(u);await p4(c,`
25
+ ${fh(l)} ${l}`)}catch(l){if(l.code==="ENOENT")return;throw l}return dh(i,u)}o(M1,"insert");ht.exports.find=R4;async function R4(i,e){let t=sc(i,e);try{return(await hh(t)).reduce((s,n)=>n&&n.key===e?dh(i,n):s,null)}catch(r){if(r.code==="ENOENT")return null;throw r}}o(R4,"find");ht.exports.delete=A4;function A4(i,e,t={}){if(!t.removeFully)return M1(i,e,null,t);let r=sc(i,e);return L1(r,{recursive:!0,force:!0})}o(A4,"del");ht.exports.lsStream=B1;function B1(i){let e=Gy(i),t=new S4({objectMode:!0});return Promise.resolve().then(async()=>{let{default:r}=await Promise.resolve().then(()=>(lh(),uh)),s=await zy(e);return await r(s,async n=>{let a=ui.join(e,n),c=await zy(a);await r(c,async u=>{let l=ui.join(a,u),h=await zy(l);await r(h,async f=>{let p=ui.join(l,f);try{let y=(await hh(p)).reduce((g,S)=>(g.set(S.key,S),g),new Map);for(let g of y.values()){let S=dh(i,g);S&&t.write(S)}}catch(m){if(m.code==="ENOENT")return;throw m}},{concurrency:Vy})},{concurrency:Vy})},{concurrency:Vy}),t.end(),t}).catch(r=>t.emit("error",r)),t}o(B1,"lsStream");ht.exports.ls=T4;async function T4(i){return(await B1(i).collect()).reduce((t,r)=>(t[r.key]=r,t),{})}o(T4,"ls");ht.exports.bucketEntries=hh;async function hh(i,e){let t=await m4(i,"utf8");return C4(t,e)}o(hh,"bucketEntries");function C4(i){let e=[];return i.split(`
26
+ `).forEach(t=>{if(!t)return;let r=t.split(" ");if(!r[1]||fh(r[1])!==r[0])return;let s;try{s=JSON.parse(r[1])}catch{}s&&e.push(s)}),e}o(C4,"_bucketEntries");ht.exports.bucketDir=Gy;function Gy(i){return ui.join(i,`index-v${I4}`)}o(Gy,"bucketDir");ht.exports.bucketPath=sc;function sc(i,e){let t=k1(e);return ui.join.apply(ui,[Gy(i)].concat(b4(t)))}o(sc,"bucketPath");ht.exports.hashKey=k1;function k1(i){return F1(i,"sha256")}o(k1,"hashKey");ht.exports.hashEntry=fh;function fh(i){return F1(i,"sha1")}o(fh,"hashEntry");function F1(i,e){return d4.createHash(e).update(i).digest("hex")}o(F1,"hash");function dh(i,e,t){return!e.integrity&&!t?null:{key:e.key,integrity:e.integrity,path:e.integrity?_4(i,e.integrity):void 0,size:e.size,time:e.time,metadata:e.metadata}}o(dh,"formatEntry");function zy(i){return g4(i).catch(e=>{if(e.code==="ENOENT"||e.code==="ENOTDIR")return[];throw e})}o(zy,"readdirOrEmpty")});var nc=d((Vpe,An)=>{"use strict";var{LRUCache:N4}=os(),ph=new N4({max:500,maxSize:50*1024*1024,ttl:180*1e3,sizeCalculation:o((i,e)=>e.startsWith("key:")?i.data.length:i.length,"sizeCalculation")});An.exports.clearMemoized=P4;function P4(){let i={};return ph.forEach((e,t)=>{i[t]=e}),ph.clear(),i}o(P4,"clearMemoized");An.exports.put=D4;function D4(i,e,t,r){mh(r).set(`key:${i}:${e.key}`,{entry:e,data:t}),U1(i,e.integrity,t,r)}o(D4,"put");An.exports.put.byDigest=U1;function U1(i,e,t,r){mh(r).set(`digest:${i}:${e}`,t)}o(U1,"putDigest");An.exports.get=x4;function x4(i,e,t){return mh(t).get(`key:${i}:${e}`)}o(x4,"get");An.exports.get.byDigest=L4;function L4(i,e,t){return mh(t).get(`digest:${i}:${e}`)}o(L4,"getDigest");var Wy=class{static{o(this,"ObjProxy")}constructor(e){this.obj=e}get(e){return this.obj[e]}set(e,t){this.obj[e]=t}};function mh(i){return!i||!i.memoize?ph:i.memoize.get&&i.memoize.set?i.memoize:typeof i.memoize=="object"?new Wy(i.memoize):ph}o(mh,"pickMem")});var Ln=d(ac=>{"use strict";var{Minipass:M4}=te(),B4=require("events").EventEmitter,Xe=require("fs"),k4=Xe.writev,Dn=Symbol("_autoClose"),Ht=Symbol("_close"),oc=Symbol("_ended"),Z=Symbol("_fd"),j1=Symbol("_finished"),_r=Symbol("_flags"),Jy=Symbol("_flush"),Zy=Symbol("_handleChunk"),Yy=Symbol("_makeBuf"),wh=Symbol("_mode"),gh=Symbol("_needDrain"),Nn=Symbol("_onerror"),xn=Symbol("_onopen"),Ky=Symbol("_onread"),Tn=Symbol("_onwrite"),br=Symbol("_open"),Wi=Symbol("_path"),Ss=Symbol("_pos"),li=Symbol("_queue"),Cn=Symbol("_read"),$1=Symbol("_readSize"),wr=Symbol("_reading"),yh=Symbol("_remain"),q1=Symbol("_size"),Sh=Symbol("_write"),ys=Symbol("_writing"),Eh=Symbol("_defaultFlag"),Pn=Symbol("_errored"),_h=class extends M4{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[Pn]=!1,this[Z]=typeof t.fd=="number"?t.fd:null,this[Wi]=e,this[$1]=t.readSize||16*1024*1024,this[wr]=!1,this[q1]=typeof t.size=="number"?t.size:1/0,this[yh]=this[q1],this[Dn]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[Z]=="number"?this[Cn]():this[br]()}get fd(){return this[Z]}get path(){return this[Wi]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[br](){Xe.open(this[Wi],"r",(e,t)=>this[xn](e,t))}[xn](e,t){e?this[Nn](e):(this[Z]=t,this.emit("open",t),this[Cn]())}[Yy](){return Buffer.allocUnsafe(Math.min(this[$1],this[yh]))}[Cn](){if(!this[wr]){this[wr]=!0;let e=this[Yy]();if(e.length===0)return process.nextTick(()=>this[Ky](null,0,e));Xe.read(this[Z],e,0,e.length,null,(t,r,s)=>this[Ky](t,r,s))}}[Ky](e,t,r){this[wr]=!1,e?this[Nn](e):this[Zy](t,r)&&this[Cn]()}[Ht](){if(this[Dn]&&typeof this[Z]=="number"){let e=this[Z];this[Z]=null,Xe.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[Nn](e){this[wr]=!0,this[Ht](),this.emit("error",e)}[Zy](e,t){let r=!1;return this[yh]-=e,e>0&&(r=super.write(e<t.length?t.slice(0,e):t)),(e===0||this[yh]<=0)&&(r=!1,this[Ht](),super.end()),r}emit(e,t){switch(e){case"prefinish":case"finish":break;case"drain":typeof this[Z]=="number"&&this[Cn]();break;case"error":return this[Pn]?void 0:(this[Pn]=!0,super.emit(e,t));default:return super.emit(e,t)}}},Xy=class extends _h{static{o(this,"ReadStreamSync")}[br](){let e=!0;try{this[xn](null,Xe.openSync(this[Wi],"r")),e=!1}finally{e&&this[Ht]()}}[Cn](){let e=!0;try{if(!this[wr]){this[wr]=!0;do{let t=this[Yy](),r=t.length===0?0:Xe.readSync(this[Z],t,0,t.length,null);if(!this[Zy](r,t))break}while(!0);this[wr]=!1}e=!1}finally{e&&this[Ht]()}}[Ht](){if(this[Dn]&&typeof this[Z]=="number"){let e=this[Z];this[Z]=null,Xe.closeSync(e),this.emit("close")}}},bh=class extends B4{static{o(this,"WriteStream")}constructor(e,t){t=t||{},super(t),this.readable=!1,this.writable=!0,this[Pn]=!1,this[ys]=!1,this[oc]=!1,this[gh]=!1,this[li]=[],this[Wi]=e,this[Z]=typeof t.fd=="number"?t.fd:null,this[wh]=t.mode===void 0?438:t.mode,this[Ss]=typeof t.start=="number"?t.start:null,this[Dn]=typeof t.autoClose=="boolean"?t.autoClose:!0;let r=this[Ss]!==null?"r+":"w";this[Eh]=t.flags===void 0,this[_r]=this[Eh]?r:t.flags,this[Z]===null&&this[br]()}emit(e,t){if(e==="error"){if(this[Pn])return;this[Pn]=!0}return super.emit(e,t)}get fd(){return this[Z]}get path(){return this[Wi]}[Nn](e){this[Ht](),this[ys]=!0,this.emit("error",e)}[br](){Xe.open(this[Wi],this[_r],this[wh],(e,t)=>this[xn](e,t))}[xn](e,t){this[Eh]&&this[_r]==="r+"&&e&&e.code==="ENOENT"?(this[_r]="w",this[br]()):e?this[Nn](e):(this[Z]=t,this.emit("open",t),this[ys]||this[Jy]())}end(e,t){return e&&this.write(e,t),this[oc]=!0,!this[ys]&&!this[li].length&&typeof this[Z]=="number"&&this[Tn](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[oc]?(this.emit("error",new Error("write() after end()")),!1):this[Z]===null||this[ys]||this[li].length?(this[li].push(e),this[gh]=!0,!1):(this[ys]=!0,this[Sh](e),!0)}[Sh](e){Xe.write(this[Z],e,0,e.length,this[Ss],(t,r)=>this[Tn](t,r))}[Tn](e,t){e?this[Nn](e):(this[Ss]!==null&&(this[Ss]+=t),this[li].length?this[Jy]():(this[ys]=!1,this[oc]&&!this[j1]?(this[j1]=!0,this[Ht](),this.emit("finish")):this[gh]&&(this[gh]=!1,this.emit("drain"))))}[Jy](){if(this[li].length===0)this[oc]&&this[Tn](null,0);else if(this[li].length===1)this[Sh](this[li].pop());else{let e=this[li];this[li]=[],k4(this[Z],e,this[Ss],(t,r)=>this[Tn](t,r))}}[Ht](){if(this[Dn]&&typeof this[Z]=="number"){let e=this[Z];this[Z]=null,Xe.close(e,t=>t?this.emit("error",t):this.emit("close"))}}},Qy=class extends bh{static{o(this,"WriteStreamSync")}[br](){let e;if(this[Eh]&&this[_r]==="r+")try{e=Xe.openSync(this[Wi],this[_r],this[wh])}catch(t){if(t.code==="ENOENT")return this[_r]="w",this[br]();throw t}else e=Xe.openSync(this[Wi],this[_r],this[wh]);this[xn](null,e)}[Ht](){if(this[Dn]&&typeof this[Z]=="number"){let e=this[Z];this[Z]=null,Xe.closeSync(e),this.emit("close")}}[Sh](e){let t=!0;try{this[Tn](null,Xe.writeSync(this[Z],e,0,e.length,this[Ss])),t=!1}finally{if(t)try{this[Ht]()}catch{}}}};ac.ReadStream=_h;ac.ReadStreamSync=Xy;ac.WriteStream=bh;ac.WriteStreamSync=Qy});var tS=d((Wpe,Mn)=>{"use strict";var cc=require("fs/promises"),F4=Ln(),eS=ai(),U4=On(),V1=In();Mn.exports=j4;var z1=64*1024*1024;async function j4(i,e,t={}){let{size:r}=t,{stat:s,cpath:n,sri:a}=await uc(i,e,async(u,l)=>({stat:r?{size:r}:await cc.stat(u),cpath:u,sri:l}));if(s.size>z1)return H1(n,s.size,a,new V1).concat();let c=await cc.readFile(n,{encoding:null});if(s.size!==c.length)throw V4(s.size,c.length);if(!eS.checkData(c,a))throw z4(a,n);return c}o(j4,"read");var H1=o((i,e,t,r)=>(r.push(new F4.ReadStream(i,{size:e,readSize:z1}),eS.integrityStream({integrity:t,size:e})),r),"readPipeline");Mn.exports.stream=G1;Mn.exports.readStream=G1;function G1(i,e,t={}){let{size:r}=t,s=new V1;return Promise.resolve().then(async()=>{let{stat:n,cpath:a,sri:c}=await uc(i,e,async(u,l)=>({stat:r?{size:r}:await cc.stat(u),cpath:u,sri:l}));return H1(a,n.size,c,s)}).catch(n=>s.emit("error",n)),s}o(G1,"readStream");Mn.exports.copy=$4;function $4(i,e,t){return uc(i,e,r=>cc.copyFile(r,t))}o($4,"copy");Mn.exports.hasContent=q4;async function q4(i,e){if(!e)return!1;try{return await uc(i,e,async(t,r)=>{let s=await cc.stat(t);return{size:s.size,sri:r,stat:s}})}catch(t){if(t.code==="ENOENT")return!1;if(t.code==="EPERM"){if(process.platform!=="win32")throw t;return!1}}}o(q4,"hasContent");async function uc(i,e,t){let r=eS.parse(e),s=r.pickAlgorithm(),n=r[s];if(n.length<=1){let a=U4(i,n[0]);return t(a,n[0])}else{let a=await Promise.all(n.map(async l=>{try{return await uc(i,l,t)}catch(h){return h.code==="ENOENT"?Object.assign(new Error("No matching content found for "+r.toString()),{code:"ENOENT"}):h}})),c=a.find(l=>!(l instanceof Error));if(c)return c;let u=a.find(l=>l.code==="ENOENT");throw u||a.find(l=>l instanceof Error)}}o(uc,"withContentSri");function V4(i,e){let t=new Error(`Bad data size: expected inserted data to be ${i} bytes, but got ${e} instead`);return t.expected=i,t.found=e,t.code="EBADSIZE",t}o(V4,"sizeError");function z4(i,e){let t=new Error(`Integrity verification failed for ${i} (${e})`);return t.code="EINTEGRITY",t.sri=i,t.path=e,t}o(z4,"integrityError")});var Z1=d((Kpe,Ki)=>{"use strict";var W1=yy(),{Minipass:J1}=te(),K1=In(),Es=Rn(),Ji=nc(),ws=tS();async function H4(i,e,t={}){let{integrity:r,memoize:s,size:n}=t,a=Ji.get(i,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 Es.find(i,e,t);if(!c)throw new Es.NotFoundError(i,e);let u=await ws(i,c.integrity,{integrity:r,size:n});return s&&Ji.put(i,c,u,t),{data:u,metadata:c.metadata,size:c.size,integrity:c.integrity}}o(H4,"getData");Ki.exports=H4;async function G4(i,e,t={}){let{integrity:r,memoize:s,size:n}=t,a=Ji.get.byDigest(i,e,t);if(a&&s!==!1)return a;let c=await ws(i,e,{integrity:r,size:n});return s&&Ji.put.byDigest(i,e,c,t),c}o(G4,"getDataByDigest");Ki.exports.byDigest=G4;var W4=o(i=>{let e=new J1;return e.on("newListener",function(t,r){t==="metadata"&&r(i.entry.metadata),t==="integrity"&&r(i.entry.integrity),t==="size"&&r(i.entry.size)}),e.end(i.data),e},"getMemoizedStream");function J4(i,e,t={}){let{memoize:r,size:s}=t,n=Ji.get(i,e,t);if(n&&r!==!1)return W4(n);let a=new K1;return Promise.resolve().then(async()=>{let c=await Es.find(i,e);if(!c)throw new Es.NotFoundError(i,e);a.emit("metadata",c.metadata),a.emit("integrity",c.integrity),a.emit("size",c.size),a.on("newListener",function(l,h){l==="metadata"&&h(c.metadata),l==="integrity"&&h(c.integrity),l==="size"&&h(c.size)});let u=ws.readStream(i,c.integrity,{...t,size:typeof s!="number"?c.size:s});if(r){let l=new W1.PassThrough;l.on("collect",h=>Ji.put(i,c,h,t)),a.unshift(l)}return a.unshift(u),a}).catch(c=>a.emit("error",c)),a}o(J4,"getStream");Ki.exports.stream=J4;function K4(i,e,t={}){let{memoize:r}=t,s=Ji.get.byDigest(i,e,t);if(s&&r!==!1){let n=new J1;return n.end(s),n}else{let n=ws.readStream(i,e,t);if(!r)return n;let a=new W1.PassThrough;return a.on("collect",c=>Ji.put.byDigest(i,e,c,t)),new K1(n,a)}}o(K4,"getStreamDigest");Ki.exports.stream.byDigest=K4;function Z4(i,e,t={}){let{memoize:r}=t,s=Ji.get(i,e,t);return s&&r!==!1?Promise.resolve(s.entry):Es.find(i,e)}o(Z4,"info");Ki.exports.info=Z4;async function Y4(i,e,t,r={}){let s=await Es.find(i,e,r);if(!s)throw new Es.NotFoundError(i,e);return await ws.copy(i,s.integrity,t,r),{metadata:s.metadata,size:s.size,integrity:s.integrity}}o(Y4,"copy");Ki.exports.copy=Y4;async function X4(i,e,t,r={}){return await ws.copy(i,e,t,r),e}o(X4,"copyByDigest");Ki.exports.copy.byDigest=X4;Ki.exports.hasContent=ws.hasContent});var Ih=d((Ype,eN)=>{var Q4=rh(),Y1=Symbol("_flush"),X1=Symbol("_flushed"),Q1=Symbol("_flushing"),iS=class extends Q4{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[Y1]=e.flush||this.flush}emit(e,...t){if(e!=="end"&&e!=="finish"||this[X1])return super.emit(e,...t);if(this[Q1])return;this[Q1]=!0;let r=o(n=>{this[X1]=!0,n?super.emit("error",n):super.emit("end")},"afterFlush"),s=this[Y1](r);s&&s.then&&s.then(()=>r(),n=>r(n))}};eN.exports=iS});var nN=d((Qpe,oS)=>{"use strict";var tN=require("events"),eJ=On(),hc=require("fs/promises"),{moveFile:tJ}=ch(),{Minipass:iJ}=te(),iN=In(),rJ=Ih(),rS=require("path"),sS=ai(),sJ=Ly(),nJ=Ln();oS.exports=oJ;var lc=new Map;async function oJ(i,e,t={}){let{algorithms:r,size:s,integrity:n}=t;if(typeof s=="number"&&e.length!==s)throw lJ(s,e.length);let a=sS.fromData(e,r?{algorithms:r}:{});if(n&&!sS.checkData(e,n,t))throw hJ(n,a);for(let c in a){let u=await rN(i,t),l=a[c].toString();try{await hc.writeFile(u.target,e,{flag:"wx"}),await sN(u,i,l,t)}finally{u.moved||await hc.rm(u.target,{recursive:!0,force:!0})}}return{integrity:a,size:e.length}}o(oJ,"write");oS.exports.stream=aJ;var nS=class extends rJ{static{o(this,"CacacheWriteStream")}constructor(e,t){super(),this.opts=t,this.cache=e,this.inputStream=new iJ,this.inputStream.on("error",r=>this.emit("error",r)),this.inputStream.on("drain",()=>this.emit("drain")),this.handleContentP=null}write(e,t,r){return this.handleContentP||(this.handleContentP=cJ(this.inputStream,this.cache,this.opts),this.handleContentP.catch(s=>this.emit("error",s))),this.inputStream.write(e,t,r)}flush(e){this.inputStream.end(()=>{if(!this.handleContentP){let t=new Error("Cache input stream was empty");return t.code="ENODATA",Promise.reject(t).catch(e)}this.handleContentP.then(t=>{t.integrity&&this.emit("integrity",t.integrity),t.size!==null&&this.emit("size",t.size),e()},t=>e(t))})}};function aJ(i,e={}){return new nS(i,e)}o(aJ,"writeStream");async function cJ(i,e,t){let r=await rN(e,t);try{let s=await uJ(i,e,r.target,t);return await sN(r,e,s.integrity,t),s}finally{r.moved||await hc.rm(r.target,{recursive:!0,force:!0})}}o(cJ,"handleContent");async function uJ(i,e,t,r){let s=new nJ.WriteStream(t,{flags:"wx"});if(r.integrityEmitter){let[l,h]=await Promise.all([tN.once(r.integrityEmitter,"integrity").then(f=>f[0]),tN.once(r.integrityEmitter,"size").then(f=>f[0]),new iN(i,s).promise()]);return{integrity:l,size:h}}let n,a,c=sS.integrityStream({integrity:r.integrity,algorithms:r.algorithms,size:r.size});return c.on("integrity",l=>{n=l}),c.on("size",l=>{a=l}),await new iN(i,c,s).promise(),{integrity:n,size:a}}o(uJ,"pipeToTmp");async function rN(i,e){let t=sJ(rS.join(i,"tmp"),e.tmpPrefix);return await hc.mkdir(rS.dirname(t),{recursive:!0}),{target:t,moved:!1}}o(rN,"makeTmp");async function sN(i,e,t){let r=eJ(e,t),s=rS.dirname(r);return lc.has(r)||lc.set(r,hc.mkdir(s,{recursive:!0}).then(async()=>(await tJ(i.target,r,{overwrite:!1}),i.moved=!0,i.moved)).catch(n=>{if(!n.message.startsWith("The destination file exists"))throw Object.assign(n,{code:"EEXIST"})}).finally(()=>{lc.delete(r)})),lc.get(r)}o(sN,"moveToDestination");function lJ(i,e){let t=new Error(`Bad data size: expected inserted data to be ${i} bytes, but got ${e} instead`);return t.expected=i,t.found=e,t.code="EBADSIZE",t}o(lJ,"sizeError");function hJ(i,e){let t=new Error(`Integrity check failed:
26
27
  Wanted: ${i}
27
- Found: ${e}`);return t.code="EINTEGRITY",t.expected=i,t.found=e,t}o(uJ,"checksumError")});var lN=d((Qpe,aS)=>{"use strict";var oN=Rn(),aN=nc(),cN=nN(),lJ=Ih(),{PassThrough:hJ}=yy(),fJ=In(),uN=o(i=>({algorithms:["sha512"],...i}),"putOpts");aS.exports=dJ;async function dJ(i,e,t,r={}){let{memoize:s}=r;r=uN(r);let n=await cN(i,t,r),a=await oN.insert(i,e,n.integrity,{...r,size:n.size});return s&&aN.put(i,a,t,r),n.integrity}o(dJ,"putData");aS.exports.stream=pJ;function pJ(i,e,t={}){let{memoize:r}=t;t=uN(t);let s,n,a,c,u=new fJ;if(r){let h=new hJ().on("collect",f=>{c=f});u.push(h)}let l=cN.stream(i,t).on("integrity",h=>{s=h}).on("size",h=>{n=h}).on("error",h=>{a=h});return u.push(l),u.push(new lJ({async flush(){if(!a){let h=await oN.insert(i,e,s,{...t,size:n});r&&c&&aN.put(i,h,c,t),u.emit("integrity",s),u.emit("size",n)}}})),u}o(pJ,"putStream")});var cS=d((tme,fN)=>{"use strict";var{glob:mJ}=hg(),hN=require("path"),gJ=o(i=>i.split(hN.win32.sep).join(hN.posix.sep),"globify");fN.exports=(i,e)=>mJ(gJ(i),e)});var pN=d((rme,dN)=>{"use strict";var yJ=require("fs/promises"),SJ=On(),{hasContent:EJ}=tS();dN.exports=wJ;async function wJ(i,e){let t=await EJ(i,e);return t&&t.sri?(await yJ.rm(SJ(i,t.sri),{recursive:!0,force:!0}),!0):!1}o(wJ,"rm")});var gN=d((nme,fc)=>{"use strict";var{rm:_J}=require("fs/promises"),bJ=cS(),IJ=Rn(),uS=nc(),OJ=require("path"),vJ=pN();fc.exports=mN;fc.exports.entry=mN;function mN(i,e,t){return uS.clearMemoized(),IJ.delete(i,e,t)}o(mN,"entry");fc.exports.content=RJ;function RJ(i,e){return uS.clearMemoized(),vJ(i,e)}o(RJ,"content");fc.exports.all=AJ;async function AJ(i){uS.clearMemoized();let e=await bJ(OJ.join(i,"*(content-*|index-*)"),{silent:!0,nosort:!0});return Promise.all(e.map(t=>_J(t,{recursive:!0,force:!0})))}o(AJ,"all")});var SN=d((ame,dS)=>{"use strict";var{mkdir:TJ,readFile:CJ,rm:hS,stat:fS,truncate:NJ,writeFile:PJ}=require("fs/promises"),yN=On(),DJ=Ln(),xJ=cS(),Bn=Rn(),Oh=require("path"),lS=ai(),LJ=o((i,e)=>Object.prototype.hasOwnProperty.call(i,e),"hasOwnProperty"),MJ=o(i=>({concurrency:20,log:{silly(){}},...i}),"verifyOpts");dS.exports=BJ;async function BJ(i,e){e=MJ(e),e.log.silly("verify","verifying cache at",i);let t=[kJ,UJ,jJ,qJ,zJ,HJ,FJ],r={};for(let s of t){let n=s.name,a=new Date,c=await s(i,e);c&&Object.keys(c).forEach(l=>{r[l]=c[l]});let u=new Date;r.runTime||(r.runTime={}),r.runTime[n]=u-a}return r.runTime.total=r.endTime-r.startTime,e.log.silly("verify","verification finished for",i,"in",`${r.runTime.total}ms`),r}o(BJ,"verify");async function kJ(){return{startTime:new Date}}o(kJ,"markStartTime");async function FJ(){return{endTime:new Date}}o(FJ,"markEndTime");async function UJ(i,e){return e.log.silly("verify","fixing cache permissions"),await TJ(i,{recursive:!0}),null}o(UJ,"fixPerms");async function jJ(i,e){e.log.silly("verify","garbage collecting content");let{default:t}=await Promise.resolve().then(()=>(lh(),uh)),r=Bn.lsStream(i),s=new Set;r.on("data",u=>{if(e.filter&&!e.filter(u))return;let l=lS.parse(u.integrity);for(let h in l)s.add(l[h].toString())}),await new Promise((u,l)=>{r.on("end",u).on("error",l)});let n=yN.contentDir(i),a=await xJ(Oh.join(n,"**"),{follow:!1,nodir:!0,nosort:!0}),c={verifiedContent:0,reclaimedCount:0,reclaimedSize:0,badContentCount:0,keptSize:0};return await t(a,async u=>{let l=u.split(/[/\\]/),h=l.slice(l.length-3).join(""),f=l[l.length-4],p=lS.fromHex(h,f);if(s.has(p.toString())){let m=await $J(u,p);m.valid?(c.verifiedContent++,c.keptSize+=m.size):(c.reclaimedCount++,c.badContentCount++,c.reclaimedSize+=m.size)}else{c.reclaimedCount++;let m=await fS(u);await hS(u,{recursive:!0,force:!0}),c.reclaimedSize+=m.size}return c},{concurrency:e.concurrency}),c}o(jJ,"garbageCollect");async function $J(i,e){let t={};try{let{size:r}=await fS(i);t.size=r,t.valid=!0,await lS.checkStream(new DJ.ReadStream(i),e)}catch(r){if(r.code==="ENOENT")return{size:0,valid:!1};if(r.code!=="EINTEGRITY")throw r;await hS(i,{recursive:!0,force:!0}),t.valid=!1}return t}o($J,"verifyContent");async function qJ(i,e){e.log.silly("verify","rebuilding index");let{default:t}=await Promise.resolve().then(()=>(lh(),uh)),r=await Bn.ls(i),s={missingContent:0,rejectedEntries:0,totalEntries:0},n={};for(let a in r)if(LJ(r,a)){let c=Bn.hashKey(a),u=r[a],l=e.filter&&!e.filter(u);l&&s.rejectedEntries++,n[c]&&!l?n[c].push(u):n[c]&&l||(l?(n[c]=[],n[c]._path=Bn.bucketPath(i,a)):(n[c]=[u],n[c]._path=Bn.bucketPath(i,a)))}return await t(Object.keys(n),a=>VJ(i,n[a],s,e),{concurrency:e.concurrency}),s}o(qJ,"rebuildIndex");async function VJ(i,e,t){await NJ(e._path);for(let r of e){let s=yN(i,r.integrity);try{await fS(s),await Bn.insert(i,r.key,r.integrity,{metadata:r.metadata,size:r.size,time:r.time}),t.totalEntries++}catch(n){if(n.code==="ENOENT")t.rejectedEntries++,t.missingContent++;else throw n}}}o(VJ,"rebuildBucket");function zJ(i,e){return e.log.silly("verify","cleaning tmp directory"),hS(Oh.join(i,"tmp"),{recursive:!0,force:!0})}o(zJ,"cleanTmp");async function HJ(i,e){let t=Oh.join(i,"_lastverified");return e.log.silly("verify","writing verifile to "+t),PJ(t,`${Date.now()}`)}o(HJ,"writeVerifile");dS.exports.lastRun=GJ;async function GJ(i){let e=await CJ(Oh.join(i,"_lastverified"),{encoding:"utf8"});return new Date(+e)}o(GJ,"lastRun")});var wN=d((ume,mS)=>{"use strict";var{withTempDir:WJ}=ch(),EN=require("fs/promises"),pS=require("path");mS.exports.mkdir=JJ;async function JJ(i,e={}){let{tmpPrefix:t}=e,r=pS.join(i,"tmp");await EN.mkdir(r,{recursive:!0,owner:"inherit"});let s=`${r}${pS.sep}${t||""}`;return EN.mkdtemp(s,{owner:"inherit"})}o(JJ,"mktmpdir");mS.exports.withTmp=KJ;function KJ(i,e,t){return t||(t=e,e={}),WJ(pS.join(i,"tmp"),t,e)}o(KJ,"withTmp")});var dc=d((hme,X)=>{"use strict";var Ir=Z1(),_N=lN(),gS=gN(),bN=SN(),{clearMemoized:ZJ}=nc(),IN=wN(),vh=Rn();X.exports.index={};X.exports.index.compact=vh.compact;X.exports.index.insert=vh.insert;X.exports.ls=vh.ls;X.exports.ls.stream=vh.lsStream;X.exports.get=Ir;X.exports.get.byDigest=Ir.byDigest;X.exports.get.stream=Ir.stream;X.exports.get.stream.byDigest=Ir.stream.byDigest;X.exports.get.copy=Ir.copy;X.exports.get.copy.byDigest=Ir.copy.byDigest;X.exports.get.info=Ir.info;X.exports.get.hasContent=Ir.hasContent;X.exports.put=_N;X.exports.put.stream=_N.stream;X.exports.rm=gS.entry;X.exports.rm.all=gS.all;X.exports.rm.entry=X.exports.rm;X.exports.rm.content=gS.content;X.exports.clearMemoized=ZJ;X.exports.tmp={};X.exports.tmp.mkdir=IN.mkdir;X.exports.tmp.withTmp=IN.withTmp;X.exports.verify=bN;X.exports.verify.lastRun=bN.lastRun});var vN=d((fme,ON)=>{"use strict";var kn=require("fs"),pc=require("path"),YJ=require("events").EventEmitter,XJ=Hl(),mc=class i extends YJ{static{o(this,"BundleWalker")}constructor(e){if(e=e||{},super(e),this.path=pc.resolve(e.path||process.cwd()),this.parent=e.parent||null,this.parent){if(this.result=this.parent.result,!this.parent.parent){let t=pc.basename(this.path),r=pc.basename(pc.dirname(this.path));this.result.add(/^@/.test(r)?r+"/"+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 r=super.on(e,t);return e==="done"&&this.didDone&&this.emit("done",this.result),r}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=pc.resolve(this.path,"package.json");return this.packageJsonCache.has(e)?this.onPackage(this.packageJsonCache.get(e)):this.readPackageJson(e),this}readPackageJson(e){kn.readFile(e,(t,r)=>t?this.done():this.onPackageJson(e,r))}onPackageJson(e,t){try{this.package=XJ(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||[],r=Array.from(new Set(Array.isArray(t)?t:t===!0?this.allDepsBundled(e):Object.keys(t)));if(!r.length)return this.done();this.bundle=r,this.readModules()}readModules(){QJ(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 r=new i({path:t,parent:this});r.on("done",()=>{--this.children===0&&this.done()}),r.start()}},Rh=class i extends mc{static{o(this,"BundleWalkerSync")}start(){return super.start(),this.done(),this}readPackageJson(e){try{this.onPackageJson(e,kn.readFileSync(e))}catch{}return this}readModules(){try{this.onReaddir(e6(this.path+"/node_modules"))}catch{this.onReaddir([])}}child(e){new i({path:this.path+"/node_modules/"+e,parent:this}).start()}},QJ=o((i,e)=>{kn.readdir(i,(t,r)=>{if(t)e(t);else{let s=r.filter(n=>/^@/.test(n));if(!s.length)e(null,r);else{let n=r.filter(c=>!/^@/.test(c)),a=s.length;s.forEach(c=>{kn.readdir(i+"/"+c,(u,l)=>{u||!l.length?n.push(c):n.push.apply(n,l.map(h=>c+"/"+h)),--a===0&&e(null,n)})})}}})},"readdirNodeModules"),e6=o(i=>{let e=kn.readdirSync(i),t=e.filter(s=>!/^@/.test(s)),r=e.filter(s=>/^@/.test(s)).map(s=>{try{let n=kn.readdirSync(i+"/"+s);return n.length?n.map(a=>s+"/"+a):[s]}catch{return[s]}}).reduce((s,n)=>s.concat(n),[]);return t.concat(r)},"readdirNodeModulesSync"),Ah=o((i,e)=>{let t=new Promise((r,s)=>{new mc(i).on("done",r).on("error",s).start()});return e?t.then(r=>e(null,r),e):t},"walk"),t6=o(i=>new Rh(i).start().result,"walkSync");ON.exports=Ah;Ah.sync=t6;Ah.BundleWalker=mc;Ah.BundleWalkerSync=Rh});var CN=d((pme,TN)=>{var i6=vN(),{readFile:r6,readdir:s6,stat:n6}=require("fs/promises"),{resolve:Th,basename:o6,dirname:RN}=require("path"),a6=Hl(),c6=o(({path:i,packageJsonCache:e})=>e.has(i)?Promise.resolve(e.get(i)):r6(i).then(t=>{let r=a6(JSON.parse(t));return e.set(i,r),r}).catch(()=>null),"readPackage"),AN=Symbol("package data has been normalized"),u6=o(({path:i,packageJsonCache:e})=>c6({path:i,packageJsonCache:e}).then(t=>{if(!t||t[AN])return t;t.bundledDependencies&&!t.bundleDependencies&&(t.bundleDependencies=t.bundledDependencies,delete t.bundledDependencies);let r=t.bundleDependencies;return r===!0&&(t.bundleDependencies=[...Object.keys(t.dependencies||{}),...Object.keys(t.optionalDependencies||{})]),typeof r=="object"&&!Array.isArray(r)&&(t.bundleDependencies=Object.keys(r)),t[AN]=!0,t}),"rpj"),Ch=o(async({path:i,depth:e=1,currentDepth:t=0,pkg:r=null,result:s=null,packageJsonCache:n=null})=>{if(s||(s=new Set),n||(n=new Map),r===!0)return u6({path:i+"/package.json",packageJsonCache:n}).then(l=>Ch({path:i,depth:e,currentDepth:t,pkg:l,result:s,packageJsonCache:n}));if(r&&r.bin){let l=RN(i),h=o6(l),f=/^@.+/.test(h)?RN(l):l,p=[];Object.keys(r.bin).forEach(y=>{let g=Th(f,".bin",y);p.push(g,g+".cmd",g+".ps1")}),(await Promise.all(p.map(y=>n6(y).then(()=>y).catch(()=>null)))).filter(y=>y).forEach(y=>s.add(y))}if(t>=e)return s.add(i),s;let[a,c]=await Promise.all([s6(i,{withFileTypes:!0}),t===0&&r&&r.bundleDependencies?i6({path:i,packageJsonCache:n}):null]).catch(()=>[]);if(!a)return s;if(!a.length&&!c&&t!==0)return s.add(i),s;let u=[];for(let l of a){let h=Th(i,l.name);if(l.isDirectory()===!1){s.add(h);continue}if(t!==0||l.name!=="node_modules"){t<e-1?u.push(Ch({path:h,packageJsonCache:n,depth:e,currentDepth:t+1,result:s})):s.add(h);continue}}return c&&u.push(...c.map(l=>{let h=Th(i,"node_modules",l);return Ch({path:h,packageJsonCache:n,pkg:!0,depth:e,currentDepth:t+1,result:s})})),u.length&&await Promise.all(u),s},"pkgContents");TN.exports=({path:i,...e})=>Ch({path:Th(i),...e,pkg:!0}).then(t=>[...t])});var Un=d((gme,Ec)=>{"use strict";var Sc=process.platform==="win32",{URL:yS}=require("node:url"),Fn=Sc?require("node:path/win32"):require("node:path"),{homedir:l6}=require("node:os"),h6=Xu(),NN=ds(),LN=Yg(),{log:f6}=St(),MN=Sc?/\\|[/]/:/[/]/,BN=/^(?:git[+])?[a-z]+:/i,d6=/^[^@]+@[^:.]+\.[^:]+:.+$/i,ES=/[.](?:tgz|tar.gz|tar)$/i,p6=/:[0-9]+(\/|$)/i,m6=/^(?:[.]|~[/]|[/\\]|[a-zA-Z]:)/,g6=/^(?:[.]|~[/]|[/]|[a-zA-Z]:)/,PN="https://registry.npmjs.org";function gc(i,e){let t,r;if(typeof i=="object")return i instanceof yc&&(!e||e===i.where)?i:i.name&&i.rawSpec?gc.resolve(i.name,i.rawSpec,e||i.where):gc(i.raw,e||i.where);let s=i.indexOf("@",1),n=s>0?i.slice(0,s):i;return BN.test(i)?r=i:d6.test(i)?r=`git+ssh://${i}`:!n.startsWith("@")&&(MN.test(n)||ES.test(n))?r=i:s>0?(t=n,r=i.slice(s+1)||"*"):LN(i).validForOldPackages?(t=i,r="*"):r=i,kN(t,r,e,i)}o(gc,"npa");function y6(i){return i?i.toLowerCase().startsWith("file:")?!0:Sc?m6.test(i):g6.test(i):!1}o(y6,"isFileSpec");function S6(i){return i?i.toLowerCase().startsWith("npm:"):!1}o(S6,"isAliasSpec");function kN(i,e,t,r){let s=new yc({raw:r,name:i,rawSpec:e,fromArgument:r!=null});if(i&&(s.name=i),t||(t=process.cwd()),y6(e))return xN(s,t);if(S6(e))return A6(s,t);let n=h6.fromUrl(e,{noGitPlus:!0,noCommittish:!0});return n?O6(s,n):e&&BN.test(e)?R6(s):e&&(MN.test(e)||ES.test(e))?xN(s,t):T6(s)}o(kN,"resolve");function E6(i,e=PN){let t=gc(i);if(t.type!=="version")throw b6(t.type,t.raw);let r="pkg:npm/"+t.name.replace(/^@/,"%40")+"@"+t.rawSpec;return e!==PN&&(r+="?repository_url="+e),r}o(E6,"toPurl");function w6(i,e,t){let r=new Error(`Invalid package name "${i}" of package "${t}": ${e.errors.join("; ")}.`);return r.code="EINVALIDPACKAGENAME",r}o(w6,"invalidPackageName");function _6(i,e){let t=new Error(`Invalid tag name "${i}" of package "${e}": Tags may not have any characters that encodeURIComponent encodes.`);return t.code="EINVALIDTAGNAME",t}o(_6,"invalidTagName");function b6(i,e){let t=new Error(`Invalid type "${i}" of package "${e}": Purl can only be generated for "version" types.`);return t.code="EINVALIDPURLTYPE",t}o(b6,"invalidPurlType");var yc=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=LN(e);if(!t.validForOldPackages)throw w6(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 SS(i,e){if(!e){i.gitCommittish=null;return}for(let t of e.split("::")){if(!t.includes(":")){if(i.gitRange)throw new Error("cannot override existing semver range with a committish");if(i.gitCommittish)throw new Error("cannot override existing committish with a second committish");i.gitCommittish=t;continue}let[r,s]=t.split(":");if(r==="semver"){if(i.gitCommittish)throw new Error("cannot override existing committish with a semver range");if(i.gitRange)throw new Error("cannot override existing semver range with a second semver range");i.gitRange=decodeURIComponent(s);continue}if(r==="path"){if(i.gitSubdir)throw new Error("cannot override existing path with a second path");i.gitSubdir=`/${s}`;continue}f6.warn("npm-package-arg",`ignoring unknown key "${r}"`)}}o(SS,"setGitAttrs");var I6=new Map([["\0","%00"],[" ","%09"],[`
28
- `,"%0A"],["\r","%0D"],[" ","%20"],['"',"%22"],["#","%23"],["%","%25"],["?","%3F"],["[","%5B"],["\\",Sc?"/":"%5C"],["]","%5D"],["^","%5E"],["|","%7C"],["~","%7E"]]);function DN(i){let e="";for(let t=0;t<i.length;t++)e=`${e}${I6.get(i[t])??i[t]}`;return e.startsWith("file:")?e:`file:${e}`}o(DN,"pathToFileURL");function xN(i,e){i.type=ES.test(i.rawSpec)?"file":"directory",i.where=e;let t=DN(i.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 r,s;try{r=new yS(t,`${DN(Fn.resolve(e))}/`),s=new yS(t)}catch(c){let u=new Error("Invalid file: URL, must comply with RFC 8089");throw Object.assign(u,{raw:i.rawSpec,spec:i,where:e,originalError:c})}let n=decodeURIComponent(s.pathname),a=decodeURIComponent(r.pathname);return Sc&&(n=n.replace(/^\/+([a-z]:\/)/i,"$1"),a=a.replace(/^\/+([a-z]:\/)/i,"$1")),/^\/~(\/|$)/.test(n)?(i.saveSpec=`file:${n.substr(1)}`,a=Fn.resolve(l6(),n.substr(3))):Fn.isAbsolute(t.slice(5))?i.saveSpec=`file:${Fn.resolve(a)}`:i.saveSpec=`file:${Fn.relative(e,a)}`,i.fetchSpec=Fn.resolve(e,a),i.saveSpec=i.saveSpec.split("\\").join("/"),i.saveSpec.startsWith("file://")&&(i.saveSpec=`file:/${i.saveSpec.slice(7)}`),i}o(xN,"fromFile");function O6(i,e){return i.type="git",i.hosted=e,i.saveSpec=e.toString({noGitPlus:!1,noCommittish:!1}),i.fetchSpec=e.getDefaultRepresentation()==="shortcut"?null:e.toString(),SS(i,e.committish),i}o(O6,"fromHostedGit");function v6(i,e){let t=new Error(`Unsupported URL Type "${i}": ${e}`);return t.code="EUNSUPPORTEDPROTOCOL",t}o(v6,"unsupportedURLType");function R6(i){let e=i.rawSpec;if(i.saveSpec=e,e.startsWith("git+ssh:")){let r=e.match(/^git\+ssh:\/\/([^:#]+:[^#]+(?:\.git)?)(?:#(.*))?$/i);if(r&&!r[1].match(p6))return i.type="git",SS(i,r[2]),i.fetchSpec=r[1],i}else e.startsWith("git+file://")&&(e=e.replace(/\\/g,"/"));let t=new yS(e);switch(t.protocol){case"git:":case"git+http:":case"git+https:":case"git+rsync:":case"git+ftp:":case"git+file:":case"git+ssh:":i.type="git",SS(i,t.hash.slice(1)),t.protocol==="git+file:"&&/^git\+file:\/\/[a-z]:/i.test(e)?i.fetchSpec=`git+file://${t.host.toLowerCase()}:${t.pathname}`:(t.hash="",i.fetchSpec=t.toString()),i.fetchSpec.startsWith("git+")&&(i.fetchSpec=i.fetchSpec.slice(4));break;case"http:":case"https:":i.type="remote",i.fetchSpec=i.saveSpec;break;default:throw v6(t.protocol,e)}return i}o(R6,"fromURL");function A6(i,e){let t=gc(i.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 i.subSpec=t,i.registry=!0,i.type="alias",i.saveSpec=null,i.fetchSpec=null,i}o(A6,"fromAlias");function T6(i){i.registry=!0;let e=i.rawSpec.trim();i.saveSpec=null,i.fetchSpec=e;let t=NN.valid(e,!0),r=NN.validRange(e,!0);if(t)i.type="version";else if(r)i.type="range";else{if(encodeURIComponent(e)!==e)throw _6(e,i.raw);i.type="tag"}return i}o(T6,"fromRegistry");Ec.exports=gc;Ec.exports.resolve=kN;Ec.exports.toPurl=E6;Ec.exports.Result=yc});var zn=d(vt=>{"use strict";var FN=vt&&vt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(vt,"__esModule",{value:!0});vt.WriteStreamSync=vt.WriteStream=vt.ReadStreamSync=vt.ReadStream=void 0;var C6=FN(require("events")),Qe=FN(require("fs")),N6=te(),P6=Qe.default.writev,vr=Symbol("_autoClose"),Wt=Symbol("_close"),wc=Symbol("_ended"),J=Symbol("_fd"),wS=Symbol("_finished"),Yi=Symbol("_flags"),_S=Symbol("_flush"),vS=Symbol("_handleChunk"),RS=Symbol("_makeBuf"),bc=Symbol("_mode"),Nh=Symbol("_needDrain"),qn=Symbol("_onerror"),Vn=Symbol("_onopen"),bS=Symbol("_onread"),jn=Symbol("_onwrite"),Rr=Symbol("_open"),Gt=Symbol("_path"),Or=Symbol("_pos"),hi=Symbol("_queue"),$n=Symbol("_read"),IS=Symbol("_readSize"),Zi=Symbol("_reading"),_c=Symbol("_remain"),OS=Symbol("_size"),Ph=Symbol("_write"),_s=Symbol("_writing"),Dh=Symbol("_defaultFlag"),bs=Symbol("_errored"),xh=class extends N6.Minipass{static{o(this,"ReadStream")}[bs]=!1;[J];[Gt];[IS];[Zi]=!1;[OS];[_c];[vr];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[bs]=!1,this[J]=typeof t.fd=="number"?t.fd:void 0,this[Gt]=e,this[IS]=t.readSize||16*1024*1024,this[Zi]=!1,this[OS]=typeof t.size=="number"?t.size:1/0,this[_c]=this[OS],this[vr]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[J]=="number"?this[$n]():this[Rr]()}get fd(){return this[J]}get path(){return this[Gt]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[Rr](){Qe.default.open(this[Gt],"r",(e,t)=>this[Vn](e,t))}[Vn](e,t){e?this[qn](e):(this[J]=t,this.emit("open",t),this[$n]())}[RS](){return Buffer.allocUnsafe(Math.min(this[IS],this[_c]))}[$n](){if(!this[Zi]){this[Zi]=!0;let e=this[RS]();if(e.length===0)return process.nextTick(()=>this[bS](null,0,e));Qe.default.read(this[J],e,0,e.length,null,(t,r,s)=>this[bS](t,r,s))}}[bS](e,t,r){this[Zi]=!1,e?this[qn](e):this[vS](t,r)&&this[$n]()}[Wt](){if(this[vr]&&typeof this[J]=="number"){let e=this[J];this[J]=void 0,Qe.default.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[qn](e){this[Zi]=!0,this[Wt](),this.emit("error",e)}[vS](e,t){let r=!1;return this[_c]-=e,e>0&&(r=super.write(e<t.length?t.subarray(0,e):t)),(e===0||this[_c]<=0)&&(r=!1,this[Wt](),super.end()),r}emit(e,...t){switch(e){case"prefinish":case"finish":return!1;case"drain":return typeof this[J]=="number"&&this[$n](),!1;case"error":return this[bs]?!1:(this[bs]=!0,super.emit(e,...t));default:return super.emit(e,...t)}}};vt.ReadStream=xh;var AS=class extends xh{static{o(this,"ReadStreamSync")}[Rr](){let e=!0;try{this[Vn](null,Qe.default.openSync(this[Gt],"r")),e=!1}finally{e&&this[Wt]()}}[$n](){let e=!0;try{if(!this[Zi]){this[Zi]=!0;do{let t=this[RS](),r=t.length===0?0:Qe.default.readSync(this[J],t,0,t.length,null);if(!this[vS](r,t))break}while(!0);this[Zi]=!1}e=!1}finally{e&&this[Wt]()}}[Wt](){if(this[vr]&&typeof this[J]=="number"){let e=this[J];this[J]=void 0,Qe.default.closeSync(e),this.emit("close")}}};vt.ReadStreamSync=AS;var Lh=class extends C6.default{static{o(this,"WriteStream")}readable=!1;writable=!0;[bs]=!1;[_s]=!1;[wc]=!1;[hi]=[];[Nh]=!1;[Gt];[bc];[vr];[J];[Dh];[Yi];[wS]=!1;[Or];constructor(e,t){t=t||{},super(t),this[Gt]=e,this[J]=typeof t.fd=="number"?t.fd:void 0,this[bc]=t.mode===void 0?438:t.mode,this[Or]=typeof t.start=="number"?t.start:void 0,this[vr]=typeof t.autoClose=="boolean"?t.autoClose:!0;let r=this[Or]!==void 0?"r+":"w";this[Dh]=t.flags===void 0,this[Yi]=t.flags===void 0?r:t.flags,this[J]===void 0&&this[Rr]()}emit(e,...t){if(e==="error"){if(this[bs])return!1;this[bs]=!0}return super.emit(e,...t)}get fd(){return this[J]}get path(){return this[Gt]}[qn](e){this[Wt](),this[_s]=!0,this.emit("error",e)}[Rr](){Qe.default.open(this[Gt],this[Yi],this[bc],(e,t)=>this[Vn](e,t))}[Vn](e,t){this[Dh]&&this[Yi]==="r+"&&e&&e.code==="ENOENT"?(this[Yi]="w",this[Rr]()):e?this[qn](e):(this[J]=t,this.emit("open",t),this[_s]||this[_S]())}end(e,t){return e&&this.write(e,t),this[wc]=!0,!this[_s]&&!this[hi].length&&typeof this[J]=="number"&&this[jn](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[wc]?(this.emit("error",new Error("write() after end()")),!1):this[J]===void 0||this[_s]||this[hi].length?(this[hi].push(e),this[Nh]=!0,!1):(this[_s]=!0,this[Ph](e),!0)}[Ph](e){Qe.default.write(this[J],e,0,e.length,this[Or],(t,r)=>this[jn](t,r))}[jn](e,t){e?this[qn](e):(this[Or]!==void 0&&typeof t=="number"&&(this[Or]+=t),this[hi].length?this[_S]():(this[_s]=!1,this[wc]&&!this[wS]?(this[wS]=!0,this[Wt](),this.emit("finish")):this[Nh]&&(this[Nh]=!1,this.emit("drain"))))}[_S](){if(this[hi].length===0)this[wc]&&this[jn](null,0);else if(this[hi].length===1)this[Ph](this[hi].pop());else{let e=this[hi];this[hi]=[],P6(this[J],e,this[Or],(t,r)=>this[jn](t,r))}}[Wt](){if(this[vr]&&typeof this[J]=="number"){let e=this[J];this[J]=void 0,Qe.default.close(e,t=>t?this.emit("error",t):this.emit("close"))}}};vt.WriteStream=Lh;var TS=class extends Lh{static{o(this,"WriteStreamSync")}[Rr](){let e;if(this[Dh]&&this[Yi]==="r+")try{e=Qe.default.openSync(this[Gt],this[Yi],this[bc])}catch(t){if(t?.code==="ENOENT")return this[Yi]="w",this[Rr]();throw t}else e=Qe.default.openSync(this[Gt],this[Yi],this[bc]);this[Vn](null,e)}[Wt](){if(this[vr]&&typeof this[J]=="number"){let e=this[J];this[J]=void 0,Qe.default.closeSync(e),this.emit("close")}}[Ph](e){let t=!0;try{this[jn](null,Qe.default.writeSync(this[J],e,0,e.length,this[Or])),t=!1}finally{if(t)try{this[Wt]()}catch{}}}};vt.WriteStreamSync=TS});var Mh=d(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.dealias=Se.isNoFile=Se.isFile=Se.isAsync=Se.isSync=Se.isAsyncNoFile=Se.isSyncNoFile=Se.isAsyncFile=Se.isSyncFile=void 0;var D6=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"]]),x6=o(i=>!!i.sync&&!!i.file,"isSyncFile");Se.isSyncFile=x6;var L6=o(i=>!i.sync&&!!i.file,"isAsyncFile");Se.isAsyncFile=L6;var M6=o(i=>!!i.sync&&!i.file,"isSyncNoFile");Se.isSyncNoFile=M6;var B6=o(i=>!i.sync&&!i.file,"isAsyncNoFile");Se.isAsyncNoFile=B6;var k6=o(i=>!!i.sync,"isSync");Se.isSync=k6;var F6=o(i=>!i.sync,"isAsync");Se.isAsync=F6;var U6=o(i=>!!i.file,"isFile");Se.isFile=U6;var j6=o(i=>!i.file,"isNoFile");Se.isNoFile=j6;var $6=o(i=>{let e=D6.get(i);return e||i},"dealiasKey"),q6=o((i={})=>{if(!i)return{};let e={};for(let[t,r]of Object.entries(i)){let s=$6(t);e[s]=r}return e.chmod===void 0&&e.noChmod===!1&&(e.chmod=!0),delete e.noChmod,e},"dealias");Se.dealias=q6});var Hn=d(Bh=>{"use strict";Object.defineProperty(Bh,"__esModule",{value:!0});Bh.makeCommand=void 0;var Ic=Mh(),V6=o((i,e,t,r,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 u=(0,Ic.dealias)(n);if(s?.(u,a),(0,Ic.isSyncFile)(u)){if(typeof c=="function")throw new TypeError("callback not supported for sync tar functions");return i(u,a)}else if((0,Ic.isAsyncFile)(u)){let l=e(u,a),h=c||void 0;return h?l.then(()=>h(),h):l}else if((0,Ic.isSyncNoFile)(u)){if(typeof c=="function")throw new TypeError("callback not supported for sync tar functions");return t(u,a)}else if((0,Ic.isAsyncNoFile)(u)){if(typeof c=="function")throw new TypeError("callback only supported with file option");return r(u,a)}else throw new Error("impossible options??")},{syncFile:i,asyncFile:e,syncNoFile:t,asyncNoFile:r,validate:s}),"makeCommand");Bh.makeCommand=V6});var CS=d(Gn=>{"use strict";var z6=Gn&&Gn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Gn,"__esModule",{value:!0});Gn.constants=void 0;var H6=z6(require("zlib")),G6=H6.default.constants||{ZLIB_VERNUM:4736};Gn.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},G6))});var vc=d(U=>{"use strict";var W6=U&&U.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),J6=U&&U.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),K6=U&&U.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&W6(t,e,r[s]);return J6(t,e),t}})(),Z6=U&&U.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(U,"__esModule",{value:!0});U.ZstdDecompress=U.ZstdCompress=U.BrotliDecompress=U.BrotliCompress=U.Unzip=U.InflateRaw=U.DeflateRaw=U.Gunzip=U.Gzip=U.Inflate=U.Deflate=U.Zlib=U.ZlibError=U.constants=void 0;var DS=Z6(require("assert")),Is=require("buffer"),Y6=te(),UN=K6(require("zlib")),fi=CS(),X6=CS();Object.defineProperty(U,"constants",{enumerable:!0,get:o(function(){return X6.constants},"get")});var Q6=Is.Buffer.concat,jN=Object.getOwnPropertyDescriptor(Is.Buffer,"concat"),eK=o(i=>i,"noop"),NS=jN?.writable===!0||jN?.set!==void 0?i=>{Is.Buffer.concat=i?eK:Q6}:i=>{},Os=Symbol("_superWrite"),vs=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"}};U.ZlibError=vs;var PS=Symbol("flushFlag"),Oc=class extends Y6.Minipass{static{o(this,"ZlibBase")}#e=!1;#t=!1;#i;#r;#s;#u;#c;get sawError(){return this.#e}get handle(){return this.#u}get flushFlag(){return this.#i}constructor(e,t){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");if(super(e),this.#i=e.flush??0,this.#r=e.finishFlush??0,this.#s=e.fullFlushFlag??0,typeof UN[t]!="function")throw new TypeError("Compression method not supported: "+t);try{this.#u=new UN[t](e)}catch(r){throw new vs(r,this.constructor)}this.#c=r=>{this.#e||(this.#e=!0,this.close(),this.emit("error",r))},this.#u?.on("error",r=>this.#c(new vs(r))),this.once("end",()=>this.close)}close(){this.#u&&(this.#u.close(),this.#u=void 0,this.emit("close"))}reset(){if(!this.#e)return(0,DS.default)(this.#u,"zlib binding closed"),this.#u.reset?.()}flush(e){this.ended||(typeof e!="number"&&(e=this.#s),this.write(Object.assign(Is.Buffer.alloc(0),{[PS]:e})))}end(e,t,r){return typeof e=="function"&&(r=e,t=void 0,e=void 0),typeof t=="function"&&(r=t,t=void 0),e&&(t?this.write(e,t):this.write(e)),this.flush(this.#r),this.#t=!0,super.end(r)}get ended(){return this.#t}[Os](e){return super.write(e)}write(e,t,r){if(typeof t=="function"&&(r=t,t="utf8"),typeof e=="string"&&(e=Is.Buffer.from(e,t)),this.#e)return;(0,DS.default)(this.#u,"zlib binding closed");let s=this.#u._handle,n=s.close;s.close=()=>{};let a=this.#u.close;this.#u.close=()=>{},NS(!0);let c;try{let l=typeof e[PS]=="number"?e[PS]:this.#i;c=this.#u._processChunk(e,l),NS(!1)}catch(l){NS(!1),this.#c(new vs(l,this.write))}finally{this.#u&&(this.#u._handle=s,s.close=n,this.#u.close=a,this.#u.removeAllListeners("error"))}this.#u&&this.#u.on("error",l=>this.#c(new vs(l,this.write)));let u;if(c)if(Array.isArray(c)&&c.length>0){let l=c[0];u=this[Os](Is.Buffer.from(l));for(let h=1;h<c.length;h++)u=this[Os](c[h])}else u=this[Os](Is.Buffer.from(c));return r&&r(),u}},di=class extends Oc{static{o(this,"Zlib")}#e;#t;constructor(e,t){e=e||{},e.flush=e.flush||fi.constants.Z_NO_FLUSH,e.finishFlush=e.finishFlush||fi.constants.Z_FINISH,e.fullFlushFlag=fi.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(fi.constants.Z_SYNC_FLUSH),(0,DS.default)(this.handle,"zlib binding closed");let r=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=r}this.handle&&(this.#e=e,this.#t=t)}}}};U.Zlib=di;var xS=class extends di{static{o(this,"Deflate")}constructor(e){super(e,"Deflate")}};U.Deflate=xS;var LS=class extends di{static{o(this,"Inflate")}constructor(e){super(e,"Inflate")}};U.Inflate=LS;var MS=class extends di{static{o(this,"Gzip")}#e;constructor(e){super(e,"Gzip"),this.#e=e&&!!e.portable}[Os](e){return this.#e?(this.#e=!1,e[9]=255,super[Os](e)):super[Os](e)}};U.Gzip=MS;var BS=class extends di{static{o(this,"Gunzip")}constructor(e){super(e,"Gunzip")}};U.Gunzip=BS;var kS=class extends di{static{o(this,"DeflateRaw")}constructor(e){super(e,"DeflateRaw")}};U.DeflateRaw=kS;var FS=class extends di{static{o(this,"InflateRaw")}constructor(e){super(e,"InflateRaw")}};U.InflateRaw=FS;var US=class extends di{static{o(this,"Unzip")}constructor(e){super(e,"Unzip")}};U.Unzip=US;var kh=class extends Oc{static{o(this,"Brotli")}constructor(e,t){e=e||{},e.flush=e.flush||fi.constants.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||fi.constants.BROTLI_OPERATION_FINISH,e.fullFlushFlag=fi.constants.BROTLI_OPERATION_FLUSH,super(e,t)}},jS=class extends kh{static{o(this,"BrotliCompress")}constructor(e){super(e,"BrotliCompress")}};U.BrotliCompress=jS;var $S=class extends kh{static{o(this,"BrotliDecompress")}constructor(e){super(e,"BrotliDecompress")}};U.BrotliDecompress=$S;var Fh=class extends Oc{static{o(this,"Zstd")}constructor(e,t){e=e||{},e.flush=e.flush||fi.constants.ZSTD_e_continue,e.finishFlush=e.finishFlush||fi.constants.ZSTD_e_end,e.fullFlushFlag=fi.constants.ZSTD_e_flush,super(e,t)}},qS=class extends Fh{static{o(this,"ZstdCompress")}constructor(e){super(e,"ZstdCompress")}};U.ZstdCompress=qS;var VS=class extends Fh{static{o(this,"ZstdDecompress")}constructor(e){super(e,"ZstdDecompress")}};U.ZstdDecompress=VS});var VN=d(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.parse=Wn.encode=void 0;var tK=o((i,e)=>{if(Number.isSafeInteger(i))i<0?rK(i,e):iK(i,e);else throw Error("cannot encode number outside of javascript safe integer range");return e},"encode");Wn.encode=tK;var iK=o((i,e)=>{e[0]=128;for(var t=e.length;t>1;t--)e[t-1]=i&255,i=Math.floor(i/256)},"encodePositive"),rK=o((i,e)=>{e[0]=255;var t=!1;i=i*-1;for(var r=e.length;r>1;r--){var s=i&255;i=Math.floor(i/256),t?e[r-1]=$N(s):s===0?e[r-1]=0:(t=!0,e[r-1]=qN(s))}},"encodeNegative"),sK=o(i=>{let e=i[0],t=e===128?oK(i.subarray(1,i.length)):e===255?nK(i):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");Wn.parse=sK;var nK=o(i=>{for(var e=i.length,t=0,r=!1,s=e-1;s>-1;s--){var n=Number(i[s]),a;r?a=$N(n):n===0?a=n:(r=!0,a=qN(n)),a!==0&&(t-=a*Math.pow(256,e-s-1))}return t},"twos"),oK=o(i=>{for(var e=i.length,t=0,r=e-1;r>-1;r--){var s=Number(i[r]);s!==0&&(t+=s*Math.pow(256,e-r-1))}return t},"pos"),$N=o(i=>(255^i)&255,"onesComp"),qN=o(i=>(255^i)+1&255,"twosComp")});var zS=d(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.code=ft.name=ft.isName=ft.isCode=void 0;var aK=o(i=>ft.name.has(i),"isCode");ft.isCode=aK;var cK=o(i=>ft.code.has(i),"isName");ft.isName=cK;ft.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"]]);ft.code=new Map(Array.from(ft.name).map(i=>[i[1],i[0]]))});var Kn=d(pi=>{"use strict";var uK=pi&&pi.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),lK=pi&&pi.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),zN=pi&&pi.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&uK(e,i,t);return lK(e,i),e};Object.defineProperty(pi,"__esModule",{value:!0});pi.Header=void 0;var Jn=require("node:path"),HN=zN(VN()),Rc=zN(zS()),WS=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,r,s){Buffer.isBuffer(e)?this.decode(e,t||0,r,s):e&&this.#t(e)}decode(e,t,r,s){if(t||(t=0),!e||!(e.length>=t+512))throw new Error("need 512 bytes for header");this.path=Rs(e,t,100),this.mode=Ar(e,t+100,8),this.uid=Ar(e,t+108,8),this.gid=Ar(e,t+116,8),this.size=Ar(e,t+124,12),this.mtime=HS(e,t+136,12),this.cksum=Ar(e,t+148,12),s&&this.#t(s,!0),r&&this.#t(r);let n=Rs(e,t+156,1);if(Rc.isCode(n)&&(this.#e=n||"0"),this.#e==="0"&&this.path.slice(-1)==="/"&&(this.#e="5"),this.#e==="5"&&(this.size=0),this.linkpath=Rs(e,t+157,100),e.subarray(t+257,t+265).toString()==="ustar\x0000")if(this.uname=Rs(e,t+265,32),this.gname=Rs(e,t+297,32),this.devmaj=Ar(e,t+329,8)??0,this.devmin=Ar(e,t+337,8)??0,e[t+475]!==0){let c=Rs(e,t+345,155);this.path=c+"/"+this.path}else{let c=Rs(e,t+345,130);c&&(this.path=c+"/"+this.path),this.atime=HS(e,t+476,12),this.ctime=HS(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(([r,s])=>!(s==null||r==="path"&&t||r==="linkpath"&&t||r==="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 r=this.ctime||this.atime?130:155,s=hK(this.path||"",r),n=s[0],a=s[1];this.needPax=!!s[2],this.needPax=As(e,t,100,n)||this.needPax,this.needPax=Tr(e,t+100,8,this.mode)||this.needPax,this.needPax=Tr(e,t+108,8,this.uid)||this.needPax,this.needPax=Tr(e,t+116,8,this.gid)||this.needPax,this.needPax=Tr(e,t+124,12,this.size)||this.needPax,this.needPax=GS(e,t+136,12,this.mtime)||this.needPax,e[t+156]=this.#e.charCodeAt(0),this.needPax=As(e,t+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",t+257,8),this.needPax=As(e,t+265,32,this.uname)||this.needPax,this.needPax=As(e,t+297,32,this.gname)||this.needPax,this.needPax=Tr(e,t+329,8,this.devmaj)||this.needPax,this.needPax=Tr(e,t+337,8,this.devmin)||this.needPax,this.needPax=As(e,t+345,r,a)||this.needPax,e[t+475]!==0?this.needPax=As(e,t+345,155,a)||this.needPax:(this.needPax=As(e,t+345,130,a)||this.needPax,this.needPax=GS(e,t+476,12,this.atime)||this.needPax,this.needPax=GS(e,t+488,12,this.ctime)||this.needPax);let c=256;for(let u=t;u<t+148;u++)c+=e[u];for(let u=t+156;u<t+512;u++)c+=e[u];return this.cksum=c,Tr(e,t+148,8,this.cksum),this.cksumValid=!0,this.needPax}get type(){return this.#e==="Unsupported"?this.#e:Rc.name.get(this.#e)}get typeKey(){return this.#e}set type(e){let t=String(Rc.code.get(e));if(Rc.isCode(t)||t==="Unsupported")this.#e=t;else if(Rc.isCode(e))this.#e=e;else throw new TypeError("invalid entry type: "+e)}};pi.Header=WS;var hK=o((i,e)=>{let r=i,s="",n,a=Jn.posix.parse(i).root||".";if(Buffer.byteLength(r)<100)n=[r,s,!1];else{s=Jn.posix.dirname(r),r=Jn.posix.basename(r);do Buffer.byteLength(r)<=100&&Buffer.byteLength(s)<=e?n=[r,s,!1]:Buffer.byteLength(r)>100&&Buffer.byteLength(s)<=e?n=[r.slice(0,99),s,!0]:(r=Jn.posix.join(Jn.posix.basename(s),r),s=Jn.posix.dirname(s));while(s!==a&&n===void 0);n||(n=[i.slice(0,99),"",!0])}return n},"splitPrefix"),Rs=o((i,e,t)=>i.subarray(e,e+t).toString("utf8").replace(/\0.*/,""),"decString"),HS=o((i,e,t)=>fK(Ar(i,e,t)),"decDate"),fK=o(i=>i===void 0?void 0:new Date(i*1e3),"numToDate"),Ar=o((i,e,t)=>Number(i[e])&128?HN.parse(i.subarray(e,e+t)):pK(i,e,t),"decNumber"),dK=o(i=>isNaN(i)?void 0:i,"nanUndef"),pK=o((i,e,t)=>dK(parseInt(i.subarray(e,e+t).toString("utf8").replace(/\0.*$/,"").trim(),8)),"decSmallNumber"),mK={12:8589934591,8:2097151},Tr=o((i,e,t,r)=>r===void 0?!1:r>mK[t]||r<0?(HN.encode(r,i.subarray(e,e+t)),!0):(gK(i,e,t,r),!1),"encNumber"),gK=o((i,e,t,r)=>i.write(yK(r,t),e,t,"ascii"),"encSmallNumber"),yK=o((i,e)=>SK(Math.floor(i).toString(8),e),"octalString"),SK=o((i,e)=>(i.length===e-1?i:new Array(e-i.length-1).join("0")+i+" ")+"\0","padOctal"),GS=o((i,e,t,r)=>r===void 0?!1:Tr(i,e,t,r.getTime()/1e3),"encDate"),EK=new Array(156).join("\0"),As=o((i,e,t,r)=>r===void 0?!1:(i.write(r+EK,e,t,"utf8"),r.length!==Buffer.byteLength(r)||r.length>t),"encString")});var jh=d(Uh=>{"use strict";Object.defineProperty(Uh,"__esModule",{value:!0});Uh.Pax=void 0;var wK=require("node:path"),_K=Kn(),JS=class i{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),r=512*Math.ceil(1+t/512),s=Buffer.allocUnsafe(r);for(let n=0;n<512;n++)s[n]=0;new _K.Header({path:("PaxHeader/"+(0,wK.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],r=t instanceof Date?t.getTime()/1e3:t,s=" "+(e==="dev"||e==="ino"||e==="nlink"?"SCHILY.":"")+e+"="+r+`
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,r=!1){return new i(bK(IK(e),t),r)}};Uh.Pax=JS;var bK=o((i,e)=>e?Object.assign({},e,i):i,"merge"),IK=o(i=>i.replace(/\n$/,"").split(`
30
- `).reduce(OK,Object.create(null)),"parseKV"),OK=o((i,e)=>{let t=parseInt(e,10);if(t!==Buffer.byteLength(e)+1)return i;e=e.slice((t+" ").length);let r=e.split("="),s=r.shift();if(!s)return i;let n=s.replace(/^SCHILY\.(dev|ino|nlink)/,"$1"),a=r.join("=");return i[n]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(n)?new Date(Number(a)*1e3):/^[0-9]+$/.test(a)?+a:a,i},"parseKVLine")});var Zn=d($h=>{"use strict";Object.defineProperty($h,"__esModule",{value:!0});$h.normalizeWindowsPath=void 0;var vK=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;$h.normalizeWindowsPath=vK!=="win32"?i=>i:i=>i&&i.replace(/\\/g,"/")});var zh=d(Vh=>{"use strict";Object.defineProperty(Vh,"__esModule",{value:!0});Vh.ReadEntry=void 0;var RK=te(),qh=Zn(),KS=class extends RK.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,r){switch(super({}),this.pause(),this.extended=t,this.globalExtended=r,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,qh.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,qh.normalizeWindowsPath)(e.linkpath):void 0,this.uname=e.uname,this.gname=e.gname,t&&this.#e(t),r&&this.#e(r,!0)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");let r=this.remain,s=this.blockRemain;return this.remain=Math.max(0,r-t),this.blockRemain=Math.max(0,s-t),this.ignore?!0:r>=t?super.write(e):super.write(e.subarray(0,r))}#e(e,t=!1){e.path&&(e.path=(0,qh.normalizeWindowsPath)(e.path)),e.linkpath&&(e.linkpath=(0,qh.normalizeWindowsPath)(e.linkpath)),Object.assign(this,Object.fromEntries(Object.entries(e).filter(([r,s])=>!(s==null||r==="path"&&t))))}};Vh.ReadEntry=KS});var Gh=d(Hh=>{"use strict";Object.defineProperty(Hh,"__esModule",{value:!0});Hh.warnMethod=void 0;var AK=o((i,e,t,r={})=>{i.file&&(r.file=i.file),i.cwd&&(r.cwd=i.cwd),r.code=t instanceof Error&&t.code||e,r.tarCode=e,!i.strict&&r.recoverable!==!1?(t instanceof Error&&(r=Object.assign(t,r),t=t.message),i.emit("warn",e,t,r)):t instanceof Error?i.emit("error",Object.assign(t,r)):i.emit("error",Object.assign(new Error(`${e}: ${t}`),r))},"warnMethod");Hh.warnMethod=AK});var ef=d(Qh=>{"use strict";Object.defineProperty(Qh,"__esModule",{value:!0});Qh.Parser=void 0;var TK=require("events"),ZS=vc(),GN=Kn(),WN=jh(),CK=zh(),NK=Gh(),PK=1024*1024,tE=Buffer.from([31,139]),iE=Buffer.from([40,181,47,253]),DK=Math.max(tE.length,iE.length),Rt=Symbol("state"),Ts=Symbol("writeEntry"),Xi=Symbol("readEntry"),YS=Symbol("nextEntry"),JN=Symbol("processEntry"),mi=Symbol("extendedHeader"),Ac=Symbol("globalExtendedHeader"),Cr=Symbol("meta"),KN=Symbol("emitMeta"),ie=Symbol("buffer"),Qi=Symbol("queue"),Nr=Symbol("ended"),XS=Symbol("emittedEnd"),Cs=Symbol("emit"),Ee=Symbol("unzip"),Wh=Symbol("consumeChunk"),Jh=Symbol("consumeChunkSub"),QS=Symbol("consumeBody"),ZN=Symbol("consumeMeta"),YN=Symbol("consumeHeader"),Tc=Symbol("consuming"),eE=Symbol("bufferConcat"),Kh=Symbol("maybeEnd"),Yn=Symbol("writing"),Pr=Symbol("aborted"),Zh=Symbol("onDone"),Ns=Symbol("sawValidEntry"),Yh=Symbol("sawNullBlock"),Xh=Symbol("sawEOF"),XN=Symbol("closeStream"),xK=o(()=>!0,"noop"),rE=class extends TK.EventEmitter{static{o(this,"Parser")}file;strict;maxMetaEntrySize;filter;brotli;zstd;writable=!0;readable=!1;[Qi]=[];[ie];[Xi];[Ts];[Rt]="begin";[Cr]="";[mi];[Ac];[Nr]=!1;[Ee];[Pr]=!1;[Ns];[Yh]=!1;[Xh]=!1;[Yn]=!1;[Tc]=!1;[XS]=!1;constructor(e={}){super(),this.file=e.file||"",this.on(Zh,()=>{(this[Rt]==="begin"||this[Ns]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(Zh,e.ondone):this.on(Zh,()=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||PK,this.filter=typeof e.filter=="function"?e.filter:xK;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 r=e.file&&(e.file.endsWith(".tar.zst")||e.file.endsWith(".tzst"));this.zstd=!(e.gzip||e.brotli)&&e.zstd!==void 0?e.zstd:r?!0:void 0,this.on("end",()=>this[XN]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onReadEntry=="function"&&this.on("entry",e.onReadEntry)}warn(e,t,r={}){(0,NK.warnMethod)(this,e,t,r)}[YN](e,t){this[Ns]===void 0&&(this[Ns]=!1);let r;try{r=new GN.Header(e,t,this[mi],this[Ac])}catch(s){return this.warn("TAR_ENTRY_INVALID",s)}if(r.nullBlock)this[Yh]?(this[Xh]=!0,this[Rt]==="begin"&&(this[Rt]="header"),this[Cs]("eof")):(this[Yh]=!0,this[Cs]("nullBlock"));else if(this[Yh]=!1,!r.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:r});else if(!r.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:r});else{let s=r.type;if(/^(Symbolic)?Link$/.test(s)&&!r.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:r});else if(!/^(Symbolic)?Link$/.test(s)&&!/^(Global)?ExtendedHeader$/.test(s)&&r.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:r});else{let n=this[Ts]=new CK.ReadEntry(r,this[mi],this[Ac]);if(!this[Ns])if(n.remain){let a=o(()=>{n.invalid||(this[Ns]=!0)},"onend");n.on("end",a)}else this[Ns]=!0;n.meta?n.size>this.maxMetaEntrySize?(n.ignore=!0,this[Cs]("ignoredEntry",n),this[Rt]="ignore",n.resume()):n.size>0&&(this[Cr]="",n.on("data",a=>this[Cr]+=a),this[Rt]="meta"):(this[mi]=void 0,n.ignore=n.ignore||!this.filter(n.path,n),n.ignore?(this[Cs]("ignoredEntry",n),this[Rt]=n.remain?"ignore":"header",n.resume()):(n.remain?this[Rt]="body":(this[Rt]="header",n.end()),this[Xi]?this[Qi].push(n):(this[Qi].push(n),this[YS]())))}}}[XN](){queueMicrotask(()=>this.emit("close"))}[JN](e){let t=!0;if(!e)this[Xi]=void 0,t=!1;else if(Array.isArray(e)){let[r,...s]=e;this.emit(r,...s)}else this[Xi]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",()=>this[YS]()),t=!1);return t}[YS](){do;while(this[JN](this[Qi].shift()));if(!this[Qi].length){let e=this[Xi];!e||e.flowing||e.size===e.remain?this[Yn]||this.emit("drain"):e.once("drain",()=>this.emit("drain"))}}[QS](e,t){let r=this[Ts];if(!r)throw new Error("attempt to consume body without entry??");let s=r.blockRemain??0,n=s>=e.length&&t===0?e:e.subarray(t,t+s);return r.write(n),r.blockRemain||(this[Rt]="header",this[Ts]=void 0,r.end()),n.length}[ZN](e,t){let r=this[Ts],s=this[QS](e,t);return!this[Ts]&&r&&this[KN](r),s}[Cs](e,t,r){!this[Qi].length&&!this[Xi]?this.emit(e,t,r):this[Qi].push([e,t,r])}[KN](e){switch(this[Cs]("meta",this[Cr]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[mi]=WN.Pax.parse(this[Cr],this[mi],!1);break;case"GlobalExtendedHeader":this[Ac]=WN.Pax.parse(this[Cr],this[Ac],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":{let t=this[mi]??Object.create(null);this[mi]=t,t.path=this[Cr].replace(/\0.*/,"");break}case"NextFileHasLongLinkpath":{let t=this[mi]||Object.create(null);this[mi]=t,t.linkpath=this[Cr].replace(/\0.*/,"");break}default:throw new Error("unknown meta: "+e.type)}}abort(e){this[Pr]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e,t,r){if(typeof t=="function"&&(r=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8")),this[Pr])return r?.(),!1;if((this[Ee]===void 0||this.brotli===void 0&&this[Ee]===!1)&&e){if(this[ie]&&(e=Buffer.concat([this[ie],e]),this[ie]=void 0),e.length<DK)return this[ie]=e,r?.(),!0;for(let u=0;this[Ee]===void 0&&u<tE.length;u++)e[u]!==tE[u]&&(this[Ee]=!1);let a=!1;if(this[Ee]===!1&&this.zstd!==!1){a=!0;for(let u=0;u<iE.length;u++)if(e[u]!==iE[u]){a=!1;break}}let c=this.brotli===void 0&&!a;if(this[Ee]===!1&&c)if(e.length<512)if(this[Nr])this.brotli=!0;else return this[ie]=e,r?.(),!0;else try{new GN.Header(e.subarray(0,512)),this.brotli=!1}catch{this.brotli=!0}if(this[Ee]===void 0||this[Ee]===!1&&(this.brotli||a)){let u=this[Nr];this[Nr]=!1,this[Ee]=this[Ee]===void 0?new ZS.Unzip({}):a?new ZS.ZstdDecompress({}):new ZS.BrotliDecompress({}),this[Ee].on("data",h=>this[Wh](h)),this[Ee].on("error",h=>this.abort(h)),this[Ee].on("end",()=>{this[Nr]=!0,this[Wh]()}),this[Yn]=!0;let l=!!this[Ee][u?"end":"write"](e);return this[Yn]=!1,r?.(),l}}this[Yn]=!0,this[Ee]?this[Ee].write(e):this[Wh](e),this[Yn]=!1;let n=this[Qi].length?!1:this[Xi]?this[Xi].flowing:!0;return!n&&!this[Qi].length&&this[Xi]?.once("drain",()=>this.emit("drain")),r?.(),n}[eE](e){e&&!this[Pr]&&(this[ie]=this[ie]?Buffer.concat([this[ie],e]):e)}[Kh](){if(this[Nr]&&!this[XS]&&!this[Pr]&&!this[Tc]){this[XS]=!0;let e=this[Ts];if(e&&e.blockRemain){let t=this[ie]?this[ie].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`,{entry:e}),this[ie]&&e.write(this[ie]),e.end()}this[Cs](Zh)}}[Wh](e){if(this[Tc]&&e)this[eE](e);else if(!e&&!this[ie])this[Kh]();else if(e){if(this[Tc]=!0,this[ie]){this[eE](e);let t=this[ie];this[ie]=void 0,this[Jh](t)}else this[Jh](e);for(;this[ie]&&this[ie]?.length>=512&&!this[Pr]&&!this[Xh];){let t=this[ie];this[ie]=void 0,this[Jh](t)}this[Tc]=!1}(!this[ie]||this[Nr])&&this[Kh]()}[Jh](e){let t=0,r=e.length;for(;t+512<=r&&!this[Pr]&&!this[Xh];)switch(this[Rt]){case"begin":case"header":this[YN](e,t),t+=512;break;case"ignore":case"body":t+=this[QS](e,t);break;case"meta":t+=this[ZN](e,t);break;default:throw new Error("invalid state: "+this[Rt])}t<r&&(this[ie]?this[ie]=Buffer.concat([e.subarray(t),this[ie]]):this[ie]=e.subarray(t))}end(e,t,r){return typeof e=="function"&&(r=e,t=void 0,e=void 0),typeof t=="function"&&(r=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,t)),r&&this.once("finish",r),this[Pr]||(this[Ee]?(e&&this[Ee].write(e),this[Ee].end()):(this[Nr]=!0,(this.brotli===void 0||this.zstd===void 0)&&(e=e||Buffer.alloc(0)),e&&this.write(e),this[Kh]())),this}};Qh.Parser=rE});var rf=d(tf=>{"use strict";Object.defineProperty(tf,"__esModule",{value:!0});tf.stripTrailingSlashes=void 0;var LK=o(i=>{let e=i.length-1,t=-1;for(;e>-1&&i.charAt(e)==="/";)t=e,e--;return t===-1?i:i.slice(0,t)},"stripTrailingSlashes");tf.stripTrailingSlashes=LK});var Qn=d(Ge=>{"use strict";var MK=Ge&&Ge.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),BK=Ge&&Ge.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),kK=Ge&&Ge.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&MK(e,i,t);return BK(e,i),e},FK=Ge&&Ge.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.list=Ge.filesFilter=void 0;var UK=kK(zn()),Xn=FK(require("node:fs")),QN=require("path"),jK=Hn(),sf=ef(),sE=rf(),$K=o(i=>{let e=i.onReadEntry;i.onReadEntry=e?t=>{e(t),t.resume()}:t=>t.resume()},"onReadEntryFunction"),qK=o((i,e)=>{let t=new Map(e.map(n=>[(0,sE.stripTrailingSlashes)(n),!0])),r=i.filter,s=o((n,a="")=>{let c=a||(0,QN.parse)(n).root||".",u;if(n===c)u=!1;else{let l=t.get(n);l!==void 0?u=l:u=s((0,QN.dirname)(n),c)}return t.set(n,u),u},"mapHas");i.filter=r?(n,a)=>r(n,a)&&s((0,sE.stripTrailingSlashes)(n)):n=>s((0,sE.stripTrailingSlashes)(n))},"filesFilter");Ge.filesFilter=qK;var VK=o(i=>{let e=new sf.Parser(i),t=i.file,r;try{r=Xn.default.openSync(t,"r");let s=Xn.default.fstatSync(r),n=i.maxReadSize||16*1024*1024;if(s.size<n){let a=Buffer.allocUnsafe(s.size);Xn.default.readSync(r,a,0,s.size,0),e.end(a)}else{let a=0,c=Buffer.allocUnsafe(n);for(;a<s.size;){let u=Xn.default.readSync(r,c,0,n,a);a+=u,e.write(c.subarray(0,u))}e.end()}}finally{if(typeof r=="number")try{Xn.default.closeSync(r)}catch{}}},"listFileSync"),zK=o((i,e)=>{let t=new sf.Parser(i),r=i.maxReadSize||16*1024*1024,s=i.file;return new Promise((a,c)=>{t.on("error",c),t.on("end",a),Xn.default.stat(s,(u,l)=>{if(u)c(u);else{let h=new UK.ReadStream(s,{readSize:r,size:l.size});h.on("error",c),h.pipe(t)}})})},"listFile");Ge.list=(0,jK.makeCommand)(VK,zK,i=>new sf.Parser(i),i=>new sf.Parser(i),(i,e)=>{e?.length&&(0,Ge.filesFilter)(i,e),i.noResume||$K(i)})});var eP=d(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});nf.modeFix=void 0;var HK=o((i,e,t)=>(i&=4095,t&&(i=(i|384)&-19),e&&(i&256&&(i|=64),i&32&&(i|=8),i&4&&(i|=1)),i),"modeFix");nf.modeFix=HK});var nE=d(of=>{"use strict";Object.defineProperty(of,"__esModule",{value:!0});of.stripAbsolutePath=void 0;var GK=require("node:path"),{isAbsolute:WK,parse:tP}=GK.win32,JK=o(i=>{let e="",t=tP(i);for(;WK(i)||t.root;){let r=i.charAt(0)==="/"&&i.slice(0,4)!=="//?/"?"/":t.root;i=i.slice(r.length),e+=r,t=tP(i)}return[e,i]},"stripAbsolutePath");of.stripAbsolutePath=JK});var aE=d(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.decode=eo.encode=void 0;var af=["|","<",">","?",":"],oE=af.map(i=>String.fromCharCode(61440+i.charCodeAt(0))),KK=new Map(af.map((i,e)=>[i,oE[e]])),ZK=new Map(oE.map((i,e)=>[i,af[e]])),YK=o(i=>af.reduce((e,t)=>e.split(t).join(KK.get(t)),i),"encode");eo.encode=YK;var XK=o(i=>oE.reduce((e,t)=>e.split(t).join(ZK.get(t)),i),"decode");eo.decode=XK});var SE=d(Be=>{"use strict";var QK=Be&&Be.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),eZ=Be&&Be.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),tZ=Be&&Be.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&QK(e,i,t);return eZ(e,i),e},aP=Be&&Be.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Be,"__esModule",{value:!0});Be.WriteEntryTar=Be.WriteEntrySync=Be.WriteEntry=void 0;var yi=aP(require("fs")),cP=te(),iP=aP(require("path")),uP=Kn(),lP=eP(),gi=Zn(),hP=Mh(),fP=jh(),dP=nE(),iZ=rf(),pP=Gh(),rZ=tZ(aE()),mP=o((i,e)=>e?(i=(0,gi.normalizeWindowsPath)(i).replace(/^\.(\/|$)/,""),(0,iZ.stripTrailingSlashes)(e)+"/"+i):(0,gi.normalizeWindowsPath)(i),"prefixPath"),sZ=16*1024*1024,rP=Symbol("process"),sP=Symbol("file"),nP=Symbol("directory"),uE=Symbol("symlink"),oP=Symbol("hardlink"),Cc=Symbol("header"),cf=Symbol("read"),lE=Symbol("lstat"),uf=Symbol("onlstat"),hE=Symbol("onread"),fE=Symbol("onreadlink"),dE=Symbol("openfile"),pE=Symbol("onopenfile"),Dr=Symbol("close"),lf=Symbol("mode"),mE=Symbol("awaitDrain"),cE=Symbol("ondrain"),Si=Symbol("prefix"),hf=class extends cP.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 r=(0,hP.dealias)(t);super(),this.path=(0,gi.normalizeWindowsPath)(e),this.portable=!!r.portable,this.maxReadSize=r.maxReadSize||sZ,this.linkCache=r.linkCache||new Map,this.statCache=r.statCache||new Map,this.preservePaths=!!r.preservePaths,this.cwd=(0,gi.normalizeWindowsPath)(r.cwd||process.cwd()),this.strict=!!r.strict,this.noPax=!!r.noPax,this.noMtime=!!r.noMtime,this.mtime=r.mtime,this.prefix=r.prefix?(0,gi.normalizeWindowsPath)(r.prefix):void 0,this.onWriteEntry=r.onWriteEntry,typeof r.onwarn=="function"&&this.on("warn",r.onwarn);let s=!1;if(!this.preservePaths){let[a,c]=(0,dP.stripAbsolutePath)(this.path);a&&typeof c=="string"&&(this.path=c,s=a)}this.win32=!!r.win32||process.platform==="win32",this.win32&&(this.path=rZ.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=(0,gi.normalizeWindowsPath)(r.absolute||iP.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[uf](n):this[lE]()}warn(e,t,r={}){return(0,pP.warnMethod)(this,e,t,r)}emit(e,...t){return e==="error"&&(this.#e=!0),super.emit(e,...t)}[lE](){yi.default.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[uf](t)})}[uf](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=nZ(e),this.emit("stat",e),this[rP]()}[rP](){switch(this.type){case"File":return this[sP]();case"Directory":return this[nP]();case"SymbolicLink":return this[uE]();default:return this.end()}}[lf](e){return(0,lP.modeFix)(e,this.type==="Directory",this.portable)}[Si](e){return mP(e,this.prefix)}[Cc](){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 uP.Header({path:this[Si](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[Si](this.linkpath):this.linkpath,mode:this[lf](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 fP.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[Si](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[Si](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)}[nP](){if(!this.stat)throw new Error("cannot create directory entry without stat");this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[Cc](),this.end()}[uE](){yi.default.readlink(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[fE](t)})}[fE](e){this.linkpath=(0,gi.normalizeWindowsPath)(e),this[Cc](),this.end()}[oP](e){if(!this.stat)throw new Error("cannot create link entry without stat");this.type="Link",this.linkpath=(0,gi.normalizeWindowsPath)(iP.default.relative(this.cwd,e)),this.stat.size=0,this[Cc](),this.end()}[sP](){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[oP](t);this.linkCache.set(e,this.absolute)}if(this[Cc](),this.stat.size===0)return this.end();this[dE]()}[dE](){yi.default.open(this.absolute,"r",(e,t)=>{if(e)return this.emit("error",e);this[pE](t)})}[pE](e){if(this.fd=e,this.#e)return this[Dr]();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[cf]()}[cf](){let{fd:e,buf:t,offset:r,length:s,pos:n}=this;if(e===void 0||t===void 0)throw new Error("cannot read file without first opening");yi.default.read(e,t,r,s,n,(a,c)=>{if(a)return this[Dr](()=>this.emit("error",a));this[hE](c)})}[Dr](e=()=>{}){this.fd!==void 0&&yi.default.close(this.fd,e)}[hE](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[Dr](()=>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[Dr](()=>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[cE]():this[mE](()=>this[cE]())}[mE](e){this.once("drain",e)}write(e,t,r){if(typeof t=="function"&&(r=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,r)}[cE](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[Dr](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[cf]()}};Be.WriteEntry=hf;var gE=class extends hf{static{o(this,"WriteEntrySync")}sync=!0;[lE](){this[uf](yi.default.lstatSync(this.absolute))}[uE](){this[fE](yi.default.readlinkSync(this.absolute))}[dE](){this[pE](yi.default.openSync(this.absolute,"r"))}[cf](){let e=!0;try{let{fd:t,buf:r,offset:s,length:n,pos:a}=this;if(t===void 0||r===void 0)throw new Error("fd and buf must be set in READ method");let c=yi.default.readSync(t,r,s,n,a);this[hE](c),e=!1}finally{if(e)try{this[Dr](()=>{})}catch{}}}[mE](e){e()}[Dr](e=()=>{}){this.fd!==void 0&&yi.default.closeSync(this.fd),e()}};Be.WriteEntrySync=gE;var yE=class extends cP.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,r={}){return(0,pP.warnMethod)(this,e,t,r)}constructor(e,t={}){let r=(0,hP.dealias)(t);super(),this.preservePaths=!!r.preservePaths,this.portable=!!r.portable,this.strict=!!r.strict,this.noPax=!!r.noPax,this.noMtime=!!r.noMtime,this.onWriteEntry=r.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=r.prefix,this.path=(0,gi.normalizeWindowsPath)(e.path),this.mode=e.mode!==void 0?this[lf](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:r.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,gi.normalizeWindowsPath)(e.linkpath):void 0,typeof r.onwarn=="function"&&this.on("warn",r.onwarn);let n=!1;if(!this.preservePaths){let[c,u]=(0,dP.stripAbsolutePath)(this.path);c&&typeof u=="string"&&(this.path=u,n=c)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.onWriteEntry?.(this),this.header=new uP.Header({path:this[Si](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[Si](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 fP.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[Si](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[Si](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)}[Si](e){return mP(e,this.prefix)}[lf](e){return(0,lP.modeFix)(e,this.type==="Directory",this.portable)}write(e,t,r){typeof t=="function"&&(r=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,r)}end(e,t,r){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),typeof e=="function"&&(r=e,t=void 0,e=void 0),typeof t=="function"&&(r=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,t??"utf8")),r&&this.once("finish",r),e?super.end(e,r):super.end(r),this}};Be.WriteEntryTar=yE;var nZ=o(i=>i.isFile()?"File":i.isDirectory()?"Directory":i.isSymbolicLink()?"SymbolicLink":"Unsupported","getType")});var gP=d(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.Node=io.Yallist=void 0;var EE=class i{static{o(this,"Yallist")}tail;head;length=0;static create(e=[]){return new i(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,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),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,r=e.length;t<r;t++)aZ(this,e[t]);return this.length}unshift(...e){for(var t=0,r=e.length;t<r;t++)cZ(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 r=this.head,s=0;r;s++)e.call(t,r.value,s,this),r=r.next}forEachReverse(e,t){t=t||this;for(let r=this.tail,s=this.length-1;r;s--)e.call(t,r.value,s,this),r=r.prev}get(e){let t=0,r=this.head;for(;r&&t<e;t++)r=r.next;if(t===e&&r)return r.value}getReverse(e){let t=0,r=this.tail;for(;r&&t<e;t++)r=r.prev;if(t===e&&r)return r.value}map(e,t){t=t||this;let r=new i;for(let s=this.head;s;)r.push(e.call(t,s.value,this)),s=s.next;return r}mapReverse(e,t){t=t||this;var r=new i;for(let s=this.tail;s;)r.push(e.call(t,s.value,this)),s=s.prev;return r}reduce(e,t){let r,s=this.head;if(arguments.length>1)r=t;else if(this.head)s=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=0;s;n++)r=e(r,s.value,n),s=s.next;return r}reduceReverse(e,t){let r,s=this.tail;if(arguments.length>1)r=t;else if(this.tail)s=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(let n=this.length-1;s;n--)r=e(r,s.value,n),s=s.prev;return r}toArray(){let e=new Array(this.length);for(let t=0,r=this.head;r;t++)e[t]=r.value,r=r.next;return e}toArrayReverse(){let e=new Array(this.length);for(let t=0,r=this.tail;r;t++)e[t]=r.value,r=r.prev;return e}slice(e=0,t=this.length){t<0&&(t+=this.length),e<0&&(e+=this.length);let r=new i;if(t<e||t<0)return r;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)r.push(s.value);return r}sliceReverse(e=0,t=this.length){t<0&&(t+=this.length),e<0&&(e+=this.length);let r=new i;if(t<e||t<0)return r;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)r.push(n.value);return r}splice(e,t=0,...r){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 r)s=oZ(this,s,a);return n}reverse(){let e=this.head,t=this.tail;for(let r=e;r;r=r.prev){let s=r.prev;r.prev=r.next,r.next=s}return this.head=t,this.tail=e,this}};io.Yallist=EE;function oZ(i,e,t){let r=e,s=e?e.next:i.head,n=new to(t,r,s,i);return n.next===void 0&&(i.tail=n),n.prev===void 0&&(i.head=n),i.length++,n}o(oZ,"insertAfter");function aZ(i,e){i.tail=new to(e,i.tail,void 0,i),i.head||(i.head=i.tail),i.length++}o(aZ,"push");function cZ(i,e){i.head=new to(e,void 0,i.head,i),i.tail||(i.tail=i.head),i.length++}o(cZ,"unshift");var to=class{static{o(this,"Node")}list;next;prev;value;constructor(e,t,r,s){this.list=s,this.value=e,t?(t.next=this,this.prev=t):this.prev=void 0,r?(r.prev=this,this.next=r):this.next=void 0}};io.Node=to});var Ef=d(ke=>{"use strict";var uZ=ke&&ke.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),lZ=ke&&ke.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),hZ=ke&&ke.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&uZ(e,i,t);return lZ(e,i),e},bP=ke&&ke.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ke,"__esModule",{value:!0});ke.PackSync=ke.Pack=ke.PackJob=void 0;var yf=bP(require("fs")),vE=SE(),Dc=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}};ke.PackJob=Dc;var fZ=te(),wE=hZ(vc()),dZ=gP(),pZ=zh(),mZ=Gh(),yP=Buffer.alloc(1024),ff=Symbol("onStat"),Nc=Symbol("ended"),Jt=Symbol("queue"),ro=Symbol("current"),Ps=Symbol("process"),Pc=Symbol("processing"),SP=Symbol("processJob"),Kt=Symbol("jobs"),_E=Symbol("jobDone"),df=Symbol("addFSEntry"),EP=Symbol("addTarEntry"),RE=Symbol("stat"),AE=Symbol("readdir"),pf=Symbol("onreaddir"),mf=Symbol("pipe"),wP=Symbol("entry"),bE=Symbol("entryOpt"),gf=Symbol("writeEntryClass"),IP=Symbol("write"),IE=Symbol("ondrain"),_P=bP(require("path")),OE=Zn(),Sf=class extends fZ.Minipass{static{o(this,"Pack")}opt;cwd;maxReadSize;preservePaths;strict;noPax;prefix;linkCache;statCache;file;portable;zip;readdirCache;noDirRecurse;follow;noMtime;mtime;filter;jobs;[gf];onWriteEntry;[Jt];[Kt]=0;[Pc]=!1;[Nc]=!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,OE.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[gf]=vE.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 wE.Gzip(e.gzip)),e.brotli&&(typeof e.brotli!="object"&&(e.brotli={}),this.zip=new wE.BrotliCompress(e.brotli)),e.zstd&&(typeof e.zstd!="object"&&(e.zstd={}),this.zip=new wE.ZstdCompress(e.zstd)),!this.zip)throw new Error("impossible");let t=this.zip;t.on("data",r=>super.write(r)),t.on("end",()=>super.end()),t.on("drain",()=>this[IE]()),this.on("resume",()=>t.resume())}else this.on("drain",this[IE]);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[Jt]=new dZ.Yallist,this[Kt]=0,this.jobs=Number(e.jobs)||4,this[Pc]=!1,this[Nc]=!1}[IP](e){return super.write(e)}add(e){return this.write(e),this}end(e,t,r){return typeof e=="function"&&(r=e,e=void 0),typeof t=="function"&&(r=t,t=void 0),e&&this.add(e),this[Nc]=!0,this[Ps](),r&&r(),this}write(e){if(this[Nc])throw new Error("write after end");return e instanceof pZ.ReadEntry?this[EP](e):this[df](e),this.flowing}[EP](e){let t=(0,OE.normalizeWindowsPath)(_P.default.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let r=new Dc(e.path,t);r.entry=new vE.WriteEntryTar(e,this[bE](r)),r.entry.on("end",()=>this[_E](r)),this[Kt]+=1,this[Jt].push(r)}this[Ps]()}[df](e){let t=(0,OE.normalizeWindowsPath)(_P.default.resolve(this.cwd,e));this[Jt].push(new Dc(e,t)),this[Ps]()}[RE](e){e.pending=!0,this[Kt]+=1;let t=this.follow?"stat":"lstat";yf.default[t](e.absolute,(r,s)=>{e.pending=!1,this[Kt]-=1,r?this.emit("error",r):this[ff](e,s)})}[ff](e,t){this.statCache.set(e.absolute,t),e.stat=t,this.filter(e.path,t)||(e.ignore=!0),this[Ps]()}[AE](e){e.pending=!0,this[Kt]+=1,yf.default.readdir(e.absolute,(t,r)=>{if(e.pending=!1,this[Kt]-=1,t)return this.emit("error",t);this[pf](e,r)})}[pf](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[Ps]()}[Ps](){if(!this[Pc]){this[Pc]=!0;for(let e=this[Jt].head;e&&this[Kt]<this.jobs;e=e.next)if(this[SP](e.value),e.value.ignore){let t=e.next;this[Jt].removeNode(e),e.next=t}this[Pc]=!1,this[Nc]&&!this[Jt].length&&this[Kt]===0&&(this.zip?this.zip.end(yP):(super.write(yP),super.end()))}}get[ro](){return this[Jt]&&this[Jt].head&&this[Jt].head.value}[_E](e){this[Jt].shift(),this[Kt]-=1,this[Ps]()}[SP](e){if(!e.pending){if(e.entry){e===this[ro]&&!e.piped&&this[mf](e);return}if(!e.stat){let t=this.statCache.get(e.absolute);t?this[ff](e,t):this[RE](e)}if(e.stat&&!e.ignore){if(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir){let t=this.readdirCache.get(e.absolute);if(t?this[pf](e,t):this[AE](e),!e.readdir)return}if(e.entry=this[wP](e),!e.entry){e.ignore=!0;return}e===this[ro]&&!e.piped&&this[mf](e)}}}[bE](e){return{onwarn:o((t,r,s)=>this.warn(t,r,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}}[wP](e){this[Kt]+=1;try{return new this[gf](e.path,this[bE](e)).on("end",()=>this[_E](e)).on("error",r=>this.emit("error",r))}catch(t){this.emit("error",t)}}[IE](){this[ro]&&this[ro].entry&&this[ro].entry.resume()}[mf](e){e.piped=!0,e.readdir&&e.readdir.forEach(s=>{let n=e.path,a=n==="./"?"":n.replace(/\/*$/,"/");this[df](a+s)});let t=e.entry,r=this.zip;if(!t)throw new Error("cannot pipe without source");r?t.on("data",s=>{r.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,r={}){(0,mZ.warnMethod)(this,e,t,r)}};ke.Pack=Sf;var TE=class extends Sf{static{o(this,"PackSync")}sync=!0;constructor(e){super(e),this[gf]=vE.WriteEntrySync}pause(){}resume(){}[RE](e){let t=this.follow?"statSync":"lstatSync";this[ff](e,yf.default[t](e.absolute))}[AE](e){this[pf](e,yf.default.readdirSync(e.absolute))}[mf](e){let t=e.entry,r=this.zip;if(e.readdir&&e.readdir.forEach(s=>{let n=e.path,a=n==="./"?"":n.replace(/\/*$/,"/");this[df](a+s)}),!t)throw new Error("Cannot pipe without source");r?t.on("data",s=>{r.write(s)}):t.on("data",s=>{super[IP](s)})}};ke.PackSync=TE});var CE=d(so=>{"use strict";var gZ=so&&so.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(so,"__esModule",{value:!0});so.create=void 0;var OP=zn(),vP=gZ(require("node:path")),RP=Qn(),yZ=Hn(),wf=Ef(),SZ=o((i,e)=>{let t=new wf.PackSync(i),r=new OP.WriteStreamSync(i.file,{mode:i.mode||438});t.pipe(r),AP(t,e)},"createFileSync"),EZ=o((i,e)=>{let t=new wf.Pack(i),r=new OP.WriteStream(i.file,{mode:i.mode||438});t.pipe(r);let s=new Promise((n,a)=>{r.on("error",a),r.on("close",n),t.on("error",a)});return TP(t,e),s},"createFile"),AP=o((i,e)=>{e.forEach(t=>{t.charAt(0)==="@"?(0,RP.list)({file:vP.default.resolve(i.cwd,t.slice(1)),sync:!0,noResume:!0,onReadEntry:o(r=>i.add(r),"onReadEntry")}):i.add(t)}),i.end()},"addFilesSync"),TP=o(async(i,e)=>{for(let t=0;t<e.length;t++){let r=String(e[t]);r.charAt(0)==="@"?await(0,RP.list)({file:vP.default.resolve(String(i.cwd),r.slice(1)),noResume:!0,onReadEntry:o(s=>{i.add(s)},"onReadEntry")}):i.add(r)}i.end()},"addFilesAsync"),wZ=o((i,e)=>{let t=new wf.PackSync(i);return AP(t,e),t},"createSync"),_Z=o((i,e)=>{let t=new wf.Pack(i);return TP(t,e),t},"createAsync");so.create=(0,yZ.makeCommand)(SZ,EZ,wZ,_Z,(i,e)=>{if(!e?.length)throw new TypeError("no paths specified to add to archive")})});var PP=d(no=>{"use strict";var bZ=no&&no.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(no,"__esModule",{value:!0});no.getWriteFlag=void 0;var CP=bZ(require("fs")),IZ=process.env.__FAKE_PLATFORM__||process.platform,OZ=IZ==="win32",{O_CREAT:vZ,O_TRUNC:RZ,O_WRONLY:AZ}=CP.default.constants,NP=Number(process.env.__FAKE_FS_O_FILENAME__)||CP.default.constants.UV_FS_O_FILEMAP||0,TZ=OZ&&!!NP,CZ=512*1024,NZ=NP|RZ|vZ|AZ;no.getWriteFlag=TZ?i=>i<CZ?NZ:"w":()=>"w"});var xP=d(Ei=>{"use strict";var DP=Ei&&Ei.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ei,"__esModule",{value:!0});Ei.chownrSync=Ei.chownr=void 0;var bf=DP(require("node:fs")),xc=DP(require("node:path")),NE=o((i,e,t)=>{try{return bf.default.lchownSync(i,e,t)}catch(r){if(r?.code!=="ENOENT")throw r}},"lchownSync"),_f=o((i,e,t,r)=>{bf.default.lchown(i,e,t,s=>{r(s&&s?.code!=="ENOENT"?s:null)})},"chown"),PZ=o((i,e,t,r,s)=>{if(e.isDirectory())(0,Ei.chownr)(xc.default.resolve(i,e.name),t,r,n=>{if(n)return s(n);let a=xc.default.resolve(i,e.name);_f(a,t,r,s)});else{let n=xc.default.resolve(i,e.name);_f(n,t,r,s)}},"chownrKid"),DZ=o((i,e,t,r)=>{bf.default.readdir(i,{withFileTypes:!0},(s,n)=>{if(s){if(s.code==="ENOENT")return r();if(s.code!=="ENOTDIR"&&s.code!=="ENOTSUP")return r(s)}if(s||!n.length)return _f(i,e,t,r);let a=n.length,c=null,u=o(l=>{if(!c){if(l)return r(c=l);if(--a===0)return _f(i,e,t,r)}},"then");for(let l of n)PZ(i,l,e,t,u)})},"chownr");Ei.chownr=DZ;var xZ=o((i,e,t,r)=>{e.isDirectory()&&(0,Ei.chownrSync)(xc.default.resolve(i,e.name),t,r),NE(xc.default.resolve(i,e.name),t,r)},"chownrKidSync"),LZ=o((i,e,t)=>{let r;try{r=bf.default.readdirSync(i,{withFileTypes:!0})}catch(s){let n=s;if(n?.code==="ENOENT")return;if(n?.code==="ENOTDIR"||n?.code==="ENOTSUP")return NE(i,e,t);throw n}for(let s of r)xZ(i,s,e,t);return NE(i,e,t)},"chownrSync");Ei.chownrSync=LZ});var LP=d(If=>{"use strict";Object.defineProperty(If,"__esModule",{value:!0});If.CwdError=void 0;var PE=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"}};If.CwdError=PE});var MP=d(Of=>{"use strict";Object.defineProperty(Of,"__esModule",{value:!0});Of.SymlinkError=void 0;var DE=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"}};Of.SymlinkError=DE});var jP=d(xr=>{"use strict";var LE=xr&&xr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(xr,"__esModule",{value:!0});xr.mkdirSync=xr.mkdir=void 0;var BP=xP(),dt=LE(require("node:fs")),MZ=LE(require("node:fs/promises")),vf=LE(require("node:path")),kP=LP(),er=Zn(),FP=MP(),BZ=o((i,e)=>{dt.default.stat(i,(t,r)=>{(t||!r.isDirectory())&&(t=new kP.CwdError(i,t?.code||"ENOTDIR")),e(t)})},"checkCwd"),kZ=o((i,e,t)=>{i=(0,er.normalizeWindowsPath)(i);let r=e.umask??18,s=e.mode|448,n=(s&r)!==0,a=e.uid,c=e.gid,u=typeof a=="number"&&typeof c=="number"&&(a!==e.processUid||c!==e.processGid),l=e.preserve,h=e.unlink,f=(0,er.normalizeWindowsPath)(e.cwd),p=o((g,S)=>{g?t(g):S&&u?(0,BP.chownr)(S,a,c,E=>p(E)):n?dt.default.chmod(i,s,t):t()},"done");if(i===f)return BZ(i,p);if(l)return MZ.default.mkdir(i,{mode:s,recursive:!0}).then(g=>p(null,g??void 0),p);let y=(0,er.normalizeWindowsPath)(vf.default.relative(f,i)).split("/");xE(f,y,s,h,f,void 0,p)},"mkdir");xr.mkdir=kZ;var xE=o((i,e,t,r,s,n,a)=>{if(!e.length)return a(null,n);let c=e.shift(),u=(0,er.normalizeWindowsPath)(vf.default.resolve(i+"/"+c));dt.default.mkdir(u,t,UP(u,e,t,r,s,n,a))},"mkdir_"),UP=o((i,e,t,r,s,n,a)=>c=>{c?dt.default.lstat(i,(u,l)=>{if(u)u.path=u.path&&(0,er.normalizeWindowsPath)(u.path),a(u);else if(l.isDirectory())xE(i,e,t,r,s,n,a);else if(r)dt.default.unlink(i,h=>{if(h)return a(h);dt.default.mkdir(i,t,UP(i,e,t,r,s,n,a))});else{if(l.isSymbolicLink())return a(new FP.SymlinkError(i,i+"/"+e.join("/")));a(c)}}):(n=n||i,xE(i,e,t,r,s,n,a))},"onmkdir"),FZ=o(i=>{let e=!1,t;try{e=dt.default.statSync(i).isDirectory()}catch(r){t=r?.code}finally{if(!e)throw new kP.CwdError(i,t??"ENOTDIR")}},"checkCwdSync"),UZ=o((i,e)=>{i=(0,er.normalizeWindowsPath)(i);let t=e.umask??18,r=e.mode|448,s=(r&t)!==0,n=e.uid,a=e.gid,c=typeof n=="number"&&typeof a=="number"&&(n!==e.processUid||a!==e.processGid),u=e.preserve,l=e.unlink,h=(0,er.normalizeWindowsPath)(e.cwd),f=o(g=>{g&&c&&(0,BP.chownrSync)(g,n,a),s&&dt.default.chmodSync(i,r)},"done");if(i===h)return FZ(h),f();if(u)return f(dt.default.mkdirSync(i,{mode:r,recursive:!0})??void 0);let m=(0,er.normalizeWindowsPath)(vf.default.relative(h,i)).split("/"),y;for(let g=m.shift(),S=h;g&&(S+="/"+g);g=m.shift()){S=(0,er.normalizeWindowsPath)(vf.default.resolve(S));try{dt.default.mkdirSync(S,r),y=y||S}catch{let _=dt.default.lstatSync(S);if(_.isDirectory())continue;if(l){dt.default.unlinkSync(S),dt.default.mkdirSync(S,r),y=y||S;continue}else if(_.isSymbolicLink())return new FP.SymlinkError(S,S+"/"+m.join("/"))}}return f(y)},"mkdirSync");xr.mkdirSync=UZ});var qP=d(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0});Rf.normalizeUnicode=void 0;var ME=Object.create(null),$P=1e4,oo=new Set,jZ=o(i=>{oo.has(i)?oo.delete(i):ME[i]=i.normalize("NFD"),oo.add(i);let e=ME[i],t=oo.size-$P;if(t>$P/10){for(let r of oo)if(oo.delete(r),delete ME[r],--t<=0)break}return e},"normalizeUnicode");Rf.normalizeUnicode=jZ});var zP=d(Af=>{"use strict";Object.defineProperty(Af,"__esModule",{value:!0});Af.PathReservations=void 0;var VP=require("node:path"),$Z=qP(),qZ=rf(),VZ=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,zZ=VZ==="win32",HZ=o(i=>i.split("/").slice(0,-1).reduce((t,r)=>{let s=t[t.length-1];return s!==void 0&&(r=(0,VP.join)(s,r)),t.push(r||"/"),t},[]),"getDirs"),BE=class{static{o(this,"PathReservations")}#e=new Map;#t=new Map;#i=new Set;reserve(e,t){e=zZ?["win32 parallelization disabled"]:e.map(s=>(0,qZ.stripTrailingSlashes)((0,VP.join)((0,$Z.normalizeUnicode)(s))).toLowerCase());let r=new Set(e.map(s=>HZ(s)).reduce((s,n)=>s.concat(n)));this.#t.set(t,{dirs:r,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 r){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)}#r(e){let t=this.#t.get(e);if(!t)throw new Error("function does not have any path reservations");return{paths:t.paths.map(r=>this.#e.get(r)),dirs:[...t.dirs].map(r=>this.#e.get(r))}}check(e){let{paths:t,dirs:r}=this.#r(e);return t.every(s=>s&&s[0]===e)&&r.every(s=>s&&s[0]instanceof Set&&s[0].has(e))}#s(e){return this.#i.has(e)||!this.check(e)?!1:(this.#i.add(e),e(()=>this.#u(e)),!0)}#u(e){if(!this.#i.has(e))return!1;let t=this.#t.get(e);if(!t)throw new Error("invalid reservation");let{paths:r,dirs:s}=t,n=new Set;for(let a of r){let c=this.#e.get(a);if(!c||c?.[0]!==e)continue;let u=c[1];if(!u){this.#e.delete(a);continue}if(c.shift(),typeof u=="function")n.add(u);else for(let l of u)n.add(l)}for(let a of s){let c=this.#e.get(a),u=c?.[0];if(!(!c||!(u instanceof Set)))if(u.size===1&&c.length===1){this.#e.delete(a);continue}else if(u.size===1){c.shift();let l=c[0];typeof l=="function"&&n.add(l)}else u.delete(e)}return this.#i.delete(e),n.forEach(a=>this.#s(a)),!0}};Af.PathReservations=BE});var GE=d(et=>{"use strict";var GZ=et&&et.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),WZ=et&&et.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),eD=et&&et.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&GZ(e,i,t);return WZ(e,i),e},HE=et&&et.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(et,"__esModule",{value:!0});et.UnpackSync=et.Unpack=void 0;var JZ=eD(zn()),KZ=HE(require("node:assert")),tD=require("node:crypto"),H=HE(require("node:fs")),tr=HE(require("node:path")),iD=PP(),rD=jP(),Zt=Zn(),ZZ=ef(),YZ=nE(),HP=eD(aE()),XZ=zP(),GP=Symbol("onEntry"),UE=Symbol("checkFs"),WP=Symbol("checkFs2"),jE=Symbol("isReusable"),At=Symbol("makeFs"),$E=Symbol("file"),qE=Symbol("directory"),Nf=Symbol("link"),JP=Symbol("symlink"),KP=Symbol("hardlink"),ZP=Symbol("unsupported"),YP=Symbol("checkPath"),Lr=Symbol("mkdir"),Fe=Symbol("onError"),Tf=Symbol("pending"),XP=Symbol("pend"),ao=Symbol("unpend"),kE=Symbol("ended"),FE=Symbol("maybeClose"),VE=Symbol("skip"),Lc=Symbol("doChown"),Mc=Symbol("uid"),Bc=Symbol("gid"),kc=Symbol("checkedCwd"),QZ=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Fc=QZ==="win32",eY=1024,tY=o((i,e)=>{if(!Fc)return H.default.unlink(i,e);let t=i+".DELETE."+(0,tD.randomBytes)(16).toString("hex");H.default.rename(i,t,r=>{if(r)return e(r);H.default.unlink(t,e)})},"unlinkFile"),iY=o(i=>{if(!Fc)return H.default.unlinkSync(i);let e=i+".DELETE."+(0,tD.randomBytes)(16).toString("hex");H.default.renameSync(i,e),H.default.unlinkSync(e)},"unlinkFileSync"),QP=o((i,e,t)=>i!==void 0&&i===i>>>0?i:e!==void 0&&e===e>>>0?e:t,"uint32"),Pf=class extends ZZ.Parser{static{o(this,"Unpack")}[kE]=!1;[kc]=!1;[Tf]=0;reservations=new XZ.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[kE]=!0,this[FE]()},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:eY,this.forceChown=e.forceChown===!0,this.win32=!!e.win32||Fc,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=(0,Zt.normalizeWindowsPath)(tr.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[GP](t))}warn(e,t,r={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(r.recoverable=!1),super.warn(e,t,r)}[FE](){this[kE]&&this[Tf]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[YP](e){let t=(0,Zt.normalizeWindowsPath)(e.path),r=t.split("/");if(this.strip){if(r.length<this.strip)return!1;if(e.type==="Link"){let s=(0,Zt.normalizeWindowsPath)(String(e.linkpath)).split("/");if(s.length>=this.strip)e.linkpath=s.slice(this.strip).join("/");else return!1}r.splice(0,this.strip),e.path=r.join("/")}if(isFinite(this.maxDepth)&&r.length>this.maxDepth)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:e,path:t,depth:r.length,maxDepth:this.maxDepth}),!1;if(!this.preservePaths){if(r.includes("..")||Fc&&/^[a-z]:\.\.$/i.test(r[0]??""))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:e,path:t}),!1;let[s,n]=(0,YZ.stripAbsolutePath)(t);s&&(e.path=String(n),this.warn("TAR_ENTRY_INFO",`stripping ${s} from absolute path`,{entry:e,path:t}))}if(tr.default.isAbsolute(e.path)?e.absolute=(0,Zt.normalizeWindowsPath)(tr.default.resolve(e.path)):e.absolute=(0,Zt.normalizeWindowsPath)(tr.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,Zt.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}=tr.default.win32.parse(String(e.absolute));e.absolute=s+HP.encode(String(e.absolute).slice(s.length));let{root:n}=tr.default.win32.parse(e.path);e.path=n+HP.encode(e.path.slice(n.length))}return!0}[GP](e){if(!this[YP](e))return e.resume();switch(KZ.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[UE](e);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[ZP](e)}}[Fe](e,t){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:t}),this[ao](),t.resume())}[Lr](e,t,r){(0,rD.mkdir)((0,Zt.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},r)}[Lc](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}[Mc](e){return QP(this.uid,e.uid,this.processUid)}[Bc](e){return QP(this.gid,e.gid,this.processGid)}[$E](e,t){let r=typeof e.mode=="number"?e.mode&4095:this.fmode,s=new JZ.WriteStream(String(e.absolute),{flags:(0,iD.getWriteFlag)(e.size),mode:r,autoClose:!1});s.on("error",u=>{s.fd&&H.default.close(s.fd,()=>{}),s.write=()=>!0,this[Fe](u,e),t()});let n=1,a=o(u=>{if(u){s.fd&&H.default.close(s.fd,()=>{}),this[Fe](u,e),t();return}--n===0&&s.fd!==void 0&&H.default.close(s.fd,l=>{l?this[Fe](l,e):this[ao](),t()})},"done");s.on("finish",()=>{let u=String(e.absolute),l=s.fd;if(typeof l=="number"&&e.mtime&&!this.noMtime){n++;let h=e.atime||new Date,f=e.mtime;H.default.futimes(l,h,f,p=>p?H.default.utimes(u,h,f,m=>a(m&&p)):a())}if(typeof l=="number"&&this[Lc](e)){n++;let h=this[Mc](e),f=this[Bc](e);typeof h=="number"&&typeof f=="number"&&H.default.fchown(l,h,f,p=>p?H.default.chown(u,h,f,m=>a(m&&p)):a())}a()});let c=this.transform&&this.transform(e)||e;c!==e&&(c.on("error",u=>{this[Fe](u,e),t()}),e.pipe(c)),c.pipe(s)}[qE](e,t){let r=typeof e.mode=="number"?e.mode&4095:this.dmode;this[Lr](String(e.absolute),r,s=>{if(s){this[Fe](s,e),t();return}let n=1,a=o(()=>{--n===0&&(t(),this[ao](),e.resume())},"done");e.mtime&&!this.noMtime&&(n++,H.default.utimes(String(e.absolute),e.atime||new Date,e.mtime,a)),this[Lc](e)&&(n++,H.default.chown(String(e.absolute),Number(this[Mc](e)),Number(this[Bc](e)),a)),a()})}[ZP](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[JP](e,t){this[Nf](e,String(e.linkpath),"symlink",t)}[KP](e,t){let r=(0,Zt.normalizeWindowsPath)(tr.default.resolve(this.cwd,String(e.linkpath)));this[Nf](e,r,"link",t)}[XP](){this[Tf]++}[ao](){this[Tf]--,this[FE]()}[VE](e){this[ao](),e.resume()}[jE](e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&!Fc}[UE](e){this[XP]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,r=>this[WP](e,r))}[WP](e,t){let r=o(c=>{t(c)},"done"),s=o(()=>{this[Lr](this.cwd,this.dmode,c=>{if(c){this[Fe](c,e),r();return}this[kc]=!0,n()})},"checkCwd"),n=o(()=>{if(e.absolute!==this.cwd){let c=(0,Zt.normalizeWindowsPath)(tr.default.dirname(String(e.absolute)));if(c!==this.cwd)return this[Lr](c,this.dmode,u=>{if(u){this[Fe](u,e),r();return}a()})}a()},"start"),a=o(()=>{H.default.lstat(String(e.absolute),(c,u)=>{if(u&&(this.keep||this.newer&&u.mtime>(e.mtime??u.mtime))){this[VE](e),r();return}if(c||this[jE](e,u))return this[At](null,e,r);if(u.isDirectory()){if(e.type==="Directory"){let l=this.chmod&&e.mode&&(u.mode&4095)!==e.mode,h=o(f=>this[At](f??null,e,r),"afterChmod");return l?H.default.chmod(String(e.absolute),Number(e.mode),h):h()}if(e.absolute!==this.cwd)return H.default.rmdir(String(e.absolute),l=>this[At](l??null,e,r))}if(e.absolute===this.cwd)return this[At](null,e,r);tY(String(e.absolute),l=>this[At](l??null,e,r))})},"afterMakeParent");this[kc]?n():s()}[At](e,t,r){if(e){this[Fe](e,t),r();return}switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[$E](t,r);case"Link":return this[KP](t,r);case"SymbolicLink":return this[JP](t,r);case"Directory":case"GNUDumpDir":return this[qE](t,r)}}[Nf](e,t,r,s){H.default[r](t,String(e.absolute),n=>{n?this[Fe](n,e):(this[ao](),e.resume()),s()})}};et.Unpack=Pf;var Cf=o(i=>{try{return[null,i()]}catch(e){return[e,null]}},"callSync"),zE=class extends Pf{static{o(this,"UnpackSync")}sync=!0;[At](e,t){return super[At](e,t,()=>{})}[UE](e){if(!this[kc]){let n=this[Lr](this.cwd,this.dmode);if(n)return this[Fe](n,e);this[kc]=!0}if(e.absolute!==this.cwd){let n=(0,Zt.normalizeWindowsPath)(tr.default.dirname(String(e.absolute)));if(n!==this.cwd){let a=this[Lr](n,this.dmode);if(a)return this[Fe](a,e)}}let[t,r]=Cf(()=>H.default.lstatSync(String(e.absolute)));if(r&&(this.keep||this.newer&&r.mtime>(e.mtime??r.mtime)))return this[VE](e);if(t||this[jE](e,r))return this[At](null,e);if(r.isDirectory()){if(e.type==="Directory"){let a=this.chmod&&e.mode&&(r.mode&4095)!==e.mode,[c]=a?Cf(()=>{H.default.chmodSync(String(e.absolute),Number(e.mode))}):[];return this[At](c,e)}let[n]=Cf(()=>H.default.rmdirSync(String(e.absolute)));this[At](n,e)}let[s]=e.absolute===this.cwd?[]:Cf(()=>iY(String(e.absolute)));this[At](s,e)}[$E](e,t){let r=typeof e.mode=="number"?e.mode&4095:this.fmode,s=o(c=>{let u;try{H.default.closeSync(n)}catch(l){u=l}(c||u)&&this[Fe](c||u,e),t()},"oner"),n;try{n=H.default.openSync(String(e.absolute),(0,iD.getWriteFlag)(e.size),r)}catch(c){return s(c)}let a=this.transform&&this.transform(e)||e;a!==e&&(a.on("error",c=>this[Fe](c,e)),e.pipe(a)),a.on("data",c=>{try{H.default.writeSync(n,c,0,c.length)}catch(u){s(u)}}),a.on("end",()=>{let c=null;if(e.mtime&&!this.noMtime){let u=e.atime||new Date,l=e.mtime;try{H.default.futimesSync(n,u,l)}catch(h){try{H.default.utimesSync(String(e.absolute),u,l)}catch{c=h}}}if(this[Lc](e)){let u=this[Mc](e),l=this[Bc](e);try{H.default.fchownSync(n,Number(u),Number(l))}catch(h){try{H.default.chownSync(String(e.absolute),Number(u),Number(l))}catch{c=c||h}}}s(c)})}[qE](e,t){let r=typeof e.mode=="number"?e.mode&4095:this.dmode,s=this[Lr](String(e.absolute),r);if(s){this[Fe](s,e),t();return}if(e.mtime&&!this.noMtime)try{H.default.utimesSync(String(e.absolute),e.atime||new Date,e.mtime)}catch{}if(this[Lc](e))try{H.default.chownSync(String(e.absolute),Number(this[Mc](e)),Number(this[Bc](e)))}catch{}t(),e.resume()}[Lr](e,t){try{return(0,rD.mkdirSync)((0,Zt.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(r){return r}}[Nf](e,t,r,s){let n=`${r}Sync`;try{H.default[n](t,String(e.absolute)),s(),e.resume()}catch(a){return this[Fe](a,e)}}};et.UnpackSync=zE});var WE=d(Tt=>{"use strict";var rY=Tt&&Tt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),sY=Tt&&Tt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),nY=Tt&&Tt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&rY(e,i,t);return sY(e,i),e},oY=Tt&&Tt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Tt,"__esModule",{value:!0});Tt.extract=void 0;var sD=nY(zn()),nD=oY(require("node:fs")),aY=Qn(),cY=Hn(),Df=GE(),uY=o(i=>{let e=new Df.UnpackSync(i),t=i.file,r=nD.default.statSync(t),s=i.maxReadSize||16*1024*1024;new sD.ReadStreamSync(t,{readSize:s,size:r.size}).pipe(e)},"extractFileSync"),lY=o((i,e)=>{let t=new Df.Unpack(i),r=i.maxReadSize||16*1024*1024,s=i.file;return new Promise((a,c)=>{t.on("error",c),t.on("close",a),nD.default.stat(s,(u,l)=>{if(u)c(u);else{let h=new sD.ReadStream(s,{readSize:r,size:l.size});h.on("error",c),h.pipe(t)}})})},"extractFile");Tt.extract=(0,cY.makeCommand)(uY,lY,i=>new Df.UnpackSync(i),i=>new Df.Unpack(i),(i,e)=>{e?.length&&(0,aY.filesFilter)(i,e)})});var xf=d(co=>{"use strict";var oD=co&&co.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(co,"__esModule",{value:!0});co.replace=void 0;var aD=zn(),pt=oD(require("node:fs")),cD=oD(require("node:path")),uD=Kn(),lD=Qn(),hY=Hn(),fY=Mh(),hD=Ef(),dY=o((i,e)=>{let t=new hD.PackSync(i),r=!0,s,n;try{try{s=pt.default.openSync(i.file,"r+")}catch(u){if(u?.code==="ENOENT")s=pt.default.openSync(i.file,"w+");else throw u}let a=pt.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=pt.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 u=new uD.Header(c);if(!u.cksumValid)break;let l=512*Math.ceil((u.size||0)/512);if(n+l+512>a.size)break;n+=l,i.mtimeCache&&u.mtime&&i.mtimeCache.set(String(u.path),u.mtime)}r=!1,pY(i,t,n,s,e)}finally{if(r)try{pt.default.closeSync(s)}catch{}}},"replaceSync"),pY=o((i,e,t,r,s)=>{let n=new aD.WriteStreamSync(i.file,{fd:r,start:t});e.pipe(n),gY(e,s)},"streamSync"),mY=o((i,e)=>{e=Array.from(e);let t=new hD.Pack(i),r=o((n,a,c)=>{let u=o((m,y)=>{m?pt.default.close(n,g=>c(m)):c(null,y)},"cb"),l=0;if(a===0)return u(null,0);let h=0,f=Buffer.alloc(512),p=o((m,y)=>{if(m||typeof y>"u")return u(m);if(h+=y,h<512&&y)return pt.default.read(n,f,h,f.length-h,l+h,p);if(l===0&&f[0]===31&&f[1]===139)return u(new Error("cannot append to compressed archives"));if(h<512)return u(null,l);let g=new uD.Header(f);if(!g.cksumValid)return u(null,l);let S=512*Math.ceil((g.size??0)/512);if(l+S+512>a||(l+=S+512,l>=a))return u(null,l);i.mtimeCache&&g.mtime&&i.mtimeCache.set(String(g.path),g.mtime),h=0,pt.default.read(n,f,0,512,l,p)},"onread");pt.default.read(n,f,0,512,l,p)},"getPos");return new Promise((n,a)=>{t.on("error",a);let c="r+",u=o((l,h)=>{if(l&&l.code==="ENOENT"&&c==="r+")return c="w+",pt.default.open(i.file,c,u);if(l||!h)return a(l);pt.default.fstat(h,(f,p)=>{if(f)return pt.default.close(h,()=>a(f));r(h,p.size,(m,y)=>{if(m)return a(m);let g=new aD.WriteStream(i.file,{fd:h,start:y});t.pipe(g),g.on("error",a),g.on("close",n),yY(t,e)})})},"onopen");pt.default.open(i.file,c,u)})},"replaceAsync"),gY=o((i,e)=>{e.forEach(t=>{t.charAt(0)==="@"?(0,lD.list)({file:cD.default.resolve(i.cwd,t.slice(1)),sync:!0,noResume:!0,onReadEntry:o(r=>i.add(r),"onReadEntry")}):i.add(t)}),i.end()},"addFilesSync"),yY=o(async(i,e)=>{for(let t=0;t<e.length;t++){let r=String(e[t]);r.charAt(0)==="@"?await(0,lD.list)({file:cD.default.resolve(String(i.cwd),r.slice(1)),noResume:!0,onReadEntry:o(s=>i.add(s),"onReadEntry")}):i.add(r)}i.end()},"addFilesAsync");co.replace=(0,hY.makeCommand)(dY,mY,()=>{throw new TypeError("file is required")},()=>{throw new TypeError("file is required")},(i,e)=>{if(!(0,fY.isFile)(i))throw new TypeError("file is required");if(i.gzip||i.brotli||i.zstd||i.file.endsWith(".br")||i.file.endsWith(".tbr"))throw new TypeError("cannot append to compressed archives");if(!e?.length)throw new TypeError("no paths specified to add/replace")})});var JE=d(Lf=>{"use strict";Object.defineProperty(Lf,"__esModule",{value:!0});Lf.update=void 0;var SY=Hn(),Uc=xf();Lf.update=(0,SY.makeCommand)(Uc.replace.syncFile,Uc.replace.asyncFile,Uc.replace.syncNoFile,Uc.replace.asyncNoFile,(i,e=[])=>{Uc.replace.validate?.(i,e),EY(i)});var EY=o(i=>{let e=i.filter;i.mtimeCache||(i.mtimeCache=new Map),i.filter=e?(t,r)=>e(t,r)&&!((i.mtimeCache?.get(t)??r.mtime??0)>(r.mtime??0)):(t,r)=>!((i.mtimeCache?.get(t)??r.mtime??0)>(r.mtime??0))},"mtimeFilter")});var KE=d(V=>{"use strict";var fD=V&&V.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),wY=V&&V.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Ct=V&&V.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&fD(e,i,t)},_Y=V&&V.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&fD(e,i,t);return wY(e,i),e};Object.defineProperty(V,"__esModule",{value:!0});V.u=V.types=V.r=V.t=V.x=V.c=void 0;Ct(CE(),V);var bY=CE();Object.defineProperty(V,"c",{enumerable:!0,get:o(function(){return bY.create},"get")});Ct(WE(),V);var IY=WE();Object.defineProperty(V,"x",{enumerable:!0,get:o(function(){return IY.extract},"get")});Ct(Kn(),V);Ct(Qn(),V);var OY=Qn();Object.defineProperty(V,"t",{enumerable:!0,get:o(function(){return OY.list},"get")});Ct(Ef(),V);Ct(ef(),V);Ct(jh(),V);Ct(zh(),V);Ct(xf(),V);var vY=xf();Object.defineProperty(V,"r",{enumerable:!0,get:o(function(){return vY.replace},"get")});V.types=_Y(zS());Ct(GE(),V);Ct(JE(),V);var RY=JE();Object.defineProperty(V,"u",{enumerable:!0,get:o(function(){return RY.update},"get")});Ct(SE(),V)});var Ds=d((Cge,dD)=>{dD.exports={cacheFetches:Symbol.for("pacote.Fetcher._cacheFetches"),readPackageJson:Symbol.for("package.Fetcher._readPackageJson"),tarballFromResolved:Symbol.for("pacote.Fetcher._tarballFromResolved")}});var mD=d((Nge,pD)=>{var{resolve:ZE}=require("node:path"),{tmpdir:AY,homedir:TY}=require("node:os");pD.exports=(i=!1)=>{let e=AY(),t=process.getuid?process.getuid():process.pid,r=TY()||ZE(e,"npm-"+t),s=i||process.platform,n=s==="win32"?"npm-cache":".npm",a=s==="win32"&&process.env.LOCALAPPDATA||r;return{cacache:ZE(a,n,"_cacache"),tufcache:ZE(a,n,"_tuf")}}});var YE=d((Pge,gD)=>{var CY=o((i,e)=>typeof e=="string"?{[i]:e}:e,"binObj"),NY=o((i,e)=>{let t=CY(i.name,i.bin),r=e.replace(/^[^\\/]*\//,"");for(let s of Object.entries(t))if(s[1]===r)return!0;return!1},"hasBin");gD.exports=(i,e)=>i&&i.bin?NY(i,e):!1});var XE=d((xge,yD)=>{var PY=o(i=>{let e=i;for(;e.endsWith("/");)e=e.slice(0,-1);return e},"removeTrailingSlashes");yD.exports=PY});var ED=d((Mge,SD)=>{"use strict";var Mr=require("fs"),QE=require("path"),DY=require("events").EventEmitter,xY=Mi().Minimatch,jc=class i extends DY{static{o(this,"Walker")}constructor(e){e=e||{},super(e),this.isSymbolicLink=e.isSymbolicLink,this.path=e.path||process.cwd(),this.basename=QE.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 r=!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?r=this.parent.emit("error",t):r=super.emit(e,t)),r}start(){return Mr.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(r=>this.isIgnoreFile(r))?this.addIgnoreFiles():this.filterEntries()}addIgnoreFiles(){let e=this.entries.filter(s=>this.isIgnoreFile(s)),t=e.length,r=o(()=>{--t===0&&this.filterEntries()},"then");e.forEach(s=>this.addIgnoreFile(s,r))}addIgnoreFile(e,t){let r=QE.resolve(this.path,e);Mr.readFile(r,"utf8",(s,n)=>s?this.emit("error",s):this.onReadIgnoreFile(e,n,t))}onReadIgnoreFile(e,t,r){let s={matchBase:!0,dot:!0,flipNegate:!0,nocase:!0},n=t.split(/\r?\n/).filter(a=>!/^#|^$/.test(a.trim())).map(a=>new xY(a.trim(),s));this.ignoreRules[e]=n,r()}filterEntries(){let e=this.entries.map(r=>{let s=this.filterEntry(r),n=this.filterEntry(r,!0);return s||n?[r,s,n]:!1}).filter(r=>r),t=e.length;if(t===0)this.emit("done",this.result);else{let r=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},r)})}}onstat({st:e,entry:t,file:r,dir:s,isSymbolicLink:n},a){let c=this.path+"/"+t;e.isDirectory()?s?this.walker(t,{isSymbolicLink:n,exact:r||this.filterEntry(t+"/")},a):a():(r&&this.result.add(c.slice(this.root.length+1)),a())}stat({entry:e,file:t,dir:r},s){let n=this.path+"/"+e;Mr.lstat(n,(a,c)=>{if(a)this.emit("error",a);else{let u=c.isSymbolicLink();this.follow&&u?Mr.stat(n,(l,h)=>{l?this.emit("error",l):this.onstat({st:h,entry:e,file:t,dir:r,isSymbolicLink:u},s)}):this.onstat({st:c,entry:e,file:t,dir:r,isSymbolicLink:u},s)}})}walkerOpt(e,t){return{path:this.path+"/"+e,parent:this,ignoreFiles:this.ignoreFiles,follow:this.follow,includeEmpty:this.includeEmpty,...t}}walker(e,t,r){new i(this.walkerOpt(e,t)).on("done",r).start()}filterEntry(e,t,r){let s=!0;if(this.parent&&this.parent.filterEntry){let n=this.basename+"/"+e,a=r||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=r&&a.globParts.some(l=>l.length<=(l.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("/"+r+"/")||a.match(r+"/")||a.negate&&(a.match("/"+r,!0)||a.match(r,!0)))))&&(s=a.negate)}})}),s}},Mf=class i extends jc{static{o(this,"WalkerSync")}start(){return this.onReaddir(Mr.readdirSync(this.path)),this}addIgnoreFile(e,t){let r=QE.resolve(this.path,e);this.onReadIgnoreFile(e,Mr.readFileSync(r,"utf8"),t)}stat({entry:e,file:t,dir:r},s){let n=this.path+"/"+e,a=Mr.lstatSync(n),c=a.isSymbolicLink();this.follow&&c&&(a=Mr.statSync(n)),this.onstat({st:a,entry:e,file:t,dir:r,isSymbolicLink:c},s)}walker(e,t,r){new i(this.walkerOpt(e,t)).start(),r()}},Bf=o((i,e)=>{let t=new Promise((r,s)=>{new jc(i).on("done",r).on("error",s).start()});return e?t.then(r=>e(null,r),e):t},"walk"),LY=o(i=>new Mf(i).start().result,"walkSync");SD.exports=Bf;Bf.sync=LY;Bf.Walker=jc;Bf.WalkerSync=Mf});var RD=d((kge,vD)=>{"use strict";var{Walker:MY}=ED(),{lstatSync:BY,readFileSync:kY}=require("fs"),{basename:wD,dirname:FY,extname:_D,join:ho,relative:lo,resolve:UY,sep:jY}=require("path"),{log:$Y}=St(),$c=Symbol("npm-packlist.rules.default"),uo=Symbol("npm-packlist.rules.strict"),qY=o(i=>/\*/.test(i),"nameIsBadForWindows"),VY=[".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/**"],bD=["/.git"],kf=o(i=>i.split("\\").join("/"),"normalizePath"),ID=o((i,e,t=[])=>{for(let a of[".npmignore",".gitignore"])try{let c=kY(ho(i,a),{encoding:"utf8"});t.push(c);break}catch(c){if(c.code!=="ENOENT")throw c}if(!e)return t;let r=e.split(jY,1)[0],s=ho(i,r),n=lo(s,ho(i,e));return ID(s,n,t)},"readOutOfTreeIgnoreFiles"),Ff=class i extends MY{static{o(this,"PackWalker")}constructor(e,t){let r={...t,includeEmpty:!1,follow:!1,path:UY(t?.path||e.path).replace(/\\/g,"/"),ignoreFiles:t?.ignoreFiles||[$c,"package.json",".npmignore",".gitignore",uo]};super(r),this.isPackage=r.isPackage,this.seen=r.seen||new Set,this.tree=e,this.requiredFiles=r.requiredFiles||[];let s=[];if(r.prefix&&r.workspaces){let n=kf(r.path),a=kf(r.prefix),c=r.workspaces.map(u=>kf(u));if(n!==a&&c.includes(n)){let u=lo(r.prefix,FY(r.path));s.push(...ID(r.prefix,u))}else n===a&&s.push(...c.map(u=>kf(lo(r.path,u))))}this.injectRules($c,[...VY,...s]),this.isPackage||this.injectRules(uo,[...bD,...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"]&&$Y.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 qY(e.entry)?t():super.stat(e,t)}walkerOpt(e,t){let r=null;if(this.tree.workspaces){let s=[...this.tree.workspaces.values()].map(a=>a.replace(/\\/g,"/")),n=ho(this.path,e).replace(/\\/g,"/");s.includes(n)&&(r=[$c,"package.json",".npmignore",".gitignore",uo])}else r=[$c,".npmignore",".gitignore",uo];return{...super.walkerOpt(e,t),ignoreFiles:r,requiredFiles:this.requiredFiles.map(s=>lo(s,e)===".."?lo(e,s).replace(/\\/g,"/"):!1).filter(Boolean)}}walker(e,t,r){new i(this.tree,this.walkerOpt(e,t)).on("done",r).start()}sort(e,t){let r=_D(e).toLowerCase(),s=_D(t).toLowerCase(),n=wD(e).toLowerCase(),a=wD(t).toLowerCase();return r.localeCompare(s,"en")||n.localeCompare(a,"en")||e.localeCompare(t,"en")}injectRules(e,t,r=()=>{}){this.onReadIgnoreFile(e,`${t.join(`
28
+ Found: ${e}`);return t.code="EINTEGRITY",t.expected=i,t.found=e,t}o(hJ,"checksumError")});var lN=d((tme,aS)=>{"use strict";var oN=Rn(),aN=nc(),cN=nN(),fJ=Ih(),{PassThrough:dJ}=yy(),pJ=In(),uN=o(i=>({algorithms:["sha512"],...i}),"putOpts");aS.exports=mJ;async function mJ(i,e,t,r={}){let{memoize:s}=r;r=uN(r);let n=await cN(i,t,r),a=await oN.insert(i,e,n.integrity,{...r,size:n.size});return s&&aN.put(i,a,t,r),n.integrity}o(mJ,"putData");aS.exports.stream=gJ;function gJ(i,e,t={}){let{memoize:r}=t;t=uN(t);let s,n,a,c,u=new pJ;if(r){let h=new dJ().on("collect",f=>{c=f});u.push(h)}let l=cN.stream(i,t).on("integrity",h=>{s=h}).on("size",h=>{n=h}).on("error",h=>{a=h});return u.push(l),u.push(new fJ({async flush(){if(!a){let h=await oN.insert(i,e,s,{...t,size:n});r&&c&&aN.put(i,h,c,t),u.emit("integrity",s),u.emit("size",n)}}})),u}o(gJ,"putStream")});var cS=d((rme,fN)=>{"use strict";var{glob:yJ}=hg(),hN=require("path"),SJ=o(i=>i.split(hN.win32.sep).join(hN.posix.sep),"globify");fN.exports=(i,e)=>yJ(SJ(i),e)});var pN=d((nme,dN)=>{"use strict";var EJ=require("fs/promises"),wJ=On(),{hasContent:_J}=tS();dN.exports=bJ;async function bJ(i,e){let t=await _J(i,e);return t&&t.sri?(await EJ.rm(wJ(i,t.sri),{recursive:!0,force:!0}),!0):!1}o(bJ,"rm")});var gN=d((ame,fc)=>{"use strict";var{rm:IJ}=require("fs/promises"),OJ=cS(),vJ=Rn(),uS=nc(),RJ=require("path"),AJ=pN();fc.exports=mN;fc.exports.entry=mN;function mN(i,e,t){return uS.clearMemoized(),vJ.delete(i,e,t)}o(mN,"entry");fc.exports.content=TJ;function TJ(i,e){return uS.clearMemoized(),AJ(i,e)}o(TJ,"content");fc.exports.all=CJ;async function CJ(i){uS.clearMemoized();let e=await OJ(RJ.join(i,"*(content-*|index-*)"),{silent:!0,nosort:!0});return Promise.all(e.map(t=>IJ(t,{recursive:!0,force:!0})))}o(CJ,"all")});var SN=d((ume,dS)=>{"use strict";var{mkdir:NJ,readFile:PJ,rm:hS,stat:fS,truncate:DJ,writeFile:xJ}=require("fs/promises"),yN=On(),LJ=Ln(),MJ=cS(),Bn=Rn(),Oh=require("path"),lS=ai(),BJ=o((i,e)=>Object.prototype.hasOwnProperty.call(i,e),"hasOwnProperty"),kJ=o(i=>({concurrency:20,log:{silly(){}},...i}),"verifyOpts");dS.exports=FJ;async function FJ(i,e){e=kJ(e),e.log.silly("verify","verifying cache at",i);let t=[UJ,$J,qJ,zJ,GJ,WJ,jJ],r={};for(let s of t){let n=s.name,a=new Date,c=await s(i,e);c&&Object.keys(c).forEach(l=>{r[l]=c[l]});let u=new Date;r.runTime||(r.runTime={}),r.runTime[n]=u-a}return r.runTime.total=r.endTime-r.startTime,e.log.silly("verify","verification finished for",i,"in",`${r.runTime.total}ms`),r}o(FJ,"verify");async function UJ(){return{startTime:new Date}}o(UJ,"markStartTime");async function jJ(){return{endTime:new Date}}o(jJ,"markEndTime");async function $J(i,e){return e.log.silly("verify","fixing cache permissions"),await NJ(i,{recursive:!0}),null}o($J,"fixPerms");async function qJ(i,e){e.log.silly("verify","garbage collecting content");let{default:t}=await Promise.resolve().then(()=>(lh(),uh)),r=Bn.lsStream(i),s=new Set;r.on("data",u=>{if(e.filter&&!e.filter(u))return;let l=lS.parse(u.integrity);for(let h in l)s.add(l[h].toString())}),await new Promise((u,l)=>{r.on("end",u).on("error",l)});let n=yN.contentDir(i),a=await MJ(Oh.join(n,"**"),{follow:!1,nodir:!0,nosort:!0}),c={verifiedContent:0,reclaimedCount:0,reclaimedSize:0,badContentCount:0,keptSize:0};return await t(a,async u=>{let l=u.split(/[/\\]/),h=l.slice(l.length-3).join(""),f=l[l.length-4],p=lS.fromHex(h,f);if(s.has(p.toString())){let m=await VJ(u,p);m.valid?(c.verifiedContent++,c.keptSize+=m.size):(c.reclaimedCount++,c.badContentCount++,c.reclaimedSize+=m.size)}else{c.reclaimedCount++;let m=await fS(u);await hS(u,{recursive:!0,force:!0}),c.reclaimedSize+=m.size}return c},{concurrency:e.concurrency}),c}o(qJ,"garbageCollect");async function VJ(i,e){let t={};try{let{size:r}=await fS(i);t.size=r,t.valid=!0,await lS.checkStream(new LJ.ReadStream(i),e)}catch(r){if(r.code==="ENOENT")return{size:0,valid:!1};if(r.code!=="EINTEGRITY")throw r;await hS(i,{recursive:!0,force:!0}),t.valid=!1}return t}o(VJ,"verifyContent");async function zJ(i,e){e.log.silly("verify","rebuilding index");let{default:t}=await Promise.resolve().then(()=>(lh(),uh)),r=await Bn.ls(i),s={missingContent:0,rejectedEntries:0,totalEntries:0},n={};for(let a in r)if(BJ(r,a)){let c=Bn.hashKey(a),u=r[a],l=e.filter&&!e.filter(u);l&&s.rejectedEntries++,n[c]&&!l?n[c].push(u):n[c]&&l||(l?(n[c]=[],n[c]._path=Bn.bucketPath(i,a)):(n[c]=[u],n[c]._path=Bn.bucketPath(i,a)))}return await t(Object.keys(n),a=>HJ(i,n[a],s,e),{concurrency:e.concurrency}),s}o(zJ,"rebuildIndex");async function HJ(i,e,t){await DJ(e._path);for(let r of e){let s=yN(i,r.integrity);try{await fS(s),await Bn.insert(i,r.key,r.integrity,{metadata:r.metadata,size:r.size,time:r.time}),t.totalEntries++}catch(n){if(n.code==="ENOENT")t.rejectedEntries++,t.missingContent++;else throw n}}}o(HJ,"rebuildBucket");function GJ(i,e){return e.log.silly("verify","cleaning tmp directory"),hS(Oh.join(i,"tmp"),{recursive:!0,force:!0})}o(GJ,"cleanTmp");async function WJ(i,e){let t=Oh.join(i,"_lastverified");return e.log.silly("verify","writing verifile to "+t),xJ(t,`${Date.now()}`)}o(WJ,"writeVerifile");dS.exports.lastRun=JJ;async function JJ(i){let e=await PJ(Oh.join(i,"_lastverified"),{encoding:"utf8"});return new Date(+e)}o(JJ,"lastRun")});var wN=d((hme,mS)=>{"use strict";var{withTempDir:KJ}=ch(),EN=require("fs/promises"),pS=require("path");mS.exports.mkdir=ZJ;async function ZJ(i,e={}){let{tmpPrefix:t}=e,r=pS.join(i,"tmp");await EN.mkdir(r,{recursive:!0,owner:"inherit"});let s=`${r}${pS.sep}${t||""}`;return EN.mkdtemp(s,{owner:"inherit"})}o(ZJ,"mktmpdir");mS.exports.withTmp=YJ;function YJ(i,e,t){return t||(t=e,e={}),KJ(pS.join(i,"tmp"),t,e)}o(YJ,"withTmp")});var dc=d((dme,X)=>{"use strict";var Ir=Z1(),_N=lN(),gS=gN(),bN=SN(),{clearMemoized:XJ}=nc(),IN=wN(),vh=Rn();X.exports.index={};X.exports.index.compact=vh.compact;X.exports.index.insert=vh.insert;X.exports.ls=vh.ls;X.exports.ls.stream=vh.lsStream;X.exports.get=Ir;X.exports.get.byDigest=Ir.byDigest;X.exports.get.stream=Ir.stream;X.exports.get.stream.byDigest=Ir.stream.byDigest;X.exports.get.copy=Ir.copy;X.exports.get.copy.byDigest=Ir.copy.byDigest;X.exports.get.info=Ir.info;X.exports.get.hasContent=Ir.hasContent;X.exports.put=_N;X.exports.put.stream=_N.stream;X.exports.rm=gS.entry;X.exports.rm.all=gS.all;X.exports.rm.entry=X.exports.rm;X.exports.rm.content=gS.content;X.exports.clearMemoized=XJ;X.exports.tmp={};X.exports.tmp.mkdir=IN.mkdir;X.exports.tmp.withTmp=IN.withTmp;X.exports.verify=bN;X.exports.verify.lastRun=bN.lastRun});var vN=d((pme,ON)=>{"use strict";var kn=require("fs"),pc=require("path"),QJ=require("events").EventEmitter,e6=Hl(),mc=class i extends QJ{static{o(this,"BundleWalker")}constructor(e){if(e=e||{},super(e),this.path=pc.resolve(e.path||process.cwd()),this.parent=e.parent||null,this.parent){if(this.result=this.parent.result,!this.parent.parent){let t=pc.basename(this.path),r=pc.basename(pc.dirname(this.path));this.result.add(/^@/.test(r)?r+"/"+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 r=super.on(e,t);return e==="done"&&this.didDone&&this.emit("done",this.result),r}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=pc.resolve(this.path,"package.json");return this.packageJsonCache.has(e)?this.onPackage(this.packageJsonCache.get(e)):this.readPackageJson(e),this}readPackageJson(e){kn.readFile(e,(t,r)=>t?this.done():this.onPackageJson(e,r))}onPackageJson(e,t){try{this.package=e6(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||[],r=Array.from(new Set(Array.isArray(t)?t:t===!0?this.allDepsBundled(e):Object.keys(t)));if(!r.length)return this.done();this.bundle=r,this.readModules()}readModules(){t6(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 r=new i({path:t,parent:this});r.on("done",()=>{--this.children===0&&this.done()}),r.start()}},Rh=class i extends mc{static{o(this,"BundleWalkerSync")}start(){return super.start(),this.done(),this}readPackageJson(e){try{this.onPackageJson(e,kn.readFileSync(e))}catch{}return this}readModules(){try{this.onReaddir(i6(this.path+"/node_modules"))}catch{this.onReaddir([])}}child(e){new i({path:this.path+"/node_modules/"+e,parent:this}).start()}},t6=o((i,e)=>{kn.readdir(i,(t,r)=>{if(t)e(t);else{let s=r.filter(n=>/^@/.test(n));if(!s.length)e(null,r);else{let n=r.filter(c=>!/^@/.test(c)),a=s.length;s.forEach(c=>{kn.readdir(i+"/"+c,(u,l)=>{u||!l.length?n.push(c):n.push.apply(n,l.map(h=>c+"/"+h)),--a===0&&e(null,n)})})}}})},"readdirNodeModules"),i6=o(i=>{let e=kn.readdirSync(i),t=e.filter(s=>!/^@/.test(s)),r=e.filter(s=>/^@/.test(s)).map(s=>{try{let n=kn.readdirSync(i+"/"+s);return n.length?n.map(a=>s+"/"+a):[s]}catch{return[s]}}).reduce((s,n)=>s.concat(n),[]);return t.concat(r)},"readdirNodeModulesSync"),Ah=o((i,e)=>{let t=new Promise((r,s)=>{new mc(i).on("done",r).on("error",s).start()});return e?t.then(r=>e(null,r),e):t},"walk"),r6=o(i=>new Rh(i).start().result,"walkSync");ON.exports=Ah;Ah.sync=r6;Ah.BundleWalker=mc;Ah.BundleWalkerSync=Rh});var CN=d((gme,TN)=>{var s6=vN(),{readFile:n6,readdir:o6,stat:a6}=require("fs/promises"),{resolve:Th,basename:c6,dirname:RN}=require("path"),u6=Hl(),l6=o(({path:i,packageJsonCache:e})=>e.has(i)?Promise.resolve(e.get(i)):n6(i).then(t=>{let r=u6(JSON.parse(t));return e.set(i,r),r}).catch(()=>null),"readPackage"),AN=Symbol("package data has been normalized"),h6=o(({path:i,packageJsonCache:e})=>l6({path:i,packageJsonCache:e}).then(t=>{if(!t||t[AN])return t;t.bundledDependencies&&!t.bundleDependencies&&(t.bundleDependencies=t.bundledDependencies,delete t.bundledDependencies);let r=t.bundleDependencies;return r===!0&&(t.bundleDependencies=[...Object.keys(t.dependencies||{}),...Object.keys(t.optionalDependencies||{})]),typeof r=="object"&&!Array.isArray(r)&&(t.bundleDependencies=Object.keys(r)),t[AN]=!0,t}),"rpj"),Ch=o(async({path:i,depth:e=1,currentDepth:t=0,pkg:r=null,result:s=null,packageJsonCache:n=null})=>{if(s||(s=new Set),n||(n=new Map),r===!0)return h6({path:i+"/package.json",packageJsonCache:n}).then(l=>Ch({path:i,depth:e,currentDepth:t,pkg:l,result:s,packageJsonCache:n}));if(r&&r.bin){let l=RN(i),h=c6(l),f=/^@.+/.test(h)?RN(l):l,p=[];Object.keys(r.bin).forEach(y=>{let g=Th(f,".bin",y);p.push(g,g+".cmd",g+".ps1")}),(await Promise.all(p.map(y=>a6(y).then(()=>y).catch(()=>null)))).filter(y=>y).forEach(y=>s.add(y))}if(t>=e)return s.add(i),s;let[a,c]=await Promise.all([o6(i,{withFileTypes:!0}),t===0&&r&&r.bundleDependencies?s6({path:i,packageJsonCache:n}):null]).catch(()=>[]);if(!a)return s;if(!a.length&&!c&&t!==0)return s.add(i),s;let u=[];for(let l of a){let h=Th(i,l.name);if(l.isDirectory()===!1){s.add(h);continue}if(t!==0||l.name!=="node_modules"){t<e-1?u.push(Ch({path:h,packageJsonCache:n,depth:e,currentDepth:t+1,result:s})):s.add(h);continue}}return c&&u.push(...c.map(l=>{let h=Th(i,"node_modules",l);return Ch({path:h,packageJsonCache:n,pkg:!0,depth:e,currentDepth:t+1,result:s})})),u.length&&await Promise.all(u),s},"pkgContents");TN.exports=({path:i,...e})=>Ch({path:Th(i),...e,pkg:!0}).then(t=>[...t])});var Un=d((Sme,Ec)=>{"use strict";var Sc=process.platform==="win32",{URL:yS}=require("node:url"),Fn=Sc?require("node:path/win32"):require("node:path"),{homedir:f6}=require("node:os"),d6=Xu(),NN=ds(),LN=Yg(),{log:p6}=St(),MN=Sc?/\\|[/]/:/[/]/,BN=/^(?:git[+])?[a-z]+:/i,m6=/^[^@]+@[^:.]+\.[^:]+:.+$/i,ES=/[.](?:tgz|tar.gz|tar)$/i,g6=/:[0-9]+(\/|$)/i,y6=/^(?:[.]|~[/]|[/\\]|[a-zA-Z]:)/,S6=/^(?:[.]|~[/]|[/]|[a-zA-Z]:)/,PN="https://registry.npmjs.org";function gc(i,e){let t,r;if(typeof i=="object")return i instanceof yc&&(!e||e===i.where)?i:i.name&&i.rawSpec?gc.resolve(i.name,i.rawSpec,e||i.where):gc(i.raw,e||i.where);let s=i.indexOf("@",1),n=s>0?i.slice(0,s):i;return BN.test(i)?r=i:m6.test(i)?r=`git+ssh://${i}`:!n.startsWith("@")&&(MN.test(n)||ES.test(n))?r=i:s>0?(t=n,r=i.slice(s+1)||"*"):LN(i).validForOldPackages?(t=i,r="*"):r=i,kN(t,r,e,i)}o(gc,"npa");function E6(i){return i?i.toLowerCase().startsWith("file:")?!0:Sc?y6.test(i):S6.test(i):!1}o(E6,"isFileSpec");function w6(i){return i?i.toLowerCase().startsWith("npm:"):!1}o(w6,"isAliasSpec");function kN(i,e,t,r){let s=new yc({raw:r,name:i,rawSpec:e,fromArgument:r!=null});if(i&&(s.name=i),t||(t=process.cwd()),E6(e))return xN(s,t);if(w6(e))return C6(s,t);let n=d6.fromUrl(e,{noGitPlus:!0,noCommittish:!0});return n?R6(s,n):e&&BN.test(e)?T6(s):e&&(MN.test(e)||ES.test(e))?xN(s,t):N6(s)}o(kN,"resolve");function _6(i,e=PN){let t=gc(i);if(t.type!=="version")throw O6(t.type,t.raw);let r="pkg:npm/"+t.name.replace(/^@/,"%40")+"@"+t.rawSpec;return e!==PN&&(r+="?repository_url="+e),r}o(_6,"toPurl");function b6(i,e,t){let r=new Error(`Invalid package name "${i}" of package "${t}": ${e.errors.join("; ")}.`);return r.code="EINVALIDPACKAGENAME",r}o(b6,"invalidPackageName");function I6(i,e){let t=new Error(`Invalid tag name "${i}" of package "${e}": Tags may not have any characters that encodeURIComponent encodes.`);return t.code="EINVALIDTAGNAME",t}o(I6,"invalidTagName");function O6(i,e){let t=new Error(`Invalid type "${i}" of package "${e}": Purl can only be generated for "version" types.`);return t.code="EINVALIDPURLTYPE",t}o(O6,"invalidPurlType");var yc=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=LN(e);if(!t.validForOldPackages)throw b6(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 SS(i,e){if(!e){i.gitCommittish=null;return}for(let t of e.split("::")){if(!t.includes(":")){if(i.gitRange)throw new Error("cannot override existing semver range with a committish");if(i.gitCommittish)throw new Error("cannot override existing committish with a second committish");i.gitCommittish=t;continue}let[r,s]=t.split(":");if(r==="semver"){if(i.gitCommittish)throw new Error("cannot override existing committish with a semver range");if(i.gitRange)throw new Error("cannot override existing semver range with a second semver range");i.gitRange=decodeURIComponent(s);continue}if(r==="path"){if(i.gitSubdir)throw new Error("cannot override existing path with a second path");i.gitSubdir=`/${s}`;continue}p6.warn("npm-package-arg",`ignoring unknown key "${r}"`)}}o(SS,"setGitAttrs");var v6=new Map([["\0","%00"],[" ","%09"],[`
29
+ `,"%0A"],["\r","%0D"],[" ","%20"],['"',"%22"],["#","%23"],["%","%25"],["?","%3F"],["[","%5B"],["\\",Sc?"/":"%5C"],["]","%5D"],["^","%5E"],["|","%7C"],["~","%7E"]]);function DN(i){let e="";for(let t=0;t<i.length;t++)e=`${e}${v6.get(i[t])??i[t]}`;return e.startsWith("file:")?e:`file:${e}`}o(DN,"pathToFileURL");function xN(i,e){i.type=ES.test(i.rawSpec)?"file":"directory",i.where=e;let t=DN(i.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 r,s;try{r=new yS(t,`${DN(Fn.resolve(e))}/`),s=new yS(t)}catch(c){let u=new Error("Invalid file: URL, must comply with RFC 8089");throw Object.assign(u,{raw:i.rawSpec,spec:i,where:e,originalError:c})}let n=decodeURIComponent(s.pathname),a=decodeURIComponent(r.pathname);return Sc&&(n=n.replace(/^\/+([a-z]:\/)/i,"$1"),a=a.replace(/^\/+([a-z]:\/)/i,"$1")),/^\/~(\/|$)/.test(n)?(i.saveSpec=`file:${n.substr(1)}`,a=Fn.resolve(f6(),n.substr(3))):Fn.isAbsolute(t.slice(5))?i.saveSpec=`file:${Fn.resolve(a)}`:i.saveSpec=`file:${Fn.relative(e,a)}`,i.fetchSpec=Fn.resolve(e,a),i.saveSpec=i.saveSpec.split("\\").join("/"),i.saveSpec.startsWith("file://")&&(i.saveSpec=`file:/${i.saveSpec.slice(7)}`),i}o(xN,"fromFile");function R6(i,e){return i.type="git",i.hosted=e,i.saveSpec=e.toString({noGitPlus:!1,noCommittish:!1}),i.fetchSpec=e.getDefaultRepresentation()==="shortcut"?null:e.toString(),SS(i,e.committish),i}o(R6,"fromHostedGit");function A6(i,e){let t=new Error(`Unsupported URL Type "${i}": ${e}`);return t.code="EUNSUPPORTEDPROTOCOL",t}o(A6,"unsupportedURLType");function T6(i){let e=i.rawSpec;if(i.saveSpec=e,e.startsWith("git+ssh:")){let r=e.match(/^git\+ssh:\/\/([^:#]+:[^#]+(?:\.git)?)(?:#(.*))?$/i);if(r&&!r[1].match(g6))return i.type="git",SS(i,r[2]),i.fetchSpec=r[1],i}else e.startsWith("git+file://")&&(e=e.replace(/\\/g,"/"));let t=new yS(e);switch(t.protocol){case"git:":case"git+http:":case"git+https:":case"git+rsync:":case"git+ftp:":case"git+file:":case"git+ssh:":i.type="git",SS(i,t.hash.slice(1)),t.protocol==="git+file:"&&/^git\+file:\/\/[a-z]:/i.test(e)?i.fetchSpec=`git+file://${t.host.toLowerCase()}:${t.pathname}`:(t.hash="",i.fetchSpec=t.toString()),i.fetchSpec.startsWith("git+")&&(i.fetchSpec=i.fetchSpec.slice(4));break;case"http:":case"https:":i.type="remote",i.fetchSpec=i.saveSpec;break;default:throw A6(t.protocol,e)}return i}o(T6,"fromURL");function C6(i,e){let t=gc(i.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 i.subSpec=t,i.registry=!0,i.type="alias",i.saveSpec=null,i.fetchSpec=null,i}o(C6,"fromAlias");function N6(i){i.registry=!0;let e=i.rawSpec.trim();i.saveSpec=null,i.fetchSpec=e;let t=NN.valid(e,!0),r=NN.validRange(e,!0);if(t)i.type="version";else if(r)i.type="range";else{if(encodeURIComponent(e)!==e)throw I6(e,i.raw);i.type="tag"}return i}o(N6,"fromRegistry");Ec.exports=gc;Ec.exports.resolve=kN;Ec.exports.toPurl=_6;Ec.exports.Result=yc});var zn=d(vt=>{"use strict";var FN=vt&&vt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(vt,"__esModule",{value:!0});vt.WriteStreamSync=vt.WriteStream=vt.ReadStreamSync=vt.ReadStream=void 0;var P6=FN(require("events")),Qe=FN(require("fs")),D6=te(),x6=Qe.default.writev,vr=Symbol("_autoClose"),Wt=Symbol("_close"),wc=Symbol("_ended"),J=Symbol("_fd"),wS=Symbol("_finished"),Yi=Symbol("_flags"),_S=Symbol("_flush"),vS=Symbol("_handleChunk"),RS=Symbol("_makeBuf"),bc=Symbol("_mode"),Nh=Symbol("_needDrain"),qn=Symbol("_onerror"),Vn=Symbol("_onopen"),bS=Symbol("_onread"),jn=Symbol("_onwrite"),Rr=Symbol("_open"),Gt=Symbol("_path"),Or=Symbol("_pos"),hi=Symbol("_queue"),$n=Symbol("_read"),IS=Symbol("_readSize"),Zi=Symbol("_reading"),_c=Symbol("_remain"),OS=Symbol("_size"),Ph=Symbol("_write"),_s=Symbol("_writing"),Dh=Symbol("_defaultFlag"),bs=Symbol("_errored"),xh=class extends D6.Minipass{static{o(this,"ReadStream")}[bs]=!1;[J];[Gt];[IS];[Zi]=!1;[OS];[_c];[vr];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[bs]=!1,this[J]=typeof t.fd=="number"?t.fd:void 0,this[Gt]=e,this[IS]=t.readSize||16*1024*1024,this[Zi]=!1,this[OS]=typeof t.size=="number"?t.size:1/0,this[_c]=this[OS],this[vr]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[J]=="number"?this[$n]():this[Rr]()}get fd(){return this[J]}get path(){return this[Gt]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[Rr](){Qe.default.open(this[Gt],"r",(e,t)=>this[Vn](e,t))}[Vn](e,t){e?this[qn](e):(this[J]=t,this.emit("open",t),this[$n]())}[RS](){return Buffer.allocUnsafe(Math.min(this[IS],this[_c]))}[$n](){if(!this[Zi]){this[Zi]=!0;let e=this[RS]();if(e.length===0)return process.nextTick(()=>this[bS](null,0,e));Qe.default.read(this[J],e,0,e.length,null,(t,r,s)=>this[bS](t,r,s))}}[bS](e,t,r){this[Zi]=!1,e?this[qn](e):this[vS](t,r)&&this[$n]()}[Wt](){if(this[vr]&&typeof this[J]=="number"){let e=this[J];this[J]=void 0,Qe.default.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[qn](e){this[Zi]=!0,this[Wt](),this.emit("error",e)}[vS](e,t){let r=!1;return this[_c]-=e,e>0&&(r=super.write(e<t.length?t.subarray(0,e):t)),(e===0||this[_c]<=0)&&(r=!1,this[Wt](),super.end()),r}emit(e,...t){switch(e){case"prefinish":case"finish":return!1;case"drain":return typeof this[J]=="number"&&this[$n](),!1;case"error":return this[bs]?!1:(this[bs]=!0,super.emit(e,...t));default:return super.emit(e,...t)}}};vt.ReadStream=xh;var AS=class extends xh{static{o(this,"ReadStreamSync")}[Rr](){let e=!0;try{this[Vn](null,Qe.default.openSync(this[Gt],"r")),e=!1}finally{e&&this[Wt]()}}[$n](){let e=!0;try{if(!this[Zi]){this[Zi]=!0;do{let t=this[RS](),r=t.length===0?0:Qe.default.readSync(this[J],t,0,t.length,null);if(!this[vS](r,t))break}while(!0);this[Zi]=!1}e=!1}finally{e&&this[Wt]()}}[Wt](){if(this[vr]&&typeof this[J]=="number"){let e=this[J];this[J]=void 0,Qe.default.closeSync(e),this.emit("close")}}};vt.ReadStreamSync=AS;var Lh=class extends P6.default{static{o(this,"WriteStream")}readable=!1;writable=!0;[bs]=!1;[_s]=!1;[wc]=!1;[hi]=[];[Nh]=!1;[Gt];[bc];[vr];[J];[Dh];[Yi];[wS]=!1;[Or];constructor(e,t){t=t||{},super(t),this[Gt]=e,this[J]=typeof t.fd=="number"?t.fd:void 0,this[bc]=t.mode===void 0?438:t.mode,this[Or]=typeof t.start=="number"?t.start:void 0,this[vr]=typeof t.autoClose=="boolean"?t.autoClose:!0;let r=this[Or]!==void 0?"r+":"w";this[Dh]=t.flags===void 0,this[Yi]=t.flags===void 0?r:t.flags,this[J]===void 0&&this[Rr]()}emit(e,...t){if(e==="error"){if(this[bs])return!1;this[bs]=!0}return super.emit(e,...t)}get fd(){return this[J]}get path(){return this[Gt]}[qn](e){this[Wt](),this[_s]=!0,this.emit("error",e)}[Rr](){Qe.default.open(this[Gt],this[Yi],this[bc],(e,t)=>this[Vn](e,t))}[Vn](e,t){this[Dh]&&this[Yi]==="r+"&&e&&e.code==="ENOENT"?(this[Yi]="w",this[Rr]()):e?this[qn](e):(this[J]=t,this.emit("open",t),this[_s]||this[_S]())}end(e,t){return e&&this.write(e,t),this[wc]=!0,!this[_s]&&!this[hi].length&&typeof this[J]=="number"&&this[jn](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[wc]?(this.emit("error",new Error("write() after end()")),!1):this[J]===void 0||this[_s]||this[hi].length?(this[hi].push(e),this[Nh]=!0,!1):(this[_s]=!0,this[Ph](e),!0)}[Ph](e){Qe.default.write(this[J],e,0,e.length,this[Or],(t,r)=>this[jn](t,r))}[jn](e,t){e?this[qn](e):(this[Or]!==void 0&&typeof t=="number"&&(this[Or]+=t),this[hi].length?this[_S]():(this[_s]=!1,this[wc]&&!this[wS]?(this[wS]=!0,this[Wt](),this.emit("finish")):this[Nh]&&(this[Nh]=!1,this.emit("drain"))))}[_S](){if(this[hi].length===0)this[wc]&&this[jn](null,0);else if(this[hi].length===1)this[Ph](this[hi].pop());else{let e=this[hi];this[hi]=[],x6(this[J],e,this[Or],(t,r)=>this[jn](t,r))}}[Wt](){if(this[vr]&&typeof this[J]=="number"){let e=this[J];this[J]=void 0,Qe.default.close(e,t=>t?this.emit("error",t):this.emit("close"))}}};vt.WriteStream=Lh;var TS=class extends Lh{static{o(this,"WriteStreamSync")}[Rr](){let e;if(this[Dh]&&this[Yi]==="r+")try{e=Qe.default.openSync(this[Gt],this[Yi],this[bc])}catch(t){if(t?.code==="ENOENT")return this[Yi]="w",this[Rr]();throw t}else e=Qe.default.openSync(this[Gt],this[Yi],this[bc]);this[Vn](null,e)}[Wt](){if(this[vr]&&typeof this[J]=="number"){let e=this[J];this[J]=void 0,Qe.default.closeSync(e),this.emit("close")}}[Ph](e){let t=!0;try{this[jn](null,Qe.default.writeSync(this[J],e,0,e.length,this[Or])),t=!1}finally{if(t)try{this[Wt]()}catch{}}}};vt.WriteStreamSync=TS});var Mh=d(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.dealias=Se.isNoFile=Se.isFile=Se.isAsync=Se.isSync=Se.isAsyncNoFile=Se.isSyncNoFile=Se.isAsyncFile=Se.isSyncFile=void 0;var L6=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"]]),M6=o(i=>!!i.sync&&!!i.file,"isSyncFile");Se.isSyncFile=M6;var B6=o(i=>!i.sync&&!!i.file,"isAsyncFile");Se.isAsyncFile=B6;var k6=o(i=>!!i.sync&&!i.file,"isSyncNoFile");Se.isSyncNoFile=k6;var F6=o(i=>!i.sync&&!i.file,"isAsyncNoFile");Se.isAsyncNoFile=F6;var U6=o(i=>!!i.sync,"isSync");Se.isSync=U6;var j6=o(i=>!i.sync,"isAsync");Se.isAsync=j6;var $6=o(i=>!!i.file,"isFile");Se.isFile=$6;var q6=o(i=>!i.file,"isNoFile");Se.isNoFile=q6;var V6=o(i=>{let e=L6.get(i);return e||i},"dealiasKey"),z6=o((i={})=>{if(!i)return{};let e={};for(let[t,r]of Object.entries(i)){let s=V6(t);e[s]=r}return e.chmod===void 0&&e.noChmod===!1&&(e.chmod=!0),delete e.noChmod,e},"dealias");Se.dealias=z6});var Hn=d(Bh=>{"use strict";Object.defineProperty(Bh,"__esModule",{value:!0});Bh.makeCommand=void 0;var Ic=Mh(),H6=o((i,e,t,r,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 u=(0,Ic.dealias)(n);if(s?.(u,a),(0,Ic.isSyncFile)(u)){if(typeof c=="function")throw new TypeError("callback not supported for sync tar functions");return i(u,a)}else if((0,Ic.isAsyncFile)(u)){let l=e(u,a),h=c||void 0;return h?l.then(()=>h(),h):l}else if((0,Ic.isSyncNoFile)(u)){if(typeof c=="function")throw new TypeError("callback not supported for sync tar functions");return t(u,a)}else if((0,Ic.isAsyncNoFile)(u)){if(typeof c=="function")throw new TypeError("callback only supported with file option");return r(u,a)}else throw new Error("impossible options??")},{syncFile:i,asyncFile:e,syncNoFile:t,asyncNoFile:r,validate:s}),"makeCommand");Bh.makeCommand=H6});var CS=d(Gn=>{"use strict";var G6=Gn&&Gn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Gn,"__esModule",{value:!0});Gn.constants=void 0;var W6=G6(require("zlib")),J6=W6.default.constants||{ZLIB_VERNUM:4736};Gn.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},J6))});var vc=d(U=>{"use strict";var K6=U&&U.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),Z6=U&&U.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Y6=U&&U.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&K6(t,e,r[s]);return Z6(t,e),t}})(),X6=U&&U.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(U,"__esModule",{value:!0});U.ZstdDecompress=U.ZstdCompress=U.BrotliDecompress=U.BrotliCompress=U.Unzip=U.InflateRaw=U.DeflateRaw=U.Gunzip=U.Gzip=U.Inflate=U.Deflate=U.Zlib=U.ZlibError=U.constants=void 0;var DS=X6(require("assert")),Is=require("buffer"),Q6=te(),UN=Y6(require("zlib")),fi=CS(),eK=CS();Object.defineProperty(U,"constants",{enumerable:!0,get:o(function(){return eK.constants},"get")});var tK=Is.Buffer.concat,jN=Object.getOwnPropertyDescriptor(Is.Buffer,"concat"),iK=o(i=>i,"noop"),NS=jN?.writable===!0||jN?.set!==void 0?i=>{Is.Buffer.concat=i?iK:tK}:i=>{},Os=Symbol("_superWrite"),vs=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"}};U.ZlibError=vs;var PS=Symbol("flushFlag"),Oc=class extends Q6.Minipass{static{o(this,"ZlibBase")}#e=!1;#t=!1;#i;#r;#s;#u;#c;get sawError(){return this.#e}get handle(){return this.#u}get flushFlag(){return this.#i}constructor(e,t){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");if(super(e),this.#i=e.flush??0,this.#r=e.finishFlush??0,this.#s=e.fullFlushFlag??0,typeof UN[t]!="function")throw new TypeError("Compression method not supported: "+t);try{this.#u=new UN[t](e)}catch(r){throw new vs(r,this.constructor)}this.#c=r=>{this.#e||(this.#e=!0,this.close(),this.emit("error",r))},this.#u?.on("error",r=>this.#c(new vs(r))),this.once("end",()=>this.close)}close(){this.#u&&(this.#u.close(),this.#u=void 0,this.emit("close"))}reset(){if(!this.#e)return(0,DS.default)(this.#u,"zlib binding closed"),this.#u.reset?.()}flush(e){this.ended||(typeof e!="number"&&(e=this.#s),this.write(Object.assign(Is.Buffer.alloc(0),{[PS]:e})))}end(e,t,r){return typeof e=="function"&&(r=e,t=void 0,e=void 0),typeof t=="function"&&(r=t,t=void 0),e&&(t?this.write(e,t):this.write(e)),this.flush(this.#r),this.#t=!0,super.end(r)}get ended(){return this.#t}[Os](e){return super.write(e)}write(e,t,r){if(typeof t=="function"&&(r=t,t="utf8"),typeof e=="string"&&(e=Is.Buffer.from(e,t)),this.#e)return;(0,DS.default)(this.#u,"zlib binding closed");let s=this.#u._handle,n=s.close;s.close=()=>{};let a=this.#u.close;this.#u.close=()=>{},NS(!0);let c;try{let l=typeof e[PS]=="number"?e[PS]:this.#i;c=this.#u._processChunk(e,l),NS(!1)}catch(l){NS(!1),this.#c(new vs(l,this.write))}finally{this.#u&&(this.#u._handle=s,s.close=n,this.#u.close=a,this.#u.removeAllListeners("error"))}this.#u&&this.#u.on("error",l=>this.#c(new vs(l,this.write)));let u;if(c)if(Array.isArray(c)&&c.length>0){let l=c[0];u=this[Os](Is.Buffer.from(l));for(let h=1;h<c.length;h++)u=this[Os](c[h])}else u=this[Os](Is.Buffer.from(c));return r&&r(),u}},di=class extends Oc{static{o(this,"Zlib")}#e;#t;constructor(e,t){e=e||{},e.flush=e.flush||fi.constants.Z_NO_FLUSH,e.finishFlush=e.finishFlush||fi.constants.Z_FINISH,e.fullFlushFlag=fi.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(fi.constants.Z_SYNC_FLUSH),(0,DS.default)(this.handle,"zlib binding closed");let r=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=r}this.handle&&(this.#e=e,this.#t=t)}}}};U.Zlib=di;var xS=class extends di{static{o(this,"Deflate")}constructor(e){super(e,"Deflate")}};U.Deflate=xS;var LS=class extends di{static{o(this,"Inflate")}constructor(e){super(e,"Inflate")}};U.Inflate=LS;var MS=class extends di{static{o(this,"Gzip")}#e;constructor(e){super(e,"Gzip"),this.#e=e&&!!e.portable}[Os](e){return this.#e?(this.#e=!1,e[9]=255,super[Os](e)):super[Os](e)}};U.Gzip=MS;var BS=class extends di{static{o(this,"Gunzip")}constructor(e){super(e,"Gunzip")}};U.Gunzip=BS;var kS=class extends di{static{o(this,"DeflateRaw")}constructor(e){super(e,"DeflateRaw")}};U.DeflateRaw=kS;var FS=class extends di{static{o(this,"InflateRaw")}constructor(e){super(e,"InflateRaw")}};U.InflateRaw=FS;var US=class extends di{static{o(this,"Unzip")}constructor(e){super(e,"Unzip")}};U.Unzip=US;var kh=class extends Oc{static{o(this,"Brotli")}constructor(e,t){e=e||{},e.flush=e.flush||fi.constants.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||fi.constants.BROTLI_OPERATION_FINISH,e.fullFlushFlag=fi.constants.BROTLI_OPERATION_FLUSH,super(e,t)}},jS=class extends kh{static{o(this,"BrotliCompress")}constructor(e){super(e,"BrotliCompress")}};U.BrotliCompress=jS;var $S=class extends kh{static{o(this,"BrotliDecompress")}constructor(e){super(e,"BrotliDecompress")}};U.BrotliDecompress=$S;var Fh=class extends Oc{static{o(this,"Zstd")}constructor(e,t){e=e||{},e.flush=e.flush||fi.constants.ZSTD_e_continue,e.finishFlush=e.finishFlush||fi.constants.ZSTD_e_end,e.fullFlushFlag=fi.constants.ZSTD_e_flush,super(e,t)}},qS=class extends Fh{static{o(this,"ZstdCompress")}constructor(e){super(e,"ZstdCompress")}};U.ZstdCompress=qS;var VS=class extends Fh{static{o(this,"ZstdDecompress")}constructor(e){super(e,"ZstdDecompress")}};U.ZstdDecompress=VS});var VN=d(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.parse=Wn.encode=void 0;var rK=o((i,e)=>{if(Number.isSafeInteger(i))i<0?nK(i,e):sK(i,e);else throw Error("cannot encode number outside of javascript safe integer range");return e},"encode");Wn.encode=rK;var sK=o((i,e)=>{e[0]=128;for(var t=e.length;t>1;t--)e[t-1]=i&255,i=Math.floor(i/256)},"encodePositive"),nK=o((i,e)=>{e[0]=255;var t=!1;i=i*-1;for(var r=e.length;r>1;r--){var s=i&255;i=Math.floor(i/256),t?e[r-1]=$N(s):s===0?e[r-1]=0:(t=!0,e[r-1]=qN(s))}},"encodeNegative"),oK=o(i=>{let e=i[0],t=e===128?cK(i.subarray(1,i.length)):e===255?aK(i):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");Wn.parse=oK;var aK=o(i=>{for(var e=i.length,t=0,r=!1,s=e-1;s>-1;s--){var n=Number(i[s]),a;r?a=$N(n):n===0?a=n:(r=!0,a=qN(n)),a!==0&&(t-=a*Math.pow(256,e-s-1))}return t},"twos"),cK=o(i=>{for(var e=i.length,t=0,r=e-1;r>-1;r--){var s=Number(i[r]);s!==0&&(t+=s*Math.pow(256,e-r-1))}return t},"pos"),$N=o(i=>(255^i)&255,"onesComp"),qN=o(i=>(255^i)+1&255,"twosComp")});var zS=d(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.code=ft.name=ft.isName=ft.isCode=void 0;var uK=o(i=>ft.name.has(i),"isCode");ft.isCode=uK;var lK=o(i=>ft.code.has(i),"isName");ft.isName=lK;ft.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"]]);ft.code=new Map(Array.from(ft.name).map(i=>[i[1],i[0]]))});var Kn=d(pi=>{"use strict";var hK=pi&&pi.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),fK=pi&&pi.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),zN=pi&&pi.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&hK(e,i,t);return fK(e,i),e};Object.defineProperty(pi,"__esModule",{value:!0});pi.Header=void 0;var Jn=require("node:path"),HN=zN(VN()),Rc=zN(zS()),WS=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,r,s){Buffer.isBuffer(e)?this.decode(e,t||0,r,s):e&&this.#t(e)}decode(e,t,r,s){if(t||(t=0),!e||!(e.length>=t+512))throw new Error("need 512 bytes for header");this.path=Rs(e,t,100),this.mode=Ar(e,t+100,8),this.uid=Ar(e,t+108,8),this.gid=Ar(e,t+116,8),this.size=Ar(e,t+124,12),this.mtime=HS(e,t+136,12),this.cksum=Ar(e,t+148,12),s&&this.#t(s,!0),r&&this.#t(r);let n=Rs(e,t+156,1);if(Rc.isCode(n)&&(this.#e=n||"0"),this.#e==="0"&&this.path.slice(-1)==="/"&&(this.#e="5"),this.#e==="5"&&(this.size=0),this.linkpath=Rs(e,t+157,100),e.subarray(t+257,t+265).toString()==="ustar\x0000")if(this.uname=Rs(e,t+265,32),this.gname=Rs(e,t+297,32),this.devmaj=Ar(e,t+329,8)??0,this.devmin=Ar(e,t+337,8)??0,e[t+475]!==0){let c=Rs(e,t+345,155);this.path=c+"/"+this.path}else{let c=Rs(e,t+345,130);c&&(this.path=c+"/"+this.path),this.atime=HS(e,t+476,12),this.ctime=HS(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(([r,s])=>!(s==null||r==="path"&&t||r==="linkpath"&&t||r==="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 r=this.ctime||this.atime?130:155,s=dK(this.path||"",r),n=s[0],a=s[1];this.needPax=!!s[2],this.needPax=As(e,t,100,n)||this.needPax,this.needPax=Tr(e,t+100,8,this.mode)||this.needPax,this.needPax=Tr(e,t+108,8,this.uid)||this.needPax,this.needPax=Tr(e,t+116,8,this.gid)||this.needPax,this.needPax=Tr(e,t+124,12,this.size)||this.needPax,this.needPax=GS(e,t+136,12,this.mtime)||this.needPax,e[t+156]=this.#e.charCodeAt(0),this.needPax=As(e,t+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",t+257,8),this.needPax=As(e,t+265,32,this.uname)||this.needPax,this.needPax=As(e,t+297,32,this.gname)||this.needPax,this.needPax=Tr(e,t+329,8,this.devmaj)||this.needPax,this.needPax=Tr(e,t+337,8,this.devmin)||this.needPax,this.needPax=As(e,t+345,r,a)||this.needPax,e[t+475]!==0?this.needPax=As(e,t+345,155,a)||this.needPax:(this.needPax=As(e,t+345,130,a)||this.needPax,this.needPax=GS(e,t+476,12,this.atime)||this.needPax,this.needPax=GS(e,t+488,12,this.ctime)||this.needPax);let c=256;for(let u=t;u<t+148;u++)c+=e[u];for(let u=t+156;u<t+512;u++)c+=e[u];return this.cksum=c,Tr(e,t+148,8,this.cksum),this.cksumValid=!0,this.needPax}get type(){return this.#e==="Unsupported"?this.#e:Rc.name.get(this.#e)}get typeKey(){return this.#e}set type(e){let t=String(Rc.code.get(e));if(Rc.isCode(t)||t==="Unsupported")this.#e=t;else if(Rc.isCode(e))this.#e=e;else throw new TypeError("invalid entry type: "+e)}};pi.Header=WS;var dK=o((i,e)=>{let r=i,s="",n,a=Jn.posix.parse(i).root||".";if(Buffer.byteLength(r)<100)n=[r,s,!1];else{s=Jn.posix.dirname(r),r=Jn.posix.basename(r);do Buffer.byteLength(r)<=100&&Buffer.byteLength(s)<=e?n=[r,s,!1]:Buffer.byteLength(r)>100&&Buffer.byteLength(s)<=e?n=[r.slice(0,99),s,!0]:(r=Jn.posix.join(Jn.posix.basename(s),r),s=Jn.posix.dirname(s));while(s!==a&&n===void 0);n||(n=[i.slice(0,99),"",!0])}return n},"splitPrefix"),Rs=o((i,e,t)=>i.subarray(e,e+t).toString("utf8").replace(/\0.*/,""),"decString"),HS=o((i,e,t)=>pK(Ar(i,e,t)),"decDate"),pK=o(i=>i===void 0?void 0:new Date(i*1e3),"numToDate"),Ar=o((i,e,t)=>Number(i[e])&128?HN.parse(i.subarray(e,e+t)):gK(i,e,t),"decNumber"),mK=o(i=>isNaN(i)?void 0:i,"nanUndef"),gK=o((i,e,t)=>mK(parseInt(i.subarray(e,e+t).toString("utf8").replace(/\0.*$/,"").trim(),8)),"decSmallNumber"),yK={12:8589934591,8:2097151},Tr=o((i,e,t,r)=>r===void 0?!1:r>yK[t]||r<0?(HN.encode(r,i.subarray(e,e+t)),!0):(SK(i,e,t,r),!1),"encNumber"),SK=o((i,e,t,r)=>i.write(EK(r,t),e,t,"ascii"),"encSmallNumber"),EK=o((i,e)=>wK(Math.floor(i).toString(8),e),"octalString"),wK=o((i,e)=>(i.length===e-1?i:new Array(e-i.length-1).join("0")+i+" ")+"\0","padOctal"),GS=o((i,e,t,r)=>r===void 0?!1:Tr(i,e,t,r.getTime()/1e3),"encDate"),_K=new Array(156).join("\0"),As=o((i,e,t,r)=>r===void 0?!1:(i.write(r+_K,e,t,"utf8"),r.length!==Buffer.byteLength(r)||r.length>t),"encString")});var jh=d(Uh=>{"use strict";Object.defineProperty(Uh,"__esModule",{value:!0});Uh.Pax=void 0;var bK=require("node:path"),IK=Kn(),JS=class i{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),r=512*Math.ceil(1+t/512),s=Buffer.allocUnsafe(r);for(let n=0;n<512;n++)s[n]=0;new IK.Header({path:("PaxHeader/"+(0,bK.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],r=t instanceof Date?t.getTime()/1e3:t,s=" "+(e==="dev"||e==="ino"||e==="nlink"?"SCHILY.":"")+e+"="+r+`
30
+ `,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,r=!1){return new i(OK(vK(e),t),r)}};Uh.Pax=JS;var OK=o((i,e)=>e?Object.assign({},e,i):i,"merge"),vK=o(i=>i.replace(/\n$/,"").split(`
31
+ `).reduce(RK,Object.create(null)),"parseKV"),RK=o((i,e)=>{let t=parseInt(e,10);if(t!==Buffer.byteLength(e)+1)return i;e=e.slice((t+" ").length);let r=e.split("="),s=r.shift();if(!s)return i;let n=s.replace(/^SCHILY\.(dev|ino|nlink)/,"$1"),a=r.join("=");return i[n]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(n)?new Date(Number(a)*1e3):/^[0-9]+$/.test(a)?+a:a,i},"parseKVLine")});var Zn=d($h=>{"use strict";Object.defineProperty($h,"__esModule",{value:!0});$h.normalizeWindowsPath=void 0;var AK=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;$h.normalizeWindowsPath=AK!=="win32"?i=>i:i=>i&&i.replace(/\\/g,"/")});var zh=d(Vh=>{"use strict";Object.defineProperty(Vh,"__esModule",{value:!0});Vh.ReadEntry=void 0;var TK=te(),qh=Zn(),KS=class extends TK.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,r){switch(super({}),this.pause(),this.extended=t,this.globalExtended=r,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,qh.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,qh.normalizeWindowsPath)(e.linkpath):void 0,this.uname=e.uname,this.gname=e.gname,t&&this.#e(t),r&&this.#e(r,!0)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");let r=this.remain,s=this.blockRemain;return this.remain=Math.max(0,r-t),this.blockRemain=Math.max(0,s-t),this.ignore?!0:r>=t?super.write(e):super.write(e.subarray(0,r))}#e(e,t=!1){e.path&&(e.path=(0,qh.normalizeWindowsPath)(e.path)),e.linkpath&&(e.linkpath=(0,qh.normalizeWindowsPath)(e.linkpath)),Object.assign(this,Object.fromEntries(Object.entries(e).filter(([r,s])=>!(s==null||r==="path"&&t))))}};Vh.ReadEntry=KS});var Gh=d(Hh=>{"use strict";Object.defineProperty(Hh,"__esModule",{value:!0});Hh.warnMethod=void 0;var CK=o((i,e,t,r={})=>{i.file&&(r.file=i.file),i.cwd&&(r.cwd=i.cwd),r.code=t instanceof Error&&t.code||e,r.tarCode=e,!i.strict&&r.recoverable!==!1?(t instanceof Error&&(r=Object.assign(t,r),t=t.message),i.emit("warn",e,t,r)):t instanceof Error?i.emit("error",Object.assign(t,r)):i.emit("error",Object.assign(new Error(`${e}: ${t}`),r))},"warnMethod");Hh.warnMethod=CK});var ef=d(Qh=>{"use strict";Object.defineProperty(Qh,"__esModule",{value:!0});Qh.Parser=void 0;var NK=require("events"),ZS=vc(),GN=Kn(),WN=jh(),PK=zh(),DK=Gh(),xK=1024*1024,tE=Buffer.from([31,139]),iE=Buffer.from([40,181,47,253]),LK=Math.max(tE.length,iE.length),Rt=Symbol("state"),Ts=Symbol("writeEntry"),Xi=Symbol("readEntry"),YS=Symbol("nextEntry"),JN=Symbol("processEntry"),mi=Symbol("extendedHeader"),Ac=Symbol("globalExtendedHeader"),Cr=Symbol("meta"),KN=Symbol("emitMeta"),ie=Symbol("buffer"),Qi=Symbol("queue"),Nr=Symbol("ended"),XS=Symbol("emittedEnd"),Cs=Symbol("emit"),Ee=Symbol("unzip"),Wh=Symbol("consumeChunk"),Jh=Symbol("consumeChunkSub"),QS=Symbol("consumeBody"),ZN=Symbol("consumeMeta"),YN=Symbol("consumeHeader"),Tc=Symbol("consuming"),eE=Symbol("bufferConcat"),Kh=Symbol("maybeEnd"),Yn=Symbol("writing"),Pr=Symbol("aborted"),Zh=Symbol("onDone"),Ns=Symbol("sawValidEntry"),Yh=Symbol("sawNullBlock"),Xh=Symbol("sawEOF"),XN=Symbol("closeStream"),MK=o(()=>!0,"noop"),rE=class extends NK.EventEmitter{static{o(this,"Parser")}file;strict;maxMetaEntrySize;filter;brotli;zstd;writable=!0;readable=!1;[Qi]=[];[ie];[Xi];[Ts];[Rt]="begin";[Cr]="";[mi];[Ac];[Nr]=!1;[Ee];[Pr]=!1;[Ns];[Yh]=!1;[Xh]=!1;[Yn]=!1;[Tc]=!1;[XS]=!1;constructor(e={}){super(),this.file=e.file||"",this.on(Zh,()=>{(this[Rt]==="begin"||this[Ns]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(Zh,e.ondone):this.on(Zh,()=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||xK,this.filter=typeof e.filter=="function"?e.filter:MK;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 r=e.file&&(e.file.endsWith(".tar.zst")||e.file.endsWith(".tzst"));this.zstd=!(e.gzip||e.brotli)&&e.zstd!==void 0?e.zstd:r?!0:void 0,this.on("end",()=>this[XN]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onReadEntry=="function"&&this.on("entry",e.onReadEntry)}warn(e,t,r={}){(0,DK.warnMethod)(this,e,t,r)}[YN](e,t){this[Ns]===void 0&&(this[Ns]=!1);let r;try{r=new GN.Header(e,t,this[mi],this[Ac])}catch(s){return this.warn("TAR_ENTRY_INVALID",s)}if(r.nullBlock)this[Yh]?(this[Xh]=!0,this[Rt]==="begin"&&(this[Rt]="header"),this[Cs]("eof")):(this[Yh]=!0,this[Cs]("nullBlock"));else if(this[Yh]=!1,!r.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:r});else if(!r.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:r});else{let s=r.type;if(/^(Symbolic)?Link$/.test(s)&&!r.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:r});else if(!/^(Symbolic)?Link$/.test(s)&&!/^(Global)?ExtendedHeader$/.test(s)&&r.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:r});else{let n=this[Ts]=new PK.ReadEntry(r,this[mi],this[Ac]);if(!this[Ns])if(n.remain){let a=o(()=>{n.invalid||(this[Ns]=!0)},"onend");n.on("end",a)}else this[Ns]=!0;n.meta?n.size>this.maxMetaEntrySize?(n.ignore=!0,this[Cs]("ignoredEntry",n),this[Rt]="ignore",n.resume()):n.size>0&&(this[Cr]="",n.on("data",a=>this[Cr]+=a),this[Rt]="meta"):(this[mi]=void 0,n.ignore=n.ignore||!this.filter(n.path,n),n.ignore?(this[Cs]("ignoredEntry",n),this[Rt]=n.remain?"ignore":"header",n.resume()):(n.remain?this[Rt]="body":(this[Rt]="header",n.end()),this[Xi]?this[Qi].push(n):(this[Qi].push(n),this[YS]())))}}}[XN](){queueMicrotask(()=>this.emit("close"))}[JN](e){let t=!0;if(!e)this[Xi]=void 0,t=!1;else if(Array.isArray(e)){let[r,...s]=e;this.emit(r,...s)}else this[Xi]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",()=>this[YS]()),t=!1);return t}[YS](){do;while(this[JN](this[Qi].shift()));if(!this[Qi].length){let e=this[Xi];!e||e.flowing||e.size===e.remain?this[Yn]||this.emit("drain"):e.once("drain",()=>this.emit("drain"))}}[QS](e,t){let r=this[Ts];if(!r)throw new Error("attempt to consume body without entry??");let s=r.blockRemain??0,n=s>=e.length&&t===0?e:e.subarray(t,t+s);return r.write(n),r.blockRemain||(this[Rt]="header",this[Ts]=void 0,r.end()),n.length}[ZN](e,t){let r=this[Ts],s=this[QS](e,t);return!this[Ts]&&r&&this[KN](r),s}[Cs](e,t,r){!this[Qi].length&&!this[Xi]?this.emit(e,t,r):this[Qi].push([e,t,r])}[KN](e){switch(this[Cs]("meta",this[Cr]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[mi]=WN.Pax.parse(this[Cr],this[mi],!1);break;case"GlobalExtendedHeader":this[Ac]=WN.Pax.parse(this[Cr],this[Ac],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":{let t=this[mi]??Object.create(null);this[mi]=t,t.path=this[Cr].replace(/\0.*/,"");break}case"NextFileHasLongLinkpath":{let t=this[mi]||Object.create(null);this[mi]=t,t.linkpath=this[Cr].replace(/\0.*/,"");break}default:throw new Error("unknown meta: "+e.type)}}abort(e){this[Pr]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e,t,r){if(typeof t=="function"&&(r=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8")),this[Pr])return r?.(),!1;if((this[Ee]===void 0||this.brotli===void 0&&this[Ee]===!1)&&e){if(this[ie]&&(e=Buffer.concat([this[ie],e]),this[ie]=void 0),e.length<LK)return this[ie]=e,r?.(),!0;for(let u=0;this[Ee]===void 0&&u<tE.length;u++)e[u]!==tE[u]&&(this[Ee]=!1);let a=!1;if(this[Ee]===!1&&this.zstd!==!1){a=!0;for(let u=0;u<iE.length;u++)if(e[u]!==iE[u]){a=!1;break}}let c=this.brotli===void 0&&!a;if(this[Ee]===!1&&c)if(e.length<512)if(this[Nr])this.brotli=!0;else return this[ie]=e,r?.(),!0;else try{new GN.Header(e.subarray(0,512)),this.brotli=!1}catch{this.brotli=!0}if(this[Ee]===void 0||this[Ee]===!1&&(this.brotli||a)){let u=this[Nr];this[Nr]=!1,this[Ee]=this[Ee]===void 0?new ZS.Unzip({}):a?new ZS.ZstdDecompress({}):new ZS.BrotliDecompress({}),this[Ee].on("data",h=>this[Wh](h)),this[Ee].on("error",h=>this.abort(h)),this[Ee].on("end",()=>{this[Nr]=!0,this[Wh]()}),this[Yn]=!0;let l=!!this[Ee][u?"end":"write"](e);return this[Yn]=!1,r?.(),l}}this[Yn]=!0,this[Ee]?this[Ee].write(e):this[Wh](e),this[Yn]=!1;let n=this[Qi].length?!1:this[Xi]?this[Xi].flowing:!0;return!n&&!this[Qi].length&&this[Xi]?.once("drain",()=>this.emit("drain")),r?.(),n}[eE](e){e&&!this[Pr]&&(this[ie]=this[ie]?Buffer.concat([this[ie],e]):e)}[Kh](){if(this[Nr]&&!this[XS]&&!this[Pr]&&!this[Tc]){this[XS]=!0;let e=this[Ts];if(e&&e.blockRemain){let t=this[ie]?this[ie].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`,{entry:e}),this[ie]&&e.write(this[ie]),e.end()}this[Cs](Zh)}}[Wh](e){if(this[Tc]&&e)this[eE](e);else if(!e&&!this[ie])this[Kh]();else if(e){if(this[Tc]=!0,this[ie]){this[eE](e);let t=this[ie];this[ie]=void 0,this[Jh](t)}else this[Jh](e);for(;this[ie]&&this[ie]?.length>=512&&!this[Pr]&&!this[Xh];){let t=this[ie];this[ie]=void 0,this[Jh](t)}this[Tc]=!1}(!this[ie]||this[Nr])&&this[Kh]()}[Jh](e){let t=0,r=e.length;for(;t+512<=r&&!this[Pr]&&!this[Xh];)switch(this[Rt]){case"begin":case"header":this[YN](e,t),t+=512;break;case"ignore":case"body":t+=this[QS](e,t);break;case"meta":t+=this[ZN](e,t);break;default:throw new Error("invalid state: "+this[Rt])}t<r&&(this[ie]?this[ie]=Buffer.concat([e.subarray(t),this[ie]]):this[ie]=e.subarray(t))}end(e,t,r){return typeof e=="function"&&(r=e,t=void 0,e=void 0),typeof t=="function"&&(r=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,t)),r&&this.once("finish",r),this[Pr]||(this[Ee]?(e&&this[Ee].write(e),this[Ee].end()):(this[Nr]=!0,(this.brotli===void 0||this.zstd===void 0)&&(e=e||Buffer.alloc(0)),e&&this.write(e),this[Kh]())),this}};Qh.Parser=rE});var rf=d(tf=>{"use strict";Object.defineProperty(tf,"__esModule",{value:!0});tf.stripTrailingSlashes=void 0;var BK=o(i=>{let e=i.length-1,t=-1;for(;e>-1&&i.charAt(e)==="/";)t=e,e--;return t===-1?i:i.slice(0,t)},"stripTrailingSlashes");tf.stripTrailingSlashes=BK});var Qn=d(Ge=>{"use strict";var kK=Ge&&Ge.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),FK=Ge&&Ge.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),UK=Ge&&Ge.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&kK(e,i,t);return FK(e,i),e},jK=Ge&&Ge.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.list=Ge.filesFilter=void 0;var $K=UK(zn()),Xn=jK(require("node:fs")),QN=require("path"),qK=Hn(),sf=ef(),sE=rf(),VK=o(i=>{let e=i.onReadEntry;i.onReadEntry=e?t=>{e(t),t.resume()}:t=>t.resume()},"onReadEntryFunction"),zK=o((i,e)=>{let t=new Map(e.map(n=>[(0,sE.stripTrailingSlashes)(n),!0])),r=i.filter,s=o((n,a="")=>{let c=a||(0,QN.parse)(n).root||".",u;if(n===c)u=!1;else{let l=t.get(n);l!==void 0?u=l:u=s((0,QN.dirname)(n),c)}return t.set(n,u),u},"mapHas");i.filter=r?(n,a)=>r(n,a)&&s((0,sE.stripTrailingSlashes)(n)):n=>s((0,sE.stripTrailingSlashes)(n))},"filesFilter");Ge.filesFilter=zK;var HK=o(i=>{let e=new sf.Parser(i),t=i.file,r;try{r=Xn.default.openSync(t,"r");let s=Xn.default.fstatSync(r),n=i.maxReadSize||16*1024*1024;if(s.size<n){let a=Buffer.allocUnsafe(s.size);Xn.default.readSync(r,a,0,s.size,0),e.end(a)}else{let a=0,c=Buffer.allocUnsafe(n);for(;a<s.size;){let u=Xn.default.readSync(r,c,0,n,a);a+=u,e.write(c.subarray(0,u))}e.end()}}finally{if(typeof r=="number")try{Xn.default.closeSync(r)}catch{}}},"listFileSync"),GK=o((i,e)=>{let t=new sf.Parser(i),r=i.maxReadSize||16*1024*1024,s=i.file;return new Promise((a,c)=>{t.on("error",c),t.on("end",a),Xn.default.stat(s,(u,l)=>{if(u)c(u);else{let h=new $K.ReadStream(s,{readSize:r,size:l.size});h.on("error",c),h.pipe(t)}})})},"listFile");Ge.list=(0,qK.makeCommand)(HK,GK,i=>new sf.Parser(i),i=>new sf.Parser(i),(i,e)=>{e?.length&&(0,Ge.filesFilter)(i,e),i.noResume||VK(i)})});var eP=d(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});nf.modeFix=void 0;var WK=o((i,e,t)=>(i&=4095,t&&(i=(i|384)&-19),e&&(i&256&&(i|=64),i&32&&(i|=8),i&4&&(i|=1)),i),"modeFix");nf.modeFix=WK});var nE=d(of=>{"use strict";Object.defineProperty(of,"__esModule",{value:!0});of.stripAbsolutePath=void 0;var JK=require("node:path"),{isAbsolute:KK,parse:tP}=JK.win32,ZK=o(i=>{let e="",t=tP(i);for(;KK(i)||t.root;){let r=i.charAt(0)==="/"&&i.slice(0,4)!=="//?/"?"/":t.root;i=i.slice(r.length),e+=r,t=tP(i)}return[e,i]},"stripAbsolutePath");of.stripAbsolutePath=ZK});var aE=d(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.decode=eo.encode=void 0;var af=["|","<",">","?",":"],oE=af.map(i=>String.fromCharCode(61440+i.charCodeAt(0))),YK=new Map(af.map((i,e)=>[i,oE[e]])),XK=new Map(oE.map((i,e)=>[i,af[e]])),QK=o(i=>af.reduce((e,t)=>e.split(t).join(YK.get(t)),i),"encode");eo.encode=QK;var eZ=o(i=>oE.reduce((e,t)=>e.split(t).join(XK.get(t)),i),"decode");eo.decode=eZ});var SE=d(Be=>{"use strict";var tZ=Be&&Be.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),iZ=Be&&Be.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),rZ=Be&&Be.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&tZ(e,i,t);return iZ(e,i),e},aP=Be&&Be.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Be,"__esModule",{value:!0});Be.WriteEntryTar=Be.WriteEntrySync=Be.WriteEntry=void 0;var yi=aP(require("fs")),cP=te(),iP=aP(require("path")),uP=Kn(),lP=eP(),gi=Zn(),hP=Mh(),fP=jh(),dP=nE(),sZ=rf(),pP=Gh(),nZ=rZ(aE()),mP=o((i,e)=>e?(i=(0,gi.normalizeWindowsPath)(i).replace(/^\.(\/|$)/,""),(0,sZ.stripTrailingSlashes)(e)+"/"+i):(0,gi.normalizeWindowsPath)(i),"prefixPath"),oZ=16*1024*1024,rP=Symbol("process"),sP=Symbol("file"),nP=Symbol("directory"),uE=Symbol("symlink"),oP=Symbol("hardlink"),Cc=Symbol("header"),cf=Symbol("read"),lE=Symbol("lstat"),uf=Symbol("onlstat"),hE=Symbol("onread"),fE=Symbol("onreadlink"),dE=Symbol("openfile"),pE=Symbol("onopenfile"),Dr=Symbol("close"),lf=Symbol("mode"),mE=Symbol("awaitDrain"),cE=Symbol("ondrain"),Si=Symbol("prefix"),hf=class extends cP.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 r=(0,hP.dealias)(t);super(),this.path=(0,gi.normalizeWindowsPath)(e),this.portable=!!r.portable,this.maxReadSize=r.maxReadSize||oZ,this.linkCache=r.linkCache||new Map,this.statCache=r.statCache||new Map,this.preservePaths=!!r.preservePaths,this.cwd=(0,gi.normalizeWindowsPath)(r.cwd||process.cwd()),this.strict=!!r.strict,this.noPax=!!r.noPax,this.noMtime=!!r.noMtime,this.mtime=r.mtime,this.prefix=r.prefix?(0,gi.normalizeWindowsPath)(r.prefix):void 0,this.onWriteEntry=r.onWriteEntry,typeof r.onwarn=="function"&&this.on("warn",r.onwarn);let s=!1;if(!this.preservePaths){let[a,c]=(0,dP.stripAbsolutePath)(this.path);a&&typeof c=="string"&&(this.path=c,s=a)}this.win32=!!r.win32||process.platform==="win32",this.win32&&(this.path=nZ.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=(0,gi.normalizeWindowsPath)(r.absolute||iP.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[uf](n):this[lE]()}warn(e,t,r={}){return(0,pP.warnMethod)(this,e,t,r)}emit(e,...t){return e==="error"&&(this.#e=!0),super.emit(e,...t)}[lE](){yi.default.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[uf](t)})}[uf](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=aZ(e),this.emit("stat",e),this[rP]()}[rP](){switch(this.type){case"File":return this[sP]();case"Directory":return this[nP]();case"SymbolicLink":return this[uE]();default:return this.end()}}[lf](e){return(0,lP.modeFix)(e,this.type==="Directory",this.portable)}[Si](e){return mP(e,this.prefix)}[Cc](){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 uP.Header({path:this[Si](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[Si](this.linkpath):this.linkpath,mode:this[lf](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 fP.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[Si](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[Si](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)}[nP](){if(!this.stat)throw new Error("cannot create directory entry without stat");this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[Cc](),this.end()}[uE](){yi.default.readlink(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[fE](t)})}[fE](e){this.linkpath=(0,gi.normalizeWindowsPath)(e),this[Cc](),this.end()}[oP](e){if(!this.stat)throw new Error("cannot create link entry without stat");this.type="Link",this.linkpath=(0,gi.normalizeWindowsPath)(iP.default.relative(this.cwd,e)),this.stat.size=0,this[Cc](),this.end()}[sP](){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[oP](t);this.linkCache.set(e,this.absolute)}if(this[Cc](),this.stat.size===0)return this.end();this[dE]()}[dE](){yi.default.open(this.absolute,"r",(e,t)=>{if(e)return this.emit("error",e);this[pE](t)})}[pE](e){if(this.fd=e,this.#e)return this[Dr]();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[cf]()}[cf](){let{fd:e,buf:t,offset:r,length:s,pos:n}=this;if(e===void 0||t===void 0)throw new Error("cannot read file without first opening");yi.default.read(e,t,r,s,n,(a,c)=>{if(a)return this[Dr](()=>this.emit("error",a));this[hE](c)})}[Dr](e=()=>{}){this.fd!==void 0&&yi.default.close(this.fd,e)}[hE](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[Dr](()=>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[Dr](()=>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[cE]():this[mE](()=>this[cE]())}[mE](e){this.once("drain",e)}write(e,t,r){if(typeof t=="function"&&(r=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,r)}[cE](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[Dr](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[cf]()}};Be.WriteEntry=hf;var gE=class extends hf{static{o(this,"WriteEntrySync")}sync=!0;[lE](){this[uf](yi.default.lstatSync(this.absolute))}[uE](){this[fE](yi.default.readlinkSync(this.absolute))}[dE](){this[pE](yi.default.openSync(this.absolute,"r"))}[cf](){let e=!0;try{let{fd:t,buf:r,offset:s,length:n,pos:a}=this;if(t===void 0||r===void 0)throw new Error("fd and buf must be set in READ method");let c=yi.default.readSync(t,r,s,n,a);this[hE](c),e=!1}finally{if(e)try{this[Dr](()=>{})}catch{}}}[mE](e){e()}[Dr](e=()=>{}){this.fd!==void 0&&yi.default.closeSync(this.fd),e()}};Be.WriteEntrySync=gE;var yE=class extends cP.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,r={}){return(0,pP.warnMethod)(this,e,t,r)}constructor(e,t={}){let r=(0,hP.dealias)(t);super(),this.preservePaths=!!r.preservePaths,this.portable=!!r.portable,this.strict=!!r.strict,this.noPax=!!r.noPax,this.noMtime=!!r.noMtime,this.onWriteEntry=r.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=r.prefix,this.path=(0,gi.normalizeWindowsPath)(e.path),this.mode=e.mode!==void 0?this[lf](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:r.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,gi.normalizeWindowsPath)(e.linkpath):void 0,typeof r.onwarn=="function"&&this.on("warn",r.onwarn);let n=!1;if(!this.preservePaths){let[c,u]=(0,dP.stripAbsolutePath)(this.path);c&&typeof u=="string"&&(this.path=u,n=c)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.onWriteEntry?.(this),this.header=new uP.Header({path:this[Si](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[Si](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 fP.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[Si](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[Si](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)}[Si](e){return mP(e,this.prefix)}[lf](e){return(0,lP.modeFix)(e,this.type==="Directory",this.portable)}write(e,t,r){typeof t=="function"&&(r=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,r)}end(e,t,r){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),typeof e=="function"&&(r=e,t=void 0,e=void 0),typeof t=="function"&&(r=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,t??"utf8")),r&&this.once("finish",r),e?super.end(e,r):super.end(r),this}};Be.WriteEntryTar=yE;var aZ=o(i=>i.isFile()?"File":i.isDirectory()?"Directory":i.isSymbolicLink()?"SymbolicLink":"Unsupported","getType")});var gP=d(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.Node=io.Yallist=void 0;var EE=class i{static{o(this,"Yallist")}tail;head;length=0;static create(e=[]){return new i(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,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),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,r=e.length;t<r;t++)uZ(this,e[t]);return this.length}unshift(...e){for(var t=0,r=e.length;t<r;t++)lZ(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 r=this.head,s=0;r;s++)e.call(t,r.value,s,this),r=r.next}forEachReverse(e,t){t=t||this;for(let r=this.tail,s=this.length-1;r;s--)e.call(t,r.value,s,this),r=r.prev}get(e){let t=0,r=this.head;for(;r&&t<e;t++)r=r.next;if(t===e&&r)return r.value}getReverse(e){let t=0,r=this.tail;for(;r&&t<e;t++)r=r.prev;if(t===e&&r)return r.value}map(e,t){t=t||this;let r=new i;for(let s=this.head;s;)r.push(e.call(t,s.value,this)),s=s.next;return r}mapReverse(e,t){t=t||this;var r=new i;for(let s=this.tail;s;)r.push(e.call(t,s.value,this)),s=s.prev;return r}reduce(e,t){let r,s=this.head;if(arguments.length>1)r=t;else if(this.head)s=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=0;s;n++)r=e(r,s.value,n),s=s.next;return r}reduceReverse(e,t){let r,s=this.tail;if(arguments.length>1)r=t;else if(this.tail)s=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(let n=this.length-1;s;n--)r=e(r,s.value,n),s=s.prev;return r}toArray(){let e=new Array(this.length);for(let t=0,r=this.head;r;t++)e[t]=r.value,r=r.next;return e}toArrayReverse(){let e=new Array(this.length);for(let t=0,r=this.tail;r;t++)e[t]=r.value,r=r.prev;return e}slice(e=0,t=this.length){t<0&&(t+=this.length),e<0&&(e+=this.length);let r=new i;if(t<e||t<0)return r;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)r.push(s.value);return r}sliceReverse(e=0,t=this.length){t<0&&(t+=this.length),e<0&&(e+=this.length);let r=new i;if(t<e||t<0)return r;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)r.push(n.value);return r}splice(e,t=0,...r){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 r)s=cZ(this,s,a);return n}reverse(){let e=this.head,t=this.tail;for(let r=e;r;r=r.prev){let s=r.prev;r.prev=r.next,r.next=s}return this.head=t,this.tail=e,this}};io.Yallist=EE;function cZ(i,e,t){let r=e,s=e?e.next:i.head,n=new to(t,r,s,i);return n.next===void 0&&(i.tail=n),n.prev===void 0&&(i.head=n),i.length++,n}o(cZ,"insertAfter");function uZ(i,e){i.tail=new to(e,i.tail,void 0,i),i.head||(i.head=i.tail),i.length++}o(uZ,"push");function lZ(i,e){i.head=new to(e,void 0,i.head,i),i.tail||(i.tail=i.head),i.length++}o(lZ,"unshift");var to=class{static{o(this,"Node")}list;next;prev;value;constructor(e,t,r,s){this.list=s,this.value=e,t?(t.next=this,this.prev=t):this.prev=void 0,r?(r.prev=this,this.next=r):this.next=void 0}};io.Node=to});var Ef=d(ke=>{"use strict";var hZ=ke&&ke.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),fZ=ke&&ke.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),dZ=ke&&ke.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&hZ(e,i,t);return fZ(e,i),e},bP=ke&&ke.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ke,"__esModule",{value:!0});ke.PackSync=ke.Pack=ke.PackJob=void 0;var yf=bP(require("fs")),vE=SE(),Dc=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}};ke.PackJob=Dc;var pZ=te(),wE=dZ(vc()),mZ=gP(),gZ=zh(),yZ=Gh(),yP=Buffer.alloc(1024),ff=Symbol("onStat"),Nc=Symbol("ended"),Jt=Symbol("queue"),ro=Symbol("current"),Ps=Symbol("process"),Pc=Symbol("processing"),SP=Symbol("processJob"),Kt=Symbol("jobs"),_E=Symbol("jobDone"),df=Symbol("addFSEntry"),EP=Symbol("addTarEntry"),RE=Symbol("stat"),AE=Symbol("readdir"),pf=Symbol("onreaddir"),mf=Symbol("pipe"),wP=Symbol("entry"),bE=Symbol("entryOpt"),gf=Symbol("writeEntryClass"),IP=Symbol("write"),IE=Symbol("ondrain"),_P=bP(require("path")),OE=Zn(),Sf=class extends pZ.Minipass{static{o(this,"Pack")}opt;cwd;maxReadSize;preservePaths;strict;noPax;prefix;linkCache;statCache;file;portable;zip;readdirCache;noDirRecurse;follow;noMtime;mtime;filter;jobs;[gf];onWriteEntry;[Jt];[Kt]=0;[Pc]=!1;[Nc]=!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,OE.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[gf]=vE.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 wE.Gzip(e.gzip)),e.brotli&&(typeof e.brotli!="object"&&(e.brotli={}),this.zip=new wE.BrotliCompress(e.brotli)),e.zstd&&(typeof e.zstd!="object"&&(e.zstd={}),this.zip=new wE.ZstdCompress(e.zstd)),!this.zip)throw new Error("impossible");let t=this.zip;t.on("data",r=>super.write(r)),t.on("end",()=>super.end()),t.on("drain",()=>this[IE]()),this.on("resume",()=>t.resume())}else this.on("drain",this[IE]);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[Jt]=new mZ.Yallist,this[Kt]=0,this.jobs=Number(e.jobs)||4,this[Pc]=!1,this[Nc]=!1}[IP](e){return super.write(e)}add(e){return this.write(e),this}end(e,t,r){return typeof e=="function"&&(r=e,e=void 0),typeof t=="function"&&(r=t,t=void 0),e&&this.add(e),this[Nc]=!0,this[Ps](),r&&r(),this}write(e){if(this[Nc])throw new Error("write after end");return e instanceof gZ.ReadEntry?this[EP](e):this[df](e),this.flowing}[EP](e){let t=(0,OE.normalizeWindowsPath)(_P.default.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let r=new Dc(e.path,t);r.entry=new vE.WriteEntryTar(e,this[bE](r)),r.entry.on("end",()=>this[_E](r)),this[Kt]+=1,this[Jt].push(r)}this[Ps]()}[df](e){let t=(0,OE.normalizeWindowsPath)(_P.default.resolve(this.cwd,e));this[Jt].push(new Dc(e,t)),this[Ps]()}[RE](e){e.pending=!0,this[Kt]+=1;let t=this.follow?"stat":"lstat";yf.default[t](e.absolute,(r,s)=>{e.pending=!1,this[Kt]-=1,r?this.emit("error",r):this[ff](e,s)})}[ff](e,t){this.statCache.set(e.absolute,t),e.stat=t,this.filter(e.path,t)||(e.ignore=!0),this[Ps]()}[AE](e){e.pending=!0,this[Kt]+=1,yf.default.readdir(e.absolute,(t,r)=>{if(e.pending=!1,this[Kt]-=1,t)return this.emit("error",t);this[pf](e,r)})}[pf](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[Ps]()}[Ps](){if(!this[Pc]){this[Pc]=!0;for(let e=this[Jt].head;e&&this[Kt]<this.jobs;e=e.next)if(this[SP](e.value),e.value.ignore){let t=e.next;this[Jt].removeNode(e),e.next=t}this[Pc]=!1,this[Nc]&&!this[Jt].length&&this[Kt]===0&&(this.zip?this.zip.end(yP):(super.write(yP),super.end()))}}get[ro](){return this[Jt]&&this[Jt].head&&this[Jt].head.value}[_E](e){this[Jt].shift(),this[Kt]-=1,this[Ps]()}[SP](e){if(!e.pending){if(e.entry){e===this[ro]&&!e.piped&&this[mf](e);return}if(!e.stat){let t=this.statCache.get(e.absolute);t?this[ff](e,t):this[RE](e)}if(e.stat&&!e.ignore){if(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir){let t=this.readdirCache.get(e.absolute);if(t?this[pf](e,t):this[AE](e),!e.readdir)return}if(e.entry=this[wP](e),!e.entry){e.ignore=!0;return}e===this[ro]&&!e.piped&&this[mf](e)}}}[bE](e){return{onwarn:o((t,r,s)=>this.warn(t,r,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}}[wP](e){this[Kt]+=1;try{return new this[gf](e.path,this[bE](e)).on("end",()=>this[_E](e)).on("error",r=>this.emit("error",r))}catch(t){this.emit("error",t)}}[IE](){this[ro]&&this[ro].entry&&this[ro].entry.resume()}[mf](e){e.piped=!0,e.readdir&&e.readdir.forEach(s=>{let n=e.path,a=n==="./"?"":n.replace(/\/*$/,"/");this[df](a+s)});let t=e.entry,r=this.zip;if(!t)throw new Error("cannot pipe without source");r?t.on("data",s=>{r.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,r={}){(0,yZ.warnMethod)(this,e,t,r)}};ke.Pack=Sf;var TE=class extends Sf{static{o(this,"PackSync")}sync=!0;constructor(e){super(e),this[gf]=vE.WriteEntrySync}pause(){}resume(){}[RE](e){let t=this.follow?"statSync":"lstatSync";this[ff](e,yf.default[t](e.absolute))}[AE](e){this[pf](e,yf.default.readdirSync(e.absolute))}[mf](e){let t=e.entry,r=this.zip;if(e.readdir&&e.readdir.forEach(s=>{let n=e.path,a=n==="./"?"":n.replace(/\/*$/,"/");this[df](a+s)}),!t)throw new Error("Cannot pipe without source");r?t.on("data",s=>{r.write(s)}):t.on("data",s=>{super[IP](s)})}};ke.PackSync=TE});var CE=d(so=>{"use strict";var SZ=so&&so.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(so,"__esModule",{value:!0});so.create=void 0;var OP=zn(),vP=SZ(require("node:path")),RP=Qn(),EZ=Hn(),wf=Ef(),wZ=o((i,e)=>{let t=new wf.PackSync(i),r=new OP.WriteStreamSync(i.file,{mode:i.mode||438});t.pipe(r),AP(t,e)},"createFileSync"),_Z=o((i,e)=>{let t=new wf.Pack(i),r=new OP.WriteStream(i.file,{mode:i.mode||438});t.pipe(r);let s=new Promise((n,a)=>{r.on("error",a),r.on("close",n),t.on("error",a)});return TP(t,e),s},"createFile"),AP=o((i,e)=>{e.forEach(t=>{t.charAt(0)==="@"?(0,RP.list)({file:vP.default.resolve(i.cwd,t.slice(1)),sync:!0,noResume:!0,onReadEntry:o(r=>i.add(r),"onReadEntry")}):i.add(t)}),i.end()},"addFilesSync"),TP=o(async(i,e)=>{for(let t=0;t<e.length;t++){let r=String(e[t]);r.charAt(0)==="@"?await(0,RP.list)({file:vP.default.resolve(String(i.cwd),r.slice(1)),noResume:!0,onReadEntry:o(s=>{i.add(s)},"onReadEntry")}):i.add(r)}i.end()},"addFilesAsync"),bZ=o((i,e)=>{let t=new wf.PackSync(i);return AP(t,e),t},"createSync"),IZ=o((i,e)=>{let t=new wf.Pack(i);return TP(t,e),t},"createAsync");so.create=(0,EZ.makeCommand)(wZ,_Z,bZ,IZ,(i,e)=>{if(!e?.length)throw new TypeError("no paths specified to add to archive")})});var PP=d(no=>{"use strict";var OZ=no&&no.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(no,"__esModule",{value:!0});no.getWriteFlag=void 0;var CP=OZ(require("fs")),vZ=process.env.__FAKE_PLATFORM__||process.platform,RZ=vZ==="win32",{O_CREAT:AZ,O_TRUNC:TZ,O_WRONLY:CZ}=CP.default.constants,NP=Number(process.env.__FAKE_FS_O_FILENAME__)||CP.default.constants.UV_FS_O_FILEMAP||0,NZ=RZ&&!!NP,PZ=512*1024,DZ=NP|TZ|AZ|CZ;no.getWriteFlag=NZ?i=>i<PZ?DZ:"w":()=>"w"});var xP=d(Ei=>{"use strict";var DP=Ei&&Ei.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ei,"__esModule",{value:!0});Ei.chownrSync=Ei.chownr=void 0;var bf=DP(require("node:fs")),xc=DP(require("node:path")),NE=o((i,e,t)=>{try{return bf.default.lchownSync(i,e,t)}catch(r){if(r?.code!=="ENOENT")throw r}},"lchownSync"),_f=o((i,e,t,r)=>{bf.default.lchown(i,e,t,s=>{r(s&&s?.code!=="ENOENT"?s:null)})},"chown"),xZ=o((i,e,t,r,s)=>{if(e.isDirectory())(0,Ei.chownr)(xc.default.resolve(i,e.name),t,r,n=>{if(n)return s(n);let a=xc.default.resolve(i,e.name);_f(a,t,r,s)});else{let n=xc.default.resolve(i,e.name);_f(n,t,r,s)}},"chownrKid"),LZ=o((i,e,t,r)=>{bf.default.readdir(i,{withFileTypes:!0},(s,n)=>{if(s){if(s.code==="ENOENT")return r();if(s.code!=="ENOTDIR"&&s.code!=="ENOTSUP")return r(s)}if(s||!n.length)return _f(i,e,t,r);let a=n.length,c=null,u=o(l=>{if(!c){if(l)return r(c=l);if(--a===0)return _f(i,e,t,r)}},"then");for(let l of n)xZ(i,l,e,t,u)})},"chownr");Ei.chownr=LZ;var MZ=o((i,e,t,r)=>{e.isDirectory()&&(0,Ei.chownrSync)(xc.default.resolve(i,e.name),t,r),NE(xc.default.resolve(i,e.name),t,r)},"chownrKidSync"),BZ=o((i,e,t)=>{let r;try{r=bf.default.readdirSync(i,{withFileTypes:!0})}catch(s){let n=s;if(n?.code==="ENOENT")return;if(n?.code==="ENOTDIR"||n?.code==="ENOTSUP")return NE(i,e,t);throw n}for(let s of r)MZ(i,s,e,t);return NE(i,e,t)},"chownrSync");Ei.chownrSync=BZ});var LP=d(If=>{"use strict";Object.defineProperty(If,"__esModule",{value:!0});If.CwdError=void 0;var PE=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"}};If.CwdError=PE});var MP=d(Of=>{"use strict";Object.defineProperty(Of,"__esModule",{value:!0});Of.SymlinkError=void 0;var DE=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"}};Of.SymlinkError=DE});var jP=d(xr=>{"use strict";var LE=xr&&xr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(xr,"__esModule",{value:!0});xr.mkdirSync=xr.mkdir=void 0;var BP=xP(),dt=LE(require("node:fs")),kZ=LE(require("node:fs/promises")),vf=LE(require("node:path")),kP=LP(),er=Zn(),FP=MP(),FZ=o((i,e)=>{dt.default.stat(i,(t,r)=>{(t||!r.isDirectory())&&(t=new kP.CwdError(i,t?.code||"ENOTDIR")),e(t)})},"checkCwd"),UZ=o((i,e,t)=>{i=(0,er.normalizeWindowsPath)(i);let r=e.umask??18,s=e.mode|448,n=(s&r)!==0,a=e.uid,c=e.gid,u=typeof a=="number"&&typeof c=="number"&&(a!==e.processUid||c!==e.processGid),l=e.preserve,h=e.unlink,f=(0,er.normalizeWindowsPath)(e.cwd),p=o((g,S)=>{g?t(g):S&&u?(0,BP.chownr)(S,a,c,E=>p(E)):n?dt.default.chmod(i,s,t):t()},"done");if(i===f)return FZ(i,p);if(l)return kZ.default.mkdir(i,{mode:s,recursive:!0}).then(g=>p(null,g??void 0),p);let y=(0,er.normalizeWindowsPath)(vf.default.relative(f,i)).split("/");xE(f,y,s,h,f,void 0,p)},"mkdir");xr.mkdir=UZ;var xE=o((i,e,t,r,s,n,a)=>{if(!e.length)return a(null,n);let c=e.shift(),u=(0,er.normalizeWindowsPath)(vf.default.resolve(i+"/"+c));dt.default.mkdir(u,t,UP(u,e,t,r,s,n,a))},"mkdir_"),UP=o((i,e,t,r,s,n,a)=>c=>{c?dt.default.lstat(i,(u,l)=>{if(u)u.path=u.path&&(0,er.normalizeWindowsPath)(u.path),a(u);else if(l.isDirectory())xE(i,e,t,r,s,n,a);else if(r)dt.default.unlink(i,h=>{if(h)return a(h);dt.default.mkdir(i,t,UP(i,e,t,r,s,n,a))});else{if(l.isSymbolicLink())return a(new FP.SymlinkError(i,i+"/"+e.join("/")));a(c)}}):(n=n||i,xE(i,e,t,r,s,n,a))},"onmkdir"),jZ=o(i=>{let e=!1,t;try{e=dt.default.statSync(i).isDirectory()}catch(r){t=r?.code}finally{if(!e)throw new kP.CwdError(i,t??"ENOTDIR")}},"checkCwdSync"),$Z=o((i,e)=>{i=(0,er.normalizeWindowsPath)(i);let t=e.umask??18,r=e.mode|448,s=(r&t)!==0,n=e.uid,a=e.gid,c=typeof n=="number"&&typeof a=="number"&&(n!==e.processUid||a!==e.processGid),u=e.preserve,l=e.unlink,h=(0,er.normalizeWindowsPath)(e.cwd),f=o(g=>{g&&c&&(0,BP.chownrSync)(g,n,a),s&&dt.default.chmodSync(i,r)},"done");if(i===h)return jZ(h),f();if(u)return f(dt.default.mkdirSync(i,{mode:r,recursive:!0})??void 0);let m=(0,er.normalizeWindowsPath)(vf.default.relative(h,i)).split("/"),y;for(let g=m.shift(),S=h;g&&(S+="/"+g);g=m.shift()){S=(0,er.normalizeWindowsPath)(vf.default.resolve(S));try{dt.default.mkdirSync(S,r),y=y||S}catch{let _=dt.default.lstatSync(S);if(_.isDirectory())continue;if(l){dt.default.unlinkSync(S),dt.default.mkdirSync(S,r),y=y||S;continue}else if(_.isSymbolicLink())return new FP.SymlinkError(S,S+"/"+m.join("/"))}}return f(y)},"mkdirSync");xr.mkdirSync=$Z});var qP=d(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0});Rf.normalizeUnicode=void 0;var ME=Object.create(null),$P=1e4,oo=new Set,qZ=o(i=>{oo.has(i)?oo.delete(i):ME[i]=i.normalize("NFD"),oo.add(i);let e=ME[i],t=oo.size-$P;if(t>$P/10){for(let r of oo)if(oo.delete(r),delete ME[r],--t<=0)break}return e},"normalizeUnicode");Rf.normalizeUnicode=qZ});var zP=d(Af=>{"use strict";Object.defineProperty(Af,"__esModule",{value:!0});Af.PathReservations=void 0;var VP=require("node:path"),VZ=qP(),zZ=rf(),HZ=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,GZ=HZ==="win32",WZ=o(i=>i.split("/").slice(0,-1).reduce((t,r)=>{let s=t[t.length-1];return s!==void 0&&(r=(0,VP.join)(s,r)),t.push(r||"/"),t},[]),"getDirs"),BE=class{static{o(this,"PathReservations")}#e=new Map;#t=new Map;#i=new Set;reserve(e,t){e=GZ?["win32 parallelization disabled"]:e.map(s=>(0,zZ.stripTrailingSlashes)((0,VP.join)((0,VZ.normalizeUnicode)(s))).toLowerCase());let r=new Set(e.map(s=>WZ(s)).reduce((s,n)=>s.concat(n)));this.#t.set(t,{dirs:r,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 r){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)}#r(e){let t=this.#t.get(e);if(!t)throw new Error("function does not have any path reservations");return{paths:t.paths.map(r=>this.#e.get(r)),dirs:[...t.dirs].map(r=>this.#e.get(r))}}check(e){let{paths:t,dirs:r}=this.#r(e);return t.every(s=>s&&s[0]===e)&&r.every(s=>s&&s[0]instanceof Set&&s[0].has(e))}#s(e){return this.#i.has(e)||!this.check(e)?!1:(this.#i.add(e),e(()=>this.#u(e)),!0)}#u(e){if(!this.#i.has(e))return!1;let t=this.#t.get(e);if(!t)throw new Error("invalid reservation");let{paths:r,dirs:s}=t,n=new Set;for(let a of r){let c=this.#e.get(a);if(!c||c?.[0]!==e)continue;let u=c[1];if(!u){this.#e.delete(a);continue}if(c.shift(),typeof u=="function")n.add(u);else for(let l of u)n.add(l)}for(let a of s){let c=this.#e.get(a),u=c?.[0];if(!(!c||!(u instanceof Set)))if(u.size===1&&c.length===1){this.#e.delete(a);continue}else if(u.size===1){c.shift();let l=c[0];typeof l=="function"&&n.add(l)}else u.delete(e)}return this.#i.delete(e),n.forEach(a=>this.#s(a)),!0}};Af.PathReservations=BE});var GE=d(et=>{"use strict";var JZ=et&&et.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),KZ=et&&et.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),eD=et&&et.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&JZ(e,i,t);return KZ(e,i),e},HE=et&&et.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(et,"__esModule",{value:!0});et.UnpackSync=et.Unpack=void 0;var ZZ=eD(zn()),YZ=HE(require("node:assert")),tD=require("node:crypto"),H=HE(require("node:fs")),tr=HE(require("node:path")),iD=PP(),rD=jP(),Zt=Zn(),XZ=ef(),QZ=nE(),HP=eD(aE()),eY=zP(),GP=Symbol("onEntry"),UE=Symbol("checkFs"),WP=Symbol("checkFs2"),jE=Symbol("isReusable"),At=Symbol("makeFs"),$E=Symbol("file"),qE=Symbol("directory"),Nf=Symbol("link"),JP=Symbol("symlink"),KP=Symbol("hardlink"),ZP=Symbol("unsupported"),YP=Symbol("checkPath"),Lr=Symbol("mkdir"),Fe=Symbol("onError"),Tf=Symbol("pending"),XP=Symbol("pend"),ao=Symbol("unpend"),kE=Symbol("ended"),FE=Symbol("maybeClose"),VE=Symbol("skip"),Lc=Symbol("doChown"),Mc=Symbol("uid"),Bc=Symbol("gid"),kc=Symbol("checkedCwd"),tY=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Fc=tY==="win32",iY=1024,rY=o((i,e)=>{if(!Fc)return H.default.unlink(i,e);let t=i+".DELETE."+(0,tD.randomBytes)(16).toString("hex");H.default.rename(i,t,r=>{if(r)return e(r);H.default.unlink(t,e)})},"unlinkFile"),sY=o(i=>{if(!Fc)return H.default.unlinkSync(i);let e=i+".DELETE."+(0,tD.randomBytes)(16).toString("hex");H.default.renameSync(i,e),H.default.unlinkSync(e)},"unlinkFileSync"),QP=o((i,e,t)=>i!==void 0&&i===i>>>0?i:e!==void 0&&e===e>>>0?e:t,"uint32"),Pf=class extends XZ.Parser{static{o(this,"Unpack")}[kE]=!1;[kc]=!1;[Tf]=0;reservations=new eY.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[kE]=!0,this[FE]()},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:iY,this.forceChown=e.forceChown===!0,this.win32=!!e.win32||Fc,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=(0,Zt.normalizeWindowsPath)(tr.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[GP](t))}warn(e,t,r={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(r.recoverable=!1),super.warn(e,t,r)}[FE](){this[kE]&&this[Tf]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[YP](e){let t=(0,Zt.normalizeWindowsPath)(e.path),r=t.split("/");if(this.strip){if(r.length<this.strip)return!1;if(e.type==="Link"){let s=(0,Zt.normalizeWindowsPath)(String(e.linkpath)).split("/");if(s.length>=this.strip)e.linkpath=s.slice(this.strip).join("/");else return!1}r.splice(0,this.strip),e.path=r.join("/")}if(isFinite(this.maxDepth)&&r.length>this.maxDepth)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:e,path:t,depth:r.length,maxDepth:this.maxDepth}),!1;if(!this.preservePaths){if(r.includes("..")||Fc&&/^[a-z]:\.\.$/i.test(r[0]??""))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:e,path:t}),!1;let[s,n]=(0,QZ.stripAbsolutePath)(t);s&&(e.path=String(n),this.warn("TAR_ENTRY_INFO",`stripping ${s} from absolute path`,{entry:e,path:t}))}if(tr.default.isAbsolute(e.path)?e.absolute=(0,Zt.normalizeWindowsPath)(tr.default.resolve(e.path)):e.absolute=(0,Zt.normalizeWindowsPath)(tr.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,Zt.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}=tr.default.win32.parse(String(e.absolute));e.absolute=s+HP.encode(String(e.absolute).slice(s.length));let{root:n}=tr.default.win32.parse(e.path);e.path=n+HP.encode(e.path.slice(n.length))}return!0}[GP](e){if(!this[YP](e))return e.resume();switch(YZ.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[UE](e);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[ZP](e)}}[Fe](e,t){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:t}),this[ao](),t.resume())}[Lr](e,t,r){(0,rD.mkdir)((0,Zt.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},r)}[Lc](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}[Mc](e){return QP(this.uid,e.uid,this.processUid)}[Bc](e){return QP(this.gid,e.gid,this.processGid)}[$E](e,t){let r=typeof e.mode=="number"?e.mode&4095:this.fmode,s=new ZZ.WriteStream(String(e.absolute),{flags:(0,iD.getWriteFlag)(e.size),mode:r,autoClose:!1});s.on("error",u=>{s.fd&&H.default.close(s.fd,()=>{}),s.write=()=>!0,this[Fe](u,e),t()});let n=1,a=o(u=>{if(u){s.fd&&H.default.close(s.fd,()=>{}),this[Fe](u,e),t();return}--n===0&&s.fd!==void 0&&H.default.close(s.fd,l=>{l?this[Fe](l,e):this[ao](),t()})},"done");s.on("finish",()=>{let u=String(e.absolute),l=s.fd;if(typeof l=="number"&&e.mtime&&!this.noMtime){n++;let h=e.atime||new Date,f=e.mtime;H.default.futimes(l,h,f,p=>p?H.default.utimes(u,h,f,m=>a(m&&p)):a())}if(typeof l=="number"&&this[Lc](e)){n++;let h=this[Mc](e),f=this[Bc](e);typeof h=="number"&&typeof f=="number"&&H.default.fchown(l,h,f,p=>p?H.default.chown(u,h,f,m=>a(m&&p)):a())}a()});let c=this.transform&&this.transform(e)||e;c!==e&&(c.on("error",u=>{this[Fe](u,e),t()}),e.pipe(c)),c.pipe(s)}[qE](e,t){let r=typeof e.mode=="number"?e.mode&4095:this.dmode;this[Lr](String(e.absolute),r,s=>{if(s){this[Fe](s,e),t();return}let n=1,a=o(()=>{--n===0&&(t(),this[ao](),e.resume())},"done");e.mtime&&!this.noMtime&&(n++,H.default.utimes(String(e.absolute),e.atime||new Date,e.mtime,a)),this[Lc](e)&&(n++,H.default.chown(String(e.absolute),Number(this[Mc](e)),Number(this[Bc](e)),a)),a()})}[ZP](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[JP](e,t){this[Nf](e,String(e.linkpath),"symlink",t)}[KP](e,t){let r=(0,Zt.normalizeWindowsPath)(tr.default.resolve(this.cwd,String(e.linkpath)));this[Nf](e,r,"link",t)}[XP](){this[Tf]++}[ao](){this[Tf]--,this[FE]()}[VE](e){this[ao](),e.resume()}[jE](e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&!Fc}[UE](e){this[XP]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,r=>this[WP](e,r))}[WP](e,t){let r=o(c=>{t(c)},"done"),s=o(()=>{this[Lr](this.cwd,this.dmode,c=>{if(c){this[Fe](c,e),r();return}this[kc]=!0,n()})},"checkCwd"),n=o(()=>{if(e.absolute!==this.cwd){let c=(0,Zt.normalizeWindowsPath)(tr.default.dirname(String(e.absolute)));if(c!==this.cwd)return this[Lr](c,this.dmode,u=>{if(u){this[Fe](u,e),r();return}a()})}a()},"start"),a=o(()=>{H.default.lstat(String(e.absolute),(c,u)=>{if(u&&(this.keep||this.newer&&u.mtime>(e.mtime??u.mtime))){this[VE](e),r();return}if(c||this[jE](e,u))return this[At](null,e,r);if(u.isDirectory()){if(e.type==="Directory"){let l=this.chmod&&e.mode&&(u.mode&4095)!==e.mode,h=o(f=>this[At](f??null,e,r),"afterChmod");return l?H.default.chmod(String(e.absolute),Number(e.mode),h):h()}if(e.absolute!==this.cwd)return H.default.rmdir(String(e.absolute),l=>this[At](l??null,e,r))}if(e.absolute===this.cwd)return this[At](null,e,r);rY(String(e.absolute),l=>this[At](l??null,e,r))})},"afterMakeParent");this[kc]?n():s()}[At](e,t,r){if(e){this[Fe](e,t),r();return}switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[$E](t,r);case"Link":return this[KP](t,r);case"SymbolicLink":return this[JP](t,r);case"Directory":case"GNUDumpDir":return this[qE](t,r)}}[Nf](e,t,r,s){H.default[r](t,String(e.absolute),n=>{n?this[Fe](n,e):(this[ao](),e.resume()),s()})}};et.Unpack=Pf;var Cf=o(i=>{try{return[null,i()]}catch(e){return[e,null]}},"callSync"),zE=class extends Pf{static{o(this,"UnpackSync")}sync=!0;[At](e,t){return super[At](e,t,()=>{})}[UE](e){if(!this[kc]){let n=this[Lr](this.cwd,this.dmode);if(n)return this[Fe](n,e);this[kc]=!0}if(e.absolute!==this.cwd){let n=(0,Zt.normalizeWindowsPath)(tr.default.dirname(String(e.absolute)));if(n!==this.cwd){let a=this[Lr](n,this.dmode);if(a)return this[Fe](a,e)}}let[t,r]=Cf(()=>H.default.lstatSync(String(e.absolute)));if(r&&(this.keep||this.newer&&r.mtime>(e.mtime??r.mtime)))return this[VE](e);if(t||this[jE](e,r))return this[At](null,e);if(r.isDirectory()){if(e.type==="Directory"){let a=this.chmod&&e.mode&&(r.mode&4095)!==e.mode,[c]=a?Cf(()=>{H.default.chmodSync(String(e.absolute),Number(e.mode))}):[];return this[At](c,e)}let[n]=Cf(()=>H.default.rmdirSync(String(e.absolute)));this[At](n,e)}let[s]=e.absolute===this.cwd?[]:Cf(()=>sY(String(e.absolute)));this[At](s,e)}[$E](e,t){let r=typeof e.mode=="number"?e.mode&4095:this.fmode,s=o(c=>{let u;try{H.default.closeSync(n)}catch(l){u=l}(c||u)&&this[Fe](c||u,e),t()},"oner"),n;try{n=H.default.openSync(String(e.absolute),(0,iD.getWriteFlag)(e.size),r)}catch(c){return s(c)}let a=this.transform&&this.transform(e)||e;a!==e&&(a.on("error",c=>this[Fe](c,e)),e.pipe(a)),a.on("data",c=>{try{H.default.writeSync(n,c,0,c.length)}catch(u){s(u)}}),a.on("end",()=>{let c=null;if(e.mtime&&!this.noMtime){let u=e.atime||new Date,l=e.mtime;try{H.default.futimesSync(n,u,l)}catch(h){try{H.default.utimesSync(String(e.absolute),u,l)}catch{c=h}}}if(this[Lc](e)){let u=this[Mc](e),l=this[Bc](e);try{H.default.fchownSync(n,Number(u),Number(l))}catch(h){try{H.default.chownSync(String(e.absolute),Number(u),Number(l))}catch{c=c||h}}}s(c)})}[qE](e,t){let r=typeof e.mode=="number"?e.mode&4095:this.dmode,s=this[Lr](String(e.absolute),r);if(s){this[Fe](s,e),t();return}if(e.mtime&&!this.noMtime)try{H.default.utimesSync(String(e.absolute),e.atime||new Date,e.mtime)}catch{}if(this[Lc](e))try{H.default.chownSync(String(e.absolute),Number(this[Mc](e)),Number(this[Bc](e)))}catch{}t(),e.resume()}[Lr](e,t){try{return(0,rD.mkdirSync)((0,Zt.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(r){return r}}[Nf](e,t,r,s){let n=`${r}Sync`;try{H.default[n](t,String(e.absolute)),s(),e.resume()}catch(a){return this[Fe](a,e)}}};et.UnpackSync=zE});var WE=d(Tt=>{"use strict";var nY=Tt&&Tt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),oY=Tt&&Tt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),aY=Tt&&Tt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&nY(e,i,t);return oY(e,i),e},cY=Tt&&Tt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Tt,"__esModule",{value:!0});Tt.extract=void 0;var sD=aY(zn()),nD=cY(require("node:fs")),uY=Qn(),lY=Hn(),Df=GE(),hY=o(i=>{let e=new Df.UnpackSync(i),t=i.file,r=nD.default.statSync(t),s=i.maxReadSize||16*1024*1024;new sD.ReadStreamSync(t,{readSize:s,size:r.size}).pipe(e)},"extractFileSync"),fY=o((i,e)=>{let t=new Df.Unpack(i),r=i.maxReadSize||16*1024*1024,s=i.file;return new Promise((a,c)=>{t.on("error",c),t.on("close",a),nD.default.stat(s,(u,l)=>{if(u)c(u);else{let h=new sD.ReadStream(s,{readSize:r,size:l.size});h.on("error",c),h.pipe(t)}})})},"extractFile");Tt.extract=(0,lY.makeCommand)(hY,fY,i=>new Df.UnpackSync(i),i=>new Df.Unpack(i),(i,e)=>{e?.length&&(0,uY.filesFilter)(i,e)})});var xf=d(co=>{"use strict";var oD=co&&co.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(co,"__esModule",{value:!0});co.replace=void 0;var aD=zn(),pt=oD(require("node:fs")),cD=oD(require("node:path")),uD=Kn(),lD=Qn(),dY=Hn(),pY=Mh(),hD=Ef(),mY=o((i,e)=>{let t=new hD.PackSync(i),r=!0,s,n;try{try{s=pt.default.openSync(i.file,"r+")}catch(u){if(u?.code==="ENOENT")s=pt.default.openSync(i.file,"w+");else throw u}let a=pt.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=pt.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 u=new uD.Header(c);if(!u.cksumValid)break;let l=512*Math.ceil((u.size||0)/512);if(n+l+512>a.size)break;n+=l,i.mtimeCache&&u.mtime&&i.mtimeCache.set(String(u.path),u.mtime)}r=!1,gY(i,t,n,s,e)}finally{if(r)try{pt.default.closeSync(s)}catch{}}},"replaceSync"),gY=o((i,e,t,r,s)=>{let n=new aD.WriteStreamSync(i.file,{fd:r,start:t});e.pipe(n),SY(e,s)},"streamSync"),yY=o((i,e)=>{e=Array.from(e);let t=new hD.Pack(i),r=o((n,a,c)=>{let u=o((m,y)=>{m?pt.default.close(n,g=>c(m)):c(null,y)},"cb"),l=0;if(a===0)return u(null,0);let h=0,f=Buffer.alloc(512),p=o((m,y)=>{if(m||typeof y>"u")return u(m);if(h+=y,h<512&&y)return pt.default.read(n,f,h,f.length-h,l+h,p);if(l===0&&f[0]===31&&f[1]===139)return u(new Error("cannot append to compressed archives"));if(h<512)return u(null,l);let g=new uD.Header(f);if(!g.cksumValid)return u(null,l);let S=512*Math.ceil((g.size??0)/512);if(l+S+512>a||(l+=S+512,l>=a))return u(null,l);i.mtimeCache&&g.mtime&&i.mtimeCache.set(String(g.path),g.mtime),h=0,pt.default.read(n,f,0,512,l,p)},"onread");pt.default.read(n,f,0,512,l,p)},"getPos");return new Promise((n,a)=>{t.on("error",a);let c="r+",u=o((l,h)=>{if(l&&l.code==="ENOENT"&&c==="r+")return c="w+",pt.default.open(i.file,c,u);if(l||!h)return a(l);pt.default.fstat(h,(f,p)=>{if(f)return pt.default.close(h,()=>a(f));r(h,p.size,(m,y)=>{if(m)return a(m);let g=new aD.WriteStream(i.file,{fd:h,start:y});t.pipe(g),g.on("error",a),g.on("close",n),EY(t,e)})})},"onopen");pt.default.open(i.file,c,u)})},"replaceAsync"),SY=o((i,e)=>{e.forEach(t=>{t.charAt(0)==="@"?(0,lD.list)({file:cD.default.resolve(i.cwd,t.slice(1)),sync:!0,noResume:!0,onReadEntry:o(r=>i.add(r),"onReadEntry")}):i.add(t)}),i.end()},"addFilesSync"),EY=o(async(i,e)=>{for(let t=0;t<e.length;t++){let r=String(e[t]);r.charAt(0)==="@"?await(0,lD.list)({file:cD.default.resolve(String(i.cwd),r.slice(1)),noResume:!0,onReadEntry:o(s=>i.add(s),"onReadEntry")}):i.add(r)}i.end()},"addFilesAsync");co.replace=(0,dY.makeCommand)(mY,yY,()=>{throw new TypeError("file is required")},()=>{throw new TypeError("file is required")},(i,e)=>{if(!(0,pY.isFile)(i))throw new TypeError("file is required");if(i.gzip||i.brotli||i.zstd||i.file.endsWith(".br")||i.file.endsWith(".tbr"))throw new TypeError("cannot append to compressed archives");if(!e?.length)throw new TypeError("no paths specified to add/replace")})});var JE=d(Lf=>{"use strict";Object.defineProperty(Lf,"__esModule",{value:!0});Lf.update=void 0;var wY=Hn(),Uc=xf();Lf.update=(0,wY.makeCommand)(Uc.replace.syncFile,Uc.replace.asyncFile,Uc.replace.syncNoFile,Uc.replace.asyncNoFile,(i,e=[])=>{Uc.replace.validate?.(i,e),_Y(i)});var _Y=o(i=>{let e=i.filter;i.mtimeCache||(i.mtimeCache=new Map),i.filter=e?(t,r)=>e(t,r)&&!((i.mtimeCache?.get(t)??r.mtime??0)>(r.mtime??0)):(t,r)=>!((i.mtimeCache?.get(t)??r.mtime??0)>(r.mtime??0))},"mtimeFilter")});var KE=d(V=>{"use strict";var fD=V&&V.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),bY=V&&V.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Ct=V&&V.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&fD(e,i,t)},IY=V&&V.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&fD(e,i,t);return bY(e,i),e};Object.defineProperty(V,"__esModule",{value:!0});V.u=V.types=V.r=V.t=V.x=V.c=void 0;Ct(CE(),V);var OY=CE();Object.defineProperty(V,"c",{enumerable:!0,get:o(function(){return OY.create},"get")});Ct(WE(),V);var vY=WE();Object.defineProperty(V,"x",{enumerable:!0,get:o(function(){return vY.extract},"get")});Ct(Kn(),V);Ct(Qn(),V);var RY=Qn();Object.defineProperty(V,"t",{enumerable:!0,get:o(function(){return RY.list},"get")});Ct(Ef(),V);Ct(ef(),V);Ct(jh(),V);Ct(zh(),V);Ct(xf(),V);var AY=xf();Object.defineProperty(V,"r",{enumerable:!0,get:o(function(){return AY.replace},"get")});V.types=IY(zS());Ct(GE(),V);Ct(JE(),V);var TY=JE();Object.defineProperty(V,"u",{enumerable:!0,get:o(function(){return TY.update},"get")});Ct(SE(),V)});var Ds=d((Pge,dD)=>{dD.exports={cacheFetches:Symbol.for("pacote.Fetcher._cacheFetches"),readPackageJson:Symbol.for("package.Fetcher._readPackageJson"),tarballFromResolved:Symbol.for("pacote.Fetcher._tarballFromResolved")}});var mD=d((Dge,pD)=>{var{resolve:ZE}=require("node:path"),{tmpdir:CY,homedir:NY}=require("node:os");pD.exports=(i=!1)=>{let e=CY(),t=process.getuid?process.getuid():process.pid,r=NY()||ZE(e,"npm-"+t),s=i||process.platform,n=s==="win32"?"npm-cache":".npm",a=s==="win32"&&process.env.LOCALAPPDATA||r;return{cacache:ZE(a,n,"_cacache"),tufcache:ZE(a,n,"_tuf")}}});var YE=d((xge,gD)=>{var PY=o((i,e)=>typeof e=="string"?{[i]:e}:e,"binObj"),DY=o((i,e)=>{let t=PY(i.name,i.bin),r=e.replace(/^[^\\/]*\//,"");for(let s of Object.entries(t))if(s[1]===r)return!0;return!1},"hasBin");gD.exports=(i,e)=>i&&i.bin?DY(i,e):!1});var XE=d((Mge,yD)=>{var xY=o(i=>{let e=i;for(;e.endsWith("/");)e=e.slice(0,-1);return e},"removeTrailingSlashes");yD.exports=xY});var ED=d((kge,SD)=>{"use strict";var Mr=require("fs"),QE=require("path"),LY=require("events").EventEmitter,MY=Mi().Minimatch,jc=class i extends LY{static{o(this,"Walker")}constructor(e){e=e||{},super(e),this.isSymbolicLink=e.isSymbolicLink,this.path=e.path||process.cwd(),this.basename=QE.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 r=!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?r=this.parent.emit("error",t):r=super.emit(e,t)),r}start(){return Mr.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(r=>this.isIgnoreFile(r))?this.addIgnoreFiles():this.filterEntries()}addIgnoreFiles(){let e=this.entries.filter(s=>this.isIgnoreFile(s)),t=e.length,r=o(()=>{--t===0&&this.filterEntries()},"then");e.forEach(s=>this.addIgnoreFile(s,r))}addIgnoreFile(e,t){let r=QE.resolve(this.path,e);Mr.readFile(r,"utf8",(s,n)=>s?this.emit("error",s):this.onReadIgnoreFile(e,n,t))}onReadIgnoreFile(e,t,r){let s={matchBase:!0,dot:!0,flipNegate:!0,nocase:!0},n=t.split(/\r?\n/).filter(a=>!/^#|^$/.test(a.trim())).map(a=>new MY(a.trim(),s));this.ignoreRules[e]=n,r()}filterEntries(){let e=this.entries.map(r=>{let s=this.filterEntry(r),n=this.filterEntry(r,!0);return s||n?[r,s,n]:!1}).filter(r=>r),t=e.length;if(t===0)this.emit("done",this.result);else{let r=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},r)})}}onstat({st:e,entry:t,file:r,dir:s,isSymbolicLink:n},a){let c=this.path+"/"+t;e.isDirectory()?s?this.walker(t,{isSymbolicLink:n,exact:r||this.filterEntry(t+"/")},a):a():(r&&this.result.add(c.slice(this.root.length+1)),a())}stat({entry:e,file:t,dir:r},s){let n=this.path+"/"+e;Mr.lstat(n,(a,c)=>{if(a)this.emit("error",a);else{let u=c.isSymbolicLink();this.follow&&u?Mr.stat(n,(l,h)=>{l?this.emit("error",l):this.onstat({st:h,entry:e,file:t,dir:r,isSymbolicLink:u},s)}):this.onstat({st:c,entry:e,file:t,dir:r,isSymbolicLink:u},s)}})}walkerOpt(e,t){return{path:this.path+"/"+e,parent:this,ignoreFiles:this.ignoreFiles,follow:this.follow,includeEmpty:this.includeEmpty,...t}}walker(e,t,r){new i(this.walkerOpt(e,t)).on("done",r).start()}filterEntry(e,t,r){let s=!0;if(this.parent&&this.parent.filterEntry){let n=this.basename+"/"+e,a=r||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=r&&a.globParts.some(l=>l.length<=(l.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("/"+r+"/")||a.match(r+"/")||a.negate&&(a.match("/"+r,!0)||a.match(r,!0)))))&&(s=a.negate)}})}),s}},Mf=class i extends jc{static{o(this,"WalkerSync")}start(){return this.onReaddir(Mr.readdirSync(this.path)),this}addIgnoreFile(e,t){let r=QE.resolve(this.path,e);this.onReadIgnoreFile(e,Mr.readFileSync(r,"utf8"),t)}stat({entry:e,file:t,dir:r},s){let n=this.path+"/"+e,a=Mr.lstatSync(n),c=a.isSymbolicLink();this.follow&&c&&(a=Mr.statSync(n)),this.onstat({st:a,entry:e,file:t,dir:r,isSymbolicLink:c},s)}walker(e,t,r){new i(this.walkerOpt(e,t)).start(),r()}},Bf=o((i,e)=>{let t=new Promise((r,s)=>{new jc(i).on("done",r).on("error",s).start()});return e?t.then(r=>e(null,r),e):t},"walk"),BY=o(i=>new Mf(i).start().result,"walkSync");SD.exports=Bf;Bf.sync=BY;Bf.Walker=jc;Bf.WalkerSync=Mf});var RD=d((Uge,vD)=>{"use strict";var{Walker:kY}=ED(),{lstatSync:FY,readFileSync:UY}=require("fs"),{basename:wD,dirname:jY,extname:_D,join:ho,relative:lo,resolve:$Y,sep:qY}=require("path"),{log:VY}=St(),$c=Symbol("npm-packlist.rules.default"),uo=Symbol("npm-packlist.rules.strict"),zY=o(i=>/\*/.test(i),"nameIsBadForWindows"),HY=[".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/**"],bD=["/.git"],kf=o(i=>i.split("\\").join("/"),"normalizePath"),ID=o((i,e,t=[])=>{for(let a of[".npmignore",".gitignore"])try{let c=UY(ho(i,a),{encoding:"utf8"});t.push(c);break}catch(c){if(c.code!=="ENOENT")throw c}if(!e)return t;let r=e.split(qY,1)[0],s=ho(i,r),n=lo(s,ho(i,e));return ID(s,n,t)},"readOutOfTreeIgnoreFiles"),Ff=class i extends kY{static{o(this,"PackWalker")}constructor(e,t){let r={...t,includeEmpty:!1,follow:!1,path:$Y(t?.path||e.path).replace(/\\/g,"/"),ignoreFiles:t?.ignoreFiles||[$c,"package.json",".npmignore",".gitignore",uo]};super(r),this.isPackage=r.isPackage,this.seen=r.seen||new Set,this.tree=e,this.requiredFiles=r.requiredFiles||[];let s=[];if(r.prefix&&r.workspaces){let n=kf(r.path),a=kf(r.prefix),c=r.workspaces.map(u=>kf(u));if(n!==a&&c.includes(n)){let u=lo(r.prefix,jY(r.path));s.push(...ID(r.prefix,u))}else n===a&&s.push(...c.map(u=>kf(lo(r.path,u))))}this.injectRules($c,[...HY,...s]),this.isPackage||this.injectRules(uo,[...bD,...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"]&&VY.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 zY(e.entry)?t():super.stat(e,t)}walkerOpt(e,t){let r=null;if(this.tree.workspaces){let s=[...this.tree.workspaces.values()].map(a=>a.replace(/\\/g,"/")),n=ho(this.path,e).replace(/\\/g,"/");s.includes(n)&&(r=[$c,"package.json",".npmignore",".gitignore",uo])}else r=[$c,".npmignore",".gitignore",uo];return{...super.walkerOpt(e,t),ignoreFiles:r,requiredFiles:this.requiredFiles.map(s=>lo(s,e)===".."?lo(e,s).replace(/\\/g,"/"):!1).filter(Boolean)}}walker(e,t,r){new i(this.tree,this.walkerOpt(e,t)).on("done",r).start()}sort(e,t){let r=_D(e).toLowerCase(),s=_D(t).toLowerCase(),n=wD(e).toLowerCase(),a=wD(t).toLowerCase();return r.localeCompare(s,"en")||n.localeCompare(a,"en")||e.localeCompare(t,"en")}injectRules(e,t,r=()=>{}){this.onReadIgnoreFile(e,`${t.join(`
31
32
  `)}
32
- `,r)}processPackage(e){let{bin:t,browser:r,files:s,main:n}=this.tree.package,a=[],c=[...bD,"!/package.json","!/readme{,.*[^~$]}","!/copying{,.*[^~$]}","!/license{,.*[^~$]}","!/licence{,.*[^~$]}","/.git","/node_modules",".npmrc","/package-lock.json","/yarn.lock","/pnpm-lock.yaml","/bun.lockb"];if(s){for(let u of s){u.startsWith("./")&&(u=u.slice(1)),u.endsWith("/*")&&(u+="*");let l=`!${u}`;try{let h=BY(ho(this.path,u.replace(/^!+/,"")).replace(/\\/g,"/"));h.isFile()?(c.unshift(l),this.requiredFiles.push(u.startsWith("/")?u.slice(1):u)):h.isDirectory()&&(a.push(l),a.push(`${l}/**`))}catch{a.push(l)}}this.injectRules("package.json",["*",...a])}if(r&&c.push(`!/${r}`),n&&c.push(`!/${n}`),t)for(let u in t)c.push(`!/${t[u]}`);this.injectRules(uo,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:r}=this.tree.package;e=Object.keys(t||{}).concat(Object.keys(r||{}))}for(let t of e){let r=this.tree.edgesOut.get(t);if(!r||r.peer||r.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($c),c.ignoreFiles.push("package.json"),s.isLink&&(c.ignoreFiles.push(".npmignore"),c.ignoreFiles.push(".gitignore")),c.ignoreFiles.push(uo);let u=new i(a,c),l=await new Promise((f,p)=>{u.on("error",p),u.on("done",f),u.start()}),h=lo(this.root,u.path);for(let f of l)this.result.add(ho(h,f).replace(/\\/g,"/"))}}},OD=o((i,e,t)=>{typeof e=="function"&&(t=e,e={});let r=new Promise((s,n)=>{new Ff(i,{...e,isPackage:!0}).on("done",s).on("error",n).start()});return t?r.then(s=>t(null,s),t):r},"walk");vD.exports=OD;OD.Walker=Ff});var CD=d((Uge,TD)=>{var{resolve:AD,dirname:zY,delimiter:ew}=require("path"),HY=AD(__dirname,"../lib/node-gyp-bin"),GY=o((i,e,t)=>{let r=Object.keys(t).filter(u=>/^path$/i.test(u)&&t[u]).map(u=>t[u].split(ew)).reduce((u,l)=>u.concat(l.filter(h=>!u.includes(h))),[]).join(ew),s=[];e&&s.push(...e);let n=i,a;do s.push(AD(n,"node_modules",".bin")),a=n,n=zY(n);while(n!==a);s.push(HY,r);let c=s.join(ew);for(let u of Object.keys(t))/^path$/i.test(u)&&(t[u]=c);return t},"setPATH");TD.exports=GY});var PD=d(($ge,ND)=>{var WY=CD(),{resolve:JY}=require("path"),Uf,KY=o(i=>{let{args:e,binPaths:t,cmd:r,env:s,event:n,nodeGyp:a,path:c,scriptShell:u=!0,stdio:l,stdioString:h}=i;a?Uf=a:s.npm_config_node_gyp?Uf=s.npm_config_node_gyp:Uf=require.resolve("node-gyp/bin/node-gyp.js");let p={env:WY(c,t,{...process.env,...s,npm_package_json:JY(c,"package.json"),npm_lifecycle_event:n,npm_lifecycle_script:r,npm_config_node_gyp:Uf}),stdioString:h,stdio:l,cwd:c,shell:u};return[r,e,p]},"makeSpawnArgs");ND.exports=KY});var xD=d((Vge,DD)=>{var tw=o((i,e,t={})=>{for(let[r,s]of Object.entries(i))s!==void 0&&(s===null||s===!1?t[`${e}${r}`]="":Array.isArray(s)?s.forEach((n,a)=>{tw({[`${r}_${a}`]:n},`${e}`,t)}):typeof s=="object"?tw(s,`${e}${r}_`,t):t[`${e}${r}`]=String(s));return t},"packageEnvs");DD.exports=i=>tw({name:i.name,version:i.version,config:i.config,engines:i.engines,bin:i.bin},"npm_package_")});var BD=d((Hge,MD)=>{var ZY=require("util"),LD=require("fs"),{stat:YY}=LD.promises||{stat:ZY.promisify(LD.stat)};async function XY(i){return await YY(`${i}/binding.gyp`).then(e=>e.isFile()).catch(()=>!1)}o(XY,"isNodeGypPackage");MD.exports={isNodeGypPackage:XY,defaultGypInstallScript:"node-gyp rebuild"}});var FD=d((Wge,kD)=>{var jf=new Set,iw=!1,rw=["SIGINT","SIGTERM"],sw=o(i=>{for(let e of jf)e.kill(i)},"handleSignal"),QY=o(()=>{for(let i of rw)process.on(i,sw);iw=!0},"setupListeners"),eX=o(()=>{if(jf.size===0){for(let i of rw)process.removeListener(i,sw);iw=!1}},"cleanupListeners"),tX=o(i=>{jf.add(i),iw||QY(),i.once("exit",()=>{jf.delete(i),eX()})},"add");kD.exports={add:tX,handleSignal:sw,forwardedSignals:rw}});var nw=d((Kge,UD)=>{var{stat:iX}=require("node:fs/promises"),{resolve:rX}=require("node:path");UD.exports=async i=>{try{return(await iX(rX(i,"server.js"))).isFile()}catch{return!1}}});var $D=d((Zge,jD)=>{var sX=PD(),nX=Dl(),oX=xD(),{isNodeGypPackage:aX,defaultGypInstallScript:cX}=BD(),uX=FD(),lX=nw(),hX=o(async i=>{let{args:e=[],binPaths:t=!1,env:r={},event:s,nodeGyp:n,path:a,pkg:c,scriptShell:u,signalTimeout:l=500,stdio:h="pipe",stdioString:f}=i,{scripts:p={},gypfile:m}=c,y=null;if(i.cmd?y=i.cmd:c.scripts&&c.scripts[s]?y=c.scripts[s]:s==="install"&&!p.install&&!p.preinstall&&m!==!1&&await aX(a)?y=cX:s==="start"&&await lX(a)&&(y="node server.js"),!y)return{code:0,signal:null};let g=o(()=>{},"inputEnd");if(h==="inherit"){let w;c._id?w=`
33
+ `,r)}processPackage(e){let{bin:t,browser:r,files:s,main:n}=this.tree.package,a=[],c=[...bD,"!/package.json","!/readme{,.*[^~$]}","!/copying{,.*[^~$]}","!/license{,.*[^~$]}","!/licence{,.*[^~$]}","/.git","/node_modules",".npmrc","/package-lock.json","/yarn.lock","/pnpm-lock.yaml","/bun.lockb"];if(s){for(let u of s){u.startsWith("./")&&(u=u.slice(1)),u.endsWith("/*")&&(u+="*");let l=`!${u}`;try{let h=FY(ho(this.path,u.replace(/^!+/,"")).replace(/\\/g,"/"));h.isFile()?(c.unshift(l),this.requiredFiles.push(u.startsWith("/")?u.slice(1):u)):h.isDirectory()&&(a.push(l),a.push(`${l}/**`))}catch{a.push(l)}}this.injectRules("package.json",["*",...a])}if(r&&c.push(`!/${r}`),n&&c.push(`!/${n}`),t)for(let u in t)c.push(`!/${t[u]}`);this.injectRules(uo,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:r}=this.tree.package;e=Object.keys(t||{}).concat(Object.keys(r||{}))}for(let t of e){let r=this.tree.edgesOut.get(t);if(!r||r.peer||r.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($c),c.ignoreFiles.push("package.json"),s.isLink&&(c.ignoreFiles.push(".npmignore"),c.ignoreFiles.push(".gitignore")),c.ignoreFiles.push(uo);let u=new i(a,c),l=await new Promise((f,p)=>{u.on("error",p),u.on("done",f),u.start()}),h=lo(this.root,u.path);for(let f of l)this.result.add(ho(h,f).replace(/\\/g,"/"))}}},OD=o((i,e,t)=>{typeof e=="function"&&(t=e,e={});let r=new Promise((s,n)=>{new Ff(i,{...e,isPackage:!0}).on("done",s).on("error",n).start()});return t?r.then(s=>t(null,s),t):r},"walk");vD.exports=OD;OD.Walker=Ff});var CD=d(($ge,TD)=>{var{resolve:AD,dirname:GY,delimiter:ew}=require("path"),WY=AD(__dirname,"../lib/node-gyp-bin"),JY=o((i,e,t)=>{let r=Object.keys(t).filter(u=>/^path$/i.test(u)&&t[u]).map(u=>t[u].split(ew)).reduce((u,l)=>u.concat(l.filter(h=>!u.includes(h))),[]).join(ew),s=[];e&&s.push(...e);let n=i,a;do s.push(AD(n,"node_modules",".bin")),a=n,n=GY(n);while(n!==a);s.push(WY,r);let c=s.join(ew);for(let u of Object.keys(t))/^path$/i.test(u)&&(t[u]=c);return t},"setPATH");TD.exports=JY});var PD=d((Vge,ND)=>{var KY=CD(),{resolve:ZY}=require("path"),Uf,YY=o(i=>{let{args:e,binPaths:t,cmd:r,env:s,event:n,nodeGyp:a,path:c,scriptShell:u=!0,stdio:l,stdioString:h}=i;a?Uf=a:s.npm_config_node_gyp?Uf=s.npm_config_node_gyp:Uf=require.resolve("node-gyp/bin/node-gyp.js");let p={env:KY(c,t,{...process.env,...s,npm_package_json:ZY(c,"package.json"),npm_lifecycle_event:n,npm_lifecycle_script:r,npm_config_node_gyp:Uf}),stdioString:h,stdio:l,cwd:c,shell:u};return[r,e,p]},"makeSpawnArgs");ND.exports=YY});var xD=d((Hge,DD)=>{var tw=o((i,e,t={})=>{for(let[r,s]of Object.entries(i))s!==void 0&&(s===null||s===!1?t[`${e}${r}`]="":Array.isArray(s)?s.forEach((n,a)=>{tw({[`${r}_${a}`]:n},`${e}`,t)}):typeof s=="object"?tw(s,`${e}${r}_`,t):t[`${e}${r}`]=String(s));return t},"packageEnvs");DD.exports=i=>tw({name:i.name,version:i.version,config:i.config,engines:i.engines,bin:i.bin},"npm_package_")});var BD=d((Wge,MD)=>{var XY=require("util"),LD=require("fs"),{stat:QY}=LD.promises||{stat:XY.promisify(LD.stat)};async function eX(i){return await QY(`${i}/binding.gyp`).then(e=>e.isFile()).catch(()=>!1)}o(eX,"isNodeGypPackage");MD.exports={isNodeGypPackage:eX,defaultGypInstallScript:"node-gyp rebuild"}});var FD=d((Kge,kD)=>{var jf=new Set,iw=!1,rw=["SIGINT","SIGTERM"],sw=o(i=>{for(let e of jf)e.kill(i)},"handleSignal"),tX=o(()=>{for(let i of rw)process.on(i,sw);iw=!0},"setupListeners"),iX=o(()=>{if(jf.size===0){for(let i of rw)process.removeListener(i,sw);iw=!1}},"cleanupListeners"),rX=o(i=>{jf.add(i),iw||tX(),i.once("exit",()=>{jf.delete(i),iX()})},"add");kD.exports={add:rX,handleSignal:sw,forwardedSignals:rw}});var nw=d((Yge,UD)=>{var{stat:sX}=require("node:fs/promises"),{resolve:nX}=require("node:path");UD.exports=async i=>{try{return(await sX(nX(i,"server.js"))).isFile()}catch{return!1}}});var $D=d((Xge,jD)=>{var oX=PD(),aX=Dl(),cX=xD(),{isNodeGypPackage:uX,defaultGypInstallScript:lX}=BD(),hX=FD(),fX=nw(),dX=o(async i=>{let{args:e=[],binPaths:t=!1,env:r={},event:s,nodeGyp:n,path:a,pkg:c,scriptShell:u,signalTimeout:l=500,stdio:h="pipe",stdioString:f}=i,{scripts:p={},gypfile:m}=c,y=null;if(i.cmd?y=i.cmd:c.scripts&&c.scripts[s]?y=c.scripts[s]:s==="install"&&!p.install&&!p.preinstall&&m!==!1&&await uX(a)?y=lX:s==="start"&&await fX(a)&&(y="node server.js"),!y)return{code:0,signal:null};let g=o(()=>{},"inputEnd");if(h==="inherit"){let w;c._id?w=`
33
34
  > ${c._id} ${s}
34
35
  `:w=`
35
36
  > ${s}
36
37
  `,w+=`> ${y.trim().replace(/\n/g,`
37
38
  > `)}`,e.length&&(w+=` ${e.join(" ")}`),w+=`
38
- `;let{output:I,input:v}=St();I.standard(w),g=v.start()}let[S,E,_]=sX({args:e,binPaths:t,cmd:y,env:{...r,...oX(c)},event:s,nodeGyp:n,path:a,scriptShell:u,stdio:h,stdioString:f}),b=nX(S,E,_,{event:s,script:y,pkgid:c._id,path:a});return h==="inherit"&&uX.add(b.process),b.stdin&&b.stdin.end(),b.catch(w=>{let{signal:I}=w;if(h==="inherit"&&I)return process.kill(process.pid,I),new Promise((v,N)=>setTimeout(()=>N(w),l));throw w}).finally(g)},"runScriptPkg");jD.exports=hX});var VD=d((Xge,qD)=>{var fX=o(i=>{if(typeof i!="object"||!i)throw new TypeError("invalid options object provided to runScript");let{event:e,path:t,scriptShell:r,env:s={},stdio:n="pipe",args:a=[],cmd:c}=i;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(r!==void 0&&typeof r!="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(u=>typeof u!="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");qD.exports=fX});var GD=d((eye,HD)=>{var dX=Yl(),zD=$D(),pX=VD(),mX=nw(),gX=o(async i=>{if(pX(i),i.pkg)return zD(i);let{content:e}=await dX.normalize(i.path);return zD({...i,pkg:e})},"runScript");HD.exports=Object.assign(gX,{isServerPackage:mX})});var fo=d((iye,WD)=>{var{resolve:yX}=require("node:path"),{stat:SX,chmod:EX}=require("node:fs/promises"),wX=dc(),_X=Ln(),bX=xs(),ow=Ds(),aw=class extends bX{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):wX.tmp.withTmp(this.cache,this.opts,e=>this.extract(e).then(()=>this[ow.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 r=>{let s=yX(t,e.bin[r]);try{let n=await SX(s),a=n.mode|73;if(a===n.mode)return;await EX(s,a)}catch{}})):Promise.resolve()}extract(e){return super.extract(e).then(t=>this.package?t:this[ow.readPackageJson](e).then(r=>this.#e(r,e)).then(()=>t))}[ow.tarballFromResolved](){return new _X.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)}}}}))}};WD.exports=aw});var KD=d((sye,JD)=>{var IX=YE(),OX=o(i=>({cwd:i._resolved,prefix:"package/",portable:!0,gzip:{level:9},filter:o((e,t)=>(IX(i,e)&&(t.mode|=73),!0),"filter"),mtime:new Date("1985-10-26T08:15:00.000Z")}),"tarCreateOptions");JD.exports=OX});var $f=d((oye,XD)=>{var{resolve:vX}=require("node:path"),RX=RD(),AX=GD(),TX=KE(),{Minipass:CX}=te(),NX=xs(),PX=fo(),ZD=Ds(),YD=KD(),cw=class extends NX{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 YD(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 AX({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:vX(this.resolved,"package.json")}})})}[ZD.tarballFromResolved](){if(!this.tree&&!this.Arborist)throw new Error("DirFetcher requires either a tree or an Arborist constructor to pack");let e=new CX;e.resolved=this.resolved,e.integrity=this.integrity;let{prefix:t,workspaces:r}=this.opts;return this.#e().then(async()=>{if(!this.tree){let s=new this.Arborist({path:this.resolved});this.tree=await s.loadActual()}return RX(this.tree,{path:this.resolved,prefix:t,workspaces:r})}).then(s=>TX.c(YD(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[ZD.readPackageJson](this.resolved).then(e=>this.package={...e,_integrity:this.integrity&&String(this.integrity),_resolved:this.resolved,_from:this.from})}packument(){return PX.prototype.packument.apply(this)}};XD.exports=cw});var dw=d((cye,QD)=>{"use strict";var{URL:DX}=require("node:url");function xX(i){try{let t=new DX(i).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(xX,"packageName");var Ls=class extends Error{static{o(this,"HttpErrorBase")}constructor(e,t,r,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=r,this.pkgid=s?s.toString():xX(t.url),Error.captureStackTrace(this,this.constructor)}},uw=class extends Ls{static{o(this,"HttpErrorGeneral")}constructor(e,t,r,s){super(e,t,r,s),this.message=`${t.status} ${t.statusText} - ${this.method.toUpperCase()} ${this.spec||this.uri}${r&&r.error?" - "+r.error:""}`}},lw=class extends Ls{static{o(this,"HttpErrorAuthOTP")}constructor(e,t,r,s){super(e,t,r,s),this.message="OTP required for authentication",this.code="EOTP"}},hw=class extends Ls{static{o(this,"HttpErrorAuthIPAddress")}constructor(e,t,r,s){super(e,t,r,s),this.message="Login is not allowed from your IP address",this.code="EAUTHIP"}},fw=class extends Ls{static{o(this,"HttpErrorAuthUnknown")}constructor(e,t,r,s){super(e,t,r,s),this.message="Unable to authenticate, need: "+t.headers.get("www-authenticate")}};QD.exports={HttpErrorBase:Ls,HttpErrorGeneral:uw,HttpErrorAuthOTP:lw,HttpErrorAuthIPAddress:hw,HttpErrorAuthUnknown:fw}});var tx=d((lye,ex)=>{var LX=rh(),qc=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"}},qf=class extends LX{static{o(this,"MinipassSized")}constructor(e={}){if(super(e),e.objectMode)throw new TypeError(`${this.constructor.name} streams only work with string and buffer data`);if(this.found=0,this.expect=e.size,typeof this.expect!="number"||this.expect>Number.MAX_SAFE_INTEGER||isNaN(this.expect)||this.expect<0||!isFinite(this.expect)||this.expect!==Math.floor(this.expect))throw new Error("invalid expected size: "+this.expect)}write(e,t,r){let 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 qc(this.found,this.expect)),super.write(e,t,r)):(this.emit("error",new TypeError(`${this.constructor.name} streams only work with string and buffer data`)),!1)}emit(e,...t){return e==="end"&&this.found!==this.expect&&this.emit("error",new qc(this.found,this.expect)),super.emit(e,...t)}};qf.SizeError=qc;ex.exports=qf});var rx=d((fye,ix)=>{"use strict";var{Minipass:MX}=te(),pw=Symbol("type"),ir=Symbol("buffer"),Vf=class i{static{o(this,"Blob")}constructor(e,t){this[pw]="";let r=[],s=0;if(e){let a=e,c=Number(a.length);for(let u=0;u<c;u++){let l=a[u],h=l instanceof Buffer?l:ArrayBuffer.isView(l)?Buffer.from(l.buffer,l.byteOffset,l.byteLength):l instanceof ArrayBuffer?Buffer.from(l):l instanceof i?l[ir]:typeof l=="string"?Buffer.from(l):Buffer.from(String(l));s+=h.length,r.push(h)}}this[ir]=Buffer.concat(r,s);let n=t&&t.type!==void 0&&String(t.type).toLowerCase();n&&!/[^\u0020-\u007E]/.test(n)&&(this[pw]=n)}get size(){return this[ir].length}get type(){return this[pw]}text(){return Promise.resolve(this[ir].toString())}arrayBuffer(){let e=this[ir],t=e.byteOffset,r=e.byteLength,s=e.buffer.slice(t,t+r);return Promise.resolve(s)}stream(){return new MX().end(this[ir])}slice(e,t,r){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),l=this[ir].slice(n,n+c),h=new i([],{type:r});return h[ir]=l,h}get[Symbol.toStringTag](){return"Blob"}static get BUFFER(){return ir}};Object.defineProperties(Vf.prototype,{size:{enumerable:!0},type:{enumerable:!0}});ix.exports=Vf});var gw=d((pye,sx)=>{"use strict";var mw=class extends Error{static{o(this,"FetchError")}constructor(e,t,r){super(e),this.code="FETCH_ERROR",r&&Object.assign(this,r),this.errno=this.code,this.type=this.code==="EBADSIZE"&&this.found>this.expect?"max-size":t,this.message=e,Error.captureStackTrace(this,this.constructor)}get name(){return"FetchError"}set name(e){}get[Symbol.toStringTag](){return"FetchError"}};sx.exports=mw});var ox=d((gye,nx)=>{"use strict";nx.exports={}});var Hf=d((yye,ux)=>{"use strict";var{Minipass:wi}=te(),yw=tx(),cx=rx(),{BUFFER:BX}=cx,Vc=gw(),Sw;try{Sw=ox().convert}catch{}var rr=Symbol("Body internals"),Ms=Symbol("consumeBody"),zf=class{static{o(this,"Body")}constructor(e,t={}){let{size:r=0,timeout:s=0}=t,n=e==null?null:ax(e)?Buffer.from(e.toString()):zc(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):wi.isStream(e)?e:Buffer.from(String(e));this[rr]={body:n,disturbed:!1,error:null},this.size=r,this.timeout=s,wi.isStream(n)&&n.on("error",a=>{let c=a.name==="AbortError"?a:new Vc(`Invalid response while trying to fetch ${this.url}: ${a.message}`,"system",a);this[rr].error=c})}get body(){return this[rr].body}get bodyUsed(){return this[rr].disturbed}arrayBuffer(){return this[Ms]().then(e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength))}blob(){let e=this.headers&&this.headers.get("content-type")||"";return this[Ms]().then(t=>Object.assign(new cx([],{type:e.toLowerCase()}),{[BX]:t}))}async json(){let e=await this[Ms]();try{return JSON.parse(e.toString())}catch(t){throw new Vc(`invalid json response body at ${this.url} reason: ${t.message}`,"invalid-json")}}text(){return this[Ms]().then(e=>e.toString())}buffer(){return this[Ms]()}textConverted(){return this[Ms]().then(e=>kX(e,this.headers))}[Ms](){if(this[rr].disturbed)return Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[rr].disturbed=!0,this[rr].error)return Promise.reject(this[rr].error);if(this.body===null)return Promise.resolve(Buffer.alloc(0));if(Buffer.isBuffer(this.body))return Promise.resolve(this.body);let e=zc(this.body)?this.body.stream():this.body;if(!wi.isStream(e))return Promise.resolve(Buffer.alloc(0));let t=this.size&&e instanceof yw||!this.size&&e instanceof wi&&!(e instanceof yw)?e:this.size?new yw({size:this.size}):new wi,r=this.timeout&&t.writable?setTimeout(()=>{t.emit("error",new Vc(`Response timeout while trying to fetch ${this.url} (over ${this.timeout}ms)`,"body-timeout"))},this.timeout):null;return r&&r.unref&&r.unref(),new Promise(s=>{t!==e&&(e.on("error",n=>t.emit("error",n)),e.pipe(t)),s()}).then(()=>t.concat()).then(s=>(clearTimeout(r),s)).catch(s=>{throw clearTimeout(r),s.name==="AbortError"||s.name==="FetchError"?s:s.name==="RangeError"?new Vc(`Could not create Buffer from response body for ${this.url}: ${s.message}`,"system",s):new Vc(`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(wi.isStream(t)&&typeof t.getBoundary!="function"){let r=new wi,s=new wi,n=new wi;return r.on("error",a=>{s.emit("error",a),n.emit("error",a)}),t.on("error",a=>r.emit("error",a)),r.pipe(s),r.pipe(n),t.pipe(r),e[rr].body=s,n}else return e.body}static extractContentType(e){return e==null?null:typeof e=="string"?"text/plain;charset=UTF-8":ax(e)?"application/x-www-form-urlencoded;charset=UTF-8":zc(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()}`:wi.isStream(e)?null:"text/plain;charset=UTF-8"}static getTotalBytes(e){let{body:t}=e;return t==null?0:zc(t)?t.size:Buffer.isBuffer(t)?t.length:t&&typeof t.getLengthSync=="function"&&(t._lengthRetrievers&&t._lengthRetrievers.length===0||t.hasKnownLength&&t.hasKnownLength())?t.getLengthSync():null}static writeToStream(e,t){let{body:r}=t;return r==null?e.end():Buffer.isBuffer(r)||typeof r=="string"?e.end(r):(zc(r)?r.stream():r).on("error",n=>e.emit("error",n)).pipe(e),e}};Object.defineProperties(zf.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}});var ax=o(i=>typeof i!="object"||typeof i.append!="function"||typeof i.delete!="function"||typeof i.get!="function"||typeof i.getAll!="function"||typeof i.has!="function"||typeof i.set!="function"?!1:i.constructor.name==="URLSearchParams"||Object.prototype.toString.call(i)==="[object URLSearchParams]"||typeof i.sort=="function","isURLSearchParams"),zc=o(i=>typeof i=="object"&&typeof i.arrayBuffer=="function"&&typeof i.type=="string"&&typeof i.stream=="function"&&typeof i.constructor=="function"&&typeof i.constructor.name=="string"&&/^(Blob|File)$/.test(i.constructor.name)&&/^(Blob|File)$/.test(i[Symbol.toStringTag]),"isBlob"),kX=o((i,e)=>{if(typeof Sw!="function")throw new Error("The package `encoding` must be installed to use the textConverted() function");let t=e&&e.get("content-type"),r="utf-8",s;t&&(s=/charset=([^;]*)/i.exec(t));let n=i.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&&(r=s.pop(),(r==="gb2312"||r==="gbk")&&(r="gb18030")),Sw(i,"UTF-8",r).toString()},"convertBody");ux.exports=zf});var Wf=d((Eye,fx)=>{"use strict";var hx=/[^^_`a-zA-Z\-0-9!#$%&'*+.|~]/,ww=/[^\t\x20-\x7e\x80-\xff]/,Hc=o(i=>{if(i=`${i}`,hx.test(i)||i==="")throw new TypeError(`${i} is not a legal HTTP header name`)},"validateName"),lx=o(i=>{if(i=`${i}`,ww.test(i))throw new TypeError(`${i} is not a legal HTTP header value`)},"validateValue"),po=o((i,e)=>{e=e.toLowerCase();for(let t in i)if(t.toLowerCase()===e)return t},"find"),me=Symbol("map"),Gf=class i{static{o(this,"Headers")}constructor(e=void 0){if(this[me]=Object.create(null),e instanceof i){let t=e.raw(),r=Object.keys(t);for(let s of r)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 r=[];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");r.push(n)}for(let s of r)this.append(s[0],s[1])}else for(let r of Object.keys(e))this.append(r,e[r])}else throw new TypeError("Provided initializer must be an object")}get(e){e=`${e}`,Hc(e);let t=po(this[me],e);return t===void 0?null:this[me][t].join(", ")}forEach(e,t=void 0){let r=_w(this);for(let s=0;s<r.length;s++){let[n,a]=r[s];e.call(t,a,n,this),r=_w(this)}}set(e,t){e=`${e}`,t=`${t}`,Hc(e),lx(t);let r=po(this[me],e);this[me][r!==void 0?r:e]=[t]}append(e,t){e=`${e}`,t=`${t}`,Hc(e),lx(t);let r=po(this[me],e);r!==void 0?this[me][r].push(t):this[me][e]=[t]}has(e){return e=`${e}`,Hc(e),po(this[me],e)!==void 0}delete(e){e=`${e}`,Hc(e);let t=po(this[me],e);t!==void 0&&delete this[me][t]}raw(){return this[me]}keys(){return new Bs(this,"key")}values(){return new Bs(this,"value")}[Symbol.iterator](){return new Bs(this,"key+value")}entries(){return new Bs(this,"key+value")}get[Symbol.toStringTag](){return"Headers"}static exportNodeCompatibleHeaders(e){let t=Object.assign(Object.create(null),e[me]),r=po(e[me],"Host");return r!==void 0&&(t[r]=t[r][0]),t}static createHeadersLenient(e){let t=new i;for(let r of Object.keys(e))if(!hx.test(r))if(Array.isArray(e[r]))for(let s of e[r])ww.test(s)||(t[me][r]===void 0?t[me][r]=[s]:t[me][r].push(s));else ww.test(e[r])||(t[me][r]=[e[r]]);return t}};Object.defineProperties(Gf.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 _w=o((i,e="key+value")=>Object.keys(i[me]).sort().map(e==="key"?t=>t.toLowerCase():e==="value"?t=>i[me][t].join(", "):t=>[t.toLowerCase(),i[me][t].join(", ")]),"getHeaders"),Ew=Symbol("internal"),Bs=class i{static{o(this,"HeadersIterator")}constructor(e,t){this[Ew]={target:e,kind:t,index:0}}get[Symbol.toStringTag](){return"HeadersIterator"}next(){if(!this||Object.getPrototypeOf(this)!==i.prototype)throw new TypeError("Value of `this` is not a HeadersIterator");let{target:e,kind:t,index:r}=this[Ew],s=_w(e,t),n=s.length;return r>=n?{value:void 0,done:!0}:(this[Ew].index++,{value:s[r],done:!1})}};Object.setPrototypeOf(Bs.prototype,Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));fx.exports=Gf});var gx=d((_ye,mx)=>{"use strict";var FX=require("http"),{STATUS_CODES:UX}=FX,dx=Wf(),px=Hf(),{clone:jX,extractContentType:$X}=px,sr=Symbol("Response internals"),Jf=class i extends px{static{o(this,"Response")}constructor(e=null,t={}){super(e,t);let r=t.status||200,s=new dx(t.headers);if(e!=null&&!s.has("Content-Type")){let n=$X(e);n&&s.append("Content-Type",n)}this[sr]={url:t.url,status:r,statusText:t.statusText||UX[r],headers:s,counter:t.counter,trailer:Promise.resolve(t.trailer||new dx)}}get trailer(){return this[sr].trailer}get url(){return this[sr].url||""}get status(){return this[sr].status}get ok(){return this[sr].status>=200&&this[sr].status<300}get redirected(){return this[sr].counter>0}get statusText(){return this[sr].statusText}get headers(){return this[sr].headers}clone(){return new i(jX(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"}};mx.exports=Jf;Object.defineProperties(Jf.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}})});var yx=d((Iye,qX)=>{qX.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 wx=d((Oye,Ex)=>{"use strict";var{URL:bw}=require("url"),{Minipass:VX}=te(),Iw=Wf(),{exportNodeCompatibleHeaders:zX}=Iw,Sx=Hf(),{clone:HX,extractContentType:GX,getTotalBytes:WX}=Sx,JX=yx().version,KX=`minipass-fetch/${JX} (+https://github.com/isaacs/minipass-fetch)`,Yt=Symbol("Request internals"),Kf=o(i=>typeof i=="object"&&typeof i[Yt]=="object","isRequest"),ZX=o(i=>{let e=i&&typeof i=="object"&&Object.getPrototypeOf(i);return!!(e&&e.constructor.name==="AbortSignal")},"isAbortSignal"),Zf=class i extends Sx{static{o(this,"Request")}constructor(e,t={}){let r=Kf(e)?new bw(e.url):e&&e.href?new bw(e.href):new bw(`${e}`);Kf(e)?t={...e[Yt],...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||Kf(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:Kf(e)&&e.body!==null?HX(e):null;super(a,{timeout:t.timeout||e.timeout||0,size:t.size||e.size||0});let c=new Iw(t.headers||e.headers||{});if(a!=null&&!c.has("Content-Type")){let ee=GX(a);ee&&c.append("Content-Type",ee)}let u="signal"in t?t.signal:null;if(u!=null&&!ZX(u))throw new TypeError("Expected signal must be an instanceof AbortSignal");let{ca:l,cert:h,ciphers:f,clientCertEngine:p,crl:m,dhparam:y,ecdhCurve:g,family:S,honorCipherOrder:E,key:_,passphrase:b,pfx:w,rejectUnauthorized:I=process.env.NODE_TLS_REJECT_UNAUTHORIZED!=="0",secureOptions:v,secureProtocol:N,servername:P,sessionIdContext:$}=t;this[Yt]={method:s,redirect:t.redirect||e.redirect||"follow",headers:c,parsedURL:r,signal:u,ca:l,cert:h,ciphers:f,clientCertEngine:p,crl:m,dhparam:y,ecdhCurve:g,family:S,honorCipherOrder:E,key:_,passphrase:b,pfx:w,rejectUnauthorized:I,secureOptions:v,secureProtocol:N,servername:P,sessionIdContext:$},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[Yt].method}get url(){return this[Yt].parsedURL.toString()}get headers(){return this[Yt].headers}get redirect(){return this[Yt].redirect}get signal(){return this[Yt].signal}clone(){return new i(this)}get[Symbol.toStringTag](){return"Request"}static getNodeRequestOptions(e){let t=e[Yt].parsedURL,r=new Iw(e[Yt].headers);if(r.has("Accept")||r.set("Accept","*/*"),!/^https?:$/.test(t.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(e.signal&&VX.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?WX(e):null;s&&r.set("Content-Length",s+""),r.has("User-Agent")||r.set("User-Agent",KX),e.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip,deflate");let n=typeof e.agent=="function"?e.agent(t):e.agent;!r.has("Connection")&&!n&&r.set("Connection","close");let{ca:a,cert:c,ciphers:u,clientCertEngine:l,crl:h,dhparam:f,ecdhCurve:p,family:m,honorCipherOrder:y,key:g,passphrase:S,pfx:E,rejectUnauthorized:_,secureOptions:b,secureProtocol:w,servername:I,sessionIdContext:v}=e[Yt];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:zX(r),agent:n,ca:a,cert:c,ciphers:u,clientCertEngine:l,crl:h,dhparam:f,ecdhCurve:p,family:m,honorCipherOrder:y,key:g,passphrase:S,pfx:E,rejectUnauthorized:_,secureOptions:b,secureProtocol:w,servername:I,sessionIdContext:v,timeout:e.timeout}}};Ex.exports=Zf;Object.defineProperties(Zf.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}})});var bx=d((Rye,_x)=>{"use strict";var Ow=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){}};_x.exports=Ow});var go=d((Tye,vx)=>{"use strict";var{URL:Gc}=require("url"),YX=require("http"),XX=require("https"),mo=vc(),{Minipass:Ix}=te(),QX=Hf(),{writeToStream:e9,getTotalBytes:t9}=QX,ks=gx(),Rw=Wf(),{createHeadersLenient:Ox}=Rw,Wc=wx(),{getNodeRequestOptions:i9}=Wc,Br=gw(),vw=bx(),nr=o(async(i,e)=>{if(/^data:/.test(i)){let t=new Wc(i,e);return Promise.resolve().then(()=>new Promise((r,s)=>{let n,a;try{let{pathname:l,search:h}=new Gc(i),f=l.split(",");if(f.length<2)throw new Error("invalid data: URI");let p=f.shift(),m=/;base64$/.test(p);n=m?p.slice(0,-7):p;let y=decodeURIComponent(f.join(",")+h);a=m?Buffer.from(y,"base64"):Buffer.from(y)}catch(l){return s(new Br(`[${t.method}] ${t.url} invalid URL, ${l.message}`,"system",l))}let{signal:c}=t;if(c&&c.aborted)return s(new vw("The user aborted a request."));let u={"Content-Length":a.length};return n&&(u["Content-Type"]=n),r(new ks(a,{headers:u}))}))}return new Promise((t,r)=>{let s=new Wc(i,e),n;try{n=i9(s)}catch(y){return r(y)}let a=(n.protocol==="https:"?XX:YX).request,{signal:c}=s,u=null,l=o(()=>{let y=new vw("The user aborted a request.");r(y),Ix.isStream(s.body)&&typeof s.body.destroy=="function"&&s.body.destroy(y),u&&u.body&&u.body.emit("error",y)},"abort");if(c&&c.aborted)return l();let h=o(()=>{l(),f()},"abortAndFinalize"),f=o(()=>{p.abort(),c&&c.removeEventListener("abort",h),clearTimeout(m)},"finalize"),p=a(n);c&&c.addEventListener("abort",h);let m=null;s.timeout&&p.once("socket",()=>{m=setTimeout(()=>{r(new Br(`network timeout at: ${s.url}`,"request-timeout")),f()},s.timeout)}),p.on("error",y=>{p.res&&p.res.emit("error",y),r(new Br(`request to ${s.url} failed, reason: ${y.message}`,"system",y)),f()}),p.on("response",y=>{clearTimeout(m);let g=Ox(y.headers);if(nr.isRedirect(y.statusCode)){let I=g.get("Location"),v=null;try{v=I===null?null:new Gc(I,s.url).toString()}catch{if(s.redirect!=="manual"){r(new Br(`uri requested responds with an invalid redirect URL: ${I}`,"invalid-redirect")),f();return}}if(s.redirect==="error"){r(new Br(`uri requested responds with a redirect, redirect mode is set to error: ${s.url}`,"no-redirect")),f();return}else if(s.redirect==="manual"){if(v!==null)try{g.set("Location",v)}catch(N){r(N)}}else if(s.redirect==="follow"&&v!==null){if(s.counter>=s.follow){r(new Br(`maximum redirect reached at: ${s.url}`,"max-redirect")),f();return}if(y.statusCode!==303&&s.body&&t9(s)===null){r(new Br("Cannot follow redirect with body being a readable stream","unsupported-redirect")),f();return}s.headers.set("host",new Gc(v).host);let N={headers:new Rw(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},P=new Gc(s.url),$=new Gc(v);P.hostname!==$.hostname&&(N.headers.delete("authorization"),N.headers.delete("cookie")),(y.statusCode===303||(y.statusCode===301||y.statusCode===302)&&s.method==="POST")&&(N.method="GET",N.body=void 0,N.headers.delete("content-length")),t(nr(new Wc(v,N))),f();return}}y.once("end",()=>c&&c.removeEventListener("abort",h));let S=new Ix;S.on("error",f),y.on("error",I=>S.emit("error",I)),y.on("data",I=>S.write(I)),y.on("end",()=>S.end());let E={url:s.url,status:y.statusCode,statusText:y.statusMessage,headers:g,size:s.size,timeout:s.timeout,counter:s.counter,trailer:new Promise(I=>y.on("end",()=>I(Ox(y.trailers))))},_=g.get("Content-Encoding");if(!s.compress||s.method==="HEAD"||_===null||y.statusCode===204||y.statusCode===304){u=new ks(S,E),t(u);return}let b={flush:mo.constants.Z_SYNC_FLUSH,finishFlush:mo.constants.Z_SYNC_FLUSH};if(_==="gzip"||_==="x-gzip"){let I=new mo.Gunzip(b);u=new ks(S.on("error",v=>I.emit("error",v)).pipe(I),E),t(u);return}if(_==="deflate"||_==="x-deflate"){y.once("data",I=>{let v=(I[0]&15)===8?new mo.Inflate:new mo.InflateRaw;S.on("error",N=>v.emit("error",N)).pipe(v),u=new ks(v,E),t(u)});return}if(_==="br"){try{var w=new mo.BrotliDecompress}catch(I){r(I),f();return}S.on("error",I=>w.emit("error",I)).pipe(w),u=new ks(w,E),t(u);return}u=new ks(S,E),t(u)}),e9(p,s)})},"fetch");vx.exports=nr;nr.isRedirect=i=>i===301||i===302||i===303||i===307||i===308;nr.Headers=Rw;nr.Request=Wc;nr.Response=ks;nr.FetchError=Br;nr.AbortError=vw});var Rx=d((Nye,r9)=>{r9.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 Aw=d((Pye,Tx)=>{var Ax=Rx();Tx.exports={maxSockets:12,method:"GET",registry:"https://registry.npmjs.org/",timeout:300*1e3,strictSSL:!0,noProxy:process.env.NOPROXY,userAgent:`${Ax.name}@${Ax.version}/node@${process.version}+${process.arch} (${process.platform})`}});var Tw=d((Dye,Cx)=>{var yo="regex",So="path",s9={type:yo,pattern:/\b(npms?_)[a-zA-Z0-9]{36,48}\b/gi,replacement:"[REDACTED_NPM_SECRET]"},n9={type:yo,pattern:/\b(Basic\s+|Bearer\s+)[\w+=\-.]+\b/gi,replacement:"[REDACTED_AUTH_HEADER]"},o9={type:yo,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]"},a9={type:yo,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]"},c9={type:yo,pattern:/(?:https?|ftp):\/\/[^\s/"$.?#].[^\s"]*/gi,replacement:"[REDACTED_URL]"},u9={type:So,predicate:o(({path:i})=>i.endsWith(".headers.authorization"),"predicate"),replacement:"[REDACTED_HEADER_AUTHORIZATION]"},l9={type:So,predicate:o(({path:i})=>i.endsWith(".headers.set-cookie"),"predicate"),replacement:"[REDACTED_HEADER_SET_COOKIE]"},h9={type:So,predicate:o(({path:i})=>i.endsWith(".headers.cookie"),"predicate"),replacement:"[REDACTED_HEADER_COOKIE]"},f9={type:So,predicate:o(({path:i})=>i.endsWith(".request"),"predicate"),replacement:o(i=>({method:i?.method,path:i?.path,headers:i?.headers,url:i?.url}),"replacement")},d9={type:So,predicate:o(({path:i})=>i.endsWith(".response"),"predicate"),replacement:o(i=>({data:i?.data,status:i?.status,headers:i?.headers}),"replacement")};Cx.exports={TYPE_REGEX:yo,TYPE_URL:"url",TYPE_PATH:So,NPM_SECRET:s9,AUTH_HEADER:n9,JSON_WEB_TOKEN:o9,UUID:a9,URL_MATCHER:c9,DEEP_HEADER_AUTHORIZATION:u9,DEEP_HEADER_SET_COOKIE:l9,DEEP_HEADER_COOKIE:h9,REWRITE_REQUEST:f9,REWRITE_RESPONSE:d9}});var Mx=d((Lye,Lx)=>{var{URL_MATCHER:p9,TYPE_URL:Yf,TYPE_REGEX:m9,TYPE_PATH:g9}=Tw(),kr=o((i=0)=>(i=typeof i=="string"?i.length:i,i<8?"*".repeat(8):"*".repeat(i)),"asterisk"),Nx=o(i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"escapeRegExp"),Px=o(i=>{let e=decodeURIComponent(i),t=encodeURIComponent(i);return[...new Set([t,e,i])].map(Nx).join("|")},"urlEncodeRegexGroup"),Xf=o((i,...e)=>{let t="";for(let r=0;r<e.length;r++)t+=i[r]+`(${Px(e[r])})`;return t+=i[i.length-1],new RegExp(t)},"urlEncodeRegexTag"),y9=o(({hostname:i,replacement:e}={})=>({type:Yf,predicate:o(({url:t})=>t.hostname===i,"predicate"),pattern:o(({url:t})=>Xf`(^${t.protocol}//${t.username}:.+@)?${t.hostname}`,"pattern"),replacement:`$1${e||kr()}`}),"redactUrlHostnameMatcher"),S9=o(({param:i,replacement:e}={})=>({type:Yf,predicate:o(({url:t})=>t.searchParams.has(i),"predicate"),pattern:o(({url:t})=>Xf`(${i}=)${t.searchParams.get(i)}`,"pattern"),replacement:`$1${e||kr()}`}),"redactUrlSearchParamsMatcher"),Dx=o(({replacement:i}={})=>({type:Yf,predicate:o(({url:e})=>e.password,"predicate"),pattern:o(({url:e})=>Xf`(^${e.protocol}//${e.username}:)${e.password}`,"pattern"),replacement:`$1${i||kr()}`}),"redactUrlPasswordMatcher"),xx=o((...i)=>e=>{try{let t=new URL(e);return Cw(...i)(e,{url:t})}catch{return e}},"redactUrlReplacement"),E9=o((...i)=>({...p9,replacement:xx(...i)}),"redactUrlMatcher"),w9={[m9]:i=>e=>(typeof e=="string"&&(e=e.replace(i.pattern,i.replacement)),e),[Yf]:i=>(e,t)=>{if(typeof e=="string")try{let r=t?.url||new URL(e),{predicate:s,pattern:n}=i;s({url:r})&&(e=e.replace(n({url:r}),i.replacement))}catch{return e}return e},[g9]:i=>(e,t)=>{let r=t?.path,s=r.join(".").toLowerCase(),{predicate:n,replacement:a}=i,c=typeof a=="function"?a:()=>a;return n({rawPath:r,path:s})&&(e=c(e,{rawPath:r,path:s})),e}},_9=o(i=>w9[i.type](i),"redactMatcher"),Cw=o((...i)=>(e,t)=>i.flat().reduce((s,n)=>(typeof n=="function"?n:_9(n))(s,t),e),"redactMatchers"),b9=o(()=>(i,e)=>typeof e=="number"?kr(i):e+kr(i.substring(e.length).length),"redactDynamicReplacement"),I9=o(i=>(e,t)=>typeof t=="number"?kr(i):t+kr(i),"redactFixedReplacement"),O9=o((i,e)=>Cw(Dx({replacement:e}))(i),"redactUrlPassword");Lx.exports={asterisk:kr,escapeRegExp:Nx,urlEncodeRegexGroup:Px,urlEncodeRegexTag:Xf,redactUrlHostnameMatcher:y9,redactUrlSearchParamsMatcher:S9,redactUrlPasswordMatcher:Dx,redactUrlMatcher:E9,redactUrlReplacement:xx,redactDynamicReplacement:b9,redactFixedReplacement:I9,redactMatchers:Cw,redactUrlPassword:O9}});var Ux=d((Bye,Fx)=>{var Bx=Tw(),{redactUrlPassword:v9}=Mx(),Nw="***",Pw=o(i=>typeof i!="string"||!i?i:v9(i,Nw).replace(Bx.NPM_SECRET.pattern,`npm_${Nw}`).replace(Bx.UUID.pattern,Nw),"redact"),kx=o(i=>{let e=/[\s=]/g,t=null,r="",s=0;for(;t=e.exec(i);)r+=Pw(i.slice(s,t.index))+t[0],s=e.lastIndex;return r+Pw(i.slice(s))},"splitAndRedact"),R9=o(i=>typeof i=="string"?kx(i):Array.isArray(i)?i.map(e=>typeof e=="string"?kx(e):e):i,"redactLog");Fx.exports={redact:Pw,redactLog:R9}});var qx=d((Fye,$x)=>{"use strict";var Jc=dw(),{Response:A9}=go(),T9=Aw(),{log:Qf}=St(),{redact:C9}=Ux(),N9="https://github.com/npm/cli/wiki/No-auth-for-URI,-but-auth-present-for-scoped-registry",P9=o(async({method:i,uri:e,res:t,startTime:r,auth:s,opts:n})=>(n={...T9,...n},t.headers.has("npm-notice")&&!t.headers.has("x-local-cache")&&Qf.notice("",t.headers.get("npm-notice")),t.status>=400?(jx(i,t,r),s&&s.scopeAuthKey&&!s.token&&!s.auth&&Qf.warn("registry",`No auth for URI, but auth present for scoped registry.
39
+ `;let{output:I,input:v}=St();I.standard(w),g=v.start()}let[S,E,_]=oX({args:e,binPaths:t,cmd:y,env:{...r,...cX(c)},event:s,nodeGyp:n,path:a,scriptShell:u,stdio:h,stdioString:f}),b=aX(S,E,_,{event:s,script:y,pkgid:c._id,path:a});return h==="inherit"&&hX.add(b.process),b.stdin&&b.stdin.end(),b.catch(w=>{let{signal:I}=w;if(h==="inherit"&&I)return process.kill(process.pid,I),new Promise((v,N)=>setTimeout(()=>N(w),l));throw w}).finally(g)},"runScriptPkg");jD.exports=dX});var VD=d((eye,qD)=>{var pX=o(i=>{if(typeof i!="object"||!i)throw new TypeError("invalid options object provided to runScript");let{event:e,path:t,scriptShell:r,env:s={},stdio:n="pipe",args:a=[],cmd:c}=i;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(r!==void 0&&typeof r!="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(u=>typeof u!="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");qD.exports=pX});var GD=d((iye,HD)=>{var mX=Yl(),zD=$D(),gX=VD(),yX=nw(),SX=o(async i=>{if(gX(i),i.pkg)return zD(i);let{content:e}=await mX.normalize(i.path);return zD({...i,pkg:e})},"runScript");HD.exports=Object.assign(SX,{isServerPackage:yX})});var fo=d((sye,WD)=>{var{resolve:EX}=require("node:path"),{stat:wX,chmod:_X}=require("node:fs/promises"),bX=dc(),IX=Ln(),OX=xs(),ow=Ds(),aw=class extends OX{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):bX.tmp.withTmp(this.cache,this.opts,e=>this.extract(e).then(()=>this[ow.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 r=>{let s=EX(t,e.bin[r]);try{let n=await wX(s),a=n.mode|73;if(a===n.mode)return;await _X(s,a)}catch{}})):Promise.resolve()}extract(e){return super.extract(e).then(t=>this.package?t:this[ow.readPackageJson](e).then(r=>this.#e(r,e)).then(()=>t))}[ow.tarballFromResolved](){return new IX.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)}}}}))}};WD.exports=aw});var KD=d((oye,JD)=>{var vX=YE(),RX=o(i=>({cwd:i._resolved,prefix:"package/",portable:!0,gzip:{level:9},filter:o((e,t)=>(vX(i,e)&&(t.mode|=73),!0),"filter"),mtime:new Date("1985-10-26T08:15:00.000Z")}),"tarCreateOptions");JD.exports=RX});var $f=d((cye,XD)=>{var{resolve:AX}=require("node:path"),TX=RD(),CX=GD(),NX=KE(),{Minipass:PX}=te(),DX=xs(),xX=fo(),ZD=Ds(),YD=KD(),cw=class extends DX{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 YD(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 CX({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:AX(this.resolved,"package.json")}})})}[ZD.tarballFromResolved](){if(!this.tree&&!this.Arborist)throw new Error("DirFetcher requires either a tree or an Arborist constructor to pack");let e=new PX;e.resolved=this.resolved,e.integrity=this.integrity;let{prefix:t,workspaces:r}=this.opts;return this.#e().then(async()=>{if(!this.tree){let s=new this.Arborist({path:this.resolved});this.tree=await s.loadActual()}return TX(this.tree,{path:this.resolved,prefix:t,workspaces:r})}).then(s=>NX.c(YD(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[ZD.readPackageJson](this.resolved).then(e=>this.package={...e,_integrity:this.integrity&&String(this.integrity),_resolved:this.resolved,_from:this.from})}packument(){return xX.prototype.packument.apply(this)}};XD.exports=cw});var dw=d((lye,QD)=>{"use strict";var{URL:LX}=require("node:url");function MX(i){try{let t=new LX(i).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(MX,"packageName");var Ls=class extends Error{static{o(this,"HttpErrorBase")}constructor(e,t,r,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=r,this.pkgid=s?s.toString():MX(t.url),Error.captureStackTrace(this,this.constructor)}},uw=class extends Ls{static{o(this,"HttpErrorGeneral")}constructor(e,t,r,s){super(e,t,r,s),this.message=`${t.status} ${t.statusText} - ${this.method.toUpperCase()} ${this.spec||this.uri}${r&&r.error?" - "+r.error:""}`}},lw=class extends Ls{static{o(this,"HttpErrorAuthOTP")}constructor(e,t,r,s){super(e,t,r,s),this.message="OTP required for authentication",this.code="EOTP"}},hw=class extends Ls{static{o(this,"HttpErrorAuthIPAddress")}constructor(e,t,r,s){super(e,t,r,s),this.message="Login is not allowed from your IP address",this.code="EAUTHIP"}},fw=class extends Ls{static{o(this,"HttpErrorAuthUnknown")}constructor(e,t,r,s){super(e,t,r,s),this.message="Unable to authenticate, need: "+t.headers.get("www-authenticate")}};QD.exports={HttpErrorBase:Ls,HttpErrorGeneral:uw,HttpErrorAuthOTP:lw,HttpErrorAuthIPAddress:hw,HttpErrorAuthUnknown:fw}});var tx=d((fye,ex)=>{var BX=rh(),qc=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"}},qf=class extends BX{static{o(this,"MinipassSized")}constructor(e={}){if(super(e),e.objectMode)throw new TypeError(`${this.constructor.name} streams only work with string and buffer data`);if(this.found=0,this.expect=e.size,typeof this.expect!="number"||this.expect>Number.MAX_SAFE_INTEGER||isNaN(this.expect)||this.expect<0||!isFinite(this.expect)||this.expect!==Math.floor(this.expect))throw new Error("invalid expected size: "+this.expect)}write(e,t,r){let 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 qc(this.found,this.expect)),super.write(e,t,r)):(this.emit("error",new TypeError(`${this.constructor.name} streams only work with string and buffer data`)),!1)}emit(e,...t){return e==="end"&&this.found!==this.expect&&this.emit("error",new qc(this.found,this.expect)),super.emit(e,...t)}};qf.SizeError=qc;ex.exports=qf});var rx=d((pye,ix)=>{"use strict";var{Minipass:kX}=te(),pw=Symbol("type"),ir=Symbol("buffer"),Vf=class i{static{o(this,"Blob")}constructor(e,t){this[pw]="";let r=[],s=0;if(e){let a=e,c=Number(a.length);for(let u=0;u<c;u++){let l=a[u],h=l instanceof Buffer?l:ArrayBuffer.isView(l)?Buffer.from(l.buffer,l.byteOffset,l.byteLength):l instanceof ArrayBuffer?Buffer.from(l):l instanceof i?l[ir]:typeof l=="string"?Buffer.from(l):Buffer.from(String(l));s+=h.length,r.push(h)}}this[ir]=Buffer.concat(r,s);let n=t&&t.type!==void 0&&String(t.type).toLowerCase();n&&!/[^\u0020-\u007E]/.test(n)&&(this[pw]=n)}get size(){return this[ir].length}get type(){return this[pw]}text(){return Promise.resolve(this[ir].toString())}arrayBuffer(){let e=this[ir],t=e.byteOffset,r=e.byteLength,s=e.buffer.slice(t,t+r);return Promise.resolve(s)}stream(){return new kX().end(this[ir])}slice(e,t,r){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),l=this[ir].slice(n,n+c),h=new i([],{type:r});return h[ir]=l,h}get[Symbol.toStringTag](){return"Blob"}static get BUFFER(){return ir}};Object.defineProperties(Vf.prototype,{size:{enumerable:!0},type:{enumerable:!0}});ix.exports=Vf});var gw=d((gye,sx)=>{"use strict";var mw=class extends Error{static{o(this,"FetchError")}constructor(e,t,r){super(e),this.code="FETCH_ERROR",r&&Object.assign(this,r),this.errno=this.code,this.type=this.code==="EBADSIZE"&&this.found>this.expect?"max-size":t,this.message=e,Error.captureStackTrace(this,this.constructor)}get name(){return"FetchError"}set name(e){}get[Symbol.toStringTag](){return"FetchError"}};sx.exports=mw});var ox=d((Sye,nx)=>{"use strict";nx.exports={}});var Hf=d((Eye,ux)=>{"use strict";var{Minipass:wi}=te(),yw=tx(),cx=rx(),{BUFFER:FX}=cx,Vc=gw(),Sw;try{Sw=ox().convert}catch{}var rr=Symbol("Body internals"),Ms=Symbol("consumeBody"),zf=class{static{o(this,"Body")}constructor(e,t={}){let{size:r=0,timeout:s=0}=t,n=e==null?null:ax(e)?Buffer.from(e.toString()):zc(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):wi.isStream(e)?e:Buffer.from(String(e));this[rr]={body:n,disturbed:!1,error:null},this.size=r,this.timeout=s,wi.isStream(n)&&n.on("error",a=>{let c=a.name==="AbortError"?a:new Vc(`Invalid response while trying to fetch ${this.url}: ${a.message}`,"system",a);this[rr].error=c})}get body(){return this[rr].body}get bodyUsed(){return this[rr].disturbed}arrayBuffer(){return this[Ms]().then(e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength))}blob(){let e=this.headers&&this.headers.get("content-type")||"";return this[Ms]().then(t=>Object.assign(new cx([],{type:e.toLowerCase()}),{[FX]:t}))}async json(){let e=await this[Ms]();try{return JSON.parse(e.toString())}catch(t){throw new Vc(`invalid json response body at ${this.url} reason: ${t.message}`,"invalid-json")}}text(){return this[Ms]().then(e=>e.toString())}buffer(){return this[Ms]()}textConverted(){return this[Ms]().then(e=>UX(e,this.headers))}[Ms](){if(this[rr].disturbed)return Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[rr].disturbed=!0,this[rr].error)return Promise.reject(this[rr].error);if(this.body===null)return Promise.resolve(Buffer.alloc(0));if(Buffer.isBuffer(this.body))return Promise.resolve(this.body);let e=zc(this.body)?this.body.stream():this.body;if(!wi.isStream(e))return Promise.resolve(Buffer.alloc(0));let t=this.size&&e instanceof yw||!this.size&&e instanceof wi&&!(e instanceof yw)?e:this.size?new yw({size:this.size}):new wi,r=this.timeout&&t.writable?setTimeout(()=>{t.emit("error",new Vc(`Response timeout while trying to fetch ${this.url} (over ${this.timeout}ms)`,"body-timeout"))},this.timeout):null;return r&&r.unref&&r.unref(),new Promise(s=>{t!==e&&(e.on("error",n=>t.emit("error",n)),e.pipe(t)),s()}).then(()=>t.concat()).then(s=>(clearTimeout(r),s)).catch(s=>{throw clearTimeout(r),s.name==="AbortError"||s.name==="FetchError"?s:s.name==="RangeError"?new Vc(`Could not create Buffer from response body for ${this.url}: ${s.message}`,"system",s):new Vc(`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(wi.isStream(t)&&typeof t.getBoundary!="function"){let r=new wi,s=new wi,n=new wi;return r.on("error",a=>{s.emit("error",a),n.emit("error",a)}),t.on("error",a=>r.emit("error",a)),r.pipe(s),r.pipe(n),t.pipe(r),e[rr].body=s,n}else return e.body}static extractContentType(e){return e==null?null:typeof e=="string"?"text/plain;charset=UTF-8":ax(e)?"application/x-www-form-urlencoded;charset=UTF-8":zc(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()}`:wi.isStream(e)?null:"text/plain;charset=UTF-8"}static getTotalBytes(e){let{body:t}=e;return t==null?0:zc(t)?t.size:Buffer.isBuffer(t)?t.length:t&&typeof t.getLengthSync=="function"&&(t._lengthRetrievers&&t._lengthRetrievers.length===0||t.hasKnownLength&&t.hasKnownLength())?t.getLengthSync():null}static writeToStream(e,t){let{body:r}=t;return r==null?e.end():Buffer.isBuffer(r)||typeof r=="string"?e.end(r):(zc(r)?r.stream():r).on("error",n=>e.emit("error",n)).pipe(e),e}};Object.defineProperties(zf.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}});var ax=o(i=>typeof i!="object"||typeof i.append!="function"||typeof i.delete!="function"||typeof i.get!="function"||typeof i.getAll!="function"||typeof i.has!="function"||typeof i.set!="function"?!1:i.constructor.name==="URLSearchParams"||Object.prototype.toString.call(i)==="[object URLSearchParams]"||typeof i.sort=="function","isURLSearchParams"),zc=o(i=>typeof i=="object"&&typeof i.arrayBuffer=="function"&&typeof i.type=="string"&&typeof i.stream=="function"&&typeof i.constructor=="function"&&typeof i.constructor.name=="string"&&/^(Blob|File)$/.test(i.constructor.name)&&/^(Blob|File)$/.test(i[Symbol.toStringTag]),"isBlob"),UX=o((i,e)=>{if(typeof Sw!="function")throw new Error("The package `encoding` must be installed to use the textConverted() function");let t=e&&e.get("content-type"),r="utf-8",s;t&&(s=/charset=([^;]*)/i.exec(t));let n=i.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&&(r=s.pop(),(r==="gb2312"||r==="gbk")&&(r="gb18030")),Sw(i,"UTF-8",r).toString()},"convertBody");ux.exports=zf});var Wf=d((_ye,fx)=>{"use strict";var hx=/[^^_`a-zA-Z\-0-9!#$%&'*+.|~]/,ww=/[^\t\x20-\x7e\x80-\xff]/,Hc=o(i=>{if(i=`${i}`,hx.test(i)||i==="")throw new TypeError(`${i} is not a legal HTTP header name`)},"validateName"),lx=o(i=>{if(i=`${i}`,ww.test(i))throw new TypeError(`${i} is not a legal HTTP header value`)},"validateValue"),po=o((i,e)=>{e=e.toLowerCase();for(let t in i)if(t.toLowerCase()===e)return t},"find"),me=Symbol("map"),Gf=class i{static{o(this,"Headers")}constructor(e=void 0){if(this[me]=Object.create(null),e instanceof i){let t=e.raw(),r=Object.keys(t);for(let s of r)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 r=[];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");r.push(n)}for(let s of r)this.append(s[0],s[1])}else for(let r of Object.keys(e))this.append(r,e[r])}else throw new TypeError("Provided initializer must be an object")}get(e){e=`${e}`,Hc(e);let t=po(this[me],e);return t===void 0?null:this[me][t].join(", ")}forEach(e,t=void 0){let r=_w(this);for(let s=0;s<r.length;s++){let[n,a]=r[s];e.call(t,a,n,this),r=_w(this)}}set(e,t){e=`${e}`,t=`${t}`,Hc(e),lx(t);let r=po(this[me],e);this[me][r!==void 0?r:e]=[t]}append(e,t){e=`${e}`,t=`${t}`,Hc(e),lx(t);let r=po(this[me],e);r!==void 0?this[me][r].push(t):this[me][e]=[t]}has(e){return e=`${e}`,Hc(e),po(this[me],e)!==void 0}delete(e){e=`${e}`,Hc(e);let t=po(this[me],e);t!==void 0&&delete this[me][t]}raw(){return this[me]}keys(){return new Bs(this,"key")}values(){return new Bs(this,"value")}[Symbol.iterator](){return new Bs(this,"key+value")}entries(){return new Bs(this,"key+value")}get[Symbol.toStringTag](){return"Headers"}static exportNodeCompatibleHeaders(e){let t=Object.assign(Object.create(null),e[me]),r=po(e[me],"Host");return r!==void 0&&(t[r]=t[r][0]),t}static createHeadersLenient(e){let t=new i;for(let r of Object.keys(e))if(!hx.test(r))if(Array.isArray(e[r]))for(let s of e[r])ww.test(s)||(t[me][r]===void 0?t[me][r]=[s]:t[me][r].push(s));else ww.test(e[r])||(t[me][r]=[e[r]]);return t}};Object.defineProperties(Gf.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 _w=o((i,e="key+value")=>Object.keys(i[me]).sort().map(e==="key"?t=>t.toLowerCase():e==="value"?t=>i[me][t].join(", "):t=>[t.toLowerCase(),i[me][t].join(", ")]),"getHeaders"),Ew=Symbol("internal"),Bs=class i{static{o(this,"HeadersIterator")}constructor(e,t){this[Ew]={target:e,kind:t,index:0}}get[Symbol.toStringTag](){return"HeadersIterator"}next(){if(!this||Object.getPrototypeOf(this)!==i.prototype)throw new TypeError("Value of `this` is not a HeadersIterator");let{target:e,kind:t,index:r}=this[Ew],s=_w(e,t),n=s.length;return r>=n?{value:void 0,done:!0}:(this[Ew].index++,{value:s[r],done:!1})}};Object.setPrototypeOf(Bs.prototype,Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));fx.exports=Gf});var gx=d((Iye,mx)=>{"use strict";var jX=require("http"),{STATUS_CODES:$X}=jX,dx=Wf(),px=Hf(),{clone:qX,extractContentType:VX}=px,sr=Symbol("Response internals"),Jf=class i extends px{static{o(this,"Response")}constructor(e=null,t={}){super(e,t);let r=t.status||200,s=new dx(t.headers);if(e!=null&&!s.has("Content-Type")){let n=VX(e);n&&s.append("Content-Type",n)}this[sr]={url:t.url,status:r,statusText:t.statusText||$X[r],headers:s,counter:t.counter,trailer:Promise.resolve(t.trailer||new dx)}}get trailer(){return this[sr].trailer}get url(){return this[sr].url||""}get status(){return this[sr].status}get ok(){return this[sr].status>=200&&this[sr].status<300}get redirected(){return this[sr].counter>0}get statusText(){return this[sr].statusText}get headers(){return this[sr].headers}clone(){return new i(qX(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"}};mx.exports=Jf;Object.defineProperties(Jf.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}})});var yx=d((vye,zX)=>{zX.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 wx=d((Rye,Ex)=>{"use strict";var{URL:bw}=require("url"),{Minipass:HX}=te(),Iw=Wf(),{exportNodeCompatibleHeaders:GX}=Iw,Sx=Hf(),{clone:WX,extractContentType:JX,getTotalBytes:KX}=Sx,ZX=yx().version,YX=`minipass-fetch/${ZX} (+https://github.com/isaacs/minipass-fetch)`,Yt=Symbol("Request internals"),Kf=o(i=>typeof i=="object"&&typeof i[Yt]=="object","isRequest"),XX=o(i=>{let e=i&&typeof i=="object"&&Object.getPrototypeOf(i);return!!(e&&e.constructor.name==="AbortSignal")},"isAbortSignal"),Zf=class i extends Sx{static{o(this,"Request")}constructor(e,t={}){let r=Kf(e)?new bw(e.url):e&&e.href?new bw(e.href):new bw(`${e}`);Kf(e)?t={...e[Yt],...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||Kf(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:Kf(e)&&e.body!==null?WX(e):null;super(a,{timeout:t.timeout||e.timeout||0,size:t.size||e.size||0});let c=new Iw(t.headers||e.headers||{});if(a!=null&&!c.has("Content-Type")){let ee=JX(a);ee&&c.append("Content-Type",ee)}let u="signal"in t?t.signal:null;if(u!=null&&!XX(u))throw new TypeError("Expected signal must be an instanceof AbortSignal");let{ca:l,cert:h,ciphers:f,clientCertEngine:p,crl:m,dhparam:y,ecdhCurve:g,family:S,honorCipherOrder:E,key:_,passphrase:b,pfx:w,rejectUnauthorized:I=process.env.NODE_TLS_REJECT_UNAUTHORIZED!=="0",secureOptions:v,secureProtocol:N,servername:P,sessionIdContext:$}=t;this[Yt]={method:s,redirect:t.redirect||e.redirect||"follow",headers:c,parsedURL:r,signal:u,ca:l,cert:h,ciphers:f,clientCertEngine:p,crl:m,dhparam:y,ecdhCurve:g,family:S,honorCipherOrder:E,key:_,passphrase:b,pfx:w,rejectUnauthorized:I,secureOptions:v,secureProtocol:N,servername:P,sessionIdContext:$},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[Yt].method}get url(){return this[Yt].parsedURL.toString()}get headers(){return this[Yt].headers}get redirect(){return this[Yt].redirect}get signal(){return this[Yt].signal}clone(){return new i(this)}get[Symbol.toStringTag](){return"Request"}static getNodeRequestOptions(e){let t=e[Yt].parsedURL,r=new Iw(e[Yt].headers);if(r.has("Accept")||r.set("Accept","*/*"),!/^https?:$/.test(t.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(e.signal&&HX.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?KX(e):null;s&&r.set("Content-Length",s+""),r.has("User-Agent")||r.set("User-Agent",YX),e.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip,deflate");let n=typeof e.agent=="function"?e.agent(t):e.agent;!r.has("Connection")&&!n&&r.set("Connection","close");let{ca:a,cert:c,ciphers:u,clientCertEngine:l,crl:h,dhparam:f,ecdhCurve:p,family:m,honorCipherOrder:y,key:g,passphrase:S,pfx:E,rejectUnauthorized:_,secureOptions:b,secureProtocol:w,servername:I,sessionIdContext:v}=e[Yt];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:GX(r),agent:n,ca:a,cert:c,ciphers:u,clientCertEngine:l,crl:h,dhparam:f,ecdhCurve:p,family:m,honorCipherOrder:y,key:g,passphrase:S,pfx:E,rejectUnauthorized:_,secureOptions:b,secureProtocol:w,servername:I,sessionIdContext:v,timeout:e.timeout}}};Ex.exports=Zf;Object.defineProperties(Zf.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}})});var bx=d((Tye,_x)=>{"use strict";var Ow=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){}};_x.exports=Ow});var go=d((Nye,vx)=>{"use strict";var{URL:Gc}=require("url"),QX=require("http"),e9=require("https"),mo=vc(),{Minipass:Ix}=te(),t9=Hf(),{writeToStream:i9,getTotalBytes:r9}=t9,ks=gx(),Rw=Wf(),{createHeadersLenient:Ox}=Rw,Wc=wx(),{getNodeRequestOptions:s9}=Wc,Br=gw(),vw=bx(),nr=o(async(i,e)=>{if(/^data:/.test(i)){let t=new Wc(i,e);return Promise.resolve().then(()=>new Promise((r,s)=>{let n,a;try{let{pathname:l,search:h}=new Gc(i),f=l.split(",");if(f.length<2)throw new Error("invalid data: URI");let p=f.shift(),m=/;base64$/.test(p);n=m?p.slice(0,-7):p;let y=decodeURIComponent(f.join(",")+h);a=m?Buffer.from(y,"base64"):Buffer.from(y)}catch(l){return s(new Br(`[${t.method}] ${t.url} invalid URL, ${l.message}`,"system",l))}let{signal:c}=t;if(c&&c.aborted)return s(new vw("The user aborted a request."));let u={"Content-Length":a.length};return n&&(u["Content-Type"]=n),r(new ks(a,{headers:u}))}))}return new Promise((t,r)=>{let s=new Wc(i,e),n;try{n=s9(s)}catch(y){return r(y)}let a=(n.protocol==="https:"?e9:QX).request,{signal:c}=s,u=null,l=o(()=>{let y=new vw("The user aborted a request.");r(y),Ix.isStream(s.body)&&typeof s.body.destroy=="function"&&s.body.destroy(y),u&&u.body&&u.body.emit("error",y)},"abort");if(c&&c.aborted)return l();let h=o(()=>{l(),f()},"abortAndFinalize"),f=o(()=>{p.abort(),c&&c.removeEventListener("abort",h),clearTimeout(m)},"finalize"),p=a(n);c&&c.addEventListener("abort",h);let m=null;s.timeout&&p.once("socket",()=>{m=setTimeout(()=>{r(new Br(`network timeout at: ${s.url}`,"request-timeout")),f()},s.timeout)}),p.on("error",y=>{p.res&&p.res.emit("error",y),r(new Br(`request to ${s.url} failed, reason: ${y.message}`,"system",y)),f()}),p.on("response",y=>{clearTimeout(m);let g=Ox(y.headers);if(nr.isRedirect(y.statusCode)){let I=g.get("Location"),v=null;try{v=I===null?null:new Gc(I,s.url).toString()}catch{if(s.redirect!=="manual"){r(new Br(`uri requested responds with an invalid redirect URL: ${I}`,"invalid-redirect")),f();return}}if(s.redirect==="error"){r(new Br(`uri requested responds with a redirect, redirect mode is set to error: ${s.url}`,"no-redirect")),f();return}else if(s.redirect==="manual"){if(v!==null)try{g.set("Location",v)}catch(N){r(N)}}else if(s.redirect==="follow"&&v!==null){if(s.counter>=s.follow){r(new Br(`maximum redirect reached at: ${s.url}`,"max-redirect")),f();return}if(y.statusCode!==303&&s.body&&r9(s)===null){r(new Br("Cannot follow redirect with body being a readable stream","unsupported-redirect")),f();return}s.headers.set("host",new Gc(v).host);let N={headers:new Rw(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},P=new Gc(s.url),$=new Gc(v);P.hostname!==$.hostname&&(N.headers.delete("authorization"),N.headers.delete("cookie")),(y.statusCode===303||(y.statusCode===301||y.statusCode===302)&&s.method==="POST")&&(N.method="GET",N.body=void 0,N.headers.delete("content-length")),t(nr(new Wc(v,N))),f();return}}y.once("end",()=>c&&c.removeEventListener("abort",h));let S=new Ix;S.on("error",f),y.on("error",I=>S.emit("error",I)),y.on("data",I=>S.write(I)),y.on("end",()=>S.end());let E={url:s.url,status:y.statusCode,statusText:y.statusMessage,headers:g,size:s.size,timeout:s.timeout,counter:s.counter,trailer:new Promise(I=>y.on("end",()=>I(Ox(y.trailers))))},_=g.get("Content-Encoding");if(!s.compress||s.method==="HEAD"||_===null||y.statusCode===204||y.statusCode===304){u=new ks(S,E),t(u);return}let b={flush:mo.constants.Z_SYNC_FLUSH,finishFlush:mo.constants.Z_SYNC_FLUSH};if(_==="gzip"||_==="x-gzip"){let I=new mo.Gunzip(b);u=new ks(S.on("error",v=>I.emit("error",v)).pipe(I),E),t(u);return}if(_==="deflate"||_==="x-deflate"){y.once("data",I=>{let v=(I[0]&15)===8?new mo.Inflate:new mo.InflateRaw;S.on("error",N=>v.emit("error",N)).pipe(v),u=new ks(v,E),t(u)});return}if(_==="br"){try{var w=new mo.BrotliDecompress}catch(I){r(I),f();return}S.on("error",I=>w.emit("error",I)).pipe(w),u=new ks(w,E),t(u);return}u=new ks(S,E),t(u)}),i9(p,s)})},"fetch");vx.exports=nr;nr.isRedirect=i=>i===301||i===302||i===303||i===307||i===308;nr.Headers=Rw;nr.Request=Wc;nr.Response=ks;nr.FetchError=Br;nr.AbortError=vw});var Rx=d((Dye,n9)=>{n9.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 Aw=d((xye,Tx)=>{var Ax=Rx();Tx.exports={maxSockets:12,method:"GET",registry:"https://registry.npmjs.org/",timeout:300*1e3,strictSSL:!0,noProxy:process.env.NOPROXY,userAgent:`${Ax.name}@${Ax.version}/node@${process.version}+${process.arch} (${process.platform})`}});var Tw=d((Lye,Cx)=>{var yo="regex",So="path",o9={type:yo,pattern:/\b(npms?_)[a-zA-Z0-9]{36,48}\b/gi,replacement:"[REDACTED_NPM_SECRET]"},a9={type:yo,pattern:/\b(Basic\s+|Bearer\s+)[\w+=\-.]+\b/gi,replacement:"[REDACTED_AUTH_HEADER]"},c9={type:yo,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]"},u9={type:yo,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]"},l9={type:yo,pattern:/(?:https?|ftp):\/\/[^\s/"$.?#].[^\s"]*/gi,replacement:"[REDACTED_URL]"},h9={type:So,predicate:o(({path:i})=>i.endsWith(".headers.authorization"),"predicate"),replacement:"[REDACTED_HEADER_AUTHORIZATION]"},f9={type:So,predicate:o(({path:i})=>i.endsWith(".headers.set-cookie"),"predicate"),replacement:"[REDACTED_HEADER_SET_COOKIE]"},d9={type:So,predicate:o(({path:i})=>i.endsWith(".headers.cookie"),"predicate"),replacement:"[REDACTED_HEADER_COOKIE]"},p9={type:So,predicate:o(({path:i})=>i.endsWith(".request"),"predicate"),replacement:o(i=>({method:i?.method,path:i?.path,headers:i?.headers,url:i?.url}),"replacement")},m9={type:So,predicate:o(({path:i})=>i.endsWith(".response"),"predicate"),replacement:o(i=>({data:i?.data,status:i?.status,headers:i?.headers}),"replacement")};Cx.exports={TYPE_REGEX:yo,TYPE_URL:"url",TYPE_PATH:So,NPM_SECRET:o9,AUTH_HEADER:a9,JSON_WEB_TOKEN:c9,UUID:u9,URL_MATCHER:l9,DEEP_HEADER_AUTHORIZATION:h9,DEEP_HEADER_SET_COOKIE:f9,DEEP_HEADER_COOKIE:d9,REWRITE_REQUEST:p9,REWRITE_RESPONSE:m9}});var Mx=d((Bye,Lx)=>{var{URL_MATCHER:g9,TYPE_URL:Yf,TYPE_REGEX:y9,TYPE_PATH:S9}=Tw(),kr=o((i=0)=>(i=typeof i=="string"?i.length:i,i<8?"*".repeat(8):"*".repeat(i)),"asterisk"),Nx=o(i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"escapeRegExp"),Px=o(i=>{let e=decodeURIComponent(i),t=encodeURIComponent(i);return[...new Set([t,e,i])].map(Nx).join("|")},"urlEncodeRegexGroup"),Xf=o((i,...e)=>{let t="";for(let r=0;r<e.length;r++)t+=i[r]+`(${Px(e[r])})`;return t+=i[i.length-1],new RegExp(t)},"urlEncodeRegexTag"),E9=o(({hostname:i,replacement:e}={})=>({type:Yf,predicate:o(({url:t})=>t.hostname===i,"predicate"),pattern:o(({url:t})=>Xf`(^${t.protocol}//${t.username}:.+@)?${t.hostname}`,"pattern"),replacement:`$1${e||kr()}`}),"redactUrlHostnameMatcher"),w9=o(({param:i,replacement:e}={})=>({type:Yf,predicate:o(({url:t})=>t.searchParams.has(i),"predicate"),pattern:o(({url:t})=>Xf`(${i}=)${t.searchParams.get(i)}`,"pattern"),replacement:`$1${e||kr()}`}),"redactUrlSearchParamsMatcher"),Dx=o(({replacement:i}={})=>({type:Yf,predicate:o(({url:e})=>e.password,"predicate"),pattern:o(({url:e})=>Xf`(^${e.protocol}//${e.username}:)${e.password}`,"pattern"),replacement:`$1${i||kr()}`}),"redactUrlPasswordMatcher"),xx=o((...i)=>e=>{try{let t=new URL(e);return Cw(...i)(e,{url:t})}catch{return e}},"redactUrlReplacement"),_9=o((...i)=>({...g9,replacement:xx(...i)}),"redactUrlMatcher"),b9={[y9]:i=>e=>(typeof e=="string"&&(e=e.replace(i.pattern,i.replacement)),e),[Yf]:i=>(e,t)=>{if(typeof e=="string")try{let r=t?.url||new URL(e),{predicate:s,pattern:n}=i;s({url:r})&&(e=e.replace(n({url:r}),i.replacement))}catch{return e}return e},[S9]:i=>(e,t)=>{let r=t?.path,s=r.join(".").toLowerCase(),{predicate:n,replacement:a}=i,c=typeof a=="function"?a:()=>a;return n({rawPath:r,path:s})&&(e=c(e,{rawPath:r,path:s})),e}},I9=o(i=>b9[i.type](i),"redactMatcher"),Cw=o((...i)=>(e,t)=>i.flat().reduce((s,n)=>(typeof n=="function"?n:I9(n))(s,t),e),"redactMatchers"),O9=o(()=>(i,e)=>typeof e=="number"?kr(i):e+kr(i.substring(e.length).length),"redactDynamicReplacement"),v9=o(i=>(e,t)=>typeof t=="number"?kr(i):t+kr(i),"redactFixedReplacement"),R9=o((i,e)=>Cw(Dx({replacement:e}))(i),"redactUrlPassword");Lx.exports={asterisk:kr,escapeRegExp:Nx,urlEncodeRegexGroup:Px,urlEncodeRegexTag:Xf,redactUrlHostnameMatcher:E9,redactUrlSearchParamsMatcher:w9,redactUrlPasswordMatcher:Dx,redactUrlMatcher:_9,redactUrlReplacement:xx,redactDynamicReplacement:O9,redactFixedReplacement:v9,redactMatchers:Cw,redactUrlPassword:R9}});var Ux=d((Fye,Fx)=>{var Bx=Tw(),{redactUrlPassword:A9}=Mx(),Nw="***",Pw=o(i=>typeof i!="string"||!i?i:A9(i,Nw).replace(Bx.NPM_SECRET.pattern,`npm_${Nw}`).replace(Bx.UUID.pattern,Nw),"redact"),kx=o(i=>{let e=/[\s=]/g,t=null,r="",s=0;for(;t=e.exec(i);)r+=Pw(i.slice(s,t.index))+t[0],s=e.lastIndex;return r+Pw(i.slice(s))},"splitAndRedact"),T9=o(i=>typeof i=="string"?kx(i):Array.isArray(i)?i.map(e=>typeof e=="string"?kx(e):e):i,"redactLog");Fx.exports={redact:Pw,redactLog:T9}});var qx=d((jye,$x)=>{"use strict";var Jc=dw(),{Response:C9}=go(),N9=Aw(),{log:Qf}=St(),{redact:P9}=Ux(),D9="https://github.com/npm/cli/wiki/No-auth-for-URI,-but-auth-present-for-scoped-registry",x9=o(async({method:i,uri:e,res:t,startTime:r,auth:s,opts:n})=>(n={...N9,...n},t.headers.has("npm-notice")&&!t.headers.has("x-local-cache")&&Qf.notice("",t.headers.get("npm-notice")),t.status>=400?(jx(i,t,r),s&&s.scopeAuthKey&&!s.token&&!s.auth&&Qf.warn("registry",`No auth for URI, but auth present for scoped registry.
39
40
 
40
41
  URI: ${e}
41
42
  Scoped Registry Key: ${s.scopeAuthKey}
42
43
 
43
- More info here: ${N9}`),D9(i,t,r,n)):(t.body.on("end",()=>jx(i,t,r,n)),n.ignoreBody?(t.body.resume(),new A9(null,t)):t)),"checkResponse");$x.exports=P9;function jx(i,e,t){let r=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})`:"",u=C9(e.url);a==="hit"?Qf.http("cache",`${u} ${r}ms${n}${c}`):Qf.http("fetch",`${i.toUpperCase()} ${e.status} ${u} ${r}ms${n}${c}`)}o(jx,"logRequest");function D9(i,e,t,r){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 Jc.HttpErrorAuthIPAddress(i,e,n,r.spec):a.indexOf("otp")!==-1?new Jc.HttpErrorAuthOTP(i,e,n,r.spec):new Jc.HttpErrorAuthUnknown(i,e,n,r.spec)}else throw e.status===401&&s!=null&&/one-time pass/.test(s.toString("utf8"))?new Jc.HttpErrorAuthOTP(i,e,n,r.spec):new Jc.HttpErrorGeneral(i,e,n,r.spec)})}o(D9,"checkErrors")});var Wx=d((jye,Gx)=>{"use strict";var x9=require("fs"),L9=Un(),{URL:Dw}=require("url"),Vx=o((i,e)=>{let t=new Dw(i),r=`//${t.host}${t.pathname}`;for(;r.length>2;){let s=M9(r,e);if(s)return{regKey:r,authKey:s};r=r.replace(/([^/]+|\/)$/,"")}return{regKey:!1,authKey:null}},"regFromURI"),M9=o((i,e)=>e[`${i}:_authToken`]?"_authToken":e[`${i}:_auth`]?"_auth":e[`${i}:username`]&&e[`${i}:_password`]?"username":e[`${i}:certfile`]&&e[`${i}:keyfile`]?"certfile":!1,"hasAuth"),B9=o((i,e)=>{let t=new Dw(i),r=new Dw(e);return t.host===r.host},"sameHost"),k9=o(i=>{let{spec:e}=i,{scope:t,subSpec:r}=e?L9(e):{},s=r&&r.scope,n=r?s:t;return n&&i[`${n}:registry`]||i.registry},"getRegistry"),zx=o(i=>{try{return x9.readFileSync(i,"utf8")}catch(e){if(e.code!=="ENOENT")throw e;return null}},"maybeReadFile"),Hx=o((i,e={})=>{let{forceAuth:t}=e;if(!i)throw new Error("URI is required");let{regKey:r,authKey:s}=Vx(i,t||e);if(t&&!r)return new Kc({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(!r){let f=k9(e);if(f&&i!==f&&B9(i,f))return Hx(f,e);if(f!==e.registry){let{regKey:p,authKey:m}=Vx(f,e);return new Kc({scopeAuthKey:p,regKey:p,authKey:m})}}let{[`${r}:_authToken`]:n,[`${r}:username`]:a,[`${r}:_password`]:c,[`${r}:_auth`]:u,[`${r}:certfile`]:l,[`${r}:keyfile`]:h}=e;return new Kc({scopeAuthKey:null,regKey:r,authKey:s,token:n,auth:u,username:a,password:c,certfile:l,keyfile:h})},"getAuth"),Kc=class{static{o(this,"Auth")}constructor({token:e,auth:t,username:r,password:s,scopeAuthKey:n,certfile:a,keyfile:c,regKey:u,authKey:l}){if(this.scopeAuthKey=n,this.regKey=u,this.authKey=l,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(r&&s){let h=Buffer.from(s,"base64").toString("utf8");this.auth=Buffer.from(`${r}:${h}`,"utf8").toString("base64"),this.isBasicAuth=!0}if(a&&c){let h=zx(a,"utf-8"),f=zx(c,"utf-8");h&&f&&(this.cert=h,this.key=f)}}};Gx.exports=Hx});var Kx=d((qye,Jx)=>{var F9=require("dns"),U9=["if-modified-since","if-none-match","if-unmodified-since","if-match","if-range"],j9=o(i=>{let{strictSSL:e,...t}={...i};if(t.method=t.method?t.method.toUpperCase():"GET",e==null?t.rejectUnauthorized=process.env.NODE_TLS_REJECT_UNAUTHORIZED!=="0":t.rejectUnauthorized=e!==!1,!t.retry)t.retry={retries:0};else if(typeof t.retry=="string"){let r=parseInt(t.retry,10);isFinite(r)?t.retry={retries:r}:t.retry={retries:0}}else typeof t.retry=="number"?t.retry={retries:t.retry}:t.retry={retries:0,...t.retry};return t.dns={ttl:300*1e3,lookup:F9.lookup,...t.dns},t.cache=t.cache||"default",t.cache==="default"&&Object.keys(t.headers||{}).some(s=>U9.includes(s.toLowerCase()))&&(t.cache="no-store"),t.cacheAdditionalHeaders=t.cacheAdditionalHeaders||[],t.cacheManager&&!t.cachePath&&(t.cachePath=t.cacheManager),t},"configureOptions");Jx.exports=j9});var Yx=d((Hye,Zx)=>{"use strict";var $9=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),q9=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),V9=new Set([500,502,503,504]),z9={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},H9={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function or(i){let e=parseInt(i,10);return isFinite(e)?e:0}o(or,"toNumberOrZero");function G9(i){return i?V9.has(i.status):!0}o(G9,"isErrorResponse");function xw(i){let e={};if(!i)return e;let t=i.trim().split(/,/);for(let r of t){let[s,n]=r.split(/=/,2);e[s.trim()]=n===void 0?!0:n.trim().replace(/^"|"$/g,"")}return e}o(xw,"parseCacheControl");function W9(i){let e=[];for(let t in i){let r=i[t];e.push(r===!0?t:t+"="+r)}if(e.length)return e.join(", ")}o(W9,"formatCacheControl");Zx.exports=class{static{o(this,"CachePolicy")}constructor(e,t,{shared:r,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=r!==!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=xw(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=xw(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":W9(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())&&q9.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||$9.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=xw(e.headers["cache-control"]);return t["no-cache"]||/no-cache/.test(e.headers.pragma)?this._evaluateRequestMissResult(e):t["max-age"]&&this.age()>or(t["max-age"])?this._evaluateRequestMissResult(e):t["min-fresh"]&&this.maxAge()-this.age()<or(t["min-fresh"])?this._evaluateRequestMissResult(e):this.stale()?"max-stale"in t&&(t["max-stale"]===!0||t["max-stale"]>this.age()-this.maxAge())?this._evaluateRequestHitResult(void 0):this.useStaleWhileRevalidate()?this._evaluateRequestHitResult(this._evaluateRequestRevalidation(e,!1)):this._evaluateRequestMissResult(e):this._evaluateRequestHitResult(void 0)}_requestMatches(e,t){return!!((!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||t&&e.method==="HEAD")&&this._varyMatches(e))}_allowsStoringAuthenticated(){return!!(this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"])}_varyMatches(e){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary==="*")return!1;let t=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let r of t)if(e.headers[r]!==this._reqHeaders[r])return!1;return!0}_copyWithoutHopByHopHeaders(e){let t={};for(let r in e)z9[r]||(t[r]=e[r]);if(e.connection){let r=e.connection.trim().split(/\s*,\s*/);for(let s of r)delete t[s]}if(t.warning){let r=t.warning.split(/,/).filter(s=>!/^\s*1[0-9][0-9]/.test(s));r.length?t.warning=r.join(",").trim():delete t.warning}return t}responseHeaders(){let e=this._copyWithoutHopByHopHeaders(this._resHeaders),t=this.age();return t>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'),e.age=`${Math.round(t)}`,e.date=new Date(this.now()).toUTCString(),e}date(){let e=Date.parse(this._resHeaders.date);return isFinite(e)?e:this._responseTime}age(){let e=this._ageValue(),t=(this.now()-this._responseTime)/1e3;return e+t}_ageValue(){return or(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 or(this._rescc["s-maxage"])}if(this._rescc["max-age"])return or(this._rescc["max-age"]);let e=this._rescc.immutable?this._immutableMinTtl:0,t=this.date();if(this._resHeaders.expires){let r=Date.parse(this._resHeaders.expires);return Number.isNaN(r)||r<t?0:Math.max(e,(r-t)/1e3)}if(this._resHeaders["last-modified"]){let r=Date.parse(this._resHeaders["last-modified"]);if(isFinite(r)&&t>r)return Math.max(e,(t-r)/1e3*this._cacheHeuristic)}return e}timeToLive(){let e=this.maxAge()-this.age(),t=e+or(this._rescc["stale-if-error"]),r=e+or(this._rescc["stale-while-revalidate"]);return Math.round(Math.max(0,e,t,r)*1e3)}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+or(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){let e=or(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()&&G9(t))return{policy:this,modified:!1,matches:!0};if(!t||!t.headers)throw Error("Response headers missing");let r=!1;t.status!==void 0&&t.status!=304?r=!1:t.headers.etag&&!/^\s*W\//.test(t.headers.etag)?r=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag:this._resHeaders.etag&&t.headers.etag?r=this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?r=this._resHeaders["last-modified"]===t.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!t.headers.etag&&!t.headers["last-modified"]&&(r=!0);let s={shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl,ignoreCargoCult:this._ignoreCargoCult};if(!r)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&&!H9[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 tL=d((Wye,Lw)=>{"use strict";Lw.exports=eL;Lw.exports.preferredCharsets=eL;var J9=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function K9(i){for(var e=i.split(","),t=0,r=0;t<e.length;t++){var s=Z9(e[t].trim(),t);s&&(e[r++]=s)}return e.length=r,e}o(K9,"parseAcceptCharset");function Z9(i,e){var t=J9.exec(i);if(!t)return null;var r=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:r,q:s,i:e}}o(Z9,"parseCharset");function Y9(i,e,t){for(var r={o:-1,q:0,s:0},s=0;s<e.length;s++){var n=X9(i,e[s],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(Y9,"getCharsetPriority");function X9(i,e,t){var r=0;if(e.charset.toLowerCase()===i.toLowerCase())r|=1;else if(e.charset!=="*")return null;return{i:t,o:e.i,q:e.q,s:r}}o(X9,"specify");function eL(i,e){var t=K9(i===void 0?"*":i||"");if(!e)return t.filter(Qx).sort(Xx).map(Q9);var r=e.map(o(function(n,a){return Y9(n,t,a)},"getPriority"));return r.filter(Qx).sort(Xx).map(o(function(n){return e[r.indexOf(n)]},"getCharset"))}o(eL,"preferredCharsets");function Xx(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}o(Xx,"compareSpecs");function Q9(i){return i.charset}o(Q9,"getFullCharset");function Qx(i){return i.q>0}o(Qx,"isQuality")});var nL=d((Kye,Mw)=>{"use strict";Mw.exports=sL;Mw.exports.preferredEncodings=sL;var e8=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function t8(i){for(var e=i.split(","),t=!1,r=1,s=0,n=0;s<e.length;s++){var a=i8(e[s].trim(),s);a&&(e[n++]=a,t=t||rL("identity",a),r=Math.min(r,a.q||1))}return t||(e[n++]={encoding:"identity",q:r,i:s}),e.length=n,e}o(t8,"parseAcceptEncoding");function i8(i,e){var t=e8.exec(i);if(!t)return null;var r=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:r,q:s,i:e}}o(i8,"parseEncoding");function r8(i,e,t){for(var r={encoding:i,o:-1,q:0,s:0},s=0;s<e.length;s++){var n=rL(i,e[s],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(r8,"getEncodingPriority");function rL(i,e,t){var r=0;if(e.encoding.toLowerCase()===i.toLowerCase())r|=1;else if(e.encoding!=="*")return null;return{encoding:i,i:t,o:e.i,q:e.q,s:r}}o(rL,"specify");function sL(i,e,t){var r=t8(i||""),s=t?o(function(c,u){if(c.q!==u.q)return u.q-c.q;var l=t.indexOf(c.encoding),h=t.indexOf(u.encoding);return l===-1&&h===-1?u.s-c.s||c.o-u.o||c.i-u.i:l!==-1&&h!==-1?l-h:l===-1?1:-1},"comparator"):s8;if(!e)return r.filter(iL).sort(s).map(n8);var n=e.map(o(function(c,u){return r8(c,r,u)},"getPriority"));return n.filter(iL).sort(s).map(o(function(c){return e[n.indexOf(c)]},"getEncoding"))}o(sL,"preferredEncodings");function s8(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i}o(s8,"compareSpecs");function n8(i){return i.encoding}o(n8,"getFullEncoding");function iL(i){return i.q>0}o(iL,"isQuality")});var lL=d((Yye,Bw)=>{"use strict";Bw.exports=uL;Bw.exports.preferredLanguages=uL;var o8=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function a8(i){for(var e=i.split(","),t=0,r=0;t<e.length;t++){var s=cL(e[t].trim(),t);s&&(e[r++]=s)}return e.length=r,e}o(a8,"parseAcceptLanguage");function cL(i,e){var t=o8.exec(i);if(!t)return null;var r=t[1],s=t[2],n=r;s&&(n+="-"+s);var a=1;if(t[3])for(var c=t[3].split(";"),u=0;u<c.length;u++){var l=c[u].split("=");l[0]==="q"&&(a=parseFloat(l[1]))}return{prefix:r,suffix:s,q:a,i:e,full:n}}o(cL,"parseLanguage");function c8(i,e,t){for(var r={o:-1,q:0,s:0},s=0;s<e.length;s++){var n=u8(i,e[s],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(c8,"getLanguagePriority");function u8(i,e,t){var r=cL(i);if(!r)return null;var s=0;if(e.full.toLowerCase()===r.full.toLowerCase())s|=4;else if(e.prefix.toLowerCase()===r.full.toLowerCase())s|=2;else if(e.full.toLowerCase()===r.prefix.toLowerCase())s|=1;else if(e.full!=="*")return null;return{i:t,o:e.i,q:e.q,s}}o(u8,"specify");function uL(i,e){var t=a8(i===void 0?"*":i||"");if(!e)return t.filter(aL).sort(oL).map(l8);var r=e.map(o(function(n,a){return c8(n,t,a)},"getPriority"));return r.filter(aL).sort(oL).map(o(function(n){return e[r.indexOf(n)]},"getLanguage"))}o(uL,"preferredLanguages");function oL(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}o(oL,"compareSpecs");function l8(i){return i.full}o(l8,"getFullLanguage");function aL(i){return i.q>0}o(aL,"isQuality")});var gL=d((Qye,kw)=>{"use strict";kw.exports=pL;kw.exports.preferredMediaTypes=pL;var h8=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function f8(i){for(var e=y8(i),t=0,r=0;t<e.length;t++){var s=dL(e[t].trim(),t);s&&(e[r++]=s)}return e.length=r,e}o(f8,"parseAccept");function dL(i,e){var t=h8.exec(i);if(!t)return null;var r=Object.create(null),s=1,n=t[2],a=t[1];if(t[3])for(var c=S8(t[3]).map(g8),u=0;u<c.length;u++){var l=c[u],h=l[0].toLowerCase(),f=l[1],p=f&&f[0]==='"'&&f[f.length-1]==='"'?f.slice(1,-1):f;if(h==="q"){s=parseFloat(p);break}r[h]=p}return{type:a,subtype:n,params:r,q:s,i:e}}o(dL,"parseMediaType");function d8(i,e,t){for(var r={o:-1,q:0,s:0},s=0;s<e.length;s++){var n=p8(i,e[s],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(d8,"getMediaTypePriority");function p8(i,e,t){var r=dL(i),s=0;if(!r)return null;if(e.type.toLowerCase()==r.type.toLowerCase())s|=4;else if(e.type!="*")return null;if(e.subtype.toLowerCase()==r.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()==(r.params[a]||"").toLowerCase()}))s|=1;else return null;return{i:t,o:e.i,q:e.q,s}}o(p8,"specify");function pL(i,e){var t=f8(i===void 0?"*/*":i||"");if(!e)return t.filter(fL).sort(hL).map(m8);var r=e.map(o(function(n,a){return d8(n,t,a)},"getPriority"));return r.filter(fL).sort(hL).map(o(function(n){return e[r.indexOf(n)]},"getType"))}o(pL,"preferredMediaTypes");function hL(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}o(hL,"compareSpecs");function m8(i){return i.type+"/"+i.subtype}o(m8,"getFullType");function fL(i){return i.q>0}o(fL,"isQuality");function mL(i){for(var e=0,t=0;(t=i.indexOf('"',t))!==-1;)e++,t++;return e}o(mL,"quoteCount");function g8(i){var e=i.indexOf("="),t,r;return e===-1?t=i:(t=i.slice(0,e),r=i.slice(e+1)),[t,r]}o(g8,"splitKeyValuePair");function y8(i){for(var e=i.split(","),t=1,r=0;t<e.length;t++)mL(e[r])%2==0?e[++r]=e[t]:e[r]+=","+e[t];return e.length=r+1,e}o(y8,"splitMediaTypes");function S8(i){for(var e=i.split(";"),t=1,r=0;t<e.length;t++)mL(e[r])%2==0?e[++r]=e[t]:e[r]+=";"+e[t];e.length=r+1;for(var t=0;t<e.length;t++)e[t]=e[t].trim();return e}o(S8,"splitParameters")});var yL=d((tSe,Fw)=>{"use strict";var E8=tL(),w8=nL(),_8=lL(),b8=gL();Fw.exports=Y;Fw.exports.Negotiator=Y;function Y(i){if(!(this instanceof Y))return new Y(i);this.request=i}o(Y,"Negotiator");Y.prototype.charset=o(function(e){var t=this.charsets(e);return t&&t[0]},"charset");Y.prototype.charsets=o(function(e){return E8(this.request.headers["accept-charset"],e)},"charsets");Y.prototype.encoding=o(function(e,t){var r=this.encodings(e,t);return r&&r[0]},"encoding");Y.prototype.encodings=o(function(e,t){var r=t||{};return w8(this.request.headers["accept-encoding"],e,r.preferred)},"encodings");Y.prototype.language=o(function(e){var t=this.languages(e);return t&&t[0]},"language");Y.prototype.languages=o(function(e){return _8(this.request.headers["accept-language"],e)},"languages");Y.prototype.mediaType=o(function(e){var t=this.mediaTypes(e);return t&&t[0]},"mediaType");Y.prototype.mediaTypes=o(function(e){return b8(this.request.headers.accept,e)},"mediaTypes");Y.prototype.preferredCharset=Y.prototype.charset;Y.prototype.preferredCharsets=Y.prototype.charsets;Y.prototype.preferredEncoding=Y.prototype.encoding;Y.prototype.preferredEncodings=Y.prototype.encodings;Y.prototype.preferredLanguage=Y.prototype.language;Y.prototype.preferredLanguages=Y.prototype.languages;Y.prototype.preferredMediaType=Y.prototype.mediaType;Y.prototype.preferredMediaTypes=Y.prototype.mediaTypes});var jw=d((rSe,bL)=>{var SL=Yx(),EL=yL(),I8=ai(),wL={shared:!1,ignoreCargoCult:!0},O8={status:200,headers:{}},Eo=o(i=>{let e={method:i.method,url:i.url,headers:{},compress:i.compress};return i.headers.forEach((t,r)=>{e.headers[r]=t}),e},"requestObject"),_L=o(i=>{let e={status:i.status,headers:{}};return i.headers.forEach((t,r)=>{e.headers[r]=t}),e},"responseObject"),Uw=class{static{o(this,"CachePolicy")}constructor({entry:e,request:t,response:r,options:s}){this.entry=e,this.request=Eo(t),this.response=_L(r),this.options=s,this.policy=new SL(this.request,this.response,wL),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 SL(Eo(e),O8,wL).storable()}satisfies(e){let t=Eo(e);if(this.request.headers.host!==t.headers.host||this.request.compress!==t.compress)return!1;let r=new EL(this.request),s=new EL(t);return JSON.stringify(r.mediaTypes())!==JSON.stringify(s.mediaTypes())||JSON.stringify(r.languages())!==JSON.stringify(s.languages())||JSON.stringify(r.encodings())!==JSON.stringify(s.encodings())?!1:this.options.integrity?I8.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=Eo(e);return t.method="GET",!this.policy.satisfiesWithoutRevalidation(t)}responseHeaders(){return this.policy.responseHeaders()}revalidationHeaders(e){let t=Eo(e);return this.policy.revalidationHeaders(t)}revalidated(e,t){let r=Eo(e),s=_L(t);return!this.policy.revalidatedPolicy(r,s).modified}};bL.exports=Uw});var OL=d((nSe,IL)=>{var $w=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"}};IL.exports={NotCachedError:$w}});var Vw=d((aSe,vL)=>{"use strict";var v8=In(),qw=class extends v8{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)}};vL.exports=qw});var AL=d((uSe,RL)=>{var{URL:R8,format:A8}=require("url"),T8={auth:!1,fragment:!1,search:!0,unicode:!1},C8=o(i=>{let e=new R8(i.url);return`make-fetch-happen:request-cache:${A8(e,T8)}`},"cacheKey");RL.exports=C8});var zw=d((hSe,CL)=>{"use strict";var{LRUCache:N8}=os(),TL=require("dns"),ed=new N8({max:50}),P8=o(({family:i=0,hints:e=TL.ADDRCONFIG,all:t=!1,verbatim:r=void 0,ttl:s=300*1e3,lookup:n=TL.lookup})=>({hints:e,lookup:o((a,...c)=>{let u=c.pop(),l=c[0]??{},h={family:i,hints:e,all:t,verbatim:r,...typeof l=="number"?{family:l}:l},f=JSON.stringify({hostname:a,...h});if(ed.has(f)){let p=ed.get(f);return process.nextTick(u,null,...p)}n(a,h,(p,...m)=>p?u(p):(ed.set(f,m,{ttl:s}),u(null,...m)))},"lookup")}),"getOptions");CL.exports={cache:ed,getOptions:P8}});var Hw=d((dSe,PL)=>{"use strict";var D8=zw(),x8=o(i=>{let e=parseInt(i.family??"0",10),t=i.keepAlive??!0,r={keepAliveMsecs:t?1e3:void 0,maxSockets:i.maxSockets??15,maxTotalSockets:1/0,maxFreeSockets:t?256:void 0,scheduling:"fifo",...i,family:e,keepAlive:t,timeouts:{idle:i.timeout??0,connection:0,response:0,transfer:0,...i.timeouts},...D8.getOptions({family:e,...i.dns})};return delete r.timeout,r},"normalizeOptions"),NL=o(i=>{let e="",t=Object.entries(i).sort((r,s)=>r[0]-s[0]);for(let[r,s]of t)s==null?s="null":s instanceof URL?s=s.toString():typeof s=="object"&&(s=NL(s)),e+=`${r}:${s}:`;return e},"createKey"),L8=o(({secureEndpoint:i,...e})=>NL({secureEndpoint:!!i,family:e.family,hints:e.hints,localAddress:e.localAddress,strictSsl:i?!!e.rejectUnauthorized:!1,ca:i?e.ca:null,cert:i?e.cert:null,key:i?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");PL.exports={normalizeOptions:x8,cacheOptions:L8}});var Fs=d((mSe,DL)=>{"use strict";function Zc(){return o(function(){},"noop")}o(Zc,"debug");Zc.enabled=!1;Zc.names=[];Zc.skips=[];Zc.formatters={};DL.exports=Zc});var ML=d(tt=>{"use strict";var M8=tt&&tt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),B8=tt&&tt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),xL=tt&&tt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&M8(e,i,t);return B8(e,i),e};Object.defineProperty(tt,"__esModule",{value:!0});tt.req=tt.json=tt.toBuffer=void 0;var k8=xL(require("http")),F8=xL(require("https"));async function LL(i){let e=0,t=[];for await(let r of i)e+=r.length,t.push(r);return Buffer.concat(t,e)}o(LL,"toBuffer");tt.toBuffer=LL;async function U8(i){let t=(await LL(i)).toString("utf8");try{return JSON.parse(t)}catch(r){let s=r;throw s.message+=` (input: ${t})`,s}}o(U8,"json");tt.json=U8;function j8(i,e={}){let r=((typeof i=="string"?i:i.href).startsWith("https:")?F8:k8).request(i,e),s=new Promise((n,a)=>{r.once("response",n).once("error",a).end()});return r.then=s.then.bind(s),r}o(j8,"req");tt.req=j8});var Yc=d(mt=>{"use strict";var kL=mt&&mt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),$8=mt&&mt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),FL=mt&&mt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&kL(e,i,t);return $8(e,i),e},q8=mt&&mt.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&kL(e,i,t)};Object.defineProperty(mt,"__esModule",{value:!0});mt.Agent=void 0;var V8=FL(require("net")),BL=FL(require("http")),z8=require("https");q8(ML(),mt);var _i=Symbol("AgentBaseInternalState"),Gw=class extends BL.Agent{static{o(this,"Agent")}constructor(e){super(e),this[_i]={}}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(`
44
- `).some(r=>r.indexOf("(https.js:")!==-1||r.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let t=new V8.Socket({writable:!1});return this.sockets[e].push(t),this.totalSocketCount++,t}decrementSockets(e,t){if(!this.sockets[e]||t===null)return;let r=this.sockets[e],s=r.indexOf(t);s!==-1&&(r.splice(s,1),this.totalSocketCount--,r.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?z8.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,t,r){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 BL.Agent)try{return c.addRequest(e,s)}catch(u){return r(u)}this[_i].currentSocket=c,super.createSocket(e,t,r)},c=>{this.decrementSockets(n,a),r(c)})}createConnection(){let e=this[_i].currentSocket;if(this[_i].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[_i].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[_i]&&(this[_i].defaultPort=e)}get protocol(){return this[_i].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[_i]&&(this[_i].protocol=e)}};mt.Agent=Gw});var $L=d(Nt=>{"use strict";var H8=Nt&&Nt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),G8=Nt&&Nt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),jL=Nt&&Nt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&H8(e,i,t);return G8(e,i),e},W8=Nt&&Nt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Nt,"__esModule",{value:!0});Nt.HttpProxyAgent=void 0;var J8=jL(require("net")),K8=jL(require("tls")),Z8=W8(Fs()),Y8=require("events"),X8=Yc(),UL=require("url"),wo=(0,Z8.default)("http-proxy-agent"),td=class extends X8.Agent{static{o(this,"HttpProxyAgent")}constructor(e,t){super(t),this.proxy=typeof e=="string"?new UL.URL(e):e,this.proxyHeaders=t?.headers??{},wo("Creating new HttpProxyAgent instance: %o",this.proxy.href);let r=(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?Q8(t,"headers"):null,host:r,port:s}}addRequest(e,t){e._header=null,this.setRequestProps(e,t),super.addRequest(e,t)}setRequestProps(e,t){let{proxy:r}=this,s=t.secureEndpoint?"https:":"http:",n=e.getHeader("host")||"localhost",a=`${s}//${n}`,c=new UL.URL(e.path,a);t.port!==80&&(c.port=String(t.port)),e.path=String(c);let u=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders};if(r.username||r.password){let l=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;u["Proxy-Authorization"]=`Basic ${Buffer.from(l).toString("base64")}`}u["Proxy-Connection"]||(u["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let l of Object.keys(u)){let h=u[l];h&&e.setHeader(l,h)}}async connect(e,t){e._header=null,e.path.includes("://")||this.setRequestProps(e,t);let r,s;wo("Regenerating stored HTTP header string for request"),e._implicitHeader(),e.outputData&&e.outputData.length>0&&(wo("Patching connection write() output buffer with updated header"),r=e.outputData[0].data,s=r.indexOf(`\r
44
+ More info here: ${D9}`),L9(i,t,r,n)):(t.body.on("end",()=>jx(i,t,r,n)),n.ignoreBody?(t.body.resume(),new C9(null,t)):t)),"checkResponse");$x.exports=x9;function jx(i,e,t){let r=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})`:"",u=P9(e.url);a==="hit"?Qf.http("cache",`${u} ${r}ms${n}${c}`):Qf.http("fetch",`${i.toUpperCase()} ${e.status} ${u} ${r}ms${n}${c}`)}o(jx,"logRequest");function L9(i,e,t,r){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 Jc.HttpErrorAuthIPAddress(i,e,n,r.spec):a.indexOf("otp")!==-1?new Jc.HttpErrorAuthOTP(i,e,n,r.spec):new Jc.HttpErrorAuthUnknown(i,e,n,r.spec)}else throw e.status===401&&s!=null&&/one-time pass/.test(s.toString("utf8"))?new Jc.HttpErrorAuthOTP(i,e,n,r.spec):new Jc.HttpErrorGeneral(i,e,n,r.spec)})}o(L9,"checkErrors")});var Wx=d((qye,Gx)=>{"use strict";var M9=require("fs"),B9=Un(),{URL:Dw}=require("url"),Vx=o((i,e)=>{let t=new Dw(i),r=`//${t.host}${t.pathname}`;for(;r.length>2;){let s=k9(r,e);if(s)return{regKey:r,authKey:s};r=r.replace(/([^/]+|\/)$/,"")}return{regKey:!1,authKey:null}},"regFromURI"),k9=o((i,e)=>e[`${i}:_authToken`]?"_authToken":e[`${i}:_auth`]?"_auth":e[`${i}:username`]&&e[`${i}:_password`]?"username":e[`${i}:certfile`]&&e[`${i}:keyfile`]?"certfile":!1,"hasAuth"),F9=o((i,e)=>{let t=new Dw(i),r=new Dw(e);return t.host===r.host},"sameHost"),U9=o(i=>{let{spec:e}=i,{scope:t,subSpec:r}=e?B9(e):{},s=r&&r.scope,n=r?s:t;return n&&i[`${n}:registry`]||i.registry},"getRegistry"),zx=o(i=>{try{return M9.readFileSync(i,"utf8")}catch(e){if(e.code!=="ENOENT")throw e;return null}},"maybeReadFile"),Hx=o((i,e={})=>{let{forceAuth:t}=e;if(!i)throw new Error("URI is required");let{regKey:r,authKey:s}=Vx(i,t||e);if(t&&!r)return new Kc({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(!r){let f=U9(e);if(f&&i!==f&&F9(i,f))return Hx(f,e);if(f!==e.registry){let{regKey:p,authKey:m}=Vx(f,e);return new Kc({scopeAuthKey:p,regKey:p,authKey:m})}}let{[`${r}:_authToken`]:n,[`${r}:username`]:a,[`${r}:_password`]:c,[`${r}:_auth`]:u,[`${r}:certfile`]:l,[`${r}:keyfile`]:h}=e;return new Kc({scopeAuthKey:null,regKey:r,authKey:s,token:n,auth:u,username:a,password:c,certfile:l,keyfile:h})},"getAuth"),Kc=class{static{o(this,"Auth")}constructor({token:e,auth:t,username:r,password:s,scopeAuthKey:n,certfile:a,keyfile:c,regKey:u,authKey:l}){if(this.scopeAuthKey=n,this.regKey=u,this.authKey=l,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(r&&s){let h=Buffer.from(s,"base64").toString("utf8");this.auth=Buffer.from(`${r}:${h}`,"utf8").toString("base64"),this.isBasicAuth=!0}if(a&&c){let h=zx(a,"utf-8"),f=zx(c,"utf-8");h&&f&&(this.cert=h,this.key=f)}}};Gx.exports=Hx});var Kx=d((zye,Jx)=>{var j9=require("dns"),$9=["if-modified-since","if-none-match","if-unmodified-since","if-match","if-range"],q9=o(i=>{let{strictSSL:e,...t}={...i};if(t.method=t.method?t.method.toUpperCase():"GET",e==null?t.rejectUnauthorized=process.env.NODE_TLS_REJECT_UNAUTHORIZED!=="0":t.rejectUnauthorized=e!==!1,!t.retry)t.retry={retries:0};else if(typeof t.retry=="string"){let r=parseInt(t.retry,10);isFinite(r)?t.retry={retries:r}:t.retry={retries:0}}else typeof t.retry=="number"?t.retry={retries:t.retry}:t.retry={retries:0,...t.retry};return t.dns={ttl:300*1e3,lookup:j9.lookup,...t.dns},t.cache=t.cache||"default",t.cache==="default"&&Object.keys(t.headers||{}).some(s=>$9.includes(s.toLowerCase()))&&(t.cache="no-store"),t.cacheAdditionalHeaders=t.cacheAdditionalHeaders||[],t.cacheManager&&!t.cachePath&&(t.cachePath=t.cacheManager),t},"configureOptions");Jx.exports=q9});var Yx=d((Wye,Zx)=>{"use strict";var V9=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),z9=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),H9=new Set([500,502,503,504]),G9={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},W9={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function or(i){let e=parseInt(i,10);return isFinite(e)?e:0}o(or,"toNumberOrZero");function J9(i){return i?H9.has(i.status):!0}o(J9,"isErrorResponse");function xw(i){let e={};if(!i)return e;let t=i.trim().split(/,/);for(let r of t){let[s,n]=r.split(/=/,2);e[s.trim()]=n===void 0?!0:n.trim().replace(/^"|"$/g,"")}return e}o(xw,"parseCacheControl");function K9(i){let e=[];for(let t in i){let r=i[t];e.push(r===!0?t:t+"="+r)}if(e.length)return e.join(", ")}o(K9,"formatCacheControl");Zx.exports=class{static{o(this,"CachePolicy")}constructor(e,t,{shared:r,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=r!==!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=xw(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=xw(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":K9(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())&&z9.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||V9.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=xw(e.headers["cache-control"]);return t["no-cache"]||/no-cache/.test(e.headers.pragma)?this._evaluateRequestMissResult(e):t["max-age"]&&this.age()>or(t["max-age"])?this._evaluateRequestMissResult(e):t["min-fresh"]&&this.maxAge()-this.age()<or(t["min-fresh"])?this._evaluateRequestMissResult(e):this.stale()?"max-stale"in t&&(t["max-stale"]===!0||t["max-stale"]>this.age()-this.maxAge())?this._evaluateRequestHitResult(void 0):this.useStaleWhileRevalidate()?this._evaluateRequestHitResult(this._evaluateRequestRevalidation(e,!1)):this._evaluateRequestMissResult(e):this._evaluateRequestHitResult(void 0)}_requestMatches(e,t){return!!((!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||t&&e.method==="HEAD")&&this._varyMatches(e))}_allowsStoringAuthenticated(){return!!(this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"])}_varyMatches(e){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary==="*")return!1;let t=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let r of t)if(e.headers[r]!==this._reqHeaders[r])return!1;return!0}_copyWithoutHopByHopHeaders(e){let t={};for(let r in e)G9[r]||(t[r]=e[r]);if(e.connection){let r=e.connection.trim().split(/\s*,\s*/);for(let s of r)delete t[s]}if(t.warning){let r=t.warning.split(/,/).filter(s=>!/^\s*1[0-9][0-9]/.test(s));r.length?t.warning=r.join(",").trim():delete t.warning}return t}responseHeaders(){let e=this._copyWithoutHopByHopHeaders(this._resHeaders),t=this.age();return t>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'),e.age=`${Math.round(t)}`,e.date=new Date(this.now()).toUTCString(),e}date(){let e=Date.parse(this._resHeaders.date);return isFinite(e)?e:this._responseTime}age(){let e=this._ageValue(),t=(this.now()-this._responseTime)/1e3;return e+t}_ageValue(){return or(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 or(this._rescc["s-maxage"])}if(this._rescc["max-age"])return or(this._rescc["max-age"]);let e=this._rescc.immutable?this._immutableMinTtl:0,t=this.date();if(this._resHeaders.expires){let r=Date.parse(this._resHeaders.expires);return Number.isNaN(r)||r<t?0:Math.max(e,(r-t)/1e3)}if(this._resHeaders["last-modified"]){let r=Date.parse(this._resHeaders["last-modified"]);if(isFinite(r)&&t>r)return Math.max(e,(t-r)/1e3*this._cacheHeuristic)}return e}timeToLive(){let e=this.maxAge()-this.age(),t=e+or(this._rescc["stale-if-error"]),r=e+or(this._rescc["stale-while-revalidate"]);return Math.round(Math.max(0,e,t,r)*1e3)}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+or(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){let e=or(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()&&J9(t))return{policy:this,modified:!1,matches:!0};if(!t||!t.headers)throw Error("Response headers missing");let r=!1;t.status!==void 0&&t.status!=304?r=!1:t.headers.etag&&!/^\s*W\//.test(t.headers.etag)?r=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag:this._resHeaders.etag&&t.headers.etag?r=this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?r=this._resHeaders["last-modified"]===t.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!t.headers.etag&&!t.headers["last-modified"]&&(r=!0);let s={shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl,ignoreCargoCult:this._ignoreCargoCult};if(!r)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&&!W9[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 tL=d((Kye,Lw)=>{"use strict";Lw.exports=eL;Lw.exports.preferredCharsets=eL;var Z9=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function Y9(i){for(var e=i.split(","),t=0,r=0;t<e.length;t++){var s=X9(e[t].trim(),t);s&&(e[r++]=s)}return e.length=r,e}o(Y9,"parseAcceptCharset");function X9(i,e){var t=Z9.exec(i);if(!t)return null;var r=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:r,q:s,i:e}}o(X9,"parseCharset");function Q9(i,e,t){for(var r={o:-1,q:0,s:0},s=0;s<e.length;s++){var n=e8(i,e[s],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(Q9,"getCharsetPriority");function e8(i,e,t){var r=0;if(e.charset.toLowerCase()===i.toLowerCase())r|=1;else if(e.charset!=="*")return null;return{i:t,o:e.i,q:e.q,s:r}}o(e8,"specify");function eL(i,e){var t=Y9(i===void 0?"*":i||"");if(!e)return t.filter(Qx).sort(Xx).map(t8);var r=e.map(o(function(n,a){return Q9(n,t,a)},"getPriority"));return r.filter(Qx).sort(Xx).map(o(function(n){return e[r.indexOf(n)]},"getCharset"))}o(eL,"preferredCharsets");function Xx(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}o(Xx,"compareSpecs");function t8(i){return i.charset}o(t8,"getFullCharset");function Qx(i){return i.q>0}o(Qx,"isQuality")});var nL=d((Yye,Mw)=>{"use strict";Mw.exports=sL;Mw.exports.preferredEncodings=sL;var i8=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function r8(i){for(var e=i.split(","),t=!1,r=1,s=0,n=0;s<e.length;s++){var a=s8(e[s].trim(),s);a&&(e[n++]=a,t=t||rL("identity",a),r=Math.min(r,a.q||1))}return t||(e[n++]={encoding:"identity",q:r,i:s}),e.length=n,e}o(r8,"parseAcceptEncoding");function s8(i,e){var t=i8.exec(i);if(!t)return null;var r=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:r,q:s,i:e}}o(s8,"parseEncoding");function n8(i,e,t){for(var r={encoding:i,o:-1,q:0,s:0},s=0;s<e.length;s++){var n=rL(i,e[s],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(n8,"getEncodingPriority");function rL(i,e,t){var r=0;if(e.encoding.toLowerCase()===i.toLowerCase())r|=1;else if(e.encoding!=="*")return null;return{encoding:i,i:t,o:e.i,q:e.q,s:r}}o(rL,"specify");function sL(i,e,t){var r=r8(i||""),s=t?o(function(c,u){if(c.q!==u.q)return u.q-c.q;var l=t.indexOf(c.encoding),h=t.indexOf(u.encoding);return l===-1&&h===-1?u.s-c.s||c.o-u.o||c.i-u.i:l!==-1&&h!==-1?l-h:l===-1?1:-1},"comparator"):o8;if(!e)return r.filter(iL).sort(s).map(a8);var n=e.map(o(function(c,u){return n8(c,r,u)},"getPriority"));return n.filter(iL).sort(s).map(o(function(c){return e[n.indexOf(c)]},"getEncoding"))}o(sL,"preferredEncodings");function o8(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i}o(o8,"compareSpecs");function a8(i){return i.encoding}o(a8,"getFullEncoding");function iL(i){return i.q>0}o(iL,"isQuality")});var lL=d((Qye,Bw)=>{"use strict";Bw.exports=uL;Bw.exports.preferredLanguages=uL;var c8=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function u8(i){for(var e=i.split(","),t=0,r=0;t<e.length;t++){var s=cL(e[t].trim(),t);s&&(e[r++]=s)}return e.length=r,e}o(u8,"parseAcceptLanguage");function cL(i,e){var t=c8.exec(i);if(!t)return null;var r=t[1],s=t[2],n=r;s&&(n+="-"+s);var a=1;if(t[3])for(var c=t[3].split(";"),u=0;u<c.length;u++){var l=c[u].split("=");l[0]==="q"&&(a=parseFloat(l[1]))}return{prefix:r,suffix:s,q:a,i:e,full:n}}o(cL,"parseLanguage");function l8(i,e,t){for(var r={o:-1,q:0,s:0},s=0;s<e.length;s++){var n=h8(i,e[s],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(l8,"getLanguagePriority");function h8(i,e,t){var r=cL(i);if(!r)return null;var s=0;if(e.full.toLowerCase()===r.full.toLowerCase())s|=4;else if(e.prefix.toLowerCase()===r.full.toLowerCase())s|=2;else if(e.full.toLowerCase()===r.prefix.toLowerCase())s|=1;else if(e.full!=="*")return null;return{i:t,o:e.i,q:e.q,s}}o(h8,"specify");function uL(i,e){var t=u8(i===void 0?"*":i||"");if(!e)return t.filter(aL).sort(oL).map(f8);var r=e.map(o(function(n,a){return l8(n,t,a)},"getPriority"));return r.filter(aL).sort(oL).map(o(function(n){return e[r.indexOf(n)]},"getLanguage"))}o(uL,"preferredLanguages");function oL(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}o(oL,"compareSpecs");function f8(i){return i.full}o(f8,"getFullLanguage");function aL(i){return i.q>0}o(aL,"isQuality")});var gL=d((tSe,kw)=>{"use strict";kw.exports=pL;kw.exports.preferredMediaTypes=pL;var d8=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function p8(i){for(var e=E8(i),t=0,r=0;t<e.length;t++){var s=dL(e[t].trim(),t);s&&(e[r++]=s)}return e.length=r,e}o(p8,"parseAccept");function dL(i,e){var t=d8.exec(i);if(!t)return null;var r=Object.create(null),s=1,n=t[2],a=t[1];if(t[3])for(var c=w8(t[3]).map(S8),u=0;u<c.length;u++){var l=c[u],h=l[0].toLowerCase(),f=l[1],p=f&&f[0]==='"'&&f[f.length-1]==='"'?f.slice(1,-1):f;if(h==="q"){s=parseFloat(p);break}r[h]=p}return{type:a,subtype:n,params:r,q:s,i:e}}o(dL,"parseMediaType");function m8(i,e,t){for(var r={o:-1,q:0,s:0},s=0;s<e.length;s++){var n=g8(i,e[s],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(m8,"getMediaTypePriority");function g8(i,e,t){var r=dL(i),s=0;if(!r)return null;if(e.type.toLowerCase()==r.type.toLowerCase())s|=4;else if(e.type!="*")return null;if(e.subtype.toLowerCase()==r.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()==(r.params[a]||"").toLowerCase()}))s|=1;else return null;return{i:t,o:e.i,q:e.q,s}}o(g8,"specify");function pL(i,e){var t=p8(i===void 0?"*/*":i||"");if(!e)return t.filter(fL).sort(hL).map(y8);var r=e.map(o(function(n,a){return m8(n,t,a)},"getPriority"));return r.filter(fL).sort(hL).map(o(function(n){return e[r.indexOf(n)]},"getType"))}o(pL,"preferredMediaTypes");function hL(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}o(hL,"compareSpecs");function y8(i){return i.type+"/"+i.subtype}o(y8,"getFullType");function fL(i){return i.q>0}o(fL,"isQuality");function mL(i){for(var e=0,t=0;(t=i.indexOf('"',t))!==-1;)e++,t++;return e}o(mL,"quoteCount");function S8(i){var e=i.indexOf("="),t,r;return e===-1?t=i:(t=i.slice(0,e),r=i.slice(e+1)),[t,r]}o(S8,"splitKeyValuePair");function E8(i){for(var e=i.split(","),t=1,r=0;t<e.length;t++)mL(e[r])%2==0?e[++r]=e[t]:e[r]+=","+e[t];return e.length=r+1,e}o(E8,"splitMediaTypes");function w8(i){for(var e=i.split(";"),t=1,r=0;t<e.length;t++)mL(e[r])%2==0?e[++r]=e[t]:e[r]+=";"+e[t];e.length=r+1;for(var t=0;t<e.length;t++)e[t]=e[t].trim();return e}o(w8,"splitParameters")});var yL=d((rSe,Fw)=>{"use strict";var _8=tL(),b8=nL(),I8=lL(),O8=gL();Fw.exports=Y;Fw.exports.Negotiator=Y;function Y(i){if(!(this instanceof Y))return new Y(i);this.request=i}o(Y,"Negotiator");Y.prototype.charset=o(function(e){var t=this.charsets(e);return t&&t[0]},"charset");Y.prototype.charsets=o(function(e){return _8(this.request.headers["accept-charset"],e)},"charsets");Y.prototype.encoding=o(function(e,t){var r=this.encodings(e,t);return r&&r[0]},"encoding");Y.prototype.encodings=o(function(e,t){var r=t||{};return b8(this.request.headers["accept-encoding"],e,r.preferred)},"encodings");Y.prototype.language=o(function(e){var t=this.languages(e);return t&&t[0]},"language");Y.prototype.languages=o(function(e){return I8(this.request.headers["accept-language"],e)},"languages");Y.prototype.mediaType=o(function(e){var t=this.mediaTypes(e);return t&&t[0]},"mediaType");Y.prototype.mediaTypes=o(function(e){return O8(this.request.headers.accept,e)},"mediaTypes");Y.prototype.preferredCharset=Y.prototype.charset;Y.prototype.preferredCharsets=Y.prototype.charsets;Y.prototype.preferredEncoding=Y.prototype.encoding;Y.prototype.preferredEncodings=Y.prototype.encodings;Y.prototype.preferredLanguage=Y.prototype.language;Y.prototype.preferredLanguages=Y.prototype.languages;Y.prototype.preferredMediaType=Y.prototype.mediaType;Y.prototype.preferredMediaTypes=Y.prototype.mediaTypes});var jw=d((nSe,bL)=>{var SL=Yx(),EL=yL(),v8=ai(),wL={shared:!1,ignoreCargoCult:!0},R8={status:200,headers:{}},Eo=o(i=>{let e={method:i.method,url:i.url,headers:{},compress:i.compress};return i.headers.forEach((t,r)=>{e.headers[r]=t}),e},"requestObject"),_L=o(i=>{let e={status:i.status,headers:{}};return i.headers.forEach((t,r)=>{e.headers[r]=t}),e},"responseObject"),Uw=class{static{o(this,"CachePolicy")}constructor({entry:e,request:t,response:r,options:s}){this.entry=e,this.request=Eo(t),this.response=_L(r),this.options=s,this.policy=new SL(this.request,this.response,wL),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 SL(Eo(e),R8,wL).storable()}satisfies(e){let t=Eo(e);if(this.request.headers.host!==t.headers.host||this.request.compress!==t.compress)return!1;let r=new EL(this.request),s=new EL(t);return JSON.stringify(r.mediaTypes())!==JSON.stringify(s.mediaTypes())||JSON.stringify(r.languages())!==JSON.stringify(s.languages())||JSON.stringify(r.encodings())!==JSON.stringify(s.encodings())?!1:this.options.integrity?v8.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=Eo(e);return t.method="GET",!this.policy.satisfiesWithoutRevalidation(t)}responseHeaders(){return this.policy.responseHeaders()}revalidationHeaders(e){let t=Eo(e);return this.policy.revalidationHeaders(t)}revalidated(e,t){let r=Eo(e),s=_L(t);return!this.policy.revalidatedPolicy(r,s).modified}};bL.exports=Uw});var OL=d((aSe,IL)=>{var $w=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"}};IL.exports={NotCachedError:$w}});var Vw=d((uSe,vL)=>{"use strict";var A8=In(),qw=class extends A8{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)}};vL.exports=qw});var AL=d((hSe,RL)=>{var{URL:T8,format:C8}=require("url"),N8={auth:!1,fragment:!1,search:!0,unicode:!1},P8=o(i=>{let e=new T8(i.url);return`make-fetch-happen:request-cache:${C8(e,N8)}`},"cacheKey");RL.exports=P8});var zw=d((dSe,CL)=>{"use strict";var{LRUCache:D8}=os(),TL=require("dns"),ed=new D8({max:50}),x8=o(({family:i=0,hints:e=TL.ADDRCONFIG,all:t=!1,verbatim:r=void 0,ttl:s=300*1e3,lookup:n=TL.lookup})=>({hints:e,lookup:o((a,...c)=>{let u=c.pop(),l=c[0]??{},h={family:i,hints:e,all:t,verbatim:r,...typeof l=="number"?{family:l}:l},f=JSON.stringify({hostname:a,...h});if(ed.has(f)){let p=ed.get(f);return process.nextTick(u,null,...p)}n(a,h,(p,...m)=>p?u(p):(ed.set(f,m,{ttl:s}),u(null,...m)))},"lookup")}),"getOptions");CL.exports={cache:ed,getOptions:x8}});var Hw=d((mSe,PL)=>{"use strict";var L8=zw(),M8=o(i=>{let e=parseInt(i.family??"0",10),t=i.keepAlive??!0,r={keepAliveMsecs:t?1e3:void 0,maxSockets:i.maxSockets??15,maxTotalSockets:1/0,maxFreeSockets:t?256:void 0,scheduling:"fifo",...i,family:e,keepAlive:t,timeouts:{idle:i.timeout??0,connection:0,response:0,transfer:0,...i.timeouts},...L8.getOptions({family:e,...i.dns})};return delete r.timeout,r},"normalizeOptions"),NL=o(i=>{let e="",t=Object.entries(i).sort((r,s)=>r[0]-s[0]);for(let[r,s]of t)s==null?s="null":s instanceof URL?s=s.toString():typeof s=="object"&&(s=NL(s)),e+=`${r}:${s}:`;return e},"createKey"),B8=o(({secureEndpoint:i,...e})=>NL({secureEndpoint:!!i,family:e.family,hints:e.hints,localAddress:e.localAddress,strictSsl:i?!!e.rejectUnauthorized:!1,ca:i?e.ca:null,cert:i?e.cert:null,key:i?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");PL.exports={normalizeOptions:M8,cacheOptions:B8}});var Fs=d((ySe,DL)=>{"use strict";function Zc(){return o(function(){},"noop")}o(Zc,"debug");Zc.enabled=!1;Zc.names=[];Zc.skips=[];Zc.formatters={};DL.exports=Zc});var ML=d(tt=>{"use strict";var k8=tt&&tt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),F8=tt&&tt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),xL=tt&&tt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&k8(e,i,t);return F8(e,i),e};Object.defineProperty(tt,"__esModule",{value:!0});tt.req=tt.json=tt.toBuffer=void 0;var U8=xL(require("http")),j8=xL(require("https"));async function LL(i){let e=0,t=[];for await(let r of i)e+=r.length,t.push(r);return Buffer.concat(t,e)}o(LL,"toBuffer");tt.toBuffer=LL;async function $8(i){let t=(await LL(i)).toString("utf8");try{return JSON.parse(t)}catch(r){let s=r;throw s.message+=` (input: ${t})`,s}}o($8,"json");tt.json=$8;function q8(i,e={}){let r=((typeof i=="string"?i:i.href).startsWith("https:")?j8:U8).request(i,e),s=new Promise((n,a)=>{r.once("response",n).once("error",a).end()});return r.then=s.then.bind(s),r}o(q8,"req");tt.req=q8});var Yc=d(mt=>{"use strict";var kL=mt&&mt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),V8=mt&&mt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),FL=mt&&mt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&kL(e,i,t);return V8(e,i),e},z8=mt&&mt.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&kL(e,i,t)};Object.defineProperty(mt,"__esModule",{value:!0});mt.Agent=void 0;var H8=FL(require("net")),BL=FL(require("http")),G8=require("https");z8(ML(),mt);var _i=Symbol("AgentBaseInternalState"),Gw=class extends BL.Agent{static{o(this,"Agent")}constructor(e){super(e),this[_i]={}}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(`
45
+ `).some(r=>r.indexOf("(https.js:")!==-1||r.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let t=new H8.Socket({writable:!1});return this.sockets[e].push(t),this.totalSocketCount++,t}decrementSockets(e,t){if(!this.sockets[e]||t===null)return;let r=this.sockets[e],s=r.indexOf(t);s!==-1&&(r.splice(s,1),this.totalSocketCount--,r.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?G8.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,t,r){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 BL.Agent)try{return c.addRequest(e,s)}catch(u){return r(u)}this[_i].currentSocket=c,super.createSocket(e,t,r)},c=>{this.decrementSockets(n,a),r(c)})}createConnection(){let e=this[_i].currentSocket;if(this[_i].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[_i].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[_i]&&(this[_i].defaultPort=e)}get protocol(){return this[_i].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[_i]&&(this[_i].protocol=e)}};mt.Agent=Gw});var $L=d(Nt=>{"use strict";var W8=Nt&&Nt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),J8=Nt&&Nt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),jL=Nt&&Nt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&W8(e,i,t);return J8(e,i),e},K8=Nt&&Nt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Nt,"__esModule",{value:!0});Nt.HttpProxyAgent=void 0;var Z8=jL(require("net")),Y8=jL(require("tls")),X8=K8(Fs()),Q8=require("events"),eQ=Yc(),UL=require("url"),wo=(0,X8.default)("http-proxy-agent"),td=class extends eQ.Agent{static{o(this,"HttpProxyAgent")}constructor(e,t){super(t),this.proxy=typeof e=="string"?new UL.URL(e):e,this.proxyHeaders=t?.headers??{},wo("Creating new HttpProxyAgent instance: %o",this.proxy.href);let r=(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?tQ(t,"headers"):null,host:r,port:s}}addRequest(e,t){e._header=null,this.setRequestProps(e,t),super.addRequest(e,t)}setRequestProps(e,t){let{proxy:r}=this,s=t.secureEndpoint?"https:":"http:",n=e.getHeader("host")||"localhost",a=`${s}//${n}`,c=new UL.URL(e.path,a);t.port!==80&&(c.port=String(t.port)),e.path=String(c);let u=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders};if(r.username||r.password){let l=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;u["Proxy-Authorization"]=`Basic ${Buffer.from(l).toString("base64")}`}u["Proxy-Connection"]||(u["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let l of Object.keys(u)){let h=u[l];h&&e.setHeader(l,h)}}async connect(e,t){e._header=null,e.path.includes("://")||this.setRequestProps(e,t);let r,s;wo("Regenerating stored HTTP header string for request"),e._implicitHeader(),e.outputData&&e.outputData.length>0&&(wo("Patching connection write() output buffer with updated header"),r=e.outputData[0].data,s=r.indexOf(`\r
45
46
  \r
46
- `)+4,e.outputData[0].data=e._header+r.substring(s),wo("Output buffer: %o",e.outputData[0].data));let n;return this.proxy.protocol==="https:"?(wo("Creating `tls.Socket`: %o",this.connectOpts),n=K8.connect(this.connectOpts)):(wo("Creating `net.Socket`: %o",this.connectOpts),n=J8.connect(this.connectOpts)),await(0,Y8.once)(n,"connect"),n}};td.protocols=["http","https"];Nt.HttpProxyAgent=td;function Q8(i,...e){let t={},r;for(r in i)e.includes(r)||(t[r]=i[r]);return t}o(Q8,"omit")});var qL=d(_o=>{"use strict";var eQ=_o&&_o.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(_o,"__esModule",{value:!0});_o.parseProxyResponse=void 0;var tQ=eQ(Fs()),id=(0,tQ.default)("https-proxy-agent:parse-proxy-response");function iQ(i){return new Promise((e,t)=>{let r=0,s=[];function n(){let h=i.read();h?l(h):i.once("readable",n)}o(n,"read");function a(){i.removeListener("end",c),i.removeListener("error",u),i.removeListener("readable",n)}o(a,"cleanup");function c(){a(),id("onend"),t(new Error("Proxy connection ended before receiving CONNECT response"))}o(c,"onend");function u(h){a(),id("onerror %o",h),t(h)}o(u,"onerror");function l(h){s.push(h),r+=h.length;let f=Buffer.concat(s,r),p=f.indexOf(`\r
47
+ `)+4,e.outputData[0].data=e._header+r.substring(s),wo("Output buffer: %o",e.outputData[0].data));let n;return this.proxy.protocol==="https:"?(wo("Creating `tls.Socket`: %o",this.connectOpts),n=Y8.connect(this.connectOpts)):(wo("Creating `net.Socket`: %o",this.connectOpts),n=Z8.connect(this.connectOpts)),await(0,Q8.once)(n,"connect"),n}};td.protocols=["http","https"];Nt.HttpProxyAgent=td;function tQ(i,...e){let t={},r;for(r in i)e.includes(r)||(t[r]=i[r]);return t}o(tQ,"omit")});var qL=d(_o=>{"use strict";var iQ=_o&&_o.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(_o,"__esModule",{value:!0});_o.parseProxyResponse=void 0;var rQ=iQ(Fs()),id=(0,rQ.default)("https-proxy-agent:parse-proxy-response");function sQ(i){return new Promise((e,t)=>{let r=0,s=[];function n(){let h=i.read();h?l(h):i.once("readable",n)}o(n,"read");function a(){i.removeListener("end",c),i.removeListener("error",u),i.removeListener("readable",n)}o(a,"cleanup");function c(){a(),id("onend"),t(new Error("Proxy connection ended before receiving CONNECT response"))}o(c,"onend");function u(h){a(),id("onerror %o",h),t(h)}o(u,"onerror");function l(h){s.push(h),r+=h.length;let f=Buffer.concat(s,r),p=f.indexOf(`\r
47
48
  \r
48
49
  `);if(p===-1){id("have not received end of HTTP headers yet..."),n();return}let m=f.slice(0,p).toString("ascii").split(`\r
49
- `),y=m.shift();if(!y)return i.destroy(),t(new Error("No header received from proxy CONNECT response"));let g=y.split(" "),S=+g[1],E=g.slice(2).join(" "),_={};for(let b of m){if(!b)continue;let w=b.indexOf(":");if(w===-1)return i.destroy(),t(new Error(`Invalid header from proxy CONNECT response: "${b}"`));let I=b.slice(0,w).toLowerCase(),v=b.slice(w+1).trimStart(),N=_[I];typeof N=="string"?_[I]=[N,v]:Array.isArray(N)?N.push(v):_[I]=v}id("got proxy server response: %o %o",y,_),a(),e({connect:{statusCode:S,statusText:E,headers:_},buffered:f})}o(l,"ondata"),i.on("error",u),i.on("end",c),n()})}o(iQ,"parseProxyResponse");_o.parseProxyResponse=iQ});var JL=d(Pt=>{"use strict";var rQ=Pt&&Pt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),sQ=Pt&&Pt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),GL=Pt&&Pt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&rQ(e,i,t);return sQ(e,i),e},WL=Pt&&Pt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.HttpsProxyAgent=void 0;var rd=GL(require("net")),VL=GL(require("tls")),nQ=WL(require("assert")),oQ=WL(Fs()),aQ=Yc(),cQ=require("url"),uQ=qL(),Xc=(0,oQ.default)("https-proxy-agent"),zL=o(i=>i.servername===void 0&&i.host&&!rd.isIP(i.host)?{...i,servername:i.host}:i,"setServernameFromNonIpHost"),sd=class extends aQ.Agent{static{o(this,"HttpsProxyAgent")}constructor(e,t){super(t),this.options={path:void 0},this.proxy=typeof e=="string"?new cQ.URL(e):e,this.proxyHeaders=t?.headers??{},Xc("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let r=(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?HL(t,"headers"):null,host:r,port:s}}async connect(e,t){let{proxy:r}=this;if(!t.host)throw new TypeError('No "host" provided');let s;r.protocol==="https:"?(Xc("Creating `tls.Socket`: %o",this.connectOpts),s=VL.connect(zL(this.connectOpts))):(Xc("Creating `net.Socket`: %o",this.connectOpts),s=rd.connect(this.connectOpts));let n=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},a=rd.isIPv6(t.host)?`[${t.host}]`:t.host,c=`CONNECT ${a}:${t.port} HTTP/1.1\r
50
+ `),y=m.shift();if(!y)return i.destroy(),t(new Error("No header received from proxy CONNECT response"));let g=y.split(" "),S=+g[1],E=g.slice(2).join(" "),_={};for(let b of m){if(!b)continue;let w=b.indexOf(":");if(w===-1)return i.destroy(),t(new Error(`Invalid header from proxy CONNECT response: "${b}"`));let I=b.slice(0,w).toLowerCase(),v=b.slice(w+1).trimStart(),N=_[I];typeof N=="string"?_[I]=[N,v]:Array.isArray(N)?N.push(v):_[I]=v}id("got proxy server response: %o %o",y,_),a(),e({connect:{statusCode:S,statusText:E,headers:_},buffered:f})}o(l,"ondata"),i.on("error",u),i.on("end",c),n()})}o(sQ,"parseProxyResponse");_o.parseProxyResponse=sQ});var JL=d(Pt=>{"use strict";var nQ=Pt&&Pt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),oQ=Pt&&Pt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),GL=Pt&&Pt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&nQ(e,i,t);return oQ(e,i),e},WL=Pt&&Pt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.HttpsProxyAgent=void 0;var rd=GL(require("net")),VL=GL(require("tls")),aQ=WL(require("assert")),cQ=WL(Fs()),uQ=Yc(),lQ=require("url"),hQ=qL(),Xc=(0,cQ.default)("https-proxy-agent"),zL=o(i=>i.servername===void 0&&i.host&&!rd.isIP(i.host)?{...i,servername:i.host}:i,"setServernameFromNonIpHost"),sd=class extends uQ.Agent{static{o(this,"HttpsProxyAgent")}constructor(e,t){super(t),this.options={path:void 0},this.proxy=typeof e=="string"?new lQ.URL(e):e,this.proxyHeaders=t?.headers??{},Xc("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let r=(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?HL(t,"headers"):null,host:r,port:s}}async connect(e,t){let{proxy:r}=this;if(!t.host)throw new TypeError('No "host" provided');let s;r.protocol==="https:"?(Xc("Creating `tls.Socket`: %o",this.connectOpts),s=VL.connect(zL(this.connectOpts))):(Xc("Creating `net.Socket`: %o",this.connectOpts),s=rd.connect(this.connectOpts));let n=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},a=rd.isIPv6(t.host)?`[${t.host}]`:t.host,c=`CONNECT ${a}:${t.port} HTTP/1.1\r
50
51
  `;if(r.username||r.password){let p=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;n["Proxy-Authorization"]=`Basic ${Buffer.from(p).toString("base64")}`}n.Host=`${a}:${t.port}`,n["Proxy-Connection"]||(n["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let p of Object.keys(n))c+=`${p}: ${n[p]}\r
51
- `;let u=(0,uQ.parseProxyResponse)(s);s.write(`${c}\r
52
- `);let{connect:l,buffered:h}=await u;if(e.emit("proxyConnect",l),this.emit("proxyConnect",l,e),l.statusCode===200)return e.once("socket",lQ),t.secureEndpoint?(Xc("Upgrading socket connection to TLS"),VL.connect({...HL(zL(t),"host","path","port"),socket:s})):s;s.destroy();let f=new rd.Socket({writable:!1});return f.readable=!0,e.once("socket",p=>{Xc("Replaying proxy buffer for failed request"),(0,nQ.default)(p.listenerCount("data")>0),p.push(h),p.push(null)}),f}};sd.protocols=["http","https"];Pt.HttpsProxyAgent=sd;function lQ(i){i.resume()}o(lQ,"resume");function HL(i,...e){let t={},r;for(r in i)e.includes(r)||(t[r]=i[r]);return t}o(HL,"omit")});var XL=d(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});var KL=require("buffer"),Us={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."};ar.ERRORS=Us;function hQ(i){if(!KL.Buffer.isEncoding(i))throw new Error(Us.INVALID_ENCODING)}o(hQ,"checkEncoding");ar.checkEncoding=hQ;function ZL(i){return typeof i=="number"&&isFinite(i)&&mQ(i)}o(ZL,"isFiniteInteger");ar.isFiniteInteger=ZL;function YL(i,e){if(typeof i=="number"){if(!ZL(i)||i<0)throw new Error(e?Us.INVALID_OFFSET:Us.INVALID_LENGTH)}else throw new Error(e?Us.INVALID_OFFSET_NON_NUMBER:Us.INVALID_LENGTH_NON_NUMBER)}o(YL,"checkOffsetOrLengthValue");function fQ(i){YL(i,!1)}o(fQ,"checkLengthValue");ar.checkLengthValue=fQ;function dQ(i){YL(i,!0)}o(dQ,"checkOffsetValue");ar.checkOffsetValue=dQ;function pQ(i,e){if(i<0||i>e.length)throw new Error(Us.INVALID_TARGET_OFFSET)}o(pQ,"checkTargetOffset");ar.checkTargetOffset=pQ;function mQ(i){return typeof i=="number"&&isFinite(i)&&Math.floor(i)===i}o(mQ,"isInteger");function gQ(i){if(typeof BigInt>"u")throw new Error("Platform does not support JS BigInt type.");if(typeof KL.Buffer.prototype[i]>"u")throw new Error(`Platform does not support Buffer.prototype.${i}.`)}o(gQ,"bigIntAndBufferInt64Check");ar.bigIntAndBufferInt64Check=gQ});var eM=d(Jw=>{"use strict";Object.defineProperty(Jw,"__esModule",{value:!0});var F=XL(),QL=4096,yQ="utf8",Ww=class i{static{o(this,"SmartBuffer")}constructor(e){if(this.length=0,this._encoding=yQ,this._writeOffset=0,this._readOffset=0,i.isSmartBufferOptions(e))if(e.encoding&&(F.checkEncoding(e.encoding),this._encoding=e.encoding),e.size)if(F.isFiniteInteger(e.size)&&e.size>0)this._buff=Buffer.allocUnsafe(e.size);else throw new Error(F.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(F.ERRORS.INVALID_SMARTBUFFER_BUFFER);else this._buff=Buffer.allocUnsafe(QL);else{if(typeof e<"u")throw new Error(F.ERRORS.INVALID_SMARTBUFFER_OBJECT);this._buff=Buffer.allocUnsafe(QL)}}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 F.bigIntAndBufferInt64Check("readBigInt64BE"),this._readNumberValue(Buffer.prototype.readBigInt64BE,8,e)}readBigInt64LE(e){return F.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 F.bigIntAndBufferInt64Check("writeBigInt64BE"),this._writeNumberValue(Buffer.prototype.writeBigInt64BE,8,e,t)}insertBigInt64BE(e,t){return F.bigIntAndBufferInt64Check("writeBigInt64BE"),this._insertNumberValue(Buffer.prototype.writeBigInt64BE,8,e,t)}writeBigInt64LE(e,t){return F.bigIntAndBufferInt64Check("writeBigInt64LE"),this._writeNumberValue(Buffer.prototype.writeBigInt64LE,8,e,t)}insertBigInt64LE(e,t){return F.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 F.bigIntAndBufferInt64Check("readBigUInt64BE"),this._readNumberValue(Buffer.prototype.readBigUInt64BE,8,e)}readBigUInt64LE(e){return F.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 F.bigIntAndBufferInt64Check("writeBigUInt64BE"),this._writeNumberValue(Buffer.prototype.writeBigUInt64BE,8,e,t)}insertBigUInt64BE(e,t){return F.bigIntAndBufferInt64Check("writeBigUInt64BE"),this._insertNumberValue(Buffer.prototype.writeBigUInt64BE,8,e,t)}writeBigUInt64LE(e,t){return F.bigIntAndBufferInt64Check("writeBigUInt64LE"),this._writeNumberValue(Buffer.prototype.writeBigUInt64LE,8,e,t)}insertBigUInt64LE(e,t){return F.bigIntAndBufferInt64Check("writeBigUInt64LE"),this._insertNumberValue(Buffer.prototype.writeBigUInt64LE,8,e,t)}readFloatBE(e){return this._readNumberValue(Buffer.prototype.readFloatBE,4,e)}readFloatLE(e){return this._readNumberValue(Buffer.prototype.readFloatLE,4,e)}writeFloatBE(e,t){return this._writeNumberValue(Buffer.prototype.writeFloatBE,4,e,t)}insertFloatBE(e,t){return this._insertNumberValue(Buffer.prototype.writeFloatBE,4,e,t)}writeFloatLE(e,t){return this._writeNumberValue(Buffer.prototype.writeFloatLE,4,e,t)}insertFloatLE(e,t){return this._insertNumberValue(Buffer.prototype.writeFloatLE,4,e,t)}readDoubleBE(e){return this._readNumberValue(Buffer.prototype.readDoubleBE,8,e)}readDoubleLE(e){return this._readNumberValue(Buffer.prototype.readDoubleLE,8,e)}writeDoubleBE(e,t){return this._writeNumberValue(Buffer.prototype.writeDoubleBE,8,e,t)}insertDoubleBE(e,t){return this._insertNumberValue(Buffer.prototype.writeDoubleBE,8,e,t)}writeDoubleLE(e,t){return this._writeNumberValue(Buffer.prototype.writeDoubleLE,8,e,t)}insertDoubleLE(e,t){return this._insertNumberValue(Buffer.prototype.writeDoubleLE,8,e,t)}readString(e,t){let r;typeof e=="number"?(F.checkLengthValue(e),r=Math.min(e,this.length-this._readOffset)):(t=e,r=this.length-this._readOffset),typeof t<"u"&&F.checkEncoding(t);let s=this._buff.slice(this._readOffset,this._readOffset+r).toString(t||this._encoding);return this._readOffset+=r,s}insertString(e,t,r){return F.checkOffsetValue(t),this._handleString(e,!0,t,r)}writeString(e,t,r){return this._handleString(e,!1,t,r)}readStringNT(e){typeof e<"u"&&F.checkEncoding(e);let t=this.length;for(let s=this._readOffset;s<this.length;s++)if(this._buff[s]===0){t=s;break}let r=this._buff.slice(this._readOffset,t);return this._readOffset=t+1,r.toString(e||this._encoding)}insertStringNT(e,t,r){return F.checkOffsetValue(t),this.insertString(e,t,r),this.insertUInt8(0,t+e.length),this}writeStringNT(e,t,r){return this.writeString(e,t,r),this.writeUInt8(0,typeof t=="number"?t+e.length:this.writeOffset),this}readBuffer(e){typeof e<"u"&&F.checkLengthValue(e);let t=typeof e=="number"?e:this.length,r=Math.min(this.length,this._readOffset+t),s=this._buff.slice(this._readOffset,r);return this._readOffset=r,s}insertBuffer(e,t){return F.checkOffsetValue(t),this._handleBuffer(e,!0,t)}writeBuffer(e,t){return this._handleBuffer(e,!1,t)}readBufferNT(){let e=this.length;for(let r=this._readOffset;r<this.length;r++)if(this._buff[r]===0){e=r;break}let t=this._buff.slice(this._readOffset,e);return this._readOffset=e+1,t}insertBufferNT(e,t){return F.checkOffsetValue(t),this.insertBuffer(e,t),this.insertUInt8(0,t+e.length),this}writeBufferNT(e,t){return typeof t<"u"&&F.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){F.checkOffsetValue(e),F.checkTargetOffset(e,this),this._readOffset=e}get writeOffset(){return this._writeOffset}set writeOffset(e){F.checkOffsetValue(e),F.checkTargetOffset(e,this),this._writeOffset=e}get encoding(){return this._encoding}set encoding(e){F.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 F.checkEncoding(t),this._buff.toString(t,0,this.length)}destroy(){return this.clear(),this}_handleString(e,t,r,s){let n=this._writeOffset,a=this._encoding;typeof r=="number"?n=r:typeof r=="string"&&(F.checkEncoding(r),a=r),typeof s=="string"&&(F.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 r=="number"?this._writeOffset=Math.max(this._writeOffset,n+c):this._writeOffset+=c,this}_handleBuffer(e,t,r){let s=typeof r=="number"?r: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 r=="number"?this._writeOffset=Math.max(this._writeOffset,s+e.length):this._writeOffset+=e.length,this}ensureReadable(e,t){let r=this._readOffset;if(typeof t<"u"&&(F.checkOffsetValue(t),r=t),r<0||r+e>this.length)throw new Error(F.ERRORS.INVALID_READ_BEYOND_BOUNDS)}ensureInsertable(e,t){F.checkOffsetValue(t),this._ensureCapacity(this.length+e),t<this.length&&this._buff.copy(this._buff,t+e,t,this._buff.length),t+e>this.length?this.length=t+e:this.length+=e}_ensureWriteable(e,t){let r=typeof t=="number"?t:this._writeOffset;this._ensureCapacity(r+e),r+e>this.length&&(this.length=r+e)}_ensureCapacity(e){let t=this._buff.length;if(e>t){let r=this._buff,s=t*3/2+1;s<e&&(s=e),this._buff=Buffer.allocUnsafe(s),r.copy(this._buff,0,0,t)}}_readNumberValue(e,t,r){this.ensureReadable(t,r);let s=e.call(this._buff,typeof r=="number"?r:this._readOffset);return typeof r>"u"&&(this._readOffset+=t),s}_insertNumberValue(e,t,r,s){return F.checkOffsetValue(s),this.ensureInsertable(t,s),e.call(this._buff,r,s),this._writeOffset+=t,this}_writeNumberValue(e,t,r,s){if(typeof s=="number"){if(s<0)throw new Error(F.ERRORS.INVALID_WRITE_BEYOND_BOUNDS);F.checkOffsetValue(s)}let n=typeof s=="number"?s:this._writeOffset;return this._ensureWriteable(t,n),e.call(this._buff,r,n),typeof s=="number"?this._writeOffset=Math.max(this._writeOffset,n+t):this._writeOffset+=t,this}};Jw.SmartBuffer=Ww});var Kw=d(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.SOCKS5_NO_ACCEPTABLE_AUTH=re.SOCKS5_CUSTOM_AUTH_END=re.SOCKS5_CUSTOM_AUTH_START=re.SOCKS_INCOMING_PACKET_SIZES=re.SocksClientState=re.Socks5Response=re.Socks5HostType=re.Socks5Auth=re.Socks4Response=re.SocksCommand=re.ERRORS=re.DEFAULT_TIMEOUT=void 0;var SQ=3e4;re.DEFAULT_TIMEOUT=SQ;var EQ={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"};re.ERRORS=EQ;var wQ={Socks5InitialHandshakeResponse:2,Socks5UserPassAuthenticationResponse:2,Socks5ResponseHeader:5,Socks5ResponseIPv4:10,Socks5ResponseIPv6:22,Socks5ResponseHostname:o(i=>i+7,"Socks5ResponseHostname"),Socks4Response:8};re.SOCKS_INCOMING_PACKET_SIZES=wQ;var tM;(function(i){i[i.connect=1]="connect",i[i.bind=2]="bind",i[i.associate=3]="associate"})(tM||(re.SocksCommand=tM={}));var iM;(function(i){i[i.Granted=90]="Granted",i[i.Failed=91]="Failed",i[i.Rejected=92]="Rejected",i[i.RejectedIdent=93]="RejectedIdent"})(iM||(re.Socks4Response=iM={}));var rM;(function(i){i[i.NoAuth=0]="NoAuth",i[i.GSSApi=1]="GSSApi",i[i.UserPass=2]="UserPass"})(rM||(re.Socks5Auth=rM={}));var _Q=128;re.SOCKS5_CUSTOM_AUTH_START=_Q;var bQ=254;re.SOCKS5_CUSTOM_AUTH_END=bQ;var IQ=255;re.SOCKS5_NO_ACCEPTABLE_AUTH=IQ;var sM;(function(i){i[i.Granted=0]="Granted",i[i.Failure=1]="Failure",i[i.NotAllowed=2]="NotAllowed",i[i.NetworkUnreachable=3]="NetworkUnreachable",i[i.HostUnreachable=4]="HostUnreachable",i[i.ConnectionRefused=5]="ConnectionRefused",i[i.TTLExpired=6]="TTLExpired",i[i.CommandNotSupported=7]="CommandNotSupported",i[i.AddressNotSupported=8]="AddressNotSupported"})(sM||(re.Socks5Response=sM={}));var nM;(function(i){i[i.IPv4=1]="IPv4",i[i.Hostname=3]="Hostname",i[i.IPv6=4]="IPv6"})(nM||(re.Socks5HostType=nM={}));var oM;(function(i){i[i.Created=0]="Created",i[i.Connecting=1]="Connecting",i[i.Connected=2]="Connected",i[i.SentInitialHandshake=3]="SentInitialHandshake",i[i.ReceivedInitialHandshakeResponse=4]="ReceivedInitialHandshakeResponse",i[i.SentAuthentication=5]="SentAuthentication",i[i.ReceivedAuthenticationResponse=6]="ReceivedAuthenticationResponse",i[i.SentFinalHandshake=7]="SentFinalHandshake",i[i.ReceivedFinalResponse=8]="ReceivedFinalResponse",i[i.BoundWaitingForConnection=9]="BoundWaitingForConnection",i[i.Established=10]="Established",i[i.Disconnected=11]="Disconnected",i[i.Error=99]="Error"})(oM||(re.SocksClientState=oM={}))});var Yw=d(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});bo.shuffleArray=bo.SocksClientError=void 0;var Zw=class extends Error{static{o(this,"SocksClientError")}constructor(e,t){super(e),this.options=t}};bo.SocksClientError=Zw;function OQ(i){for(let e=i.length-1;e>0;e--){let t=Math.floor(Math.random()*(e+1));[i[e],i[t]]=[i[t],i[e]]}}o(OQ,"shuffleArray");bo.shuffleArray=OQ});var nd=d(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.isInSubnet=vQ;js.isCorrect=RQ;js.numberToPaddedHex=aM;js.stringToPaddedHex=AQ;js.testBit=TQ;function vQ(i){return this.subnetMask<i.subnetMask?!1:this.mask(i.subnetMask)===i.mask()}o(vQ,"isInSubnet");function RQ(i){return function(){return this.addressMinusSuffix!==this.correctForm()?!1:this.subnetMask===i&&!this.parsedSubnet?!0:this.parsedSubnet===String(this.subnetMask)}}o(RQ,"isCorrect");function aM(i){return i.toString(16).padStart(2,"0")}o(aM,"numberToPaddedHex");function AQ(i){return aM(parseInt(i,10))}o(AQ,"stringToPaddedHex");function TQ(i,e){let{length:t}=i;if(e>t)return!1;let r=t-e;return i.substring(r,r+1)==="1"}o(TQ,"testBit")});var Xw=d(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.RE_SUBNET_STRING=bi.RE_ADDRESS=bi.GROUPS=bi.BITS=void 0;bi.BITS=32;bi.GROUPS=4;bi.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;bi.RE_SUBNET_STRING=/\/\d{1,2}$/});var ad=d(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0});od.AddressError=void 0;var Qw=class extends Error{static{o(this,"AddressError")}constructor(e,t){super(e),this.name="AddressError",this.parseMessage=t}};od.AddressError=Qw});var t_=d(Ii=>{"use strict";var CQ=Ii&&Ii.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),NQ=Ii&&Ii.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),uM=Ii&&Ii.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&CQ(e,i,t);return NQ(e,i),e};Object.defineProperty(Ii,"__esModule",{value:!0});Ii.Address4=void 0;var Io=uM(nd()),Xt=uM(Xw()),cM=ad(),e_=class i{static{o(this,"Address4")}constructor(e){this.groups=Xt.GROUPS,this.parsedAddress=[],this.parsedSubnet="",this.subnet="/32",this.subnetMask=32,this.v4=!0,this.isCorrect=Io.isCorrect(Xt.BITS),this.isInSubnet=Io.isInSubnet,this.address=e;let t=Xt.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>Xt.BITS)throw new cM.AddressError("Invalid subnet mask.");e=e.replace(Xt.RE_SUBNET_STRING,"")}this.addressMinusSuffix=e,this.parsedAddress=this.parse(e)}static isValid(e){try{return new i(e),!0}catch{return!1}}parse(e){let t=e.split(".");if(!e.match(Xt.RE_ADDRESS))throw new cM.AddressError("Invalid IPv4 address.");return t}correctForm(){return this.parsedAddress.map(e=>parseInt(e,10)).join(".")}static fromHex(e){let t=e.replace(/:/g,"").padStart(8,"0"),r=[],s;for(s=0;s<8;s+=2){let n=t.slice(s,s+2);r.push(parseInt(n,16))}return new i(r.join("."))}static fromInteger(e){return i.fromHex(e.toString(16))}static fromArpa(e){let r=e.replace(/(\.in-addr\.arpa)?\.$/,"").split(".").reverse().join(".");return new i(r)}toHex(){return this.parsedAddress.map(e=>Io.stringToPaddedHex(e)).join(":")}toArray(){return this.parsedAddress.map(e=>parseInt(e,10))}toGroup6(){let e=[],t;for(t=0;t<Xt.GROUPS;t+=2)e.push(`${Io.stringToPaddedHex(this.parsedAddress[t])}${Io.stringToPaddedHex(this.parsedAddress[t+1])}`);return e.join(":")}bigInt(){return BigInt(`0x${this.parsedAddress.map(e=>Io.stringToPaddedHex(e)).join("")}`)}_startAddress(){return BigInt(`0b${this.mask()+"0".repeat(Xt.BITS-this.subnetMask)}`)}startAddress(){return i.fromBigInt(this._startAddress())}startAddressExclusive(){let e=BigInt("1");return i.fromBigInt(this._startAddress()+e)}_endAddress(){return BigInt(`0b${this.mask()+"1".repeat(Xt.BITS-this.subnetMask)}`)}endAddress(){return i.fromBigInt(this._endAddress())}endAddressExclusive(){let e=BigInt("1");return i.fromBigInt(this._endAddress()-e)}static fromBigInt(e){return i.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 i("224.0.0.0/4"))}binaryZeroPad(){return this.bigInt().toString(2).padStart(Xt.BITS,"0")}groupForV6(){let e=this.parsedAddress;return this.address.replace(Xt.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>`)}};Ii.Address4=e_});var i_=d(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.RE_URL_WITH_PORT=he.RE_URL=he.RE_ZONE_STRING=he.RE_SUBNET_STRING=he.RE_BAD_ADDRESS=he.RE_BAD_CHARACTERS=he.TYPES=he.SCOPES=he.GROUPS=he.BITS=void 0;he.BITS=128;he.GROUPS=8;he.SCOPES={0:"Reserved",1:"Interface local",2:"Link local",4:"Admin local",5:"Site local",8:"Organization local",14:"Global",15:"Reserved"};he.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"};he.RE_BAD_CHARACTERS=/([^0-9a-f:/%])/gi;he.RE_BAD_ADDRESS=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi;he.RE_SUBNET_STRING=/\/\d{1,3}(?=%|$)/;he.RE_ZONE_STRING=/%.*$/;he.RE_URL=/^\[{0,1}([0-9a-f:]+)\]{0,1}/;he.RE_URL_WITH_PORT=/\[([0-9a-f:]+)\]:([0-9]{1,5})/});var r_=d(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.spanAllZeroes=lM;Oo.spanAll=PQ;Oo.spanLeadingZeroes=DQ;Oo.simpleGroup=xQ;function lM(i){return i.replace(/(0+)/g,'<span class="zero">$1</span>')}o(lM,"spanAllZeroes");function PQ(i,e=0){return i.split("").map((r,s)=>`<span class="digit value-${r} position-${s+e}">${lM(r)}</span>`).join("")}o(PQ,"spanAll");function hM(i){return i.replace(/^(0+)/,'<span class="zero">$1</span>')}o(hM,"spanLeadingZeroesSimple");function DQ(i){return i.split(":").map(t=>hM(t)).join(":")}o(DQ,"spanLeadingZeroes");function xQ(i,e=0){return i.split(":").map((r,s)=>/group-v4/.test(r)?r:`<span class="hover-group group-${s+e}">${hM(r)}</span>`)}o(xQ,"simpleGroup")});var fM=d(it=>{"use strict";var LQ=it&&it.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),MQ=it&&it.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),BQ=it&&it.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&LQ(e,i,t);return MQ(e,i),e};Object.defineProperty(it,"__esModule",{value:!0});it.ADDRESS_BOUNDARY=void 0;it.groupPossibilities=ud;it.padGroup=cd;it.simpleRegularExpression=FQ;it.possibleElisions=UQ;var kQ=BQ(i_());function ud(i){return`(${i.join("|")})`}o(ud,"groupPossibilities");function cd(i){return i.length<4?`0{0,${4-i.length}}${i}`:i}o(cd,"padGroup");it.ADDRESS_BOUNDARY="[^A-Fa-f0-9:]";function FQ(i){let e=[];i.forEach((r,s)=>{parseInt(r,16)===0&&e.push(s)});let t=e.map(r=>i.map((s,n)=>{if(n===r){let a=n===0||n===kQ.GROUPS-1?":":"";return ud([cd(s),a])}return cd(s)}).join(":"));return t.push(i.map(cd).join(":")),ud(t)}o(FQ,"simpleRegularExpression");function UQ(i,e,t){let r=e?"":":",s=t?"":":",n=[];!e&&!t&&n.push("::"),e&&t&&n.push(""),(t&&!e||!t&&e)&&n.push(":"),n.push(`${r}(:0{1,4}){1,${i-1}}`),n.push(`(0{1,4}:){1,${i-1}}${s}`),n.push(`(0{1,4}:){${i-1}}0{1,4}`);for(let a=1;a<i-1;a++)for(let c=1;c<i-a;c++)n.push(`(0{1,4}:){${c}}:(0{1,4}:){${i-c-a-1}}0{1,4}`);return ud(n)}o(UQ,"possibleElisions")});var gM=d(Oi=>{"use strict";var jQ=Oi&&Oi.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),$Q=Oi&&Oi.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),fd=Oi&&Oi.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&jQ(e,i,t);return $Q(e,i),e};Object.defineProperty(Oi,"__esModule",{value:!0});Oi.Address6=void 0;var dM=fd(nd()),s_=fd(Xw()),se=fd(i_()),n_=fd(r_()),$s=t_(),qs=fM(),cr=ad(),ld=nd();function hd(i){if(!i)throw new Error("Assertion failed.")}o(hd,"assert");function qQ(i){let e=/(\d+)(\d{3})/;for(;e.test(i);)i=i.replace(e,"$1,$2");return i}o(qQ,"addCommas");function VQ(i){return i=i.replace(/^(0{1,})([1-9]+)$/,'<span class="parse-error">$1</span>$2'),i=i.replace(/^(0{1,})(0)$/,'<span class="parse-error">$1</span>$2'),i}o(VQ,"spanLeadingZeroes4");function zQ(i,e){let t=[],r=[],s;for(s=0;s<i.length;s++)s<e[0]?t.push(i[s]):s>e[1]&&r.push(i[s]);return t.concat(["compact"]).concat(r)}o(zQ,"compact");function pM(i){return parseInt(i,16).toString(16).padStart(4,"0")}o(pM,"paddedHex");function mM(i){return i&255}o(mM,"unsignByte");var o_=class i{static{o(this,"Address6")}constructor(e,t){this.addressMinusSuffix="",this.parsedSubnet="",this.subnet="/128",this.subnetMask=128,this.v4=!1,this.zone="",this.isInSubnet=dM.isInSubnet,this.isCorrect=dM.isCorrect(se.BITS),t===void 0?this.groups=se.GROUPS:this.groups=t,this.address=e;let r=se.RE_SUBNET_STRING.exec(e);if(r){if(this.parsedSubnet=r[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,Number.isNaN(this.subnetMask)||this.subnetMask<0||this.subnetMask>se.BITS)throw new cr.AddressError("Invalid subnet mask.");e=e.replace(se.RE_SUBNET_STRING,"")}else if(/\//.test(e))throw new cr.AddressError("Invalid subnet mask.");let s=se.RE_ZONE_STRING.exec(e);s&&(this.zone=s[0],e=e.replace(se.RE_ZONE_STRING,"")),this.addressMinusSuffix=e,this.parsedAddress=this.parse(this.addressMinusSuffix)}static isValid(e){try{return new i(e),!0}catch{return!1}}static fromBigInt(e){let t=e.toString(16).padStart(32,"0"),r=[],s;for(s=0;s<se.GROUPS;s++)r.push(t.slice(s*4,(s+1)*4));return new i(r.join(":"))}static fromURL(e){let t,r=null,s;if(e.indexOf("[")!==-1&&e.indexOf("]:")!==-1){if(s=se.RE_URL_WITH_PORT.exec(e),s===null)return{error:"failed to parse address with port",address:null,port:null};t=s[1],r=s[2]}else if(e.indexOf("/")!==-1){if(e=e.replace(/^[a-z0-9]+:\/\//,""),s=se.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 r?(r=parseInt(r,10),(r<0||r>65536)&&(r=null)):r=null,{address:new i(t),port:r}}static fromAddress4(e){let t=new $s.Address4(e),r=se.BITS-(s_.BITS-t.subnetMask);return new i(`::ffff:${t.correctForm()}/${r}`)}static fromArpa(e){let t=e.replace(/(\.ip6\.arpa)?\.$/,""),r=7;if(t.length!==63)throw new cr.AddressError("Invalid 'ip6.arpa' form.");let s=t.split(".").reverse();for(let n=r;n>0;n--){let a=n*4;s.splice(a,0,":")}return t=s.join(""),new i(t)}microsoftTranscription(){return`${this.correctForm().replace(/:/g,"-")}.ipv6-literal.net`}mask(e=this.subnetMask){return this.getBitsBase2(0,e)}possibleSubnets(e=128){let t=se.BITS-this.subnetMask,r=Math.abs(e-se.BITS),s=t-r;return s<0?"0":qQ((BigInt("2")**BigInt(s)).toString(10))}_startAddress(){return BigInt(`0b${this.mask()+"0".repeat(se.BITS-this.subnetMask)}`)}startAddress(){return i.fromBigInt(this._startAddress())}startAddressExclusive(){let e=BigInt("1");return i.fromBigInt(this._startAddress()+e)}_endAddress(){return BigInt(`0b${this.mask()+"1".repeat(se.BITS-this.subnetMask)}`)}endAddress(){return i.fromBigInt(this._endAddress())}endAddressExclusive(){let e=BigInt("1");return i.fromBigInt(this._endAddress()-e)}getScope(){let e=se.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(se.TYPES))if(this.isInSubnet(new i(e)))return se.TYPES[e];return"Global unicast"}getBits(e,t){return BigInt(`0b${this.getBitsBase2(e,t)}`)}getBitsBase2(e,t){return this.binaryZeroPad().slice(e,t)}getBitsBase16(e,t){let r=t-e;if(r%4!==0)throw new Error("Length of bits to retrieve must be divisible by four");return this.getBits(e,t).toString(16).padStart(r/4,"0")}getBitsPastSubnet(){return this.getBitsBase2(this.subnetMask,se.BITS)}reverseForm(e){e||(e={});let t=Math.floor(this.subnetMask/4),r=this.canonicalForm().replace(/:/g,"").split("").slice(0,t).reverse().join(".");return t>0?e.omitSuffix?r:`${r}.ip6.arpa.`:e.omitSuffix?"":"ip6.arpa."}correctForm(){let e,t=[],r=0,s=[];for(e=0;e<this.parsedAddress.length;e++){let c=parseInt(this.parsedAddress[e],16);c===0&&r++,c!==0&&r>0&&(r>1&&s.push([e-r,e-1]),r=0)}r>1&&s.push([this.parsedAddress.length-r,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=zQ(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(se.BITS,"0")}parse4in6(e){let t=e.split(":"),s=t.slice(-1)[0].match(s_.RE_ADDRESS);if(s){this.parsedAddress4=s[0],this.address4=new $s.Address4(this.parsedAddress4);for(let n=0;n<this.address4.groups;n++)if(/^0[0-9]+/.test(this.address4.parsedAddress[n]))throw new cr.AddressError("IPv4 addresses can't have leading zeroes.",e.replace(s_.RE_ADDRESS,this.address4.parsedAddress.map(VQ).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(se.RE_BAD_CHARACTERS);if(t)throw new cr.AddressError(`Bad character${t.length>1?"s":""} detected in address: ${t.join("")}`,e.replace(se.RE_BAD_CHARACTERS,'<span class="parse-error">$1</span>'));let r=e.match(se.RE_BAD_ADDRESS);if(r)throw new cr.AddressError(`Address failed regex: ${r.join("")}`,e.replace(se.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 u=this.groups-(a.length+c.length);if(!u)throw new cr.AddressError("Error parsing groups");this.elidedGroups=u,this.elisionBegin=a.length,this.elisionEnd=a.length+this.elidedGroups,s=s.concat(a);for(let l=0;l<u;l++)s.push("0");s=s.concat(c)}else if(n.length===1)s=e.split(":"),this.elidedGroups=0;else throw new cr.AddressError("Too many :: groups found");if(s=s.map(a=>parseInt(a,16).toString(16)),s.length!==this.groups)throw new cr.AddressError("Incorrect number of groups found");return s}canonicalForm(){return this.parsedAddress.map(pM).join(":")}decimal(){return this.parsedAddress.map(e=>parseInt(e,16).toString(10).padStart(5,"0")).join(":")}bigInt(){return BigInt(`0x${this.parsedAddress.map(pM).join("")}`)}to4(){let e=this.binaryZeroPad().split("");return $s.Address4.fromHex(BigInt(`0b${e.slice(96,128).join("")}`).toString(16))}to4in6(){let e=this.to4(),r=new i(this.parsedAddress.slice(0,6).join(":"),6).correctForm(),s="";return/:$/.test(r)||(s=":"),r+s+e.address}inspectTeredo(){let e=this.getBitsBase16(0,32),r=(this.getBits(80,96)^BigInt("0xffff")).toString(),s=$s.Address4.fromHex(this.getBitsBase16(32,64)),n=this.getBits(96,128),a=$s.Address4.fromHex((n^BigInt("0xffffffff")).toString(16)),c=this.getBitsBase2(64,80),u=(0,ld.testBit)(c,15),l=(0,ld.testBit)(c,14),h=(0,ld.testBit)(c,8),f=(0,ld.testBit)(c,9),p=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:u,microsoft:{reserved:l,universalLocal:f,groupIndividual:h,nonce:p},udpPort:r}}inspect6to4(){let e=this.getBitsBase16(0,16),t=$s.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 i(e)}toByteArray(){let e=this.bigInt().toString(16),r=`${"0".repeat(e.length%2)}${e}`,s=[];for(let n=0,a=r.length;n<a;n+=2)s.push(parseInt(r.substring(n,n+2),16));return s}toUnsignedByteArray(){return this.toByteArray().map(mM)}static fromByteArray(e){return this.fromUnsignedByteArray(e.map(mM))}static fromUnsignedByteArray(e){let t=BigInt("256"),r=BigInt("0"),s=BigInt("1");for(let n=e.length-1;n>=0;n--)r+=s*BigInt(e[n].toString(10)),s*=t;return i.fromBigInt(r)}isCanonical(){return this.addressMinusSuffix===this.canonicalForm()}isLinkLocal(){return this.getBitsBase2(0,64)==="1111111010000000000000000000000000000000000000000000000000000000"}isMulticast(){return this.getType()==="Multicast"}is4(){return this.v4}isTeredo(){return this.isInSubnet(new i("2001::/32"))}is6to4(){return this.isInSubnet(new i("2002::/16"))}isLoopback(){return this.getType()==="Loopback"}href(e){return e===void 0?e="":e=`:${e}`,`http://[${this.correctForm()}]${e}/`}link(e){e||(e={}),e.className===void 0&&(e.className=""),e.prefix===void 0&&(e.prefix="/#address="),e.v4===void 0&&(e.v4=!1);let t=this.correctForm;e.v4&&(t=this.to4in6);let r=t.call(this);return e.className?`<a href="${e.prefix}${r}" class="${e.className}">${r}</a>`:`<a href="${e.prefix}${r}">${r}</a>`}group(){if(this.elidedGroups===0)return n_.simpleGroup(this.address).join(":");hd(typeof this.elidedGroups=="number"),hd(typeof this.elisionBegin=="number");let e=[],[t,r]=this.address.split("::");t.length?e.push(...n_.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>`),r.length?e.push(...n_.simpleGroup(r,this.elisionEnd)):e.push(""),this.is4()&&(hd(this.address4 instanceof $s.Address4),e.pop(),e.push(this.address4.groupForV6())),e.join(":")}regularExpressionString(e=!1){let t=[],r=new i(this.correctForm());if(r.elidedGroups===0)t.push((0,qs.simpleRegularExpression)(r.parsedAddress));else if(r.elidedGroups===se.GROUPS)t.push((0,qs.possibleElisions)(se.GROUPS));else{let s=r.address.split("::");s[0].length&&t.push((0,qs.simpleRegularExpression)(s[0].split(":"))),hd(typeof r.elidedGroups=="number"),t.push((0,qs.possibleElisions)(r.elidedGroups,s[0].length!==0,s[1].length!==0)),s[1].length&&t.push((0,qs.simpleRegularExpression)(s[1].split(":"))),t=[t.join(":")]}return e||(t=["(?=^|",qs.ADDRESS_BOUNDARY,"|[^\\w\\:])(",...t,")(?=[^\\w\\:]|",qs.ADDRESS_BOUNDARY,"|$)"]),t.join("")}regularExpression(e=!1){return new RegExp(this.regularExpressionString(e),"i")}};Oi.Address6=o_});var a_=d(Ue=>{"use strict";var HQ=Ue&&Ue.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),GQ=Ue&&Ue.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),WQ=Ue&&Ue.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&HQ(e,i,t);return GQ(e,i),e};Object.defineProperty(Ue,"__esModule",{value:!0});Ue.v6=Ue.AddressError=Ue.Address6=Ue.Address4=void 0;var JQ=t_();Object.defineProperty(Ue,"Address4",{enumerable:!0,get:o(function(){return JQ.Address4},"get")});var KQ=gM();Object.defineProperty(Ue,"Address6",{enumerable:!0,get:o(function(){return KQ.Address6},"get")});var ZQ=ad();Object.defineProperty(Ue,"AddressError",{enumerable:!0,get:o(function(){return ZQ.AddressError},"get")});var YQ=WQ(r_());Ue.v6={helpers:YQ}});var bM=d(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.ipToBuffer=Dt.int32ToIpv4=Dt.ipv4ToInt32=Dt.validateSocksClientChainOptions=Dt.validateSocksClientOptions=void 0;var We=Yw(),Ce=Kw(),XQ=require("stream"),c_=a_(),yM=require("net");function QQ(i,e=["connect","bind","associate"]){if(!Ce.SocksCommand[i.command])throw new We.SocksClientError(Ce.ERRORS.InvalidSocksCommand,i);if(e.indexOf(i.command)===-1)throw new We.SocksClientError(Ce.ERRORS.InvalidSocksCommandForOperation,i);if(!EM(i.destination))throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsDestination,i);if(!wM(i.proxy))throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsProxy,i);if(SM(i.proxy,i),i.timeout&&!_M(i.timeout))throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsTimeout,i);if(i.existing_socket&&!(i.existing_socket instanceof XQ.Duplex))throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsExistingSocket,i)}o(QQ,"validateSocksClientOptions");Dt.validateSocksClientOptions=QQ;function e7(i){if(i.command!=="connect")throw new We.SocksClientError(Ce.ERRORS.InvalidSocksCommandChain,i);if(!EM(i.destination))throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsDestination,i);if(!(i.proxies&&Array.isArray(i.proxies)&&i.proxies.length>=2))throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsProxiesLength,i);if(i.proxies.forEach(e=>{if(!wM(e))throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsProxy,i);SM(e,i)}),i.timeout&&!_M(i.timeout))throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsTimeout,i)}o(e7,"validateSocksClientChainOptions");Dt.validateSocksClientChainOptions=e7;function SM(i,e){if(i.custom_auth_method!==void 0){if(i.custom_auth_method<Ce.SOCKS5_CUSTOM_AUTH_START||i.custom_auth_method>Ce.SOCKS5_CUSTOM_AUTH_END)throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsCustomAuthRange,e);if(i.custom_auth_request_handler===void 0||typeof i.custom_auth_request_handler!="function")throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e);if(i.custom_auth_response_size===void 0)throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e);if(i.custom_auth_response_handler===void 0||typeof i.custom_auth_response_handler!="function")throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e)}}o(SM,"validateCustomProxyAuth");function EM(i){return i&&typeof i.host=="string"&&Buffer.byteLength(i.host)<256&&typeof i.port=="number"&&i.port>=0&&i.port<=65535}o(EM,"isValidSocksRemoteHost");function wM(i){return i&&(typeof i.host=="string"||typeof i.ipaddress=="string")&&typeof i.port=="number"&&i.port>=0&&i.port<=65535&&(i.type===4||i.type===5)}o(wM,"isValidSocksProxy");function _M(i){return typeof i=="number"&&i>0}o(_M,"isValidTimeoutValue");function t7(i){return new c_.Address4(i).toArray().reduce((t,r)=>(t<<8)+r,0)>>>0}o(t7,"ipv4ToInt32");Dt.ipv4ToInt32=t7;function i7(i){let e=i>>>24&255,t=i>>>16&255,r=i>>>8&255,s=i&255;return[e,t,r,s].join(".")}o(i7,"int32ToIpv4");Dt.int32ToIpv4=i7;function r7(i){if(yM.isIPv4(i)){let e=new c_.Address4(i);return Buffer.from(e.toArray())}else if(yM.isIPv6(i)){let e=new c_.Address6(i);return Buffer.from(e.canonicalForm().split(":").map(t=>t.padStart(4,"0")).join(""),"hex")}else throw new Error("Invalid IP address format")}o(r7,"ipToBuffer");Dt.ipToBuffer=r7});var IM=d(dd=>{"use strict";Object.defineProperty(dd,"__esModule",{value:!0});dd.ReceiveBuffer=void 0;var u_=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}};dd.ReceiveBuffer=u_});var OM=d(Fr=>{"use strict";var vo=Fr&&Fr.__awaiter||function(i,e,t,r){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{l(r.next(h))}catch(f){a(f)}}o(c,"fulfilled");function u(h){try{l(r.throw(h))}catch(f){a(f)}}o(u,"rejected");function l(h){h.done?n(h.value):s(h.value).then(c,u)}o(l,"step"),l((r=r.apply(i,e||[])).next())})};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.SocksClientError=Fr.SocksClient=void 0;var s7=require("events"),Ro=require("net"),rt=eM(),O=Kw(),gt=bM(),n7=IM(),h_=Yw();Object.defineProperty(Fr,"SocksClientError",{enumerable:!0,get:o(function(){return h_.SocksClientError},"get")});var l_=a_(),f_=class i extends s7.EventEmitter{static{o(this,"SocksClient")}constructor(e){super(),this.options=Object.assign({},e),(0,gt.validateSocksClientOptions)(e),this.setState(O.SocksClientState.Created)}static createConnection(e,t){return new Promise((r,s)=>{try{(0,gt.validateSocksClientOptions)(e,["connect"])}catch(a){return typeof t=="function"?(t(a),r(a)):s(a)}let n=new i(e);n.connect(e.existing_socket),n.once("established",a=>{n.removeAllListeners(),typeof t=="function"&&t(null,a),r(a)}),n.once("error",a=>{n.removeAllListeners(),typeof t=="function"?(t(a),r(a)):s(a)})})}static createConnectionChain(e,t){return new Promise((r,s)=>vo(this,void 0,void 0,function*(){try{(0,gt.validateSocksClientChainOptions)(e)}catch(n){return typeof t=="function"?(t(n),r(n)):s(n)}e.randomizeChain&&(0,h_.shuffleArray)(e.proxies);try{let n;for(let a=0;a<e.proxies.length;a++){let c=e.proxies[a],u=a===e.proxies.length-1?e.destination:{host:e.proxies[a+1].host||e.proxies[a+1].ipaddress,port:e.proxies[a+1].port},l=yield i.createConnection({command:"connect",proxy:c,destination:u,existing_socket:n});n=n||l.socket}typeof t=="function"?(t(null,{socket:n}),r({socket:n})):r({socket:n})}catch(n){typeof t=="function"?(t(n),r(n)):s(n)}}))}static createUDPFrame(e){let t=new rt.SmartBuffer;return t.writeUInt16BE(0),t.writeUInt8(e.frameNumber||0),Ro.isIPv4(e.remoteHost.host)?(t.writeUInt8(O.Socks5HostType.IPv4),t.writeUInt32BE((0,gt.ipv4ToInt32)(e.remoteHost.host))):Ro.isIPv6(e.remoteHost.host)?(t.writeUInt8(O.Socks5HostType.IPv6),t.writeBuffer((0,gt.ipToBuffer)(e.remoteHost.host))):(t.writeUInt8(O.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 r=t.readUInt8(),s=t.readUInt8(),n;s===O.Socks5HostType.IPv4?n=(0,gt.int32ToIpv4)(t.readUInt32BE()):s===O.Socks5HostType.IPv6?n=l_.Address6.fromByteArray(Array.from(t.readBuffer(16))).canonicalForm():n=t.readString(t.readUInt8());let a=t.readUInt16BE();return{frameNumber:r,remoteHost:{host:n,port:a},data:t.readBuffer()}}setState(e){this.state!==O.SocksClientState.Error&&(this.state=e)}connect(e){this.onDataReceived=r=>this.onDataReceivedHandler(r),this.onClose=()=>this.onCloseHandler(),this.onError=r=>this.onErrorHandler(r),this.onConnect=()=>this.onConnectHandler();let t=setTimeout(()=>this.onEstablishedTimeout(),this.options.timeout||O.DEFAULT_TIMEOUT);t.unref&&typeof t.unref=="function"&&t.unref(),e?this.socket=e:this.socket=new Ro.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(O.SocksClientState.Connecting),this.receiveBuffer=new n7.ReceiveBuffer,e?this.socket.emit("connect"):(this.socket.connect(this.getSocketOptions()),this.options.set_tcp_nodelay!==void 0&&this.options.set_tcp_nodelay!==null&&this.socket.setNoDelay(!!this.options.set_tcp_nodelay)),this.prependOnceListener("established",r=>{setImmediate(()=>{if(this.receiveBuffer.length>0){let s=this.receiveBuffer.get(this.receiveBuffer.length);r.socket.emit("data",s)}r.socket.resume()})})}getSocketOptions(){return Object.assign(Object.assign({},this.options.socket_options),{host:this.options.proxy.host||this.options.proxy.ipaddress,port:this.options.proxy.port})}onEstablishedTimeout(){this.state!==O.SocksClientState.Established&&this.state!==O.SocksClientState.BoundWaitingForConnection&&this.closeSocket(O.ERRORS.ProxyConnectionTimedOut)}onConnectHandler(){this.setState(O.SocksClientState.Connected),this.options.proxy.type===4?this.sendSocks4InitialHandshake():this.sendSocks5InitialHandshake(),this.setState(O.SocksClientState.SentInitialHandshake)}onDataReceivedHandler(e){this.receiveBuffer.append(e),this.processData()}processData(){for(;this.state!==O.SocksClientState.Established&&this.state!==O.SocksClientState.Error&&this.receiveBuffer.length>=this.nextRequiredPacketBufferSize;)if(this.state===O.SocksClientState.SentInitialHandshake)this.options.proxy.type===4?this.handleSocks4FinalHandshakeResponse():this.handleInitialSocks5HandshakeResponse();else if(this.state===O.SocksClientState.SentAuthentication)this.handleInitialSocks5AuthenticationHandshakeResponse();else if(this.state===O.SocksClientState.SentFinalHandshake)this.handleSocks5FinalHandshakeResponse();else if(this.state===O.SocksClientState.BoundWaitingForConnection)this.options.proxy.type===4?this.handleSocks4IncomingConnectionResponse():this.handleSocks5IncomingConnectionResponse();else{this.closeSocket(O.ERRORS.InternalError);break}}onCloseHandler(){this.closeSocket(O.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!==O.SocksClientState.Error&&(this.setState(O.SocksClientState.Error),this.socket.destroy(),this.removeInternalSocketHandlers(),this.emit("error",new h_.SocksClientError(e,this.options)))}sendSocks4InitialHandshake(){let e=this.options.proxy.userId||"",t=new rt.SmartBuffer;t.writeUInt8(4),t.writeUInt8(O.SocksCommand[this.options.command]),t.writeUInt16BE(this.options.destination.port),Ro.isIPv4(this.options.destination.host)?(t.writeBuffer((0,gt.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=O.SOCKS_INCOMING_PACKET_SIZES.Socks4Response,this.socket.write(t.toBuffer())}handleSocks4FinalHandshakeResponse(){let e=this.receiveBuffer.get(8);if(e[1]!==O.Socks4Response.Granted)this.closeSocket(`${O.ERRORS.Socks4ProxyRejectedConnection} - (${O.Socks4Response[e[1]]})`);else if(O.SocksCommand[this.options.command]===O.SocksCommand.bind){let t=rt.SmartBuffer.fromBuffer(e);t.readOffset=2;let r={port:t.readUInt16BE(),host:(0,gt.int32ToIpv4)(t.readUInt32BE())};r.host==="0.0.0.0"&&(r.host=this.options.proxy.ipaddress),this.setState(O.SocksClientState.BoundWaitingForConnection),this.emit("bound",{remoteHost:r,socket:this.socket})}else this.setState(O.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{socket:this.socket})}handleSocks4IncomingConnectionResponse(){let e=this.receiveBuffer.get(8);if(e[1]!==O.Socks4Response.Granted)this.closeSocket(`${O.ERRORS.Socks4ProxyRejectedIncomingBoundConnection} - (${O.Socks4Response[e[1]]})`);else{let t=rt.SmartBuffer.fromBuffer(e);t.readOffset=2;let r={port:t.readUInt16BE(),host:(0,gt.int32ToIpv4)(t.readUInt32BE())};this.setState(O.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket})}}sendSocks5InitialHandshake(){let e=new rt.SmartBuffer,t=[O.Socks5Auth.NoAuth];(this.options.proxy.userId||this.options.proxy.password)&&t.push(O.Socks5Auth.UserPass),this.options.proxy.custom_auth_method!==void 0&&t.push(this.options.proxy.custom_auth_method),e.writeUInt8(5),e.writeUInt8(t.length);for(let r of t)e.writeUInt8(r);this.nextRequiredPacketBufferSize=O.SOCKS_INCOMING_PACKET_SIZES.Socks5InitialHandshakeResponse,this.socket.write(e.toBuffer()),this.setState(O.SocksClientState.SentInitialHandshake)}handleInitialSocks5HandshakeResponse(){let e=this.receiveBuffer.get(2);e[0]!==5?this.closeSocket(O.ERRORS.InvalidSocks5IntiailHandshakeSocksVersion):e[1]===O.SOCKS5_NO_ACCEPTABLE_AUTH?this.closeSocket(O.ERRORS.InvalidSocks5InitialHandshakeNoAcceptedAuthType):e[1]===O.Socks5Auth.NoAuth?(this.socks5ChosenAuthType=O.Socks5Auth.NoAuth,this.sendSocks5CommandRequest()):e[1]===O.Socks5Auth.UserPass?(this.socks5ChosenAuthType=O.Socks5Auth.UserPass,this.sendSocks5UserPassAuthentication()):e[1]===this.options.proxy.custom_auth_method?(this.socks5ChosenAuthType=this.options.proxy.custom_auth_method,this.sendSocks5CustomAuthentication()):this.closeSocket(O.ERRORS.InvalidSocks5InitialHandshakeUnknownAuthType)}sendSocks5UserPassAuthentication(){let e=this.options.proxy.userId||"",t=this.options.proxy.password||"",r=new rt.SmartBuffer;r.writeUInt8(1),r.writeUInt8(Buffer.byteLength(e)),r.writeString(e),r.writeUInt8(Buffer.byteLength(t)),r.writeString(t),this.nextRequiredPacketBufferSize=O.SOCKS_INCOMING_PACKET_SIZES.Socks5UserPassAuthenticationResponse,this.socket.write(r.toBuffer()),this.setState(O.SocksClientState.SentAuthentication)}sendSocks5CustomAuthentication(){return vo(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(O.SocksClientState.SentAuthentication)})}handleSocks5CustomAuthHandshakeResponse(e){return vo(this,void 0,void 0,function*(){return yield this.options.proxy.custom_auth_response_handler(e)})}handleSocks5AuthenticationNoAuthHandshakeResponse(e){return vo(this,void 0,void 0,function*(){return e[1]===0})}handleSocks5AuthenticationUserPassHandshakeResponse(e){return vo(this,void 0,void 0,function*(){return e[1]===0})}handleInitialSocks5AuthenticationHandshakeResponse(){return vo(this,void 0,void 0,function*(){this.setState(O.SocksClientState.ReceivedAuthenticationResponse);let e=!1;this.socks5ChosenAuthType===O.Socks5Auth.NoAuth?e=yield this.handleSocks5AuthenticationNoAuthHandshakeResponse(this.receiveBuffer.get(2)):this.socks5ChosenAuthType===O.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(O.ERRORS.Socks5AuthenticationFailed)})}sendSocks5CommandRequest(){let e=new rt.SmartBuffer;e.writeUInt8(5),e.writeUInt8(O.SocksCommand[this.options.command]),e.writeUInt8(0),Ro.isIPv4(this.options.destination.host)?(e.writeUInt8(O.Socks5HostType.IPv4),e.writeBuffer((0,gt.ipToBuffer)(this.options.destination.host))):Ro.isIPv6(this.options.destination.host)?(e.writeUInt8(O.Socks5HostType.IPv6),e.writeBuffer((0,gt.ipToBuffer)(this.options.destination.host))):(e.writeUInt8(O.Socks5HostType.Hostname),e.writeUInt8(this.options.destination.host.length),e.writeString(this.options.destination.host)),e.writeUInt16BE(this.options.destination.port),this.nextRequiredPacketBufferSize=O.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader,this.socket.write(e.toBuffer()),this.setState(O.SocksClientState.SentFinalHandshake)}handleSocks5FinalHandshakeResponse(){let e=this.receiveBuffer.peek(5);if(e[0]!==5||e[1]!==O.Socks5Response.Granted)this.closeSocket(`${O.ERRORS.InvalidSocks5FinalHandshakeRejected} - ${O.Socks5Response[e[1]]}`);else{let t=e[3],r,s;if(t===O.Socks5HostType.IPv4){let n=O.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}s=rt.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:(0,gt.int32ToIpv4)(s.readUInt32BE()),port:s.readUInt16BE()},r.host==="0.0.0.0"&&(r.host=this.options.proxy.ipaddress)}else if(t===O.Socks5HostType.Hostname){let n=e[4],a=O.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)),r={host:s.readString(n),port:s.readUInt16BE()}}else if(t===O.Socks5HostType.IPv6){let n=O.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}s=rt.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:l_.Address6.fromByteArray(Array.from(s.readBuffer(16))).canonicalForm(),port:s.readUInt16BE()}}this.setState(O.SocksClientState.ReceivedFinalResponse),O.SocksCommand[this.options.command]===O.SocksCommand.connect?(this.setState(O.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket})):O.SocksCommand[this.options.command]===O.SocksCommand.bind?(this.setState(O.SocksClientState.BoundWaitingForConnection),this.nextRequiredPacketBufferSize=O.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader,this.emit("bound",{remoteHost:r,socket:this.socket})):O.SocksCommand[this.options.command]===O.SocksCommand.associate&&(this.setState(O.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket}))}}handleSocks5IncomingConnectionResponse(){let e=this.receiveBuffer.peek(5);if(e[0]!==5||e[1]!==O.Socks5Response.Granted)this.closeSocket(`${O.ERRORS.Socks5ProxyRejectedIncomingBoundConnection} - ${O.Socks5Response[e[1]]}`);else{let t=e[3],r,s;if(t===O.Socks5HostType.IPv4){let n=O.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}s=rt.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:(0,gt.int32ToIpv4)(s.readUInt32BE()),port:s.readUInt16BE()},r.host==="0.0.0.0"&&(r.host=this.options.proxy.ipaddress)}else if(t===O.Socks5HostType.Hostname){let n=e[4],a=O.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)),r={host:s.readString(n),port:s.readUInt16BE()}}else if(t===O.Socks5HostType.IPv6){let n=O.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}s=rt.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:l_.Address6.fromByteArray(Array.from(s.readBuffer(16))).canonicalForm(),port:s.readUInt16BE()}}this.setState(O.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket})}}get socksClientOptions(){return Object.assign({},this.options)}};Fr.SocksClient=f_});var vM=d(Vs=>{"use strict";var o7=Vs&&Vs.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),a7=Vs&&Vs.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&o7(e,i,t)};Object.defineProperty(Vs,"__esModule",{value:!0});a7(OM(),Vs)});var RM=d(xt=>{"use strict";var c7=xt&&xt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),u7=xt&&xt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),d_=xt&&xt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&c7(e,i,t);return u7(e,i),e},l7=xt&&xt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(xt,"__esModule",{value:!0});xt.SocksProxyAgent=void 0;var h7=vM(),f7=Yc(),d7=l7(Fs()),p7=d_(require("dns")),m7=d_(require("net")),g7=d_(require("tls")),y7=require("url"),pd=(0,d7.default)("socks-proxy-agent"),S7=o(i=>i.servername===void 0&&i.host&&!m7.isIP(i.host)?{...i,servername:i.host}:i,"setServernameFromNonIpHost");function E7(i){let e=!1,t=5,r=i.hostname,s=parseInt(i.port,10)||1080;switch(i.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(i.protocol)}`)}let n={host:r,port:s,type:t};return i.username&&Object.defineProperty(n,"userId",{value:decodeURIComponent(i.username),enumerable:!1}),i.password!=null&&Object.defineProperty(n,"password",{value:decodeURIComponent(i.password),enumerable:!1}),{lookup:e,proxy:n}}o(E7,"parseSocksURL");var md=class extends f7.Agent{static{o(this,"SocksProxyAgent")}constructor(e,t){super(t);let r=typeof e=="string"?new y7.URL(e):e,{proxy:s,lookup:n}=E7(r);this.shouldLookup=n,this.proxy=s,this.timeout=t?.timeout??null,this.socketOptions=t?.socketOptions??null}async connect(e,t){let{shouldLookup:r,proxy:s,timeout:n}=this;if(!t.host)throw new Error("No `host` defined!");let{host:a}=t,{port:c,lookup:u=p7.lookup}=t;r&&(a=await new Promise((p,m)=>{u(a,{},(y,g)=>{y?m(y):p(g)})}));let l={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(p=>{e.destroy(),f.destroy(),p&&p.destroy()},"cleanup");pd("Creating socks proxy connection: %o",l);let{socket:f}=await h7.SocksClient.createConnection(l);if(pd("Successfully created socks proxy connection"),n!==null&&(f.setTimeout(n),f.on("timeout",()=>h())),t.secureEndpoint){pd("Upgrading socket connection to TLS");let p=g7.connect({...w7(S7(t),"host","path","port"),socket:f});return p.once("error",m=>{pd("Socket TLS error",m.message),h(p)}),p}return f}};md.protocols=["socks","socks4","socks4a","socks5","socks5h"];xt.SocksProxyAgent=md;function w7(i,...e){let t={},r;for(r in i)e.includes(r)||(t[r]=i[r]);return t}o(w7,"omit")});var E_=d((aEe,AM)=>{"use strict";var p_=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}},m_=class extends Error{static{o(this,"ConnectionTimeoutError")}constructor(e){super(`Timeout connecting to host \`${e}\``),this.code="ECONNECTIONTIMEOUT",this.host=e}},g_=class extends Error{static{o(this,"IdleTimeoutError")}constructor(e){super(`Idle timeout reached for host \`${e}\``),this.code="EIDLETIMEOUT",this.host=e}},y_=class extends Error{static{o(this,"ResponseTimeoutError")}constructor(e,t){let r="Response timeout ";t&&(r+=`from proxy \`${t.host}\` `),r+=`connecting to host \`${e.host}\``,super(r),this.code="ERESPONSETIMEOUT",this.proxy=t,this.request=e}},S_=class extends Error{static{o(this,"TransferTimeoutError")}constructor(e,t){let r="Transfer timeout ";t&&(r+=`from proxy \`${t.host}\` `),r+=`for \`${e.host}\``,super(r),this.code="ETRANSFERTIMEOUT",this.proxy=t,this.request=e}};AM.exports={InvalidProxyProtocolError:p_,ConnectionTimeoutError:m_,IdleTimeoutError:g_,ResponseTimeoutError:y_,TransferTimeoutError:S_}});var w_=d((uEe,CM)=>{"use strict";var{HttpProxyAgent:_7}=$L(),{HttpsProxyAgent:b7}=JL(),{SocksProxyAgent:TM}=RM(),{LRUCache:I7}=os(),{InvalidProxyProtocolError:O7}=E_(),v7=new I7({max:20}),R7=new Set(TM.protocols),A7=new Set(["https_proxy","http_proxy","proxy","no_proxy"]),Qc=Object.entries(process.env).reduce((i,[e,t])=>(e=e.toLowerCase(),A7.has(e)&&(i[e]=t),i),{}),T7=o(i=>{i=new URL(i);let e=i.protocol.slice(0,-1);if(R7.has(e))return TM;if(e==="https"||e==="http")return[_7,b7];throw new O7(i)},"getProxyAgent"),C7=o((i,e)=>{if(typeof e=="string"&&(e=e.split(",").map(r=>r.trim()).filter(Boolean)),!e||!e.length)return!1;let t=i.hostname.split(".").reverse();return e.some(r=>{let s=r.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"),N7=o((i,{proxy:e,noProxy:t})=>(i=new URL(i),e||(e=i.protocol==="https:"?Qc.https_proxy:Qc.https_proxy||Qc.http_proxy||Qc.proxy),t||(t=Qc.no_proxy),!e||C7(i,t)?null:new URL(e)),"getProxy");CM.exports={getProxyAgent:T7,getProxy:N7,proxyCache:v7}});var DM=d((fEe,PM)=>{"use strict";var P7=require("net"),D7=require("tls"),{once:NM}=require("events"),x7=require("timers/promises"),{normalizeOptions:L7,cacheOptions:M7}=Hw(),{getProxy:B7,getProxyAgent:k7,proxyCache:__}=w_(),gd=E_(),{Agent:F7}=Yc();PM.exports=class extends F7{static{o(this,"Agent")}#e;#t;#i;#r;#s;constructor(e={}){let{timeouts:t,proxy:r,noProxy:s,...n}=L7(e);super(n),this.#e=n,this.#t=t,r&&(this.#i=new URL(r),this.#r=s,this.#s=k7(r))}get proxy(){return this.#i?{url:this.#i}:{}}#u(e){if(!this.#i)return;let t=B7(`${e.protocol}//${e.host}:${e.port}`,{proxy:this.#i,noProxy:this.#r});if(!t)return;let r=M7({...e,...this.#e,timeouts:this.#t,proxy:t});if(__.has(r))return __.get(r);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 __.set(r,n),n}async#c({promises:e,options:t,timeout:r},s=new AbortController){if(r){let a=x7.setTimeout(r,null,{signal:s.signal}).then(()=>{throw new gd.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 r,s=this.#t.connection,n=this.isSecureEndpoint(t),a=this.#u(t);if(a){let h=Date.now();r=await this.#c({options:t,timeout:s,promises:[a.connect(e,t)]}),s&&(s=s-(Date.now()-h))}else r=(n?D7:P7).connect(t);r.setKeepAlive(this.keepAlive,this.keepAliveMsecs),r.setNoDelay(this.keepAlive);let c=new AbortController,{signal:u}=c,l=r[n?"secureConnecting":"connecting"]?NM(r,n?"secureConnect":"connect",{signal:u}):Promise.resolve();return await this.#c({options:t,timeout:s,promises:[l,NM(r,"error",{signal:u}).then(h=>{throw h[0]})]},c),this.#t.idle&&r.setTimeout(this.#t.idle,()=>{r.destroy(new gd.IdleTimeoutError(`${t.host}:${t.port}`))}),r}addRequest(e,t){let r=this.#u(t);if(r?.setRequestProps&&r.setRequestProps(e,t),e.setHeader("connection",this.keepAlive?"keep-alive":"close"),this.#t.response){let s;e.once("finish",()=>{setTimeout(()=>{e.destroy(new gd.ResponseTimeoutError(e,this.#i))},this.#t.response)}),e.once("response",()=>{clearTimeout(s)})}if(this.#t.transfer){let s;e.once("response",n=>{setTimeout(()=>{n.destroy(new gd.TransferTimeoutError(e,this.#i))},this.#t.transfer),n.once("close",()=>{clearTimeout(s)})})}return super.addRequest(e,t)}}});var BM=d((pEe,MM)=>{"use strict";var{LRUCache:U7}=os(),{normalizeOptions:j7,cacheOptions:$7}=Hw(),{getProxy:q7,proxyCache:xM}=w_(),LM=zw(),yd=DM(),eu=new U7({max:20}),V7=o((i,{agent:e,proxy:t,noProxy:r,...s}={})=>{if(e!=null)return e;i=new URL(i);let n=q7(i,{proxy:t,noProxy:r}),a={...j7(s),proxy:n},c=$7({...a,secureEndpoint:i.protocol==="https:"});if(eu.has(c))return eu.get(c);let u=new yd(a);return eu.set(c,u),u},"getAgent");MM.exports={getAgent:V7,Agent:yd,HttpAgent:yd,HttpsAgent:yd,cache:{proxy:xM,agent:eu,dns:LM.cache,clear:o(()=>{xM.clear(),eu.clear(),LM.cache.clear()},"clear")}}});var kM=d((gEe,z7)=>{z7.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 Ed=d((yEe,UM)=>{var{Minipass:H7}=te(),Sd=go(),G7=xa(),W7=ai(),{log:FM}=St(),J7=Vw(),{getAgent:K7}=BM(),b_=kM(),Z7=`${b_.name}/${b_.version} (+https://npm.im/${b_.name})`,Y7=["ECONNRESET","ECONNREFUSED","EADDRINUSE","ETIMEDOUT","ECONNECTIONTIMEOUT","EIDLETIMEOUT","ERESPONSETIMEOUT","ETRANSFERTIMEOUT"],X7=["request-timeout"],Q7=o((i,e)=>{let t=K7(i.url,{...e,signal:void 0});i.headers.has("connection")||i.headers.set("connection",t?"keep-alive":"close"),i.headers.has("user-agent")||i.headers.set("user-agent",Z7);let r={...e,agent:t,redirect:"manual"};return G7(async(s,n)=>{let a=new Sd.Request(i,r);try{let c=await Sd(a,r);if(r.integrity&&c.status===200){let h=W7.integrityStream({algorithms:r.algorithms,integrity:r.integrity,size:r.size}),f=new J7({events:["integrity","size"]},c.body,h);h.on("integrity",p=>f.emit("integrity",p)),h.on("size",p=>f.emit("size",p)),c=new Sd.Response(f,c),c.body.hasIntegrityEmitter=!0}c.headers.set("x-fetch-attempts",n);let u=H7.isStream(a.body);return a.method!=="POST"&&!u&&([408,420,429].includes(c.status)||c.status>=500)?(typeof e.onRetry=="function"&&e.onRetry(c),FM.http("fetch",`${a.method} ${a.url} attempt ${n} failed with ${c.status}`),s(c)):c}catch(c){let u=c.code==="EPROMISERETRY"?c.retried.code:c.code,l=c.retried instanceof Sd.Response||Y7.includes(u)&&X7.includes(c.type);if(a.method==="POST"||l)throw c;return typeof e.onRetry=="function"&&e.onRetry(c),FM.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");UM.exports=Q7});var HM=d((EEe,zM)=>{var{Request:jM,Response:I_}=go(),{Minipass:$M}=te(),eee=Ih(),zs=dc(),tee=require("url"),iee=Vw(),ree=jw(),O_=AL(),see=Ed(),tu=o((i,e)=>Object.prototype.hasOwnProperty.call(i,e),"hasOwnProperty"),nee=["accept-charset","accept-encoding","accept-language","accept","cache-control"],VM=["cache-control","content-encoding","content-language","content-type","date","etag","expires","last-modified","link","location","pragma","vary"],qM=o((i,e,t)=>{let r={time:Date.now(),url:i.url,reqHeaders:{},resHeaders:{},options:{compress:t.compress!=null?t.compress:i.compress}};e.status!==200&&e.status!==304&&(r.status=e.status);for(let a of nee)i.headers.has(a)&&(r.reqHeaders[a]=i.headers.get(a));let s=i.headers.get("host"),n=new tee.URL(i.url);if(s&&n.host!==s&&(r.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 u of c)i.headers.has(u)&&(r.reqHeaders[u]=i.headers.get(u))}}for(let a of VM)e.headers.has(a)&&(r.resHeaders[a]=e.headers.get(a));for(let a of t.cacheAdditionalHeaders)e.headers.has(a)&&(r.resHeaders[a]=e.headers.get(a));return r},"getMetadata"),wd=Symbol("request"),_d=Symbol("response"),bd=Symbol("policy"),v_=class i{static{o(this,"CacheEntry")}constructor({entry:e,request:t,response:r,options:s}){e?(this.key=e.key,this.entry=e,this.entry.metadata.time=this.entry.metadata.time||this.entry.time):this.key=O_(t),this.options=s,this[wd]=t,this[_d]=r,this[bd]=null}static async find(e,t){try{var r=await zs.index.compact(t.cachePath,O_(e),(n,a)=>{let c=new i({entry:n,options:t}),u=new i({entry:a,options:t});return c.policy.satisfies(u.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 r){let a=new i({entry:n,options:t});if(a.policy.satisfies(e)){s=a;break}}return s}static async invalidate(e,t){let r=O_(e);try{await zs.rm.entry(t.cachePath,r,{removeFully:!0})}catch{}}get request(){return this[wd]||(this[wd]=new jM(this.entry.metadata.url,{method:"GET",headers:this.entry.metadata.reqHeaders,...this.entry.metadata.options})),this[wd]}get response(){return this[_d]||(this[_d]=new I_(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[_d]}get policy(){return this[bd]||(this[bd]=new ree({entry:this.entry,request:this.request,response:this.response,options:this.options})),this[bd]}async store(e){if(this.request.method!=="GET"||![200,301,308].includes(this.response.status)||!this.policy.storable())return this.response.headers.set("x-local-cache-status","skip"),this.response;let t=this.response.headers.get("content-length"),r={algorithms:this.options.algorithms,metadata:qM(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,u=new Promise((h,f)=>{a=h,c=f}).catch(h=>{s.emit("error",h)});s=new iee({events:["integrity","size"]},new eee({flush(){return u}})),s.hasIntegrityEmitter=!0;let l=o(()=>{let h=new $M,f=zs.put.stream(this.options.cachePath,this.key,r);f.on("integrity",p=>s.emit("integrity",p)),f.on("size",p=>s.emit("size",p)),h.pipe(f),f.promise().then(a,c),s.unshift(h),s.unshift(this.response.body)},"onResume");s.once("resume",l),s.once("end",()=>s.removeListener("resume",l))}else await zs.index.insert(this.options.cachePath,this.key,null,r);return this.response.headers.set("x-local-cache",encodeURIComponent(this.options.cachePath)),this.response.headers.set("x-local-cache-key",encodeURIComponent(this.key)),this.response.headers.set("x-local-cache-mode","stream"),this.response.headers.set("x-local-cache-status",e),this.response.headers.set("x-local-cache-time",new Date().toISOString()),new I_(s,{url:this.response.url,status:this.response.status,headers:this.response.headers,counter:this.options.counter})}async respond(e,t,r){let s;if(e==="HEAD"||[301,308].includes(this.response.status))s=this.response;else{let n=new $M,a={...this.policy.responseHeaders()},c=o(()=>{let u=zs.get.stream.byDigest(this.options.cachePath,this.entry.integrity,{memoize:this.options.memoize});u.on("error",async l=>{u.pause(),l.code==="EINTEGRITY"&&await zs.rm.content(this.options.cachePath,this.entry.integrity,{memoize:this.options.memoize}),(l.code==="ENOENT"||l.code==="EINTEGRITY")&&await i.invalidate(this.request,this.options),n.emit("error",l),u.resume()}),n.emit("integrity",this.entry.integrity),n.emit("size",Number(a["content-length"])),u.pipe(n)},"onResume");n.once("resume",c),n.once("end",()=>n.removeListener("resume",c)),s=new I_(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",r),s.headers.set("x-local-cache-time",new Date(this.entry.metadata.time).toUTCString()),s}async revalidate(e,t){let r=new jM(e,{headers:this.policy.revalidationHeaders(e)});try{var s=await see(r,{...t,headers:void 0})}catch(a){if(!this.policy.mustRevalidate)return this.respond(e.method,t,"stale");throw a}if(this.policy.revalidated(r,s)){let a=qM(e,s,t);for(let c of VM)!tu(a.resHeaders,c)&&tu(this.entry.metadata.resHeaders,c)&&(a.resHeaders[c]=this.entry.metadata.resHeaders[c]);for(let c of t.cacheAdditionalHeaders){let u=tu(a.resHeaders,c),l=tu(this.entry.metadata.resHeaders,c),h=tu(this.policy.response.headers,c);!u&&l&&(a.resHeaders[c]=this.entry.metadata.resHeaders[c]),!h&&u&&(this.policy.response.headers[c]=a.resHeaders[c])}try{await zs.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 i({request:e,response:s,options:t}).store("updated")}};zM.exports=v_});var JM=d((_Ee,WM)=>{var{NotCachedError:oee}=OL(),R_=HM(),aee=Ed(),GM=o(async(i,e)=>{let t=await R_.find(i,e);if(!t){if(e.cache==="only-if-cached")throw new oee(i.url);let s=await aee(i,e);return new R_({request:i,response:s,options:e}).store("miss")}if(e.cache==="no-cache")return t.revalidate(i,e);let r=t.policy.needsRevalidation(i);return e.cache==="force-cache"||e.cache==="only-if-cached"||!r?t.respond(i.method,e,r?"stale":"hit"):t.revalidate(i,e)},"cacheFetch");GM.invalidate=async(i,e)=>{if(e.cachePath)return R_.invalidate(i,e)};WM.exports=GM});var XM=d((IEe,YM)=>{"use strict";var{FetchError:A_,Request:cee,isRedirect:uee}=go(),T_=require("url"),lee=jw(),KM=JM(),hee=Ed(),fee=o((i,e,t)=>{if(!uee(e.status)||t.redirect==="manual")return!1;if(t.redirect==="error")throw new A_(`redirect mode is set to error: ${i.url}`,"no-redirect",{code:"ENOREDIRECT"});if(!e.headers.has("location"))throw new A_(`redirect location header missing for: ${i.url}`,"no-location",{code:"EINVALIDREDIRECT"});if(i.counter>=i.follow)throw new A_(`maximum redirect reached at: ${i.url}`,"max-redirect",{code:"EMAXREDIRECT"});return!0},"canFollowRedirect"),dee=o((i,e,t)=>{let r={...t},s=e.headers.get("location"),n=new T_.URL(s,/^https?:/.test(s)?void 0:i.url);return new T_.URL(i.url).hostname!==n.hostname&&(i.headers.delete("authorization"),i.headers.delete("cookie")),(e.status===303||i.method==="POST"&&[301,302].includes(e.status))&&(r.method="GET",r.body=null,i.headers.delete("content-length")),r.headers={},i.headers.forEach((c,u)=>{r.headers[u]=c}),r.counter=++i.counter,{request:new cee(T_.format(n),r),options:r}},"getRedirect"),ZM=o(async(i,e)=>{let t=lee.storable(i,e)?await KM(i,e):await hee(i,e);if(!["GET","HEAD"].includes(i.method)&&t.status>=200&&t.status<=399&&await KM.invalidate(i,e),!fee(i,t,e))return t;let r=dee(i,t,e);return ZM(r.request,r.options)},"fetch");YM.exports=ZM});var iu=d((vEe,Ao)=>{var{FetchError:pee,Headers:mee,Request:QM,Response:gee}=go(),yee=Kx(),See=XM(),Id=o((i,e)=>{let t=yee(e),r=new QM(i,t);return See(r,t)},"makeFetchHappen");Id.defaults=(i,e={},t=Id)=>{typeof i=="object"&&(e=i,i=null);let r=o((s,n={})=>{let a=s||i,c={...e,...n,headers:{...e.headers,...n.headers}};return t(a,c)},"defaultedFetch");return r.defaults=(s,n={})=>Id.defaults(s,n,r),r};Ao.exports=Id;Ao.exports.FetchError=pee;Ao.exports.Headers=mee;Ao.exports.Request=QM;Ao.exports.Response=gee});var bB=d((AEe,_B)=>{var j={},pB=j.LEFT_BRACE=1,Rd=j.RIGHT_BRACE=2,mB=j.LEFT_BRACKET=3,P_=j.RIGHT_BRACKET=4,Ad=j.COLON=5,Td=j.COMMA=6,gB=j.TRUE=7,yB=j.FALSE=8,SB=j.NULL=9,Cd=j.STRING=10,EB=j.NUMBER=11,Hs=j.START=17,wB=j.STOP=18,eB=j.TRUE1=33,tB=j.TRUE2=34,iB=j.TRUE3=35,rB=j.FALSE1=49,sB=j.FALSE2=50,nB=j.FALSE3=51,oB=j.FALSE4=52,aB=j.NULL1=65,cB=j.NULL2=66,uB=j.NULL3=67,lB=j.NUMBER1=81,C_=j.NUMBER3=83,Qt=j.STRING1=97,hB=j.STRING2=98,fB=j.STRING3=99,Eee=j.STRING4=100,wee=j.STRING5=101,dB=j.STRING6=102,To=j.VALUE=113,N_=j.KEY=114,Od=j.OBJECT=129,vd=j.ARRAY=130,_ee=92,bee=47,Iee=8,Oee=12,vee=10,Ree=13,Aee=9,Nd=64*1024;function Ur(){this.tState=Hs,this.value=void 0,this.string=void 0,this.stringBuffer=Buffer.alloc?Buffer.alloc(Nd):new Buffer(Nd),this.stringBufferOffset=0,this.unicode=void 0,this.highSurrogate=void 0,this.key=void 0,this.mode=void 0,this.stack=[],this.state=To,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(Ur,"Parser");Ur.toknam=function(i){for(var e=Object.keys(j),t=0,r=e.length;t<r;t++){var s=e[t];if(j[s]===i)return s}return i&&"0x"+i.toString(16)};var Lt=Ur.prototype;Lt.onError=function(i){throw i};Lt.charError=function(i,e){this.tState=wB,this.onError(new Error("Unexpected "+JSON.stringify(String.fromCharCode(i[e]))+" at position "+e+" in state "+Ur.toknam(this.tState)))};Lt.appendStringChar=function(i){this.stringBufferOffset>=Nd&&(this.string+=this.stringBuffer.toString("utf8"),this.stringBufferOffset=0),this.stringBuffer[this.stringBufferOffset++]=i};Lt.appendStringBuf=function(i,e,t){var r=i.length;typeof e=="number"&&(typeof t=="number"?t<0?r=i.length-e+t:r=t-e:r=i.length-e),r<0&&(r=0),this.stringBufferOffset+r>Nd&&(this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0),i.copy(this.stringBuffer,this.stringBufferOffset,e,t),this.stringBufferOffset+=r};Lt.write=function(i){typeof i=="string"&&(i=new Buffer(i));for(var e,t=0,r=i.length;t<r;t++)if(this.tState===Hs){if(e=i[t],this.offset++,e===123)this.onToken(pB,"{");else if(e===125)this.onToken(Rd,"}");else if(e===91)this.onToken(mB,"[");else if(e===93)this.onToken(P_,"]");else if(e===58)this.onToken(Ad,":");else if(e===44)this.onToken(Td,",");else if(e===116)this.tState=eB;else if(e===102)this.tState=rB;else if(e===110)this.tState=aB;else if(e===34)this.string="",this.stringBufferOffset=0,this.tState=Qt;else if(e===45)this.string="-",this.tState=lB;else if(e>=48&&e<64)this.string=String.fromCharCode(e),this.tState=C_;else if(!(e===32||e===9||e===10||e===13))return this.charError(i,t)}else if(this.tState===Qt)if(e=i[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]=i[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 "+Ur.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>i.length){for(var n=0;n<=i.length-1-t;n++)this.temp_buffs[this.bytes_in_sequence][n]=i[t+n];this.bytes_remaining=t+this.bytes_in_sequence-i.length,t=i.length-1}else this.appendStringBuf(i,t,t+this.bytes_in_sequence),t=t+this.bytes_in_sequence-1}else if(e===34)this.tState=Hs,this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0,this.onToken(Cd,this.string),this.offset+=Buffer.byteLength(this.string,"utf8")+1,this.string=void 0;else if(e===92)this.tState=hB;else if(e>=32)this.appendStringChar(e);else return this.charError(i,t);else if(this.tState===hB)if(e=i[t],e===34)this.appendStringChar(e),this.tState=Qt;else if(e===92)this.appendStringChar(_ee),this.tState=Qt;else if(e===47)this.appendStringChar(bee),this.tState=Qt;else if(e===98)this.appendStringChar(Iee),this.tState=Qt;else if(e===102)this.appendStringChar(Oee),this.tState=Qt;else if(e===110)this.appendStringChar(vee),this.tState=Qt;else if(e===114)this.appendStringChar(Ree),this.tState=Qt;else if(e===116)this.appendStringChar(Aee),this.tState=Qt;else if(e===117)this.unicode="",this.tState=fB;else return this.charError(i,t);else if(this.tState===fB||this.tState===Eee||this.tState===wee||this.tState===dB)if(e=i[t],e>=48&&e<64||e>64&&e<=70||e>96&&e<=102){if(this.unicode+=String.fromCharCode(e),this.tState++===dB){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=Qt}}else return this.charError(i,t);else if(this.tState===lB||this.tState===C_)switch(e=i[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=C_;break;default:this.tState=Hs;var c=Number(this.string);if(isNaN(c))return this.charError(i,t);this.string.match(/[0-9]+/)==this.string&&c.toString()!=this.string?this.onToken(Cd,this.string):this.onToken(EB,c),this.offset+=this.string.length-1,this.string=void 0,t--;break}else if(this.tState===eB)if(i[t]===114)this.tState=tB;else return this.charError(i,t);else if(this.tState===tB)if(i[t]===117)this.tState=iB;else return this.charError(i,t);else if(this.tState===iB)if(i[t]===101)this.tState=Hs,this.onToken(gB,!0),this.offset+=3;else return this.charError(i,t);else if(this.tState===rB)if(i[t]===97)this.tState=sB;else return this.charError(i,t);else if(this.tState===sB)if(i[t]===108)this.tState=nB;else return this.charError(i,t);else if(this.tState===nB)if(i[t]===115)this.tState=oB;else return this.charError(i,t);else if(this.tState===oB)if(i[t]===101)this.tState=Hs,this.onToken(yB,!1),this.offset+=4;else return this.charError(i,t);else if(this.tState===aB)if(i[t]===117)this.tState=cB;else return this.charError(i,t);else if(this.tState===cB)if(i[t]===108)this.tState=uB;else return this.charError(i,t);else if(this.tState===uB)if(i[t]===108)this.tState=Hs,this.onToken(SB,null),this.offset+=3;else return this.charError(i,t)};Lt.onToken=function(i,e){};Lt.parseError=function(i,e){this.tState=wB,this.onError(new Error("Unexpected "+Ur.toknam(i)+(e?"("+JSON.stringify(e)+")":"")+" in state "+Ur.toknam(this.state)))};Lt.push=function(){this.stack.push({value:this.value,key:this.key,mode:this.mode})};Lt.pop=function(){var i=this.value,e=this.stack.pop();this.value=e.value,this.key=e.key,this.mode=e.mode,this.emit(i),this.mode||(this.state=To)};Lt.emit=function(i){this.mode&&(this.state=Td),this.onValue(i)};Lt.onValue=function(i){};Lt.onToken=function(i,e){if(this.state===To)if(i===Cd||i===EB||i===gB||i===yB||i===SB)this.value&&(this.value[this.key]=e),this.emit(e);else if(i===pB)this.push(),this.value?this.value=this.value[this.key]={}:this.value={},this.key=void 0,this.state=N_,this.mode=Od;else if(i===mB)this.push(),this.value?this.value=this.value[this.key]=[]:this.value=[],this.key=0,this.mode=vd,this.state=To;else if(i===Rd)if(this.mode===Od)this.pop();else return this.parseError(i,e);else if(i===P_)if(this.mode===vd)this.pop();else return this.parseError(i,e);else return this.parseError(i,e);else if(this.state===N_)if(i===Cd)this.key=e,this.state=Ad;else if(i===Rd)this.pop();else return this.parseError(i,e);else if(this.state===Ad)if(i===Ad)this.state=To;else return this.parseError(i,e);else if(this.state===Td)if(i===Td)this.mode===vd?(this.key++,this.state=To):this.mode===Od&&(this.state=N_);else if(i===P_&&this.mode===vd||i===Rd&&this.mode===Od)this.pop();else return this.parseError(i,e);else return this.parseError(i,e)};Ur.C=j;_B.exports=Ur});var vB=d((CEe,OB)=>{var Tee=bB(),{Minipass:Cee}=te(),Pd=class extends Error{static{o(this,"JSONStreamError")}constructor(e,t){super(e.message),Error.captureStackTrace(this,t||this.constructor)}get name(){return"JSONStreamError"}},IB=o((i,e)=>typeof i=="string"?String(e)===i:i&&typeof i.test=="function"?i.test(e):typeof i=="boolean"||typeof i=="object"?i:typeof i=="function"?i(e):!1,"check"),D_=class i extends Cee{static{o(this,"JSONStream")}#e=0;#t=!1;#i=null;#r=null;#s=null;#u;#c;#f=null;#n=null;constructor(e){super({...e,objectMode:!0});let t=this.#c=new Tee;t.onValue=r=>this.#a(r),this.#u=t.onToken,t.onToken=(r,s)=>this.#d(r,s),t.onError=r=>this.#o(r),this.#f=typeof e.path=="string"?e.path.split(".").map(r=>r==="$*"?{emitKey:!0}:r==="*"?!0:r===""?{recurse:!0}:r):Array.isArray(e.path)&&e.path.length?e.path:null,typeof e.map=="function"&&(this.#s=e.map)}#h(e,t){this.#r!==!1&&(this.#r=this.#r||{},this.#r[e]=t),this.#i!==!1&&this.#r===!1&&(this.#i=this.#i||{},this.#i[e]=t)}#o(e){let t=this.#t?this.end:this.write;return this.#t=!1,this.emit("error",new Pd(e,t))}#d(e,t){let r=this.#c;if(this.#u.call(this.#c,e,t),r.stack.length===0&&this.#n){let s=this.#n;this.#f||super.write(s),this.#n=null,this.#e=0}}#a(e){let t=this.#c;if(this.#n=e,!this.#f)return;let r=0,s=0,n=!1;for(;r<this.#f.length;){let c=this.#f[r];if(s++,c&&!c.recurse){let u=s===t.stack.length?t:t.stack[s];if(!u)return;if(!IB(c,u.key)){this.#h(u.key,e);return}n=!!c.emitKey,r++}else{if(r++,r>=this.#f.length)return;let u=this.#f[r];if(!u)return;for(;;){let l=s===t.stack.length?t:t.stack[s];if(!l)return;if(IB(u,l.key)){r++,Object.isFrozen(t.stack[s])||(t.stack[s].value=null);break}else this.#h(l.key,e);s++}}}if(this.#r){let c=this.#r;this.#r=!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 u=n?{value:c}:c;n&&(u.key=t.key),super.write(u)}}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.#c.write(e),this.flowing}end(e,t){this.#t=!0,e&&this.write(e,t);let r=this.#r;this.#r=null;let s=this.#i;return this.#i=null,r&&this.emit("header",r),s&&this.emit("footer",s),super.end()}static get JSONStreamError(){return Pd}static parse(e,t){return new i({path:e,map:t})}};OB.exports=D_});var x_=d((PEe,Co)=>{"use strict";var{HttpErrorAuthOTP:Nee}=dw(),Pee=qx(),AB=Wx(),Dee=iu(),xee=vB(),Lee=Un(),Mee=require("querystring"),Dd=require("url"),RB=vc(),{Minipass:Bee}=te(),xd=Aw(),kee=o(i=>{try{return!!new Dd.URL(i)}catch{return!1}},"urlIsValid");Co.exports=Ld;function Ld(i,e={}){let t={...xd,...e},r=kee(i),s=t.registry||xd.registry;r||(s=t.registry=t.spec&&TB(t.spec,t)||t.registry||s,i=`${s.trim().replace(/\/?$/g,"")}/${i.trim().replace(/^\//,"")}`,new Dd.URL(i));let n=t.method||"GET",a=Date.now(),c=AB(i,t),u=$ee(i,c,t),l=t.body,h=Bee.isStream(l),f=l&&typeof l=="object"&&typeof l.then=="function";if(l&&!h&&!f&&typeof l!="string"&&!Buffer.isBuffer(l)?(u["content-type"]=u["content-type"]||"application/json",l=JSON.stringify(l)):l&&!u["content-type"]&&(u["content-type"]="application/octet-stream"),t.gzip)if(u["content-encoding"]="gzip",h){let y=new RB.Gzip;l.on("error",g=>y.emit("error",g)),l=l.pipe(y)}else f||(l=new RB.Gzip().end(l).concat());let p=new Dd.URL(i);if(t.query){let y=typeof t.query=="string"?Mee.parse(t.query):t.query;Object.keys(y).forEach(g=>{y[g]!==void 0&&p.searchParams.set(g,y[g])}),i=Dd.format(p)}p.searchParams.get("write")==="true"&&n==="GET"&&(t.offline=!1,t.preferOffline=!1,t.preferOnline=!0);let m=o(async y=>{let g=Dee(i,{agent:t.agent,algorithms:t.algorithms,body:y,cache:jee(t),cachePath:t.cache,ca:t.ca,cert:c.cert||t.cert,headers:u,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(S=>Pee({method:n,uri:i,res:S,registry:s,startTime:a,auth:c,opts:t}));return typeof t.otpPrompt=="function"?g.catch(async S=>{if(S instanceof Nee){let E;try{E=await t.otpPrompt()}catch{}if(!E)throw S;return Ld(i,{...t,otp:E})}throw S}):g},"doFetch");return Promise.resolve(l).then(m)}o(Ld,"regFetch");Co.exports.getAuth=AB;Co.exports.json=Fee;function Fee(i,e){return Ld(i,e).then(t=>t.json())}o(Fee,"fetchJSON");Co.exports.json.stream=Uee;function Uee(i,e,t={}){let r={...xd,...t},s=xee.parse(e,r.mapJSON);return Ld(i,r).then(n=>n.body.on("error",a=>s.emit("error",a)).pipe(s)).catch(n=>s.emit("error",n)),s}o(Uee,"fetchJSONStream");Co.exports.pickRegistry=TB;function TB(i,e={}){i=Lee(i);let t=i.scope&&e[i.scope.replace(/^@?/,"@")+":registry"];return!t&&e.scope&&(t=e[e.scope.replace(/^@?/,"@")+":registry"]),t||(t=e.registry||xd.registry),t}o(TB,"pickRegistry");function jee(i){return i.offline?"only-if-cached":i.preferOffline?"force-cache":i.preferOnline?"no-cache":"default"}o(jee,"getCacheMode");function $ee(i,e,t){let r=Object.assign({"user-agent":t.userAgent},t.headers||{});return t.authType&&(r["npm-auth-type"]=t.authType),t.scope&&(r["npm-scope"]=t.scope),t.npmSession&&(r["npm-session"]=t.npmSession),t.npmCommand&&(r["npm-command"]=t.npmCommand),e.token?r.authorization=`Bearer ${e.token}`:e.auth&&(r.authorization=`Basic ${e.auth}`),t.otp&&(r["npm-otp"]=t.otp),r}o($ee,"getHeaders")});var L_=d((xEe,qee)=>{qee.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 ru=d((LEe,DB)=>{var Vee=x_(),{Minipass:zee}=te(),Hee=xs(),CB=fo(),NB=Ds(),PB=L_().version,M_=class extends Hee{static{o(this,"RemoteFetcher")}constructor(e,t){super(e,t),this.resolved=this.spec.fetchSpec;let r=new URL(this.resolved);this.replaceRegistryHost!=="never"&&(this.replaceRegistryHost==="always"||this.replaceRegistryHost===r.host)&&(this.resolved=new URL(r.pathname,this.registry).href);let s=this.spec.name?`${this.spec.name}@`:"";this.pkgid=t.pkgid?t.pkgid:`remote:${s}${this.resolved}`}get[NB.cacheFetches](){return!1}[NB.tarballFromResolved](){let e=new zee;e.hasIntegrityEmitter=!0;let t={...this.opts,headers:this.#e(),spec:this.spec,integrity:this.integrity,algorithms:[this.pickIntegrityAlgorithm()]};return Vee(this.resolved,t).then(r=>{r.body.on("error",s=>e.emit("error",s)),r.body.on("integrity",s=>{this.integrity=s,e.emit("integrity",s)}),r.body.pipe(e)}).catch(r=>e.emit("error",r)),e}#e(){return{"user-agent":this.opts.userAgent||`pacote/${PB} node/${process.version}`,...this.opts.headers||{},"pacote-version":PB,"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 CB.prototype.packument.apply(this)}manifest(){return CB.prototype.manifest.apply(this)}};DB.exports=M_});var LB=d((BEe,xB)=>{var Gee=o((i,e)=>{if(i.hosted){let t=i.hosted,r={noCommittish:!0};return`${t.https&&t.auth?t.https(r):t.shortcut(r)}#${e}`}else return i.rawSpec.replace(/#.*$/,"")+`#${e}`},"addGitSha");xB.exports=Gee});var BB=d((FEe,MB)=>{var Wee=Dl();MB.exports=(i,e,t,r,s)=>{let n=i.endsWith(".js"),a=n?process.execPath:i,c=(n?[i]:[]).concat(e);return Wee(a,c,{cwd:t,env:r},s)}});var k_=d((UEe,jB)=>{var Jee=dc(),Md=uy(),Kee=Un(),Zee=Jl(),{Minipass:Yee}=te(),{log:kB}=St(),Xee=$f(),Qee=xs(),FB=fo(),ete=ru(),Bd=Ds(),tte=LB(),ite=BB(),rte=/^[a-f0-9]{40}$/,kd=o((i,e)=>i.sshurl&&!(i.https&&i.auth)&&UB(i.sshurl(e))||i.https&&UB(i.https(e)),"repoUrl"),UB=o(i=>i&&`git+${i}`.replace(/^(git\+)+/,"git+"),"addGitPlus"),B_=class extends Qee{static{o(this,"GitFetcher")}constructor(e,t){super(e,t),this.opts.integrity&&(delete this.opts.integrity,kB.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&&rte.test(this.spec.gitCommittish)?(this.resolvedSha=this.spec.gitCommittish,this.resolved=this.spec.hosted?kd(this.spec.hosted,{noCommittish:!1}):this.spec.rawSpec):this.resolvedSha="",this.Arborist=t.Arborist||null}static repoUrl(e,t){return kd(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 Md.errors.GitPathspecError)throw t;let r=e.sshurl&&e.sshurl();if(!r||e.auth)throw t;return this.#t(r)})}#t(e){if(!e)return Promise.reject(new Error(`No git url for ${this.spec}`));let t=this.spec.gitRange,r=this.spec.name;return Md.revs(e,this.opts).then(s=>t?Zee({versions:s.versions,"dist-tags":s["dist-tags"],name:r},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.#r(s.sha),this.resolved))}#i(e){this.resolved=this.spec.hosted?kd(Kee(e).hosted,{noCommittish:!1}):e}#r(e){this.#i(tte(this.spec,e))}#s(){return this.#c(()=>this.resolved)}#u(e){return this[Bd.readPackageJson](e).then(t=>{let r=t.scripts;if(!t.workspaces&&(!r||!(r.postinstall||r.build||r.preinstall||r.install||r.prepack||r.prepare)))return;let s=process.env._PACOTE_NO_PREPARE_?process.env._PACOTE_NO_PREPARE_.split(`
53
- `):[];if(s.includes(this.resolved)){kB.info("prepare","skip prepare, already seen",this.resolved);return}return s.push(this.resolved),ite(this.npmBin,[].concat(this.npmInstallCmd).concat(this.npmCliConfig),e,{...process.env,_PACOTE_NO_PREPARE_:s.join(`
54
- `)},{message:"git dep preparation failed"})})}[Bd.tarballFromResolved](){let e=new Yee;return e.resolved=this.resolved,e.from=this.from,this.#c(t=>this.#u(t).then(()=>new Promise((r,s)=>{if(!this.Arborist)throw new Error("GitFetcher requires an Arborist constructor to pack a tarball");let a=new Xee(`file:${t}`,{...this.opts,Arborist:this.Arborist,resolved:null,integrity:null})[Bd.tarballFromResolved]();a.on("error",s),a.on("end",r),a.pipe(e)}))).catch(t=>e.emit("error",t)),e}#c(e,t=!0){let r={tmpPrefix:"git-clone"},s=this.resolvedSha||this.spec.gitCommittish,n=this.spec.hosted,a=this.resolved;return t=t&&n&&a===kd(n,{noCommittish:!1})&&n.tarball,Jee.tmp.withTmp(this.cache,r,async c=>{if(t){let l=this.spec.name?`${this.spec.name}@`:"";return new ete(n.tarball({noCommittish:!1}),{...this.opts,allowGitIgnore:!0,pkgid:`git:${l}${this.resolved}`,resolved:this.resolved,integrity:null}).extract(c).then(()=>e(c),h=>{if(h.constructor.name.match(/^Http/))return this.#c(e,!1);throw h})}let u=await(n?this.#f(s,c):this.#n(this.spec.fetchSpec,s,c));return this.resolvedSha=u,this.resolved||await this.#r(u),e(c)})}#f(e,t){let r=this.spec.hosted;return this.#n(r.https({noCommittish:!0}),e,t).catch(s=>{if(s instanceof Md.errors.GitPathspecError)throw s;let n=r.sshurl&&r.sshurl({noCommittish:!0});if(!n||r.auth)throw s;return this.#n(n,e,t)})}#n(e,t,r){let{opts:s,spec:n}=this;return Md.clone(e,t,r,{...s,spec:n})}manifest(){return this.package?Promise.resolve(this.package):this.spec.hosted&&this.resolved?FB.prototype.manifest.apply(this):this.#c(e=>this[Bd.readPackageJson](e).then(t=>this.package={...t,_resolved:this.resolved,_from:this.from}))}packument(){return FB.prototype.packument.apply(this)}};jB.exports=B_});var F_=d(jr=>{"use strict";Object.defineProperty(jr,"__esModule",{value:!0});jr.Signature=jr.Envelope=void 0;jr.Envelope={fromJSON(i){return{payload:Fd(i.payload)?Buffer.from($B(i.payload)):Buffer.alloc(0),payloadType:Fd(i.payloadType)?globalThis.String(i.payloadType):"",signatures:globalThis.Array.isArray(i?.signatures)?i.signatures.map(e=>jr.Signature.fromJSON(e)):[]}},toJSON(i){let e={};return i.payload.length!==0&&(e.payload=qB(i.payload)),i.payloadType!==""&&(e.payloadType=i.payloadType),i.signatures?.length&&(e.signatures=i.signatures.map(t=>jr.Signature.toJSON(t))),e}};jr.Signature={fromJSON(i){return{sig:Fd(i.sig)?Buffer.from($B(i.sig)):Buffer.alloc(0),keyid:Fd(i.keyid)?globalThis.String(i.keyid):""}},toJSON(i){let e={};return i.sig.length!==0&&(e.sig=qB(i.sig)),i.keyid!==""&&(e.keyid=i.keyid),e}};function $B(i){return Uint8Array.from(globalThis.Buffer.from(i,"base64"))}o($B,"bytesFromBase64");function qB(i){return globalThis.Buffer.from(i).toString("base64")}o(qB,"base64FromBytes");function Fd(i){return i!=null}o(Fd,"isSet")});var zB=d(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});Ud.Timestamp=void 0;Ud.Timestamp={fromJSON(i){return{seconds:VB(i.seconds)?globalThis.String(i.seconds):"0",nanos:VB(i.nanos)?globalThis.Number(i.nanos):0}},toJSON(i){let e={};return i.seconds!=="0"&&(e.seconds=i.seconds),i.nanos!==0&&(e.nanos=Math.round(i.nanos)),e}};function VB(i){return i!=null}o(VB,"isSet")});var No=d(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.TimeRange=x.X509CertificateChain=x.SubjectAlternativeName=x.X509Certificate=x.DistinguishedName=x.ObjectIdentifierValuePair=x.ObjectIdentifier=x.PublicKeyIdentifier=x.PublicKey=x.RFC3161SignedTimestamp=x.LogId=x.MessageSignature=x.HashOutput=x.SubjectAlternativeNameType=x.PublicKeyDetails=x.HashAlgorithm=void 0;x.hashAlgorithmFromJSON=GB;x.hashAlgorithmToJSON=WB;x.publicKeyDetailsFromJSON=JB;x.publicKeyDetailsToJSON=KB;x.subjectAlternativeNameTypeFromJSON=ZB;x.subjectAlternativeNameTypeToJSON=YB;var ste=zB(),st;(function(i){i[i.HASH_ALGORITHM_UNSPECIFIED=0]="HASH_ALGORITHM_UNSPECIFIED",i[i.SHA2_256=1]="SHA2_256",i[i.SHA2_384=2]="SHA2_384",i[i.SHA2_512=3]="SHA2_512",i[i.SHA3_256=4]="SHA3_256",i[i.SHA3_384=5]="SHA3_384"})(st||(x.HashAlgorithm=st={}));function GB(i){switch(i){case 0:case"HASH_ALGORITHM_UNSPECIFIED":return st.HASH_ALGORITHM_UNSPECIFIED;case 1:case"SHA2_256":return st.SHA2_256;case 2:case"SHA2_384":return st.SHA2_384;case 3:case"SHA2_512":return st.SHA2_512;case 4:case"SHA3_256":return st.SHA3_256;case 5:case"SHA3_384":return st.SHA3_384;default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum HashAlgorithm")}}o(GB,"hashAlgorithmFromJSON");function WB(i){switch(i){case st.HASH_ALGORITHM_UNSPECIFIED:return"HASH_ALGORITHM_UNSPECIFIED";case st.SHA2_256:return"SHA2_256";case st.SHA2_384:return"SHA2_384";case st.SHA2_512:return"SHA2_512";case st.SHA3_256:return"SHA3_256";case st.SHA3_384:return"SHA3_384";default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum HashAlgorithm")}}o(WB,"hashAlgorithmToJSON");var D;(function(i){i[i.PUBLIC_KEY_DETAILS_UNSPECIFIED=0]="PUBLIC_KEY_DETAILS_UNSPECIFIED",i[i.PKCS1_RSA_PKCS1V5=1]="PKCS1_RSA_PKCS1V5",i[i.PKCS1_RSA_PSS=2]="PKCS1_RSA_PSS",i[i.PKIX_RSA_PKCS1V5=3]="PKIX_RSA_PKCS1V5",i[i.PKIX_RSA_PSS=4]="PKIX_RSA_PSS",i[i.PKIX_RSA_PKCS1V15_2048_SHA256=9]="PKIX_RSA_PKCS1V15_2048_SHA256",i[i.PKIX_RSA_PKCS1V15_3072_SHA256=10]="PKIX_RSA_PKCS1V15_3072_SHA256",i[i.PKIX_RSA_PKCS1V15_4096_SHA256=11]="PKIX_RSA_PKCS1V15_4096_SHA256",i[i.PKIX_RSA_PSS_2048_SHA256=16]="PKIX_RSA_PSS_2048_SHA256",i[i.PKIX_RSA_PSS_3072_SHA256=17]="PKIX_RSA_PSS_3072_SHA256",i[i.PKIX_RSA_PSS_4096_SHA256=18]="PKIX_RSA_PSS_4096_SHA256",i[i.PKIX_ECDSA_P256_HMAC_SHA_256=6]="PKIX_ECDSA_P256_HMAC_SHA_256",i[i.PKIX_ECDSA_P256_SHA_256=5]="PKIX_ECDSA_P256_SHA_256",i[i.PKIX_ECDSA_P384_SHA_384=12]="PKIX_ECDSA_P384_SHA_384",i[i.PKIX_ECDSA_P521_SHA_512=13]="PKIX_ECDSA_P521_SHA_512",i[i.PKIX_ED25519=7]="PKIX_ED25519",i[i.PKIX_ED25519_PH=8]="PKIX_ED25519_PH",i[i.PKIX_ECDSA_P384_SHA_256=19]="PKIX_ECDSA_P384_SHA_256",i[i.PKIX_ECDSA_P521_SHA_256=20]="PKIX_ECDSA_P521_SHA_256",i[i.LMS_SHA256=14]="LMS_SHA256",i[i.LMOTS_SHA256=15]="LMOTS_SHA256",i[i.ML_DSA_65=21]="ML_DSA_65",i[i.ML_DSA_87=22]="ML_DSA_87"})(D||(x.PublicKeyDetails=D={}));function JB(i){switch(i){case 0:case"PUBLIC_KEY_DETAILS_UNSPECIFIED":return D.PUBLIC_KEY_DETAILS_UNSPECIFIED;case 1:case"PKCS1_RSA_PKCS1V5":return D.PKCS1_RSA_PKCS1V5;case 2:case"PKCS1_RSA_PSS":return D.PKCS1_RSA_PSS;case 3:case"PKIX_RSA_PKCS1V5":return D.PKIX_RSA_PKCS1V5;case 4:case"PKIX_RSA_PSS":return D.PKIX_RSA_PSS;case 9:case"PKIX_RSA_PKCS1V15_2048_SHA256":return D.PKIX_RSA_PKCS1V15_2048_SHA256;case 10:case"PKIX_RSA_PKCS1V15_3072_SHA256":return D.PKIX_RSA_PKCS1V15_3072_SHA256;case 11:case"PKIX_RSA_PKCS1V15_4096_SHA256":return D.PKIX_RSA_PKCS1V15_4096_SHA256;case 16:case"PKIX_RSA_PSS_2048_SHA256":return D.PKIX_RSA_PSS_2048_SHA256;case 17:case"PKIX_RSA_PSS_3072_SHA256":return D.PKIX_RSA_PSS_3072_SHA256;case 18:case"PKIX_RSA_PSS_4096_SHA256":return D.PKIX_RSA_PSS_4096_SHA256;case 6:case"PKIX_ECDSA_P256_HMAC_SHA_256":return D.PKIX_ECDSA_P256_HMAC_SHA_256;case 5:case"PKIX_ECDSA_P256_SHA_256":return D.PKIX_ECDSA_P256_SHA_256;case 12:case"PKIX_ECDSA_P384_SHA_384":return D.PKIX_ECDSA_P384_SHA_384;case 13:case"PKIX_ECDSA_P521_SHA_512":return D.PKIX_ECDSA_P521_SHA_512;case 7:case"PKIX_ED25519":return D.PKIX_ED25519;case 8:case"PKIX_ED25519_PH":return D.PKIX_ED25519_PH;case 19:case"PKIX_ECDSA_P384_SHA_256":return D.PKIX_ECDSA_P384_SHA_256;case 20:case"PKIX_ECDSA_P521_SHA_256":return D.PKIX_ECDSA_P521_SHA_256;case 14:case"LMS_SHA256":return D.LMS_SHA256;case 15:case"LMOTS_SHA256":return D.LMOTS_SHA256;case 21:case"ML_DSA_65":return D.ML_DSA_65;case 22:case"ML_DSA_87":return D.ML_DSA_87;default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum PublicKeyDetails")}}o(JB,"publicKeyDetailsFromJSON");function KB(i){switch(i){case D.PUBLIC_KEY_DETAILS_UNSPECIFIED:return"PUBLIC_KEY_DETAILS_UNSPECIFIED";case D.PKCS1_RSA_PKCS1V5:return"PKCS1_RSA_PKCS1V5";case D.PKCS1_RSA_PSS:return"PKCS1_RSA_PSS";case D.PKIX_RSA_PKCS1V5:return"PKIX_RSA_PKCS1V5";case D.PKIX_RSA_PSS:return"PKIX_RSA_PSS";case D.PKIX_RSA_PKCS1V15_2048_SHA256:return"PKIX_RSA_PKCS1V15_2048_SHA256";case D.PKIX_RSA_PKCS1V15_3072_SHA256:return"PKIX_RSA_PKCS1V15_3072_SHA256";case D.PKIX_RSA_PKCS1V15_4096_SHA256:return"PKIX_RSA_PKCS1V15_4096_SHA256";case D.PKIX_RSA_PSS_2048_SHA256:return"PKIX_RSA_PSS_2048_SHA256";case D.PKIX_RSA_PSS_3072_SHA256:return"PKIX_RSA_PSS_3072_SHA256";case D.PKIX_RSA_PSS_4096_SHA256:return"PKIX_RSA_PSS_4096_SHA256";case D.PKIX_ECDSA_P256_HMAC_SHA_256:return"PKIX_ECDSA_P256_HMAC_SHA_256";case D.PKIX_ECDSA_P256_SHA_256:return"PKIX_ECDSA_P256_SHA_256";case D.PKIX_ECDSA_P384_SHA_384:return"PKIX_ECDSA_P384_SHA_384";case D.PKIX_ECDSA_P521_SHA_512:return"PKIX_ECDSA_P521_SHA_512";case D.PKIX_ED25519:return"PKIX_ED25519";case D.PKIX_ED25519_PH:return"PKIX_ED25519_PH";case D.PKIX_ECDSA_P384_SHA_256:return"PKIX_ECDSA_P384_SHA_256";case D.PKIX_ECDSA_P521_SHA_256:return"PKIX_ECDSA_P521_SHA_256";case D.LMS_SHA256:return"LMS_SHA256";case D.LMOTS_SHA256:return"LMOTS_SHA256";case D.ML_DSA_65:return"ML_DSA_65";case D.ML_DSA_87:return"ML_DSA_87";default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum PublicKeyDetails")}}o(KB,"publicKeyDetailsToJSON");var vi;(function(i){i[i.SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED=0]="SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED",i[i.EMAIL=1]="EMAIL",i[i.URI=2]="URI",i[i.OTHER_NAME=3]="OTHER_NAME"})(vi||(x.SubjectAlternativeNameType=vi={}));function ZB(i){switch(i){case 0:case"SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED":return vi.SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED;case 1:case"EMAIL":return vi.EMAIL;case 2:case"URI":return vi.URI;case 3:case"OTHER_NAME":return vi.OTHER_NAME;default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum SubjectAlternativeNameType")}}o(ZB,"subjectAlternativeNameTypeFromJSON");function YB(i){switch(i){case vi.SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED:return"SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED";case vi.EMAIL:return"EMAIL";case vi.URI:return"URI";case vi.OTHER_NAME:return"OTHER_NAME";default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum SubjectAlternativeNameType")}}o(YB,"subjectAlternativeNameTypeToJSON");x.HashOutput={fromJSON(i){return{algorithm:we(i.algorithm)?GB(i.algorithm):0,digest:we(i.digest)?Buffer.from(Gs(i.digest)):Buffer.alloc(0)}},toJSON(i){let e={};return i.algorithm!==0&&(e.algorithm=WB(i.algorithm)),i.digest.length!==0&&(e.digest=Ws(i.digest)),e}};x.MessageSignature={fromJSON(i){return{messageDigest:we(i.messageDigest)?x.HashOutput.fromJSON(i.messageDigest):void 0,signature:we(i.signature)?Buffer.from(Gs(i.signature)):Buffer.alloc(0)}},toJSON(i){let e={};return i.messageDigest!==void 0&&(e.messageDigest=x.HashOutput.toJSON(i.messageDigest)),i.signature.length!==0&&(e.signature=Ws(i.signature)),e}};x.LogId={fromJSON(i){return{keyId:we(i.keyId)?Buffer.from(Gs(i.keyId)):Buffer.alloc(0)}},toJSON(i){let e={};return i.keyId.length!==0&&(e.keyId=Ws(i.keyId)),e}};x.RFC3161SignedTimestamp={fromJSON(i){return{signedTimestamp:we(i.signedTimestamp)?Buffer.from(Gs(i.signedTimestamp)):Buffer.alloc(0)}},toJSON(i){let e={};return i.signedTimestamp.length!==0&&(e.signedTimestamp=Ws(i.signedTimestamp)),e}};x.PublicKey={fromJSON(i){return{rawBytes:we(i.rawBytes)?Buffer.from(Gs(i.rawBytes)):void 0,keyDetails:we(i.keyDetails)?JB(i.keyDetails):0,validFor:we(i.validFor)?x.TimeRange.fromJSON(i.validFor):void 0}},toJSON(i){let e={};return i.rawBytes!==void 0&&(e.rawBytes=Ws(i.rawBytes)),i.keyDetails!==0&&(e.keyDetails=KB(i.keyDetails)),i.validFor!==void 0&&(e.validFor=x.TimeRange.toJSON(i.validFor)),e}};x.PublicKeyIdentifier={fromJSON(i){return{hint:we(i.hint)?globalThis.String(i.hint):""}},toJSON(i){let e={};return i.hint!==""&&(e.hint=i.hint),e}};x.ObjectIdentifier={fromJSON(i){return{id:globalThis.Array.isArray(i?.id)?i.id.map(e=>globalThis.Number(e)):[]}},toJSON(i){let e={};return i.id?.length&&(e.id=i.id.map(t=>Math.round(t))),e}};x.ObjectIdentifierValuePair={fromJSON(i){return{oid:we(i.oid)?x.ObjectIdentifier.fromJSON(i.oid):void 0,value:we(i.value)?Buffer.from(Gs(i.value)):Buffer.alloc(0)}},toJSON(i){let e={};return i.oid!==void 0&&(e.oid=x.ObjectIdentifier.toJSON(i.oid)),i.value.length!==0&&(e.value=Ws(i.value)),e}};x.DistinguishedName={fromJSON(i){return{organization:we(i.organization)?globalThis.String(i.organization):"",commonName:we(i.commonName)?globalThis.String(i.commonName):""}},toJSON(i){let e={};return i.organization!==""&&(e.organization=i.organization),i.commonName!==""&&(e.commonName=i.commonName),e}};x.X509Certificate={fromJSON(i){return{rawBytes:we(i.rawBytes)?Buffer.from(Gs(i.rawBytes)):Buffer.alloc(0)}},toJSON(i){let e={};return i.rawBytes.length!==0&&(e.rawBytes=Ws(i.rawBytes)),e}};x.SubjectAlternativeName={fromJSON(i){return{type:we(i.type)?ZB(i.type):0,identity:we(i.regexp)?{$case:"regexp",regexp:globalThis.String(i.regexp)}:we(i.value)?{$case:"value",value:globalThis.String(i.value)}:void 0}},toJSON(i){let e={};return i.type!==0&&(e.type=YB(i.type)),i.identity?.$case==="regexp"?e.regexp=i.identity.regexp:i.identity?.$case==="value"&&(e.value=i.identity.value),e}};x.X509CertificateChain={fromJSON(i){return{certificates:globalThis.Array.isArray(i?.certificates)?i.certificates.map(e=>x.X509Certificate.fromJSON(e)):[]}},toJSON(i){let e={};return i.certificates?.length&&(e.certificates=i.certificates.map(t=>x.X509Certificate.toJSON(t))),e}};x.TimeRange={fromJSON(i){return{start:we(i.start)?HB(i.start):void 0,end:we(i.end)?HB(i.end):void 0}},toJSON(i){let e={};return i.start!==void 0&&(e.start=i.start.toISOString()),i.end!==void 0&&(e.end=i.end.toISOString()),e}};function Gs(i){return Uint8Array.from(globalThis.Buffer.from(i,"base64"))}o(Gs,"bytesFromBase64");function Ws(i){return globalThis.Buffer.from(i).toString("base64")}o(Ws,"base64FromBytes");function nte(i){let e=(globalThis.Number(i.seconds)||0)*1e3;return e+=(i.nanos||0)/1e6,new globalThis.Date(e)}o(nte,"fromTimestamp");function HB(i){return i instanceof globalThis.Date?i:typeof i=="string"?new globalThis.Date(i):nte(ste.Timestamp.fromJSON(i))}o(HB,"fromJsonTimestamp");function we(i){return i!=null}o(we,"isSet")});var U_=d(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.TransparencyLogEntry=_e.InclusionPromise=_e.InclusionProof=_e.Checkpoint=_e.KindVersion=void 0;var XB=No();_e.KindVersion={fromJSON(i){return{kind:Je(i.kind)?globalThis.String(i.kind):"",version:Je(i.version)?globalThis.String(i.version):""}},toJSON(i){let e={};return i.kind!==""&&(e.kind=i.kind),i.version!==""&&(e.version=i.version),e}};_e.Checkpoint={fromJSON(i){return{envelope:Je(i.envelope)?globalThis.String(i.envelope):""}},toJSON(i){let e={};return i.envelope!==""&&(e.envelope=i.envelope),e}};_e.InclusionProof={fromJSON(i){return{logIndex:Je(i.logIndex)?globalThis.String(i.logIndex):"0",rootHash:Je(i.rootHash)?Buffer.from(jd(i.rootHash)):Buffer.alloc(0),treeSize:Je(i.treeSize)?globalThis.String(i.treeSize):"0",hashes:globalThis.Array.isArray(i?.hashes)?i.hashes.map(e=>Buffer.from(jd(e))):[],checkpoint:Je(i.checkpoint)?_e.Checkpoint.fromJSON(i.checkpoint):void 0}},toJSON(i){let e={};return i.logIndex!=="0"&&(e.logIndex=i.logIndex),i.rootHash.length!==0&&(e.rootHash=$d(i.rootHash)),i.treeSize!=="0"&&(e.treeSize=i.treeSize),i.hashes?.length&&(e.hashes=i.hashes.map(t=>$d(t))),i.checkpoint!==void 0&&(e.checkpoint=_e.Checkpoint.toJSON(i.checkpoint)),e}};_e.InclusionPromise={fromJSON(i){return{signedEntryTimestamp:Je(i.signedEntryTimestamp)?Buffer.from(jd(i.signedEntryTimestamp)):Buffer.alloc(0)}},toJSON(i){let e={};return i.signedEntryTimestamp.length!==0&&(e.signedEntryTimestamp=$d(i.signedEntryTimestamp)),e}};_e.TransparencyLogEntry={fromJSON(i){return{logIndex:Je(i.logIndex)?globalThis.String(i.logIndex):"0",logId:Je(i.logId)?XB.LogId.fromJSON(i.logId):void 0,kindVersion:Je(i.kindVersion)?_e.KindVersion.fromJSON(i.kindVersion):void 0,integratedTime:Je(i.integratedTime)?globalThis.String(i.integratedTime):"0",inclusionPromise:Je(i.inclusionPromise)?_e.InclusionPromise.fromJSON(i.inclusionPromise):void 0,inclusionProof:Je(i.inclusionProof)?_e.InclusionProof.fromJSON(i.inclusionProof):void 0,canonicalizedBody:Je(i.canonicalizedBody)?Buffer.from(jd(i.canonicalizedBody)):Buffer.alloc(0)}},toJSON(i){let e={};return i.logIndex!=="0"&&(e.logIndex=i.logIndex),i.logId!==void 0&&(e.logId=XB.LogId.toJSON(i.logId)),i.kindVersion!==void 0&&(e.kindVersion=_e.KindVersion.toJSON(i.kindVersion)),i.integratedTime!=="0"&&(e.integratedTime=i.integratedTime),i.inclusionPromise!==void 0&&(e.inclusionPromise=_e.InclusionPromise.toJSON(i.inclusionPromise)),i.inclusionProof!==void 0&&(e.inclusionProof=_e.InclusionProof.toJSON(i.inclusionProof)),i.canonicalizedBody.length!==0&&(e.canonicalizedBody=$d(i.canonicalizedBody)),e}};function jd(i){return Uint8Array.from(globalThis.Buffer.from(i,"base64"))}o(jd,"bytesFromBase64");function $d(i){return globalThis.Buffer.from(i).toString("base64")}o($d,"base64FromBytes");function Je(i){return i!=null}o(Je,"isSet")});var j_=d(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.Bundle=Mt.VerificationMaterial=Mt.TimestampVerificationData=void 0;var QB=F_(),Ri=No(),ek=U_();Mt.TimestampVerificationData={fromJSON(i){return{rfc3161Timestamps:globalThis.Array.isArray(i?.rfc3161Timestamps)?i.rfc3161Timestamps.map(e=>Ri.RFC3161SignedTimestamp.fromJSON(e)):[]}},toJSON(i){let e={};return i.rfc3161Timestamps?.length&&(e.rfc3161Timestamps=i.rfc3161Timestamps.map(t=>Ri.RFC3161SignedTimestamp.toJSON(t))),e}};Mt.VerificationMaterial={fromJSON(i){return{content:$r(i.publicKey)?{$case:"publicKey",publicKey:Ri.PublicKeyIdentifier.fromJSON(i.publicKey)}:$r(i.x509CertificateChain)?{$case:"x509CertificateChain",x509CertificateChain:Ri.X509CertificateChain.fromJSON(i.x509CertificateChain)}:$r(i.certificate)?{$case:"certificate",certificate:Ri.X509Certificate.fromJSON(i.certificate)}:void 0,tlogEntries:globalThis.Array.isArray(i?.tlogEntries)?i.tlogEntries.map(e=>ek.TransparencyLogEntry.fromJSON(e)):[],timestampVerificationData:$r(i.timestampVerificationData)?Mt.TimestampVerificationData.fromJSON(i.timestampVerificationData):void 0}},toJSON(i){let e={};return i.content?.$case==="publicKey"?e.publicKey=Ri.PublicKeyIdentifier.toJSON(i.content.publicKey):i.content?.$case==="x509CertificateChain"?e.x509CertificateChain=Ri.X509CertificateChain.toJSON(i.content.x509CertificateChain):i.content?.$case==="certificate"&&(e.certificate=Ri.X509Certificate.toJSON(i.content.certificate)),i.tlogEntries?.length&&(e.tlogEntries=i.tlogEntries.map(t=>ek.TransparencyLogEntry.toJSON(t))),i.timestampVerificationData!==void 0&&(e.timestampVerificationData=Mt.TimestampVerificationData.toJSON(i.timestampVerificationData)),e}};Mt.Bundle={fromJSON(i){return{mediaType:$r(i.mediaType)?globalThis.String(i.mediaType):"",verificationMaterial:$r(i.verificationMaterial)?Mt.VerificationMaterial.fromJSON(i.verificationMaterial):void 0,content:$r(i.messageSignature)?{$case:"messageSignature",messageSignature:Ri.MessageSignature.fromJSON(i.messageSignature)}:$r(i.dsseEnvelope)?{$case:"dsseEnvelope",dsseEnvelope:QB.Envelope.fromJSON(i.dsseEnvelope)}:void 0}},toJSON(i){let e={};return i.mediaType!==""&&(e.mediaType=i.mediaType),i.verificationMaterial!==void 0&&(e.verificationMaterial=Mt.VerificationMaterial.toJSON(i.verificationMaterial)),i.content?.$case==="messageSignature"?e.messageSignature=Ri.MessageSignature.toJSON(i.content.messageSignature):i.content?.$case==="dsseEnvelope"&&(e.dsseEnvelope=QB.Envelope.toJSON(i.content.dsseEnvelope)),e}};function $r(i){return i!=null}o($r,"isSet")});var $_=d(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});L.ClientTrustConfig=L.ServiceConfiguration=L.Service=L.SigningConfig=L.TrustedRoot=L.CertificateAuthority=L.TransparencyLogInstance=L.ServiceSelector=void 0;L.serviceSelectorFromJSON=tk;L.serviceSelectorToJSON=ik;var je=No(),Ai;(function(i){i[i.SERVICE_SELECTOR_UNDEFINED=0]="SERVICE_SELECTOR_UNDEFINED",i[i.ALL=1]="ALL",i[i.ANY=2]="ANY",i[i.EXACT=3]="EXACT"})(Ai||(L.ServiceSelector=Ai={}));function tk(i){switch(i){case 0:case"SERVICE_SELECTOR_UNDEFINED":return Ai.SERVICE_SELECTOR_UNDEFINED;case 1:case"ALL":return Ai.ALL;case 2:case"ANY":return Ai.ANY;case 3:case"EXACT":return Ai.EXACT;default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum ServiceSelector")}}o(tk,"serviceSelectorFromJSON");function ik(i){switch(i){case Ai.SERVICE_SELECTOR_UNDEFINED:return"SERVICE_SELECTOR_UNDEFINED";case Ai.ALL:return"ALL";case Ai.ANY:return"ANY";case Ai.EXACT:return"EXACT";default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum ServiceSelector")}}o(ik,"serviceSelectorToJSON");L.TransparencyLogInstance={fromJSON(i){return{baseUrl:ae(i.baseUrl)?globalThis.String(i.baseUrl):"",hashAlgorithm:ae(i.hashAlgorithm)?(0,je.hashAlgorithmFromJSON)(i.hashAlgorithm):0,publicKey:ae(i.publicKey)?je.PublicKey.fromJSON(i.publicKey):void 0,logId:ae(i.logId)?je.LogId.fromJSON(i.logId):void 0,checkpointKeyId:ae(i.checkpointKeyId)?je.LogId.fromJSON(i.checkpointKeyId):void 0,operator:ae(i.operator)?globalThis.String(i.operator):""}},toJSON(i){let e={};return i.baseUrl!==""&&(e.baseUrl=i.baseUrl),i.hashAlgorithm!==0&&(e.hashAlgorithm=(0,je.hashAlgorithmToJSON)(i.hashAlgorithm)),i.publicKey!==void 0&&(e.publicKey=je.PublicKey.toJSON(i.publicKey)),i.logId!==void 0&&(e.logId=je.LogId.toJSON(i.logId)),i.checkpointKeyId!==void 0&&(e.checkpointKeyId=je.LogId.toJSON(i.checkpointKeyId)),i.operator!==""&&(e.operator=i.operator),e}};L.CertificateAuthority={fromJSON(i){return{subject:ae(i.subject)?je.DistinguishedName.fromJSON(i.subject):void 0,uri:ae(i.uri)?globalThis.String(i.uri):"",certChain:ae(i.certChain)?je.X509CertificateChain.fromJSON(i.certChain):void 0,validFor:ae(i.validFor)?je.TimeRange.fromJSON(i.validFor):void 0,operator:ae(i.operator)?globalThis.String(i.operator):""}},toJSON(i){let e={};return i.subject!==void 0&&(e.subject=je.DistinguishedName.toJSON(i.subject)),i.uri!==""&&(e.uri=i.uri),i.certChain!==void 0&&(e.certChain=je.X509CertificateChain.toJSON(i.certChain)),i.validFor!==void 0&&(e.validFor=je.TimeRange.toJSON(i.validFor)),i.operator!==""&&(e.operator=i.operator),e}};L.TrustedRoot={fromJSON(i){return{mediaType:ae(i.mediaType)?globalThis.String(i.mediaType):"",tlogs:globalThis.Array.isArray(i?.tlogs)?i.tlogs.map(e=>L.TransparencyLogInstance.fromJSON(e)):[],certificateAuthorities:globalThis.Array.isArray(i?.certificateAuthorities)?i.certificateAuthorities.map(e=>L.CertificateAuthority.fromJSON(e)):[],ctlogs:globalThis.Array.isArray(i?.ctlogs)?i.ctlogs.map(e=>L.TransparencyLogInstance.fromJSON(e)):[],timestampAuthorities:globalThis.Array.isArray(i?.timestampAuthorities)?i.timestampAuthorities.map(e=>L.CertificateAuthority.fromJSON(e)):[]}},toJSON(i){let e={};return i.mediaType!==""&&(e.mediaType=i.mediaType),i.tlogs?.length&&(e.tlogs=i.tlogs.map(t=>L.TransparencyLogInstance.toJSON(t))),i.certificateAuthorities?.length&&(e.certificateAuthorities=i.certificateAuthorities.map(t=>L.CertificateAuthority.toJSON(t))),i.ctlogs?.length&&(e.ctlogs=i.ctlogs.map(t=>L.TransparencyLogInstance.toJSON(t))),i.timestampAuthorities?.length&&(e.timestampAuthorities=i.timestampAuthorities.map(t=>L.CertificateAuthority.toJSON(t))),e}};L.SigningConfig={fromJSON(i){return{mediaType:ae(i.mediaType)?globalThis.String(i.mediaType):"",caUrls:globalThis.Array.isArray(i?.caUrls)?i.caUrls.map(e=>L.Service.fromJSON(e)):[],oidcUrls:globalThis.Array.isArray(i?.oidcUrls)?i.oidcUrls.map(e=>L.Service.fromJSON(e)):[],rekorTlogUrls:globalThis.Array.isArray(i?.rekorTlogUrls)?i.rekorTlogUrls.map(e=>L.Service.fromJSON(e)):[],rekorTlogConfig:ae(i.rekorTlogConfig)?L.ServiceConfiguration.fromJSON(i.rekorTlogConfig):void 0,tsaUrls:globalThis.Array.isArray(i?.tsaUrls)?i.tsaUrls.map(e=>L.Service.fromJSON(e)):[],tsaConfig:ae(i.tsaConfig)?L.ServiceConfiguration.fromJSON(i.tsaConfig):void 0}},toJSON(i){let e={};return i.mediaType!==""&&(e.mediaType=i.mediaType),i.caUrls?.length&&(e.caUrls=i.caUrls.map(t=>L.Service.toJSON(t))),i.oidcUrls?.length&&(e.oidcUrls=i.oidcUrls.map(t=>L.Service.toJSON(t))),i.rekorTlogUrls?.length&&(e.rekorTlogUrls=i.rekorTlogUrls.map(t=>L.Service.toJSON(t))),i.rekorTlogConfig!==void 0&&(e.rekorTlogConfig=L.ServiceConfiguration.toJSON(i.rekorTlogConfig)),i.tsaUrls?.length&&(e.tsaUrls=i.tsaUrls.map(t=>L.Service.toJSON(t))),i.tsaConfig!==void 0&&(e.tsaConfig=L.ServiceConfiguration.toJSON(i.tsaConfig)),e}};L.Service={fromJSON(i){return{url:ae(i.url)?globalThis.String(i.url):"",majorApiVersion:ae(i.majorApiVersion)?globalThis.Number(i.majorApiVersion):0,validFor:ae(i.validFor)?je.TimeRange.fromJSON(i.validFor):void 0,operator:ae(i.operator)?globalThis.String(i.operator):""}},toJSON(i){let e={};return i.url!==""&&(e.url=i.url),i.majorApiVersion!==0&&(e.majorApiVersion=Math.round(i.majorApiVersion)),i.validFor!==void 0&&(e.validFor=je.TimeRange.toJSON(i.validFor)),i.operator!==""&&(e.operator=i.operator),e}};L.ServiceConfiguration={fromJSON(i){return{selector:ae(i.selector)?tk(i.selector):0,count:ae(i.count)?globalThis.Number(i.count):0}},toJSON(i){let e={};return i.selector!==0&&(e.selector=ik(i.selector)),i.count!==0&&(e.count=Math.round(i.count)),e}};L.ClientTrustConfig={fromJSON(i){return{mediaType:ae(i.mediaType)?globalThis.String(i.mediaType):"",trustedRoot:ae(i.trustedRoot)?L.TrustedRoot.fromJSON(i.trustedRoot):void 0,signingConfig:ae(i.signingConfig)?L.SigningConfig.fromJSON(i.signingConfig):void 0}},toJSON(i){let e={};return i.mediaType!==""&&(e.mediaType=i.mediaType),i.trustedRoot!==void 0&&(e.trustedRoot=L.TrustedRoot.toJSON(i.trustedRoot)),i.signingConfig!==void 0&&(e.signingConfig=L.SigningConfig.toJSON(i.signingConfig)),e}};function ae(i){return i!=null}o(ae,"isSet")});var nk=d(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});M.Input=M.Artifact=M.ArtifactVerificationOptions_ObserverTimestampOptions=M.ArtifactVerificationOptions_TlogIntegratedTimestampOptions=M.ArtifactVerificationOptions_TimestampAuthorityOptions=M.ArtifactVerificationOptions_CtlogOptions=M.ArtifactVerificationOptions_TlogOptions=M.ArtifactVerificationOptions=M.PublicKeyIdentities=M.CertificateIdentities=M.CertificateIdentity=void 0;var rk=j_(),qr=No(),sk=$_();M.CertificateIdentity={fromJSON(i){return{issuer:Q(i.issuer)?globalThis.String(i.issuer):"",san:Q(i.san)?qr.SubjectAlternativeName.fromJSON(i.san):void 0,oids:globalThis.Array.isArray(i?.oids)?i.oids.map(e=>qr.ObjectIdentifierValuePair.fromJSON(e)):[]}},toJSON(i){let e={};return i.issuer!==""&&(e.issuer=i.issuer),i.san!==void 0&&(e.san=qr.SubjectAlternativeName.toJSON(i.san)),i.oids?.length&&(e.oids=i.oids.map(t=>qr.ObjectIdentifierValuePair.toJSON(t))),e}};M.CertificateIdentities={fromJSON(i){return{identities:globalThis.Array.isArray(i?.identities)?i.identities.map(e=>M.CertificateIdentity.fromJSON(e)):[]}},toJSON(i){let e={};return i.identities?.length&&(e.identities=i.identities.map(t=>M.CertificateIdentity.toJSON(t))),e}};M.PublicKeyIdentities={fromJSON(i){return{publicKeys:globalThis.Array.isArray(i?.publicKeys)?i.publicKeys.map(e=>qr.PublicKey.fromJSON(e)):[]}},toJSON(i){let e={};return i.publicKeys?.length&&(e.publicKeys=i.publicKeys.map(t=>qr.PublicKey.toJSON(t))),e}};M.ArtifactVerificationOptions={fromJSON(i){return{signers:Q(i.certificateIdentities)?{$case:"certificateIdentities",certificateIdentities:M.CertificateIdentities.fromJSON(i.certificateIdentities)}:Q(i.publicKeys)?{$case:"publicKeys",publicKeys:M.PublicKeyIdentities.fromJSON(i.publicKeys)}:void 0,tlogOptions:Q(i.tlogOptions)?M.ArtifactVerificationOptions_TlogOptions.fromJSON(i.tlogOptions):void 0,ctlogOptions:Q(i.ctlogOptions)?M.ArtifactVerificationOptions_CtlogOptions.fromJSON(i.ctlogOptions):void 0,tsaOptions:Q(i.tsaOptions)?M.ArtifactVerificationOptions_TimestampAuthorityOptions.fromJSON(i.tsaOptions):void 0,integratedTsOptions:Q(i.integratedTsOptions)?M.ArtifactVerificationOptions_TlogIntegratedTimestampOptions.fromJSON(i.integratedTsOptions):void 0,observerOptions:Q(i.observerOptions)?M.ArtifactVerificationOptions_ObserverTimestampOptions.fromJSON(i.observerOptions):void 0}},toJSON(i){let e={};return i.signers?.$case==="certificateIdentities"?e.certificateIdentities=M.CertificateIdentities.toJSON(i.signers.certificateIdentities):i.signers?.$case==="publicKeys"&&(e.publicKeys=M.PublicKeyIdentities.toJSON(i.signers.publicKeys)),i.tlogOptions!==void 0&&(e.tlogOptions=M.ArtifactVerificationOptions_TlogOptions.toJSON(i.tlogOptions)),i.ctlogOptions!==void 0&&(e.ctlogOptions=M.ArtifactVerificationOptions_CtlogOptions.toJSON(i.ctlogOptions)),i.tsaOptions!==void 0&&(e.tsaOptions=M.ArtifactVerificationOptions_TimestampAuthorityOptions.toJSON(i.tsaOptions)),i.integratedTsOptions!==void 0&&(e.integratedTsOptions=M.ArtifactVerificationOptions_TlogIntegratedTimestampOptions.toJSON(i.integratedTsOptions)),i.observerOptions!==void 0&&(e.observerOptions=M.ArtifactVerificationOptions_ObserverTimestampOptions.toJSON(i.observerOptions)),e}};M.ArtifactVerificationOptions_TlogOptions={fromJSON(i){return{threshold:Q(i.threshold)?globalThis.Number(i.threshold):0,performOnlineVerification:Q(i.performOnlineVerification)?globalThis.Boolean(i.performOnlineVerification):!1,disable:Q(i.disable)?globalThis.Boolean(i.disable):!1}},toJSON(i){let e={};return i.threshold!==0&&(e.threshold=Math.round(i.threshold)),i.performOnlineVerification!==!1&&(e.performOnlineVerification=i.performOnlineVerification),i.disable!==!1&&(e.disable=i.disable),e}};M.ArtifactVerificationOptions_CtlogOptions={fromJSON(i){return{threshold:Q(i.threshold)?globalThis.Number(i.threshold):0,disable:Q(i.disable)?globalThis.Boolean(i.disable):!1}},toJSON(i){let e={};return i.threshold!==0&&(e.threshold=Math.round(i.threshold)),i.disable!==!1&&(e.disable=i.disable),e}};M.ArtifactVerificationOptions_TimestampAuthorityOptions={fromJSON(i){return{threshold:Q(i.threshold)?globalThis.Number(i.threshold):0,disable:Q(i.disable)?globalThis.Boolean(i.disable):!1}},toJSON(i){let e={};return i.threshold!==0&&(e.threshold=Math.round(i.threshold)),i.disable!==!1&&(e.disable=i.disable),e}};M.ArtifactVerificationOptions_TlogIntegratedTimestampOptions={fromJSON(i){return{threshold:Q(i.threshold)?globalThis.Number(i.threshold):0,disable:Q(i.disable)?globalThis.Boolean(i.disable):!1}},toJSON(i){let e={};return i.threshold!==0&&(e.threshold=Math.round(i.threshold)),i.disable!==!1&&(e.disable=i.disable),e}};M.ArtifactVerificationOptions_ObserverTimestampOptions={fromJSON(i){return{threshold:Q(i.threshold)?globalThis.Number(i.threshold):0,disable:Q(i.disable)?globalThis.Boolean(i.disable):!1}},toJSON(i){let e={};return i.threshold!==0&&(e.threshold=Math.round(i.threshold)),i.disable!==!1&&(e.disable=i.disable),e}};M.Artifact={fromJSON(i){return{data:Q(i.artifactUri)?{$case:"artifactUri",artifactUri:globalThis.String(i.artifactUri)}:Q(i.artifact)?{$case:"artifact",artifact:Buffer.from(ote(i.artifact))}:Q(i.artifactDigest)?{$case:"artifactDigest",artifactDigest:qr.HashOutput.fromJSON(i.artifactDigest)}:void 0}},toJSON(i){let e={};return i.data?.$case==="artifactUri"?e.artifactUri=i.data.artifactUri:i.data?.$case==="artifact"?e.artifact=ate(i.data.artifact):i.data?.$case==="artifactDigest"&&(e.artifactDigest=qr.HashOutput.toJSON(i.data.artifactDigest)),e}};M.Input={fromJSON(i){return{artifactTrustRoot:Q(i.artifactTrustRoot)?sk.TrustedRoot.fromJSON(i.artifactTrustRoot):void 0,artifactVerificationOptions:Q(i.artifactVerificationOptions)?M.ArtifactVerificationOptions.fromJSON(i.artifactVerificationOptions):void 0,bundle:Q(i.bundle)?rk.Bundle.fromJSON(i.bundle):void 0,artifact:Q(i.artifact)?M.Artifact.fromJSON(i.artifact):void 0}},toJSON(i){let e={};return i.artifactTrustRoot!==void 0&&(e.artifactTrustRoot=sk.TrustedRoot.toJSON(i.artifactTrustRoot)),i.artifactVerificationOptions!==void 0&&(e.artifactVerificationOptions=M.ArtifactVerificationOptions.toJSON(i.artifactVerificationOptions)),i.bundle!==void 0&&(e.bundle=rk.Bundle.toJSON(i.bundle)),i.artifact!==void 0&&(e.artifact=M.Artifact.toJSON(i.artifact)),e}};function ote(i){return Uint8Array.from(globalThis.Buffer.from(i,"base64"))}o(ote,"bytesFromBase64");function ate(i){return globalThis.Buffer.from(i).toString("base64")}o(ate,"base64FromBytes");function Q(i){return i!=null}o(Q,"isSet")});var su=d(Bt=>{"use strict";var cte=Bt&&Bt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),Po=Bt&&Bt.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&cte(e,i,t)};Object.defineProperty(Bt,"__esModule",{value:!0});Po(F_(),Bt);Po(j_(),Bt);Po(No(),Bt);Po(U_(),Bt);Po($_(),Bt);Po(nk(),Bt)});var qd=d(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.BUNDLE_V03_MEDIA_TYPE=nt.BUNDLE_V03_LEGACY_MEDIA_TYPE=nt.BUNDLE_V02_MEDIA_TYPE=nt.BUNDLE_V01_MEDIA_TYPE=void 0;nt.isBundleWithCertificateChain=ute;nt.isBundleWithPublicKey=lte;nt.isBundleWithMessageSignature=hte;nt.isBundleWithDsseEnvelope=fte;nt.BUNDLE_V01_MEDIA_TYPE="application/vnd.dev.sigstore.bundle+json;version=0.1";nt.BUNDLE_V02_MEDIA_TYPE="application/vnd.dev.sigstore.bundle+json;version=0.2";nt.BUNDLE_V03_LEGACY_MEDIA_TYPE="application/vnd.dev.sigstore.bundle+json;version=0.3";nt.BUNDLE_V03_MEDIA_TYPE="application/vnd.dev.sigstore.bundle.v0.3+json";function ute(i){return i.verificationMaterial.content.$case==="x509CertificateChain"}o(ute,"isBundleWithCertificateChain");function lte(i){return i.verificationMaterial.content.$case==="publicKey"}o(lte,"isBundleWithPublicKey");function hte(i){return i.content.$case==="messageSignature"}o(hte,"isBundleWithMessageSignature");function fte(i){return i.content.$case==="dsseEnvelope"}o(fte,"isBundleWithDsseEnvelope")});var ak=d(zd=>{"use strict";Object.defineProperty(zd,"__esModule",{value:!0});zd.toMessageSignatureBundle=pte;zd.toDSSEBundle=mte;var dte=su(),Vd=qd();function pte(i){return{mediaType:i.certificateChain?Vd.BUNDLE_V02_MEDIA_TYPE:Vd.BUNDLE_V03_MEDIA_TYPE,content:{$case:"messageSignature",messageSignature:{messageDigest:{algorithm:dte.HashAlgorithm.SHA2_256,digest:i.digest},signature:i.signature}},verificationMaterial:ok(i)}}o(pte,"toMessageSignatureBundle");function mte(i){return{mediaType:i.certificateChain?Vd.BUNDLE_V02_MEDIA_TYPE:Vd.BUNDLE_V03_MEDIA_TYPE,content:{$case:"dsseEnvelope",dsseEnvelope:gte(i)},verificationMaterial:ok(i)}}o(mte,"toDSSEBundle");function gte(i){return{payloadType:i.artifactType,payload:i.artifact,signatures:[yte(i)]}}o(gte,"toEnvelope");function yte(i){return{keyid:i.keyHint||"",sig:i.signature}}o(yte,"toSignature");function ok(i){return{content:Ste(i),tlogEntries:[],timestampVerificationData:{rfc3161Timestamps:[]}}}o(ok,"toVerificationMaterial");function Ste(i){return i.certificate?i.certificateChain?{$case:"x509CertificateChain",x509CertificateChain:{certificates:[{rawBytes:i.certificate}]}}:{$case:"certificate",certificate:{rawBytes:i.certificate}}:{$case:"publicKey",publicKey:{hint:i.keyHint||""}}}o(Ste,"toKeyContent")});var V_=d(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});Hd.ValidationError=void 0;var q_=class extends Error{static{o(this,"ValidationError")}constructor(e,t){super(e),this.fields=t}};Hd.ValidationError=q_});var z_=d(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});Js.assertBundle=Ete;Js.assertBundleV01=ck;Js.isBundleV01=wte;Js.assertBundleV02=_te;Js.assertBundleLatest=bte;var Gd=V_();function Ete(i){let e=Wd(i);if(e.length>0)throw new Gd.ValidationError("invalid bundle",e)}o(Ete,"assertBundle");function ck(i){let e=[];if(e.push(...Wd(i)),e.push(...Ite(i)),e.length>0)throw new Gd.ValidationError("invalid v0.1 bundle",e)}o(ck,"assertBundleV01");function wte(i){try{return ck(i),!0}catch{return!1}}o(wte,"isBundleV01");function _te(i){let e=[];if(e.push(...Wd(i)),e.push(...uk(i)),e.length>0)throw new Gd.ValidationError("invalid v0.2 bundle",e)}o(_te,"assertBundleV02");function bte(i){let e=[];if(e.push(...Wd(i)),e.push(...uk(i)),e.push(...Ote(i)),e.length>0)throw new Gd.ValidationError("invalid bundle",e)}o(bte,"assertBundleLatest");function Wd(i){let e=[];if((i.mediaType===void 0||!i.mediaType.match(/^application\/vnd\.dev\.sigstore\.bundle\+json;version=\d\.\d/)&&!i.mediaType.match(/^application\/vnd\.dev\.sigstore\.bundle\.v\d\.\d\+json/))&&e.push("mediaType"),i.content===void 0)e.push("content");else switch(i.content.$case){case"messageSignature":i.content.messageSignature.messageDigest===void 0?e.push("content.messageSignature.messageDigest"):i.content.messageSignature.messageDigest.digest.length===0&&e.push("content.messageSignature.messageDigest.digest"),i.content.messageSignature.signature.length===0&&e.push("content.messageSignature.signature");break;case"dsseEnvelope":i.content.dsseEnvelope.payload.length===0&&e.push("content.dsseEnvelope.payload"),i.content.dsseEnvelope.signatures.length!==1?e.push("content.dsseEnvelope.signatures"):i.content.dsseEnvelope.signatures[0].sig.length===0&&e.push("content.dsseEnvelope.signatures[0].sig");break}if(i.verificationMaterial===void 0)e.push("verificationMaterial");else{if(i.verificationMaterial.content===void 0)e.push("verificationMaterial.content");else switch(i.verificationMaterial.content.$case){case"x509CertificateChain":i.verificationMaterial.content.x509CertificateChain.certificates.length===0&&e.push("verificationMaterial.content.x509CertificateChain.certificates"),i.verificationMaterial.content.x509CertificateChain.certificates.forEach((t,r)=>{t.rawBytes.length===0&&e.push(`verificationMaterial.content.x509CertificateChain.certificates[${r}].rawBytes`)});break;case"certificate":i.verificationMaterial.content.certificate.rawBytes.length===0&&e.push("verificationMaterial.content.certificate.rawBytes");break}i.verificationMaterial.tlogEntries===void 0?e.push("verificationMaterial.tlogEntries"):i.verificationMaterial.tlogEntries.length>0&&i.verificationMaterial.tlogEntries.forEach((t,r)=>{t.logId===void 0&&e.push(`verificationMaterial.tlogEntries[${r}].logId`),t.kindVersion===void 0&&e.push(`verificationMaterial.tlogEntries[${r}].kindVersion`)})}return e}o(Wd,"validateBundleBase");function Ite(i){let e=[];return i.verificationMaterial&&i.verificationMaterial.tlogEntries?.length>0&&i.verificationMaterial.tlogEntries.forEach((t,r)=>{t.inclusionPromise===void 0&&e.push(`verificationMaterial.tlogEntries[${r}].inclusionPromise`)}),e}o(Ite,"validateInclusionPromise");function uk(i){let e=[];return i.verificationMaterial&&i.verificationMaterial.tlogEntries?.length>0&&i.verificationMaterial.tlogEntries.forEach((t,r)=>{t.inclusionProof===void 0?e.push(`verificationMaterial.tlogEntries[${r}].inclusionProof`):t.inclusionProof.checkpoint===void 0&&e.push(`verificationMaterial.tlogEntries[${r}].inclusionProof.checkpoint`)}),e}o(uk,"validateInclusionProof");function Ote(i){let e=[];return i.verificationMaterial?.content?.$case==="x509CertificateChain"&&e.push("verificationMaterial.content.$case"),e}o(Ote,"validateNoCertificateChain")});var hk=d(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.envelopeToJSON=Ti.envelopeFromJSON=Ti.bundleToJSON=Ti.bundleFromJSON=void 0;var Jd=su(),lk=qd(),H_=z_(),vte=o(i=>{let e=Jd.Bundle.fromJSON(i);switch(e.mediaType){case lk.BUNDLE_V01_MEDIA_TYPE:(0,H_.assertBundleV01)(e);break;case lk.BUNDLE_V02_MEDIA_TYPE:(0,H_.assertBundleV02)(e);break;default:(0,H_.assertBundleLatest)(e);break}return e},"bundleFromJSON");Ti.bundleFromJSON=vte;var Rte=o(i=>Jd.Bundle.toJSON(i),"bundleToJSON");Ti.bundleToJSON=Rte;var Ate=o(i=>Jd.Envelope.fromJSON(i),"envelopeFromJSON");Ti.envelopeFromJSON=Ate;var Tte=o(i=>Jd.Envelope.toJSON(i),"envelopeToJSON");Ti.envelopeToJSON=Tte});var ou=d(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.isBundleV01=k.assertBundleV02=k.assertBundleV01=k.assertBundleLatest=k.assertBundle=k.envelopeToJSON=k.envelopeFromJSON=k.bundleToJSON=k.bundleFromJSON=k.ValidationError=k.isBundleWithPublicKey=k.isBundleWithMessageSignature=k.isBundleWithDsseEnvelope=k.isBundleWithCertificateChain=k.BUNDLE_V03_MEDIA_TYPE=k.BUNDLE_V03_LEGACY_MEDIA_TYPE=k.BUNDLE_V02_MEDIA_TYPE=k.BUNDLE_V01_MEDIA_TYPE=k.toMessageSignatureBundle=k.toDSSEBundle=void 0;var fk=ak();Object.defineProperty(k,"toDSSEBundle",{enumerable:!0,get:o(function(){return fk.toDSSEBundle},"get")});Object.defineProperty(k,"toMessageSignatureBundle",{enumerable:!0,get:o(function(){return fk.toMessageSignatureBundle},"get")});var Vr=qd();Object.defineProperty(k,"BUNDLE_V01_MEDIA_TYPE",{enumerable:!0,get:o(function(){return Vr.BUNDLE_V01_MEDIA_TYPE},"get")});Object.defineProperty(k,"BUNDLE_V02_MEDIA_TYPE",{enumerable:!0,get:o(function(){return Vr.BUNDLE_V02_MEDIA_TYPE},"get")});Object.defineProperty(k,"BUNDLE_V03_LEGACY_MEDIA_TYPE",{enumerable:!0,get:o(function(){return Vr.BUNDLE_V03_LEGACY_MEDIA_TYPE},"get")});Object.defineProperty(k,"BUNDLE_V03_MEDIA_TYPE",{enumerable:!0,get:o(function(){return Vr.BUNDLE_V03_MEDIA_TYPE},"get")});Object.defineProperty(k,"isBundleWithCertificateChain",{enumerable:!0,get:o(function(){return Vr.isBundleWithCertificateChain},"get")});Object.defineProperty(k,"isBundleWithDsseEnvelope",{enumerable:!0,get:o(function(){return Vr.isBundleWithDsseEnvelope},"get")});Object.defineProperty(k,"isBundleWithMessageSignature",{enumerable:!0,get:o(function(){return Vr.isBundleWithMessageSignature},"get")});Object.defineProperty(k,"isBundleWithPublicKey",{enumerable:!0,get:o(function(){return Vr.isBundleWithPublicKey},"get")});var Cte=V_();Object.defineProperty(k,"ValidationError",{enumerable:!0,get:o(function(){return Cte.ValidationError},"get")});var Kd=hk();Object.defineProperty(k,"bundleFromJSON",{enumerable:!0,get:o(function(){return Kd.bundleFromJSON},"get")});Object.defineProperty(k,"bundleToJSON",{enumerable:!0,get:o(function(){return Kd.bundleToJSON},"get")});Object.defineProperty(k,"envelopeFromJSON",{enumerable:!0,get:o(function(){return Kd.envelopeFromJSON},"get")});Object.defineProperty(k,"envelopeToJSON",{enumerable:!0,get:o(function(){return Kd.envelopeToJSON},"get")});var nu=z_();Object.defineProperty(k,"assertBundle",{enumerable:!0,get:o(function(){return nu.assertBundle},"get")});Object.defineProperty(k,"assertBundleLatest",{enumerable:!0,get:o(function(){return nu.assertBundleLatest},"get")});Object.defineProperty(k,"assertBundleV01",{enumerable:!0,get:o(function(){return nu.assertBundleV01},"get")});Object.defineProperty(k,"assertBundleV02",{enumerable:!0,get:o(function(){return nu.assertBundleV02},"get")});Object.defineProperty(k,"isBundleV01",{enumerable:!0,get:o(function(){return nu.isBundleV01},"get")})});var au=d(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});Yd.ByteStream=void 0;var G_=class extends Error{static{o(this,"StreamError")}},Zd=class i{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 r=e+t;if(r>this.length)throw new G_("request past end of buffer");return this.view.subarray(e,r)}appendChar(e){this.ensureCapacity(1),this.view[this.start]=e,this.start+=1}appendUint16(e){this.ensureCapacity(2);let t=new Uint16Array([e]),r=new Uint8Array(t.buffer);this.view[this.start]=r[1],this.view[this.start+1]=r[0],this.start+=2}appendUint24(e){this.ensureCapacity(3);let t=new Uint32Array([e]),r=new Uint8Array(t.buffer);this.view[this.start]=r[2],this.view[this.start+1]=r[1],this.view[this.start+2]=r[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=i.BLOCK_SIZE+(e>i.BLOCK_SIZE?e:0);this.realloc(this.view.byteLength+t)}}realloc(e){let t=new ArrayBuffer(e),r=Buffer.from(t);r.set(this.view),this.buf=t,this.view=r}};Yd.ByteStream=Zd;Zd.BLOCK_SIZE=1024});var Xd=d(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});Do.ASN1TypeError=Do.ASN1ParseError=void 0;var W_=class extends Error{static{o(this,"ASN1ParseError")}};Do.ASN1ParseError=W_;var J_=class extends Error{static{o(this,"ASN1TypeError")}};Do.ASN1TypeError=J_});var pk=d(Qd=>{"use strict";Object.defineProperty(Qd,"__esModule",{value:!0});Qd.decodeLength=Nte;Qd.encodeLength=Pte;var dk=Xd();function Nte(i){let e=i.getUint8();if((e&128)===0)return e;let t=e&127;if(t>6)throw new dk.ASN1ParseError("length exceeds 6 byte limit");let r=0;for(let s=0;s<t;s++)r=r*256+i.getUint8();if(r===0)throw new dk.ASN1ParseError("indefinite length encoding not supported");return r}o(Nte,"decodeLength");function Pte(i){if(i<128)return Buffer.from([i]);let e=BigInt(i),t=[];for(;e>0n;)t.unshift(Number(e&255n)),e=e>>8n;return Buffer.from([128|t.length,...t])}o(Pte,"encodeLength")});var gk=d(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.parseInteger=Lte;zr.parseStringASCII=mk;zr.parseTime=Mte;zr.parseOID=Bte;zr.parseBoolean=kte;zr.parseBitString=Fte;var Dte=/^(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\.\d{3})?Z$/,xte=/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\.\d{3})?Z$/;function Lte(i){let e=0,t=i.length,r=i[e],s=r>127,n=s?255:0;for(;r==n&&++e<t;)r=i[e];if(t-e===0)return BigInt(s?-1:0);r=s?r-256:r;let c=BigInt(r);for(let u=e+1;u<t;++u)c=c*BigInt(256)+BigInt(i[u]);return c}o(Lte,"parseInteger");function mk(i){return i.toString("ascii")}o(mk,"parseStringASCII");function Mte(i,e){let t=mk(i),r=e?Dte.exec(t):xte.exec(t);if(!r)throw new Error("invalid time");if(e){let s=Number(r[1]);s+=s>=50?1900:2e3,r[1]=s.toString()}return new Date(`${r[1]}-${r[2]}-${r[3]}T${r[4]}:${r[5]}:${r[6]}Z`)}o(Mte,"parseTime");function Bte(i){let e=0,t=i.length,r=i[e++],s=Math.floor(r/40),n=r%40,a=`${s}.${n}`,c=0;for(;e<t;++e)r=i[e],c=(c<<7)+(r&127),(r&128)===0&&(a+=`.${c}`,c=0);return a}o(Bte,"parseOID");function kte(i){return i[0]!==0}o(kte,"parseBoolean");function Fte(i){let e=i[0],t=1,r=i.length,s=[];for(let n=t;n<r;++n){let a=i[n],c=n===r-1?e:0;for(let u=7;u>=c;--u)s.push(a>>u&1)}return s}o(Fte,"parseBitString")});var Sk=d(ep=>{"use strict";Object.defineProperty(ep,"__esModule",{value:!0});ep.ASN1Tag=void 0;var yk=Xd(),Ks={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},K_={UNIVERSAL:0,APPLICATION:1,CONTEXT_SPECIFIC:2,PRIVATE:3},Z_=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 yk.ASN1ParseError("long form tags not supported");if(this.class===K_.UNIVERSAL&&this.number===0)throw new yk.ASN1ParseError("unsupported tag 0x00")}isUniversal(){return this.class===K_.UNIVERSAL}isContextSpecific(e){let t=this.class===K_.CONTEXT_SPECIFIC;return e!==void 0?t&&this.number===e:t}isBoolean(){return this.isUniversal()&&this.number===Ks.BOOLEAN}isInteger(){return this.isUniversal()&&this.number===Ks.INTEGER}isBitString(){return this.isUniversal()&&this.number===Ks.BIT_STRING}isOctetString(){return this.isUniversal()&&this.number===Ks.OCTET_STRING}isOID(){return this.isUniversal()&&this.number===Ks.OBJECT_IDENTIFIER}isUTCTime(){return this.isUniversal()&&this.number===Ks.UTC_TIME}isGeneralizedTime(){return this.isUniversal()&&this.number===Ks.GENERALIZED_TIME}toDER(){return this.number|(this.constructed?32:0)|this.class<<6}};ep.ASN1Tag=Z_});var bk=d(ip=>{"use strict";Object.defineProperty(ip,"__esModule",{value:!0});ip.ASN1Obj=void 0;var Y_=au(),Zs=Xd(),wk=pk(),xo=gk(),Ute=Sk(),tp=class{static{o(this,"ASN1Obj")}constructor(e,t,r){this.tag=e,this.value=t,this.subs=r}static parseBuffer(e){return _k(new Y_.ByteStream(e))}toDER(){let e=new Y_.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,r=new Y_.ByteStream;return r.appendChar(this.tag.toDER()),r.appendView((0,wk.encodeLength)(t.length)),r.appendView(t),r.buffer}toBoolean(){if(!this.tag.isBoolean())throw new Zs.ASN1TypeError("not a boolean");return(0,xo.parseBoolean)(this.value)}toInteger(){if(!this.tag.isInteger())throw new Zs.ASN1TypeError("not an integer");return(0,xo.parseInteger)(this.value)}toOID(){if(!this.tag.isOID())throw new Zs.ASN1TypeError("not an OID");return(0,xo.parseOID)(this.value)}toDate(){switch(!0){case this.tag.isUTCTime():return(0,xo.parseTime)(this.value,!0);case this.tag.isGeneralizedTime():return(0,xo.parseTime)(this.value,!1);default:throw new Zs.ASN1TypeError("not a date")}}toBitString(){if(!this.tag.isBitString())throw new Zs.ASN1TypeError("not a bit string");return(0,xo.parseBitString)(this.value)}};ip.ASN1Obj=tp;function _k(i){let e=new Ute.ASN1Tag(i.getUint8()),t=(0,wk.decodeLength)(i),r=i.slice(i.position,t),s=i.position,n=[];if(e.constructed)n=Ek(i,t);else if(e.isOctetString())try{n=Ek(i,t)}catch{}return n.length===0&&i.seek(s+t),new tp(e,r,n)}o(_k,"parseStream");function Ek(i,e){let t=i.position+e;if(t>i.length)throw new Zs.ASN1ParseError("invalid length");let r=[];for(;i.position<t;)r.push(_k(i));if(i.position!==t)throw new Zs.ASN1ParseError("invalid length");return r}o(Ek,"collectSubs")});var sp=d(rp=>{"use strict";Object.defineProperty(rp,"__esModule",{value:!0});rp.ASN1Obj=void 0;var jte=bk();Object.defineProperty(rp,"ASN1Obj",{enumerable:!0,get:o(function(){return jte.ASN1Obj},"get")})});var Lo=d(Hr=>{"use strict";var $te=Hr&&Hr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Hr,"__esModule",{value:!0});Hr.createPublicKey=qte;Hr.digest=Vte;Hr.verify=zte;Hr.bufferEqual=Hte;var cu=$te(require("crypto"));function qte(i,e="spki"){return typeof i=="string"?cu.default.createPublicKey(i):cu.default.createPublicKey({key:i,format:"der",type:e})}o(qte,"createPublicKey");function Vte(i,...e){let t=cu.default.createHash(i);for(let r of e)t.update(r);return t.digest()}o(Vte,"digest");function zte(i,e,t,r){try{return cu.default.verify(r,i,e,t)}catch{return!1}}o(zte,"verify");function Hte(i,e){try{return cu.default.timingSafeEqual(i,e)}catch{return!1}}o(Hte,"bufferEqual")});var Ik=d(X_=>{"use strict";Object.defineProperty(X_,"__esModule",{value:!0});X_.preAuthEncoding=Wte;var Gte="DSSEv1";function Wte(i,e){let t=[Gte,i.length,i,e.length,""].join(" ");return Buffer.concat([Buffer.from(t,"ascii"),e])}o(Wte,"preAuthEncoding")});var Rk=d(np=>{"use strict";Object.defineProperty(np,"__esModule",{value:!0});np.base64Encode=Jte;np.base64Decode=Kte;var Ok="base64",vk="utf-8";function Jte(i){return Buffer.from(i,vk).toString(Ok)}o(Jte,"base64Encode");function Kte(i){return Buffer.from(i,Ok).toString(vk)}o(Kte,"base64Decode")});var Ak=d(eb=>{"use strict";Object.defineProperty(eb,"__esModule",{value:!0});eb.canonicalize=Q_;function Q_(i){let e="";if(i===null||typeof i!="object"||i.toJSON!=null)e+=JSON.stringify(i);else if(Array.isArray(i)){e+="[";let t=!0;i.forEach(r=>{t||(e+=","),t=!1,e+=Q_(r)}),e+="]"}else{e+="{";let t=!0;Object.keys(i).sort().forEach(r=>{t||(e+=","),t=!1,e+=JSON.stringify(r),e+=":",e+=Q_(i[r])}),e+="}"}return e}o(Q_,"canonicalize")});var tb=d(op=>{"use strict";Object.defineProperty(op,"__esModule",{value:!0});op.toDER=Xte;op.fromDER=Qte;var Zte=/-----BEGIN (.*)-----/,Yte=/-----END (.*)-----/;function Xte(i){let e="";return i.split(`
55
- `).forEach(t=>{t.match(Zte)||t.match(Yte)||(e+=t)}),Buffer.from(e,"base64")}o(Xte,"toDER");function Qte(i,e="CERTIFICATE"){let r=i.toString("base64").match(/.{1,64}/g)||"";return[`-----BEGIN ${e}-----`,...r,`-----END ${e}-----`].join(`
52
+ `;let u=(0,hQ.parseProxyResponse)(s);s.write(`${c}\r
53
+ `);let{connect:l,buffered:h}=await u;if(e.emit("proxyConnect",l),this.emit("proxyConnect",l,e),l.statusCode===200)return e.once("socket",fQ),t.secureEndpoint?(Xc("Upgrading socket connection to TLS"),VL.connect({...HL(zL(t),"host","path","port"),socket:s})):s;s.destroy();let f=new rd.Socket({writable:!1});return f.readable=!0,e.once("socket",p=>{Xc("Replaying proxy buffer for failed request"),(0,aQ.default)(p.listenerCount("data")>0),p.push(h),p.push(null)}),f}};sd.protocols=["http","https"];Pt.HttpsProxyAgent=sd;function fQ(i){i.resume()}o(fQ,"resume");function HL(i,...e){let t={},r;for(r in i)e.includes(r)||(t[r]=i[r]);return t}o(HL,"omit")});var XL=d(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});var KL=require("buffer"),Us={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."};ar.ERRORS=Us;function dQ(i){if(!KL.Buffer.isEncoding(i))throw new Error(Us.INVALID_ENCODING)}o(dQ,"checkEncoding");ar.checkEncoding=dQ;function ZL(i){return typeof i=="number"&&isFinite(i)&&yQ(i)}o(ZL,"isFiniteInteger");ar.isFiniteInteger=ZL;function YL(i,e){if(typeof i=="number"){if(!ZL(i)||i<0)throw new Error(e?Us.INVALID_OFFSET:Us.INVALID_LENGTH)}else throw new Error(e?Us.INVALID_OFFSET_NON_NUMBER:Us.INVALID_LENGTH_NON_NUMBER)}o(YL,"checkOffsetOrLengthValue");function pQ(i){YL(i,!1)}o(pQ,"checkLengthValue");ar.checkLengthValue=pQ;function mQ(i){YL(i,!0)}o(mQ,"checkOffsetValue");ar.checkOffsetValue=mQ;function gQ(i,e){if(i<0||i>e.length)throw new Error(Us.INVALID_TARGET_OFFSET)}o(gQ,"checkTargetOffset");ar.checkTargetOffset=gQ;function yQ(i){return typeof i=="number"&&isFinite(i)&&Math.floor(i)===i}o(yQ,"isInteger");function SQ(i){if(typeof BigInt>"u")throw new Error("Platform does not support JS BigInt type.");if(typeof KL.Buffer.prototype[i]>"u")throw new Error(`Platform does not support Buffer.prototype.${i}.`)}o(SQ,"bigIntAndBufferInt64Check");ar.bigIntAndBufferInt64Check=SQ});var eM=d(Jw=>{"use strict";Object.defineProperty(Jw,"__esModule",{value:!0});var F=XL(),QL=4096,EQ="utf8",Ww=class i{static{o(this,"SmartBuffer")}constructor(e){if(this.length=0,this._encoding=EQ,this._writeOffset=0,this._readOffset=0,i.isSmartBufferOptions(e))if(e.encoding&&(F.checkEncoding(e.encoding),this._encoding=e.encoding),e.size)if(F.isFiniteInteger(e.size)&&e.size>0)this._buff=Buffer.allocUnsafe(e.size);else throw new Error(F.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(F.ERRORS.INVALID_SMARTBUFFER_BUFFER);else this._buff=Buffer.allocUnsafe(QL);else{if(typeof e<"u")throw new Error(F.ERRORS.INVALID_SMARTBUFFER_OBJECT);this._buff=Buffer.allocUnsafe(QL)}}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 F.bigIntAndBufferInt64Check("readBigInt64BE"),this._readNumberValue(Buffer.prototype.readBigInt64BE,8,e)}readBigInt64LE(e){return F.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 F.bigIntAndBufferInt64Check("writeBigInt64BE"),this._writeNumberValue(Buffer.prototype.writeBigInt64BE,8,e,t)}insertBigInt64BE(e,t){return F.bigIntAndBufferInt64Check("writeBigInt64BE"),this._insertNumberValue(Buffer.prototype.writeBigInt64BE,8,e,t)}writeBigInt64LE(e,t){return F.bigIntAndBufferInt64Check("writeBigInt64LE"),this._writeNumberValue(Buffer.prototype.writeBigInt64LE,8,e,t)}insertBigInt64LE(e,t){return F.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 F.bigIntAndBufferInt64Check("readBigUInt64BE"),this._readNumberValue(Buffer.prototype.readBigUInt64BE,8,e)}readBigUInt64LE(e){return F.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 F.bigIntAndBufferInt64Check("writeBigUInt64BE"),this._writeNumberValue(Buffer.prototype.writeBigUInt64BE,8,e,t)}insertBigUInt64BE(e,t){return F.bigIntAndBufferInt64Check("writeBigUInt64BE"),this._insertNumberValue(Buffer.prototype.writeBigUInt64BE,8,e,t)}writeBigUInt64LE(e,t){return F.bigIntAndBufferInt64Check("writeBigUInt64LE"),this._writeNumberValue(Buffer.prototype.writeBigUInt64LE,8,e,t)}insertBigUInt64LE(e,t){return F.bigIntAndBufferInt64Check("writeBigUInt64LE"),this._insertNumberValue(Buffer.prototype.writeBigUInt64LE,8,e,t)}readFloatBE(e){return this._readNumberValue(Buffer.prototype.readFloatBE,4,e)}readFloatLE(e){return this._readNumberValue(Buffer.prototype.readFloatLE,4,e)}writeFloatBE(e,t){return this._writeNumberValue(Buffer.prototype.writeFloatBE,4,e,t)}insertFloatBE(e,t){return this._insertNumberValue(Buffer.prototype.writeFloatBE,4,e,t)}writeFloatLE(e,t){return this._writeNumberValue(Buffer.prototype.writeFloatLE,4,e,t)}insertFloatLE(e,t){return this._insertNumberValue(Buffer.prototype.writeFloatLE,4,e,t)}readDoubleBE(e){return this._readNumberValue(Buffer.prototype.readDoubleBE,8,e)}readDoubleLE(e){return this._readNumberValue(Buffer.prototype.readDoubleLE,8,e)}writeDoubleBE(e,t){return this._writeNumberValue(Buffer.prototype.writeDoubleBE,8,e,t)}insertDoubleBE(e,t){return this._insertNumberValue(Buffer.prototype.writeDoubleBE,8,e,t)}writeDoubleLE(e,t){return this._writeNumberValue(Buffer.prototype.writeDoubleLE,8,e,t)}insertDoubleLE(e,t){return this._insertNumberValue(Buffer.prototype.writeDoubleLE,8,e,t)}readString(e,t){let r;typeof e=="number"?(F.checkLengthValue(e),r=Math.min(e,this.length-this._readOffset)):(t=e,r=this.length-this._readOffset),typeof t<"u"&&F.checkEncoding(t);let s=this._buff.slice(this._readOffset,this._readOffset+r).toString(t||this._encoding);return this._readOffset+=r,s}insertString(e,t,r){return F.checkOffsetValue(t),this._handleString(e,!0,t,r)}writeString(e,t,r){return this._handleString(e,!1,t,r)}readStringNT(e){typeof e<"u"&&F.checkEncoding(e);let t=this.length;for(let s=this._readOffset;s<this.length;s++)if(this._buff[s]===0){t=s;break}let r=this._buff.slice(this._readOffset,t);return this._readOffset=t+1,r.toString(e||this._encoding)}insertStringNT(e,t,r){return F.checkOffsetValue(t),this.insertString(e,t,r),this.insertUInt8(0,t+e.length),this}writeStringNT(e,t,r){return this.writeString(e,t,r),this.writeUInt8(0,typeof t=="number"?t+e.length:this.writeOffset),this}readBuffer(e){typeof e<"u"&&F.checkLengthValue(e);let t=typeof e=="number"?e:this.length,r=Math.min(this.length,this._readOffset+t),s=this._buff.slice(this._readOffset,r);return this._readOffset=r,s}insertBuffer(e,t){return F.checkOffsetValue(t),this._handleBuffer(e,!0,t)}writeBuffer(e,t){return this._handleBuffer(e,!1,t)}readBufferNT(){let e=this.length;for(let r=this._readOffset;r<this.length;r++)if(this._buff[r]===0){e=r;break}let t=this._buff.slice(this._readOffset,e);return this._readOffset=e+1,t}insertBufferNT(e,t){return F.checkOffsetValue(t),this.insertBuffer(e,t),this.insertUInt8(0,t+e.length),this}writeBufferNT(e,t){return typeof t<"u"&&F.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){F.checkOffsetValue(e),F.checkTargetOffset(e,this),this._readOffset=e}get writeOffset(){return this._writeOffset}set writeOffset(e){F.checkOffsetValue(e),F.checkTargetOffset(e,this),this._writeOffset=e}get encoding(){return this._encoding}set encoding(e){F.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 F.checkEncoding(t),this._buff.toString(t,0,this.length)}destroy(){return this.clear(),this}_handleString(e,t,r,s){let n=this._writeOffset,a=this._encoding;typeof r=="number"?n=r:typeof r=="string"&&(F.checkEncoding(r),a=r),typeof s=="string"&&(F.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 r=="number"?this._writeOffset=Math.max(this._writeOffset,n+c):this._writeOffset+=c,this}_handleBuffer(e,t,r){let s=typeof r=="number"?r: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 r=="number"?this._writeOffset=Math.max(this._writeOffset,s+e.length):this._writeOffset+=e.length,this}ensureReadable(e,t){let r=this._readOffset;if(typeof t<"u"&&(F.checkOffsetValue(t),r=t),r<0||r+e>this.length)throw new Error(F.ERRORS.INVALID_READ_BEYOND_BOUNDS)}ensureInsertable(e,t){F.checkOffsetValue(t),this._ensureCapacity(this.length+e),t<this.length&&this._buff.copy(this._buff,t+e,t,this._buff.length),t+e>this.length?this.length=t+e:this.length+=e}_ensureWriteable(e,t){let r=typeof t=="number"?t:this._writeOffset;this._ensureCapacity(r+e),r+e>this.length&&(this.length=r+e)}_ensureCapacity(e){let t=this._buff.length;if(e>t){let r=this._buff,s=t*3/2+1;s<e&&(s=e),this._buff=Buffer.allocUnsafe(s),r.copy(this._buff,0,0,t)}}_readNumberValue(e,t,r){this.ensureReadable(t,r);let s=e.call(this._buff,typeof r=="number"?r:this._readOffset);return typeof r>"u"&&(this._readOffset+=t),s}_insertNumberValue(e,t,r,s){return F.checkOffsetValue(s),this.ensureInsertable(t,s),e.call(this._buff,r,s),this._writeOffset+=t,this}_writeNumberValue(e,t,r,s){if(typeof s=="number"){if(s<0)throw new Error(F.ERRORS.INVALID_WRITE_BEYOND_BOUNDS);F.checkOffsetValue(s)}let n=typeof s=="number"?s:this._writeOffset;return this._ensureWriteable(t,n),e.call(this._buff,r,n),typeof s=="number"?this._writeOffset=Math.max(this._writeOffset,n+t):this._writeOffset+=t,this}};Jw.SmartBuffer=Ww});var Kw=d(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.SOCKS5_NO_ACCEPTABLE_AUTH=re.SOCKS5_CUSTOM_AUTH_END=re.SOCKS5_CUSTOM_AUTH_START=re.SOCKS_INCOMING_PACKET_SIZES=re.SocksClientState=re.Socks5Response=re.Socks5HostType=re.Socks5Auth=re.Socks4Response=re.SocksCommand=re.ERRORS=re.DEFAULT_TIMEOUT=void 0;var wQ=3e4;re.DEFAULT_TIMEOUT=wQ;var _Q={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"};re.ERRORS=_Q;var bQ={Socks5InitialHandshakeResponse:2,Socks5UserPassAuthenticationResponse:2,Socks5ResponseHeader:5,Socks5ResponseIPv4:10,Socks5ResponseIPv6:22,Socks5ResponseHostname:o(i=>i+7,"Socks5ResponseHostname"),Socks4Response:8};re.SOCKS_INCOMING_PACKET_SIZES=bQ;var tM;(function(i){i[i.connect=1]="connect",i[i.bind=2]="bind",i[i.associate=3]="associate"})(tM||(re.SocksCommand=tM={}));var iM;(function(i){i[i.Granted=90]="Granted",i[i.Failed=91]="Failed",i[i.Rejected=92]="Rejected",i[i.RejectedIdent=93]="RejectedIdent"})(iM||(re.Socks4Response=iM={}));var rM;(function(i){i[i.NoAuth=0]="NoAuth",i[i.GSSApi=1]="GSSApi",i[i.UserPass=2]="UserPass"})(rM||(re.Socks5Auth=rM={}));var IQ=128;re.SOCKS5_CUSTOM_AUTH_START=IQ;var OQ=254;re.SOCKS5_CUSTOM_AUTH_END=OQ;var vQ=255;re.SOCKS5_NO_ACCEPTABLE_AUTH=vQ;var sM;(function(i){i[i.Granted=0]="Granted",i[i.Failure=1]="Failure",i[i.NotAllowed=2]="NotAllowed",i[i.NetworkUnreachable=3]="NetworkUnreachable",i[i.HostUnreachable=4]="HostUnreachable",i[i.ConnectionRefused=5]="ConnectionRefused",i[i.TTLExpired=6]="TTLExpired",i[i.CommandNotSupported=7]="CommandNotSupported",i[i.AddressNotSupported=8]="AddressNotSupported"})(sM||(re.Socks5Response=sM={}));var nM;(function(i){i[i.IPv4=1]="IPv4",i[i.Hostname=3]="Hostname",i[i.IPv6=4]="IPv6"})(nM||(re.Socks5HostType=nM={}));var oM;(function(i){i[i.Created=0]="Created",i[i.Connecting=1]="Connecting",i[i.Connected=2]="Connected",i[i.SentInitialHandshake=3]="SentInitialHandshake",i[i.ReceivedInitialHandshakeResponse=4]="ReceivedInitialHandshakeResponse",i[i.SentAuthentication=5]="SentAuthentication",i[i.ReceivedAuthenticationResponse=6]="ReceivedAuthenticationResponse",i[i.SentFinalHandshake=7]="SentFinalHandshake",i[i.ReceivedFinalResponse=8]="ReceivedFinalResponse",i[i.BoundWaitingForConnection=9]="BoundWaitingForConnection",i[i.Established=10]="Established",i[i.Disconnected=11]="Disconnected",i[i.Error=99]="Error"})(oM||(re.SocksClientState=oM={}))});var Yw=d(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});bo.shuffleArray=bo.SocksClientError=void 0;var Zw=class extends Error{static{o(this,"SocksClientError")}constructor(e,t){super(e),this.options=t}};bo.SocksClientError=Zw;function RQ(i){for(let e=i.length-1;e>0;e--){let t=Math.floor(Math.random()*(e+1));[i[e],i[t]]=[i[t],i[e]]}}o(RQ,"shuffleArray");bo.shuffleArray=RQ});var nd=d(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.isInSubnet=AQ;js.isCorrect=TQ;js.numberToPaddedHex=aM;js.stringToPaddedHex=CQ;js.testBit=NQ;function AQ(i){return this.subnetMask<i.subnetMask?!1:this.mask(i.subnetMask)===i.mask()}o(AQ,"isInSubnet");function TQ(i){return function(){return this.addressMinusSuffix!==this.correctForm()?!1:this.subnetMask===i&&!this.parsedSubnet?!0:this.parsedSubnet===String(this.subnetMask)}}o(TQ,"isCorrect");function aM(i){return i.toString(16).padStart(2,"0")}o(aM,"numberToPaddedHex");function CQ(i){return aM(parseInt(i,10))}o(CQ,"stringToPaddedHex");function NQ(i,e){let{length:t}=i;if(e>t)return!1;let r=t-e;return i.substring(r,r+1)==="1"}o(NQ,"testBit")});var Xw=d(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.RE_SUBNET_STRING=bi.RE_ADDRESS=bi.GROUPS=bi.BITS=void 0;bi.BITS=32;bi.GROUPS=4;bi.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;bi.RE_SUBNET_STRING=/\/\d{1,2}$/});var ad=d(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0});od.AddressError=void 0;var Qw=class extends Error{static{o(this,"AddressError")}constructor(e,t){super(e),this.name="AddressError",this.parseMessage=t}};od.AddressError=Qw});var t_=d(Ii=>{"use strict";var PQ=Ii&&Ii.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),DQ=Ii&&Ii.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),uM=Ii&&Ii.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&PQ(e,i,t);return DQ(e,i),e};Object.defineProperty(Ii,"__esModule",{value:!0});Ii.Address4=void 0;var Io=uM(nd()),Xt=uM(Xw()),cM=ad(),e_=class i{static{o(this,"Address4")}constructor(e){this.groups=Xt.GROUPS,this.parsedAddress=[],this.parsedSubnet="",this.subnet="/32",this.subnetMask=32,this.v4=!0,this.isCorrect=Io.isCorrect(Xt.BITS),this.isInSubnet=Io.isInSubnet,this.address=e;let t=Xt.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>Xt.BITS)throw new cM.AddressError("Invalid subnet mask.");e=e.replace(Xt.RE_SUBNET_STRING,"")}this.addressMinusSuffix=e,this.parsedAddress=this.parse(e)}static isValid(e){try{return new i(e),!0}catch{return!1}}parse(e){let t=e.split(".");if(!e.match(Xt.RE_ADDRESS))throw new cM.AddressError("Invalid IPv4 address.");return t}correctForm(){return this.parsedAddress.map(e=>parseInt(e,10)).join(".")}static fromHex(e){let t=e.replace(/:/g,"").padStart(8,"0"),r=[],s;for(s=0;s<8;s+=2){let n=t.slice(s,s+2);r.push(parseInt(n,16))}return new i(r.join("."))}static fromInteger(e){return i.fromHex(e.toString(16))}static fromArpa(e){let r=e.replace(/(\.in-addr\.arpa)?\.$/,"").split(".").reverse().join(".");return new i(r)}toHex(){return this.parsedAddress.map(e=>Io.stringToPaddedHex(e)).join(":")}toArray(){return this.parsedAddress.map(e=>parseInt(e,10))}toGroup6(){let e=[],t;for(t=0;t<Xt.GROUPS;t+=2)e.push(`${Io.stringToPaddedHex(this.parsedAddress[t])}${Io.stringToPaddedHex(this.parsedAddress[t+1])}`);return e.join(":")}bigInt(){return BigInt(`0x${this.parsedAddress.map(e=>Io.stringToPaddedHex(e)).join("")}`)}_startAddress(){return BigInt(`0b${this.mask()+"0".repeat(Xt.BITS-this.subnetMask)}`)}startAddress(){return i.fromBigInt(this._startAddress())}startAddressExclusive(){let e=BigInt("1");return i.fromBigInt(this._startAddress()+e)}_endAddress(){return BigInt(`0b${this.mask()+"1".repeat(Xt.BITS-this.subnetMask)}`)}endAddress(){return i.fromBigInt(this._endAddress())}endAddressExclusive(){let e=BigInt("1");return i.fromBigInt(this._endAddress()-e)}static fromBigInt(e){return i.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 i("224.0.0.0/4"))}binaryZeroPad(){return this.bigInt().toString(2).padStart(Xt.BITS,"0")}groupForV6(){let e=this.parsedAddress;return this.address.replace(Xt.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>`)}};Ii.Address4=e_});var i_=d(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.RE_URL_WITH_PORT=he.RE_URL=he.RE_ZONE_STRING=he.RE_SUBNET_STRING=he.RE_BAD_ADDRESS=he.RE_BAD_CHARACTERS=he.TYPES=he.SCOPES=he.GROUPS=he.BITS=void 0;he.BITS=128;he.GROUPS=8;he.SCOPES={0:"Reserved",1:"Interface local",2:"Link local",4:"Admin local",5:"Site local",8:"Organization local",14:"Global",15:"Reserved"};he.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"};he.RE_BAD_CHARACTERS=/([^0-9a-f:/%])/gi;he.RE_BAD_ADDRESS=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi;he.RE_SUBNET_STRING=/\/\d{1,3}(?=%|$)/;he.RE_ZONE_STRING=/%.*$/;he.RE_URL=/^\[{0,1}([0-9a-f:]+)\]{0,1}/;he.RE_URL_WITH_PORT=/\[([0-9a-f:]+)\]:([0-9]{1,5})/});var r_=d(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.spanAllZeroes=lM;Oo.spanAll=xQ;Oo.spanLeadingZeroes=LQ;Oo.simpleGroup=MQ;function lM(i){return i.replace(/(0+)/g,'<span class="zero">$1</span>')}o(lM,"spanAllZeroes");function xQ(i,e=0){return i.split("").map((r,s)=>`<span class="digit value-${r} position-${s+e}">${lM(r)}</span>`).join("")}o(xQ,"spanAll");function hM(i){return i.replace(/^(0+)/,'<span class="zero">$1</span>')}o(hM,"spanLeadingZeroesSimple");function LQ(i){return i.split(":").map(t=>hM(t)).join(":")}o(LQ,"spanLeadingZeroes");function MQ(i,e=0){return i.split(":").map((r,s)=>/group-v4/.test(r)?r:`<span class="hover-group group-${s+e}">${hM(r)}</span>`)}o(MQ,"simpleGroup")});var fM=d(it=>{"use strict";var BQ=it&&it.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),kQ=it&&it.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),FQ=it&&it.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&BQ(e,i,t);return kQ(e,i),e};Object.defineProperty(it,"__esModule",{value:!0});it.ADDRESS_BOUNDARY=void 0;it.groupPossibilities=ud;it.padGroup=cd;it.simpleRegularExpression=jQ;it.possibleElisions=$Q;var UQ=FQ(i_());function ud(i){return`(${i.join("|")})`}o(ud,"groupPossibilities");function cd(i){return i.length<4?`0{0,${4-i.length}}${i}`:i}o(cd,"padGroup");it.ADDRESS_BOUNDARY="[^A-Fa-f0-9:]";function jQ(i){let e=[];i.forEach((r,s)=>{parseInt(r,16)===0&&e.push(s)});let t=e.map(r=>i.map((s,n)=>{if(n===r){let a=n===0||n===UQ.GROUPS-1?":":"";return ud([cd(s),a])}return cd(s)}).join(":"));return t.push(i.map(cd).join(":")),ud(t)}o(jQ,"simpleRegularExpression");function $Q(i,e,t){let r=e?"":":",s=t?"":":",n=[];!e&&!t&&n.push("::"),e&&t&&n.push(""),(t&&!e||!t&&e)&&n.push(":"),n.push(`${r}(:0{1,4}){1,${i-1}}`),n.push(`(0{1,4}:){1,${i-1}}${s}`),n.push(`(0{1,4}:){${i-1}}0{1,4}`);for(let a=1;a<i-1;a++)for(let c=1;c<i-a;c++)n.push(`(0{1,4}:){${c}}:(0{1,4}:){${i-c-a-1}}0{1,4}`);return ud(n)}o($Q,"possibleElisions")});var gM=d(Oi=>{"use strict";var qQ=Oi&&Oi.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),VQ=Oi&&Oi.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),fd=Oi&&Oi.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&qQ(e,i,t);return VQ(e,i),e};Object.defineProperty(Oi,"__esModule",{value:!0});Oi.Address6=void 0;var dM=fd(nd()),s_=fd(Xw()),se=fd(i_()),n_=fd(r_()),$s=t_(),qs=fM(),cr=ad(),ld=nd();function hd(i){if(!i)throw new Error("Assertion failed.")}o(hd,"assert");function zQ(i){let e=/(\d+)(\d{3})/;for(;e.test(i);)i=i.replace(e,"$1,$2");return i}o(zQ,"addCommas");function HQ(i){return i=i.replace(/^(0{1,})([1-9]+)$/,'<span class="parse-error">$1</span>$2'),i=i.replace(/^(0{1,})(0)$/,'<span class="parse-error">$1</span>$2'),i}o(HQ,"spanLeadingZeroes4");function GQ(i,e){let t=[],r=[],s;for(s=0;s<i.length;s++)s<e[0]?t.push(i[s]):s>e[1]&&r.push(i[s]);return t.concat(["compact"]).concat(r)}o(GQ,"compact");function pM(i){return parseInt(i,16).toString(16).padStart(4,"0")}o(pM,"paddedHex");function mM(i){return i&255}o(mM,"unsignByte");var o_=class i{static{o(this,"Address6")}constructor(e,t){this.addressMinusSuffix="",this.parsedSubnet="",this.subnet="/128",this.subnetMask=128,this.v4=!1,this.zone="",this.isInSubnet=dM.isInSubnet,this.isCorrect=dM.isCorrect(se.BITS),t===void 0?this.groups=se.GROUPS:this.groups=t,this.address=e;let r=se.RE_SUBNET_STRING.exec(e);if(r){if(this.parsedSubnet=r[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,Number.isNaN(this.subnetMask)||this.subnetMask<0||this.subnetMask>se.BITS)throw new cr.AddressError("Invalid subnet mask.");e=e.replace(se.RE_SUBNET_STRING,"")}else if(/\//.test(e))throw new cr.AddressError("Invalid subnet mask.");let s=se.RE_ZONE_STRING.exec(e);s&&(this.zone=s[0],e=e.replace(se.RE_ZONE_STRING,"")),this.addressMinusSuffix=e,this.parsedAddress=this.parse(this.addressMinusSuffix)}static isValid(e){try{return new i(e),!0}catch{return!1}}static fromBigInt(e){let t=e.toString(16).padStart(32,"0"),r=[],s;for(s=0;s<se.GROUPS;s++)r.push(t.slice(s*4,(s+1)*4));return new i(r.join(":"))}static fromURL(e){let t,r=null,s;if(e.indexOf("[")!==-1&&e.indexOf("]:")!==-1){if(s=se.RE_URL_WITH_PORT.exec(e),s===null)return{error:"failed to parse address with port",address:null,port:null};t=s[1],r=s[2]}else if(e.indexOf("/")!==-1){if(e=e.replace(/^[a-z0-9]+:\/\//,""),s=se.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 r?(r=parseInt(r,10),(r<0||r>65536)&&(r=null)):r=null,{address:new i(t),port:r}}static fromAddress4(e){let t=new $s.Address4(e),r=se.BITS-(s_.BITS-t.subnetMask);return new i(`::ffff:${t.correctForm()}/${r}`)}static fromArpa(e){let t=e.replace(/(\.ip6\.arpa)?\.$/,""),r=7;if(t.length!==63)throw new cr.AddressError("Invalid 'ip6.arpa' form.");let s=t.split(".").reverse();for(let n=r;n>0;n--){let a=n*4;s.splice(a,0,":")}return t=s.join(""),new i(t)}microsoftTranscription(){return`${this.correctForm().replace(/:/g,"-")}.ipv6-literal.net`}mask(e=this.subnetMask){return this.getBitsBase2(0,e)}possibleSubnets(e=128){let t=se.BITS-this.subnetMask,r=Math.abs(e-se.BITS),s=t-r;return s<0?"0":zQ((BigInt("2")**BigInt(s)).toString(10))}_startAddress(){return BigInt(`0b${this.mask()+"0".repeat(se.BITS-this.subnetMask)}`)}startAddress(){return i.fromBigInt(this._startAddress())}startAddressExclusive(){let e=BigInt("1");return i.fromBigInt(this._startAddress()+e)}_endAddress(){return BigInt(`0b${this.mask()+"1".repeat(se.BITS-this.subnetMask)}`)}endAddress(){return i.fromBigInt(this._endAddress())}endAddressExclusive(){let e=BigInt("1");return i.fromBigInt(this._endAddress()-e)}getScope(){let e=se.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(se.TYPES))if(this.isInSubnet(new i(e)))return se.TYPES[e];return"Global unicast"}getBits(e,t){return BigInt(`0b${this.getBitsBase2(e,t)}`)}getBitsBase2(e,t){return this.binaryZeroPad().slice(e,t)}getBitsBase16(e,t){let r=t-e;if(r%4!==0)throw new Error("Length of bits to retrieve must be divisible by four");return this.getBits(e,t).toString(16).padStart(r/4,"0")}getBitsPastSubnet(){return this.getBitsBase2(this.subnetMask,se.BITS)}reverseForm(e){e||(e={});let t=Math.floor(this.subnetMask/4),r=this.canonicalForm().replace(/:/g,"").split("").slice(0,t).reverse().join(".");return t>0?e.omitSuffix?r:`${r}.ip6.arpa.`:e.omitSuffix?"":"ip6.arpa."}correctForm(){let e,t=[],r=0,s=[];for(e=0;e<this.parsedAddress.length;e++){let c=parseInt(this.parsedAddress[e],16);c===0&&r++,c!==0&&r>0&&(r>1&&s.push([e-r,e-1]),r=0)}r>1&&s.push([this.parsedAddress.length-r,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=GQ(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(se.BITS,"0")}parse4in6(e){let t=e.split(":"),s=t.slice(-1)[0].match(s_.RE_ADDRESS);if(s){this.parsedAddress4=s[0],this.address4=new $s.Address4(this.parsedAddress4);for(let n=0;n<this.address4.groups;n++)if(/^0[0-9]+/.test(this.address4.parsedAddress[n]))throw new cr.AddressError("IPv4 addresses can't have leading zeroes.",e.replace(s_.RE_ADDRESS,this.address4.parsedAddress.map(HQ).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(se.RE_BAD_CHARACTERS);if(t)throw new cr.AddressError(`Bad character${t.length>1?"s":""} detected in address: ${t.join("")}`,e.replace(se.RE_BAD_CHARACTERS,'<span class="parse-error">$1</span>'));let r=e.match(se.RE_BAD_ADDRESS);if(r)throw new cr.AddressError(`Address failed regex: ${r.join("")}`,e.replace(se.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 u=this.groups-(a.length+c.length);if(!u)throw new cr.AddressError("Error parsing groups");this.elidedGroups=u,this.elisionBegin=a.length,this.elisionEnd=a.length+this.elidedGroups,s=s.concat(a);for(let l=0;l<u;l++)s.push("0");s=s.concat(c)}else if(n.length===1)s=e.split(":"),this.elidedGroups=0;else throw new cr.AddressError("Too many :: groups found");if(s=s.map(a=>parseInt(a,16).toString(16)),s.length!==this.groups)throw new cr.AddressError("Incorrect number of groups found");return s}canonicalForm(){return this.parsedAddress.map(pM).join(":")}decimal(){return this.parsedAddress.map(e=>parseInt(e,16).toString(10).padStart(5,"0")).join(":")}bigInt(){return BigInt(`0x${this.parsedAddress.map(pM).join("")}`)}to4(){let e=this.binaryZeroPad().split("");return $s.Address4.fromHex(BigInt(`0b${e.slice(96,128).join("")}`).toString(16))}to4in6(){let e=this.to4(),r=new i(this.parsedAddress.slice(0,6).join(":"),6).correctForm(),s="";return/:$/.test(r)||(s=":"),r+s+e.address}inspectTeredo(){let e=this.getBitsBase16(0,32),r=(this.getBits(80,96)^BigInt("0xffff")).toString(),s=$s.Address4.fromHex(this.getBitsBase16(32,64)),n=this.getBits(96,128),a=$s.Address4.fromHex((n^BigInt("0xffffffff")).toString(16)),c=this.getBitsBase2(64,80),u=(0,ld.testBit)(c,15),l=(0,ld.testBit)(c,14),h=(0,ld.testBit)(c,8),f=(0,ld.testBit)(c,9),p=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:u,microsoft:{reserved:l,universalLocal:f,groupIndividual:h,nonce:p},udpPort:r}}inspect6to4(){let e=this.getBitsBase16(0,16),t=$s.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 i(e)}toByteArray(){let e=this.bigInt().toString(16),r=`${"0".repeat(e.length%2)}${e}`,s=[];for(let n=0,a=r.length;n<a;n+=2)s.push(parseInt(r.substring(n,n+2),16));return s}toUnsignedByteArray(){return this.toByteArray().map(mM)}static fromByteArray(e){return this.fromUnsignedByteArray(e.map(mM))}static fromUnsignedByteArray(e){let t=BigInt("256"),r=BigInt("0"),s=BigInt("1");for(let n=e.length-1;n>=0;n--)r+=s*BigInt(e[n].toString(10)),s*=t;return i.fromBigInt(r)}isCanonical(){return this.addressMinusSuffix===this.canonicalForm()}isLinkLocal(){return this.getBitsBase2(0,64)==="1111111010000000000000000000000000000000000000000000000000000000"}isMulticast(){return this.getType()==="Multicast"}is4(){return this.v4}isTeredo(){return this.isInSubnet(new i("2001::/32"))}is6to4(){return this.isInSubnet(new i("2002::/16"))}isLoopback(){return this.getType()==="Loopback"}href(e){return e===void 0?e="":e=`:${e}`,`http://[${this.correctForm()}]${e}/`}link(e){e||(e={}),e.className===void 0&&(e.className=""),e.prefix===void 0&&(e.prefix="/#address="),e.v4===void 0&&(e.v4=!1);let t=this.correctForm;e.v4&&(t=this.to4in6);let r=t.call(this);return e.className?`<a href="${e.prefix}${r}" class="${e.className}">${r}</a>`:`<a href="${e.prefix}${r}">${r}</a>`}group(){if(this.elidedGroups===0)return n_.simpleGroup(this.address).join(":");hd(typeof this.elidedGroups=="number"),hd(typeof this.elisionBegin=="number");let e=[],[t,r]=this.address.split("::");t.length?e.push(...n_.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>`),r.length?e.push(...n_.simpleGroup(r,this.elisionEnd)):e.push(""),this.is4()&&(hd(this.address4 instanceof $s.Address4),e.pop(),e.push(this.address4.groupForV6())),e.join(":")}regularExpressionString(e=!1){let t=[],r=new i(this.correctForm());if(r.elidedGroups===0)t.push((0,qs.simpleRegularExpression)(r.parsedAddress));else if(r.elidedGroups===se.GROUPS)t.push((0,qs.possibleElisions)(se.GROUPS));else{let s=r.address.split("::");s[0].length&&t.push((0,qs.simpleRegularExpression)(s[0].split(":"))),hd(typeof r.elidedGroups=="number"),t.push((0,qs.possibleElisions)(r.elidedGroups,s[0].length!==0,s[1].length!==0)),s[1].length&&t.push((0,qs.simpleRegularExpression)(s[1].split(":"))),t=[t.join(":")]}return e||(t=["(?=^|",qs.ADDRESS_BOUNDARY,"|[^\\w\\:])(",...t,")(?=[^\\w\\:]|",qs.ADDRESS_BOUNDARY,"|$)"]),t.join("")}regularExpression(e=!1){return new RegExp(this.regularExpressionString(e),"i")}};Oi.Address6=o_});var a_=d(Ue=>{"use strict";var WQ=Ue&&Ue.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),JQ=Ue&&Ue.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),KQ=Ue&&Ue.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&WQ(e,i,t);return JQ(e,i),e};Object.defineProperty(Ue,"__esModule",{value:!0});Ue.v6=Ue.AddressError=Ue.Address6=Ue.Address4=void 0;var ZQ=t_();Object.defineProperty(Ue,"Address4",{enumerable:!0,get:o(function(){return ZQ.Address4},"get")});var YQ=gM();Object.defineProperty(Ue,"Address6",{enumerable:!0,get:o(function(){return YQ.Address6},"get")});var XQ=ad();Object.defineProperty(Ue,"AddressError",{enumerable:!0,get:o(function(){return XQ.AddressError},"get")});var QQ=KQ(r_());Ue.v6={helpers:QQ}});var bM=d(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.ipToBuffer=Dt.int32ToIpv4=Dt.ipv4ToInt32=Dt.validateSocksClientChainOptions=Dt.validateSocksClientOptions=void 0;var We=Yw(),Ce=Kw(),e7=require("stream"),c_=a_(),yM=require("net");function t7(i,e=["connect","bind","associate"]){if(!Ce.SocksCommand[i.command])throw new We.SocksClientError(Ce.ERRORS.InvalidSocksCommand,i);if(e.indexOf(i.command)===-1)throw new We.SocksClientError(Ce.ERRORS.InvalidSocksCommandForOperation,i);if(!EM(i.destination))throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsDestination,i);if(!wM(i.proxy))throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsProxy,i);if(SM(i.proxy,i),i.timeout&&!_M(i.timeout))throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsTimeout,i);if(i.existing_socket&&!(i.existing_socket instanceof e7.Duplex))throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsExistingSocket,i)}o(t7,"validateSocksClientOptions");Dt.validateSocksClientOptions=t7;function i7(i){if(i.command!=="connect")throw new We.SocksClientError(Ce.ERRORS.InvalidSocksCommandChain,i);if(!EM(i.destination))throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsDestination,i);if(!(i.proxies&&Array.isArray(i.proxies)&&i.proxies.length>=2))throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsProxiesLength,i);if(i.proxies.forEach(e=>{if(!wM(e))throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsProxy,i);SM(e,i)}),i.timeout&&!_M(i.timeout))throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsTimeout,i)}o(i7,"validateSocksClientChainOptions");Dt.validateSocksClientChainOptions=i7;function SM(i,e){if(i.custom_auth_method!==void 0){if(i.custom_auth_method<Ce.SOCKS5_CUSTOM_AUTH_START||i.custom_auth_method>Ce.SOCKS5_CUSTOM_AUTH_END)throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsCustomAuthRange,e);if(i.custom_auth_request_handler===void 0||typeof i.custom_auth_request_handler!="function")throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e);if(i.custom_auth_response_size===void 0)throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e);if(i.custom_auth_response_handler===void 0||typeof i.custom_auth_response_handler!="function")throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e)}}o(SM,"validateCustomProxyAuth");function EM(i){return i&&typeof i.host=="string"&&Buffer.byteLength(i.host)<256&&typeof i.port=="number"&&i.port>=0&&i.port<=65535}o(EM,"isValidSocksRemoteHost");function wM(i){return i&&(typeof i.host=="string"||typeof i.ipaddress=="string")&&typeof i.port=="number"&&i.port>=0&&i.port<=65535&&(i.type===4||i.type===5)}o(wM,"isValidSocksProxy");function _M(i){return typeof i=="number"&&i>0}o(_M,"isValidTimeoutValue");function r7(i){return new c_.Address4(i).toArray().reduce((t,r)=>(t<<8)+r,0)>>>0}o(r7,"ipv4ToInt32");Dt.ipv4ToInt32=r7;function s7(i){let e=i>>>24&255,t=i>>>16&255,r=i>>>8&255,s=i&255;return[e,t,r,s].join(".")}o(s7,"int32ToIpv4");Dt.int32ToIpv4=s7;function n7(i){if(yM.isIPv4(i)){let e=new c_.Address4(i);return Buffer.from(e.toArray())}else if(yM.isIPv6(i)){let e=new c_.Address6(i);return Buffer.from(e.canonicalForm().split(":").map(t=>t.padStart(4,"0")).join(""),"hex")}else throw new Error("Invalid IP address format")}o(n7,"ipToBuffer");Dt.ipToBuffer=n7});var IM=d(dd=>{"use strict";Object.defineProperty(dd,"__esModule",{value:!0});dd.ReceiveBuffer=void 0;var u_=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}};dd.ReceiveBuffer=u_});var OM=d(Fr=>{"use strict";var vo=Fr&&Fr.__awaiter||function(i,e,t,r){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{l(r.next(h))}catch(f){a(f)}}o(c,"fulfilled");function u(h){try{l(r.throw(h))}catch(f){a(f)}}o(u,"rejected");function l(h){h.done?n(h.value):s(h.value).then(c,u)}o(l,"step"),l((r=r.apply(i,e||[])).next())})};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.SocksClientError=Fr.SocksClient=void 0;var o7=require("events"),Ro=require("net"),rt=eM(),O=Kw(),gt=bM(),a7=IM(),h_=Yw();Object.defineProperty(Fr,"SocksClientError",{enumerable:!0,get:o(function(){return h_.SocksClientError},"get")});var l_=a_(),f_=class i extends o7.EventEmitter{static{o(this,"SocksClient")}constructor(e){super(),this.options=Object.assign({},e),(0,gt.validateSocksClientOptions)(e),this.setState(O.SocksClientState.Created)}static createConnection(e,t){return new Promise((r,s)=>{try{(0,gt.validateSocksClientOptions)(e,["connect"])}catch(a){return typeof t=="function"?(t(a),r(a)):s(a)}let n=new i(e);n.connect(e.existing_socket),n.once("established",a=>{n.removeAllListeners(),typeof t=="function"&&t(null,a),r(a)}),n.once("error",a=>{n.removeAllListeners(),typeof t=="function"?(t(a),r(a)):s(a)})})}static createConnectionChain(e,t){return new Promise((r,s)=>vo(this,void 0,void 0,function*(){try{(0,gt.validateSocksClientChainOptions)(e)}catch(n){return typeof t=="function"?(t(n),r(n)):s(n)}e.randomizeChain&&(0,h_.shuffleArray)(e.proxies);try{let n;for(let a=0;a<e.proxies.length;a++){let c=e.proxies[a],u=a===e.proxies.length-1?e.destination:{host:e.proxies[a+1].host||e.proxies[a+1].ipaddress,port:e.proxies[a+1].port},l=yield i.createConnection({command:"connect",proxy:c,destination:u,existing_socket:n});n=n||l.socket}typeof t=="function"?(t(null,{socket:n}),r({socket:n})):r({socket:n})}catch(n){typeof t=="function"?(t(n),r(n)):s(n)}}))}static createUDPFrame(e){let t=new rt.SmartBuffer;return t.writeUInt16BE(0),t.writeUInt8(e.frameNumber||0),Ro.isIPv4(e.remoteHost.host)?(t.writeUInt8(O.Socks5HostType.IPv4),t.writeUInt32BE((0,gt.ipv4ToInt32)(e.remoteHost.host))):Ro.isIPv6(e.remoteHost.host)?(t.writeUInt8(O.Socks5HostType.IPv6),t.writeBuffer((0,gt.ipToBuffer)(e.remoteHost.host))):(t.writeUInt8(O.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 r=t.readUInt8(),s=t.readUInt8(),n;s===O.Socks5HostType.IPv4?n=(0,gt.int32ToIpv4)(t.readUInt32BE()):s===O.Socks5HostType.IPv6?n=l_.Address6.fromByteArray(Array.from(t.readBuffer(16))).canonicalForm():n=t.readString(t.readUInt8());let a=t.readUInt16BE();return{frameNumber:r,remoteHost:{host:n,port:a},data:t.readBuffer()}}setState(e){this.state!==O.SocksClientState.Error&&(this.state=e)}connect(e){this.onDataReceived=r=>this.onDataReceivedHandler(r),this.onClose=()=>this.onCloseHandler(),this.onError=r=>this.onErrorHandler(r),this.onConnect=()=>this.onConnectHandler();let t=setTimeout(()=>this.onEstablishedTimeout(),this.options.timeout||O.DEFAULT_TIMEOUT);t.unref&&typeof t.unref=="function"&&t.unref(),e?this.socket=e:this.socket=new Ro.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(O.SocksClientState.Connecting),this.receiveBuffer=new a7.ReceiveBuffer,e?this.socket.emit("connect"):(this.socket.connect(this.getSocketOptions()),this.options.set_tcp_nodelay!==void 0&&this.options.set_tcp_nodelay!==null&&this.socket.setNoDelay(!!this.options.set_tcp_nodelay)),this.prependOnceListener("established",r=>{setImmediate(()=>{if(this.receiveBuffer.length>0){let s=this.receiveBuffer.get(this.receiveBuffer.length);r.socket.emit("data",s)}r.socket.resume()})})}getSocketOptions(){return Object.assign(Object.assign({},this.options.socket_options),{host:this.options.proxy.host||this.options.proxy.ipaddress,port:this.options.proxy.port})}onEstablishedTimeout(){this.state!==O.SocksClientState.Established&&this.state!==O.SocksClientState.BoundWaitingForConnection&&this.closeSocket(O.ERRORS.ProxyConnectionTimedOut)}onConnectHandler(){this.setState(O.SocksClientState.Connected),this.options.proxy.type===4?this.sendSocks4InitialHandshake():this.sendSocks5InitialHandshake(),this.setState(O.SocksClientState.SentInitialHandshake)}onDataReceivedHandler(e){this.receiveBuffer.append(e),this.processData()}processData(){for(;this.state!==O.SocksClientState.Established&&this.state!==O.SocksClientState.Error&&this.receiveBuffer.length>=this.nextRequiredPacketBufferSize;)if(this.state===O.SocksClientState.SentInitialHandshake)this.options.proxy.type===4?this.handleSocks4FinalHandshakeResponse():this.handleInitialSocks5HandshakeResponse();else if(this.state===O.SocksClientState.SentAuthentication)this.handleInitialSocks5AuthenticationHandshakeResponse();else if(this.state===O.SocksClientState.SentFinalHandshake)this.handleSocks5FinalHandshakeResponse();else if(this.state===O.SocksClientState.BoundWaitingForConnection)this.options.proxy.type===4?this.handleSocks4IncomingConnectionResponse():this.handleSocks5IncomingConnectionResponse();else{this.closeSocket(O.ERRORS.InternalError);break}}onCloseHandler(){this.closeSocket(O.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!==O.SocksClientState.Error&&(this.setState(O.SocksClientState.Error),this.socket.destroy(),this.removeInternalSocketHandlers(),this.emit("error",new h_.SocksClientError(e,this.options)))}sendSocks4InitialHandshake(){let e=this.options.proxy.userId||"",t=new rt.SmartBuffer;t.writeUInt8(4),t.writeUInt8(O.SocksCommand[this.options.command]),t.writeUInt16BE(this.options.destination.port),Ro.isIPv4(this.options.destination.host)?(t.writeBuffer((0,gt.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=O.SOCKS_INCOMING_PACKET_SIZES.Socks4Response,this.socket.write(t.toBuffer())}handleSocks4FinalHandshakeResponse(){let e=this.receiveBuffer.get(8);if(e[1]!==O.Socks4Response.Granted)this.closeSocket(`${O.ERRORS.Socks4ProxyRejectedConnection} - (${O.Socks4Response[e[1]]})`);else if(O.SocksCommand[this.options.command]===O.SocksCommand.bind){let t=rt.SmartBuffer.fromBuffer(e);t.readOffset=2;let r={port:t.readUInt16BE(),host:(0,gt.int32ToIpv4)(t.readUInt32BE())};r.host==="0.0.0.0"&&(r.host=this.options.proxy.ipaddress),this.setState(O.SocksClientState.BoundWaitingForConnection),this.emit("bound",{remoteHost:r,socket:this.socket})}else this.setState(O.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{socket:this.socket})}handleSocks4IncomingConnectionResponse(){let e=this.receiveBuffer.get(8);if(e[1]!==O.Socks4Response.Granted)this.closeSocket(`${O.ERRORS.Socks4ProxyRejectedIncomingBoundConnection} - (${O.Socks4Response[e[1]]})`);else{let t=rt.SmartBuffer.fromBuffer(e);t.readOffset=2;let r={port:t.readUInt16BE(),host:(0,gt.int32ToIpv4)(t.readUInt32BE())};this.setState(O.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket})}}sendSocks5InitialHandshake(){let e=new rt.SmartBuffer,t=[O.Socks5Auth.NoAuth];(this.options.proxy.userId||this.options.proxy.password)&&t.push(O.Socks5Auth.UserPass),this.options.proxy.custom_auth_method!==void 0&&t.push(this.options.proxy.custom_auth_method),e.writeUInt8(5),e.writeUInt8(t.length);for(let r of t)e.writeUInt8(r);this.nextRequiredPacketBufferSize=O.SOCKS_INCOMING_PACKET_SIZES.Socks5InitialHandshakeResponse,this.socket.write(e.toBuffer()),this.setState(O.SocksClientState.SentInitialHandshake)}handleInitialSocks5HandshakeResponse(){let e=this.receiveBuffer.get(2);e[0]!==5?this.closeSocket(O.ERRORS.InvalidSocks5IntiailHandshakeSocksVersion):e[1]===O.SOCKS5_NO_ACCEPTABLE_AUTH?this.closeSocket(O.ERRORS.InvalidSocks5InitialHandshakeNoAcceptedAuthType):e[1]===O.Socks5Auth.NoAuth?(this.socks5ChosenAuthType=O.Socks5Auth.NoAuth,this.sendSocks5CommandRequest()):e[1]===O.Socks5Auth.UserPass?(this.socks5ChosenAuthType=O.Socks5Auth.UserPass,this.sendSocks5UserPassAuthentication()):e[1]===this.options.proxy.custom_auth_method?(this.socks5ChosenAuthType=this.options.proxy.custom_auth_method,this.sendSocks5CustomAuthentication()):this.closeSocket(O.ERRORS.InvalidSocks5InitialHandshakeUnknownAuthType)}sendSocks5UserPassAuthentication(){let e=this.options.proxy.userId||"",t=this.options.proxy.password||"",r=new rt.SmartBuffer;r.writeUInt8(1),r.writeUInt8(Buffer.byteLength(e)),r.writeString(e),r.writeUInt8(Buffer.byteLength(t)),r.writeString(t),this.nextRequiredPacketBufferSize=O.SOCKS_INCOMING_PACKET_SIZES.Socks5UserPassAuthenticationResponse,this.socket.write(r.toBuffer()),this.setState(O.SocksClientState.SentAuthentication)}sendSocks5CustomAuthentication(){return vo(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(O.SocksClientState.SentAuthentication)})}handleSocks5CustomAuthHandshakeResponse(e){return vo(this,void 0,void 0,function*(){return yield this.options.proxy.custom_auth_response_handler(e)})}handleSocks5AuthenticationNoAuthHandshakeResponse(e){return vo(this,void 0,void 0,function*(){return e[1]===0})}handleSocks5AuthenticationUserPassHandshakeResponse(e){return vo(this,void 0,void 0,function*(){return e[1]===0})}handleInitialSocks5AuthenticationHandshakeResponse(){return vo(this,void 0,void 0,function*(){this.setState(O.SocksClientState.ReceivedAuthenticationResponse);let e=!1;this.socks5ChosenAuthType===O.Socks5Auth.NoAuth?e=yield this.handleSocks5AuthenticationNoAuthHandshakeResponse(this.receiveBuffer.get(2)):this.socks5ChosenAuthType===O.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(O.ERRORS.Socks5AuthenticationFailed)})}sendSocks5CommandRequest(){let e=new rt.SmartBuffer;e.writeUInt8(5),e.writeUInt8(O.SocksCommand[this.options.command]),e.writeUInt8(0),Ro.isIPv4(this.options.destination.host)?(e.writeUInt8(O.Socks5HostType.IPv4),e.writeBuffer((0,gt.ipToBuffer)(this.options.destination.host))):Ro.isIPv6(this.options.destination.host)?(e.writeUInt8(O.Socks5HostType.IPv6),e.writeBuffer((0,gt.ipToBuffer)(this.options.destination.host))):(e.writeUInt8(O.Socks5HostType.Hostname),e.writeUInt8(this.options.destination.host.length),e.writeString(this.options.destination.host)),e.writeUInt16BE(this.options.destination.port),this.nextRequiredPacketBufferSize=O.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader,this.socket.write(e.toBuffer()),this.setState(O.SocksClientState.SentFinalHandshake)}handleSocks5FinalHandshakeResponse(){let e=this.receiveBuffer.peek(5);if(e[0]!==5||e[1]!==O.Socks5Response.Granted)this.closeSocket(`${O.ERRORS.InvalidSocks5FinalHandshakeRejected} - ${O.Socks5Response[e[1]]}`);else{let t=e[3],r,s;if(t===O.Socks5HostType.IPv4){let n=O.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}s=rt.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:(0,gt.int32ToIpv4)(s.readUInt32BE()),port:s.readUInt16BE()},r.host==="0.0.0.0"&&(r.host=this.options.proxy.ipaddress)}else if(t===O.Socks5HostType.Hostname){let n=e[4],a=O.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)),r={host:s.readString(n),port:s.readUInt16BE()}}else if(t===O.Socks5HostType.IPv6){let n=O.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}s=rt.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:l_.Address6.fromByteArray(Array.from(s.readBuffer(16))).canonicalForm(),port:s.readUInt16BE()}}this.setState(O.SocksClientState.ReceivedFinalResponse),O.SocksCommand[this.options.command]===O.SocksCommand.connect?(this.setState(O.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket})):O.SocksCommand[this.options.command]===O.SocksCommand.bind?(this.setState(O.SocksClientState.BoundWaitingForConnection),this.nextRequiredPacketBufferSize=O.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader,this.emit("bound",{remoteHost:r,socket:this.socket})):O.SocksCommand[this.options.command]===O.SocksCommand.associate&&(this.setState(O.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket}))}}handleSocks5IncomingConnectionResponse(){let e=this.receiveBuffer.peek(5);if(e[0]!==5||e[1]!==O.Socks5Response.Granted)this.closeSocket(`${O.ERRORS.Socks5ProxyRejectedIncomingBoundConnection} - ${O.Socks5Response[e[1]]}`);else{let t=e[3],r,s;if(t===O.Socks5HostType.IPv4){let n=O.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}s=rt.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:(0,gt.int32ToIpv4)(s.readUInt32BE()),port:s.readUInt16BE()},r.host==="0.0.0.0"&&(r.host=this.options.proxy.ipaddress)}else if(t===O.Socks5HostType.Hostname){let n=e[4],a=O.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)),r={host:s.readString(n),port:s.readUInt16BE()}}else if(t===O.Socks5HostType.IPv6){let n=O.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}s=rt.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:l_.Address6.fromByteArray(Array.from(s.readBuffer(16))).canonicalForm(),port:s.readUInt16BE()}}this.setState(O.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket})}}get socksClientOptions(){return Object.assign({},this.options)}};Fr.SocksClient=f_});var vM=d(Vs=>{"use strict";var c7=Vs&&Vs.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),u7=Vs&&Vs.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&c7(e,i,t)};Object.defineProperty(Vs,"__esModule",{value:!0});u7(OM(),Vs)});var RM=d(xt=>{"use strict";var l7=xt&&xt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),h7=xt&&xt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),d_=xt&&xt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&l7(e,i,t);return h7(e,i),e},f7=xt&&xt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(xt,"__esModule",{value:!0});xt.SocksProxyAgent=void 0;var d7=vM(),p7=Yc(),m7=f7(Fs()),g7=d_(require("dns")),y7=d_(require("net")),S7=d_(require("tls")),E7=require("url"),pd=(0,m7.default)("socks-proxy-agent"),w7=o(i=>i.servername===void 0&&i.host&&!y7.isIP(i.host)?{...i,servername:i.host}:i,"setServernameFromNonIpHost");function _7(i){let e=!1,t=5,r=i.hostname,s=parseInt(i.port,10)||1080;switch(i.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(i.protocol)}`)}let n={host:r,port:s,type:t};return i.username&&Object.defineProperty(n,"userId",{value:decodeURIComponent(i.username),enumerable:!1}),i.password!=null&&Object.defineProperty(n,"password",{value:decodeURIComponent(i.password),enumerable:!1}),{lookup:e,proxy:n}}o(_7,"parseSocksURL");var md=class extends p7.Agent{static{o(this,"SocksProxyAgent")}constructor(e,t){super(t);let r=typeof e=="string"?new E7.URL(e):e,{proxy:s,lookup:n}=_7(r);this.shouldLookup=n,this.proxy=s,this.timeout=t?.timeout??null,this.socketOptions=t?.socketOptions??null}async connect(e,t){let{shouldLookup:r,proxy:s,timeout:n}=this;if(!t.host)throw new Error("No `host` defined!");let{host:a}=t,{port:c,lookup:u=g7.lookup}=t;r&&(a=await new Promise((p,m)=>{u(a,{},(y,g)=>{y?m(y):p(g)})}));let l={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(p=>{e.destroy(),f.destroy(),p&&p.destroy()},"cleanup");pd("Creating socks proxy connection: %o",l);let{socket:f}=await d7.SocksClient.createConnection(l);if(pd("Successfully created socks proxy connection"),n!==null&&(f.setTimeout(n),f.on("timeout",()=>h())),t.secureEndpoint){pd("Upgrading socket connection to TLS");let p=S7.connect({...b7(w7(t),"host","path","port"),socket:f});return p.once("error",m=>{pd("Socket TLS error",m.message),h(p)}),p}return f}};md.protocols=["socks","socks4","socks4a","socks5","socks5h"];xt.SocksProxyAgent=md;function b7(i,...e){let t={},r;for(r in i)e.includes(r)||(t[r]=i[r]);return t}o(b7,"omit")});var E_=d((uEe,AM)=>{"use strict";var p_=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}},m_=class extends Error{static{o(this,"ConnectionTimeoutError")}constructor(e){super(`Timeout connecting to host \`${e}\``),this.code="ECONNECTIONTIMEOUT",this.host=e}},g_=class extends Error{static{o(this,"IdleTimeoutError")}constructor(e){super(`Idle timeout reached for host \`${e}\``),this.code="EIDLETIMEOUT",this.host=e}},y_=class extends Error{static{o(this,"ResponseTimeoutError")}constructor(e,t){let r="Response timeout ";t&&(r+=`from proxy \`${t.host}\` `),r+=`connecting to host \`${e.host}\``,super(r),this.code="ERESPONSETIMEOUT",this.proxy=t,this.request=e}},S_=class extends Error{static{o(this,"TransferTimeoutError")}constructor(e,t){let r="Transfer timeout ";t&&(r+=`from proxy \`${t.host}\` `),r+=`for \`${e.host}\``,super(r),this.code="ETRANSFERTIMEOUT",this.proxy=t,this.request=e}};AM.exports={InvalidProxyProtocolError:p_,ConnectionTimeoutError:m_,IdleTimeoutError:g_,ResponseTimeoutError:y_,TransferTimeoutError:S_}});var w_=d((hEe,CM)=>{"use strict";var{HttpProxyAgent:I7}=$L(),{HttpsProxyAgent:O7}=JL(),{SocksProxyAgent:TM}=RM(),{LRUCache:v7}=os(),{InvalidProxyProtocolError:R7}=E_(),A7=new v7({max:20}),T7=new Set(TM.protocols),C7=new Set(["https_proxy","http_proxy","proxy","no_proxy"]),Qc=Object.entries(process.env).reduce((i,[e,t])=>(e=e.toLowerCase(),C7.has(e)&&(i[e]=t),i),{}),N7=o(i=>{i=new URL(i);let e=i.protocol.slice(0,-1);if(T7.has(e))return TM;if(e==="https"||e==="http")return[I7,O7];throw new R7(i)},"getProxyAgent"),P7=o((i,e)=>{if(typeof e=="string"&&(e=e.split(",").map(r=>r.trim()).filter(Boolean)),!e||!e.length)return!1;let t=i.hostname.split(".").reverse();return e.some(r=>{let s=r.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"),D7=o((i,{proxy:e,noProxy:t})=>(i=new URL(i),e||(e=i.protocol==="https:"?Qc.https_proxy:Qc.https_proxy||Qc.http_proxy||Qc.proxy),t||(t=Qc.no_proxy),!e||P7(i,t)?null:new URL(e)),"getProxy");CM.exports={getProxyAgent:N7,getProxy:D7,proxyCache:A7}});var DM=d((pEe,PM)=>{"use strict";var x7=require("net"),L7=require("tls"),{once:NM}=require("events"),M7=require("timers/promises"),{normalizeOptions:B7,cacheOptions:k7}=Hw(),{getProxy:F7,getProxyAgent:U7,proxyCache:__}=w_(),gd=E_(),{Agent:j7}=Yc();PM.exports=class extends j7{static{o(this,"Agent")}#e;#t;#i;#r;#s;constructor(e={}){let{timeouts:t,proxy:r,noProxy:s,...n}=B7(e);super(n),this.#e=n,this.#t=t,r&&(this.#i=new URL(r),this.#r=s,this.#s=U7(r))}get proxy(){return this.#i?{url:this.#i}:{}}#u(e){if(!this.#i)return;let t=F7(`${e.protocol}//${e.host}:${e.port}`,{proxy:this.#i,noProxy:this.#r});if(!t)return;let r=k7({...e,...this.#e,timeouts:this.#t,proxy:t});if(__.has(r))return __.get(r);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 __.set(r,n),n}async#c({promises:e,options:t,timeout:r},s=new AbortController){if(r){let a=M7.setTimeout(r,null,{signal:s.signal}).then(()=>{throw new gd.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 r,s=this.#t.connection,n=this.isSecureEndpoint(t),a=this.#u(t);if(a){let h=Date.now();r=await this.#c({options:t,timeout:s,promises:[a.connect(e,t)]}),s&&(s=s-(Date.now()-h))}else r=(n?L7:x7).connect(t);r.setKeepAlive(this.keepAlive,this.keepAliveMsecs),r.setNoDelay(this.keepAlive);let c=new AbortController,{signal:u}=c,l=r[n?"secureConnecting":"connecting"]?NM(r,n?"secureConnect":"connect",{signal:u}):Promise.resolve();return await this.#c({options:t,timeout:s,promises:[l,NM(r,"error",{signal:u}).then(h=>{throw h[0]})]},c),this.#t.idle&&r.setTimeout(this.#t.idle,()=>{r.destroy(new gd.IdleTimeoutError(`${t.host}:${t.port}`))}),r}addRequest(e,t){let r=this.#u(t);if(r?.setRequestProps&&r.setRequestProps(e,t),e.setHeader("connection",this.keepAlive?"keep-alive":"close"),this.#t.response){let s;e.once("finish",()=>{setTimeout(()=>{e.destroy(new gd.ResponseTimeoutError(e,this.#i))},this.#t.response)}),e.once("response",()=>{clearTimeout(s)})}if(this.#t.transfer){let s;e.once("response",n=>{setTimeout(()=>{n.destroy(new gd.TransferTimeoutError(e,this.#i))},this.#t.transfer),n.once("close",()=>{clearTimeout(s)})})}return super.addRequest(e,t)}}});var BM=d((gEe,MM)=>{"use strict";var{LRUCache:$7}=os(),{normalizeOptions:q7,cacheOptions:V7}=Hw(),{getProxy:z7,proxyCache:xM}=w_(),LM=zw(),yd=DM(),eu=new $7({max:20}),H7=o((i,{agent:e,proxy:t,noProxy:r,...s}={})=>{if(e!=null)return e;i=new URL(i);let n=z7(i,{proxy:t,noProxy:r}),a={...q7(s),proxy:n},c=V7({...a,secureEndpoint:i.protocol==="https:"});if(eu.has(c))return eu.get(c);let u=new yd(a);return eu.set(c,u),u},"getAgent");MM.exports={getAgent:H7,Agent:yd,HttpAgent:yd,HttpsAgent:yd,cache:{proxy:xM,agent:eu,dns:LM.cache,clear:o(()=>{xM.clear(),eu.clear(),LM.cache.clear()},"clear")}}});var kM=d((SEe,G7)=>{G7.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 Ed=d((EEe,UM)=>{var{Minipass:W7}=te(),Sd=go(),J7=xa(),K7=ai(),{log:FM}=St(),Z7=Vw(),{getAgent:Y7}=BM(),b_=kM(),X7=`${b_.name}/${b_.version} (+https://npm.im/${b_.name})`,Q7=["ECONNRESET","ECONNREFUSED","EADDRINUSE","ETIMEDOUT","ECONNECTIONTIMEOUT","EIDLETIMEOUT","ERESPONSETIMEOUT","ETRANSFERTIMEOUT"],eee=["request-timeout"],tee=o((i,e)=>{let t=Y7(i.url,{...e,signal:void 0});i.headers.has("connection")||i.headers.set("connection",t?"keep-alive":"close"),i.headers.has("user-agent")||i.headers.set("user-agent",X7);let r={...e,agent:t,redirect:"manual"};return J7(async(s,n)=>{let a=new Sd.Request(i,r);try{let c=await Sd(a,r);if(r.integrity&&c.status===200){let h=K7.integrityStream({algorithms:r.algorithms,integrity:r.integrity,size:r.size}),f=new Z7({events:["integrity","size"]},c.body,h);h.on("integrity",p=>f.emit("integrity",p)),h.on("size",p=>f.emit("size",p)),c=new Sd.Response(f,c),c.body.hasIntegrityEmitter=!0}c.headers.set("x-fetch-attempts",n);let u=W7.isStream(a.body);return a.method!=="POST"&&!u&&([408,420,429].includes(c.status)||c.status>=500)?(typeof e.onRetry=="function"&&e.onRetry(c),FM.http("fetch",`${a.method} ${a.url} attempt ${n} failed with ${c.status}`),s(c)):c}catch(c){let u=c.code==="EPROMISERETRY"?c.retried.code:c.code,l=c.retried instanceof Sd.Response||Q7.includes(u)&&eee.includes(c.type);if(a.method==="POST"||l)throw c;return typeof e.onRetry=="function"&&e.onRetry(c),FM.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");UM.exports=tee});var HM=d((_Ee,zM)=>{var{Request:jM,Response:I_}=go(),{Minipass:$M}=te(),iee=Ih(),zs=dc(),ree=require("url"),see=Vw(),nee=jw(),O_=AL(),oee=Ed(),tu=o((i,e)=>Object.prototype.hasOwnProperty.call(i,e),"hasOwnProperty"),aee=["accept-charset","accept-encoding","accept-language","accept","cache-control"],VM=["cache-control","content-encoding","content-language","content-type","date","etag","expires","last-modified","link","location","pragma","vary"],qM=o((i,e,t)=>{let r={time:Date.now(),url:i.url,reqHeaders:{},resHeaders:{},options:{compress:t.compress!=null?t.compress:i.compress}};e.status!==200&&e.status!==304&&(r.status=e.status);for(let a of aee)i.headers.has(a)&&(r.reqHeaders[a]=i.headers.get(a));let s=i.headers.get("host"),n=new ree.URL(i.url);if(s&&n.host!==s&&(r.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 u of c)i.headers.has(u)&&(r.reqHeaders[u]=i.headers.get(u))}}for(let a of VM)e.headers.has(a)&&(r.resHeaders[a]=e.headers.get(a));for(let a of t.cacheAdditionalHeaders)e.headers.has(a)&&(r.resHeaders[a]=e.headers.get(a));return r},"getMetadata"),wd=Symbol("request"),_d=Symbol("response"),bd=Symbol("policy"),v_=class i{static{o(this,"CacheEntry")}constructor({entry:e,request:t,response:r,options:s}){e?(this.key=e.key,this.entry=e,this.entry.metadata.time=this.entry.metadata.time||this.entry.time):this.key=O_(t),this.options=s,this[wd]=t,this[_d]=r,this[bd]=null}static async find(e,t){try{var r=await zs.index.compact(t.cachePath,O_(e),(n,a)=>{let c=new i({entry:n,options:t}),u=new i({entry:a,options:t});return c.policy.satisfies(u.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 r){let a=new i({entry:n,options:t});if(a.policy.satisfies(e)){s=a;break}}return s}static async invalidate(e,t){let r=O_(e);try{await zs.rm.entry(t.cachePath,r,{removeFully:!0})}catch{}}get request(){return this[wd]||(this[wd]=new jM(this.entry.metadata.url,{method:"GET",headers:this.entry.metadata.reqHeaders,...this.entry.metadata.options})),this[wd]}get response(){return this[_d]||(this[_d]=new I_(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[_d]}get policy(){return this[bd]||(this[bd]=new nee({entry:this.entry,request:this.request,response:this.response,options:this.options})),this[bd]}async store(e){if(this.request.method!=="GET"||![200,301,308].includes(this.response.status)||!this.policy.storable())return this.response.headers.set("x-local-cache-status","skip"),this.response;let t=this.response.headers.get("content-length"),r={algorithms:this.options.algorithms,metadata:qM(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,u=new Promise((h,f)=>{a=h,c=f}).catch(h=>{s.emit("error",h)});s=new see({events:["integrity","size"]},new iee({flush(){return u}})),s.hasIntegrityEmitter=!0;let l=o(()=>{let h=new $M,f=zs.put.stream(this.options.cachePath,this.key,r);f.on("integrity",p=>s.emit("integrity",p)),f.on("size",p=>s.emit("size",p)),h.pipe(f),f.promise().then(a,c),s.unshift(h),s.unshift(this.response.body)},"onResume");s.once("resume",l),s.once("end",()=>s.removeListener("resume",l))}else await zs.index.insert(this.options.cachePath,this.key,null,r);return this.response.headers.set("x-local-cache",encodeURIComponent(this.options.cachePath)),this.response.headers.set("x-local-cache-key",encodeURIComponent(this.key)),this.response.headers.set("x-local-cache-mode","stream"),this.response.headers.set("x-local-cache-status",e),this.response.headers.set("x-local-cache-time",new Date().toISOString()),new I_(s,{url:this.response.url,status:this.response.status,headers:this.response.headers,counter:this.options.counter})}async respond(e,t,r){let s;if(e==="HEAD"||[301,308].includes(this.response.status))s=this.response;else{let n=new $M,a={...this.policy.responseHeaders()},c=o(()=>{let u=zs.get.stream.byDigest(this.options.cachePath,this.entry.integrity,{memoize:this.options.memoize});u.on("error",async l=>{u.pause(),l.code==="EINTEGRITY"&&await zs.rm.content(this.options.cachePath,this.entry.integrity,{memoize:this.options.memoize}),(l.code==="ENOENT"||l.code==="EINTEGRITY")&&await i.invalidate(this.request,this.options),n.emit("error",l),u.resume()}),n.emit("integrity",this.entry.integrity),n.emit("size",Number(a["content-length"])),u.pipe(n)},"onResume");n.once("resume",c),n.once("end",()=>n.removeListener("resume",c)),s=new I_(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",r),s.headers.set("x-local-cache-time",new Date(this.entry.metadata.time).toUTCString()),s}async revalidate(e,t){let r=new jM(e,{headers:this.policy.revalidationHeaders(e)});try{var s=await oee(r,{...t,headers:void 0})}catch(a){if(!this.policy.mustRevalidate)return this.respond(e.method,t,"stale");throw a}if(this.policy.revalidated(r,s)){let a=qM(e,s,t);for(let c of VM)!tu(a.resHeaders,c)&&tu(this.entry.metadata.resHeaders,c)&&(a.resHeaders[c]=this.entry.metadata.resHeaders[c]);for(let c of t.cacheAdditionalHeaders){let u=tu(a.resHeaders,c),l=tu(this.entry.metadata.resHeaders,c),h=tu(this.policy.response.headers,c);!u&&l&&(a.resHeaders[c]=this.entry.metadata.resHeaders[c]),!h&&u&&(this.policy.response.headers[c]=a.resHeaders[c])}try{await zs.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 i({request:e,response:s,options:t}).store("updated")}};zM.exports=v_});var JM=d((IEe,WM)=>{var{NotCachedError:cee}=OL(),R_=HM(),uee=Ed(),GM=o(async(i,e)=>{let t=await R_.find(i,e);if(!t){if(e.cache==="only-if-cached")throw new cee(i.url);let s=await uee(i,e);return new R_({request:i,response:s,options:e}).store("miss")}if(e.cache==="no-cache")return t.revalidate(i,e);let r=t.policy.needsRevalidation(i);return e.cache==="force-cache"||e.cache==="only-if-cached"||!r?t.respond(i.method,e,r?"stale":"hit"):t.revalidate(i,e)},"cacheFetch");GM.invalidate=async(i,e)=>{if(e.cachePath)return R_.invalidate(i,e)};WM.exports=GM});var XM=d((vEe,YM)=>{"use strict";var{FetchError:A_,Request:lee,isRedirect:hee}=go(),T_=require("url"),fee=jw(),KM=JM(),dee=Ed(),pee=o((i,e,t)=>{if(!hee(e.status)||t.redirect==="manual")return!1;if(t.redirect==="error")throw new A_(`redirect mode is set to error: ${i.url}`,"no-redirect",{code:"ENOREDIRECT"});if(!e.headers.has("location"))throw new A_(`redirect location header missing for: ${i.url}`,"no-location",{code:"EINVALIDREDIRECT"});if(i.counter>=i.follow)throw new A_(`maximum redirect reached at: ${i.url}`,"max-redirect",{code:"EMAXREDIRECT"});return!0},"canFollowRedirect"),mee=o((i,e,t)=>{let r={...t},s=e.headers.get("location"),n=new T_.URL(s,/^https?:/.test(s)?void 0:i.url);return new T_.URL(i.url).hostname!==n.hostname&&(i.headers.delete("authorization"),i.headers.delete("cookie")),(e.status===303||i.method==="POST"&&[301,302].includes(e.status))&&(r.method="GET",r.body=null,i.headers.delete("content-length")),r.headers={},i.headers.forEach((c,u)=>{r.headers[u]=c}),r.counter=++i.counter,{request:new lee(T_.format(n),r),options:r}},"getRedirect"),ZM=o(async(i,e)=>{let t=fee.storable(i,e)?await KM(i,e):await dee(i,e);if(!["GET","HEAD"].includes(i.method)&&t.status>=200&&t.status<=399&&await KM.invalidate(i,e),!pee(i,t,e))return t;let r=mee(i,t,e);return ZM(r.request,r.options)},"fetch");YM.exports=ZM});var iu=d((AEe,Ao)=>{var{FetchError:gee,Headers:yee,Request:QM,Response:See}=go(),Eee=Kx(),wee=XM(),Id=o((i,e)=>{let t=Eee(e),r=new QM(i,t);return wee(r,t)},"makeFetchHappen");Id.defaults=(i,e={},t=Id)=>{typeof i=="object"&&(e=i,i=null);let r=o((s,n={})=>{let a=s||i,c={...e,...n,headers:{...e.headers,...n.headers}};return t(a,c)},"defaultedFetch");return r.defaults=(s,n={})=>Id.defaults(s,n,r),r};Ao.exports=Id;Ao.exports.FetchError=gee;Ao.exports.Headers=yee;Ao.exports.Request=QM;Ao.exports.Response=See});var bB=d((CEe,_B)=>{var j={},pB=j.LEFT_BRACE=1,Rd=j.RIGHT_BRACE=2,mB=j.LEFT_BRACKET=3,P_=j.RIGHT_BRACKET=4,Ad=j.COLON=5,Td=j.COMMA=6,gB=j.TRUE=7,yB=j.FALSE=8,SB=j.NULL=9,Cd=j.STRING=10,EB=j.NUMBER=11,Hs=j.START=17,wB=j.STOP=18,eB=j.TRUE1=33,tB=j.TRUE2=34,iB=j.TRUE3=35,rB=j.FALSE1=49,sB=j.FALSE2=50,nB=j.FALSE3=51,oB=j.FALSE4=52,aB=j.NULL1=65,cB=j.NULL2=66,uB=j.NULL3=67,lB=j.NUMBER1=81,C_=j.NUMBER3=83,Qt=j.STRING1=97,hB=j.STRING2=98,fB=j.STRING3=99,_ee=j.STRING4=100,bee=j.STRING5=101,dB=j.STRING6=102,To=j.VALUE=113,N_=j.KEY=114,Od=j.OBJECT=129,vd=j.ARRAY=130,Iee=92,Oee=47,vee=8,Ree=12,Aee=10,Tee=13,Cee=9,Nd=64*1024;function Ur(){this.tState=Hs,this.value=void 0,this.string=void 0,this.stringBuffer=Buffer.alloc?Buffer.alloc(Nd):new Buffer(Nd),this.stringBufferOffset=0,this.unicode=void 0,this.highSurrogate=void 0,this.key=void 0,this.mode=void 0,this.stack=[],this.state=To,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(Ur,"Parser");Ur.toknam=function(i){for(var e=Object.keys(j),t=0,r=e.length;t<r;t++){var s=e[t];if(j[s]===i)return s}return i&&"0x"+i.toString(16)};var Lt=Ur.prototype;Lt.onError=function(i){throw i};Lt.charError=function(i,e){this.tState=wB,this.onError(new Error("Unexpected "+JSON.stringify(String.fromCharCode(i[e]))+" at position "+e+" in state "+Ur.toknam(this.tState)))};Lt.appendStringChar=function(i){this.stringBufferOffset>=Nd&&(this.string+=this.stringBuffer.toString("utf8"),this.stringBufferOffset=0),this.stringBuffer[this.stringBufferOffset++]=i};Lt.appendStringBuf=function(i,e,t){var r=i.length;typeof e=="number"&&(typeof t=="number"?t<0?r=i.length-e+t:r=t-e:r=i.length-e),r<0&&(r=0),this.stringBufferOffset+r>Nd&&(this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0),i.copy(this.stringBuffer,this.stringBufferOffset,e,t),this.stringBufferOffset+=r};Lt.write=function(i){typeof i=="string"&&(i=new Buffer(i));for(var e,t=0,r=i.length;t<r;t++)if(this.tState===Hs){if(e=i[t],this.offset++,e===123)this.onToken(pB,"{");else if(e===125)this.onToken(Rd,"}");else if(e===91)this.onToken(mB,"[");else if(e===93)this.onToken(P_,"]");else if(e===58)this.onToken(Ad,":");else if(e===44)this.onToken(Td,",");else if(e===116)this.tState=eB;else if(e===102)this.tState=rB;else if(e===110)this.tState=aB;else if(e===34)this.string="",this.stringBufferOffset=0,this.tState=Qt;else if(e===45)this.string="-",this.tState=lB;else if(e>=48&&e<64)this.string=String.fromCharCode(e),this.tState=C_;else if(!(e===32||e===9||e===10||e===13))return this.charError(i,t)}else if(this.tState===Qt)if(e=i[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]=i[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 "+Ur.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>i.length){for(var n=0;n<=i.length-1-t;n++)this.temp_buffs[this.bytes_in_sequence][n]=i[t+n];this.bytes_remaining=t+this.bytes_in_sequence-i.length,t=i.length-1}else this.appendStringBuf(i,t,t+this.bytes_in_sequence),t=t+this.bytes_in_sequence-1}else if(e===34)this.tState=Hs,this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0,this.onToken(Cd,this.string),this.offset+=Buffer.byteLength(this.string,"utf8")+1,this.string=void 0;else if(e===92)this.tState=hB;else if(e>=32)this.appendStringChar(e);else return this.charError(i,t);else if(this.tState===hB)if(e=i[t],e===34)this.appendStringChar(e),this.tState=Qt;else if(e===92)this.appendStringChar(Iee),this.tState=Qt;else if(e===47)this.appendStringChar(Oee),this.tState=Qt;else if(e===98)this.appendStringChar(vee),this.tState=Qt;else if(e===102)this.appendStringChar(Ree),this.tState=Qt;else if(e===110)this.appendStringChar(Aee),this.tState=Qt;else if(e===114)this.appendStringChar(Tee),this.tState=Qt;else if(e===116)this.appendStringChar(Cee),this.tState=Qt;else if(e===117)this.unicode="",this.tState=fB;else return this.charError(i,t);else if(this.tState===fB||this.tState===_ee||this.tState===bee||this.tState===dB)if(e=i[t],e>=48&&e<64||e>64&&e<=70||e>96&&e<=102){if(this.unicode+=String.fromCharCode(e),this.tState++===dB){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=Qt}}else return this.charError(i,t);else if(this.tState===lB||this.tState===C_)switch(e=i[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=C_;break;default:this.tState=Hs;var c=Number(this.string);if(isNaN(c))return this.charError(i,t);this.string.match(/[0-9]+/)==this.string&&c.toString()!=this.string?this.onToken(Cd,this.string):this.onToken(EB,c),this.offset+=this.string.length-1,this.string=void 0,t--;break}else if(this.tState===eB)if(i[t]===114)this.tState=tB;else return this.charError(i,t);else if(this.tState===tB)if(i[t]===117)this.tState=iB;else return this.charError(i,t);else if(this.tState===iB)if(i[t]===101)this.tState=Hs,this.onToken(gB,!0),this.offset+=3;else return this.charError(i,t);else if(this.tState===rB)if(i[t]===97)this.tState=sB;else return this.charError(i,t);else if(this.tState===sB)if(i[t]===108)this.tState=nB;else return this.charError(i,t);else if(this.tState===nB)if(i[t]===115)this.tState=oB;else return this.charError(i,t);else if(this.tState===oB)if(i[t]===101)this.tState=Hs,this.onToken(yB,!1),this.offset+=4;else return this.charError(i,t);else if(this.tState===aB)if(i[t]===117)this.tState=cB;else return this.charError(i,t);else if(this.tState===cB)if(i[t]===108)this.tState=uB;else return this.charError(i,t);else if(this.tState===uB)if(i[t]===108)this.tState=Hs,this.onToken(SB,null),this.offset+=3;else return this.charError(i,t)};Lt.onToken=function(i,e){};Lt.parseError=function(i,e){this.tState=wB,this.onError(new Error("Unexpected "+Ur.toknam(i)+(e?"("+JSON.stringify(e)+")":"")+" in state "+Ur.toknam(this.state)))};Lt.push=function(){this.stack.push({value:this.value,key:this.key,mode:this.mode})};Lt.pop=function(){var i=this.value,e=this.stack.pop();this.value=e.value,this.key=e.key,this.mode=e.mode,this.emit(i),this.mode||(this.state=To)};Lt.emit=function(i){this.mode&&(this.state=Td),this.onValue(i)};Lt.onValue=function(i){};Lt.onToken=function(i,e){if(this.state===To)if(i===Cd||i===EB||i===gB||i===yB||i===SB)this.value&&(this.value[this.key]=e),this.emit(e);else if(i===pB)this.push(),this.value?this.value=this.value[this.key]={}:this.value={},this.key=void 0,this.state=N_,this.mode=Od;else if(i===mB)this.push(),this.value?this.value=this.value[this.key]=[]:this.value=[],this.key=0,this.mode=vd,this.state=To;else if(i===Rd)if(this.mode===Od)this.pop();else return this.parseError(i,e);else if(i===P_)if(this.mode===vd)this.pop();else return this.parseError(i,e);else return this.parseError(i,e);else if(this.state===N_)if(i===Cd)this.key=e,this.state=Ad;else if(i===Rd)this.pop();else return this.parseError(i,e);else if(this.state===Ad)if(i===Ad)this.state=To;else return this.parseError(i,e);else if(this.state===Td)if(i===Td)this.mode===vd?(this.key++,this.state=To):this.mode===Od&&(this.state=N_);else if(i===P_&&this.mode===vd||i===Rd&&this.mode===Od)this.pop();else return this.parseError(i,e);else return this.parseError(i,e)};Ur.C=j;_B.exports=Ur});var vB=d((PEe,OB)=>{var Nee=bB(),{Minipass:Pee}=te(),Pd=class extends Error{static{o(this,"JSONStreamError")}constructor(e,t){super(e.message),Error.captureStackTrace(this,t||this.constructor)}get name(){return"JSONStreamError"}},IB=o((i,e)=>typeof i=="string"?String(e)===i:i&&typeof i.test=="function"?i.test(e):typeof i=="boolean"||typeof i=="object"?i:typeof i=="function"?i(e):!1,"check"),D_=class i extends Pee{static{o(this,"JSONStream")}#e=0;#t=!1;#i=null;#r=null;#s=null;#u;#c;#f=null;#n=null;constructor(e){super({...e,objectMode:!0});let t=this.#c=new Nee;t.onValue=r=>this.#a(r),this.#u=t.onToken,t.onToken=(r,s)=>this.#d(r,s),t.onError=r=>this.#o(r),this.#f=typeof e.path=="string"?e.path.split(".").map(r=>r==="$*"?{emitKey:!0}:r==="*"?!0:r===""?{recurse:!0}:r):Array.isArray(e.path)&&e.path.length?e.path:null,typeof e.map=="function"&&(this.#s=e.map)}#h(e,t){this.#r!==!1&&(this.#r=this.#r||{},this.#r[e]=t),this.#i!==!1&&this.#r===!1&&(this.#i=this.#i||{},this.#i[e]=t)}#o(e){let t=this.#t?this.end:this.write;return this.#t=!1,this.emit("error",new Pd(e,t))}#d(e,t){let r=this.#c;if(this.#u.call(this.#c,e,t),r.stack.length===0&&this.#n){let s=this.#n;this.#f||super.write(s),this.#n=null,this.#e=0}}#a(e){let t=this.#c;if(this.#n=e,!this.#f)return;let r=0,s=0,n=!1;for(;r<this.#f.length;){let c=this.#f[r];if(s++,c&&!c.recurse){let u=s===t.stack.length?t:t.stack[s];if(!u)return;if(!IB(c,u.key)){this.#h(u.key,e);return}n=!!c.emitKey,r++}else{if(r++,r>=this.#f.length)return;let u=this.#f[r];if(!u)return;for(;;){let l=s===t.stack.length?t:t.stack[s];if(!l)return;if(IB(u,l.key)){r++,Object.isFrozen(t.stack[s])||(t.stack[s].value=null);break}else this.#h(l.key,e);s++}}}if(this.#r){let c=this.#r;this.#r=!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 u=n?{value:c}:c;n&&(u.key=t.key),super.write(u)}}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.#c.write(e),this.flowing}end(e,t){this.#t=!0,e&&this.write(e,t);let r=this.#r;this.#r=null;let s=this.#i;return this.#i=null,r&&this.emit("header",r),s&&this.emit("footer",s),super.end()}static get JSONStreamError(){return Pd}static parse(e,t){return new i({path:e,map:t})}};OB.exports=D_});var x_=d((xEe,Co)=>{"use strict";var{HttpErrorAuthOTP:Dee}=dw(),xee=qx(),AB=Wx(),Lee=iu(),Mee=vB(),Bee=Un(),kee=require("querystring"),Dd=require("url"),RB=vc(),{Minipass:Fee}=te(),xd=Aw(),Uee=o(i=>{try{return!!new Dd.URL(i)}catch{return!1}},"urlIsValid");Co.exports=Ld;function Ld(i,e={}){let t={...xd,...e},r=Uee(i),s=t.registry||xd.registry;r||(s=t.registry=t.spec&&TB(t.spec,t)||t.registry||s,i=`${s.trim().replace(/\/?$/g,"")}/${i.trim().replace(/^\//,"")}`,new Dd.URL(i));let n=t.method||"GET",a=Date.now(),c=AB(i,t),u=Vee(i,c,t),l=t.body,h=Fee.isStream(l),f=l&&typeof l=="object"&&typeof l.then=="function";if(l&&!h&&!f&&typeof l!="string"&&!Buffer.isBuffer(l)?(u["content-type"]=u["content-type"]||"application/json",l=JSON.stringify(l)):l&&!u["content-type"]&&(u["content-type"]="application/octet-stream"),t.gzip)if(u["content-encoding"]="gzip",h){let y=new RB.Gzip;l.on("error",g=>y.emit("error",g)),l=l.pipe(y)}else f||(l=new RB.Gzip().end(l).concat());let p=new Dd.URL(i);if(t.query){let y=typeof t.query=="string"?kee.parse(t.query):t.query;Object.keys(y).forEach(g=>{y[g]!==void 0&&p.searchParams.set(g,y[g])}),i=Dd.format(p)}p.searchParams.get("write")==="true"&&n==="GET"&&(t.offline=!1,t.preferOffline=!1,t.preferOnline=!0);let m=o(async y=>{let g=Lee(i,{agent:t.agent,algorithms:t.algorithms,body:y,cache:qee(t),cachePath:t.cache,ca:t.ca,cert:c.cert||t.cert,headers:u,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(S=>xee({method:n,uri:i,res:S,registry:s,startTime:a,auth:c,opts:t}));return typeof t.otpPrompt=="function"?g.catch(async S=>{if(S instanceof Dee){let E;try{E=await t.otpPrompt()}catch{}if(!E)throw S;return Ld(i,{...t,otp:E})}throw S}):g},"doFetch");return Promise.resolve(l).then(m)}o(Ld,"regFetch");Co.exports.getAuth=AB;Co.exports.json=jee;function jee(i,e){return Ld(i,e).then(t=>t.json())}o(jee,"fetchJSON");Co.exports.json.stream=$ee;function $ee(i,e,t={}){let r={...xd,...t},s=Mee.parse(e,r.mapJSON);return Ld(i,r).then(n=>n.body.on("error",a=>s.emit("error",a)).pipe(s)).catch(n=>s.emit("error",n)),s}o($ee,"fetchJSONStream");Co.exports.pickRegistry=TB;function TB(i,e={}){i=Bee(i);let t=i.scope&&e[i.scope.replace(/^@?/,"@")+":registry"];return!t&&e.scope&&(t=e[e.scope.replace(/^@?/,"@")+":registry"]),t||(t=e.registry||xd.registry),t}o(TB,"pickRegistry");function qee(i){return i.offline?"only-if-cached":i.preferOffline?"force-cache":i.preferOnline?"no-cache":"default"}o(qee,"getCacheMode");function Vee(i,e,t){let r=Object.assign({"user-agent":t.userAgent},t.headers||{});return t.authType&&(r["npm-auth-type"]=t.authType),t.scope&&(r["npm-scope"]=t.scope),t.npmSession&&(r["npm-session"]=t.npmSession),t.npmCommand&&(r["npm-command"]=t.npmCommand),e.token?r.authorization=`Bearer ${e.token}`:e.auth&&(r.authorization=`Basic ${e.auth}`),t.otp&&(r["npm-otp"]=t.otp),r}o(Vee,"getHeaders")});var L_=d((MEe,zee)=>{zee.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 ru=d((BEe,DB)=>{var Hee=x_(),{Minipass:Gee}=te(),Wee=xs(),CB=fo(),NB=Ds(),PB=L_().version,M_=class extends Wee{static{o(this,"RemoteFetcher")}constructor(e,t){super(e,t),this.resolved=this.spec.fetchSpec;let r=new URL(this.resolved);this.replaceRegistryHost!=="never"&&(this.replaceRegistryHost==="always"||this.replaceRegistryHost===r.host)&&(this.resolved=new URL(r.pathname,this.registry).href);let s=this.spec.name?`${this.spec.name}@`:"";this.pkgid=t.pkgid?t.pkgid:`remote:${s}${this.resolved}`}get[NB.cacheFetches](){return!1}[NB.tarballFromResolved](){let e=new Gee;e.hasIntegrityEmitter=!0;let t={...this.opts,headers:this.#e(),spec:this.spec,integrity:this.integrity,algorithms:[this.pickIntegrityAlgorithm()]};return Hee(this.resolved,t).then(r=>{r.body.on("error",s=>e.emit("error",s)),r.body.on("integrity",s=>{this.integrity=s,e.emit("integrity",s)}),r.body.pipe(e)}).catch(r=>e.emit("error",r)),e}#e(){return{"user-agent":this.opts.userAgent||`pacote/${PB} node/${process.version}`,...this.opts.headers||{},"pacote-version":PB,"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 CB.prototype.packument.apply(this)}manifest(){return CB.prototype.manifest.apply(this)}};DB.exports=M_});var LB=d((FEe,xB)=>{var Jee=o((i,e)=>{if(i.hosted){let t=i.hosted,r={noCommittish:!0};return`${t.https&&t.auth?t.https(r):t.shortcut(r)}#${e}`}else return i.rawSpec.replace(/#.*$/,"")+`#${e}`},"addGitSha");xB.exports=Jee});var BB=d((jEe,MB)=>{var Kee=Dl();MB.exports=(i,e,t,r,s)=>{let n=i.endsWith(".js"),a=n?process.execPath:i,c=(n?[i]:[]).concat(e);return Kee(a,c,{cwd:t,env:r},s)}});var k_=d(($Ee,jB)=>{var Zee=dc(),Md=uy(),Yee=Un(),Xee=Jl(),{Minipass:Qee}=te(),{log:kB}=St(),ete=$f(),tte=xs(),FB=fo(),ite=ru(),Bd=Ds(),rte=LB(),ste=BB(),nte=/^[a-f0-9]{40}$/,kd=o((i,e)=>i.sshurl&&!(i.https&&i.auth)&&UB(i.sshurl(e))||i.https&&UB(i.https(e)),"repoUrl"),UB=o(i=>i&&`git+${i}`.replace(/^(git\+)+/,"git+"),"addGitPlus"),B_=class extends tte{static{o(this,"GitFetcher")}constructor(e,t){super(e,t),this.opts.integrity&&(delete this.opts.integrity,kB.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&&nte.test(this.spec.gitCommittish)?(this.resolvedSha=this.spec.gitCommittish,this.resolved=this.spec.hosted?kd(this.spec.hosted,{noCommittish:!1}):this.spec.rawSpec):this.resolvedSha="",this.Arborist=t.Arborist||null}static repoUrl(e,t){return kd(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 Md.errors.GitPathspecError)throw t;let r=e.sshurl&&e.sshurl();if(!r||e.auth)throw t;return this.#t(r)})}#t(e){if(!e)return Promise.reject(new Error(`No git url for ${this.spec}`));let t=this.spec.gitRange,r=this.spec.name;return Md.revs(e,this.opts).then(s=>t?Xee({versions:s.versions,"dist-tags":s["dist-tags"],name:r},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.#r(s.sha),this.resolved))}#i(e){this.resolved=this.spec.hosted?kd(Yee(e).hosted,{noCommittish:!1}):e}#r(e){this.#i(rte(this.spec,e))}#s(){return this.#c(()=>this.resolved)}#u(e){return this[Bd.readPackageJson](e).then(t=>{let r=t.scripts;if(!t.workspaces&&(!r||!(r.postinstall||r.build||r.preinstall||r.install||r.prepack||r.prepare)))return;let s=process.env._PACOTE_NO_PREPARE_?process.env._PACOTE_NO_PREPARE_.split(`
54
+ `):[];if(s.includes(this.resolved)){kB.info("prepare","skip prepare, already seen",this.resolved);return}return s.push(this.resolved),ste(this.npmBin,[].concat(this.npmInstallCmd).concat(this.npmCliConfig),e,{...process.env,_PACOTE_NO_PREPARE_:s.join(`
55
+ `)},{message:"git dep preparation failed"})})}[Bd.tarballFromResolved](){let e=new Qee;return e.resolved=this.resolved,e.from=this.from,this.#c(t=>this.#u(t).then(()=>new Promise((r,s)=>{if(!this.Arborist)throw new Error("GitFetcher requires an Arborist constructor to pack a tarball");let a=new ete(`file:${t}`,{...this.opts,Arborist:this.Arborist,resolved:null,integrity:null})[Bd.tarballFromResolved]();a.on("error",s),a.on("end",r),a.pipe(e)}))).catch(t=>e.emit("error",t)),e}#c(e,t=!0){let r={tmpPrefix:"git-clone"},s=this.resolvedSha||this.spec.gitCommittish,n=this.spec.hosted,a=this.resolved;return t=t&&n&&a===kd(n,{noCommittish:!1})&&n.tarball,Zee.tmp.withTmp(this.cache,r,async c=>{if(t){let l=this.spec.name?`${this.spec.name}@`:"";return new ite(n.tarball({noCommittish:!1}),{...this.opts,allowGitIgnore:!0,pkgid:`git:${l}${this.resolved}`,resolved:this.resolved,integrity:null}).extract(c).then(()=>e(c),h=>{if(h.constructor.name.match(/^Http/))return this.#c(e,!1);throw h})}let u=await(n?this.#f(s,c):this.#n(this.spec.fetchSpec,s,c));return this.resolvedSha=u,this.resolved||await this.#r(u),e(c)})}#f(e,t){let r=this.spec.hosted;return this.#n(r.https({noCommittish:!0}),e,t).catch(s=>{if(s instanceof Md.errors.GitPathspecError)throw s;let n=r.sshurl&&r.sshurl({noCommittish:!0});if(!n||r.auth)throw s;return this.#n(n,e,t)})}#n(e,t,r){let{opts:s,spec:n}=this;return Md.clone(e,t,r,{...s,spec:n})}manifest(){return this.package?Promise.resolve(this.package):this.spec.hosted&&this.resolved?FB.prototype.manifest.apply(this):this.#c(e=>this[Bd.readPackageJson](e).then(t=>this.package={...t,_resolved:this.resolved,_from:this.from}))}packument(){return FB.prototype.packument.apply(this)}};jB.exports=B_});var F_=d(jr=>{"use strict";Object.defineProperty(jr,"__esModule",{value:!0});jr.Signature=jr.Envelope=void 0;jr.Envelope={fromJSON(i){return{payload:Fd(i.payload)?Buffer.from($B(i.payload)):Buffer.alloc(0),payloadType:Fd(i.payloadType)?globalThis.String(i.payloadType):"",signatures:globalThis.Array.isArray(i?.signatures)?i.signatures.map(e=>jr.Signature.fromJSON(e)):[]}},toJSON(i){let e={};return i.payload.length!==0&&(e.payload=qB(i.payload)),i.payloadType!==""&&(e.payloadType=i.payloadType),i.signatures?.length&&(e.signatures=i.signatures.map(t=>jr.Signature.toJSON(t))),e}};jr.Signature={fromJSON(i){return{sig:Fd(i.sig)?Buffer.from($B(i.sig)):Buffer.alloc(0),keyid:Fd(i.keyid)?globalThis.String(i.keyid):""}},toJSON(i){let e={};return i.sig.length!==0&&(e.sig=qB(i.sig)),i.keyid!==""&&(e.keyid=i.keyid),e}};function $B(i){return Uint8Array.from(globalThis.Buffer.from(i,"base64"))}o($B,"bytesFromBase64");function qB(i){return globalThis.Buffer.from(i).toString("base64")}o(qB,"base64FromBytes");function Fd(i){return i!=null}o(Fd,"isSet")});var zB=d(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});Ud.Timestamp=void 0;Ud.Timestamp={fromJSON(i){return{seconds:VB(i.seconds)?globalThis.String(i.seconds):"0",nanos:VB(i.nanos)?globalThis.Number(i.nanos):0}},toJSON(i){let e={};return i.seconds!=="0"&&(e.seconds=i.seconds),i.nanos!==0&&(e.nanos=Math.round(i.nanos)),e}};function VB(i){return i!=null}o(VB,"isSet")});var No=d(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.TimeRange=x.X509CertificateChain=x.SubjectAlternativeName=x.X509Certificate=x.DistinguishedName=x.ObjectIdentifierValuePair=x.ObjectIdentifier=x.PublicKeyIdentifier=x.PublicKey=x.RFC3161SignedTimestamp=x.LogId=x.MessageSignature=x.HashOutput=x.SubjectAlternativeNameType=x.PublicKeyDetails=x.HashAlgorithm=void 0;x.hashAlgorithmFromJSON=GB;x.hashAlgorithmToJSON=WB;x.publicKeyDetailsFromJSON=JB;x.publicKeyDetailsToJSON=KB;x.subjectAlternativeNameTypeFromJSON=ZB;x.subjectAlternativeNameTypeToJSON=YB;var ote=zB(),st;(function(i){i[i.HASH_ALGORITHM_UNSPECIFIED=0]="HASH_ALGORITHM_UNSPECIFIED",i[i.SHA2_256=1]="SHA2_256",i[i.SHA2_384=2]="SHA2_384",i[i.SHA2_512=3]="SHA2_512",i[i.SHA3_256=4]="SHA3_256",i[i.SHA3_384=5]="SHA3_384"})(st||(x.HashAlgorithm=st={}));function GB(i){switch(i){case 0:case"HASH_ALGORITHM_UNSPECIFIED":return st.HASH_ALGORITHM_UNSPECIFIED;case 1:case"SHA2_256":return st.SHA2_256;case 2:case"SHA2_384":return st.SHA2_384;case 3:case"SHA2_512":return st.SHA2_512;case 4:case"SHA3_256":return st.SHA3_256;case 5:case"SHA3_384":return st.SHA3_384;default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum HashAlgorithm")}}o(GB,"hashAlgorithmFromJSON");function WB(i){switch(i){case st.HASH_ALGORITHM_UNSPECIFIED:return"HASH_ALGORITHM_UNSPECIFIED";case st.SHA2_256:return"SHA2_256";case st.SHA2_384:return"SHA2_384";case st.SHA2_512:return"SHA2_512";case st.SHA3_256:return"SHA3_256";case st.SHA3_384:return"SHA3_384";default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum HashAlgorithm")}}o(WB,"hashAlgorithmToJSON");var D;(function(i){i[i.PUBLIC_KEY_DETAILS_UNSPECIFIED=0]="PUBLIC_KEY_DETAILS_UNSPECIFIED",i[i.PKCS1_RSA_PKCS1V5=1]="PKCS1_RSA_PKCS1V5",i[i.PKCS1_RSA_PSS=2]="PKCS1_RSA_PSS",i[i.PKIX_RSA_PKCS1V5=3]="PKIX_RSA_PKCS1V5",i[i.PKIX_RSA_PSS=4]="PKIX_RSA_PSS",i[i.PKIX_RSA_PKCS1V15_2048_SHA256=9]="PKIX_RSA_PKCS1V15_2048_SHA256",i[i.PKIX_RSA_PKCS1V15_3072_SHA256=10]="PKIX_RSA_PKCS1V15_3072_SHA256",i[i.PKIX_RSA_PKCS1V15_4096_SHA256=11]="PKIX_RSA_PKCS1V15_4096_SHA256",i[i.PKIX_RSA_PSS_2048_SHA256=16]="PKIX_RSA_PSS_2048_SHA256",i[i.PKIX_RSA_PSS_3072_SHA256=17]="PKIX_RSA_PSS_3072_SHA256",i[i.PKIX_RSA_PSS_4096_SHA256=18]="PKIX_RSA_PSS_4096_SHA256",i[i.PKIX_ECDSA_P256_HMAC_SHA_256=6]="PKIX_ECDSA_P256_HMAC_SHA_256",i[i.PKIX_ECDSA_P256_SHA_256=5]="PKIX_ECDSA_P256_SHA_256",i[i.PKIX_ECDSA_P384_SHA_384=12]="PKIX_ECDSA_P384_SHA_384",i[i.PKIX_ECDSA_P521_SHA_512=13]="PKIX_ECDSA_P521_SHA_512",i[i.PKIX_ED25519=7]="PKIX_ED25519",i[i.PKIX_ED25519_PH=8]="PKIX_ED25519_PH",i[i.PKIX_ECDSA_P384_SHA_256=19]="PKIX_ECDSA_P384_SHA_256",i[i.PKIX_ECDSA_P521_SHA_256=20]="PKIX_ECDSA_P521_SHA_256",i[i.LMS_SHA256=14]="LMS_SHA256",i[i.LMOTS_SHA256=15]="LMOTS_SHA256",i[i.ML_DSA_65=21]="ML_DSA_65",i[i.ML_DSA_87=22]="ML_DSA_87"})(D||(x.PublicKeyDetails=D={}));function JB(i){switch(i){case 0:case"PUBLIC_KEY_DETAILS_UNSPECIFIED":return D.PUBLIC_KEY_DETAILS_UNSPECIFIED;case 1:case"PKCS1_RSA_PKCS1V5":return D.PKCS1_RSA_PKCS1V5;case 2:case"PKCS1_RSA_PSS":return D.PKCS1_RSA_PSS;case 3:case"PKIX_RSA_PKCS1V5":return D.PKIX_RSA_PKCS1V5;case 4:case"PKIX_RSA_PSS":return D.PKIX_RSA_PSS;case 9:case"PKIX_RSA_PKCS1V15_2048_SHA256":return D.PKIX_RSA_PKCS1V15_2048_SHA256;case 10:case"PKIX_RSA_PKCS1V15_3072_SHA256":return D.PKIX_RSA_PKCS1V15_3072_SHA256;case 11:case"PKIX_RSA_PKCS1V15_4096_SHA256":return D.PKIX_RSA_PKCS1V15_4096_SHA256;case 16:case"PKIX_RSA_PSS_2048_SHA256":return D.PKIX_RSA_PSS_2048_SHA256;case 17:case"PKIX_RSA_PSS_3072_SHA256":return D.PKIX_RSA_PSS_3072_SHA256;case 18:case"PKIX_RSA_PSS_4096_SHA256":return D.PKIX_RSA_PSS_4096_SHA256;case 6:case"PKIX_ECDSA_P256_HMAC_SHA_256":return D.PKIX_ECDSA_P256_HMAC_SHA_256;case 5:case"PKIX_ECDSA_P256_SHA_256":return D.PKIX_ECDSA_P256_SHA_256;case 12:case"PKIX_ECDSA_P384_SHA_384":return D.PKIX_ECDSA_P384_SHA_384;case 13:case"PKIX_ECDSA_P521_SHA_512":return D.PKIX_ECDSA_P521_SHA_512;case 7:case"PKIX_ED25519":return D.PKIX_ED25519;case 8:case"PKIX_ED25519_PH":return D.PKIX_ED25519_PH;case 19:case"PKIX_ECDSA_P384_SHA_256":return D.PKIX_ECDSA_P384_SHA_256;case 20:case"PKIX_ECDSA_P521_SHA_256":return D.PKIX_ECDSA_P521_SHA_256;case 14:case"LMS_SHA256":return D.LMS_SHA256;case 15:case"LMOTS_SHA256":return D.LMOTS_SHA256;case 21:case"ML_DSA_65":return D.ML_DSA_65;case 22:case"ML_DSA_87":return D.ML_DSA_87;default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum PublicKeyDetails")}}o(JB,"publicKeyDetailsFromJSON");function KB(i){switch(i){case D.PUBLIC_KEY_DETAILS_UNSPECIFIED:return"PUBLIC_KEY_DETAILS_UNSPECIFIED";case D.PKCS1_RSA_PKCS1V5:return"PKCS1_RSA_PKCS1V5";case D.PKCS1_RSA_PSS:return"PKCS1_RSA_PSS";case D.PKIX_RSA_PKCS1V5:return"PKIX_RSA_PKCS1V5";case D.PKIX_RSA_PSS:return"PKIX_RSA_PSS";case D.PKIX_RSA_PKCS1V15_2048_SHA256:return"PKIX_RSA_PKCS1V15_2048_SHA256";case D.PKIX_RSA_PKCS1V15_3072_SHA256:return"PKIX_RSA_PKCS1V15_3072_SHA256";case D.PKIX_RSA_PKCS1V15_4096_SHA256:return"PKIX_RSA_PKCS1V15_4096_SHA256";case D.PKIX_RSA_PSS_2048_SHA256:return"PKIX_RSA_PSS_2048_SHA256";case D.PKIX_RSA_PSS_3072_SHA256:return"PKIX_RSA_PSS_3072_SHA256";case D.PKIX_RSA_PSS_4096_SHA256:return"PKIX_RSA_PSS_4096_SHA256";case D.PKIX_ECDSA_P256_HMAC_SHA_256:return"PKIX_ECDSA_P256_HMAC_SHA_256";case D.PKIX_ECDSA_P256_SHA_256:return"PKIX_ECDSA_P256_SHA_256";case D.PKIX_ECDSA_P384_SHA_384:return"PKIX_ECDSA_P384_SHA_384";case D.PKIX_ECDSA_P521_SHA_512:return"PKIX_ECDSA_P521_SHA_512";case D.PKIX_ED25519:return"PKIX_ED25519";case D.PKIX_ED25519_PH:return"PKIX_ED25519_PH";case D.PKIX_ECDSA_P384_SHA_256:return"PKIX_ECDSA_P384_SHA_256";case D.PKIX_ECDSA_P521_SHA_256:return"PKIX_ECDSA_P521_SHA_256";case D.LMS_SHA256:return"LMS_SHA256";case D.LMOTS_SHA256:return"LMOTS_SHA256";case D.ML_DSA_65:return"ML_DSA_65";case D.ML_DSA_87:return"ML_DSA_87";default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum PublicKeyDetails")}}o(KB,"publicKeyDetailsToJSON");var vi;(function(i){i[i.SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED=0]="SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED",i[i.EMAIL=1]="EMAIL",i[i.URI=2]="URI",i[i.OTHER_NAME=3]="OTHER_NAME"})(vi||(x.SubjectAlternativeNameType=vi={}));function ZB(i){switch(i){case 0:case"SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED":return vi.SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED;case 1:case"EMAIL":return vi.EMAIL;case 2:case"URI":return vi.URI;case 3:case"OTHER_NAME":return vi.OTHER_NAME;default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum SubjectAlternativeNameType")}}o(ZB,"subjectAlternativeNameTypeFromJSON");function YB(i){switch(i){case vi.SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED:return"SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED";case vi.EMAIL:return"EMAIL";case vi.URI:return"URI";case vi.OTHER_NAME:return"OTHER_NAME";default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum SubjectAlternativeNameType")}}o(YB,"subjectAlternativeNameTypeToJSON");x.HashOutput={fromJSON(i){return{algorithm:we(i.algorithm)?GB(i.algorithm):0,digest:we(i.digest)?Buffer.from(Gs(i.digest)):Buffer.alloc(0)}},toJSON(i){let e={};return i.algorithm!==0&&(e.algorithm=WB(i.algorithm)),i.digest.length!==0&&(e.digest=Ws(i.digest)),e}};x.MessageSignature={fromJSON(i){return{messageDigest:we(i.messageDigest)?x.HashOutput.fromJSON(i.messageDigest):void 0,signature:we(i.signature)?Buffer.from(Gs(i.signature)):Buffer.alloc(0)}},toJSON(i){let e={};return i.messageDigest!==void 0&&(e.messageDigest=x.HashOutput.toJSON(i.messageDigest)),i.signature.length!==0&&(e.signature=Ws(i.signature)),e}};x.LogId={fromJSON(i){return{keyId:we(i.keyId)?Buffer.from(Gs(i.keyId)):Buffer.alloc(0)}},toJSON(i){let e={};return i.keyId.length!==0&&(e.keyId=Ws(i.keyId)),e}};x.RFC3161SignedTimestamp={fromJSON(i){return{signedTimestamp:we(i.signedTimestamp)?Buffer.from(Gs(i.signedTimestamp)):Buffer.alloc(0)}},toJSON(i){let e={};return i.signedTimestamp.length!==0&&(e.signedTimestamp=Ws(i.signedTimestamp)),e}};x.PublicKey={fromJSON(i){return{rawBytes:we(i.rawBytes)?Buffer.from(Gs(i.rawBytes)):void 0,keyDetails:we(i.keyDetails)?JB(i.keyDetails):0,validFor:we(i.validFor)?x.TimeRange.fromJSON(i.validFor):void 0}},toJSON(i){let e={};return i.rawBytes!==void 0&&(e.rawBytes=Ws(i.rawBytes)),i.keyDetails!==0&&(e.keyDetails=KB(i.keyDetails)),i.validFor!==void 0&&(e.validFor=x.TimeRange.toJSON(i.validFor)),e}};x.PublicKeyIdentifier={fromJSON(i){return{hint:we(i.hint)?globalThis.String(i.hint):""}},toJSON(i){let e={};return i.hint!==""&&(e.hint=i.hint),e}};x.ObjectIdentifier={fromJSON(i){return{id:globalThis.Array.isArray(i?.id)?i.id.map(e=>globalThis.Number(e)):[]}},toJSON(i){let e={};return i.id?.length&&(e.id=i.id.map(t=>Math.round(t))),e}};x.ObjectIdentifierValuePair={fromJSON(i){return{oid:we(i.oid)?x.ObjectIdentifier.fromJSON(i.oid):void 0,value:we(i.value)?Buffer.from(Gs(i.value)):Buffer.alloc(0)}},toJSON(i){let e={};return i.oid!==void 0&&(e.oid=x.ObjectIdentifier.toJSON(i.oid)),i.value.length!==0&&(e.value=Ws(i.value)),e}};x.DistinguishedName={fromJSON(i){return{organization:we(i.organization)?globalThis.String(i.organization):"",commonName:we(i.commonName)?globalThis.String(i.commonName):""}},toJSON(i){let e={};return i.organization!==""&&(e.organization=i.organization),i.commonName!==""&&(e.commonName=i.commonName),e}};x.X509Certificate={fromJSON(i){return{rawBytes:we(i.rawBytes)?Buffer.from(Gs(i.rawBytes)):Buffer.alloc(0)}},toJSON(i){let e={};return i.rawBytes.length!==0&&(e.rawBytes=Ws(i.rawBytes)),e}};x.SubjectAlternativeName={fromJSON(i){return{type:we(i.type)?ZB(i.type):0,identity:we(i.regexp)?{$case:"regexp",regexp:globalThis.String(i.regexp)}:we(i.value)?{$case:"value",value:globalThis.String(i.value)}:void 0}},toJSON(i){let e={};return i.type!==0&&(e.type=YB(i.type)),i.identity?.$case==="regexp"?e.regexp=i.identity.regexp:i.identity?.$case==="value"&&(e.value=i.identity.value),e}};x.X509CertificateChain={fromJSON(i){return{certificates:globalThis.Array.isArray(i?.certificates)?i.certificates.map(e=>x.X509Certificate.fromJSON(e)):[]}},toJSON(i){let e={};return i.certificates?.length&&(e.certificates=i.certificates.map(t=>x.X509Certificate.toJSON(t))),e}};x.TimeRange={fromJSON(i){return{start:we(i.start)?HB(i.start):void 0,end:we(i.end)?HB(i.end):void 0}},toJSON(i){let e={};return i.start!==void 0&&(e.start=i.start.toISOString()),i.end!==void 0&&(e.end=i.end.toISOString()),e}};function Gs(i){return Uint8Array.from(globalThis.Buffer.from(i,"base64"))}o(Gs,"bytesFromBase64");function Ws(i){return globalThis.Buffer.from(i).toString("base64")}o(Ws,"base64FromBytes");function ate(i){let e=(globalThis.Number(i.seconds)||0)*1e3;return e+=(i.nanos||0)/1e6,new globalThis.Date(e)}o(ate,"fromTimestamp");function HB(i){return i instanceof globalThis.Date?i:typeof i=="string"?new globalThis.Date(i):ate(ote.Timestamp.fromJSON(i))}o(HB,"fromJsonTimestamp");function we(i){return i!=null}o(we,"isSet")});var U_=d(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.TransparencyLogEntry=_e.InclusionPromise=_e.InclusionProof=_e.Checkpoint=_e.KindVersion=void 0;var XB=No();_e.KindVersion={fromJSON(i){return{kind:Je(i.kind)?globalThis.String(i.kind):"",version:Je(i.version)?globalThis.String(i.version):""}},toJSON(i){let e={};return i.kind!==""&&(e.kind=i.kind),i.version!==""&&(e.version=i.version),e}};_e.Checkpoint={fromJSON(i){return{envelope:Je(i.envelope)?globalThis.String(i.envelope):""}},toJSON(i){let e={};return i.envelope!==""&&(e.envelope=i.envelope),e}};_e.InclusionProof={fromJSON(i){return{logIndex:Je(i.logIndex)?globalThis.String(i.logIndex):"0",rootHash:Je(i.rootHash)?Buffer.from(jd(i.rootHash)):Buffer.alloc(0),treeSize:Je(i.treeSize)?globalThis.String(i.treeSize):"0",hashes:globalThis.Array.isArray(i?.hashes)?i.hashes.map(e=>Buffer.from(jd(e))):[],checkpoint:Je(i.checkpoint)?_e.Checkpoint.fromJSON(i.checkpoint):void 0}},toJSON(i){let e={};return i.logIndex!=="0"&&(e.logIndex=i.logIndex),i.rootHash.length!==0&&(e.rootHash=$d(i.rootHash)),i.treeSize!=="0"&&(e.treeSize=i.treeSize),i.hashes?.length&&(e.hashes=i.hashes.map(t=>$d(t))),i.checkpoint!==void 0&&(e.checkpoint=_e.Checkpoint.toJSON(i.checkpoint)),e}};_e.InclusionPromise={fromJSON(i){return{signedEntryTimestamp:Je(i.signedEntryTimestamp)?Buffer.from(jd(i.signedEntryTimestamp)):Buffer.alloc(0)}},toJSON(i){let e={};return i.signedEntryTimestamp.length!==0&&(e.signedEntryTimestamp=$d(i.signedEntryTimestamp)),e}};_e.TransparencyLogEntry={fromJSON(i){return{logIndex:Je(i.logIndex)?globalThis.String(i.logIndex):"0",logId:Je(i.logId)?XB.LogId.fromJSON(i.logId):void 0,kindVersion:Je(i.kindVersion)?_e.KindVersion.fromJSON(i.kindVersion):void 0,integratedTime:Je(i.integratedTime)?globalThis.String(i.integratedTime):"0",inclusionPromise:Je(i.inclusionPromise)?_e.InclusionPromise.fromJSON(i.inclusionPromise):void 0,inclusionProof:Je(i.inclusionProof)?_e.InclusionProof.fromJSON(i.inclusionProof):void 0,canonicalizedBody:Je(i.canonicalizedBody)?Buffer.from(jd(i.canonicalizedBody)):Buffer.alloc(0)}},toJSON(i){let e={};return i.logIndex!=="0"&&(e.logIndex=i.logIndex),i.logId!==void 0&&(e.logId=XB.LogId.toJSON(i.logId)),i.kindVersion!==void 0&&(e.kindVersion=_e.KindVersion.toJSON(i.kindVersion)),i.integratedTime!=="0"&&(e.integratedTime=i.integratedTime),i.inclusionPromise!==void 0&&(e.inclusionPromise=_e.InclusionPromise.toJSON(i.inclusionPromise)),i.inclusionProof!==void 0&&(e.inclusionProof=_e.InclusionProof.toJSON(i.inclusionProof)),i.canonicalizedBody.length!==0&&(e.canonicalizedBody=$d(i.canonicalizedBody)),e}};function jd(i){return Uint8Array.from(globalThis.Buffer.from(i,"base64"))}o(jd,"bytesFromBase64");function $d(i){return globalThis.Buffer.from(i).toString("base64")}o($d,"base64FromBytes");function Je(i){return i!=null}o(Je,"isSet")});var j_=d(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.Bundle=Mt.VerificationMaterial=Mt.TimestampVerificationData=void 0;var QB=F_(),Ri=No(),ek=U_();Mt.TimestampVerificationData={fromJSON(i){return{rfc3161Timestamps:globalThis.Array.isArray(i?.rfc3161Timestamps)?i.rfc3161Timestamps.map(e=>Ri.RFC3161SignedTimestamp.fromJSON(e)):[]}},toJSON(i){let e={};return i.rfc3161Timestamps?.length&&(e.rfc3161Timestamps=i.rfc3161Timestamps.map(t=>Ri.RFC3161SignedTimestamp.toJSON(t))),e}};Mt.VerificationMaterial={fromJSON(i){return{content:$r(i.publicKey)?{$case:"publicKey",publicKey:Ri.PublicKeyIdentifier.fromJSON(i.publicKey)}:$r(i.x509CertificateChain)?{$case:"x509CertificateChain",x509CertificateChain:Ri.X509CertificateChain.fromJSON(i.x509CertificateChain)}:$r(i.certificate)?{$case:"certificate",certificate:Ri.X509Certificate.fromJSON(i.certificate)}:void 0,tlogEntries:globalThis.Array.isArray(i?.tlogEntries)?i.tlogEntries.map(e=>ek.TransparencyLogEntry.fromJSON(e)):[],timestampVerificationData:$r(i.timestampVerificationData)?Mt.TimestampVerificationData.fromJSON(i.timestampVerificationData):void 0}},toJSON(i){let e={};return i.content?.$case==="publicKey"?e.publicKey=Ri.PublicKeyIdentifier.toJSON(i.content.publicKey):i.content?.$case==="x509CertificateChain"?e.x509CertificateChain=Ri.X509CertificateChain.toJSON(i.content.x509CertificateChain):i.content?.$case==="certificate"&&(e.certificate=Ri.X509Certificate.toJSON(i.content.certificate)),i.tlogEntries?.length&&(e.tlogEntries=i.tlogEntries.map(t=>ek.TransparencyLogEntry.toJSON(t))),i.timestampVerificationData!==void 0&&(e.timestampVerificationData=Mt.TimestampVerificationData.toJSON(i.timestampVerificationData)),e}};Mt.Bundle={fromJSON(i){return{mediaType:$r(i.mediaType)?globalThis.String(i.mediaType):"",verificationMaterial:$r(i.verificationMaterial)?Mt.VerificationMaterial.fromJSON(i.verificationMaterial):void 0,content:$r(i.messageSignature)?{$case:"messageSignature",messageSignature:Ri.MessageSignature.fromJSON(i.messageSignature)}:$r(i.dsseEnvelope)?{$case:"dsseEnvelope",dsseEnvelope:QB.Envelope.fromJSON(i.dsseEnvelope)}:void 0}},toJSON(i){let e={};return i.mediaType!==""&&(e.mediaType=i.mediaType),i.verificationMaterial!==void 0&&(e.verificationMaterial=Mt.VerificationMaterial.toJSON(i.verificationMaterial)),i.content?.$case==="messageSignature"?e.messageSignature=Ri.MessageSignature.toJSON(i.content.messageSignature):i.content?.$case==="dsseEnvelope"&&(e.dsseEnvelope=QB.Envelope.toJSON(i.content.dsseEnvelope)),e}};function $r(i){return i!=null}o($r,"isSet")});var $_=d(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});L.ClientTrustConfig=L.ServiceConfiguration=L.Service=L.SigningConfig=L.TrustedRoot=L.CertificateAuthority=L.TransparencyLogInstance=L.ServiceSelector=void 0;L.serviceSelectorFromJSON=tk;L.serviceSelectorToJSON=ik;var je=No(),Ai;(function(i){i[i.SERVICE_SELECTOR_UNDEFINED=0]="SERVICE_SELECTOR_UNDEFINED",i[i.ALL=1]="ALL",i[i.ANY=2]="ANY",i[i.EXACT=3]="EXACT"})(Ai||(L.ServiceSelector=Ai={}));function tk(i){switch(i){case 0:case"SERVICE_SELECTOR_UNDEFINED":return Ai.SERVICE_SELECTOR_UNDEFINED;case 1:case"ALL":return Ai.ALL;case 2:case"ANY":return Ai.ANY;case 3:case"EXACT":return Ai.EXACT;default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum ServiceSelector")}}o(tk,"serviceSelectorFromJSON");function ik(i){switch(i){case Ai.SERVICE_SELECTOR_UNDEFINED:return"SERVICE_SELECTOR_UNDEFINED";case Ai.ALL:return"ALL";case Ai.ANY:return"ANY";case Ai.EXACT:return"EXACT";default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum ServiceSelector")}}o(ik,"serviceSelectorToJSON");L.TransparencyLogInstance={fromJSON(i){return{baseUrl:ae(i.baseUrl)?globalThis.String(i.baseUrl):"",hashAlgorithm:ae(i.hashAlgorithm)?(0,je.hashAlgorithmFromJSON)(i.hashAlgorithm):0,publicKey:ae(i.publicKey)?je.PublicKey.fromJSON(i.publicKey):void 0,logId:ae(i.logId)?je.LogId.fromJSON(i.logId):void 0,checkpointKeyId:ae(i.checkpointKeyId)?je.LogId.fromJSON(i.checkpointKeyId):void 0,operator:ae(i.operator)?globalThis.String(i.operator):""}},toJSON(i){let e={};return i.baseUrl!==""&&(e.baseUrl=i.baseUrl),i.hashAlgorithm!==0&&(e.hashAlgorithm=(0,je.hashAlgorithmToJSON)(i.hashAlgorithm)),i.publicKey!==void 0&&(e.publicKey=je.PublicKey.toJSON(i.publicKey)),i.logId!==void 0&&(e.logId=je.LogId.toJSON(i.logId)),i.checkpointKeyId!==void 0&&(e.checkpointKeyId=je.LogId.toJSON(i.checkpointKeyId)),i.operator!==""&&(e.operator=i.operator),e}};L.CertificateAuthority={fromJSON(i){return{subject:ae(i.subject)?je.DistinguishedName.fromJSON(i.subject):void 0,uri:ae(i.uri)?globalThis.String(i.uri):"",certChain:ae(i.certChain)?je.X509CertificateChain.fromJSON(i.certChain):void 0,validFor:ae(i.validFor)?je.TimeRange.fromJSON(i.validFor):void 0,operator:ae(i.operator)?globalThis.String(i.operator):""}},toJSON(i){let e={};return i.subject!==void 0&&(e.subject=je.DistinguishedName.toJSON(i.subject)),i.uri!==""&&(e.uri=i.uri),i.certChain!==void 0&&(e.certChain=je.X509CertificateChain.toJSON(i.certChain)),i.validFor!==void 0&&(e.validFor=je.TimeRange.toJSON(i.validFor)),i.operator!==""&&(e.operator=i.operator),e}};L.TrustedRoot={fromJSON(i){return{mediaType:ae(i.mediaType)?globalThis.String(i.mediaType):"",tlogs:globalThis.Array.isArray(i?.tlogs)?i.tlogs.map(e=>L.TransparencyLogInstance.fromJSON(e)):[],certificateAuthorities:globalThis.Array.isArray(i?.certificateAuthorities)?i.certificateAuthorities.map(e=>L.CertificateAuthority.fromJSON(e)):[],ctlogs:globalThis.Array.isArray(i?.ctlogs)?i.ctlogs.map(e=>L.TransparencyLogInstance.fromJSON(e)):[],timestampAuthorities:globalThis.Array.isArray(i?.timestampAuthorities)?i.timestampAuthorities.map(e=>L.CertificateAuthority.fromJSON(e)):[]}},toJSON(i){let e={};return i.mediaType!==""&&(e.mediaType=i.mediaType),i.tlogs?.length&&(e.tlogs=i.tlogs.map(t=>L.TransparencyLogInstance.toJSON(t))),i.certificateAuthorities?.length&&(e.certificateAuthorities=i.certificateAuthorities.map(t=>L.CertificateAuthority.toJSON(t))),i.ctlogs?.length&&(e.ctlogs=i.ctlogs.map(t=>L.TransparencyLogInstance.toJSON(t))),i.timestampAuthorities?.length&&(e.timestampAuthorities=i.timestampAuthorities.map(t=>L.CertificateAuthority.toJSON(t))),e}};L.SigningConfig={fromJSON(i){return{mediaType:ae(i.mediaType)?globalThis.String(i.mediaType):"",caUrls:globalThis.Array.isArray(i?.caUrls)?i.caUrls.map(e=>L.Service.fromJSON(e)):[],oidcUrls:globalThis.Array.isArray(i?.oidcUrls)?i.oidcUrls.map(e=>L.Service.fromJSON(e)):[],rekorTlogUrls:globalThis.Array.isArray(i?.rekorTlogUrls)?i.rekorTlogUrls.map(e=>L.Service.fromJSON(e)):[],rekorTlogConfig:ae(i.rekorTlogConfig)?L.ServiceConfiguration.fromJSON(i.rekorTlogConfig):void 0,tsaUrls:globalThis.Array.isArray(i?.tsaUrls)?i.tsaUrls.map(e=>L.Service.fromJSON(e)):[],tsaConfig:ae(i.tsaConfig)?L.ServiceConfiguration.fromJSON(i.tsaConfig):void 0}},toJSON(i){let e={};return i.mediaType!==""&&(e.mediaType=i.mediaType),i.caUrls?.length&&(e.caUrls=i.caUrls.map(t=>L.Service.toJSON(t))),i.oidcUrls?.length&&(e.oidcUrls=i.oidcUrls.map(t=>L.Service.toJSON(t))),i.rekorTlogUrls?.length&&(e.rekorTlogUrls=i.rekorTlogUrls.map(t=>L.Service.toJSON(t))),i.rekorTlogConfig!==void 0&&(e.rekorTlogConfig=L.ServiceConfiguration.toJSON(i.rekorTlogConfig)),i.tsaUrls?.length&&(e.tsaUrls=i.tsaUrls.map(t=>L.Service.toJSON(t))),i.tsaConfig!==void 0&&(e.tsaConfig=L.ServiceConfiguration.toJSON(i.tsaConfig)),e}};L.Service={fromJSON(i){return{url:ae(i.url)?globalThis.String(i.url):"",majorApiVersion:ae(i.majorApiVersion)?globalThis.Number(i.majorApiVersion):0,validFor:ae(i.validFor)?je.TimeRange.fromJSON(i.validFor):void 0,operator:ae(i.operator)?globalThis.String(i.operator):""}},toJSON(i){let e={};return i.url!==""&&(e.url=i.url),i.majorApiVersion!==0&&(e.majorApiVersion=Math.round(i.majorApiVersion)),i.validFor!==void 0&&(e.validFor=je.TimeRange.toJSON(i.validFor)),i.operator!==""&&(e.operator=i.operator),e}};L.ServiceConfiguration={fromJSON(i){return{selector:ae(i.selector)?tk(i.selector):0,count:ae(i.count)?globalThis.Number(i.count):0}},toJSON(i){let e={};return i.selector!==0&&(e.selector=ik(i.selector)),i.count!==0&&(e.count=Math.round(i.count)),e}};L.ClientTrustConfig={fromJSON(i){return{mediaType:ae(i.mediaType)?globalThis.String(i.mediaType):"",trustedRoot:ae(i.trustedRoot)?L.TrustedRoot.fromJSON(i.trustedRoot):void 0,signingConfig:ae(i.signingConfig)?L.SigningConfig.fromJSON(i.signingConfig):void 0}},toJSON(i){let e={};return i.mediaType!==""&&(e.mediaType=i.mediaType),i.trustedRoot!==void 0&&(e.trustedRoot=L.TrustedRoot.toJSON(i.trustedRoot)),i.signingConfig!==void 0&&(e.signingConfig=L.SigningConfig.toJSON(i.signingConfig)),e}};function ae(i){return i!=null}o(ae,"isSet")});var nk=d(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});M.Input=M.Artifact=M.ArtifactVerificationOptions_ObserverTimestampOptions=M.ArtifactVerificationOptions_TlogIntegratedTimestampOptions=M.ArtifactVerificationOptions_TimestampAuthorityOptions=M.ArtifactVerificationOptions_CtlogOptions=M.ArtifactVerificationOptions_TlogOptions=M.ArtifactVerificationOptions=M.PublicKeyIdentities=M.CertificateIdentities=M.CertificateIdentity=void 0;var rk=j_(),qr=No(),sk=$_();M.CertificateIdentity={fromJSON(i){return{issuer:Q(i.issuer)?globalThis.String(i.issuer):"",san:Q(i.san)?qr.SubjectAlternativeName.fromJSON(i.san):void 0,oids:globalThis.Array.isArray(i?.oids)?i.oids.map(e=>qr.ObjectIdentifierValuePair.fromJSON(e)):[]}},toJSON(i){let e={};return i.issuer!==""&&(e.issuer=i.issuer),i.san!==void 0&&(e.san=qr.SubjectAlternativeName.toJSON(i.san)),i.oids?.length&&(e.oids=i.oids.map(t=>qr.ObjectIdentifierValuePair.toJSON(t))),e}};M.CertificateIdentities={fromJSON(i){return{identities:globalThis.Array.isArray(i?.identities)?i.identities.map(e=>M.CertificateIdentity.fromJSON(e)):[]}},toJSON(i){let e={};return i.identities?.length&&(e.identities=i.identities.map(t=>M.CertificateIdentity.toJSON(t))),e}};M.PublicKeyIdentities={fromJSON(i){return{publicKeys:globalThis.Array.isArray(i?.publicKeys)?i.publicKeys.map(e=>qr.PublicKey.fromJSON(e)):[]}},toJSON(i){let e={};return i.publicKeys?.length&&(e.publicKeys=i.publicKeys.map(t=>qr.PublicKey.toJSON(t))),e}};M.ArtifactVerificationOptions={fromJSON(i){return{signers:Q(i.certificateIdentities)?{$case:"certificateIdentities",certificateIdentities:M.CertificateIdentities.fromJSON(i.certificateIdentities)}:Q(i.publicKeys)?{$case:"publicKeys",publicKeys:M.PublicKeyIdentities.fromJSON(i.publicKeys)}:void 0,tlogOptions:Q(i.tlogOptions)?M.ArtifactVerificationOptions_TlogOptions.fromJSON(i.tlogOptions):void 0,ctlogOptions:Q(i.ctlogOptions)?M.ArtifactVerificationOptions_CtlogOptions.fromJSON(i.ctlogOptions):void 0,tsaOptions:Q(i.tsaOptions)?M.ArtifactVerificationOptions_TimestampAuthorityOptions.fromJSON(i.tsaOptions):void 0,integratedTsOptions:Q(i.integratedTsOptions)?M.ArtifactVerificationOptions_TlogIntegratedTimestampOptions.fromJSON(i.integratedTsOptions):void 0,observerOptions:Q(i.observerOptions)?M.ArtifactVerificationOptions_ObserverTimestampOptions.fromJSON(i.observerOptions):void 0}},toJSON(i){let e={};return i.signers?.$case==="certificateIdentities"?e.certificateIdentities=M.CertificateIdentities.toJSON(i.signers.certificateIdentities):i.signers?.$case==="publicKeys"&&(e.publicKeys=M.PublicKeyIdentities.toJSON(i.signers.publicKeys)),i.tlogOptions!==void 0&&(e.tlogOptions=M.ArtifactVerificationOptions_TlogOptions.toJSON(i.tlogOptions)),i.ctlogOptions!==void 0&&(e.ctlogOptions=M.ArtifactVerificationOptions_CtlogOptions.toJSON(i.ctlogOptions)),i.tsaOptions!==void 0&&(e.tsaOptions=M.ArtifactVerificationOptions_TimestampAuthorityOptions.toJSON(i.tsaOptions)),i.integratedTsOptions!==void 0&&(e.integratedTsOptions=M.ArtifactVerificationOptions_TlogIntegratedTimestampOptions.toJSON(i.integratedTsOptions)),i.observerOptions!==void 0&&(e.observerOptions=M.ArtifactVerificationOptions_ObserverTimestampOptions.toJSON(i.observerOptions)),e}};M.ArtifactVerificationOptions_TlogOptions={fromJSON(i){return{threshold:Q(i.threshold)?globalThis.Number(i.threshold):0,performOnlineVerification:Q(i.performOnlineVerification)?globalThis.Boolean(i.performOnlineVerification):!1,disable:Q(i.disable)?globalThis.Boolean(i.disable):!1}},toJSON(i){let e={};return i.threshold!==0&&(e.threshold=Math.round(i.threshold)),i.performOnlineVerification!==!1&&(e.performOnlineVerification=i.performOnlineVerification),i.disable!==!1&&(e.disable=i.disable),e}};M.ArtifactVerificationOptions_CtlogOptions={fromJSON(i){return{threshold:Q(i.threshold)?globalThis.Number(i.threshold):0,disable:Q(i.disable)?globalThis.Boolean(i.disable):!1}},toJSON(i){let e={};return i.threshold!==0&&(e.threshold=Math.round(i.threshold)),i.disable!==!1&&(e.disable=i.disable),e}};M.ArtifactVerificationOptions_TimestampAuthorityOptions={fromJSON(i){return{threshold:Q(i.threshold)?globalThis.Number(i.threshold):0,disable:Q(i.disable)?globalThis.Boolean(i.disable):!1}},toJSON(i){let e={};return i.threshold!==0&&(e.threshold=Math.round(i.threshold)),i.disable!==!1&&(e.disable=i.disable),e}};M.ArtifactVerificationOptions_TlogIntegratedTimestampOptions={fromJSON(i){return{threshold:Q(i.threshold)?globalThis.Number(i.threshold):0,disable:Q(i.disable)?globalThis.Boolean(i.disable):!1}},toJSON(i){let e={};return i.threshold!==0&&(e.threshold=Math.round(i.threshold)),i.disable!==!1&&(e.disable=i.disable),e}};M.ArtifactVerificationOptions_ObserverTimestampOptions={fromJSON(i){return{threshold:Q(i.threshold)?globalThis.Number(i.threshold):0,disable:Q(i.disable)?globalThis.Boolean(i.disable):!1}},toJSON(i){let e={};return i.threshold!==0&&(e.threshold=Math.round(i.threshold)),i.disable!==!1&&(e.disable=i.disable),e}};M.Artifact={fromJSON(i){return{data:Q(i.artifactUri)?{$case:"artifactUri",artifactUri:globalThis.String(i.artifactUri)}:Q(i.artifact)?{$case:"artifact",artifact:Buffer.from(cte(i.artifact))}:Q(i.artifactDigest)?{$case:"artifactDigest",artifactDigest:qr.HashOutput.fromJSON(i.artifactDigest)}:void 0}},toJSON(i){let e={};return i.data?.$case==="artifactUri"?e.artifactUri=i.data.artifactUri:i.data?.$case==="artifact"?e.artifact=ute(i.data.artifact):i.data?.$case==="artifactDigest"&&(e.artifactDigest=qr.HashOutput.toJSON(i.data.artifactDigest)),e}};M.Input={fromJSON(i){return{artifactTrustRoot:Q(i.artifactTrustRoot)?sk.TrustedRoot.fromJSON(i.artifactTrustRoot):void 0,artifactVerificationOptions:Q(i.artifactVerificationOptions)?M.ArtifactVerificationOptions.fromJSON(i.artifactVerificationOptions):void 0,bundle:Q(i.bundle)?rk.Bundle.fromJSON(i.bundle):void 0,artifact:Q(i.artifact)?M.Artifact.fromJSON(i.artifact):void 0}},toJSON(i){let e={};return i.artifactTrustRoot!==void 0&&(e.artifactTrustRoot=sk.TrustedRoot.toJSON(i.artifactTrustRoot)),i.artifactVerificationOptions!==void 0&&(e.artifactVerificationOptions=M.ArtifactVerificationOptions.toJSON(i.artifactVerificationOptions)),i.bundle!==void 0&&(e.bundle=rk.Bundle.toJSON(i.bundle)),i.artifact!==void 0&&(e.artifact=M.Artifact.toJSON(i.artifact)),e}};function cte(i){return Uint8Array.from(globalThis.Buffer.from(i,"base64"))}o(cte,"bytesFromBase64");function ute(i){return globalThis.Buffer.from(i).toString("base64")}o(ute,"base64FromBytes");function Q(i){return i!=null}o(Q,"isSet")});var su=d(Bt=>{"use strict";var lte=Bt&&Bt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),Po=Bt&&Bt.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&lte(e,i,t)};Object.defineProperty(Bt,"__esModule",{value:!0});Po(F_(),Bt);Po(j_(),Bt);Po(No(),Bt);Po(U_(),Bt);Po($_(),Bt);Po(nk(),Bt)});var qd=d(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.BUNDLE_V03_MEDIA_TYPE=nt.BUNDLE_V03_LEGACY_MEDIA_TYPE=nt.BUNDLE_V02_MEDIA_TYPE=nt.BUNDLE_V01_MEDIA_TYPE=void 0;nt.isBundleWithCertificateChain=hte;nt.isBundleWithPublicKey=fte;nt.isBundleWithMessageSignature=dte;nt.isBundleWithDsseEnvelope=pte;nt.BUNDLE_V01_MEDIA_TYPE="application/vnd.dev.sigstore.bundle+json;version=0.1";nt.BUNDLE_V02_MEDIA_TYPE="application/vnd.dev.sigstore.bundle+json;version=0.2";nt.BUNDLE_V03_LEGACY_MEDIA_TYPE="application/vnd.dev.sigstore.bundle+json;version=0.3";nt.BUNDLE_V03_MEDIA_TYPE="application/vnd.dev.sigstore.bundle.v0.3+json";function hte(i){return i.verificationMaterial.content.$case==="x509CertificateChain"}o(hte,"isBundleWithCertificateChain");function fte(i){return i.verificationMaterial.content.$case==="publicKey"}o(fte,"isBundleWithPublicKey");function dte(i){return i.content.$case==="messageSignature"}o(dte,"isBundleWithMessageSignature");function pte(i){return i.content.$case==="dsseEnvelope"}o(pte,"isBundleWithDsseEnvelope")});var ak=d(zd=>{"use strict";Object.defineProperty(zd,"__esModule",{value:!0});zd.toMessageSignatureBundle=gte;zd.toDSSEBundle=yte;var mte=su(),Vd=qd();function gte(i){return{mediaType:i.certificateChain?Vd.BUNDLE_V02_MEDIA_TYPE:Vd.BUNDLE_V03_MEDIA_TYPE,content:{$case:"messageSignature",messageSignature:{messageDigest:{algorithm:mte.HashAlgorithm.SHA2_256,digest:i.digest},signature:i.signature}},verificationMaterial:ok(i)}}o(gte,"toMessageSignatureBundle");function yte(i){return{mediaType:i.certificateChain?Vd.BUNDLE_V02_MEDIA_TYPE:Vd.BUNDLE_V03_MEDIA_TYPE,content:{$case:"dsseEnvelope",dsseEnvelope:Ste(i)},verificationMaterial:ok(i)}}o(yte,"toDSSEBundle");function Ste(i){return{payloadType:i.artifactType,payload:i.artifact,signatures:[Ete(i)]}}o(Ste,"toEnvelope");function Ete(i){return{keyid:i.keyHint||"",sig:i.signature}}o(Ete,"toSignature");function ok(i){return{content:wte(i),tlogEntries:[],timestampVerificationData:{rfc3161Timestamps:[]}}}o(ok,"toVerificationMaterial");function wte(i){return i.certificate?i.certificateChain?{$case:"x509CertificateChain",x509CertificateChain:{certificates:[{rawBytes:i.certificate}]}}:{$case:"certificate",certificate:{rawBytes:i.certificate}}:{$case:"publicKey",publicKey:{hint:i.keyHint||""}}}o(wte,"toKeyContent")});var V_=d(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});Hd.ValidationError=void 0;var q_=class extends Error{static{o(this,"ValidationError")}constructor(e,t){super(e),this.fields=t}};Hd.ValidationError=q_});var z_=d(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});Js.assertBundle=_te;Js.assertBundleV01=ck;Js.isBundleV01=bte;Js.assertBundleV02=Ite;Js.assertBundleLatest=Ote;var Gd=V_();function _te(i){let e=Wd(i);if(e.length>0)throw new Gd.ValidationError("invalid bundle",e)}o(_te,"assertBundle");function ck(i){let e=[];if(e.push(...Wd(i)),e.push(...vte(i)),e.length>0)throw new Gd.ValidationError("invalid v0.1 bundle",e)}o(ck,"assertBundleV01");function bte(i){try{return ck(i),!0}catch{return!1}}o(bte,"isBundleV01");function Ite(i){let e=[];if(e.push(...Wd(i)),e.push(...uk(i)),e.length>0)throw new Gd.ValidationError("invalid v0.2 bundle",e)}o(Ite,"assertBundleV02");function Ote(i){let e=[];if(e.push(...Wd(i)),e.push(...uk(i)),e.push(...Rte(i)),e.length>0)throw new Gd.ValidationError("invalid bundle",e)}o(Ote,"assertBundleLatest");function Wd(i){let e=[];if((i.mediaType===void 0||!i.mediaType.match(/^application\/vnd\.dev\.sigstore\.bundle\+json;version=\d\.\d/)&&!i.mediaType.match(/^application\/vnd\.dev\.sigstore\.bundle\.v\d\.\d\+json/))&&e.push("mediaType"),i.content===void 0)e.push("content");else switch(i.content.$case){case"messageSignature":i.content.messageSignature.messageDigest===void 0?e.push("content.messageSignature.messageDigest"):i.content.messageSignature.messageDigest.digest.length===0&&e.push("content.messageSignature.messageDigest.digest"),i.content.messageSignature.signature.length===0&&e.push("content.messageSignature.signature");break;case"dsseEnvelope":i.content.dsseEnvelope.payload.length===0&&e.push("content.dsseEnvelope.payload"),i.content.dsseEnvelope.signatures.length!==1?e.push("content.dsseEnvelope.signatures"):i.content.dsseEnvelope.signatures[0].sig.length===0&&e.push("content.dsseEnvelope.signatures[0].sig");break}if(i.verificationMaterial===void 0)e.push("verificationMaterial");else{if(i.verificationMaterial.content===void 0)e.push("verificationMaterial.content");else switch(i.verificationMaterial.content.$case){case"x509CertificateChain":i.verificationMaterial.content.x509CertificateChain.certificates.length===0&&e.push("verificationMaterial.content.x509CertificateChain.certificates"),i.verificationMaterial.content.x509CertificateChain.certificates.forEach((t,r)=>{t.rawBytes.length===0&&e.push(`verificationMaterial.content.x509CertificateChain.certificates[${r}].rawBytes`)});break;case"certificate":i.verificationMaterial.content.certificate.rawBytes.length===0&&e.push("verificationMaterial.content.certificate.rawBytes");break}i.verificationMaterial.tlogEntries===void 0?e.push("verificationMaterial.tlogEntries"):i.verificationMaterial.tlogEntries.length>0&&i.verificationMaterial.tlogEntries.forEach((t,r)=>{t.logId===void 0&&e.push(`verificationMaterial.tlogEntries[${r}].logId`),t.kindVersion===void 0&&e.push(`verificationMaterial.tlogEntries[${r}].kindVersion`)})}return e}o(Wd,"validateBundleBase");function vte(i){let e=[];return i.verificationMaterial&&i.verificationMaterial.tlogEntries?.length>0&&i.verificationMaterial.tlogEntries.forEach((t,r)=>{t.inclusionPromise===void 0&&e.push(`verificationMaterial.tlogEntries[${r}].inclusionPromise`)}),e}o(vte,"validateInclusionPromise");function uk(i){let e=[];return i.verificationMaterial&&i.verificationMaterial.tlogEntries?.length>0&&i.verificationMaterial.tlogEntries.forEach((t,r)=>{t.inclusionProof===void 0?e.push(`verificationMaterial.tlogEntries[${r}].inclusionProof`):t.inclusionProof.checkpoint===void 0&&e.push(`verificationMaterial.tlogEntries[${r}].inclusionProof.checkpoint`)}),e}o(uk,"validateInclusionProof");function Rte(i){let e=[];return i.verificationMaterial?.content?.$case==="x509CertificateChain"&&e.push("verificationMaterial.content.$case"),e}o(Rte,"validateNoCertificateChain")});var hk=d(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.envelopeToJSON=Ti.envelopeFromJSON=Ti.bundleToJSON=Ti.bundleFromJSON=void 0;var Jd=su(),lk=qd(),H_=z_(),Ate=o(i=>{let e=Jd.Bundle.fromJSON(i);switch(e.mediaType){case lk.BUNDLE_V01_MEDIA_TYPE:(0,H_.assertBundleV01)(e);break;case lk.BUNDLE_V02_MEDIA_TYPE:(0,H_.assertBundleV02)(e);break;default:(0,H_.assertBundleLatest)(e);break}return e},"bundleFromJSON");Ti.bundleFromJSON=Ate;var Tte=o(i=>Jd.Bundle.toJSON(i),"bundleToJSON");Ti.bundleToJSON=Tte;var Cte=o(i=>Jd.Envelope.fromJSON(i),"envelopeFromJSON");Ti.envelopeFromJSON=Cte;var Nte=o(i=>Jd.Envelope.toJSON(i),"envelopeToJSON");Ti.envelopeToJSON=Nte});var ou=d(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.isBundleV01=k.assertBundleV02=k.assertBundleV01=k.assertBundleLatest=k.assertBundle=k.envelopeToJSON=k.envelopeFromJSON=k.bundleToJSON=k.bundleFromJSON=k.ValidationError=k.isBundleWithPublicKey=k.isBundleWithMessageSignature=k.isBundleWithDsseEnvelope=k.isBundleWithCertificateChain=k.BUNDLE_V03_MEDIA_TYPE=k.BUNDLE_V03_LEGACY_MEDIA_TYPE=k.BUNDLE_V02_MEDIA_TYPE=k.BUNDLE_V01_MEDIA_TYPE=k.toMessageSignatureBundle=k.toDSSEBundle=void 0;var fk=ak();Object.defineProperty(k,"toDSSEBundle",{enumerable:!0,get:o(function(){return fk.toDSSEBundle},"get")});Object.defineProperty(k,"toMessageSignatureBundle",{enumerable:!0,get:o(function(){return fk.toMessageSignatureBundle},"get")});var Vr=qd();Object.defineProperty(k,"BUNDLE_V01_MEDIA_TYPE",{enumerable:!0,get:o(function(){return Vr.BUNDLE_V01_MEDIA_TYPE},"get")});Object.defineProperty(k,"BUNDLE_V02_MEDIA_TYPE",{enumerable:!0,get:o(function(){return Vr.BUNDLE_V02_MEDIA_TYPE},"get")});Object.defineProperty(k,"BUNDLE_V03_LEGACY_MEDIA_TYPE",{enumerable:!0,get:o(function(){return Vr.BUNDLE_V03_LEGACY_MEDIA_TYPE},"get")});Object.defineProperty(k,"BUNDLE_V03_MEDIA_TYPE",{enumerable:!0,get:o(function(){return Vr.BUNDLE_V03_MEDIA_TYPE},"get")});Object.defineProperty(k,"isBundleWithCertificateChain",{enumerable:!0,get:o(function(){return Vr.isBundleWithCertificateChain},"get")});Object.defineProperty(k,"isBundleWithDsseEnvelope",{enumerable:!0,get:o(function(){return Vr.isBundleWithDsseEnvelope},"get")});Object.defineProperty(k,"isBundleWithMessageSignature",{enumerable:!0,get:o(function(){return Vr.isBundleWithMessageSignature},"get")});Object.defineProperty(k,"isBundleWithPublicKey",{enumerable:!0,get:o(function(){return Vr.isBundleWithPublicKey},"get")});var Pte=V_();Object.defineProperty(k,"ValidationError",{enumerable:!0,get:o(function(){return Pte.ValidationError},"get")});var Kd=hk();Object.defineProperty(k,"bundleFromJSON",{enumerable:!0,get:o(function(){return Kd.bundleFromJSON},"get")});Object.defineProperty(k,"bundleToJSON",{enumerable:!0,get:o(function(){return Kd.bundleToJSON},"get")});Object.defineProperty(k,"envelopeFromJSON",{enumerable:!0,get:o(function(){return Kd.envelopeFromJSON},"get")});Object.defineProperty(k,"envelopeToJSON",{enumerable:!0,get:o(function(){return Kd.envelopeToJSON},"get")});var nu=z_();Object.defineProperty(k,"assertBundle",{enumerable:!0,get:o(function(){return nu.assertBundle},"get")});Object.defineProperty(k,"assertBundleLatest",{enumerable:!0,get:o(function(){return nu.assertBundleLatest},"get")});Object.defineProperty(k,"assertBundleV01",{enumerable:!0,get:o(function(){return nu.assertBundleV01},"get")});Object.defineProperty(k,"assertBundleV02",{enumerable:!0,get:o(function(){return nu.assertBundleV02},"get")});Object.defineProperty(k,"isBundleV01",{enumerable:!0,get:o(function(){return nu.isBundleV01},"get")})});var au=d(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});Yd.ByteStream=void 0;var G_=class extends Error{static{o(this,"StreamError")}},Zd=class i{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 r=e+t;if(r>this.length)throw new G_("request past end of buffer");return this.view.subarray(e,r)}appendChar(e){this.ensureCapacity(1),this.view[this.start]=e,this.start+=1}appendUint16(e){this.ensureCapacity(2);let t=new Uint16Array([e]),r=new Uint8Array(t.buffer);this.view[this.start]=r[1],this.view[this.start+1]=r[0],this.start+=2}appendUint24(e){this.ensureCapacity(3);let t=new Uint32Array([e]),r=new Uint8Array(t.buffer);this.view[this.start]=r[2],this.view[this.start+1]=r[1],this.view[this.start+2]=r[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=i.BLOCK_SIZE+(e>i.BLOCK_SIZE?e:0);this.realloc(this.view.byteLength+t)}}realloc(e){let t=new ArrayBuffer(e),r=Buffer.from(t);r.set(this.view),this.buf=t,this.view=r}};Yd.ByteStream=Zd;Zd.BLOCK_SIZE=1024});var Xd=d(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});Do.ASN1TypeError=Do.ASN1ParseError=void 0;var W_=class extends Error{static{o(this,"ASN1ParseError")}};Do.ASN1ParseError=W_;var J_=class extends Error{static{o(this,"ASN1TypeError")}};Do.ASN1TypeError=J_});var pk=d(Qd=>{"use strict";Object.defineProperty(Qd,"__esModule",{value:!0});Qd.decodeLength=Dte;Qd.encodeLength=xte;var dk=Xd();function Dte(i){let e=i.getUint8();if((e&128)===0)return e;let t=e&127;if(t>6)throw new dk.ASN1ParseError("length exceeds 6 byte limit");let r=0;for(let s=0;s<t;s++)r=r*256+i.getUint8();if(r===0)throw new dk.ASN1ParseError("indefinite length encoding not supported");return r}o(Dte,"decodeLength");function xte(i){if(i<128)return Buffer.from([i]);let e=BigInt(i),t=[];for(;e>0n;)t.unshift(Number(e&255n)),e=e>>8n;return Buffer.from([128|t.length,...t])}o(xte,"encodeLength")});var gk=d(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.parseInteger=Bte;zr.parseStringASCII=mk;zr.parseTime=kte;zr.parseOID=Fte;zr.parseBoolean=Ute;zr.parseBitString=jte;var Lte=/^(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\.\d{3})?Z$/,Mte=/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\.\d{3})?Z$/;function Bte(i){let e=0,t=i.length,r=i[e],s=r>127,n=s?255:0;for(;r==n&&++e<t;)r=i[e];if(t-e===0)return BigInt(s?-1:0);r=s?r-256:r;let c=BigInt(r);for(let u=e+1;u<t;++u)c=c*BigInt(256)+BigInt(i[u]);return c}o(Bte,"parseInteger");function mk(i){return i.toString("ascii")}o(mk,"parseStringASCII");function kte(i,e){let t=mk(i),r=e?Lte.exec(t):Mte.exec(t);if(!r)throw new Error("invalid time");if(e){let s=Number(r[1]);s+=s>=50?1900:2e3,r[1]=s.toString()}return new Date(`${r[1]}-${r[2]}-${r[3]}T${r[4]}:${r[5]}:${r[6]}Z`)}o(kte,"parseTime");function Fte(i){let e=0,t=i.length,r=i[e++],s=Math.floor(r/40),n=r%40,a=`${s}.${n}`,c=0;for(;e<t;++e)r=i[e],c=(c<<7)+(r&127),(r&128)===0&&(a+=`.${c}`,c=0);return a}o(Fte,"parseOID");function Ute(i){return i[0]!==0}o(Ute,"parseBoolean");function jte(i){let e=i[0],t=1,r=i.length,s=[];for(let n=t;n<r;++n){let a=i[n],c=n===r-1?e:0;for(let u=7;u>=c;--u)s.push(a>>u&1)}return s}o(jte,"parseBitString")});var Sk=d(ep=>{"use strict";Object.defineProperty(ep,"__esModule",{value:!0});ep.ASN1Tag=void 0;var yk=Xd(),Ks={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},K_={UNIVERSAL:0,APPLICATION:1,CONTEXT_SPECIFIC:2,PRIVATE:3},Z_=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 yk.ASN1ParseError("long form tags not supported");if(this.class===K_.UNIVERSAL&&this.number===0)throw new yk.ASN1ParseError("unsupported tag 0x00")}isUniversal(){return this.class===K_.UNIVERSAL}isContextSpecific(e){let t=this.class===K_.CONTEXT_SPECIFIC;return e!==void 0?t&&this.number===e:t}isBoolean(){return this.isUniversal()&&this.number===Ks.BOOLEAN}isInteger(){return this.isUniversal()&&this.number===Ks.INTEGER}isBitString(){return this.isUniversal()&&this.number===Ks.BIT_STRING}isOctetString(){return this.isUniversal()&&this.number===Ks.OCTET_STRING}isOID(){return this.isUniversal()&&this.number===Ks.OBJECT_IDENTIFIER}isUTCTime(){return this.isUniversal()&&this.number===Ks.UTC_TIME}isGeneralizedTime(){return this.isUniversal()&&this.number===Ks.GENERALIZED_TIME}toDER(){return this.number|(this.constructed?32:0)|this.class<<6}};ep.ASN1Tag=Z_});var bk=d(ip=>{"use strict";Object.defineProperty(ip,"__esModule",{value:!0});ip.ASN1Obj=void 0;var Y_=au(),Zs=Xd(),wk=pk(),xo=gk(),$te=Sk(),tp=class{static{o(this,"ASN1Obj")}constructor(e,t,r){this.tag=e,this.value=t,this.subs=r}static parseBuffer(e){return _k(new Y_.ByteStream(e))}toDER(){let e=new Y_.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,r=new Y_.ByteStream;return r.appendChar(this.tag.toDER()),r.appendView((0,wk.encodeLength)(t.length)),r.appendView(t),r.buffer}toBoolean(){if(!this.tag.isBoolean())throw new Zs.ASN1TypeError("not a boolean");return(0,xo.parseBoolean)(this.value)}toInteger(){if(!this.tag.isInteger())throw new Zs.ASN1TypeError("not an integer");return(0,xo.parseInteger)(this.value)}toOID(){if(!this.tag.isOID())throw new Zs.ASN1TypeError("not an OID");return(0,xo.parseOID)(this.value)}toDate(){switch(!0){case this.tag.isUTCTime():return(0,xo.parseTime)(this.value,!0);case this.tag.isGeneralizedTime():return(0,xo.parseTime)(this.value,!1);default:throw new Zs.ASN1TypeError("not a date")}}toBitString(){if(!this.tag.isBitString())throw new Zs.ASN1TypeError("not a bit string");return(0,xo.parseBitString)(this.value)}};ip.ASN1Obj=tp;function _k(i){let e=new $te.ASN1Tag(i.getUint8()),t=(0,wk.decodeLength)(i),r=i.slice(i.position,t),s=i.position,n=[];if(e.constructed)n=Ek(i,t);else if(e.isOctetString())try{n=Ek(i,t)}catch{}return n.length===0&&i.seek(s+t),new tp(e,r,n)}o(_k,"parseStream");function Ek(i,e){let t=i.position+e;if(t>i.length)throw new Zs.ASN1ParseError("invalid length");let r=[];for(;i.position<t;)r.push(_k(i));if(i.position!==t)throw new Zs.ASN1ParseError("invalid length");return r}o(Ek,"collectSubs")});var sp=d(rp=>{"use strict";Object.defineProperty(rp,"__esModule",{value:!0});rp.ASN1Obj=void 0;var qte=bk();Object.defineProperty(rp,"ASN1Obj",{enumerable:!0,get:o(function(){return qte.ASN1Obj},"get")})});var Lo=d(Hr=>{"use strict";var Vte=Hr&&Hr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Hr,"__esModule",{value:!0});Hr.createPublicKey=zte;Hr.digest=Hte;Hr.verify=Gte;Hr.bufferEqual=Wte;var cu=Vte(require("crypto"));function zte(i,e="spki"){return typeof i=="string"?cu.default.createPublicKey(i):cu.default.createPublicKey({key:i,format:"der",type:e})}o(zte,"createPublicKey");function Hte(i,...e){let t=cu.default.createHash(i);for(let r of e)t.update(r);return t.digest()}o(Hte,"digest");function Gte(i,e,t,r){try{return cu.default.verify(r,i,e,t)}catch{return!1}}o(Gte,"verify");function Wte(i,e){try{return cu.default.timingSafeEqual(i,e)}catch{return!1}}o(Wte,"bufferEqual")});var Ik=d(X_=>{"use strict";Object.defineProperty(X_,"__esModule",{value:!0});X_.preAuthEncoding=Kte;var Jte="DSSEv1";function Kte(i,e){let t=[Jte,i.length,i,e.length,""].join(" ");return Buffer.concat([Buffer.from(t,"ascii"),e])}o(Kte,"preAuthEncoding")});var Rk=d(np=>{"use strict";Object.defineProperty(np,"__esModule",{value:!0});np.base64Encode=Zte;np.base64Decode=Yte;var Ok="base64",vk="utf-8";function Zte(i){return Buffer.from(i,vk).toString(Ok)}o(Zte,"base64Encode");function Yte(i){return Buffer.from(i,Ok).toString(vk)}o(Yte,"base64Decode")});var Ak=d(eb=>{"use strict";Object.defineProperty(eb,"__esModule",{value:!0});eb.canonicalize=Q_;function Q_(i){let e="";if(i===null||typeof i!="object"||i.toJSON!=null)e+=JSON.stringify(i);else if(Array.isArray(i)){e+="[";let t=!0;i.forEach(r=>{t||(e+=","),t=!1,e+=Q_(r)}),e+="]"}else{e+="{";let t=!0;Object.keys(i).sort().forEach(r=>{t||(e+=","),t=!1,e+=JSON.stringify(r),e+=":",e+=Q_(i[r])}),e+="}"}return e}o(Q_,"canonicalize")});var tb=d(op=>{"use strict";Object.defineProperty(op,"__esModule",{value:!0});op.toDER=eie;op.fromDER=tie;var Xte=/-----BEGIN (.*)-----/,Qte=/-----END (.*)-----/;function eie(i){let e="";return i.split(`
56
+ `).forEach(t=>{t.match(Xte)||t.match(Qte)||(e+=t)}),Buffer.from(e,"base64")}o(eie,"toDER");function tie(i,e="CERTIFICATE"){let r=i.toString("base64").match(/.{1,64}/g)||"";return[`-----BEGIN ${e}-----`,...r,`-----END ${e}-----`].join(`
56
57
  `).concat(`
57
- `)}o(Qte,"fromDER")});var ap=d(Mo=>{"use strict";Object.defineProperty(Mo,"__esModule",{value:!0});Mo.SHA2_HASH_ALGOS=Mo.ECDSA_SIGNATURE_ALGOS=void 0;Mo.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"};Mo.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 rb=d(cp=>{"use strict";Object.defineProperty(cp,"__esModule",{value:!0});cp.RFC3161TimestampVerificationError=void 0;var ib=class extends Error{static{o(this,"RFC3161TimestampVerificationError")}};cp.RFC3161TimestampVerificationError=ib});var Ck=d(Ci=>{"use strict";var eie=Ci&&Ci.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),tie=Ci&&Ci.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),iie=Ci&&Ci.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&eie(t,e,r[s]);return tie(t,e),t}})();Object.defineProperty(Ci,"__esModule",{value:!0});Ci.TSTInfo=void 0;var Tk=iie(Lo()),rie=ap(),sie=rb(),sb=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 rie.SHA2_HASH_ALGOS[e]}get messageImprintHashedMessage(){return this.messageImprintObj.subs[1].value}get raw(){return this.root.toDER()}verify(e){let t=Tk.digest(this.messageImprintHashAlgorithm,e);if(!Tk.bufferEqual(t,this.messageImprintHashedMessage))throw new sie.RFC3161TimestampVerificationError("message imprint does not match artifact")}get messageImprintObj(){return this.root.subs[2]}};Ci.TSTInfo=sb});var Pk=d(Ni=>{"use strict";var nie=Ni&&Ni.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),oie=Ni&&Ni.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),aie=Ni&&Ni.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&nie(t,e,r[s]);return oie(t,e),t}})();Object.defineProperty(Ni,"__esModule",{value:!0});Ni.RFC3161Timestamp=void 0;var cie=sp(),nb=aie(Lo()),Nk=ap(),uu=rb(),uie=Ck(),lie="1.2.840.113549.1.7.2",hie="1.2.840.113549.1.9.16.1.4",fie="1.2.840.113549.1.9.4",ob=class i{static{o(this,"RFC3161Timestamp")}constructor(e){this.root=e}static parse(e){let t=cie.ASN1Obj.parseBuffer(e);return new i(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 Nk.SHA2_HASH_ALGOS[e]}get signatureAlgorithm(){let e=this.signatureAlgorithmObj.subs[0].toOID();return Nk.ECDSA_SIGNATURE_ALGOS[e]}get signatureValue(){return this.signatureValueObj.value}get tstInfo(){return new uie.TSTInfo(this.eContentObj.subs[0].subs[0])}verify(e,t){if(!this.timeStampTokenObj)throw new uu.RFC3161TimestampVerificationError("timeStampToken is missing");if(this.contentType!==lie)throw new uu.RFC3161TimestampVerificationError(`incorrect content type: ${this.contentType}`);if(this.eContentType!==hie)throw new uu.RFC3161TimestampVerificationError(`incorrect encapsulated content type: ${this.eContentType}`);this.tstInfo.verify(e),this.verifyMessageDigest(),this.verifySignature(t)}verifyMessageDigest(){let e=nb.digest(this.signerDigestAlgorithm,this.tstInfo.raw),t=this.messageDigestAttributeObj.subs[1].subs[0].value;if(!nb.bufferEqual(e,t))throw new uu.RFC3161TimestampVerificationError("signed data does not match tstInfo")}verifySignature(e){let t=this.signedAttrsObj.toDER();if(t[0]=49,!nb.verify(t,e,this.signatureValue,this.signatureAlgorithm))throw new uu.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()===fie)}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]}};Ni.RFC3161Timestamp=ob});var Dk=d(up=>{"use strict";Object.defineProperty(up,"__esModule",{value:!0});up.RFC3161Timestamp=void 0;var die=Pk();Object.defineProperty(up,"RFC3161Timestamp",{enumerable:!0,get:o(function(){return die.RFC3161Timestamp},"get")})});var Lk=d(Pi=>{"use strict";var pie=Pi&&Pi.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),mie=Pi&&Pi.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),gie=Pi&&Pi.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&pie(t,e,r[s]);return mie(t,e),t}})();Object.defineProperty(Pi,"__esModule",{value:!0});Pi.SignedCertificateTimestamp=void 0;var yie=gie(Lo()),xk=au(),ab=class i{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 r=new xk.ByteStream;return r.appendChar(this.version),r.appendChar(0),r.appendView(this.timestamp),r.appendUint16(1),r.appendView(e),r.appendUint16(this.extensions.byteLength),this.extensions.byteLength>0&&r.appendView(this.extensions),yie.verify(r.buffer,t,this.signature,this.algorithm)}static parse(e){let t=new xk.ByteStream(e),r=t.getUint8(),s=t.getBlock(32),n=t.getBlock(8),a=t.getUint16(),c=t.getBlock(a),u=t.getUint8(),l=t.getUint8(),h=t.getUint16(),f=t.getBlock(h);if(t.position!==e.length)throw new Error("SCT buffer length mismatch");return new i({version:r,logID:s,timestamp:n,extensions:c,hashAlgorithm:u,signatureAlgorithm:l,signature:f})}};Pi.SignedCertificateTimestamp=ab});var pb=d($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.X509SCTExtension=$e.X509SubjectKeyIDExtension=$e.X509AuthorityKeyIDExtension=$e.X509SubjectAlternativeNameExtension=$e.X509KeyUsageExtension=$e.X509BasicConstraintsExtension=$e.X509Extension=void 0;var Sie=au(),Eie=Lk(),ur=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]}};$e.X509Extension=ur;var cb=class extends ur{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]}};$e.X509BasicConstraintsExtension=cb;var ub=class extends ur{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()}};$e.X509KeyUsageExtension=ub;var lb=class extends ur{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}};$e.X509SubjectAlternativeNameExtension=lb;var hb=class extends ur{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]}};$e.X509AuthorityKeyIDExtension=hb;var fb=class extends ur{static{o(this,"X509SubjectKeyIDExtension")}get keyIdentifier(){return this.extnValueObj.subs[0].value}};$e.X509SubjectKeyIDExtension=fb;var db=class extends ur{static{o(this,"X509SCTExtension")}constructor(e){super(e)}get signedCertificateTimestamps(){let e=this.extnValueObj.subs[0].value,t=new Sie.ByteStream(e),r=t.getUint16()+2,s=[];for(;t.position<r;){let n=t.getUint16(),a=t.getBlock(n);s.push(Eie.SignedCertificateTimestamp.parse(a))}if(t.position!==r)throw new Error("SCT list length does not match actual length");return s}};$e.X509SCTExtension=db});var kk=d(yt=>{"use strict";var wie=yt&&yt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),_ie=yt&&yt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Bk=yt&&yt.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&wie(t,e,r[s]);return _ie(t,e),t}})();Object.defineProperty(yt,"__esModule",{value:!0});yt.X509Certificate=yt.EXTENSION_OID_SCT=void 0;var bie=sp(),Mk=Bk(Lo()),Iie=ap(),Oie=Bk(tb()),Ys=pb(),vie="2.5.29.14",Rie="2.5.29.15",Aie="2.5.29.17",Tie="2.5.29.19",Cie="2.5.29.35";yt.EXTENSION_OID_SCT="1.3.6.1.4.1.11129.2.4.2";var mb=class i{static{o(this,"X509Certificate")}constructor(e){this.root=e}static parse(e){let t=typeof e=="string"?Oie.toDER(e):e,r=bie.ASN1Obj.parseBuffer(t);return new i(r)}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 Iie.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(Rie);return e?new Ys.X509KeyUsageExtension(e):void 0}get extBasicConstraints(){let e=this.findExtension(Tie);return e?new Ys.X509BasicConstraintsExtension(e):void 0}get extSubjectAltName(){let e=this.findExtension(Aie);return e?new Ys.X509SubjectAlternativeNameExtension(e):void 0}get extAuthorityKeyID(){let e=this.findExtension(Cie);return e?new Ys.X509AuthorityKeyIDExtension(e):void 0}get extSubjectKeyID(){let e=this.findExtension(vie);return e?new Ys.X509SubjectKeyIDExtension(e):void 0}get extSCT(){let e=this.findExtension(yt.EXTENSION_OID_SCT);return e?new Ys.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 Ys.X509Extension(t):void 0}verify(e){let t=e?.publicKey||this.publicKey,r=Mk.createPublicKey(t);return Mk.verify(this.tbsCertificate.toDER(),r,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),i.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))}};yt.X509Certificate=mb});var Uk=d(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.X509SCTExtension=Gr.X509Certificate=Gr.EXTENSION_OID_SCT=void 0;var Fk=kk();Object.defineProperty(Gr,"EXTENSION_OID_SCT",{enumerable:!0,get:o(function(){return Fk.EXTENSION_OID_SCT},"get")});Object.defineProperty(Gr,"X509Certificate",{enumerable:!0,get:o(function(){return Fk.X509Certificate},"get")});var Nie=pb();Object.defineProperty(Gr,"X509SCTExtension",{enumerable:!0,get:o(function(){return Nie.X509SCTExtension},"get")})});var ot=d(K=>{"use strict";var Pie=K&&K.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),Die=K&&K.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),lu=K&&K.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&Pie(t,e,r[s]);return Die(t,e),t}})();Object.defineProperty(K,"__esModule",{value:!0});K.X509SCTExtension=K.X509Certificate=K.EXTENSION_OID_SCT=K.ByteStream=K.RFC3161Timestamp=K.pem=K.json=K.encoding=K.dsse=K.crypto=K.ASN1Obj=void 0;var xie=sp();Object.defineProperty(K,"ASN1Obj",{enumerable:!0,get:o(function(){return xie.ASN1Obj},"get")});K.crypto=lu(Lo());K.dsse=lu(Ik());K.encoding=lu(Rk());K.json=lu(Ak());K.pem=lu(tb());var Lie=Dk();Object.defineProperty(K,"RFC3161Timestamp",{enumerable:!0,get:o(function(){return Lie.RFC3161Timestamp},"get")});var Mie=au();Object.defineProperty(K,"ByteStream",{enumerable:!0,get:o(function(){return Mie.ByteStream},"get")});var gb=Uk();Object.defineProperty(K,"EXTENSION_OID_SCT",{enumerable:!0,get:o(function(){return gb.EXTENSION_OID_SCT},"get")});Object.defineProperty(K,"X509Certificate",{enumerable:!0,get:o(function(){return gb.X509Certificate},"get")});Object.defineProperty(K,"X509SCTExtension",{enumerable:!0,get:o(function(){return gb.X509SCTExtension},"get")})});var jk=d(yb=>{"use strict";Object.defineProperty(yb,"__esModule",{value:!0});yb.extractJWTSubject=kie;var Bie=ot();function kie(i){let e=i.split(".",3),t=JSON.parse(Bie.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(kie,"extractJWTSubject")});var $k=d((o_e,Fie)=>{Fie.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 Vk=d(Bo=>{"use strict";var Uie=Bo&&Bo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Bo,"__esModule",{value:!0});Bo.getUserAgent=void 0;var qk=Uie(require("os")),jie=o(()=>{let i=$k().version,e=process.version,t=qk.default.platform(),r=qk.default.arch();return`sigstore-js/${i} (Node ${e}) (${t}/${r})`},"getUserAgent");Bo.getUserAgent=jie});var Wr=d(fe=>{"use strict";var $ie=fe&&fe.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),qie=fe&&fe.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),zk=fe&&fe.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&$ie(t,e,r[s]);return qie(t,e),t}})();Object.defineProperty(fe,"__esModule",{value:!0});fe.ua=fe.oidc=fe.pem=fe.json=fe.encoding=fe.dsse=fe.crypto=void 0;var hu=ot();Object.defineProperty(fe,"crypto",{enumerable:!0,get:o(function(){return hu.crypto},"get")});Object.defineProperty(fe,"dsse",{enumerable:!0,get:o(function(){return hu.dsse},"get")});Object.defineProperty(fe,"encoding",{enumerable:!0,get:o(function(){return hu.encoding},"get")});Object.defineProperty(fe,"json",{enumerable:!0,get:o(function(){return hu.json},"get")});Object.defineProperty(fe,"pem",{enumerable:!0,get:o(function(){return hu.pem},"get")});fe.oidc=zk(jk());fe.ua=zk(Vk())});var Eb=d(lp=>{"use strict";Object.defineProperty(lp,"__esModule",{value:!0});lp.BaseBundleBuilder=void 0;var Sb=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)),r=await this.package(e,t),s=await Promise.all(this.witnesses.map(c=>c.testify(r.content,Vie(t.key)))),n=[],a=[];return s.forEach(({tlogEntries:c,rfc3161Timestamps:u})=>{n.push(...c??[]),a.push(...u??[])}),r.verificationMaterial.tlogEntries=n,r.verificationMaterial.timestampVerificationData={rfc3161Timestamps:a},r}async prepare(e){return e.data}};lp.BaseBundleBuilder=Sb;function Vie(i){switch(i.$case){case"publicKey":return i.publicKey;case"x509Certificate":return i.certificate}}o(Vie,"publicKey")});var _b=d(Di=>{"use strict";var zie=Di&&Di.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),Hie=Di&&Di.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Gie=Di&&Di.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&zie(t,e,r[s]);return Hie(t,e),t}})();Object.defineProperty(Di,"__esModule",{value:!0});Di.toMessageSignatureBundle=Wie;Di.toDSSEBundle=Jie;var Hk=Gie(ou()),wb=Wr();function Wie(i,e){let t=wb.crypto.digest("sha256",i.data);return Hk.toMessageSignatureBundle({digest:t,signature:e.signature,certificate:e.key.$case==="x509Certificate"?wb.pem.toDER(e.key.certificate):void 0,keyHint:e.key.$case==="publicKey"?e.key.hint:void 0,certificateChain:!0})}o(Wie,"toMessageSignatureBundle");function Jie(i,e,t){return Hk.toDSSEBundle({artifact:i.data,artifactType:i.type,signature:e.signature,certificate:e.key.$case==="x509Certificate"?wb.pem.toDER(e.key.certificate):void 0,keyHint:e.key.$case==="publicKey"?e.key.hint:void 0,certificateChain:t})}o(Jie,"toDSSEBundle")});var Wk=d(hp=>{"use strict";Object.defineProperty(hp,"__esModule",{value:!0});hp.DSSEBundleBuilder=void 0;var Kie=Wr(),Zie=Eb(),Yie=_b(),bb=class extends Zie.BaseBundleBuilder{static{o(this,"DSSEBundleBuilder")}constructor(e){super(e),this.certificateChain=e.certificateChain??!1}async prepare(e){let t=Gk(e);return Kie.dsse.preAuthEncoding(t.type,t.data)}async package(e,t){return(0,Yie.toDSSEBundle)(Gk(e),t,this.certificateChain)}};hp.DSSEBundleBuilder=bb;function Gk(i){return{...i,type:i.type??""}}o(Gk,"artifactDefaults")});var Jk=d(fp=>{"use strict";Object.defineProperty(fp,"__esModule",{value:!0});fp.MessageSignatureBundleBuilder=void 0;var Xie=Eb(),Qie=_b(),Ib=class extends Xie.BaseBundleBuilder{static{o(this,"MessageSignatureBundleBuilder")}constructor(e){super(e)}async package(e,t){return(0,Qie.toMessageSignatureBundle)(e,t)}};fp.MessageSignatureBundleBuilder=Ib});var Kk=d(ko=>{"use strict";Object.defineProperty(ko,"__esModule",{value:!0});ko.MessageSignatureBundleBuilder=ko.DSSEBundleBuilder=void 0;var ere=Wk();Object.defineProperty(ko,"DSSEBundleBuilder",{enumerable:!0,get:o(function(){return ere.DSSEBundleBuilder},"get")});var tre=Jk();Object.defineProperty(ko,"MessageSignatureBundleBuilder",{enumerable:!0,get:o(function(){return tre.MessageSignatureBundleBuilder},"get")})});var pp=d(dp=>{"use strict";Object.defineProperty(dp,"__esModule",{value:!0});dp.HTTPError=void 0;var Ob=class extends Error{static{o(this,"HTTPError")}constructor({status:e,message:t,location:r}){super(`(${e}) ${t}`),this.statusCode=e,this.location=r}};dp.HTTPError=Ob});var Fo=d(fu=>{"use strict";Object.defineProperty(fu,"__esModule",{value:!0});fu.InternalError=void 0;fu.internalError=rre;var ire=pp(),mp=class extends Error{static{o(this,"InternalError")}constructor({code:e,message:t,cause:r}){super(t),this.name=this.constructor.name,this.cause=r,this.code=e}};fu.InternalError=mp;function rre(i,e,t){throw i instanceof ire.HTTPError&&(t+=` - ${i.message}`),new mp({code:e,message:t,cause:i})}o(rre,"internalError")});var Zk=d(Uo=>{"use strict";var sre=Uo&&Uo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Uo,"__esModule",{value:!0});Uo.CIContextProvider=void 0;var nre=sre(iu()),ore=[are,cre],vb=class{static{o(this,"CIContextProvider")}constructor(e="sigstore"){this.audience=e}async getToken(){return Promise.any(ore.map(e=>e(this.audience))).catch(()=>Promise.reject("CI: no tokens available"))}};Uo.CIContextProvider=vb;async function are(i){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",i),(await(0,nre.default)(e.href,{retry:2,headers:{Accept:"application/json",Authorization:`Bearer ${process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN}`}})).json().then(r=>r.value)}o(are,"getGHAToken");async function cre(){return process.env.SIGSTORE_ID_TOKEN?process.env.SIGSTORE_ID_TOKEN:Promise.reject("no token available")}o(cre,"getEnv")});var Yk=d(gp=>{"use strict";Object.defineProperty(gp,"__esModule",{value:!0});gp.CIContextProvider=void 0;var ure=Zk();Object.defineProperty(gp,"CIContextProvider",{enumerable:!0,get:o(function(){return ure.CIContextProvider},"get")})});var yp=d(du=>{"use strict";var Qk=du&&du.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(du,"__esModule",{value:!0});du.fetchWithRetry=_re;var lre=require("http2"),hre=Qk(iu()),Xk=St(),fre=Qk(xa()),dre=Wr(),pre=pp(),{HTTP2_HEADER_LOCATION:mre,HTTP2_HEADER_CONTENT_TYPE:gre,HTTP2_HEADER_USER_AGENT:yre,HTTP_STATUS_INTERNAL_SERVER_ERROR:Sre,HTTP_STATUS_TOO_MANY_REQUESTS:Ere,HTTP_STATUS_REQUEST_TIMEOUT:wre}=lre.constants;async function _re(i,e){return(0,fre.default)(async(t,r)=>{let s=e.method||"POST",n={[yre]:dre.ua.getUserAgent(),...e.headers},a=await(0,hre.default)(i,{method:s,headers:n,body:e.body,timeout:e.timeout,retry:!1}).catch(c=>(Xk.log.http("fetch",`${s} ${i} attempt ${r} failed with ${c}`),t(c)));if(a.ok)return a;{let c=await bre(a);if(Xk.log.http("fetch",`${s} ${i} attempt ${r} failed with ${a.status}`),Ire(a.status))return t(c);throw c}},Ore(e.retry))}o(_re,"fetchWithRetry");var bre=o(async i=>{let e=i.statusText,t=i.headers.get(mre)||void 0;if(i.headers.get(gre)?.includes("application/json"))try{e=(await i.json()).message||e}catch{}return new pre.HTTPError({status:i.status,message:e,location:t})},"errorFromResponse"),Ire=o(i=>[wre,Ere].includes(i)||i>=Sre,"retryable"),Ore=o(i=>typeof i=="boolean"?{retries:i?1:0}:typeof i=="number"?{retries:i}:{retries:0,...i},"retryOpts")});var eF=d(Sp=>{"use strict";Object.defineProperty(Sp,"__esModule",{value:!0});Sp.Fulcio=void 0;var vre=yp(),Rb=class{static{o(this,"Fulcio")}constructor(e){this.options=e}async createSigningCertificate(e){let{baseURL:t,retry:r,timeout:s}=this.options,n=`${t}/api/v2/signingCert`;return(await(0,vre.fetchWithRetry)(n,{headers:{"Content-Type":"application/json"},body:JSON.stringify(e),timeout:s,retry:r})).json()}};Sp.Fulcio=Rb});var tF=d(Ep=>{"use strict";Object.defineProperty(Ep,"__esModule",{value:!0});Ep.CAClient=void 0;var Rre=Fo(),Are=eF(),Ab=class{static{o(this,"CAClient")}constructor(e){this.fulcio=new Are.Fulcio({baseURL:e.fulcioBaseURL,retry:e.retry,timeout:e.timeout})}async createSigningCertificate(e,t,r){let s=Tre(e,t,r);try{let n=await this.fulcio.createSigningCertificate(s);return(n.signedCertificateEmbeddedSct?n.signedCertificateEmbeddedSct:n.signedCertificateDetachedSct).chain.certificates}catch(n){(0,Rre.internalError)(n,"CA_CREATE_SIGNING_CERTIFICATE_ERROR","error creating signing certificate")}}};Ep.CAClient=Ab;function Tre(i,e,t){return{credentials:{oidcIdentityToken:i},publicKeyRequest:{publicKey:{algorithm:"ECDSA",content:e},proofOfPossession:t.toString("base64")}}}o(Tre,"toCertificateRequest")});var rF=d(jo=>{"use strict";var Cre=jo&&jo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(jo,"__esModule",{value:!0});jo.EphemeralSigner=void 0;var iF=Cre(require("crypto")),Nre="ec",Pre="P-256",Tb=class{static{o(this,"EphemeralSigner")}constructor(){this.keypair=iF.default.generateKeyPairSync(Nre,{namedCurve:Pre})}async sign(e){let t=iF.default.sign(null,e,this.keypair.privateKey),r=this.keypair.publicKey.export({format:"pem",type:"spki"}).toString("ascii");return{signature:t,key:{$case:"publicKey",publicKey:r}}}};jo.EphemeralSigner=Tb});var sF=d(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});Xs.FulcioSigner=Xs.DEFAULT_FULCIO_URL=void 0;var Cb=Fo(),Dre=Wr(),xre=tF(),Lre=rF();Xs.DEFAULT_FULCIO_URL="https://fulcio.sigstore.dev";var Nb=class{static{o(this,"FulcioSigner")}constructor(e){this.ca=new xre.CAClient({...e,fulcioBaseURL:e.fulcioBaseURL||Xs.DEFAULT_FULCIO_URL}),this.identityProvider=e.identityProvider,this.keyHolder=e.keyHolder||new Lre.EphemeralSigner}async sign(e){let t=await this.getIdentityToken(),r;try{r=Dre.oidc.extractJWTSubject(t)}catch(c){throw new Cb.InternalError({code:"IDENTITY_TOKEN_PARSE_ERROR",message:`invalid identity token: ${t}`,cause:c})}let s=await this.keyHolder.sign(Buffer.from(r));if(s.key.$case!=="publicKey")throw new Cb.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 Cb.InternalError({code:"IDENTITY_TOKEN_READ_ERROR",message:"error retrieving identity token",cause:e})}}};Xs.FulcioSigner=Nb});var oF=d($o=>{"use strict";Object.defineProperty($o,"__esModule",{value:!0});$o.FulcioSigner=$o.DEFAULT_FULCIO_URL=void 0;var nF=sF();Object.defineProperty($o,"DEFAULT_FULCIO_URL",{enumerable:!0,get:o(function(){return nF.DEFAULT_FULCIO_URL},"get")});Object.defineProperty($o,"FulcioSigner",{enumerable:!0,get:o(function(){return nF.FulcioSigner},"get")})});var uF=d(wp=>{"use strict";Object.defineProperty(wp,"__esModule",{value:!0});wp.Rekor=void 0;var aF=yp(),Pb=class{static{o(this,"Rekor")}constructor(e){this.options=e}async createEntry(e){let{baseURL:t,timeout:r,retry:s}=this.options,n=`${t}/api/v1/log/entries`,c=await(await(0,aF.fetchWithRetry)(n,{headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(e),timeout:r,retry:s})).json();return cF(c)}async getEntry(e){let{baseURL:t,timeout:r,retry:s}=this.options,n=`${t}/api/v1/log/entries/${e}`,c=await(await(0,aF.fetchWithRetry)(n,{method:"GET",headers:{Accept:"application/json"},timeout:r,retry:s})).json();return cF(c)}};wp.Rekor=Pb;function cF(i){let e=Object.entries(i);if(e.length!=1)throw new Error("Received multiple entries in Rekor response");let[t,r]=e[0];return{...r,uuid:t}}o(cF,"entryFromResponse")});var hF=d(_p=>{"use strict";Object.defineProperty(_p,"__esModule",{value:!0});_p.TLogClient=void 0;var lF=Fo(),Mre=pp(),Bre=uF(),Db=class{static{o(this,"TLogClient")}constructor(e){this.fetchOnConflict=e.fetchOnConflict??!1,this.rekor=new Bre.Rekor({baseURL:e.rekorBaseURL,retry:e.retry,timeout:e.timeout})}async createEntry(e){let t;try{t=await this.rekor.createEntry(e)}catch(r){if(kre(r)&&this.fetchOnConflict){let s=r.location.split("/").pop()||"";try{t=await this.rekor.getEntry(s)}catch(n){(0,lF.internalError)(n,"TLOG_FETCH_ENTRY_ERROR","error fetching tlog entry")}}else(0,lF.internalError)(r,"TLOG_CREATE_ENTRY_ERROR","error creating tlog entry")}return t}};_p.TLogClient=Db;function kre(i){return i instanceof Mre.HTTPError&&i.statusCode===409&&i.location!==void 0}o(kre,"entryExistsError")});var fF=d(xb=>{"use strict";Object.defineProperty(xb,"__esModule",{value:!0});xb.toProposedEntry=Ure;var Fre=ou(),Jr=Wr(),pu="sha256";function Ure(i,e,t="dsse"){switch(i.$case){case"dsseEnvelope":return t==="intoto"?qre(i.dsseEnvelope,e):$re(i.dsseEnvelope,e);case"messageSignature":return jre(i.messageSignature,e)}}o(Ure,"toProposedEntry");function jre(i,e){let t=i.messageDigest.digest.toString("hex"),r=i.signature.toString("base64"),s=Jr.encoding.base64Encode(e);return{apiVersion:"0.0.1",kind:"hashedrekord",spec:{data:{hash:{algorithm:pu,value:t}},signature:{content:r,publicKey:{content:s}}}}}o(jre,"toProposedHashedRekordEntry");function $re(i,e){let t=JSON.stringify((0,Fre.envelopeToJSON)(i)),r=Jr.encoding.base64Encode(e);return{apiVersion:"0.0.1",kind:"dsse",spec:{proposedContent:{envelope:t,verifiers:[r]}}}}o($re,"toProposedDSSEEntry");function qre(i,e){let t=Jr.crypto.digest(pu,i.payload).toString("hex"),r=Vre(i,e),s=Jr.encoding.base64Encode(i.payload.toString("base64")),n=Jr.encoding.base64Encode(i.signatures[0].sig.toString("base64")),a=i.signatures[0].keyid,c=Jr.encoding.base64Encode(e),u={payloadType:i.payloadType,payload:s,signatures:[{sig:n,publicKey:c}]};return a.length>0&&(u.signatures[0].keyid=a),{apiVersion:"0.0.2",kind:"intoto",spec:{content:{envelope:u,hash:{algorithm:pu,value:r},payloadHash:{algorithm:pu,value:t}}}}}o(qre,"toProposedIntotoEntry");function Vre(i,e){let t={payloadType:i.payloadType,payload:i.payload.toString("base64"),signatures:[{sig:i.signatures[0].sig.toString("base64"),publicKey:e}]};return i.signatures[0].keyid.length>0&&(t.signatures[0].keyid=i.signatures[0].keyid),Jr.crypto.digest(pu,Jr.json.canonicalize(t)).toString("hex")}o(Vre,"calculateDSSEHash")});var dF=d(Qs=>{"use strict";Object.defineProperty(Qs,"__esModule",{value:!0});Qs.RekorWitness=Qs.DEFAULT_REKOR_URL=void 0;var zre=Wr(),Hre=hF(),Gre=fF();Qs.DEFAULT_REKOR_URL="https://rekor.sigstore.dev";var Lb=class{static{o(this,"RekorWitness")}constructor(e){this.entryType=e.entryType,this.tlog=new Hre.TLogClient({...e,rekorBaseURL:e.rekorBaseURL||Qs.DEFAULT_REKOR_URL})}async testify(e,t){let r=(0,Gre.toProposedEntry)(e,t,this.entryType),s=await this.tlog.createEntry(r);return Wre(s)}};Qs.RekorWitness=Lb;function Wre(i){let e=Buffer.from(i.logID,"hex"),t=zre.encoding.base64Decode(i.body),r=JSON.parse(t),s=i?.verification?.signedEntryTimestamp?Jre(i.verification.signedEntryTimestamp):void 0,n=i?.verification?.inclusionProof?Kre(i.verification.inclusionProof):void 0;return{tlogEntries:[{logIndex:i.logIndex.toString(),logId:{keyId:e},integratedTime:i.integratedTime.toString(),kindVersion:{kind:r.kind,version:r.apiVersion},inclusionPromise:s,inclusionProof:n,canonicalizedBody:Buffer.from(i.body,"base64")}]}}o(Wre,"toTransparencyLogEntry");function Jre(i){return{signedEntryTimestamp:Buffer.from(i,"base64")}}o(Jre,"inclusionPromise");function Kre(i){return{logIndex:i.logIndex.toString(),treeSize:i.treeSize.toString(),rootHash:Buffer.from(i.rootHash,"hex"),hashes:i.hashes.map(e=>Buffer.from(e,"hex")),checkpoint:{envelope:i.checkpoint}}}o(Kre,"inclusionProof")});var pF=d(bp=>{"use strict";Object.defineProperty(bp,"__esModule",{value:!0});bp.TimestampAuthority=void 0;var Zre=yp(),Mb=class{static{o(this,"TimestampAuthority")}constructor(e){this.options=e}async createTimestamp(e){let{baseURL:t,timeout:r,retry:s}=this.options,n=`${t}/api/v1/timestamp`;return(await(0,Zre.fetchWithRetry)(n,{headers:{"Content-Type":"application/json"},body:JSON.stringify(e),timeout:r,retry:s})).buffer()}};bp.TimestampAuthority=Mb});var gF=d(Ip=>{"use strict";Object.defineProperty(Ip,"__esModule",{value:!0});Ip.TSAClient=void 0;var Yre=Fo(),Xre=pF(),Qre=Wr(),mF="sha256",Bb=class{static{o(this,"TSAClient")}constructor(e){this.tsa=new Xre.TimestampAuthority({baseURL:e.tsaBaseURL,retry:e.retry,timeout:e.timeout})}async createTimestamp(e){let t={artifactHash:Qre.crypto.digest(mF,e).toString("base64"),hashAlgorithm:mF};try{return await this.tsa.createTimestamp(t)}catch(r){(0,Yre.internalError)(r,"TSA_CREATE_TIMESTAMP_ERROR","error creating timestamp")}}};Ip.TSAClient=Bb});var yF=d(Op=>{"use strict";Object.defineProperty(Op,"__esModule",{value:!0});Op.TSAWitness=void 0;var ese=gF(),kb=class{static{o(this,"TSAWitness")}constructor(e){this.tsa=new ese.TSAClient({tsaBaseURL:e.tsaBaseURL,retry:e.retry,timeout:e.timeout})}async testify(e){let t=tse(e);return{rfc3161Timestamps:[{signedTimestamp:await this.tsa.createTimestamp(t)}]}}};Op.TSAWitness=kb;function tse(i){switch(i.$case){case"dsseEnvelope":return i.dsseEnvelope.signatures[0].sig;case"messageSignature":return i.messageSignature.signature}}o(tse,"extractSignature")});var EF=d(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.TSAWitness=Kr.RekorWitness=Kr.DEFAULT_REKOR_URL=void 0;var SF=dF();Object.defineProperty(Kr,"DEFAULT_REKOR_URL",{enumerable:!0,get:o(function(){return SF.DEFAULT_REKOR_URL},"get")});Object.defineProperty(Kr,"RekorWitness",{enumerable:!0,get:o(function(){return SF.RekorWitness},"get")});var ise=yF();Object.defineProperty(Kr,"TSAWitness",{enumerable:!0,get:o(function(){return ise.TSAWitness},"get")})});var Ub=d(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 wF=Kk();Object.defineProperty(be,"DSSEBundleBuilder",{enumerable:!0,get:o(function(){return wF.DSSEBundleBuilder},"get")});Object.defineProperty(be,"MessageSignatureBundleBuilder",{enumerable:!0,get:o(function(){return wF.MessageSignatureBundleBuilder},"get")});var rse=Fo();Object.defineProperty(be,"InternalError",{enumerable:!0,get:o(function(){return rse.InternalError},"get")});var sse=Yk();Object.defineProperty(be,"CIContextProvider",{enumerable:!0,get:o(function(){return sse.CIContextProvider},"get")});var _F=oF();Object.defineProperty(be,"DEFAULT_FULCIO_URL",{enumerable:!0,get:o(function(){return _F.DEFAULT_FULCIO_URL},"get")});Object.defineProperty(be,"FulcioSigner",{enumerable:!0,get:o(function(){return _F.FulcioSigner},"get")});var Fb=EF();Object.defineProperty(be,"DEFAULT_REKOR_URL",{enumerable:!0,get:o(function(){return Fb.DEFAULT_REKOR_URL},"get")});Object.defineProperty(be,"RekorWitness",{enumerable:!0,get:o(function(){return Fb.RekorWitness},"get")});Object.defineProperty(be,"TSAWitness",{enumerable:!0,get:o(function(){return Fb.TSAWitness},"get")})});var IF=d(mu=>{"use strict";var bF=mu&&mu.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(mu,"__esModule",{value:!0});mu.appDataPath=ose;var nse=bF(require("os")),qo=bF(require("path"));function ose(i){let e=nse.default.homedir();switch(process.platform){case"darwin":{let t=qo.default.join(e,"Library","Application Support");return qo.default.join(t,i)}case"win32":{let t=process.env.LOCALAPPDATA||qo.default.join(e,"AppData","Local");return qo.default.join(t,i,"Data")}default:{let t=process.env.XDG_DATA_HOME||qo.default.join(e,".local","share");return qo.default.join(t,i)}}}o(ose,"appDataPath")});var xi=d(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.UnsupportedAlgorithmError=at.CryptoError=at.LengthOrHashMismatchError=at.UnsignedMetadataError=at.RepositoryError=at.ValueError=void 0;var jb=class extends Error{static{o(this,"ValueError")}};at.ValueError=jb;var gu=class extends Error{static{o(this,"RepositoryError")}};at.RepositoryError=gu;var $b=class extends gu{static{o(this,"UnsignedMetadataError")}};at.UnsignedMetadataError=$b;var qb=class extends gu{static{o(this,"LengthOrHashMismatchError")}};at.LengthOrHashMismatchError=qb;var vp=class extends Error{static{o(this,"CryptoError")}};at.CryptoError=vp;var Vb=class extends vp{static{o(this,"UnsupportedAlgorithmError")}};at.UnsupportedAlgorithmError=Vb});var vF=d(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.isDefined=ase;Zr.isObject=OF;Zr.isStringArray=cse;Zr.isObjectArray=use;Zr.isStringRecord=lse;Zr.isObjectRecord=hse;function ase(i){return i!==void 0}o(ase,"isDefined");function OF(i){return typeof i=="object"&&i!==null}o(OF,"isObject");function cse(i){return Array.isArray(i)&&i.every(e=>typeof e=="string")}o(cse,"isStringArray");function use(i){return Array.isArray(i)&&i.every(OF)}o(use,"isObjectArray");function lse(i){return typeof i=="object"&&i!==null&&Object.keys(i).every(e=>typeof e=="string")&&Object.values(i).every(e=>typeof e=="string")}o(lse,"isStringRecord");function hse(i){return typeof i=="object"&&i!==null&&Object.keys(i).every(e=>typeof e=="string")&&Object.values(i).every(e=>typeof e=="object"&&e!==null)}o(hse,"isObjectRecord")});var Hb=d((hbe,AF)=>{function zb(i){let e=[];if(typeof i=="string")e.push(RF(i));else if(typeof i=="boolean")e.push(JSON.stringify(i));else if(Number.isInteger(i))e.push(JSON.stringify(i));else if(i===null)e.push(JSON.stringify(i));else if(Array.isArray(i)){e.push("[");let t=!0;i.forEach(r=>{t||e.push(","),t=!1,e.push(zb(r))}),e.push("]")}else if(typeof i=="object"){e.push("{");let t=!0;Object.keys(i).sort().forEach(r=>{t||e.push(","),t=!1,e.push(RF(r)),e.push(":"),e.push(zb(i[r]))}),e.push("}")}else throw new TypeError("cannot encode "+i.toString());return e.join("")}o(zb,"canonicalize");function RF(i){return'"'+i.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'}o(RF,"canonicalizeString");AF.exports={canonicalize:zb}});var TF=d(Vo=>{"use strict";var fse=Vo&&Vo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Vo,"__esModule",{value:!0});Vo.verifySignature=void 0;var dse=Hb(),pse=fse(require("crypto")),mse=o((i,e,t)=>{let r=Buffer.from((0,dse.canonicalize)(i));return pse.default.verify(void 0,r,e,Buffer.from(t,"hex"))},"verifySignature");Vo.verifySignature=mse});var ei=d(kt=>{"use strict";var gse=kt&&kt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),yse=kt&&kt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),CF=kt&&kt.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&gse(t,e,r[s]);return yse(t,e),t}})();Object.defineProperty(kt,"__esModule",{value:!0});kt.crypto=kt.guard=void 0;kt.guard=CF(vF());kt.crypto=CF(TF())});var en=d(lr=>{"use strict";var Sse=lr&&lr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(lr,"__esModule",{value:!0});lr.Signed=lr.MetadataKind=void 0;lr.isMetadataKind=wse;var Ese=Sse(require("util")),yu=xi(),Gb=ei(),NF=["1","0","31"],Wb;(function(i){i.Root="root",i.Timestamp="timestamp",i.Snapshot="snapshot",i.Targets="targets"})(Wb||(lr.MetadataKind=Wb={}));function wse(i){return typeof i=="string"&&Object.values(Wb).includes(i)}o(wse,"isMetadataKind");var Jb=class i{static{o(this,"Signed")}specVersion;expires;version;unrecognizedFields;constructor(e){this.specVersion=e.specVersion||NF.join(".");let t=this.specVersion.split(".");if(!(t.length===2||t.length===3)||!t.every(r=>_se(r)))throw new yu.ValueError("Failed to parse specVersion");if(t[0]!=NF[0])throw new yu.ValueError("Unsupported specVersion");this.expires=e.expires,this.version=e.version,this.unrecognizedFields=e.unrecognizedFields||{}}equals(e){return e instanceof i?this.specVersion===e.specVersion&&this.expires===e.expires&&this.version===e.version&&Ese.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:r,version:s,...n}=e;if(Gb.guard.isDefined(t)){if(typeof t!="string")throw new TypeError("spec_version must be a string")}else throw new yu.ValueError("spec_version is not defined");if(Gb.guard.isDefined(r)){if(typeof r!="string")throw new TypeError("expires must be a string")}else throw new yu.ValueError("expires is not defined");if(Gb.guard.isDefined(s)){if(typeof s!="number")throw new TypeError("version must be a number")}else throw new yu.ValueError("version is not defined");return{specVersion:t,expires:r,version:s,unrecognizedFields:n}}};lr.Signed=Jb;function _se(i){return!isNaN(Number(i))}o(_se,"isNumeric")});var Su=d(Xr=>{"use strict";var PF=Xr&&Xr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Xr,"__esModule",{value:!0});Xr.TargetFile=Xr.MetaFile=void 0;var DF=PF(require("crypto")),Ap=PF(require("util")),Yr=xi(),Rp=ei(),Kb=class i{static{o(this,"MetaFile")}version;length;hashes;unrecognizedFields;constructor(e){if(e.version<=0)throw new Yr.ValueError("Metafile version must be at least 1");e.length!==void 0&&xF(e.length),this.version=e.version,this.length=e.length,this.hashes=e.hashes,this.unrecognizedFields=e.unrecognizedFields||{}}equals(e){return e instanceof i?this.version===e.version&&this.length===e.length&&Ap.default.isDeepStrictEqual(this.hashes,e.hashes)&&Ap.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}verify(e){if(this.length!==void 0&&e.length!==this.length)throw new Yr.LengthOrHashMismatchError(`Expected length ${this.length} but got ${e.length}`);this.hashes&&Object.entries(this.hashes).forEach(([t,r])=>{let s;try{s=DF.default.createHash(t)}catch{throw new Yr.LengthOrHashMismatchError(`Hash algorithm ${t} not supported`)}let n=s.update(e).digest("hex");if(n!==r)throw new Yr.LengthOrHashMismatchError(`Expected hash ${r} 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:r,hashes:s,...n}=e;if(typeof t!="number")throw new TypeError("version must be a number");if(Rp.guard.isDefined(r)&&typeof r!="number")throw new TypeError("length must be a number");if(Rp.guard.isDefined(s)&&!Rp.guard.isStringRecord(s))throw new TypeError("hashes must be string keys and values");return new i({version:t,length:r,hashes:s,unrecognizedFields:n})}};Xr.MetaFile=Kb;var Zb=class i{static{o(this,"TargetFile")}length;path;hashes;unrecognizedFields;constructor(e){xF(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 i?this.length===e.length&&this.path===e.path&&Ap.default.isDeepStrictEqual(this.hashes,e.hashes)&&Ap.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}async verify(e){let t=0,r=Object.keys(this.hashes).reduce((s,n)=>{try{s[n]=DF.default.createHash(n)}catch{throw new Yr.LengthOrHashMismatchError(`Hash algorithm ${n} not supported`)}return s},{});for await(let s of e)t+=s.length,Object.values(r).forEach(n=>{n.update(s)});if(t!==this.length)throw new Yr.LengthOrHashMismatchError(`Expected length ${this.length} but got ${t}`);Object.entries(r).forEach(([s,n])=>{let a=this.hashes[s],c=n.digest("hex");if(c!==a)throw new Yr.LengthOrHashMismatchError(`Expected hash ${a} but got ${c}`)})}toJSON(){return{length:this.length,hashes:this.hashes,...this.unrecognizedFields}}static fromJSON(e,t){let{length:r,hashes:s,...n}=t;if(typeof r!="number")throw new TypeError("length must be a number");if(!Rp.guard.isStringRecord(s))throw new TypeError("hashes must have string keys and values");return new i({length:r,path:e,hashes:s,unrecognizedFields:n})}};Xr.TargetFile=Zb;function xF(i){if(i<0)throw new Yr.ValueError("Length must be at least 0")}o(xF,"validateLength")});var LF=d(Yb=>{"use strict";Object.defineProperty(Yb,"__esModule",{value:!0});Yb.encodeOIDString=Ise;var bse=6;function Ise(i){let e=i.split("."),t=parseInt(e[0],10)*40+parseInt(e[1],10),r=[];e.slice(2).forEach(n=>{let a=Ose(parseInt(n,10));r.push(...a)});let s=Buffer.from([t,...r]);return Buffer.from([bse,s.length,...s])}o(Ise,"encodeOIDString");function Ose(i){let e=[],t=0;for(;i>0;)e.unshift(i&127|t),i>>=7,t=128;return e}o(Ose,"encodeVariableLengthInteger")});var FF=d(wu=>{"use strict";var vse=wu&&wu.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(wu,"__esModule",{value:!0});wu.getPublicKey=Cse;var zo=vse(require("crypto")),Eu=xi(),Xb=LF(),Tp=48,MF=3,BF=0,Rse="1.3.101.112",Ase="1.2.840.10045.2.1",Tse="1.2.840.10045.3.1.7",Qb="-----BEGIN PUBLIC KEY-----";function Cse(i){switch(i.keyType){case"rsa":return Nse(i);case"ed25519":return Pse(i);case"ecdsa":case"ecdsa-sha2-nistp256":case"ecdsa-sha2-nistp384":return Dse(i);default:throw new Eu.UnsupportedAlgorithmError(`Unsupported key type: ${i.keyType}`)}}o(Cse,"getPublicKey");function Nse(i){if(!i.keyVal.startsWith(Qb))throw new Eu.CryptoError("Invalid key format");let e=zo.default.createPublicKey(i.keyVal);switch(i.scheme){case"rsassa-pss-sha256":return{key:e,padding:zo.default.constants.RSA_PKCS1_PSS_PADDING};default:throw new Eu.UnsupportedAlgorithmError(`Unsupported RSA scheme: ${i.scheme}`)}}o(Nse,"getRSAPublicKey");function Pse(i){let e;if(i.keyVal.startsWith(Qb))e=zo.default.createPublicKey(i.keyVal);else{if(!kF(i.keyVal))throw new Eu.CryptoError("Invalid key format");e=zo.default.createPublicKey({key:xse.hexToDER(i.keyVal),format:"der",type:"spki"})}return{key:e}}o(Pse,"getED25519PublicKey");function Dse(i){let e;if(i.keyVal.startsWith(Qb))e=zo.default.createPublicKey(i.keyVal);else{if(!kF(i.keyVal))throw new Eu.CryptoError("Invalid key format");e=zo.default.createPublicKey({key:Lse.hexToDER(i.keyVal),format:"der",type:"spki"})}return{key:e}}o(Dse,"getECDCSAPublicKey");var xse={hexToDER:o(i=>{let e=Buffer.from(i,"hex"),t=(0,Xb.encodeOIDString)(Rse),r=Buffer.concat([Buffer.concat([Buffer.from([Tp]),Buffer.from([t.length]),t]),Buffer.concat([Buffer.from([MF]),Buffer.from([e.length+1]),Buffer.from([BF]),e])]);return Buffer.concat([Buffer.from([Tp]),Buffer.from([r.length]),r])},"hexToDER")},Lse={hexToDER:o(i=>{let e=Buffer.from(i,"hex"),t=Buffer.concat([Buffer.from([MF]),Buffer.from([e.length+1]),Buffer.from([BF]),e]),r=Buffer.concat([(0,Xb.encodeOIDString)(Ase),(0,Xb.encodeOIDString)(Tse)]),s=Buffer.concat([Buffer.from([Tp]),Buffer.from([r.length]),r]);return Buffer.concat([Buffer.from([Tp]),Buffer.from([s.length+t.length]),s,t])},"hexToDER")},kF=o(i=>/^[0-9a-fA-F]+$/.test(i),"isHex")});var Cp=d(Ho=>{"use strict";var Mse=Ho&&Ho.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ho,"__esModule",{value:!0});Ho.Key=void 0;var UF=Mse(require("util")),_u=xi(),jF=ei(),Bse=FF(),e0=class i{static{o(this,"Key")}keyID;keyType;scheme;keyVal;unrecognizedFields;constructor(e){let{keyID:t,keyType:r,scheme:s,keyVal:n,unrecognizedFields:a}=e;this.keyID=t,this.keyType=r,this.scheme=s,this.keyVal=n,this.unrecognizedFields=a||{}}verifySignature(e){let t=e.signatures[this.keyID];if(!t)throw new _u.UnsignedMetadataError("no signature for key found in metadata");if(!this.keyVal.public)throw new _u.UnsignedMetadataError("no public key found");let r=(0,Bse.getPublicKey)({keyType:this.keyType,scheme:this.scheme,keyVal:this.keyVal.public}),s=e.signed.toJSON();try{if(!jF.crypto.verifySignature(s,r,t.sig))throw new _u.UnsignedMetadataError(`failed to verify ${this.keyID} signature`)}catch(n){throw n instanceof _u.UnsignedMetadataError?n:new _u.UnsignedMetadataError(`failed to verify ${this.keyID} signature`)}}equals(e){return e instanceof i?this.keyID===e.keyID&&this.keyType===e.keyType&&this.scheme===e.scheme&&UF.default.isDeepStrictEqual(this.keyVal,e.keyVal)&&UF.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:r,scheme:s,keyval:n,...a}=t;if(typeof r!="string")throw new TypeError("keytype must be a string");if(typeof s!="string")throw new TypeError("scheme must be a string");if(!jF.guard.isStringRecord(n))throw new TypeError("keyval must be a string record");return new i({keyID:e,keyType:r,scheme:s,keyVal:n,unrecognizedFields:a})}};Ho.Key=e0});var HF=d((Abe,zF)=>{"use strict";zF.exports=qF;function qF(i,e,t){i instanceof RegExp&&(i=$F(i,t)),e instanceof RegExp&&(e=$F(e,t));var r=VF(i,e,t);return r&&{start:r[0],end:r[1],pre:t.slice(0,r[0]),body:t.slice(r[0]+i.length,r[1]),post:t.slice(r[1]+e.length)}}o(qF,"balanced");function $F(i,e){var t=e.match(i);return t?t[0]:null}o($F,"maybeMatch");qF.range=VF;function VF(i,e,t){var r,s,n,a,c,u=t.indexOf(i),l=t.indexOf(e,u+1),h=u;if(u>=0&&l>0){if(i===e)return[u,l];for(r=[],n=t.length;h>=0&&!c;)h==u?(r.push(h),u=t.indexOf(i,h+1)):r.length==1?c=[r.pop(),l]:(s=r.pop(),s<n&&(n=s,a=l),l=t.indexOf(e,h+1)),h=u<l&&u>=0?u:l;r.length&&(c=[n,a])}return c}o(VF,"range")});var QF=d((Cbe,XF)=>{var GF=HF();XF.exports=Use;var WF="\0SLASH"+Math.random()+"\0",JF="\0OPEN"+Math.random()+"\0",i0="\0CLOSE"+Math.random()+"\0",KF="\0COMMA"+Math.random()+"\0",ZF="\0PERIOD"+Math.random()+"\0";function t0(i){return parseInt(i,10)==i?parseInt(i,10):i.charCodeAt(0)}o(t0,"numeric");function kse(i){return i.split("\\\\").join(WF).split("\\{").join(JF).split("\\}").join(i0).split("\\,").join(KF).split("\\.").join(ZF)}o(kse,"escapeBraces");function Fse(i){return i.split(WF).join("\\").split(JF).join("{").split(i0).join("}").split(KF).join(",").split(ZF).join(".")}o(Fse,"unescapeBraces");function YF(i){if(!i)return[""];var e=[],t=GF("{","}",i);if(!t)return i.split(",");var r=t.pre,s=t.body,n=t.post,a=r.split(",");a[a.length-1]+="{"+s+"}";var c=YF(n);return n.length&&(a[a.length-1]+=c.shift(),a.push.apply(a,c)),e.push.apply(e,a),e}o(YF,"parseCommaParts");function Use(i){return i?(i.substr(0,2)==="{}"&&(i="\\{\\}"+i.substr(2)),bu(kse(i),!0).map(Fse)):[]}o(Use,"expandTop");function jse(i){return"{"+i+"}"}o(jse,"embrace");function $se(i){return/^-?0\d/.test(i)}o($se,"isPadded");function qse(i,e){return i<=e}o(qse,"lte");function Vse(i,e){return i>=e}o(Vse,"gte");function bu(i,e){var t=[],r=GF("{","}",i);if(!r)return[i];var s=r.pre,n=r.post.length?bu(r.post,!1):[""];if(/\$$/.test(r.pre))for(var a=0;a<n.length;a++){var c=s+"{"+r.body+"}"+n[a];t.push(c)}else{var u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),h=u||l,f=r.body.indexOf(",")>=0;if(!h&&!f)return r.post.match(/,(?!,).*\}/)?(i=r.pre+"{"+r.body+i0+r.post,bu(i)):[i];var p;if(h)p=r.body.split(/\.\./);else if(p=YF(r.body),p.length===1&&(p=bu(p[0],!1).map(jse),p.length===1))return n.map(function(ee){return r.pre+p[0]+ee});var m;if(h){var y=t0(p[0]),g=t0(p[1]),S=Math.max(p[0].length,p[1].length),E=p.length==3?Math.abs(t0(p[2])):1,_=qse,b=g<y;b&&(E*=-1,_=Vse);var w=p.some($se);m=[];for(var I=y;_(I,g);I+=E){var v;if(l)v=String.fromCharCode(I),v==="\\"&&(v="");else if(v=String(I),w){var N=S-v.length;if(N>0){var P=new Array(N+1).join("0");I<0?v="-"+P+v.slice(1):v=P+v}}m.push(v)}}else{m=[];for(var $=0;$<p.length;$++)m.push.apply(m,bu(p[$],!1))}for(var $=0;$<m.length;$++)for(var a=0;a<n.length;a++){var c=s+m[$]+n[a];(!e||h||c)&&t.push(c)}}return t}o(bu,"expand")});var eU=d(Np=>{"use strict";Object.defineProperty(Np,"__esModule",{value:!0});Np.assertValidPattern=void 0;var zse=1024*64,Hse=o(i=>{if(typeof i!="string")throw new TypeError("invalid pattern");if(i.length>zse)throw new TypeError("pattern is too long")},"assertValidPattern");Np.assertValidPattern=Hse});var iU=d(Pp=>{"use strict";Object.defineProperty(Pp,"__esModule",{value:!0});Pp.parseClass=void 0;var Gse={"[: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]},Iu=o(i=>i.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),Wse=o(i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),tU=o(i=>i.join(""),"rangesToString"),Jse=o((i,e)=>{let t=e;if(i.charAt(t)!=="[")throw new Error("not in a brace expression");let r=[],s=[],n=t+1,a=!1,c=!1,u=!1,l=!1,h=t,f="";e:for(;n<i.length;){let g=i.charAt(n);if((g==="!"||g==="^")&&n===t+1){l=!0,n++;continue}if(g==="]"&&a&&!u){h=n+1;break}if(a=!0,g==="\\"&&!u){u=!0,n++;continue}if(g==="["&&!u){for(let[S,[E,_,b]]of Object.entries(Gse))if(i.startsWith(S,n)){if(f)return["$.",!1,i.length-t,!0];n+=S.length,b?s.push(E):r.push(E),c=c||_;continue e}}if(u=!1,f){g>f?r.push(Iu(f)+"-"+Iu(g)):g===f&&r.push(Iu(g)),f="",n++;continue}if(i.startsWith("-]",n+1)){r.push(Iu(g+"-")),n+=2;continue}if(i.startsWith("-",n+1)){f=g,n+=2;continue}r.push(Iu(g)),n++}if(h<n)return["",!1,0,!1];if(!r.length&&!s.length)return["$.",!1,i.length-t,!0];if(s.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let g=r[0].length===2?r[0].slice(-1):r[0];return[Wse(g),!1,h-t,!1]}let p="["+(l?"^":"")+tU(r)+"]",m="["+(l?"":"^")+tU(s)+"]";return[r.length&&s.length?"("+p+"|"+m+")":r.length?p:m,c,h-t,!0]},"parseClass");Pp.parseClass=Jse});var xp=d(Dp=>{"use strict";Object.defineProperty(Dp,"__esModule",{value:!0});Dp.unescape=void 0;var Kse=o((i,{windowsPathsNoEscape:e=!1}={})=>e?i.replace(/\[([^\/\\])\]/g,"$1"):i.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),"unescape");Dp.unescape=Kse});var n0=d(Bp=>{"use strict";Object.defineProperty(Bp,"__esModule",{value:!0});Bp.AST=void 0;var Zse=iU(),Lp=xp(),Yse=new Set(["!","?","+","*","@"]),rU=o(i=>Yse.has(i),"isExtglobType"),Xse="(?!(?:^|/)\\.\\.?(?:$|/))",Mp="(?!\\.)",Qse=new Set(["[","."]),ene=new Set(["..","."]),tne=new Set("().*{}+?[]^$\\!"),ine=o(i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),s0="[^/]",sU=s0+"*?",nU=s0+"+?",r0=class i{static{o(this,"AST")}type;#e;#t;#i=!1;#r=[];#s;#u;#c;#f=!1;#n;#h;#o=!1;constructor(e,t,r={}){this.type=e,e&&(this.#t=!0),this.#s=t,this.#e=this.#s?this.#s.#e:this,this.#n=this.#e===this?r:this.#e.#n,this.#c=this.#e===this?[]:this.#e.#c,e==="!"&&!this.#e.#f&&this.#c.push(this),this.#u=this.#s?this.#s.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#h!==void 0?this.#h:this.type?this.#h=this.type+"("+this.#r.map(e=>String(e)).join("|")+")":this.#h=this.#r.map(e=>String(e)).join("")}#d(){if(this!==this.#e)throw new Error("should only call on root");if(this.#f)return this;this.toString(),this.#f=!0;let e;for(;e=this.#c.pop();){if(e.type!=="!")continue;let t=e,r=t.#s;for(;r;){for(let s=t.#u+1;!r.type&&s<r.#r.length;s++)for(let n of e.#r){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(r.#r[s])}t=r,r=t.#s}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof i&&t.#s===this))throw new Error("invalid part: "+t);this.#r.push(t)}}toJSON(){let e=this.type===null?this.#r.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#r.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#f&&this.#s?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#s?.isStart())return!1;if(this.#u===0)return!0;let e=this.#s;for(let t=0;t<this.#u;t++){let r=e.#r[t];if(!(r instanceof i&&r.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.#r.length:0;return this.#u===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new i(this.type,e);for(let r of this.#r)t.copyIn(r);return t}static#a(e,t,r,s){let n=!1,a=!1,c=-1,u=!1;if(t.type===null){let m=r,y="";for(;m<e.length;){let g=e.charAt(m++);if(n||g==="\\"){n=!n,y+=g;continue}if(a){m===c+1?(g==="^"||g==="!")&&(u=!0):g==="]"&&!(m===c+2&&u)&&(a=!1),y+=g;continue}else if(g==="["){a=!0,c=m,u=!1,y+=g;continue}if(!s.noext&&rU(g)&&e.charAt(m)==="("){t.push(y),y="";let S=new i(g,t);m=i.#a(e,S,m,s),t.push(S);continue}y+=g}return t.push(y),m}let l=r+1,h=new i(null,t),f=[],p="";for(;l<e.length;){let m=e.charAt(l++);if(n||m==="\\"){n=!n,p+=m;continue}if(a){l===c+1?(m==="^"||m==="!")&&(u=!0):m==="]"&&!(l===c+2&&u)&&(a=!1),p+=m;continue}else if(m==="["){a=!0,c=l,u=!1,p+=m;continue}if(rU(m)&&e.charAt(l)==="("){h.push(p),p="";let y=new i(m,h);h.push(y),l=i.#a(e,y,l,s);continue}if(m==="|"){h.push(p),p="",f.push(h),h=new i(null,t);continue}if(m===")")return p===""&&t.#r.length===0&&(t.#o=!0),h.push(p),p="",t.push(...f,h),l;p+=m}return t.type=null,t.#t=void 0,t.#r=[e.substring(r-1)],l}static fromGlob(e,t={}){let r=new i(null,void 0,t);return i.#a(e,r,0,t),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,r,s,n]=this.toRegExpSource();if(!(s||this.#t||this.#n.nocase&&!this.#n.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let c=(this.#n.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${t}$`,c),{_src:t,_glob:e})}get options(){return this.#n}toRegExpSource(e){let t=e??!!this.#n.dot;if(this.#e===this&&this.#d(),!this.type){let u=this.isStart()&&this.isEnd(),l=this.#r.map(m=>{let[y,g,S,E]=typeof m=="string"?i.#y(m,this.#t,u):m.toRegExpSource(e);return this.#t=this.#t||S,this.#i=this.#i||E,y}).join(""),h="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&ene.has(this.#r[0]))){let y=Qse,g=t&&y.has(l.charAt(0))||l.startsWith("\\.")&&y.has(l.charAt(2))||l.startsWith("\\.\\.")&&y.has(l.charAt(4)),S=!t&&!e&&y.has(l.charAt(0));h=g?Xse:S?Mp:""}let f="";return this.isEnd()&&this.#e.#f&&this.#s?.type==="!"&&(f="(?:$|\\/)"),[h+l+f,(0,Lp.unescape)(l),this.#t=!!this.#t,this.#i]}let r=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#p(t);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let u=this.toString();return this.#r=[u],this.type=null,this.#t=void 0,[u,(0,Lp.unescape)(this.toString()),!1,!1]}let a=!r||e||t||!Mp?"":this.#p(!0);a===n&&(a=""),a&&(n=`(?:${n})(?:${a})*?`);let c="";if(this.type==="!"&&this.#o)c=(this.isStart()&&!t?Mp:"")+nU;else{let u=this.type==="!"?"))"+(this.isStart()&&!t&&!e?Mp:"")+sU+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;c=s+n+u}return[c,(0,Lp.unescape)(n),this.#t=!!this.#t,this.#i]}#p(e){return this.#r.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[r,s,n,a]=t.toRegExpSource(e);return this.#i=this.#i||a,r}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#y(e,t,r=!1){let s=!1,n="",a=!1;for(let c=0;c<e.length;c++){let u=e.charAt(c);if(s){s=!1,n+=(tne.has(u)?"\\":"")+u;continue}if(u==="\\"){c===e.length-1?n+="\\\\":s=!0;continue}if(u==="["){let[l,h,f,p]=(0,Zse.parseClass)(e,c);if(f){n+=l,a=a||h,c+=f-1,t=t||p;continue}}if(u==="*"){r&&e==="*"?n+=nU:n+=sU,t=!0;continue}if(u==="?"){n+=s0,t=!0;continue}n+=ine(u)}return[n,(0,Lp.unescape)(e),!!t,a]}};Bp.AST=r0});var o0=d(kp=>{"use strict";Object.defineProperty(kp,"__esModule",{value:!0});kp.escape=void 0;var rne=o((i,{windowsPathsNoEscape:e=!1}={})=>e?i.replace(/[?*()[\]]/g,"[$&]"):i.replace(/[?*()[\]\\]/g,"\\$&"),"escape");kp.escape=rne});var fU=d(T=>{"use strict";var sne=T&&T.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(T,"__esModule",{value:!0});T.unescape=T.escape=T.AST=T.Minimatch=T.match=T.makeRe=T.braceExpand=T.defaults=T.filter=T.GLOBSTAR=T.sep=T.minimatch=void 0;var nne=sne(QF()),Fp=eU(),cU=n0(),one=o0(),ane=xp(),cne=o((i,e,t={})=>((0,Fp.assertValidPattern)(e),!t.nocomment&&e.charAt(0)==="#"?!1:new tn(e,t).match(i)),"minimatch");T.minimatch=cne;var une=/^\*+([^+@!?\*\[\(]*)$/,lne=o(i=>e=>!e.startsWith(".")&&e.endsWith(i),"starDotExtTest"),hne=o(i=>e=>e.endsWith(i),"starDotExtTestDot"),fne=o(i=>(i=i.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(i)),"starDotExtTestNocase"),dne=o(i=>(i=i.toLowerCase(),e=>e.toLowerCase().endsWith(i)),"starDotExtTestNocaseDot"),pne=/^\*+\.\*+$/,mne=o(i=>!i.startsWith(".")&&i.includes("."),"starDotStarTest"),gne=o(i=>i!=="."&&i!==".."&&i.includes("."),"starDotStarTestDot"),yne=/^\.\*+$/,Sne=o(i=>i!=="."&&i!==".."&&i.startsWith("."),"dotStarTest"),Ene=/^\*+$/,wne=o(i=>i.length!==0&&!i.startsWith("."),"starTest"),_ne=o(i=>i.length!==0&&i!=="."&&i!=="..","starTestDot"),bne=/^\?+([^+@!?\*\[\(]*)?$/,Ine=o(([i,e=""])=>{let t=uU([i]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocase"),One=o(([i,e=""])=>{let t=lU([i]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocaseDot"),vne=o(([i,e=""])=>{let t=lU([i]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTestDot"),Rne=o(([i,e=""])=>{let t=uU([i]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTest"),uU=o(([i])=>{let e=i.length;return t=>t.length===e&&!t.startsWith(".")},"qmarksTestNoExt"),lU=o(([i])=>{let e=i.length;return t=>t.length===e&&t!=="."&&t!==".."},"qmarksTestNoExtDot"),hU=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",oU={win32:{sep:"\\"},posix:{sep:"/"}};T.sep=hU==="win32"?oU.win32.sep:oU.posix.sep;T.minimatch.sep=T.sep;T.GLOBSTAR=Symbol("globstar **");T.minimatch.GLOBSTAR=T.GLOBSTAR;var Ane="[^/]",Tne=Ane+"*?",Cne="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Nne="(?:(?!(?:\\/|^)\\.).)*?",Pne=o((i,e={})=>t=>(0,T.minimatch)(t,i,e),"filter");T.filter=Pne;T.minimatch.filter=T.filter;var Ft=o((i,e={})=>Object.assign({},i,e),"ext"),Dne=o(i=>{if(!i||typeof i!="object"||!Object.keys(i).length)return T.minimatch;let e=T.minimatch;return Object.assign(o((r,s,n={})=>e(r,s,Ft(i,n)),"m"),{Minimatch:class extends e.Minimatch{static{o(this,"Minimatch")}constructor(s,n={}){super(s,Ft(i,n))}static defaults(s){return e.defaults(Ft(i,s)).Minimatch}},AST:class extends e.AST{static{o(this,"AST")}constructor(s,n,a={}){super(s,n,Ft(i,a))}static fromGlob(s,n={}){return e.AST.fromGlob(s,Ft(i,n))}},unescape:o((r,s={})=>e.unescape(r,Ft(i,s)),"unescape"),escape:o((r,s={})=>e.escape(r,Ft(i,s)),"escape"),filter:o((r,s={})=>e.filter(r,Ft(i,s)),"filter"),defaults:o(r=>e.defaults(Ft(i,r)),"defaults"),makeRe:o((r,s={})=>e.makeRe(r,Ft(i,s)),"makeRe"),braceExpand:o((r,s={})=>e.braceExpand(r,Ft(i,s)),"braceExpand"),match:o((r,s,n={})=>e.match(r,s,Ft(i,n)),"match"),sep:e.sep,GLOBSTAR:T.GLOBSTAR})},"defaults");T.defaults=Dne;T.minimatch.defaults=T.defaults;var xne=o((i,e={})=>((0,Fp.assertValidPattern)(i),e.nobrace||!/\{(?:(?!\{).)*\}/.test(i)?[i]:(0,nne.default)(i)),"braceExpand");T.braceExpand=xne;T.minimatch.braceExpand=T.braceExpand;var Lne=o((i,e={})=>new tn(i,e).makeRe(),"makeRe");T.makeRe=Lne;T.minimatch.makeRe=T.makeRe;var Mne=o((i,e,t={})=>{let r=new tn(e,t);return i=i.filter(s=>r.match(s)),r.options.nonull&&!i.length&&i.push(e),i},"match");T.match=Mne;T.minimatch.match=T.match;var aU=/[?*]|[+@!]\(.*?\)|\[|\]/,Bne=o(i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),tn=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,Fp.assertValidPattern)(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||hU,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...n)=>{}),this.debug(this.pattern,this.globSet);let r=this.globSet.map(n=>this.slashSplit(n));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let s=this.globParts.map((n,a,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=n[0]===""&&n[1]===""&&(n[2]==="?"||!aU.test(n[2]))&&!aU.test(n[3]),l=/^[a-z]:/i.test(n[0]);if(u)return[...n.slice(0,4),...n.slice(4).map(h=>this.parse(h))];if(l)return[n[0],...n.slice(1).map(h=>this.parse(h))]}return n.map(u=>this.parse(u))});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 r=0;r<e.length;r++)for(let s=0;s<e[r].length;s++)e[r][s]==="**"&&(e[r][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 r=-1;for(;(r=t.indexOf("**",r+1))!==-1;){let s=r;for(;t[s+1]==="**";)s++;s!==r&&t.splice(r,s-r)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((r,s)=>{let n=r[r.length-1];return s==="**"&&n==="**"?r:s===".."&&n&&n!==".."&&n!=="."&&n!=="**"?(r.pop(),r):(r.push(s),r)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let 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 r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let s=e[r-1];s&&s!=="."&&s!==".."&&s!=="**"&&(t=!0,e.splice(r-1,2),r-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let r of e){let s=-1;for(;(s=r.indexOf("**",s+1))!==-1;){let a=s;for(;r[a+1]==="**";)a++;a>s&&r.splice(s+1,a-s);let c=r[s+1],u=r[s+2],l=r[s+3];if(c!==".."||!u||u==="."||u===".."||!l||l==="."||l==="..")continue;t=!0,r.splice(s,1);let h=r.slice(0);h[s]="**",e.push(h),s--}if(!this.preserveMultipleSlashes){for(let a=1;a<r.length-1;a++){let c=r[a];a===1&&c===""&&r[0]===""||(c==="."||c==="")&&(t=!0,r.splice(a,1),a--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(t=!0,r.pop())}let n=0;for(;(n=r.indexOf("..",n+1))!==-1;){let a=r[n-1];if(a&&a!=="."&&a!==".."&&a!=="**"){t=!0;let u=n===1&&r[n+1]==="**"?["."]:[];r.splice(n-1,2,...u),r.length===0&&r.push(""),n-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let r=t+1;r<e.length;r++){let s=this.partsMatch(e[t],e[r],!this.preserveMultipleSlashes);if(s){e[t]=[],e[r]=s;break}}return e.filter(t=>t.length)}partsMatch(e,t,r=!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(r&&e[s]==="**"&&t[n]===e[s+1])a.push(e[s]),s++;else if(r&&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,r=0;for(let s=0;s<e.length&&e.charAt(s)==="!";s++)t=!t,r++;r&&(this.pattern=e.slice(r)),this.negate=t}matchOne(e,t,r=!1){let s=this.options;if(this.isWindows){let g=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),S=!g&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),E=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),_=!E&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),b=S?3:g?0:void 0,w=_?3:E?0:void 0;if(typeof b=="number"&&typeof w=="number"){let[I,v]=[e[b],t[w]];I.toLowerCase()===v.toLowerCase()&&(t[w]=I,w>b?t=t.slice(w):b>w&&(e=e.slice(b)))}}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,u=e.length,l=t.length;a<u&&c<l;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===T.GLOBSTAR){this.debug("GLOBSTAR",[t,h,f]);var p=a,m=c+1;if(m===l){for(this.debug("** at the end");a<u;a++)if(e[a]==="."||e[a]===".."||!s.dot&&e[a].charAt(0)===".")return!1;return!0}for(;p<u;){var y=e[p];if(this.debug(`
58
+ `)}o(tie,"fromDER")});var ap=d(Mo=>{"use strict";Object.defineProperty(Mo,"__esModule",{value:!0});Mo.SHA2_HASH_ALGOS=Mo.ECDSA_SIGNATURE_ALGOS=void 0;Mo.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"};Mo.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 rb=d(cp=>{"use strict";Object.defineProperty(cp,"__esModule",{value:!0});cp.RFC3161TimestampVerificationError=void 0;var ib=class extends Error{static{o(this,"RFC3161TimestampVerificationError")}};cp.RFC3161TimestampVerificationError=ib});var Ck=d(Ci=>{"use strict";var iie=Ci&&Ci.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),rie=Ci&&Ci.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),sie=Ci&&Ci.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&iie(t,e,r[s]);return rie(t,e),t}})();Object.defineProperty(Ci,"__esModule",{value:!0});Ci.TSTInfo=void 0;var Tk=sie(Lo()),nie=ap(),oie=rb(),sb=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 nie.SHA2_HASH_ALGOS[e]}get messageImprintHashedMessage(){return this.messageImprintObj.subs[1].value}get raw(){return this.root.toDER()}verify(e){let t=Tk.digest(this.messageImprintHashAlgorithm,e);if(!Tk.bufferEqual(t,this.messageImprintHashedMessage))throw new oie.RFC3161TimestampVerificationError("message imprint does not match artifact")}get messageImprintObj(){return this.root.subs[2]}};Ci.TSTInfo=sb});var Pk=d(Ni=>{"use strict";var aie=Ni&&Ni.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),cie=Ni&&Ni.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),uie=Ni&&Ni.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&aie(t,e,r[s]);return cie(t,e),t}})();Object.defineProperty(Ni,"__esModule",{value:!0});Ni.RFC3161Timestamp=void 0;var lie=sp(),nb=uie(Lo()),Nk=ap(),uu=rb(),hie=Ck(),fie="1.2.840.113549.1.7.2",die="1.2.840.113549.1.9.16.1.4",pie="1.2.840.113549.1.9.4",ob=class i{static{o(this,"RFC3161Timestamp")}constructor(e){this.root=e}static parse(e){let t=lie.ASN1Obj.parseBuffer(e);return new i(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 Nk.SHA2_HASH_ALGOS[e]}get signatureAlgorithm(){let e=this.signatureAlgorithmObj.subs[0].toOID();return Nk.ECDSA_SIGNATURE_ALGOS[e]}get signatureValue(){return this.signatureValueObj.value}get tstInfo(){return new hie.TSTInfo(this.eContentObj.subs[0].subs[0])}verify(e,t){if(!this.timeStampTokenObj)throw new uu.RFC3161TimestampVerificationError("timeStampToken is missing");if(this.contentType!==fie)throw new uu.RFC3161TimestampVerificationError(`incorrect content type: ${this.contentType}`);if(this.eContentType!==die)throw new uu.RFC3161TimestampVerificationError(`incorrect encapsulated content type: ${this.eContentType}`);this.tstInfo.verify(e),this.verifyMessageDigest(),this.verifySignature(t)}verifyMessageDigest(){let e=nb.digest(this.signerDigestAlgorithm,this.tstInfo.raw),t=this.messageDigestAttributeObj.subs[1].subs[0].value;if(!nb.bufferEqual(e,t))throw new uu.RFC3161TimestampVerificationError("signed data does not match tstInfo")}verifySignature(e){let t=this.signedAttrsObj.toDER();if(t[0]=49,!nb.verify(t,e,this.signatureValue,this.signatureAlgorithm))throw new uu.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()===pie)}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]}};Ni.RFC3161Timestamp=ob});var Dk=d(up=>{"use strict";Object.defineProperty(up,"__esModule",{value:!0});up.RFC3161Timestamp=void 0;var mie=Pk();Object.defineProperty(up,"RFC3161Timestamp",{enumerable:!0,get:o(function(){return mie.RFC3161Timestamp},"get")})});var Lk=d(Pi=>{"use strict";var gie=Pi&&Pi.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),yie=Pi&&Pi.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Sie=Pi&&Pi.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&gie(t,e,r[s]);return yie(t,e),t}})();Object.defineProperty(Pi,"__esModule",{value:!0});Pi.SignedCertificateTimestamp=void 0;var Eie=Sie(Lo()),xk=au(),ab=class i{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 r=new xk.ByteStream;return r.appendChar(this.version),r.appendChar(0),r.appendView(this.timestamp),r.appendUint16(1),r.appendView(e),r.appendUint16(this.extensions.byteLength),this.extensions.byteLength>0&&r.appendView(this.extensions),Eie.verify(r.buffer,t,this.signature,this.algorithm)}static parse(e){let t=new xk.ByteStream(e),r=t.getUint8(),s=t.getBlock(32),n=t.getBlock(8),a=t.getUint16(),c=t.getBlock(a),u=t.getUint8(),l=t.getUint8(),h=t.getUint16(),f=t.getBlock(h);if(t.position!==e.length)throw new Error("SCT buffer length mismatch");return new i({version:r,logID:s,timestamp:n,extensions:c,hashAlgorithm:u,signatureAlgorithm:l,signature:f})}};Pi.SignedCertificateTimestamp=ab});var pb=d($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.X509SCTExtension=$e.X509SubjectKeyIDExtension=$e.X509AuthorityKeyIDExtension=$e.X509SubjectAlternativeNameExtension=$e.X509KeyUsageExtension=$e.X509BasicConstraintsExtension=$e.X509Extension=void 0;var wie=au(),_ie=Lk(),ur=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]}};$e.X509Extension=ur;var cb=class extends ur{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]}};$e.X509BasicConstraintsExtension=cb;var ub=class extends ur{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()}};$e.X509KeyUsageExtension=ub;var lb=class extends ur{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}};$e.X509SubjectAlternativeNameExtension=lb;var hb=class extends ur{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]}};$e.X509AuthorityKeyIDExtension=hb;var fb=class extends ur{static{o(this,"X509SubjectKeyIDExtension")}get keyIdentifier(){return this.extnValueObj.subs[0].value}};$e.X509SubjectKeyIDExtension=fb;var db=class extends ur{static{o(this,"X509SCTExtension")}constructor(e){super(e)}get signedCertificateTimestamps(){let e=this.extnValueObj.subs[0].value,t=new wie.ByteStream(e),r=t.getUint16()+2,s=[];for(;t.position<r;){let n=t.getUint16(),a=t.getBlock(n);s.push(_ie.SignedCertificateTimestamp.parse(a))}if(t.position!==r)throw new Error("SCT list length does not match actual length");return s}};$e.X509SCTExtension=db});var kk=d(yt=>{"use strict";var bie=yt&&yt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),Iie=yt&&yt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Bk=yt&&yt.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&bie(t,e,r[s]);return Iie(t,e),t}})();Object.defineProperty(yt,"__esModule",{value:!0});yt.X509Certificate=yt.EXTENSION_OID_SCT=void 0;var Oie=sp(),Mk=Bk(Lo()),vie=ap(),Rie=Bk(tb()),Ys=pb(),Aie="2.5.29.14",Tie="2.5.29.15",Cie="2.5.29.17",Nie="2.5.29.19",Pie="2.5.29.35";yt.EXTENSION_OID_SCT="1.3.6.1.4.1.11129.2.4.2";var mb=class i{static{o(this,"X509Certificate")}constructor(e){this.root=e}static parse(e){let t=typeof e=="string"?Rie.toDER(e):e,r=Oie.ASN1Obj.parseBuffer(t);return new i(r)}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 vie.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(Tie);return e?new Ys.X509KeyUsageExtension(e):void 0}get extBasicConstraints(){let e=this.findExtension(Nie);return e?new Ys.X509BasicConstraintsExtension(e):void 0}get extSubjectAltName(){let e=this.findExtension(Cie);return e?new Ys.X509SubjectAlternativeNameExtension(e):void 0}get extAuthorityKeyID(){let e=this.findExtension(Pie);return e?new Ys.X509AuthorityKeyIDExtension(e):void 0}get extSubjectKeyID(){let e=this.findExtension(Aie);return e?new Ys.X509SubjectKeyIDExtension(e):void 0}get extSCT(){let e=this.findExtension(yt.EXTENSION_OID_SCT);return e?new Ys.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 Ys.X509Extension(t):void 0}verify(e){let t=e?.publicKey||this.publicKey,r=Mk.createPublicKey(t);return Mk.verify(this.tbsCertificate.toDER(),r,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),i.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))}};yt.X509Certificate=mb});var Uk=d(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.X509SCTExtension=Gr.X509Certificate=Gr.EXTENSION_OID_SCT=void 0;var Fk=kk();Object.defineProperty(Gr,"EXTENSION_OID_SCT",{enumerable:!0,get:o(function(){return Fk.EXTENSION_OID_SCT},"get")});Object.defineProperty(Gr,"X509Certificate",{enumerable:!0,get:o(function(){return Fk.X509Certificate},"get")});var Die=pb();Object.defineProperty(Gr,"X509SCTExtension",{enumerable:!0,get:o(function(){return Die.X509SCTExtension},"get")})});var ot=d(K=>{"use strict";var xie=K&&K.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),Lie=K&&K.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),lu=K&&K.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&xie(t,e,r[s]);return Lie(t,e),t}})();Object.defineProperty(K,"__esModule",{value:!0});K.X509SCTExtension=K.X509Certificate=K.EXTENSION_OID_SCT=K.ByteStream=K.RFC3161Timestamp=K.pem=K.json=K.encoding=K.dsse=K.crypto=K.ASN1Obj=void 0;var Mie=sp();Object.defineProperty(K,"ASN1Obj",{enumerable:!0,get:o(function(){return Mie.ASN1Obj},"get")});K.crypto=lu(Lo());K.dsse=lu(Ik());K.encoding=lu(Rk());K.json=lu(Ak());K.pem=lu(tb());var Bie=Dk();Object.defineProperty(K,"RFC3161Timestamp",{enumerable:!0,get:o(function(){return Bie.RFC3161Timestamp},"get")});var kie=au();Object.defineProperty(K,"ByteStream",{enumerable:!0,get:o(function(){return kie.ByteStream},"get")});var gb=Uk();Object.defineProperty(K,"EXTENSION_OID_SCT",{enumerable:!0,get:o(function(){return gb.EXTENSION_OID_SCT},"get")});Object.defineProperty(K,"X509Certificate",{enumerable:!0,get:o(function(){return gb.X509Certificate},"get")});Object.defineProperty(K,"X509SCTExtension",{enumerable:!0,get:o(function(){return gb.X509SCTExtension},"get")})});var jk=d(yb=>{"use strict";Object.defineProperty(yb,"__esModule",{value:!0});yb.extractJWTSubject=Uie;var Fie=ot();function Uie(i){let e=i.split(".",3),t=JSON.parse(Fie.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(Uie,"extractJWTSubject")});var $k=d((c_e,jie)=>{jie.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 Vk=d(Bo=>{"use strict";var $ie=Bo&&Bo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Bo,"__esModule",{value:!0});Bo.getUserAgent=void 0;var qk=$ie(require("os")),qie=o(()=>{let i=$k().version,e=process.version,t=qk.default.platform(),r=qk.default.arch();return`sigstore-js/${i} (Node ${e}) (${t}/${r})`},"getUserAgent");Bo.getUserAgent=qie});var Wr=d(fe=>{"use strict";var Vie=fe&&fe.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),zie=fe&&fe.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),zk=fe&&fe.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&Vie(t,e,r[s]);return zie(t,e),t}})();Object.defineProperty(fe,"__esModule",{value:!0});fe.ua=fe.oidc=fe.pem=fe.json=fe.encoding=fe.dsse=fe.crypto=void 0;var hu=ot();Object.defineProperty(fe,"crypto",{enumerable:!0,get:o(function(){return hu.crypto},"get")});Object.defineProperty(fe,"dsse",{enumerable:!0,get:o(function(){return hu.dsse},"get")});Object.defineProperty(fe,"encoding",{enumerable:!0,get:o(function(){return hu.encoding},"get")});Object.defineProperty(fe,"json",{enumerable:!0,get:o(function(){return hu.json},"get")});Object.defineProperty(fe,"pem",{enumerable:!0,get:o(function(){return hu.pem},"get")});fe.oidc=zk(jk());fe.ua=zk(Vk())});var Eb=d(lp=>{"use strict";Object.defineProperty(lp,"__esModule",{value:!0});lp.BaseBundleBuilder=void 0;var Sb=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)),r=await this.package(e,t),s=await Promise.all(this.witnesses.map(c=>c.testify(r.content,Hie(t.key)))),n=[],a=[];return s.forEach(({tlogEntries:c,rfc3161Timestamps:u})=>{n.push(...c??[]),a.push(...u??[])}),r.verificationMaterial.tlogEntries=n,r.verificationMaterial.timestampVerificationData={rfc3161Timestamps:a},r}async prepare(e){return e.data}};lp.BaseBundleBuilder=Sb;function Hie(i){switch(i.$case){case"publicKey":return i.publicKey;case"x509Certificate":return i.certificate}}o(Hie,"publicKey")});var _b=d(Di=>{"use strict";var Gie=Di&&Di.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),Wie=Di&&Di.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Jie=Di&&Di.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&Gie(t,e,r[s]);return Wie(t,e),t}})();Object.defineProperty(Di,"__esModule",{value:!0});Di.toMessageSignatureBundle=Kie;Di.toDSSEBundle=Zie;var Hk=Jie(ou()),wb=Wr();function Kie(i,e){let t=wb.crypto.digest("sha256",i.data);return Hk.toMessageSignatureBundle({digest:t,signature:e.signature,certificate:e.key.$case==="x509Certificate"?wb.pem.toDER(e.key.certificate):void 0,keyHint:e.key.$case==="publicKey"?e.key.hint:void 0,certificateChain:!0})}o(Kie,"toMessageSignatureBundle");function Zie(i,e,t){return Hk.toDSSEBundle({artifact:i.data,artifactType:i.type,signature:e.signature,certificate:e.key.$case==="x509Certificate"?wb.pem.toDER(e.key.certificate):void 0,keyHint:e.key.$case==="publicKey"?e.key.hint:void 0,certificateChain:t})}o(Zie,"toDSSEBundle")});var Wk=d(hp=>{"use strict";Object.defineProperty(hp,"__esModule",{value:!0});hp.DSSEBundleBuilder=void 0;var Yie=Wr(),Xie=Eb(),Qie=_b(),bb=class extends Xie.BaseBundleBuilder{static{o(this,"DSSEBundleBuilder")}constructor(e){super(e),this.certificateChain=e.certificateChain??!1}async prepare(e){let t=Gk(e);return Yie.dsse.preAuthEncoding(t.type,t.data)}async package(e,t){return(0,Qie.toDSSEBundle)(Gk(e),t,this.certificateChain)}};hp.DSSEBundleBuilder=bb;function Gk(i){return{...i,type:i.type??""}}o(Gk,"artifactDefaults")});var Jk=d(fp=>{"use strict";Object.defineProperty(fp,"__esModule",{value:!0});fp.MessageSignatureBundleBuilder=void 0;var ere=Eb(),tre=_b(),Ib=class extends ere.BaseBundleBuilder{static{o(this,"MessageSignatureBundleBuilder")}constructor(e){super(e)}async package(e,t){return(0,tre.toMessageSignatureBundle)(e,t)}};fp.MessageSignatureBundleBuilder=Ib});var Kk=d(ko=>{"use strict";Object.defineProperty(ko,"__esModule",{value:!0});ko.MessageSignatureBundleBuilder=ko.DSSEBundleBuilder=void 0;var ire=Wk();Object.defineProperty(ko,"DSSEBundleBuilder",{enumerable:!0,get:o(function(){return ire.DSSEBundleBuilder},"get")});var rre=Jk();Object.defineProperty(ko,"MessageSignatureBundleBuilder",{enumerable:!0,get:o(function(){return rre.MessageSignatureBundleBuilder},"get")})});var pp=d(dp=>{"use strict";Object.defineProperty(dp,"__esModule",{value:!0});dp.HTTPError=void 0;var Ob=class extends Error{static{o(this,"HTTPError")}constructor({status:e,message:t,location:r}){super(`(${e}) ${t}`),this.statusCode=e,this.location=r}};dp.HTTPError=Ob});var Fo=d(fu=>{"use strict";Object.defineProperty(fu,"__esModule",{value:!0});fu.InternalError=void 0;fu.internalError=nre;var sre=pp(),mp=class extends Error{static{o(this,"InternalError")}constructor({code:e,message:t,cause:r}){super(t),this.name=this.constructor.name,this.cause=r,this.code=e}};fu.InternalError=mp;function nre(i,e,t){throw i instanceof sre.HTTPError&&(t+=` - ${i.message}`),new mp({code:e,message:t,cause:i})}o(nre,"internalError")});var Zk=d(Uo=>{"use strict";var ore=Uo&&Uo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Uo,"__esModule",{value:!0});Uo.CIContextProvider=void 0;var are=ore(iu()),cre=[ure,lre],vb=class{static{o(this,"CIContextProvider")}constructor(e="sigstore"){this.audience=e}async getToken(){return Promise.any(cre.map(e=>e(this.audience))).catch(()=>Promise.reject("CI: no tokens available"))}};Uo.CIContextProvider=vb;async function ure(i){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",i),(await(0,are.default)(e.href,{retry:2,headers:{Accept:"application/json",Authorization:`Bearer ${process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN}`}})).json().then(r=>r.value)}o(ure,"getGHAToken");async function lre(){return process.env.SIGSTORE_ID_TOKEN?process.env.SIGSTORE_ID_TOKEN:Promise.reject("no token available")}o(lre,"getEnv")});var Yk=d(gp=>{"use strict";Object.defineProperty(gp,"__esModule",{value:!0});gp.CIContextProvider=void 0;var hre=Zk();Object.defineProperty(gp,"CIContextProvider",{enumerable:!0,get:o(function(){return hre.CIContextProvider},"get")})});var yp=d(du=>{"use strict";var Qk=du&&du.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(du,"__esModule",{value:!0});du.fetchWithRetry=Ire;var fre=require("http2"),dre=Qk(iu()),Xk=St(),pre=Qk(xa()),mre=Wr(),gre=pp(),{HTTP2_HEADER_LOCATION:yre,HTTP2_HEADER_CONTENT_TYPE:Sre,HTTP2_HEADER_USER_AGENT:Ere,HTTP_STATUS_INTERNAL_SERVER_ERROR:wre,HTTP_STATUS_TOO_MANY_REQUESTS:_re,HTTP_STATUS_REQUEST_TIMEOUT:bre}=fre.constants;async function Ire(i,e){return(0,pre.default)(async(t,r)=>{let s=e.method||"POST",n={[Ere]:mre.ua.getUserAgent(),...e.headers},a=await(0,dre.default)(i,{method:s,headers:n,body:e.body,timeout:e.timeout,retry:!1}).catch(c=>(Xk.log.http("fetch",`${s} ${i} attempt ${r} failed with ${c}`),t(c)));if(a.ok)return a;{let c=await Ore(a);if(Xk.log.http("fetch",`${s} ${i} attempt ${r} failed with ${a.status}`),vre(a.status))return t(c);throw c}},Rre(e.retry))}o(Ire,"fetchWithRetry");var Ore=o(async i=>{let e=i.statusText,t=i.headers.get(yre)||void 0;if(i.headers.get(Sre)?.includes("application/json"))try{e=(await i.json()).message||e}catch{}return new gre.HTTPError({status:i.status,message:e,location:t})},"errorFromResponse"),vre=o(i=>[bre,_re].includes(i)||i>=wre,"retryable"),Rre=o(i=>typeof i=="boolean"?{retries:i?1:0}:typeof i=="number"?{retries:i}:{retries:0,...i},"retryOpts")});var eF=d(Sp=>{"use strict";Object.defineProperty(Sp,"__esModule",{value:!0});Sp.Fulcio=void 0;var Are=yp(),Rb=class{static{o(this,"Fulcio")}constructor(e){this.options=e}async createSigningCertificate(e){let{baseURL:t,retry:r,timeout:s}=this.options,n=`${t}/api/v2/signingCert`;return(await(0,Are.fetchWithRetry)(n,{headers:{"Content-Type":"application/json"},body:JSON.stringify(e),timeout:s,retry:r})).json()}};Sp.Fulcio=Rb});var tF=d(Ep=>{"use strict";Object.defineProperty(Ep,"__esModule",{value:!0});Ep.CAClient=void 0;var Tre=Fo(),Cre=eF(),Ab=class{static{o(this,"CAClient")}constructor(e){this.fulcio=new Cre.Fulcio({baseURL:e.fulcioBaseURL,retry:e.retry,timeout:e.timeout})}async createSigningCertificate(e,t,r){let s=Nre(e,t,r);try{let n=await this.fulcio.createSigningCertificate(s);return(n.signedCertificateEmbeddedSct?n.signedCertificateEmbeddedSct:n.signedCertificateDetachedSct).chain.certificates}catch(n){(0,Tre.internalError)(n,"CA_CREATE_SIGNING_CERTIFICATE_ERROR","error creating signing certificate")}}};Ep.CAClient=Ab;function Nre(i,e,t){return{credentials:{oidcIdentityToken:i},publicKeyRequest:{publicKey:{algorithm:"ECDSA",content:e},proofOfPossession:t.toString("base64")}}}o(Nre,"toCertificateRequest")});var rF=d(jo=>{"use strict";var Pre=jo&&jo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(jo,"__esModule",{value:!0});jo.EphemeralSigner=void 0;var iF=Pre(require("crypto")),Dre="ec",xre="P-256",Tb=class{static{o(this,"EphemeralSigner")}constructor(){this.keypair=iF.default.generateKeyPairSync(Dre,{namedCurve:xre})}async sign(e){let t=iF.default.sign(null,e,this.keypair.privateKey),r=this.keypair.publicKey.export({format:"pem",type:"spki"}).toString("ascii");return{signature:t,key:{$case:"publicKey",publicKey:r}}}};jo.EphemeralSigner=Tb});var sF=d(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});Xs.FulcioSigner=Xs.DEFAULT_FULCIO_URL=void 0;var Cb=Fo(),Lre=Wr(),Mre=tF(),Bre=rF();Xs.DEFAULT_FULCIO_URL="https://fulcio.sigstore.dev";var Nb=class{static{o(this,"FulcioSigner")}constructor(e){this.ca=new Mre.CAClient({...e,fulcioBaseURL:e.fulcioBaseURL||Xs.DEFAULT_FULCIO_URL}),this.identityProvider=e.identityProvider,this.keyHolder=e.keyHolder||new Bre.EphemeralSigner}async sign(e){let t=await this.getIdentityToken(),r;try{r=Lre.oidc.extractJWTSubject(t)}catch(c){throw new Cb.InternalError({code:"IDENTITY_TOKEN_PARSE_ERROR",message:`invalid identity token: ${t}`,cause:c})}let s=await this.keyHolder.sign(Buffer.from(r));if(s.key.$case!=="publicKey")throw new Cb.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 Cb.InternalError({code:"IDENTITY_TOKEN_READ_ERROR",message:"error retrieving identity token",cause:e})}}};Xs.FulcioSigner=Nb});var oF=d($o=>{"use strict";Object.defineProperty($o,"__esModule",{value:!0});$o.FulcioSigner=$o.DEFAULT_FULCIO_URL=void 0;var nF=sF();Object.defineProperty($o,"DEFAULT_FULCIO_URL",{enumerable:!0,get:o(function(){return nF.DEFAULT_FULCIO_URL},"get")});Object.defineProperty($o,"FulcioSigner",{enumerable:!0,get:o(function(){return nF.FulcioSigner},"get")})});var uF=d(wp=>{"use strict";Object.defineProperty(wp,"__esModule",{value:!0});wp.Rekor=void 0;var aF=yp(),Pb=class{static{o(this,"Rekor")}constructor(e){this.options=e}async createEntry(e){let{baseURL:t,timeout:r,retry:s}=this.options,n=`${t}/api/v1/log/entries`,c=await(await(0,aF.fetchWithRetry)(n,{headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(e),timeout:r,retry:s})).json();return cF(c)}async getEntry(e){let{baseURL:t,timeout:r,retry:s}=this.options,n=`${t}/api/v1/log/entries/${e}`,c=await(await(0,aF.fetchWithRetry)(n,{method:"GET",headers:{Accept:"application/json"},timeout:r,retry:s})).json();return cF(c)}};wp.Rekor=Pb;function cF(i){let e=Object.entries(i);if(e.length!=1)throw new Error("Received multiple entries in Rekor response");let[t,r]=e[0];return{...r,uuid:t}}o(cF,"entryFromResponse")});var hF=d(_p=>{"use strict";Object.defineProperty(_p,"__esModule",{value:!0});_p.TLogClient=void 0;var lF=Fo(),kre=pp(),Fre=uF(),Db=class{static{o(this,"TLogClient")}constructor(e){this.fetchOnConflict=e.fetchOnConflict??!1,this.rekor=new Fre.Rekor({baseURL:e.rekorBaseURL,retry:e.retry,timeout:e.timeout})}async createEntry(e){let t;try{t=await this.rekor.createEntry(e)}catch(r){if(Ure(r)&&this.fetchOnConflict){let s=r.location.split("/").pop()||"";try{t=await this.rekor.getEntry(s)}catch(n){(0,lF.internalError)(n,"TLOG_FETCH_ENTRY_ERROR","error fetching tlog entry")}}else(0,lF.internalError)(r,"TLOG_CREATE_ENTRY_ERROR","error creating tlog entry")}return t}};_p.TLogClient=Db;function Ure(i){return i instanceof kre.HTTPError&&i.statusCode===409&&i.location!==void 0}o(Ure,"entryExistsError")});var fF=d(xb=>{"use strict";Object.defineProperty(xb,"__esModule",{value:!0});xb.toProposedEntry=$re;var jre=ou(),Jr=Wr(),pu="sha256";function $re(i,e,t="dsse"){switch(i.$case){case"dsseEnvelope":return t==="intoto"?zre(i.dsseEnvelope,e):Vre(i.dsseEnvelope,e);case"messageSignature":return qre(i.messageSignature,e)}}o($re,"toProposedEntry");function qre(i,e){let t=i.messageDigest.digest.toString("hex"),r=i.signature.toString("base64"),s=Jr.encoding.base64Encode(e);return{apiVersion:"0.0.1",kind:"hashedrekord",spec:{data:{hash:{algorithm:pu,value:t}},signature:{content:r,publicKey:{content:s}}}}}o(qre,"toProposedHashedRekordEntry");function Vre(i,e){let t=JSON.stringify((0,jre.envelopeToJSON)(i)),r=Jr.encoding.base64Encode(e);return{apiVersion:"0.0.1",kind:"dsse",spec:{proposedContent:{envelope:t,verifiers:[r]}}}}o(Vre,"toProposedDSSEEntry");function zre(i,e){let t=Jr.crypto.digest(pu,i.payload).toString("hex"),r=Hre(i,e),s=Jr.encoding.base64Encode(i.payload.toString("base64")),n=Jr.encoding.base64Encode(i.signatures[0].sig.toString("base64")),a=i.signatures[0].keyid,c=Jr.encoding.base64Encode(e),u={payloadType:i.payloadType,payload:s,signatures:[{sig:n,publicKey:c}]};return a.length>0&&(u.signatures[0].keyid=a),{apiVersion:"0.0.2",kind:"intoto",spec:{content:{envelope:u,hash:{algorithm:pu,value:r},payloadHash:{algorithm:pu,value:t}}}}}o(zre,"toProposedIntotoEntry");function Hre(i,e){let t={payloadType:i.payloadType,payload:i.payload.toString("base64"),signatures:[{sig:i.signatures[0].sig.toString("base64"),publicKey:e}]};return i.signatures[0].keyid.length>0&&(t.signatures[0].keyid=i.signatures[0].keyid),Jr.crypto.digest(pu,Jr.json.canonicalize(t)).toString("hex")}o(Hre,"calculateDSSEHash")});var dF=d(Qs=>{"use strict";Object.defineProperty(Qs,"__esModule",{value:!0});Qs.RekorWitness=Qs.DEFAULT_REKOR_URL=void 0;var Gre=Wr(),Wre=hF(),Jre=fF();Qs.DEFAULT_REKOR_URL="https://rekor.sigstore.dev";var Lb=class{static{o(this,"RekorWitness")}constructor(e){this.entryType=e.entryType,this.tlog=new Wre.TLogClient({...e,rekorBaseURL:e.rekorBaseURL||Qs.DEFAULT_REKOR_URL})}async testify(e,t){let r=(0,Jre.toProposedEntry)(e,t,this.entryType),s=await this.tlog.createEntry(r);return Kre(s)}};Qs.RekorWitness=Lb;function Kre(i){let e=Buffer.from(i.logID,"hex"),t=Gre.encoding.base64Decode(i.body),r=JSON.parse(t),s=i?.verification?.signedEntryTimestamp?Zre(i.verification.signedEntryTimestamp):void 0,n=i?.verification?.inclusionProof?Yre(i.verification.inclusionProof):void 0;return{tlogEntries:[{logIndex:i.logIndex.toString(),logId:{keyId:e},integratedTime:i.integratedTime.toString(),kindVersion:{kind:r.kind,version:r.apiVersion},inclusionPromise:s,inclusionProof:n,canonicalizedBody:Buffer.from(i.body,"base64")}]}}o(Kre,"toTransparencyLogEntry");function Zre(i){return{signedEntryTimestamp:Buffer.from(i,"base64")}}o(Zre,"inclusionPromise");function Yre(i){return{logIndex:i.logIndex.toString(),treeSize:i.treeSize.toString(),rootHash:Buffer.from(i.rootHash,"hex"),hashes:i.hashes.map(e=>Buffer.from(e,"hex")),checkpoint:{envelope:i.checkpoint}}}o(Yre,"inclusionProof")});var pF=d(bp=>{"use strict";Object.defineProperty(bp,"__esModule",{value:!0});bp.TimestampAuthority=void 0;var Xre=yp(),Mb=class{static{o(this,"TimestampAuthority")}constructor(e){this.options=e}async createTimestamp(e){let{baseURL:t,timeout:r,retry:s}=this.options,n=`${t}/api/v1/timestamp`;return(await(0,Xre.fetchWithRetry)(n,{headers:{"Content-Type":"application/json"},body:JSON.stringify(e),timeout:r,retry:s})).buffer()}};bp.TimestampAuthority=Mb});var gF=d(Ip=>{"use strict";Object.defineProperty(Ip,"__esModule",{value:!0});Ip.TSAClient=void 0;var Qre=Fo(),ese=pF(),tse=Wr(),mF="sha256",Bb=class{static{o(this,"TSAClient")}constructor(e){this.tsa=new ese.TimestampAuthority({baseURL:e.tsaBaseURL,retry:e.retry,timeout:e.timeout})}async createTimestamp(e){let t={artifactHash:tse.crypto.digest(mF,e).toString("base64"),hashAlgorithm:mF};try{return await this.tsa.createTimestamp(t)}catch(r){(0,Qre.internalError)(r,"TSA_CREATE_TIMESTAMP_ERROR","error creating timestamp")}}};Ip.TSAClient=Bb});var yF=d(Op=>{"use strict";Object.defineProperty(Op,"__esModule",{value:!0});Op.TSAWitness=void 0;var ise=gF(),kb=class{static{o(this,"TSAWitness")}constructor(e){this.tsa=new ise.TSAClient({tsaBaseURL:e.tsaBaseURL,retry:e.retry,timeout:e.timeout})}async testify(e){let t=rse(e);return{rfc3161Timestamps:[{signedTimestamp:await this.tsa.createTimestamp(t)}]}}};Op.TSAWitness=kb;function rse(i){switch(i.$case){case"dsseEnvelope":return i.dsseEnvelope.signatures[0].sig;case"messageSignature":return i.messageSignature.signature}}o(rse,"extractSignature")});var EF=d(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.TSAWitness=Kr.RekorWitness=Kr.DEFAULT_REKOR_URL=void 0;var SF=dF();Object.defineProperty(Kr,"DEFAULT_REKOR_URL",{enumerable:!0,get:o(function(){return SF.DEFAULT_REKOR_URL},"get")});Object.defineProperty(Kr,"RekorWitness",{enumerable:!0,get:o(function(){return SF.RekorWitness},"get")});var sse=yF();Object.defineProperty(Kr,"TSAWitness",{enumerable:!0,get:o(function(){return sse.TSAWitness},"get")})});var Ub=d(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 wF=Kk();Object.defineProperty(be,"DSSEBundleBuilder",{enumerable:!0,get:o(function(){return wF.DSSEBundleBuilder},"get")});Object.defineProperty(be,"MessageSignatureBundleBuilder",{enumerable:!0,get:o(function(){return wF.MessageSignatureBundleBuilder},"get")});var nse=Fo();Object.defineProperty(be,"InternalError",{enumerable:!0,get:o(function(){return nse.InternalError},"get")});var ose=Yk();Object.defineProperty(be,"CIContextProvider",{enumerable:!0,get:o(function(){return ose.CIContextProvider},"get")});var _F=oF();Object.defineProperty(be,"DEFAULT_FULCIO_URL",{enumerable:!0,get:o(function(){return _F.DEFAULT_FULCIO_URL},"get")});Object.defineProperty(be,"FulcioSigner",{enumerable:!0,get:o(function(){return _F.FulcioSigner},"get")});var Fb=EF();Object.defineProperty(be,"DEFAULT_REKOR_URL",{enumerable:!0,get:o(function(){return Fb.DEFAULT_REKOR_URL},"get")});Object.defineProperty(be,"RekorWitness",{enumerable:!0,get:o(function(){return Fb.RekorWitness},"get")});Object.defineProperty(be,"TSAWitness",{enumerable:!0,get:o(function(){return Fb.TSAWitness},"get")})});var IF=d(mu=>{"use strict";var bF=mu&&mu.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(mu,"__esModule",{value:!0});mu.appDataPath=cse;var ase=bF(require("os")),qo=bF(require("path"));function cse(i){let e=ase.default.homedir();switch(process.platform){case"darwin":{let t=qo.default.join(e,"Library","Application Support");return qo.default.join(t,i)}case"win32":{let t=process.env.LOCALAPPDATA||qo.default.join(e,"AppData","Local");return qo.default.join(t,i,"Data")}default:{let t=process.env.XDG_DATA_HOME||qo.default.join(e,".local","share");return qo.default.join(t,i)}}}o(cse,"appDataPath")});var xi=d(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.UnsupportedAlgorithmError=at.CryptoError=at.LengthOrHashMismatchError=at.UnsignedMetadataError=at.RepositoryError=at.ValueError=void 0;var jb=class extends Error{static{o(this,"ValueError")}};at.ValueError=jb;var gu=class extends Error{static{o(this,"RepositoryError")}};at.RepositoryError=gu;var $b=class extends gu{static{o(this,"UnsignedMetadataError")}};at.UnsignedMetadataError=$b;var qb=class extends gu{static{o(this,"LengthOrHashMismatchError")}};at.LengthOrHashMismatchError=qb;var vp=class extends Error{static{o(this,"CryptoError")}};at.CryptoError=vp;var Vb=class extends vp{static{o(this,"UnsupportedAlgorithmError")}};at.UnsupportedAlgorithmError=Vb});var vF=d(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.isDefined=use;Zr.isObject=OF;Zr.isStringArray=lse;Zr.isObjectArray=hse;Zr.isStringRecord=fse;Zr.isObjectRecord=dse;function use(i){return i!==void 0}o(use,"isDefined");function OF(i){return typeof i=="object"&&i!==null}o(OF,"isObject");function lse(i){return Array.isArray(i)&&i.every(e=>typeof e=="string")}o(lse,"isStringArray");function hse(i){return Array.isArray(i)&&i.every(OF)}o(hse,"isObjectArray");function fse(i){return typeof i=="object"&&i!==null&&Object.keys(i).every(e=>typeof e=="string")&&Object.values(i).every(e=>typeof e=="string")}o(fse,"isStringRecord");function dse(i){return typeof i=="object"&&i!==null&&Object.keys(i).every(e=>typeof e=="string")&&Object.values(i).every(e=>typeof e=="object"&&e!==null)}o(dse,"isObjectRecord")});var Hb=d((dbe,AF)=>{function zb(i){let e=[];if(typeof i=="string")e.push(RF(i));else if(typeof i=="boolean")e.push(JSON.stringify(i));else if(Number.isInteger(i))e.push(JSON.stringify(i));else if(i===null)e.push(JSON.stringify(i));else if(Array.isArray(i)){e.push("[");let t=!0;i.forEach(r=>{t||e.push(","),t=!1,e.push(zb(r))}),e.push("]")}else if(typeof i=="object"){e.push("{");let t=!0;Object.keys(i).sort().forEach(r=>{t||e.push(","),t=!1,e.push(RF(r)),e.push(":"),e.push(zb(i[r]))}),e.push("}")}else throw new TypeError("cannot encode "+i.toString());return e.join("")}o(zb,"canonicalize");function RF(i){return'"'+i.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'}o(RF,"canonicalizeString");AF.exports={canonicalize:zb}});var TF=d(Vo=>{"use strict";var pse=Vo&&Vo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Vo,"__esModule",{value:!0});Vo.verifySignature=void 0;var mse=Hb(),gse=pse(require("crypto")),yse=o((i,e,t)=>{let r=Buffer.from((0,mse.canonicalize)(i));return gse.default.verify(void 0,r,e,Buffer.from(t,"hex"))},"verifySignature");Vo.verifySignature=yse});var ei=d(kt=>{"use strict";var Sse=kt&&kt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),Ese=kt&&kt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),CF=kt&&kt.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&Sse(t,e,r[s]);return Ese(t,e),t}})();Object.defineProperty(kt,"__esModule",{value:!0});kt.crypto=kt.guard=void 0;kt.guard=CF(vF());kt.crypto=CF(TF())});var en=d(lr=>{"use strict";var wse=lr&&lr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(lr,"__esModule",{value:!0});lr.Signed=lr.MetadataKind=void 0;lr.isMetadataKind=bse;var _se=wse(require("util")),yu=xi(),Gb=ei(),NF=["1","0","31"],Wb;(function(i){i.Root="root",i.Timestamp="timestamp",i.Snapshot="snapshot",i.Targets="targets"})(Wb||(lr.MetadataKind=Wb={}));function bse(i){return typeof i=="string"&&Object.values(Wb).includes(i)}o(bse,"isMetadataKind");var Jb=class i{static{o(this,"Signed")}specVersion;expires;version;unrecognizedFields;constructor(e){this.specVersion=e.specVersion||NF.join(".");let t=this.specVersion.split(".");if(!(t.length===2||t.length===3)||!t.every(r=>Ise(r)))throw new yu.ValueError("Failed to parse specVersion");if(t[0]!=NF[0])throw new yu.ValueError("Unsupported specVersion");this.expires=e.expires,this.version=e.version,this.unrecognizedFields=e.unrecognizedFields||{}}equals(e){return e instanceof i?this.specVersion===e.specVersion&&this.expires===e.expires&&this.version===e.version&&_se.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:r,version:s,...n}=e;if(Gb.guard.isDefined(t)){if(typeof t!="string")throw new TypeError("spec_version must be a string")}else throw new yu.ValueError("spec_version is not defined");if(Gb.guard.isDefined(r)){if(typeof r!="string")throw new TypeError("expires must be a string")}else throw new yu.ValueError("expires is not defined");if(Gb.guard.isDefined(s)){if(typeof s!="number")throw new TypeError("version must be a number")}else throw new yu.ValueError("version is not defined");return{specVersion:t,expires:r,version:s,unrecognizedFields:n}}};lr.Signed=Jb;function Ise(i){return!isNaN(Number(i))}o(Ise,"isNumeric")});var Su=d(Xr=>{"use strict";var PF=Xr&&Xr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Xr,"__esModule",{value:!0});Xr.TargetFile=Xr.MetaFile=void 0;var DF=PF(require("crypto")),Ap=PF(require("util")),Yr=xi(),Rp=ei(),Kb=class i{static{o(this,"MetaFile")}version;length;hashes;unrecognizedFields;constructor(e){if(e.version<=0)throw new Yr.ValueError("Metafile version must be at least 1");e.length!==void 0&&xF(e.length),this.version=e.version,this.length=e.length,this.hashes=e.hashes,this.unrecognizedFields=e.unrecognizedFields||{}}equals(e){return e instanceof i?this.version===e.version&&this.length===e.length&&Ap.default.isDeepStrictEqual(this.hashes,e.hashes)&&Ap.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}verify(e){if(this.length!==void 0&&e.length!==this.length)throw new Yr.LengthOrHashMismatchError(`Expected length ${this.length} but got ${e.length}`);this.hashes&&Object.entries(this.hashes).forEach(([t,r])=>{let s;try{s=DF.default.createHash(t)}catch{throw new Yr.LengthOrHashMismatchError(`Hash algorithm ${t} not supported`)}let n=s.update(e).digest("hex");if(n!==r)throw new Yr.LengthOrHashMismatchError(`Expected hash ${r} 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:r,hashes:s,...n}=e;if(typeof t!="number")throw new TypeError("version must be a number");if(Rp.guard.isDefined(r)&&typeof r!="number")throw new TypeError("length must be a number");if(Rp.guard.isDefined(s)&&!Rp.guard.isStringRecord(s))throw new TypeError("hashes must be string keys and values");return new i({version:t,length:r,hashes:s,unrecognizedFields:n})}};Xr.MetaFile=Kb;var Zb=class i{static{o(this,"TargetFile")}length;path;hashes;unrecognizedFields;constructor(e){xF(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 i?this.length===e.length&&this.path===e.path&&Ap.default.isDeepStrictEqual(this.hashes,e.hashes)&&Ap.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}async verify(e){let t=0,r=Object.keys(this.hashes).reduce((s,n)=>{try{s[n]=DF.default.createHash(n)}catch{throw new Yr.LengthOrHashMismatchError(`Hash algorithm ${n} not supported`)}return s},{});for await(let s of e)t+=s.length,Object.values(r).forEach(n=>{n.update(s)});if(t!==this.length)throw new Yr.LengthOrHashMismatchError(`Expected length ${this.length} but got ${t}`);Object.entries(r).forEach(([s,n])=>{let a=this.hashes[s],c=n.digest("hex");if(c!==a)throw new Yr.LengthOrHashMismatchError(`Expected hash ${a} but got ${c}`)})}toJSON(){return{length:this.length,hashes:this.hashes,...this.unrecognizedFields}}static fromJSON(e,t){let{length:r,hashes:s,...n}=t;if(typeof r!="number")throw new TypeError("length must be a number");if(!Rp.guard.isStringRecord(s))throw new TypeError("hashes must have string keys and values");return new i({length:r,path:e,hashes:s,unrecognizedFields:n})}};Xr.TargetFile=Zb;function xF(i){if(i<0)throw new Yr.ValueError("Length must be at least 0")}o(xF,"validateLength")});var LF=d(Yb=>{"use strict";Object.defineProperty(Yb,"__esModule",{value:!0});Yb.encodeOIDString=vse;var Ose=6;function vse(i){let e=i.split("."),t=parseInt(e[0],10)*40+parseInt(e[1],10),r=[];e.slice(2).forEach(n=>{let a=Rse(parseInt(n,10));r.push(...a)});let s=Buffer.from([t,...r]);return Buffer.from([Ose,s.length,...s])}o(vse,"encodeOIDString");function Rse(i){let e=[],t=0;for(;i>0;)e.unshift(i&127|t),i>>=7,t=128;return e}o(Rse,"encodeVariableLengthInteger")});var FF=d(wu=>{"use strict";var Ase=wu&&wu.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(wu,"__esModule",{value:!0});wu.getPublicKey=Pse;var zo=Ase(require("crypto")),Eu=xi(),Xb=LF(),Tp=48,MF=3,BF=0,Tse="1.3.101.112",Cse="1.2.840.10045.2.1",Nse="1.2.840.10045.3.1.7",Qb="-----BEGIN PUBLIC KEY-----";function Pse(i){switch(i.keyType){case"rsa":return Dse(i);case"ed25519":return xse(i);case"ecdsa":case"ecdsa-sha2-nistp256":case"ecdsa-sha2-nistp384":return Lse(i);default:throw new Eu.UnsupportedAlgorithmError(`Unsupported key type: ${i.keyType}`)}}o(Pse,"getPublicKey");function Dse(i){if(!i.keyVal.startsWith(Qb))throw new Eu.CryptoError("Invalid key format");let e=zo.default.createPublicKey(i.keyVal);switch(i.scheme){case"rsassa-pss-sha256":return{key:e,padding:zo.default.constants.RSA_PKCS1_PSS_PADDING};default:throw new Eu.UnsupportedAlgorithmError(`Unsupported RSA scheme: ${i.scheme}`)}}o(Dse,"getRSAPublicKey");function xse(i){let e;if(i.keyVal.startsWith(Qb))e=zo.default.createPublicKey(i.keyVal);else{if(!kF(i.keyVal))throw new Eu.CryptoError("Invalid key format");e=zo.default.createPublicKey({key:Mse.hexToDER(i.keyVal),format:"der",type:"spki"})}return{key:e}}o(xse,"getED25519PublicKey");function Lse(i){let e;if(i.keyVal.startsWith(Qb))e=zo.default.createPublicKey(i.keyVal);else{if(!kF(i.keyVal))throw new Eu.CryptoError("Invalid key format");e=zo.default.createPublicKey({key:Bse.hexToDER(i.keyVal),format:"der",type:"spki"})}return{key:e}}o(Lse,"getECDCSAPublicKey");var Mse={hexToDER:o(i=>{let e=Buffer.from(i,"hex"),t=(0,Xb.encodeOIDString)(Tse),r=Buffer.concat([Buffer.concat([Buffer.from([Tp]),Buffer.from([t.length]),t]),Buffer.concat([Buffer.from([MF]),Buffer.from([e.length+1]),Buffer.from([BF]),e])]);return Buffer.concat([Buffer.from([Tp]),Buffer.from([r.length]),r])},"hexToDER")},Bse={hexToDER:o(i=>{let e=Buffer.from(i,"hex"),t=Buffer.concat([Buffer.from([MF]),Buffer.from([e.length+1]),Buffer.from([BF]),e]),r=Buffer.concat([(0,Xb.encodeOIDString)(Cse),(0,Xb.encodeOIDString)(Nse)]),s=Buffer.concat([Buffer.from([Tp]),Buffer.from([r.length]),r]);return Buffer.concat([Buffer.from([Tp]),Buffer.from([s.length+t.length]),s,t])},"hexToDER")},kF=o(i=>/^[0-9a-fA-F]+$/.test(i),"isHex")});var Cp=d(Ho=>{"use strict";var kse=Ho&&Ho.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ho,"__esModule",{value:!0});Ho.Key=void 0;var UF=kse(require("util")),_u=xi(),jF=ei(),Fse=FF(),e0=class i{static{o(this,"Key")}keyID;keyType;scheme;keyVal;unrecognizedFields;constructor(e){let{keyID:t,keyType:r,scheme:s,keyVal:n,unrecognizedFields:a}=e;this.keyID=t,this.keyType=r,this.scheme=s,this.keyVal=n,this.unrecognizedFields=a||{}}verifySignature(e){let t=e.signatures[this.keyID];if(!t)throw new _u.UnsignedMetadataError("no signature for key found in metadata");if(!this.keyVal.public)throw new _u.UnsignedMetadataError("no public key found");let r=(0,Fse.getPublicKey)({keyType:this.keyType,scheme:this.scheme,keyVal:this.keyVal.public}),s=e.signed.toJSON();try{if(!jF.crypto.verifySignature(s,r,t.sig))throw new _u.UnsignedMetadataError(`failed to verify ${this.keyID} signature`)}catch(n){throw n instanceof _u.UnsignedMetadataError?n:new _u.UnsignedMetadataError(`failed to verify ${this.keyID} signature`)}}equals(e){return e instanceof i?this.keyID===e.keyID&&this.keyType===e.keyType&&this.scheme===e.scheme&&UF.default.isDeepStrictEqual(this.keyVal,e.keyVal)&&UF.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:r,scheme:s,keyval:n,...a}=t;if(typeof r!="string")throw new TypeError("keytype must be a string");if(typeof s!="string")throw new TypeError("scheme must be a string");if(!jF.guard.isStringRecord(n))throw new TypeError("keyval must be a string record");return new i({keyID:e,keyType:r,scheme:s,keyVal:n,unrecognizedFields:a})}};Ho.Key=e0});var HF=d((Cbe,zF)=>{"use strict";zF.exports=qF;function qF(i,e,t){i instanceof RegExp&&(i=$F(i,t)),e instanceof RegExp&&(e=$F(e,t));var r=VF(i,e,t);return r&&{start:r[0],end:r[1],pre:t.slice(0,r[0]),body:t.slice(r[0]+i.length,r[1]),post:t.slice(r[1]+e.length)}}o(qF,"balanced");function $F(i,e){var t=e.match(i);return t?t[0]:null}o($F,"maybeMatch");qF.range=VF;function VF(i,e,t){var r,s,n,a,c,u=t.indexOf(i),l=t.indexOf(e,u+1),h=u;if(u>=0&&l>0){if(i===e)return[u,l];for(r=[],n=t.length;h>=0&&!c;)h==u?(r.push(h),u=t.indexOf(i,h+1)):r.length==1?c=[r.pop(),l]:(s=r.pop(),s<n&&(n=s,a=l),l=t.indexOf(e,h+1)),h=u<l&&u>=0?u:l;r.length&&(c=[n,a])}return c}o(VF,"range")});var QF=d((Pbe,XF)=>{var GF=HF();XF.exports=$se;var WF="\0SLASH"+Math.random()+"\0",JF="\0OPEN"+Math.random()+"\0",i0="\0CLOSE"+Math.random()+"\0",KF="\0COMMA"+Math.random()+"\0",ZF="\0PERIOD"+Math.random()+"\0";function t0(i){return parseInt(i,10)==i?parseInt(i,10):i.charCodeAt(0)}o(t0,"numeric");function Use(i){return i.split("\\\\").join(WF).split("\\{").join(JF).split("\\}").join(i0).split("\\,").join(KF).split("\\.").join(ZF)}o(Use,"escapeBraces");function jse(i){return i.split(WF).join("\\").split(JF).join("{").split(i0).join("}").split(KF).join(",").split(ZF).join(".")}o(jse,"unescapeBraces");function YF(i){if(!i)return[""];var e=[],t=GF("{","}",i);if(!t)return i.split(",");var r=t.pre,s=t.body,n=t.post,a=r.split(",");a[a.length-1]+="{"+s+"}";var c=YF(n);return n.length&&(a[a.length-1]+=c.shift(),a.push.apply(a,c)),e.push.apply(e,a),e}o(YF,"parseCommaParts");function $se(i){return i?(i.substr(0,2)==="{}"&&(i="\\{\\}"+i.substr(2)),bu(Use(i),!0).map(jse)):[]}o($se,"expandTop");function qse(i){return"{"+i+"}"}o(qse,"embrace");function Vse(i){return/^-?0\d/.test(i)}o(Vse,"isPadded");function zse(i,e){return i<=e}o(zse,"lte");function Hse(i,e){return i>=e}o(Hse,"gte");function bu(i,e){var t=[],r=GF("{","}",i);if(!r)return[i];var s=r.pre,n=r.post.length?bu(r.post,!1):[""];if(/\$$/.test(r.pre))for(var a=0;a<n.length;a++){var c=s+"{"+r.body+"}"+n[a];t.push(c)}else{var u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),h=u||l,f=r.body.indexOf(",")>=0;if(!h&&!f)return r.post.match(/,(?!,).*\}/)?(i=r.pre+"{"+r.body+i0+r.post,bu(i)):[i];var p;if(h)p=r.body.split(/\.\./);else if(p=YF(r.body),p.length===1&&(p=bu(p[0],!1).map(qse),p.length===1))return n.map(function(ee){return r.pre+p[0]+ee});var m;if(h){var y=t0(p[0]),g=t0(p[1]),S=Math.max(p[0].length,p[1].length),E=p.length==3?Math.abs(t0(p[2])):1,_=zse,b=g<y;b&&(E*=-1,_=Hse);var w=p.some(Vse);m=[];for(var I=y;_(I,g);I+=E){var v;if(l)v=String.fromCharCode(I),v==="\\"&&(v="");else if(v=String(I),w){var N=S-v.length;if(N>0){var P=new Array(N+1).join("0");I<0?v="-"+P+v.slice(1):v=P+v}}m.push(v)}}else{m=[];for(var $=0;$<p.length;$++)m.push.apply(m,bu(p[$],!1))}for(var $=0;$<m.length;$++)for(var a=0;a<n.length;a++){var c=s+m[$]+n[a];(!e||h||c)&&t.push(c)}}return t}o(bu,"expand")});var eU=d(Np=>{"use strict";Object.defineProperty(Np,"__esModule",{value:!0});Np.assertValidPattern=void 0;var Gse=1024*64,Wse=o(i=>{if(typeof i!="string")throw new TypeError("invalid pattern");if(i.length>Gse)throw new TypeError("pattern is too long")},"assertValidPattern");Np.assertValidPattern=Wse});var iU=d(Pp=>{"use strict";Object.defineProperty(Pp,"__esModule",{value:!0});Pp.parseClass=void 0;var Jse={"[: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]},Iu=o(i=>i.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),Kse=o(i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),tU=o(i=>i.join(""),"rangesToString"),Zse=o((i,e)=>{let t=e;if(i.charAt(t)!=="[")throw new Error("not in a brace expression");let r=[],s=[],n=t+1,a=!1,c=!1,u=!1,l=!1,h=t,f="";e:for(;n<i.length;){let g=i.charAt(n);if((g==="!"||g==="^")&&n===t+1){l=!0,n++;continue}if(g==="]"&&a&&!u){h=n+1;break}if(a=!0,g==="\\"&&!u){u=!0,n++;continue}if(g==="["&&!u){for(let[S,[E,_,b]]of Object.entries(Jse))if(i.startsWith(S,n)){if(f)return["$.",!1,i.length-t,!0];n+=S.length,b?s.push(E):r.push(E),c=c||_;continue e}}if(u=!1,f){g>f?r.push(Iu(f)+"-"+Iu(g)):g===f&&r.push(Iu(g)),f="",n++;continue}if(i.startsWith("-]",n+1)){r.push(Iu(g+"-")),n+=2;continue}if(i.startsWith("-",n+1)){f=g,n+=2;continue}r.push(Iu(g)),n++}if(h<n)return["",!1,0,!1];if(!r.length&&!s.length)return["$.",!1,i.length-t,!0];if(s.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let g=r[0].length===2?r[0].slice(-1):r[0];return[Kse(g),!1,h-t,!1]}let p="["+(l?"^":"")+tU(r)+"]",m="["+(l?"":"^")+tU(s)+"]";return[r.length&&s.length?"("+p+"|"+m+")":r.length?p:m,c,h-t,!0]},"parseClass");Pp.parseClass=Zse});var xp=d(Dp=>{"use strict";Object.defineProperty(Dp,"__esModule",{value:!0});Dp.unescape=void 0;var Yse=o((i,{windowsPathsNoEscape:e=!1}={})=>e?i.replace(/\[([^\/\\])\]/g,"$1"):i.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),"unescape");Dp.unescape=Yse});var n0=d(Bp=>{"use strict";Object.defineProperty(Bp,"__esModule",{value:!0});Bp.AST=void 0;var Xse=iU(),Lp=xp(),Qse=new Set(["!","?","+","*","@"]),rU=o(i=>Qse.has(i),"isExtglobType"),ene="(?!(?:^|/)\\.\\.?(?:$|/))",Mp="(?!\\.)",tne=new Set(["[","."]),ine=new Set(["..","."]),rne=new Set("().*{}+?[]^$\\!"),sne=o(i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),s0="[^/]",sU=s0+"*?",nU=s0+"+?",r0=class i{static{o(this,"AST")}type;#e;#t;#i=!1;#r=[];#s;#u;#c;#f=!1;#n;#h;#o=!1;constructor(e,t,r={}){this.type=e,e&&(this.#t=!0),this.#s=t,this.#e=this.#s?this.#s.#e:this,this.#n=this.#e===this?r:this.#e.#n,this.#c=this.#e===this?[]:this.#e.#c,e==="!"&&!this.#e.#f&&this.#c.push(this),this.#u=this.#s?this.#s.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#h!==void 0?this.#h:this.type?this.#h=this.type+"("+this.#r.map(e=>String(e)).join("|")+")":this.#h=this.#r.map(e=>String(e)).join("")}#d(){if(this!==this.#e)throw new Error("should only call on root");if(this.#f)return this;this.toString(),this.#f=!0;let e;for(;e=this.#c.pop();){if(e.type!=="!")continue;let t=e,r=t.#s;for(;r;){for(let s=t.#u+1;!r.type&&s<r.#r.length;s++)for(let n of e.#r){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(r.#r[s])}t=r,r=t.#s}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof i&&t.#s===this))throw new Error("invalid part: "+t);this.#r.push(t)}}toJSON(){let e=this.type===null?this.#r.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#r.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#f&&this.#s?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#s?.isStart())return!1;if(this.#u===0)return!0;let e=this.#s;for(let t=0;t<this.#u;t++){let r=e.#r[t];if(!(r instanceof i&&r.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.#r.length:0;return this.#u===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new i(this.type,e);for(let r of this.#r)t.copyIn(r);return t}static#a(e,t,r,s){let n=!1,a=!1,c=-1,u=!1;if(t.type===null){let m=r,y="";for(;m<e.length;){let g=e.charAt(m++);if(n||g==="\\"){n=!n,y+=g;continue}if(a){m===c+1?(g==="^"||g==="!")&&(u=!0):g==="]"&&!(m===c+2&&u)&&(a=!1),y+=g;continue}else if(g==="["){a=!0,c=m,u=!1,y+=g;continue}if(!s.noext&&rU(g)&&e.charAt(m)==="("){t.push(y),y="";let S=new i(g,t);m=i.#a(e,S,m,s),t.push(S);continue}y+=g}return t.push(y),m}let l=r+1,h=new i(null,t),f=[],p="";for(;l<e.length;){let m=e.charAt(l++);if(n||m==="\\"){n=!n,p+=m;continue}if(a){l===c+1?(m==="^"||m==="!")&&(u=!0):m==="]"&&!(l===c+2&&u)&&(a=!1),p+=m;continue}else if(m==="["){a=!0,c=l,u=!1,p+=m;continue}if(rU(m)&&e.charAt(l)==="("){h.push(p),p="";let y=new i(m,h);h.push(y),l=i.#a(e,y,l,s);continue}if(m==="|"){h.push(p),p="",f.push(h),h=new i(null,t);continue}if(m===")")return p===""&&t.#r.length===0&&(t.#o=!0),h.push(p),p="",t.push(...f,h),l;p+=m}return t.type=null,t.#t=void 0,t.#r=[e.substring(r-1)],l}static fromGlob(e,t={}){let r=new i(null,void 0,t);return i.#a(e,r,0,t),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,r,s,n]=this.toRegExpSource();if(!(s||this.#t||this.#n.nocase&&!this.#n.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let c=(this.#n.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${t}$`,c),{_src:t,_glob:e})}get options(){return this.#n}toRegExpSource(e){let t=e??!!this.#n.dot;if(this.#e===this&&this.#d(),!this.type){let u=this.isStart()&&this.isEnd(),l=this.#r.map(m=>{let[y,g,S,E]=typeof m=="string"?i.#y(m,this.#t,u):m.toRegExpSource(e);return this.#t=this.#t||S,this.#i=this.#i||E,y}).join(""),h="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&ine.has(this.#r[0]))){let y=tne,g=t&&y.has(l.charAt(0))||l.startsWith("\\.")&&y.has(l.charAt(2))||l.startsWith("\\.\\.")&&y.has(l.charAt(4)),S=!t&&!e&&y.has(l.charAt(0));h=g?ene:S?Mp:""}let f="";return this.isEnd()&&this.#e.#f&&this.#s?.type==="!"&&(f="(?:$|\\/)"),[h+l+f,(0,Lp.unescape)(l),this.#t=!!this.#t,this.#i]}let r=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#p(t);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let u=this.toString();return this.#r=[u],this.type=null,this.#t=void 0,[u,(0,Lp.unescape)(this.toString()),!1,!1]}let a=!r||e||t||!Mp?"":this.#p(!0);a===n&&(a=""),a&&(n=`(?:${n})(?:${a})*?`);let c="";if(this.type==="!"&&this.#o)c=(this.isStart()&&!t?Mp:"")+nU;else{let u=this.type==="!"?"))"+(this.isStart()&&!t&&!e?Mp:"")+sU+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;c=s+n+u}return[c,(0,Lp.unescape)(n),this.#t=!!this.#t,this.#i]}#p(e){return this.#r.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[r,s,n,a]=t.toRegExpSource(e);return this.#i=this.#i||a,r}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#y(e,t,r=!1){let s=!1,n="",a=!1;for(let c=0;c<e.length;c++){let u=e.charAt(c);if(s){s=!1,n+=(rne.has(u)?"\\":"")+u;continue}if(u==="\\"){c===e.length-1?n+="\\\\":s=!0;continue}if(u==="["){let[l,h,f,p]=(0,Xse.parseClass)(e,c);if(f){n+=l,a=a||h,c+=f-1,t=t||p;continue}}if(u==="*"){r&&e==="*"?n+=nU:n+=sU,t=!0;continue}if(u==="?"){n+=s0,t=!0;continue}n+=sne(u)}return[n,(0,Lp.unescape)(e),!!t,a]}};Bp.AST=r0});var o0=d(kp=>{"use strict";Object.defineProperty(kp,"__esModule",{value:!0});kp.escape=void 0;var nne=o((i,{windowsPathsNoEscape:e=!1}={})=>e?i.replace(/[?*()[\]]/g,"[$&]"):i.replace(/[?*()[\]\\]/g,"\\$&"),"escape");kp.escape=nne});var fU=d(T=>{"use strict";var one=T&&T.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(T,"__esModule",{value:!0});T.unescape=T.escape=T.AST=T.Minimatch=T.match=T.makeRe=T.braceExpand=T.defaults=T.filter=T.GLOBSTAR=T.sep=T.minimatch=void 0;var ane=one(QF()),Fp=eU(),cU=n0(),cne=o0(),une=xp(),lne=o((i,e,t={})=>((0,Fp.assertValidPattern)(e),!t.nocomment&&e.charAt(0)==="#"?!1:new tn(e,t).match(i)),"minimatch");T.minimatch=lne;var hne=/^\*+([^+@!?\*\[\(]*)$/,fne=o(i=>e=>!e.startsWith(".")&&e.endsWith(i),"starDotExtTest"),dne=o(i=>e=>e.endsWith(i),"starDotExtTestDot"),pne=o(i=>(i=i.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(i)),"starDotExtTestNocase"),mne=o(i=>(i=i.toLowerCase(),e=>e.toLowerCase().endsWith(i)),"starDotExtTestNocaseDot"),gne=/^\*+\.\*+$/,yne=o(i=>!i.startsWith(".")&&i.includes("."),"starDotStarTest"),Sne=o(i=>i!=="."&&i!==".."&&i.includes("."),"starDotStarTestDot"),Ene=/^\.\*+$/,wne=o(i=>i!=="."&&i!==".."&&i.startsWith("."),"dotStarTest"),_ne=/^\*+$/,bne=o(i=>i.length!==0&&!i.startsWith("."),"starTest"),Ine=o(i=>i.length!==0&&i!=="."&&i!=="..","starTestDot"),One=/^\?+([^+@!?\*\[\(]*)?$/,vne=o(([i,e=""])=>{let t=uU([i]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocase"),Rne=o(([i,e=""])=>{let t=lU([i]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocaseDot"),Ane=o(([i,e=""])=>{let t=lU([i]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTestDot"),Tne=o(([i,e=""])=>{let t=uU([i]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTest"),uU=o(([i])=>{let e=i.length;return t=>t.length===e&&!t.startsWith(".")},"qmarksTestNoExt"),lU=o(([i])=>{let e=i.length;return t=>t.length===e&&t!=="."&&t!==".."},"qmarksTestNoExtDot"),hU=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",oU={win32:{sep:"\\"},posix:{sep:"/"}};T.sep=hU==="win32"?oU.win32.sep:oU.posix.sep;T.minimatch.sep=T.sep;T.GLOBSTAR=Symbol("globstar **");T.minimatch.GLOBSTAR=T.GLOBSTAR;var Cne="[^/]",Nne=Cne+"*?",Pne="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Dne="(?:(?!(?:\\/|^)\\.).)*?",xne=o((i,e={})=>t=>(0,T.minimatch)(t,i,e),"filter");T.filter=xne;T.minimatch.filter=T.filter;var Ft=o((i,e={})=>Object.assign({},i,e),"ext"),Lne=o(i=>{if(!i||typeof i!="object"||!Object.keys(i).length)return T.minimatch;let e=T.minimatch;return Object.assign(o((r,s,n={})=>e(r,s,Ft(i,n)),"m"),{Minimatch:class extends e.Minimatch{static{o(this,"Minimatch")}constructor(s,n={}){super(s,Ft(i,n))}static defaults(s){return e.defaults(Ft(i,s)).Minimatch}},AST:class extends e.AST{static{o(this,"AST")}constructor(s,n,a={}){super(s,n,Ft(i,a))}static fromGlob(s,n={}){return e.AST.fromGlob(s,Ft(i,n))}},unescape:o((r,s={})=>e.unescape(r,Ft(i,s)),"unescape"),escape:o((r,s={})=>e.escape(r,Ft(i,s)),"escape"),filter:o((r,s={})=>e.filter(r,Ft(i,s)),"filter"),defaults:o(r=>e.defaults(Ft(i,r)),"defaults"),makeRe:o((r,s={})=>e.makeRe(r,Ft(i,s)),"makeRe"),braceExpand:o((r,s={})=>e.braceExpand(r,Ft(i,s)),"braceExpand"),match:o((r,s,n={})=>e.match(r,s,Ft(i,n)),"match"),sep:e.sep,GLOBSTAR:T.GLOBSTAR})},"defaults");T.defaults=Lne;T.minimatch.defaults=T.defaults;var Mne=o((i,e={})=>((0,Fp.assertValidPattern)(i),e.nobrace||!/\{(?:(?!\{).)*\}/.test(i)?[i]:(0,ane.default)(i)),"braceExpand");T.braceExpand=Mne;T.minimatch.braceExpand=T.braceExpand;var Bne=o((i,e={})=>new tn(i,e).makeRe(),"makeRe");T.makeRe=Bne;T.minimatch.makeRe=T.makeRe;var kne=o((i,e,t={})=>{let r=new tn(e,t);return i=i.filter(s=>r.match(s)),r.options.nonull&&!i.length&&i.push(e),i},"match");T.match=kne;T.minimatch.match=T.match;var aU=/[?*]|[+@!]\(.*?\)|\[|\]/,Fne=o(i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),tn=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,Fp.assertValidPattern)(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||hU,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...n)=>{}),this.debug(this.pattern,this.globSet);let r=this.globSet.map(n=>this.slashSplit(n));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let s=this.globParts.map((n,a,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=n[0]===""&&n[1]===""&&(n[2]==="?"||!aU.test(n[2]))&&!aU.test(n[3]),l=/^[a-z]:/i.test(n[0]);if(u)return[...n.slice(0,4),...n.slice(4).map(h=>this.parse(h))];if(l)return[n[0],...n.slice(1).map(h=>this.parse(h))]}return n.map(u=>this.parse(u))});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 r=0;r<e.length;r++)for(let s=0;s<e[r].length;s++)e[r][s]==="**"&&(e[r][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 r=-1;for(;(r=t.indexOf("**",r+1))!==-1;){let s=r;for(;t[s+1]==="**";)s++;s!==r&&t.splice(r,s-r)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((r,s)=>{let n=r[r.length-1];return s==="**"&&n==="**"?r:s===".."&&n&&n!==".."&&n!=="."&&n!=="**"?(r.pop(),r):(r.push(s),r)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let 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 r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let s=e[r-1];s&&s!=="."&&s!==".."&&s!=="**"&&(t=!0,e.splice(r-1,2),r-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let r of e){let s=-1;for(;(s=r.indexOf("**",s+1))!==-1;){let a=s;for(;r[a+1]==="**";)a++;a>s&&r.splice(s+1,a-s);let c=r[s+1],u=r[s+2],l=r[s+3];if(c!==".."||!u||u==="."||u===".."||!l||l==="."||l==="..")continue;t=!0,r.splice(s,1);let h=r.slice(0);h[s]="**",e.push(h),s--}if(!this.preserveMultipleSlashes){for(let a=1;a<r.length-1;a++){let c=r[a];a===1&&c===""&&r[0]===""||(c==="."||c==="")&&(t=!0,r.splice(a,1),a--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(t=!0,r.pop())}let n=0;for(;(n=r.indexOf("..",n+1))!==-1;){let a=r[n-1];if(a&&a!=="."&&a!==".."&&a!=="**"){t=!0;let u=n===1&&r[n+1]==="**"?["."]:[];r.splice(n-1,2,...u),r.length===0&&r.push(""),n-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let r=t+1;r<e.length;r++){let s=this.partsMatch(e[t],e[r],!this.preserveMultipleSlashes);if(s){e[t]=[],e[r]=s;break}}return e.filter(t=>t.length)}partsMatch(e,t,r=!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(r&&e[s]==="**"&&t[n]===e[s+1])a.push(e[s]),s++;else if(r&&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,r=0;for(let s=0;s<e.length&&e.charAt(s)==="!";s++)t=!t,r++;r&&(this.pattern=e.slice(r)),this.negate=t}matchOne(e,t,r=!1){let s=this.options;if(this.isWindows){let g=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),S=!g&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),E=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),_=!E&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),b=S?3:g?0:void 0,w=_?3:E?0:void 0;if(typeof b=="number"&&typeof w=="number"){let[I,v]=[e[b],t[w]];I.toLowerCase()===v.toLowerCase()&&(t[w]=I,w>b?t=t.slice(w):b>w&&(e=e.slice(b)))}}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,u=e.length,l=t.length;a<u&&c<l;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===T.GLOBSTAR){this.debug("GLOBSTAR",[t,h,f]);var p=a,m=c+1;if(m===l){for(this.debug("** at the end");a<u;a++)if(e[a]==="."||e[a]===".."||!s.dot&&e[a].charAt(0)===".")return!1;return!0}for(;p<u;){var y=e[p];if(this.debug(`
58
59
  globstar while`,e,p,t,m,y),this.matchOne(e.slice(p),t.slice(m),r))return this.debug("globstar found match!",p,u,y),!0;if(y==="."||y===".."||!s.dot&&y.charAt(0)==="."){this.debug("dot detected!",e,p,t,m);break}this.debug("globstar swallow a segment, and continue"),p++}return!!(r&&(this.debug(`
59
- >>> no match, partial?`,e,p,t,m),p===u))}let g;if(typeof h=="string"?(g=f===h,this.debug("string match",h,f,g)):(g=h.test(f),this.debug("pattern match",h,f,g)),!g)return!1}if(a===u&&c===l)return!0;if(a===u)return r;if(c===l)return a===u-1&&e[a]==="";throw new Error("wtf?")}braceExpand(){return(0,T.braceExpand)(this.pattern,this.options)}parse(e){(0,Fp.assertValidPattern)(e);let t=this.options;if(e==="**")return T.GLOBSTAR;if(e==="")return"";let r,s=null;(r=e.match(Ene))?s=t.dot?_ne:wne:(r=e.match(une))?s=(t.nocase?t.dot?dne:fne:t.dot?hne:lne)(r[1]):(r=e.match(bne))?s=(t.nocase?t.dot?One:Ine:t.dot?vne:Rne)(r):(r=e.match(pne))?s=t.dot?gne:mne:(r=e.match(yne))&&(s=Sne);let n=cU.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,r=t.noglobstar?Tne:t.dot?Cne:Nne,s=new Set(t.nocase?["i"]:[]),n=e.map(u=>{let l=u.map(h=>{if(h instanceof RegExp)for(let f of h.flags.split(""))s.add(f);return typeof h=="string"?Bne(h):h===T.GLOBSTAR?T.GLOBSTAR:h._src});return l.forEach((h,f)=>{let p=l[f+1],m=l[f-1];h!==T.GLOBSTAR||m===T.GLOBSTAR||(m===void 0?p!==void 0&&p!==T.GLOBSTAR?l[f+1]="(?:\\/|"+r+"\\/)?"+p:l[f]=r:p===void 0?l[f-1]=m+"(?:\\/|"+r+")?":p!==T.GLOBSTAR&&(l[f-1]=m+"(?:\\/|\\/"+r+"\\/)"+p,l[f+1]=T.GLOBSTAR))}),l.filter(h=>h!==T.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 r=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 u=n[c],l=s;if(r.matchBase&&u.length===1&&(l=[a]),this.matchOne(l,u,t))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return T.minimatch.defaults(e).Minimatch}};T.Minimatch=tn;var kne=n0();Object.defineProperty(T,"AST",{enumerable:!0,get:o(function(){return kne.AST},"get")});var Fne=o0();Object.defineProperty(T,"escape",{enumerable:!0,get:o(function(){return Fne.escape},"get")});var Une=xp();Object.defineProperty(T,"unescape",{enumerable:!0,get:o(function(){return Une.unescape},"get")});T.minimatch.AST=cU.AST;T.minimatch.Minimatch=tn;T.minimatch.escape=one.escape;T.minimatch.unescape=ane.unescape});var u0=d(Ut=>{"use strict";var dU=Ut&&Ut.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ut,"__esModule",{value:!0});Ut.SuccinctRoles=Ut.DelegatedRole=Ut.Role=Ut.TOP_LEVEL_ROLE_NAMES=void 0;var pU=dU(require("crypto")),jne=fU(),Up=dU(require("util")),jp=xi(),rn=ei();Ut.TOP_LEVEL_ROLE_NAMES=["root","targets","snapshot","timestamp"];var Ou=class i{static{o(this,"Role")}keyIDs;threshold;unrecognizedFields;constructor(e){let{keyIDs:t,threshold:r,unrecognizedFields:s}=e;if($ne(t))throw new jp.ValueError("duplicate key IDs found");if(r<1)throw new jp.ValueError("threshold must be at least 1");this.keyIDs=t,this.threshold=r,this.unrecognizedFields=s||{}}equals(e){return e instanceof i?this.threshold===e.threshold&&Up.default.isDeepStrictEqual(this.keyIDs,e.keyIDs)&&Up.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}toJSON(){return{keyids:this.keyIDs,threshold:this.threshold,...this.unrecognizedFields}}static fromJSON(e){let{keyids:t,threshold:r,...s}=e;if(!rn.guard.isStringArray(t))throw new TypeError("keyids must be an array");if(typeof r!="number")throw new TypeError("threshold must be a number");return new i({keyIDs:t,threshold:r,unrecognizedFields:s})}};Ut.Role=Ou;function $ne(i){return new Set(i).size!==i.length}o($ne,"hasDuplicates");var a0=class i extends Ou{static{o(this,"DelegatedRole")}name;terminating;paths;pathHashPrefixes;constructor(e){super(e);let{name:t,terminating:r,paths:s,pathHashPrefixes:n}=e;if(this.name=t,this.terminating=r,e.paths&&e.pathHashPrefixes)throw new jp.ValueError("paths and pathHashPrefixes are mutually exclusive");this.paths=s,this.pathHashPrefixes=n}equals(e){return e instanceof i?super.equals(e)&&this.name===e.name&&this.terminating===e.terminating&&Up.default.isDeepStrictEqual(this.paths,e.paths)&&Up.default.isDeepStrictEqual(this.pathHashPrefixes,e.pathHashPrefixes):!1}isDelegatedPath(e){if(this.paths)return this.paths.some(t=>Vne(e,t));if(this.pathHashPrefixes){let r=pU.default.createHash("sha256").update(e).digest("hex");return this.pathHashPrefixes.some(s=>r.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:r,name:s,terminating:n,paths:a,path_hash_prefixes:c,...u}=e;if(!rn.guard.isStringArray(t))throw new TypeError("keyids must be an array of strings");if(typeof r!="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(rn.guard.isDefined(a)&&!rn.guard.isStringArray(a))throw new TypeError("paths must be an array of strings");if(rn.guard.isDefined(c)&&!rn.guard.isStringArray(c))throw new TypeError("path_hash_prefixes must be an array of strings");return new i({keyIDs:t,threshold:r,name:s,terminating:n,paths:a,pathHashPrefixes:c,unrecognizedFields:u})}};Ut.DelegatedRole=a0;var qne=o((i,e)=>i.map((t,r)=>[t,e[r]]),"zip");function Vne(i,e){let t=i.split("/"),r=e.split("/");return r.length!=t.length?!1:qne(t,r).every(([s,n])=>(0,jne.minimatch)(s,n))}o(Vne,"isTargetInPathPattern");var c0=class i extends Ou{static{o(this,"SuccinctRoles")}bitLength;namePrefix;numberOfBins;suffixLen;constructor(e){super(e);let{bitLength:t,namePrefix:r}=e;if(t<=0||t>32)throw new jp.ValueError("bitLength must be between 1 and 32");this.bitLength=t,this.namePrefix=r,this.numberOfBins=Math.pow(2,t),this.suffixLen=(this.numberOfBins-1).toString(16).length}equals(e){return e instanceof i?super.equals(e)&&this.bitLength===e.bitLength&&this.namePrefix===e.namePrefix:!1}getRoleForTarget(e){let s=pU.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 r=e.slice(t.length,e.length);if(r.length!=this.suffixLen||!r.match(/^[0-9a-fA-F]+$/))return!1;let s=parseInt(r,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:r,bit_length:s,name_prefix:n,...a}=e;if(!rn.guard.isStringArray(t))throw new TypeError("keyids must be an array of strings");if(typeof r!="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 i({keyIDs:t,threshold:r,bitLength:s,namePrefix:n,unrecognizedFields:a})}};Ut.SuccinctRoles=c0});var f0=d(Go=>{"use strict";var zne=Go&&Go.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Go,"__esModule",{value:!0});Go.Root=void 0;var mU=zne(require("util")),l0=en(),gU=xi(),Hne=Cp(),$p=u0(),qp=ei(),h0=class i extends l0.Signed{static{o(this,"Root")}type=l0.MetadataKind.Root;keys;roles;consistentSnapshot;constructor(e){if(super(e),this.keys=e.keys||{},this.consistentSnapshot=e.consistentSnapshot??!0,!e.roles)this.roles=$p.TOP_LEVEL_ROLE_NAMES.reduce((t,r)=>({...t,[r]:new $p.Role({keyIDs:[],threshold:1})}),{});else{let t=new Set(Object.keys(e.roles));if(!$p.TOP_LEVEL_ROLE_NAMES.every(r=>t.has(r)))throw new gU.ValueError("missing top-level role");this.roles=e.roles}}addKey(e,t){if(!this.roles[t])throw new gU.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 i?super.equals(e)&&this.consistentSnapshot===e.consistentSnapshot&&mU.default.isDeepStrictEqual(this.keys,e.keys)&&mU.default.isDeepStrictEqual(this.roles,e.roles):!1}toJSON(){return{_type:this.type,spec_version:this.specVersion,version:this.version,expires:this.expires,keys:Gne(this.keys),roles:Wne(this.roles),consistent_snapshot:this.consistentSnapshot,...this.unrecognizedFields}}static fromJSON(e){let{unrecognizedFields:t,...r}=l0.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 i({...r,keys:Jne(s),roles:Kne(n),consistentSnapshot:a,unrecognizedFields:c})}};Go.Root=h0;function Gne(i){return Object.entries(i).reduce((e,[t,r])=>({...e,[t]:r.toJSON()}),{})}o(Gne,"keysToJSON");function Wne(i){return Object.entries(i).reduce((e,[t,r])=>({...e,[t]:r.toJSON()}),{})}o(Wne,"rolesToJSON");function Jne(i){let e;if(qp.guard.isDefined(i)){if(!qp.guard.isObjectRecord(i))throw new TypeError("keys must be an object");e=Object.entries(i).reduce((t,[r,s])=>({...t,[r]:Hne.Key.fromJSON(r,s)}),{})}return e}o(Jne,"keysFromJSON");function Kne(i){let e;if(qp.guard.isDefined(i)){if(!qp.guard.isObjectRecord(i))throw new TypeError("roles must be an object");e=Object.entries(i).reduce((t,[r,s])=>({...t,[r]:$p.Role.fromJSON(s)}),{})}return e}o(Kne,"rolesFromJSON")});var p0=d(Vp=>{"use strict";Object.defineProperty(Vp,"__esModule",{value:!0});Vp.Signature=void 0;var d0=class i{static{o(this,"Signature")}keyID;sig;constructor(e){let{keyID:t,sig:r}=e;this.keyID=t,this.sig=r}toJSON(){return{keyid:this.keyID,sig:this.sig}}static fromJSON(e){let{keyid:t,sig:r}=e;if(typeof t!="string")throw new TypeError("keyid must be a string");if(typeof r!="string")throw new TypeError("sig must be a string");return new i({keyID:t,sig:r})}};Vp.Signature=d0});var y0=d(Wo=>{"use strict";var Zne=Wo&&Wo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Wo,"__esModule",{value:!0});Wo.Snapshot=void 0;var Yne=Zne(require("util")),m0=en(),SU=Su(),yU=ei(),g0=class i extends m0.Signed{static{o(this,"Snapshot")}type=m0.MetadataKind.Snapshot;meta;constructor(e){super(e),this.meta=e.meta||{"targets.json":new SU.MetaFile({version:1})}}equals(e){return e instanceof i?super.equals(e)&&Yne.default.isDeepStrictEqual(this.meta,e.meta):!1}toJSON(){return{_type:this.type,meta:Xne(this.meta),spec_version:this.specVersion,version:this.version,expires:this.expires,...this.unrecognizedFields}}static fromJSON(e){let{unrecognizedFields:t,...r}=m0.Signed.commonFieldsFromJSON(e),{meta:s,...n}=t;return new i({...r,meta:Qne(s),unrecognizedFields:n})}};Wo.Snapshot=g0;function Xne(i){return Object.entries(i).reduce((e,[t,r])=>({...e,[t]:r.toJSON()}),{})}o(Xne,"metaToJSON");function Qne(i){let e;if(yU.guard.isDefined(i))if(yU.guard.isObjectRecord(i))e=Object.entries(i).reduce((t,[r,s])=>({...t,[r]:SU.MetaFile.fromJSON(s)}),{});else throw new TypeError("meta field is malformed");return e}o(Qne,"metaFromJSON")});var EU=d(Jo=>{"use strict";var eoe=Jo&&Jo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Jo,"__esModule",{value:!0});Jo.Delegations=void 0;var zp=eoe(require("util")),toe=xi(),ioe=Cp(),S0=u0(),Hp=ei(),E0=class i{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=>S0.TOP_LEVEL_ROLE_NAMES.includes(t)))throw new toe.ValueError("Delegated role name conflicts with top-level role name");this.succinctRoles=e.succinctRoles,this.roles=e.roles}equals(e){return e instanceof i?zp.default.isDeepStrictEqual(this.keys,e.keys)&&zp.default.isDeepStrictEqual(this.roles,e.roles)&&zp.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields)&&zp.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:roe(this.keys),...this.unrecognizedFields};return this.roles?e.roles=soe(this.roles):this.succinctRoles&&(e.succinct_roles=this.succinctRoles.toJSON()),e}static fromJSON(e){let{keys:t,roles:r,succinct_roles:s,...n}=e,a;return Hp.guard.isObject(s)&&(a=S0.SuccinctRoles.fromJSON(s)),new i({keys:noe(t),roles:ooe(r),unrecognizedFields:n,succinctRoles:a})}};Jo.Delegations=E0;function roe(i){return Object.entries(i).reduce((e,[t,r])=>({...e,[t]:r.toJSON()}),{})}o(roe,"keysToJSON");function soe(i){return Object.values(i).map(e=>e.toJSON())}o(soe,"rolesToJSON");function noe(i){if(!Hp.guard.isObjectRecord(i))throw new TypeError("keys is malformed");return Object.entries(i).reduce((e,[t,r])=>({...e,[t]:ioe.Key.fromJSON(t,r)}),{})}o(noe,"keysFromJSON");function ooe(i){let e;if(Hp.guard.isDefined(i)){if(!Hp.guard.isObjectArray(i))throw new TypeError("roles is malformed");e=i.reduce((t,r)=>{let s=S0.DelegatedRole.fromJSON(r);return{...t,[s.name]:s}},{})}return e}o(ooe,"rolesFromJSON")});var b0=d(Ko=>{"use strict";var aoe=Ko&&Ko.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ko,"__esModule",{value:!0});Ko.Targets=void 0;var wU=aoe(require("util")),w0=en(),coe=EU(),uoe=Su(),Gp=ei(),_0=class i extends w0.Signed{static{o(this,"Targets")}type=w0.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 i?super.equals(e)&&wU.default.isDeepStrictEqual(this.targets,e.targets)&&wU.default.isDeepStrictEqual(this.delegations,e.delegations):!1}toJSON(){let e={_type:this.type,spec_version:this.specVersion,version:this.version,expires:this.expires,targets:loe(this.targets),...this.unrecognizedFields};return this.delegations&&(e.delegations=this.delegations.toJSON()),e}static fromJSON(e){let{unrecognizedFields:t,...r}=w0.Signed.commonFieldsFromJSON(e),{targets:s,delegations:n,...a}=t;return new i({...r,targets:hoe(s),delegations:foe(n),unrecognizedFields:a})}};Ko.Targets=_0;function loe(i){return Object.entries(i).reduce((e,[t,r])=>({...e,[t]:r.toJSON()}),{})}o(loe,"targetsToJSON");function hoe(i){let e;if(Gp.guard.isDefined(i))if(Gp.guard.isObjectRecord(i))e=Object.entries(i).reduce((t,[r,s])=>({...t,[r]:uoe.TargetFile.fromJSON(r,s)}),{});else throw new TypeError("targets must be an object");return e}o(hoe,"targetsFromJSON");function foe(i){let e;if(Gp.guard.isDefined(i))if(Gp.guard.isObject(i))e=coe.Delegations.fromJSON(i);else throw new TypeError("delegations must be an object");return e}o(foe,"delegationsFromJSON")});var R0=d(Wp=>{"use strict";Object.defineProperty(Wp,"__esModule",{value:!0});Wp.Timestamp=void 0;var I0=en(),_U=Su(),O0=ei(),v0=class i extends I0.Signed{static{o(this,"Timestamp")}type=I0.MetadataKind.Timestamp;snapshotMeta;constructor(e){super(e),this.snapshotMeta=e.snapshotMeta||new _U.MetaFile({version:1})}equals(e){return e instanceof i?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,...r}=I0.Signed.commonFieldsFromJSON(e),{meta:s,...n}=t;return new i({...r,snapshotMeta:doe(s),unrecognizedFields:n})}};Wp.Timestamp=v0;function doe(i){let e;if(O0.guard.isDefined(i)){let t=i["snapshot.json"];if(!O0.guard.isDefined(t)||!O0.guard.isObject(t))throw new TypeError("missing snapshot.json in meta");e=_U.MetaFile.fromJSON(t)}return e}o(doe,"snapshotMetaFromJSON")});var IU=d(Yo=>{"use strict";var poe=Yo&&Yo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Yo,"__esModule",{value:!0});Yo.Metadata=void 0;var moe=Hb(),bU=poe(require("util")),Zo=en(),vu=xi(),goe=f0(),yoe=p0(),Soe=y0(),Eoe=b0(),woe=R0(),A0=ei(),T0=class i{static{o(this,"Metadata")}signed;signatures;unrecognizedFields;constructor(e,t,r){this.signed=e,this.signatures=t||{},this.unrecognizedFields=r||{}}sign(e,t=!0){let r=Buffer.from((0,moe.canonicalize)(this.signed.toJSON())),s=e(r);t||(this.signatures={}),this.signatures[s.keyID]=s}verifyDelegate(e,t){let r,s={};switch(this.signed.type){case Zo.MetadataKind.Root:s=this.signed.keys,r=this.signed.roles[e];break;case Zo.MetadataKind.Targets:if(!this.signed.delegations)throw new vu.ValueError(`No delegations found for ${e}`);s=this.signed.delegations.keys,this.signed.delegations.roles?r=this.signed.delegations.roles[e]:this.signed.delegations.succinctRoles&&this.signed.delegations.succinctRoles.isDelegatedRole(e)&&(r=this.signed.delegations.succinctRoles);break;default:throw new TypeError("invalid metadata type")}if(!r)throw new vu.ValueError(`no delegation found for ${e}`);let n=new Set;if(r.keyIDs.forEach(a=>{let c=s[a];if(c)try{c.verifySignature(t),n.add(c.keyID)}catch{}}),n.size<r.threshold)throw new vu.UnsignedMetadataError(`${e} was signed by ${n.size}/${r.threshold} keys`)}equals(e){return e instanceof i?this.signed.equals(e.signed)&&bU.default.isDeepStrictEqual(this.signatures,e.signatures)&&bU.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:r,signatures:s,...n}=t;if(!A0.guard.isDefined(r)||!A0.guard.isObject(r))throw new TypeError("signed is not defined");if(e!==r._type)throw new vu.ValueError(`expected '${e}', got ${r._type}`);if(!A0.guard.isObjectArray(s))throw new TypeError("signatures is not an array");let a;switch(e){case Zo.MetadataKind.Root:a=goe.Root.fromJSON(r);break;case Zo.MetadataKind.Timestamp:a=woe.Timestamp.fromJSON(r);break;case Zo.MetadataKind.Snapshot:a=Soe.Snapshot.fromJSON(r);break;case Zo.MetadataKind.Targets:a=Eoe.Targets.fromJSON(r);break;default:throw new TypeError("invalid metadata type")}let c={};return s.forEach(u=>{let l=yoe.Signature.fromJSON(u);if(c[l.keyID])throw new vu.ValueError(`multiple signatures found for keyid: ${l.keyID}`);c[l.keyID]=l}),new i(a,c,n)}};Yo.Metadata=T0});var Jp=d(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.Timestamp=ce.Targets=ce.Snapshot=ce.Signature=ce.Root=ce.Metadata=ce.Key=ce.TargetFile=ce.MetaFile=ce.ValueError=ce.MetadataKind=void 0;var _oe=en();Object.defineProperty(ce,"MetadataKind",{enumerable:!0,get:o(function(){return _oe.MetadataKind},"get")});var boe=xi();Object.defineProperty(ce,"ValueError",{enumerable:!0,get:o(function(){return boe.ValueError},"get")});var OU=Su();Object.defineProperty(ce,"MetaFile",{enumerable:!0,get:o(function(){return OU.MetaFile},"get")});Object.defineProperty(ce,"TargetFile",{enumerable:!0,get:o(function(){return OU.TargetFile},"get")});var Ioe=Cp();Object.defineProperty(ce,"Key",{enumerable:!0,get:o(function(){return Ioe.Key},"get")});var Ooe=IU();Object.defineProperty(ce,"Metadata",{enumerable:!0,get:o(function(){return Ooe.Metadata},"get")});var voe=f0();Object.defineProperty(ce,"Root",{enumerable:!0,get:o(function(){return voe.Root},"get")});var Roe=p0();Object.defineProperty(ce,"Signature",{enumerable:!0,get:o(function(){return Roe.Signature},"get")});var Aoe=y0();Object.defineProperty(ce,"Snapshot",{enumerable:!0,get:o(function(){return Aoe.Snapshot},"get")});var Toe=b0();Object.defineProperty(ce,"Targets",{enumerable:!0,get:o(function(){return Toe.Targets},"get")});var Coe=R0();Object.defineProperty(ce,"Timestamp",{enumerable:!0,get:o(function(){return Coe.Timestamp},"get")})});var Zp=d(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.DownloadHTTPError=de.DownloadLengthMismatchError=de.DownloadError=de.ExpiredMetadataError=de.EqualVersionError=de.BadVersionError=de.RepositoryError=de.PersistError=de.RuntimeError=de.ValueError=void 0;var C0=class extends Error{static{o(this,"ValueError")}};de.ValueError=C0;var N0=class extends Error{static{o(this,"RuntimeError")}};de.RuntimeError=N0;var P0=class extends Error{static{o(this,"PersistError")}};de.PersistError=P0;var Ru=class extends Error{static{o(this,"RepositoryError")}};de.RepositoryError=Ru;var Kp=class extends Ru{static{o(this,"BadVersionError")}};de.BadVersionError=Kp;var D0=class extends Kp{static{o(this,"EqualVersionError")}};de.EqualVersionError=D0;var x0=class extends Ru{static{o(this,"ExpiredMetadataError")}};de.ExpiredMetadataError=x0;var Au=class extends Error{static{o(this,"DownloadError")}};de.DownloadError=Au;var L0=class extends Au{static{o(this,"DownloadLengthMismatchError")}};de.DownloadLengthMismatchError=L0;var M0=class extends Au{static{o(this,"DownloadHTTPError")}statusCode;constructor(e,t){super(e),this.statusCode=t}};de.DownloadHTTPError=M0});var RU=d(Xo=>{"use strict";var k0=Xo&&Xo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Xo,"__esModule",{value:!0});Xo.withTempFile=void 0;var B0=k0(require("fs/promises")),Noe=k0(require("os")),vU=k0(require("path")),Poe=o(async i=>Doe(async e=>i(vU.default.join(e,"tempfile"))),"withTempFile");Xo.withTempFile=Poe;var Doe=o(async i=>{let e=await B0.default.realpath(Noe.default.tmpdir()),t=await B0.default.mkdtemp(e+vU.default.sep);try{return await i(t)}finally{await B0.default.rm(t,{force:!0,recursive:!0,maxRetries:3})}},"withTempDir")});var U0=d(Qr=>{"use strict";var Xp=Qr&&Qr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Qr,"__esModule",{value:!0});Qr.DefaultFetcher=Qr.BaseFetcher=void 0;var xoe=Xp(Fs()),AU=Xp(require("fs")),Loe=Xp(iu()),Moe=Xp(require("util")),TU=Zp(),Boe=RU(),koe=(0,xoe.default)("tuf:fetch"),Yp=class{static{o(this,"BaseFetcher")}async downloadFile(e,t,r){return(0,Boe.withTempFile)(async s=>{let n=await this.fetch(e),a=0,c=AU.default.createWriteStream(s);try{for await(let u of n){if(a+=u.length,a>t)throw new TU.DownloadLengthMismatchError("Max length reached");await Foe(c,u)}}finally{await Moe.default.promisify(c.close).bind(c)()}return r(s)})}async downloadBytes(e,t){return this.downloadFile(e,t,async r=>{let s=AU.default.createReadStream(r),n=[];for await(let a of s)n.push(a);return Buffer.concat(n)})}};Qr.BaseFetcher=Yp;var F0=class extends Yp{static{o(this,"DefaultFetcher")}timeout;retry;constructor(e={}){super(),this.timeout=e.timeout,this.retry=e.retry}async fetch(e){koe("GET %s",e);let t=await(0,Loe.default)(e,{timeout:this.timeout,retry:this.retry});if(!t.ok||!t?.body)throw new TU.DownloadHTTPError("Failed to download",t.status);return t.body}};Qr.DefaultFetcher=F0;var Foe=o(async(i,e)=>new Promise((t,r)=>{i.write(e,s=>{s&&r(s),t(!0)})}),"writeBufferToStream")});var CU=d(Qp=>{"use strict";Object.defineProperty(Qp,"__esModule",{value:!0});Qp.defaultConfig=void 0;Qp.defaultConfig={maxRootRotations:256,maxDelegations:32,rootMaxLength:512e3,timestampMaxLength:16384,snapshotMaxLength:2e6,targetsMaxLength:5e6,prefixTargetsWithHash:!0,fetchTimeout:1e5,fetchRetries:void 0,fetchRetry:2}});var NU=d(em=>{"use strict";Object.defineProperty(em,"__esModule",{value:!0});em.TrustedMetadataStore=void 0;var Ie=Jp(),le=Zp(),j0=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")),r=Ie.Metadata.fromJSON(Ie.MetadataKind.Root,t);if(r.signed.type!=Ie.MetadataKind.Root)throw new le.RepositoryError(`Expected 'root', got ${r.signed.type}`);if(this.root.verifyDelegate(Ie.MetadataKind.Root,r),r.signed.version!=this.root.signed.version+1)throw new le.BadVersionError(`Expected version ${this.root.signed.version+1}, got ${r.signed.version}`);return r.verifyDelegate(Ie.MetadataKind.Root,r),this.trustedSet.root=r,r}updateTimestamp(e){if(this.snapshot)throw new le.RuntimeError("Cannot update timestamp after snapshot");if(this.root.signed.isExpired(this.referenceTime))throw new le.ExpiredMetadataError("Final root.json is expired");let t=JSON.parse(e.toString("utf8")),r=Ie.Metadata.fromJSON(Ie.MetadataKind.Timestamp,t);if(r.signed.type!=Ie.MetadataKind.Timestamp)throw new le.RepositoryError(`Expected 'timestamp', got ${r.signed.type}`);if(this.root.verifyDelegate(Ie.MetadataKind.Timestamp,r),this.timestamp){if(r.signed.version<this.timestamp.signed.version)throw new le.BadVersionError(`New timestamp version ${r.signed.version} is less than current version ${this.timestamp.signed.version}`);if(r.signed.version===this.timestamp.signed.version)throw new le.EqualVersionError(`New timestamp version ${r.signed.version} is equal to current version ${this.timestamp.signed.version}`);let s=this.timestamp.signed.snapshotMeta,n=r.signed.snapshotMeta;if(n.version<s.version)throw new le.BadVersionError(`New snapshot version ${n.version} is less than current version ${s.version}`)}return this.trustedSet.timestamp=r,this.checkFinalTimestamp(),r}updateSnapshot(e,t=!1){if(!this.timestamp)throw new le.RuntimeError("Cannot update snapshot before timestamp");if(this.targets)throw new le.RuntimeError("Cannot update snapshot after targets");this.checkFinalTimestamp();let r=this.timestamp.signed.snapshotMeta;t||r.verify(e);let s=JSON.parse(e.toString("utf8")),n=Ie.Metadata.fromJSON(Ie.MetadataKind.Snapshot,s);if(n.signed.type!=Ie.MetadataKind.Snapshot)throw new le.RepositoryError(`Expected 'snapshot', got ${n.signed.type}`);return this.root.verifyDelegate(Ie.MetadataKind.Snapshot,n),this.snapshot&&Object.entries(this.snapshot.signed.meta).forEach(([a,c])=>{let u=n.signed.meta[a];if(!u)throw new le.RepositoryError(`Missing file ${a} in new snapshot`);if(u.version<c.version)throw new le.BadVersionError(`New version ${u.version} of ${a} is less than current version ${c.version}`)}),this.trustedSet.snapshot=n,this.checkFinalSnapsnot(),n}updateDelegatedTargets(e,t,r){if(!this.snapshot)throw new le.RuntimeError("Cannot update delegated targets before snapshot");this.checkFinalSnapsnot();let s=this.trustedSet[r];if(!s)throw new le.RuntimeError(`No trusted ${r} metadata`);let n=this.snapshot.signed.meta?.[`${t}.json`];if(!n)throw new le.RepositoryError(`Missing ${t}.json in snapshot`);n.verify(e);let a=JSON.parse(e.toString("utf8")),c=Ie.Metadata.fromJSON(Ie.MetadataKind.Targets,a);if(c.signed.type!=Ie.MetadataKind.Targets)throw new le.RepositoryError(`Expected 'targets', got ${c.signed.type}`);s.verifyDelegate(t,c);let u=c.signed.version;if(u!=n.version)throw new le.BadVersionError(`Version ${u} of ${t} does not match snapshot version ${n.version}`);if(c.signed.isExpired(this.referenceTime))throw new le.ExpiredMetadataError(`${t}.json is expired`);this.trustedSet[t]=c}loadTrustedRoot(e){let t=JSON.parse(e.toString("utf8")),r=Ie.Metadata.fromJSON(Ie.MetadataKind.Root,t);if(r.signed.type!=Ie.MetadataKind.Root)throw new le.RepositoryError(`Expected 'root', got ${r.signed.type}`);r.verifyDelegate(Ie.MetadataKind.Root,r),this.trustedSet.root=r}checkFinalTimestamp(){if(!this.timestamp)throw new ReferenceError("No trusted timestamp metadata");if(this.timestamp.signed.isExpired(this.referenceTime))throw new le.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 le.ExpiredMetadataError("snapshot.json is expired");let e=this.timestamp.signed.snapshotMeta;if(this.snapshot.signed.version!==e.version)throw new le.BadVersionError("Snapshot version doesn't match timestamp")}};em.TrustedMetadataStore=j0});var PU=d($0=>{"use strict";Object.defineProperty($0,"__esModule",{value:!0});$0.join=joe;var Uoe=require("url");function joe(i,e){return new Uoe.URL($oe(i)+qoe(e)).toString()}o(joe,"join");function $oe(i){return i.endsWith("/")?i:i+"/"}o($oe,"ensureTrailingSlash");function qoe(i){return i.startsWith("/")?i.slice(1):i}o(qoe,"removeLeadingSlash")});var DU=d(jt=>{"use strict";var Voe=jt&&jt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),zoe=jt&&jt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),z0=jt&&jt.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&Voe(t,e,r[s]);return zoe(t,e),t}})(),Hoe=jt&&jt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(jt,"__esModule",{value:!0});jt.Updater=void 0;var Li=Jp(),Goe=Hoe(Fs()),Qo=z0(require("fs")),tm=z0(require("path")),Woe=CU(),sn=Zp(),Joe=U0(),Koe=NU(),Tu=z0(PU()),q0=(0,Goe.default)("tuf:cache"),V0=class{static{o(this,"Updater")}dir;metadataBaseUrl;targetDir;targetBaseUrl;forceCache;trustedSet;config;fetcher;constructor(e){let{metadataDir:t,metadataBaseUrl:r,targetDir:s,targetBaseUrl:n,fetcher:a,config:c}=e;this.dir=t,this.metadataBaseUrl=r,this.targetDir=s,this.targetBaseUrl=n,this.forceCache=e.forceCache??!1;let u=this.loadLocalMetadata(Li.MetadataKind.Root);this.trustedSet=new Koe.TrustedMetadataStore(u),this.config={...Woe.defaultConfig,...c},this.fetcher=a||new Joe.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(Li.MetadataKind.Targets,Li.MetadataKind.Root)}async getTargetInfo(e){return this.trustedSet.targets||await this.refresh(),this.preorderDepthFirstWalk(e)}async downloadTarget(e,t,r){let s=t||this.generateTargetPath(e);if(!r){if(!this.targetBaseUrl)throw new sn.ValueError("Target base URL not set");r=this.targetBaseUrl}let n=e.path;if(this.trustedSet.root.signed.consistentSnapshot&&this.config.prefixTargetsWithHash){let u=Object.values(e.hashes),{dir:l,base:h}=tm.parse(n),f=`${u[0]}.${h}`;n=l?`${l}/${f}`:f}let c=Tu.join(r,n);return await this.fetcher.downloadFile(c,e.length,async u=>{await e.verify(Qo.createReadStream(u)),q0("WRITE %s",s),Qo.copyFileSync(u,s)}),s}async findCachedTarget(e,t){t||(t=this.generateTargetPath(e));try{if(Qo.existsSync(t))return await e.verify(Qo.createReadStream(t)),t}catch{return}}loadLocalMetadata(e){let t=tm.join(this.dir,`${e}.json`);return q0("READ %s",t),Qo.readFileSync(t)}async loadRoot(){let t=this.trustedSet.root.signed.version+1,r=t+this.config.maxRootRotations;for(let s=t;s<r;s++){let n=Tu.join(this.metadataBaseUrl,`${s}.root.json`);try{let a=await this.fetcher.downloadBytes(n,this.config.rootMaxLength);this.trustedSet.updateRoot(a),this.persistMetadata(Li.MetadataKind.Root,a)}catch(a){if(a instanceof sn.DownloadHTTPError&&[403,404].includes(a.statusCode))break;throw a}}}async loadTimestamp({checkRemote:e}={checkRemote:!0}){try{let s=this.loadLocalMetadata(Li.MetadataKind.Timestamp);if(this.trustedSet.updateTimestamp(s),!e)return}catch{}let t=Tu.join(this.metadataBaseUrl,"timestamp.json"),r=await this.fetcher.downloadBytes(t,this.config.timestampMaxLength);try{this.trustedSet.updateTimestamp(r)}catch(s){if(s instanceof sn.EqualVersionError)return;throw s}this.persistMetadata(Li.MetadataKind.Timestamp,r)}async loadSnapshot(){try{let e=this.loadLocalMetadata(Li.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,r=t.length||this.config.snapshotMaxLength,s=this.trustedSet.root.signed.consistentSnapshot?t.version:void 0,n=Tu.join(this.metadataBaseUrl,s?`${s}.snapshot.json`:"snapshot.json");try{let a=await this.fetcher.downloadBytes(n,r);this.trustedSet.updateSnapshot(a),this.persistMetadata(Li.MetadataKind.Snapshot,a)}catch(a){throw new sn.RuntimeError(`Unable to load snapshot metadata error ${a}`)}}}async loadTargets(e,t){if(this.trustedSet.getRole(e))return this.trustedSet.getRole(e);try{let r=this.loadLocalMetadata(e);this.trustedSet.updateDelegatedTargets(r,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),u=Tu.join(this.metadataBaseUrl,a?`${a}.${c}.json`:`${c}.json`);try{let l=await this.fetcher.downloadBytes(u,n);this.trustedSet.updateDelegatedTargets(l,e,t),this.persistMetadata(e,l)}catch(l){throw new sn.RuntimeError(`Unable to load targets error ${l}`)}}return this.trustedSet.getRole(e)}async preorderDepthFirstWalk(e){let t=[{roleName:Li.MetadataKind.Targets,parentRoleName:Li.MetadataKind.Root}],r=new Set;for(;r.size<=this.config.maxDelegations&&t.length>0;){let{roleName:s,parentRoleName:n}=t.pop();if(r.has(s))continue;let a=(await this.loadTargets(s,n))?.signed;if(!a)continue;let c=a.targets?.[e];if(c)return c;if(r.add(s),a.delegations){let u=[],l=a.delegations.rolesForTarget(e);for(let{role:h,terminating:f}of l)if(u.push({roleName:h,parentRoleName:s}),f){t.splice(0);break}u.reverse(),t.push(...u)}}}generateTargetPath(e){if(!this.targetDir)throw new sn.ValueError("Target directory not set");let t=encodeURIComponent(e.path);return tm.join(this.targetDir,t)}persistMetadata(e,t){let r=encodeURIComponent(e);try{let s=tm.join(this.dir,`${r}.json`);q0("WRITE %s",s),Qo.writeFileSync(s,t.toString("utf8"))}catch(s){throw new sn.PersistError(`Failed to persist metadata ${r} error: ${s}`)}}};jt.Updater=V0});var xU=d(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.Updater=es.BaseFetcher=es.TargetFile=void 0;var Zoe=Jp();Object.defineProperty(es,"TargetFile",{enumerable:!0,get:o(function(){return Zoe.TargetFile},"get")});var Yoe=U0();Object.defineProperty(es,"BaseFetcher",{enumerable:!0,get:o(function(){return Yoe.BaseFetcher},"get")});var Xoe=DU();Object.defineProperty(es,"Updater",{enumerable:!0,get:o(function(){return Xoe.Updater},"get")})});var G0=d(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});im.TUFError=void 0;var H0=class extends Error{static{o(this,"TUFError")}constructor({code:e,message:t,cause:r}){super(t),this.code=e,this.cause=r,this.name=this.constructor.name}};im.TUFError=H0});var LU=d(Cu=>{"use strict";var Qoe=Cu&&Cu.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Cu,"__esModule",{value:!0});Cu.readTarget=tae;var eae=Qoe(require("fs")),rm=G0();async function tae(i,e){let t=await iae(i,e);return new Promise((r,s)=>{eae.default.readFile(t,"utf-8",(n,a)=>{n?s(new rm.TUFError({code:"TUF_READ_TARGET_ERROR",message:`error reading target ${t}`,cause:n})):r(a)})})}o(tae,"readTarget");async function iae(i,e){let t;try{t=await i.getTargetInfo(e)}catch(s){throw new rm.TUFError({code:"TUF_REFRESH_METADATA_ERROR",message:"error refreshing TUF metadata",cause:s})}if(!t)throw new rm.TUFError({code:"TUF_FIND_TARGET_ERROR",message:`target ${e} not found`});let r=await i.findCachedTarget(t);if(!r)try{r=await i.downloadTarget(t)}catch(s){throw new rm.TUFError({code:"TUF_DOWNLOAD_TARGET_ERROR",message:`error downloading target ${r}`,cause:s})}return r}o(iae,"getTargetPath")});var MU=d((T0e,rae)=>{rae.exports={"https://tuf-repo-cdn.sigstore.dev":{"root.json":"ewogInNpZ25hdHVyZXMiOiBbCiAgewogICAia2V5aWQiOiAiNmYyNjAwODlkNTkyM2RhZjIwMTY2Y2E2NTdjNTQzYWY2MTgzNDZhYjk3MTg4NGE5OTk2MmIwMTk4OGJiZTBjMyIsCiAgICJzaWciOiAiIgogIH0sCiAgewogICAia2V5aWQiOiAiZTcxYTU0ZDU0MzgzNWJhODZhZGFkOTQ2MDM3OWM3NjQxZmI4NzI2ZDE2NGVhNzY2ODAxYTFjNTIyYWJhN2VhMiIsCiAgICJzaWciOiAiMzA0NTAyMjEwMGJiZGRkNDY0ZjgwNjZjZWI4OGJhNzg3Mzc1YzEyY2Q2MzMwNjgwZTA4YzI5MTA3MDNlNjUzOGM3MWNjNzlhZDIwMjIwNTE5MGIwNmU0NTM3ZmU5NjFiM2VmODFmZTY4ZWRjZDAwODljMTlmOTE5YWZlZDQyM2I5YWFmZDcwMDY0MTE1MyIKICB9LAogIHsKICAgImtleWlkIjogIjIyZjRjYWVjNmQ4ZTZmOTU1NWFmNjZiM2Q0YzNjYjA2YTNiYjIzZmRjN2UzOWM5MTZjNjFmNDYyZTZmNTJiMDYiLAogICAic2lnIjogIjMwNDQwMjIwNjkzMDZjZDUyNTdmNzMyYTc0MGMxYWZlNjBhOGU0MzNjNWRlNThlYWZlYWRiZTk5YzMzNmM5YzcxZDE5OGNmODAyMjAwZDc3Mzk1M2FlN2RiYzQ4ZDNlNWJhZDlhNmY2NGJhZmZmMTk2YjdlMmFkNGE1MmExOTUxOTM2N2Q0N2RjMDQyIgogIH0sCiAgewogICAia2V5aWQiOiAiNjE2NDM4MzgxMjViNDQwYjQwZGI2OTQyZjVjYjVhMzFjMGRjMDQzNjgzMTZlYjJhYWE1OGI5NTkwNGE1ODIyMiIsCiAgICJzaWciOiAiMzA0NDAyMjA0ZDIxYTJlYzgwZGY2NmU2MWY2ZmUyOTEyOTUxZGM0N2RmODM2MDM2ZjhjMGFiMTA4MTZkMzc1ZTcxZGJmNzllMDIyMDU0N2FkY2UxYWZkZjA0ZTY3OTRlZmEyMDNkZDUyNjRjNmY3ZTBlZjc4ZTU3ZmU5MzRiMGQyNmNiOTk0ZWVjNzYiCiAgfSwKICB7CiAgICJrZXlpZCI6ICJhNjg3ZTViZjRmYWI4MmIwZWU1OGQ0NmUwNWM5NTM1MTQ1YTJjOWFmYjQ1OGY0M2Q0MmI0NWNhMGZkY2UyYTcwIiwKICAgInNpZyI6ICIzMDQ1MDIyMDYwODI2NDk2NTU3MTQ0ZWIxNjQ5ODkzZWQ1ZjZmNGVhNTQ1MzZmZWIwY2E4MmY4Yjg5YWU2NDFiZTM5NzQzZTUwMjIxMDBhZDcxMThiNWU5ZDQ4MzczMjYyMDZlNDEyZmM2ZGEyOTk5OTI1ZDExMDMyOGE3YzE2NmIwNmM2MjQzMzZjOTNmIgogIH0sCiAgewogICAia2V5aWQiOiAiMTgzZTY0ZjM3NjcwZGMxM2NhMGQyODk5NWEzMDUzZjM3NDA5NTRkZGNlNDQzMjFhNDFlNDY1MzRjZjQ0ZTYzMiIsCiAgICJzaWciOiAiMzA0NjAyMjEwMGQ4MTc5NDM5YzJlNzNlYjBjMTczM2FiZWU3ZmFmODMyZGNhZWE3MjYzZWRjYjQ5MTk4OTFjM2EyNDdmMDU5MjMwMjIxMDBlMWE0MzdlMDc5N2U4MDNmOWI3MmRjOWQyZDkyMTU1YjBhMjI3MGMyNGVmZGQ1ZjRiM2E1ZDhmMGIwZjQzMWE3IgogIH0KIF0sCiAic2lnbmVkIjogewogICJfdHlwZSI6ICJyb290IiwKICAiY29uc2lzdGVudF9zbmFwc2hvdCI6IHRydWUsCiAgImV4cGlyZXMiOiAiMjAyNi0wMS0yMlQxMzowNTo1OVoiLAogICJrZXlzIjogewogICAiMGM4NzQzMmMzYmYwOWZkOTkxODlmZGMzMmZhNWVhZWRmNGU0YTVmYWM3YmFiNzNmYTA0YTJlMGZjNjRhZjZmNSI6IHsKICAgICJrZXlpZF9oYXNoX2FsZ29yaXRobXMiOiBbCiAgICAgInNoYTI1NiIsCiAgICAgInNoYTUxMiIKICAgIF0sCiAgICAia2V5dHlwZSI6ICJlY2RzYSIsCiAgICAia2V5dmFsIjogewogICAgICJwdWJsaWMiOiAiLS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS1cbk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRVdSaUdyNStqKzNKNVNzSCtadHI1bkUySDJ3TzdcbkJWK25PM3M5M2dMY2ExOHFUT3pIWTFvV3lBR0R5a01Tc0dUVUJTdDlEK0FuMEtmS3NEMm1mU000MlE9PVxuLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tXG4iCiAgICB9LAogICAgInNjaGVtZSI6ICJlY2RzYS1zaGEyLW5pc3RwMjU2IiwKICAgICJ4LXR1Zi1vbi1jaS1vbmxpbmUtdXJpIjogImdjcGttczpwcm9qZWN0cy9zaWdzdG9yZS1yb290LXNpZ25pbmcvbG9jYXRpb25zL2dsb2JhbC9rZXlSaW5ncy9yb290L2NyeXB0b0tleXMvdGltZXN0YW1wL2NyeXB0b0tleVZlcnNpb25zLzEiCiAgIH0sCiAgICIxODNlNjRmMzc2NzBkYzEzY2EwZDI4OTk1YTMwNTNmMzc0MDk1NGRkY2U0NDMyMWE0MWU0NjUzNGNmNDRlNjMyIjogewogICAgImtleXR5cGUiOiAiZWNkc2EiLAogICAgImtleXZhbCI6IHsKICAgICAicHVibGljIjogIi0tLS0tQkVHSU4gUFVCTElDIEtFWS0tLS0tXG5NRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUVNeHBQT0pDSVo1b3RHNDEwNmZHSnNlRVFpM1Y5XG5wa01ZUTR1eVY5VGoxTTdXSFhJeUxHK2prZnZ1RzBnbFExSlpiUlpaQlYzZ0FSNHNvamRHSElTZW93PT1cbi0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLVxuIgogICAgfSwKICAgICJzY2hlbWUiOiAiZWNkc2Etc2hhMi1uaXN0cDI1NiIsCiAgICAieC10dWYtb24tY2kta2V5b3duZXIiOiAiQGxhbmNlIgogICB9LAogICAiMjJmNGNhZWM2ZDhlNmY5NTU1YWY2NmIzZDRjM2NiMDZhM2JiMjNmZGM3ZTM5YzkxNmM2MWY0NjJlNmY1MmIwNiI6IHsKICAgICJrZXlpZF9oYXNoX2FsZ29yaXRobXMiOiBbCiAgICAgInNoYTI1NiIsCiAgICAgInNoYTUxMiIKICAgIF0sCiAgICAia2V5dHlwZSI6ICJlY2RzYSIsCiAgICAia2V5dmFsIjogewogICAgICJwdWJsaWMiOiAiLS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS1cbk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRXpCelZPbUhDUG9qTVZMU0kzNjRXaWlWOE5QckRcbjZJZ1J4Vmxpc2t6L3YreTNKRVI1bWNWR2NPTmxpRGNXTUM1SjJsZkhtalBOUGhiNEg3eG04THpmU0E9PVxuLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tXG4iCiAgICB9LAogICAgInNjaGVtZSI6ICJlY2RzYS1zaGEyLW5pc3RwMjU2IiwKICAgICJ4LXR1Zi1vbi1jaS1rZXlvd25lciI6ICJAc2FudGlhZ290b3JyZXMiCiAgIH0sCiAgICI2MTY0MzgzODEyNWI0NDBiNDBkYjY5NDJmNWNiNWEzMWMwZGMwNDM2ODMxNmViMmFhYTU4Yjk1OTA0YTU4MjIyIjogewogICAgImtleWlkX2hhc2hfYWxnb3JpdGhtcyI6IFsKICAgICAic2hhMjU2IiwKICAgICAic2hhNTEyIgogICAgXSwKICAgICJrZXl0eXBlIjogImVjZHNhIiwKICAgICJrZXl2YWwiOiB7CiAgICAgInB1YmxpYyI6ICItLS0tLUJFR0lOIFBVQkxJQyBLRVktLS0tLVxuTUZrd0V3WUhLb1pJemowQ0FRWUlLb1pJemowREFRY0RRZ0FFaW5pa1NzQVFtWWtOZUg1ZVlxL0NuSXpMYWFjT1xueGxTYWF3UURPd3FLeS90Q3F4cTV4eFBTSmMyMUs0V0loczlHeU9rS2Z6dWVZM0dJTHpjTUpaNGNXdz09XG4tLS0tLUVORCBQVUJMSUMgS0VZLS0tLS1cbiIKICAgIH0sCiAgICAic2NoZW1lIjogImVjZHNhLXNoYTItbmlzdHAyNTYiLAogICAgIngtdHVmLW9uLWNpLWtleW93bmVyIjogIkBib2JjYWxsYXdheSIKICAgfSwKICAgImE2ODdlNWJmNGZhYjgyYjBlZTU4ZDQ2ZTA1Yzk1MzUxNDVhMmM5YWZiNDU4ZjQzZDQyYjQ1Y2EwZmRjZTJhNzAiOiB7CiAgICAia2V5aWRfaGFzaF9hbGdvcml0aG1zIjogWwogICAgICJzaGEyNTYiLAogICAgICJzaGE1MTIiCiAgICBdLAogICAgImtleXR5cGUiOiAiZWNkc2EiLAogICAgImtleXZhbCI6IHsKICAgICAicHVibGljIjogIi0tLS0tQkVHSU4gUFVCTElDIEtFWS0tLS0tXG5NRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUUwZ2hyaDkyTHcxWXIzaWRHVjVXcUN0TURCOEN4XG4rRDhoZEM0dzJaTE5JcGxWUm9WR0xza1lhM2doZU15T2ppSjhrUGkxNWFRMi8vN1Arb2o3VXZKUEd3PT1cbi0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLVxuIgogICAgfSwKICAgICJzY2hlbWUiOiAiZWNkc2Etc2hhMi1uaXN0cDI1NiIsCiAgICAieC10dWYtb24tY2kta2V5b3duZXIiOiAiQGpvc2h1YWdsIgogICB9LAogICAiZTcxYTU0ZDU0MzgzNWJhODZhZGFkOTQ2MDM3OWM3NjQxZmI4NzI2ZDE2NGVhNzY2ODAxYTFjNTIyYWJhN2VhMiI6IHsKICAgICJrZXlpZF9oYXNoX2FsZ29yaXRobXMiOiBbCiAgICAgInNoYTI1NiIsCiAgICAgInNoYTUxMiIKICAgIF0sCiAgICAia2V5dHlwZSI6ICJlY2RzYSIsCiAgICAia2V5dmFsIjogewogICAgICJwdWJsaWMiOiAiLS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS1cbk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRUVYc3ozU1pYRmI4ak1WNDJqNnBKbHlqYmpSOEtcbk4zQndvY2V4cTZMTUliNXFzV0tPUXZMTjE2TlVlZkxjNEhzd09vdW1Sc1ZWYWFqU3BRUzZmb2JrUnc9PVxuLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tXG4iCiAgICB9LAogICAgInNjaGVtZSI6ICJlY2RzYS1zaGEyLW5pc3RwMjU2IiwKICAgICJ4LXR1Zi1vbi1jaS1rZXlvd25lciI6ICJAbW5tNjc4IgogICB9CiAgfSwKICAicm9sZXMiOiB7CiAgICJyb290IjogewogICAgImtleWlkcyI6IFsKICAgICAiZTcxYTU0ZDU0MzgzNWJhODZhZGFkOTQ2MDM3OWM3NjQxZmI4NzI2ZDE2NGVhNzY2ODAxYTFjNTIyYWJhN2VhMiIsCiAgICAgIjIyZjRjYWVjNmQ4ZTZmOTU1NWFmNjZiM2Q0YzNjYjA2YTNiYjIzZmRjN2UzOWM5MTZjNjFmNDYyZTZmNTJiMDYiLAogICAgICI2MTY0MzgzODEyNWI0NDBiNDBkYjY5NDJmNWNiNWEzMWMwZGMwNDM2ODMxNmViMmFhYTU4Yjk1OTA0YTU4MjIyIiwKICAgICAiYTY4N2U1YmY0ZmFiODJiMGVlNThkNDZlMDVjOTUzNTE0NWEyYzlhZmI0NThmNDNkNDJiNDVjYTBmZGNlMmE3MCIsCiAgICAgIjE4M2U2NGYzNzY3MGRjMTNjYTBkMjg5OTVhMzA1M2YzNzQwOTU0ZGRjZTQ0MzIxYTQxZTQ2NTM0Y2Y0NGU2MzIiCiAgICBdLAogICAgInRocmVzaG9sZCI6IDMKICAgfSwKICAgInNuYXBzaG90IjogewogICAgImtleWlkcyI6IFsKICAgICAiMGM4NzQzMmMzYmYwOWZkOTkxODlmZGMzMmZhNWVhZWRmNGU0YTVmYWM3YmFiNzNmYTA0YTJlMGZjNjRhZjZmNSIKICAgIF0sCiAgICAidGhyZXNob2xkIjogMSwKICAgICJ4LXR1Zi1vbi1jaS1leHBpcnktcGVyaW9kIjogMzY1MCwKICAgICJ4LXR1Zi1vbi1jaS1zaWduaW5nLXBlcmlvZCI6IDM2NQogICB9LAogICAidGFyZ2V0cyI6IHsKICAgICJrZXlpZHMiOiBbCiAgICAgImU3MWE1NGQ1NDM4MzViYTg2YWRhZDk0NjAzNzljNzY0MWZiODcyNmQxNjRlYTc2NjgwMWExYzUyMmFiYTdlYTIiLAogICAgICIyMmY0Y2FlYzZkOGU2Zjk1NTVhZjY2YjNkNGMzY2IwNmEzYmIyM2ZkYzdlMzljOTE2YzYxZjQ2MmU2ZjUyYjA2IiwKICAgICAiNjE2NDM4MzgxMjViNDQwYjQwZGI2OTQyZjVjYjVhMzFjMGRjMDQzNjgzMTZlYjJhYWE1OGI5NTkwNGE1ODIyMiIsCiAgICAgImE2ODdlNWJmNGZhYjgyYjBlZTU4ZDQ2ZTA1Yzk1MzUxNDVhMmM5YWZiNDU4ZjQzZDQyYjQ1Y2EwZmRjZTJhNzAiLAogICAgICIxODNlNjRmMzc2NzBkYzEzY2EwZDI4OTk1YTMwNTNmMzc0MDk1NGRkY2U0NDMyMWE0MWU0NjUzNGNmNDRlNjMyIgogICAgXSwKICAgICJ0aHJlc2hvbGQiOiAzCiAgIH0sCiAgICJ0aW1lc3RhbXAiOiB7CiAgICAia2V5aWRzIjogWwogICAgICIwYzg3NDMyYzNiZjA5ZmQ5OTE4OWZkYzMyZmE1ZWFlZGY0ZTRhNWZhYzdiYWI3M2ZhMDRhMmUwZmM2NGFmNmY1IgogICAgXSwKICAgICJ0aHJlc2hvbGQiOiAxLAogICAgIngtdHVmLW9uLWNpLWV4cGlyeS1wZXJpb2QiOiA3LAogICAgIngtdHVmLW9uLWNpLXNpZ25pbmctcGVyaW9kIjogNgogICB9CiAgfSwKICAic3BlY192ZXJzaW9uIjogIjEuMCIsCiAgInZlcnNpb24iOiAxMywKICAieC10dWYtb24tY2ktZXhwaXJ5LXBlcmlvZCI6IDE5NywKICAieC10dWYtb24tY2ktc2lnbmluZy1wZXJpb2QiOiA0NgogfQp9",targets:{"trusted_root.json":"ewogICJtZWRpYVR5cGUiOiAiYXBwbGljYXRpb24vdm5kLmRldi5zaWdzdG9yZS50cnVzdGVkcm9vdCtqc29uO3ZlcnNpb249MC4xIiwKICAidGxvZ3MiOiBbCiAgICB7CiAgICAgICJiYXNlVXJsIjogImh0dHBzOi8vcmVrb3Iuc2lnc3RvcmUuZGV2IiwKICAgICAgImhhc2hBbGdvcml0aG0iOiAiU0hBMl8yNTYiLAogICAgICAicHVibGljS2V5IjogewogICAgICAgICJyYXdCeXRlcyI6ICJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUUyRzJZKzJ0YWJkVFY1QmNHaUJJeDBhOWZBRndya0JibUxTR3RrczRMM3FYNnlZWTB6dWZCbmhDOFVyL2l5NTVHaFdQLzlBL2JZMkxoQzMwTTkrUll0dz09IiwKICAgICAgICAia2V5RGV0YWlscyI6ICJQS0lYX0VDRFNBX1AyNTZfU0hBXzI1NiIsCiAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgInN0YXJ0IjogIjIwMjEtMDEtMTJUMTE6NTM6MjdaIgogICAgICAgIH0KICAgICAgfSwKICAgICAgImxvZ0lkIjogewogICAgICAgICJrZXlJZCI6ICJ3Tkk5YXRRR2x6K1ZXZk82TFJ5Z0g0UVVmWS84VzRSRndpVDVpNVdSZ0IwPSIKICAgICAgfQogICAgfQogIF0sCiAgImNlcnRpZmljYXRlQXV0aG9yaXRpZXMiOiBbCiAgICB7CiAgICAgICJzdWJqZWN0IjogewogICAgICAgICJvcmdhbml6YXRpb24iOiAic2lnc3RvcmUuZGV2IiwKICAgICAgICAiY29tbW9uTmFtZSI6ICJzaWdzdG9yZSIKICAgICAgfSwKICAgICAgInVyaSI6ICJodHRwczovL2Z1bGNpby5zaWdzdG9yZS5kZXYiLAogICAgICAiY2VydENoYWluIjogewogICAgICAgICJjZXJ0aWZpY2F0ZXMiOiBbCiAgICAgICAgICB7CiAgICAgICAgICAgICJyYXdCeXRlcyI6ICJNSUlCK0RDQ0FYNmdBd0lCQWdJVE5Wa0Rab0Npb2ZQRHN5N2RmbTZnZUxidWh6QUtCZ2dxaGtqT1BRUURBekFxTVJVd0V3WURWUVFLRXd4emFXZHpkRzl5WlM1a1pYWXhFVEFQQmdOVkJBTVRDSE5wWjNOMGIzSmxNQjRYRFRJeE1ETXdOekF6TWpBeU9Wb1hEVE14TURJeU16QXpNakF5T1Zvd0tqRVZNQk1HQTFVRUNoTU1jMmxuYzNSdmNtVXVaR1YyTVJFd0R3WURWUVFERXdoemFXZHpkRzl5WlRCMk1CQUdCeXFHU000OUFnRUdCU3VCQkFBaUEySUFCTFN5QTdJaTVrK3BOTzhaRVdZMHlsZW1XRG93T2tOYTNrTCtHWkU1WjVHV2VoTDkvQTliUk5BM1JicnNaNWkwSmNhc3RhUkw3U3A1ZnAvakQ1ZHhxYy9VZFRWbmx2UzE2YW4rMllmc3dlL1F1TG9sUlVDcmNPRTIrMmlBNSt0emQ2Tm1NR1F3RGdZRFZSMFBBUUgvQkFRREFnRUdNQklHQTFVZEV3RUIvd1FJTUFZQkFmOENBUUV3SFFZRFZSME9CQllFRk1qRkhRQkJtaVFwTWxFazZ3MnVTdTFLQnRQc01COEdBMVVkSXdRWU1CYUFGTWpGSFFCQm1pUXBNbEVrNncydVN1MUtCdFBzTUFvR0NDcUdTTTQ5QkFNREEyZ0FNR1VDTUg4bGlXSmZNdWk2dlhYQmhqRGdZNE13c2xtTi9USnhWZS84M1dyRm9td21OZjA1NnkxWDQ4RjljNG0zYTNvelhBSXhBS2pSYXk1L2FqL2pzS0tHSWttUWF0akk4dXVwSHIvK0N4RnZhSldtcFlxTmtMREdSVSs5b3J6aDVoSTJScmN1YVE9PSIKICAgICAgICAgIH0KICAgICAgICBdCiAgICAgIH0sCiAgICAgICJ2YWxpZEZvciI6IHsKICAgICAgICAic3RhcnQiOiAiMjAyMS0wMy0wN1QwMzoyMDoyOVoiLAogICAgICAgICJlbmQiOiAiMjAyMi0xMi0zMVQyMzo1OTo1OS45OTlaIgogICAgICB9CiAgICB9LAogICAgewogICAgICAic3ViamVjdCI6IHsKICAgICAgICAib3JnYW5pemF0aW9uIjogInNpZ3N0b3JlLmRldiIsCiAgICAgICAgImNvbW1vbk5hbWUiOiAic2lnc3RvcmUiCiAgICAgIH0sCiAgICAgICJ1cmkiOiAiaHR0cHM6Ly9mdWxjaW8uc2lnc3RvcmUuZGV2IiwKICAgICAgImNlcnRDaGFpbiI6IHsKICAgICAgICAiY2VydGlmaWNhdGVzIjogWwogICAgICAgICAgewogICAgICAgICAgICAicmF3Qnl0ZXMiOiAiTUlJQ0dqQ0NBYUdnQXdJQkFnSVVBTG5WaVZmblUwYnJKYXNtUmtIcm4vVW5mYVF3Q2dZSUtvWkl6ajBFQXdNd0tqRVZNQk1HQTFVRUNoTU1jMmxuYzNSdmNtVXVaR1YyTVJFd0R3WURWUVFERXdoemFXZHpkRzl5WlRBZUZ3MHlNakEwTVRNeU1EQTJNVFZhRncwek1URXdNRFV4TXpVMk5UaGFNRGN4RlRBVEJnTlZCQW9UREhOcFozTjBiM0psTG1SbGRqRWVNQndHQTFVRUF4TVZjMmxuYzNSdmNtVXRhVzUwWlhKdFpXUnBZWFJsTUhZd0VBWUhLb1pJemowQ0FRWUZLNEVFQUNJRFlnQUU4UlZTL3lzSCtOT3Z1RFp5UEladGlsZ1VGOU5sYXJZcEFkOUhQMXZCQkgxVTVDVjc3TFNTN3MwWmlING5FN0h2N3B0UzZMdnZSL1NUazc5OExWZ016TGxKNEhlSWZGM3RIU2FleExjWXBTQVNyMWtTME4vUmdCSnovOWpXQ2lYbm8zc3dlVEFPQmdOVkhROEJBZjhFQkFNQ0FRWXdFd1lEVlIwbEJBd3dDZ1lJS3dZQkJRVUhBd013RWdZRFZSMFRBUUgvQkFnd0JnRUIvd0lCQURBZEJnTlZIUTRFRmdRVTM5UHB6MVlrRVpiNXFOanBLRldpeGk0WVpEOHdId1lEVlIwakJCZ3dGb0FVV01BZVg1RkZwV2FwZXN5UW9aTWkwQ3JGeGZvd0NnWUlLb1pJemowRUF3TURad0F3WkFJd1BDc1FLNERZaVpZRFBJYURpNUhGS25meFh4NkFTU1ZtRVJmc3luWUJpWDJYNlNKUm5aVTg0LzlEWmRuRnZ2eG1BakJPdDZRcEJsYzRKLzBEeHZrVENxcGNsdnppTDZCQ0NQbmpkbElCM1B1M0J4c1BteWdVWTdJaTJ6YmRDZGxpaW93PSIKICAgICAgICAgIH0sCiAgICAgICAgICB7CiAgICAgICAgICAgICJyYXdCeXRlcyI6ICJNSUlCOXpDQ0FYeWdBd0lCQWdJVUFMWk5BUEZkeEhQd2plRGxvRHd5WUNoQU8vNHdDZ1lJS29aSXpqMEVBd013S2pFVk1CTUdBMVVFQ2hNTWMybG5jM1J2Y21VdVpHVjJNUkV3RHdZRFZRUURFd2h6YVdkemRHOXlaVEFlRncweU1URXdNRGN4TXpVMk5UbGFGdzB6TVRFd01EVXhNelUyTlRoYU1Db3hGVEFUQmdOVkJBb1RESE5wWjNOMGIzSmxMbVJsZGpFUk1BOEdBMVVFQXhNSWMybG5jM1J2Y21Vd2RqQVFCZ2NxaGtqT1BRSUJCZ1VyZ1FRQUlnTmlBQVQ3WGVGVDRyYjNQUUd3UzRJYWp0TGszL09sbnBnYW5nYUJjbFlwc1lCcjVpKzR5bkIwN2NlYjNMUDBPSU9aZHhleFg2OWM1aVZ1eUpSUStIejA1eWkrVUYzdUJXQWxIcGlTNXNoMCtIMkdIRTdTWHJrMUVDNW0xVHIxOUw5Z2c5MmpZekJoTUE0R0ExVWREd0VCL3dRRUF3SUJCakFQQmdOVkhSTUJBZjhFQlRBREFRSC9NQjBHQTFVZERnUVdCQlJZd0I1ZmtVV2xacWw2ekpDaGt5TFFLc1hGK2pBZkJnTlZIU01FR0RBV2dCUll3QjVma1VXbFpxbDZ6SkNoa3lMUUtzWEYrakFLQmdncWhrak9QUVFEQXdOcEFEQm1BakVBajFuSGVYWnArMTNOV0JOYStFRHNEUDhHMVdXZzF0Q01XUC9XSFBxcGFWbzBqaHN3ZU5GWmdTczBlRTd3WUk0cUFqRUEyV0I5b3Q5OHNJa29GM3ZaWWRkMy9WdFdCNWI5VE5NZWE3SXgvc3RKNVRmY0xMZUFCTEU0Qk5KT3NRNHZuQkhKIgogICAgICAgICAgfQogICAgICAgIF0KICAgICAgfSwKICAgICAgInZhbGlkRm9yIjogewogICAgICAgICJzdGFydCI6ICIyMDIyLTA0LTEzVDIwOjA2OjE1WiIKICAgICAgfQogICAgfQogIF0sCiAgImN0bG9ncyI6IFsKICAgIHsKICAgICAgImJhc2VVcmwiOiAiaHR0cHM6Ly9jdGZlLnNpZ3N0b3JlLmRldi90ZXN0IiwKICAgICAgImhhc2hBbGdvcml0aG0iOiAiU0hBMl8yNTYiLAogICAgICAicHVibGljS2V5IjogewogICAgICAgICJyYXdCeXRlcyI6ICJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUViZndSK1JKdWRYc2NnUkJScEtYMVhGRHkzUHl1ZER4ei9TZm5SaTFmVDhla3BmQmQyTzF1b3o3anIzWjhuS3p4QTY5RVVRK2VGQ0ZJM3pldWJQV1U3dz09IiwKICAgICAgICAia2V5RGV0YWlscyI6ICJQS0lYX0VDRFNBX1AyNTZfU0hBXzI1NiIsCiAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgInN0YXJ0IjogIjIwMjEtMDMtMTRUMDA6MDA6MDBaIiwKICAgICAgICAgICJlbmQiOiAiMjAyMi0xMC0zMVQyMzo1OTo1OS45OTlaIgogICAgICAgIH0KICAgICAgfSwKICAgICAgImxvZ0lkIjogewogICAgICAgICJrZXlJZCI6ICJDR0NTOENoUy8yaEYwZEZySjRTY1JXY1lyQlk5d3pqU2JlYThJZ1kyYjNJPSIKICAgICAgfQogICAgfSwKICAgIHsKICAgICAgImJhc2VVcmwiOiAiaHR0cHM6Ly9jdGZlLnNpZ3N0b3JlLmRldi8yMDIyIiwKICAgICAgImhhc2hBbGdvcml0aG0iOiAiU0hBMl8yNTYiLAogICAgICAicHVibGljS2V5IjogewogICAgICAgICJyYXdCeXRlcyI6ICJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUVpUFNsRmkwQ21GVGZFakNVcUY5SHVDRWNZWE5LQWFZYWxJSm1CWjh5eWV6UGpUcWh4cktCcE1uYW9jVnRMSkJJMWVNM3VYblF6UUdBSmRKNGdzOUZ5dz09IiwKICAgICAgICAia2V5RGV0YWlscyI6ICJQS0lYX0VDRFNBX1AyNTZfU0hBXzI1NiIsCiAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgInN0YXJ0IjogIjIwMjItMTAtMjBUMDA6MDA6MDBaIgogICAgICAgIH0KICAgICAgfSwKICAgICAgImxvZ0lkIjogewogICAgICAgICJrZXlJZCI6ICIzVDB3YXNiSEVUSmpHUjRjbVdjM0FxSktYcmplUEszL2g0cHlnQzhwN280PSIKICAgICAgfQogICAgfQogIF0sCiAgInRpbWVzdGFtcEF1dGhvcml0aWVzIjogWwogICAgewogICAgICAic3ViamVjdCI6IHsKICAgICAgICAib3JnYW5pemF0aW9uIjogInNpZ3N0b3JlLmRldiIsCiAgICAgICAgImNvbW1vbk5hbWUiOiAic2lnc3RvcmUtdHNhLXNlbGZzaWduZWQiCiAgICAgIH0sCiAgICAgICJ1cmkiOiAiaHR0cHM6Ly90aW1lc3RhbXAuc2lnc3RvcmUuZGV2L2FwaS92MS90aW1lc3RhbXAiLAogICAgICAiY2VydENoYWluIjogewogICAgICAgICJjZXJ0aWZpY2F0ZXMiOiBbCiAgICAgICAgICB7CiAgICAgICAgICAgICJyYXdCeXRlcyI6ICJNSUlDRURDQ0FaYWdBd0lCQWdJVU9oTlVMd3lRWWU2OHdVTXZ5NHFPaXlvaml3d3dDZ1lJS29aSXpqMEVBd013T1RFVk1CTUdBMVVFQ2hNTWMybG5jM1J2Y21VdVpHVjJNU0F3SGdZRFZRUURFeGR6YVdkemRHOXlaUzEwYzJFdGMyVnNabk5wWjI1bFpEQWVGdzB5TlRBME1EZ3dOalU1TkROYUZ3MHpOVEEwTURZd05qVTVORE5hTUM0eEZUQVRCZ05WQkFvVERITnBaM04wYjNKbExtUmxkakVWTUJNR0ExVUVBeE1NYzJsbmMzUnZjbVV0ZEhOaE1IWXdFQVlIS29aSXpqMENBUVlGSzRFRUFDSURZZ0FFNHJhMlo4aEtOaWcyVDlrRmpDQVRvR0czMGpreStXUXYzQnpMK21LdmgxU0tOUi9Vd3V3c2ZOQ2c0c3J5b1lBZDhFNmlzb3ZWQTNNNGFvTmRtOVFEaTUwWjhuVEV5dnFnZkRQdFRJd1hJdGZpVy9BRmYxVjd1d2tia0FvajB4eGNvMm93YURBT0JnTlZIUThCQWY4RUJBTUNCNEF3SFFZRFZSME9CQllFRkluOWVVT0h6OUJsUnNNQ1JzY3NjMXQ5dE9zRE1COEdBMVVkSXdRWU1CYUFGSmpzQWU5L3UxSC8xSlVlYjRxSW1GTUhpYzYvTUJZR0ExVWRKUUVCL3dRTU1Bb0dDQ3NHQVFVRkJ3TUlNQW9HQ0NxR1NNNDlCQU1EQTJnQU1HVUNNRHRwc1YvNkthTzBxeUYvVU1zWDJhU1VYS1FGZG9HVHB0UUdjMGZ0cTFjc3VsSFBHRzZkc215TU5kM0pCK0czRVFJeEFPYWp2QmNqcEptS2I0TnYrMlRhb2o4VWM1K2I2aWg2RlhDQ0tyYVNxdXBlMDd6cXN3TWNYSlRlMWNFeHZIdnZsdz09IgogICAgICAgICAgfSwKICAgICAgICAgIHsKICAgICAgICAgICAgInJhd0J5dGVzIjogIk1JSUI5ekNDQVh5Z0F3SUJBZ0lVVjdmMEdMRE9vRXpJaDhMWFNXODBPSmlVcDE0d0NnWUlLb1pJemowRUF3TXdPVEVWTUJNR0ExVUVDaE1NYzJsbmMzUnZjbVV1WkdWMk1TQXdIZ1lEVlFRREV4ZHphV2R6ZEc5eVpTMTBjMkV0YzJWc1puTnBaMjVsWkRBZUZ3MHlOVEEwTURnd05qVTVORE5hRncwek5UQTBNRFl3TmpVNU5ETmFNRGt4RlRBVEJnTlZCQW9UREhOcFozTjBiM0psTG1SbGRqRWdNQjRHQTFVRUF4TVhjMmxuYzNSdmNtVXRkSE5oTFhObGJHWnphV2R1WldRd2RqQVFCZ2NxaGtqT1BRSUJCZ1VyZ1FRQUlnTmlBQVFVUU50ZlJUL291M1lBVGE2d0Iva0tUZTcwY2ZKd3lSSUJvdk1udDhSY0pwaC9DT0U4MnV5UzZGbXBwTExMMVZCUEdjUGZwUVBZSk5Yeld3aThpY3doS1E2Vy9RZTJoM29lYkJiMkZIcHdOSkRxbytUTWFDL3RkZmt2L0VsSkI3MmpSVEJETUE0R0ExVWREd0VCL3dRRUF3SUJCakFTQmdOVkhSTUJBZjhFQ0RBR0FRSC9BZ0VBTUIwR0ExVWREZ1FXQkJTWTdBSHZmN3RSLzlTVkhtK0tpSmhUQjRuT3Z6QUtCZ2dxaGtqT1BRUURBd05wQURCbUFqRUF3R0VHcmZHWlIxY2VuMVI4L0RUVk1JOTQzTHNzWm1KUnREcC9pN1NmR0htR1JQNmdSYnVqOXZPSzNiNjdaMFFRQWpFQXVUMkg2NzNMUUVhSFRjeVFTWnJrcDRtWDdXd2ttRitzVmJrWVk1bVhOK1JNSDEzS1VFSEhPcUFTYWVtWVdLL0UiCiAgICAgICAgICB9CiAgICAgICAgXQogICAgICB9LAogICAgICAidmFsaWRGb3IiOiB7CiAgICAgICAgInN0YXJ0IjogIjIwMjUtMDctMDRUMDA6MDA6MDBaIgogICAgICB9CiAgICB9CiAgXQp9Cg==","registry.npmjs.org%2Fkeys.json":"ewogICAgImtleXMiOiBbCiAgICAgICAgewogICAgICAgICAgICAia2V5SWQiOiAiU0hBMjU2OmpsM2J3c3d1ODBQampva0NnaDBvMnc1YzJVNExoUUFFNTdnajljejFrekEiLAogICAgICAgICAgICAia2V5VXNhZ2UiOiAibnBtOnNpZ25hdHVyZXMiLAogICAgICAgICAgICAicHVibGljS2V5IjogewogICAgICAgICAgICAgICAgInJhd0J5dGVzIjogIk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRTFPbGIzek1BRkZ4WEtIaUlrUU81Y0ozWWhsNWk2VVBwK0lodXRlQkpidUhjQTVVb2dLbzBFV3RsV3dXNktTYUtvVE5FWUw3SmxDUWlWbmtoQmt0VWdnPT0iLAogICAgICAgICAgICAgICAgImtleURldGFpbHMiOiAiUEtJWF9FQ0RTQV9QMjU2X1NIQV8yNTYiLAogICAgICAgICAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgICAgICAgICAgICJzdGFydCI6ICIxOTk5LTAxLTAxVDAwOjAwOjAwLjAwMFoiLAogICAgICAgICAgICAgICAgICAgICJlbmQiOiAiMjAyNS0wMS0yOVQwMDowMDowMC4wMDBaIgogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgfSwKICAgICAgICB7CiAgICAgICAgICAgICJrZXlJZCI6ICJTSEEyNTY6amwzYndzd3U4MFBqam9rQ2doMG8ydzVjMlU0TGhRQUU1N2dqOWN6MWt6QSIsCiAgICAgICAgICAgICJrZXlVc2FnZSI6ICJucG06YXR0ZXN0YXRpb25zIiwKICAgICAgICAgICAgInB1YmxpY0tleSI6IHsKICAgICAgICAgICAgICAgICJyYXdCeXRlcyI6ICJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUUxT2xiM3pNQUZGeFhLSGlJa1FPNWNKM1lobDVpNlVQcCtJaHV0ZUJKYnVIY0E1VW9nS28wRVd0bFd3VzZLU2FLb1RORVlMN0psQ1FpVm5raEJrdFVnZz09IiwKICAgICAgICAgICAgICAgICJrZXlEZXRhaWxzIjogIlBLSVhfRUNEU0FfUDI1Nl9TSEFfMjU2IiwKICAgICAgICAgICAgICAgICJ2YWxpZEZvciI6IHsKICAgICAgICAgICAgICAgICAgICAic3RhcnQiOiAiMjAyMi0xMi0wMVQwMDowMDowMC4wMDBaIiwKICAgICAgICAgICAgICAgICAgICAiZW5kIjogIjIwMjUtMDEtMjlUMDA6MDA6MDAuMDAwWiIKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0sCiAgICAgICAgewogICAgICAgICAgICAia2V5SWQiOiAiU0hBMjU2OkRoUTh3UjVBUEJ2RkhMRi8rVGMrQVl2UE9kVHBjSURxT2h4c0JIUndDN1UiLAogICAgICAgICAgICAia2V5VXNhZ2UiOiAibnBtOnNpZ25hdHVyZXMiLAogICAgICAgICAgICAicHVibGljS2V5IjogewogICAgICAgICAgICAgICAgInJhd0J5dGVzIjogIk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRVk2WWE3VysrN2FVUHp2TVRyZXpINlljeDNjK0hPS1lDY05HeWJKWlNDSnEvZmQ3UWE4dXVBS3RkSWtVUXRRaUVLRVJoQW1FNWxNTUpoUDhPa0RPYTJnPT0iLAogICAgICAgICAgICAgICAgImtleURldGFpbHMiOiAiUEtJWF9FQ0RTQV9QMjU2X1NIQV8yNTYiLAogICAgICAgICAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgICAgICAgICAgICJzdGFydCI6ICIyMDI1LTAxLTEzVDAwOjAwOjAwLjAwMFoiCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9LAogICAgICAgIHsKICAgICAgICAgICAgImtleUlkIjogIlNIQTI1NjpEaFE4d1I1QVBCdkZITEYvK1RjK0FZdlBPZFRwY0lEcU9oeHNCSFJ3QzdVIiwKICAgICAgICAgICAgImtleVVzYWdlIjogIm5wbTphdHRlc3RhdGlvbnMiLAogICAgICAgICAgICAicHVibGljS2V5IjogewogICAgICAgICAgICAgICAgInJhd0J5dGVzIjogIk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRVk2WWE3VysrN2FVUHp2TVRyZXpINlljeDNjK0hPS1lDY05HeWJKWlNDSnEvZmQ3UWE4dXVBS3RkSWtVUXRRaUVLRVJoQW1FNWxNTUpoUDhPa0RPYTJnPT0iLAogICAgICAgICAgICAgICAgImtleURldGFpbHMiOiAiUEtJWF9FQ0RTQV9QMjU2X1NIQV8yNTYiLAogICAgICAgICAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgICAgICAgICAgICJzdGFydCI6ICIyMDI1LTAxLTEzVDAwOjAwOjAwLjAwMFoiCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICBdCn0K"}}}});var kU=d(ea=>{"use strict";var BU=ea&&ea.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ea,"__esModule",{value:!0});ea.TUFClient=void 0;var ts=BU(require("fs")),Nu=BU(require("path")),sae=xU(),nae=sm(),oae=LU(),J0="targets",W0=class{static{o(this,"TUFClient")}constructor(e){let t=new URL(e.mirrorURL),r=encodeURIComponent(t.host+t.pathname.replace(/\/$/,"")),s=Nu.default.join(e.cachePath,r);aae(s),cae({cachePath:s,mirrorURL:e.mirrorURL,tufRootPath:e.rootPath,forceInit:e.forceInit}),this.updater=uae({mirrorURL:e.mirrorURL,cachePath:s,forceCache:e.forceCache,retry:e.retry,timeout:e.timeout})}async refresh(){return this.updater.refresh()}getTarget(e){return(0,oae.readTarget)(this.updater,e)}};ea.TUFClient=W0;function aae(i){let e=Nu.default.join(i,J0);ts.default.existsSync(i)||ts.default.mkdirSync(i,{recursive:!0}),ts.default.existsSync(e)||ts.default.mkdirSync(e)}o(aae,"initTufCache");function cae({cachePath:i,mirrorURL:e,tufRootPath:t,forceInit:r}){let s=Nu.default.join(i,"root.json");if(!ts.default.existsSync(s)||r)if(t)ts.default.copyFileSync(t,s);else{let a=MU()[e];if(!a)throw new nae.TUFError({code:"TUF_INIT_CACHE_ERROR",message:`No root.json found for mirror: ${e}`});ts.default.writeFileSync(s,Buffer.from(a["root.json"],"base64")),Object.entries(a.targets).forEach(([c,u])=>{ts.default.writeFileSync(Nu.default.join(i,J0,c),Buffer.from(u,"base64"))})}}o(cae,"seedCache");function uae(i){let e={fetchTimeout:i.timeout,fetchRetry:i.retry};return new sae.Updater({metadataBaseUrl:i.mirrorURL,targetBaseUrl:`${i.mirrorURL}/targets`,metadataDir:i.cachePath,targetDir:Nu.default.join(i.cachePath,J0),forceCache:i.forceCache,config:e})}o(uae,"initClient")});var sm=d(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.TUFError=hr.DEFAULT_MIRROR_URL=void 0;hr.getTrustedRoot=yae;hr.initTUF=Sae;var lae=su(),hae=IF(),fae=kU();hr.DEFAULT_MIRROR_URL="https://tuf-repo-cdn.sigstore.dev";var dae="sigstore-js",pae={retries:2},mae=5e3,gae="trusted_root.json";async function yae(i={}){let t=await FU(i).getTarget(gae);return lae.TrustedRoot.fromJSON(JSON.parse(t))}o(yae,"getTrustedRoot");async function Sae(i={}){let e=FU(i);return e.refresh().then(()=>e)}o(Sae,"initTUF");function FU(i){return new fae.TUFClient({cachePath:i.cachePath||(0,hae.appDataPath)(dae),rootPath:i.rootPath,mirrorURL:i.mirrorURL||hr.DEFAULT_MIRROR_URL,retry:i.retry??pae,timeout:i.timeout??mae,forceCache:i.forceCache??!1,forceInit:i.forceInit??i.force??!1})}o(FU,"createClient");var Eae=G0();Object.defineProperty(hr,"TUFError",{enumerable:!0,get:o(function(){return Eae.TUFError},"get")})});var UU=d(nm=>{"use strict";Object.defineProperty(nm,"__esModule",{value:!0});nm.DSSESignatureContent=void 0;var Pu=ot(),K0=class{static{o(this,"DSSESignatureContent")}constructor(e){this.env=e}compareDigest(e){return Pu.crypto.bufferEqual(e,Pu.crypto.digest("sha256",this.env.payload))}compareSignature(e){return Pu.crypto.bufferEqual(e,this.signature)}verifySignature(e){return Pu.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 Pu.dsse.preAuthEncoding(this.env.payloadType,this.env.payload)}};nm.DSSESignatureContent=K0});var jU=d(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});om.MessageSignatureContent=void 0;var Z0=ot(),Y0=class{static{o(this,"MessageSignatureContent")}constructor(e,t){this.signature=e.signature,this.messageDigest=e.messageDigest.digest,this.artifact=t}compareSignature(e){return Z0.crypto.bufferEqual(e,this.signature)}compareDigest(e){return Z0.crypto.bufferEqual(e,this.messageDigest)}verifySignature(e){return Z0.crypto.verify(this.artifact,e,this.signature)}};om.MessageSignatureContent=Y0});var qU=d(am=>{"use strict";Object.defineProperty(am,"__esModule",{value:!0});am.toSignedEntity=bae;am.signatureContent=$U;var X0=ot(),wae=UU(),_ae=jU();function bae(i,e){let{tlogEntries:t,timestampVerificationData:r}=i.verificationMaterial,s=[];for(let n of t)s.push({$case:"transparency-log",tlogEntry:n});for(let n of r?.rfc3161Timestamps??[])s.push({$case:"timestamp-authority",timestamp:X0.RFC3161Timestamp.parse(n.signedTimestamp)});return{signature:$U(i,e),key:Iae(i),tlogEntries:t,timestamps:s}}o(bae,"toSignedEntity");function $U(i,e){switch(i.content.$case){case"dsseEnvelope":return new wae.DSSESignatureContent(i.content.dsseEnvelope);case"messageSignature":return new _ae.MessageSignatureContent(i.content.messageSignature,e)}}o($U,"signatureContent");function Iae(i){switch(i.verificationMaterial.content.$case){case"publicKey":return{$case:"public-key",hint:i.verificationMaterial.content.publicKey.hint};case"x509CertificateChain":return{$case:"certificate",certificate:X0.X509Certificate.parse(i.verificationMaterial.content.x509CertificateChain.certificates[0].rawBytes)};case"certificate":return{$case:"certificate",certificate:X0.X509Certificate.parse(i.verificationMaterial.content.certificate.rawBytes)}}}o(Iae,"key")});var Pe=d(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.PolicyError=ta.VerificationError=void 0;var cm=class extends Error{static{o(this,"BaseError")}constructor({code:e,message:t,cause:r}){super(t),this.code=e,this.cause=r,this.name=this.constructor.name}},Q0=class extends cm{static{o(this,"VerificationError")}};ta.VerificationError=Q0;var eI=class extends cm{static{o(this,"PolicyError")}};ta.PolicyError=eI});var VU=d(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});um.filterCertAuthorities=Oae;um.filterTLogAuthorities=vae;function Oae(i,e){return i.filter(t=>t.validFor.start<=e&&t.validFor.end>=e)}o(Oae,"filterCertAuthorities");function vae(i,e){return i.filter(t=>e.logID&&!t.logID.equals(e.logID)?!1:t.validFor.start<=e.targetDate&&e.targetDate<=t.validFor.end)}o(vae,"filterTLogAuthorities")});var on=d(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.filterTLogAuthorities=nn.filterCertAuthorities=void 0;nn.toTrustMaterial=Aae;var tI=ot(),Du=su(),Rae=Pe(),iI=new Date(0),rI=new Date(864e13),GU=VU();Object.defineProperty(nn,"filterCertAuthorities",{enumerable:!0,get:o(function(){return GU.filterCertAuthorities},"get")});Object.defineProperty(nn,"filterTLogAuthorities",{enumerable:!0,get:o(function(){return GU.filterTLogAuthorities},"get")});function Aae(i,e){let t=typeof e=="function"?e:Tae(e);return{certificateAuthorities:i.certificateAuthorities.map(HU),timestampAuthorities:i.timestampAuthorities.map(HU),tlogs:i.tlogs.map(zU),ctlogs:i.ctlogs.map(zU),publicKey:t}}o(Aae,"toTrustMaterial");function zU(i){let e=i.publicKey.keyDetails,t=e===Du.PublicKeyDetails.PKCS1_RSA_PKCS1V5||e===Du.PublicKeyDetails.PKIX_RSA_PKCS1V5||e===Du.PublicKeyDetails.PKIX_RSA_PKCS1V15_2048_SHA256||e===Du.PublicKeyDetails.PKIX_RSA_PKCS1V15_3072_SHA256||e===Du.PublicKeyDetails.PKIX_RSA_PKCS1V15_4096_SHA256?"pkcs1":"spki";return{logID:i.logId.keyId,publicKey:tI.crypto.createPublicKey(i.publicKey.rawBytes,t),validFor:{start:i.publicKey.validFor?.start||iI,end:i.publicKey.validFor?.end||rI}}}o(zU,"createTLogAuthority");function HU(i){return{certChain:i.certChain.certificates.map(e=>tI.X509Certificate.parse(e.rawBytes)),validFor:{start:i.validFor?.start||iI,end:i.validFor?.end||rI}}}o(HU,"createCertAuthority");function Tae(i){return e=>{let t=(i||{})[e];if(!t)throw new Rae.VerificationError({code:"PUBLIC_KEY_ERROR",message:`key not found: ${e}`});return{publicKey:tI.crypto.createPublicKey(t.rawBytes),validFor:o(r=>(t.validFor?.start||iI)<=r&&(t.validFor?.end||rI)>=r,"validFor")}}}o(Tae,"keyLocator")});var sI=d(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});xu.CertificateChainVerifier=void 0;xu.verifyCertificateChain=Nae;var is=Pe(),Cae=on();function Nae(i,e,t){let r=(0,Cae.filterCertAuthorities)(t,i),s;for(let n of r)try{return new lm({trustedCerts:n.certChain,untrustedCert:e,timestamp:i}).verify()}catch(a){s=a}throw new is.VerificationError({code:"CERTIFICATE_ERROR",message:"Failed to verify certificate chain",cause:s})}o(Nae,"verifyCertificateChain");var lm=class{static{o(this,"CertificateChainVerifier")}constructor(e){this.untrustedCert=e.untrustedCert,this.trustedCerts=e.trustedCerts,this.localCerts=Pae([...e.trustedCerts,e.untrustedCert]),this.timestamp=e.timestamp}verify(){let e=this.sort();if(this.checkPath(e),!e.every(r=>r.validForDate(this.timestamp)))throw new is.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 is.VerificationError({code:"CERTIFICATE_ERROR",message:"no trusted certificate path found"});let r=t.reduce((s,n)=>s.length<n.length?s:n);return[e,...r].slice(0,-1)}buildPaths(e){let t=[],r=this.findIssuer(e);if(r.length===0)throw new is.VerificationError({code:"CERTIFICATE_ERROR",message:"no valid certificate path found"});for(let s=0;s<r.length;s++){let n=r[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=[],r;return e.subject.equals(e.issuer)&&e.verify()?[e]:(e.extAuthorityKeyID&&(r=e.extAuthorityKeyID.keyIdentifier),this.localCerts.forEach(s=>{if(r&&s.extSubjectKeyID){s.extSubjectKeyID.keyIdentifier.equals(r)&&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 is.VerificationError({code:"CERTIFICATE_ERROR",message:"certificate chain must contain at least one certificate"});if(!e.slice(1).every(r=>r.isCA))throw new is.VerificationError({code:"CERTIFICATE_ERROR",message:"intermediate certificate is not a CA"});for(let r=e.length-2;r>=0;r--)if(!e[r].issuer.equals(e[r+1].subject))throw new is.VerificationError({code:"CERTIFICATE_ERROR",message:"incorrect certificate name chaining"});for(let r=0;r<e.length;r++){let s=e[r];if(s.extBasicConstraints?.isCA){let n=s.extBasicConstraints.pathLenConstraint;if(n!==void 0&&n<r-1)throw new is.VerificationError({code:"CERTIFICATE_ERROR",message:"path length constraint exceeded"})}}}};xu.CertificateChainVerifier=lm;function Pae(i){for(let e=0;e<i.length;e++)for(let t=e+1;t<i.length;t++)i[e].equals(i[t])&&(i.splice(t,1),t--);return i}o(Pae,"dedupeCertificates")});var WU=d(nI=>{"use strict";Object.defineProperty(nI,"__esModule",{value:!0});nI.verifySCTs=Lae;var hm=ot(),Dae=Pe(),xae=on();function Lae(i,e,t){let r,s=i.clone();for(let u=0;u<s.extensions.length;u++){let l=s.extensions[u];if(l.subs[0].toOID()===hm.EXTENSION_OID_SCT){r=new hm.X509SCTExtension(l),s.extensions.splice(u,1);break}}if(!r)return[];if(r.signedCertificateTimestamps.length===0)return[];let n=new hm.ByteStream,a=hm.crypto.digest("sha256",e.publicKey);n.appendView(a);let c=s.tbsCertificate.toDER();return n.appendUint24(c.length),n.appendView(c),r.signedCertificateTimestamps.map(u=>{if(!(0,xae.filterTLogAuthorities)(t,{logID:u.logID,targetDate:u.datetime}).some(f=>u.verify(n.buffer,f.publicKey)))throw new Dae.VerificationError({code:"CERTIFICATE_ERROR",message:"SCT verification failed"});return u.logID})}o(Lae,"verifySCTs")});var JU=d(fm=>{"use strict";Object.defineProperty(fm,"__esModule",{value:!0});fm.verifyPublicKey=$ae;fm.verifyCertificate=qae;var Mae=ot(),Bae=Pe(),kae=sI(),Fae=WU(),Uae="1.3.6.1.4.1.57264.1.1",jae="1.3.6.1.4.1.57264.1.8";function $ae(i,e,t){let r=t.publicKey(i);return e.forEach(s=>{if(!r.validFor(s))throw new Bae.VerificationError({code:"PUBLIC_KEY_ERROR",message:`Public key is not valid for timestamp: ${s.toISOString()}`})}),{key:r.publicKey}}o($ae,"verifyPublicKey");function qae(i,e,t){let r=[];return e.forEach(s=>{r=(0,kae.verifyCertificateChain)(s,i,t.certificateAuthorities)}),{scts:(0,Fae.verifySCTs)(r[0],r[1],t.ctlogs),signer:Vae(r[0])}}o(qae,"verifyCertificate");function Vae(i){let e,t=i.extension(jae);t?e=t.valueObj.subs?.[0]?.value.toString("ascii"):e=i.extension(Uae)?.value.toString("ascii");let r={extensions:{issuer:e},subjectAlternativeName:i.subjectAltName};return{key:Mae.crypto.createPublicKey(i.publicKey),identity:r}}o(Vae,"getSigner")});var ZU=d(dm=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});dm.verifySubjectAlternativeName=zae;dm.verifyExtensions=Hae;var KU=Pe();function zae(i,e){if(e===void 0||!e.match(i))throw new KU.PolicyError({code:"UNTRUSTED_SIGNER_ERROR",message:`certificate identity error - expected ${i}, got ${e}`})}o(zae,"verifySubjectAlternativeName");function Hae(i,e={}){let t;for(t in i)if(e[t]!==i[t])throw new KU.PolicyError({code:"UNTRUSTED_SIGNER_ERROR",message:`invalid certificate extension - expected ${t}=${i[t]}, got ${t}=${e[t]}`})}o(Hae,"verifyExtensions")});var YU=d(lI=>{"use strict";Object.defineProperty(lI,"__esModule",{value:!0});lI.verifyCheckpoint=Jae;var aI=ot(),ia=Pe(),Gae=on(),oI=`
60
+ >>> no match, partial?`,e,p,t,m),p===u))}let g;if(typeof h=="string"?(g=f===h,this.debug("string match",h,f,g)):(g=h.test(f),this.debug("pattern match",h,f,g)),!g)return!1}if(a===u&&c===l)return!0;if(a===u)return r;if(c===l)return a===u-1&&e[a]==="";throw new Error("wtf?")}braceExpand(){return(0,T.braceExpand)(this.pattern,this.options)}parse(e){(0,Fp.assertValidPattern)(e);let t=this.options;if(e==="**")return T.GLOBSTAR;if(e==="")return"";let r,s=null;(r=e.match(_ne))?s=t.dot?Ine:bne:(r=e.match(hne))?s=(t.nocase?t.dot?mne:pne:t.dot?dne:fne)(r[1]):(r=e.match(One))?s=(t.nocase?t.dot?Rne:vne:t.dot?Ane:Tne)(r):(r=e.match(gne))?s=t.dot?Sne:yne:(r=e.match(Ene))&&(s=wne);let n=cU.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,r=t.noglobstar?Nne:t.dot?Pne:Dne,s=new Set(t.nocase?["i"]:[]),n=e.map(u=>{let l=u.map(h=>{if(h instanceof RegExp)for(let f of h.flags.split(""))s.add(f);return typeof h=="string"?Fne(h):h===T.GLOBSTAR?T.GLOBSTAR:h._src});return l.forEach((h,f)=>{let p=l[f+1],m=l[f-1];h!==T.GLOBSTAR||m===T.GLOBSTAR||(m===void 0?p!==void 0&&p!==T.GLOBSTAR?l[f+1]="(?:\\/|"+r+"\\/)?"+p:l[f]=r:p===void 0?l[f-1]=m+"(?:\\/|"+r+")?":p!==T.GLOBSTAR&&(l[f-1]=m+"(?:\\/|\\/"+r+"\\/)"+p,l[f+1]=T.GLOBSTAR))}),l.filter(h=>h!==T.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 r=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 u=n[c],l=s;if(r.matchBase&&u.length===1&&(l=[a]),this.matchOne(l,u,t))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return T.minimatch.defaults(e).Minimatch}};T.Minimatch=tn;var Une=n0();Object.defineProperty(T,"AST",{enumerable:!0,get:o(function(){return Une.AST},"get")});var jne=o0();Object.defineProperty(T,"escape",{enumerable:!0,get:o(function(){return jne.escape},"get")});var $ne=xp();Object.defineProperty(T,"unescape",{enumerable:!0,get:o(function(){return $ne.unescape},"get")});T.minimatch.AST=cU.AST;T.minimatch.Minimatch=tn;T.minimatch.escape=cne.escape;T.minimatch.unescape=une.unescape});var u0=d(Ut=>{"use strict";var dU=Ut&&Ut.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ut,"__esModule",{value:!0});Ut.SuccinctRoles=Ut.DelegatedRole=Ut.Role=Ut.TOP_LEVEL_ROLE_NAMES=void 0;var pU=dU(require("crypto")),qne=fU(),Up=dU(require("util")),jp=xi(),rn=ei();Ut.TOP_LEVEL_ROLE_NAMES=["root","targets","snapshot","timestamp"];var Ou=class i{static{o(this,"Role")}keyIDs;threshold;unrecognizedFields;constructor(e){let{keyIDs:t,threshold:r,unrecognizedFields:s}=e;if(Vne(t))throw new jp.ValueError("duplicate key IDs found");if(r<1)throw new jp.ValueError("threshold must be at least 1");this.keyIDs=t,this.threshold=r,this.unrecognizedFields=s||{}}equals(e){return e instanceof i?this.threshold===e.threshold&&Up.default.isDeepStrictEqual(this.keyIDs,e.keyIDs)&&Up.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}toJSON(){return{keyids:this.keyIDs,threshold:this.threshold,...this.unrecognizedFields}}static fromJSON(e){let{keyids:t,threshold:r,...s}=e;if(!rn.guard.isStringArray(t))throw new TypeError("keyids must be an array");if(typeof r!="number")throw new TypeError("threshold must be a number");return new i({keyIDs:t,threshold:r,unrecognizedFields:s})}};Ut.Role=Ou;function Vne(i){return new Set(i).size!==i.length}o(Vne,"hasDuplicates");var a0=class i extends Ou{static{o(this,"DelegatedRole")}name;terminating;paths;pathHashPrefixes;constructor(e){super(e);let{name:t,terminating:r,paths:s,pathHashPrefixes:n}=e;if(this.name=t,this.terminating=r,e.paths&&e.pathHashPrefixes)throw new jp.ValueError("paths and pathHashPrefixes are mutually exclusive");this.paths=s,this.pathHashPrefixes=n}equals(e){return e instanceof i?super.equals(e)&&this.name===e.name&&this.terminating===e.terminating&&Up.default.isDeepStrictEqual(this.paths,e.paths)&&Up.default.isDeepStrictEqual(this.pathHashPrefixes,e.pathHashPrefixes):!1}isDelegatedPath(e){if(this.paths)return this.paths.some(t=>Hne(e,t));if(this.pathHashPrefixes){let r=pU.default.createHash("sha256").update(e).digest("hex");return this.pathHashPrefixes.some(s=>r.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:r,name:s,terminating:n,paths:a,path_hash_prefixes:c,...u}=e;if(!rn.guard.isStringArray(t))throw new TypeError("keyids must be an array of strings");if(typeof r!="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(rn.guard.isDefined(a)&&!rn.guard.isStringArray(a))throw new TypeError("paths must be an array of strings");if(rn.guard.isDefined(c)&&!rn.guard.isStringArray(c))throw new TypeError("path_hash_prefixes must be an array of strings");return new i({keyIDs:t,threshold:r,name:s,terminating:n,paths:a,pathHashPrefixes:c,unrecognizedFields:u})}};Ut.DelegatedRole=a0;var zne=o((i,e)=>i.map((t,r)=>[t,e[r]]),"zip");function Hne(i,e){let t=i.split("/"),r=e.split("/");return r.length!=t.length?!1:zne(t,r).every(([s,n])=>(0,qne.minimatch)(s,n))}o(Hne,"isTargetInPathPattern");var c0=class i extends Ou{static{o(this,"SuccinctRoles")}bitLength;namePrefix;numberOfBins;suffixLen;constructor(e){super(e);let{bitLength:t,namePrefix:r}=e;if(t<=0||t>32)throw new jp.ValueError("bitLength must be between 1 and 32");this.bitLength=t,this.namePrefix=r,this.numberOfBins=Math.pow(2,t),this.suffixLen=(this.numberOfBins-1).toString(16).length}equals(e){return e instanceof i?super.equals(e)&&this.bitLength===e.bitLength&&this.namePrefix===e.namePrefix:!1}getRoleForTarget(e){let s=pU.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 r=e.slice(t.length,e.length);if(r.length!=this.suffixLen||!r.match(/^[0-9a-fA-F]+$/))return!1;let s=parseInt(r,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:r,bit_length:s,name_prefix:n,...a}=e;if(!rn.guard.isStringArray(t))throw new TypeError("keyids must be an array of strings");if(typeof r!="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 i({keyIDs:t,threshold:r,bitLength:s,namePrefix:n,unrecognizedFields:a})}};Ut.SuccinctRoles=c0});var f0=d(Go=>{"use strict";var Gne=Go&&Go.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Go,"__esModule",{value:!0});Go.Root=void 0;var mU=Gne(require("util")),l0=en(),gU=xi(),Wne=Cp(),$p=u0(),qp=ei(),h0=class i extends l0.Signed{static{o(this,"Root")}type=l0.MetadataKind.Root;keys;roles;consistentSnapshot;constructor(e){if(super(e),this.keys=e.keys||{},this.consistentSnapshot=e.consistentSnapshot??!0,!e.roles)this.roles=$p.TOP_LEVEL_ROLE_NAMES.reduce((t,r)=>({...t,[r]:new $p.Role({keyIDs:[],threshold:1})}),{});else{let t=new Set(Object.keys(e.roles));if(!$p.TOP_LEVEL_ROLE_NAMES.every(r=>t.has(r)))throw new gU.ValueError("missing top-level role");this.roles=e.roles}}addKey(e,t){if(!this.roles[t])throw new gU.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 i?super.equals(e)&&this.consistentSnapshot===e.consistentSnapshot&&mU.default.isDeepStrictEqual(this.keys,e.keys)&&mU.default.isDeepStrictEqual(this.roles,e.roles):!1}toJSON(){return{_type:this.type,spec_version:this.specVersion,version:this.version,expires:this.expires,keys:Jne(this.keys),roles:Kne(this.roles),consistent_snapshot:this.consistentSnapshot,...this.unrecognizedFields}}static fromJSON(e){let{unrecognizedFields:t,...r}=l0.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 i({...r,keys:Zne(s),roles:Yne(n),consistentSnapshot:a,unrecognizedFields:c})}};Go.Root=h0;function Jne(i){return Object.entries(i).reduce((e,[t,r])=>({...e,[t]:r.toJSON()}),{})}o(Jne,"keysToJSON");function Kne(i){return Object.entries(i).reduce((e,[t,r])=>({...e,[t]:r.toJSON()}),{})}o(Kne,"rolesToJSON");function Zne(i){let e;if(qp.guard.isDefined(i)){if(!qp.guard.isObjectRecord(i))throw new TypeError("keys must be an object");e=Object.entries(i).reduce((t,[r,s])=>({...t,[r]:Wne.Key.fromJSON(r,s)}),{})}return e}o(Zne,"keysFromJSON");function Yne(i){let e;if(qp.guard.isDefined(i)){if(!qp.guard.isObjectRecord(i))throw new TypeError("roles must be an object");e=Object.entries(i).reduce((t,[r,s])=>({...t,[r]:$p.Role.fromJSON(s)}),{})}return e}o(Yne,"rolesFromJSON")});var p0=d(Vp=>{"use strict";Object.defineProperty(Vp,"__esModule",{value:!0});Vp.Signature=void 0;var d0=class i{static{o(this,"Signature")}keyID;sig;constructor(e){let{keyID:t,sig:r}=e;this.keyID=t,this.sig=r}toJSON(){return{keyid:this.keyID,sig:this.sig}}static fromJSON(e){let{keyid:t,sig:r}=e;if(typeof t!="string")throw new TypeError("keyid must be a string");if(typeof r!="string")throw new TypeError("sig must be a string");return new i({keyID:t,sig:r})}};Vp.Signature=d0});var y0=d(Wo=>{"use strict";var Xne=Wo&&Wo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Wo,"__esModule",{value:!0});Wo.Snapshot=void 0;var Qne=Xne(require("util")),m0=en(),SU=Su(),yU=ei(),g0=class i extends m0.Signed{static{o(this,"Snapshot")}type=m0.MetadataKind.Snapshot;meta;constructor(e){super(e),this.meta=e.meta||{"targets.json":new SU.MetaFile({version:1})}}equals(e){return e instanceof i?super.equals(e)&&Qne.default.isDeepStrictEqual(this.meta,e.meta):!1}toJSON(){return{_type:this.type,meta:eoe(this.meta),spec_version:this.specVersion,version:this.version,expires:this.expires,...this.unrecognizedFields}}static fromJSON(e){let{unrecognizedFields:t,...r}=m0.Signed.commonFieldsFromJSON(e),{meta:s,...n}=t;return new i({...r,meta:toe(s),unrecognizedFields:n})}};Wo.Snapshot=g0;function eoe(i){return Object.entries(i).reduce((e,[t,r])=>({...e,[t]:r.toJSON()}),{})}o(eoe,"metaToJSON");function toe(i){let e;if(yU.guard.isDefined(i))if(yU.guard.isObjectRecord(i))e=Object.entries(i).reduce((t,[r,s])=>({...t,[r]:SU.MetaFile.fromJSON(s)}),{});else throw new TypeError("meta field is malformed");return e}o(toe,"metaFromJSON")});var EU=d(Jo=>{"use strict";var ioe=Jo&&Jo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Jo,"__esModule",{value:!0});Jo.Delegations=void 0;var zp=ioe(require("util")),roe=xi(),soe=Cp(),S0=u0(),Hp=ei(),E0=class i{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=>S0.TOP_LEVEL_ROLE_NAMES.includes(t)))throw new roe.ValueError("Delegated role name conflicts with top-level role name");this.succinctRoles=e.succinctRoles,this.roles=e.roles}equals(e){return e instanceof i?zp.default.isDeepStrictEqual(this.keys,e.keys)&&zp.default.isDeepStrictEqual(this.roles,e.roles)&&zp.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields)&&zp.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:noe(this.keys),...this.unrecognizedFields};return this.roles?e.roles=ooe(this.roles):this.succinctRoles&&(e.succinct_roles=this.succinctRoles.toJSON()),e}static fromJSON(e){let{keys:t,roles:r,succinct_roles:s,...n}=e,a;return Hp.guard.isObject(s)&&(a=S0.SuccinctRoles.fromJSON(s)),new i({keys:aoe(t),roles:coe(r),unrecognizedFields:n,succinctRoles:a})}};Jo.Delegations=E0;function noe(i){return Object.entries(i).reduce((e,[t,r])=>({...e,[t]:r.toJSON()}),{})}o(noe,"keysToJSON");function ooe(i){return Object.values(i).map(e=>e.toJSON())}o(ooe,"rolesToJSON");function aoe(i){if(!Hp.guard.isObjectRecord(i))throw new TypeError("keys is malformed");return Object.entries(i).reduce((e,[t,r])=>({...e,[t]:soe.Key.fromJSON(t,r)}),{})}o(aoe,"keysFromJSON");function coe(i){let e;if(Hp.guard.isDefined(i)){if(!Hp.guard.isObjectArray(i))throw new TypeError("roles is malformed");e=i.reduce((t,r)=>{let s=S0.DelegatedRole.fromJSON(r);return{...t,[s.name]:s}},{})}return e}o(coe,"rolesFromJSON")});var b0=d(Ko=>{"use strict";var uoe=Ko&&Ko.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ko,"__esModule",{value:!0});Ko.Targets=void 0;var wU=uoe(require("util")),w0=en(),loe=EU(),hoe=Su(),Gp=ei(),_0=class i extends w0.Signed{static{o(this,"Targets")}type=w0.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 i?super.equals(e)&&wU.default.isDeepStrictEqual(this.targets,e.targets)&&wU.default.isDeepStrictEqual(this.delegations,e.delegations):!1}toJSON(){let e={_type:this.type,spec_version:this.specVersion,version:this.version,expires:this.expires,targets:foe(this.targets),...this.unrecognizedFields};return this.delegations&&(e.delegations=this.delegations.toJSON()),e}static fromJSON(e){let{unrecognizedFields:t,...r}=w0.Signed.commonFieldsFromJSON(e),{targets:s,delegations:n,...a}=t;return new i({...r,targets:doe(s),delegations:poe(n),unrecognizedFields:a})}};Ko.Targets=_0;function foe(i){return Object.entries(i).reduce((e,[t,r])=>({...e,[t]:r.toJSON()}),{})}o(foe,"targetsToJSON");function doe(i){let e;if(Gp.guard.isDefined(i))if(Gp.guard.isObjectRecord(i))e=Object.entries(i).reduce((t,[r,s])=>({...t,[r]:hoe.TargetFile.fromJSON(r,s)}),{});else throw new TypeError("targets must be an object");return e}o(doe,"targetsFromJSON");function poe(i){let e;if(Gp.guard.isDefined(i))if(Gp.guard.isObject(i))e=loe.Delegations.fromJSON(i);else throw new TypeError("delegations must be an object");return e}o(poe,"delegationsFromJSON")});var R0=d(Wp=>{"use strict";Object.defineProperty(Wp,"__esModule",{value:!0});Wp.Timestamp=void 0;var I0=en(),_U=Su(),O0=ei(),v0=class i extends I0.Signed{static{o(this,"Timestamp")}type=I0.MetadataKind.Timestamp;snapshotMeta;constructor(e){super(e),this.snapshotMeta=e.snapshotMeta||new _U.MetaFile({version:1})}equals(e){return e instanceof i?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,...r}=I0.Signed.commonFieldsFromJSON(e),{meta:s,...n}=t;return new i({...r,snapshotMeta:moe(s),unrecognizedFields:n})}};Wp.Timestamp=v0;function moe(i){let e;if(O0.guard.isDefined(i)){let t=i["snapshot.json"];if(!O0.guard.isDefined(t)||!O0.guard.isObject(t))throw new TypeError("missing snapshot.json in meta");e=_U.MetaFile.fromJSON(t)}return e}o(moe,"snapshotMetaFromJSON")});var IU=d(Yo=>{"use strict";var goe=Yo&&Yo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Yo,"__esModule",{value:!0});Yo.Metadata=void 0;var yoe=Hb(),bU=goe(require("util")),Zo=en(),vu=xi(),Soe=f0(),Eoe=p0(),woe=y0(),_oe=b0(),boe=R0(),A0=ei(),T0=class i{static{o(this,"Metadata")}signed;signatures;unrecognizedFields;constructor(e,t,r){this.signed=e,this.signatures=t||{},this.unrecognizedFields=r||{}}sign(e,t=!0){let r=Buffer.from((0,yoe.canonicalize)(this.signed.toJSON())),s=e(r);t||(this.signatures={}),this.signatures[s.keyID]=s}verifyDelegate(e,t){let r,s={};switch(this.signed.type){case Zo.MetadataKind.Root:s=this.signed.keys,r=this.signed.roles[e];break;case Zo.MetadataKind.Targets:if(!this.signed.delegations)throw new vu.ValueError(`No delegations found for ${e}`);s=this.signed.delegations.keys,this.signed.delegations.roles?r=this.signed.delegations.roles[e]:this.signed.delegations.succinctRoles&&this.signed.delegations.succinctRoles.isDelegatedRole(e)&&(r=this.signed.delegations.succinctRoles);break;default:throw new TypeError("invalid metadata type")}if(!r)throw new vu.ValueError(`no delegation found for ${e}`);let n=new Set;if(r.keyIDs.forEach(a=>{let c=s[a];if(c)try{c.verifySignature(t),n.add(c.keyID)}catch{}}),n.size<r.threshold)throw new vu.UnsignedMetadataError(`${e} was signed by ${n.size}/${r.threshold} keys`)}equals(e){return e instanceof i?this.signed.equals(e.signed)&&bU.default.isDeepStrictEqual(this.signatures,e.signatures)&&bU.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:r,signatures:s,...n}=t;if(!A0.guard.isDefined(r)||!A0.guard.isObject(r))throw new TypeError("signed is not defined");if(e!==r._type)throw new vu.ValueError(`expected '${e}', got ${r._type}`);if(!A0.guard.isObjectArray(s))throw new TypeError("signatures is not an array");let a;switch(e){case Zo.MetadataKind.Root:a=Soe.Root.fromJSON(r);break;case Zo.MetadataKind.Timestamp:a=boe.Timestamp.fromJSON(r);break;case Zo.MetadataKind.Snapshot:a=woe.Snapshot.fromJSON(r);break;case Zo.MetadataKind.Targets:a=_oe.Targets.fromJSON(r);break;default:throw new TypeError("invalid metadata type")}let c={};return s.forEach(u=>{let l=Eoe.Signature.fromJSON(u);if(c[l.keyID])throw new vu.ValueError(`multiple signatures found for keyid: ${l.keyID}`);c[l.keyID]=l}),new i(a,c,n)}};Yo.Metadata=T0});var Jp=d(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.Timestamp=ce.Targets=ce.Snapshot=ce.Signature=ce.Root=ce.Metadata=ce.Key=ce.TargetFile=ce.MetaFile=ce.ValueError=ce.MetadataKind=void 0;var Ioe=en();Object.defineProperty(ce,"MetadataKind",{enumerable:!0,get:o(function(){return Ioe.MetadataKind},"get")});var Ooe=xi();Object.defineProperty(ce,"ValueError",{enumerable:!0,get:o(function(){return Ooe.ValueError},"get")});var OU=Su();Object.defineProperty(ce,"MetaFile",{enumerable:!0,get:o(function(){return OU.MetaFile},"get")});Object.defineProperty(ce,"TargetFile",{enumerable:!0,get:o(function(){return OU.TargetFile},"get")});var voe=Cp();Object.defineProperty(ce,"Key",{enumerable:!0,get:o(function(){return voe.Key},"get")});var Roe=IU();Object.defineProperty(ce,"Metadata",{enumerable:!0,get:o(function(){return Roe.Metadata},"get")});var Aoe=f0();Object.defineProperty(ce,"Root",{enumerable:!0,get:o(function(){return Aoe.Root},"get")});var Toe=p0();Object.defineProperty(ce,"Signature",{enumerable:!0,get:o(function(){return Toe.Signature},"get")});var Coe=y0();Object.defineProperty(ce,"Snapshot",{enumerable:!0,get:o(function(){return Coe.Snapshot},"get")});var Noe=b0();Object.defineProperty(ce,"Targets",{enumerable:!0,get:o(function(){return Noe.Targets},"get")});var Poe=R0();Object.defineProperty(ce,"Timestamp",{enumerable:!0,get:o(function(){return Poe.Timestamp},"get")})});var Zp=d(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.DownloadHTTPError=de.DownloadLengthMismatchError=de.DownloadError=de.ExpiredMetadataError=de.EqualVersionError=de.BadVersionError=de.RepositoryError=de.PersistError=de.RuntimeError=de.ValueError=void 0;var C0=class extends Error{static{o(this,"ValueError")}};de.ValueError=C0;var N0=class extends Error{static{o(this,"RuntimeError")}};de.RuntimeError=N0;var P0=class extends Error{static{o(this,"PersistError")}};de.PersistError=P0;var Ru=class extends Error{static{o(this,"RepositoryError")}};de.RepositoryError=Ru;var Kp=class extends Ru{static{o(this,"BadVersionError")}};de.BadVersionError=Kp;var D0=class extends Kp{static{o(this,"EqualVersionError")}};de.EqualVersionError=D0;var x0=class extends Ru{static{o(this,"ExpiredMetadataError")}};de.ExpiredMetadataError=x0;var Au=class extends Error{static{o(this,"DownloadError")}};de.DownloadError=Au;var L0=class extends Au{static{o(this,"DownloadLengthMismatchError")}};de.DownloadLengthMismatchError=L0;var M0=class extends Au{static{o(this,"DownloadHTTPError")}statusCode;constructor(e,t){super(e),this.statusCode=t}};de.DownloadHTTPError=M0});var RU=d(Xo=>{"use strict";var k0=Xo&&Xo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Xo,"__esModule",{value:!0});Xo.withTempFile=void 0;var B0=k0(require("fs/promises")),Doe=k0(require("os")),vU=k0(require("path")),xoe=o(async i=>Loe(async e=>i(vU.default.join(e,"tempfile"))),"withTempFile");Xo.withTempFile=xoe;var Loe=o(async i=>{let e=await B0.default.realpath(Doe.default.tmpdir()),t=await B0.default.mkdtemp(e+vU.default.sep);try{return await i(t)}finally{await B0.default.rm(t,{force:!0,recursive:!0,maxRetries:3})}},"withTempDir")});var U0=d(Qr=>{"use strict";var Xp=Qr&&Qr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Qr,"__esModule",{value:!0});Qr.DefaultFetcher=Qr.BaseFetcher=void 0;var Moe=Xp(Fs()),AU=Xp(require("fs")),Boe=Xp(iu()),koe=Xp(require("util")),TU=Zp(),Foe=RU(),Uoe=(0,Moe.default)("tuf:fetch"),Yp=class{static{o(this,"BaseFetcher")}async downloadFile(e,t,r){return(0,Foe.withTempFile)(async s=>{let n=await this.fetch(e),a=0,c=AU.default.createWriteStream(s);try{for await(let u of n){if(a+=u.length,a>t)throw new TU.DownloadLengthMismatchError("Max length reached");await joe(c,u)}}finally{await koe.default.promisify(c.close).bind(c)()}return r(s)})}async downloadBytes(e,t){return this.downloadFile(e,t,async r=>{let s=AU.default.createReadStream(r),n=[];for await(let a of s)n.push(a);return Buffer.concat(n)})}};Qr.BaseFetcher=Yp;var F0=class extends Yp{static{o(this,"DefaultFetcher")}timeout;retry;constructor(e={}){super(),this.timeout=e.timeout,this.retry=e.retry}async fetch(e){Uoe("GET %s",e);let t=await(0,Boe.default)(e,{timeout:this.timeout,retry:this.retry});if(!t.ok||!t?.body)throw new TU.DownloadHTTPError("Failed to download",t.status);return t.body}};Qr.DefaultFetcher=F0;var joe=o(async(i,e)=>new Promise((t,r)=>{i.write(e,s=>{s&&r(s),t(!0)})}),"writeBufferToStream")});var CU=d(Qp=>{"use strict";Object.defineProperty(Qp,"__esModule",{value:!0});Qp.defaultConfig=void 0;Qp.defaultConfig={maxRootRotations:256,maxDelegations:32,rootMaxLength:512e3,timestampMaxLength:16384,snapshotMaxLength:2e6,targetsMaxLength:5e6,prefixTargetsWithHash:!0,fetchTimeout:1e5,fetchRetries:void 0,fetchRetry:2}});var NU=d(em=>{"use strict";Object.defineProperty(em,"__esModule",{value:!0});em.TrustedMetadataStore=void 0;var Ie=Jp(),le=Zp(),j0=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")),r=Ie.Metadata.fromJSON(Ie.MetadataKind.Root,t);if(r.signed.type!=Ie.MetadataKind.Root)throw new le.RepositoryError(`Expected 'root', got ${r.signed.type}`);if(this.root.verifyDelegate(Ie.MetadataKind.Root,r),r.signed.version!=this.root.signed.version+1)throw new le.BadVersionError(`Expected version ${this.root.signed.version+1}, got ${r.signed.version}`);return r.verifyDelegate(Ie.MetadataKind.Root,r),this.trustedSet.root=r,r}updateTimestamp(e){if(this.snapshot)throw new le.RuntimeError("Cannot update timestamp after snapshot");if(this.root.signed.isExpired(this.referenceTime))throw new le.ExpiredMetadataError("Final root.json is expired");let t=JSON.parse(e.toString("utf8")),r=Ie.Metadata.fromJSON(Ie.MetadataKind.Timestamp,t);if(r.signed.type!=Ie.MetadataKind.Timestamp)throw new le.RepositoryError(`Expected 'timestamp', got ${r.signed.type}`);if(this.root.verifyDelegate(Ie.MetadataKind.Timestamp,r),this.timestamp){if(r.signed.version<this.timestamp.signed.version)throw new le.BadVersionError(`New timestamp version ${r.signed.version} is less than current version ${this.timestamp.signed.version}`);if(r.signed.version===this.timestamp.signed.version)throw new le.EqualVersionError(`New timestamp version ${r.signed.version} is equal to current version ${this.timestamp.signed.version}`);let s=this.timestamp.signed.snapshotMeta,n=r.signed.snapshotMeta;if(n.version<s.version)throw new le.BadVersionError(`New snapshot version ${n.version} is less than current version ${s.version}`)}return this.trustedSet.timestamp=r,this.checkFinalTimestamp(),r}updateSnapshot(e,t=!1){if(!this.timestamp)throw new le.RuntimeError("Cannot update snapshot before timestamp");if(this.targets)throw new le.RuntimeError("Cannot update snapshot after targets");this.checkFinalTimestamp();let r=this.timestamp.signed.snapshotMeta;t||r.verify(e);let s=JSON.parse(e.toString("utf8")),n=Ie.Metadata.fromJSON(Ie.MetadataKind.Snapshot,s);if(n.signed.type!=Ie.MetadataKind.Snapshot)throw new le.RepositoryError(`Expected 'snapshot', got ${n.signed.type}`);return this.root.verifyDelegate(Ie.MetadataKind.Snapshot,n),this.snapshot&&Object.entries(this.snapshot.signed.meta).forEach(([a,c])=>{let u=n.signed.meta[a];if(!u)throw new le.RepositoryError(`Missing file ${a} in new snapshot`);if(u.version<c.version)throw new le.BadVersionError(`New version ${u.version} of ${a} is less than current version ${c.version}`)}),this.trustedSet.snapshot=n,this.checkFinalSnapsnot(),n}updateDelegatedTargets(e,t,r){if(!this.snapshot)throw new le.RuntimeError("Cannot update delegated targets before snapshot");this.checkFinalSnapsnot();let s=this.trustedSet[r];if(!s)throw new le.RuntimeError(`No trusted ${r} metadata`);let n=this.snapshot.signed.meta?.[`${t}.json`];if(!n)throw new le.RepositoryError(`Missing ${t}.json in snapshot`);n.verify(e);let a=JSON.parse(e.toString("utf8")),c=Ie.Metadata.fromJSON(Ie.MetadataKind.Targets,a);if(c.signed.type!=Ie.MetadataKind.Targets)throw new le.RepositoryError(`Expected 'targets', got ${c.signed.type}`);s.verifyDelegate(t,c);let u=c.signed.version;if(u!=n.version)throw new le.BadVersionError(`Version ${u} of ${t} does not match snapshot version ${n.version}`);if(c.signed.isExpired(this.referenceTime))throw new le.ExpiredMetadataError(`${t}.json is expired`);this.trustedSet[t]=c}loadTrustedRoot(e){let t=JSON.parse(e.toString("utf8")),r=Ie.Metadata.fromJSON(Ie.MetadataKind.Root,t);if(r.signed.type!=Ie.MetadataKind.Root)throw new le.RepositoryError(`Expected 'root', got ${r.signed.type}`);r.verifyDelegate(Ie.MetadataKind.Root,r),this.trustedSet.root=r}checkFinalTimestamp(){if(!this.timestamp)throw new ReferenceError("No trusted timestamp metadata");if(this.timestamp.signed.isExpired(this.referenceTime))throw new le.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 le.ExpiredMetadataError("snapshot.json is expired");let e=this.timestamp.signed.snapshotMeta;if(this.snapshot.signed.version!==e.version)throw new le.BadVersionError("Snapshot version doesn't match timestamp")}};em.TrustedMetadataStore=j0});var PU=d($0=>{"use strict";Object.defineProperty($0,"__esModule",{value:!0});$0.join=qoe;var $oe=require("url");function qoe(i,e){return new $oe.URL(Voe(i)+zoe(e)).toString()}o(qoe,"join");function Voe(i){return i.endsWith("/")?i:i+"/"}o(Voe,"ensureTrailingSlash");function zoe(i){return i.startsWith("/")?i.slice(1):i}o(zoe,"removeLeadingSlash")});var DU=d(jt=>{"use strict";var Hoe=jt&&jt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),Goe=jt&&jt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),z0=jt&&jt.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&Hoe(t,e,r[s]);return Goe(t,e),t}})(),Woe=jt&&jt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(jt,"__esModule",{value:!0});jt.Updater=void 0;var Li=Jp(),Joe=Woe(Fs()),Qo=z0(require("fs")),tm=z0(require("path")),Koe=CU(),sn=Zp(),Zoe=U0(),Yoe=NU(),Tu=z0(PU()),q0=(0,Joe.default)("tuf:cache"),V0=class{static{o(this,"Updater")}dir;metadataBaseUrl;targetDir;targetBaseUrl;forceCache;trustedSet;config;fetcher;constructor(e){let{metadataDir:t,metadataBaseUrl:r,targetDir:s,targetBaseUrl:n,fetcher:a,config:c}=e;this.dir=t,this.metadataBaseUrl=r,this.targetDir=s,this.targetBaseUrl=n,this.forceCache=e.forceCache??!1;let u=this.loadLocalMetadata(Li.MetadataKind.Root);this.trustedSet=new Yoe.TrustedMetadataStore(u),this.config={...Koe.defaultConfig,...c},this.fetcher=a||new Zoe.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(Li.MetadataKind.Targets,Li.MetadataKind.Root)}async getTargetInfo(e){return this.trustedSet.targets||await this.refresh(),this.preorderDepthFirstWalk(e)}async downloadTarget(e,t,r){let s=t||this.generateTargetPath(e);if(!r){if(!this.targetBaseUrl)throw new sn.ValueError("Target base URL not set");r=this.targetBaseUrl}let n=e.path;if(this.trustedSet.root.signed.consistentSnapshot&&this.config.prefixTargetsWithHash){let u=Object.values(e.hashes),{dir:l,base:h}=tm.parse(n),f=`${u[0]}.${h}`;n=l?`${l}/${f}`:f}let c=Tu.join(r,n);return await this.fetcher.downloadFile(c,e.length,async u=>{await e.verify(Qo.createReadStream(u)),q0("WRITE %s",s),Qo.copyFileSync(u,s)}),s}async findCachedTarget(e,t){t||(t=this.generateTargetPath(e));try{if(Qo.existsSync(t))return await e.verify(Qo.createReadStream(t)),t}catch{return}}loadLocalMetadata(e){let t=tm.join(this.dir,`${e}.json`);return q0("READ %s",t),Qo.readFileSync(t)}async loadRoot(){let t=this.trustedSet.root.signed.version+1,r=t+this.config.maxRootRotations;for(let s=t;s<r;s++){let n=Tu.join(this.metadataBaseUrl,`${s}.root.json`);try{let a=await this.fetcher.downloadBytes(n,this.config.rootMaxLength);this.trustedSet.updateRoot(a),this.persistMetadata(Li.MetadataKind.Root,a)}catch(a){if(a instanceof sn.DownloadHTTPError&&[403,404].includes(a.statusCode))break;throw a}}}async loadTimestamp({checkRemote:e}={checkRemote:!0}){try{let s=this.loadLocalMetadata(Li.MetadataKind.Timestamp);if(this.trustedSet.updateTimestamp(s),!e)return}catch{}let t=Tu.join(this.metadataBaseUrl,"timestamp.json"),r=await this.fetcher.downloadBytes(t,this.config.timestampMaxLength);try{this.trustedSet.updateTimestamp(r)}catch(s){if(s instanceof sn.EqualVersionError)return;throw s}this.persistMetadata(Li.MetadataKind.Timestamp,r)}async loadSnapshot(){try{let e=this.loadLocalMetadata(Li.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,r=t.length||this.config.snapshotMaxLength,s=this.trustedSet.root.signed.consistentSnapshot?t.version:void 0,n=Tu.join(this.metadataBaseUrl,s?`${s}.snapshot.json`:"snapshot.json");try{let a=await this.fetcher.downloadBytes(n,r);this.trustedSet.updateSnapshot(a),this.persistMetadata(Li.MetadataKind.Snapshot,a)}catch(a){throw new sn.RuntimeError(`Unable to load snapshot metadata error ${a}`)}}}async loadTargets(e,t){if(this.trustedSet.getRole(e))return this.trustedSet.getRole(e);try{let r=this.loadLocalMetadata(e);this.trustedSet.updateDelegatedTargets(r,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),u=Tu.join(this.metadataBaseUrl,a?`${a}.${c}.json`:`${c}.json`);try{let l=await this.fetcher.downloadBytes(u,n);this.trustedSet.updateDelegatedTargets(l,e,t),this.persistMetadata(e,l)}catch(l){throw new sn.RuntimeError(`Unable to load targets error ${l}`)}}return this.trustedSet.getRole(e)}async preorderDepthFirstWalk(e){let t=[{roleName:Li.MetadataKind.Targets,parentRoleName:Li.MetadataKind.Root}],r=new Set;for(;r.size<=this.config.maxDelegations&&t.length>0;){let{roleName:s,parentRoleName:n}=t.pop();if(r.has(s))continue;let a=(await this.loadTargets(s,n))?.signed;if(!a)continue;let c=a.targets?.[e];if(c)return c;if(r.add(s),a.delegations){let u=[],l=a.delegations.rolesForTarget(e);for(let{role:h,terminating:f}of l)if(u.push({roleName:h,parentRoleName:s}),f){t.splice(0);break}u.reverse(),t.push(...u)}}}generateTargetPath(e){if(!this.targetDir)throw new sn.ValueError("Target directory not set");let t=encodeURIComponent(e.path);return tm.join(this.targetDir,t)}persistMetadata(e,t){let r=encodeURIComponent(e);try{let s=tm.join(this.dir,`${r}.json`);q0("WRITE %s",s),Qo.writeFileSync(s,t.toString("utf8"))}catch(s){throw new sn.PersistError(`Failed to persist metadata ${r} error: ${s}`)}}};jt.Updater=V0});var xU=d(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.Updater=es.BaseFetcher=es.TargetFile=void 0;var Xoe=Jp();Object.defineProperty(es,"TargetFile",{enumerable:!0,get:o(function(){return Xoe.TargetFile},"get")});var Qoe=U0();Object.defineProperty(es,"BaseFetcher",{enumerable:!0,get:o(function(){return Qoe.BaseFetcher},"get")});var eae=DU();Object.defineProperty(es,"Updater",{enumerable:!0,get:o(function(){return eae.Updater},"get")})});var G0=d(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});im.TUFError=void 0;var H0=class extends Error{static{o(this,"TUFError")}constructor({code:e,message:t,cause:r}){super(t),this.code=e,this.cause=r,this.name=this.constructor.name}};im.TUFError=H0});var LU=d(Cu=>{"use strict";var tae=Cu&&Cu.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Cu,"__esModule",{value:!0});Cu.readTarget=rae;var iae=tae(require("fs")),rm=G0();async function rae(i,e){let t=await sae(i,e);return new Promise((r,s)=>{iae.default.readFile(t,"utf-8",(n,a)=>{n?s(new rm.TUFError({code:"TUF_READ_TARGET_ERROR",message:`error reading target ${t}`,cause:n})):r(a)})})}o(rae,"readTarget");async function sae(i,e){let t;try{t=await i.getTargetInfo(e)}catch(s){throw new rm.TUFError({code:"TUF_REFRESH_METADATA_ERROR",message:"error refreshing TUF metadata",cause:s})}if(!t)throw new rm.TUFError({code:"TUF_FIND_TARGET_ERROR",message:`target ${e} not found`});let r=await i.findCachedTarget(t);if(!r)try{r=await i.downloadTarget(t)}catch(s){throw new rm.TUFError({code:"TUF_DOWNLOAD_TARGET_ERROR",message:`error downloading target ${r}`,cause:s})}return r}o(sae,"getTargetPath")});var MU=d((N0e,nae)=>{nae.exports={"https://tuf-repo-cdn.sigstore.dev":{"root.json":"ewogInNpZ25hdHVyZXMiOiBbCiAgewogICAia2V5aWQiOiAiNmYyNjAwODlkNTkyM2RhZjIwMTY2Y2E2NTdjNTQzYWY2MTgzNDZhYjk3MTg4NGE5OTk2MmIwMTk4OGJiZTBjMyIsCiAgICJzaWciOiAiIgogIH0sCiAgewogICAia2V5aWQiOiAiZTcxYTU0ZDU0MzgzNWJhODZhZGFkOTQ2MDM3OWM3NjQxZmI4NzI2ZDE2NGVhNzY2ODAxYTFjNTIyYWJhN2VhMiIsCiAgICJzaWciOiAiMzA0NTAyMjEwMGJiZGRkNDY0ZjgwNjZjZWI4OGJhNzg3Mzc1YzEyY2Q2MzMwNjgwZTA4YzI5MTA3MDNlNjUzOGM3MWNjNzlhZDIwMjIwNTE5MGIwNmU0NTM3ZmU5NjFiM2VmODFmZTY4ZWRjZDAwODljMTlmOTE5YWZlZDQyM2I5YWFmZDcwMDY0MTE1MyIKICB9LAogIHsKICAgImtleWlkIjogIjIyZjRjYWVjNmQ4ZTZmOTU1NWFmNjZiM2Q0YzNjYjA2YTNiYjIzZmRjN2UzOWM5MTZjNjFmNDYyZTZmNTJiMDYiLAogICAic2lnIjogIjMwNDQwMjIwNjkzMDZjZDUyNTdmNzMyYTc0MGMxYWZlNjBhOGU0MzNjNWRlNThlYWZlYWRiZTk5YzMzNmM5YzcxZDE5OGNmODAyMjAwZDc3Mzk1M2FlN2RiYzQ4ZDNlNWJhZDlhNmY2NGJhZmZmMTk2YjdlMmFkNGE1MmExOTUxOTM2N2Q0N2RjMDQyIgogIH0sCiAgewogICAia2V5aWQiOiAiNjE2NDM4MzgxMjViNDQwYjQwZGI2OTQyZjVjYjVhMzFjMGRjMDQzNjgzMTZlYjJhYWE1OGI5NTkwNGE1ODIyMiIsCiAgICJzaWciOiAiMzA0NDAyMjA0ZDIxYTJlYzgwZGY2NmU2MWY2ZmUyOTEyOTUxZGM0N2RmODM2MDM2ZjhjMGFiMTA4MTZkMzc1ZTcxZGJmNzllMDIyMDU0N2FkY2UxYWZkZjA0ZTY3OTRlZmEyMDNkZDUyNjRjNmY3ZTBlZjc4ZTU3ZmU5MzRiMGQyNmNiOTk0ZWVjNzYiCiAgfSwKICB7CiAgICJrZXlpZCI6ICJhNjg3ZTViZjRmYWI4MmIwZWU1OGQ0NmUwNWM5NTM1MTQ1YTJjOWFmYjQ1OGY0M2Q0MmI0NWNhMGZkY2UyYTcwIiwKICAgInNpZyI6ICIzMDQ1MDIyMDYwODI2NDk2NTU3MTQ0ZWIxNjQ5ODkzZWQ1ZjZmNGVhNTQ1MzZmZWIwY2E4MmY4Yjg5YWU2NDFiZTM5NzQzZTUwMjIxMDBhZDcxMThiNWU5ZDQ4MzczMjYyMDZlNDEyZmM2ZGEyOTk5OTI1ZDExMDMyOGE3YzE2NmIwNmM2MjQzMzZjOTNmIgogIH0sCiAgewogICAia2V5aWQiOiAiMTgzZTY0ZjM3NjcwZGMxM2NhMGQyODk5NWEzMDUzZjM3NDA5NTRkZGNlNDQzMjFhNDFlNDY1MzRjZjQ0ZTYzMiIsCiAgICJzaWciOiAiMzA0NjAyMjEwMGQ4MTc5NDM5YzJlNzNlYjBjMTczM2FiZWU3ZmFmODMyZGNhZWE3MjYzZWRjYjQ5MTk4OTFjM2EyNDdmMDU5MjMwMjIxMDBlMWE0MzdlMDc5N2U4MDNmOWI3MmRjOWQyZDkyMTU1YjBhMjI3MGMyNGVmZGQ1ZjRiM2E1ZDhmMGIwZjQzMWE3IgogIH0KIF0sCiAic2lnbmVkIjogewogICJfdHlwZSI6ICJyb290IiwKICAiY29uc2lzdGVudF9zbmFwc2hvdCI6IHRydWUsCiAgImV4cGlyZXMiOiAiMjAyNi0wMS0yMlQxMzowNTo1OVoiLAogICJrZXlzIjogewogICAiMGM4NzQzMmMzYmYwOWZkOTkxODlmZGMzMmZhNWVhZWRmNGU0YTVmYWM3YmFiNzNmYTA0YTJlMGZjNjRhZjZmNSI6IHsKICAgICJrZXlpZF9oYXNoX2FsZ29yaXRobXMiOiBbCiAgICAgInNoYTI1NiIsCiAgICAgInNoYTUxMiIKICAgIF0sCiAgICAia2V5dHlwZSI6ICJlY2RzYSIsCiAgICAia2V5dmFsIjogewogICAgICJwdWJsaWMiOiAiLS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS1cbk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRVdSaUdyNStqKzNKNVNzSCtadHI1bkUySDJ3TzdcbkJWK25PM3M5M2dMY2ExOHFUT3pIWTFvV3lBR0R5a01Tc0dUVUJTdDlEK0FuMEtmS3NEMm1mU000MlE9PVxuLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tXG4iCiAgICB9LAogICAgInNjaGVtZSI6ICJlY2RzYS1zaGEyLW5pc3RwMjU2IiwKICAgICJ4LXR1Zi1vbi1jaS1vbmxpbmUtdXJpIjogImdjcGttczpwcm9qZWN0cy9zaWdzdG9yZS1yb290LXNpZ25pbmcvbG9jYXRpb25zL2dsb2JhbC9rZXlSaW5ncy9yb290L2NyeXB0b0tleXMvdGltZXN0YW1wL2NyeXB0b0tleVZlcnNpb25zLzEiCiAgIH0sCiAgICIxODNlNjRmMzc2NzBkYzEzY2EwZDI4OTk1YTMwNTNmMzc0MDk1NGRkY2U0NDMyMWE0MWU0NjUzNGNmNDRlNjMyIjogewogICAgImtleXR5cGUiOiAiZWNkc2EiLAogICAgImtleXZhbCI6IHsKICAgICAicHVibGljIjogIi0tLS0tQkVHSU4gUFVCTElDIEtFWS0tLS0tXG5NRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUVNeHBQT0pDSVo1b3RHNDEwNmZHSnNlRVFpM1Y5XG5wa01ZUTR1eVY5VGoxTTdXSFhJeUxHK2prZnZ1RzBnbFExSlpiUlpaQlYzZ0FSNHNvamRHSElTZW93PT1cbi0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLVxuIgogICAgfSwKICAgICJzY2hlbWUiOiAiZWNkc2Etc2hhMi1uaXN0cDI1NiIsCiAgICAieC10dWYtb24tY2kta2V5b3duZXIiOiAiQGxhbmNlIgogICB9LAogICAiMjJmNGNhZWM2ZDhlNmY5NTU1YWY2NmIzZDRjM2NiMDZhM2JiMjNmZGM3ZTM5YzkxNmM2MWY0NjJlNmY1MmIwNiI6IHsKICAgICJrZXlpZF9oYXNoX2FsZ29yaXRobXMiOiBbCiAgICAgInNoYTI1NiIsCiAgICAgInNoYTUxMiIKICAgIF0sCiAgICAia2V5dHlwZSI6ICJlY2RzYSIsCiAgICAia2V5dmFsIjogewogICAgICJwdWJsaWMiOiAiLS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS1cbk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRXpCelZPbUhDUG9qTVZMU0kzNjRXaWlWOE5QckRcbjZJZ1J4Vmxpc2t6L3YreTNKRVI1bWNWR2NPTmxpRGNXTUM1SjJsZkhtalBOUGhiNEg3eG04THpmU0E9PVxuLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tXG4iCiAgICB9LAogICAgInNjaGVtZSI6ICJlY2RzYS1zaGEyLW5pc3RwMjU2IiwKICAgICJ4LXR1Zi1vbi1jaS1rZXlvd25lciI6ICJAc2FudGlhZ290b3JyZXMiCiAgIH0sCiAgICI2MTY0MzgzODEyNWI0NDBiNDBkYjY5NDJmNWNiNWEzMWMwZGMwNDM2ODMxNmViMmFhYTU4Yjk1OTA0YTU4MjIyIjogewogICAgImtleWlkX2hhc2hfYWxnb3JpdGhtcyI6IFsKICAgICAic2hhMjU2IiwKICAgICAic2hhNTEyIgogICAgXSwKICAgICJrZXl0eXBlIjogImVjZHNhIiwKICAgICJrZXl2YWwiOiB7CiAgICAgInB1YmxpYyI6ICItLS0tLUJFR0lOIFBVQkxJQyBLRVktLS0tLVxuTUZrd0V3WUhLb1pJemowQ0FRWUlLb1pJemowREFRY0RRZ0FFaW5pa1NzQVFtWWtOZUg1ZVlxL0NuSXpMYWFjT1xueGxTYWF3UURPd3FLeS90Q3F4cTV4eFBTSmMyMUs0V0loczlHeU9rS2Z6dWVZM0dJTHpjTUpaNGNXdz09XG4tLS0tLUVORCBQVUJMSUMgS0VZLS0tLS1cbiIKICAgIH0sCiAgICAic2NoZW1lIjogImVjZHNhLXNoYTItbmlzdHAyNTYiLAogICAgIngtdHVmLW9uLWNpLWtleW93bmVyIjogIkBib2JjYWxsYXdheSIKICAgfSwKICAgImE2ODdlNWJmNGZhYjgyYjBlZTU4ZDQ2ZTA1Yzk1MzUxNDVhMmM5YWZiNDU4ZjQzZDQyYjQ1Y2EwZmRjZTJhNzAiOiB7CiAgICAia2V5aWRfaGFzaF9hbGdvcml0aG1zIjogWwogICAgICJzaGEyNTYiLAogICAgICJzaGE1MTIiCiAgICBdLAogICAgImtleXR5cGUiOiAiZWNkc2EiLAogICAgImtleXZhbCI6IHsKICAgICAicHVibGljIjogIi0tLS0tQkVHSU4gUFVCTElDIEtFWS0tLS0tXG5NRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUUwZ2hyaDkyTHcxWXIzaWRHVjVXcUN0TURCOEN4XG4rRDhoZEM0dzJaTE5JcGxWUm9WR0xza1lhM2doZU15T2ppSjhrUGkxNWFRMi8vN1Arb2o3VXZKUEd3PT1cbi0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLVxuIgogICAgfSwKICAgICJzY2hlbWUiOiAiZWNkc2Etc2hhMi1uaXN0cDI1NiIsCiAgICAieC10dWYtb24tY2kta2V5b3duZXIiOiAiQGpvc2h1YWdsIgogICB9LAogICAiZTcxYTU0ZDU0MzgzNWJhODZhZGFkOTQ2MDM3OWM3NjQxZmI4NzI2ZDE2NGVhNzY2ODAxYTFjNTIyYWJhN2VhMiI6IHsKICAgICJrZXlpZF9oYXNoX2FsZ29yaXRobXMiOiBbCiAgICAgInNoYTI1NiIsCiAgICAgInNoYTUxMiIKICAgIF0sCiAgICAia2V5dHlwZSI6ICJlY2RzYSIsCiAgICAia2V5dmFsIjogewogICAgICJwdWJsaWMiOiAiLS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS1cbk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRUVYc3ozU1pYRmI4ak1WNDJqNnBKbHlqYmpSOEtcbk4zQndvY2V4cTZMTUliNXFzV0tPUXZMTjE2TlVlZkxjNEhzd09vdW1Sc1ZWYWFqU3BRUzZmb2JrUnc9PVxuLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tXG4iCiAgICB9LAogICAgInNjaGVtZSI6ICJlY2RzYS1zaGEyLW5pc3RwMjU2IiwKICAgICJ4LXR1Zi1vbi1jaS1rZXlvd25lciI6ICJAbW5tNjc4IgogICB9CiAgfSwKICAicm9sZXMiOiB7CiAgICJyb290IjogewogICAgImtleWlkcyI6IFsKICAgICAiZTcxYTU0ZDU0MzgzNWJhODZhZGFkOTQ2MDM3OWM3NjQxZmI4NzI2ZDE2NGVhNzY2ODAxYTFjNTIyYWJhN2VhMiIsCiAgICAgIjIyZjRjYWVjNmQ4ZTZmOTU1NWFmNjZiM2Q0YzNjYjA2YTNiYjIzZmRjN2UzOWM5MTZjNjFmNDYyZTZmNTJiMDYiLAogICAgICI2MTY0MzgzODEyNWI0NDBiNDBkYjY5NDJmNWNiNWEzMWMwZGMwNDM2ODMxNmViMmFhYTU4Yjk1OTA0YTU4MjIyIiwKICAgICAiYTY4N2U1YmY0ZmFiODJiMGVlNThkNDZlMDVjOTUzNTE0NWEyYzlhZmI0NThmNDNkNDJiNDVjYTBmZGNlMmE3MCIsCiAgICAgIjE4M2U2NGYzNzY3MGRjMTNjYTBkMjg5OTVhMzA1M2YzNzQwOTU0ZGRjZTQ0MzIxYTQxZTQ2NTM0Y2Y0NGU2MzIiCiAgICBdLAogICAgInRocmVzaG9sZCI6IDMKICAgfSwKICAgInNuYXBzaG90IjogewogICAgImtleWlkcyI6IFsKICAgICAiMGM4NzQzMmMzYmYwOWZkOTkxODlmZGMzMmZhNWVhZWRmNGU0YTVmYWM3YmFiNzNmYTA0YTJlMGZjNjRhZjZmNSIKICAgIF0sCiAgICAidGhyZXNob2xkIjogMSwKICAgICJ4LXR1Zi1vbi1jaS1leHBpcnktcGVyaW9kIjogMzY1MCwKICAgICJ4LXR1Zi1vbi1jaS1zaWduaW5nLXBlcmlvZCI6IDM2NQogICB9LAogICAidGFyZ2V0cyI6IHsKICAgICJrZXlpZHMiOiBbCiAgICAgImU3MWE1NGQ1NDM4MzViYTg2YWRhZDk0NjAzNzljNzY0MWZiODcyNmQxNjRlYTc2NjgwMWExYzUyMmFiYTdlYTIiLAogICAgICIyMmY0Y2FlYzZkOGU2Zjk1NTVhZjY2YjNkNGMzY2IwNmEzYmIyM2ZkYzdlMzljOTE2YzYxZjQ2MmU2ZjUyYjA2IiwKICAgICAiNjE2NDM4MzgxMjViNDQwYjQwZGI2OTQyZjVjYjVhMzFjMGRjMDQzNjgzMTZlYjJhYWE1OGI5NTkwNGE1ODIyMiIsCiAgICAgImE2ODdlNWJmNGZhYjgyYjBlZTU4ZDQ2ZTA1Yzk1MzUxNDVhMmM5YWZiNDU4ZjQzZDQyYjQ1Y2EwZmRjZTJhNzAiLAogICAgICIxODNlNjRmMzc2NzBkYzEzY2EwZDI4OTk1YTMwNTNmMzc0MDk1NGRkY2U0NDMyMWE0MWU0NjUzNGNmNDRlNjMyIgogICAgXSwKICAgICJ0aHJlc2hvbGQiOiAzCiAgIH0sCiAgICJ0aW1lc3RhbXAiOiB7CiAgICAia2V5aWRzIjogWwogICAgICIwYzg3NDMyYzNiZjA5ZmQ5OTE4OWZkYzMyZmE1ZWFlZGY0ZTRhNWZhYzdiYWI3M2ZhMDRhMmUwZmM2NGFmNmY1IgogICAgXSwKICAgICJ0aHJlc2hvbGQiOiAxLAogICAgIngtdHVmLW9uLWNpLWV4cGlyeS1wZXJpb2QiOiA3LAogICAgIngtdHVmLW9uLWNpLXNpZ25pbmctcGVyaW9kIjogNgogICB9CiAgfSwKICAic3BlY192ZXJzaW9uIjogIjEuMCIsCiAgInZlcnNpb24iOiAxMywKICAieC10dWYtb24tY2ktZXhwaXJ5LXBlcmlvZCI6IDE5NywKICAieC10dWYtb24tY2ktc2lnbmluZy1wZXJpb2QiOiA0NgogfQp9",targets:{"trusted_root.json":"ewogICJtZWRpYVR5cGUiOiAiYXBwbGljYXRpb24vdm5kLmRldi5zaWdzdG9yZS50cnVzdGVkcm9vdCtqc29uO3ZlcnNpb249MC4xIiwKICAidGxvZ3MiOiBbCiAgICB7CiAgICAgICJiYXNlVXJsIjogImh0dHBzOi8vcmVrb3Iuc2lnc3RvcmUuZGV2IiwKICAgICAgImhhc2hBbGdvcml0aG0iOiAiU0hBMl8yNTYiLAogICAgICAicHVibGljS2V5IjogewogICAgICAgICJyYXdCeXRlcyI6ICJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUUyRzJZKzJ0YWJkVFY1QmNHaUJJeDBhOWZBRndya0JibUxTR3RrczRMM3FYNnlZWTB6dWZCbmhDOFVyL2l5NTVHaFdQLzlBL2JZMkxoQzMwTTkrUll0dz09IiwKICAgICAgICAia2V5RGV0YWlscyI6ICJQS0lYX0VDRFNBX1AyNTZfU0hBXzI1NiIsCiAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgInN0YXJ0IjogIjIwMjEtMDEtMTJUMTE6NTM6MjdaIgogICAgICAgIH0KICAgICAgfSwKICAgICAgImxvZ0lkIjogewogICAgICAgICJrZXlJZCI6ICJ3Tkk5YXRRR2x6K1ZXZk82TFJ5Z0g0UVVmWS84VzRSRndpVDVpNVdSZ0IwPSIKICAgICAgfQogICAgfQogIF0sCiAgImNlcnRpZmljYXRlQXV0aG9yaXRpZXMiOiBbCiAgICB7CiAgICAgICJzdWJqZWN0IjogewogICAgICAgICJvcmdhbml6YXRpb24iOiAic2lnc3RvcmUuZGV2IiwKICAgICAgICAiY29tbW9uTmFtZSI6ICJzaWdzdG9yZSIKICAgICAgfSwKICAgICAgInVyaSI6ICJodHRwczovL2Z1bGNpby5zaWdzdG9yZS5kZXYiLAogICAgICAiY2VydENoYWluIjogewogICAgICAgICJjZXJ0aWZpY2F0ZXMiOiBbCiAgICAgICAgICB7CiAgICAgICAgICAgICJyYXdCeXRlcyI6ICJNSUlCK0RDQ0FYNmdBd0lCQWdJVE5Wa0Rab0Npb2ZQRHN5N2RmbTZnZUxidWh6QUtCZ2dxaGtqT1BRUURBekFxTVJVd0V3WURWUVFLRXd4emFXZHpkRzl5WlM1a1pYWXhFVEFQQmdOVkJBTVRDSE5wWjNOMGIzSmxNQjRYRFRJeE1ETXdOekF6TWpBeU9Wb1hEVE14TURJeU16QXpNakF5T1Zvd0tqRVZNQk1HQTFVRUNoTU1jMmxuYzNSdmNtVXVaR1YyTVJFd0R3WURWUVFERXdoemFXZHpkRzl5WlRCMk1CQUdCeXFHU000OUFnRUdCU3VCQkFBaUEySUFCTFN5QTdJaTVrK3BOTzhaRVdZMHlsZW1XRG93T2tOYTNrTCtHWkU1WjVHV2VoTDkvQTliUk5BM1JicnNaNWkwSmNhc3RhUkw3U3A1ZnAvakQ1ZHhxYy9VZFRWbmx2UzE2YW4rMllmc3dlL1F1TG9sUlVDcmNPRTIrMmlBNSt0emQ2Tm1NR1F3RGdZRFZSMFBBUUgvQkFRREFnRUdNQklHQTFVZEV3RUIvd1FJTUFZQkFmOENBUUV3SFFZRFZSME9CQllFRk1qRkhRQkJtaVFwTWxFazZ3MnVTdTFLQnRQc01COEdBMVVkSXdRWU1CYUFGTWpGSFFCQm1pUXBNbEVrNncydVN1MUtCdFBzTUFvR0NDcUdTTTQ5QkFNREEyZ0FNR1VDTUg4bGlXSmZNdWk2dlhYQmhqRGdZNE13c2xtTi9USnhWZS84M1dyRm9td21OZjA1NnkxWDQ4RjljNG0zYTNvelhBSXhBS2pSYXk1L2FqL2pzS0tHSWttUWF0akk4dXVwSHIvK0N4RnZhSldtcFlxTmtMREdSVSs5b3J6aDVoSTJScmN1YVE9PSIKICAgICAgICAgIH0KICAgICAgICBdCiAgICAgIH0sCiAgICAgICJ2YWxpZEZvciI6IHsKICAgICAgICAic3RhcnQiOiAiMjAyMS0wMy0wN1QwMzoyMDoyOVoiLAogICAgICAgICJlbmQiOiAiMjAyMi0xMi0zMVQyMzo1OTo1OS45OTlaIgogICAgICB9CiAgICB9LAogICAgewogICAgICAic3ViamVjdCI6IHsKICAgICAgICAib3JnYW5pemF0aW9uIjogInNpZ3N0b3JlLmRldiIsCiAgICAgICAgImNvbW1vbk5hbWUiOiAic2lnc3RvcmUiCiAgICAgIH0sCiAgICAgICJ1cmkiOiAiaHR0cHM6Ly9mdWxjaW8uc2lnc3RvcmUuZGV2IiwKICAgICAgImNlcnRDaGFpbiI6IHsKICAgICAgICAiY2VydGlmaWNhdGVzIjogWwogICAgICAgICAgewogICAgICAgICAgICAicmF3Qnl0ZXMiOiAiTUlJQ0dqQ0NBYUdnQXdJQkFnSVVBTG5WaVZmblUwYnJKYXNtUmtIcm4vVW5mYVF3Q2dZSUtvWkl6ajBFQXdNd0tqRVZNQk1HQTFVRUNoTU1jMmxuYzNSdmNtVXVaR1YyTVJFd0R3WURWUVFERXdoemFXZHpkRzl5WlRBZUZ3MHlNakEwTVRNeU1EQTJNVFZhRncwek1URXdNRFV4TXpVMk5UaGFNRGN4RlRBVEJnTlZCQW9UREhOcFozTjBiM0psTG1SbGRqRWVNQndHQTFVRUF4TVZjMmxuYzNSdmNtVXRhVzUwWlhKdFpXUnBZWFJsTUhZd0VBWUhLb1pJemowQ0FRWUZLNEVFQUNJRFlnQUU4UlZTL3lzSCtOT3Z1RFp5UEladGlsZ1VGOU5sYXJZcEFkOUhQMXZCQkgxVTVDVjc3TFNTN3MwWmlING5FN0h2N3B0UzZMdnZSL1NUazc5OExWZ016TGxKNEhlSWZGM3RIU2FleExjWXBTQVNyMWtTME4vUmdCSnovOWpXQ2lYbm8zc3dlVEFPQmdOVkhROEJBZjhFQkFNQ0FRWXdFd1lEVlIwbEJBd3dDZ1lJS3dZQkJRVUhBd013RWdZRFZSMFRBUUgvQkFnd0JnRUIvd0lCQURBZEJnTlZIUTRFRmdRVTM5UHB6MVlrRVpiNXFOanBLRldpeGk0WVpEOHdId1lEVlIwakJCZ3dGb0FVV01BZVg1RkZwV2FwZXN5UW9aTWkwQ3JGeGZvd0NnWUlLb1pJemowRUF3TURad0F3WkFJd1BDc1FLNERZaVpZRFBJYURpNUhGS25meFh4NkFTU1ZtRVJmc3luWUJpWDJYNlNKUm5aVTg0LzlEWmRuRnZ2eG1BakJPdDZRcEJsYzRKLzBEeHZrVENxcGNsdnppTDZCQ0NQbmpkbElCM1B1M0J4c1BteWdVWTdJaTJ6YmRDZGxpaW93PSIKICAgICAgICAgIH0sCiAgICAgICAgICB7CiAgICAgICAgICAgICJyYXdCeXRlcyI6ICJNSUlCOXpDQ0FYeWdBd0lCQWdJVUFMWk5BUEZkeEhQd2plRGxvRHd5WUNoQU8vNHdDZ1lJS29aSXpqMEVBd013S2pFVk1CTUdBMVVFQ2hNTWMybG5jM1J2Y21VdVpHVjJNUkV3RHdZRFZRUURFd2h6YVdkemRHOXlaVEFlRncweU1URXdNRGN4TXpVMk5UbGFGdzB6TVRFd01EVXhNelUyTlRoYU1Db3hGVEFUQmdOVkJBb1RESE5wWjNOMGIzSmxMbVJsZGpFUk1BOEdBMVVFQXhNSWMybG5jM1J2Y21Vd2RqQVFCZ2NxaGtqT1BRSUJCZ1VyZ1FRQUlnTmlBQVQ3WGVGVDRyYjNQUUd3UzRJYWp0TGszL09sbnBnYW5nYUJjbFlwc1lCcjVpKzR5bkIwN2NlYjNMUDBPSU9aZHhleFg2OWM1aVZ1eUpSUStIejA1eWkrVUYzdUJXQWxIcGlTNXNoMCtIMkdIRTdTWHJrMUVDNW0xVHIxOUw5Z2c5MmpZekJoTUE0R0ExVWREd0VCL3dRRUF3SUJCakFQQmdOVkhSTUJBZjhFQlRBREFRSC9NQjBHQTFVZERnUVdCQlJZd0I1ZmtVV2xacWw2ekpDaGt5TFFLc1hGK2pBZkJnTlZIU01FR0RBV2dCUll3QjVma1VXbFpxbDZ6SkNoa3lMUUtzWEYrakFLQmdncWhrak9QUVFEQXdOcEFEQm1BakVBajFuSGVYWnArMTNOV0JOYStFRHNEUDhHMVdXZzF0Q01XUC9XSFBxcGFWbzBqaHN3ZU5GWmdTczBlRTd3WUk0cUFqRUEyV0I5b3Q5OHNJa29GM3ZaWWRkMy9WdFdCNWI5VE5NZWE3SXgvc3RKNVRmY0xMZUFCTEU0Qk5KT3NRNHZuQkhKIgogICAgICAgICAgfQogICAgICAgIF0KICAgICAgfSwKICAgICAgInZhbGlkRm9yIjogewogICAgICAgICJzdGFydCI6ICIyMDIyLTA0LTEzVDIwOjA2OjE1WiIKICAgICAgfQogICAgfQogIF0sCiAgImN0bG9ncyI6IFsKICAgIHsKICAgICAgImJhc2VVcmwiOiAiaHR0cHM6Ly9jdGZlLnNpZ3N0b3JlLmRldi90ZXN0IiwKICAgICAgImhhc2hBbGdvcml0aG0iOiAiU0hBMl8yNTYiLAogICAgICAicHVibGljS2V5IjogewogICAgICAgICJyYXdCeXRlcyI6ICJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUViZndSK1JKdWRYc2NnUkJScEtYMVhGRHkzUHl1ZER4ei9TZm5SaTFmVDhla3BmQmQyTzF1b3o3anIzWjhuS3p4QTY5RVVRK2VGQ0ZJM3pldWJQV1U3dz09IiwKICAgICAgICAia2V5RGV0YWlscyI6ICJQS0lYX0VDRFNBX1AyNTZfU0hBXzI1NiIsCiAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgInN0YXJ0IjogIjIwMjEtMDMtMTRUMDA6MDA6MDBaIiwKICAgICAgICAgICJlbmQiOiAiMjAyMi0xMC0zMVQyMzo1OTo1OS45OTlaIgogICAgICAgIH0KICAgICAgfSwKICAgICAgImxvZ0lkIjogewogICAgICAgICJrZXlJZCI6ICJDR0NTOENoUy8yaEYwZEZySjRTY1JXY1lyQlk5d3pqU2JlYThJZ1kyYjNJPSIKICAgICAgfQogICAgfSwKICAgIHsKICAgICAgImJhc2VVcmwiOiAiaHR0cHM6Ly9jdGZlLnNpZ3N0b3JlLmRldi8yMDIyIiwKICAgICAgImhhc2hBbGdvcml0aG0iOiAiU0hBMl8yNTYiLAogICAgICAicHVibGljS2V5IjogewogICAgICAgICJyYXdCeXRlcyI6ICJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUVpUFNsRmkwQ21GVGZFakNVcUY5SHVDRWNZWE5LQWFZYWxJSm1CWjh5eWV6UGpUcWh4cktCcE1uYW9jVnRMSkJJMWVNM3VYblF6UUdBSmRKNGdzOUZ5dz09IiwKICAgICAgICAia2V5RGV0YWlscyI6ICJQS0lYX0VDRFNBX1AyNTZfU0hBXzI1NiIsCiAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgInN0YXJ0IjogIjIwMjItMTAtMjBUMDA6MDA6MDBaIgogICAgICAgIH0KICAgICAgfSwKICAgICAgImxvZ0lkIjogewogICAgICAgICJrZXlJZCI6ICIzVDB3YXNiSEVUSmpHUjRjbVdjM0FxSktYcmplUEszL2g0cHlnQzhwN280PSIKICAgICAgfQogICAgfQogIF0sCiAgInRpbWVzdGFtcEF1dGhvcml0aWVzIjogWwogICAgewogICAgICAic3ViamVjdCI6IHsKICAgICAgICAib3JnYW5pemF0aW9uIjogInNpZ3N0b3JlLmRldiIsCiAgICAgICAgImNvbW1vbk5hbWUiOiAic2lnc3RvcmUtdHNhLXNlbGZzaWduZWQiCiAgICAgIH0sCiAgICAgICJ1cmkiOiAiaHR0cHM6Ly90aW1lc3RhbXAuc2lnc3RvcmUuZGV2L2FwaS92MS90aW1lc3RhbXAiLAogICAgICAiY2VydENoYWluIjogewogICAgICAgICJjZXJ0aWZpY2F0ZXMiOiBbCiAgICAgICAgICB7CiAgICAgICAgICAgICJyYXdCeXRlcyI6ICJNSUlDRURDQ0FaYWdBd0lCQWdJVU9oTlVMd3lRWWU2OHdVTXZ5NHFPaXlvaml3d3dDZ1lJS29aSXpqMEVBd013T1RFVk1CTUdBMVVFQ2hNTWMybG5jM1J2Y21VdVpHVjJNU0F3SGdZRFZRUURFeGR6YVdkemRHOXlaUzEwYzJFdGMyVnNabk5wWjI1bFpEQWVGdzB5TlRBME1EZ3dOalU1TkROYUZ3MHpOVEEwTURZd05qVTVORE5hTUM0eEZUQVRCZ05WQkFvVERITnBaM04wYjNKbExtUmxkakVWTUJNR0ExVUVBeE1NYzJsbmMzUnZjbVV0ZEhOaE1IWXdFQVlIS29aSXpqMENBUVlGSzRFRUFDSURZZ0FFNHJhMlo4aEtOaWcyVDlrRmpDQVRvR0czMGpreStXUXYzQnpMK21LdmgxU0tOUi9Vd3V3c2ZOQ2c0c3J5b1lBZDhFNmlzb3ZWQTNNNGFvTmRtOVFEaTUwWjhuVEV5dnFnZkRQdFRJd1hJdGZpVy9BRmYxVjd1d2tia0FvajB4eGNvMm93YURBT0JnTlZIUThCQWY4RUJBTUNCNEF3SFFZRFZSME9CQllFRkluOWVVT0h6OUJsUnNNQ1JzY3NjMXQ5dE9zRE1COEdBMVVkSXdRWU1CYUFGSmpzQWU5L3UxSC8xSlVlYjRxSW1GTUhpYzYvTUJZR0ExVWRKUUVCL3dRTU1Bb0dDQ3NHQVFVRkJ3TUlNQW9HQ0NxR1NNNDlCQU1EQTJnQU1HVUNNRHRwc1YvNkthTzBxeUYvVU1zWDJhU1VYS1FGZG9HVHB0UUdjMGZ0cTFjc3VsSFBHRzZkc215TU5kM0pCK0czRVFJeEFPYWp2QmNqcEptS2I0TnYrMlRhb2o4VWM1K2I2aWg2RlhDQ0tyYVNxdXBlMDd6cXN3TWNYSlRlMWNFeHZIdnZsdz09IgogICAgICAgICAgfSwKICAgICAgICAgIHsKICAgICAgICAgICAgInJhd0J5dGVzIjogIk1JSUI5ekNDQVh5Z0F3SUJBZ0lVVjdmMEdMRE9vRXpJaDhMWFNXODBPSmlVcDE0d0NnWUlLb1pJemowRUF3TXdPVEVWTUJNR0ExVUVDaE1NYzJsbmMzUnZjbVV1WkdWMk1TQXdIZ1lEVlFRREV4ZHphV2R6ZEc5eVpTMTBjMkV0YzJWc1puTnBaMjVsWkRBZUZ3MHlOVEEwTURnd05qVTVORE5hRncwek5UQTBNRFl3TmpVNU5ETmFNRGt4RlRBVEJnTlZCQW9UREhOcFozTjBiM0psTG1SbGRqRWdNQjRHQTFVRUF4TVhjMmxuYzNSdmNtVXRkSE5oTFhObGJHWnphV2R1WldRd2RqQVFCZ2NxaGtqT1BRSUJCZ1VyZ1FRQUlnTmlBQVFVUU50ZlJUL291M1lBVGE2d0Iva0tUZTcwY2ZKd3lSSUJvdk1udDhSY0pwaC9DT0U4MnV5UzZGbXBwTExMMVZCUEdjUGZwUVBZSk5Yeld3aThpY3doS1E2Vy9RZTJoM29lYkJiMkZIcHdOSkRxbytUTWFDL3RkZmt2L0VsSkI3MmpSVEJETUE0R0ExVWREd0VCL3dRRUF3SUJCakFTQmdOVkhSTUJBZjhFQ0RBR0FRSC9BZ0VBTUIwR0ExVWREZ1FXQkJTWTdBSHZmN3RSLzlTVkhtK0tpSmhUQjRuT3Z6QUtCZ2dxaGtqT1BRUURBd05wQURCbUFqRUF3R0VHcmZHWlIxY2VuMVI4L0RUVk1JOTQzTHNzWm1KUnREcC9pN1NmR0htR1JQNmdSYnVqOXZPSzNiNjdaMFFRQWpFQXVUMkg2NzNMUUVhSFRjeVFTWnJrcDRtWDdXd2ttRitzVmJrWVk1bVhOK1JNSDEzS1VFSEhPcUFTYWVtWVdLL0UiCiAgICAgICAgICB9CiAgICAgICAgXQogICAgICB9LAogICAgICAidmFsaWRGb3IiOiB7CiAgICAgICAgInN0YXJ0IjogIjIwMjUtMDctMDRUMDA6MDA6MDBaIgogICAgICB9CiAgICB9CiAgXQp9Cg==","registry.npmjs.org%2Fkeys.json":"ewogICAgImtleXMiOiBbCiAgICAgICAgewogICAgICAgICAgICAia2V5SWQiOiAiU0hBMjU2OmpsM2J3c3d1ODBQampva0NnaDBvMnc1YzJVNExoUUFFNTdnajljejFrekEiLAogICAgICAgICAgICAia2V5VXNhZ2UiOiAibnBtOnNpZ25hdHVyZXMiLAogICAgICAgICAgICAicHVibGljS2V5IjogewogICAgICAgICAgICAgICAgInJhd0J5dGVzIjogIk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRTFPbGIzek1BRkZ4WEtIaUlrUU81Y0ozWWhsNWk2VVBwK0lodXRlQkpidUhjQTVVb2dLbzBFV3RsV3dXNktTYUtvVE5FWUw3SmxDUWlWbmtoQmt0VWdnPT0iLAogICAgICAgICAgICAgICAgImtleURldGFpbHMiOiAiUEtJWF9FQ0RTQV9QMjU2X1NIQV8yNTYiLAogICAgICAgICAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgICAgICAgICAgICJzdGFydCI6ICIxOTk5LTAxLTAxVDAwOjAwOjAwLjAwMFoiLAogICAgICAgICAgICAgICAgICAgICJlbmQiOiAiMjAyNS0wMS0yOVQwMDowMDowMC4wMDBaIgogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgfSwKICAgICAgICB7CiAgICAgICAgICAgICJrZXlJZCI6ICJTSEEyNTY6amwzYndzd3U4MFBqam9rQ2doMG8ydzVjMlU0TGhRQUU1N2dqOWN6MWt6QSIsCiAgICAgICAgICAgICJrZXlVc2FnZSI6ICJucG06YXR0ZXN0YXRpb25zIiwKICAgICAgICAgICAgInB1YmxpY0tleSI6IHsKICAgICAgICAgICAgICAgICJyYXdCeXRlcyI6ICJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUUxT2xiM3pNQUZGeFhLSGlJa1FPNWNKM1lobDVpNlVQcCtJaHV0ZUJKYnVIY0E1VW9nS28wRVd0bFd3VzZLU2FLb1RORVlMN0psQ1FpVm5raEJrdFVnZz09IiwKICAgICAgICAgICAgICAgICJrZXlEZXRhaWxzIjogIlBLSVhfRUNEU0FfUDI1Nl9TSEFfMjU2IiwKICAgICAgICAgICAgICAgICJ2YWxpZEZvciI6IHsKICAgICAgICAgICAgICAgICAgICAic3RhcnQiOiAiMjAyMi0xMi0wMVQwMDowMDowMC4wMDBaIiwKICAgICAgICAgICAgICAgICAgICAiZW5kIjogIjIwMjUtMDEtMjlUMDA6MDA6MDAuMDAwWiIKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0sCiAgICAgICAgewogICAgICAgICAgICAia2V5SWQiOiAiU0hBMjU2OkRoUTh3UjVBUEJ2RkhMRi8rVGMrQVl2UE9kVHBjSURxT2h4c0JIUndDN1UiLAogICAgICAgICAgICAia2V5VXNhZ2UiOiAibnBtOnNpZ25hdHVyZXMiLAogICAgICAgICAgICAicHVibGljS2V5IjogewogICAgICAgICAgICAgICAgInJhd0J5dGVzIjogIk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRVk2WWE3VysrN2FVUHp2TVRyZXpINlljeDNjK0hPS1lDY05HeWJKWlNDSnEvZmQ3UWE4dXVBS3RkSWtVUXRRaUVLRVJoQW1FNWxNTUpoUDhPa0RPYTJnPT0iLAogICAgICAgICAgICAgICAgImtleURldGFpbHMiOiAiUEtJWF9FQ0RTQV9QMjU2X1NIQV8yNTYiLAogICAgICAgICAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgICAgICAgICAgICJzdGFydCI6ICIyMDI1LTAxLTEzVDAwOjAwOjAwLjAwMFoiCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9LAogICAgICAgIHsKICAgICAgICAgICAgImtleUlkIjogIlNIQTI1NjpEaFE4d1I1QVBCdkZITEYvK1RjK0FZdlBPZFRwY0lEcU9oeHNCSFJ3QzdVIiwKICAgICAgICAgICAgImtleVVzYWdlIjogIm5wbTphdHRlc3RhdGlvbnMiLAogICAgICAgICAgICAicHVibGljS2V5IjogewogICAgICAgICAgICAgICAgInJhd0J5dGVzIjogIk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRVk2WWE3VysrN2FVUHp2TVRyZXpINlljeDNjK0hPS1lDY05HeWJKWlNDSnEvZmQ3UWE4dXVBS3RkSWtVUXRRaUVLRVJoQW1FNWxNTUpoUDhPa0RPYTJnPT0iLAogICAgICAgICAgICAgICAgImtleURldGFpbHMiOiAiUEtJWF9FQ0RTQV9QMjU2X1NIQV8yNTYiLAogICAgICAgICAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgICAgICAgICAgICJzdGFydCI6ICIyMDI1LTAxLTEzVDAwOjAwOjAwLjAwMFoiCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICBdCn0K"}}}});var kU=d(ea=>{"use strict";var BU=ea&&ea.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ea,"__esModule",{value:!0});ea.TUFClient=void 0;var ts=BU(require("fs")),Nu=BU(require("path")),oae=xU(),aae=sm(),cae=LU(),J0="targets",W0=class{static{o(this,"TUFClient")}constructor(e){let t=new URL(e.mirrorURL),r=encodeURIComponent(t.host+t.pathname.replace(/\/$/,"")),s=Nu.default.join(e.cachePath,r);uae(s),lae({cachePath:s,mirrorURL:e.mirrorURL,tufRootPath:e.rootPath,forceInit:e.forceInit}),this.updater=hae({mirrorURL:e.mirrorURL,cachePath:s,forceCache:e.forceCache,retry:e.retry,timeout:e.timeout})}async refresh(){return this.updater.refresh()}getTarget(e){return(0,cae.readTarget)(this.updater,e)}};ea.TUFClient=W0;function uae(i){let e=Nu.default.join(i,J0);ts.default.existsSync(i)||ts.default.mkdirSync(i,{recursive:!0}),ts.default.existsSync(e)||ts.default.mkdirSync(e)}o(uae,"initTufCache");function lae({cachePath:i,mirrorURL:e,tufRootPath:t,forceInit:r}){let s=Nu.default.join(i,"root.json");if(!ts.default.existsSync(s)||r)if(t)ts.default.copyFileSync(t,s);else{let a=MU()[e];if(!a)throw new aae.TUFError({code:"TUF_INIT_CACHE_ERROR",message:`No root.json found for mirror: ${e}`});ts.default.writeFileSync(s,Buffer.from(a["root.json"],"base64")),Object.entries(a.targets).forEach(([c,u])=>{ts.default.writeFileSync(Nu.default.join(i,J0,c),Buffer.from(u,"base64"))})}}o(lae,"seedCache");function hae(i){let e={fetchTimeout:i.timeout,fetchRetry:i.retry};return new oae.Updater({metadataBaseUrl:i.mirrorURL,targetBaseUrl:`${i.mirrorURL}/targets`,metadataDir:i.cachePath,targetDir:Nu.default.join(i.cachePath,J0),forceCache:i.forceCache,config:e})}o(hae,"initClient")});var sm=d(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.TUFError=hr.DEFAULT_MIRROR_URL=void 0;hr.getTrustedRoot=Eae;hr.initTUF=wae;var fae=su(),dae=IF(),pae=kU();hr.DEFAULT_MIRROR_URL="https://tuf-repo-cdn.sigstore.dev";var mae="sigstore-js",gae={retries:2},yae=5e3,Sae="trusted_root.json";async function Eae(i={}){let t=await FU(i).getTarget(Sae);return fae.TrustedRoot.fromJSON(JSON.parse(t))}o(Eae,"getTrustedRoot");async function wae(i={}){let e=FU(i);return e.refresh().then(()=>e)}o(wae,"initTUF");function FU(i){return new pae.TUFClient({cachePath:i.cachePath||(0,dae.appDataPath)(mae),rootPath:i.rootPath,mirrorURL:i.mirrorURL||hr.DEFAULT_MIRROR_URL,retry:i.retry??gae,timeout:i.timeout??yae,forceCache:i.forceCache??!1,forceInit:i.forceInit??i.force??!1})}o(FU,"createClient");var _ae=G0();Object.defineProperty(hr,"TUFError",{enumerable:!0,get:o(function(){return _ae.TUFError},"get")})});var UU=d(nm=>{"use strict";Object.defineProperty(nm,"__esModule",{value:!0});nm.DSSESignatureContent=void 0;var Pu=ot(),K0=class{static{o(this,"DSSESignatureContent")}constructor(e){this.env=e}compareDigest(e){return Pu.crypto.bufferEqual(e,Pu.crypto.digest("sha256",this.env.payload))}compareSignature(e){return Pu.crypto.bufferEqual(e,this.signature)}verifySignature(e){return Pu.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 Pu.dsse.preAuthEncoding(this.env.payloadType,this.env.payload)}};nm.DSSESignatureContent=K0});var jU=d(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});om.MessageSignatureContent=void 0;var Z0=ot(),Y0=class{static{o(this,"MessageSignatureContent")}constructor(e,t){this.signature=e.signature,this.messageDigest=e.messageDigest.digest,this.artifact=t}compareSignature(e){return Z0.crypto.bufferEqual(e,this.signature)}compareDigest(e){return Z0.crypto.bufferEqual(e,this.messageDigest)}verifySignature(e){return Z0.crypto.verify(this.artifact,e,this.signature)}};om.MessageSignatureContent=Y0});var qU=d(am=>{"use strict";Object.defineProperty(am,"__esModule",{value:!0});am.toSignedEntity=Oae;am.signatureContent=$U;var X0=ot(),bae=UU(),Iae=jU();function Oae(i,e){let{tlogEntries:t,timestampVerificationData:r}=i.verificationMaterial,s=[];for(let n of t)s.push({$case:"transparency-log",tlogEntry:n});for(let n of r?.rfc3161Timestamps??[])s.push({$case:"timestamp-authority",timestamp:X0.RFC3161Timestamp.parse(n.signedTimestamp)});return{signature:$U(i,e),key:vae(i),tlogEntries:t,timestamps:s}}o(Oae,"toSignedEntity");function $U(i,e){switch(i.content.$case){case"dsseEnvelope":return new bae.DSSESignatureContent(i.content.dsseEnvelope);case"messageSignature":return new Iae.MessageSignatureContent(i.content.messageSignature,e)}}o($U,"signatureContent");function vae(i){switch(i.verificationMaterial.content.$case){case"publicKey":return{$case:"public-key",hint:i.verificationMaterial.content.publicKey.hint};case"x509CertificateChain":return{$case:"certificate",certificate:X0.X509Certificate.parse(i.verificationMaterial.content.x509CertificateChain.certificates[0].rawBytes)};case"certificate":return{$case:"certificate",certificate:X0.X509Certificate.parse(i.verificationMaterial.content.certificate.rawBytes)}}}o(vae,"key")});var Pe=d(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.PolicyError=ta.VerificationError=void 0;var cm=class extends Error{static{o(this,"BaseError")}constructor({code:e,message:t,cause:r}){super(t),this.code=e,this.cause=r,this.name=this.constructor.name}},Q0=class extends cm{static{o(this,"VerificationError")}};ta.VerificationError=Q0;var eI=class extends cm{static{o(this,"PolicyError")}};ta.PolicyError=eI});var VU=d(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});um.filterCertAuthorities=Rae;um.filterTLogAuthorities=Aae;function Rae(i,e){return i.filter(t=>t.validFor.start<=e&&t.validFor.end>=e)}o(Rae,"filterCertAuthorities");function Aae(i,e){return i.filter(t=>e.logID&&!t.logID.equals(e.logID)?!1:t.validFor.start<=e.targetDate&&e.targetDate<=t.validFor.end)}o(Aae,"filterTLogAuthorities")});var on=d(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.filterTLogAuthorities=nn.filterCertAuthorities=void 0;nn.toTrustMaterial=Cae;var tI=ot(),Du=su(),Tae=Pe(),iI=new Date(0),rI=new Date(864e13),GU=VU();Object.defineProperty(nn,"filterCertAuthorities",{enumerable:!0,get:o(function(){return GU.filterCertAuthorities},"get")});Object.defineProperty(nn,"filterTLogAuthorities",{enumerable:!0,get:o(function(){return GU.filterTLogAuthorities},"get")});function Cae(i,e){let t=typeof e=="function"?e:Nae(e);return{certificateAuthorities:i.certificateAuthorities.map(HU),timestampAuthorities:i.timestampAuthorities.map(HU),tlogs:i.tlogs.map(zU),ctlogs:i.ctlogs.map(zU),publicKey:t}}o(Cae,"toTrustMaterial");function zU(i){let e=i.publicKey.keyDetails,t=e===Du.PublicKeyDetails.PKCS1_RSA_PKCS1V5||e===Du.PublicKeyDetails.PKIX_RSA_PKCS1V5||e===Du.PublicKeyDetails.PKIX_RSA_PKCS1V15_2048_SHA256||e===Du.PublicKeyDetails.PKIX_RSA_PKCS1V15_3072_SHA256||e===Du.PublicKeyDetails.PKIX_RSA_PKCS1V15_4096_SHA256?"pkcs1":"spki";return{logID:i.logId.keyId,publicKey:tI.crypto.createPublicKey(i.publicKey.rawBytes,t),validFor:{start:i.publicKey.validFor?.start||iI,end:i.publicKey.validFor?.end||rI}}}o(zU,"createTLogAuthority");function HU(i){return{certChain:i.certChain.certificates.map(e=>tI.X509Certificate.parse(e.rawBytes)),validFor:{start:i.validFor?.start||iI,end:i.validFor?.end||rI}}}o(HU,"createCertAuthority");function Nae(i){return e=>{let t=(i||{})[e];if(!t)throw new Tae.VerificationError({code:"PUBLIC_KEY_ERROR",message:`key not found: ${e}`});return{publicKey:tI.crypto.createPublicKey(t.rawBytes),validFor:o(r=>(t.validFor?.start||iI)<=r&&(t.validFor?.end||rI)>=r,"validFor")}}}o(Nae,"keyLocator")});var sI=d(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});xu.CertificateChainVerifier=void 0;xu.verifyCertificateChain=Dae;var is=Pe(),Pae=on();function Dae(i,e,t){let r=(0,Pae.filterCertAuthorities)(t,i),s;for(let n of r)try{return new lm({trustedCerts:n.certChain,untrustedCert:e,timestamp:i}).verify()}catch(a){s=a}throw new is.VerificationError({code:"CERTIFICATE_ERROR",message:"Failed to verify certificate chain",cause:s})}o(Dae,"verifyCertificateChain");var lm=class{static{o(this,"CertificateChainVerifier")}constructor(e){this.untrustedCert=e.untrustedCert,this.trustedCerts=e.trustedCerts,this.localCerts=xae([...e.trustedCerts,e.untrustedCert]),this.timestamp=e.timestamp}verify(){let e=this.sort();if(this.checkPath(e),!e.every(r=>r.validForDate(this.timestamp)))throw new is.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 is.VerificationError({code:"CERTIFICATE_ERROR",message:"no trusted certificate path found"});let r=t.reduce((s,n)=>s.length<n.length?s:n);return[e,...r].slice(0,-1)}buildPaths(e){let t=[],r=this.findIssuer(e);if(r.length===0)throw new is.VerificationError({code:"CERTIFICATE_ERROR",message:"no valid certificate path found"});for(let s=0;s<r.length;s++){let n=r[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=[],r;return e.subject.equals(e.issuer)&&e.verify()?[e]:(e.extAuthorityKeyID&&(r=e.extAuthorityKeyID.keyIdentifier),this.localCerts.forEach(s=>{if(r&&s.extSubjectKeyID){s.extSubjectKeyID.keyIdentifier.equals(r)&&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 is.VerificationError({code:"CERTIFICATE_ERROR",message:"certificate chain must contain at least one certificate"});if(!e.slice(1).every(r=>r.isCA))throw new is.VerificationError({code:"CERTIFICATE_ERROR",message:"intermediate certificate is not a CA"});for(let r=e.length-2;r>=0;r--)if(!e[r].issuer.equals(e[r+1].subject))throw new is.VerificationError({code:"CERTIFICATE_ERROR",message:"incorrect certificate name chaining"});for(let r=0;r<e.length;r++){let s=e[r];if(s.extBasicConstraints?.isCA){let n=s.extBasicConstraints.pathLenConstraint;if(n!==void 0&&n<r-1)throw new is.VerificationError({code:"CERTIFICATE_ERROR",message:"path length constraint exceeded"})}}}};xu.CertificateChainVerifier=lm;function xae(i){for(let e=0;e<i.length;e++)for(let t=e+1;t<i.length;t++)i[e].equals(i[t])&&(i.splice(t,1),t--);return i}o(xae,"dedupeCertificates")});var WU=d(nI=>{"use strict";Object.defineProperty(nI,"__esModule",{value:!0});nI.verifySCTs=Bae;var hm=ot(),Lae=Pe(),Mae=on();function Bae(i,e,t){let r,s=i.clone();for(let u=0;u<s.extensions.length;u++){let l=s.extensions[u];if(l.subs[0].toOID()===hm.EXTENSION_OID_SCT){r=new hm.X509SCTExtension(l),s.extensions.splice(u,1);break}}if(!r)return[];if(r.signedCertificateTimestamps.length===0)return[];let n=new hm.ByteStream,a=hm.crypto.digest("sha256",e.publicKey);n.appendView(a);let c=s.tbsCertificate.toDER();return n.appendUint24(c.length),n.appendView(c),r.signedCertificateTimestamps.map(u=>{if(!(0,Mae.filterTLogAuthorities)(t,{logID:u.logID,targetDate:u.datetime}).some(f=>u.verify(n.buffer,f.publicKey)))throw new Lae.VerificationError({code:"CERTIFICATE_ERROR",message:"SCT verification failed"});return u.logID})}o(Bae,"verifySCTs")});var JU=d(fm=>{"use strict";Object.defineProperty(fm,"__esModule",{value:!0});fm.verifyPublicKey=Vae;fm.verifyCertificate=zae;var kae=ot(),Fae=Pe(),Uae=sI(),jae=WU(),$ae="1.3.6.1.4.1.57264.1.1",qae="1.3.6.1.4.1.57264.1.8";function Vae(i,e,t){let r=t.publicKey(i);return e.forEach(s=>{if(!r.validFor(s))throw new Fae.VerificationError({code:"PUBLIC_KEY_ERROR",message:`Public key is not valid for timestamp: ${s.toISOString()}`})}),{key:r.publicKey}}o(Vae,"verifyPublicKey");function zae(i,e,t){let r=[];return e.forEach(s=>{r=(0,Uae.verifyCertificateChain)(s,i,t.certificateAuthorities)}),{scts:(0,jae.verifySCTs)(r[0],r[1],t.ctlogs),signer:Hae(r[0])}}o(zae,"verifyCertificate");function Hae(i){let e,t=i.extension(qae);t?e=t.valueObj.subs?.[0]?.value.toString("ascii"):e=i.extension($ae)?.value.toString("ascii");let r={extensions:{issuer:e},subjectAlternativeName:i.subjectAltName};return{key:kae.crypto.createPublicKey(i.publicKey),identity:r}}o(Hae,"getSigner")});var ZU=d(dm=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});dm.verifySubjectAlternativeName=Gae;dm.verifyExtensions=Wae;var KU=Pe();function Gae(i,e){if(e===void 0||!e.match(i))throw new KU.PolicyError({code:"UNTRUSTED_SIGNER_ERROR",message:`certificate identity error - expected ${i}, got ${e}`})}o(Gae,"verifySubjectAlternativeName");function Wae(i,e={}){let t;for(t in i)if(e[t]!==i[t])throw new KU.PolicyError({code:"UNTRUSTED_SIGNER_ERROR",message:`invalid certificate extension - expected ${t}=${i[t]}, got ${t}=${e[t]}`})}o(Wae,"verifyExtensions")});var YU=d(lI=>{"use strict";Object.defineProperty(lI,"__esModule",{value:!0});lI.verifyCheckpoint=Zae;var aI=ot(),ia=Pe(),Jae=on(),oI=`
60
61
 
61
- `,Wae=/\u2014 (\S+) (\S+)\n/g;function Jae(i,e){let t=(0,Gae.filterTLogAuthorities)(e,{targetDate:new Date(Number(i.integratedTime)*1e3)}),r=i.inclusionProof,s=cI.fromString(r.checkpoint.envelope),n=uI.fromString(s.note);if(!Kae(s,t))throw new ia.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"invalid checkpoint signature"});if(!aI.crypto.bufferEqual(n.logHash,r.rootHash))throw new ia.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"root hash mismatch"})}o(Jae,"verifyCheckpoint");function Kae(i,e){let t=Buffer.from(i.note,"utf-8");return i.signatures.every(r=>{let s=e.find(n=>aI.crypto.bufferEqual(n.logID.subarray(0,4),r.keyHint));return s?aI.crypto.verify(t,s.publicKey,r.signature):!1})}o(Kae,"verifySignedNote");var cI=class i{static{o(this,"SignedNote")}constructor(e,t){this.note=e,this.signatures=t}static fromString(e){if(!e.includes(oI))throw new ia.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"missing checkpoint separator"});let t=e.indexOf(oI),r=e.slice(0,t+1),n=e.slice(t+oI.length).matchAll(Wae),a=Array.from(n,c=>{let[,u,l]=c,h=Buffer.from(l,"base64");if(h.length<5)throw new ia.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"malformed checkpoint signature"});return{name:u,keyHint:h.subarray(0,4),signature:h.subarray(4)}});if(a.length===0)throw new ia.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"no signatures found in checkpoint"});return new i(r,a)}},uI=class i{static{o(this,"LogCheckpoint")}constructor(e,t,r,s){this.origin=e,this.logSize=t,this.logHash=r,this.rest=s}static fromString(e){let t=e.trimEnd().split(`
62
- `);if(t.length<3)throw new ia.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"too few lines in checkpoint header"});let r=t[0],s=BigInt(t[1]),n=Buffer.from(t[2],"base64"),a=t.slice(3);return new i(r,s,n,a)}}});var XU=d(pI=>{"use strict";Object.defineProperty(pI,"__esModule",{value:!0});pI.verifyMerkleInclusion=Xae;var dI=ot(),hI=Pe(),Zae=Buffer.from([0]),Yae=Buffer.from([1]);function Xae(i){let e=i.inclusionProof,t=BigInt(e.logIndex),r=BigInt(e.treeSize);if(t<0n||t>=r)throw new hI.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:`invalid index: ${t}`});let{inner:s,border:n}=Qae(t,r);if(e.hashes.length!==s+n)throw new hI.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"invalid hash count"});let a=e.hashes.slice(0,s),c=e.hashes.slice(s),u=nce(i.canonicalizedBody),l=tce(ece(u,a,t),c);if(!dI.crypto.bufferEqual(l,e.rootHash))throw new hI.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"calculated root hash does not match inclusion proof"})}o(Xae,"verifyMerkleInclusion");function Qae(i,e){let t=ice(i,e),r=rce(i>>BigInt(t));return{inner:t,border:r}}o(Qae,"decompInclProof");function ece(i,e,t){return e.reduce((r,s,n)=>t>>BigInt(n)&BigInt(1)?fI(s,r):fI(r,s),i)}o(ece,"chainInner");function tce(i,e){return e.reduce((t,r)=>fI(r,t),i)}o(tce,"chainBorderRight");function ice(i,e){return sce(i^e-BigInt(1))}o(ice,"innerProofSize");function rce(i){return i.toString(2).split("1").length-1}o(rce,"onesCount");function sce(i){return i===0n?0:i.toString(2).length}o(sce,"bitLength");function fI(i,e){return dI.crypto.digest("sha256",Yae,i,e)}o(fI,"hashChildren");function nce(i){return dI.crypto.digest("sha256",Zae,i)}o(nce,"hashLeaf")});var ej=d(mI=>{"use strict";Object.defineProperty(mI,"__esModule",{value:!0});mI.verifyTLogSET=cce;var QU=ot(),oce=Pe(),ace=on();function cce(i,e){if(!(0,ace.filterTLogAuthorities)(e,{logID:i.logId.keyId,targetDate:new Date(Number(i.integratedTime)*1e3)}).some(s=>{let n=uce(i),a=Buffer.from(QU.json.canonicalize(n),"utf8"),c=i.inclusionPromise.signedEntryTimestamp;return QU.crypto.verify(a,s.publicKey,c)}))throw new oce.VerificationError({code:"TLOG_INCLUSION_PROMISE_ERROR",message:"inclusion promise could not be verified"})}o(cce,"verifyTLogSET");function uce(i){let{integratedTime:e,logIndex:t,logId:r,canonicalizedBody:s}=i;return{body:s.toString("base64"),integratedTime:Number(e),logIndex:Number(t),logID:r.keyId.toString("hex")}}o(uce,"toVerificationPayload")});var ij=d(yI=>{"use strict";Object.defineProperty(yI,"__esModule",{value:!0});yI.verifyRFC3161Timestamp=fce;var gI=ot(),tj=Pe(),lce=sI(),hce=on();function fce(i,e,t){let r=i.signingTime;if(t=(0,hce.filterCertAuthorities)(t,r),t=pce(t,{serialNumber:i.signerSerialNumber,issuer:i.signerIssuer}),!t.some(n=>{try{return dce(i,e,n),!0}catch{return!1}}))throw new tj.VerificationError({code:"TIMESTAMP_ERROR",message:"timestamp could not be verified"})}o(fce,"verifyRFC3161Timestamp");function dce(i,e,t){let[r,...s]=t.certChain,n=gI.crypto.createPublicKey(r.publicKey),a=i.signingTime;try{new lce.CertificateChainVerifier({untrustedCert:r,trustedCerts:s,timestamp:a}).verify()}catch{throw new tj.VerificationError({code:"TIMESTAMP_ERROR",message:"invalid certificate chain"})}i.verify(e,n)}o(dce,"verifyTimestampForCA");function pce(i,e){return i.filter(t=>t.certChain.length>0&&gI.crypto.bufferEqual(t.certChain[0].serialNumber,e.serialNumber)&&gI.crypto.bufferEqual(t.certChain[0].issuer,e.issuer))}o(pce,"filterCAsBySerialAndIssuer")});var rj=d(pm=>{"use strict";Object.defineProperty(pm,"__esModule",{value:!0});pm.verifyTSATimestamp=wce;pm.verifyTLogTimestamp=_ce;var mce=Pe(),gce=YU(),yce=XU(),Sce=ej(),Ece=ij();function wce(i,e,t){return(0,Ece.verifyRFC3161Timestamp)(i,e,t),{type:"timestamp-authority",logID:i.signerSerialNumber,timestamp:i.signingTime}}o(wce,"verifyTSATimestamp");function _ce(i,e){let t=!1;if(bce(i)&&((0,Sce.verifyTLogSET)(i,e),t=!0),Ice(i)&&((0,yce.verifyMerkleInclusion)(i),(0,gce.verifyCheckpoint)(i,e),t=!0),!t)throw new mce.VerificationError({code:"TLOG_MISSING_INCLUSION_ERROR",message:"inclusion could not be verified"});return{type:"transparency-log",logID:i.logId.keyId,timestamp:new Date(Number(i.integratedTime)*1e3)}}o(_ce,"verifyTLogTimestamp");function bce(i){return i.inclusionPromise!==void 0}o(bce,"isTLogEntryWithInclusionPromise");function Ice(i){return i.inclusionProof!==void 0}o(Ice,"isTLogEntryWithInclusionProof")});var sj=d(SI=>{"use strict";Object.defineProperty(SI,"__esModule",{value:!0});SI.verifyDSSETLogBody=Oce;var mm=Pe();function Oce(i,e){switch(i.apiVersion){case"0.0.1":return vce(i,e);default:throw new mm.VerificationError({code:"TLOG_BODY_ERROR",message:`unsupported dsse version: ${i.apiVersion}`})}}o(Oce,"verifyDSSETLogBody");function vce(i,e){if(i.spec.signatures?.length!==1)throw new mm.VerificationError({code:"TLOG_BODY_ERROR",message:"signature count mismatch"});let t=i.spec.signatures[0].signature;if(!e.compareSignature(Buffer.from(t,"base64")))throw new mm.VerificationError({code:"TLOG_BODY_ERROR",message:"tlog entry signature mismatch"});let r=i.spec.payloadHash?.value||"";if(!e.compareDigest(Buffer.from(r,"hex")))throw new mm.VerificationError({code:"TLOG_BODY_ERROR",message:"DSSE payload hash mismatch"})}o(vce,"verifyDSSE001TLogBody")});var nj=d(wI=>{"use strict";Object.defineProperty(wI,"__esModule",{value:!0});wI.verifyHashedRekordTLogBody=Rce;var EI=Pe();function Rce(i,e){switch(i.apiVersion){case"0.0.1":return Ace(i,e);default:throw new EI.VerificationError({code:"TLOG_BODY_ERROR",message:`unsupported hashedrekord version: ${i.apiVersion}`})}}o(Rce,"verifyHashedRekordTLogBody");function Ace(i,e){let t=i.spec.signature.content||"";if(!e.compareSignature(Buffer.from(t,"base64")))throw new EI.VerificationError({code:"TLOG_BODY_ERROR",message:"signature mismatch"});let r=i.spec.data.hash?.value||"";if(!e.compareDigest(Buffer.from(r,"hex")))throw new EI.VerificationError({code:"TLOG_BODY_ERROR",message:"digest mismatch"})}o(Ace,"verifyHashedrekord001TLogBody")});var oj=d(_I=>{"use strict";Object.defineProperty(_I,"__esModule",{value:!0});_I.verifyIntotoTLogBody=Tce;var gm=Pe();function Tce(i,e){switch(i.apiVersion){case"0.0.2":return Cce(i,e);default:throw new gm.VerificationError({code:"TLOG_BODY_ERROR",message:`unsupported intoto version: ${i.apiVersion}`})}}o(Tce,"verifyIntotoTLogBody");function Cce(i,e){if(i.spec.content.envelope.signatures?.length!==1)throw new gm.VerificationError({code:"TLOG_BODY_ERROR",message:"signature count mismatch"});let t=Nce(i.spec.content.envelope.signatures[0].sig);if(!e.compareSignature(Buffer.from(t,"base64")))throw new gm.VerificationError({code:"TLOG_BODY_ERROR",message:"tlog entry signature mismatch"});let r=i.spec.content.payloadHash?.value||"";if(!e.compareDigest(Buffer.from(r,"hex")))throw new gm.VerificationError({code:"TLOG_BODY_ERROR",message:"DSSE payload hash mismatch"})}o(Cce,"verifyIntoto002TLogBody");function Nce(i){return Buffer.from(i,"base64").toString("utf-8")}o(Nce,"base64Decode")});var cj=d(bI=>{"use strict";Object.defineProperty(bI,"__esModule",{value:!0});bI.verifyTLogBody=Lce;var aj=Pe(),Pce=sj(),Dce=nj(),xce=oj();function Lce(i,e){let{kind:t,version:r}=i.kindVersion,s=JSON.parse(i.canonicalizedBody.toString("utf8"));if(t!==s.kind||r!==s.apiVersion)throw new aj.VerificationError({code:"TLOG_BODY_ERROR",message:`kind/version mismatch - expected: ${t}/${r}, received: ${s.kind}/${s.apiVersion}`});switch(s.kind){case"dsse":return(0,Pce.verifyDSSETLogBody)(s,e);case"intoto":return(0,xce.verifyIntotoTLogBody)(s,e);case"hashedrekord":return(0,Dce.verifyHashedRekordTLogBody)(s,e);default:throw new aj.VerificationError({code:"TLOG_BODY_ERROR",message:`unsupported kind: ${t}`})}}o(Lce,"verifyTLogBody")});var dj=d(ym=>{"use strict";Object.defineProperty(ym,"__esModule",{value:!0});ym.Verifier=void 0;var Mce=require("util"),ra=Pe(),uj=JU(),lj=ZU(),hj=rj(),Bce=cj(),II=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 r=this.verifyTimestamps(e),s=this.verifySigningKey(e,r);return this.verifyTLogs(e),this.verifySignature(e,s),t&&this.verifyPolicy(t,s.identity||{}),s}verifyTimestamps(e){let t=0,r=0,s=e.timestamps.map(n=>{switch(n.$case){case"timestamp-authority":return r++,(0,hj.verifyTSATimestamp)(n.timestamp,e.signature.signature,this.trustMaterial.timestampAuthorities);case"transparency-log":return t++,(0,hj.verifyTLogTimestamp)(n.tlogEntry,this.trustMaterial.tlogs)}});if(fj(s))throw new ra.VerificationError({code:"TIMESTAMP_ERROR",message:"duplicate timestamp"});if(t<this.options.tlogThreshold)throw new ra.VerificationError({code:"TIMESTAMP_ERROR",message:`expected ${this.options.tlogThreshold} tlog timestamps, got ${t}`});if(r<this.options.tsaThreshold)throw new ra.VerificationError({code:"TIMESTAMP_ERROR",message:`expected ${this.options.tsaThreshold} tsa timestamps, got ${r}`});return s.map(n=>n.timestamp)}verifySigningKey({key:e},t){switch(e.$case){case"public-key":return(0,uj.verifyPublicKey)(e.hint,t,this.trustMaterial);case"certificate":{let r=(0,uj.verifyCertificate)(e.certificate,t,this.trustMaterial);if(fj(r.scts))throw new ra.VerificationError({code:"CERTIFICATE_ERROR",message:"duplicate SCT"});if(r.scts.length<this.options.ctlogThreshold)throw new ra.VerificationError({code:"CERTIFICATE_ERROR",message:`expected ${this.options.ctlogThreshold} SCTs, got ${r.scts.length}`});return r.signer}}}verifyTLogs({signature:e,tlogEntries:t}){t.forEach(r=>(0,Bce.verifyTLogBody)(r,e))}verifySignature(e,t){if(!e.signature.verifySignature(t.key))throw new ra.VerificationError({code:"SIGNATURE_ERROR",message:"signature verification failed"})}verifyPolicy(e,t){e.subjectAlternativeName&&(0,lj.verifySubjectAlternativeName)(e.subjectAlternativeName,t.subjectAlternativeName),e.extensions&&(0,lj.verifyExtensions)(e.extensions,t.extensions)}};ym.Verifier=II;function fj(i){for(let e=0;e<i.length;e++)for(let t=e+1;t<i.length;t++)if((0,Mce.isDeepStrictEqual)(i[e],i[t]))return!0;return!1}o(fj,"containsDupes")});var Sm=d($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.Verifier=$t.toTrustMaterial=$t.VerificationError=$t.PolicyError=$t.toSignedEntity=void 0;var kce=qU();Object.defineProperty($t,"toSignedEntity",{enumerable:!0,get:o(function(){return kce.toSignedEntity},"get")});var pj=Pe();Object.defineProperty($t,"PolicyError",{enumerable:!0,get:o(function(){return pj.PolicyError},"get")});Object.defineProperty($t,"VerificationError",{enumerable:!0,get:o(function(){return pj.VerificationError},"get")});var Fce=on();Object.defineProperty($t,"toTrustMaterial",{enumerable:!0,get:o(function(){return Fce.toTrustMaterial},"get")});var Uce=dj();Object.defineProperty($t,"Verifier",{enumerable:!0,get:o(function(){return Uce.Verifier},"get")})});var mj=d(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.DEFAULT_TIMEOUT=Ke.DEFAULT_RETRY=void 0;Ke.createBundleBuilder=qce;Ke.createKeyFinder=Vce;Ke.createVerificationPolicy=zce;var jce=ot(),sa=Ub(),$ce=Sm();Ke.DEFAULT_RETRY={retries:2};Ke.DEFAULT_TIMEOUT=5e3;function qce(i,e){let t={signer:Hce(e),witnesses:Wce(e)};switch(i){case"messageSignature":return new sa.MessageSignatureBundleBuilder(t);case"dsseEnvelope":return new sa.DSSEBundleBuilder({...t,certificateChain:e.legacyCompatibility})}}o(qce,"createBundleBuilder");function Vce(i){return e=>{let t=i(e);if(!t)throw new $ce.VerificationError({code:"PUBLIC_KEY_ERROR",message:`key not found: ${e}`});return{publicKey:jce.crypto.createPublicKey(t),validFor:o(()=>!0,"validFor")}}}o(Vce,"createKeyFinder");function zce(i){let e={},t=i.certificateIdentityEmail||i.certificateIdentityURI;return t&&(e.subjectAlternativeName=t),i.certificateIssuer&&(e.extensions={issuer:i.certificateIssuer}),e}o(zce,"createVerificationPolicy");function Hce(i){return new sa.FulcioSigner({fulcioBaseURL:i.fulcioURL,identityProvider:i.identityProvider||Gce(i),retry:i.retry??Ke.DEFAULT_RETRY,timeout:i.timeout??Ke.DEFAULT_TIMEOUT})}o(Hce,"initSigner");function Gce(i){let e=i.identityToken;return e?{getToken:o(()=>Promise.resolve(e),"getToken")}:new sa.CIContextProvider("sigstore")}o(Gce,"initIdentityProvider");function Wce(i){let e=[];return Jce(i)&&e.push(new sa.RekorWitness({rekorBaseURL:i.rekorURL,entryType:i.legacyCompatibility?"intoto":"dsse",fetchOnConflict:!1,retry:i.retry??Ke.DEFAULT_RETRY,timeout:i.timeout??Ke.DEFAULT_TIMEOUT})),Kce(i)&&e.push(new sa.TSAWitness({tsaBaseURL:i.tsaServerURL,retry:i.retry??Ke.DEFAULT_RETRY,timeout:i.timeout??Ke.DEFAULT_TIMEOUT})),e}o(Wce,"initWitnesses");function Jce(i){return i.tlogUpload!==!1}o(Jce,"isRekorEnabled");function Kce(i){return i.tsaServerURL!==void 0}o(Kce,"isTSAEnabled")});var Sj=d(qt=>{"use strict";var Zce=qt&&qt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),Yce=qt&&qt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),gj=qt&&qt.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&Zce(t,e,r[s]);return Yce(t,e),t}})();Object.defineProperty(qt,"__esModule",{value:!0});qt.sign=Qce;qt.attest=eue;qt.verify=tue;qt.createVerifier=yj;var vI=ou(),Xce=gj(sm()),OI=Sm(),na=gj(mj());async function Qce(i,e={}){let r=await na.createBundleBuilder("messageSignature",e).create({data:i});return(0,vI.bundleToJSON)(r)}o(Qce,"sign");async function eue(i,e,t={}){let s=await na.createBundleBuilder("dsseEnvelope",t).create({data:i,type:e});return(0,vI.bundleToJSON)(s)}o(eue,"attest");async function tue(i,e,t){let r;return Buffer.isBuffer(e)?r=e:t=e,yj(t).then(s=>s.verify(i,r))}o(tue,"verify");async function yj(i={}){let e=await Xce.getTrustedRoot({mirrorURL:i.tufMirrorURL,rootPath:i.tufRootPath,cachePath:i.tufCachePath,forceCache:i.tufForceCache,retry:i.retry??na.DEFAULT_RETRY,timeout:i.timeout??na.DEFAULT_TIMEOUT}),t=i.keySelector?na.createKeyFinder(i.keySelector):void 0,r=(0,OI.toTrustMaterial)(e,t),s={ctlogThreshold:i.ctLogThreshold,tlogThreshold:i.tlogThreshold},n=new OI.Verifier(r,s),a=na.createVerificationPolicy(i);return{verify:o((c,u)=>{let l=(0,vI.bundleFromJSON)(c),h=(0,OI.toSignedEntity)(l,u);n.verify(h,a)},"verify")}}o(yj,"createVerifier")});var wj=d(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.verify=ue.sign=ue.createVerifier=ue.attest=ue.VerificationError=ue.PolicyError=ue.TUFError=ue.InternalError=ue.DEFAULT_REKOR_URL=ue.DEFAULT_FULCIO_URL=ue.ValidationError=void 0;var iue=ou();Object.defineProperty(ue,"ValidationError",{enumerable:!0,get:o(function(){return iue.ValidationError},"get")});var RI=Ub();Object.defineProperty(ue,"DEFAULT_FULCIO_URL",{enumerable:!0,get:o(function(){return RI.DEFAULT_FULCIO_URL},"get")});Object.defineProperty(ue,"DEFAULT_REKOR_URL",{enumerable:!0,get:o(function(){return RI.DEFAULT_REKOR_URL},"get")});Object.defineProperty(ue,"InternalError",{enumerable:!0,get:o(function(){return RI.InternalError},"get")});var rue=sm();Object.defineProperty(ue,"TUFError",{enumerable:!0,get:o(function(){return rue.TUFError},"get")});var Ej=Sm();Object.defineProperty(ue,"PolicyError",{enumerable:!0,get:o(function(){return Ej.PolicyError},"get")});Object.defineProperty(ue,"VerificationError",{enumerable:!0,get:o(function(){return Ej.VerificationError},"get")});var Em=Sj();Object.defineProperty(ue,"attest",{enumerable:!0,get:o(function(){return Em.attest},"get")});Object.defineProperty(ue,"createVerifier",{enumerable:!0,get:o(function(){return Em.createVerifier},"get")});Object.defineProperty(ue,"sign",{enumerable:!0,get:o(function(){return Em.sign},"get")});Object.defineProperty(ue,"verify",{enumerable:!0,get:o(function(){return Em.verify},"get")})});var NI=d((AIe,vj)=>{var sue=require("node:crypto"),_j=Yl(),nue=Jl(),AI=ai(),oue=Un(),aue=wj(),TI=x_(),cue=xs(),uue=ru(),bj=L_().version,Ij=XE(),Oj=Ds(),lue="application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*",hue="application/json",fue="2015-01-01T00:00:00.000Z",CI=class extends cue{static{o(this,"RegistryFetcher")}#e;constructor(e,t){super(e,t),this.packumentCache=this.opts.packumentCache||null,this.registry=TI.pickRegistry(e,t),this.packumentUrl=`${Ij(this.registry)}/${this.spec.escapedName}`,this.#e=`${this.fullMetadata?"full":"corgi"}:${this.packumentUrl}`;let r=new URL(this.registry),s=`//${r.host}${r.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/${bj} node/${process.version}`,...this.opts.headers||{},"pacote-version":bj,"pacote-req-type":"packument","pacote-pkg-id":`registry:${this.spec.name}`,accept:this.fullMetadata?hue:lue}}async packument(){if(this.packumentCache?.has(this.#e))return this.packumentCache.get(this.#e);try{let e=await TI(this.packumentUrl,{...this.opts,headers:this.#t(),spec:this.spec,integrity:null}),t=await e.json(),r=e.headers.get("content-length");return r&&(t._contentLength=Number(r)),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=_j.normalizeSteps.filter(a=>a!=="_attributes"),r=await new _j().fromContent(nue(e,this.spec.fetchSpec,{...this.opts,defaultTag:this.defaultTag,before:this.before})).normalize({steps:t}).then(a=>a.content),s=e.time?.[r.version];s&&(r._time=s);let{dist:n}=r;if(n){this.resolved=r._resolved=n.tarball,r._from=this.from;let a=n.integrity?AI.parse(n.integrity):n.shasum?AI.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(r._integrity=String(this.integrity),n.signatures)if(this.opts.verifySignatures){let a=`${r._id}:${r._integrity}`;for(let c of n.signatures){let u=this.registryKeys&&this.registryKeys.filter(m=>m.keyid===c.keyid)[0];if(!u)throw Object.assign(new Error(`${r._id} has a registry signature with keyid: ${c.keyid} but no corresponding public key can be found`),{code:"EMISSINGSIGNATUREKEY"});let l=Date.parse(r._time||fue);if(!(!u.expires||l<Date.parse(u.expires)))throw Object.assign(new Error(`${r._id} has a registry signature with keyid: ${c.keyid} but the corresponding public key has expired ${u.expires}`),{code:"EEXPIREDSIGNATUREKEY"});let f=sue.createVerify("SHA256");if(f.write(a),f.end(),!f.verify(u.pemkey,c.sig,"base64"))throw Object.assign(new Error(`${r._id} has an invalid registry signature with keyid: ${u.keyid} and signature: ${c.sig}`),{code:"EINTEGRITYSIGNATURE",keyid:u.keyid,signature:c.sig,resolved:r._resolved,integrity:r._integrity})}r._signatures=n.signatures}else r._signatures=n.signatures;if(n.attestations)if(this.opts.verifyAttestations){let a=new URL(n.attestations.url).pathname,c=Ij(this.registry)+a,u=await TI(c,{...this.opts,integrity:null}),{attestations:l}=await u.json(),h=l.map(({predicateType:m,bundle:y})=>{let g=JSON.parse(Buffer.from(y.dsseEnvelope.payload,"base64").toString("utf8")),S=y.dsseEnvelope.signatures[0].keyid,E=y.dsseEnvelope.signatures[0].sig;return{predicateType:m,bundle:y,statement:g,keyid:S,signature:E}}),f=h.map(m=>m.keyid).filter(m=>!!m),p=(this.registryKeys||[]).filter(m=>f.includes(m.keyid));if(!p.length)throw Object.assign(new Error(`${r._id} has attestations but no corresponding public key(s) can be found`),{code:"EMISSINGSIGNATUREKEY"});for(let{predicateType:m,bundle:y,keyid:g,signature:S,statement:E}of h){let _=p.find(v=>v.keyid===g);if(g){if(!_)throw Object.assign(new Error(`${r._id} has attestations with keyid: ${g} but no corresponding public key can be found`),{code:"EMISSINGSIGNATUREKEY"});let v=new Date(Number(y.verificationMaterial.tlogEntries[0].integratedTime)*1e3);if(!(!_.expires||v<Date.parse(_.expires)))throw Object.assign(new Error(`${r._id} has attestations with keyid: ${g} but the corresponding public key has expired ${_.expires}`),{code:"EEXPIREDSIGNATUREKEY"})}let b={name:E.subject[0].name,sha512:E.subject[0].digest.sha512},w=this.spec.type==="version"?oue.toPurl(this.spec):this.spec;if(b.name!==w)throw Object.assign(new Error(`${r._id} package name and version (PURL): ${w} doesn't match what was signed: ${b.name}`),{code:"EATTESTATIONSUBJECT"});let I=AI.parse(this.integrity).hexDigest();if(b.sha512!==I)throw Object.assign(new Error(`${r._id} package integrity (hex digest): ${I} doesn't match what was signed: ${b.sha512}`),{code:"EATTESTATIONSUBJECT"});try{let v={tufCachePath:this.tufCache,tufForceCache:!0,keySelector:_?()=>_.pemkey:void 0};await aue.verify(y,v)}catch(v){throw Object.assign(new Error(`${r._id} failed to verify attestation: ${v.message}`),{code:"EATTESTATIONVERIFY",predicateType:m,keyid:g,signature:S,resolved:r._resolved,integrity:r._integrity})}}r._attestations=n.attestations}else r._attestations=n.attestations}return this.package=r,this.package}[Oj.tarballFromResolved](){return new uue(this.resolved,{...this.opts,resolved:this.resolved,pkgid:`registry:${this.spec.name}@${this.resolved}`})[Oj.tarballFromResolved]()}get types(){return["tag","version","range"]}};vj.exports=CI});var xs=d((CIe,Pj)=>{var{basename:due,dirname:Rj}=require("node:path"),{rm:pue,mkdir:Aj}=require("node:fs/promises"),Cj=Yl(),PI=dc(),mue=Ln(),gue=CN(),Nj=Un(),yue=xa(),DI=ai(),Sue=KE(),{Minipass:Eue}=te(),{log:rs}=St(),Lu=Ds(),Tj=mD(),wue=YE(),_ue=XE(),bue=o(i=>Cj.prepare(i).then(e=>e.content),"packageJsonPrepare"),Iue=o(i=>Cj.normalize(i).then(e=>e.content),"packageJsonNormalize"),wm=class{static{o(this,"FetcherBase")}constructor(e,t){if(!t||typeof t!="object")throw new TypeError("options object is required");this.spec=Nj(e,t.where),this.allowGitIgnore=!!t.allowGitIgnore,this.from=this.spec.registry?`${this.spec.name}@${this.spec.rawSpec}`:this.spec.saveSpec,this.#i(),this.opts={...t},this.cache=t.cache||Tj().cacache,this.tufCache=t.tufCache||Tj().tufcache,this.resolved=t.resolved||null,this.defaultIntegrityAlgorithm=t.defaultIntegrityAlgorithm||"sha512",typeof t.integrity=="string"&&(this.opts.integrity=DI.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[Lu.readPackageJson]=this.fullReadJson?bue:Iue,this.replaceRegistryHost=!t.replaceRegistryHost||t.replaceRegistryHost==="npmjs"?"registry.npmjs.org":t.replaceRegistryHost,this.defaultTag=t.defaultTag||"latest",this.registry=_ue(t.registry||"https://registry.npmjs.org"),this.npmBin=t.npmBin||"npm",this.npmInstallCmd=t.npmInstallCmd||["install","--force"],this.npmCliConfig=t.npmCliConfig||[`--cache=${Rj(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=DI.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)}[Lu.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=PI.get.stream.byDigest(this.cache,this.integrity,this.opts),r=Date.now()-e;return rs.http("cache",`${this.spec} ${r}ms (cache hit)`),t}get[Lu.cacheFetches](){return!0}#t(e){if(!this.opts.cache||!this[Lu.cacheFetches]){if(e.hasIntegrityEmitter)return e.on("integrity",n=>this.integrity=n),e;let s=DI.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 Eue;e.on("error",s=>t.emit("error",s)),e.pipe(t,{end:!1});let r=PI.put.stream(this.opts.cache,`pacote:tarball:${this.from}`,this.opts);return r.on("integrity",s=>this.integrity=s),r.on("error",s=>e.emit("error",s)),e.pipe(r),r.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}#i(){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 rs.warn("tarball",`cached data for ${this.spec} (${this.integrity}) seems to be corrupted. Refreshing cache.`),this.cleanupCached().then(()=>{throw s});throw s}):null,r=o(s=>{if(s){if(!this.isRetriableError(s))throw s;rs.silly("tarball",`no local data for ${this.spec}. Extracting by manifest.`)}return this.resolve().then(()=>yue(n=>e(this.#t(this[Lu.tarballFromResolved]())).catch(a=>{if(this.isRetriableError(a))return rs.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(r):r()}cleanupCached(){return PI.rm.content(this.cache,this.integrity,this.opts)}#r(e){return gue({path:e,depth:1}).then(t=>Promise.all(t.map(r=>pue(r,{recursive:!0,force:!0}))))}async#s(e){return await this.#r(e),await Aj(e,{recursive:!0})}async extract(e){return await this.#s(e),this.tarballStream(t=>this.#c(e,t))}#u(e){return this.tarballStream(t=>new Promise((r,s)=>{let n=new mue.WriteStream(e);t.on("error",a=>n.emit("error",a)),n.on("error",a=>s(a)),n.on("close",()=>r({integrity:this.integrity&&String(this.integrity),resolved:this.resolved,from:this.from})),t.pipe(n)}))}async tarballFile(e){let t=Rj(e);return await Aj(t,{recursive:!0}),this.#u(e)}#c(e,t){let r=Sue.x(this.#n({cwd:e})),s=new Promise((n,a)=>{r.on("end",()=>{n({resolved:this.resolved,integrity:this.integrity&&String(this.integrity),from:this.from})}),r.on("error",c=>{rs.warn("tar",c.message),rs.silly("tar",c),a(c)}),t.on("error",c=>a(c))});return t.pipe(r),s}#f(e,t,r){let s=/Directory|GNUDumpDir/.test(r)?this.dmode:/File$/.test(r)?this.fmode:0,n=wue(this.package,e)?73:0;return(t|s)&~this.umask|n|384}#n({cwd:e}){let t=new Set;return{cwd:e,noChmod:!0,noMtime:!0,filter:o((r,s)=>{if(/Link$/.test(s.type))return!1;if(s.mode=this.#f(s.path,s.mode,s.type),/File$/.test(s.type)){let n=due(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((r,s,n)=>{rs.warn("tar",r,s),rs.silly("tar",r,s,n)},"onwarn"),umask:this.umask,preserveOwner:!1}}};Pj.exports=wm;var Oue=k_(),vue=NI(),Rue=fo(),Aue=$f(),Tue=ru();wm.get=(i,e={})=>{let t=Nj(i,e.where);switch(t.type){case"git":return new Oue(t,e);case"remote":return new Tue(t,e);case"version":case"range":case"tag":case"alias":return new vue(t.subSpec||t,e);case"file":return new Rue(t,e);case"directory":return new Aue(t,e);default:throw new TypeError("Unknown spec type: "+t.type)}}});var{get:an}=xs(),Cue=k_(),Nue=NI(),Pue=fo(),Due=$f(),xue=ru(),xI=o((i,e)=>an(i,e).tarball(),"tarball");xI.stream=(i,e,t)=>an(i,t).tarballStream(e);xI.file=(i,e,t)=>an(i,t).tarballFile(e);module.exports={GitFetcher:Cue,RegistryFetcher:Nue,FileFetcher:Pue,DirFetcher:Due,RemoteFetcher:xue,resolve:o((i,e)=>an(i,e).resolve(),"resolve"),extract:o((i,e,t)=>an(i,t).extract(e),"extract"),manifest:o((i,e)=>an(i,e).manifest(),"manifest"),packument:o((i,e)=>an(i,e).packument(),"packument"),tarball:xI};
62
+ `,Kae=/\u2014 (\S+) (\S+)\n/g;function Zae(i,e){let t=(0,Jae.filterTLogAuthorities)(e,{targetDate:new Date(Number(i.integratedTime)*1e3)}),r=i.inclusionProof,s=cI.fromString(r.checkpoint.envelope),n=uI.fromString(s.note);if(!Yae(s,t))throw new ia.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"invalid checkpoint signature"});if(!aI.crypto.bufferEqual(n.logHash,r.rootHash))throw new ia.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"root hash mismatch"})}o(Zae,"verifyCheckpoint");function Yae(i,e){let t=Buffer.from(i.note,"utf-8");return i.signatures.every(r=>{let s=e.find(n=>aI.crypto.bufferEqual(n.logID.subarray(0,4),r.keyHint));return s?aI.crypto.verify(t,s.publicKey,r.signature):!1})}o(Yae,"verifySignedNote");var cI=class i{static{o(this,"SignedNote")}constructor(e,t){this.note=e,this.signatures=t}static fromString(e){if(!e.includes(oI))throw new ia.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"missing checkpoint separator"});let t=e.indexOf(oI),r=e.slice(0,t+1),n=e.slice(t+oI.length).matchAll(Kae),a=Array.from(n,c=>{let[,u,l]=c,h=Buffer.from(l,"base64");if(h.length<5)throw new ia.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"malformed checkpoint signature"});return{name:u,keyHint:h.subarray(0,4),signature:h.subarray(4)}});if(a.length===0)throw new ia.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"no signatures found in checkpoint"});return new i(r,a)}},uI=class i{static{o(this,"LogCheckpoint")}constructor(e,t,r,s){this.origin=e,this.logSize=t,this.logHash=r,this.rest=s}static fromString(e){let t=e.trimEnd().split(`
63
+ `);if(t.length<3)throw new ia.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"too few lines in checkpoint header"});let r=t[0],s=BigInt(t[1]),n=Buffer.from(t[2],"base64"),a=t.slice(3);return new i(r,s,n,a)}}});var XU=d(pI=>{"use strict";Object.defineProperty(pI,"__esModule",{value:!0});pI.verifyMerkleInclusion=ece;var dI=ot(),hI=Pe(),Xae=Buffer.from([0]),Qae=Buffer.from([1]);function ece(i){let e=i.inclusionProof,t=BigInt(e.logIndex),r=BigInt(e.treeSize);if(t<0n||t>=r)throw new hI.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:`invalid index: ${t}`});let{inner:s,border:n}=tce(t,r);if(e.hashes.length!==s+n)throw new hI.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"invalid hash count"});let a=e.hashes.slice(0,s),c=e.hashes.slice(s),u=ace(i.canonicalizedBody),l=rce(ice(u,a,t),c);if(!dI.crypto.bufferEqual(l,e.rootHash))throw new hI.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"calculated root hash does not match inclusion proof"})}o(ece,"verifyMerkleInclusion");function tce(i,e){let t=sce(i,e),r=nce(i>>BigInt(t));return{inner:t,border:r}}o(tce,"decompInclProof");function ice(i,e,t){return e.reduce((r,s,n)=>t>>BigInt(n)&BigInt(1)?fI(s,r):fI(r,s),i)}o(ice,"chainInner");function rce(i,e){return e.reduce((t,r)=>fI(r,t),i)}o(rce,"chainBorderRight");function sce(i,e){return oce(i^e-BigInt(1))}o(sce,"innerProofSize");function nce(i){return i.toString(2).split("1").length-1}o(nce,"onesCount");function oce(i){return i===0n?0:i.toString(2).length}o(oce,"bitLength");function fI(i,e){return dI.crypto.digest("sha256",Qae,i,e)}o(fI,"hashChildren");function ace(i){return dI.crypto.digest("sha256",Xae,i)}o(ace,"hashLeaf")});var ej=d(mI=>{"use strict";Object.defineProperty(mI,"__esModule",{value:!0});mI.verifyTLogSET=lce;var QU=ot(),cce=Pe(),uce=on();function lce(i,e){if(!(0,uce.filterTLogAuthorities)(e,{logID:i.logId.keyId,targetDate:new Date(Number(i.integratedTime)*1e3)}).some(s=>{let n=hce(i),a=Buffer.from(QU.json.canonicalize(n),"utf8"),c=i.inclusionPromise.signedEntryTimestamp;return QU.crypto.verify(a,s.publicKey,c)}))throw new cce.VerificationError({code:"TLOG_INCLUSION_PROMISE_ERROR",message:"inclusion promise could not be verified"})}o(lce,"verifyTLogSET");function hce(i){let{integratedTime:e,logIndex:t,logId:r,canonicalizedBody:s}=i;return{body:s.toString("base64"),integratedTime:Number(e),logIndex:Number(t),logID:r.keyId.toString("hex")}}o(hce,"toVerificationPayload")});var ij=d(yI=>{"use strict";Object.defineProperty(yI,"__esModule",{value:!0});yI.verifyRFC3161Timestamp=pce;var gI=ot(),tj=Pe(),fce=sI(),dce=on();function pce(i,e,t){let r=i.signingTime;if(t=(0,dce.filterCertAuthorities)(t,r),t=gce(t,{serialNumber:i.signerSerialNumber,issuer:i.signerIssuer}),!t.some(n=>{try{return mce(i,e,n),!0}catch{return!1}}))throw new tj.VerificationError({code:"TIMESTAMP_ERROR",message:"timestamp could not be verified"})}o(pce,"verifyRFC3161Timestamp");function mce(i,e,t){let[r,...s]=t.certChain,n=gI.crypto.createPublicKey(r.publicKey),a=i.signingTime;try{new fce.CertificateChainVerifier({untrustedCert:r,trustedCerts:s,timestamp:a}).verify()}catch{throw new tj.VerificationError({code:"TIMESTAMP_ERROR",message:"invalid certificate chain"})}i.verify(e,n)}o(mce,"verifyTimestampForCA");function gce(i,e){return i.filter(t=>t.certChain.length>0&&gI.crypto.bufferEqual(t.certChain[0].serialNumber,e.serialNumber)&&gI.crypto.bufferEqual(t.certChain[0].issuer,e.issuer))}o(gce,"filterCAsBySerialAndIssuer")});var rj=d(pm=>{"use strict";Object.defineProperty(pm,"__esModule",{value:!0});pm.verifyTSATimestamp=bce;pm.verifyTLogTimestamp=Ice;var yce=Pe(),Sce=YU(),Ece=XU(),wce=ej(),_ce=ij();function bce(i,e,t){return(0,_ce.verifyRFC3161Timestamp)(i,e,t),{type:"timestamp-authority",logID:i.signerSerialNumber,timestamp:i.signingTime}}o(bce,"verifyTSATimestamp");function Ice(i,e){let t=!1;if(Oce(i)&&((0,wce.verifyTLogSET)(i,e),t=!0),vce(i)&&((0,Ece.verifyMerkleInclusion)(i),(0,Sce.verifyCheckpoint)(i,e),t=!0),!t)throw new yce.VerificationError({code:"TLOG_MISSING_INCLUSION_ERROR",message:"inclusion could not be verified"});return{type:"transparency-log",logID:i.logId.keyId,timestamp:new Date(Number(i.integratedTime)*1e3)}}o(Ice,"verifyTLogTimestamp");function Oce(i){return i.inclusionPromise!==void 0}o(Oce,"isTLogEntryWithInclusionPromise");function vce(i){return i.inclusionProof!==void 0}o(vce,"isTLogEntryWithInclusionProof")});var sj=d(SI=>{"use strict";Object.defineProperty(SI,"__esModule",{value:!0});SI.verifyDSSETLogBody=Rce;var mm=Pe();function Rce(i,e){switch(i.apiVersion){case"0.0.1":return Ace(i,e);default:throw new mm.VerificationError({code:"TLOG_BODY_ERROR",message:`unsupported dsse version: ${i.apiVersion}`})}}o(Rce,"verifyDSSETLogBody");function Ace(i,e){if(i.spec.signatures?.length!==1)throw new mm.VerificationError({code:"TLOG_BODY_ERROR",message:"signature count mismatch"});let t=i.spec.signatures[0].signature;if(!e.compareSignature(Buffer.from(t,"base64")))throw new mm.VerificationError({code:"TLOG_BODY_ERROR",message:"tlog entry signature mismatch"});let r=i.spec.payloadHash?.value||"";if(!e.compareDigest(Buffer.from(r,"hex")))throw new mm.VerificationError({code:"TLOG_BODY_ERROR",message:"DSSE payload hash mismatch"})}o(Ace,"verifyDSSE001TLogBody")});var nj=d(wI=>{"use strict";Object.defineProperty(wI,"__esModule",{value:!0});wI.verifyHashedRekordTLogBody=Tce;var EI=Pe();function Tce(i,e){switch(i.apiVersion){case"0.0.1":return Cce(i,e);default:throw new EI.VerificationError({code:"TLOG_BODY_ERROR",message:`unsupported hashedrekord version: ${i.apiVersion}`})}}o(Tce,"verifyHashedRekordTLogBody");function Cce(i,e){let t=i.spec.signature.content||"";if(!e.compareSignature(Buffer.from(t,"base64")))throw new EI.VerificationError({code:"TLOG_BODY_ERROR",message:"signature mismatch"});let r=i.spec.data.hash?.value||"";if(!e.compareDigest(Buffer.from(r,"hex")))throw new EI.VerificationError({code:"TLOG_BODY_ERROR",message:"digest mismatch"})}o(Cce,"verifyHashedrekord001TLogBody")});var oj=d(_I=>{"use strict";Object.defineProperty(_I,"__esModule",{value:!0});_I.verifyIntotoTLogBody=Nce;var gm=Pe();function Nce(i,e){switch(i.apiVersion){case"0.0.2":return Pce(i,e);default:throw new gm.VerificationError({code:"TLOG_BODY_ERROR",message:`unsupported intoto version: ${i.apiVersion}`})}}o(Nce,"verifyIntotoTLogBody");function Pce(i,e){if(i.spec.content.envelope.signatures?.length!==1)throw new gm.VerificationError({code:"TLOG_BODY_ERROR",message:"signature count mismatch"});let t=Dce(i.spec.content.envelope.signatures[0].sig);if(!e.compareSignature(Buffer.from(t,"base64")))throw new gm.VerificationError({code:"TLOG_BODY_ERROR",message:"tlog entry signature mismatch"});let r=i.spec.content.payloadHash?.value||"";if(!e.compareDigest(Buffer.from(r,"hex")))throw new gm.VerificationError({code:"TLOG_BODY_ERROR",message:"DSSE payload hash mismatch"})}o(Pce,"verifyIntoto002TLogBody");function Dce(i){return Buffer.from(i,"base64").toString("utf-8")}o(Dce,"base64Decode")});var cj=d(bI=>{"use strict";Object.defineProperty(bI,"__esModule",{value:!0});bI.verifyTLogBody=Bce;var aj=Pe(),xce=sj(),Lce=nj(),Mce=oj();function Bce(i,e){let{kind:t,version:r}=i.kindVersion,s=JSON.parse(i.canonicalizedBody.toString("utf8"));if(t!==s.kind||r!==s.apiVersion)throw new aj.VerificationError({code:"TLOG_BODY_ERROR",message:`kind/version mismatch - expected: ${t}/${r}, received: ${s.kind}/${s.apiVersion}`});switch(s.kind){case"dsse":return(0,xce.verifyDSSETLogBody)(s,e);case"intoto":return(0,Mce.verifyIntotoTLogBody)(s,e);case"hashedrekord":return(0,Lce.verifyHashedRekordTLogBody)(s,e);default:throw new aj.VerificationError({code:"TLOG_BODY_ERROR",message:`unsupported kind: ${t}`})}}o(Bce,"verifyTLogBody")});var dj=d(ym=>{"use strict";Object.defineProperty(ym,"__esModule",{value:!0});ym.Verifier=void 0;var kce=require("util"),ra=Pe(),uj=JU(),lj=ZU(),hj=rj(),Fce=cj(),II=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 r=this.verifyTimestamps(e),s=this.verifySigningKey(e,r);return this.verifyTLogs(e),this.verifySignature(e,s),t&&this.verifyPolicy(t,s.identity||{}),s}verifyTimestamps(e){let t=0,r=0,s=e.timestamps.map(n=>{switch(n.$case){case"timestamp-authority":return r++,(0,hj.verifyTSATimestamp)(n.timestamp,e.signature.signature,this.trustMaterial.timestampAuthorities);case"transparency-log":return t++,(0,hj.verifyTLogTimestamp)(n.tlogEntry,this.trustMaterial.tlogs)}});if(fj(s))throw new ra.VerificationError({code:"TIMESTAMP_ERROR",message:"duplicate timestamp"});if(t<this.options.tlogThreshold)throw new ra.VerificationError({code:"TIMESTAMP_ERROR",message:`expected ${this.options.tlogThreshold} tlog timestamps, got ${t}`});if(r<this.options.tsaThreshold)throw new ra.VerificationError({code:"TIMESTAMP_ERROR",message:`expected ${this.options.tsaThreshold} tsa timestamps, got ${r}`});return s.map(n=>n.timestamp)}verifySigningKey({key:e},t){switch(e.$case){case"public-key":return(0,uj.verifyPublicKey)(e.hint,t,this.trustMaterial);case"certificate":{let r=(0,uj.verifyCertificate)(e.certificate,t,this.trustMaterial);if(fj(r.scts))throw new ra.VerificationError({code:"CERTIFICATE_ERROR",message:"duplicate SCT"});if(r.scts.length<this.options.ctlogThreshold)throw new ra.VerificationError({code:"CERTIFICATE_ERROR",message:`expected ${this.options.ctlogThreshold} SCTs, got ${r.scts.length}`});return r.signer}}}verifyTLogs({signature:e,tlogEntries:t}){t.forEach(r=>(0,Fce.verifyTLogBody)(r,e))}verifySignature(e,t){if(!e.signature.verifySignature(t.key))throw new ra.VerificationError({code:"SIGNATURE_ERROR",message:"signature verification failed"})}verifyPolicy(e,t){e.subjectAlternativeName&&(0,lj.verifySubjectAlternativeName)(e.subjectAlternativeName,t.subjectAlternativeName),e.extensions&&(0,lj.verifyExtensions)(e.extensions,t.extensions)}};ym.Verifier=II;function fj(i){for(let e=0;e<i.length;e++)for(let t=e+1;t<i.length;t++)if((0,kce.isDeepStrictEqual)(i[e],i[t]))return!0;return!1}o(fj,"containsDupes")});var Sm=d($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.Verifier=$t.toTrustMaterial=$t.VerificationError=$t.PolicyError=$t.toSignedEntity=void 0;var Uce=qU();Object.defineProperty($t,"toSignedEntity",{enumerable:!0,get:o(function(){return Uce.toSignedEntity},"get")});var pj=Pe();Object.defineProperty($t,"PolicyError",{enumerable:!0,get:o(function(){return pj.PolicyError},"get")});Object.defineProperty($t,"VerificationError",{enumerable:!0,get:o(function(){return pj.VerificationError},"get")});var jce=on();Object.defineProperty($t,"toTrustMaterial",{enumerable:!0,get:o(function(){return jce.toTrustMaterial},"get")});var $ce=dj();Object.defineProperty($t,"Verifier",{enumerable:!0,get:o(function(){return $ce.Verifier},"get")})});var mj=d(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.DEFAULT_TIMEOUT=Ke.DEFAULT_RETRY=void 0;Ke.createBundleBuilder=zce;Ke.createKeyFinder=Hce;Ke.createVerificationPolicy=Gce;var qce=ot(),sa=Ub(),Vce=Sm();Ke.DEFAULT_RETRY={retries:2};Ke.DEFAULT_TIMEOUT=5e3;function zce(i,e){let t={signer:Wce(e),witnesses:Kce(e)};switch(i){case"messageSignature":return new sa.MessageSignatureBundleBuilder(t);case"dsseEnvelope":return new sa.DSSEBundleBuilder({...t,certificateChain:e.legacyCompatibility})}}o(zce,"createBundleBuilder");function Hce(i){return e=>{let t=i(e);if(!t)throw new Vce.VerificationError({code:"PUBLIC_KEY_ERROR",message:`key not found: ${e}`});return{publicKey:qce.crypto.createPublicKey(t),validFor:o(()=>!0,"validFor")}}}o(Hce,"createKeyFinder");function Gce(i){let e={},t=i.certificateIdentityEmail||i.certificateIdentityURI;return t&&(e.subjectAlternativeName=t),i.certificateIssuer&&(e.extensions={issuer:i.certificateIssuer}),e}o(Gce,"createVerificationPolicy");function Wce(i){return new sa.FulcioSigner({fulcioBaseURL:i.fulcioURL,identityProvider:i.identityProvider||Jce(i),retry:i.retry??Ke.DEFAULT_RETRY,timeout:i.timeout??Ke.DEFAULT_TIMEOUT})}o(Wce,"initSigner");function Jce(i){let e=i.identityToken;return e?{getToken:o(()=>Promise.resolve(e),"getToken")}:new sa.CIContextProvider("sigstore")}o(Jce,"initIdentityProvider");function Kce(i){let e=[];return Zce(i)&&e.push(new sa.RekorWitness({rekorBaseURL:i.rekorURL,entryType:i.legacyCompatibility?"intoto":"dsse",fetchOnConflict:!1,retry:i.retry??Ke.DEFAULT_RETRY,timeout:i.timeout??Ke.DEFAULT_TIMEOUT})),Yce(i)&&e.push(new sa.TSAWitness({tsaBaseURL:i.tsaServerURL,retry:i.retry??Ke.DEFAULT_RETRY,timeout:i.timeout??Ke.DEFAULT_TIMEOUT})),e}o(Kce,"initWitnesses");function Zce(i){return i.tlogUpload!==!1}o(Zce,"isRekorEnabled");function Yce(i){return i.tsaServerURL!==void 0}o(Yce,"isTSAEnabled")});var Sj=d(qt=>{"use strict";var Xce=qt&&qt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=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(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),Qce=qt&&qt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),gj=qt&&qt.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&Xce(t,e,r[s]);return Qce(t,e),t}})();Object.defineProperty(qt,"__esModule",{value:!0});qt.sign=tue;qt.attest=iue;qt.verify=rue;qt.createVerifier=yj;var vI=ou(),eue=gj(sm()),OI=Sm(),na=gj(mj());async function tue(i,e={}){let r=await na.createBundleBuilder("messageSignature",e).create({data:i});return(0,vI.bundleToJSON)(r)}o(tue,"sign");async function iue(i,e,t={}){let s=await na.createBundleBuilder("dsseEnvelope",t).create({data:i,type:e});return(0,vI.bundleToJSON)(s)}o(iue,"attest");async function rue(i,e,t){let r;return Buffer.isBuffer(e)?r=e:t=e,yj(t).then(s=>s.verify(i,r))}o(rue,"verify");async function yj(i={}){let e=await eue.getTrustedRoot({mirrorURL:i.tufMirrorURL,rootPath:i.tufRootPath,cachePath:i.tufCachePath,forceCache:i.tufForceCache,retry:i.retry??na.DEFAULT_RETRY,timeout:i.timeout??na.DEFAULT_TIMEOUT}),t=i.keySelector?na.createKeyFinder(i.keySelector):void 0,r=(0,OI.toTrustMaterial)(e,t),s={ctlogThreshold:i.ctLogThreshold,tlogThreshold:i.tlogThreshold},n=new OI.Verifier(r,s),a=na.createVerificationPolicy(i);return{verify:o((c,u)=>{let l=(0,vI.bundleFromJSON)(c),h=(0,OI.toSignedEntity)(l,u);n.verify(h,a)},"verify")}}o(yj,"createVerifier")});var wj=d(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.verify=ue.sign=ue.createVerifier=ue.attest=ue.VerificationError=ue.PolicyError=ue.TUFError=ue.InternalError=ue.DEFAULT_REKOR_URL=ue.DEFAULT_FULCIO_URL=ue.ValidationError=void 0;var sue=ou();Object.defineProperty(ue,"ValidationError",{enumerable:!0,get:o(function(){return sue.ValidationError},"get")});var RI=Ub();Object.defineProperty(ue,"DEFAULT_FULCIO_URL",{enumerable:!0,get:o(function(){return RI.DEFAULT_FULCIO_URL},"get")});Object.defineProperty(ue,"DEFAULT_REKOR_URL",{enumerable:!0,get:o(function(){return RI.DEFAULT_REKOR_URL},"get")});Object.defineProperty(ue,"InternalError",{enumerable:!0,get:o(function(){return RI.InternalError},"get")});var nue=sm();Object.defineProperty(ue,"TUFError",{enumerable:!0,get:o(function(){return nue.TUFError},"get")});var Ej=Sm();Object.defineProperty(ue,"PolicyError",{enumerable:!0,get:o(function(){return Ej.PolicyError},"get")});Object.defineProperty(ue,"VerificationError",{enumerable:!0,get:o(function(){return Ej.VerificationError},"get")});var Em=Sj();Object.defineProperty(ue,"attest",{enumerable:!0,get:o(function(){return Em.attest},"get")});Object.defineProperty(ue,"createVerifier",{enumerable:!0,get:o(function(){return Em.createVerifier},"get")});Object.defineProperty(ue,"sign",{enumerable:!0,get:o(function(){return Em.sign},"get")});Object.defineProperty(ue,"verify",{enumerable:!0,get:o(function(){return Em.verify},"get")})});var NI=d((CIe,vj)=>{var oue=require("node:crypto"),_j=Yl(),aue=Jl(),AI=ai(),cue=Un(),uue=wj(),TI=x_(),lue=xs(),hue=ru(),bj=L_().version,Ij=XE(),Oj=Ds(),fue="application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*",due="application/json",pue="2015-01-01T00:00:00.000Z",CI=class extends lue{static{o(this,"RegistryFetcher")}#e;constructor(e,t){super(e,t),this.packumentCache=this.opts.packumentCache||null,this.registry=TI.pickRegistry(e,t),this.packumentUrl=`${Ij(this.registry)}/${this.spec.escapedName}`,this.#e=`${this.fullMetadata?"full":"corgi"}:${this.packumentUrl}`;let r=new URL(this.registry),s=`//${r.host}${r.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/${bj} node/${process.version}`,...this.opts.headers||{},"pacote-version":bj,"pacote-req-type":"packument","pacote-pkg-id":`registry:${this.spec.name}`,accept:this.fullMetadata?due:fue}}async packument(){if(this.packumentCache?.has(this.#e))return this.packumentCache.get(this.#e);try{let e=await TI(this.packumentUrl,{...this.opts,headers:this.#t(),spec:this.spec,integrity:null}),t=await e.json(),r=e.headers.get("content-length");return r&&(t._contentLength=Number(r)),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=_j.normalizeSteps.filter(a=>a!=="_attributes"),r=await new _j().fromContent(aue(e,this.spec.fetchSpec,{...this.opts,defaultTag:this.defaultTag,before:this.before})).normalize({steps:t}).then(a=>a.content),s=e.time?.[r.version];s&&(r._time=s);let{dist:n}=r;if(n){this.resolved=r._resolved=n.tarball,r._from=this.from;let a=n.integrity?AI.parse(n.integrity):n.shasum?AI.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(r._integrity=String(this.integrity),n.signatures)if(this.opts.verifySignatures){let a=`${r._id}:${r._integrity}`;for(let c of n.signatures){let u=this.registryKeys&&this.registryKeys.filter(m=>m.keyid===c.keyid)[0];if(!u)throw Object.assign(new Error(`${r._id} has a registry signature with keyid: ${c.keyid} but no corresponding public key can be found`),{code:"EMISSINGSIGNATUREKEY"});let l=Date.parse(r._time||pue);if(!(!u.expires||l<Date.parse(u.expires)))throw Object.assign(new Error(`${r._id} has a registry signature with keyid: ${c.keyid} but the corresponding public key has expired ${u.expires}`),{code:"EEXPIREDSIGNATUREKEY"});let f=oue.createVerify("SHA256");if(f.write(a),f.end(),!f.verify(u.pemkey,c.sig,"base64"))throw Object.assign(new Error(`${r._id} has an invalid registry signature with keyid: ${u.keyid} and signature: ${c.sig}`),{code:"EINTEGRITYSIGNATURE",keyid:u.keyid,signature:c.sig,resolved:r._resolved,integrity:r._integrity})}r._signatures=n.signatures}else r._signatures=n.signatures;if(n.attestations)if(this.opts.verifyAttestations){let a=new URL(n.attestations.url).pathname,c=Ij(this.registry)+a,u=await TI(c,{...this.opts,integrity:null}),{attestations:l}=await u.json(),h=l.map(({predicateType:m,bundle:y})=>{let g=JSON.parse(Buffer.from(y.dsseEnvelope.payload,"base64").toString("utf8")),S=y.dsseEnvelope.signatures[0].keyid,E=y.dsseEnvelope.signatures[0].sig;return{predicateType:m,bundle:y,statement:g,keyid:S,signature:E}}),f=h.map(m=>m.keyid).filter(m=>!!m),p=(this.registryKeys||[]).filter(m=>f.includes(m.keyid));if(!p.length)throw Object.assign(new Error(`${r._id} has attestations but no corresponding public key(s) can be found`),{code:"EMISSINGSIGNATUREKEY"});for(let{predicateType:m,bundle:y,keyid:g,signature:S,statement:E}of h){let _=p.find(v=>v.keyid===g);if(g){if(!_)throw Object.assign(new Error(`${r._id} has attestations with keyid: ${g} but no corresponding public key can be found`),{code:"EMISSINGSIGNATUREKEY"});let v=new Date(Number(y.verificationMaterial.tlogEntries[0].integratedTime)*1e3);if(!(!_.expires||v<Date.parse(_.expires)))throw Object.assign(new Error(`${r._id} has attestations with keyid: ${g} but the corresponding public key has expired ${_.expires}`),{code:"EEXPIREDSIGNATUREKEY"})}let b={name:E.subject[0].name,sha512:E.subject[0].digest.sha512},w=this.spec.type==="version"?cue.toPurl(this.spec):this.spec;if(b.name!==w)throw Object.assign(new Error(`${r._id} package name and version (PURL): ${w} doesn't match what was signed: ${b.name}`),{code:"EATTESTATIONSUBJECT"});let I=AI.parse(this.integrity).hexDigest();if(b.sha512!==I)throw Object.assign(new Error(`${r._id} package integrity (hex digest): ${I} doesn't match what was signed: ${b.sha512}`),{code:"EATTESTATIONSUBJECT"});try{let v={tufCachePath:this.tufCache,tufForceCache:!0,keySelector:_?()=>_.pemkey:void 0};await uue.verify(y,v)}catch(v){throw Object.assign(new Error(`${r._id} failed to verify attestation: ${v.message}`),{code:"EATTESTATIONVERIFY",predicateType:m,keyid:g,signature:S,resolved:r._resolved,integrity:r._integrity})}}r._attestations=n.attestations}else r._attestations=n.attestations}return this.package=r,this.package}[Oj.tarballFromResolved](){return new hue(this.resolved,{...this.opts,resolved:this.resolved,pkgid:`registry:${this.spec.name}@${this.resolved}`})[Oj.tarballFromResolved]()}get types(){return["tag","version","range"]}};vj.exports=CI});var xs=d((PIe,Pj)=>{var{basename:mue,dirname:Rj}=require("node:path"),{rm:gue,mkdir:Aj}=require("node:fs/promises"),Cj=Yl(),PI=dc(),yue=Ln(),Sue=CN(),Nj=Un(),Eue=xa(),DI=ai(),wue=KE(),{Minipass:_ue}=te(),{log:rs}=St(),Lu=Ds(),Tj=mD(),bue=YE(),Iue=XE(),Oue=o(i=>Cj.prepare(i).then(e=>e.content),"packageJsonPrepare"),vue=o(i=>Cj.normalize(i).then(e=>e.content),"packageJsonNormalize"),wm=class{static{o(this,"FetcherBase")}constructor(e,t){if(!t||typeof t!="object")throw new TypeError("options object is required");this.spec=Nj(e,t.where),this.allowGitIgnore=!!t.allowGitIgnore,this.from=this.spec.registry?`${this.spec.name}@${this.spec.rawSpec}`:this.spec.saveSpec,this.#i(),this.opts={...t},this.cache=t.cache||Tj().cacache,this.tufCache=t.tufCache||Tj().tufcache,this.resolved=t.resolved||null,this.defaultIntegrityAlgorithm=t.defaultIntegrityAlgorithm||"sha512",typeof t.integrity=="string"&&(this.opts.integrity=DI.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[Lu.readPackageJson]=this.fullReadJson?Oue:vue,this.replaceRegistryHost=!t.replaceRegistryHost||t.replaceRegistryHost==="npmjs"?"registry.npmjs.org":t.replaceRegistryHost,this.defaultTag=t.defaultTag||"latest",this.registry=Iue(t.registry||"https://registry.npmjs.org"),this.npmBin=t.npmBin||"npm",this.npmInstallCmd=t.npmInstallCmd||["install","--force"],this.npmCliConfig=t.npmCliConfig||[`--cache=${Rj(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=DI.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)}[Lu.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=PI.get.stream.byDigest(this.cache,this.integrity,this.opts),r=Date.now()-e;return rs.http("cache",`${this.spec} ${r}ms (cache hit)`),t}get[Lu.cacheFetches](){return!0}#t(e){if(!this.opts.cache||!this[Lu.cacheFetches]){if(e.hasIntegrityEmitter)return e.on("integrity",n=>this.integrity=n),e;let s=DI.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 _ue;e.on("error",s=>t.emit("error",s)),e.pipe(t,{end:!1});let r=PI.put.stream(this.opts.cache,`pacote:tarball:${this.from}`,this.opts);return r.on("integrity",s=>this.integrity=s),r.on("error",s=>e.emit("error",s)),e.pipe(r),r.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}#i(){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 rs.warn("tarball",`cached data for ${this.spec} (${this.integrity}) seems to be corrupted. Refreshing cache.`),this.cleanupCached().then(()=>{throw s});throw s}):null,r=o(s=>{if(s){if(!this.isRetriableError(s))throw s;rs.silly("tarball",`no local data for ${this.spec}. Extracting by manifest.`)}return this.resolve().then(()=>Eue(n=>e(this.#t(this[Lu.tarballFromResolved]())).catch(a=>{if(this.isRetriableError(a))return rs.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(r):r()}cleanupCached(){return PI.rm.content(this.cache,this.integrity,this.opts)}#r(e){return Sue({path:e,depth:1}).then(t=>Promise.all(t.map(r=>gue(r,{recursive:!0,force:!0}))))}async#s(e){return await this.#r(e),await Aj(e,{recursive:!0})}async extract(e){return await this.#s(e),this.tarballStream(t=>this.#c(e,t))}#u(e){return this.tarballStream(t=>new Promise((r,s)=>{let n=new yue.WriteStream(e);t.on("error",a=>n.emit("error",a)),n.on("error",a=>s(a)),n.on("close",()=>r({integrity:this.integrity&&String(this.integrity),resolved:this.resolved,from:this.from})),t.pipe(n)}))}async tarballFile(e){let t=Rj(e);return await Aj(t,{recursive:!0}),this.#u(e)}#c(e,t){let r=wue.x(this.#n({cwd:e})),s=new Promise((n,a)=>{r.on("end",()=>{n({resolved:this.resolved,integrity:this.integrity&&String(this.integrity),from:this.from})}),r.on("error",c=>{rs.warn("tar",c.message),rs.silly("tar",c),a(c)}),t.on("error",c=>a(c))});return t.pipe(r),s}#f(e,t,r){let s=/Directory|GNUDumpDir/.test(r)?this.dmode:/File$/.test(r)?this.fmode:0,n=bue(this.package,e)?73:0;return(t|s)&~this.umask|n|384}#n({cwd:e}){let t=new Set;return{cwd:e,noChmod:!0,noMtime:!0,filter:o((r,s)=>{if(/Link$/.test(s.type))return!1;if(s.mode=this.#f(s.path,s.mode,s.type),/File$/.test(s.type)){let n=mue(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((r,s,n)=>{rs.warn("tar",r,s),rs.silly("tar",r,s,n)},"onwarn"),umask:this.umask,preserveOwner:!1}}};Pj.exports=wm;var Rue=k_(),Aue=NI(),Tue=fo(),Cue=$f(),Nue=ru();wm.get=(i,e={})=>{let t=Nj(i,e.where);switch(t.type){case"git":return new Rue(t,e);case"remote":return new Nue(t,e);case"version":case"range":case"tag":case"alias":return new Aue(t.subSpec||t,e);case"file":return new Tue(t,e);case"directory":return new Cue(t,e);default:throw new TypeError("Unknown spec type: "+t.type)}}});var xj=d((xIe,Dj)=>{var{get:an}=xs(),Pue=k_(),Due=NI(),xue=fo(),Lue=$f(),Mue=ru(),xI=o((i,e)=>an(i,e).tarball(),"tarball");xI.stream=(i,e,t)=>an(i,t).tarballStream(e);xI.file=(i,e,t)=>an(i,t).tarballFile(e);Dj.exports={GitFetcher:Pue,RegistryFetcher:Due,FileFetcher:xue,DirFetcher:Lue,RemoteFetcher:Mue,resolve:o((i,e)=>an(i,e).resolve(),"resolve"),extract:o((i,e,t)=>an(i,t).extract(e),"extract"),manifest:o((i,e)=>an(i,e).manifest(),"manifest"),packument:o((i,e)=>an(i,e).packument(),"packument"),tarball:xI}});module.exports=xj();
63
64
  /*! Bundled license information:
64
65
 
65
66
  imurmurhash/imurmurhash.js: