@visulima/vis 1.0.0-alpha.9 → 1.0.1

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 (278) hide show
  1. package/CHANGELOG.md +1854 -3
  2. package/LICENSE.md +13515 -10
  3. package/README.md +215 -39
  4. package/bin/resolve-binary.mjs +85 -0
  5. package/bin/vis.mjs +76 -0
  6. package/dashboard/dist/index.html +152 -0
  7. package/dist/bin.d.ts +1 -0
  8. package/dist/bin.js +1 -2
  9. package/dist/binx.js +3 -0
  10. package/dist/config/index.d.ts +3276 -0
  11. package/dist/config/index.js +1 -0
  12. package/dist/generate/index.d.ts +1 -1
  13. package/dist/generate/index.js +1 -1
  14. package/dist/packem_chunks/CONFIG_FILES.js +8 -0
  15. package/dist/packem_chunks/DEFAULT_CLEAN_KEEP.js +1 -0
  16. package/dist/packem_chunks/agent-instructions.js +11 -0
  17. package/dist/packem_chunks/bloom-status.js +2 -0
  18. package/dist/packem_chunks/bloom-sync.js +2 -0
  19. package/dist/packem_chunks/cache-attestation.js +1 -0
  20. package/dist/packem_chunks/catalog-detector.js +1 -0
  21. package/dist/packem_chunks/catalog.js +114 -0
  22. package/dist/packem_chunks/cli-exec.js +1 -0
  23. package/dist/packem_chunks/cli-main.js +268 -0
  24. package/dist/packem_chunks/defineReleasePlugin.js +3 -0
  25. package/dist/packem_chunks/detect.js +3 -0
  26. package/dist/packem_chunks/detect2.js +8 -0
  27. package/dist/packem_chunks/devtools.js +4 -0
  28. package/dist/packem_chunks/discord.js +4 -0
  29. package/dist/packem_chunks/dispatch.js +4 -0
  30. package/dist/packem_chunks/doctor-probe.js +2 -0
  31. package/dist/packem_chunks/dynamic-import.js +1 -0
  32. package/dist/packem_chunks/extra-files.js +3 -0
  33. package/dist/packem_chunks/fix.js +11 -0
  34. package/dist/packem_chunks/git.js +3 -0
  35. package/dist/packem_chunks/group-tags.js +1 -0
  36. package/dist/packem_chunks/handler.js +1 -1
  37. package/dist/packem_chunks/handler10.js +5 -1
  38. package/dist/packem_chunks/handler11.js +1 -1
  39. package/dist/packem_chunks/handler12.js +26 -152
  40. package/dist/packem_chunks/handler13.js +5 -1
  41. package/dist/packem_chunks/handler14.js +1 -3
  42. package/dist/packem_chunks/handler15.js +1 -1
  43. package/dist/packem_chunks/handler16.js +1 -2
  44. package/dist/packem_chunks/handler17.js +1 -7
  45. package/dist/packem_chunks/handler18.js +1 -1
  46. package/dist/packem_chunks/handler19.js +5 -19
  47. package/dist/packem_chunks/handler2.js +1 -1
  48. package/dist/packem_chunks/handler20.js +2 -428
  49. package/dist/packem_chunks/handler21.js +2 -22
  50. package/dist/packem_chunks/handler22.js +14 -3
  51. package/dist/packem_chunks/handler23.js +1 -5
  52. package/dist/packem_chunks/handler24.js +1 -1
  53. package/dist/packem_chunks/handler25.js +1 -20
  54. package/dist/packem_chunks/handler26.js +5 -1
  55. package/dist/packem_chunks/handler27.js +1 -1
  56. package/dist/packem_chunks/handler28.js +3 -1
  57. package/dist/packem_chunks/handler29.js +1 -2
  58. package/dist/packem_chunks/handler3.js +4 -2
  59. package/dist/packem_chunks/handler30.js +1 -22
  60. package/dist/packem_chunks/handler31.js +2 -1
  61. package/dist/packem_chunks/handler32.js +2 -1
  62. package/dist/packem_chunks/handler33.js +2 -37
  63. package/dist/packem_chunks/handler34.js +3 -3
  64. package/dist/packem_chunks/handler35.js +6 -23
  65. package/dist/packem_chunks/handler36.js +1 -5
  66. package/dist/packem_chunks/handler37.js +36 -21
  67. package/dist/packem_chunks/handler38.js +8 -1
  68. package/dist/packem_chunks/handler39.js +9 -2
  69. package/dist/packem_chunks/handler4.js +4 -5
  70. package/dist/packem_chunks/handler40.js +75 -1
  71. package/dist/packem_chunks/handler41.js +5 -5
  72. package/dist/packem_chunks/handler42.js +4 -1
  73. package/dist/packem_chunks/handler43.js +3 -24
  74. package/dist/packem_chunks/handler44.js +2 -3
  75. package/dist/packem_chunks/handler45.js +1 -1
  76. package/dist/packem_chunks/handler46.js +1 -0
  77. package/dist/packem_chunks/handler47.js +1 -0
  78. package/dist/packem_chunks/handler48.js +3 -0
  79. package/dist/packem_chunks/handler49.js +1 -0
  80. package/dist/packem_chunks/handler5.js +6 -4
  81. package/dist/packem_chunks/handler50.js +7 -0
  82. package/dist/packem_chunks/handler51.js +33 -0
  83. package/dist/packem_chunks/handler52.js +3 -0
  84. package/dist/packem_chunks/handler53.js +8 -0
  85. package/dist/packem_chunks/handler54.js +4 -0
  86. package/dist/packem_chunks/handler55.js +1 -0
  87. package/dist/packem_chunks/handler56.js +12 -0
  88. package/dist/packem_chunks/handler57.js +11 -0
  89. package/dist/packem_chunks/handler58.js +5 -0
  90. package/dist/packem_chunks/handler59.js +11 -0
  91. package/dist/packem_chunks/handler6.js +8 -2
  92. package/dist/packem_chunks/handler60.js +3 -0
  93. package/dist/packem_chunks/handler61.js +22 -0
  94. package/dist/packem_chunks/handler62.js +61 -0
  95. package/dist/packem_chunks/handler63.js +3 -0
  96. package/dist/packem_chunks/handler64.js +6 -0
  97. package/dist/packem_chunks/handler65.js +9 -0
  98. package/dist/packem_chunks/handler66.js +2 -0
  99. package/dist/packem_chunks/handler67.js +24 -0
  100. package/dist/packem_chunks/handler68.js +25 -0
  101. package/dist/packem_chunks/handler69.js +153 -0
  102. package/dist/packem_chunks/handler7.js +1 -24
  103. package/dist/packem_chunks/handler70.js +10 -0
  104. package/dist/packem_chunks/handler71.js +23 -0
  105. package/dist/packem_chunks/handler72.js +322 -0
  106. package/dist/packem_chunks/handler73.js +708 -0
  107. package/dist/packem_chunks/handler74.js +48 -0
  108. package/dist/packem_chunks/handler75.js +27 -0
  109. package/dist/packem_chunks/handler76.js +3 -0
  110. package/dist/packem_chunks/handler77.js +190 -0
  111. package/dist/packem_chunks/handler78.js +38 -0
  112. package/dist/packem_chunks/handler8.js +1 -6
  113. package/dist/packem_chunks/handler9.js +1 -8
  114. package/dist/packem_chunks/heal-accept.js +10 -0
  115. package/dist/packem_chunks/heal.js +14 -0
  116. package/dist/packem_chunks/help-command.js +31 -0
  117. package/dist/packem_chunks/index.js +1 -7
  118. package/dist/packem_chunks/index2.js +802 -0
  119. package/dist/packem_chunks/index3.js +7 -0
  120. package/dist/packem_chunks/index4.js +135 -0
  121. package/dist/packem_chunks/index5.js +73 -0
  122. package/dist/packem_chunks/interface.js +2 -0
  123. package/dist/packem_chunks/keys-refresh.js +4 -0
  124. package/dist/packem_chunks/lean.js +4 -0
  125. package/dist/packem_chunks/list.js +3 -0
  126. package/dist/packem_chunks/loader.js +4 -1
  127. package/dist/packem_chunks/loader2.js +1 -0
  128. package/dist/packem_chunks/orchestrator.js +42 -0
  129. package/dist/packem_chunks/pre-mode.js +2 -0
  130. package/dist/packem_chunks/print-config.js +2 -0
  131. package/dist/packem_chunks/prompts.js +7 -0
  132. package/dist/packem_chunks/prune.js +3 -0
  133. package/dist/packem_chunks/publish-guards.js +1 -0
  134. package/dist/packem_chunks/registry.js +48 -0
  135. package/dist/packem_chunks/resolveFormatter.js +9 -0
  136. package/dist/packem_chunks/run.js +1 -0
  137. package/dist/packem_chunks/security.js +1 -0
  138. package/dist/packem_chunks/shell-runner.js +1 -0
  139. package/dist/packem_chunks/slack.js +2 -0
  140. package/dist/packem_chunks/snapshot.js +2 -0
  141. package/dist/packem_chunks/stage-publisher.js +1 -0
  142. package/dist/packem_chunks/staged-registry.js +2 -0
  143. package/dist/packem_chunks/state.js +3 -0
  144. package/dist/packem_chunks/status.js +2 -0
  145. package/dist/packem_chunks/success-walk.js +8 -0
  146. package/dist/packem_chunks/sync.js +2 -0
  147. package/dist/packem_chunks/sync2.js +2 -0
  148. package/dist/packem_chunks/tar.js +3 -0
  149. package/dist/packem_chunks/tripwire.js +2 -0
  150. package/dist/packem_chunks/ts-loader.js +22 -0
  151. package/dist/packem_chunks/verify-lockfile.js +2 -0
  152. package/dist/packem_chunks/version-resolver.js +2 -0
  153. package/dist/packem_chunks/webhook.js +1 -0
  154. package/dist/packem_chunks/workflow-templates.js +167 -0
  155. package/dist/packem_chunks/workspace.js +2 -0
  156. package/dist/packem_shared/AfterAllProjectsVersioned-CAKI2nWf.js +1 -0
  157. package/dist/packem_shared/MultiSpinner-B9U0-aE3-B-gIXhFk.js +3 -0
  158. package/dist/packem_shared/ReleaseClient-BY4OZNCK.js +1 -0
  159. package/dist/packem_shared/Table-BGIHvenQ-D2oJtNQj.js +34 -0
  160. package/dist/packem_shared/VisReleaseError-DMGRBTNO.js +1 -0
  161. package/dist/packem_shared/_commonjsHelpers-B5Y90VFO.js +1 -0
  162. package/dist/packem_shared/advisories-CaP4uNhD.js +1 -0
  163. package/dist/packem_shared/affected-shas-BfO3PDJq.js +1 -0
  164. package/dist/packem_shared/ai-analysis-CO7No4rt.js +68 -0
  165. package/dist/packem_shared/ai-fix-B4u2zlVG.js +43 -0
  166. package/dist/packem_shared/anolilab-text-CAM_E6uK.js +13 -0
  167. package/dist/packem_shared/api.d-BPftyU9r.d.ts +27 -0
  168. package/dist/packem_shared/augment-8z86AwtF.js +4 -0
  169. package/dist/packem_shared/bin-Cv8vsMEo.js +1 -0
  170. package/dist/packem_shared/build-scripts-D477Ou-x.js +1 -0
  171. package/dist/packem_shared/command-runtime-EWjmSxPj.js +1 -0
  172. package/dist/packem_shared/compile-cache-B_Vf_WxT.js +3 -0
  173. package/dist/packem_shared/createAdapter-bU4DIP3F.js +1 -0
  174. package/dist/packem_shared/createVersionActions-BK43SNDH.js +1 -0
  175. package/dist/packem_shared/cyclonedx-CDWHbD9s.js +4 -0
  176. package/dist/packem_shared/defineFormatter-D5dCp6Kv.js +1 -0
  177. package/dist/packem_shared/definePlugin-DoUcoYSy.js +1 -0
  178. package/dist/packem_shared/dependency-scan-P52jY0pU.js +1 -0
  179. package/dist/packem_shared/docker-CD7o1D1o.js +59 -0
  180. package/dist/packem_shared/env-Cpxa_7UE.js +27 -0
  181. package/dist/packem_shared/failure-log-MOhz-TBv.js +2 -0
  182. package/dist/packem_shared/giget-DVTFJlbR.js +2 -0
  183. package/dist/packem_shared/glob-DMbPwGSj-uzODoE-1.js +1 -0
  184. package/dist/packem_shared/index-B0EsgdzO.js +1 -0
  185. package/dist/packem_shared/index-BAUIIRZJ.js +1 -0
  186. package/dist/packem_shared/index-BVuCxe14.js +22 -0
  187. package/dist/packem_shared/index-CdTXvj-V.js +1 -0
  188. package/dist/packem_shared/index-CgXLAAVI.js +28 -0
  189. package/dist/packem_shared/index-DjTWo3sH.js +1 -0
  190. package/dist/packem_shared/index.server-J83sowC4.js +2 -0
  191. package/dist/packem_shared/interface.d-B7VK2rcH.d.ts +148 -0
  192. package/dist/packem_shared/interface.d-Cezzifoh.d.ts +106 -0
  193. package/dist/packem_shared/license-t5KnNX6v.js +1 -0
  194. package/dist/packem_shared/lifecycle-hzwghh5a.js +2 -0
  195. package/dist/packem_shared/lockfile-CWcVTdRc.js +1 -0
  196. package/dist/packem_shared/main-B3juSU5z.js +1 -0
  197. package/dist/packem_shared/manifests-CaPqgQxW.js +1 -0
  198. package/dist/packem_shared/min-release-age-skpcnlpk.js +34 -0
  199. package/dist/packem_shared/missing-package-json-_hOp4AW5.js +1 -0
  200. package/dist/packem_shared/native-config-sync-CFi1iQNG.js +21 -0
  201. package/dist/packem_shared/osv-bloom-BAyJUnRx.js +2 -0
  202. package/dist/packem_shared/otelPlugin-DmKDBaPo.js +1 -0
  203. package/dist/packem_shared/packument-CYxvm590.js +1 -0
  204. package/dist/packem_shared/peer-warnings-BXAzXqY3.js +1 -0
  205. package/dist/packem_shared/plugins.d-ND23R9I3.d.ts +4 -0
  206. package/dist/packem_shared/pm-runner-mVFjedM6.js +1 -0
  207. package/dist/packem_shared/prompt-DjXHVgYU.js +1 -0
  208. package/dist/packem_shared/provenance-CI_WQx7G.js +1 -0
  209. package/dist/packem_shared/public-api-WqUCiyIe.js +131 -0
  210. package/dist/packem_shared/readJsonSync-DuMMeB3s-Cx08VBQg.js +1 -0
  211. package/dist/packem_shared/registry-keys-AGlSEY6R.js +1 -0
  212. package/dist/packem_shared/resolve-explicit-DVE9cfkm.js +5 -0
  213. package/dist/packem_shared/resolve-runtime-CGHf-wHz.js +1 -0
  214. package/dist/packem_shared/run-file-Bs_E9O6O.js +1 -0
  215. package/dist/packem_shared/runtime-check-pS2XH4BO.js +1 -0
  216. package/dist/packem_shared/runtime-process-Dmz0vCJy-DUwTvH1J.js +1 -0
  217. package/dist/packem_shared/s1ngularity-xmrq5T5r.js +1 -0
  218. package/dist/packem_shared/scan-progress-DQ4TMXcb.js +2 -0
  219. package/dist/packem_shared/selectors-CRgS4bU9.js +3 -0
  220. package/dist/packem_shared/signatures-Dp3th1DB.js +2 -0
  221. package/dist/packem_shared/slug-DoueYuLo.js +1 -0
  222. package/dist/packem_shared/spinner-DuJJvFTl.js +1 -0
  223. package/dist/packem_shared/sticky-comment-D6_7-w8T.js +1 -0
  224. package/dist/packem_shared/subtree-C7bZuiSQ.js +2 -0
  225. package/dist/packem_shared/symbols-DPTlrJ3B.js +1 -0
  226. package/dist/packem_shared/tabs-CgxCvjCY.js +1 -0
  227. package/dist/packem_shared/target-merge-D2eTghgd.js +11 -0
  228. package/dist/packem_shared/target-options-TM6ETDAS.js +1 -0
  229. package/dist/packem_shared/toolchain-B5KwUZfq.js +5 -0
  230. package/dist/packem_shared/typosquats-C0layQsP.js +1 -0
  231. package/dist/packem_shared/use-measured-height-Drobr4fe.js +1 -0
  232. package/dist/packem_shared/utils-CRueU43T.js +1 -0
  233. package/dist/packem_shared/verify-Cjo4EBFZ.js +1 -0
  234. package/dist/packem_shared/vis-update-app-qIkyvrd1.js +1 -0
  235. package/dist/packem_shared/watch-BnE1TzYn.js +1 -0
  236. package/dist/packem_shared/watch-loop-Irf3Pm-1.js +11 -0
  237. package/dist/release/core/changelog/index.d.ts +5 -0
  238. package/dist/release/core/changelog/index.js +1 -0
  239. package/dist/release/core/package-managers/index.d.ts +6 -0
  240. package/dist/release/core/package-managers/index.js +1 -0
  241. package/dist/release/core/version-actions/index.d.ts +14 -0
  242. package/dist/release/core/version-actions/index.js +1 -0
  243. package/dist/release/index.d.ts +233 -0
  244. package/dist/release/index.js +1 -0
  245. package/dist/release/plugin-sdk.d.ts +128 -0
  246. package/dist/release/plugin-sdk.js +1 -0
  247. package/dist/release/presets.d.ts +225 -0
  248. package/dist/release/presets.js +1 -0
  249. package/dist/release/types.d.ts +1493 -0
  250. package/dist/release/types.js +1 -0
  251. package/dist/runtime/preload.d.ts +1 -0
  252. package/dist/runtime/preload.js +1 -0
  253. package/index.d.ts +450 -0
  254. package/index.js +663 -556
  255. package/package.json +105 -62
  256. package/schemas/project.schema.json +872 -225
  257. package/schemas/vis-config.schema.json +6309 -264
  258. package/schemas/vis-release-config.schema.json +1423 -0
  259. package/skills/vis/SKILL.md +96 -0
  260. package/templates/buildkite-ci/.buildkite/pipeline.yml.tera +85 -0
  261. package/templates/buildkite-ci/template.yml +20 -0
  262. package/dist/config.d.ts +0 -1087
  263. package/dist/config.js +0 -1
  264. package/dist/packem_shared/VisUpdateApp-BBx3idMI.js +0 -1
  265. package/dist/packem_shared/ai-analysis-DDqXRFxY.js +0 -67
  266. package/dist/packem_shared/bin-BaZZ32BK.js +0 -93
  267. package/dist/packem_shared/cache-directory-DL8hfXeG.js +0 -1
  268. package/dist/packem_shared/catalog-CuSpuB_R.js +0 -12
  269. package/dist/packem_shared/dependency-scan-BoLG2Fez.js +0 -1
  270. package/dist/packem_shared/docker-BcfqH4Av.js +0 -2
  271. package/dist/packem_shared/flakiness-DSIHZGBT.js +0 -1
  272. package/dist/packem_shared/otelPlugin-DxyvBcXO.js +0 -1
  273. package/dist/packem_shared/runtime-check-CGHal8SO.js +0 -1
  274. package/dist/packem_shared/selectors-CfH9ZY08.js +0 -3
  275. package/dist/packem_shared/symbols-CIMw60-G.js +0 -1
  276. package/dist/packem_shared/toolchain-C3ZG0o_X.js +0 -5
  277. package/dist/packem_shared/typosquats-Bpq4zcWL.js +0 -1
  278. package/dist/packem_shared/utils-DrNg0XTR.js +0 -1
@@ -0,0 +1,21 @@
1
+ import{m as c,v as f,T as i,f as y}from"./index-BVuCxe14.js";import"./public-api-WqUCiyIe.js";import{u as O}from"../packem_chunks/ts-loader.js";import{n as C}from"../packem_chunks/cli-main.js";import{a as D}from"./readJsonSync-DuMMeB3s-Cx08VBQg.js";const v=(E,a,o)=>{const s=[],$=Object.entries(o).filter(([,n])=>n).map(([n])=>n);switch(E){case"bun":{const n=c(a,"package.json");if(y(n))try{const e=D(n);e.trustedDependencies=$,i(n,`${JSON.stringify(e,null,2)}
2
+ `),s.push(`Updated package.json trustedDependencies with ${$.length} packages`)}catch(e){s.push(`Failed to update package.json: ${e instanceof Error?e.message:String(e)}`)}break}case"npm":{const n=c(a,".npmrc");let e=y(n)?f(n):"";/^\s*ignore-scripts\s*=\s*true\s*$/m.test(e)?s.push(".npmrc already has ignore-scripts=true"):(e=`${e.trimEnd()}
3
+ ignore-scripts=true
4
+ `,i(n,e),s.push("Added ignore-scripts=true to .npmrc"));break}case"pnpm":{const n=c(a,"pnpm-workspace.yaml");if(!y(n)){s.push("pnpm-workspace.yaml not found. Cannot sync allowBuilds.");break}let e={},m=[];try{const t=O(n);e=t?.allowBuilds??{},m=Array.isArray(t?.onlyBuiltDependencies)?t.onlyBuiltDependencies:[]}catch{}const g={...e,...o},j=Object.keys(o).filter(t=>e[t]!==o[t]).length,d=$.toSorted((t,p)=>t.localeCompare(p)),k=[...new Set([...m,...d])].toSorted((t,p)=>t.localeCompare(p)),b=d.filter(t=>!m.includes(t)).length;if(j===0&&b===0)s.push(`All ${String(Object.keys(o).length)} allowBuilds entries already present in pnpm-workspace.yaml.`);else{const t=Object.keys(g).sort(),p=l=>l.startsWith("@")||l.includes("/")||/[:#\s]/.test(l),h=l=>p(l)?`'${l.replaceAll("'","''")}'`:l,u=`allowBuilds:
5
+ ${t.map(l=>` ${h(l)}: ${String(g[l])}`).join(`
6
+ `)}
7
+ `;let r=f(n);r.endsWith(`
8
+ `)||(r+=`
9
+ `);const S=/^allowBuilds:[ \t]*\n(?:[ \t]{2}[^\n]*\n)*/m;if(r=S.test(r)?r.replace(S,u):`${r.trimEnd()}
10
+
11
+ ${u}`,k.length>0){const l=`onlyBuiltDependencies:
12
+ ${k.map(B=>` - ${p(B)?`'${B.replaceAll("'","''")}'`:B}`).join(`
13
+ `)}
14
+ `,A=/^onlyBuiltDependencies:[ \t]*\n(?:[ \t]{2}[^\n]*\n)*/m;r=A.test(r)?r.replace(A,l):`${r.trimEnd()}
15
+
16
+ ${l}`}i(n,r),s.push(`Updated pnpm-workspace.yaml allowBuilds (${String(j)} new, ${String(t.length)} total)`),b>0&&s.push(`Updated pnpm-workspace.yaml onlyBuiltDependencies (${String(b)} new, ${String(k.length)} total)`)}const w=c(a,"package.json");if(y(w)&&d.length>0)try{const t=D(w),p=Array.isArray(t.pnpm?.onlyBuiltDependencies)?t.pnpm.onlyBuiltDependencies:[],h=[...new Set([...p,...d])].toSorted((r,S)=>r.localeCompare(S)),u=d.filter(r=>!p.includes(r)).length;u>0&&(t.pnpm={...t.pnpm,onlyBuiltDependencies:h},i(w,`${JSON.stringify(t,null,2)}
17
+ `),s.push(`Updated package.json pnpm.onlyBuiltDependencies (${String(u)} new, ${String(h.length)} total)`))}catch(t){s.push(`Failed to update package.json pnpm.onlyBuiltDependencies: ${t instanceof Error?t.message:String(t)}`)}break}case"yarn":{if(C(a)){const n=c(a,".yarnrc.yml");let e=f(n);const m=/^\s*enableScripts\s*:/m.test(e),g=/^\s*enableScripts\s*:\s*false\s*$/m.test(e);m?g?s.push(".yarnrc.yml already has enableScripts: false"):(e=e.replace(/^\s*enableScripts\s*:.+$/m,"enableScripts: false"),i(n,e),s.push("Changed enableScripts to false in .yarnrc.yml")):(e=`${e.trimEnd()}
18
+ enableScripts: false
19
+ `,i(n,e),s.push("Added enableScripts: false to .yarnrc.yml"))}else{const n=c(a,".npmrc");let e=y(n)?f(n):"";/^\s*ignore-scripts\s*=\s*true\s*$/m.test(e)?s.push(".npmrc already has ignore-scripts=true"):(e=`${e.trimEnd()}
20
+ ignore-scripts=true
21
+ `,i(n,e),s.push("Added ignore-scripts=true to .npmrc (yarn classic lacks enableScripts)"))}break}}return s};export{v as O};
@@ -0,0 +1,2 @@
1
+ import{createRequire as C}from"node:module";import{R as W}from"./target-merge-D2eTghgd.js";import{osvBloomDecode as q,osvBloomProbeBatch as J,NATIVE_BINDING_VERSION as D}from"#native";const U=C(import.meta.url),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,p=e=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[o,t]=h.versions.node.split(".").map(Number);if(o>22||o===22&&t>=3||o===20&&t>=16)return h.getBuiltinModule(e)}return U(e)},{createHash:j,randomUUID:V}=p("node:crypto"),{existsSync:g}=p("node:fs"),{readFile:O,mkdir:M,stat:B,writeFile:F,rename:H,unlink:G}=p("node:fs/promises"),{join:d,dirname:P}=p("node:path"),I=6;if(D!==I)throw new Error(`vis native binding ABI mismatch in osv-bloom: expected ${I}, got ${D}. Rebuild via \`pnpm --filter @visulima/vis run build:native\` or reinstall the platform binding package.`);const st="https://endevco.github.io/osv-bloom",z=new Set(["endevco.github.io"]);class w extends Error{cause="OSV_BLOOM_SOURCE_NOT_ALLOWED";constructor(o){super(`osv-bloom source host '${o}' is not in the built-in allowlist. Add it to \`security.audit.advisories.bloom.allowedHosts\` if intentional.`),this.name="OsvBloomSourceNotAllowedError"}}class _ extends Error{cause="OSV_BLOOM_NETWORK";constructor(o,t){super(`osv-bloom fetch failed for ${o}: ${t}. Check connectivity, proxy env vars, or --source.`),this.name="OsvBloomNetworkError"}}class K extends Error{cause="OSV_BLOOM_INTEGRITY";constructor(o,t){super(`osv-bloom filter.bin sha256 mismatch (expected ${o}, got ${t}). Refusing to install a corrupted filter.`),this.name="OsvBloomIntegrityError"}}class m extends Error{cause="OSV_BLOOM_MANIFEST";constructor(o){super(`osv-bloom manifest invalid: ${o}`),this.name="OsvBloomManifestError"}}class Y extends Error{cause="OSV_BLOOM_CACHE_MISS";constructor(o){super(`No osv-bloom cache at ${o}. Run 'vis advisories bloom sync' first.`),this.name="OsvBloomCacheMissError"}}const y=e=>{const o=W("vis",{create:!0,cwd:e})??d(e,"node_modules",".cache","vis");return d(o,"osv-bloom")},l=e=>d(e,"filter.bin"),R=e=>d(e,"manifest.json"),x=e=>d(e,"state.json"),Q=(e,o)=>{let t;try{t=new URL(e)}catch{throw new w(e)}if(!t.host)throw new w(e);if(t.protocol!=="https:")throw new w(`${t.protocol}//${t.host}`);if(!new Set([...z,...o??[]]).has(t.host))throw new w(t.host);return t},rt=async e=>{const o=Date.now(),t=e.cacheDir??y(e.workspaceRoot);await M(t,{recursive:!0});const s=Q(e.source,e.allowedHosts),i=new URL("manifest.json",N(s.toString())),r=new URL("filter.bin",N(s.toString())),n=await A(i,{method:"GET"});if(!n.ok)throw new _(i.toString(),n.status);const v=await n.text(),a=L(v),u=await T(t);if(!e.force&&u?.setDigestSha256===a.setDigestSha256&&g(l(t)))return{bytesOnDisk:(await B(l(t))).size,cacheDir:t,durationMs:Date.now()-o,manifest:a,upToDate:!0};const S={};!e.force&&u?.filterEtag&&(S.headers={"if-none-match":u.filterEtag});const f=await A(r,{...S,method:"GET"});if(f.status===304&&u&&g(l(t)))return await $(t,v,{fetchedAtIso:new Date().toISOString(),filterEtag:u.filterEtag,setDigestSha256:a.setDigestSha256}),{bytesOnDisk:(await B(l(t))).size,cacheDir:t,durationMs:Date.now()-o,manifest:a,upToDate:!0};if(!f.ok||!f.body)throw new _(r.toString(),f.status);const c=Buffer.from(await f.arrayBuffer());e.onProgress&&e.onProgress(c.length,c.length);const E=X(c);if(E!==a.filterSha256)throw new K(a.filterSha256,E);if(c.length!==a.bloomByteLen)throw new m(`filter.bin length ${c.length} does not match manifest.bloom_byte_len ${a.bloomByteLen}`);const k=f.headers.get("etag")??void 0;return await b(l(t),c),await $(t,v,{fetchedAtIso:new Date().toISOString(),filterEtag:k,setDigestSha256:a.setDigestSha256}),{bytesOnDisk:c.length,cacheDir:t,durationMs:Date.now()-o,manifest:a,upToDate:!1}},it=async(e,o)=>{const t=o?.cacheDir??y(e),s=l(t);if(!g(s)){if(o?.softFail)return null;throw new Y(t)}const i=await O(s);return q(i)},nt=(e,o)=>J(e,o),at=async(e,o)=>{const t=o??y(e);if(!g(l(t)))return{cacheDir:t,present:!1};let s,i;try{s=L(await O(R(t),"utf8"))}catch{}try{i=await T(t)}catch{}return{cacheDir:t,fetchedAtIso:i?.fetchedAtIso,manifest:s,present:!0}},L=e=>{let o;try{o=JSON.parse(e)}catch(r){throw new m(r instanceof Error?r.message:String(r))}const t=r=>{const n=o[r];if(typeof n!="number"||Number.isNaN(n))throw new m(`field '${r}' missing or non-numeric`);return n},s=r=>{const n=o[r];if(typeof n!="string"||n.length===0)throw new m(`field '${r}' missing or empty`);return n},i=t("format_version");if(i!==1)throw new m(`unsupported format_version ${i} (this build expects v1)`);return{advisoryCount:t("advisory_count"),bloomByteLen:t("bloom_byte_len"),bloomKHashes:t("bloom_k_hashes"),bloomMBits:t("bloom_m_bits"),builtAtRfc3339:s("built_at_rfc3339"),builtAtUnix:t("built_at_unix"),entryCount:t("entry_count"),filterSha256:s("filter_sha256"),formatVersion:i,setDigestSha256:s("set_digest_sha256"),sourceUrl:s("source_url"),targetFpr:t("target_fpr")}},T=async e=>{try{const o=await O(x(e),"utf8"),t=JSON.parse(o);return typeof t.setDigestSha256!="string"||typeof t.fetchedAtIso!="string"?void 0:{fetchedAtIso:t.fetchedAtIso,filterEtag:typeof t.filterEtag=="string"?t.filterEtag:void 0,setDigestSha256:t.setDigestSha256}}catch{return}},$=async(e,o,t)=>{await b(R(e),Buffer.from(o,"utf8")),await b(x(e),Buffer.from(`${JSON.stringify(t,void 0,2)}
2
+ `,"utf8"))},b=async(e,o)=>{await M(P(e),{recursive:!0});const t=`${e}.${process.pid}.${V()}.tmp`;try{await F(t,o),await H(t,e)}catch(s){throw await G(t).catch(()=>{}),s}},X=e=>j("sha256").update(e).digest("hex"),N=e=>e.endsWith("/")?e:`${e}/`,Z=3e4,A=async(e,o)=>{try{return await fetch(e,{...o,signal:AbortSignal.timeout(Z)})}catch(t){throw new _(e.toString(),t instanceof Error?t.message:String(t))}};export{st as D,Y as O,at as g,it as l,nt as p,rt as s};
@@ -0,0 +1 @@
1
+ import{c as Te}from"./_commonjsHelpers-B5Y90VFO.js";import{definePlugin as Tt}from"./definePlugin-DoUcoYSy.js";var ne={},S={},I={},m={},T={},L={},Se;function dt(){return Se||(Se=1,Object.defineProperty(L,"__esModule",{value:!0}),L.VERSION=void 0,L.VERSION="1.9.1"),L}var M={},Me;function St(){if(Me)return M;Me=1,Object.defineProperty(M,"__esModule",{value:!0}),M.isCompatible=M._makeCompatibilityCheck=void 0;const e=dt(),t=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function u(r){const n=new Set([r]),i=new Set,c=r.match(t);if(!c)return()=>!1;const a={major:+c[1],minor:+c[2],patch:+c[3],prerelease:c[4]};if(a.prerelease!=null)return function(s){return s===r};function o(s){return i.add(s),!1}function g(s){return n.add(s),!0}return function(s){if(n.has(s))return!0;if(i.has(s))return!1;const l=s.match(t);if(!l)return o(s);const d={major:+l[1],minor:+l[2],patch:+l[3],prerelease:l[4]};return d.prerelease!=null||a.major!==d.major?o(s):a.major===0?a.minor===d.minor&&a.patch<=d.patch?g(s):o(s):a.minor<=d.minor?g(s):o(s)}}return M._makeCompatibilityCheck=u,M.isCompatible=u(e.VERSION),M}var Re;function h(){if(Re)return T;Re=1,Object.defineProperty(T,"__esModule",{value:!0}),T.unregisterGlobal=T.getGlobal=T.registerGlobal=void 0;const e=dt(),t=St(),u=e.VERSION.split(".")[0],r=Symbol.for(`opentelemetry.js.api.${u}`),n=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof Te=="object"?Te:{};function i(o,g,s,l=!1){var d;const _=n[r]=(d=n[r])!==null&&d!==void 0?d:{version:e.VERSION};if(!l&&_[o]){const p=new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${o}`);return s.error(p.stack||p.message),!1}if(_.version!==e.VERSION){const p=new Error(`@opentelemetry/api: Registration of version v${_.version} for ${o} does not match previously registered API v${e.VERSION}`);return s.error(p.stack||p.message),!1}return _[o]=g,s.debug(`@opentelemetry/api: Registered a global for ${o} v${e.VERSION}.`),!0}T.registerGlobal=i;function c(o){var g,s;const l=(g=n[r])===null||g===void 0?void 0:g.version;if(!(!l||!(0,t.isCompatible)(l)))return(s=n[r])===null||s===void 0?void 0:s[o]}T.getGlobal=c;function a(o,g){g.debug(`@opentelemetry/api: Unregistering a global for ${o} v${e.VERSION}.`);const s=n[r];s&&delete s[o]}return T.unregisterGlobal=a,T}var Ee;function Mt(){if(Ee)return m;Ee=1,Object.defineProperty(m,"__esModule",{value:!0}),m.DiagComponentLogger=void 0;const e=h();class t{constructor(n){this._namespace=n.namespace||"DiagComponentLogger"}debug(...n){return u("debug",this._namespace,n)}error(...n){return u("error",this._namespace,n)}info(...n){return u("info",this._namespace,n)}warn(...n){return u("warn",this._namespace,n)}verbose(...n){return u("verbose",this._namespace,n)}}m.DiagComponentLogger=t;function u(r,n,i){const c=(0,e.getGlobal)("diag");if(c)return c[r](n,...i)}return m}var D={},ae={},Ce;function _e(){return Ce||(Ce=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiagLogLevel=void 0,(function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"})(e.DiagLogLevel||(e.DiagLogLevel={}))})(ae)),ae}var ye;function Rt(){if(ye)return D;ye=1,Object.defineProperty(D,"__esModule",{value:!0}),D.createLogLevelDiagLogger=void 0;const e=_e();function t(u,r){u<e.DiagLogLevel.NONE?u=e.DiagLogLevel.NONE:u>e.DiagLogLevel.ALL&&(u=e.DiagLogLevel.ALL),r=r||{};function n(i,c){const a=r[i];return typeof a=="function"&&u>=c?a.bind(r):function(){}}return{error:n("error",e.DiagLogLevel.ERROR),warn:n("warn",e.DiagLogLevel.WARN),info:n("info",e.DiagLogLevel.INFO),debug:n("debug",e.DiagLogLevel.DEBUG),verbose:n("verbose",e.DiagLogLevel.VERBOSE)}}return D.createLogLevelDiagLogger=t,D}var he;function A(){if(he)return I;he=1,Object.defineProperty(I,"__esModule",{value:!0}),I.DiagAPI=void 0;const e=Mt(),t=Rt(),u=_e(),r=h(),n="diag";class i{static instance(){return this._instance||(this._instance=new i),this._instance}constructor(){function a(s){return function(...l){const d=(0,r.getGlobal)("diag");if(d)return d[s](...l)}}const o=this,g=(s,l={logLevel:u.DiagLogLevel.INFO})=>{var d,_,p;if(s===o){const P=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return o.error((d=P.stack)!==null&&d!==void 0?d:P.message),!1}typeof l=="number"&&(l={logLevel:l});const b=(0,r.getGlobal)("diag"),N=(0,t.createLogLevelDiagLogger)((_=l.logLevel)!==null&&_!==void 0?_:u.DiagLogLevel.INFO,s);if(b&&!l.suppressOverrideMessage){const P=(p=new Error().stack)!==null&&p!==void 0?p:"<failed to generate stacktrace>";b.warn(`Current logger will be overwritten from ${P}`),N.warn(`Current logger will overwrite one already registered from ${P}`)}return(0,r.registerGlobal)("diag",N,o,!0)};o.setLogger=g,o.disable=()=>{(0,r.unregisterGlobal)(n,o)},o.createComponentLogger=s=>new e.DiagComponentLogger(s),o.verbose=a("verbose"),o.debug=a("debug"),o.info=a("info"),o.warn=a("warn"),o.error=a("error")}}return I.DiagAPI=i,I}var V={},Ae;function Et(){if(Ae)return V;Ae=1,Object.defineProperty(V,"__esModule",{value:!0}),V.BaggageImpl=void 0;class e{constructor(u){this._entries=u?new Map(u):new Map}getEntry(u){const r=this._entries.get(u);if(r)return Object.assign({},r)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(u,r){const n=new e(this._entries);return n._entries.set(u,r),n}removeEntry(u){const r=new e(this._entries);return r._entries.delete(u),r}removeEntries(...u){const r=new e(this._entries);for(const n of u)r._entries.delete(n);return r}clear(){return new e}}return V.BaggageImpl=e,V}var w={},Ie;function Ct(){return Ie||(Ie=1,Object.defineProperty(w,"__esModule",{value:!0}),w.baggageEntryMetadataSymbol=void 0,w.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")),w}var me;function _t(){if(me)return S;me=1,Object.defineProperty(S,"__esModule",{value:!0}),S.baggageEntryMetadataFromString=S.createBaggage=void 0;const e=A(),t=Et(),u=Ct(),r=e.DiagAPI.instance();function n(c={}){return new t.BaggageImpl(new Map(Object.entries(c)))}S.createBaggage=n;function i(c){return typeof c!="string"&&(r.error(`Cannot create baggage metadata from unknown type: ${typeof c}`),c=""),{__TYPE__:u.baggageEntryMetadataSymbol,toString(){return c}}}return S.baggageEntryMetadataFromString=i,S}var R={},Le;function te(){if(Le)return R;Le=1,Object.defineProperty(R,"__esModule",{value:!0}),R.ROOT_CONTEXT=R.createContextKey=void 0;function e(u){return Symbol.for(u)}R.createContextKey=e;class t{constructor(r){const n=this;n._currentContext=r?new Map(r):new Map,n.getValue=i=>n._currentContext.get(i),n.setValue=(i,c)=>{const a=new t(n._currentContext);return a._currentContext.set(i,c),a},n.deleteValue=i=>{const c=new t(n._currentContext);return c._currentContext.delete(i),c}}}return R.ROOT_CONTEXT=new t,R}var oe={},De;function yt(){return De||(De=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiagConsoleLogger=e._originalConsoleMethods=void 0;const t=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}];if(e._originalConsoleMethods={},typeof console<"u"){const r=["error","warn","info","debug","trace","log"];for(const n of r)typeof console[n]=="function"&&(e._originalConsoleMethods[n]=console[n])}class u{constructor(){function n(i){return function(...c){let a=e._originalConsoleMethods[i];if(typeof a!="function"&&(a=e._originalConsoleMethods.log),typeof a!="function"&&console&&(a=console[i],typeof a!="function"&&(a=console.log)),typeof a=="function")return a.apply(console,c)}}for(let i=0;i<t.length;i++)this[t[i].n]=n(t[i].c)}}e.DiagConsoleLogger=u})(oe)),oe}var ie={},Ve;function pt(){return Ve||(Ve=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createNoopMeter=e.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=e.NOOP_OBSERVABLE_GAUGE_METRIC=e.NOOP_OBSERVABLE_COUNTER_METRIC=e.NOOP_UP_DOWN_COUNTER_METRIC=e.NOOP_HISTOGRAM_METRIC=e.NOOP_GAUGE_METRIC=e.NOOP_COUNTER_METRIC=e.NOOP_METER=e.NoopObservableUpDownCounterMetric=e.NoopObservableGaugeMetric=e.NoopObservableCounterMetric=e.NoopObservableMetric=e.NoopHistogramMetric=e.NoopGaugeMetric=e.NoopUpDownCounterMetric=e.NoopCounterMetric=e.NoopMetric=e.NoopMeter=void 0;class t{constructor(){}createGauge(_,p){return e.NOOP_GAUGE_METRIC}createHistogram(_,p){return e.NOOP_HISTOGRAM_METRIC}createCounter(_,p){return e.NOOP_COUNTER_METRIC}createUpDownCounter(_,p){return e.NOOP_UP_DOWN_COUNTER_METRIC}createObservableGauge(_,p){return e.NOOP_OBSERVABLE_GAUGE_METRIC}createObservableCounter(_,p){return e.NOOP_OBSERVABLE_COUNTER_METRIC}createObservableUpDownCounter(_,p){return e.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC}addBatchObservableCallback(_,p){}removeBatchObservableCallback(_){}}e.NoopMeter=t;class u{}e.NoopMetric=u;class r extends u{add(_,p){}}e.NoopCounterMetric=r;class n extends u{add(_,p){}}e.NoopUpDownCounterMetric=n;class i extends u{record(_,p){}}e.NoopGaugeMetric=i;class c extends u{record(_,p){}}e.NoopHistogramMetric=c;class a{addCallback(_){}removeCallback(_){}}e.NoopObservableMetric=a;class o extends a{}e.NoopObservableCounterMetric=o;class g extends a{}e.NoopObservableGaugeMetric=g;class s extends a{}e.NoopObservableUpDownCounterMetric=s,e.NOOP_METER=new t,e.NOOP_COUNTER_METRIC=new r,e.NOOP_GAUGE_METRIC=new i,e.NOOP_HISTOGRAM_METRIC=new c,e.NOOP_UP_DOWN_COUNTER_METRIC=new n,e.NOOP_OBSERVABLE_COUNTER_METRIC=new o,e.NOOP_OBSERVABLE_GAUGE_METRIC=new g,e.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=new s;function l(){return e.NOOP_METER}e.createNoopMeter=l})(ie)),ie}var ue={},we;function ht(){return we||(we=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueType=void 0,(function(t){t[t.INT=0]="INT",t[t.DOUBLE=1]="DOUBLE"})(e.ValueType||(e.ValueType={}))})(ue)),ue}var E={},je;function vt(){return je||(je=1,Object.defineProperty(E,"__esModule",{value:!0}),E.defaultTextMapSetter=E.defaultTextMapGetter=void 0,E.defaultTextMapGetter={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},E.defaultTextMapSetter={set(e,t,u){e!=null&&(e[t]=u)}}),E}var j={},q={},G={},U={},qe;function At(){if(qe)return U;qe=1,Object.defineProperty(U,"__esModule",{value:!0}),U.NoopContextManager=void 0;const e=te();let t=class{active(){return e.ROOT_CONTEXT}with(r,n,i,...c){return n.call(i,...c)}bind(r,n){return n}enable(){return this}disable(){return this}};return U.NoopContextManager=t,U}var Ge;function re(){if(Ge)return G;Ge=1,Object.defineProperty(G,"__esModule",{value:!0}),G.ContextAPI=void 0;const e=At(),t=h(),u=A(),r="context",n=new e.NoopContextManager;class i{constructor(){}static getInstance(){return this._instance||(this._instance=new i),this._instance}setGlobalContextManager(a){return(0,t.registerGlobal)(r,a,u.DiagAPI.instance())}active(){return this._getContextManager().active()}with(a,o,g,...s){return this._getContextManager().with(a,o,g,...s)}bind(a,o){return this._getContextManager().bind(a,o)}_getContextManager(){return(0,t.getGlobal)(r)||n}disable(){this._getContextManager().disable(),(0,t.unregisterGlobal)(r,u.DiagAPI.instance())}}return G.ContextAPI=i,G}var v={},B={},ce={},se={},Ue;function ft(){return Ue||(Ue=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TraceFlags=void 0,(function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"})(e.TraceFlags||(e.TraceFlags={}))})(se)),se}var Be;function pe(){return Be||(Be=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.INVALID_SPAN_CONTEXT=e.INVALID_TRACEID=e.INVALID_SPANID=void 0;const t=ft();e.INVALID_SPANID="0000000000000000",e.INVALID_TRACEID="00000000000000000000000000000000",e.INVALID_SPAN_CONTEXT={traceId:e.INVALID_TRACEID,spanId:e.INVALID_SPANID,traceFlags:t.TraceFlags.NONE}})(ce)),ce}var xe;function ve(){if(xe)return B;xe=1,Object.defineProperty(B,"__esModule",{value:!0}),B.NonRecordingSpan=void 0;const e=pe();let t=class{constructor(r=e.INVALID_SPAN_CONTEXT){this._spanContext=r}spanContext(){return this._spanContext}setAttribute(r,n){return this}setAttributes(r){return this}addEvent(r,n){return this}addLink(r){return this}addLinks(r){return this}setStatus(r){return this}updateName(r){return this}end(r){}isRecording(){return!1}recordException(r,n){}};return B.NonRecordingSpan=t,B}var ke;function Ot(){if(ke)return v;ke=1,Object.defineProperty(v,"__esModule",{value:!0}),v.getSpanContext=v.setSpanContext=v.deleteSpan=v.setSpan=v.getActiveSpan=v.getSpan=void 0;const e=te(),t=ve(),u=re(),r=(0,e.createContextKey)("OpenTelemetry Context Key SPAN");function n(s){return s.getValue(r)||void 0}v.getSpan=n;function i(){return n(u.ContextAPI.getInstance().active())}v.getActiveSpan=i;function c(s,l){return s.setValue(r,l)}v.setSpan=c;function a(s){return s.deleteValue(r)}v.deleteSpan=a;function o(s,l){return c(s,new t.NonRecordingSpan(l))}v.setSpanContext=o;function g(s){var l;return(l=n(s))===null||l===void 0?void 0:l.spanContext()}return v.getSpanContext=g,v}var f={},$e;function fe(){if($e)return f;$e=1,Object.defineProperty(f,"__esModule",{value:!0}),f.wrapSpanContext=f.isSpanContextValid=f.isValidSpanId=f.isValidTraceId=void 0;const e=pe(),t=ve(),u=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]);function r(o,g){if(typeof o!="string"||o.length!==g)return!1;let s=0;for(let l=0;l<o.length;l+=4)s+=(u[o.charCodeAt(l)]|0)+(u[o.charCodeAt(l+1)]|0)+(u[o.charCodeAt(l+2)]|0)+(u[o.charCodeAt(l+3)]|0);return s===g}function n(o){return r(o,32)&&o!==e.INVALID_TRACEID}f.isValidTraceId=n;function i(o){return r(o,16)&&o!==e.INVALID_SPANID}f.isValidSpanId=i;function c(o){return n(o.traceId)&&i(o.spanId)}f.isSpanContextValid=c;function a(o){return new t.NonRecordingSpan(o)}return f.wrapSpanContext=a,f}var Ke;function Pt(){if(Ke)return q;Ke=1,Object.defineProperty(q,"__esModule",{value:!0}),q.NoopTracer=void 0;const e=re(),t=Ot(),u=ve(),r=fe(),n=e.ContextAPI.getInstance();let i=class{startSpan(o,g,s=n.active()){if(g?.root)return new u.NonRecordingSpan;const l=s&&(0,t.getSpanContext)(s);return c(l)&&(0,r.isSpanContextValid)(l)?new u.NonRecordingSpan(l):new u.NonRecordingSpan}startActiveSpan(o,g,s,l){let d,_,p;if(arguments.length<2)return;arguments.length===2?p=g:arguments.length===3?(d=g,p=s):(d=g,_=s,p=l);const b=_??n.active(),N=this.startSpan(o,d,b),P=(0,t.setSpan)(b,N);return n.with(P,p,void 0,N)}};q.NoopTracer=i;function c(a){return a!==null&&typeof a=="object"&&"spanId"in a&&typeof a.spanId=="string"&&"traceId"in a&&typeof a.traceId=="string"&&"traceFlags"in a&&typeof a.traceFlags=="number"}return q}var Fe;function bt(){if(Fe)return j;Fe=1,Object.defineProperty(j,"__esModule",{value:!0}),j.ProxyTracer=void 0;const e=Pt(),t=new e.NoopTracer;let u=class{constructor(n,i,c,a){this._provider=n,this.name=i,this.version=c,this.options=a}startSpan(n,i,c){return this._getTracer().startSpan(n,i,c)}startActiveSpan(n,i,c,a){const o=this._getTracer();return Reflect.apply(o.startActiveSpan,o,arguments)}_getTracer(){if(this._delegate)return this._delegate;const n=this._provider.getDelegateTracer(this.name,this.version,this.options);return n?(this._delegate=n,this._delegate):t}};return j.ProxyTracer=u,j}var x={},k={},Xe;function It(){if(Xe)return k;Xe=1,Object.defineProperty(k,"__esModule",{value:!0}),k.NoopTracerProvider=void 0;const e=Pt();let t=class{getTracer(r,n,i){return new e.NoopTracer}};return k.NoopTracerProvider=t,k}var He;function Nt(){if(He)return x;He=1,Object.defineProperty(x,"__esModule",{value:!0}),x.ProxyTracerProvider=void 0;const e=bt(),t=It(),u=new t.NoopTracerProvider;let r=class{getTracer(i,c,a){var o;return(o=this.getDelegateTracer(i,c,a))!==null&&o!==void 0?o:new e.ProxyTracer(this,i,c,a)}getDelegate(){var i;return(i=this._delegate)!==null&&i!==void 0?i:u}setDelegate(i){this._delegate=i}getDelegateTracer(i,c,a){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getTracer(i,c,a)}};return x.ProxyTracerProvider=r,x}var le={},Ye;function mt(){return Ye||(Ye=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SamplingDecision=void 0,(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(e.SamplingDecision||(e.SamplingDecision={}))})(le)),le}var ge={},We;function Lt(){return We||(We=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SpanKind=void 0,(function(t){t[t.INTERNAL=0]="INTERNAL",t[t.SERVER=1]="SERVER",t[t.CLIENT=2]="CLIENT",t[t.PRODUCER=3]="PRODUCER",t[t.CONSUMER=4]="CONSUMER"})(e.SpanKind||(e.SpanKind={}))})(ge)),ge}var de={},ze;function Dt(){return ze||(ze=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SpanStatusCode=void 0,(function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"})(e.SpanStatusCode||(e.SpanStatusCode={}))})(de)),de}var $={},K={},C={},Qe;function Vt(){if(Qe)return C;Qe=1,Object.defineProperty(C,"__esModule",{value:!0}),C.validateValue=C.validateKey=void 0;const e="[_0-9a-z-*/]",t=`[a-z]${e}{0,255}`,u=`[a-z0-9]${e}{0,240}@[a-z]${e}{0,13}`,r=new RegExp(`^(?:${t}|${u})$`),n=/^[ -~]{0,255}[!-~]$/,i=/,|=/;function c(o){return r.test(o)}C.validateKey=c;function a(o){return n.test(o)&&!i.test(o)}return C.validateValue=a,C}var Je;function wt(){if(Je)return K;Je=1,Object.defineProperty(K,"__esModule",{value:!0}),K.TraceStateImpl=void 0;const e=Vt(),t=32,u=512,r=",",n="=";class i{constructor(a){this._internalState=new Map,a&&this._parse(a)}set(a,o){const g=this._clone();return g._internalState.has(a)&&g._internalState.delete(a),g._internalState.set(a,o),g}unset(a){const o=this._clone();return o._internalState.delete(a),o}get(a){return this._internalState.get(a)}serialize(){return Array.from(this._internalState.keys()).reduceRight((a,o)=>(a.push(o+n+this.get(o)),a),[]).join(r)}_parse(a){a.length>u||(this._internalState=a.split(r).reduceRight((o,g)=>{const s=g.trim(),l=s.indexOf(n);if(l!==-1){const d=s.slice(0,l),_=s.slice(l+1,g.length);(0,e.validateKey)(d)&&(0,e.validateValue)(_)&&o.set(d,_)}return o},new Map),this._internalState.size>t&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,t))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){const a=new i;return a._internalState=new Map(this._internalState),a}}return K.TraceStateImpl=i,K}var Ze;function jt(){if(Ze)return $;Ze=1,Object.defineProperty($,"__esModule",{value:!0}),$.createTraceState=void 0;const e=wt();function t(u){return new e.TraceStateImpl(u)}return $.createTraceState=t,$}var F={},et;function qt(){if(et)return F;et=1,Object.defineProperty(F,"__esModule",{value:!0}),F.context=void 0;const e=re();return F.context=e.ContextAPI.getInstance(),F}var X={},tt;function Gt(){if(tt)return X;tt=1,Object.defineProperty(X,"__esModule",{value:!0}),X.diag=void 0;const e=A();return X.diag=e.DiagAPI.instance(),X}var H={},Y={},y={},rt;function Ut(){if(rt)return y;rt=1,Object.defineProperty(y,"__esModule",{value:!0}),y.NOOP_METER_PROVIDER=y.NoopMeterProvider=void 0;const e=pt();let t=class{getMeter(r,n,i){return e.NOOP_METER}};return y.NoopMeterProvider=t,y.NOOP_METER_PROVIDER=new t,y}var nt;function Bt(){if(nt)return Y;nt=1,Object.defineProperty(Y,"__esModule",{value:!0}),Y.MetricsAPI=void 0;const e=Ut(),t=h(),u=A(),r="metrics";class n{constructor(){}static getInstance(){return this._instance||(this._instance=new n),this._instance}setGlobalMeterProvider(c){return(0,t.registerGlobal)(r,c,u.DiagAPI.instance())}getMeterProvider(){return(0,t.getGlobal)(r)||e.NOOP_METER_PROVIDER}getMeter(c,a,o){return this.getMeterProvider().getMeter(c,a,o)}disable(){(0,t.unregisterGlobal)(r,u.DiagAPI.instance())}}return Y.MetricsAPI=n,Y}var at;function xt(){if(at)return H;at=1,Object.defineProperty(H,"__esModule",{value:!0}),H.metrics=void 0;const e=Bt();return H.metrics=e.MetricsAPI.getInstance(),H}var W={},z={},Q={},ot;function kt(){if(ot)return Q;ot=1,Object.defineProperty(Q,"__esModule",{value:!0}),Q.NoopTextMapPropagator=void 0;let e=class{inject(u,r){}extract(u,r){return u}fields(){return[]}};return Q.NoopTextMapPropagator=e,Q}var O={},it;function $t(){if(it)return O;it=1,Object.defineProperty(O,"__esModule",{value:!0}),O.deleteBaggage=O.setBaggage=O.getActiveBaggage=O.getBaggage=void 0;const e=re(),t=te(),u=(0,t.createContextKey)("OpenTelemetry Baggage Key");function r(a){return a.getValue(u)||void 0}O.getBaggage=r;function n(){return r(e.ContextAPI.getInstance().active())}O.getActiveBaggage=n;function i(a,o){return a.setValue(u,o)}O.setBaggage=i;function c(a){return a.deleteValue(u)}return O.deleteBaggage=c,O}var ut;function Kt(){if(ut)return z;ut=1,Object.defineProperty(z,"__esModule",{value:!0}),z.PropagationAPI=void 0;const e=h(),t=kt(),u=vt(),r=$t(),n=_t(),i=A(),c="propagation",a=new t.NoopTextMapPropagator;class o{constructor(){this.createBaggage=n.createBaggage,this.getBaggage=r.getBaggage,this.getActiveBaggage=r.getActiveBaggage,this.setBaggage=r.setBaggage,this.deleteBaggage=r.deleteBaggage}static getInstance(){return this._instance||(this._instance=new o),this._instance}setGlobalPropagator(s){return(0,e.registerGlobal)(c,s,i.DiagAPI.instance())}inject(s,l,d=u.defaultTextMapSetter){return this._getGlobalPropagator().inject(s,l,d)}extract(s,l,d=u.defaultTextMapGetter){return this._getGlobalPropagator().extract(s,l,d)}fields(){return this._getGlobalPropagator().fields()}disable(){(0,e.unregisterGlobal)(c,i.DiagAPI.instance())}_getGlobalPropagator(){return(0,e.getGlobal)(c)||a}}return z.PropagationAPI=o,z}var ct;function Ft(){if(ct)return W;ct=1,Object.defineProperty(W,"__esModule",{value:!0}),W.propagation=void 0;const e=Kt();return W.propagation=e.PropagationAPI.getInstance(),W}var J={},Z={},st;function Xt(){if(st)return Z;st=1,Object.defineProperty(Z,"__esModule",{value:!0}),Z.TraceAPI=void 0;const e=h(),t=Nt(),u=fe(),r=Ot(),n=A(),i="trace";class c{constructor(){this._proxyTracerProvider=new t.ProxyTracerProvider,this.wrapSpanContext=u.wrapSpanContext,this.isSpanContextValid=u.isSpanContextValid,this.deleteSpan=r.deleteSpan,this.getSpan=r.getSpan,this.getActiveSpan=r.getActiveSpan,this.getSpanContext=r.getSpanContext,this.setSpan=r.setSpan,this.setSpanContext=r.setSpanContext}static getInstance(){return this._instance||(this._instance=new c),this._instance}setGlobalTracerProvider(o){const g=(0,e.registerGlobal)(i,this._proxyTracerProvider,n.DiagAPI.instance());return g&&this._proxyTracerProvider.setDelegate(o),g}getTracerProvider(){return(0,e.getGlobal)(i)||this._proxyTracerProvider}getTracer(o,g){return this.getTracerProvider().getTracer(o,g)}disable(){(0,e.unregisterGlobal)(i,n.DiagAPI.instance()),this._proxyTracerProvider=new t.ProxyTracerProvider}}return Z.TraceAPI=c,Z}var lt;function Ht(){if(lt)return J;lt=1,Object.defineProperty(J,"__esModule",{value:!0}),J.trace=void 0;const e=Xt();return J.trace=e.TraceAPI.getInstance(),J}var gt;function Yt(){return gt||(gt=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.trace=e.propagation=e.metrics=e.diag=e.context=e.INVALID_SPAN_CONTEXT=e.INVALID_TRACEID=e.INVALID_SPANID=e.isValidSpanId=e.isValidTraceId=e.isSpanContextValid=e.createTraceState=e.TraceFlags=e.SpanStatusCode=e.SpanKind=e.SamplingDecision=e.ProxyTracerProvider=e.ProxyTracer=e.defaultTextMapSetter=e.defaultTextMapGetter=e.ValueType=e.createNoopMeter=e.DiagLogLevel=e.DiagConsoleLogger=e.ROOT_CONTEXT=e.createContextKey=e.baggageEntryMetadataFromString=void 0;var t=_t();Object.defineProperty(e,"baggageEntryMetadataFromString",{enumerable:!0,get:function(){return t.baggageEntryMetadataFromString}});var u=te();Object.defineProperty(e,"createContextKey",{enumerable:!0,get:function(){return u.createContextKey}}),Object.defineProperty(e,"ROOT_CONTEXT",{enumerable:!0,get:function(){return u.ROOT_CONTEXT}});var r=yt();Object.defineProperty(e,"DiagConsoleLogger",{enumerable:!0,get:function(){return r.DiagConsoleLogger}});var n=_e();Object.defineProperty(e,"DiagLogLevel",{enumerable:!0,get:function(){return n.DiagLogLevel}});var i=pt();Object.defineProperty(e,"createNoopMeter",{enumerable:!0,get:function(){return i.createNoopMeter}});var c=ht();Object.defineProperty(e,"ValueType",{enumerable:!0,get:function(){return c.ValueType}});var a=vt();Object.defineProperty(e,"defaultTextMapGetter",{enumerable:!0,get:function(){return a.defaultTextMapGetter}}),Object.defineProperty(e,"defaultTextMapSetter",{enumerable:!0,get:function(){return a.defaultTextMapSetter}});var o=bt();Object.defineProperty(e,"ProxyTracer",{enumerable:!0,get:function(){return o.ProxyTracer}});var g=Nt();Object.defineProperty(e,"ProxyTracerProvider",{enumerable:!0,get:function(){return g.ProxyTracerProvider}});var s=mt();Object.defineProperty(e,"SamplingDecision",{enumerable:!0,get:function(){return s.SamplingDecision}});var l=Lt();Object.defineProperty(e,"SpanKind",{enumerable:!0,get:function(){return l.SpanKind}});var d=Dt();Object.defineProperty(e,"SpanStatusCode",{enumerable:!0,get:function(){return d.SpanStatusCode}});var _=ft();Object.defineProperty(e,"TraceFlags",{enumerable:!0,get:function(){return _.TraceFlags}});var p=jt();Object.defineProperty(e,"createTraceState",{enumerable:!0,get:function(){return p.createTraceState}});var b=fe();Object.defineProperty(e,"isSpanContextValid",{enumerable:!0,get:function(){return b.isSpanContextValid}}),Object.defineProperty(e,"isValidTraceId",{enumerable:!0,get:function(){return b.isValidTraceId}}),Object.defineProperty(e,"isValidSpanId",{enumerable:!0,get:function(){return b.isValidSpanId}});var N=pe();Object.defineProperty(e,"INVALID_SPANID",{enumerable:!0,get:function(){return N.INVALID_SPANID}}),Object.defineProperty(e,"INVALID_TRACEID",{enumerable:!0,get:function(){return N.INVALID_TRACEID}}),Object.defineProperty(e,"INVALID_SPAN_CONTEXT",{enumerable:!0,get:function(){return N.INVALID_SPAN_CONTEXT}});const P=qt();Object.defineProperty(e,"context",{enumerable:!0,get:function(){return P.context}});const Oe=Gt();Object.defineProperty(e,"diag",{enumerable:!0,get:function(){return Oe.diag}});const Pe=xt();Object.defineProperty(e,"metrics",{enumerable:!0,get:function(){return Pe.metrics}});const be=Ft();Object.defineProperty(e,"propagation",{enumerable:!0,get:function(){return be.propagation}});const Ne=Ht();Object.defineProperty(e,"trace",{enumerable:!0,get:function(){return Ne.trace}}),e.default={context:P.context,diag:Oe.diag,metrics:Pe.metrics,propagation:be.propagation,trace:Ne.trace}})(ne)),ne}var ee=Yt();const or=e=>{const{renameSpan:t,tracer:u}=e;let r;const n=new Map;return Tt({hooks:{"run:after":i=>{if(!r)return;const c=[...i.values()].filter(a=>a.status==="failure").length;r.setAttribute("vis.run.tasks_total",i.size),r.setAttribute("vis.run.tasks_failed",c),c>0?r.setStatus({code:ee.SpanStatusCode.ERROR,message:`${String(c)} task(s) failed`}):r.setStatus({code:ee.SpanStatusCode.OK}),r.end(),r=void 0;for(const a of n.values())a.end();n.clear()},"run:before":i=>{r&&(r.setStatus({code:ee.SpanStatusCode.ERROR,message:"run:before fired while previous run was still active"}),r.end());for(const c of n.values())c.end();n.clear(),r=u.startSpan("vis.run",{attributes:{"vis.run.task_count":i.tasks.length,"vis.workspace_root":i.workspaceRoot}})},"task:after":(i,c)=>{const a=n.get(i.id);a&&(a.setAttribute("vis.task.exit_code",c.code??0),a.setAttribute("vis.task.cache_status",c.status),a.end(),n.delete(i.id))},"task:before":i=>{const c=n.get(i.id);c&&(c.setStatus({code:ee.SpanStatusCode.ERROR,message:"retried — superseded by new attempt"}),c.end());const a=u.startSpan(t?t(i):i.id,{attributes:{"vis.task.id":i.id,"vis.task.project":i.target.project,"vis.task.target":i.target.target}});n.set(i.id,a)},"task:failure":(i,c)=>{const a=n.get(i.id);a&&a.setStatus({code:ee.SpanStatusCode.ERROR,message:`Task failed with exit code ${String(c.code??-1)}`})}},name:"otel"})};export{or as otelPlugin};
@@ -0,0 +1 @@
1
+ import{createRequire as b}from"node:module";import{f as w,a as T,m}from"./index-BVuCxe14.js";import{s as j}from"./index-BAUIIRZJ.js";import{g as S}from"./env-Cpxa_7UE.js";import{a as C}from"./readJsonSync-DuMMeB3s-Cx08VBQg.js";const h=b(import.meta.url),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k=t=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[e,s]=u.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return u.getBuiltinModule(t)}return h(t)},{rmSync:p,writeFileSync:_}=k("node:fs"),f=3,R=1800*1e3,U=15e3,g=()=>m(S(),"packuments"),y=t=>m(g(),`${encodeURIComponent(t)}.json`),$=t=>{const e=y(t);if(w(e))try{const s=C(e);if(s.cacheVersion!==f){p(e,{force:!0});return}if(Date.now()-s.createdAt>s.ttlMs){p(e,{force:!0});return}return s.packument}catch{p(e,{force:!0});return}},z=(t,e,s)=>{T(g());const n={cacheVersion:f,createdAt:Date.now(),packument:e,ttlMs:s};_(y(t),JSON.stringify(n),"utf8")},F=t=>{const e={},s=t.versions??{};for(const[c,r]of Object.entries(s)){const i=r.dist,o={version:c};if(r._npmUser!==void 0&&(o._npmUser=r._npmUser),r.maintainers!==void 0&&(o.maintainers=r.maintainers),r.bin!==void 0&&(o.bin=r.bin),i!==void 0){const a={};i.signatures!==void 0&&(a.signatures=i.signatures),i.attestations!==void 0&&(a.attestations=i.attestations),typeof i.integrity=="string"&&(a.integrity=i.integrity),typeof i.tarball=="string"&&(a.tarball=i.tarball),typeof i.unpackedSize=="number"&&Number.isFinite(i.unpackedSize)&&i.unpackedSize>=0&&(a.unpackedSize=i.unpackedSize),typeof i.fileCount=="number"&&Number.isInteger(i.fileCount)&&i.fileCount>=0&&(a.fileCount=i.fileCount),o.dist=a}r.repository!==void 0&&(o.repository=r.repository),r.license!==void 0&&(o.license=r.license),typeof r.readme=="string"&&(o.readme=r.readme),typeof r.readmeFilename=="string"&&(o.readmeFilename=r.readmeFilename),typeof r.private=="boolean"&&(o.private=r.private),typeof r.deprecated=="string"&&(o.deprecated=r.deprecated),r.scripts!==void 0&&typeof r.scripts=="object"&&(o.scripts=r.scripts),e[c]=o}const n={name:typeof t.name=="string"?t.name:"",versions:e};return t["dist-tags"]!==void 0&&(n["dist-tags"]=t["dist-tags"]),t.time!==void 0&&(n.time=t.time),typeof t.readme=="string"&&(n.readme=t.readme),n},M=t=>{const e={Accept:"application/json"};return t!==void 0&&t!==""&&(e.Authorization=`Bearer ${t}`),e},A=async(t,e)=>{if(e.registryUrl!==void 0)return{authToken:e.authToken,url:e.registryUrl};if(e.workspaceRoot!==void 0){const{getRegistryForPackage:s,loadNpmrc:n}=await import("../packem_chunks/catalog.js").then(o=>o.a3),c=n(e.workspaceRoot),{token:r,url:i}=s(t,c);return{authToken:e.authToken??r,url:i}}return{authToken:e.authToken,url:"https://registry.npmjs.org"}},P=async(t,e={})=>{const s=e.cacheTtlMs??R,n=$(t);if(n!==void 0)return n;if(e.offline)return;const c=await A(t,e),r=`${c.url.endsWith("/")?c.url.slice(0,-1):c.url}/${t.replace("/","%2f")}`,i=new AbortController,o=setTimeout(()=>{i.abort()},U),a=()=>{i.abort()};e.signal?.addEventListener("abort",a,{once:!0});try{const d=await fetch(r,{headers:M(c.authToken),signal:i.signal});if(d.status===404)return;if(!d.ok)throw new Error(`Registry returned ${String(d.status)} for ${t}`);const v=await d.json(),l=F(v);return z(t,l,s),l}finally{clearTimeout(o),e.signal?.removeEventListener("abort",a)}},q=(t,e)=>{const s=Object.keys(t.versions);if(s.length===0)return;if(e===void 0||e===""||e==="latest")return t["dist-tags"]?.latest??s.at(-1);const n=t["dist-tags"]?.[e];return n!==void 0?n:Object.hasOwn(t.versions,e)?e:j.maxSatisfying(s,e)??void 0};export{P as g,q as r};
@@ -0,0 +1 @@
1
+ const s=[/Issues with peer dependencies found/i,/\bunmet peer\b/i,/\bERESOLVE\b/,/unmet peer dependency/i,/\bYN0060\b/,/incorrect peer dependency/i],d="Peer dependency issues detected. Run `vis update --peer` to inspect and bump mismatched peer dependencies.",p=e=>e?s.some(n=>n.test(e)):!1;export{d as P,p as h};
@@ -0,0 +1,4 @@
1
+ import { ReleasePlugin } from "../release/types.js";
2
+ /** Type-narrowing identity helper for authoring plugins (mirrors define* family). */
3
+ declare const defineReleasePlugin: <T extends ReleasePlugin>(plugin: T) => T;
4
+ export { defineReleasePlugin as d };
@@ -0,0 +1 @@
1
+ import{createRequire as N}from"node:module";import{f as j,m as v,H as S,j as R,v as J}from"./index-BVuCxe14.js";import{withEnhancedPath as z,collectNodeModulesBinDirs as H}from"@visulima/task-runner";import{s as $}from"./index-BAUIIRZJ.js";import{resolveDlx as F,whichBin as V,detectPackageManager as Y,execPmCommandInteractive as G,resolveAdd as K,resolveRemove as Q,resolveInstall as X,resolveDedupe as Z,resolveWhy as ee,resolveLink as ne,resolveUnlink as se,resolveExec as re,resolvePmCommand as ae}from"#native";const T=N(import.meta.url),b=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,B=e=>{if(typeof b<"u"&&b.versions&&b.versions.node){const[n,s]=b.versions.node.split(".").map(Number);if(n>22||n===22&&s>=3||n===20&&s>=16)return b.getBuiltinModule(e)}return T(e)},{spawn:q,spawnSync:E}=B("node:child_process"),h=(e,n,s,r)=>{for(const a of n)e.push("--filter",a);s&&e.push("--recursive"),r&&e.push("--workspace-root")},oe=e=>{const n=[],s=[];return h(n,e.filter,e.recursive,e.workspaceRoot),e.silent&&n.push("--silent"),e.frozenLockfile&&n.push("--frozen-lockfile"),n.push("install"),e.dev&&n.push("--dev"),e.prod&&n.push("--prod"),e.force&&n.push("--force"),e.ignoreScripts&&n.push("--ignore-scripts"),e.lockfileOnly&&n.push("--lockfile-only"),e.noOptional&&n.push("--no-optional"),e.offline&&n.push("--offline"),{args:n,bin:"aube",warnings:s}},ie=e=>{const n=[],s=[];return h(n,e.filter,!1,!1),n.push("add"),e.saveDev&&n.push("--save-dev"),e.exact&&n.push("--save-exact"),e.global&&n.push("--global"),e.optional&&n.push("--save-optional"),e.peer&&n.push("--save-peer"),e.workspace&&s.push("aube has no flag for the `workspace:` protocol; it auto-detects local workspace members during add. Ignoring --workspace."),e.workspaceRoot&&n.push("--workspace"),n.push(...e.packages),{args:n,bin:"aube",warnings:s}},te=e=>{const n=[];return h(n,e.filter,e.recursive,!1),n.push("remove"),e.saveDev&&n.push("--save-dev"),e.global&&n.push("--global"),e.workspaceRoot&&n.push("--workspace"),n.push(...e.packages),{args:n,bin:"aube",warnings:[]}},pe=e=>{const n=["dedupe"];return e&&n.push("--check"),{args:n,bin:"aube",warnings:[]}},ue=e=>{const n=[],s=[];h(n,e.filter,e.recursive,!1),n.push("why"),e.dev&&n.push("--dev"),e.prod&&n.push("--prod"),e.json&&n.push("--json"),e.long&&n.push("--long"),e.parseable&&n.push("--parseable"),e.depth!==void 0&&s.push("aube why does not accept --depth; ignoring."),e.noOptional&&s.push("aube why does not accept --no-optional; ignoring."),e.global&&s.push("aube why does not accept --global; ignoring.");const[r,...a]=e.packages;return r===void 0?s.push("aube why requires a package name; none provided."):(a.length>0&&s.push("aube why takes a single package; using the first."),n.push(r)),{args:n,bin:"aube",warnings:s}},ce=e=>{const n=[];e.silent&&n.push("--silent"),n.push("dlx");for(const s of e.additionalPackages)n.push("--package",s);return e.shellMode&&n.push("--shell-mode"),n.push(e.package),n.push(...e.args),{args:n,bin:"aube",warnings:[]}},le=e=>{const n=[];return h(n,e.filter,e.recursive,e.workspaceRoot),n.push("exec"),e.parallel&&n.push("--parallel"),e.reverse&&n.push("--reverse"),e.shellMode&&n.push("--shell-mode"),n.push(e.command),n.push(...e.args),{args:n,bin:"aube",warnings:[]}},ge=e=>{const n=["link"];return e!==null&&n.push(e),{args:n,bin:"aube",warnings:[]}},de=(e,n)=>{const s=[],r=[];return n&&s.push("--recursive"),s.push("unlink"),e.length>1&&r.push("aube unlink takes a single package; using the first."),e.length>0&&s.push(e[0]),{args:s,bin:"aube",warnings:r}},he=e=>{const n=["view","--",e.package],s=[],[r,...a]=e.fields;return r!==void 0?(a.length>0&&s.push("aube view only supports a single field; using the first."),e.json&&s.push("aube view does not support --json with a field selector; printing the field without --json."),n.push(r)):e.json&&n.push("--json"),{args:n,bin:"aube",warnings:s}},Je=e=>{const n=[],s=[];return h(n,e.filters,e.recursive,e.workspaceRoot),n.push("update"),e.dev&&n.push("--dev"),e.prod&&n.push("--prod"),e.global&&n.push("--global"),e.interactive&&n.push("--interactive"),e.latest&&n.push("--latest"),e.noOptional&&n.push("--no-optional"),e.noSave&&n.push("--no-save"),n.push(...e.packages),{args:n,bin:"aube",warnings:s}},fe=new Set(["fund","ping","search","token"]),me=(e,n)=>fe.has(e)?{args:[e,...n],bin:"npm",warnings:[`'${e}' is not natively supported by aube. Delegating to npm.`]}:{args:[e,...n],bin:"aube",warnings:[]},k=256*1024,be=e=>{const n=e?{...process.env,...e}:{...process.env};return process.stderr.isTTY&&n.FORCE_COLOR===void 0&&n.NO_COLOR===void 0&&(n.FORCE_COLOR="1"),n},W=e=>e!==""&&!/[\s"&()<>^|%!]/u.test(e)?e:`"${e.replaceAll(/(\\*)"/gu,String.raw`$1$1\"`).replace(/(\\+)$/u,"$1$1").replaceAll(/[&()<>^|%!]/gu,String.raw`^$&`)}"`,ke=async(e,n,s)=>new Promise((r,a)=>{const o=process.platform==="win32",i=q(o?W(e):e,o?n.map(t=>W(t)):[...n],{cwd:s.cwd,env:be(s.env),shell:o,stdio:["inherit","pipe","pipe"],windowsHide:!0});let u=[],l=0;const g=t=>{if(u.push(t),l+=t.length,!(l<=k)){for(;u.length>1&&l-u[0].length>k;)l-=u.shift().length;if(u.length===1&&l>k){const d=u[0];u[0]=d.subarray(d.length-k),l=k}}},m=()=>Buffer.concat(u).toString("utf8");i.stdout?.on("data",t=>{process.stdout.write(t),g(t)}),i.stderr?.on("data",t=>{process.stderr.write(t),g(t)}),i.on("error",a),i.on("close",t=>{const d=m();u=[],r({code:t??1,output:d})})}),w=e=>{const n=$.coerce(e);return n?$.gte(n,"11.0.0"):!1},c=e=>e.name==="yarn"&&!e.version.startsWith("1."),x=e=>e.name==="yarn"&&e.version.startsWith("1."),we=e=>e[0]==="rm"?["remove",...e.slice(1)]:e,ve=(e,n,s)=>{switch(n){case"audit":return c(e)?{args:["npm","audit",...s],bin:"yarn",kind:"rewrite"}:{kind:"passthrough"};case"config":{if(c(e)){const[r,...a]=s;return r==="delete"?{args:["config","unset",...a],bin:"yarn",kind:"rewrite",warning:"yarn berry uses `config unset`, not `config delete`."}:{kind:"passthrough"}}return e.name==="bun"?{kind:"skip",warning:"bun has no `config` CLI. Edit bunfig.toml or .npmrc directly."}:e.name==="deno"?{kind:"skip",warning:"deno has no registry-config CLI. Edit deno.json directly."}:{kind:"passthrough"}}case"dist-tag":return x(e)?{args:["tag",...s],bin:"yarn",kind:"rewrite",warning:"yarn 1 has no `dist-tag`; using `yarn tag`."}:c(e)?{args:["npm","tag",...we(s)],bin:"yarn",kind:"rewrite"}:e.name==="bun"||e.name==="deno"?{kind:"skip",warning:`${e.name} has no \`dist-tag\`. Use \`npm dist-tag\` instead.`}:{kind:"passthrough"};case"login":case"logout":return c(e)?{args:["npm",n,...s],bin:"yarn",kind:"rewrite"}:e.name==="bun"?{args:[n,...s],bin:"npm",kind:"rewrite",warning:`bun has no \`${n}\`; falling back to \`npm ${n}\` (writes ~/.npmrc, which bun reads).`}:e.name==="deno"?{kind:"skip",warning:`deno has no \`${n}\`. JSR uses browser OAuth via \`deno publish\`.`}:{kind:"passthrough"};case"owner":return e.name==="pnpm"&&w(e.version)?{args:["owner",...s],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `owner`; falling back to `npm owner`."}:c(e)?{args:["owner",...s],bin:"npm",kind:"rewrite",warning:"yarn berry has no `owner` (not in `yarn npm`); falling back to `npm owner`."}:e.name==="bun"?{args:["owner",...s],bin:"npm",kind:"rewrite",warning:"bun has no `owner`; falling back to `npm owner`."}:e.name==="deno"?{kind:"skip",warning:"deno has no `owner`. JSR uses scope-member roles via the web UI."}:{kind:"passthrough"};case"ping":return e.name==="pnpm"&&w(e.version)?{args:["ping",...s],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `ping`; falling back to `npm ping`."}:{kind:"passthrough"};case"plugin":return c(e)?{kind:"passthrough"}:{kind:"skip",warning:`${e.name} does not support yarn-style plugins. Skipping (no-op).`};case"prune":return x(e)?{kind:"skip",warning:"yarn 1 has no `prune`. Use `yarn install --production` for a prod-only tree."}:c(e)?{kind:"skip",warning:"yarn berry has no `prune`. Use `yarn workspaces focus --production` instead."}:e.name==="bun"||e.name==="deno"?{kind:"skip",warning:`${e.name} has no \`prune\`. Pruning happens automatically on install.`}:{kind:"passthrough"};case"publish":return c(e)?{args:["npm","publish",...s],bin:"yarn",kind:"rewrite"}:{kind:"passthrough"};case"rebuild":return x(e)?{kind:"skip",warning:"yarn 1 has no `rebuild`. Re-install instead."}:e.name==="bun"?{kind:"skip",warning:"bun has no `rebuild`. Use `bun install --force` instead."}:e.name==="deno"?{kind:"skip",warning:"deno has no `rebuild`."}:{kind:"passthrough"};case"search":return e.name==="pnpm"&&w(e.version)?{args:["search",...s],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `search`; falling back to `npm search`."}:{kind:"passthrough"};case"token":return e.name==="pnpm"&&w(e.version)?{args:["token",...s],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `token`; falling back to `npm token`."}:{kind:"passthrough"};case"whoami":return e.name==="pnpm"&&w(e.version)?{args:["whoami",...s],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `whoami`; falling back to `npm whoami`."}:c(e)?{args:["npm","whoami",...s],bin:"yarn",kind:"rewrite"}:e.name==="bun"?{args:["pm","whoami",...s],bin:"bun",kind:"rewrite"}:e.name==="deno"?{kind:"skip",warning:"deno has no `whoami`. JSR uses browser auth."}:{kind:"passthrough"};default:return{kind:"passthrough"}}},O=e=>V(e)!==null,ye=e=>{const n=[["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["package-lock.json","npm"],["npm-shrinkwrap.json","npm"],["bun.lock","bun"],["bun.lockb","bun"],["deno.lock","deno"]];let s=e;for(;;){for(const[a,o]of n)if(j(v(s,a)))return o;const r=S(s);if(r===s||R(s).root===s)return;s=r}},ze=(e,n)=>{if(n.name!=="aube")return;const s=ye(e);if(s!==void 0)return`Resolved installer is aube but the workspace has a ${s} lockfile. Aube reads and writes ${s}'s lockfile format in place, but its byte output may differ subtly — expect a one-time churn diff on the first install, and ongoing drift if your team mixes tools on the same lockfile. To pin the choice across the team, set \`install.backend\` in vis.config; to bypass aube for this run, pass --no-aube.`},C=e=>{if(j(e))try{return JSON.parse(J(e,{buffer:!1}))}catch{return}},$e=e=>{let n=e;for(;;){const s=v(n,"package.json"),r=C(s);if(r&&typeof r.packageManager=="string"&&r.packageManager.length>0)return r.packageManager;const a=S(n);if(a===n||R(n).root===n)return;n=a}},P=new Set(["npm","pnpm","yarn"]),M=(e,n,s)=>s===!1||!P.has(n)||!O("corepack")?!1:s===!0?!0:$e(e)!==void 0,He=(e,n)=>{const s=n.backend,r=process.env.VIS_INSTALLER,a=s??r??n.configBackend,o=n.configCorepack??"auto";if(a&&a!=="auto"){if(a==="aube"&&!O("aube"))throw new Error('install.backend is set to "aube" but the `aube` binary is not on PATH. Install it via `npm i -g @endevco/aube`, `mise use -g aube`, or `brew install endevco/tap/aube`.');return{name:a,useCorepack:M(e,a,o),version:"latest"}}if(O("aube"))return{name:"aube",useCorepack:!1,version:"latest"};const i=je(e);return{...i,useCorepack:M(e,i.name,o)}},je=e=>{if(!j(e))throw new Error(`Could not detect package manager in ${e}. Directory does not exist.`);const n=Y(e);return{name:n.name,version:n.version||"latest"}},L=(e,n)=>n.useCorepack!==!0||!P.has(n.name)||e.bin==="corepack"||e.bin!==n.name?e:{...e,args:[n.name,...e.args],bin:"corepack"},xe=(e,n,s)=>{if(s===void 0)return G(e.bin,e.args,n);const r=E(e.bin,e.args,{cwd:n,env:{...process.env,...s},stdio:"inherit"});if(r.error)throw r.error;return r.status??1},p=(e,n,s,r,a={})=>{const o=L(n,e);for(const i of o.warnings)r.warn(`warning: ${i}`);return a.dry?(r.log(`[dry-run] ${o.bin} ${o.args.join(" ")}`),0):xe(o,s,a.env)},f=(e,n,s,r,a={})=>p(e,n(),s,r,a),Oe=(e,n)=>n==="aube"||n==="deno"?e:{...e,args:[...e.args,"--prefer-offline"]},Se=(e,n,s)=>n!=="yarn"||s.startsWith("1.")||!e.args.includes("--immutable")||e.args.includes("--immutable-cache")?e:{...e,args:[...e.args,"--immutable-cache"]},I=(e,n,s)=>{let r=e.name==="aube"?oe(n):X(e.name,e.version,{...n,silent:n.silent||s.silent===!0});return s.preferOffline&&(r=Oe(r,e.name)),s.ciMode&&(r=Se(r,e.name,e.version)),r},Fe=(e,n,s,r,a={})=>{const o=I(e,n,a);return D(e,o,s,r,{dry:a.dry,env:a.env})},Ve=async(e,n,s,r,a={})=>{const o=L(I(e,n,a),e);for(const i of o.warnings)r.warn(`warning: ${i}`);return a.dry?(r.log(`[dry-run] ${o.bin} ${o.args.join(" ")}`),{code:0,output:""}):ke(o.bin,o.args,{cwd:s,env:a.env?{...process.env,...a.env}:process.env})},A=(e,n)=>{const s=n==="deno"?"--quiet":"--silent";return{...e,args:[...e.args,s]}},Re=(e,n)=>n==="yarn"||n==="aube"?null:{...e,args:[...e.args,"--dry-run"]},D=(e,n,s,r,a)=>{if(a.dry!==!0)return p(e,n,s,r,a);const o=Re(n,e.name);return o===null?p(e,n,s,r,a):p(e,o,s,r,{env:a.env})},Ce=(e,n)=>n==="aube"?{...e,args:[...e.args,"--ignore-scripts"]}:n==="deno"?e:{...e,args:[...e.args,"--ignore-scripts"]},De=(e,n,s,r,a={})=>{let o=e.name==="aube"?ie(n):K(e.name,e.version,n);a.ignoreScripts&&(o=Ce(o,e.name)),a.silent&&(o=A(o,e.name));const i=D(e,o,s,r,{dry:a.dry,env:a.env});return i===0&&a.autoInstallPeers&&Ee(e,n,s,r,a),i},_e=e=>{if(e.startsWith("@")){const s=e.indexOf("/");if(s===-1)return e;const r=e.indexOf("@",s);return r===-1?e:e.slice(0,r)}const n=e.indexOf("@");return n===-1?e:e.slice(0,n)},We=(e,n)=>{let s=e;for(;;){const r=v(s,"node_modules",n,"package.json"),a=C(r);if(a)return a;const o=S(s);if(o===s||R(s).root===s)return;s=o}},Me=e=>{const n=C(v(e,"package.json")),s=new Set;if(!n)return s;for(const r of["dependencies","devDependencies","peerDependencies","optionalDependencies"]){const a=n[r];if(a)for(const o of Object.keys(a))s.add(o)}return s},Ee=(e,n,s,r,a)=>{if(e.name==="deno")return;const o=Me(s),i=new Map;for(const g of n.packages){const m=_e(g),t=We(s,m);if(!t?.peerDependencies)continue;const d=t.peerDependenciesMeta??{};for(const[y,U]of Object.entries(t.peerDependencies))d[y]?.optional||o.has(y)||i.has(y)||i.set(y,U)}if(i.size===0)return;const u=[...i.entries()].map(([g,m])=>`${g}@${m}`);r.log(`auto-installing peer dependencies: ${u.join(", ")}`);const l={exact:!1,filter:n.filter,global:!1,optional:!1,packages:u,peer:!1,saveDev:n.saveDev,workspace:!1,workspaceRoot:n.workspaceRoot};De(e,l,s,r,{ignoreScripts:a.ignoreScripts})},Ye=(e,n,s,r,a={})=>{let o=e.name==="aube"?te(n):Q(e.name,e.version,n);return a.silent&&(o=A(o,e.name)),D(e,o,s,r,{dry:a.dry,env:a.env})},Ge=(e,n,s,r,a={})=>e.name==="aube"?p(e,pe(n),s,r,a):f(e,()=>Z(e.name,e.version,n),s,r,a),Ke=(e,n,s,r,a={})=>e.name==="aube"?p(e,ue(n),s,r,a):f(e,()=>ee(e.name,e.version,n),s,r,a),Pe=(e,n)=>{if(e.name==="aube")return he(n);const s=[],r=[],a=e.name;switch(e.name){case"bun":{const o=$.coerce(e.version);o&&$.lt(o,"1.3.0")&&r.push(`bun ${e.version} does not support \`bun pm view\` (added in bun 1.3). Upgrade bun, or run \`npm view ${n.package}\` instead.`),s.push("pm","view","--",n.package,...n.fields),n.json&&s.push("--json");break}case"deno":{const o=n.package.startsWith("npm:")||n.package.startsWith("jsr:")||n.package.startsWith("https://")||n.package.startsWith("http://")||n.package.startsWith("file:")?n.package:`npm:${n.package}`;s.push("info","--",o),n.json&&s.push("--json"),n.fields.length>0&&r.push("deno info does not accept field selectors; ignoring.");break}case"npm":case"pnpm":{s.push("view","--",n.package,...n.fields),n.json&&s.push("--json");break}case"yarn":{if(e.version.startsWith("1.")){s.push("info","--",n.package);const[o,...i]=n.fields;o!==void 0&&(i.length>0&&r.push("yarn v1 only supports querying one field at a time; using the first."),s.push(o)),n.json&&s.push("--json")}else s.push("npm","info","--",n.package),n.fields.length>0&&r.push("yarn berry does not support field arguments to 'npm info'; ignoring."),n.json&&s.push("--json");break}default:{const o=e.name;throw new Error(`Unsupported package manager: ${o}`)}}return{args:s,bin:a,warnings:r}},Qe=(e,n,s,r,a={})=>p(e,Pe(e,n),s,r,a),Xe=(e,n,s,r,a={})=>e.name==="aube"?p(e,ge(n),s,r,a):f(e,()=>ne(e.name,e.version,n),s,r,a),Ze=(e,n,s,r,a,o={})=>e.name==="aube"?p(e,de(n,s),r,a,o):f(e,()=>se(e.name,e.version,n,s),r,a,o),Le=(e,n,s)=>{if(e.args.includes("--offline")||e.args.includes("--cached-only"))return e;const r=(a,o)=>{const i=[...e.args];return i.splice(o,0,a),{...e,args:i}};switch(n){case"aube":case"pnpm":return r("--offline",1);case"bun":return{...e,warnings:[...e.warnings,"bun x does not support --offline. Pre-install the package via `vis install` so bun x resolves from the local cache."]};case"deno":return r("--cached-only",1);case"npm":return r("--offline",1);case"yarn":return s.startsWith("1.")?r("--offline",0):{...e,warnings:[...e.warnings,"yarn berry has no --offline flag for dlx. Configure `enableNetwork: false` in .yarnrc.yml or set `enableMirror: true` for offline-first behavior."]};default:{const a=n;return{...e,warnings:[...e.warnings,`applyDlxOffline: unsupported pm ${String(a)}`]}}}},en=(e,n,s,r,a={})=>{let o=e.name==="aube"?ce(n):F(e.name,e.version,n);return a.offline&&(o=Le(o,e.name,e.version)),p(e,o,s,r,{dry:a.dry,env:a.env})},_=process.platform==="win32",Ie=_?[".exe",".cmd",".bat",".ps1",""]:[""],Ae=(e,n)=>{if(!(e.includes("/")||e.includes("\\")))for(const s of H(n))for(const r of Ie){const a=v(s,`${e}${r}`);if(j(a))return _?a.replaceAll("/","\\"):a}},nn=(e,n,s)=>{const r=Ae(e,s);if(r===void 0||_&&!r.toLowerCase().endsWith(".exe"))return null;const a=E(r,n,{cwd:s,env:z({...process.env},s),stdio:"inherit"});if(a.error)throw a.error;return a.status??1},sn=(e,n,s,r,a={})=>e.name==="aube"?p(e,le(n),s,r,a):f(e,()=>re(e.name,e.version,n),s,r,a),rn=(e,n,s,r,a,o={})=>{if(e.name==="aube")return p(e,me(n,s),r,a,o);const i=ve(e,n,s);return i.kind==="skip"?(a.warn(`warning: ${i.warning}`),0):i.kind==="rewrite"?p(e,{args:i.args,bin:i.bin,warnings:i.warning?[i.warning]:[]},r,a,o):f(e,()=>ae(e.name,e.version,n,s),r,a,o)};export{Ze as $,je as A,Ve as C,Ye as E,ze as I,nn as L,Ge as M,sn as N,Ke as P,Xe as S,rn as U,en as W,Qe as a,He as h,De as j,ke as s,Je as v,Fe as y};
@@ -0,0 +1 @@
1
+ import{createRequire as n}from"node:module";const i=n(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,a=t=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[e,s]=o.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return o.getBuiltinModule(t)}return i(t)},{createInterface:c}=a("node:readline"),u=async t=>{const e=c({input:process.stdin,output:process.stdout});try{return await new Promise(s=>{e.question(t,r=>{s(r.trim().toLowerCase())})})}finally{e.close()}},l=async(t,e=u)=>{const s=(await e(t)).trim().toLowerCase();return s==="y"||s==="yes"};export{u as d,l as p};
@@ -0,0 +1 @@
1
+ import{s as c}from"./index-BAUIIRZJ.js";import{g as m}from"./packument-CYxvm590.js";import{i as v}from"../packem_chunks/cli-main.js";const h=8,u=async(t,r,e)=>{if(t.length===0)return[];const o=Math.max(1,Math.min(r,t.length)),s=Array.from({length:t.length});let n=0;const i=async()=>{for(;n<t.length;){const a=n;n+=1;const f=t[a];s[a]=await e(f,a)}};return await Promise.all(Array.from({length:o},()=>i())),s},l=(t,r)=>t.versions[r]?.dist?.attestations?.provenance!==void 0,p=(t,r)=>c.valid(r)?Object.keys(t.versions).filter(e=>c.valid(e)!==null&&c.lt(e,r)).filter(e=>c.satisfies(e,"*",{includePrerelease:!1})).filter(e=>l(t,e)).sort((e,o)=>c.lt(e,o)?1:-1)[0]:void 0,y=async(t,r={})=>{if(v("provenance"))return[];const e=new Set(r.allowlist),o=r.concurrency??h;return(await u(t,o,async({name:s,version:n})=>{if(e.has(s))return;const i=await m(s,{workspaceRoot:r.workspaceRoot});if(i===void 0||l(i,n))return;const a=p(i,n);if(a!==void 0)return{packageName:s,priorVersionWithProvenance:a,version:n}})).filter(s=>s!==void 0)};export{h as D,p as f,u as m,y as r};
@@ -0,0 +1,131 @@
1
+ const tt=Symbol.for("yaml.alias"),He=Symbol.for("yaml.document"),V=Symbol.for("yaml.map"),At=Symbol.for("yaml.pair"),D=Symbol.for("yaml.scalar"),re=Symbol.for("yaml.seq"),K=Symbol.for("yaml.node.type"),oe=n=>!!n&&typeof n=="object"&&n[K]===tt,ye=n=>!!n&&typeof n=="object"&&n[K]===He,be=n=>!!n&&typeof n=="object"&&n[K]===V,T=n=>!!n&&typeof n=="object"&&n[K]===At,N=n=>!!n&&typeof n=="object"&&n[K]===D,we=n=>!!n&&typeof n=="object"&&n[K]===re;function A(n){if(n&&typeof n=="object")switch(n[K]){case V:case re:return!0}return!1}function I(n){if(n&&typeof n=="object")switch(n[K]){case tt:case V:case D:case re:return!0}return!1}const It=n=>(N(n)||A(n))&&!!n.anchor,J=Symbol("break visit"),bs=Symbol("skip children"),de=Symbol("remove node");function ae(n,e){const t=ws(e);ye(n)?z(null,n.contents,t,Object.freeze([n]))===de&&(n.contents=null):z(null,n,t,Object.freeze([]))}ae.BREAK=J;ae.SKIP=bs;ae.REMOVE=de;function z(n,e,t,s){const i=ks(n,e,t,s);if(I(i)||T(i))return vs(n,s,i),z(n,i,t,s);if(typeof i!="symbol"){if(A(e)){s=Object.freeze(s.concat(e));for(let r=0;r<e.items.length;++r){const o=z(r,e.items[r],t,s);if(typeof o=="number")r=o-1;else{if(o===J)return J;o===de&&(e.items.splice(r,1),r-=1)}}}else if(T(e)){s=Object.freeze(s.concat(e));const r=z("key",e.key,t,s);if(r===J)return J;r===de&&(e.key=null);const o=z("value",e.value,t,s);if(o===J)return J;o===de&&(e.value=null)}}return i}function ws(n){return typeof n=="object"&&(n.Collection||n.Node||n.Value)?Object.assign({Alias:n.Node,Map:n.Node,Scalar:n.Node,Seq:n.Node},n.Value&&{Map:n.Value,Scalar:n.Value,Seq:n.Value},n.Collection&&{Map:n.Collection,Seq:n.Collection},n):n}function ks(n,e,t,s){if(typeof t=="function")return t(n,e,s);if(be(e))return t.Map?.(n,e,s);if(we(e))return t.Seq?.(n,e,s);if(T(e))return t.Pair?.(n,e,s);if(N(e))return t.Scalar?.(n,e,s);if(oe(e))return t.Alias?.(n,e,s)}function vs(n,e,t){const s=e[e.length-1];if(A(s))s.items[n]=t;else if(T(s))n==="key"?s.key=t:s.value=t;else if(ye(s))s.contents=t;else{const i=oe(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const $s={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Ss=n=>n.replace(/[!,[\]{}]/g,e=>$s[e]);let te=class q{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},q.defaultYaml,e),this.tags=Object.assign({},q.defaultTags,t)}clone(){const e=new q(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new q(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:q.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},q.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:q.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},q.defaultTags),this.atNextDocument=!1);const s=e.trim().split(/[ \t]+/),i=s.shift();switch(i){case"%TAG":{if(s.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;const[r,o]=s;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;const[r]=s;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{const o=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,o),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}const[,s,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);const r=this.tags[s];if(r)try{return r+decodeURIComponent(i)}catch(o){return t(String(o)),null}return s==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,s]of Object.entries(this.tags))if(e.startsWith(s))return t+Ss(e.substring(s.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags);let i;if(e&&s.length>0&&I(e.contents)){const r={};ae(e.contents,(o,a)=>{I(a)&&a.tag&&(r[a.tag]=!0)}),i=Object.keys(r)}else i=[];for(const[r,o]of s)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&t.push(`%TAG ${r} ${o}`);return t.join(`
2
+ `)}};te.defaultYaml={explicit:!1,version:"1.2"};te.defaultTags={"!!":"tag:yaml.org,2002:"};function Tt(n){if(/[\x00-\x19\s,[\]{}]/.test(n)){const e=`Anchor must not contain whitespace or control characters: ${JSON.stringify(n)}`;throw new Error(e)}return!0}function xt(n){const e=new Set;return ae(n,{Value(t,s){s.anchor&&e.add(s.anchor)}}),e}function Lt(n,e){for(let t=1;;++t){const s=`${n}${t}`;if(!e.has(s))return s}}function Es(n,e){const t=[],s=new Map;let i=null;return{onAnchor:r=>{t.push(r),i??(i=xt(n));const o=Lt(e,i);return i.add(o),o},setAnchors:()=>{for(const r of t){const o=s.get(r);if(typeof o=="object"&&o.anchor&&(N(o.node)||A(o.node)))o.node.anchor=o.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=r,a}}},sourceObjects:s}}function Z(n,e,t,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let i=0,r=s.length;i<r;++i){const o=s[i],a=Z(n,s,String(i),o);a===void 0?delete s[i]:a!==o&&(s[i]=a)}else if(s instanceof Map)for(const i of Array.from(s.keys())){const r=s.get(i),o=Z(n,s,i,r);o===void 0?s.delete(i):o!==r&&s.set(i,o)}else if(s instanceof Set)for(const i of Array.from(s)){const r=Z(n,s,i,i);r===void 0?s.delete(i):r!==i&&(s.delete(i),s.add(r))}else for(const[i,r]of Object.entries(s)){const o=Z(n,s,i,r);o===void 0?delete s[i]:o!==r&&(s[i]=o)}return n.call(e,t,s)}function B(n,e,t){if(Array.isArray(n))return n.map((s,i)=>B(s,String(i),t));if(n&&typeof n.toJSON=="function"){if(!t||!It(n))return n.toJSON(e,t);const s={aliasCount:0,count:1,res:void 0};t.anchors.set(n,s),t.onCreate=r=>{s.res=r,delete t.onCreate};const i=n.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof n=="bigint"&&!t?.keep?Number(n):n}let st=class{constructor(e){Object.defineProperty(this,K,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:s,onAnchor:i,reviver:r}={}){if(!ye(e))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},a=B(this,"",o);if(typeof i=="function")for(const{count:c,res:l}of o.anchors.values())i(l,c);return typeof r=="function"?Z(r,{"":a},"",a):a}},nt=class extends st{constructor(e){super(tt),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let s;t?.aliasResolveCache?s=t.aliasResolveCache:(s=[],ae(e,{Node:(r,o)=>{(oe(o)||It(o))&&s.push(o)}}),t&&(t.aliasResolveCache=s));let i;for(const r of s){if(r===this)break;r.anchor===this.source&&(i=r)}return i}toJSON(e,t){if(!t)return{source:this.source};const{anchors:s,doc:i,maxAliasCount:r}=t,o=this.resolve(i,t);if(!o){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=s.get(o);if(a||(B(o,null,t),a=s.get(o)),a?.res===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(r>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Ae(i,o,s)),a.count*a.aliasCount>r)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,t,s){const i=`*${this.source}`;if(e){if(Tt(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}};function Ae(n,e,t){if(oe(e)){const s=e.resolve(n),i=t&&s&&t.get(s);return i?i.count*i.aliasCount:0}else if(A(e)){let s=0;for(const i of e.items){const r=Ae(n,i,t);r>s&&(s=r)}return s}else if(T(e)){const s=Ae(n,e.key,t),i=Ae(n,e.value,t);return Math.max(s,i)}return 1}const Ct=n=>!n||typeof n!="function"&&typeof n!="object";let $=class extends st{constructor(e){super(D),this.value=e}toJSON(e,t){return t?.keep?this.value:B(this.value,e,t)}toString(){return String(this.value)}};$.BLOCK_FOLDED="BLOCK_FOLDED";$.BLOCK_LITERAL="BLOCK_LITERAL";$.PLAIN="PLAIN";$.QUOTE_DOUBLE="QUOTE_DOUBLE";$.QUOTE_SINGLE="QUOTE_SINGLE";const Ns="tag:yaml.org,2002:";function Os(n,e,t){if(e){const s=t.filter(r=>r.tag===e),i=s.find(r=>!r.format)??s[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return t.find(s=>s.identify?.(n)&&!s.format)}function me(n,e,t){if(ye(n)&&(n=n.contents),I(n))return n;if(T(n)){const u=t.schema[V].createNode?.(t.schema,null,t);return u.items.push(n),u}(n instanceof String||n instanceof Number||n instanceof Boolean||typeof BigInt<"u"&&n instanceof BigInt)&&(n=n.valueOf());const{aliasDuplicateObjects:s,onAnchor:i,onTagObj:r,schema:o,sourceObjects:a}=t;let c;if(s&&n&&typeof n=="object"){if(c=a.get(n),c)return c.anchor??(c.anchor=i(n)),new nt(c.anchor);c={anchor:null,node:null},a.set(n,c)}e?.startsWith("!!")&&(e=Ns+e.slice(2));let l=Os(n,e,o.tags);if(!l){if(n&&typeof n.toJSON=="function"&&(n=n.toJSON()),!n||typeof n!="object"){const u=new $(n);return c&&(c.node=u),u}l=n instanceof Map?o[V]:Symbol.iterator in Object(n)?o[re]:o[V]}r&&(r(l),delete t.onTagObj);const d=l?.createNode?l.createNode(t.schema,n,t):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(t.schema,n,t):new $(n);return e?d.tag=e:l.default||(d.tag=l.tag),c&&(c.node=d),d}function Le(n,e,t){let s=t;for(let i=e.length-1;i>=0;--i){const r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){const o=[];o[r]=s,s=o}else s=new Map([[r,s]])}return me(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:n,sourceObjects:new Map})}const fe=n=>n==null||typeof n=="object"&&!!n[Symbol.iterator]().next().done;let _t=class extends st{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(s=>I(s)||T(s)?s.clone(e):s),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(fe(e))this.add(t);else{const[s,...i]=e,r=this.get(s,!0);if(A(r))r.addIn(i,t);else if(r===void 0&&this.schema)this.set(s,Le(this.schema,i,t));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}deleteIn(e){const[t,...s]=e;if(s.length===0)return this.delete(t);const i=this.get(t,!0);if(A(i))return i.deleteIn(s);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${s}`)}getIn(e,t){const[s,...i]=e,r=this.get(s,!0);return i.length===0?!t&&N(r)?r.value:r:A(r)?r.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!T(t))return!1;const s=t.value;return s==null||e&&N(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(e){const[t,...s]=e;if(s.length===0)return this.has(t);const i=this.get(t,!0);return A(i)?i.hasIn(s):!1}setIn(e,t){const[s,...i]=e;if(i.length===0)this.set(s,t);else{const r=this.get(s,!0);if(A(r))r.setIn(i,t);else if(r===void 0&&this.schema)this.set(s,Le(this.schema,i,t));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}};const As=n=>n.replace(/^(?!$)(?: $)?/gm,"#");function P(n,e){return/^\n+$/.test(n)?n.substring(1):e?n.replace(/^(?! *$)/gm,e):n}const W=(n,e,t)=>n.endsWith(`
3
+ `)?P(t,e):t.includes(`
4
+ `)?`
5
+ `+P(t,e):(n.endsWith(" ")?"":" ")+t,Bt="flow",Qe="block",Ie="quoted";function Ke(n,e,t="flow",{indentAtStart:s,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return n;i<r&&(r=0);const c=Math.max(1+r,1+i-e.length);if(n.length<=c)return n;const l=[],d={};let u=i-e.length;typeof s=="number"&&(s>i-Math.max(2,r)?l.push(0):u=i-s);let f,m,g=!1,h=-1,p=-1,y=-1;t===Qe&&(h=yt(n,h,e.length),h!==-1&&(u=h+c));for(let k;k=n[h+=1];){if(t===Ie&&k==="\\"){switch(p=h,n[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}y=h}if(k===`
6
+ `)t===Qe&&(h=yt(n,h,e.length)),u=h+e.length+c,f=void 0;else{if(k===" "&&m&&m!==" "&&m!==`
7
+ `&&m!==" "){const v=n[h+1];v&&v!==" "&&v!==`
8
+ `&&v!==" "&&(f=h)}if(h>=u)if(f)l.push(f),u=f+c,f=void 0;else if(t===Ie){for(;m===" "||m===" ";)m=k,k=n[h+=1],g=!0;const v=h>y+1?h-2:p-1;if(d[v])return n;l.push(v),d[v]=!0,u=v+c,f=void 0}else g=!0}m=k}if(g&&a&&a(),l.length===0)return n;o&&o();let w=n.slice(0,l[0]);for(let k=0;k<l.length;++k){const v=l[k],E=l[k+1]||n.length;v===0?w=`
9
+ ${e}${n.slice(0,E)}`:(t===Ie&&d[v]&&(w+=`${n[v]}\\`),w+=`
10
+ ${e}${n.slice(v+1,E)}`)}return w}function yt(n,e,t){let s=e,i=e+1,r=n[i];for(;r===" "||r===" ";)if(e<i+t)r=n[++e];else{do r=n[++e];while(r&&r!==`
11
+ `);s=e,i=e+1,r=n[i]}return s}const je=(n,e)=>({indentAtStart:e?n.indent.length:n.indentAtStart,lineWidth:n.options.lineWidth,minContentWidth:n.options.minContentWidth}),Me=n=>/^(%|---|\.\.\.)/m.test(n);function Is(n,e,t){if(!e||e<0)return!1;const s=e-t,i=n.length;if(i<=s)return!1;for(let r=0,o=0;r<i;++r)if(n[r]===`
12
+ `){if(r-o>s)return!0;if(o=r+1,i-o<=s)return!1}return!0}function pe(n,e){const t=JSON.stringify(n);if(e.options.doubleQuotedAsJSON)return t;const{implicitKey:s}=e,i=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(Me(n)?" ":"");let o="",a=0;for(let c=0,l=t[c];l;l=t[++c])if(l===" "&&t[c+1]==="\\"&&t[c+2]==="n"&&(o+=t.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(t[c+1]){case"u":{o+=t.slice(a,c);const d=t.substr(c+2,4);switch(d){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:d.substr(0,2)==="00"?o+="\\x"+d.substr(2):o+=t.substr(c,6)}c+=5,a=c+1}break;case"n":if(s||t[c+2]==='"'||t.length<i)c+=1;else{for(o+=t.slice(a,c)+`
13
+
14
+ `;t[c+2]==="\\"&&t[c+3]==="n"&&t[c+4]!=='"';)o+=`
15
+ `,c+=2;o+=r,t[c+2]===" "&&(o+="\\"),c+=1,a=c+1}break;default:c+=1}return o=a?o+t.slice(a):t,s?o:Ke(o,r,Ie,je(e,!1))}function Xe(n,e){if(e.options.singleQuote===!1||e.implicitKey&&n.includes(`
16
+ `)||/[ \t]\n|\n[ \t]/.test(n))return pe(n,e);const t=e.indent||(Me(n)?" ":""),s="'"+n.replace(/'/g,"''").replace(/\n+/g,`$&
17
+ ${t}`)+"'";return e.implicitKey?s:Ke(s,t,Bt,je(e,!1))}function ee(n,e){const{singleQuote:t}=e.options;let s;if(t===!1)s=pe;else{const i=n.includes('"'),r=n.includes("'");i&&!r?s=Xe:r&&!i?s=pe:s=t?Xe:pe}return s(n,e)}let ze;try{ze=new RegExp(`(^|(?<!
18
+ ))
19
+ +(?!
20
+ |$)`,"g")}catch{ze=/\n+(?!\n|$)/g}function Te({comment:n,type:e,value:t},s,i,r){const{blockQuote:o,commentString:a,lineWidth:c}=s.options;if(!o||/\n[\t ]+$/.test(t))return ee(t,s);const l=s.indent||(s.forceBlockIndent||Me(t)?" ":""),d=o==="literal"?!0:o==="folded"||e===$.BLOCK_FOLDED?!1:e===$.BLOCK_LITERAL?!0:!Is(t,c,l.length);if(!t)return d?`|
21
+ `:`>
22
+ `;let u,f;for(f=t.length;f>0;--f){const v=t[f-1];if(v!==`
23
+ `&&v!==" "&&v!==" ")break}let m=t.substring(f);const g=m.indexOf(`
24
+ `);g===-1?u="-":t===m||g!==m.length-1?(u="+",r&&r()):u="",m&&(t=t.slice(0,-m.length),m[m.length-1]===`
25
+ `&&(m=m.slice(0,-1)),m=m.replace(ze,`$&${l}`));let h=!1,p,y=-1;for(p=0;p<t.length;++p){const v=t[p];if(v===" ")h=!0;else if(v===`
26
+ `)y=p;else break}let w=t.substring(0,y<p?y+1:p);w&&(t=t.substring(w.length),w=w.replace(/\n+/g,`$&${l}`));let k=(h?l?"2":"1":"")+u;if(n&&(k+=" "+a(n.replace(/ ?[\r\n]+/g," ")),i&&i()),!d){const v=t.replace(/\n+/g,`
27
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`);let E=!1;const S=je(s,!0);o!=="folded"&&e!==$.BLOCK_FOLDED&&(S.onOverflow=()=>{E=!0});const O=Ke(`${w}${v}${m}`,l,Qe,S);if(!E)return`>${k}
28
+ ${l}${O}`}return t=t.replace(/\n+/g,`$&${l}`),`|${k}
29
+ ${l}${w}${t}${m}`}function Ts(n,e,t,s){const{type:i,value:r}=n,{actualString:o,implicitKey:a,indent:c,indentStep:l,inFlow:d}=e;if(a&&r.includes(`
30
+ `)||d&&/[[\]{},]/.test(r))return ee(r,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||d||!r.includes(`
31
+ `)?ee(r,e):Te(n,e,t,s);if(!a&&!d&&i!==$.PLAIN&&r.includes(`
32
+ `))return Te(n,e,t,s);if(Me(r)){if(c==="")return e.forceBlockIndent=!0,Te(n,e,t,s);if(a&&c===l)return ee(r,e)}const u=r.replace(/\n+/g,`$&
33
+ ${c}`);if(o){const f=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(u),{compat:m,tags:g}=e.doc.schema;if(g.some(f)||m?.some(f))return ee(r,e)}return a?u:Ke(u,c,Bt,je(e,!1))}function it(n,e,t,s){const{implicitKey:i,inFlow:r}=e,o=typeof n.value=="string"?n:Object.assign({},n,{value:String(n.value)});let{type:a}=n;a!==$.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=$.QUOTE_DOUBLE);const c=d=>{switch(d){case $.BLOCK_FOLDED:case $.BLOCK_LITERAL:return i||r?ee(o.value,e):Te(o,e,t,s);case $.QUOTE_DOUBLE:return pe(o.value,e);case $.QUOTE_SINGLE:return Xe(o.value,e);case $.PLAIN:return Ts(o,e,t,s);default:return null}};let l=c(a);if(l===null){const{defaultKeyType:d,defaultStringType:u}=e.options,f=i&&d||u;if(l=c(f),l===null)throw new Error(`Unsupported default string type ${f}`)}return l}function Kt(n,e){const t=Object.assign({blockQuote:!0,commentString:As,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},n.schema.toStringOptions,e);let s;switch(t.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:n,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:s,options:t}}function xs(n,e){if(e.tag){const i=n.filter(r=>r.tag===e.tag);if(i.length>0)return i.find(r=>r.format===e.format)??i[0]}let t,s;if(N(e)){s=e.value;let i=n.filter(r=>r.identify?.(s));if(i.length>1){const r=i.filter(o=>o.test);r.length>0&&(i=r)}t=i.find(r=>r.format===e.format)??i.find(r=>!r.format)}else s=e,t=n.find(i=>i.nodeClass&&s instanceof i.nodeClass);if(!t){const i=s?.constructor?.name??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${i} value`)}return t}function Ls(n,e,{anchors:t,doc:s}){if(!s.directives)return"";const i=[],r=(N(n)||A(n))&&n.anchor;r&&Tt(r)&&(t.add(r),i.push(`&${r}`));const o=n.tag??(e.default?null:e.tag);return o&&i.push(s.directives.tagString(o)),i.join(" ")}function ne(n,e,t,s){if(T(n))return n.toString(e,t,s);if(oe(n)){if(e.doc.directives)return n.toString(e);if(e.resolvedAliases?.has(n))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(n):e.resolvedAliases=new Set([n]),n=n.resolve(e.doc)}let i;const r=I(n)?n:e.doc.createNode(n,{onTagObj:c=>i=c});i??(i=xs(e.doc.schema.tags,r));const o=Ls(r,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);const a=typeof i.stringify=="function"?i.stringify(r,e,t,s):N(r)?it(r,e,t,s):r.toString(e,t,s);return o?N(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
34
+ ${e.indent}${a}`:a}function Cs({key:n,value:e},t,s,i){const{allNullValues:r,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:d,simpleKeys:u}}=t;let f=I(n)&&n.comment||null;if(u){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(A(n)||!I(n)&&typeof n=="object"){const O="With simple keys, collection cannot be used as a key value";throw new Error(O)}}let m=!u&&(!n||f&&e==null&&!t.inFlow||A(n)||(N(n)?n.type===$.BLOCK_FOLDED||n.type===$.BLOCK_LITERAL:typeof n=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!m&&(u||!r),indent:a+c});let g=!1,h=!1,p=ne(n,t,()=>g=!0,()=>h=!0);if(!m&&!t.inFlow&&p.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(t.inFlow){if(r||e==null)return g&&s&&s(),p===""?"?":m?`? ${p}`:p}else if(r&&!u||e==null&&m)return p=`? ${p}`,f&&!g?p+=W(p,t.indent,l(f)):h&&i&&i(),p;g&&(f=null),m?(f&&(p+=W(p,t.indent,l(f))),p=`? ${p}
35
+ ${a}:`):(p=`${p}:`,f&&(p+=W(p,t.indent,l(f))));let y,w,k;I(e)?(y=!!e.spaceBefore,w=e.commentBefore,k=e.comment):(y=!1,w=null,k=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!m&&!f&&N(e)&&(t.indentAtStart=p.length+1),h=!1,!d&&c.length>=2&&!t.inFlow&&!m&&we(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let v=!1;const E=ne(e,t,()=>v=!0,()=>h=!0);let S=" ";if(f||y||w){if(S=y?`
36
+ `:"",w){const O=l(w);S+=`
37
+ ${P(O,t.indent)}`}E===""&&!t.inFlow?S===`
38
+ `&&k&&(S=`
39
+
40
+ `):S+=`
41
+ ${t.indent}`}else if(!m&&A(e)){const O=E[0],b=E.indexOf(`
42
+ `),x=b!==-1,R=t.inFlow??e.flow??e.items.length===0;if(x||!R){let H=!1;if(x&&(O==="&"||O==="!")){let L=E.indexOf(" ");O==="&"&&L!==-1&&L<b&&E[L+1]==="!"&&(L=E.indexOf(" ",L+1)),(L===-1||b<L)&&(H=!0)}H||(S=`
43
+ ${t.indent}`)}}else(E===""||E[0]===`
44
+ `)&&(S="");return p+=S+E,t.inFlow?v&&s&&s():k&&!v?p+=W(p,t.indent,l(k)):h&&i&&i(),p}function jt(n,e){(n==="debug"||n==="warn")&&console.warn(e)}const $e="<<",U={identify:n=>n===$e||typeof n=="symbol"&&n.description===$e,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new $(Symbol($e)),{addToJSMap:Mt}),stringify:()=>$e},_s=(n,e)=>(U.identify(e)||N(e)&&(!e.type||e.type===$.PLAIN)&&U.identify(e.value))&&n?.doc.schema.tags.some(t=>t.tag===U.tag&&t.default);function Mt(n,e,t){const s=Dt(n,t);if(we(s))for(const i of s.items)Fe(n,e,i);else if(Array.isArray(s))for(const i of s)Fe(n,e,i);else Fe(n,e,s)}function Fe(n,e,t){const s=Dt(n,t);if(!be(s))throw new Error("Merge sources must be maps or map aliases");const i=s.toJSON(null,n,Map);for(const[r,o]of i)e instanceof Map?e.has(r)||e.set(r,o):e instanceof Set?e.add(r):Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function Dt(n,e){return n&&oe(e)?e.resolve(n.doc,n):e}function qt(n,e,{key:t,value:s}){if(I(t)&&t.addToJSMap)t.addToJSMap(n,e,s);else if(_s(n,t))Mt(n,e,s);else{const i=B(t,"",n);if(e instanceof Map)e.set(i,B(s,i,n));else if(e instanceof Set)e.add(i);else{const r=Bs(t,i,n),o=B(s,r,n);r in e?Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[r]=o}}return e}function Bs(n,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(I(n)&&t?.doc){const s=Kt(t.doc,{});s.anchors=new Set;for(const r of t.anchors.keys())s.anchors.add(r.anchor);s.inFlow=!0,s.inStringifyKey=!0;const i=n.toString(s);if(!t.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),jt(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return i}return JSON.stringify(e)}function rt(n,e,t){const s=me(n,void 0,t),i=me(e,void 0,t);return new C(s,i)}let C=class Pt{constructor(e,t=null){Object.defineProperty(this,K,{value:At}),this.key=e,this.value=t}clone(e){let{key:t,value:s}=this;return I(t)&&(t=t.clone(e)),I(s)&&(s=s.clone(e)),new Pt(t,s)}toJSON(e,t){const s=t?.mapAsMap?new Map:{};return qt(t,s,this)}toString(e,t,s){return e?.doc?Cs(this,e,t,s):JSON.stringify(this)}};function Ut(n,e,t){return(e.inFlow??n.flow?js:Ks)(n,e,t)}function Ks({comment:n,items:e},t,{blockItemPrefix:s,flowChars:i,itemIndent:r,onChompKeep:o,onComment:a}){const{indent:c,options:{commentString:l}}=t,d=Object.assign({},t,{indent:r,type:null});let u=!1;const f=[];for(let g=0;g<e.length;++g){const h=e[g];let p=null;if(I(h))!u&&h.spaceBefore&&f.push(""),Ce(t,f,h.commentBefore,u),h.comment&&(p=h.comment);else if(T(h)){const w=I(h.key)?h.key:null;w&&(!u&&w.spaceBefore&&f.push(""),Ce(t,f,w.commentBefore,u))}u=!1;let y=ne(h,d,()=>p=null,()=>u=!0);p&&(y+=W(y,r,l(p))),u&&p&&(u=!1),f.push(s+y)}let m;if(f.length===0)m=i.start+i.end;else{m=f[0];for(let g=1;g<f.length;++g){const h=f[g];m+=h?`
45
+ ${c}${h}`:`
46
+ `}}return n?(m+=`
47
+ `+P(l(n),c),a&&a()):u&&o&&o(),m}function js({items:n},e,{flowChars:t,itemIndent:s}){const{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:a}}=e;s+=r;const c=Object.assign({},e,{indent:s,inFlow:!0,type:null});let l=!1,d=0;const u=[];for(let g=0;g<n.length;++g){const h=n[g];let p=null;if(I(h))h.spaceBefore&&u.push(""),Ce(e,u,h.commentBefore,!1),h.comment&&(p=h.comment);else if(T(h)){const w=I(h.key)?h.key:null;w&&(w.spaceBefore&&u.push(""),Ce(e,u,w.commentBefore,!1),w.comment&&(l=!0));const k=I(h.value)?h.value:null;k?(k.comment&&(p=k.comment),k.commentBefore&&(l=!0)):h.value==null&&w?.comment&&(p=w.comment)}p&&(l=!0);let y=ne(h,c,()=>p=null);l||(l=u.length>d||y.includes(`
48
+ `)),g<n.length-1?y+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(l||(l=u.reduce((w,k)=>w+k.length+2,2)+(y.length+2)>e.options.lineWidth)),l&&(y+=",")),p&&(y+=W(y,s,a(p))),u.push(y),d=u.length}const{start:f,end:m}=t;if(u.length===0)return f+m;if(!l){const g=u.reduce((h,p)=>h+p.length+2,2);l=e.options.lineWidth>0&&g>e.options.lineWidth}if(l){let g=f;for(const h of u)g+=h?`
49
+ ${r}${i}${h}`:`
50
+ `;return`${g}
51
+ ${i}${m}`}else return`${f}${o}${u.join(" ")}${o}${m}`}function Ce({indent:n,options:{commentString:e}},t,s,i){if(s&&i&&(s=s.replace(/^\n+/,"")),s){const r=P(e(s),n);t.push(r.trimStart())}}function Y(n,e){const t=N(e)?e.value:e;for(const s of n)if(T(s)&&(s.key===e||s.key===t||N(s.key)&&s.key.value===t))return s}class _ extends _t{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(V,e),this.items=[]}static from(e,t,s){const{keepUndefined:i,replacer:r}=s,o=new this(e),a=(c,l)=>{if(typeof r=="function")l=r.call(t,c,l);else if(Array.isArray(r)&&!r.includes(c))return;(l!==void 0||i)&&o.items.push(rt(c,l,s))};if(t instanceof Map)for(const[c,l]of t)a(c,l);else if(t&&typeof t=="object")for(const c of Object.keys(t))a(c,t[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){let s;T(e)?s=e:!e||typeof e!="object"||!("key"in e)?s=new C(e,e?.value):s=new C(e.key,e.value);const i=Y(this.items,s.key),r=this.schema?.sortMapEntries;if(i){if(!t)throw new Error(`Key ${s.key} already set`);N(i.value)&&Ct(s.value)?i.value.value=s.value:i.value=s.value}else if(r){const o=this.items.findIndex(a=>r(s,a)<0);o===-1?this.items.push(s):this.items.splice(o,0,s)}else this.items.push(s)}delete(e){const t=Y(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){const s=Y(this.items,e)?.value;return(!t&&N(s)?s.value:s)??void 0}has(e){return!!Y(this.items,e)}set(e,t){this.add(new C(e,t),!0)}toJSON(e,t,s){const i=s?new s:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(i);for(const r of this.items)qt(t,i,r);return i}toString(e,t,s){if(!e)return JSON.stringify(this);for(const i of this.items)if(!T(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Ut(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:s,onComment:t})}}const ce={collection:"map",default:!0,nodeClass:_,tag:"tag:yaml.org,2002:map",resolve(n,e){return be(n)||e("Expected a mapping for this tag"),n},createNode:(n,e,t)=>_.from(n,e,t)};let G=class extends _t{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(re,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=Se(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){const s=Se(e);if(typeof s!="number")return;const i=this.items[s];return!t&&N(i)?i.value:i}has(e){const t=Se(e);return typeof t=="number"&&t<this.items.length}set(e,t){const s=Se(e);if(typeof s!="number")throw new Error(`Expected a valid index, not ${e}.`);const i=this.items[s];N(i)&&Ct(t)?i.value=t:this.items[s]=t}toJSON(e,t){const s=[];t?.onCreate&&t.onCreate(s);let i=0;for(const r of this.items)s.push(B(r,String(i++),t));return s}toString(e,t,s){return e?Ut(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:s,onComment:t}):JSON.stringify(this)}static from(e,t,s){const{replacer:i}=s,r=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let a of t){if(typeof i=="function"){const c=t instanceof Set?a:String(o++);a=i.call(t,c,a)}r.items.push(me(a,void 0,s))}}return r}};function Se(n){let e=N(n)?n.value:n;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}const le={collection:"seq",default:!0,nodeClass:G,tag:"tag:yaml.org,2002:seq",resolve(n,e){return we(n)||e("Expected a sequence for this tag"),n},createNode:(n,e,t)=>G.from(n,e,t)},De={identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify(n,e,t,s){return e=Object.assign({actualString:!0},e),it(n,e,t,s)}},qe={identify:n=>n==null,createNode:()=>new $(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new $(null),stringify:({source:n},e)=>typeof n=="string"&&qe.test.test(n)?n:e.options.nullStr},ot={identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:n=>new $(n[0]==="t"||n[0]==="T"),stringify({source:n,value:e},t){if(n&&ot.test.test(n)){const s=n[0]==="t"||n[0]==="T";if(e===s)return n}return e?t.options.trueStr:t.options.falseStr}};function M({format:n,minFractionDigits:e,tag:t,value:s}){if(typeof s=="bigint")return String(s);const i=typeof s=="number"?s:Number(s);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(s,-0)?"-0":JSON.stringify(s);if(!n&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^-?\d/.test(r)&&!r.includes("e")){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let a=e-(r.length-o-1);for(;a-- >0;)r+="0"}return r}const Rt={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:M},Ft={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n),stringify(n){const e=Number(n.value);return isFinite(e)?e.toExponential():M(n)}},Vt={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(n){const e=new $(parseFloat(n)),t=n.indexOf(".");return t!==-1&&n[n.length-1]==="0"&&(e.minFractionDigits=n.length-t-1),e},stringify:M},Pe=n=>typeof n=="bigint"||Number.isInteger(n),at=(n,e,t,{intAsBigInt:s})=>s?BigInt(n):parseInt(n.substring(e),t);function Jt(n,e,t){const{value:s}=n;return Pe(s)&&s>=0?t+s.toString(e):M(n)}const Wt={identify:n=>Pe(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(n,e,t)=>at(n,2,8,t),stringify:n=>Jt(n,8,"0o")},Yt={identify:Pe,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(n,e,t)=>at(n,0,10,t),stringify:M},Gt={identify:n=>Pe(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(n,e,t)=>at(n,2,16,t),stringify:n=>Jt(n,16,"0x")},Ms=[ce,le,De,qe,ot,Wt,Yt,Gt,Rt,Ft,Vt];function bt(n){return typeof n=="bigint"||Number.isInteger(n)}const Ee=({value:n})=>JSON.stringify(n),Ds=[{identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify:Ee},{identify:n=>n==null,createNode:()=>new $(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Ee},{identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:n=>n==="true",stringify:Ee},{identify:bt,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(n,e,{intAsBigInt:t})=>t?BigInt(n):parseInt(n,10),stringify:({value:n})=>bt(n)?n.toString():JSON.stringify(n)},{identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:n=>parseFloat(n),stringify:Ee}],qs={default:!0,tag:"",test:/^/,resolve(n,e){return e(`Unresolved plain scalar ${JSON.stringify(n)}`),n}},Ps=[ce,le].concat(Ds,qs),ct={identify:n=>n instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(n,e){if(typeof atob=="function"){const t=atob(n.replace(/[\n\r]/g,"")),s=new Uint8Array(t.length);for(let i=0;i<t.length;++i)s[i]=t.charCodeAt(i);return s}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),n},stringify({comment:n,type:e,value:t},s,i,r){if(!t)return"";const o=t;let a;if(typeof btoa=="function"){let c="";for(let l=0;l<o.length;++l)c+=String.fromCharCode(o[l]);a=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=$.BLOCK_LITERAL),e!==$.QUOTE_DOUBLE){const c=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),l=Math.ceil(a.length/c),d=new Array(l);for(let u=0,f=0;u<l;++u,f+=c)d[u]=a.substr(f,c);a=d.join(e===$.BLOCK_LITERAL?`
52
+ `:" ")}return it({comment:n,type:e,value:a},s,i,r)}};function Ht(n,e){if(we(n))for(let t=0;t<n.items.length;++t){let s=n.items[t];if(!T(s)){if(be(s)){s.items.length>1&&e("Each pair must have its own sequence indicator");const i=s.items[0]||new C(new $(null));if(s.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${s.commentBefore}
53
+ ${i.key.commentBefore}`:s.commentBefore),s.comment){const r=i.value??i.key;r.comment=r.comment?`${s.comment}
54
+ ${r.comment}`:s.comment}s=i}n.items[t]=T(s)?s:new C(s)}}else e("Expected a sequence for this tag");return n}function Qt(n,e,t){const{replacer:s}=t,i=new G(n);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof s=="function"&&(o=s.call(e,String(r++),o));let a,c;if(Array.isArray(o))if(o.length===2)a=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const l=Object.keys(o);if(l.length===1)a=l[0],c=o[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=o;i.items.push(rt(a,c,t))}return i}const lt={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Ht,createNode:Qt};let xe=class Xt extends G{constructor(){super(),this.add=_.prototype.add.bind(this),this.delete=_.prototype.delete.bind(this),this.get=_.prototype.get.bind(this),this.has=_.prototype.has.bind(this),this.set=_.prototype.set.bind(this),this.tag=Xt.tag}toJSON(e,t){if(!t)return super.toJSON(e);const s=new Map;t?.onCreate&&t.onCreate(s);for(const i of this.items){let r,o;if(T(i)?(r=B(i.key,"",t),o=B(i.value,r,t)):r=B(i,"",t),s.has(r))throw new Error("Ordered maps must not include duplicate keys");s.set(r,o)}return s}static from(e,t,s){const i=Qt(e,t,s),r=new this;return r.items=i.items,r}};xe.tag="tag:yaml.org,2002:omap";const ut={collection:"seq",identify:n=>n instanceof Map,nodeClass:xe,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){const t=Ht(n,e),s=[];for(const{key:i}of t.items)N(i)&&(s.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):s.push(i.value));return Object.assign(new xe,t)},createNode:(n,e,t)=>xe.from(n,e,t)};function zt({value:n,source:e},t){return e&&(n?Zt:es).test.test(e)?e:n?t.options.trueStr:t.options.falseStr}const Zt={identify:n=>n===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new $(!0),stringify:zt},es={identify:n=>n===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new $(!1),stringify:zt},Us={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:M},Rs={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n.replace(/_/g,"")),stringify(n){const e=Number(n.value);return isFinite(e)?e.toExponential():M(n)}},Fs={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(n){const e=new $(parseFloat(n.replace(/_/g,""))),t=n.indexOf(".");if(t!==-1){const s=n.substring(t+1).replace(/_/g,"");s[s.length-1]==="0"&&(e.minFractionDigits=s.length)}return e},stringify:M},ke=n=>typeof n=="bigint"||Number.isInteger(n);function Ue(n,e,t,{intAsBigInt:s}){const i=n[0];if((i==="-"||i==="+")&&(e+=1),n=n.substring(e).replace(/_/g,""),s){switch(t){case 2:n=`0b${n}`;break;case 8:n=`0o${n}`;break;case 16:n=`0x${n}`;break}const o=BigInt(n);return i==="-"?BigInt(-1)*o:o}const r=parseInt(n,t);return i==="-"?-1*r:r}function ft(n,e,t){const{value:s}=n;if(ke(s)){const i=s.toString(e);return s<0?"-"+t+i.substr(1):t+i}return M(n)}const Vs={identify:ke,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(n,e,t)=>Ue(n,2,2,t),stringify:n=>ft(n,2,"0b")},Js={identify:ke,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(n,e,t)=>Ue(n,1,8,t),stringify:n=>ft(n,8,"0")},Ws={identify:ke,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(n,e,t)=>Ue(n,0,10,t),stringify:M},Ys={identify:ke,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(n,e,t)=>Ue(n,2,16,t),stringify:n=>ft(n,16,"0x")};class se extends _{constructor(e){super(e),this.tag=se.tag}add(e){let t;T(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new C(e.key,null):t=new C(e,null),Y(this.items,t.key)||this.items.push(t)}get(e,t){const s=Y(this.items,e);return!t&&T(s)?N(s.key)?s.key.value:s.key:s}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);const s=Y(this.items,e);s&&!t?this.items.splice(this.items.indexOf(s),1):!s&&t&&this.items.push(new C(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,s){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,s);throw new Error("Set items must all have null values")}static from(e,t,s){const{replacer:i}=s,r=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof i=="function"&&(o=i.call(t,o,o)),r.items.push(rt(o,null,s));return r}}se.tag="tag:yaml.org,2002:set";const ht={collection:"map",identify:n=>n instanceof Set,nodeClass:se,default:!1,tag:"tag:yaml.org,2002:set",createNode:(n,e,t)=>se.from(n,e,t),resolve(n,e){if(be(n)){if(n.hasAllNullValues(!0))return Object.assign(new se,n);e("Set items must all have null values")}else e("Expected a mapping for this tag");return n}};function dt(n,e){const t=n[0],s=t==="-"||t==="+"?n.substring(1):n,i=o=>e?BigInt(o):Number(o),r=s.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return t==="-"?i(-1)*r:r}function ts(n){let{value:e}=n,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return M(n);let s="";e<0&&(s="-",e*=t(-1));const i=t(60),r=[e%i];return e<60?r.unshift(0):(e=(e-r[0])/i,r.unshift(e%i),e>=60&&(e=(e-r[0])/i,r.unshift(e))),s+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const ss={identify:n=>typeof n=="bigint"||Number.isInteger(n),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(n,e,{intAsBigInt:t})=>dt(n,t),stringify:ts},ns={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:n=>dt(n,!1),stringify:ts},Re={identify:n=>n instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(n){const e=n.match(Re.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,t,s,i,r,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0;let l=Date.UTC(t,s-1,i,r||0,o||0,a||0,c);const d=e[8];if(d&&d!=="Z"){let u=dt(d,!1);Math.abs(u)<30&&(u*=60),l-=6e4*u}return new Date(l)},stringify:({value:n})=>n?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},wt=[ce,le,De,qe,Zt,es,Vs,Js,Ws,Ys,Us,Rs,Fs,ct,U,ut,lt,ht,ss,ns,Re],kt=new Map([["core",Ms],["failsafe",[ce,le,De]],["json",Ps],["yaml11",wt],["yaml-1.1",wt]]),vt={binary:ct,bool:ot,float:Vt,floatExp:Ft,floatNaN:Rt,floatTime:ns,int:Yt,intHex:Gt,intOct:Wt,intTime:ss,map:ce,merge:U,null:qe,omap:ut,pairs:lt,seq:le,set:ht,timestamp:Re},Gs={"tag:yaml.org,2002:binary":ct,"tag:yaml.org,2002:merge":U,"tag:yaml.org,2002:omap":ut,"tag:yaml.org,2002:pairs":lt,"tag:yaml.org,2002:set":ht,"tag:yaml.org,2002:timestamp":Re};function Ve(n,e,t){const s=kt.get(e);if(s&&!n)return t&&!s.includes(U)?s.concat(U):s.slice();let i=s;if(!i)if(Array.isArray(n))i=[];else{const r=Array.from(kt.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${r} or define customTags array`)}if(Array.isArray(n))for(const r of n)i=i.concat(r);else typeof n=="function"&&(i=n(i.slice()));return t&&(i=i.concat(U)),i.reduce((r,o)=>{const a=typeof o=="string"?vt[o]:o;if(!a){const c=JSON.stringify(o),l=Object.keys(vt).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return r.includes(a)||r.push(a),r},[])}const Hs=(n,e)=>n.key<e.key?-1:n.key>e.key?1:0;let Qs=class is{constructor({compat:e,customTags:t,merge:s,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Ve(e,"compat"):e?Ve(null,e):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?Gs:{},this.tags=Ve(t,this.name,s),this.toStringOptions=a??null,Object.defineProperty(this,V,{value:ce}),Object.defineProperty(this,D,{value:De}),Object.defineProperty(this,re,{value:le}),this.sortMapEntries=typeof o=="function"?o:o===!0?Hs:null}clone(){const e=Object.create(is.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};function Xs(n,e){const t=[];let s=e.directives===!0;if(e.directives!==!1&&n.directives){const c=n.directives.toString(n);c?(t.push(c),s=!0):n.directives.docStart&&(s=!0)}s&&t.push("---");const i=Kt(n,e),{commentString:r}=i.options;if(n.commentBefore){t.length!==1&&t.unshift("");const c=r(n.commentBefore);t.unshift(P(c,""))}let o=!1,a=null;if(n.contents){if(I(n.contents)){if(n.contents.spaceBefore&&s&&t.push(""),n.contents.commentBefore){const d=r(n.contents.commentBefore);t.push(P(d,""))}i.forceBlockIndent=!!n.comment,a=n.contents.comment}const c=a?void 0:()=>o=!0;let l=ne(n.contents,i,()=>a=null,c);a&&(l+=W(l,"",r(a))),(l[0]==="|"||l[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${l}`:t.push(l)}else t.push(ne(n.contents,i));if(n.directives?.docEnd)if(n.comment){const c=r(n.comment);c.includes(`
55
+ `)?(t.push("..."),t.push(P(c,""))):t.push(`... ${c}`)}else t.push("...");else{let c=n.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&t[t.length-1]!==""&&t.push(""),t.push(P(r(c),"")))}return t.join(`
56
+ `)+`
57
+ `}let pt=class rs{constructor(e,t,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,K,{value:He});let i=null;typeof t=="function"||Array.isArray(t)?i=t:s===void 0&&t&&(s=t,t=void 0);const r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=r;let{version:o}=r;s?._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new te({version:o}),this.setSchema(o,s),this.contents=e===void 0?null:this.createNode(e,i,s)}clone(){const e=Object.create(rs.prototype,{[K]:{value:He}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=I(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Q(this.contents)&&this.contents.add(e)}addIn(e,t){Q(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const s=xt(this);e.anchor=!t||s.has(t)?Lt(t||"a",s):t}return new nt(e.anchor)}createNode(e,t,s){let i;if(typeof t=="function")e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){const p=w=>typeof w=="number"||w instanceof String||w instanceof Number,y=t.filter(p).map(String);y.length>0&&(t=t.concat(y)),i=t}else s===void 0&&t&&(s=t,t=void 0);const{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:l,tag:d}=s??{},{onAnchor:u,setAnchors:f,sourceObjects:m}=Es(this,o||"a"),g={aliasDuplicateObjects:r??!0,keepUndefined:c??!1,onAnchor:u,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:m},h=me(e,d,g);return a&&A(h)&&(h.flow=!0),f(),h}createPair(e,t,s={}){const i=this.createNode(e,null,s),r=this.createNode(t,null,s);return new C(i,r)}delete(e){return Q(this.contents)?this.contents.delete(e):!1}deleteIn(e){return fe(e)?this.contents==null?!1:(this.contents=null,!0):Q(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return A(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return fe(e)?!t&&N(this.contents)?this.contents.value:this.contents:A(this.contents)?this.contents.getIn(e,t):void 0}has(e){return A(this.contents)?this.contents.has(e):!1}hasIn(e){return fe(e)?this.contents!==void 0:A(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Le(this.schema,[e],t):Q(this.contents)&&this.contents.set(e,t)}setIn(e,t){fe(e)?this.contents=t:this.contents==null?this.contents=Le(this.schema,Array.from(e),t):Q(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let s;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new te({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new te({version:e}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{const i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(s)this.schema=new Qs(Object.assign(s,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:s,maxAliasCount:i,onAnchor:r,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!e,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=B(this.contents,t??"",a);if(typeof r=="function")for(const{count:l,res:d}of a.anchors.values())r(d,l);return typeof o=="function"?Z(o,{"":c},"",c):c}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return Xs(this,e)}};function Q(n){if(A(n))return!0;throw new Error("Expected a YAML collection as document contents")}let os=class extends Error{constructor(e,t,s,i){super(),this.name=e,this.code=s,this.message=i,this.pos=t}},he=class extends os{constructor(e,t,s){super("YAMLParseError",e,t,s)}},zs=class extends os{constructor(e,t,s){super("YAMLWarning",e,t,s)}};const _e=(n,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));const{line:s,col:i}=t.linePos[0];t.message+=` at line ${s}, column ${i}`;let r=i-1,o=n.substring(e.lineStarts[s-1],e.lineStarts[s]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){const a=Math.min(r-39,o.length-79);o="…"+o.substring(a),r-=a-1}if(o.length>80&&(o=o.substring(0,79)+"…"),s>1&&/^ *$/.test(o.substring(0,r))){let a=n.substring(e.lineStarts[s-2],e.lineStarts[s-1]);a.length>80&&(a=a.substring(0,79)+`…
58
+ `),o=a+o}if(/[^ ]/.test(o)){let a=1;const c=t.linePos[1];c?.line===s&&c.col>i&&(a=Math.max(1,Math.min(c.col-i,80-r)));const l=" ".repeat(r)+"^".repeat(a);t.message+=`:
59
+
60
+ ${o}
61
+ ${l}
62
+ `}};function ie(n,{flow:e,indicator:t,next:s,offset:i,onError:r,parentIndent:o,startOnNewline:a}){let c=!1,l=a,d=a,u="",f="",m=!1,g=!1,h=null,p=null,y=null,w=null,k=null,v=null,E=null;for(const b of n)switch(g&&(b.type!=="space"&&b.type!=="newline"&&b.type!=="comma"&&r(b.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),h&&(l&&b.type!=="comment"&&b.type!=="newline"&&r(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),b.type){case"space":!e&&(t!=="doc-start"||s?.type!=="flow-collection")&&b.source.includes(" ")&&(h=b),d=!0;break;case"comment":{d||r(b,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const x=b.source.substring(1)||" ";u?u+=f+x:u=x,f="",l=!1;break}case"newline":l?u?u+=b.source:(!v||t!=="seq-item-ind")&&(c=!0):f+=b.source,l=!0,m=!0,(p||y)&&(w=b),d=!0;break;case"anchor":p&&r(b,"MULTIPLE_ANCHORS","A node can have at most one anchor"),b.source.endsWith(":")&&r(b.offset+b.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),p=b,E??(E=b.offset),l=!1,d=!1,g=!0;break;case"tag":{y&&r(b,"MULTIPLE_TAGS","A node can have at most one tag"),y=b,E??(E=b.offset),l=!1,d=!1,g=!0;break}case t:(p||y)&&r(b,"BAD_PROP_ORDER",`Anchors and tags must be after the ${b.source} indicator`),v&&r(b,"UNEXPECTED_TOKEN",`Unexpected ${b.source} in ${e??"collection"}`),v=b,l=t==="seq-item-ind"||t==="explicit-key-ind",d=!1;break;case"comma":if(e){k&&r(b,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=b,l=!1,d=!1;break}default:r(b,"UNEXPECTED_TOKEN",`Unexpected ${b.type} token`),l=!1,d=!1}const S=n[n.length-1],O=S?S.offset+S.source.length:i;return g&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&r(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(l&&h.indent<=o||s?.type==="block-map"||s?.type==="block-seq")&&r(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:v,spaceBefore:c,comment:u,hasNewline:m,anchor:p,tag:y,newlineAfterProp:w,end:O,start:E??O}}function ge(n){if(!n)return null;switch(n.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(n.source.includes(`
63
+ `))return!0;if(n.end){for(const e of n.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of n.items){for(const t of e.start)if(t.type==="newline")return!0;if(e.sep){for(const t of e.sep)if(t.type==="newline")return!0}if(ge(e.key)||ge(e.value))return!0}return!1;default:return!0}}function Ze(n,e,t){if(e?.type==="flow-collection"){const s=e.end[0];s.indent===n&&(s.source==="]"||s.source==="}")&&ge(e)&&t(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function as(n,e,t){const{uniqueKeys:s}=n.options;if(s===!1)return!1;const i=typeof s=="function"?s:(r,o)=>r===o||N(r)&&N(o)&&r.value===o.value;return e.some(r=>i(r.key,t))}const $t="All mapping items must start at the same column";function Zs({composeNode:n,composeEmptyNode:e},t,s,i,r){const o=r?.nodeClass??_,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let c=s.offset,l=null;for(const d of s.items){const{start:u,key:f,sep:m,value:g}=d,h=ie(u,{indicator:"explicit-key-ind",next:f??m?.[0],offset:c,onError:i,parentIndent:s.indent,startOnNewline:!0}),p=!h.found;if(p){if(f&&(f.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==s.indent&&i(c,"BAD_INDENT",$t)),!h.anchor&&!h.tag&&!m){l=h.end,h.comment&&(a.comment?a.comment+=`
64
+ `+h.comment:a.comment=h.comment);continue}(h.newlineAfterProp||ge(f))&&i(f??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==s.indent&&i(c,"BAD_INDENT",$t);t.atKey=!0;const y=h.end,w=f?n(t,f,h,i):e(t,y,u,null,h,i);t.schema.compat&&Ze(s.indent,f,i),t.atKey=!1,as(t,a.items,w)&&i(y,"DUPLICATE_KEY","Map keys must be unique");const k=ie(m??[],{indicator:"map-value-ind",next:g,offset:w.range[2],onError:i,parentIndent:s.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=k.end,k.found){p&&(g?.type==="block-map"&&!k.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&h.start<k.found.offset-1024&&i(w.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const v=g?n(t,g,k,i):e(t,c,m,null,k,i);t.schema.compat&&Ze(s.indent,g,i),c=v.range[2];const E=new C(w,v);t.options.keepSourceTokens&&(E.srcToken=d),a.items.push(E)}else{p&&i(w.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(w.comment?w.comment+=`
65
+ `+k.comment:w.comment=k.comment);const v=new C(w);t.options.keepSourceTokens&&(v.srcToken=d),a.items.push(v)}}return l&&l<c&&i(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[s.offset,c,l??c],a}function en({composeNode:n,composeEmptyNode:e},t,s,i,r){const o=r?.nodeClass??G,a=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let c=s.offset,l=null;for(const{start:d,value:u}of s.items){const f=ie(d,{indicator:"seq-item-ind",next:u,offset:c,onError:i,parentIndent:s.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||u)u?.type==="block-seq"?i(f.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(a.comment=f.comment);continue}const m=u?n(t,u,f,i):e(t,f.end,d,null,f,i);t.schema.compat&&Ze(s.indent,u,i),c=m.range[2],a.items.push(m)}return a.range=[s.offset,c,l??c],a}function ve(n,e,t,s){let i="";if(n){let r=!1,o="";for(const a of n){const{source:c,type:l}=a;switch(l){case"space":r=!0;break;case"comment":{t&&!r&&s(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const d=c.substring(1)||" ";i?i+=o+d:i=d,o="";break}case"newline":i&&(o+=c),r=!0;break;default:s(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:i,offset:e}}const Je="Block collections are not allowed within flow collections",We=n=>n&&(n.type==="block-map"||n.type==="block-seq");function tn({composeNode:n,composeEmptyNode:e},t,s,i,r){const o=s.start.source==="{",a=o?"flow map":"flow sequence",c=r?.nodeClass??(o?_:G),l=new c(t.schema);l.flow=!0;const d=t.atRoot;d&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let u=s.offset+s.start.source.length;for(let p=0;p<s.items.length;++p){const y=s.items[p],{start:w,key:k,sep:v,value:E}=y,S=ie(w,{flow:a,indicator:"explicit-key-ind",next:k??v?.[0],offset:u,onError:i,parentIndent:s.indent,startOnNewline:!1});if(!S.found){if(!S.anchor&&!S.tag&&!v&&!E){p===0&&S.comma?i(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):p<s.items.length-1&&i(S.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),S.comment&&(l.comment?l.comment+=`
66
+ `+S.comment:l.comment=S.comment),u=S.end;continue}!o&&t.options.strict&&ge(k)&&i(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(p===0)S.comma&&i(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(S.comma||i(S.start,"MISSING_CHAR",`Missing , between ${a} items`),S.comment){let O="";e:for(const b of w)switch(b.type){case"comma":case"space":break;case"comment":O=b.source.substring(1);break e;default:break e}if(O){let b=l.items[l.items.length-1];T(b)&&(b=b.value??b.key),b.comment?b.comment+=`
67
+ `+O:b.comment=O,S.comment=S.comment.substring(O.length+1)}}if(!o&&!v&&!S.found){const O=E?n(t,E,S,i):e(t,S.end,v,null,S,i);l.items.push(O),u=O.range[2],We(E)&&i(O.range,"BLOCK_IN_FLOW",Je)}else{t.atKey=!0;const O=S.end,b=k?n(t,k,S,i):e(t,O,w,null,S,i);We(k)&&i(b.range,"BLOCK_IN_FLOW",Je),t.atKey=!1;const x=ie(v??[],{flow:a,indicator:"map-value-ind",next:E,offset:b.range[2],onError:i,parentIndent:s.indent,startOnNewline:!1});if(x.found){if(!o&&!S.found&&t.options.strict){if(v)for(const L of v){if(L===x.found)break;if(L.type==="newline"){i(L,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}S.start<x.found.offset-1024&&i(x.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else E&&("source"in E&&E.source?.[0]===":"?i(E,"MISSING_CHAR",`Missing space after : in ${a}`):i(x.start,"MISSING_CHAR",`Missing , or : between ${a} items`));const R=E?n(t,E,x,i):x.found?e(t,x.end,v,null,x,i):null;R?We(E)&&i(R.range,"BLOCK_IN_FLOW",Je):x.comment&&(b.comment?b.comment+=`
68
+ `+x.comment:b.comment=x.comment);const H=new C(b,R);if(t.options.keepSourceTokens&&(H.srcToken=y),o){const L=l;as(t,L.items,b)&&i(O,"DUPLICATE_KEY","Map keys must be unique"),L.items.push(H)}else{const L=new _(t.schema);L.flow=!0,L.items.push(H);const gt=(R??b).range;L.range=[b.range[0],gt[1],gt[2]],l.items.push(L)}u=R?R.range[2]:x.end}}const f=o?"}":"]",[m,...g]=s.end;let h=u;if(m?.source===f)h=m.offset+m.source.length;else{const p=a[0].toUpperCase()+a.substring(1),y=d?`${p} must end with a ${f}`:`${p} in block collection must be sufficiently indented and end with a ${f}`;i(u,d?"MISSING_CHAR":"BAD_INDENT",y),m&&m.source.length!==1&&g.unshift(m)}if(g.length>0){const p=ve(g,h,t.options.strict,i);p.comment&&(l.comment?l.comment+=`
69
+ `+p.comment:l.comment=p.comment),l.range=[s.offset,h,p.offset]}else l.range=[s.offset,h,h];return l}function Ye(n,e,t,s,i,r){const o=t.type==="block-map"?Zs(n,e,t,s,r):t.type==="block-seq"?en(n,e,t,s,r):tn(n,e,t,s,r),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function sn(n,e,t,s,i){const r=s.tag,o=r?e.directives.tagName(r.source,f=>i(r,"TAG_RESOLVE_FAILED",f)):null;if(t.type==="block-seq"){const{anchor:f,newlineAfterProp:m}=s,g=f&&r?f.offset>r.offset?f:r:f??r;g&&(!m||m.offset<g.offset)&&i(g,"MISSING_CHAR","Missing newline after block sequence props")}const a=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!r||!o||o==="!"||o===_.tagName&&a==="map"||o===G.tagName&&a==="seq")return Ye(n,e,t,i,o);let c=e.schema.tags.find(f=>f.tag===o&&f.collection===a);if(!c){const f=e.schema.knownTags[o];if(f?.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else return f?i(r,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Ye(n,e,t,i,o)}const l=Ye(n,e,t,i,o,c),d=c.resolve?.(l,f=>i(r,"TAG_RESOLVE_FAILED",f),e.options)??l,u=I(d)?d:new $(d);return u.range=l.range,u.tag=o,c?.format&&(u.format=c.format),u}function nn(n,e,t){const s=e.offset,i=rn(e,n.options.strict,t);if(!i)return{value:"",type:null,comment:"",range:[s,s,s]};const r=i.mode===">"?$.BLOCK_FOLDED:$.BLOCK_LITERAL,o=e.source?on(e.source):[];let a=o.length;for(let h=o.length-1;h>=0;--h){const p=o[h][1];if(p===""||p==="\r")a=h;else break}if(a===0){const h=i.chomp==="+"&&o.length>0?`
70
+ `.repeat(Math.max(1,o.length-1)):"";let p=s+i.length;return e.source&&(p+=e.source.length),{value:h,type:r,comment:i.comment,range:[s,p,p]}}let c=e.indent+i.indent,l=e.offset+i.length,d=0;for(let h=0;h<a;++h){const[p,y]=o[h];if(y===""||y==="\r")i.indent===0&&p.length>c&&(c=p.length);else{p.length<c&&t(l+p.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(c=p.length),d=h,c===0&&!n.atRoot&&t(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=p.length+y.length+1}for(let h=o.length-1;h>=a;--h)o[h][0].length>c&&(a=h+1);let u="",f="",m=!1;for(let h=0;h<d;++h)u+=o[h][0].slice(c)+`
71
+ `;for(let h=d;h<a;++h){let[p,y]=o[h];l+=p.length+y.length+1;const w=y[y.length-1]==="\r";if(w&&(y=y.slice(0,-1)),y&&p.length<c){const k=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;t(l-y.length-(w?2:1),"BAD_INDENT",k),p=""}r===$.BLOCK_LITERAL?(u+=f+p.slice(c)+y,f=`
72
+ `):p.length>c||y[0]===" "?(f===" "?f=`
73
+ `:!m&&f===`
74
+ `&&(f=`
75
+
76
+ `),u+=f+p.slice(c)+y,f=`
77
+ `,m=!0):y===""?f===`
78
+ `?u+=`
79
+ `:f=`
80
+ `:(u+=f+y,f=" ",m=!1)}switch(i.chomp){case"-":break;case"+":for(let h=a;h<o.length;++h)u+=`
81
+ `+o[h][0].slice(c);u[u.length-1]!==`
82
+ `&&(u+=`
83
+ `);break;default:u+=`
84
+ `}const g=s+i.length+e.source.length;return{value:u,type:r,comment:i.comment,range:[s,g,g]}}function rn({offset:n,props:e},t,s){if(e[0].type!=="block-scalar-header")return s(e[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=e[0],r=i[0];let o=0,a="",c=-1;for(let f=1;f<i.length;++f){const m=i[f];if(!a&&(m==="-"||m==="+"))a=m;else{const g=Number(m);!o&&g?o=g:c===-1&&(c=n+f)}}c!==-1&&s(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let l=!1,d="",u=i.length;for(let f=1;f<e.length;++f){const m=e[f];switch(m.type){case"space":l=!0;case"newline":u+=m.source.length;break;case"comment":t&&!l&&s(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),u+=m.source.length,d=m.source.substring(1);break;case"error":s(m,"UNEXPECTED_TOKEN",m.message),u+=m.source.length;break;default:{const g=`Unexpected token in block scalar header: ${m.type}`;s(m,"UNEXPECTED_TOKEN",g);const h=m.source;h&&typeof h=="string"&&(u+=h.length)}}}return{mode:r,indent:o,chomp:a,comment:d,length:u}}function on(n){const e=n.split(/\n( *)/),t=e[0],s=t.match(/^( *)/),i=[s?.[1]?[s[1],t.slice(s[1].length)]:["",t]];for(let r=1;r<e.length;r+=2)i.push([e[r],e[r+1]]);return i}function an(n,e,t){const{offset:s,type:i,source:r,end:o}=n;let a,c;const l=(f,m,g)=>t(s+f,m,g);switch(i){case"scalar":a=$.PLAIN,c=cn(r,l);break;case"single-quoted-scalar":a=$.QUOTE_SINGLE,c=ln(r,l);break;case"double-quoted-scalar":a=$.QUOTE_DOUBLE,c=un(r,l);break;default:return t(n,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[s,s+r.length,s+r.length]}}const d=s+r.length,u=ve(o,d,e,t);return{value:c,type:a,comment:u.comment,range:[s,d,u.offset]}}function cn(n,e){let t="";switch(n[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${n[0]}`;break}case"@":case"`":{t=`reserved character ${n[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),cs(n)}function ln(n,e){return(n[n.length-1]!=="'"||n.length===1)&&e(n.length,"MISSING_CHAR","Missing closing 'quote"),cs(n.slice(1,-1)).replace(/''/g,"'")}function cs(n){let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
85
+ `,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
86
+ `,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let s=e.exec(n);if(!s)return n;let i=s[1],r=" ",o=e.lastIndex;for(t.lastIndex=o;s=t.exec(n);)s[1]===""?r===`
87
+ `?i+=r:r=`
88
+ `:(i+=r+s[1],r=" "),o=t.lastIndex;const a=/[ \t]*(.*)/sy;return a.lastIndex=o,s=a.exec(n),i+r+(s?.[1]??"")}function un(n,e){let t="";for(let s=1;s<n.length-1;++s){const i=n[s];if(!(i==="\r"&&n[s+1]===`
89
+ `))if(i===`
90
+ `){const{fold:r,offset:o}=fn(n,s);t+=r,s=o}else if(i==="\\"){let r=n[++s];const o=hn[r];if(o)t+=o;else if(r===`
91
+ `)for(r=n[s+1];r===" "||r===" ";)r=n[++s+1];else if(r==="\r"&&n[s+1]===`
92
+ `)for(r=n[++s+1];r===" "||r===" ";)r=n[++s+1];else if(r==="x"||r==="u"||r==="U"){const a=r==="x"?2:r==="u"?4:8;t+=dn(n,s+1,a,e),s+=a}else{const a=n.substr(s-1,2);e(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),t+=a}}else if(i===" "||i===" "){const r=s;let o=n[s+1];for(;o===" "||o===" ";)o=n[++s+1];o!==`
93
+ `&&!(o==="\r"&&n[s+2]===`
94
+ `)&&(t+=s>r?n.slice(r,s+1):i)}else t+=i}return(n[n.length-1]!=='"'||n.length===1)&&e(n.length,"MISSING_CHAR",'Missing closing "quote'),t}function fn(n,e){let t="",s=n[e+1];for(;(s===" "||s===" "||s===`
95
+ `||s==="\r")&&!(s==="\r"&&n[e+2]!==`
96
+ `);)s===`
97
+ `&&(t+=`
98
+ `),e+=1,s=n[e+1];return t||(t=" "),{fold:t,offset:e}}const hn={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
99
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function dn(n,e,t,s){const i=n.substr(e,t),r=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(r)}catch{const o=n.substr(e-2,t+2);return s(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),o}}function ls(n,e,t,s){const{value:i,type:r,comment:o,range:a}=e.type==="block-scalar"?nn(n,e,s):an(e,n.options.strict,s),c=t?n.directives.tagName(t.source,u=>s(t,"TAG_RESOLVE_FAILED",u)):null;let l;n.options.stringKeys&&n.atKey?l=n.schema[D]:c?l=pn(n.schema,i,c,t,s):e.type==="scalar"?l=mn(n,i,e,s):l=n.schema[D];let d;try{const u=l.resolve(i,f=>s(t??e,"TAG_RESOLVE_FAILED",f),n.options);d=N(u)?u:new $(u)}catch(u){const f=u instanceof Error?u.message:String(u);s(t??e,"TAG_RESOLVE_FAILED",f),d=new $(i)}return d.range=a,d.source=i,r&&(d.type=r),c&&(d.tag=c),l.format&&(d.format=l.format),o&&(d.comment=o),d}function pn(n,e,t,s,i){if(t==="!")return n[D];const r=[];for(const a of n.tags)if(!a.collection&&a.tag===t)if(a.default&&a.test)r.push(a);else return a;for(const a of r)if(a.test?.test(e))return a;const o=n.knownTags[t];return o&&!o.collection?(n.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),n[D])}function mn({atKey:n,directives:e,schema:t},s,i,r){const o=t.tags.find(a=>(a.default===!0||n&&a.default==="key")&&a.test?.test(s))||t[D];if(t.compat){const a=t.compat.find(c=>c.default&&c.test?.test(s))??t[D];if(o.tag!==a.tag){const c=e.tagString(o.tag),l=e.tagString(a.tag),d=`Value may be parsed as either ${c} or ${l}`;r(i,"TAG_RESOLVE_FAILED",d,!0)}}return o}function gn(n,e,t){if(e){t??(t=e.length);for(let s=t-1;s>=0;--s){let i=e[s];switch(i.type){case"space":case"comment":case"newline":n-=i.source.length;continue}for(i=e[++s];i?.type==="space";)n+=i.source.length,i=e[++s];break}}return n}const yn={composeNode:us,composeEmptyNode:mt};function us(n,e,t,s){const i=n.atKey,{spaceBefore:r,comment:o,anchor:a,tag:c}=t;let l,d=!0;switch(e.type){case"alias":l=bn(n,e,s),(a||c)&&s(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=ls(n,e,c,s),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=sn(yn,n,e,t,s),a&&(l.anchor=a.source.substring(1))}catch(u){const f=u instanceof Error?u.message:String(u);s(e,"RESOURCE_EXHAUSTION",f)}break;default:{const u=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;s(e,"UNEXPECTED_TOKEN",u),d=!1}}return l??(l=mt(n,e.offset,void 0,null,t,s)),a&&l.anchor===""&&s(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&n.options.stringKeys&&(!N(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&s(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(l.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?l.comment=o:l.commentBefore=o),n.options.keepSourceTokens&&d&&(l.srcToken=e),l}function mt(n,e,t,s,{spaceBefore:i,comment:r,anchor:o,tag:a,end:c},l){const d={type:"scalar",offset:gn(e,t,s),indent:-1,source:""},u=ls(n,d,a,l);return o&&(u.anchor=o.source.substring(1),u.anchor===""&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(u.spaceBefore=!0),r&&(u.comment=r,u.range[2]=c),u}function bn({options:n},{offset:e,source:t,end:s},i){const r=new nt(t.substring(1));r.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=e+t.length,a=ve(s,o,n.strict,i);return r.range=[e,o,a.offset],a.comment&&(r.comment=a.comment),r}function wn(n,e,{offset:t,start:s,value:i,end:r},o){const a=Object.assign({_directives:e},n),c=new pt(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=ie(s,{indicator:"doc-start",next:i??r?.[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});d.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!d.hasNewline&&o(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?us(l,i,d,o):mt(l,d.end,s,null,d,o);const u=c.contents.range[2],f=ve(r,u,!1,o);return f.comment&&(c.comment=f.comment),c.range=[t,u,f.offset],c}function ue(n){if(typeof n=="number")return[n,n+1];if(Array.isArray(n))return n.length===2?n:[n[0],n[1]];const{offset:e,source:t}=n;return[e,e+(typeof t=="string"?t.length:1)]}function St(n){let e="",t=!1,s=!1;for(let i=0;i<n.length;++i){const r=n[i];switch(r[0]){case"#":e+=(e===""?"":s?`
100
+
101
+ `:`
102
+ `)+(r.substring(1)||" "),t=!0,s=!1;break;case"%":n[i+1]?.[0]!=="#"&&(i+=1),t=!1;break;default:t||(s=!0),t=!1}}return{comment:e,afterEmptyLine:s}}class fs{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,s,i,r)=>{const o=ue(t);r?this.warnings.push(new zs(o,s,i)):this.errors.push(new he(o,s,i))},this.directives=new te({version:e.version||"1.2"}),this.options=e}decorate(e,t){const{comment:s,afterEmptyLine:i}=St(this.prelude);if(s){const r=e.contents;if(t)e.comment=e.comment?`${e.comment}
103
+ ${s}`:s;else if(i||e.directives.docStart||!r)e.commentBefore=s;else if(A(r)&&!r.flow&&r.items.length>0){let o=r.items[0];T(o)&&(o=o.key);const a=o.commentBefore;o.commentBefore=a?`${s}
104
+ ${a}`:s}else{const o=r.commentBefore;r.commentBefore=o?`${s}
105
+ ${o}`:s}}if(t){for(let r=0;r<this.errors.length;++r)e.errors.push(this.errors[r]);for(let r=0;r<this.warnings.length;++r)e.warnings.push(this.warnings[r])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:St(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,s=-1){for(const i of e)yield*this.next(i);yield*this.end(t,s)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,s,i)=>{const r=ue(e);r[0]+=t,this.onError(r,"BAD_DIRECTIVE",s,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const t=wn(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,s=new he(ue(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){const s="Unexpected doc-end without preceding document";this.errors.push(new he(ue(e),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;const t=ve(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){const s=this.doc.comment;this.doc.comment=s?`${s}
106
+ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new he(ue(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const s=Object.assign({_directives:this.directives},this.options),i=new pt(void 0,s);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,t,t],this.decorate(i,!1),yield i}}}const hs="\uFEFF",ds="",ps="",et="";function kn(n){switch(n){case hs:return"byte-order-mark";case ds:return"doc-mode";case ps:return"flow-error-end";case et:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
107
+ `:case`\r
108
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(n[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function j(n){switch(n){case void 0:case" ":case`
109
+ `:case"\r":case" ":return!0;default:return!1}}const Et=new Set("0123456789ABCDEFabcdef"),vn=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Ne=new Set(",[]{}"),$n=new Set(` ,[]{}
110
+ \r `),Ge=n=>!n||$n.has(n);class Sn{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let s=this.next??"stream";for(;s&&(t||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
111
+ `?!0:t==="\r"?this.buffer[e+1]===`
112
+ `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let s=0;for(;t===" ";)t=this.buffer[++s+e];if(t==="\r"){const i=this.buffer[s+e+1];if(i===`
113
+ `||!i&&!this.atEnd)return e+s+1}return t===`
114
+ `||s>=this.indentNext||!t&&!this.atEnd?e+s:-1}if(t==="-"||t==="."){const s=this.buffer.substr(e,3);if((s==="---"||s==="...")&&j(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
115
+ `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===hs&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,s=e.indexOf("#");for(;s!==-1;){const r=e[s-1];if(r===" "||r===" "){t=s-1;break}else s=e.indexOf("#",s+1)}for(;;){const r=e[t-1];if(r===" "||r===" ")t-=1;else break}const i=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){const t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield ds,yield*this.parseLineStart()}*parseLineStart(){const e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const t=this.peek(3);if((t==="---"||t==="...")&&j(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!j(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&j(t)){const s=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=s,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Ge),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,s=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=s=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);const i=this.getLine();if(i===null)return this.setNext("flow");if((s!==-1&&s<this.indentNext&&i[0]!=="#"||s===0&&(i.startsWith("---")||i.startsWith("..."))&&j(i[3]))&&!(s===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield ps,yield*this.parseLineStart();let r=0;for(;i[r]===",";)r+=yield*this.pushCount(1),r+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(r+=yield*this.pushIndicators(),i[r]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-r),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Ge),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||j(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const e=this.charAt(0);let t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let r=0;for(;this.buffer[t-1-r]==="\\";)r+=1;if(r%2===0)break;t=this.buffer.indexOf('"',t+1)}const s=this.buffer.substring(0,t);let i=s.indexOf(`
116
+ `,this.pos);if(i!==-1){for(;i!==-1;){const r=this.continueScalar(i+1);if(r===-1)break;i=s.indexOf(`
117
+ `,r)}i!==-1&&(t=i-(s[i-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>j(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,s;e:for(let r=this.pos;s=this.buffer[r];++r)switch(s){case" ":t+=1;break;case`
118
+ `:e=r,t=0;break;case"\r":{const o=this.buffer[r+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
119
+ `)break}default:break e}if(!s&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const r=this.continueScalar(e+1);if(r===-1)break;e=this.buffer.indexOf(`
120
+ `,r)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(s=this.buffer[i];s===" ";)s=this.buffer[++i];if(s===" "){for(;s===" "||s===" "||s==="\r"||s===`
121
+ `;)s=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let r=e-1,o=this.buffer[r];o==="\r"&&(o=this.buffer[--r]);const a=r;for(;o===" ";)o=this.buffer[--r];if(o===`
122
+ `&&r>=this.pos&&r+1+t>a)e=r;else break}while(!0);return yield et,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let t=this.pos-1,s=this.pos-1,i;for(;i=this.buffer[++s];)if(i===":"){const r=this.buffer[s+1];if(j(r)||e&&Ne.has(r))break;t=s}else if(j(i)){let r=this.buffer[s+1];if(i==="\r"&&(r===`
123
+ `?(s+=1,i=`
124
+ `,r=this.buffer[s+1]):t=s),r==="#"||e&&Ne.has(r))break;if(i===`
125
+ `){const o=this.continueScalar(s+1);if(o===-1)break;s=Math.max(s,o-2)}}else{if(e&&Ne.has(i))break;t=s}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield et,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){const s=this.buffer.slice(this.pos,e);return s?(yield s,this.pos+=s.length,s.length):(t&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(Ge),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const t=this.flowLevel>0,s=this.charAt(1);if(j(s)||t&&Ne.has(s)){t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!j(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(vn.has(t))t=this.buffer[++e];else if(t==="%"&&Et.has(this.buffer[e+1])&&Et.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return e===`
126
+ `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
127
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,s;do s=this.buffer[++t];while(s===" "||e&&s===" ");const i=t-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=t),i}*pushUntil(e){let t=this.pos,s=this.buffer[t];for(;!e(s);)s=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}class En{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,s=this.lineStarts.length;for(;t<s;){const r=t+s>>1;this.lineStarts[r]<e?t=r+1:s=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};const i=this.lineStarts[t-1];return{line:t,col:e-i+1}}}}function F(n,e){for(let t=0;t<n.length;++t)if(n[t].type===e)return!0;return!1}function Nt(n){for(let e=0;e<n.length;++e)switch(n[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function ms(n){switch(n?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Oe(n){switch(n.type){case"document":return n.start;case"block-map":{const e=n.items[n.items.length-1];return e.sep??e.start}case"block-seq":return n.items[n.items.length-1].start;default:return[]}}function X(n){if(n.length===0)return[];let e=n.length;e:for(;--e>=0;)switch(n[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;n[++e]?.type==="space";);return n.splice(e,n.length)}function Be(n,e){if(e.length<1e5)Array.prototype.push.apply(n,e);else for(let t=0;t<e.length;++t)n.push(e[t])}function Ot(n){if(n.start.type==="flow-seq-start")for(const e of n.items)e.sep&&!e.value&&!F(e.start,"explicit-key-ind")&&!F(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,ms(e.value)?e.value.end?Be(e.value.end,e.sep):e.value.end=e.sep:Be(e.start,e.sep),delete e.sep)}class gs{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Sn,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const s of this.lexer.lex(e,t))yield*this.next(s);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}const t=kn(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const s=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:s,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{const s=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in s?s.indent:0:t.type==="flow-collection"&&s.type==="document"&&(t.indent=0),t.type==="flow-collection"&&Ot(t),s.type){case"document":s.value=t;break;case"block-scalar":s.props.push(t);break;case"block-map":{const i=s.items[s.items.length-1];if(i.value){s.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=t;else{Object.assign(i,{key:t,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{const i=s.items[s.items.length-1];i.value?s.items.push({start:[],value:t}):i.value=t;break}case"flow-collection":{const i=s.items[s.items.length-1];!i||i.value?s.items.push({start:[],key:t,sep:[]}):i.sep?i.value=t:Object.assign(i,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){const i=t.items[t.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&Nt(i.start)===-1&&(t.indent===0||i.start.every(r=>r.type!=="comment"||r.indent<t.indent))&&(s.type==="document"?s.end=i.start:s.items.push({start:i.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{Nt(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}const t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){const t=Oe(this.peek(2)),s=X(t);let i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];const r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
128
+ `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
129
+ `,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){const s="end"in t.value?t.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){const s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){Be(s,t.start),s.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const s=!this.onKeyLine&&this.indent===e.indent,i=s&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind";let r=[];if(i&&t.sep&&!t.value){const o=[];for(let a=0;a<t.sep.length;++a){const c=t.sep[a];switch(c.type){case"newline":o.push(a);break;case"space":break;case"comment":c.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(r=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||t.value?(r.push(this.sourceToken),e.items.push({start:r}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):i||t.value?(r.push(this.sourceToken),e.items.push({start:r,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(F(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]});else if(ms(t.key)&&!F(t.sep,"newline")){const o=X(t.start),a=t.key,c=t.sep;c.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:c}]})}else r.length>0?t.sep=t.sep.concat(r,this.sourceToken):t.sep.push(this.sourceToken);else if(F(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{const o=X(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||i?e.items.push({start:r,key:null,sep:[this.sourceToken]}):F(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);i||t.value?(e.items.push({start:r,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!t.explicitKey&&t.sep&&!F(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else s&&e.items.push({start:r});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){const s="end"in t.value?t.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){const s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){Be(s,t.start),s.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||F(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){const s=this.startBlockValue(e);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while(s?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const i=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:i,sep:[]}):t.sep?this.stack.push(i):Object.assign(t,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const s=this.startBlockValue(e);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{const s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===e.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){const i=Oe(s),r=X(i);Ot(e);const o=e.end.splice(1,e.end.length);o.push(this.sourceToken);const a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
130
+ `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
131
+ `,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const t=Oe(e),s=X(t);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const t=Oe(e),s=X(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function ys(n){const e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new En||null,prettyErrors:e}}function Bn(n,e={}){const{lineCounter:t,prettyErrors:s}=ys(e),i=new gs(t?.addNewLine),r=new fs(e),o=Array.from(r.compose(i.parse(n)));if(s&&t)for(const a of o)a.errors.forEach(_e(n,t)),a.warnings.forEach(_e(n,t));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function Nn(n,e={}){const{lineCounter:t,prettyErrors:s}=ys(e),i=new gs(t?.addNewLine),r=new fs(e);let o=null;for(const a of r.compose(i.parse(n),!0,n.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new he(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&t&&(o.errors.forEach(_e(n,t)),o.warnings.forEach(_e(n,t))),o}function Kn(n,e,t){let s;typeof e=="function"?s=e:t===void 0&&e&&typeof e=="object"&&(t=e);const i=Nn(n,t);if(!i)return null;if(i.warnings.forEach(r=>jt(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:s},t))}function jn(n,e,t){let s=null;if(typeof e=="function"||Array.isArray(e)?s=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){const i=Math.round(t);t=i<1?void 0:i>8?{indent:8}:{indent:i}}if(n===void 0){const{keepUndefined:i}=t??e??{};if(!i)return}return ye(n)&&!s?n.toString(t):new pt(n,s,t).toString(t)}export{Kn as E,jn as L,Nn as a,Bn as h};
@@ -0,0 +1 @@
1
+ import{s as a,z as l,U as s,v as f,L as d}from"./index-BVuCxe14.js";const m=e=>String.raw`\u{${e.codePointAt(0).toString(16)}}`,p=(e,o,c)=>s(e,{start:o},{tabWidth:!1,...c}),g=/in JSON at position (\d+)(?: \(line (\d+) column (\d+)\))?$/,h=(e,o)=>{const c=g.exec(o);if(!c)return;const[,i,t,n]=c;if(t&&n)return{column:Number(n),line:Number(t)};let r=Number(i);return r===e.length&&(r=e.length-1),l(e,r)},N=/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,b=e=>e.replace(N,(o,c,i)=>`"${i}"(${m(i)})`);function w(e,o,c,i){let t;try{return JSON.parse(e,o)}catch(u){t=u.message}let n;e?(n=h(e,t),t=b(t)):t+=" while parsing empty string";const r=new a(t);throw r.fileName=c,n&&(r.codeFrame=p(e,n,i)),r}function S(e,o,c){const i=f(e,{buffer:!0,encoding:void 0});let t=new TextDecoder().decode(i);const{beforeParse:n,color:r}={};return typeof n=="function"&&(t=n(t)),w(t,o,d(e),{color:r})}export{w as N,S as a};
@@ -0,0 +1 @@
1
+ import{createRequire as g}from"node:module";import{f as l,m,a as v}from"./index-BVuCxe14.js";import{g as b}from"./env-Cpxa_7UE.js";import{a as j}from"./readJsonSync-DuMMeB3s-Cx08VBQg.js";const h=g(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_=e=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[t,r]=o.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return o.getBuiltinModule(e)}return h(e)},{rmSync:u,writeFileSync:k}=_("node:fs"),C=1440*60*1e3,R=15e3,w="https://registry.npmjs.org/-/npm/v1/keys",p=()=>m(b(),"registry-keys"),i=()=>m(p(),"npmjs.json"),A=()=>{const e=i();if(l(e))try{const t=j(e),r=Date.now()-t.createdAt>t.ttlMs;return{entry:t,expired:r}}catch{u(e,{force:!0});return}},M=(e,t)=>{v(p());const r={createdAt:Date.now(),keys:e,ttlMs:t};k(i(),JSON.stringify(r),"utf8")},q=async(e={})=>{const t=e.ttlMs??C,r=e.keysUrl??process.env.VIS_NPM_KEYS_URL??w,s=A();if(s!==void 0&&!s.expired&&e.forceRefresh!==!0)return{fromCache:!0,keys:s.entry.keys};const n=new AbortController,d=setTimeout(()=>{n.abort()},R),a=()=>{n.abort()};e.signal?.addEventListener("abort",a,{once:!0});try{const c=await fetch(r,{headers:{Accept:"application/json"},signal:n.signal});if(!c.ok)return s!==void 0?{fromCache:!0,keys:s.entry.keys,stale:!0}:void 0;const y=await c.json(),f=Array.isArray(y.keys)?y.keys:[];return M(f,t),{fromCache:!1,keys:f}}catch{return s!==void 0?{fromCache:!0,keys:s.entry.keys,stale:!0}:void 0}finally{clearTimeout(d),e.signal?.removeEventListener("abort",a)}},x=()=>{const e=i();return l(e)?(u(e,{force:!0}),!0):!1};export{x as c,q as f};