@rpamis/comet 0.4.0-beta.18 → 0.4.0-beta.19

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 (241) hide show
  1. package/README.md +18 -3
  2. package/assets/manifest.json +3 -1
  3. package/assets/skills/comet/scripts/comet-archive.mjs +121 -121
  4. package/assets/skills/comet/scripts/comet-entry-runtime.mjs +84 -84
  5. package/assets/skills/comet/scripts/comet-guard.mjs +152 -152
  6. package/assets/skills/comet/scripts/comet-handoff.mjs +123 -123
  7. package/assets/skills/comet/scripts/comet-hook-guard.mjs +75 -75
  8. package/assets/skills/comet/scripts/comet-hook-router.mjs +91 -91
  9. package/assets/skills/comet/scripts/comet-intent.mjs +6 -6
  10. package/assets/skills/comet/scripts/comet-resume-probe.mjs +79 -79
  11. package/assets/skills/comet/scripts/comet-runtime.mjs +169 -169
  12. package/assets/skills/comet/scripts/comet-state.mjs +88 -88
  13. package/assets/skills/comet/scripts/comet-yaml-validate.mjs +97 -97
  14. package/assets/skills/comet-build/SKILL.md +21 -6
  15. package/assets/skills/comet-design/SKILL.md +2 -2
  16. package/assets/skills/comet-native/SKILL.md +7 -7
  17. package/assets/skills/comet-native/reference/artifacts.md +3 -3
  18. package/assets/skills/comet-native/reference/clarification.md +1 -1
  19. package/assets/skills/comet-native/reference/commands.md +3 -3
  20. package/assets/skills/comet-native/scripts/comet-native-archive.mjs +114 -113
  21. package/assets/skills/comet-native/scripts/comet-native-doctor.mjs +123 -123
  22. package/assets/skills/comet-native/scripts/comet-native-hook-guard.mjs +88 -88
  23. package/assets/skills/comet-native/scripts/comet-native-init.mjs +116 -116
  24. package/assets/skills/comet-native/scripts/comet-native-new.mjs +100 -100
  25. package/assets/skills/comet-native/scripts/comet-native-next.mjs +118 -118
  26. package/assets/skills/comet-native/scripts/comet-native-root.mjs +95 -95
  27. package/assets/skills/comet-native/scripts/comet-native-runtime.mjs +145 -144
  28. package/assets/skills/comet-native/scripts/comet-native-select.mjs +101 -101
  29. package/assets/skills/comet-native/scripts/comet-native-show.mjs +83 -83
  30. package/assets/skills/comet-native/scripts/comet-native-spec.mjs +87 -87
  31. package/assets/skills/comet-native/scripts/comet-native-status.mjs +98 -98
  32. package/assets/skills/comet-review/SKILL.md +121 -0
  33. package/assets/skills/comet-review/agents/openai.yaml +5 -0
  34. package/assets/skills-zh/comet-build/SKILL.md +21 -6
  35. package/assets/skills-zh/comet-design/SKILL.md +2 -2
  36. package/assets/skills-zh/comet-native/SKILL.md +7 -7
  37. package/assets/skills-zh/comet-native/reference/artifacts.md +3 -3
  38. package/assets/skills-zh/comet-native/reference/clarification.md +1 -1
  39. package/assets/skills-zh/comet-native/reference/commands.md +3 -3
  40. package/assets/skills-zh/comet-review/SKILL.md +121 -0
  41. package/assets/skills-zh/comet-review/agents/openai.yaml +5 -0
  42. package/dist/app/commands/init.d.ts.map +1 -1
  43. package/dist/app/commands/init.js +5 -9
  44. package/dist/app/commands/init.js.map +1 -1
  45. package/dist/app/commands/update.d.ts.map +1 -1
  46. package/dist/app/commands/update.js +5 -9
  47. package/dist/app/commands/update.js.map +1 -1
  48. package/dist/domains/comet-classic/classic-command-context.d.ts +9 -0
  49. package/dist/domains/comet-classic/classic-command-context.d.ts.map +1 -1
  50. package/dist/domains/comet-classic/classic-command-context.js +10 -0
  51. package/dist/domains/comet-classic/classic-command-context.js.map +1 -1
  52. package/dist/domains/comet-classic/classic-guard.d.ts.map +1 -1
  53. package/dist/domains/comet-classic/classic-guard.js +2 -2
  54. package/dist/domains/comet-classic/classic-guard.js.map +1 -1
  55. package/dist/domains/comet-classic/classic-handoff.d.ts.map +1 -1
  56. package/dist/domains/comet-classic/classic-handoff.js +44 -6
  57. package/dist/domains/comet-classic/classic-handoff.js.map +1 -1
  58. package/dist/domains/comet-classic/classic-hook-guard.d.ts.map +1 -1
  59. package/dist/domains/comet-classic/classic-hook-guard.js +2 -1
  60. package/dist/domains/comet-classic/classic-hook-guard.js.map +1 -1
  61. package/dist/domains/comet-classic/classic-intent-command.d.ts.map +1 -1
  62. package/dist/domains/comet-classic/classic-intent-command.js +2 -1
  63. package/dist/domains/comet-classic/classic-intent-command.js.map +1 -1
  64. package/dist/domains/comet-classic/classic-resume-probe-command.d.ts.map +1 -1
  65. package/dist/domains/comet-classic/classic-resume-probe-command.js +4 -3
  66. package/dist/domains/comet-classic/classic-resume-probe-command.js.map +1 -1
  67. package/dist/domains/comet-classic/classic-runtime-run.d.ts +6 -0
  68. package/dist/domains/comet-classic/classic-runtime-run.d.ts.map +1 -1
  69. package/dist/domains/comet-classic/classic-runtime-run.js +58 -9
  70. package/dist/domains/comet-classic/classic-runtime-run.js.map +1 -1
  71. package/dist/domains/comet-classic/classic-state-command.d.ts.map +1 -1
  72. package/dist/domains/comet-classic/classic-state-command.js +8 -5
  73. package/dist/domains/comet-classic/classic-state-command.js.map +1 -1
  74. package/dist/domains/comet-classic/classic-validate-command.d.ts.map +1 -1
  75. package/dist/domains/comet-classic/classic-validate-command.js +2 -2
  76. package/dist/domains/comet-classic/classic-validate-command.js.map +1 -1
  77. package/dist/domains/comet-classic/classic-workspace-command.d.ts.map +1 -1
  78. package/dist/domains/comet-classic/classic-workspace-command.js +3 -3
  79. package/dist/domains/comet-classic/classic-workspace-command.js.map +1 -1
  80. package/dist/domains/comet-entry/hook-adapter.d.ts.map +1 -1
  81. package/dist/domains/comet-entry/hook-adapter.js +4 -1
  82. package/dist/domains/comet-entry/hook-adapter.js.map +1 -1
  83. package/dist/domains/comet-native/native-archive-command.d.ts.map +1 -1
  84. package/dist/domains/comet-native/native-archive-command.js +2 -0
  85. package/dist/domains/comet-native/native-archive-command.js.map +1 -1
  86. package/dist/domains/comet-native/native-atomic-file.d.ts.map +1 -1
  87. package/dist/domains/comet-native/native-atomic-file.js +17 -10
  88. package/dist/domains/comet-native/native-atomic-file.js.map +1 -1
  89. package/dist/domains/comet-native/native-children.d.ts +18 -2
  90. package/dist/domains/comet-native/native-children.d.ts.map +1 -1
  91. package/dist/domains/comet-native/native-children.js +73 -8
  92. package/dist/domains/comet-native/native-children.js.map +1 -1
  93. package/dist/domains/comet-native/native-cli-help.d.ts.map +1 -1
  94. package/dist/domains/comet-native/native-cli-help.js +10 -4
  95. package/dist/domains/comet-native/native-cli-help.js.map +1 -1
  96. package/dist/domains/comet-native/native-cli-shared.d.ts.map +1 -1
  97. package/dist/domains/comet-native/native-cli-shared.js +18 -5
  98. package/dist/domains/comet-native/native-cli-shared.js.map +1 -1
  99. package/dist/domains/comet-native/native-hook-guard.d.ts.map +1 -1
  100. package/dist/domains/comet-native/native-hook-guard.js +15 -2
  101. package/dist/domains/comet-native/native-hook-guard.js.map +1 -1
  102. package/dist/domains/comet-native/native-next-command.d.ts.map +1 -1
  103. package/dist/domains/comet-native/native-next-command.js +94 -15
  104. package/dist/domains/comet-native/native-next-command.js.map +1 -1
  105. package/dist/domains/comet-native/native-portable-continuation.d.ts +19 -7
  106. package/dist/domains/comet-native/native-portable-continuation.d.ts.map +1 -1
  107. package/dist/domains/comet-native/native-portable-continuation.js +115 -72
  108. package/dist/domains/comet-native/native-portable-continuation.js.map +1 -1
  109. package/dist/domains/comet-native/native-portable-migration-runtime.d.ts.map +1 -1
  110. package/dist/domains/comet-native/native-portable-migration-runtime.js +9 -4
  111. package/dist/domains/comet-native/native-portable-migration-runtime.js.map +1 -1
  112. package/dist/domains/comet-native/native-portable-runtime.d.ts +14 -1
  113. package/dist/domains/comet-native/native-portable-runtime.d.ts.map +1 -1
  114. package/dist/domains/comet-native/native-portable-runtime.js +59 -1
  115. package/dist/domains/comet-native/native-portable-runtime.js.map +1 -1
  116. package/dist/domains/comet-native/native-pull-request-finish.d.ts +35 -0
  117. package/dist/domains/comet-native/native-pull-request-finish.d.ts.map +1 -0
  118. package/dist/domains/comet-native/native-pull-request-finish.js +282 -0
  119. package/dist/domains/comet-native/native-pull-request-finish.js.map +1 -0
  120. package/dist/domains/comet-native/native-status-discovery.d.ts.map +1 -1
  121. package/dist/domains/comet-native/native-status-discovery.js +24 -6
  122. package/dist/domains/comet-native/native-status-discovery.js.map +1 -1
  123. package/dist/domains/comet-native/native-workspace-finish.d.ts +6 -0
  124. package/dist/domains/comet-native/native-workspace-finish.d.ts.map +1 -1
  125. package/dist/domains/comet-native/native-workspace-finish.js +86 -35
  126. package/dist/domains/comet-native/native-workspace-finish.js.map +1 -1
  127. package/dist/domains/dashboard/web/assets/{abnfDiagram-N423BO3Z-B5cFR6hS.js → abnfDiagram-N423BO3Z-BYya6ofk.js} +1 -1
  128. package/dist/domains/dashboard/web/assets/{arc-CVQDtMsu.js → arc-DJbo4TD3.js} +1 -1
  129. package/dist/domains/dashboard/web/assets/{architectureDiagram-T3A2C74G-C0v0kULK.js → architectureDiagram-T3A2C74G-D8uZ2IB-.js} +1 -1
  130. package/dist/domains/dashboard/web/assets/{blockDiagram-VBNYF7ZC-DpHLuxu4.js → blockDiagram-VBNYF7ZC-B16BVj-r.js} +1 -1
  131. package/dist/domains/dashboard/web/assets/{c4Diagram-5PPSVZJV-BHnFxUs1.js → c4Diagram-5PPSVZJV-ayV208_D.js} +1 -1
  132. package/dist/domains/dashboard/web/assets/channel-CEsrvmig.js +1 -0
  133. package/dist/domains/dashboard/web/assets/{chunk-2GRJ4B5K-CGC9gh5n.js → chunk-2GRJ4B5K-Bn5o8p3H.js} +1 -1
  134. package/dist/domains/dashboard/web/assets/{chunk-2Q5K7J3B-l4puLU_O.js → chunk-2Q5K7J3B-BnF1SI6B.js} +1 -1
  135. package/dist/domains/dashboard/web/assets/{chunk-5RXB4S5H-ls9jQHZc.js → chunk-5RXB4S5H-ETnma053.js} +1 -1
  136. package/dist/domains/dashboard/web/assets/{chunk-5VM5RSS4-BVavmTEq.js → chunk-5VM5RSS4-Cuvy639H.js} +1 -1
  137. package/dist/domains/dashboard/web/assets/{chunk-6Q2QTUOP-Dungt2g9.js → chunk-6Q2QTUOP-DOXBzl73.js} +1 -1
  138. package/dist/domains/dashboard/web/assets/{chunk-GF5L2VYU-BidXO_ZP.js → chunk-GF5L2VYU-CfREXlEl.js} +1 -1
  139. package/dist/domains/dashboard/web/assets/{chunk-JWPE2WC7-57L5Up5X.js → chunk-JWPE2WC7-DWIdpYTb.js} +1 -1
  140. package/dist/domains/dashboard/web/assets/{chunk-KBJHAD2P-C5u5vbwr.js → chunk-KBJHAD2P-BnqPcfZB.js} +1 -1
  141. package/dist/domains/dashboard/web/assets/{chunk-RYQCIY6F-CvLz21I2.js → chunk-RYQCIY6F-DdJ00fZz.js} +1 -1
  142. package/dist/domains/dashboard/web/assets/{chunk-XXDRQBXY-D5nJpckG.js → chunk-XXDRQBXY-BVDhdJyW.js} +1 -1
  143. package/dist/domains/dashboard/web/assets/classDiagram-JCYQIIEL-CKFe0hg4.js +1 -0
  144. package/dist/domains/dashboard/web/assets/classDiagram-v2-OCEON4UE-CKFe0hg4.js +1 -0
  145. package/dist/domains/dashboard/web/assets/{cose-bilkent-JH36ORCC-Dp0JAGyE.js → cose-bilkent-JH36ORCC-C-nglwHC.js} +1 -1
  146. package/dist/domains/dashboard/web/assets/{cynefin-VYW2F7L2-EjC54l1g.js → cynefin-VYW2F7L2-C8TMmrbP.js} +1 -1
  147. package/dist/domains/dashboard/web/assets/{cynefinDiagram-MW4NZA55-CpYrW3w3.js → cynefinDiagram-MW4NZA55-C3pnQnjg.js} +1 -1
  148. package/dist/domains/dashboard/web/assets/{dagre-VZM6K2ZE-h5K39rCk.js → dagre-VZM6K2ZE-DY7UWiPI.js} +1 -1
  149. package/dist/domains/dashboard/web/assets/{diagram-7IWD3JNH-CKQj9O4H.js → diagram-7IWD3JNH-voTyDkQ5.js} +1 -1
  150. package/dist/domains/dashboard/web/assets/{diagram-B4RE2ZJO-DXRIYcnW.js → diagram-B4RE2ZJO-B3VkUMck.js} +1 -1
  151. package/dist/domains/dashboard/web/assets/{diagram-LBJQPF4R-wWutQYmv.js → diagram-LBJQPF4R-BdJzPkv8.js} +1 -1
  152. package/dist/domains/dashboard/web/assets/{diagram-Q27KOJAE-EgXLJQYi.js → diagram-Q27KOJAE-Bsq0anZx.js} +1 -1
  153. package/dist/domains/dashboard/web/assets/{diagram-UB23O5K3-CsQRXDQZ.js → diagram-UB23O5K3-CBaKRbcu.js} +1 -1
  154. package/dist/domains/dashboard/web/assets/{ebnfDiagram-BXEA7PRR-gm328Eho.js → ebnfDiagram-BXEA7PRR-Bl9Bm5wa.js} +1 -1
  155. package/dist/domains/dashboard/web/assets/{erDiagram-JOGREHBK-BbbMVUx_.js → erDiagram-JOGREHBK-DjOZzfKI.js} +1 -1
  156. package/dist/domains/dashboard/web/assets/{flowDiagram-UKHOOZJN-1Y7scCns.js → flowDiagram-UKHOOZJN-C21e4siK.js} +1 -1
  157. package/dist/domains/dashboard/web/assets/{ganttDiagram-PKOTCBZU-BAoBqczv.js → ganttDiagram-PKOTCBZU-Bs62uy6-.js} +1 -1
  158. package/dist/domains/dashboard/web/assets/{gitGraphDiagram-DS77QQ5N-CMUAyEzl.js → gitGraphDiagram-DS77QQ5N-DQY_Ba00.js} +1 -1
  159. package/dist/domains/dashboard/web/assets/{index-CCApJ0Yr.js → index-BLv71GRj.js} +1 -1
  160. package/dist/domains/dashboard/web/assets/{index-DWdm_XBi.js → index-Be4r99N4.js} +3 -3
  161. package/dist/domains/dashboard/web/assets/index-ByVYiA6g.css +1 -0
  162. package/dist/domains/dashboard/web/assets/{infoDiagram-6WML65LV-BaCdtYYC.js → infoDiagram-6WML65LV-CNgNNG9l.js} +1 -1
  163. package/dist/domains/dashboard/web/assets/{ishikawaDiagram-WSZJBQD7-DQQlNnjU.js → ishikawaDiagram-WSZJBQD7-D9k1fTO1.js} +1 -1
  164. package/dist/domains/dashboard/web/assets/{journeyDiagram-NVQOT4AX-DW9wUMqn.js → journeyDiagram-NVQOT4AX-CHijUnPl.js} +1 -1
  165. package/dist/domains/dashboard/web/assets/{kanban-definition-27J2QSJJ-C_ITaZ0q.js → kanban-definition-27J2QSJJ-DfWlntDq.js} +1 -1
  166. package/dist/domains/dashboard/web/assets/{linear-DXOo6ZRT.js → linear-o6hemX-z.js} +1 -1
  167. package/dist/domains/dashboard/web/assets/{mermaid.core-ol-0NI97.js → mermaid.core-B1DoOsPD.js} +4 -4
  168. package/dist/domains/dashboard/web/assets/{mindmap-definition-FAOFIHXS-CHF_HOLV.js → mindmap-definition-FAOFIHXS-COMQF9Yy.js} +1 -1
  169. package/dist/domains/dashboard/web/assets/{pegDiagram-VL7TDLO6-wQEvkNF8.js → pegDiagram-VL7TDLO6-C_21n7Ps.js} +1 -1
  170. package/dist/domains/dashboard/web/assets/{pieDiagram-7S7Q4E2Y-C3H3kiIP.js → pieDiagram-7S7Q4E2Y-D3EmoYDY.js} +1 -1
  171. package/dist/domains/dashboard/web/assets/{quadrantDiagram-CIZ2JOQS-S0FdVzJb.js → quadrantDiagram-CIZ2JOQS-C3fGdiMa.js} +1 -1
  172. package/dist/domains/dashboard/web/assets/{railroadDiagram-AXF67PYL-DCDXDaVg.js → railroadDiagram-AXF67PYL-mIsjemD-.js} +1 -1
  173. package/dist/domains/dashboard/web/assets/{requirementDiagram-LRYGKXZP-BW8J4gO_.js → requirementDiagram-LRYGKXZP-D_UMpS5e.js} +1 -1
  174. package/dist/domains/dashboard/web/assets/{sankeyDiagram-W5VNT64P-DQQBmLoy.js → sankeyDiagram-W5VNT64P-D1MwyMF6.js} +1 -1
  175. package/dist/domains/dashboard/web/assets/{sequenceDiagram-SI44F4Z6-2tDcli0Y.js → sequenceDiagram-SI44F4Z6-B8jp1RxX.js} +1 -1
  176. package/dist/domains/dashboard/web/assets/{sizeCapture-X5ZJPWSS-4sEZLBKb.js → sizeCapture-X5ZJPWSS-BKioI1Ql.js} +1 -1
  177. package/dist/domains/dashboard/web/assets/{stateDiagram-OKZ733FA-OgPb8pyR.js → stateDiagram-OKZ733FA-B7l8_CDo.js} +1 -1
  178. package/dist/domains/dashboard/web/assets/stateDiagram-v2-UEYNNEHI-BIxuwbeV.js +1 -0
  179. package/dist/domains/dashboard/web/assets/{swimlanes-SLNWSIFB-DR7lwtxd.js → swimlanes-SLNWSIFB-951PRLYp.js} +2 -2
  180. package/dist/domains/dashboard/web/assets/swimlanesDiagram-ULZ7WXOC-CEo6cGsy.js +8 -0
  181. package/dist/domains/dashboard/web/assets/{timeline-definition-Z64GVDOM-DNIJVlQV.js → timeline-definition-Z64GVDOM-CeyA2KbI.js} +1 -1
  182. package/dist/domains/dashboard/web/assets/{vennDiagram-T6HMQDX7-CClhw4QZ.js → vennDiagram-T6HMQDX7-BHe0TZJV.js} +1 -1
  183. package/dist/domains/dashboard/web/assets/{wardleyDiagram-T6FBY63Y-DzR3aFPS.js → wardleyDiagram-T6FBY63Y-CWqdSzJ-.js} +1 -1
  184. package/dist/domains/dashboard/web/assets/{xychartDiagram-ELKLHX3M-DZhq0ZRj.js → xychartDiagram-ELKLHX3M-DCKiZVPV.js} +1 -1
  185. package/dist/domains/dashboard/web/index.html +2 -2
  186. package/dist/domains/dashboard/workspace.d.ts +3 -0
  187. package/dist/domains/dashboard/workspace.d.ts.map +1 -1
  188. package/dist/domains/dashboard/workspace.js +23 -2
  189. package/dist/domains/dashboard/workspace.js.map +1 -1
  190. package/dist/domains/integrations/openspec.d.ts +1 -1
  191. package/dist/domains/integrations/openspec.d.ts.map +1 -1
  192. package/dist/domains/integrations/openspec.js +43 -84
  193. package/dist/domains/integrations/openspec.js.map +1 -1
  194. package/dist/domains/integrations/superpowers.d.ts +10 -1
  195. package/dist/domains/integrations/superpowers.d.ts.map +1 -1
  196. package/dist/domains/integrations/superpowers.js +73 -4
  197. package/dist/domains/integrations/superpowers.js.map +1 -1
  198. package/dist/domains/skill/platform-inspect.d.ts.map +1 -1
  199. package/dist/domains/skill/platform-inspect.js +3 -3
  200. package/dist/domains/skill/platform-inspect.js.map +1 -1
  201. package/dist/domains/skill/platform-install.d.ts +3 -1
  202. package/dist/domains/skill/platform-install.d.ts.map +1 -1
  203. package/dist/domains/skill/platform-install.js +15 -9
  204. package/dist/domains/skill/platform-install.js.map +1 -1
  205. package/dist/domains/skill/project-instructions.d.ts.map +1 -1
  206. package/dist/domains/skill/project-instructions.js +6 -0
  207. package/dist/domains/skill/project-instructions.js.map +1 -1
  208. package/dist/domains/skill/uninstall.d.ts.map +1 -1
  209. package/dist/domains/skill/uninstall.js +39 -29
  210. package/dist/domains/skill/uninstall.js.map +1 -1
  211. package/dist/domains/workflow-contract/contained-atomic-write.d.ts.map +1 -1
  212. package/dist/domains/workflow-contract/contained-atomic-write.js +18 -10
  213. package/dist/domains/workflow-contract/contained-atomic-write.js.map +1 -1
  214. package/dist/domains/workflow-contract/project-config.d.ts +4 -2
  215. package/dist/domains/workflow-contract/project-config.d.ts.map +1 -1
  216. package/dist/domains/workflow-contract/project-config.js +132 -0
  217. package/dist/domains/workflow-contract/project-config.js.map +1 -1
  218. package/dist/domains/workflow-contract/types.d.ts +9 -0
  219. package/dist/domains/workflow-contract/types.d.ts.map +1 -1
  220. package/dist/platform/fs/strip-bom.d.ts +10 -0
  221. package/dist/platform/fs/strip-bom.d.ts.map +1 -0
  222. package/dist/platform/fs/strip-bom.js +12 -0
  223. package/dist/platform/fs/strip-bom.js.map +1 -0
  224. package/dist/platform/install/platforms.d.ts +11 -0
  225. package/dist/platform/install/platforms.d.ts.map +1 -1
  226. package/dist/platform/install/platforms.js +36 -0
  227. package/dist/platform/install/platforms.js.map +1 -1
  228. package/dist/platform/process/external-command.d.ts +1 -0
  229. package/dist/platform/process/external-command.d.ts.map +1 -1
  230. package/dist/platform/process/external-command.js +2 -1
  231. package/dist/platform/process/external-command.js.map +1 -1
  232. package/eval/local/tests/conftest.py +18 -3
  233. package/eval/local/tests/scaffold/test_conftest_helpers.py +57 -0
  234. package/package.json +11 -26
  235. package/dist/domains/dashboard/web/assets/channel-eM0x3m1G.js +0 -1
  236. package/dist/domains/dashboard/web/assets/classDiagram-JCYQIIEL-CEFhao2K.js +0 -1
  237. package/dist/domains/dashboard/web/assets/classDiagram-v2-OCEON4UE-CEFhao2K.js +0 -1
  238. package/dist/domains/dashboard/web/assets/index-DhhbseFJ.css +0 -1
  239. package/dist/domains/dashboard/web/assets/stateDiagram-v2-UEYNNEHI-CiDNPr4P.js +0 -1
  240. package/dist/domains/dashboard/web/assets/swimlanesDiagram-ULZ7WXOC-DggHFP9q.js +0 -8
  241. package/eval/local/tasks/comet-native-interrupted-transition/environment/.comet/config.yaml +0 -6
@@ -1,77 +1,77 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __cometCreateRequire } from 'module';
3
3
  const require = __cometCreateRequire(import.meta.url);
4
- var _l=Object.create;var gn=Object.defineProperty;var xl=Object.getOwnPropertyDescriptor;var Al=Object.getOwnPropertyNames;var Nl=Object.getPrototypeOf,Ol=Object.prototype.hasOwnProperty;var Ut=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var T=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var g=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Rl=(t,e)=>{for(var r in e)gn(t,r,{get:e[r],enumerable:!0})},Tl=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Al(e))!Ol.call(t,i)&&i!==r&&gn(t,i,{get:()=>e[i],enumerable:!(n=xl(e,i))||n.enumerable});return t};var rt=(t,e,r)=>(r=t!=null?_l(Nl(t)):{},Tl(e||!t||!t.__esModule?gn(r,"default",{value:t,enumerable:!0}):r,t));function Oo(t,e){let r=t;for(let n of e)r+="\0"+(typeof n=="string"?n:JSON.stringify(n));return r}function Ce(t,e){return(...r)=>{let n=No;if(n===null)return e(...r);let i=Oo(`async:${t}`,r),o=n.entries.get(i);if(o)return o.value;let s=e(...r).catch(a=>{throw n.entries.delete(i),a});return n.entries.set(i,{value:s}),s}}function wn(t,e){return(...r)=>{let n=No;if(n===null)return e(...r);let i=Oo(`sync:${t}`,r),o=n.entries.get(i);if(o)return o.value;let s=e(...r);return n.entries.set(i,{value:s}),s}}var No,nt=T(()=>{"use strict";No=null});var P=g(j=>{"use strict";var bn=Symbol.for("yaml.alias"),Ro=Symbol.for("yaml.document"),Gt=Symbol.for("yaml.map"),To=Symbol.for("yaml.pair"),vn=Symbol.for("yaml.scalar"),Ht=Symbol.for("yaml.seq"),te=Symbol.for("yaml.node.type"),Ll=t=>!!t&&typeof t=="object"&&t[te]===bn,ql=t=>!!t&&typeof t=="object"&&t[te]===Ro,Wl=t=>!!t&&typeof t=="object"&&t[te]===Gt,Dl=t=>!!t&&typeof t=="object"&&t[te]===To,Io=t=>!!t&&typeof t=="object"&&t[te]===vn,$l=t=>!!t&&typeof t=="object"&&t[te]===Ht;function jo(t){if(t&&typeof t=="object")switch(t[te]){case Gt:case Ht:return!0}return!1}function Ml(t){if(t&&typeof t=="object")switch(t[te]){case bn:case Gt:case vn:case Ht:return!0}return!1}var Bl=t=>(Io(t)||jo(t))&&!!t.anchor;j.ALIAS=bn;j.DOC=Ro;j.MAP=Gt;j.NODE_TYPE=te;j.PAIR=To;j.SCALAR=vn;j.SEQ=Ht;j.hasAnchor=Bl;j.isAlias=Ll;j.isCollection=jo;j.isDocument=ql;j.isMap=Wl;j.isNode=Ml;j.isPair=Dl;j.isScalar=Io;j.isSeq=$l});var it=g(kn=>{"use strict";var I=P(),$=Symbol("break visit"),Lo=Symbol("skip children"),X=Symbol("remove node");function Yt(t,e){let r=qo(e);I.isDocument(t)?Le(null,t.contents,r,Object.freeze([t]))===X&&(t.contents=null):Le(null,t,r,Object.freeze([]))}Yt.BREAK=$;Yt.SKIP=Lo;Yt.REMOVE=X;function Le(t,e,r,n){let i=Wo(t,e,r,n);if(I.isNode(i)||I.isPair(i))return Do(t,n,i),Le(t,i,r,n);if(typeof i!="symbol"){if(I.isCollection(e)){n=Object.freeze(n.concat(e));for(let o=0;o<e.items.length;++o){let s=Le(o,e.items[o],r,n);if(typeof s=="number")o=s-1;else{if(s===$)return $;s===X&&(e.items.splice(o,1),o-=1)}}}else if(I.isPair(e)){n=Object.freeze(n.concat(e));let o=Le("key",e.key,r,n);if(o===$)return $;o===X&&(e.key=null);let s=Le("value",e.value,r,n);if(s===$)return $;s===X&&(e.value=null)}}return i}async function Jt(t,e){let r=qo(e);I.isDocument(t)?await qe(null,t.contents,r,Object.freeze([t]))===X&&(t.contents=null):await qe(null,t,r,Object.freeze([]))}Jt.BREAK=$;Jt.SKIP=Lo;Jt.REMOVE=X;async function qe(t,e,r,n){let i=await Wo(t,e,r,n);if(I.isNode(i)||I.isPair(i))return Do(t,n,i),qe(t,i,r,n);if(typeof i!="symbol"){if(I.isCollection(e)){n=Object.freeze(n.concat(e));for(let o=0;o<e.items.length;++o){let s=await qe(o,e.items[o],r,n);if(typeof s=="number")o=s-1;else{if(s===$)return $;s===X&&(e.items.splice(o,1),o-=1)}}}else if(I.isPair(e)){n=Object.freeze(n.concat(e));let o=await qe("key",e.key,r,n);if(o===$)return $;o===X&&(e.key=null);let s=await qe("value",e.value,r,n);if(s===$)return $;s===X&&(e.value=null)}}return i}function qo(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function Wo(t,e,r,n){if(typeof r=="function")return r(t,e,n);if(I.isMap(e))return r.Map?.(t,e,n);if(I.isSeq(e))return r.Seq?.(t,e,n);if(I.isPair(e))return r.Pair?.(t,e,n);if(I.isScalar(e))return r.Scalar?.(t,e,n);if(I.isAlias(e))return r.Alias?.(t,e,n)}function Do(t,e,r){let n=e[e.length-1];if(I.isCollection(n))n.items[t]=r;else if(I.isPair(n))t==="key"?n.key=r:n.value=r;else if(I.isDocument(n))n.contents=r;else{let i=I.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}kn.visit=Yt;kn.visitAsync=Jt});var Sn=g(Mo=>{"use strict";var $o=P(),Fl=it(),Kl={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Ul=t=>t.replace(/[!,[\]{}]/g,e=>Kl[e]),ot=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[o,s]=n;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[o]=n;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return r(6,`Unsupported YAML version ${o}`,s),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let s=e.slice(2,-1);return s==="!"||s==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),s)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let o=this.tags[n];if(o)try{return o+decodeURIComponent(i)}catch(s){return r(String(s)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+Ul(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&$o.isNode(e.contents)){let o={};Fl.visit(e.contents,(s,a)=>{$o.isNode(a)&&a.tag&&(o[a.tag]=!0)}),i=Object.keys(o)}else i=[];for(let[o,s]of n)o==="!!"&&s==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(s)))&&r.push(`%TAG ${o} ${s}`);return r.join(`
5
- `)}};ot.defaultYaml={explicit:!1,version:"1.2"};ot.defaultTags={"!!":"tag:yaml.org,2002:"};Mo.Directives=ot});var Vt=g(st=>{"use strict";var Bo=P(),Gl=it();function Hl(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function Fo(t){let e=new Set;return Gl.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function Ko(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function Yl(t,e){let r=[],n=new Map,i=null;return{onAnchor:o=>{r.push(o),i??(i=Fo(t));let s=Ko(e,i);return i.add(s),s},setAnchors:()=>{for(let o of r){let s=n.get(o);if(typeof s=="object"&&s.anchor&&(Bo.isScalar(s.node)||Bo.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:n}}st.anchorIsValid=Hl;st.anchorNames=Fo;st.createNodeAnchors=Yl;st.findNewAnchor=Ko});var Cn=g(Uo=>{"use strict";function at(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,o=n.length;i<o;++i){let s=n[i],a=at(t,n,String(i),s);a===void 0?delete n[i]:a!==s&&(n[i]=a)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let o=n.get(i),s=at(t,n,i,o);s===void 0?n.delete(i):s!==o&&n.set(i,s)}else if(n instanceof Set)for(let i of Array.from(n)){let o=at(t,n,i,i);o===void 0?n.delete(i):o!==i&&(n.delete(i),n.add(o))}else for(let[i,o]of Object.entries(n)){let s=at(t,n,i,o);s===void 0?delete n[i]:s!==o&&(n[i]=s)}return t.call(e,r,n)}Uo.applyReviver=at});var ae=g(Ho=>{"use strict";var Jl=P();function Go(t,e,r){if(Array.isArray(t))return t.map((n,i)=>Go(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!Jl.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=o=>{n.res=o,delete r.onCreate};let i=t.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof t=="bigint"&&!r?.keep?Number(t):t}Ho.toJS=Go});var zt=g(Jo=>{"use strict";var Vl=Cn(),Yo=P(),zl=ae(),En=class{constructor(e){Object.defineProperty(this,Yo.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:o}={}){if(!Yo.isDocument(e))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=zl.toJS(this,"",s);if(typeof i=="function")for(let{count:c,res:l}of s.anchors.values())i(l,c);return typeof o=="function"?Vl.applyReviver(o,{"":a},"",a):a}};Jo.NodeBase=En});var ct=g(Vo=>{"use strict";var Xl=Vt(),Ql=it(),We=P(),Zl=zt(),eu=ae(),Pn=class extends Zl.NodeBase{constructor(e){super(We.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],Ql.visit(e,{Node:(o,s)=>{(We.isAlias(s)||We.hasAnchor(s))&&n.push(s)}}),r&&(r.aliasResolveCache=n));let i;for(let o of n){if(o===this)break;o.anchor===this.source&&(i=o)}return i}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:o}=r,s=this.resolve(i,r);if(!s){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=n.get(s);if(a||(eu.toJS(s,null,r),a=n.get(s)),a?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(o>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Xt(i,s,n)),a.count*a.aliasCount>o)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,r,n){let i=`*${this.source}`;if(e){if(Xl.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(e.implicitKey)return`${i} `}return i}};function Xt(t,e,r){if(We.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(We.isCollection(e)){let n=0;for(let i of e.items){let o=Xt(t,i,r);o>n&&(n=o)}return n}else if(We.isPair(e)){let n=Xt(t,e.key,r),i=Xt(t,e.value,r);return Math.max(n,i)}return 1}Vo.Alias=Pn});var A=g(_n=>{"use strict";var tu=P(),ru=zt(),nu=ae(),iu=t=>!t||typeof t!="function"&&typeof t!="object",ce=class extends ru.NodeBase{constructor(e){super(tu.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:nu.toJS(this.value,e,r)}toString(){return String(this.value)}};ce.BLOCK_FOLDED="BLOCK_FOLDED";ce.BLOCK_LITERAL="BLOCK_LITERAL";ce.PLAIN="PLAIN";ce.QUOTE_DOUBLE="QUOTE_DOUBLE";ce.QUOTE_SINGLE="QUOTE_SINGLE";_n.Scalar=ce;_n.isScalarValue=iu});var lt=g(Xo=>{"use strict";var ou=ct(),Ee=P(),zo=A(),su="tag:yaml.org,2002:";function au(t,e,r){if(e){let n=r.filter(o=>o.tag===e),i=n.find(o=>!o.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return r.find(n=>n.identify?.(t)&&!n.format)}function cu(t,e,r){if(Ee.isDocument(t)&&(t=t.contents),Ee.isNode(t))return t;if(Ee.isPair(t)){let f=r.schema[Ee.MAP].createNode?.(r.schema,null,r);return f.items.push(t),f}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=r,c;if(n&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor??(c.anchor=i(t)),new ou.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=su+e.slice(2));let l=au(t,e,s.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let f=new zo.Scalar(t);return c&&(c.node=f),f}l=t instanceof Map?s[Ee.MAP]:Symbol.iterator in Object(t)?s[Ee.SEQ]:s[Ee.MAP]}o&&(o(l),delete r.onTagObj);let u=l?.createNode?l.createNode(r.schema,t,r):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(r.schema,t,r):new zo.Scalar(t);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}Xo.createNode=cu});var Zt=g(Qt=>{"use strict";var lu=lt(),Q=P(),uu=zt();function xn(t,e,r){let n=r;for(let i=e.length-1;i>=0;--i){let o=e[i];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=n,n=s}else n=new Map([[o,n]])}return lu.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var Qo=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,An=class extends uu.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>Q.isNode(n)||Q.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(Qo(e))this.add(r);else{let[n,...i]=e,o=this.get(n,!0);if(Q.isCollection(o))o.addIn(i,r);else if(o===void 0&&this.schema)this.set(n,xn(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(Q.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...i]=e,o=this.get(n,!0);return i.length===0?!r&&Q.isScalar(o)?o.value:o:Q.isCollection(o)?o.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!Q.isPair(r))return!1;let n=r.value;return n==null||e&&Q.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let i=this.get(r,!0);return Q.isCollection(i)?i.hasIn(n):!1}setIn(e,r){let[n,...i]=e;if(i.length===0)this.set(n,r);else{let o=this.get(n,!0);if(Q.isCollection(o))o.setIn(i,r);else if(o===void 0&&this.schema)this.set(n,xn(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};Qt.Collection=An;Qt.collectionFromPath=xn;Qt.isEmptyPath=Qo});var ut=g(er=>{"use strict";var fu=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function Nn(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var du=(t,e,r)=>t.endsWith(`
6
- `)?Nn(r,e):r.includes(`
4
+ var Nl=Object.create;var hn=Object.defineProperty;var Ol=Object.getOwnPropertyDescriptor;var Rl=Object.getOwnPropertyNames;var Tl=Object.getPrototypeOf,Il=Object.prototype.hasOwnProperty;var Gt=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var T=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var g=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},jl=(t,e)=>{for(var r in e)hn(t,r,{get:e[r],enumerable:!0})},ql=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Rl(e))!Il.call(t,i)&&i!==r&&hn(t,i,{get:()=>e[i],enumerable:!(n=Ol(e,i))||n.enumerable});return t};var nt=(t,e,r)=>(r=t!=null?Nl(Tl(t)):{},ql(e||!t||!t.__esModule?hn(r,"default",{value:t,enumerable:!0}):r,t));function Oo(t,e){let r=t;for(let n of e)r+="\0"+(typeof n=="string"?n:JSON.stringify(n));return r}function Ee(t,e){return(...r)=>{let n=No;if(n===null)return e(...r);let i=Oo(`async:${t}`,r),o=n.entries.get(i);if(o)return o.value;let s=e(...r).catch(a=>{throw n.entries.delete(i),a});return n.entries.set(i,{value:s}),s}}function mn(t,e){return(...r)=>{let n=No;if(n===null)return e(...r);let i=Oo(`sync:${t}`,r),o=n.entries.get(i);if(o)return o.value;let s=e(...r);return n.entries.set(i,{value:s}),s}}var No,it=T(()=>{"use strict";No=null});var _=g(j=>{"use strict";var wn=Symbol.for("yaml.alias"),Ro=Symbol.for("yaml.document"),Ht=Symbol.for("yaml.map"),To=Symbol.for("yaml.pair"),yn=Symbol.for("yaml.scalar"),Yt=Symbol.for("yaml.seq"),te=Symbol.for("yaml.node.type"),Dl=t=>!!t&&typeof t=="object"&&t[te]===wn,$l=t=>!!t&&typeof t=="object"&&t[te]===Ro,Ml=t=>!!t&&typeof t=="object"&&t[te]===Ht,Bl=t=>!!t&&typeof t=="object"&&t[te]===To,Io=t=>!!t&&typeof t=="object"&&t[te]===yn,Fl=t=>!!t&&typeof t=="object"&&t[te]===Yt;function jo(t){if(t&&typeof t=="object")switch(t[te]){case Ht:case Yt:return!0}return!1}function Kl(t){if(t&&typeof t=="object")switch(t[te]){case wn:case Ht:case yn:case Yt:return!0}return!1}var Ul=t=>(Io(t)||jo(t))&&!!t.anchor;j.ALIAS=wn;j.DOC=Ro;j.MAP=Ht;j.NODE_TYPE=te;j.PAIR=To;j.SCALAR=yn;j.SEQ=Yt;j.hasAnchor=Ul;j.isAlias=Dl;j.isCollection=jo;j.isDocument=$l;j.isMap=Ml;j.isNode=Kl;j.isPair=Bl;j.isScalar=Io;j.isSeq=Fl});var ot=g(bn=>{"use strict";var I=_(),$=Symbol("break visit"),qo=Symbol("skip children"),X=Symbol("remove node");function Jt(t,e){let r=Lo(e);I.isDocument(t)?Le(null,t.contents,r,Object.freeze([t]))===X&&(t.contents=null):Le(null,t,r,Object.freeze([]))}Jt.BREAK=$;Jt.SKIP=qo;Jt.REMOVE=X;function Le(t,e,r,n){let i=Wo(t,e,r,n);if(I.isNode(i)||I.isPair(i))return Do(t,n,i),Le(t,i,r,n);if(typeof i!="symbol"){if(I.isCollection(e)){n=Object.freeze(n.concat(e));for(let o=0;o<e.items.length;++o){let s=Le(o,e.items[o],r,n);if(typeof s=="number")o=s-1;else{if(s===$)return $;s===X&&(e.items.splice(o,1),o-=1)}}}else if(I.isPair(e)){n=Object.freeze(n.concat(e));let o=Le("key",e.key,r,n);if(o===$)return $;o===X&&(e.key=null);let s=Le("value",e.value,r,n);if(s===$)return $;s===X&&(e.value=null)}}return i}async function Vt(t,e){let r=Lo(e);I.isDocument(t)?await We(null,t.contents,r,Object.freeze([t]))===X&&(t.contents=null):await We(null,t,r,Object.freeze([]))}Vt.BREAK=$;Vt.SKIP=qo;Vt.REMOVE=X;async function We(t,e,r,n){let i=await Wo(t,e,r,n);if(I.isNode(i)||I.isPair(i))return Do(t,n,i),We(t,i,r,n);if(typeof i!="symbol"){if(I.isCollection(e)){n=Object.freeze(n.concat(e));for(let o=0;o<e.items.length;++o){let s=await We(o,e.items[o],r,n);if(typeof s=="number")o=s-1;else{if(s===$)return $;s===X&&(e.items.splice(o,1),o-=1)}}}else if(I.isPair(e)){n=Object.freeze(n.concat(e));let o=await We("key",e.key,r,n);if(o===$)return $;o===X&&(e.key=null);let s=await We("value",e.value,r,n);if(s===$)return $;s===X&&(e.value=null)}}return i}function Lo(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function Wo(t,e,r,n){if(typeof r=="function")return r(t,e,n);if(I.isMap(e))return r.Map?.(t,e,n);if(I.isSeq(e))return r.Seq?.(t,e,n);if(I.isPair(e))return r.Pair?.(t,e,n);if(I.isScalar(e))return r.Scalar?.(t,e,n);if(I.isAlias(e))return r.Alias?.(t,e,n)}function Do(t,e,r){let n=e[e.length-1];if(I.isCollection(n))n.items[t]=r;else if(I.isPair(n))t==="key"?n.key=r:n.value=r;else if(I.isDocument(n))n.contents=r;else{let i=I.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}bn.visit=Jt;bn.visitAsync=Vt});var vn=g(Mo=>{"use strict";var $o=_(),Gl=ot(),Hl={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Yl=t=>t.replace(/[!,[\]{}]/g,e=>Hl[e]),st=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[o,s]=n;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[o]=n;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return r(6,`Unsupported YAML version ${o}`,s),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let s=e.slice(2,-1);return s==="!"||s==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),s)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let o=this.tags[n];if(o)try{return o+decodeURIComponent(i)}catch(s){return r(String(s)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+Yl(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&$o.isNode(e.contents)){let o={};Gl.visit(e.contents,(s,a)=>{$o.isNode(a)&&a.tag&&(o[a.tag]=!0)}),i=Object.keys(o)}else i=[];for(let[o,s]of n)o==="!!"&&s==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(s)))&&r.push(`%TAG ${o} ${s}`);return r.join(`
5
+ `)}};st.defaultYaml={explicit:!1,version:"1.2"};st.defaultTags={"!!":"tag:yaml.org,2002:"};Mo.Directives=st});var zt=g(at=>{"use strict";var Bo=_(),Jl=ot();function Vl(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function Fo(t){let e=new Set;return Jl.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function Ko(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function zl(t,e){let r=[],n=new Map,i=null;return{onAnchor:o=>{r.push(o),i??(i=Fo(t));let s=Ko(e,i);return i.add(s),s},setAnchors:()=>{for(let o of r){let s=n.get(o);if(typeof s=="object"&&s.anchor&&(Bo.isScalar(s.node)||Bo.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:n}}at.anchorIsValid=Vl;at.anchorNames=Fo;at.createNodeAnchors=zl;at.findNewAnchor=Ko});var kn=g(Uo=>{"use strict";function ct(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,o=n.length;i<o;++i){let s=n[i],a=ct(t,n,String(i),s);a===void 0?delete n[i]:a!==s&&(n[i]=a)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let o=n.get(i),s=ct(t,n,i,o);s===void 0?n.delete(i):s!==o&&n.set(i,s)}else if(n instanceof Set)for(let i of Array.from(n)){let o=ct(t,n,i,i);o===void 0?n.delete(i):o!==i&&(n.delete(i),n.add(o))}else for(let[i,o]of Object.entries(n)){let s=ct(t,n,i,o);s===void 0?delete n[i]:s!==o&&(n[i]=s)}return t.call(e,r,n)}Uo.applyReviver=ct});var se=g(Ho=>{"use strict";var Xl=_();function Go(t,e,r){if(Array.isArray(t))return t.map((n,i)=>Go(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!Xl.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=o=>{n.res=o,delete r.onCreate};let i=t.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof t=="bigint"&&!r?.keep?Number(t):t}Ho.toJS=Go});var Xt=g(Jo=>{"use strict";var Ql=kn(),Yo=_(),Zl=se(),Sn=class{constructor(e){Object.defineProperty(this,Yo.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:o}={}){if(!Yo.isDocument(e))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=Zl.toJS(this,"",s);if(typeof i=="function")for(let{count:c,res:l}of s.anchors.values())i(l,c);return typeof o=="function"?Ql.applyReviver(o,{"":a},"",a):a}};Jo.NodeBase=Sn});var lt=g(Vo=>{"use strict";var eu=zt(),tu=ot(),De=_(),ru=Xt(),nu=se(),Cn=class extends ru.NodeBase{constructor(e){super(De.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],tu.visit(e,{Node:(o,s)=>{(De.isAlias(s)||De.hasAnchor(s))&&n.push(s)}}),r&&(r.aliasResolveCache=n));let i;for(let o of n){if(o===this)break;o.anchor===this.source&&(i=o)}return i}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:o}=r,s=this.resolve(i,r);if(!s){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=n.get(s);if(a||(nu.toJS(s,null,r),a=n.get(s)),a?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(o>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Qt(i,s,n)),a.count*a.aliasCount>o)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,r,n){let i=`*${this.source}`;if(e){if(eu.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(e.implicitKey)return`${i} `}return i}};function Qt(t,e,r){if(De.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(De.isCollection(e)){let n=0;for(let i of e.items){let o=Qt(t,i,r);o>n&&(n=o)}return n}else if(De.isPair(e)){let n=Qt(t,e.key,r),i=Qt(t,e.value,r);return Math.max(n,i)}return 1}Vo.Alias=Cn});var A=g(En=>{"use strict";var iu=_(),ou=Xt(),su=se(),au=t=>!t||typeof t!="function"&&typeof t!="object",ae=class extends ou.NodeBase{constructor(e){super(iu.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:su.toJS(this.value,e,r)}toString(){return String(this.value)}};ae.BLOCK_FOLDED="BLOCK_FOLDED";ae.BLOCK_LITERAL="BLOCK_LITERAL";ae.PLAIN="PLAIN";ae.QUOTE_DOUBLE="QUOTE_DOUBLE";ae.QUOTE_SINGLE="QUOTE_SINGLE";En.Scalar=ae;En.isScalarValue=au});var ut=g(Xo=>{"use strict";var cu=lt(),_e=_(),zo=A(),lu="tag:yaml.org,2002:";function uu(t,e,r){if(e){let n=r.filter(o=>o.tag===e),i=n.find(o=>!o.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return r.find(n=>n.identify?.(t)&&!n.format)}function fu(t,e,r){if(_e.isDocument(t)&&(t=t.contents),_e.isNode(t))return t;if(_e.isPair(t)){let f=r.schema[_e.MAP].createNode?.(r.schema,null,r);return f.items.push(t),f}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=r,c;if(n&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor??(c.anchor=i(t)),new cu.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=lu+e.slice(2));let l=uu(t,e,s.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let f=new zo.Scalar(t);return c&&(c.node=f),f}l=t instanceof Map?s[_e.MAP]:Symbol.iterator in Object(t)?s[_e.SEQ]:s[_e.MAP]}o&&(o(l),delete r.onTagObj);let u=l?.createNode?l.createNode(r.schema,t,r):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(r.schema,t,r):new zo.Scalar(t);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}Xo.createNode=fu});var er=g(Zt=>{"use strict";var du=ut(),Q=_(),pu=Xt();function _n(t,e,r){let n=r;for(let i=e.length-1;i>=0;--i){let o=e[i];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=n,n=s}else n=new Map([[o,n]])}return du.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var Qo=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,Pn=class extends pu.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>Q.isNode(n)||Q.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(Qo(e))this.add(r);else{let[n,...i]=e,o=this.get(n,!0);if(Q.isCollection(o))o.addIn(i,r);else if(o===void 0&&this.schema)this.set(n,_n(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(Q.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...i]=e,o=this.get(n,!0);return i.length===0?!r&&Q.isScalar(o)?o.value:o:Q.isCollection(o)?o.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!Q.isPair(r))return!1;let n=r.value;return n==null||e&&Q.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let i=this.get(r,!0);return Q.isCollection(i)?i.hasIn(n):!1}setIn(e,r){let[n,...i]=e;if(i.length===0)this.set(n,r);else{let o=this.get(n,!0);if(Q.isCollection(o))o.setIn(i,r);else if(o===void 0&&this.schema)this.set(n,_n(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};Zt.Collection=Pn;Zt.collectionFromPath=_n;Zt.isEmptyPath=Qo});var ft=g(tr=>{"use strict";var hu=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function xn(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var mu=(t,e,r)=>t.endsWith(`
6
+ `)?xn(r,e):r.includes(`
7
7
  `)?`
8
- `+Nn(r,e):(t.endsWith(" ")?"":" ")+r;er.indentComment=Nn;er.lineComment=du;er.stringifyComment=fu});var es=g(ft=>{"use strict";var pu="flow",On="block",tr="quoted";function hu(t,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!i||i<0)return t;i<o&&(o=0);let c=Math.max(1+o,1+i-e.length);if(t.length<=c)return t;let l=[],u={},f=i-e.length;typeof n=="number"&&(n>i-Math.max(2,o)?l.push(0):f=i-n);let d,m,w=!1,p=-1,h=-1,y=-1;r===On&&(p=Zo(t,p,e.length),p!==-1&&(f=p+c));for(let k;k=t[p+=1];){if(r===tr&&k==="\\"){switch(h=p,t[p+1]){case"x":p+=3;break;case"u":p+=5;break;case"U":p+=9;break;default:p+=1}y=p}if(k===`
9
- `)r===On&&(p=Zo(t,p,e.length)),f=p+e.length+c,d=void 0;else{if(k===" "&&m&&m!==" "&&m!==`
8
+ `+xn(r,e):(t.endsWith(" ")?"":" ")+r;tr.indentComment=xn;tr.lineComment=mu;tr.stringifyComment=hu});var es=g(dt=>{"use strict";var gu="flow",An="block",rr="quoted";function wu(t,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!i||i<0)return t;i<o&&(o=0);let c=Math.max(1+o,1+i-e.length);if(t.length<=c)return t;let l=[],u={},f=i-e.length;typeof n=="number"&&(n>i-Math.max(2,o)?l.push(0):f=i-n);let d,m,w=!1,p=-1,h=-1,y=-1;r===An&&(p=Zo(t,p,e.length),p!==-1&&(f=p+c));for(let k;k=t[p+=1];){if(r===rr&&k==="\\"){switch(h=p,t[p+1]){case"x":p+=3;break;case"u":p+=5;break;case"U":p+=9;break;default:p+=1}y=p}if(k===`
9
+ `)r===An&&(p=Zo(t,p,e.length)),f=p+e.length+c,d=void 0;else{if(k===" "&&m&&m!==" "&&m!==`
10
10
  `&&m!==" "){let S=t[p+1];S&&S!==" "&&S!==`
11
- `&&S!==" "&&(d=p)}if(p>=f)if(d)l.push(d),f=d+c,d=void 0;else if(r===tr){for(;m===" "||m===" ";)m=k,k=t[p+=1],w=!0;let S=p>y+1?p-2:h-1;if(u[S])return t;l.push(S),u[S]=!0,f=S+c,d=void 0}else w=!0}m=k}if(w&&a&&a(),l.length===0)return t;s&&s();let v=t.slice(0,l[0]);for(let k=0;k<l.length;++k){let S=l[k],C=l[k+1]||t.length;S===0?v=`
12
- ${e}${t.slice(0,C)}`:(r===tr&&u[S]&&(v+=`${t[S]}\\`),v+=`
11
+ `&&S!==" "&&(d=p)}if(p>=f)if(d)l.push(d),f=d+c,d=void 0;else if(r===rr){for(;m===" "||m===" ";)m=k,k=t[p+=1],w=!0;let S=p>y+1?p-2:h-1;if(u[S])return t;l.push(S),u[S]=!0,f=S+c,d=void 0}else w=!0}m=k}if(w&&a&&a(),l.length===0)return t;s&&s();let v=t.slice(0,l[0]);for(let k=0;k<l.length;++k){let S=l[k],C=l[k+1]||t.length;S===0?v=`
12
+ ${e}${t.slice(0,C)}`:(r===rr&&u[S]&&(v+=`${t[S]}\\`),v+=`
13
13
  ${e}${t.slice(S+1,C)}`)}return v}function Zo(t,e,r){let n=e,i=e+1,o=t[i];for(;o===" "||o===" ";)if(e<i+r)o=t[++e];else{do o=t[++e];while(o&&o!==`
14
- `);n=e,i=e+1,o=t[i]}return n}ft.FOLD_BLOCK=On;ft.FOLD_FLOW=pu;ft.FOLD_QUOTED=tr;ft.foldFlowLines=hu});var pt=g(ts=>{"use strict";var Y=A(),le=es(),nr=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),ir=t=>/^(%|---|\.\.\.)/m.test(t);function mu(t,e,r){if(!e||e<0)return!1;let n=e-r,i=t.length;if(i<=n)return!1;for(let o=0,s=0;o<i;++o)if(t[o]===`
15
- `){if(o-s>n)return!0;if(s=o+1,i-s<=n)return!1}return!0}function dt(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(ir(t)?" ":""),s="",a=0;for(let c=0,l=r[c];l;l=r[++c])if(l===" "&&r[c+1]==="\\"&&r[c+2]==="n"&&(s+=r.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(r[c+1]){case"u":{s+=r.slice(a,c);let u=r.substr(c+2,4);switch(u){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:u.substr(0,2)==="00"?s+="\\x"+u.substr(2):s+=r.substr(c,6)}c+=5,a=c+1}break;case"n":if(n||r[c+2]==='"'||r.length<i)c+=1;else{for(s+=r.slice(a,c)+`
14
+ `);n=e,i=e+1,o=t[i]}return n}dt.FOLD_BLOCK=An;dt.FOLD_FLOW=gu;dt.FOLD_QUOTED=rr;dt.foldFlowLines=wu});var ht=g(ts=>{"use strict";var Y=A(),ce=es(),ir=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),or=t=>/^(%|---|\.\.\.)/m.test(t);function yu(t,e,r){if(!e||e<0)return!1;let n=e-r,i=t.length;if(i<=n)return!1;for(let o=0,s=0;o<i;++o)if(t[o]===`
15
+ `){if(o-s>n)return!0;if(s=o+1,i-s<=n)return!1}return!0}function pt(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(or(t)?" ":""),s="",a=0;for(let c=0,l=r[c];l;l=r[++c])if(l===" "&&r[c+1]==="\\"&&r[c+2]==="n"&&(s+=r.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(r[c+1]){case"u":{s+=r.slice(a,c);let u=r.substr(c+2,4);switch(u){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:u.substr(0,2)==="00"?s+="\\x"+u.substr(2):s+=r.substr(c,6)}c+=5,a=c+1}break;case"n":if(n||r[c+2]==='"'||r.length<i)c+=1;else{for(s+=r.slice(a,c)+`
16
16
 
17
17
  `;r[c+2]==="\\"&&r[c+3]==="n"&&r[c+4]!=='"';)s+=`
18
- `,c+=2;s+=o,r[c+2]===" "&&(s+="\\"),c+=1,a=c+1}break;default:c+=1}return s=a?s+r.slice(a):r,n?s:le.foldFlowLines(s,o,le.FOLD_QUOTED,nr(e,!1))}function Rn(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
19
- `)||/[ \t]\n|\n[ \t]/.test(t))return dt(t,e);let r=e.indent||(ir(t)?" ":""),n="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
20
- ${r}`)+"'";return e.implicitKey?n:le.foldFlowLines(n,r,le.FOLD_FLOW,nr(e,!1))}function De(t,e){let{singleQuote:r}=e.options,n;if(r===!1)n=dt;else{let i=t.includes('"'),o=t.includes("'");i&&!o?n=Rn:o&&!i?n=dt:n=r?Rn:dt}return n(t,e)}var Tn;try{Tn=new RegExp(`(^|(?<!
18
+ `,c+=2;s+=o,r[c+2]===" "&&(s+="\\"),c+=1,a=c+1}break;default:c+=1}return s=a?s+r.slice(a):r,n?s:ce.foldFlowLines(s,o,ce.FOLD_QUOTED,ir(e,!1))}function Nn(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
19
+ `)||/[ \t]\n|\n[ \t]/.test(t))return pt(t,e);let r=e.indent||(or(t)?" ":""),n="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
20
+ ${r}`)+"'";return e.implicitKey?n:ce.foldFlowLines(n,r,ce.FOLD_FLOW,ir(e,!1))}function $e(t,e){let{singleQuote:r}=e.options,n;if(r===!1)n=pt;else{let i=t.includes('"'),o=t.includes("'");i&&!o?n=Nn:o&&!i?n=pt:n=r?Nn:pt}return n(t,e)}var On;try{On=new RegExp(`(^|(?<!
21
21
  ))
22
22
  +(?!
23
- |$)`,"g")}catch{Tn=/\n+(?!\n|$)/g}function rr({comment:t,type:e,value:r},n,i,o){let{blockQuote:s,commentString:a,lineWidth:c}=n.options;if(!s||/\n[\t ]+$/.test(r))return De(r,n);let l=n.indent||(n.forceBlockIndent||ir(r)?" ":""),u=s==="literal"?!0:s==="folded"||e===Y.Scalar.BLOCK_FOLDED?!1:e===Y.Scalar.BLOCK_LITERAL?!0:!mu(r,c,l.length);if(!r)return u?`|
23
+ |$)`,"g")}catch{On=/\n+(?!\n|$)/g}function nr({comment:t,type:e,value:r},n,i,o){let{blockQuote:s,commentString:a,lineWidth:c}=n.options;if(!s||/\n[\t ]+$/.test(r))return $e(r,n);let l=n.indent||(n.forceBlockIndent||or(r)?" ":""),u=s==="literal"?!0:s==="folded"||e===Y.Scalar.BLOCK_FOLDED?!1:e===Y.Scalar.BLOCK_LITERAL?!0:!yu(r,c,l.length);if(!r)return u?`|
24
24
  `:`>
25
25
  `;let f,d;for(d=r.length;d>0;--d){let C=r[d-1];if(C!==`
26
26
  `&&C!==" "&&C!==" ")break}let m=r.substring(d),w=m.indexOf(`
27
27
  `);w===-1?f="-":r===m||w!==m.length-1?(f="+",o&&o()):f="",m&&(r=r.slice(0,-m.length),m[m.length-1]===`
28
- `&&(m=m.slice(0,-1)),m=m.replace(Tn,`$&${l}`));let p=!1,h,y=-1;for(h=0;h<r.length;++h){let C=r[h];if(C===" ")p=!0;else if(C===`
28
+ `&&(m=m.slice(0,-1)),m=m.replace(On,`$&${l}`));let p=!1,h,y=-1;for(h=0;h<r.length;++h){let C=r[h];if(C===" ")p=!0;else if(C===`
29
29
  `)y=h;else break}let v=r.substring(0,y<h?y+1:h);v&&(r=r.substring(v.length),v=v.replace(/\n+/g,`$&${l}`));let S=(p?l?"2":"1":"")+f;if(t&&(S+=" "+a(t.replace(/ ?[\r\n]+/g," ")),i&&i()),!u){let C=r.replace(/\n+/g,`
30
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),E=!1,x=nr(n,!0);s!=="folded"&&e!==Y.Scalar.BLOCK_FOLDED&&(x.onOverflow=()=>{E=!0});let b=le.foldFlowLines(`${v}${C}${m}`,l,le.FOLD_BLOCK,x);if(!E)return`>${S}
30
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),E=!1,x=ir(n,!0);s!=="folded"&&e!==Y.Scalar.BLOCK_FOLDED&&(x.onOverflow=()=>{E=!0});let b=ce.foldFlowLines(`${v}${C}${m}`,l,ce.FOLD_BLOCK,x);if(!E)return`>${S}
31
31
  ${l}${b}`}return r=r.replace(/\n+/g,`$&${l}`),`|${S}
32
- ${l}${v}${r}${m}`}function gu(t,e,r,n){let{type:i,value:o}=t,{actualString:s,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&o.includes(`
33
- `)||u&&/[[\]{},]/.test(o))return De(o,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||u||!o.includes(`
34
- `)?De(o,e):rr(t,e,r,n);if(!a&&!u&&i!==Y.Scalar.PLAIN&&o.includes(`
35
- `))return rr(t,e,r,n);if(ir(o)){if(c==="")return e.forceBlockIndent=!0,rr(t,e,r,n);if(a&&c===l)return De(o,e)}let f=o.replace(/\n+/g,`$&
36
- ${c}`);if(s){let d=p=>p.default&&p.tag!=="tag:yaml.org,2002:str"&&p.test?.test(f),{compat:m,tags:w}=e.doc.schema;if(w.some(d)||m?.some(d))return De(o,e)}return a?f:le.foldFlowLines(f,c,le.FOLD_FLOW,nr(e,!1))}function wu(t,e,r,n){let{implicitKey:i,inFlow:o}=e,s=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==Y.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=Y.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case Y.Scalar.BLOCK_FOLDED:case Y.Scalar.BLOCK_LITERAL:return i||o?De(s.value,e):rr(s,e,r,n);case Y.Scalar.QUOTE_DOUBLE:return dt(s.value,e);case Y.Scalar.QUOTE_SINGLE:return Rn(s.value,e);case Y.Scalar.PLAIN:return gu(s,e,r,n);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:f}=e.options,d=i&&u||f;if(l=c(d),l===null)throw new Error(`Unsupported default string type ${d}`)}return l}ts.stringifyString=wu});var ht=g(In=>{"use strict";var yu=Vt(),ue=P(),bu=ut(),vu=pt();function ku(t,e){let r=Object.assign({blockQuote:!0,commentString:bu.stringifyComment,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},t.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function Su(t,e){if(e.tag){let i=t.filter(o=>o.tag===e.tag);if(i.length>0)return i.find(o=>o.format===e.format)??i[0]}let r,n;if(ue.isScalar(e)){n=e.value;let i=t.filter(o=>o.identify?.(n));if(i.length>1){let o=i.filter(s=>s.test);o.length>0&&(i=o)}r=i.find(o=>o.format===e.format)??i.find(o=>!o.format)}else n=e,r=t.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!r){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return r}function Cu(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],o=(ue.isScalar(t)||ue.isCollection(t))&&t.anchor;o&&yu.anchorIsValid(o)&&(r.add(o),i.push(`&${o}`));let s=t.tag??(e.default?null:e.tag);return s&&i.push(n.directives.tagString(s)),i.join(" ")}function Eu(t,e,r,n){if(ue.isPair(t))return t.toString(e,r,n);if(ue.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i,o=ue.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>i=c});i??(i=Su(e.doc.schema.tags,o));let s=Cu(o,i,e);s.length>0&&(e.indentAtStart=(e.indentAtStart??0)+s.length+1);let a=typeof i.stringify=="function"?i.stringify(o,e,r,n):ue.isScalar(o)?vu.stringifyString(o,e,r,n):o.toString(e,r,n);return s?ue.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s}
37
- ${e.indent}${a}`:a}In.createStringifyContext=ku;In.stringify=Eu});var os=g(is=>{"use strict";var re=P(),rs=A(),ns=ht(),mt=ut();function Pu({key:t,value:e},r,n,i){let{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:f}}=r,d=re.isNode(t)&&t.comment||null;if(f){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(re.isCollection(t)||!re.isNode(t)&&typeof t=="object"){let x="With simple keys, collection cannot be used as a key value";throw new Error(x)}}let m=!f&&(!t||d&&e==null&&!r.inFlow||re.isCollection(t)||(re.isScalar(t)?t.type===rs.Scalar.BLOCK_FOLDED||t.type===rs.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!m&&(f||!o),indent:a+c});let w=!1,p=!1,h=ns.stringify(t,r,()=>w=!0,()=>p=!0);if(!m&&!r.inFlow&&h.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(r.inFlow){if(o||e==null)return w&&n&&n(),h===""?"?":m?`? ${h}`:h}else if(o&&!f||e==null&&m)return h=`? ${h}`,d&&!w?h+=mt.lineComment(h,r.indent,l(d)):p&&i&&i(),h;w&&(d=null),m?(d&&(h+=mt.lineComment(h,r.indent,l(d))),h=`? ${h}
38
- ${a}:`):(h=`${h}:`,d&&(h+=mt.lineComment(h,r.indent,l(d))));let y,v,k;re.isNode(e)?(y=!!e.spaceBefore,v=e.commentBefore,k=e.comment):(y=!1,v=null,k=null,e&&typeof e=="object"&&(e=s.createNode(e))),r.implicitKey=!1,!m&&!d&&re.isScalar(e)&&(r.indentAtStart=h.length+1),p=!1,!u&&c.length>=2&&!r.inFlow&&!m&&re.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let S=!1,C=ns.stringify(e,r,()=>S=!0,()=>p=!0),E=" ";if(d||y||v){if(E=y?`
32
+ ${l}${v}${r}${m}`}function bu(t,e,r,n){let{type:i,value:o}=t,{actualString:s,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&o.includes(`
33
+ `)||u&&/[[\]{},]/.test(o))return $e(o,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||u||!o.includes(`
34
+ `)?$e(o,e):nr(t,e,r,n);if(!a&&!u&&i!==Y.Scalar.PLAIN&&o.includes(`
35
+ `))return nr(t,e,r,n);if(or(o)){if(c==="")return e.forceBlockIndent=!0,nr(t,e,r,n);if(a&&c===l)return $e(o,e)}let f=o.replace(/\n+/g,`$&
36
+ ${c}`);if(s){let d=p=>p.default&&p.tag!=="tag:yaml.org,2002:str"&&p.test?.test(f),{compat:m,tags:w}=e.doc.schema;if(w.some(d)||m?.some(d))return $e(o,e)}return a?f:ce.foldFlowLines(f,c,ce.FOLD_FLOW,ir(e,!1))}function vu(t,e,r,n){let{implicitKey:i,inFlow:o}=e,s=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==Y.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=Y.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case Y.Scalar.BLOCK_FOLDED:case Y.Scalar.BLOCK_LITERAL:return i||o?$e(s.value,e):nr(s,e,r,n);case Y.Scalar.QUOTE_DOUBLE:return pt(s.value,e);case Y.Scalar.QUOTE_SINGLE:return Nn(s.value,e);case Y.Scalar.PLAIN:return bu(s,e,r,n);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:f}=e.options,d=i&&u||f;if(l=c(d),l===null)throw new Error(`Unsupported default string type ${d}`)}return l}ts.stringifyString=vu});var mt=g(Rn=>{"use strict";var ku=zt(),le=_(),Su=ft(),Cu=ht();function Eu(t,e){let r=Object.assign({blockQuote:!0,commentString:Su.stringifyComment,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},t.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function _u(t,e){if(e.tag){let i=t.filter(o=>o.tag===e.tag);if(i.length>0)return i.find(o=>o.format===e.format)??i[0]}let r,n;if(le.isScalar(e)){n=e.value;let i=t.filter(o=>o.identify?.(n));if(i.length>1){let o=i.filter(s=>s.test);o.length>0&&(i=o)}r=i.find(o=>o.format===e.format)??i.find(o=>!o.format)}else n=e,r=t.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!r){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return r}function Pu(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],o=(le.isScalar(t)||le.isCollection(t))&&t.anchor;o&&ku.anchorIsValid(o)&&(r.add(o),i.push(`&${o}`));let s=t.tag??(e.default?null:e.tag);return s&&i.push(n.directives.tagString(s)),i.join(" ")}function xu(t,e,r,n){if(le.isPair(t))return t.toString(e,r,n);if(le.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i,o=le.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>i=c});i??(i=_u(e.doc.schema.tags,o));let s=Pu(o,i,e);s.length>0&&(e.indentAtStart=(e.indentAtStart??0)+s.length+1);let a=typeof i.stringify=="function"?i.stringify(o,e,r,n):le.isScalar(o)?Cu.stringifyString(o,e,r,n):o.toString(e,r,n);return s?le.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s}
37
+ ${e.indent}${a}`:a}Rn.createStringifyContext=Eu;Rn.stringify=xu});var os=g(is=>{"use strict";var re=_(),rs=A(),ns=mt(),gt=ft();function Au({key:t,value:e},r,n,i){let{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:f}}=r,d=re.isNode(t)&&t.comment||null;if(f){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(re.isCollection(t)||!re.isNode(t)&&typeof t=="object"){let x="With simple keys, collection cannot be used as a key value";throw new Error(x)}}let m=!f&&(!t||d&&e==null&&!r.inFlow||re.isCollection(t)||(re.isScalar(t)?t.type===rs.Scalar.BLOCK_FOLDED||t.type===rs.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!m&&(f||!o),indent:a+c});let w=!1,p=!1,h=ns.stringify(t,r,()=>w=!0,()=>p=!0);if(!m&&!r.inFlow&&h.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(r.inFlow){if(o||e==null)return w&&n&&n(),h===""?"?":m?`? ${h}`:h}else if(o&&!f||e==null&&m)return h=`? ${h}`,d&&!w?h+=gt.lineComment(h,r.indent,l(d)):p&&i&&i(),h;w&&(d=null),m?(d&&(h+=gt.lineComment(h,r.indent,l(d))),h=`? ${h}
38
+ ${a}:`):(h=`${h}:`,d&&(h+=gt.lineComment(h,r.indent,l(d))));let y,v,k;re.isNode(e)?(y=!!e.spaceBefore,v=e.commentBefore,k=e.comment):(y=!1,v=null,k=null,e&&typeof e=="object"&&(e=s.createNode(e))),r.implicitKey=!1,!m&&!d&&re.isScalar(e)&&(r.indentAtStart=h.length+1),p=!1,!u&&c.length>=2&&!r.inFlow&&!m&&re.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let S=!1,C=ns.stringify(e,r,()=>S=!0,()=>p=!0),E=" ";if(d||y||v){if(E=y?`
39
39
  `:"",v){let x=l(v);E+=`
40
- ${mt.indentComment(x,r.indent)}`}C===""&&!r.inFlow?E===`
40
+ ${gt.indentComment(x,r.indent)}`}C===""&&!r.inFlow?E===`
41
41
  `&&k&&(E=`
42
42
 
43
43
  `):E+=`
44
44
  ${r.indent}`}else if(!m&&re.isCollection(e)){let x=C[0],b=C.indexOf(`
45
- `),O=b!==-1,se=r.inFlow??e.flow??e.items.length===0;if(O||!se){let je=!1;if(O&&(x==="&"||x==="!")){let R=C.indexOf(" ");x==="&"&&R!==-1&&R<b&&C[R+1]==="!"&&(R=C.indexOf(" ",R+1)),(R===-1||b<R)&&(je=!0)}je||(E=`
45
+ `),O=b!==-1,oe=r.inFlow??e.flow??e.items.length===0;if(O||!oe){let qe=!1;if(O&&(x==="&"||x==="!")){let R=C.indexOf(" ");x==="&"&&R!==-1&&R<b&&C[R+1]==="!"&&(R=C.indexOf(" ",R+1)),(R===-1||b<R)&&(qe=!0)}qe||(E=`
46
46
  ${r.indent}`)}}else(C===""||C[0]===`
47
- `)&&(E="");return h+=E+C,r.inFlow?S&&n&&n():k&&!S?h+=mt.lineComment(h,r.indent,l(k)):p&&i&&i(),h}is.stringifyPair=Pu});var Ln=g(jn=>{"use strict";var ss=Ut("process");function _u(t,...e){t==="debug"&&console.log(...e)}function xu(t,e){(t==="debug"||t==="warn")&&(typeof ss.emitWarning=="function"?ss.emitWarning(e):console.warn(e))}jn.debug=_u;jn.warn=xu});var lr=g(cr=>{"use strict";var ar=P(),as=A(),or="<<",sr={identify:t=>t===or||typeof t=="symbol"&&t.description===or,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new as.Scalar(Symbol(or)),{addToJSMap:cs}),stringify:()=>or},Au=(t,e)=>(sr.identify(e)||ar.isScalar(e)&&(!e.type||e.type===as.Scalar.PLAIN)&&sr.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===sr.tag&&r.default);function cs(t,e,r){let n=ls(t,r);if(ar.isSeq(n))for(let i of n.items)qn(t,e,i);else if(Array.isArray(n))for(let i of n)qn(t,e,i);else qn(t,e,n)}function qn(t,e,r){let n=ls(t,r);if(!ar.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[o,s]of i)e instanceof Map?e.has(o)||e.set(o,s):e instanceof Set?e.add(o):Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return e}function ls(t,e){return t&&ar.isAlias(e)?e.resolve(t.doc,t):e}cr.addMergeToJSMap=cs;cr.isMergeKey=Au;cr.merge=sr});var Dn=g(ds=>{"use strict";var Nu=Ln(),us=lr(),Ou=ht(),fs=P(),Wn=ae();function Ru(t,e,{key:r,value:n}){if(fs.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(us.isMergeKey(t,r))us.addMergeToJSMap(t,e,n);else{let i=Wn.toJS(r,"",t);if(e instanceof Map)e.set(i,Wn.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let o=Tu(r,i,t),s=Wn.toJS(n,o,t);o in e?Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[o]=s}}return e}function Tu(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(fs.isNode(t)&&r?.doc){let n=Ou.createStringifyContext(r.doc,{});n.anchors=new Set;for(let o of r.anchors.keys())n.anchors.add(o.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=t.toString(n);if(!r.mapKeyWarned){let o=JSON.stringify(i);o.length>40&&(o=o.substring(0,36)+'..."'),Nu.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}ds.addPairToJSMap=Ru});var fe=g($n=>{"use strict";var ps=lt(),Iu=os(),ju=Dn(),ur=P();function Lu(t,e,r){let n=ps.createNode(t,void 0,r),i=ps.createNode(e,void 0,r);return new fr(n,i)}var fr=class t{constructor(e,r=null){Object.defineProperty(this,ur.NODE_TYPE,{value:ur.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return ur.isNode(r)&&(r=r.clone(e)),ur.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return ju.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?Iu.stringifyPair(this,e,r,n):JSON.stringify(this)}};$n.Pair=fr;$n.createPair=Lu});var Mn=g(ms=>{"use strict";var Pe=P(),hs=ht(),dr=ut();function qu(t,e,r){return(e.inFlow??t.flow?Du:Wu)(t,e,r)}function Wu({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:l}}=r,u=Object.assign({},r,{indent:o,type:null}),f=!1,d=[];for(let w=0;w<e.length;++w){let p=e[w],h=null;if(Pe.isNode(p))!f&&p.spaceBefore&&d.push(""),pr(r,d,p.commentBefore,f),p.comment&&(h=p.comment);else if(Pe.isPair(p)){let v=Pe.isNode(p.key)?p.key:null;v&&(!f&&v.spaceBefore&&d.push(""),pr(r,d,v.commentBefore,f))}f=!1;let y=hs.stringify(p,u,()=>h=null,()=>f=!0);h&&(y+=dr.lineComment(y,o,l(h))),f&&h&&(f=!1),d.push(n+y)}let m;if(d.length===0)m=i.start+i.end;else{m=d[0];for(let w=1;w<d.length;++w){let p=d[w];m+=p?`
47
+ `)&&(E="");return h+=E+C,r.inFlow?S&&n&&n():k&&!S?h+=gt.lineComment(h,r.indent,l(k)):p&&i&&i(),h}is.stringifyPair=Au});var In=g(Tn=>{"use strict";var ss=Gt("process");function Nu(t,...e){t==="debug"&&console.log(...e)}function Ou(t,e){(t==="debug"||t==="warn")&&(typeof ss.emitWarning=="function"?ss.emitWarning(e):console.warn(e))}Tn.debug=Nu;Tn.warn=Ou});var ur=g(lr=>{"use strict";var cr=_(),as=A(),sr="<<",ar={identify:t=>t===sr||typeof t=="symbol"&&t.description===sr,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new as.Scalar(Symbol(sr)),{addToJSMap:cs}),stringify:()=>sr},Ru=(t,e)=>(ar.identify(e)||cr.isScalar(e)&&(!e.type||e.type===as.Scalar.PLAIN)&&ar.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===ar.tag&&r.default);function cs(t,e,r){let n=ls(t,r);if(cr.isSeq(n))for(let i of n.items)jn(t,e,i);else if(Array.isArray(n))for(let i of n)jn(t,e,i);else jn(t,e,n)}function jn(t,e,r){let n=ls(t,r);if(!cr.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[o,s]of i)e instanceof Map?e.has(o)||e.set(o,s):e instanceof Set?e.add(o):Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return e}function ls(t,e){return t&&cr.isAlias(e)?e.resolve(t.doc,t):e}lr.addMergeToJSMap=cs;lr.isMergeKey=Ru;lr.merge=ar});var Ln=g(ds=>{"use strict";var Tu=In(),us=ur(),Iu=mt(),fs=_(),qn=se();function ju(t,e,{key:r,value:n}){if(fs.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(us.isMergeKey(t,r))us.addMergeToJSMap(t,e,n);else{let i=qn.toJS(r,"",t);if(e instanceof Map)e.set(i,qn.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let o=qu(r,i,t),s=qn.toJS(n,o,t);o in e?Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[o]=s}}return e}function qu(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(fs.isNode(t)&&r?.doc){let n=Iu.createStringifyContext(r.doc,{});n.anchors=new Set;for(let o of r.anchors.keys())n.anchors.add(o.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=t.toString(n);if(!r.mapKeyWarned){let o=JSON.stringify(i);o.length>40&&(o=o.substring(0,36)+'..."'),Tu.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}ds.addPairToJSMap=ju});var ue=g(Wn=>{"use strict";var ps=ut(),Lu=os(),Wu=Ln(),fr=_();function Du(t,e,r){let n=ps.createNode(t,void 0,r),i=ps.createNode(e,void 0,r);return new dr(n,i)}var dr=class t{constructor(e,r=null){Object.defineProperty(this,fr.NODE_TYPE,{value:fr.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return fr.isNode(r)&&(r=r.clone(e)),fr.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return Wu.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?Lu.stringifyPair(this,e,r,n):JSON.stringify(this)}};Wn.Pair=dr;Wn.createPair=Du});var Dn=g(ms=>{"use strict";var Pe=_(),hs=mt(),pr=ft();function $u(t,e,r){return(e.inFlow??t.flow?Bu:Mu)(t,e,r)}function Mu({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:l}}=r,u=Object.assign({},r,{indent:o,type:null}),f=!1,d=[];for(let w=0;w<e.length;++w){let p=e[w],h=null;if(Pe.isNode(p))!f&&p.spaceBefore&&d.push(""),hr(r,d,p.commentBefore,f),p.comment&&(h=p.comment);else if(Pe.isPair(p)){let v=Pe.isNode(p.key)?p.key:null;v&&(!f&&v.spaceBefore&&d.push(""),hr(r,d,v.commentBefore,f))}f=!1;let y=hs.stringify(p,u,()=>h=null,()=>f=!0);h&&(y+=pr.lineComment(y,o,l(h))),f&&h&&(f=!1),d.push(n+y)}let m;if(d.length===0)m=i.start+i.end;else{m=d[0];for(let w=1;w<d.length;++w){let p=d[w];m+=p?`
48
48
  ${c}${p}`:`
49
49
  `}}return t?(m+=`
50
- `+dr.indentComment(l(t),c),a&&a()):f&&s&&s(),m}function Du({items:t},e,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:o,flowCollectionPadding:s,options:{commentString:a}}=e;n+=o;let c=Object.assign({},e,{indent:n,inFlow:!0,type:null}),l=!1,u=0,f=[];for(let w=0;w<t.length;++w){let p=t[w],h=null;if(Pe.isNode(p))p.spaceBefore&&f.push(""),pr(e,f,p.commentBefore,!1),p.comment&&(h=p.comment);else if(Pe.isPair(p)){let v=Pe.isNode(p.key)?p.key:null;v&&(v.spaceBefore&&f.push(""),pr(e,f,v.commentBefore,!1),v.comment&&(l=!0));let k=Pe.isNode(p.value)?p.value:null;k?(k.comment&&(h=k.comment),k.commentBefore&&(l=!0)):p.value==null&&v?.comment&&(h=v.comment)}h&&(l=!0);let y=hs.stringify(p,c,()=>h=null);l||(l=f.length>u||y.includes(`
51
- `)),w<t.length-1?y+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(l||(l=f.reduce((v,k)=>v+k.length+2,2)+(y.length+2)>e.options.lineWidth)),l&&(y+=",")),h&&(y+=dr.lineComment(y,n,a(h))),f.push(y),u=f.length}let{start:d,end:m}=r;if(f.length===0)return d+m;if(!l){let w=f.reduce((p,h)=>p+h.length+2,2);l=e.options.lineWidth>0&&w>e.options.lineWidth}if(l){let w=d;for(let p of f)w+=p?`
50
+ `+pr.indentComment(l(t),c),a&&a()):f&&s&&s(),m}function Bu({items:t},e,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:o,flowCollectionPadding:s,options:{commentString:a}}=e;n+=o;let c=Object.assign({},e,{indent:n,inFlow:!0,type:null}),l=!1,u=0,f=[];for(let w=0;w<t.length;++w){let p=t[w],h=null;if(Pe.isNode(p))p.spaceBefore&&f.push(""),hr(e,f,p.commentBefore,!1),p.comment&&(h=p.comment);else if(Pe.isPair(p)){let v=Pe.isNode(p.key)?p.key:null;v&&(v.spaceBefore&&f.push(""),hr(e,f,v.commentBefore,!1),v.comment&&(l=!0));let k=Pe.isNode(p.value)?p.value:null;k?(k.comment&&(h=k.comment),k.commentBefore&&(l=!0)):p.value==null&&v?.comment&&(h=v.comment)}h&&(l=!0);let y=hs.stringify(p,c,()=>h=null);l||(l=f.length>u||y.includes(`
51
+ `)),w<t.length-1?y+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(l||(l=f.reduce((v,k)=>v+k.length+2,2)+(y.length+2)>e.options.lineWidth)),l&&(y+=",")),h&&(y+=pr.lineComment(y,n,a(h))),f.push(y),u=f.length}let{start:d,end:m}=r;if(f.length===0)return d+m;if(!l){let w=f.reduce((p,h)=>p+h.length+2,2);l=e.options.lineWidth>0&&w>e.options.lineWidth}if(l){let w=d;for(let p of f)w+=p?`
52
52
  ${o}${i}${p}`:`
53
53
  `;return`${w}
54
- ${i}${m}`}else return`${d}${s}${f.join(" ")}${s}${m}`}function pr({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let o=dr.indentComment(e(n),t);r.push(o.trimStart())}}ms.stringifyCollection=qu});var pe=g(Fn=>{"use strict";var $u=Mn(),Mu=Dn(),Bu=Zt(),de=P(),hr=fe(),Fu=A();function gt(t,e){let r=de.isScalar(e)?e.value:e;for(let n of t)if(de.isPair(n)&&(n.key===e||n.key===r||de.isScalar(n.key)&&n.key.value===r))return n}var Bn=class extends Bu.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(de.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:o}=n,s=new this(e),a=(c,l)=>{if(typeof o=="function")l=o.call(r,c,l);else if(Array.isArray(o)&&!o.includes(c))return;(l!==void 0||i)&&s.items.push(hr.createPair(c,l,n))};if(r instanceof Map)for(let[c,l]of r)a(c,l);else if(r&&typeof r=="object")for(let c of Object.keys(r))a(c,r[c]);return typeof e.sortMapEntries=="function"&&s.items.sort(e.sortMapEntries),s}add(e,r){let n;de.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new hr.Pair(e,e?.value):n=new hr.Pair(e.key,e.value);let i=gt(this.items,n.key),o=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);de.isScalar(i.value)&&Fu.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(o){let s=this.items.findIndex(a=>o(n,a)<0);s===-1?this.items.push(n):this.items.splice(s,0,n)}else this.items.push(n)}delete(e){let r=gt(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=gt(this.items,e)?.value;return(!r&&de.isScalar(i)?i.value:i)??void 0}has(e){return!!gt(this.items,e)}set(e,r){this.add(new hr.Pair(e,r),!0)}toJSON(e,r,n){let i=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(i);for(let o of this.items)Mu.addPairToJSMap(r,i,o);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!de.isPair(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})),$u.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};Fn.YAMLMap=Bn;Fn.findPair=gt});var $e=g(ws=>{"use strict";var Ku=P(),gs=pe(),Uu={collection:"map",default:!0,nodeClass:gs.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return Ku.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>gs.YAMLMap.from(t,e,r)};ws.map=Uu});var he=g(ys=>{"use strict";var Gu=lt(),Hu=Mn(),Yu=Zt(),gr=P(),Ju=A(),Vu=ae(),Kn=class extends Yu.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(gr.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=mr(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=mr(e);if(typeof n!="number")return;let i=this.items[n];return!r&&gr.isScalar(i)?i.value:i}has(e){let r=mr(e);return typeof r=="number"&&r<this.items.length}set(e,r){let n=mr(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];gr.isScalar(i)&&Ju.isScalarValue(r)?i.value=r:this.items[n]=r}toJSON(e,r){let n=[];r?.onCreate&&r.onCreate(n);let i=0;for(let o of this.items)n.push(Vu.toJS(o,String(i++),r));return n}toString(e,r,n){return e?Hu.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:r}):JSON.stringify(this)}static from(e,r,n){let{replacer:i}=n,o=new this(e);if(r&&Symbol.iterator in Object(r)){let s=0;for(let a of r){if(typeof i=="function"){let c=r instanceof Set?a:String(s++);a=i.call(r,c,a)}o.items.push(Gu.createNode(a,void 0,n))}}return o}};function mr(t){let e=gr.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}ys.YAMLSeq=Kn});var Me=g(vs=>{"use strict";var zu=P(),bs=he(),Xu={collection:"seq",default:!0,nodeClass:bs.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return zu.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>bs.YAMLSeq.from(t,e,r)};vs.seq=Xu});var wt=g(ks=>{"use strict";var Qu=pt(),Zu={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),Qu.stringifyString(t,e,r,n)}};ks.string=Zu});var wr=g(Es=>{"use strict";var Ss=A(),Cs={identify:t=>t==null,createNode:()=>new Ss.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ss.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&Cs.test.test(t)?t:e.options.nullStr};Es.nullTag=Cs});var Un=g(_s=>{"use strict";var ef=A(),Ps={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new ef.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&Ps.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};_s.boolTag=Ps});var Be=g(xs=>{"use strict";function tf({format:t,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=Object.is(n,-0)?"-0":JSON.stringify(n);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");s<0&&(s=o.length,o+=".");let a=e-(o.length-s-1);for(;a-- >0;)o+="0"}return o}xs.stringifyNumber=tf});var Hn=g(yr=>{"use strict";var rf=A(),Gn=Be(),nf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Gn.stringifyNumber},of={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Gn.stringifyNumber(t)}},sf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new rf.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:Gn.stringifyNumber};yr.float=sf;yr.floatExp=of;yr.floatNaN=nf});var Jn=g(vr=>{"use strict";var As=Be(),br=t=>typeof t=="bigint"||Number.isInteger(t),Yn=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function Ns(t,e,r){let{value:n}=t;return br(n)&&n>=0?r+n.toString(e):As.stringifyNumber(t)}var af={identify:t=>br(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>Yn(t,2,8,r),stringify:t=>Ns(t,8,"0o")},cf={identify:br,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>Yn(t,0,10,r),stringify:As.stringifyNumber},lf={identify:t=>br(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>Yn(t,2,16,r),stringify:t=>Ns(t,16,"0x")};vr.int=cf;vr.intHex=lf;vr.intOct=af});var Rs=g(Os=>{"use strict";var uf=$e(),ff=wr(),df=Me(),pf=wt(),hf=Un(),Vn=Hn(),zn=Jn(),mf=[uf.map,df.seq,pf.string,ff.nullTag,hf.boolTag,zn.intOct,zn.int,zn.intHex,Vn.floatNaN,Vn.floatExp,Vn.float];Os.schema=mf});var js=g(Is=>{"use strict";var gf=A(),wf=$e(),yf=Me();function Ts(t){return typeof t=="bigint"||Number.isInteger(t)}var kr=({value:t})=>JSON.stringify(t),bf=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:kr},{identify:t=>t==null,createNode:()=>new gf.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:kr},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:kr},{identify:Ts,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>Ts(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:kr}],vf={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},kf=[wf.map,yf.seq].concat(bf,vf);Is.schema=kf});var Qn=g(Ls=>{"use strict";var yt=Ut("buffer"),Xn=A(),Sf=pt(),Cf={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof yt.Buffer=="function")return yt.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i<r.length;++i)n[i]=r.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:r},n,i,o){if(!r)return"";let s=r,a;if(typeof yt.Buffer=="function")a=s instanceof yt.Buffer?s.toString("base64"):yt.Buffer.from(s.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let l=0;l<s.length;++l)c+=String.fromCharCode(s[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=Xn.Scalar.BLOCK_LITERAL),e!==Xn.Scalar.QUOTE_DOUBLE){let c=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),l=Math.ceil(a.length/c),u=new Array(l);for(let f=0,d=0;f<l;++f,d+=c)u[f]=a.substr(d,c);a=u.join(e===Xn.Scalar.BLOCK_LITERAL?`
55
- `:" ")}return Sf.stringifyString({comment:t,type:e,value:a},n,i,o)}};Ls.binary=Cf});var Er=g(Cr=>{"use strict";var Sr=P(),Zn=fe(),Ef=A(),Pf=he();function qs(t,e){if(Sr.isSeq(t))for(let r=0;r<t.items.length;++r){let n=t.items[r];if(!Sr.isPair(n)){if(Sr.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new Zn.Pair(new Ef.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
54
+ ${i}${m}`}else return`${d}${s}${f.join(" ")}${s}${m}`}function hr({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let o=pr.indentComment(e(n),t);r.push(o.trimStart())}}ms.stringifyCollection=$u});var de=g(Mn=>{"use strict";var Fu=Dn(),Ku=Ln(),Uu=er(),fe=_(),mr=ue(),Gu=A();function wt(t,e){let r=fe.isScalar(e)?e.value:e;for(let n of t)if(fe.isPair(n)&&(n.key===e||n.key===r||fe.isScalar(n.key)&&n.key.value===r))return n}var $n=class extends Uu.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(fe.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:o}=n,s=new this(e),a=(c,l)=>{if(typeof o=="function")l=o.call(r,c,l);else if(Array.isArray(o)&&!o.includes(c))return;(l!==void 0||i)&&s.items.push(mr.createPair(c,l,n))};if(r instanceof Map)for(let[c,l]of r)a(c,l);else if(r&&typeof r=="object")for(let c of Object.keys(r))a(c,r[c]);return typeof e.sortMapEntries=="function"&&s.items.sort(e.sortMapEntries),s}add(e,r){let n;fe.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new mr.Pair(e,e?.value):n=new mr.Pair(e.key,e.value);let i=wt(this.items,n.key),o=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);fe.isScalar(i.value)&&Gu.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(o){let s=this.items.findIndex(a=>o(n,a)<0);s===-1?this.items.push(n):this.items.splice(s,0,n)}else this.items.push(n)}delete(e){let r=wt(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=wt(this.items,e)?.value;return(!r&&fe.isScalar(i)?i.value:i)??void 0}has(e){return!!wt(this.items,e)}set(e,r){this.add(new mr.Pair(e,r),!0)}toJSON(e,r,n){let i=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(i);for(let o of this.items)Ku.addPairToJSMap(r,i,o);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!fe.isPair(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})),Fu.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};Mn.YAMLMap=$n;Mn.findPair=wt});var Me=g(ws=>{"use strict";var Hu=_(),gs=de(),Yu={collection:"map",default:!0,nodeClass:gs.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return Hu.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>gs.YAMLMap.from(t,e,r)};ws.map=Yu});var pe=g(ys=>{"use strict";var Ju=ut(),Vu=Dn(),zu=er(),wr=_(),Xu=A(),Qu=se(),Bn=class extends zu.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(wr.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=gr(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=gr(e);if(typeof n!="number")return;let i=this.items[n];return!r&&wr.isScalar(i)?i.value:i}has(e){let r=gr(e);return typeof r=="number"&&r<this.items.length}set(e,r){let n=gr(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];wr.isScalar(i)&&Xu.isScalarValue(r)?i.value=r:this.items[n]=r}toJSON(e,r){let n=[];r?.onCreate&&r.onCreate(n);let i=0;for(let o of this.items)n.push(Qu.toJS(o,String(i++),r));return n}toString(e,r,n){return e?Vu.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:r}):JSON.stringify(this)}static from(e,r,n){let{replacer:i}=n,o=new this(e);if(r&&Symbol.iterator in Object(r)){let s=0;for(let a of r){if(typeof i=="function"){let c=r instanceof Set?a:String(s++);a=i.call(r,c,a)}o.items.push(Ju.createNode(a,void 0,n))}}return o}};function gr(t){let e=wr.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}ys.YAMLSeq=Bn});var Be=g(vs=>{"use strict";var Zu=_(),bs=pe(),ef={collection:"seq",default:!0,nodeClass:bs.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return Zu.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>bs.YAMLSeq.from(t,e,r)};vs.seq=ef});var yt=g(ks=>{"use strict";var tf=ht(),rf={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),tf.stringifyString(t,e,r,n)}};ks.string=rf});var yr=g(Es=>{"use strict";var Ss=A(),Cs={identify:t=>t==null,createNode:()=>new Ss.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ss.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&Cs.test.test(t)?t:e.options.nullStr};Es.nullTag=Cs});var Fn=g(Ps=>{"use strict";var nf=A(),_s={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new nf.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&_s.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};Ps.boolTag=_s});var Fe=g(xs=>{"use strict";function of({format:t,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=Object.is(n,-0)?"-0":JSON.stringify(n);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");s<0&&(s=o.length,o+=".");let a=e-(o.length-s-1);for(;a-- >0;)o+="0"}return o}xs.stringifyNumber=of});var Un=g(br=>{"use strict";var sf=A(),Kn=Fe(),af={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Kn.stringifyNumber},cf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Kn.stringifyNumber(t)}},lf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new sf.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:Kn.stringifyNumber};br.float=lf;br.floatExp=cf;br.floatNaN=af});var Hn=g(kr=>{"use strict";var As=Fe(),vr=t=>typeof t=="bigint"||Number.isInteger(t),Gn=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function Ns(t,e,r){let{value:n}=t;return vr(n)&&n>=0?r+n.toString(e):As.stringifyNumber(t)}var uf={identify:t=>vr(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>Gn(t,2,8,r),stringify:t=>Ns(t,8,"0o")},ff={identify:vr,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>Gn(t,0,10,r),stringify:As.stringifyNumber},df={identify:t=>vr(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>Gn(t,2,16,r),stringify:t=>Ns(t,16,"0x")};kr.int=ff;kr.intHex=df;kr.intOct=uf});var Rs=g(Os=>{"use strict";var pf=Me(),hf=yr(),mf=Be(),gf=yt(),wf=Fn(),Yn=Un(),Jn=Hn(),yf=[pf.map,mf.seq,gf.string,hf.nullTag,wf.boolTag,Jn.intOct,Jn.int,Jn.intHex,Yn.floatNaN,Yn.floatExp,Yn.float];Os.schema=yf});var js=g(Is=>{"use strict";var bf=A(),vf=Me(),kf=Be();function Ts(t){return typeof t=="bigint"||Number.isInteger(t)}var Sr=({value:t})=>JSON.stringify(t),Sf=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Sr},{identify:t=>t==null,createNode:()=>new bf.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Sr},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Sr},{identify:Ts,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>Ts(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Sr}],Cf={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Ef=[vf.map,kf.seq].concat(Sf,Cf);Is.schema=Ef});var zn=g(qs=>{"use strict";var bt=Gt("buffer"),Vn=A(),_f=ht(),Pf={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof bt.Buffer=="function")return bt.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i<r.length;++i)n[i]=r.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:r},n,i,o){if(!r)return"";let s=r,a;if(typeof bt.Buffer=="function")a=s instanceof bt.Buffer?s.toString("base64"):bt.Buffer.from(s.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let l=0;l<s.length;++l)c+=String.fromCharCode(s[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=Vn.Scalar.BLOCK_LITERAL),e!==Vn.Scalar.QUOTE_DOUBLE){let c=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),l=Math.ceil(a.length/c),u=new Array(l);for(let f=0,d=0;f<l;++f,d+=c)u[f]=a.substr(d,c);a=u.join(e===Vn.Scalar.BLOCK_LITERAL?`
55
+ `:" ")}return _f.stringifyString({comment:t,type:e,value:a},n,i,o)}};qs.binary=Pf});var _r=g(Er=>{"use strict";var Cr=_(),Xn=ue(),xf=A(),Af=pe();function Ls(t,e){if(Cr.isSeq(t))for(let r=0;r<t.items.length;++r){let n=t.items[r];if(!Cr.isPair(n)){if(Cr.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new Xn.Pair(new xf.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
56
56
  ${i.key.commentBefore}`:n.commentBefore),n.comment){let o=i.value??i.key;o.comment=o.comment?`${n.comment}
57
- ${o.comment}`:n.comment}n=i}t.items[r]=Sr.isPair(n)?n:new Zn.Pair(n)}}else e("Expected a sequence for this tag");return t}function Ws(t,e,r){let{replacer:n}=r,i=new Pf.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let s of e){typeof n=="function"&&(s=n.call(e,String(o++),s));let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let l=Object.keys(s);if(l.length===1)a=l[0],c=s[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=s;i.items.push(Zn.createPair(a,c,r))}return i}var _f={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:qs,createNode:Ws};Cr.createPairs=Ws;Cr.pairs=_f;Cr.resolvePairs=qs});var ri=g(ti=>{"use strict";var Ds=P(),ei=ae(),bt=pe(),xf=he(),$s=Er(),_e=class t extends xf.YAMLSeq{constructor(){super(),this.add=bt.YAMLMap.prototype.add.bind(this),this.delete=bt.YAMLMap.prototype.delete.bind(this),this.get=bt.YAMLMap.prototype.get.bind(this),this.has=bt.YAMLMap.prototype.has.bind(this),this.set=bt.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let o,s;if(Ds.isPair(i)?(o=ei.toJS(i.key,"",r),s=ei.toJS(i.value,o,r)):o=ei.toJS(i,"",r),n.has(o))throw new Error("Ordered maps must not include duplicate keys");n.set(o,s)}return n}static from(e,r,n){let i=$s.createPairs(e,r,n),o=new this;return o.items=i.items,o}};_e.tag="tag:yaml.org,2002:omap";var Af={collection:"seq",identify:t=>t instanceof Map,nodeClass:_e,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=$s.resolvePairs(t,e),n=[];for(let{key:i}of r.items)Ds.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new _e,r)},createNode:(t,e,r)=>_e.from(t,e,r)};ti.YAMLOMap=_e;ti.omap=Af});var Us=g(ni=>{"use strict";var Ms=A();function Bs({value:t,source:e},r){return e&&(t?Fs:Ks).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var Fs={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Ms.Scalar(!0),stringify:Bs},Ks={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Ms.Scalar(!1),stringify:Bs};ni.falseTag=Ks;ni.trueTag=Fs});var Gs=g(Pr=>{"use strict";var Nf=A(),ii=Be(),Of={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ii.stringifyNumber},Rf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():ii.stringifyNumber(t)}},Tf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new Nf.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:ii.stringifyNumber};Pr.float=Tf;Pr.floatExp=Rf;Pr.floatNaN=Of});var Ys=g(kt=>{"use strict";var Hs=Be(),vt=t=>typeof t=="bigint"||Number.isInteger(t);function _r(t,e,r,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let s=BigInt(t);return i==="-"?BigInt(-1)*s:s}let o=parseInt(t,r);return i==="-"?-1*o:o}function oi(t,e,r){let{value:n}=t;if(vt(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return Hs.stringifyNumber(t)}var If={identify:vt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>_r(t,2,2,r),stringify:t=>oi(t,2,"0b")},jf={identify:vt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>_r(t,1,8,r),stringify:t=>oi(t,8,"0")},Lf={identify:vt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>_r(t,0,10,r),stringify:Hs.stringifyNumber},qf={identify:vt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>_r(t,2,16,r),stringify:t=>oi(t,16,"0x")};kt.int=Lf;kt.intBin=If;kt.intHex=qf;kt.intOct=jf});var ai=g(si=>{"use strict";var Nr=P(),xr=fe(),Ar=pe(),xe=class t extends Ar.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;Nr.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new xr.Pair(e.key,null):r=new xr.Pair(e,null),Ar.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=Ar.findPair(this.items,e);return!r&&Nr.isPair(n)?Nr.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=Ar.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new xr.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:i}=n,o=new this(e);if(r&&Symbol.iterator in Object(r))for(let s of r)typeof i=="function"&&(s=i.call(r,s,s)),o.items.push(xr.createPair(s,null,n));return o}};xe.tag="tag:yaml.org,2002:set";var Wf={collection:"map",identify:t=>t instanceof Set,nodeClass:xe,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>xe.from(t,e,r),resolve(t,e){if(Nr.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new xe,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};si.YAMLSet=xe;si.set=Wf});var li=g(Or=>{"use strict";var Df=Be();function ci(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=s=>e?BigInt(s):Number(s),o=n.replace(/_/g,"").split(":").reduce((s,a)=>s*i(60)+i(a),i(0));return r==="-"?i(-1)*o:o}function Js(t){let{value:e}=t,r=s=>s;if(typeof e=="bigint")r=s=>BigInt(s);else if(isNaN(e)||!isFinite(e))return Df.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let i=r(60),o=[e%i];return e<60?o.unshift(0):(e=(e-o[0])/i,o.unshift(e%i),e>=60&&(e=(e-o[0])/i,o.unshift(e))),n+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var $f={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>ci(t,r),stringify:Js},Mf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>ci(t,!1),stringify:Js},Vs={identify:t=>t 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(t){let e=t.match(Vs.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,o,s,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(r,n-1,i,o||0,s||0,a||0,c),u=e[8];if(u&&u!=="Z"){let f=ci(u,!1);Math.abs(f)<30&&(f*=60),l-=6e4*f}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Or.floatTime=Mf;Or.intTime=$f;Or.timestamp=Vs});var Qs=g(Xs=>{"use strict";var Bf=$e(),Ff=wr(),Kf=Me(),Uf=wt(),Gf=Qn(),zs=Us(),ui=Gs(),Rr=Ys(),Hf=lr(),Yf=ri(),Jf=Er(),Vf=ai(),fi=li(),zf=[Bf.map,Kf.seq,Uf.string,Ff.nullTag,zs.trueTag,zs.falseTag,Rr.intBin,Rr.intOct,Rr.int,Rr.intHex,ui.floatNaN,ui.floatExp,ui.float,Gf.binary,Hf.merge,Yf.omap,Jf.pairs,Vf.set,fi.intTime,fi.floatTime,fi.timestamp];Xs.schema=zf});var ca=g(hi=>{"use strict";var ra=$e(),Xf=wr(),na=Me(),Qf=wt(),Zf=Un(),di=Hn(),pi=Jn(),ed=Rs(),td=js(),ia=Qn(),St=lr(),oa=ri(),sa=Er(),Zs=Qs(),aa=ai(),Tr=li(),ea=new Map([["core",ed.schema],["failsafe",[ra.map,na.seq,Qf.string]],["json",td.schema],["yaml11",Zs.schema],["yaml-1.1",Zs.schema]]),ta={binary:ia.binary,bool:Zf.boolTag,float:di.float,floatExp:di.floatExp,floatNaN:di.floatNaN,floatTime:Tr.floatTime,int:pi.int,intHex:pi.intHex,intOct:pi.intOct,intTime:Tr.intTime,map:ra.map,merge:St.merge,null:Xf.nullTag,omap:oa.omap,pairs:sa.pairs,seq:na.seq,set:aa.set,timestamp:Tr.timestamp},rd={"tag:yaml.org,2002:binary":ia.binary,"tag:yaml.org,2002:merge":St.merge,"tag:yaml.org,2002:omap":oa.omap,"tag:yaml.org,2002:pairs":sa.pairs,"tag:yaml.org,2002:set":aa.set,"tag:yaml.org,2002:timestamp":Tr.timestamp};function nd(t,e,r){let n=ea.get(e);if(n&&!t)return r&&!n.includes(St.merge)?n.concat(St.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let o=Array.from(ea.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${o} or define customTags array`)}if(Array.isArray(t))for(let o of t)i=i.concat(o);else typeof t=="function"&&(i=t(i.slice()));return r&&(i=i.concat(St.merge)),i.reduce((o,s)=>{let a=typeof s=="string"?ta[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(ta).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return o.includes(a)||o.push(a),o},[])}hi.coreKnownTags=rd;hi.getTags=nd});var wi=g(la=>{"use strict";var mi=P(),id=$e(),od=Me(),sd=wt(),Ir=ca(),ad=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,gi=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(e)?Ir.getTags(e,"compat"):e?Ir.getTags(null,e):null,this.name=typeof o=="string"&&o||"core",this.knownTags=i?Ir.coreKnownTags:{},this.tags=Ir.getTags(r,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,mi.MAP,{value:id.map}),Object.defineProperty(this,mi.SCALAR,{value:sd.string}),Object.defineProperty(this,mi.SEQ,{value:od.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?ad:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};la.Schema=gi});var fa=g(ua=>{"use strict";var cd=P(),yi=ht(),Ct=ut();function ld(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(r.push(c),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=yi.createStringifyContext(t,e),{commentString:o}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let c=o(t.commentBefore);r.unshift(Ct.indentComment(c,""))}let s=!1,a=null;if(t.contents){if(cd.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let u=o(t.contents.commentBefore);r.push(Ct.indentComment(u,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>s=!0,l=yi.stringify(t.contents,i,()=>a=null,c);a&&(l+=Ct.lineComment(l,"",o(a))),(l[0]==="|"||l[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(yi.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let c=o(t.comment);c.includes(`
58
- `)?(r.push("..."),r.push(Ct.indentComment(c,""))):r.push(`... ${c}`)}else r.push("...");else{let c=t.comment;c&&s&&(c=c.replace(/^\n+/,"")),c&&((!s||a)&&r[r.length-1]!==""&&r.push(""),r.push(Ct.indentComment(o(c),"")))}return r.join(`
57
+ ${o.comment}`:n.comment}n=i}t.items[r]=Cr.isPair(n)?n:new Xn.Pair(n)}}else e("Expected a sequence for this tag");return t}function Ws(t,e,r){let{replacer:n}=r,i=new Af.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let s of e){typeof n=="function"&&(s=n.call(e,String(o++),s));let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let l=Object.keys(s);if(l.length===1)a=l[0],c=s[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=s;i.items.push(Xn.createPair(a,c,r))}return i}var Nf={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Ls,createNode:Ws};Er.createPairs=Ws;Er.pairs=Nf;Er.resolvePairs=Ls});var ei=g(Zn=>{"use strict";var Ds=_(),Qn=se(),vt=de(),Of=pe(),$s=_r(),xe=class t extends Of.YAMLSeq{constructor(){super(),this.add=vt.YAMLMap.prototype.add.bind(this),this.delete=vt.YAMLMap.prototype.delete.bind(this),this.get=vt.YAMLMap.prototype.get.bind(this),this.has=vt.YAMLMap.prototype.has.bind(this),this.set=vt.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let o,s;if(Ds.isPair(i)?(o=Qn.toJS(i.key,"",r),s=Qn.toJS(i.value,o,r)):o=Qn.toJS(i,"",r),n.has(o))throw new Error("Ordered maps must not include duplicate keys");n.set(o,s)}return n}static from(e,r,n){let i=$s.createPairs(e,r,n),o=new this;return o.items=i.items,o}};xe.tag="tag:yaml.org,2002:omap";var Rf={collection:"seq",identify:t=>t instanceof Map,nodeClass:xe,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=$s.resolvePairs(t,e),n=[];for(let{key:i}of r.items)Ds.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new xe,r)},createNode:(t,e,r)=>xe.from(t,e,r)};Zn.YAMLOMap=xe;Zn.omap=Rf});var Us=g(ti=>{"use strict";var Ms=A();function Bs({value:t,source:e},r){return e&&(t?Fs:Ks).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var Fs={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Ms.Scalar(!0),stringify:Bs},Ks={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Ms.Scalar(!1),stringify:Bs};ti.falseTag=Ks;ti.trueTag=Fs});var Gs=g(Pr=>{"use strict";var Tf=A(),ri=Fe(),If={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ri.stringifyNumber},jf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():ri.stringifyNumber(t)}},qf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new Tf.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:ri.stringifyNumber};Pr.float=qf;Pr.floatExp=jf;Pr.floatNaN=If});var Ys=g(St=>{"use strict";var Hs=Fe(),kt=t=>typeof t=="bigint"||Number.isInteger(t);function xr(t,e,r,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let s=BigInt(t);return i==="-"?BigInt(-1)*s:s}let o=parseInt(t,r);return i==="-"?-1*o:o}function ni(t,e,r){let{value:n}=t;if(kt(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return Hs.stringifyNumber(t)}var Lf={identify:kt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>xr(t,2,2,r),stringify:t=>ni(t,2,"0b")},Wf={identify:kt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>xr(t,1,8,r),stringify:t=>ni(t,8,"0")},Df={identify:kt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>xr(t,0,10,r),stringify:Hs.stringifyNumber},$f={identify:kt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>xr(t,2,16,r),stringify:t=>ni(t,16,"0x")};St.int=Df;St.intBin=Lf;St.intHex=$f;St.intOct=Wf});var oi=g(ii=>{"use strict";var Or=_(),Ar=ue(),Nr=de(),Ae=class t extends Nr.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;Or.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new Ar.Pair(e.key,null):r=new Ar.Pair(e,null),Nr.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=Nr.findPair(this.items,e);return!r&&Or.isPair(n)?Or.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=Nr.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new Ar.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:i}=n,o=new this(e);if(r&&Symbol.iterator in Object(r))for(let s of r)typeof i=="function"&&(s=i.call(r,s,s)),o.items.push(Ar.createPair(s,null,n));return o}};Ae.tag="tag:yaml.org,2002:set";var Mf={collection:"map",identify:t=>t instanceof Set,nodeClass:Ae,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>Ae.from(t,e,r),resolve(t,e){if(Or.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Ae,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};ii.YAMLSet=Ae;ii.set=Mf});var ai=g(Rr=>{"use strict";var Bf=Fe();function si(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=s=>e?BigInt(s):Number(s),o=n.replace(/_/g,"").split(":").reduce((s,a)=>s*i(60)+i(a),i(0));return r==="-"?i(-1)*o:o}function Js(t){let{value:e}=t,r=s=>s;if(typeof e=="bigint")r=s=>BigInt(s);else if(isNaN(e)||!isFinite(e))return Bf.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let i=r(60),o=[e%i];return e<60?o.unshift(0):(e=(e-o[0])/i,o.unshift(e%i),e>=60&&(e=(e-o[0])/i,o.unshift(e))),n+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Ff={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>si(t,r),stringify:Js},Kf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>si(t,!1),stringify:Js},Vs={identify:t=>t 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(t){let e=t.match(Vs.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,o,s,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(r,n-1,i,o||0,s||0,a||0,c),u=e[8];if(u&&u!=="Z"){let f=si(u,!1);Math.abs(f)<30&&(f*=60),l-=6e4*f}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Rr.floatTime=Kf;Rr.intTime=Ff;Rr.timestamp=Vs});var Qs=g(Xs=>{"use strict";var Uf=Me(),Gf=yr(),Hf=Be(),Yf=yt(),Jf=zn(),zs=Us(),ci=Gs(),Tr=Ys(),Vf=ur(),zf=ei(),Xf=_r(),Qf=oi(),li=ai(),Zf=[Uf.map,Hf.seq,Yf.string,Gf.nullTag,zs.trueTag,zs.falseTag,Tr.intBin,Tr.intOct,Tr.int,Tr.intHex,ci.floatNaN,ci.floatExp,ci.float,Jf.binary,Vf.merge,zf.omap,Xf.pairs,Qf.set,li.intTime,li.floatTime,li.timestamp];Xs.schema=Zf});var ca=g(di=>{"use strict";var ra=Me(),ed=yr(),na=Be(),td=yt(),rd=Fn(),ui=Un(),fi=Hn(),nd=Rs(),id=js(),ia=zn(),Ct=ur(),oa=ei(),sa=_r(),Zs=Qs(),aa=oi(),Ir=ai(),ea=new Map([["core",nd.schema],["failsafe",[ra.map,na.seq,td.string]],["json",id.schema],["yaml11",Zs.schema],["yaml-1.1",Zs.schema]]),ta={binary:ia.binary,bool:rd.boolTag,float:ui.float,floatExp:ui.floatExp,floatNaN:ui.floatNaN,floatTime:Ir.floatTime,int:fi.int,intHex:fi.intHex,intOct:fi.intOct,intTime:Ir.intTime,map:ra.map,merge:Ct.merge,null:ed.nullTag,omap:oa.omap,pairs:sa.pairs,seq:na.seq,set:aa.set,timestamp:Ir.timestamp},od={"tag:yaml.org,2002:binary":ia.binary,"tag:yaml.org,2002:merge":Ct.merge,"tag:yaml.org,2002:omap":oa.omap,"tag:yaml.org,2002:pairs":sa.pairs,"tag:yaml.org,2002:set":aa.set,"tag:yaml.org,2002:timestamp":Ir.timestamp};function sd(t,e,r){let n=ea.get(e);if(n&&!t)return r&&!n.includes(Ct.merge)?n.concat(Ct.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let o=Array.from(ea.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${o} or define customTags array`)}if(Array.isArray(t))for(let o of t)i=i.concat(o);else typeof t=="function"&&(i=t(i.slice()));return r&&(i=i.concat(Ct.merge)),i.reduce((o,s)=>{let a=typeof s=="string"?ta[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(ta).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return o.includes(a)||o.push(a),o},[])}di.coreKnownTags=od;di.getTags=sd});var mi=g(la=>{"use strict";var pi=_(),ad=Me(),cd=Be(),ld=yt(),jr=ca(),ud=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,hi=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(e)?jr.getTags(e,"compat"):e?jr.getTags(null,e):null,this.name=typeof o=="string"&&o||"core",this.knownTags=i?jr.coreKnownTags:{},this.tags=jr.getTags(r,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,pi.MAP,{value:ad.map}),Object.defineProperty(this,pi.SCALAR,{value:ld.string}),Object.defineProperty(this,pi.SEQ,{value:cd.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?ud:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};la.Schema=hi});var fa=g(ua=>{"use strict";var fd=_(),gi=mt(),Et=ft();function dd(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(r.push(c),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=gi.createStringifyContext(t,e),{commentString:o}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let c=o(t.commentBefore);r.unshift(Et.indentComment(c,""))}let s=!1,a=null;if(t.contents){if(fd.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let u=o(t.contents.commentBefore);r.push(Et.indentComment(u,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>s=!0,l=gi.stringify(t.contents,i,()=>a=null,c);a&&(l+=Et.lineComment(l,"",o(a))),(l[0]==="|"||l[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(gi.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let c=o(t.comment);c.includes(`
58
+ `)?(r.push("..."),r.push(Et.indentComment(c,""))):r.push(`... ${c}`)}else r.push("...");else{let c=t.comment;c&&s&&(c=c.replace(/^\n+/,"")),c&&((!s||a)&&r[r.length-1]!==""&&r.push(""),r.push(Et.indentComment(o(c),"")))}return r.join(`
59
59
  `)+`
60
- `}ua.stringifyDocument=ld});var Et=g(da=>{"use strict";var ud=ct(),Fe=Zt(),G=P(),fd=fe(),dd=ae(),pd=wi(),hd=fa(),bi=Vt(),md=Cn(),gd=lt(),vi=Sn(),ki=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,G.NODE_TYPE,{value:G.DOC});let i=null;typeof r=="function"||Array.isArray(r)?i=r:n===void 0&&r&&(n=r,r=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=o;let{version:s}=o;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new vi.Directives({version:s}),this.setSchema(s,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(t.prototype,{[G.NODE_TYPE]:{value:G.DOC}});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=G.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Ke(this.contents)&&this.contents.add(e)}addIn(e,r){Ke(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=bi.anchorNames(this);e.anchor=!r||n.has(r)?bi.findNewAnchor(r||"a",n):r}return new ud.Alias(e.anchor)}createNode(e,r,n){let i;if(typeof r=="function")e=r.call({"":e},"",e),i=r;else if(Array.isArray(r)){let h=v=>typeof v=="number"||v instanceof String||v instanceof Number,y=r.filter(h).map(String);y.length>0&&(r=r.concat(y)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:c,onTagObj:l,tag:u}=n??{},{onAnchor:f,setAnchors:d,sourceObjects:m}=bi.createNodeAnchors(this,s||"a"),w={aliasDuplicateObjects:o??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:m},p=gd.createNode(e,u,w);return a&&G.isCollection(p)&&(p.flow=!0),d(),p}createPair(e,r,n={}){let i=this.createNode(e,null,n),o=this.createNode(r,null,n);return new fd.Pair(i,o)}delete(e){return Ke(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Fe.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Ke(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return G.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return Fe.isEmptyPath(e)?!r&&G.isScalar(this.contents)?this.contents.value:this.contents:G.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return G.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Fe.isEmptyPath(e)?this.contents!==void 0:G.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=Fe.collectionFromPath(this.schema,[e],r):Ke(this.contents)&&this.contents.set(e,r)}setIn(e,r){Fe.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=Fe.collectionFromPath(this.schema,Array.from(e),r):Ke(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new vi.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new vi.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new pd.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:i,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=dd.toJS(this.contents,r??"",a);if(typeof o=="function")for(let{count:l,res:u}of a.anchors.values())o(u,l);return typeof s=="function"?md.applyReviver(s,{"":c},"",c):c}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}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)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return hd.stringifyDocument(this,e)}};function Ke(t){if(G.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}da.Document=ki});var xt=g(_t=>{"use strict";var Pt=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},Si=class extends Pt{constructor(e,r,n){super("YAMLParseError",e,r,n)}},Ci=class extends Pt{constructor(e,r,n){super("YAMLWarning",e,r,n)}},wd=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(a=>e.linePos(a));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let o=i-1,s=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="…"+s.substring(a),o-=a-1}if(s.length>80&&(s=s.substring(0,79)+"…"),n>1&&/^ *$/.test(s.substring(0,o))){let a=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`…
60
+ `}ua.stringifyDocument=dd});var _t=g(da=>{"use strict";var pd=lt(),Ke=er(),G=_(),hd=ue(),md=se(),gd=mi(),wd=fa(),wi=zt(),yd=kn(),bd=ut(),yi=vn(),bi=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,G.NODE_TYPE,{value:G.DOC});let i=null;typeof r=="function"||Array.isArray(r)?i=r:n===void 0&&r&&(n=r,r=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=o;let{version:s}=o;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new yi.Directives({version:s}),this.setSchema(s,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(t.prototype,{[G.NODE_TYPE]:{value:G.DOC}});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=G.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Ue(this.contents)&&this.contents.add(e)}addIn(e,r){Ue(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=wi.anchorNames(this);e.anchor=!r||n.has(r)?wi.findNewAnchor(r||"a",n):r}return new pd.Alias(e.anchor)}createNode(e,r,n){let i;if(typeof r=="function")e=r.call({"":e},"",e),i=r;else if(Array.isArray(r)){let h=v=>typeof v=="number"||v instanceof String||v instanceof Number,y=r.filter(h).map(String);y.length>0&&(r=r.concat(y)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:c,onTagObj:l,tag:u}=n??{},{onAnchor:f,setAnchors:d,sourceObjects:m}=wi.createNodeAnchors(this,s||"a"),w={aliasDuplicateObjects:o??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:m},p=bd.createNode(e,u,w);return a&&G.isCollection(p)&&(p.flow=!0),d(),p}createPair(e,r,n={}){let i=this.createNode(e,null,n),o=this.createNode(r,null,n);return new hd.Pair(i,o)}delete(e){return Ue(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Ke.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Ue(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return G.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return Ke.isEmptyPath(e)?!r&&G.isScalar(this.contents)?this.contents.value:this.contents:G.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return G.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Ke.isEmptyPath(e)?this.contents!==void 0:G.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=Ke.collectionFromPath(this.schema,[e],r):Ue(this.contents)&&this.contents.set(e,r)}setIn(e,r){Ke.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=Ke.collectionFromPath(this.schema,Array.from(e),r):Ue(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new yi.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new yi.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new gd.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:i,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=md.toJS(this.contents,r??"",a);if(typeof o=="function")for(let{count:l,res:u}of a.anchors.values())o(u,l);return typeof s=="function"?yd.applyReviver(s,{"":c},"",c):c}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}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)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return wd.stringifyDocument(this,e)}};function Ue(t){if(G.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}da.Document=bi});var At=g(xt=>{"use strict";var Pt=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},vi=class extends Pt{constructor(e,r,n){super("YAMLParseError",e,r,n)}},ki=class extends Pt{constructor(e,r,n){super("YAMLWarning",e,r,n)}},vd=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(a=>e.linePos(a));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let o=i-1,s=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="…"+s.substring(a),o-=a-1}if(s.length>80&&(s=s.substring(0,79)+"…"),n>1&&/^ *$/.test(s.substring(0,o))){let a=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`…
61
61
  `),s=a+s}if(/[^ ]/.test(s)){let a=1,c=r.linePos[1];c?.line===n&&c.col>i&&(a=Math.max(1,Math.min(c.col-i,80-o)));let l=" ".repeat(o)+"^".repeat(a);r.message+=`:
62
62
 
63
63
  ${s}
64
64
  ${l}
65
- `}};_t.YAMLError=Pt;_t.YAMLParseError=Si;_t.YAMLWarning=Ci;_t.prettifyError=wd});var At=g(pa=>{"use strict";function yd(t,{flow:e,indicator:r,next:n,offset:i,onError:o,parentIndent:s,startOnNewline:a}){let c=!1,l=a,u=a,f="",d="",m=!1,w=!1,p=null,h=null,y=null,v=null,k=null,S=null,C=null;for(let b of t)switch(w&&(b.type!=="space"&&b.type!=="newline"&&b.type!=="comma"&&o(b.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w=!1),p&&(l&&b.type!=="comment"&&b.type!=="newline"&&o(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),p=null),b.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&b.source.includes(" ")&&(p=b),u=!0;break;case"comment":{u||o(b,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let O=b.source.substring(1)||" ";f?f+=d+O:f=O,d="",l=!1;break}case"newline":l?f?f+=b.source:(!S||r!=="seq-item-ind")&&(c=!0):d+=b.source,l=!0,m=!0,(h||y)&&(v=b),u=!0;break;case"anchor":h&&o(b,"MULTIPLE_ANCHORS","A node can have at most one anchor"),b.source.endsWith(":")&&o(b.offset+b.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),h=b,C??(C=b.offset),l=!1,u=!1,w=!0;break;case"tag":{y&&o(b,"MULTIPLE_TAGS","A node can have at most one tag"),y=b,C??(C=b.offset),l=!1,u=!1,w=!0;break}case r:(h||y)&&o(b,"BAD_PROP_ORDER",`Anchors and tags must be after the ${b.source} indicator`),S&&o(b,"UNEXPECTED_TOKEN",`Unexpected ${b.source} in ${e??"collection"}`),S=b,l=r==="seq-item-ind"||r==="explicit-key-ind",u=!1;break;case"comma":if(e){k&&o(b,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=b,l=!1,u=!1;break}default:o(b,"UNEXPECTED_TOKEN",`Unexpected ${b.type} token`),l=!1,u=!1}let E=t[t.length-1],x=E?E.offset+E.source.length:i;return w&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&o(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),p&&(l&&p.indent<=s||n?.type==="block-map"||n?.type==="block-seq")&&o(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:S,spaceBefore:c,comment:f,hasNewline:m,anchor:h,tag:y,newlineAfterProp:v,end:x,start:C??x}}pa.resolveProps=yd});var jr=g(ha=>{"use strict";function Ei(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
66
- `))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(Ei(e.key)||Ei(e.value))return!0}return!1;default:return!0}}ha.containsNewline=Ei});var Pi=g(ma=>{"use strict";var bd=jr();function vd(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&bd.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}ma.flowIndentCheck=vd});var _i=g(wa=>{"use strict";var ga=P();function kd(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(o,s)=>o===s||ga.isScalar(o)&&ga.isScalar(s)&&o.value===s.value;return e.some(o=>i(o.key,r))}wa.mapIncludes=kd});var Ca=g(Sa=>{"use strict";var ya=fe(),Sd=pe(),ba=At(),Cd=jr(),va=Pi(),Ed=_i(),ka="All mapping items must start at the same column";function Pd({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??Sd.YAMLMap,a=new s(r.schema);r.atRoot&&(r.atRoot=!1);let c=n.offset,l=null;for(let u of n.items){let{start:f,key:d,sep:m,value:w}=u,p=ba.resolveProps(f,{indicator:"explicit-key-ind",next:d??m?.[0],offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0}),h=!p.found;if(h){if(d&&(d.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in d&&d.indent!==n.indent&&i(c,"BAD_INDENT",ka)),!p.anchor&&!p.tag&&!m){l=p.end,p.comment&&(a.comment?a.comment+=`
67
- `+p.comment:a.comment=p.comment);continue}(p.newlineAfterProp||Cd.containsNewline(d))&&i(d??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else p.found?.indent!==n.indent&&i(c,"BAD_INDENT",ka);r.atKey=!0;let y=p.end,v=d?t(r,d,p,i):e(r,y,f,null,p,i);r.schema.compat&&va.flowIndentCheck(n.indent,d,i),r.atKey=!1,Ed.mapIncludes(r,a.items,v)&&i(y,"DUPLICATE_KEY","Map keys must be unique");let k=ba.resolveProps(m??[],{indicator:"map-value-ind",next:w,offset:v.range[2],onError:i,parentIndent:n.indent,startOnNewline:!d||d.type==="block-scalar"});if(c=k.end,k.found){h&&(w?.type==="block-map"&&!k.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&p.start<k.found.offset-1024&&i(v.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let S=w?t(r,w,k,i):e(r,c,m,null,k,i);r.schema.compat&&va.flowIndentCheck(n.indent,w,i),c=S.range[2];let C=new ya.Pair(v,S);r.options.keepSourceTokens&&(C.srcToken=u),a.items.push(C)}else{h&&i(v.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(v.comment?v.comment+=`
68
- `+k.comment:v.comment=k.comment);let S=new ya.Pair(v);r.options.keepSourceTokens&&(S.srcToken=u),a.items.push(S)}}return l&&l<c&&i(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[n.offset,c,l??c],a}Sa.resolveBlockMap=Pd});var Pa=g(Ea=>{"use strict";var _d=he(),xd=At(),Ad=Pi();function Nd({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??_d.YAMLSeq,a=new s(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=n.offset,l=null;for(let{start:u,value:f}of n.items){let d=xd.resolveProps(u,{indicator:"seq-item-ind",next:f,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!d.found)if(d.anchor||d.tag||f)f?.type==="block-seq"?i(d.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=d.end,d.comment&&(a.comment=d.comment);continue}let m=f?t(r,f,d,i):e(r,d.end,u,null,d,i);r.schema.compat&&Ad.flowIndentCheck(n.indent,f,i),c=m.range[2],a.items.push(m)}return a.range=[n.offset,c,l??c],a}Ea.resolveBlockSeq=Nd});var Ue=g(_a=>{"use strict";function Od(t,e,r,n){let i="";if(t){let o=!1,s="";for(let a of t){let{source:c,type:l}=a;switch(l){case"space":o=!0;break;case"comment":{r&&!o&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";i?i+=s+u:i=u,s="";break}case"newline":i&&(s+=c),o=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:i,offset:e}}_a.resolveEnd=Od});var Oa=g(Na=>{"use strict";var Rd=P(),Td=fe(),xa=pe(),Id=he(),jd=Ue(),Aa=At(),Ld=jr(),qd=_i(),xi="Block collections are not allowed within flow collections",Ai=t=>t&&(t.type==="block-map"||t.type==="block-seq");function Wd({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=n.start.source==="{",a=s?"flow map":"flow sequence",c=o?.nodeClass??(s?xa.YAMLMap:Id.YAMLSeq),l=new c(r.schema);l.flow=!0;let u=r.atRoot;u&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let f=n.offset+n.start.source.length;for(let h=0;h<n.items.length;++h){let y=n.items[h],{start:v,key:k,sep:S,value:C}=y,E=Aa.resolveProps(v,{flow:a,indicator:"explicit-key-ind",next:k??S?.[0],offset:f,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!E.found){if(!E.anchor&&!E.tag&&!S&&!C){h===0&&E.comma?i(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):h<n.items.length-1&&i(E.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),E.comment&&(l.comment?l.comment+=`
69
- `+E.comment:l.comment=E.comment),f=E.end;continue}!s&&r.options.strict&&Ld.containsNewline(k)&&i(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(h===0)E.comma&&i(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(E.comma||i(E.start,"MISSING_CHAR",`Missing , between ${a} items`),E.comment){let x="";e:for(let b of v)switch(b.type){case"comma":case"space":break;case"comment":x=b.source.substring(1);break e;default:break e}if(x){let b=l.items[l.items.length-1];Rd.isPair(b)&&(b=b.value??b.key),b.comment?b.comment+=`
70
- `+x:b.comment=x,E.comment=E.comment.substring(x.length+1)}}if(!s&&!S&&!E.found){let x=C?t(r,C,E,i):e(r,E.end,S,null,E,i);l.items.push(x),f=x.range[2],Ai(C)&&i(x.range,"BLOCK_IN_FLOW",xi)}else{r.atKey=!0;let x=E.end,b=k?t(r,k,E,i):e(r,x,v,null,E,i);Ai(k)&&i(b.range,"BLOCK_IN_FLOW",xi),r.atKey=!1;let O=Aa.resolveProps(S??[],{flow:a,indicator:"map-value-ind",next:C,offset:b.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(O.found){if(!s&&!E.found&&r.options.strict){if(S)for(let R of S){if(R===O.found)break;if(R.type==="newline"){i(R,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}E.start<O.found.offset-1024&&i(O.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else C&&("source"in C&&C.source?.[0]===":"?i(C,"MISSING_CHAR",`Missing space after : in ${a}`):i(O.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let se=C?t(r,C,O,i):O.found?e(r,O.end,S,null,O,i):null;se?Ai(C)&&i(se.range,"BLOCK_IN_FLOW",xi):O.comment&&(b.comment?b.comment+=`
71
- `+O.comment:b.comment=O.comment);let je=new Td.Pair(b,se);if(r.options.keepSourceTokens&&(je.srcToken=y),s){let R=l;qd.mapIncludes(r,R.items,b)&&i(x,"DUPLICATE_KEY","Map keys must be unique"),R.items.push(je)}else{let R=new xa.YAMLMap(r.schema);R.flow=!0,R.items.push(je);let Ao=(se??b).range;R.range=[b.range[0],Ao[1],Ao[2]],l.items.push(R)}f=se?se.range[2]:O.end}}let d=s?"}":"]",[m,...w]=n.end,p=f;if(m?.source===d)p=m.offset+m.source.length;else{let h=a[0].toUpperCase()+a.substring(1),y=u?`${h} must end with a ${d}`:`${h} in block collection must be sufficiently indented and end with a ${d}`;i(f,u?"MISSING_CHAR":"BAD_INDENT",y),m&&m.source.length!==1&&w.unshift(m)}if(w.length>0){let h=jd.resolveEnd(w,p,r.options.strict,i);h.comment&&(l.comment?l.comment+=`
72
- `+h.comment:l.comment=h.comment),l.range=[n.offset,p,h.offset]}else l.range=[n.offset,p,p];return l}Na.resolveFlowCollection=Wd});var Ta=g(Ra=>{"use strict";var Dd=P(),$d=A(),Md=pe(),Bd=he(),Fd=Ca(),Kd=Pa(),Ud=Oa();function Ni(t,e,r,n,i,o){let s=r.type==="block-map"?Fd.resolveBlockMap(t,e,r,n,o):r.type==="block-seq"?Kd.resolveBlockSeq(t,e,r,n,o):Ud.resolveFlowCollection(t,e,r,n,o),a=s.constructor;return i==="!"||i===a.tagName?(s.tag=a.tagName,s):(i&&(s.tag=i),s)}function Gd(t,e,r,n,i){let o=n.tag,s=o?e.directives.tagName(o.source,d=>i(o,"TAG_RESOLVE_FAILED",d)):null;if(r.type==="block-seq"){let{anchor:d,newlineAfterProp:m}=n,w=d&&o?d.offset>o.offset?d:o:d??o;w&&(!m||m.offset<w.offset)&&i(w,"MISSING_CHAR","Missing newline after block sequence props")}let a=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!o||!s||s==="!"||s===Md.YAMLMap.tagName&&a==="map"||s===Bd.YAMLSeq.tagName&&a==="seq")return Ni(t,e,r,i,s);let c=e.schema.tags.find(d=>d.tag===s&&d.collection===a);if(!c){let d=e.schema.knownTags[s];if(d?.collection===a)e.schema.tags.push(Object.assign({},d,{default:!1})),c=d;else return d?i(o,"BAD_COLLECTION_TYPE",`${d.tag} used for ${a} collection, but expects ${d.collection??"scalar"}`,!0):i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),Ni(t,e,r,i,s)}let l=Ni(t,e,r,i,s,c),u=c.resolve?.(l,d=>i(o,"TAG_RESOLVE_FAILED",d),e.options)??l,f=Dd.isNode(u)?u:new $d.Scalar(u);return f.range=l.range,f.tag=s,c?.format&&(f.format=c.format),f}Ra.composeCollection=Gd});var Ri=g(Ia=>{"use strict";var Oi=A();function Hd(t,e,r){let n=e.offset,i=Yd(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let o=i.mode===">"?Oi.Scalar.BLOCK_FOLDED:Oi.Scalar.BLOCK_LITERAL,s=e.source?Jd(e.source):[],a=s.length;for(let p=s.length-1;p>=0;--p){let h=s[p][1];if(h===""||h==="\r")a=p;else break}if(a===0){let p=i.chomp==="+"&&s.length>0?`
65
+ `}};xt.YAMLError=Pt;xt.YAMLParseError=vi;xt.YAMLWarning=ki;xt.prettifyError=vd});var Nt=g(pa=>{"use strict";function kd(t,{flow:e,indicator:r,next:n,offset:i,onError:o,parentIndent:s,startOnNewline:a}){let c=!1,l=a,u=a,f="",d="",m=!1,w=!1,p=null,h=null,y=null,v=null,k=null,S=null,C=null;for(let b of t)switch(w&&(b.type!=="space"&&b.type!=="newline"&&b.type!=="comma"&&o(b.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w=!1),p&&(l&&b.type!=="comment"&&b.type!=="newline"&&o(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),p=null),b.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&b.source.includes(" ")&&(p=b),u=!0;break;case"comment":{u||o(b,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let O=b.source.substring(1)||" ";f?f+=d+O:f=O,d="",l=!1;break}case"newline":l?f?f+=b.source:(!S||r!=="seq-item-ind")&&(c=!0):d+=b.source,l=!0,m=!0,(h||y)&&(v=b),u=!0;break;case"anchor":h&&o(b,"MULTIPLE_ANCHORS","A node can have at most one anchor"),b.source.endsWith(":")&&o(b.offset+b.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),h=b,C??(C=b.offset),l=!1,u=!1,w=!0;break;case"tag":{y&&o(b,"MULTIPLE_TAGS","A node can have at most one tag"),y=b,C??(C=b.offset),l=!1,u=!1,w=!0;break}case r:(h||y)&&o(b,"BAD_PROP_ORDER",`Anchors and tags must be after the ${b.source} indicator`),S&&o(b,"UNEXPECTED_TOKEN",`Unexpected ${b.source} in ${e??"collection"}`),S=b,l=r==="seq-item-ind"||r==="explicit-key-ind",u=!1;break;case"comma":if(e){k&&o(b,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=b,l=!1,u=!1;break}default:o(b,"UNEXPECTED_TOKEN",`Unexpected ${b.type} token`),l=!1,u=!1}let E=t[t.length-1],x=E?E.offset+E.source.length:i;return w&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&o(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),p&&(l&&p.indent<=s||n?.type==="block-map"||n?.type==="block-seq")&&o(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:S,spaceBefore:c,comment:f,hasNewline:m,anchor:h,tag:y,newlineAfterProp:v,end:x,start:C??x}}pa.resolveProps=kd});var qr=g(ha=>{"use strict";function Si(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
66
+ `))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(Si(e.key)||Si(e.value))return!0}return!1;default:return!0}}ha.containsNewline=Si});var Ci=g(ma=>{"use strict";var Sd=qr();function Cd(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&Sd.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}ma.flowIndentCheck=Cd});var Ei=g(wa=>{"use strict";var ga=_();function Ed(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(o,s)=>o===s||ga.isScalar(o)&&ga.isScalar(s)&&o.value===s.value;return e.some(o=>i(o.key,r))}wa.mapIncludes=Ed});var Ca=g(Sa=>{"use strict";var ya=ue(),_d=de(),ba=Nt(),Pd=qr(),va=Ci(),xd=Ei(),ka="All mapping items must start at the same column";function Ad({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??_d.YAMLMap,a=new s(r.schema);r.atRoot&&(r.atRoot=!1);let c=n.offset,l=null;for(let u of n.items){let{start:f,key:d,sep:m,value:w}=u,p=ba.resolveProps(f,{indicator:"explicit-key-ind",next:d??m?.[0],offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0}),h=!p.found;if(h){if(d&&(d.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in d&&d.indent!==n.indent&&i(c,"BAD_INDENT",ka)),!p.anchor&&!p.tag&&!m){l=p.end,p.comment&&(a.comment?a.comment+=`
67
+ `+p.comment:a.comment=p.comment);continue}(p.newlineAfterProp||Pd.containsNewline(d))&&i(d??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else p.found?.indent!==n.indent&&i(c,"BAD_INDENT",ka);r.atKey=!0;let y=p.end,v=d?t(r,d,p,i):e(r,y,f,null,p,i);r.schema.compat&&va.flowIndentCheck(n.indent,d,i),r.atKey=!1,xd.mapIncludes(r,a.items,v)&&i(y,"DUPLICATE_KEY","Map keys must be unique");let k=ba.resolveProps(m??[],{indicator:"map-value-ind",next:w,offset:v.range[2],onError:i,parentIndent:n.indent,startOnNewline:!d||d.type==="block-scalar"});if(c=k.end,k.found){h&&(w?.type==="block-map"&&!k.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&p.start<k.found.offset-1024&&i(v.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let S=w?t(r,w,k,i):e(r,c,m,null,k,i);r.schema.compat&&va.flowIndentCheck(n.indent,w,i),c=S.range[2];let C=new ya.Pair(v,S);r.options.keepSourceTokens&&(C.srcToken=u),a.items.push(C)}else{h&&i(v.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(v.comment?v.comment+=`
68
+ `+k.comment:v.comment=k.comment);let S=new ya.Pair(v);r.options.keepSourceTokens&&(S.srcToken=u),a.items.push(S)}}return l&&l<c&&i(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[n.offset,c,l??c],a}Sa.resolveBlockMap=Ad});var _a=g(Ea=>{"use strict";var Nd=pe(),Od=Nt(),Rd=Ci();function Td({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??Nd.YAMLSeq,a=new s(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=n.offset,l=null;for(let{start:u,value:f}of n.items){let d=Od.resolveProps(u,{indicator:"seq-item-ind",next:f,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!d.found)if(d.anchor||d.tag||f)f?.type==="block-seq"?i(d.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=d.end,d.comment&&(a.comment=d.comment);continue}let m=f?t(r,f,d,i):e(r,d.end,u,null,d,i);r.schema.compat&&Rd.flowIndentCheck(n.indent,f,i),c=m.range[2],a.items.push(m)}return a.range=[n.offset,c,l??c],a}Ea.resolveBlockSeq=Td});var Ge=g(Pa=>{"use strict";function Id(t,e,r,n){let i="";if(t){let o=!1,s="";for(let a of t){let{source:c,type:l}=a;switch(l){case"space":o=!0;break;case"comment":{r&&!o&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";i?i+=s+u:i=u,s="";break}case"newline":i&&(s+=c),o=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:i,offset:e}}Pa.resolveEnd=Id});var Oa=g(Na=>{"use strict";var jd=_(),qd=ue(),xa=de(),Ld=pe(),Wd=Ge(),Aa=Nt(),Dd=qr(),$d=Ei(),_i="Block collections are not allowed within flow collections",Pi=t=>t&&(t.type==="block-map"||t.type==="block-seq");function Md({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=n.start.source==="{",a=s?"flow map":"flow sequence",c=o?.nodeClass??(s?xa.YAMLMap:Ld.YAMLSeq),l=new c(r.schema);l.flow=!0;let u=r.atRoot;u&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let f=n.offset+n.start.source.length;for(let h=0;h<n.items.length;++h){let y=n.items[h],{start:v,key:k,sep:S,value:C}=y,E=Aa.resolveProps(v,{flow:a,indicator:"explicit-key-ind",next:k??S?.[0],offset:f,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!E.found){if(!E.anchor&&!E.tag&&!S&&!C){h===0&&E.comma?i(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):h<n.items.length-1&&i(E.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),E.comment&&(l.comment?l.comment+=`
69
+ `+E.comment:l.comment=E.comment),f=E.end;continue}!s&&r.options.strict&&Dd.containsNewline(k)&&i(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(h===0)E.comma&&i(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(E.comma||i(E.start,"MISSING_CHAR",`Missing , between ${a} items`),E.comment){let x="";e:for(let b of v)switch(b.type){case"comma":case"space":break;case"comment":x=b.source.substring(1);break e;default:break e}if(x){let b=l.items[l.items.length-1];jd.isPair(b)&&(b=b.value??b.key),b.comment?b.comment+=`
70
+ `+x:b.comment=x,E.comment=E.comment.substring(x.length+1)}}if(!s&&!S&&!E.found){let x=C?t(r,C,E,i):e(r,E.end,S,null,E,i);l.items.push(x),f=x.range[2],Pi(C)&&i(x.range,"BLOCK_IN_FLOW",_i)}else{r.atKey=!0;let x=E.end,b=k?t(r,k,E,i):e(r,x,v,null,E,i);Pi(k)&&i(b.range,"BLOCK_IN_FLOW",_i),r.atKey=!1;let O=Aa.resolveProps(S??[],{flow:a,indicator:"map-value-ind",next:C,offset:b.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(O.found){if(!s&&!E.found&&r.options.strict){if(S)for(let R of S){if(R===O.found)break;if(R.type==="newline"){i(R,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}E.start<O.found.offset-1024&&i(O.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else C&&("source"in C&&C.source?.[0]===":"?i(C,"MISSING_CHAR",`Missing space after : in ${a}`):i(O.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let oe=C?t(r,C,O,i):O.found?e(r,O.end,S,null,O,i):null;oe?Pi(C)&&i(oe.range,"BLOCK_IN_FLOW",_i):O.comment&&(b.comment?b.comment+=`
71
+ `+O.comment:b.comment=O.comment);let qe=new qd.Pair(b,oe);if(r.options.keepSourceTokens&&(qe.srcToken=y),s){let R=l;$d.mapIncludes(r,R.items,b)&&i(x,"DUPLICATE_KEY","Map keys must be unique"),R.items.push(qe)}else{let R=new xa.YAMLMap(r.schema);R.flow=!0,R.items.push(qe);let xo=(oe??b).range;R.range=[b.range[0],xo[1],xo[2]],l.items.push(R)}f=oe?oe.range[2]:O.end}}let d=s?"}":"]",[m,...w]=n.end,p=f;if(m?.source===d)p=m.offset+m.source.length;else{let h=a[0].toUpperCase()+a.substring(1),y=u?`${h} must end with a ${d}`:`${h} in block collection must be sufficiently indented and end with a ${d}`;i(f,u?"MISSING_CHAR":"BAD_INDENT",y),m&&m.source.length!==1&&w.unshift(m)}if(w.length>0){let h=Wd.resolveEnd(w,p,r.options.strict,i);h.comment&&(l.comment?l.comment+=`
72
+ `+h.comment:l.comment=h.comment),l.range=[n.offset,p,h.offset]}else l.range=[n.offset,p,p];return l}Na.resolveFlowCollection=Md});var Ta=g(Ra=>{"use strict";var Bd=_(),Fd=A(),Kd=de(),Ud=pe(),Gd=Ca(),Hd=_a(),Yd=Oa();function xi(t,e,r,n,i,o){let s=r.type==="block-map"?Gd.resolveBlockMap(t,e,r,n,o):r.type==="block-seq"?Hd.resolveBlockSeq(t,e,r,n,o):Yd.resolveFlowCollection(t,e,r,n,o),a=s.constructor;return i==="!"||i===a.tagName?(s.tag=a.tagName,s):(i&&(s.tag=i),s)}function Jd(t,e,r,n,i){let o=n.tag,s=o?e.directives.tagName(o.source,d=>i(o,"TAG_RESOLVE_FAILED",d)):null;if(r.type==="block-seq"){let{anchor:d,newlineAfterProp:m}=n,w=d&&o?d.offset>o.offset?d:o:d??o;w&&(!m||m.offset<w.offset)&&i(w,"MISSING_CHAR","Missing newline after block sequence props")}let a=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!o||!s||s==="!"||s===Kd.YAMLMap.tagName&&a==="map"||s===Ud.YAMLSeq.tagName&&a==="seq")return xi(t,e,r,i,s);let c=e.schema.tags.find(d=>d.tag===s&&d.collection===a);if(!c){let d=e.schema.knownTags[s];if(d?.collection===a)e.schema.tags.push(Object.assign({},d,{default:!1})),c=d;else return d?i(o,"BAD_COLLECTION_TYPE",`${d.tag} used for ${a} collection, but expects ${d.collection??"scalar"}`,!0):i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),xi(t,e,r,i,s)}let l=xi(t,e,r,i,s,c),u=c.resolve?.(l,d=>i(o,"TAG_RESOLVE_FAILED",d),e.options)??l,f=Bd.isNode(u)?u:new Fd.Scalar(u);return f.range=l.range,f.tag=s,c?.format&&(f.format=c.format),f}Ra.composeCollection=Jd});var Ni=g(Ia=>{"use strict";var Ai=A();function Vd(t,e,r){let n=e.offset,i=zd(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let o=i.mode===">"?Ai.Scalar.BLOCK_FOLDED:Ai.Scalar.BLOCK_LITERAL,s=e.source?Xd(e.source):[],a=s.length;for(let p=s.length-1;p>=0;--p){let h=s[p][1];if(h===""||h==="\r")a=p;else break}if(a===0){let p=i.chomp==="+"&&s.length>0?`
73
73
  `.repeat(Math.max(1,s.length-1)):"",h=n+i.length;return e.source&&(h+=e.source.length),{value:p,type:o,comment:i.comment,range:[n,h,h]}}let c=e.indent+i.indent,l=e.offset+i.length,u=0;for(let p=0;p<a;++p){let[h,y]=s[p];if(y===""||y==="\r")i.indent===0&&h.length>c&&(c=h.length);else{h.length<c&&r(l+h.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(c=h.length),u=p,c===0&&!t.atRoot&&r(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=h.length+y.length+1}for(let p=s.length-1;p>=a;--p)s[p][0].length>c&&(a=p+1);let f="",d="",m=!1;for(let p=0;p<u;++p)f+=s[p][0].slice(c)+`
74
- `;for(let p=u;p<a;++p){let[h,y]=s[p];l+=h.length+y.length+1;let v=y[y.length-1]==="\r";if(v&&(y=y.slice(0,-1)),y&&h.length<c){let S=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;r(l-y.length-(v?2:1),"BAD_INDENT",S),h=""}o===Oi.Scalar.BLOCK_LITERAL?(f+=d+h.slice(c)+y,d=`
74
+ `;for(let p=u;p<a;++p){let[h,y]=s[p];l+=h.length+y.length+1;let v=y[y.length-1]==="\r";if(v&&(y=y.slice(0,-1)),y&&h.length<c){let S=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;r(l-y.length-(v?2:1),"BAD_INDENT",S),h=""}o===Ai.Scalar.BLOCK_LITERAL?(f+=d+h.slice(c)+y,d=`
75
75
  `):h.length>c||y[0]===" "?(d===" "?d=`
76
76
  `:!m&&d===`
77
77
  `&&(d=`
@@ -84,71 +84,71 @@ ${l}
84
84
  `+s[p][0].slice(c);f[f.length-1]!==`
85
85
  `&&(f+=`
86
86
  `);break;default:f+=`
87
- `}let w=n+i.length+e.source.length;return{value:f,type:o,comment:i.comment,range:[n,w,w]}}function Yd({offset:t,props:e},r,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],o=i[0],s=0,a="",c=-1;for(let d=1;d<i.length;++d){let m=i[d];if(!a&&(m==="-"||m==="+"))a=m;else{let w=Number(m);!s&&w?s=w:c===-1&&(c=t+d)}}c!==-1&&n(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let l=!1,u="",f=i.length;for(let d=1;d<e.length;++d){let m=e[d];switch(m.type){case"space":l=!0;case"newline":f+=m.source.length;break;case"comment":r&&!l&&n(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=m.source.length,u=m.source.substring(1);break;case"error":n(m,"UNEXPECTED_TOKEN",m.message),f+=m.source.length;break;default:{let w=`Unexpected token in block scalar header: ${m.type}`;n(m,"UNEXPECTED_TOKEN",w);let p=m.source;p&&typeof p=="string"&&(f+=p.length)}}}return{mode:o,indent:s,chomp:a,comment:u,length:f}}function Jd(t){let e=t.split(/\n( *)/),r=e[0],n=r.match(/^( *)/),o=[n?.[1]?[n[1],r.slice(n[1].length)]:["",r]];for(let s=1;s<e.length;s+=2)o.push([e[s],e[s+1]]);return o}Ia.resolveBlockScalar=Hd});var Ii=g(La=>{"use strict";var Ti=A(),Vd=Ue();function zd(t,e,r){let{offset:n,type:i,source:o,end:s}=t,a,c,l=(d,m,w)=>r(n+d,m,w);switch(i){case"scalar":a=Ti.Scalar.PLAIN,c=Xd(o,l);break;case"single-quoted-scalar":a=Ti.Scalar.QUOTE_SINGLE,c=Qd(o,l);break;case"double-quoted-scalar":a=Ti.Scalar.QUOTE_DOUBLE,c=Zd(o,l);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+o.length,n+o.length]}}let u=n+o.length,f=Vd.resolveEnd(s,u,e,r);return{value:c,type:a,comment:f.comment,range:[n,u,f.offset]}}function Xd(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),ja(t)}function Qd(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),ja(t.slice(1,-1)).replace(/''/g,"'")}function ja(t){let e,r;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
87
+ `}let w=n+i.length+e.source.length;return{value:f,type:o,comment:i.comment,range:[n,w,w]}}function zd({offset:t,props:e},r,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],o=i[0],s=0,a="",c=-1;for(let d=1;d<i.length;++d){let m=i[d];if(!a&&(m==="-"||m==="+"))a=m;else{let w=Number(m);!s&&w?s=w:c===-1&&(c=t+d)}}c!==-1&&n(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let l=!1,u="",f=i.length;for(let d=1;d<e.length;++d){let m=e[d];switch(m.type){case"space":l=!0;case"newline":f+=m.source.length;break;case"comment":r&&!l&&n(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=m.source.length,u=m.source.substring(1);break;case"error":n(m,"UNEXPECTED_TOKEN",m.message),f+=m.source.length;break;default:{let w=`Unexpected token in block scalar header: ${m.type}`;n(m,"UNEXPECTED_TOKEN",w);let p=m.source;p&&typeof p=="string"&&(f+=p.length)}}}return{mode:o,indent:s,chomp:a,comment:u,length:f}}function Xd(t){let e=t.split(/\n( *)/),r=e[0],n=r.match(/^( *)/),o=[n?.[1]?[n[1],r.slice(n[1].length)]:["",r]];for(let s=1;s<e.length;s+=2)o.push([e[s],e[s+1]]);return o}Ia.resolveBlockScalar=Vd});var Ri=g(qa=>{"use strict";var Oi=A(),Qd=Ge();function Zd(t,e,r){let{offset:n,type:i,source:o,end:s}=t,a,c,l=(d,m,w)=>r(n+d,m,w);switch(i){case"scalar":a=Oi.Scalar.PLAIN,c=ep(o,l);break;case"single-quoted-scalar":a=Oi.Scalar.QUOTE_SINGLE,c=tp(o,l);break;case"double-quoted-scalar":a=Oi.Scalar.QUOTE_DOUBLE,c=rp(o,l);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+o.length,n+o.length]}}let u=n+o.length,f=Qd.resolveEnd(s,u,e,r);return{value:c,type:a,comment:f.comment,range:[n,u,f.offset]}}function ep(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),ja(t)}function tp(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),ja(t.slice(1,-1)).replace(/''/g,"'")}function ja(t){let e,r;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
88
88
  `,"sy"),r=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
89
89
  `,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,r=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=e.exec(t);if(!n)return t;let i=n[1],o=" ",s=e.lastIndex;for(r.lastIndex=s;n=r.exec(t);)n[1]===""?o===`
90
90
  `?i+=o:o=`
91
- `:(i+=o+n[1],o=" "),s=r.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=s,n=a.exec(t),i+o+(n?.[1]??"")}function Zd(t,e){let r="";for(let n=1;n<t.length-1;++n){let i=t[n];if(!(i==="\r"&&t[n+1]===`
91
+ `:(i+=o+n[1],o=" "),s=r.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=s,n=a.exec(t),i+o+(n?.[1]??"")}function rp(t,e){let r="";for(let n=1;n<t.length-1;++n){let i=t[n];if(!(i==="\r"&&t[n+1]===`
92
92
  `))if(i===`
93
- `){let{fold:o,offset:s}=ep(t,n);r+=o,n=s}else if(i==="\\"){let o=t[++n],s=tp[o];if(s)r+=s;else if(o===`
93
+ `){let{fold:o,offset:s}=np(t,n);r+=o,n=s}else if(i==="\\"){let o=t[++n],s=ip[o];if(s)r+=s;else if(o===`
94
94
  `)for(o=t[n+1];o===" "||o===" ";)o=t[++n+1];else if(o==="\r"&&t[n+1]===`
95
- `)for(o=t[++n+1];o===" "||o===" ";)o=t[++n+1];else if(o==="x"||o==="u"||o==="U"){let a=o==="x"?2:o==="u"?4:8;r+=rp(t,n+1,a,e),n+=a}else{let a=t.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),r+=a}}else if(i===" "||i===" "){let o=n,s=t[n+1];for(;s===" "||s===" ";)s=t[++n+1];s!==`
95
+ `)for(o=t[++n+1];o===" "||o===" ";)o=t[++n+1];else if(o==="x"||o==="u"||o==="U"){let a=o==="x"?2:o==="u"?4:8;r+=op(t,n+1,a,e),n+=a}else{let a=t.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),r+=a}}else if(i===" "||i===" "){let o=n,s=t[n+1];for(;s===" "||s===" ";)s=t[++n+1];s!==`
96
96
  `&&!(s==="\r"&&t[n+2]===`
97
- `)&&(r+=n>o?t.slice(o,n+1):i)}else r+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function ep(t,e){let r="",n=t[e+1];for(;(n===" "||n===" "||n===`
97
+ `)&&(r+=n>o?t.slice(o,n+1):i)}else r+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function np(t,e){let r="",n=t[e+1];for(;(n===" "||n===" "||n===`
98
98
  `||n==="\r")&&!(n==="\r"&&t[e+2]!==`
99
99
  `);)n===`
100
100
  `&&(r+=`
101
- `),e+=1,n=t[e+1];return r||(r=" "),{fold:r,offset:e}}var tp={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
102
- `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function rp(t,e,r,n){let i=t.substr(e,r),s=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(s)}catch{let a=t.substr(e-2,r+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}La.resolveFlowScalar=zd});var Da=g(Wa=>{"use strict";var Ae=P(),qa=A(),np=Ri(),ip=Ii();function op(t,e,r,n){let{value:i,type:o,comment:s,range:a}=e.type==="block-scalar"?np.resolveBlockScalar(t,e,n):ip.resolveFlowScalar(e,t.options.strict,n),c=r?t.directives.tagName(r.source,f=>n(r,"TAG_RESOLVE_FAILED",f)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[Ae.SCALAR]:c?l=sp(t.schema,i,c,r,n):e.type==="scalar"?l=ap(t,i,e,n):l=t.schema[Ae.SCALAR];let u;try{let f=l.resolve(i,d=>n(r??e,"TAG_RESOLVE_FAILED",d),t.options);u=Ae.isScalar(f)?f:new qa.Scalar(f)}catch(f){let d=f instanceof Error?f.message:String(f);n(r??e,"TAG_RESOLVE_FAILED",d),u=new qa.Scalar(i)}return u.range=a,u.source=i,o&&(u.type=o),c&&(u.tag=c),l.format&&(u.format=l.format),s&&(u.comment=s),u}function sp(t,e,r,n,i){if(r==="!")return t[Ae.SCALAR];let o=[];for(let a of t.tags)if(!a.collection&&a.tag===r)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(e))return a;let s=t.knownTags[r];return s&&!s.collection?(t.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[Ae.SCALAR])}function ap({atKey:t,directives:e,schema:r},n,i,o){let s=r.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(n))||r[Ae.SCALAR];if(r.compat){let a=r.compat.find(c=>c.default&&c.test?.test(n))??r[Ae.SCALAR];if(s.tag!==a.tag){let c=e.tagString(s.tag),l=e.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;o(i,"TAG_RESOLVE_FAILED",u,!0)}}return s}Wa.composeScalar=op});var Ma=g($a=>{"use strict";function cp(t,e,r){if(e){r??(r=e.length);for(let n=r-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++n];i?.type==="space";)t+=i.source.length,i=e[++n];break}}return t}$a.emptyScalarPosition=cp});var Ka=g(Li=>{"use strict";var lp=ct(),up=P(),fp=Ta(),Ba=Da(),dp=Ue(),pp=Ma(),hp={composeNode:Fa,composeEmptyNode:ji};function Fa(t,e,r,n){let i=t.atKey,{spaceBefore:o,comment:s,anchor:a,tag:c}=r,l,u=!0;switch(e.type){case"alias":l=mp(t,e,n),(a||c)&&n(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=Ba.composeScalar(t,e,c,n),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=fp.composeCollection(hp,t,e,r,n),a&&(l.anchor=a.source.substring(1))}catch(f){let d=f instanceof Error?f.message:String(f);n(e,"RESOURCE_EXHAUSTION",d)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",f),u=!1}}return l??(l=ji(t,e.offset,void 0,null,r,n)),a&&l.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!up.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&n(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(l.spaceBefore=!0),s&&(e.type==="scalar"&&e.source===""?l.comment=s:l.commentBefore=s),t.options.keepSourceTokens&&u&&(l.srcToken=e),l}function ji(t,e,r,n,{spaceBefore:i,comment:o,anchor:s,tag:a,end:c},l){let u={type:"scalar",offset:pp.emptyScalarPosition(e,r,n),indent:-1,source:""},f=Ba.composeScalar(t,u,a,l);return s&&(f.anchor=s.source.substring(1),f.anchor===""&&l(s,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),o&&(f.comment=o,f.range[2]=c),f}function mp({options:t},{offset:e,source:r,end:n},i){let o=new lp.Alias(r.substring(1));o.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=e+r.length,a=dp.resolveEnd(n,s,t.strict,i);return o.range=[e,s,a.offset],a.comment&&(o.comment=a.comment),o}Li.composeEmptyNode=ji;Li.composeNode=Fa});var Ha=g(Ga=>{"use strict";var gp=Et(),Ua=Ka(),wp=Ue(),yp=At();function bp(t,e,{offset:r,start:n,value:i,end:o},s){let a=Object.assign({_directives:e},t),c=new gp.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=yp.resolveProps(n,{indicator:"doc-start",next:i??o?.[0],offset:r,onError:s,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?Ua.composeNode(l,i,u,s):Ua.composeEmptyNode(l,u.end,n,null,u,s);let f=c.contents.range[2],d=wp.resolveEnd(o,f,!1,s);return d.comment&&(c.comment=d.comment),c.range=[r,f,d.offset],c}Ga.composeDoc=bp});var Wi=g(Va=>{"use strict";var vp=Ut("process"),kp=Sn(),Sp=Et(),Nt=xt(),Ya=P(),Cp=Ha(),Ep=Ue();function Ot(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function Ja(t){let e="",r=!1,n=!1;for(let i=0;i<t.length;++i){let o=t[i];switch(o[0]){case"#":e+=(e===""?"":n?`
101
+ `),e+=1,n=t[e+1];return r||(r=" "),{fold:r,offset:e}}var ip={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
102
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function op(t,e,r,n){let i=t.substr(e,r),s=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(s)}catch{let a=t.substr(e-2,r+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}qa.resolveFlowScalar=Zd});var Da=g(Wa=>{"use strict";var Ne=_(),La=A(),sp=Ni(),ap=Ri();function cp(t,e,r,n){let{value:i,type:o,comment:s,range:a}=e.type==="block-scalar"?sp.resolveBlockScalar(t,e,n):ap.resolveFlowScalar(e,t.options.strict,n),c=r?t.directives.tagName(r.source,f=>n(r,"TAG_RESOLVE_FAILED",f)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[Ne.SCALAR]:c?l=lp(t.schema,i,c,r,n):e.type==="scalar"?l=up(t,i,e,n):l=t.schema[Ne.SCALAR];let u;try{let f=l.resolve(i,d=>n(r??e,"TAG_RESOLVE_FAILED",d),t.options);u=Ne.isScalar(f)?f:new La.Scalar(f)}catch(f){let d=f instanceof Error?f.message:String(f);n(r??e,"TAG_RESOLVE_FAILED",d),u=new La.Scalar(i)}return u.range=a,u.source=i,o&&(u.type=o),c&&(u.tag=c),l.format&&(u.format=l.format),s&&(u.comment=s),u}function lp(t,e,r,n,i){if(r==="!")return t[Ne.SCALAR];let o=[];for(let a of t.tags)if(!a.collection&&a.tag===r)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(e))return a;let s=t.knownTags[r];return s&&!s.collection?(t.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[Ne.SCALAR])}function up({atKey:t,directives:e,schema:r},n,i,o){let s=r.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(n))||r[Ne.SCALAR];if(r.compat){let a=r.compat.find(c=>c.default&&c.test?.test(n))??r[Ne.SCALAR];if(s.tag!==a.tag){let c=e.tagString(s.tag),l=e.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;o(i,"TAG_RESOLVE_FAILED",u,!0)}}return s}Wa.composeScalar=cp});var Ma=g($a=>{"use strict";function fp(t,e,r){if(e){r??(r=e.length);for(let n=r-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++n];i?.type==="space";)t+=i.source.length,i=e[++n];break}}return t}$a.emptyScalarPosition=fp});var Ka=g(Ii=>{"use strict";var dp=lt(),pp=_(),hp=Ta(),Ba=Da(),mp=Ge(),gp=Ma(),wp={composeNode:Fa,composeEmptyNode:Ti};function Fa(t,e,r,n){let i=t.atKey,{spaceBefore:o,comment:s,anchor:a,tag:c}=r,l,u=!0;switch(e.type){case"alias":l=yp(t,e,n),(a||c)&&n(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=Ba.composeScalar(t,e,c,n),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=hp.composeCollection(wp,t,e,r,n),a&&(l.anchor=a.source.substring(1))}catch(f){let d=f instanceof Error?f.message:String(f);n(e,"RESOURCE_EXHAUSTION",d)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",f),u=!1}}return l??(l=Ti(t,e.offset,void 0,null,r,n)),a&&l.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!pp.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&n(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(l.spaceBefore=!0),s&&(e.type==="scalar"&&e.source===""?l.comment=s:l.commentBefore=s),t.options.keepSourceTokens&&u&&(l.srcToken=e),l}function Ti(t,e,r,n,{spaceBefore:i,comment:o,anchor:s,tag:a,end:c},l){let u={type:"scalar",offset:gp.emptyScalarPosition(e,r,n),indent:-1,source:""},f=Ba.composeScalar(t,u,a,l);return s&&(f.anchor=s.source.substring(1),f.anchor===""&&l(s,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),o&&(f.comment=o,f.range[2]=c),f}function yp({options:t},{offset:e,source:r,end:n},i){let o=new dp.Alias(r.substring(1));o.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=e+r.length,a=mp.resolveEnd(n,s,t.strict,i);return o.range=[e,s,a.offset],a.comment&&(o.comment=a.comment),o}Ii.composeEmptyNode=Ti;Ii.composeNode=Fa});var Ha=g(Ga=>{"use strict";var bp=_t(),Ua=Ka(),vp=Ge(),kp=Nt();function Sp(t,e,{offset:r,start:n,value:i,end:o},s){let a=Object.assign({_directives:e},t),c=new bp.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=kp.resolveProps(n,{indicator:"doc-start",next:i??o?.[0],offset:r,onError:s,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?Ua.composeNode(l,i,u,s):Ua.composeEmptyNode(l,u.end,n,null,u,s);let f=c.contents.range[2],d=vp.resolveEnd(o,f,!1,s);return d.comment&&(c.comment=d.comment),c.range=[r,f,d.offset],c}Ga.composeDoc=Sp});var qi=g(Va=>{"use strict";var Cp=Gt("process"),Ep=vn(),_p=_t(),Ot=At(),Ya=_(),Pp=Ha(),xp=Ge();function Rt(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function Ja(t){let e="",r=!1,n=!1;for(let i=0;i<t.length;++i){let o=t[i];switch(o[0]){case"#":e+=(e===""?"":n?`
103
103
 
104
104
  `:`
105
- `)+(o.substring(1)||" "),r=!0,n=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:e,afterEmptyLine:n}}var qi=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,n,i,o)=>{let s=Ot(r);o?this.warnings.push(new Nt.YAMLWarning(s,n,i)):this.errors.push(new Nt.YAMLParseError(s,n,i))},this.directives=new kp.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:i}=Ja(this.prelude);if(n){let o=e.contents;if(r)e.comment=e.comment?`${e.comment}
105
+ `)+(o.substring(1)||" "),r=!0,n=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:e,afterEmptyLine:n}}var ji=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,n,i,o)=>{let s=Rt(r);o?this.warnings.push(new Ot.YAMLWarning(s,n,i)):this.errors.push(new Ot.YAMLParseError(s,n,i))},this.directives=new Ep.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:i}=Ja(this.prelude);if(n){let o=e.contents;if(r)e.comment=e.comment?`${e.comment}
106
106
  ${n}`:n;else if(i||e.directives.docStart||!o)e.commentBefore=n;else if(Ya.isCollection(o)&&!o.flow&&o.items.length>0){let s=o.items[0];Ya.isPair(s)&&(s=s.key);let a=s.commentBefore;s.commentBefore=a?`${n}
107
107
  ${a}`:n}else{let s=o.commentBefore;o.commentBefore=s?`${n}
108
- ${s}`:n}}if(r){for(let o=0;o<this.errors.length;++o)e.errors.push(this.errors[o]);for(let o=0;o<this.warnings.length;++o)e.warnings.push(this.warnings[o])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Ja(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,r=!1,n=-1){for(let i of e)yield*this.next(i);yield*this.end(r,n)}*next(e){switch(vp.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,n,i)=>{let o=Ot(e);o[0]+=r,this.onError(o,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=Cp.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Nt.YAMLParseError(Ot(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new Nt.YAMLParseError(Ot(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=Ep.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
109
- ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Nt.YAMLParseError(Ot(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new Sp.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,r,r],this.decorate(i,!1),yield i}}};Va.Composer=qi});var Qa=g(Lr=>{"use strict";var Pp=Ri(),_p=Ii(),xp=xt(),za=pt();function Ap(t,e=!0,r){if(t){let n=(i,o,s)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(a,o,s);else throw new xp.YAMLParseError([a,a+1],o,s)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return _p.resolveFlowScalar(t,e,n);case"block-scalar":return Pp.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function Np(t,e){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:o=-1,type:s="PLAIN"}=e,a=za.stringifyString({type:s,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:n,source:`
108
+ ${s}`:n}}if(r){for(let o=0;o<this.errors.length;++o)e.errors.push(this.errors[o]);for(let o=0;o<this.warnings.length;++o)e.warnings.push(this.warnings[o])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Ja(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,r=!1,n=-1){for(let i of e)yield*this.next(i);yield*this.end(r,n)}*next(e){switch(Cp.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,n,i)=>{let o=Rt(e);o[0]+=r,this.onError(o,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=Pp.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Ot.YAMLParseError(Rt(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new Ot.YAMLParseError(Rt(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=xp.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
109
+ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Ot.YAMLParseError(Rt(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new _p.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,r,r],this.decorate(i,!1),yield i}}};Va.Composer=ji});var Qa=g(Lr=>{"use strict";var Ap=Ni(),Np=Ri(),Op=At(),za=ht();function Rp(t,e=!0,r){if(t){let n=(i,o,s)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(a,o,s);else throw new Op.YAMLParseError([a,a+1],o,s)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Np.resolveFlowScalar(t,e,n);case"block-scalar":return Ap.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function Tp(t,e){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:o=-1,type:s="PLAIN"}=e,a=za.stringifyString({type:s,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:n,source:`
110
110
  `}];switch(a[0]){case"|":case">":{let l=a.indexOf(`
111
111
  `),u=a.substring(0,l),f=a.substring(l+1)+`
112
112
  `,d=[{type:"block-scalar-header",offset:o,indent:n,source:u}];return Xa(d,c)||d.push({type:"newline",offset:-1,indent:n,source:`
113
- `}),{type:"block-scalar",offset:o,indent:n,props:d,source:f}}case'"':return{type:"double-quoted-scalar",offset:o,indent:n,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:n,source:a,end:c};default:return{type:"scalar",offset:o,indent:n,source:a,end:c}}}function Op(t,e,r={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:o=!1,type:s}=r,a="indent"in t?t.indent:null;if(n&&typeof a=="number"&&(a+=2),!s)switch(t.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let l=t.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let c=za.stringifyString({type:s,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":Rp(t,c);break;case'"':Di(t,c,"double-quoted-scalar");break;case"'":Di(t,c,"single-quoted-scalar");break;default:Di(t,c,"scalar")}}function Rp(t,e){let r=e.indexOf(`
113
+ `}),{type:"block-scalar",offset:o,indent:n,props:d,source:f}}case'"':return{type:"double-quoted-scalar",offset:o,indent:n,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:n,source:a,end:c};default:return{type:"scalar",offset:o,indent:n,source:a,end:c}}}function Ip(t,e,r={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:o=!1,type:s}=r,a="indent"in t?t.indent:null;if(n&&typeof a=="number"&&(a+=2),!s)switch(t.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let l=t.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let c=za.stringifyString({type:s,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":jp(t,c);break;case'"':Li(t,c,"double-quoted-scalar");break;case"'":Li(t,c,"single-quoted-scalar");break;default:Li(t,c,"scalar")}}function jp(t,e){let r=e.indexOf(`
114
114
  `),n=e.substring(0,r),i=e.substring(r+1)+`
115
115
  `;if(t.type==="block-scalar"){let o=t.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=n,t.source=i}else{let{offset:o}=t,s="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:n}];Xa(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:s,source:`
116
- `});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:s,props:a,source:i})}}function Xa(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}function Di(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let n=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let o of n)o.offset+=i;delete t.props,Object.assign(t,{type:r,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
117
- `};delete t.items,Object.assign(t,{type:r,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(t))o!=="type"&&o!=="offset"&&delete t[o];Object.assign(t,{type:r,indent:n,source:e,end:i})}}}Lr.createScalarToken=Np;Lr.resolveAsScalar=Ap;Lr.setScalarValue=Op});var ec=g(Za=>{"use strict";var Tp=t=>"type"in t?Wr(t):qr(t);function Wr(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Wr(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=qr(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=qr(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=qr(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}function qr({start:t,key:e,sep:r,value:n}){let i="";for(let o of t)i+=o.source;if(e&&(i+=Wr(e)),r)for(let o of r)i+=o.source;return n&&(i+=Wr(n)),i}Za.stringify=Tp});var ic=g(nc=>{"use strict";var $i=Symbol("break visit"),Ip=Symbol("skip children"),tc=Symbol("remove item");function Ne(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),rc(Object.freeze([]),t,e)}Ne.BREAK=$i;Ne.SKIP=Ip;Ne.REMOVE=tc;Ne.itemAtPath=(t,e)=>{let r=t;for(let[n,i]of e){let o=r?.[n];if(o&&"items"in o)r=o.items[i];else return}return r};Ne.parentCollection=(t,e)=>{let r=Ne.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function rc(t,e,r){let n=r(e,t);if(typeof n=="symbol")return n;for(let i of["key","value"]){let o=e[i];if(o&&"items"in o){for(let s=0;s<o.items.length;++s){let a=rc(Object.freeze(t.concat([[i,s]])),o.items[s],r);if(typeof a=="number")s=a-1;else{if(a===$i)return $i;a===tc&&(o.items.splice(s,1),s-=1)}}typeof n=="function"&&i==="key"&&(n=n(e,t))}}return typeof n=="function"?n(e,t):n}nc.visit=Ne});var Dr=g(M=>{"use strict";var Mi=Qa(),jp=ec(),Lp=ic(),Bi="\uFEFF",Fi="",Ki="",Ui="",qp=t=>!!t&&"items"in t,Wp=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function Dp(t){switch(t){case Bi:return"<BOM>";case Fi:return"<DOC>";case Ki:return"<FLOW_END>";case Ui:return"<SCALAR>";default:return JSON.stringify(t)}}function $p(t){switch(t){case Bi:return"byte-order-mark";case Fi:return"doc-mode";case Ki:return"flow-error-end";case Ui:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
116
+ `});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:s,props:a,source:i})}}function Xa(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}function Li(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let n=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let o of n)o.offset+=i;delete t.props,Object.assign(t,{type:r,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
117
+ `};delete t.items,Object.assign(t,{type:r,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(t))o!=="type"&&o!=="offset"&&delete t[o];Object.assign(t,{type:r,indent:n,source:e,end:i})}}}Lr.createScalarToken=Tp;Lr.resolveAsScalar=Rp;Lr.setScalarValue=Ip});var ec=g(Za=>{"use strict";var qp=t=>"type"in t?Dr(t):Wr(t);function Dr(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Dr(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=Wr(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=Wr(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=Wr(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}function Wr({start:t,key:e,sep:r,value:n}){let i="";for(let o of t)i+=o.source;if(e&&(i+=Dr(e)),r)for(let o of r)i+=o.source;return n&&(i+=Dr(n)),i}Za.stringify=qp});var ic=g(nc=>{"use strict";var Wi=Symbol("break visit"),Lp=Symbol("skip children"),tc=Symbol("remove item");function Oe(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),rc(Object.freeze([]),t,e)}Oe.BREAK=Wi;Oe.SKIP=Lp;Oe.REMOVE=tc;Oe.itemAtPath=(t,e)=>{let r=t;for(let[n,i]of e){let o=r?.[n];if(o&&"items"in o)r=o.items[i];else return}return r};Oe.parentCollection=(t,e)=>{let r=Oe.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function rc(t,e,r){let n=r(e,t);if(typeof n=="symbol")return n;for(let i of["key","value"]){let o=e[i];if(o&&"items"in o){for(let s=0;s<o.items.length;++s){let a=rc(Object.freeze(t.concat([[i,s]])),o.items[s],r);if(typeof a=="number")s=a-1;else{if(a===Wi)return Wi;a===tc&&(o.items.splice(s,1),s-=1)}}typeof n=="function"&&i==="key"&&(n=n(e,t))}}return typeof n=="function"?n(e,t):n}nc.visit=Oe});var $r=g(M=>{"use strict";var Di=Qa(),Wp=ec(),Dp=ic(),$i="\uFEFF",Mi="",Bi="",Fi="",$p=t=>!!t&&"items"in t,Mp=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function Bp(t){switch(t){case $i:return"<BOM>";case Mi:return"<DOC>";case Bi:return"<FLOW_END>";case Fi:return"<SCALAR>";default:return JSON.stringify(t)}}function Fp(t){switch(t){case $i:return"byte-order-mark";case Mi:return"doc-mode";case Bi:return"flow-error-end";case Fi:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
118
118
  `:case`\r
119
- `: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(t[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}M.createScalarToken=Mi.createScalarToken;M.resolveAsScalar=Mi.resolveAsScalar;M.setScalarValue=Mi.setScalarValue;M.stringify=jp.stringify;M.visit=Lp.visit;M.BOM=Bi;M.DOCUMENT=Fi;M.FLOW_END=Ki;M.SCALAR=Ui;M.isCollection=qp;M.isScalar=Wp;M.prettyToken=Dp;M.tokenType=$p});var Yi=g(sc=>{"use strict";var Rt=Dr();function J(t){switch(t){case void 0:case" ":case`
120
- `:case"\r":case" ":return!0;default:return!1}}var oc=new Set("0123456789ABCDEFabcdef"),Mp=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),$r=new Set(",[]{}"),Bp=new Set(` ,[]{}
121
- \r `),Gi=t=>!t||Bp.has(t),Hi=class{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,r=!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=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===`
119
+ `: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(t[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}M.createScalarToken=Di.createScalarToken;M.resolveAsScalar=Di.resolveAsScalar;M.setScalarValue=Di.setScalarValue;M.stringify=Wp.stringify;M.visit=Dp.visit;M.BOM=$i;M.DOCUMENT=Mi;M.FLOW_END=Bi;M.SCALAR=Fi;M.isCollection=$p;M.isScalar=Mp;M.prettyToken=Bp;M.tokenType=Fp});var Gi=g(sc=>{"use strict";var Tt=$r();function J(t){switch(t){case void 0:case" ":case`
120
+ `:case"\r":case" ":return!0;default:return!1}}var oc=new Set("0123456789ABCDEFabcdef"),Kp=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Mr=new Set(",[]{}"),Up=new Set(` ,[]{}
121
+ \r `),Ki=t=>!t||Up.has(t),Ui=class{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,r=!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=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===`
122
122
  `?!0:r==="\r"?this.buffer[e+1]===`
123
123
  `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let r=this.buffer[e];if(this.indentNext>0){let n=0;for(;r===" ";)r=this.buffer[++n+e];if(r==="\r"){let i=this.buffer[n+e+1];if(i===`
124
124
  `||!i&&!this.atEnd)return e+n+1}return r===`
125
125
  `||n>=this.indentNext||!r&&!this.atEnd?e+n:-1}if(r==="-"||r==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&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(`
126
- `,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]===Rt.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let r=e.length,n=e.indexOf("#");for(;n!==-1;){let o=e[n-1];if(o===" "||o===" "){r=n-1;break}else n=e.indexOf("#",n+1)}for(;;){let o=e[r-1];if(o===" "||o===" ")r-=1;else break}let i=(yield*this.pushCount(r))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let r=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-r),yield*this.pushNewline(),"stream"}return yield Rt.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let 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");let r=this.peek(3);if((r==="---"||r==="...")&&J(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,r==="---"?"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(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&J(r)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);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(Gi),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,n=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&J(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield Rt.FLOW_END,yield*this.parseLineStart();let o=0;for(;i[o]===",";)o+=yield*this.pushCount(1),o+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(o+=yield*this.pushIndicators(),i[o]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-o),"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(Gi),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let s=this.charAt(1);if(this.flowKey||J(s)||s===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),r=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;r!==-1&&this.buffer[r+1]==="'";)r=this.buffer.indexOf("'",r+2);else for(;r!==-1;){let o=0;for(;this.buffer[r-1-o]==="\\";)o+=1;if(o%2===0)break;r=this.buffer.indexOf('"',r+1)}let n=this.buffer.substring(0,r),i=n.indexOf(`
126
+ `,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]===Tt.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let r=e.length,n=e.indexOf("#");for(;n!==-1;){let o=e[n-1];if(o===" "||o===" "){r=n-1;break}else n=e.indexOf("#",n+1)}for(;;){let o=e[r-1];if(o===" "||o===" ")r-=1;else break}let i=(yield*this.pushCount(r))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let r=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-r),yield*this.pushNewline(),"stream"}return yield Tt.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let 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");let r=this.peek(3);if((r==="---"||r==="...")&&J(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,r==="---"?"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(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&J(r)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);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(Ki),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,n=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&J(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield Tt.FLOW_END,yield*this.parseLineStart();let o=0;for(;i[o]===",";)o+=yield*this.pushCount(1),o+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(o+=yield*this.pushIndicators(),i[o]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-o),"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(Ki),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let s=this.charAt(1);if(this.flowKey||J(s)||s===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),r=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;r!==-1&&this.buffer[r+1]==="'";)r=this.buffer.indexOf("'",r+2);else for(;r!==-1;){let o=0;for(;this.buffer[r-1-o]==="\\";)o+=1;if(o%2===0)break;r=this.buffer.indexOf('"',r+1)}let n=this.buffer.substring(0,r),i=n.indexOf(`
127
127
  `,this.pos);if(i!==-1){for(;i!==-1;){let o=this.continueScalar(i+1);if(o===-1)break;i=n.indexOf(`
128
128
  `,o)}i!==-1&&(r=i-(n[i-1]==="\r"?2:1))}if(r===-1){if(!this.atEnd)return this.setNext("quoted-scalar");r=this.buffer.length}return yield*this.pushToIndex(r+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let r=this.buffer[++e];if(r==="+")this.blockScalarKeep=!0;else if(r>"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>J(r)||r==="#")}*parseBlockScalar(){let e=this.pos-1,r=0,n;e:for(let o=this.pos;n=this.buffer[o];++o)switch(n){case" ":r+=1;break;case`
129
129
  `:e=o,r=0;break;case"\r":{let s=this.buffer[o+1];if(!s&&!this.atEnd)return this.setNext("block-scalar");if(s===`
130
130
  `)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=r:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let o=this.continueScalar(e+1);if(o===-1)break;e=this.buffer.indexOf(`
131
131
  `,o)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
132
132
  `;)n=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let o=e-1,s=this.buffer[o];s==="\r"&&(s=this.buffer[--o]);let a=o;for(;s===" ";)s=this.buffer[--o];if(s===`
133
- `&&o>=this.pos&&o+1+r>a)e=o;else break}while(!0);return yield Rt.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let o=this.buffer[n+1];if(J(o)||e&&$r.has(o))break;r=n}else if(J(i)){let o=this.buffer[n+1];if(i==="\r"&&(o===`
133
+ `&&o>=this.pos&&o+1+r>a)e=o;else break}while(!0);return yield Tt.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let o=this.buffer[n+1];if(J(o)||e&&Mr.has(o))break;r=n}else if(J(i)){let o=this.buffer[n+1];if(i==="\r"&&(o===`
134
134
  `?(n+=1,i=`
135
- `,o=this.buffer[n+1]):r=n),o==="#"||e&&$r.has(o))break;if(i===`
136
- `){let s=this.continueScalar(n+1);if(s===-1)break;n=Math.max(n,s-2)}}else{if(e&&$r.has(i))break;r=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Rt.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(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(Gi),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let r=this.flowLevel>0,n=this.charAt(1);if(J(n)||r&&$r.has(n)){r?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,r=this.buffer[e];for(;!J(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(Mp.has(r))r=this.buffer[++e];else if(r==="%"&&oc.has(this.buffer[e+1])&&oc.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
135
+ `,o=this.buffer[n+1]):r=n),o==="#"||e&&Mr.has(o))break;if(i===`
136
+ `){let s=this.continueScalar(n+1);if(s===-1)break;n=Math.max(n,s-2)}}else{if(e&&Mr.has(i))break;r=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Tt.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(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(Ki),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let r=this.flowLevel>0,n=this.charAt(1);if(J(n)||r&&Mr.has(n)){r?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,r=this.buffer[e];for(;!J(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(Kp.has(r))r=this.buffer[++e];else if(r==="%"&&oc.has(this.buffer[e+1])&&oc.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
137
137
  `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
138
- `?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||e&&n===" ");let i=r-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};sc.Lexer=Hi});var Vi=g(ac=>{"use strict";var Ji=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r<n;){let o=r+n>>1;this.lineStarts[o]<e?r=o+1:n=o}if(this.lineStarts[r]===e)return{line:r+1,col:1};if(r===0)return{line:0,col:e};let i=this.lineStarts[r-1];return{line:r,col:e-i+1}}}};ac.LineCounter=Ji});var Xi=g(dc=>{"use strict";var Fp=Ut("process"),cc=Dr(),Kp=Yi();function me(t,e){for(let r=0;r<t.length;++r)if(t[r].type===e)return!0;return!1}function lc(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function fc(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Mr(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function Ge(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function Br(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let r=0;r<e.length;++r)t.push(e[r])}function uc(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!me(e.start,"explicit-key-ind")&&!me(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,fc(e.value)?e.value.end?Br(e.value.end,e.sep):e.value.end=e.sep:Br(e.start,e.sep),delete e.sep)}var zi=class{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 Kp.Lexer,this.onNewLine=e}*parse(e,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,r))yield*this.next(n);r||(yield*this.end())}*next(e){if(this.source=e,Fp.env.LOG_TOKENS&&console.log("|",cc.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=cc.tokenType(e);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){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{let n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,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(){let 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){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&uc(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=r;else{Object.assign(i,{key:r,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:r}):i.value=r;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:r,sep:[]}):i.sep?i.value=r:Object.assign(i,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let i=r.items[r.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&lc(i.start)===-1&&(r.indent===0||i.start.every(o=>o.type!=="comment"||o.indent<r.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),r.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":{let 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":{lc(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}let r=this.startBlockValue(e);r?this.stack.push(r):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"){let r=Mr(this.peek(2)),n=Ge(r),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let o={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}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 r=this.source.indexOf(`
138
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||e&&n===" ");let i=r-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};sc.Lexer=Ui});var Yi=g(ac=>{"use strict";var Hi=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r<n;){let o=r+n>>1;this.lineStarts[o]<e?r=o+1:n=o}if(this.lineStarts[r]===e)return{line:r+1,col:1};if(r===0)return{line:0,col:e};let i=this.lineStarts[r-1];return{line:r,col:e-i+1}}}};ac.LineCounter=Hi});var Vi=g(dc=>{"use strict";var Gp=Gt("process"),cc=$r(),Hp=Gi();function he(t,e){for(let r=0;r<t.length;++r)if(t[r].type===e)return!0;return!1}function lc(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function fc(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Br(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function He(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function Fr(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let r=0;r<e.length;++r)t.push(e[r])}function uc(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!he(e.start,"explicit-key-ind")&&!he(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,fc(e.value)?e.value.end?Fr(e.value.end,e.sep):e.value.end=e.sep:Fr(e.start,e.sep),delete e.sep)}var Ji=class{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 Hp.Lexer,this.onNewLine=e}*parse(e,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,r))yield*this.next(n);r||(yield*this.end())}*next(e){if(this.source=e,Gp.env.LOG_TOKENS&&console.log("|",cc.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=cc.tokenType(e);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){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{let n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,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(){let 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){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&uc(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=r;else{Object.assign(i,{key:r,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:r}):i.value=r;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:r,sep:[]}):i.sep?i.value=r:Object.assign(i,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let i=r.items[r.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&lc(i.start)===-1&&(r.indent===0||i.start.every(o=>o.type!=="comment"||o.indent<r.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),r.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":{let 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":{lc(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}let r=this.startBlockValue(e);r?this.stack.push(r):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"){let r=Br(this.peek(2)),n=He(r),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let o={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}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 r=this.source.indexOf(`
139
139
  `)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
140
- `,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Br(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",o=[];if(i&&r.sep&&!r.value){let s=[];for(let a=0;a<r.sep.length;++a){let c=r.sep[a];switch(c.type){case"newline":s.push(a);break;case"space":break;case"comment":c.indent>e.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(o=r.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":i||r.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):i||r.value?(o.push(this.sourceToken),e.items.push({start:o,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(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(me(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(fc(r.key)&&!me(r.sep,"newline")){let s=Ge(r.start),a=r.key,c=r.sep;c.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:a,sep:c}]})}else o.length>0?r.sep=r.sep.concat(o,this.sourceToken):r.sep.push(this.sourceToken);else if(me(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let s=Ge(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||i?e.items.push({start:o,key:null,sep:[this.sourceToken]}):me(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);i||r.value?(e.items.push({start:o,key:s,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(s):(Object.assign(r,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(e);if(s){if(s.type==="block-seq"){if(!r.explicitKey&&r.sep&&!me(r.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 n&&e.items.push({start:o});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Br(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||me(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:i,sep:[]}):r.sep?this.stack.push(i):Object.assign(r,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=Mr(n),o=Ge(i);uc(e);let s=e.end.splice(1,e.end.length);s.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:o,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(`
140
+ `,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Fr(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",o=[];if(i&&r.sep&&!r.value){let s=[];for(let a=0;a<r.sep.length;++a){let c=r.sep[a];switch(c.type){case"newline":s.push(a);break;case"space":break;case"comment":c.indent>e.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(o=r.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":i||r.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):i||r.value?(o.push(this.sourceToken),e.items.push({start:o,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(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(he(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(fc(r.key)&&!he(r.sep,"newline")){let s=He(r.start),a=r.key,c=r.sep;c.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:a,sep:c}]})}else o.length>0?r.sep=r.sep.concat(o,this.sourceToken):r.sep.push(this.sourceToken);else if(he(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let s=He(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||i?e.items.push({start:o,key:null,sep:[this.sourceToken]}):he(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);i||r.value?(e.items.push({start:o,key:s,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(s):(Object.assign(r,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(e);if(s){if(s.type==="block-seq"){if(!r.explicitKey&&r.sep&&!he(r.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 n&&e.items.push({start:o});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Fr(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||he(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:i,sep:[]}):r.sep?this.stack.push(i):Object.assign(r,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=Br(n),o=He(i);uc(e);let s=e.end.splice(1,e.end.length);s.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:o,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(`
141
141
  `)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
142
- `,r)+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;let r=Mr(e),n=Ge(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=Mr(e),n=Ge(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.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())}}};dc.Parser=zi});var wc=g(It=>{"use strict";var pc=Wi(),Up=Et(),Tt=xt(),Gp=Ln(),Hp=P(),Yp=Vi(),hc=Xi();function mc(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Yp.LineCounter||null,prettyErrors:e}}function Jp(t,e={}){let{lineCounter:r,prettyErrors:n}=mc(e),i=new hc.Parser(r?.addNewLine),o=new pc.Composer(e),s=Array.from(o.compose(i.parse(t)));if(n&&r)for(let a of s)a.errors.forEach(Tt.prettifyError(t,r)),a.warnings.forEach(Tt.prettifyError(t,r));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function gc(t,e={}){let{lineCounter:r,prettyErrors:n}=mc(e),i=new hc.Parser(r?.addNewLine),o=new pc.Composer(e),s=null;for(let a of o.compose(i.parse(t),!0,t.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new Tt.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(s.errors.forEach(Tt.prettifyError(t,r)),s.warnings.forEach(Tt.prettifyError(t,r))),s}function Vp(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=gc(t,r);if(!i)return null;if(i.warnings.forEach(o=>Gp.warn(i.options.logLevel,o)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},r))}function zp(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=r??e??{};if(!i)return}return Hp.isDocument(t)&&!n?t.toString(r):new Up.Document(t,n,r).toString(r)}It.parse=Vp;It.parseAllDocuments=Jp;It.parseDocument=gc;It.stringify=zp});var He=g(_=>{"use strict";var Xp=Wi(),Qp=Et(),Zp=wi(),Qi=xt(),eh=ct(),ge=P(),th=fe(),rh=A(),nh=pe(),ih=he(),oh=Dr(),sh=Yi(),ah=Vi(),ch=Xi(),Fr=wc(),yc=it();_.Composer=Xp.Composer;_.Document=Qp.Document;_.Schema=Zp.Schema;_.YAMLError=Qi.YAMLError;_.YAMLParseError=Qi.YAMLParseError;_.YAMLWarning=Qi.YAMLWarning;_.Alias=eh.Alias;_.isAlias=ge.isAlias;_.isCollection=ge.isCollection;_.isDocument=ge.isDocument;_.isMap=ge.isMap;_.isNode=ge.isNode;_.isPair=ge.isPair;_.isScalar=ge.isScalar;_.isSeq=ge.isSeq;_.Pair=th.Pair;_.Scalar=rh.Scalar;_.YAMLMap=nh.YAMLMap;_.YAMLSeq=ih.YAMLSeq;_.CST=oh;_.Lexer=sh.Lexer;_.LineCounter=ah.LineCounter;_.Parser=ch.Parser;_.parse=Fr.parse;_.parseAllDocuments=Fr.parseAllDocuments;_.parseDocument=Fr.parseDocument;_.stringify=Fr.stringify;_.visit=yc.visit;_.visitAsync=yc.visitAsync});import Kr from"path";function ph(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let r=t.trim();if(r.length===0||Kr.posix.isAbsolute(r)||Kr.win32.isAbsolute(r)||/^(?:~|[\\/])/u.test(r))throw new Error(`${e} must be a project-relative path`);if(r===".")return[];let n=r.replaceAll("\\","/").split("/");if(n.some(i=>i===".."))throw new Error(`${e} must stay inside the project root`);if(n.some(i=>i===""||i==="."))throw new Error(`${e} must not contain empty or dot path segments`);return n}function Ur(t){let e=ph(t,"native.artifact_root");return e.length===0?".":e.join("/")}function vc(t,e="docs"){let r=t??e;if(r!=="legacy"&&r!=="docs")throw new Error("classic.artifact_layout must be legacy or docs");return r}function Je(t,e,r=!1){if(typeof t!="string")throw new Error(`${e} must be a string`);let n=t.trim().replaceAll("\\","/");if(n.length===0||Kr.posix.isAbsolute(n)||Kr.win32.isAbsolute(n)||/^(?:~|[\\/])/u.test(n))throw new Error(`${e} must be relative to its declared path base`);let i=n.split("/");if(i.some(o=>o===".."))throw new Error(`${e} must stay inside its declared path base`);if(i.some(o=>o===""||o==="."))throw new Error(`${e} must not contain empty or dot path segments`);if(!r&&/[*?]/u.test(n))throw new Error(`${e} cannot contain wildcards`);return i.join("/")}function Ye(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function kc(t,e,r){let n=t??e;if(n!=="en"&&n!=="zh-CN")throw new Error(`${r} must be en or zh-CN`);return n}function Sc(t,e){if(typeof t!="string"||t.length===0||t.includes("\\")||t.includes("\0")||t.startsWith("/")||t.split("/").includes(".."))throw new Error(`${e} contains an unsafe pattern`);if(t.length>eo)throw new Error(`${e} exceeds ${eo} characters`);let r=0;for(let n=0;n<t.length;n+=1)t[n]==="?"?r+=1:t[n]==="*"&&(r+=1,t[n+1]==="*"&&(n+=1));if(r>to)throw new Error(`${e} contains more than ${to} wildcard tokens`);return t}function bc(t,e,r){if(t===void 0)return[...r];if(!Array.isArray(t))throw new Error(`${e} contains an unsafe pattern`);return[...new Set(t.map(n=>Sc(n,e)))].sort((n,i)=>n.localeCompare(i,"en"))}function Zi(t,e,r){let n=t??e;if(!Number.isSafeInteger(n)||n<1)throw new Error(`${r} must be a positive integer`);return n}function hh(t){if(t===void 0)return{...ne,include:[...ne.include],exclude:[...ne.exclude]};let e=Ye(t,"native.snapshot");return{include:bc(e.include,"native.snapshot.include",ne.include),exclude:bc(e.exclude,"native.snapshot.exclude",ne.exclude),max_files:Zi(e.max_files,ne.max_files,"native.snapshot.max_files"),max_total_bytes:Zi(e.max_total_bytes,ne.max_total_bytes,"native.snapshot.max_total_bytes"),max_duration_ms:Zi(e.max_duration_ms,ne.max_duration_ms,"native.snapshot.max_duration_ms")}}function mh(t){if(t===void 0)return;let e=Ye(t,"native.pending_root_move"),r=e.id,n=e.from_artifact_root,i=e.to_artifact_root,o=e.stage;if(typeof r!="string"||!/^[a-f0-9-]{8,}$/u.test(r))throw new Error("native.pending_root_move.id is invalid");if(typeof n!="string"||typeof i!="string")throw new Error("native.pending_root_move roots must be strings");if(o!=="copying"&&o!=="ready"&&o!=="switched")throw new Error("native.pending_root_move.stage is invalid");let s;if(e.cleanup!==void 0){let a=Ye(e.cleanup,"native.pending_root_move.cleanup"),c=a.kind,l=a.state,u=a.manifest_hash;if(c!=="forward-source"&&c!=="restart-staging"&&c!=="rollback-destination"&&c!=="rollback-staging")throw new Error("native.pending_root_move.cleanup.kind is invalid");if(l!=="prepared"&&l!=="quarantined"&&l!=="deleting")throw new Error("native.pending_root_move.cleanup.state is invalid");if(typeof u!="string"||!/^[a-f0-9]{64}$/u.test(u))throw new Error("native.pending_root_move.cleanup.manifest_hash is invalid");s={kind:c,state:l,manifestHash:u}}return{id:r,fromArtifactRoot:Ur(n),toArtifactRoot:Ur(i),stage:o,...s?{cleanup:s}:{}}}function gh(t,e={}){let r=Ye(t,"native"),n=r.artifact_root??(e.allowMissingArtifactRoot?"docs":void 0);if(typeof n!="string")throw new Error("native.artifact_root must be a string");let i=r.clarification_mode??"batch";if(i!=="sequential"&&i!=="batch")throw new Error("native.clarification_mode must be sequential or batch");let o=r.archive_confirmation??"automatic";if(o!=="automatic"&&o!=="required")throw new Error("native.archive_confirmation must be automatic or required");let s=r.max_verify_failures??lh;if(!Number.isSafeInteger(s)||s<1)throw new Error("native.max_verify_failures must be a positive integer");let a=mh(r.pending_root_move);return{artifact_root:Ur(n),language:kc(r.language,"en","native.language"),clarification_mode:i,archive_confirmation:o,max_verify_failures:s,snapshot:hh(r.snapshot),...a?{pending_root_move:a}:{}}}function wh(t){let e=Ye(t,"classic"),r=e.context_compression??"off";if(r!=="off"&&r!=="beta")throw new Error("classic.context_compression must be off or beta");let n=e.review_mode??"standard";if(n!=="off"&&n!=="standard"&&n!=="thorough")throw new Error("classic.review_mode must be off, standard, or thorough");let i=e.auto_transition??!0;if(typeof i!="boolean")throw new Error("classic.auto_transition must be true or false");return{artifact_layout:vc(e.artifact_layout),language:kc(e.language,"zh-CN","classic.language"),context_compression:r,review_mode:n,auto_transition:i}}function yh(t){let r=Ye(t,"hook").allow_paths??[];if(!Array.isArray(r))throw new Error("hook.allow_paths must be an array");return{allow_paths:[...new Set(r.map((n,i)=>Je(n,`hook.allow_paths[${i}]`)))]}}function bh(t){let e=t??!0;if(typeof e!="boolean")throw new Error("ambient_resume must be true or false");return e}function vh(t,e,r,n,i,o){let s=t.schema!==void 0;if(!(s||t.default_workflow!==void 0||t.workflows!==void 0||!o.allowPartialProject&&t.native!==void 0)||o.allowPartialProject&&!s)return null;if(t.schema!=="comet.project.v1")throw new Error("Unsupported Comet project schema");if(t.default_workflow!=="native"&&t.default_workflow!=="classic")throw new Error("default_workflow must be native or classic");let c=t.workflows??[t.default_workflow];if(!Array.isArray(c)||c.length===0||c.some(u=>u!=="native"&&u!=="classic"))throw new Error("workflows must contain native and/or classic");let l=[...new Set(c)];if(!l.includes(t.default_workflow))throw new Error("workflows must include default_workflow");if(l.includes("native")&&!r)throw new Error("native must be a mapping");return{schema:"comet.project.v1",default_workflow:t.default_workflow,workflows:l,ambient_resume:i,...e?{hook:e}:{},...r?{native:r}:{},...n?{classic:n}:{}}}function Ve(t,e={}){let r=(0,ro.parseDocument)(t,{uniqueKeys:!0});if(r.errors.length>0)throw new Error(`Invalid .comet/config.yaml: ${r.errors[0].message}`);let n=r.toJS();if(n==null)return{value:{},config:null,ambient_resume:!0};if(typeof n!="object"||Array.isArray(n))throw new Error("Invalid .comet/config.yaml: root must be a mapping");let i=n,o=bh(i.ambient_resume),s=i.hook===void 0?void 0:yh(i.hook),a=i.native===void 0?void 0:gh(i.native,{allowMissingArtifactRoot:e.allowMissingNativeFields}),c=i.classic===void 0?void 0:wh(i.classic),l=vh(i,s,a,c,o,{allowPartialProject:e.allowPartialProject??!1});return{value:i,config:l,ambient_resume:o,...s?{hook:s}:{},...a?{native:a}:{},...c?{classic:c}:{}}}var ro,jt,eo,to,lh,uh,fh,dh,ne,we=T(()=>{"use strict";ro=rt(He(),1),jt=64*1024,eo=1024,to=64,lh=5,uh=[".agents/skills/**",".amazonq/skills/**",".augment/skills/**",".bob/skills/**",".claude/skills/**",".cline/skills/**",".codebuddy/skills/**",".workbuddy/skills/**",".continue/skills/**",".cospec/skills/**",".crush/skills/**",".cursor/skills/**",".factory/skills/**",".forge/skills/**",".gemini/skills/**",".github/skills/**",".iflow/skills/**",".junie/skills/**",".kilocode/skills/**",".kimi-code/skills/**",".kiro/skills/**",".lingma/skills/**",".mimocode/skills/**",".opencode/skills/**",".pi/skills/**",".qoder/skills/**",".qwen/skills/**",".roo/skills/**",".trae-cn/skills/**",".trae/skills/**",".windsurf/skills/**",".zcode/skills/**"],fh=["**/.idea/**","**/.vscode/**",".codex/skills/**","**/node_modules/**","**/.next/**","**/.nuxt/**","**/.output/**","**/.svelte-kit/**","**/.vite/**","**/.parcel-cache/**","**/.turbo/**","**/.nx/cache/**","**/dist/**","**/build/**","**/out/**","**/coverage/**","**/.nyc_output/**","**/target/**","**/.gradle/**","**/.cxx/**","**/.externalNativeBuild/**","**/captures/**","**/__pycache__/**","**/.pytest_cache/**","**/.mypy_cache/**","**/.ruff_cache/**","**/.tox/**","**/.nox/**","**/.venv/**","**/venv/**","**/obj/**","**/CMakeFiles/**","**/cmake-build-*/**","**/.cache/**","**/tmp/**","**/temp/**","**/logs/**","**/*.tsbuildinfo","**/*.log","**/.DS_Store","**/Thumbs.db"],dh=[...uh,...fh].sort((t,e)=>t.localeCompare(e,"en")),ne={include:["**/*"],exclude:[...dh],max_files:1e4,max_total_bytes:256*1024*1024,max_duration_ms:6e4}});function ye(t){return t!==0&&t!==0n&&t!=="0"}function Gr(t,e){return ye(t.dev)&&ye(e.dev)&&ye(t.ino)&&ye(e.ino)}function ie(t,e){let r=ye(t.dev)&&ye(e.dev);if(r&&t.dev!==e.dev)return!1;let n=ye(t.ino)&&ye(e.ino);return n&&t.ino!==e.ino?!1:r&&n?!0:t.birthtime===e.birthtime}var Hr=T(()=>{"use strict"});import{constants as Yr,promises as Oe}from"fs";function no(t){return"birthtimeNs"in t&&typeof t.birthtimeNs=="bigint"?t.birthtimeNs:t.birthtimeMs}function Cc(t){return"ctimeNs"in t&&typeof t.ctimeNs=="bigint"?t.ctimeNs:t.ctimeMs}function Lt(t){return{dev:t.dev,ino:t.ino,birthtime:no(t)}}function Jr(t,e){let r=Lt(t),n=Lt(e);return Gr(r,n)?ie(r,n):ie(r,n)&&no(t)===no(e)&&Cc(t)===Cc(e)&&t.size===e.size}async function Vr(t,e,r={}){if(!Number.isSafeInteger(e)||e<1)throw new Error("race-safe read byte limit must be a positive integer");let n=r.label??"file",i=r.bigint===!0,o=await Oe.lstat(t,{bigint:i});if(!o.isFile()||o.isSymbolicLink())throw new be("not-regular-file",`${n} must be a regular file`);if(BigInt(o.size)>BigInt(e))throw new be("too-large",`${n} exceeds ${e} bytes`);let s=await Oe.realpath(t);await r.verify?.("pre-open",{realPath:s,identity:Lt(o)});let a=process.platform==="win32"?Yr.O_RDONLY:Yr.O_RDONLY|Yr.O_NOFOLLOW|Yr.O_NONBLOCK,c;try{c=await Oe.open(t,a)}catch(l){throw l.code==="ELOOP"?new be("not-regular-file",`${n} must be a regular file`,{cause:l}):l}try{let[l,u,f]=await Promise.all([c.stat({bigint:i}),Oe.lstat(t,{bigint:i}),Oe.realpath(t)]);if(!l.isFile()||!u.isFile()||u.isSymbolicLink()||f!==s||!Jr(o,l)||!Jr(o,u))throw new be("changed",`${n} changed while opening`);await r.verify?.("post-open",{realPath:f,identity:Lt(l)}),await r.hooks?.afterOpen?.();let d=[],m=0,w=Buffer.allocUnsafe(Math.min(64*1024,e+1));for(;;){let v=e+1-m,{bytesRead:k}=await c.read(w,0,Math.min(w.length,v),null);if(k===0)break;if(m+=k,m>e)throw new be("too-large",`${n} exceeds ${e} bytes`);d.push(Buffer.from(w.subarray(0,k)))}await r.hooks?.beforeFinalCheck?.();let[p,h,y]=await Promise.all([c.stat({bigint:i}),Oe.lstat(t,{bigint:i}),Oe.realpath(t)]);if(!h.isFile()||h.isSymbolicLink()||y!==s||!Jr(o,p)||!Jr(o,h))throw new be("changed",`${n} changed while reading`);return await r.verify?.("post-read",{realPath:y,identity:Lt(p)}),{bytes:Buffer.concat(d,m),stat:p,realPath:y}}finally{await c.close()}}var be,io=T(()=>{"use strict";Hr();be=class extends Error{reason;constructor(e,r,n){super(r,n),this.name="RaceSafeReadError",this.reason=e}}});import{promises as zr}from"fs";import ve from"path";function kh(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}function oo(t,e){let r=ve.relative(t,e);return r===""||!ve.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${ve.sep}`)}async function Ec(t,e){let r=ve.resolve(t),n=await zr.lstat(r);if(!n.isDirectory()||n.isSymbolicLink())throw new Error(`${e} project root must be a real directory`);return zr.realpath(r)}async function Pc(t,e,r,n){let i=t;for(let o=0;o<r.length;o++){i=ve.join(i,r[o]);let s;try{s=await zr.lstat(i)}catch(u){if(kh(u))return{exists:!1,kind:"missing"};throw u}let a=ve.relative(t,i).replaceAll("\\","/");if(s.isSymbolicLink())throw new Error(`${n.label} crosses a symbolic link or junction at ${a}`);let c=o===r.length-1;if(!c&&!s.isDirectory())throw new Error(`${n.label} ancestor ${a} must be a real directory`);if(c&&(n.expected==="file"&&!s.isFile()||n.expected==="directory"&&!s.isDirectory()||n.expected==="any"&&!s.isFile()&&!s.isDirectory()))throw new Error(`${n.label} must be a real ${n.expected}`);let l=await zr.realpath(i);if(!oo(e,l))throw new Error(`${n.label} resolves outside the project root`);if(c)return{exists:!0,kind:s.isFile()?"file":s.isDirectory()?"directory":"missing"}}return{exists:!0,kind:"directory"}}async function B(t,e,r){let n=Je(e,r.label),i=ve.resolve(t),o=await Ec(i,r.label),s=n.split("/"),a=ve.resolve(i,...s);if(!oo(i,a))throw new Error(`${r.label} must stay inside the project root`);let c=await Pc(i,o,s,r);return{projectRoot:i,target:a,relative:n,exists:c.exists,kind:c.kind}}async function H(t,e,r,n){let i=await B(t,e,{label:n.label,expected:"file"});if(!i.exists){let s=new Error(`${n.label} does not exist`);throw s.code="ENOENT",s}let o=await Ec(i.projectRoot,n.label);return Vr(i.target,r,{...n,verify:async(s,a)=>{if(!oo(o,a.realPath))throw new Error(`${n.label} resolves outside the project root`);await Pc(i.projectRoot,o,i.relative.split("/"),{label:n.label,expected:"file"})}})}var Z=T(()=>{"use strict";io();we()});import{createHash as Sh}from"crypto";function Ch(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function Xr(t,e={}){return(await Qr(t,e)).document}async function Eh(t){try{return(await H(t,qt,jt,{label:qt})).bytes}catch(e){if(Ch(e))return null;throw e}}function Ph(t){return t?{exists:!0,sha256:Sh("sha256").update(t).digest("hex")}:{exists:!1,sha256:null}}async function Qr(t,e={}){let r=await Eh(t);return{document:r?Ve(r.toString("utf8"),e):null,identity:Ph(r)}}async function so(t){return(await Xr(t))?.config??null}var qt,ze=T(()=>{"use strict";we();Z();qt=".comet/config.yaml"});import{randomUUID as _h}from"crypto";import{constants as xh,promises as N}from"fs";import L from"path";async function ao(t,e){try{return await N.link(t,e),{linked:!0}}catch(r){let n=r.code;if(n!=="ENOTSUP"&&n!=="EOPNOTSUPP")throw r}return await N.copyFile(t,e,xh.COPYFILE_EXCL),{linked:!1}}function Xe(t,e){let r=L.relative(t,e);return r===""||!L.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${L.sep}`)}function en(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function Ah(t,e){return ie(t,en(e))}function Zr(t,e){let r=en(t),n=en(e);return Gr(r,n)?ie(r,n):ie(r,n)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.size===e.size}async function tn(t){let e=await N.lstat(t);if(!e.isDirectory()||e.isSymbolicLink())throw new Error(`Contained atomic write parent must be a real directory: ${t}`);return{path:t,realPath:await N.realpath(t),...en(e)}}async function ke(t){for(let e of t){let r=await N.lstat(e.path);if(!r.isDirectory()||r.isSymbolicLink()||!Ah(e,r)||await N.realpath(e.path)!==e.realPath)throw new Error(`Contained atomic write parent changed before commit: ${e.path}`)}}async function Nh(t,e){let r=L.resolve(t),n=L.resolve(e);if(!Xe(r,n))throw new Error(`Contained atomic write parent is outside its managed root: ${e}`);let i=[await tn(r)],o=L.relative(r,n).split(L.sep).filter(Boolean),s=r;for(let a of o){await ke(i),s=L.join(s,a);try{await N.mkdir(s)}catch(l){if(l.code!=="EEXIST")throw l}let c=await tn(s);if(!Xe(i[0].realPath,c.realPath))throw new Error(`Contained atomic write parent resolves outside its managed root: ${s}`);i.push(c)}return await ke(i),i}async function Oh(t,e){let r=L.resolve(t),n=L.resolve(e);if(!Xe(r,n))throw new Error(`Contained file parent is outside its managed root: ${e}`);let i=[await tn(r)],o=L.relative(r,n).split(L.sep).filter(Boolean),s=r;for(let a of o){s=L.join(s,a);try{let c=await tn(s);if(!Xe(i[0].realPath,c.realPath))throw new Error(`Contained file parent resolves outside its managed root: ${s}`);i.push(c)}catch(c){if(c.code==="ENOENT")return null;throw c}}return await ke(i),i}async function _c(t){let e;try{e=await N.open(t,"r"),await e.sync()}catch(r){let n=r.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(n??""))throw r}finally{await e?.close()}}async function Rh(t,e,r){let n=L.dirname(t),i=await Nh(r.containedRoot,n),o=L.join(n,`.${L.basename(t)}.${_h()}.tmp`),s,a;try{await r.beforeTemporaryOpen?.(),s=await N.open(o,"wx"),a=await s.stat();let[c,l]=await Promise.all([N.lstat(o),N.realpath(o)]);if(await ke(i),!c.isFile()||c.isSymbolicLink()||!Zr(a,c)||!Xe(i[0].realPath,l))throw new Error("Contained atomic write temporary file opened outside its managed parent");if(typeof e=="string"?await s.writeFile(e,"utf8"):await s.writeFile(e),await s.sync(),!Zr(a,await s.stat()))throw new Error("Contained atomic write temporary file changed while writing");await s.close(),s=void 0,await r.beforeCommit?.(),await ke(i);let u=await N.lstat(o);if(!u.isFile()||u.isSymbolicLink()||!Zr(u,a))throw new Error("Contained atomic write temporary file changed before commit");r.exclusive?(await ao(o,t),await N.unlink(o)):await N.rename(o,t),await _c(n)}catch(c){await s?.close();try{await ke(i),await N.rm(o,{force:!0})}catch{}throw c}}async function ee(t,e,r){await Rh(t,e,r)}async function co(t,e){let r=L.dirname(t),n=await Oh(e.containedRoot,r);if(!n)return!1;let i,o;try{i=await N.lstat(t),o=await N.realpath(t)}catch(c){if(c.code==="ENOENT")return!1;throw c}if(!i.isFile()||i.isSymbolicLink()||!Xe(n[0].realPath,o))throw new Error("Contained file removal target must be a regular file inside its managed root");await e.beforeRemove?.(),await ke(n);let[s,a]=await Promise.all([N.lstat(t),N.realpath(t)]);if(!s.isFile()||s.isSymbolicLink()||!Zr(i,s)||a!==o)throw new Error("Contained file removal target changed before removal");return await N.unlink(t),await ke(n),await _c(r),!0}var Se=T(()=>{"use strict";Hr()});var ly,lo=T(()=>{"use strict";Se();ze();Z();ly=16*1024});var fo=T(()=>{"use strict";Se();we();ze();Z();lo()});import W from"path";function Lc(t,e){let r=W.relative(t,e);return r===""||!W.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${W.sep}`)}function zh(t,e){let r=W.isAbsolute(e)?W.resolve(e):W.resolve(t,e),n=W.relative(W.resolve(t),r);return n===""||W.isAbsolute(n)||n===".."||n.startsWith(`..${W.sep}`)?null:n.replaceAll("\\","/")}function qc(t){return process.platform==="win32"?t.toLowerCase():t}async function go(t,e,r=[]){let n=W.isAbsolute(e)?W.resolve(e):W.resolve(t,e),i=W.resolve(t);if(!Lc(i,n)||r.some(c=>Lc(W.resolve(c),n)))return null;let o=zh(t,e);if(!o)return null;let a=(await Vh(t)).allow_paths.find(c=>{let l=qc(o),u=qc(c);return l===u||l.startsWith(`${u}/`)});return a?`${o} (configured Hook allow path: ${a})`:null}var Vh,wo=T(()=>{"use strict";nt();ze();Vh=Ce("hookWritePolicy",async t=>(await so(t))?.hook??{allow_paths:[]})});var an=T(()=>{"use strict"});var Kc=T(()=>{"use strict"});var vo=T(()=>{"use strict";an()});var Uc=T(()=>{"use strict";an();vo()});var gm,Gc=T(()=>{"use strict";gm=rt(He(),1);Se();we();Z()});var db,Hc=T(()=>{"use strict";Se();Z();db=4*1024*1024});var Yc=T(()=>{"use strict";an();Se();Kc();Uc();we();Gc();Z();ze();fo();Hc();wo();lo();vo()});import{TextDecoder as wm}from"util";function Jc(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function ym(t,e){try{return new wm("utf-8",{fatal:!0}).decode(t.bytes)}catch(r){throw new Error(`${e} is not valid UTF-8`,{cause:r})}}async function ko(t,e,r,n,i={}){try{let o=await H(t,e,r,{label:n,hooks:i.hooks});return{result:o,text:ym(o,n)}}catch(o){let s=o.code;if(s==="ENOENT"||s==="ENOTDIR")return null;throw o}}async function Vc(t,e,r,n,i={}){return(await ko(t,e,r,n,i))?.text??null}async function zc(t,e,r,n,i,o={}){if(Buffer.byteLength(r,"utf8")>n)throw new Error(`${i} exceeds ${n} bytes`);let s=await ko(t,e,n,i),a=await B(t,e,{label:i,expected:"file"});await ee(a.target,r,{containedRoot:a.projectRoot,beforeCommit:async()=>{await o.beforeCommit?.();let c=await ko(t,e,n,i);if(!(!s&&!c)){if(!s||!c)throw new Error(`${i} changed before commit`);if(s.result.realPath!==c.result.realPath||!ie(Jc(s.result.stat),Jc(c.result.stat))||s.text!==c.text)throw new Error(`${i} changed before commit`)}}})}async function Xc(t,e,r,n={}){let i=await B(t,e,{label:r,expected:"file"});return i.exists?co(i.target,{containedRoot:i.projectRoot,beforeRemove:n.beforeRemove}):!1}var Qc=T(()=>{"use strict";Yc();Hr()});var nl={};Rl(nl,{RUN_STATE_FILE:()=>ln,applyRunStateToDocument:()=>el,readRunState:()=>So,removeRunState:()=>rl,runStateFromDocument:()=>cn,writeRunState:()=>Co});import bm from"path";function Mt(t,e){let r=t[e];if(typeof r!="string"||r.length===0)throw new Error(`Invalid Run state: ${e} must be a non-empty string`);return r}function $t(t,e){let r=Mt(t,e);if(bm.isAbsolute(r)||/^(?:[A-Za-z]:|[\\/]|~)/u.test(r)||r.split(/[\\/]/u).includes(".."))throw new Error(`Invalid Run state: ${e} must stay inside the change directory`);return r}function vm(t){let e=t.run_retries??"{}",r;try{r=typeof e=="string"?JSON.parse(e):e}catch(n){throw new Error("Invalid Run state: run_retries must be a JSON object",{cause:n})}if(!r||typeof r!="object"||Array.isArray(r))throw new Error("Invalid Run state: run_retries must be a JSON object");for(let n of Object.values(r))if(!Number.isInteger(n)||Number(n)<0)throw new Error("Invalid Run state: retry counts must be non-negative integers");return r}function cn(t){if(!t.run_id)return null;let e=Mt(t,"run_id"),r=Mt(t,"skill"),n=Mt(t,"skill_version"),i=Mt(t,"skill_hash"),o=$t(t,"pending_ref"),s=$t(t,"trajectory_ref"),a=$t(t,"context_ref"),c=$t(t,"artifacts_ref"),l=$t(t,"checkpoint_ref"),u=Number(t.iteration);if(!Number.isInteger(u)||u<0)throw new Error("Invalid Run state: iteration must be a non-negative integer");if(t.orchestration!=="deterministic"&&t.orchestration!=="adaptive")throw new Error("Invalid Run state: orchestration must be deterministic or adaptive");if(t.run_status!=="running"&&t.run_status!=="waiting"&&t.run_status!=="completed"&&t.run_status!=="failed")throw new Error("Invalid Run state: run_status is invalid");return{runId:e,skill:r,skillVersion:n,skillHash:i,orchestration:t.orchestration,currentStep:Zc(t,"current_step"),iteration:u,pending:Zc(t,"pending"),pendingRef:o,trajectoryRef:s,contextRef:a,artifactsRef:c,checkpointRef:l,status:t.run_status,retries:vm(t)}}function el(t,e){e?t.run_id=e.runId:delete t.run_id}function km(t){return{runId:t.runId,skill:t.skill,skillVersion:t.skillVersion,skillHash:t.skillHash,orchestration:t.orchestration,currentStep:t.currentStep,iteration:t.iteration,pending:t.pending,pendingRef:t.pendingRef,trajectoryRef:t.trajectoryRef,contextRef:t.contextRef,artifactsRef:t.artifactsRef,checkpointRef:t.checkpointRef,status:t.status,retries:t.retries}}function Sm(t){let e={run_id:t.runId,skill:t.skill,skill_version:t.skillVersion,skill_hash:t.skillHash,orchestration:t.orchestration,current_step:t.currentStep,iteration:t.iteration,pending:t.pending,pending_ref:t.pendingRef,trajectory_ref:t.trajectoryRef,context_ref:t.contextRef,artifacts_ref:t.artifactsRef,checkpoint_ref:t.checkpointRef,run_status:t.status,run_retries:JSON.stringify(t.retries)};return cn(e)}async function So(t,e={}){let r=await Vc(t,ln,tl,"Run state",e);if(r===null)return null;let n=JSON.parse(r);return Sm(n)}async function Co(t,e,r={}){await zc(t,ln,JSON.stringify(km(e),null,2),tl,"Run state",r)}async function rl(t,e={}){await Xc(t,ln,"Run state",e)}var Zc,ln,tl,un=T(()=>{"use strict";Qc();Zc=(t,e)=>{let r=t[e];return r==null?null:String(r)};ln=".comet/run-state.json",tl=256*1024});nt();import{promises as mn,readFileSync as Ym}from"fs";import K from"path";import{promises as qh}from"fs";import F from"path";import{promises as Il}from"fs";async function yn(t){try{return await Il.access(t),!0}catch(e){if(jl(e))return!1;throw e}}function jl(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}we();ze();fo();Z();var Qe=class extends Error{code="classic-layout-unavailable";constructor(e="Classic artifact layout is unavailable from .comet/config.yaml"){super(e),this.name="ClassicLayoutUnavailableError"}},Nc=".comet/config.yaml";function Wh(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function Dh(t){await B(t,Nc,{label:Nc,expected:"file"})}function Oc(t,e){let r=F.resolve(t),n=e==="docs"?F.join(r,"docs"):r,i=F.join(n,"openspec"),o=F.join(r,"docs","superpowers");return{projectRoot:r,artifactLayout:e,openSpecBase:n,openSpecRoot:i,changesDir:F.join(i,"changes"),archiveDir:F.join(i,"changes","archive"),specsDir:F.join(i,"specs"),superpowersRoot:o,superpowersSpecsDir:F.join(o,"specs"),superpowersPlansDir:F.join(o,"plans"),superpowersReportsDir:F.join(o,"reports")}}async function $h(t){await Dh(t);let e=await Xr(t,{allowPartialProject:!0,allowMissingNativeFields:!0});if(!e?.config)throw new Qe;if(!(e.config.workflows??[e.config.default_workflow]).includes("classic"))throw new Qe("Classic artifact layout is unavailable because Classic is not enabled");return e.classic?.artifact_layout??"legacy"}async function Mh(t,e){return Oc(t,e??await $h(t))}async function Bh(t){try{return await qh.lstat(t),!0}catch(e){if(Wh(e))return!1;throw e}}async function Fh(t,e){let r=await Mh(t,e),n=r.artifactLayout==="legacy"?"docs":"legacy",i=Oc(t,n).openSpecRoot,[o,s]=await Promise.all([B(r.projectRoot,q(r.projectRoot,r.openSpecRoot),{label:"Configured Classic OpenSpec root",expected:"directory"}),Bh(i)]),a=o.exists;return{paths:r,configuredRootExists:a,alternateRoot:i,alternateRootExists:s,dualRoots:a&&s}}async function Kh(t){let e=[t.openSpecRoot,t.changesDir,t.archiveDir,t.specsDir,t.superpowersRoot,t.superpowersSpecsDir,t.superpowersPlansDir,t.superpowersReportsDir];for(let r of e){let n=q(t.projectRoot,r);await B(t.projectRoot,n,{label:`Classic managed physical path ${n}`,expected:"directory"})}}async function Re(t,e){let r=await Fh(t,e);if(await Kh(r.paths),!r.configuredRootExists){let n=q(r.paths.projectRoot,r.paths.openSpecRoot),i=q(r.paths.projectRoot,r.alternateRoot);throw new Qe(`Configured Classic OpenSpec root is missing: ${n} (alternate ${i} is ${r.alternateRootExists?"present":"missing"})`)}return r.paths}async function po(t,e){let r=F.join(F.resolve(t),".comet","classic-root-move.json");if(await yn(r))throw new Error("Classic root move transaction is incomplete; inspect it with comet doctor and recover it explicitly before writing");let n=await Re(t,e);if(!await yn(n.openSpecRoot))throw new Error(`Configured Classic OpenSpec root is missing: ${q(n.projectRoot,n.openSpecRoot)}`);return n}function q(t,e){return F.relative(F.resolve(t),e).replaceAll("\\","/")}import Tc from"path";Se();we();Z();import Wt from"path";var Oy=2*1024*1024;function Gh(t,e,r){let n=Wt.resolve(t),i=Wt.isAbsolute(e)?Wt.resolve(e):Wt.resolve(n,e),o=Wt.relative(n,i).replaceAll("\\","/");return{root:n,relative:Je(o,r),target:i}}async function Ze(t,e,r){let n=Gh(t,e,r.label);return B(n.root,n.relative,r)}async function Rc(t,e,r){return(await Ze(t,e,{label:r.label,expected:r.expected??"any"})).exists}function ho(t){return t?/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u.test(t)?t.includes("..")?"Change name cannot contain '..' (path traversal not allowed)":null:`Invalid change name: '${t}'
143
- Valid format: lowercase kebab-case (a-z, 0-9, single hyphens)`:"Change name cannot be empty"}function rn(t){let e=ho(t);if(e)throw new Error(e)}function Hh(t,e){return{label:q(t,e),directory:e}}async function Yh(t,e,r){let n=Hh(t,e);if(!(await Ze(t,e,{label:r,expected:"directory"})).exists)return{change:n,exists:!1,stateExists:!1};let o=await Ze(t,Tc.join(e,".comet.yaml"),{label:`${r} state`,expected:"file"});return{change:n,exists:!0,stateExists:o.exists}}async function et(t,e=process.cwd()){rn(t);let r=await Re(e),n=await Yh(r.projectRoot,Tc.join(r.changesDir,t),`Classic active change ${t}`);return{...n.change,exists:n.exists,stateExists:n.stateExists}}import{promises as mo}from"fs";import U from"path";function Ic(t,e){let r=U.relative(t,e);return r===""||r!==".."&&!r.startsWith(`..${U.sep}`)&&!U.isAbsolute(r)}async function Jh(t){let e=U.resolve(t),r=U.parse(e).root,n=[],i=e;for(;i&&i!==r;)try{let o=await mo.realpath(i);return U.join(o,...n.reverse())}catch(o){let s=o.code;if(s!=="ENOENT"&&s!=="ENOTDIR")throw o;n.push(U.basename(i)),i=U.dirname(i)}try{let o=await mo.realpath(r);return U.join(o,...n.reverse())}catch{return null}}async function jc(t,e){let r=U.resolve(t),n=await mo.realpath(r),i=[],o=[];for(let s of e){let a=U.isAbsolute(s)?U.resolve(s):U.resolve(r,s),c=await Jh(a);((c?Ic(n,c):Ic(r,a))?i:o).push(s)}return{projectTargets:i,externalTargets:o}}wo();var yo=rt(He(),1);nt();import{execFileSync as Wc}from"child_process";import{randomUUID as Xh}from"crypto";import{promises as Dt}from"fs";import Dc from"path";function Qh(t){try{let e=Wc("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();return e&&e!=="HEAD"?e:null}catch{return null}}var Zh=wn("liveGitBranch",t=>Qh(t));function em(t){try{return Wc("git",["rev-parse","--is-inside-work-tree"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()==="true"}catch{return!1}}var tm=wn("isGitWorkTree",t=>em(t)),rm=["current","branch","worktree"];function $c(t){return rm.includes(t)}function nm(t){return $c(t.isolation)?t.boundBranch===null&&t.currentBranch===null&&t.gitWorkTree===!1?{status:"not-applicable"}:t.boundBranch===null?t.currentBranch===null?{status:"unbound-detached"}:{status:"needs-heal",branch:t.currentBranch}:t.currentBranch===t.boundBranch?{status:"ok"}:{status:"drift",boundBranch:t.boundBranch,currentBranch:t.currentBranch}:{status:"not-applicable"}}async function nn(t,e){let r=Dc.join(t,".comet.yaml"),n=(0,yo.parseDocument)(await Dt.readFile(r,"utf8"),{uniqueKeys:!1});if(n.errors.length>0)throw new Error(`Invalid .comet.yaml: ${n.errors[0].message}`);let i=n.toJS()??{},o=typeof i.isolation=="string"?i.isolation:null,s=typeof i.bound_branch=="string"&&i.bound_branch!==""?i.bound_branch:null,a=$c(o),c=Zh(e.cwd),l=a&&s===null&&c===null?tm(e.cwd):!0,u=nm({isolation:o,boundBranch:s,currentBranch:c,gitWorkTree:l});return u.status==="needs-heal"&&e.heal?(await im(t,u.branch),{status:"healed",branch:u.branch,bindingRequired:a,currentBranch:c}):{...u,bindingRequired:a,currentBranch:c}}async function im(t,e){let r=Dc.join(t,".comet.yaml"),n=(0,yo.parseDocument)(await Dt.readFile(r,"utf8"),{uniqueKeys:!1});n.set("bound_branch",e);let i=`${r}.${Xh()}.tmp`;try{await Dt.writeFile(i,n.toString(),"utf8"),await Dt.rename(i,r)}catch(o){throw await Dt.rm(i,{force:!0}),o}}function om(t){return t??"detached HEAD"}function on(t,e,r){return`change '${t}' is bound to branch '${e}', but current branch is '${om(r)}'`}function sn(t){return`change '${t}' uses a branch-bound workspace mode but has no bound branch and HEAD is detached; checkout a branch first before continuing.`}io();import sm from"path";var bo="comet.selection.v2",am=16*1024;function Bc(t){return sm.join(t,".comet","current-change.json")}function cm(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}function Mc(t){return t===null||typeof t=="string"}function lm(t){let e;try{e=JSON.parse(t)}catch(r){throw new Error(`current change selection contains invalid JSON: ${r instanceof Error?r.message:String(r)}`,{cause:r})}if(!cm(e))throw new Error("current change selection must be a JSON object");if(e.version===1){if(typeof e.change!="string")throw new Error("legacy current change selection change must be a string");if(e.branch!==void 0&&!Mc(e.branch))throw new Error("legacy current change selection branch must be a string or null");return{selection:{schema:bo,workflow:"classic",change:e.change,branch:e.branch??null},legacy:!0}}if(e.schema!==bo)throw new Error(`current change selection schema must be ${bo}`);if(e.workflow!=="native"&&e.workflow!=="classic")throw new Error("current change selection workflow must be native or classic");if(typeof e.change!="string")throw new Error("current change selection change must be a string");if(!Mc(e.branch))throw new Error("current change selection branch must be a string or null");if(e.workflow==="native"&&e.branch!==null)throw new Error("Native current change selection branch must be null");return{selection:e,legacy:!1}}async function Fc(t){let e;try{let n=Bc(t),{bytes:i}=await Vr(n,am,{label:"current change selection"});e=i.toString("utf8")}catch(n){if(n.code==="ENOENT")return{status:"missing"};throw new Error(`cannot read current change selection: ${n instanceof Error?n.message:String(n)}`,{cause:n})}return{status:"selected",...lm(e)}}nt();var pn=rt(He(),1);Se();Z();import dn from"path";un();var Po=["full","hotfix","tweak"],il=1,sl=["open","design","build","verify","archive"],Cm=["en","zh-CN"],Em=["off","beta"],Pm=["subagent-driven-development","executing-plans","direct"],_m=["plan-ready"],xm=["confirmed"],Am=["tdd","direct"],Nm=["off","standard","thorough"],Om=["current","branch","worktree"],Rm=["light","full"],Tm=["pending","pass","fail"],Im=["pending","handled"],jm=["pending","confirmed"],_o=["workflow","language","phase","context_compression","build_mode","build_pause","subagent_dispatch","tdd_mode","review_mode","isolation","bound_branch","verify_mode","auto_transition","base_ref","design_doc","plan","verify_result","verify_failures","verification_report","branch_status","created_at","verified_at","archive_confirmation","archived","direct_override","handoff_context","handoff_hash","classic_profile","classic_migration"],Lm=["run_id"],al=new Set([..._o,...Lm]),qm=["workflow","phase","design_doc","plan","build_mode","isolation","verify_mode","verify_result","verified_at","archived"];function ol(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function tt(t,e){let r=t[e];if(r==null||r==="")return null;if(typeof r!="string")throw new Error(`Invalid Classic state: ${e} must be a string or null`);return r}function D(t,e,r,n=!0){let i=t[e];if(i==null||i===""){if(n)return null;throw new Error(`Invalid Classic state: ${e} is required`)}if(typeof i!="string"||!r.includes(i))throw new Error(`Invalid Classic state: ${e} must be one of ${r.join(", ")}${n?" or null":""}`);return i}function Eo(t,e,r=!0){let n=t[e];if(n==null||n===""){if(r)return null;throw new Error(`Invalid Classic state: ${e} is required`)}if(typeof n!="boolean")throw new Error(`Invalid Classic state: ${e} must be true or false`);return n}function Wm(t,e,r=0){let n=t[e];if(n==null||n==="")return r;if(typeof n!="number"||!Number.isInteger(n)||n<0)throw new Error(`Invalid Classic state: ${e} must be a non-negative integer`);return n}function fn(t,e){let r=tt(t,e);if(r===null)return null;if(/^(?:[A-Za-z]:|[\\/]|~)/u.test(r)||r.split(/[\\/]/u).includes(".."))throw new Error(`Invalid Classic state: ${e} must be a relative repository path`);return r}function Dm(t,e){let r=tt(t,e);if(r!==null&&!/^[a-f0-9]{64}$/u.test(r))throw new Error(`Invalid Classic state: ${e} must be a sha256 hex digest`);return r}function $m(t){let e=t.classic_migration;if(e==null||e==="")return null;if(e!==il)throw new Error(`Invalid Classic state: classic_migration must be ${il}`);return e}function Mm(t){if(!_o.some(r=>ol(t,r)))return null;for(let r of qm)if(!ol(t,r))return null;return{workflow:D(t,"workflow",Po,!1),language:D(t,"language",Cm),phase:D(t,"phase",sl,!1),contextCompression:D(t,"context_compression",Em),buildMode:D(t,"build_mode",Pm),buildPause:D(t,"build_pause",_m),subagentDispatch:D(t,"subagent_dispatch",xm),tddMode:D(t,"tdd_mode",Am),reviewMode:D(t,"review_mode",Nm),isolation:D(t,"isolation",Om),boundBranch:tt(t,"bound_branch"),verifyMode:D(t,"verify_mode",Rm),autoTransition:Eo(t,"auto_transition"),baseRef:tt(t,"base_ref"),designDoc:fn(t,"design_doc"),plan:fn(t,"plan"),verifyResult:D(t,"verify_result",Tm,!1),verifyFailures:Wm(t,"verify_failures"),verificationReport:fn(t,"verification_report"),branchStatus:D(t,"branch_status",Im),createdAt:tt(t,"created_at"),verifiedAt:tt(t,"verified_at"),archiveConfirmation:D(t,"archive_confirmation",jm),archived:Eo(t,"archived",!1),directOverride:Eo(t,"direct_override"),handoffContext:fn(t,"handoff_context"),handoffHash:Dm(t,"handoff_hash"),classicProfile:D(t,"classic_profile",Po),classicMigration:$m(t)}}function cl(t,e){let r=e??null;if(r===null&&e===void 0&&t.run_id&&t.skill)try{r=cn(t)}catch(n){let i=n instanceof Error?n.message:String(n);throw new Error(i.replace(/^Invalid Run state:/u,"Invalid Classic state:"),{cause:n})}return{classic:Mm(t),run:r,unknownKeys:Object.keys(t).filter(n=>!al.has(n))}}function ll(t){let e=t.workflow,r=t.phase,n=t.archived,i=t.design_doc;return{workflow:typeof e=="string"&&Po.includes(e)?e:null,phase:typeof r=="string"&&sl.includes(r)?r:null,archived:n===!0,designDoc:typeof i=="string"&&i!==""?i:null,unknownKeys:Object.keys(t).filter(o=>!al.has(o))}}un();var Bm=2*1024*1024;function Bt(t){let e=t.toJS();if(e===null)return{};if(typeof e!="object"||Array.isArray(e))throw new Error("Invalid Classic state document: root must be a mapping");return e}function Fm(t){let e=["skill","skill_version","skill_hash","orchestration","current_step","iteration","pending","pending_ref","trajectory_ref","context_ref","artifacts_ref","checkpoint_ref","run_status","run_retries"];for(let r of e)t.delete(r)}function Km(t){let e=!1;for(let r of["build_command","verify_command"])t.has(r)&&(t.delete(r),e=!0);return e}async function ul(t){let e;try{e=(await H(dn.dirname(t),dn.basename(t),Bm,{label:"Classic state document"})).bytes.toString("utf8")}catch(n){if(n.code!=="ENOENT")throw n;return new pn.Document({})}let r=(0,pn.parseDocument)(e);if(r.errors.length>0)throw new Error(`Invalid Classic state document: ${r.errors[0].message}`);return Bt(r),r}async function hn(t,e={}){let r=e.migrate!==!1,n=dn.join(t,".comet.yaml"),i=await ul(n),o=Bt(i),s=Km(i);s&&(o=Bt(i));let a=await So(t);if(!a&&o.run_id&&o.skill){let{runStateFromDocument:c}=await Promise.resolve().then(()=>(un(),nl));a=c(o),a&&r&&(await Co(t,a),Fm(i),s=!0)}return s&&r&&await ee(n,i.toString(),{containedRoot:t}),cl(Bt(i),a)}async function fl(t){let e=await ul(dn.join(t,".comet.yaml"));return ll(Bt(e))}var Um=rt(He(),1);var pv=8*1024*1024;var Gm=Ce("readCometCurrentSelection",t=>Fc(t));async function Hm(t,e){rn(e);let r=await et(e,t);if(!r.stateExists)throw new Error(`Cannot select current change '${e}': active change state not found`);let n=await hn(r.directory,{migrate:!1});if(!n.classic)throw new Error(`Cannot select current change '${e}': Classic state is incomplete`);if(n.classic.archived)throw new Error(`Cannot select current change '${e}': change is archived`);return r.directory}async function dl(t){let e;try{e=await Gm(t)}catch(o){return{status:"stale",reason:o instanceof Error?o.message:String(o)}}if(e.status==="missing")return{status:"missing"};if(e.selection.workflow!=="classic")return{status:"stale",reason:`current change '${e.selection.change}' belongs to Native, not Classic`};let r=e.selection,n;try{n=await Hm(t,r.change)}catch(o){return{status:"stale",reason:o instanceof Error?o.message:String(o)}}let i=await nn(n,{heal:!1,cwd:t});return i.status==="drift"?{status:"stale",reason:on(r.change,i.boundBranch,i.currentBranch)}:i.status==="unbound-detached"?{status:"stale",reason:sn(r.change)}:i.status==="ok"?{status:"selected",selection:r}:r.branch!==null&&i.currentBranch!==r.branch?{status:"stale",reason:`current change '${r.change}' was selected on branch '${r.branch}', current branch is '${i.currentBranch??"detached HEAD"}'`}:{status:"selected",selection:r}}import Te from"node:path";async function pl(t,e){if(!e||e==="null")return{status:"missing",recordedPath:null};let r=await Re(t),n=Te.resolve(t,e),i=Te.relative(r.superpowersPlansDir,n);return Te.isAbsolute(e)||!i||i.startsWith(`..${Te.sep}`)||Te.isAbsolute(i)||i.includes(Te.sep)||Te.extname(i).toLowerCase()!==".md"?{status:"broken",recordedPath:e}:await Rc(t,e,{label:`Classic build plan ${e}`,expected:"file"})?{status:"ready",recordedPath:e}:{status:"broken",recordedPath:e}}function z(t,e){return{exitCode:t,stderr:e+`
144
- `}}function V(t){return z(0,`[COMET-HOOK] allowed: ${t}`)}function Jm(){if(process.env.FILE_PATH)return process.env.FILE_PATH;if(process.stdin.isTTY)return"";let t=Ym(0,"utf8");if(!t)return"";try{let e=JSON.parse(t);return typeof e.tool_input?.file_path=="string"?e.tool_input.file_path:""}catch{return""}}function Kt(t){return t.replaceAll("\\","/").replace(/\/+/gu,"/")}function Ie(t){let e=Kt(t);return process.platform==="win32"?e.toLowerCase():e}function Vm(t){let e=t.indexOf("--project-root"),r=e>=0?t[e+1]:void 0;return K.resolve(r&&!r.startsWith("--")?r:process.cwd())}function hl(t,e){let r=Kt(K.relative(e,t));return r===""?"":r.startsWith("../")||r===".."||K.isAbsolute(r)?null:r}async function zm(t){let e=K.resolve(t),r=K.parse(e).root,n=[],i=e;for(;i&&i!==r;)try{let o=await mn.realpath(i);return K.join(o,...n.reverse())}catch(o){let s=o.code;if(s!=="ENOENT"&&s!=="ENOTDIR")throw o;n.push(K.basename(i)),i=K.dirname(i)}try{let o=await mn.realpath(r);return K.join(o,...n.reverse())}catch{return null}}async function Xm(t,e){let r=K.isAbsolute(t)?t:K.resolve(e,t),n=Kt(r),i=hl(r,e);if(i!==null)return i;try{let o=await zm(r),s=await mn.realpath(e);if(o){let a=hl(o,s);if(a!==null)return a;n=Kt(o)}}catch{if(!K.isAbsolute(t))return Kt(t).replace(/^\.\//u,"")}return n.replace(/^\.\//u,"")}async function yl(t){try{let e=await hn(t,{migrate:!1}),r=Array.from(new Set(e.unknownKeys)).sort();if(r.length>0)throw new Error(`Invalid Classic state: unknown field(s): ${r.join(", ")}`);if(!e.classic)throw new Error("Classic state projection is unavailable");return{changeDir:t,phase:e.classic.phase,classic:e.classic,archived:e.classic.archived}}catch(e){let r=await fl(t);return r.phase?{changeDir:t,phase:r.phase,classic:null,archived:r.archived,invalidState:e instanceof Error&&e.message.includes("unknown field")}:null}}async function Qm(t){let e=(await Re(t)).changesDir,r=[];if(!(await Ze(t,e,{label:"Classic changes directory",expected:"directory"})).exists)return r;for(let i of(await mn.readdir(e,{withFileTypes:!0})).sort((o,s)=>o.name.localeCompare(s.name))){if(i.name==="archive"||ho(i.name))continue;let o=await et(i.name,t);if(!o.exists||!o.stateExists)continue;let s=await yl(o.directory);!s||s.archived||r.push(s)}return r}var xo=Ce("classicActiveChanges",t=>Qm(t)),bl=Ce("classicPlanReadiness",pl);function vl(t,e){return`${q(t,e.superpowersRoot)}/`}function kl(t,e){return Ie(t).startsWith(Ie(e))}function Zm(t,e){return[{prefix:`${q(t,e.superpowersSpecsDir)}/`,field:"designDoc",wireField:"design_doc",phase:"design"},{prefix:`${q(t,e.superpowersPlansDir)}/`,field:"plan",wireField:"plan",phase:"build"},{prefix:`${q(t,e.superpowersReportsDir)}/`,field:"verificationReport",wireField:"verification_report",phase:"verify"}]}function eg(t,e){let r=Ie(t),n=e.find(o=>r.startsWith(Ie(o.prefix)));if(!n)return null;let i=r.slice(Ie(n.prefix).length);return!i||i.includes("/")||!i.endsWith(".md")?null:n}function Sl(t,e){return t.classic?.[e.field]??null}function tg(t,e){return t.classic!==null&&t.phase===e.phase&&!Sl(t,e)}async function ml(t,e,r){return tg(e,r)?!0:r.field!=="plan"||e.phase!=="build"?!1:(await bl(t,e.classic?.plan??null)).status==="broken"}function Cl(t){return t.phase==="design"||t.phase==="build"||t.phase==="verify"}function oe(t){return t.changeDir?K.basename(t.changeDir):null}var rg=new Set(["design","plan","verify","verification","verification-report","report"]);function gl(t){return t.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&")}function ng(t,e){return[e.classic?.designDoc,e.classic?.plan,e.classic?.verificationReport].some(n=>n&&Ie(n)===Ie(t))}function ig(t,e){let n=(t.split("/").at(-1)??t).replace(/\.[^.]+$/u,"");if(n===e)return!0;let i=[...rg].map(gl).join("|");return new RegExp(`(^|[-_.])${gl(e)}[-_.](${i})$`,"u").test(n)}async function og(t,e){let r=await xo(e),n=r.find(s=>ng(t,s));if(n)return{governing:n,match:"recorded"};let o=r.filter(Cl).filter(s=>{let a=oe(s);return a!==null&&ig(t,a)}).sort((s,a)=>(oe(a)?.length??0)-(oe(s)?.length??0))[0];return o?{governing:o,match:"named"}:null}async function wl(t,e,r){let n=await xo(t);if(n.length===0)return null;if(r)return n.find(s=>oe(s)===r)??{blockedResult:Ft(e,`selected change '${r}' is no longer active`)};let i=await dl(t);if(i.status==="stale")return{blockedResult:Ft(e,i.reason)};if(i.status==="selected"){let o=n.find(s=>oe(s)===i.selection.change);return o||{blockedResult:Ft(e,`selected change '${i.selection.change}' is no longer active`)}}if(n.length===1){let o=n[0];if(o.changeDir!==null){let s=await nn(o.changeDir,{heal:!1,cwd:t}),a=oe(o)??"unknown";if(s.status==="drift")return{blockedResult:Ft(e,on(a,s.boundBranch,s.currentBranch))};if(s.status==="unbound-detached")return{blockedResult:Ft(e,sn(a))}}return o}return{blockedResult:mg(e,n.map(o=>oe(o)).filter(Boolean))}}async function sg(t,e,r,n){let i=`${q(e,r.changesDir)}/`;if(t.startsWith(i)){let o=t.slice(i.length),[s]=o.split("/");if(s&&s!=="archive"){let a=await et(s,e);if(a.stateExists){let c=await yl(a.directory);return c||{changeDir:a.directory,phase:"open",classic:null,archived:!1}}return{changeDir:a.directory,phase:"open",classic:null,archived:!1}}}if(kl(t,vl(e,r))){let o=await og(t,e);if(o?.match==="recorded")return{...o.governing,superpowersArtifact:"matched"};let s=eg(t,Zm(e,r));if(o)return s?{...o.governing,superpowersArtifact:await ml(e,o.governing,s)?"matched":"unmatched",superpowersSlot:s}:{...o.governing,superpowersArtifact:"matched"};if(s){let l=await wl(e,t,n);return!l||"blockedResult"in l?l:{...l,superpowersArtifact:await ml(e,l,s)?"matched":"unmatched",superpowersSlot:s}}let a=await xo(e),c=n?a.find(l=>oe(l)===n)??null:a[0]??null;return c?{...c,superpowersArtifact:"unmatched"}:null}return wl(e,t,n)}function ag(t){return!t.includes("/")&&t.endsWith(".md")}function cg(t){return t.startsWith(".comet/")||t.includes("/.comet/")}function lg(t){return t===".superpowers"||t.startsWith(".superpowers/")}function ug(t,e,r){if(!t.startsWith(r))return null;let n=t.endsWith("/.comet.yaml")||t.endsWith("/.openspec.yaml"),i=t.endsWith("/proposal.md")||t.endsWith("/design.md")||t.endsWith("/tasks.md"),o=t.includes("/.comet/"),s=t.includes("/specs/");return e==="open"&&(i||n||o||s)?`${t} (phase: open, openspec artifacts)`:e==="design"&&(i||n||o||s)?`${t} (phase: design, handoff/spec)`:e==="build"&&(t.endsWith("/tasks.md")||n||s)?`${t} (phase: build, spec/tasks)`:e==="verify"&&(t.endsWith("/tasks.md")||n)?`${t} (phase: verify, tasks/state)`:e==="archive"&&n?`${t} (phase: archive, state)`:null}function fg(t,e){let r=e==="open"?[" BLOCKED: source writes are not allowed during open"," This phase does not allow source writes"," ALLOWED: create proposal/design/tasks artifacts and run guard"," NEXT: finish clarification and artifacts, then run guard --apply"]:e==="design"?[" BLOCKED: source writes are not allowed during design"," This phase does not allow source writes"," ALLOWED: run brainstorming, create the Design Doc, and run guard"," NEXT: finish the Design Doc, then run comet guard <change-name> design --apply to enter build"]:[" BLOCKED: source writes are not allowed during archive"," This phase does not allow source writes"," ALLOWED: confirm archive state and run the archive script"];return z(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝","",` Current phase: ${e}`,` Target file: ${t}`,"",...r,""].join(`
145
- `))}function dg(t){return z(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝",""," Current phase: build (workflow: full), but design_doc is empty",` Target file: ${t}`,""," BLOCKED: full workflow source writes require a recorded Design Doc"," This phase does not allow source writes until design_doc is recorded"," NEXT: return to design, create/link the Design Doc, then run guard again",""].join(`
146
- `))}function pg(t,e,r,n,i){let o=oe(e)??"<change-name>",s=r.status==="missing",a=s?"classic-build-plan-missing":"classic-build-plan-broken",c=s?"plan is not recorded":"the recorded plan path does not resolve to a file",l=s?[]:[`RECORDED_PLAN: ${r.recordedPath}`],u=e.changeDir?q(n,e.changeDir):"<classic-change-dir>",f=q(n,i.superpowersPlansDir),d=s?`comet state set ${o} plan <repository-relative-plan-path>`:`comet state set ${o} plan <new-repository-relative-plan-path>`,m=s?["2. Load the Superpowers writing-plans Skill.",`3. Read the Design Doc path from "comet state get ${o} design_doc" and read ${u}/tasks.md.`,`4. Create the implementation plan under ${f}/.`,"5. Record the plan path:",` ${d}`]:[`2. Restore the plan file at ${r.recordedPath}, or load the Superpowers writing-plans Skill and create a replacement under ${f}/.`,"3. When creating a replacement, record its path:",` ${d}`];return z(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝","",`ERROR_CODE: ${a}`,`CHANGE: ${o}`,"WORKFLOW: full","PHASE: build",`TARGET: ${t}`,`STATE: ${c}`,...l,"","BLOCKED: project source writes require a ready Superpowers implementation plan.","","ALLOWED_RECOVERY_WRITES:",`- ${f}/<plan-file>.md`,"- Comet state updates performed by the comet CLI",`- ${u} artifacts allowed by the build phase`,"","RECOVERY:",`1. Invoke /comet-build for ${o} and resume Step 1.`,...m,`${s?"6":"4"}. Verify recovery:`,` comet state check ${o} build --recover`,"","SUCCESS: plan is reported as DONE and recovery advances beyond plan creation.",`RETRY: retry the original Write/Edit for ${t} only after SUCCESS.`,"PROHIBITED: do not treat tasks.md as the implementation plan or write project source before SUCCESS.","If writing-plans is unavailable, stop and report the missing Skill instead of bypassing this check.",""].join(`
147
- `))}function hg(t,e){let r=e.superpowersSlot,n=r?Sl(e,r):null,i=r?e.phase!==r.phase?[` BLOCKED: ${r.wireField} cannot be first-written in phase ${e.phase}`,` Expected phase: ${r.phase}`," NEXT: resume the matching Comet phase or use an already recorded artifact path"]:n?[` BLOCKED: ${r.wireField} is already recorded for this change`,` Recorded path: ${n}`," NEXT: write the recorded artifact or explicitly correct the state path"]:[" BLOCKED: standard Superpowers artifact state is incomplete"," NEXT: validate the active change state, then retry the matching phase"]:[" BLOCKED: unmatched Superpowers artifact"," This docs/superpowers/ path does not match any active change artifact"," NEXT: use a recorded artifact path or a standard phase artifact directory"];return z(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝","",` Current phase: ${e.phase}`,` Target file: ${t}`,"",...i,""].join(`
148
- `))}function mg(t,e){return z(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝",""," BLOCKED: multiple active changes require a current change",` Target file: ${t}`,` Active changes: ${e.join(", ")}`,""," NEXT: run comet state select <change-name>, then retry the source write",""].join(`
149
- `))}function Ft(t,e){return z(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝",""," BLOCKED: current change selection is stale or invalid",` Target file: ${t}`,` Reason: ${e}`,""," NEXT: run comet state select <change-name>, then retry the source write",""].join(`
150
- `))}async function gg(t,e,r,n=jc){try{if((await n(t,[e])).projectTargets.length===0)return V(`${e} (outside guarded project)`)}catch(u){return z(2,[`[COMET-HOOK] blocked: scope could not be determined safely for ${e}.`,`REASON: ${u instanceof Error?u.message:String(u)}`,"NEXT: verify that the project root is accessible, then retry the write."].join(`
151
- `))}let i=await Xm(e,t),o;try{o=await po(t)}catch(u){return z(2,`[COMET-HOOK] blocked: ${u instanceof Error?u.message:String(u)}`)}if(cg(i))return V(`${i} (whitelist: comet config)`);if(lg(i))return V(`${i} (whitelist: superpowers workspace)`);if(i==="CLAUDE.md"||i==="CHANGELOG.md"||i==="README.md"||ag(i))return V(`${i} (whitelist: root markdown)`);let s=await go(t,e,[K.join(t,".comet"),o.openSpecRoot,o.superpowersRoot]);if(s)return V(s);let a;try{a=await sg(i,t,o,r)}catch(u){return z(2,`[COMET-HOOK] blocked: ${u instanceof Error?u.message:String(u)}`)}if(!a)return V("no active comet change");if("blockedResult"in a)return a.blockedResult;if(a.archived)return V(`${i} (own change archived)`);let c=a.phase,l=ug(i,c,`${q(t,o.openSpecRoot)}/`);if(l)return V(l);if(kl(i,vl(t,o))){if(a.superpowersArtifact==="matched"&&Cl(a))return V(`${i} (phase: ${c}, superpowers)`);if(a.superpowersArtifact==="unmatched")return hg(i,a)}if(a.invalidState)return z(2,`[COMET-HOOK] blocked: active Classic state is invalid; repair .comet.yaml before writing ${i}`);if(c==="build"&&a.classic?.workflow==="full"&&!a.classic.designDoc)return dg(i);if(c==="build"&&a.classic?.workflow==="full"){let u=await bl(t,a.classic.plan);if(u.status!=="ready")return pg(i,a,u,t,o)}return c==="build"||c==="verify"?V(`${i} (phase: ${c})`):fg(i,c)}var El=async t=>{let e=Vm(t),r=Jm();return r?gg(e,r):V("no file path in tool input")};function wg(t,e){return{exitCode:e.exitCode,stdout:JSON.stringify({command:t,exitCode:e.exitCode,...e.stdout===void 0?{}:{stdout:e.stdout},...e.stderr===void 0?{}:{stderr:e.stderr}})+`
152
- `}}async function Pl(t,e,r=process.argv.slice(2)){let n=r.includes("--json"),i=r.filter(a=>a!=="--json"),o;try{o=await e(i,{json:n})}catch(a){o={exitCode:70,stderr:a instanceof Error?a.message:String(a)}}let s=n?wg(t,o):o;return s.stdout&&process.stdout.write(s.stdout),s.stderr&&process.stderr.write(s.stderr+(s.stderr.endsWith(`
142
+ `,r)+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;let r=Br(e),n=He(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=Br(e),n=He(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.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())}}};dc.Parser=Ji});var wc=g(jt=>{"use strict";var pc=qi(),Yp=_t(),It=At(),Jp=In(),Vp=_(),zp=Yi(),hc=Vi();function mc(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new zp.LineCounter||null,prettyErrors:e}}function Xp(t,e={}){let{lineCounter:r,prettyErrors:n}=mc(e),i=new hc.Parser(r?.addNewLine),o=new pc.Composer(e),s=Array.from(o.compose(i.parse(t)));if(n&&r)for(let a of s)a.errors.forEach(It.prettifyError(t,r)),a.warnings.forEach(It.prettifyError(t,r));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function gc(t,e={}){let{lineCounter:r,prettyErrors:n}=mc(e),i=new hc.Parser(r?.addNewLine),o=new pc.Composer(e),s=null;for(let a of o.compose(i.parse(t),!0,t.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new It.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(s.errors.forEach(It.prettifyError(t,r)),s.warnings.forEach(It.prettifyError(t,r))),s}function Qp(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=gc(t,r);if(!i)return null;if(i.warnings.forEach(o=>Jp.warn(i.options.logLevel,o)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},r))}function Zp(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=r??e??{};if(!i)return}return Vp.isDocument(t)&&!n?t.toString(r):new Yp.Document(t,n,r).toString(r)}jt.parse=Qp;jt.parseAllDocuments=Xp;jt.parseDocument=gc;jt.stringify=Zp});var Ye=g(P=>{"use strict";var eh=qi(),th=_t(),rh=mi(),zi=At(),nh=lt(),me=_(),ih=ue(),oh=A(),sh=de(),ah=pe(),ch=$r(),lh=Gi(),uh=Yi(),fh=Vi(),Kr=wc(),yc=ot();P.Composer=eh.Composer;P.Document=th.Document;P.Schema=rh.Schema;P.YAMLError=zi.YAMLError;P.YAMLParseError=zi.YAMLParseError;P.YAMLWarning=zi.YAMLWarning;P.Alias=nh.Alias;P.isAlias=me.isAlias;P.isCollection=me.isCollection;P.isDocument=me.isDocument;P.isMap=me.isMap;P.isNode=me.isNode;P.isPair=me.isPair;P.isScalar=me.isScalar;P.isSeq=me.isSeq;P.Pair=ih.Pair;P.Scalar=oh.Scalar;P.YAMLMap=sh.YAMLMap;P.YAMLSeq=ah.YAMLSeq;P.CST=ch;P.Lexer=lh.Lexer;P.LineCounter=uh.LineCounter;P.Parser=fh.Parser;P.parse=Kr.parse;P.parseAllDocuments=Kr.parseAllDocuments;P.parseDocument=Kr.parseDocument;P.stringify=Kr.stringify;P.visit=yc.visit;P.visitAsync=yc.visitAsync});import Je from"path";function wh(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let r=t.trim();if(r.length===0||Je.posix.isAbsolute(r)||Je.win32.isAbsolute(r)||/^(?:~|[\\/])/u.test(r))throw new Error(`${e} must be a project-relative path`);if(r===".")return[];let n=r.replaceAll("\\","/").split("/");if(n.some(i=>i===".."))throw new Error(`${e} must stay inside the project root`);if(n.some(i=>i===""||i==="."))throw new Error(`${e} must not contain empty or dot path segments`);return n}function Ur(t){let e=wh(t,"native.artifact_root");return e.length===0?".":e.join("/")}function kc(t,e="docs"){let r=t??e;if(r!=="legacy"&&r!=="docs")throw new Error("classic.artifact_layout must be legacy or docs");return r}function Ve(t,e,r=!1){if(typeof t!="string")throw new Error(`${e} must be a string`);let n=t.trim().replaceAll("\\","/");if(n.length===0||Je.posix.isAbsolute(n)||Je.win32.isAbsolute(n)||/^(?:~|[\\/])/u.test(n))throw new Error(`${e} must be relative to its declared path base`);let i=n.split("/");if(i.some(o=>o===".."))throw new Error(`${e} must stay inside its declared path base`);if(i.some(o=>o===""||o==="."))throw new Error(`${e} must not contain empty or dot path segments`);if(!r&&/[*?]/u.test(n))throw new Error(`${e} cannot contain wildcards`);return i.join("/")}function ge(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function Sc(t,e,r){let n=t??e;if(n!=="en"&&n!=="zh-CN")throw new Error(`${r} must be en or zh-CN`);return n}function Cc(t,e){if(typeof t!="string"||t.length===0||t.includes("\\")||t.includes("\0")||t.startsWith("/")||t.split("/").includes(".."))throw new Error(`${e} contains an unsafe pattern`);if(t.length>Qi)throw new Error(`${e} exceeds ${Qi} characters`);let r=0;for(let n=0;n<t.length;n+=1)t[n]==="?"?r+=1:t[n]==="*"&&(r+=1,t[n+1]==="*"&&(n+=1));if(r>Zi)throw new Error(`${e} contains more than ${Zi} wildcard tokens`);return t}function vc(t,e,r){if(t===void 0)return[...r];if(!Array.isArray(t))throw new Error(`${e} contains an unsafe pattern`);return[...new Set(t.map(n=>Cc(n,e)))].sort((n,i)=>n.localeCompare(i,"en"))}function Xi(t,e,r){let n=t??e;if(!Number.isSafeInteger(n)||n<1)throw new Error(`${r} must be a positive integer`);return n}function yh(t){if(t===void 0)return{...ne,include:[...ne.include],exclude:[...ne.exclude]};let e=ge(t,"native.snapshot");return{include:vc(e.include,"native.snapshot.include",ne.include),exclude:vc(e.exclude,"native.snapshot.exclude",ne.exclude),max_files:Xi(e.max_files,ne.max_files,"native.snapshot.max_files"),max_total_bytes:Xi(e.max_total_bytes,ne.max_total_bytes,"native.snapshot.max_total_bytes"),max_duration_ms:Xi(e.max_duration_ms,ne.max_duration_ms,"native.snapshot.max_duration_ms")}}function bh(t){if(t===void 0)return;let e=ge(t,"native.pending_root_move"),r=e.id,n=e.from_artifact_root,i=e.to_artifact_root,o=e.stage;if(typeof r!="string"||!/^[a-f0-9-]{8,}$/u.test(r))throw new Error("native.pending_root_move.id is invalid");if(typeof n!="string"||typeof i!="string")throw new Error("native.pending_root_move roots must be strings");if(o!=="copying"&&o!=="ready"&&o!=="switched")throw new Error("native.pending_root_move.stage is invalid");let s;if(e.cleanup!==void 0){let a=ge(e.cleanup,"native.pending_root_move.cleanup"),c=a.kind,l=a.state,u=a.manifest_hash;if(c!=="forward-source"&&c!=="restart-staging"&&c!=="rollback-destination"&&c!=="rollback-staging")throw new Error("native.pending_root_move.cleanup.kind is invalid");if(l!=="prepared"&&l!=="quarantined"&&l!=="deleting")throw new Error("native.pending_root_move.cleanup.state is invalid");if(typeof u!="string"||!/^[a-f0-9]{64}$/u.test(u))throw new Error("native.pending_root_move.cleanup.manifest_hash is invalid");s={kind:c,state:l,manifestHash:u}}return{id:r,fromArtifactRoot:Ur(n),toArtifactRoot:Ur(i),stage:o,...s?{cleanup:s}:{}}}function vh(t){if(t===void 0)return;let e=ge(t,"native.finish");if(e.pull_request===void 0)return{};let r=ge(e.pull_request,"native.finish.pull_request");if(r.provider!=="repository-command")throw new Error("native.finish.pull_request.provider must be repository-command");if(!Array.isArray(r.command)||r.command.length===0)throw new Error("native.finish.pull_request.command must be a non-empty array");if(r.command.length>64)throw new Error("native.finish.pull_request.command must contain at most 64 arguments");let n=r.command.map((o,s)=>{if(typeof o!="string"||o.trim().length===0||o.length>4096||/[\0\r\n]/u.test(o))throw new Error(`native.finish.pull_request.command[${s}] must be a non-empty single-line string of at most 4096 characters`);return o});if(Je.posix.isAbsolute(n[0])||Je.win32.isAbsolute(n[0]))throw new Error("native.finish.pull_request.command[0] must be a bare executable name or a project-relative path");let i=r.timeout_ms??ph;if(!Number.isSafeInteger(i)||i<1||i>bc)throw new Error(`native.finish.pull_request.timeout_ms must be an integer between 1 and ${bc}`);return{pull_request:{provider:"repository-command",command:n,timeout_ms:i}}}function kh(t,e={}){let r=ge(t,"native"),n=r.artifact_root??(e.allowMissingArtifactRoot?"docs":void 0);if(typeof n!="string")throw new Error("native.artifact_root must be a string");let i=r.clarification_mode??"batch";if(i!=="sequential"&&i!=="batch")throw new Error("native.clarification_mode must be sequential or batch");let o=r.archive_confirmation??"automatic";if(o!=="automatic"&&o!=="required")throw new Error("native.archive_confirmation must be automatic or required");let s=r.max_verify_failures??dh;if(!Number.isSafeInteger(s)||s<1)throw new Error("native.max_verify_failures must be a positive integer");let a=bh(r.pending_root_move),c=vh(r.finish);return{artifact_root:Ur(n),language:Sc(r.language,"en","native.language"),clarification_mode:i,archive_confirmation:o,max_verify_failures:s,snapshot:yh(r.snapshot),...c?{finish:c}:{},...a?{pending_root_move:a}:{}}}function Sh(t){let e=ge(t,"classic"),r=e.context_compression??"off";if(r!=="off"&&r!=="beta")throw new Error("classic.context_compression must be off or beta");let n=e.review_mode??"standard";if(n!=="off"&&n!=="standard"&&n!=="thorough")throw new Error("classic.review_mode must be off, standard, or thorough");let i=e.auto_transition??!0;if(typeof i!="boolean")throw new Error("classic.auto_transition must be true or false");return{artifact_layout:kc(e.artifact_layout),language:Sc(e.language,"zh-CN","classic.language"),context_compression:r,review_mode:n,auto_transition:i}}function Ch(t){let r=ge(t,"hook").allow_paths??[];if(!Array.isArray(r))throw new Error("hook.allow_paths must be an array");return{allow_paths:[...new Set(r.map((n,i)=>Ve(n,`hook.allow_paths[${i}]`)))]}}function Eh(t){let e=t??!0;if(typeof e!="boolean")throw new Error("ambient_resume must be true or false");return e}function _h(t,e,r,n,i,o){let s=t.schema!==void 0;if(!(s||t.default_workflow!==void 0||t.workflows!==void 0||!o.allowPartialProject&&t.native!==void 0)||o.allowPartialProject&&!s)return null;if(t.schema!=="comet.project.v1")throw new Error("Unsupported Comet project schema");if(t.default_workflow!=="native"&&t.default_workflow!=="classic")throw new Error("default_workflow must be native or classic");let c=t.workflows??[t.default_workflow];if(!Array.isArray(c)||c.length===0||c.some(u=>u!=="native"&&u!=="classic"))throw new Error("workflows must contain native and/or classic");let l=[...new Set(c)];if(!l.includes(t.default_workflow))throw new Error("workflows must include default_workflow");if(l.includes("native")&&!r)throw new Error("native must be a mapping");return{schema:"comet.project.v1",default_workflow:t.default_workflow,workflows:l,ambient_resume:i,...e?{hook:e}:{},...r?{native:r}:{},...n?{classic:n}:{}}}function ze(t,e={}){let r=(0,eo.parseDocument)(t,{uniqueKeys:!0});if(r.errors.length>0)throw new Error(`Invalid .comet/config.yaml: ${r.errors[0].message}`);let n=r.toJS();if(n==null)return{value:{},config:null,ambient_resume:!0};if(typeof n!="object"||Array.isArray(n))throw new Error("Invalid .comet/config.yaml: root must be a mapping");let i=n,o=Eh(i.ambient_resume),s=i.hook===void 0?void 0:Ch(i.hook),a=i.native===void 0?void 0:kh(i.native,{allowMissingArtifactRoot:e.allowMissingNativeFields}),c=i.classic===void 0?void 0:Sh(i.classic),l=_h(i,s,a,c,o,{allowPartialProject:e.allowPartialProject??!1});return{value:i,config:l,ambient_resume:o,...s?{hook:s}:{},...a?{native:a}:{},...c?{classic:c}:{}}}var eo,qt,Qi,Zi,dh,ph,bc,hh,mh,gh,ne,we=T(()=>{"use strict";eo=nt(Ye(),1),qt=64*1024,Qi=1024,Zi=64,dh=5,ph=12e4,bc=6e5,hh=[".agents/skills/**",".amazonq/skills/**",".augment/skills/**",".bob/skills/**",".claude/skills/**",".cline/skills/**",".codebuddy/skills/**",".workbuddy/skills/**",".continue/skills/**",".cospec/skills/**",".crush/skills/**",".cursor/skills/**",".factory/skills/**",".forge/skills/**",".gemini/skills/**",".github/skills/**",".grok/skills/**",".iflow/skills/**",".junie/skills/**",".kilocode/skills/**",".kimi-code/skills/**",".kiro/skills/**",".lingma/skills/**",".mimocode/skills/**",".opencode/skills/**",".pi/skills/**",".qoder/skills/**",".qwen/skills/**",".roo/skills/**",".trae-cn/skills/**",".trae/skills/**",".windsurf/skills/**",".zcode/skills/**"],mh=["**/.idea/**","**/.vscode/**",".codex/skills/**","**/node_modules/**","**/.next/**","**/.nuxt/**","**/.output/**","**/.svelte-kit/**","**/.vite/**","**/.parcel-cache/**","**/.turbo/**","**/.nx/cache/**","**/dist/**","**/build/**","**/out/**","**/coverage/**","**/.nyc_output/**","**/target/**","**/.gradle/**","**/.cxx/**","**/.externalNativeBuild/**","**/captures/**","**/__pycache__/**","**/.pytest_cache/**","**/.mypy_cache/**","**/.ruff_cache/**","**/.tox/**","**/.nox/**","**/.venv/**","**/venv/**","**/obj/**","**/CMakeFiles/**","**/cmake-build-*/**","**/.cache/**","**/tmp/**","**/temp/**","**/logs/**","**/*.tsbuildinfo","**/*.log","**/.DS_Store","**/Thumbs.db"],gh=[...hh,...mh].sort((t,e)=>t.localeCompare(e,"en")),ne={include:["**/*"],exclude:[...gh],max_files:1e4,max_total_bytes:256*1024*1024,max_duration_ms:6e4}});function ye(t){return t!==0&&t!==0n&&t!=="0"}function Ec(t,e){return ye(t.dev)&&ye(e.dev)&&ye(t.ino)&&ye(e.ino)}function be(t,e){let r=ye(t.dev)&&ye(e.dev);if(r&&t.dev!==e.dev)return!1;let n=ye(t.ino)&&ye(e.ino);return n&&t.ino!==e.ino?!1:r&&n?!0:t.birthtime===e.birthtime}var Gr=T(()=>{"use strict"});import{constants as Hr,promises as Re}from"fs";function to(t){return"birthtimeNs"in t&&typeof t.birthtimeNs=="bigint"?t.birthtimeNs:t.birthtimeMs}function _c(t){return"ctimeNs"in t&&typeof t.ctimeNs=="bigint"?t.ctimeNs:t.ctimeMs}function Lt(t){return{dev:t.dev,ino:t.ino,birthtime:to(t)}}function Yr(t,e){let r=Lt(t),n=Lt(e);return Ec(r,n)?be(r,n):be(r,n)&&to(t)===to(e)&&_c(t)===_c(e)&&t.size===e.size}async function Jr(t,e,r={}){if(!Number.isSafeInteger(e)||e<1)throw new Error("race-safe read byte limit must be a positive integer");let n=r.label??"file",i=r.bigint===!0,o=await Re.lstat(t,{bigint:i});if(!o.isFile()||o.isSymbolicLink())throw new ve("not-regular-file",`${n} must be a regular file`);if(BigInt(o.size)>BigInt(e))throw new ve("too-large",`${n} exceeds ${e} bytes`);let s=await Re.realpath(t);await r.verify?.("pre-open",{realPath:s,identity:Lt(o)});let a=process.platform==="win32"?Hr.O_RDONLY:Hr.O_RDONLY|Hr.O_NOFOLLOW|Hr.O_NONBLOCK,c;try{c=await Re.open(t,a)}catch(l){throw l.code==="ELOOP"?new ve("not-regular-file",`${n} must be a regular file`,{cause:l}):l}try{let[l,u,f]=await Promise.all([c.stat({bigint:i}),Re.lstat(t,{bigint:i}),Re.realpath(t)]);if(!l.isFile()||!u.isFile()||u.isSymbolicLink()||f!==s||!Yr(o,l)||!Yr(o,u))throw new ve("changed",`${n} changed while opening`);await r.verify?.("post-open",{realPath:f,identity:Lt(l)}),await r.hooks?.afterOpen?.();let d=[],m=0,w=Buffer.allocUnsafe(Math.min(64*1024,e+1));for(;;){let v=e+1-m,{bytesRead:k}=await c.read(w,0,Math.min(w.length,v),null);if(k===0)break;if(m+=k,m>e)throw new ve("too-large",`${n} exceeds ${e} bytes`);d.push(Buffer.from(w.subarray(0,k)))}await r.hooks?.beforeFinalCheck?.();let[p,h,y]=await Promise.all([c.stat({bigint:i}),Re.lstat(t,{bigint:i}),Re.realpath(t)]);if(!h.isFile()||h.isSymbolicLink()||y!==s||!Yr(o,p)||!Yr(o,h))throw new ve("changed",`${n} changed while reading`);return await r.verify?.("post-read",{realPath:y,identity:Lt(p)}),{bytes:Buffer.concat(d,m),stat:p,realPath:y}}finally{await c.close()}}var ve,ro=T(()=>{"use strict";Gr();ve=class extends Error{reason;constructor(e,r,n){super(r,n),this.name="RaceSafeReadError",this.reason=e}}});import{promises as Vr}from"fs";import ke from"path";function Ph(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}function no(t,e){let r=ke.relative(t,e);return r===""||!ke.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${ke.sep}`)}async function Pc(t,e){let r=ke.resolve(t),n=await Vr.lstat(r);if(!n.isDirectory()||n.isSymbolicLink())throw new Error(`${e} project root must be a real directory`);return Vr.realpath(r)}async function xc(t,e,r,n){let i=t;for(let o=0;o<r.length;o++){i=ke.join(i,r[o]);let s;try{s=await Vr.lstat(i)}catch(u){if(Ph(u))return{exists:!1,kind:"missing"};throw u}let a=ke.relative(t,i).replaceAll("\\","/");if(s.isSymbolicLink())throw new Error(`${n.label} crosses a symbolic link or junction at ${a}`);let c=o===r.length-1;if(!c&&!s.isDirectory())throw new Error(`${n.label} ancestor ${a} must be a real directory`);if(c&&(n.expected==="file"&&!s.isFile()||n.expected==="directory"&&!s.isDirectory()||n.expected==="any"&&!s.isFile()&&!s.isDirectory()))throw new Error(`${n.label} must be a real ${n.expected}`);let l=await Vr.realpath(i);if(!no(e,l))throw new Error(`${n.label} resolves outside the project root`);if(c)return{exists:!0,kind:s.isFile()?"file":s.isDirectory()?"directory":"missing"}}return{exists:!0,kind:"directory"}}async function B(t,e,r){let n=Ve(e,r.label),i=ke.resolve(t),o=await Pc(i,r.label),s=n.split("/"),a=ke.resolve(i,...s);if(!no(i,a))throw new Error(`${r.label} must stay inside the project root`);let c=await xc(i,o,s,r);return{projectRoot:i,target:a,relative:n,exists:c.exists,kind:c.kind}}async function H(t,e,r,n){let i=await B(t,e,{label:n.label,expected:"file"});if(!i.exists){let s=new Error(`${n.label} does not exist`);throw s.code="ENOENT",s}let o=await Pc(i.projectRoot,n.label);return Jr(i.target,r,{...n,verify:async(s,a)=>{if(!no(o,a.realPath))throw new Error(`${n.label} resolves outside the project root`);await xc(i.projectRoot,o,i.relative.split("/"),{label:n.label,expected:"file"})}})}var Z=T(()=>{"use strict";ro();we()});import{createHash as xh}from"crypto";function Ah(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function zr(t,e={}){return(await Xr(t,e)).document}async function Nh(t){try{return(await H(t,Wt,qt,{label:Wt})).bytes}catch(e){if(Ah(e))return null;throw e}}function Oh(t){return t?{exists:!0,sha256:xh("sha256").update(t).digest("hex")}:{exists:!1,sha256:null}}async function Xr(t,e={}){let r=await Nh(t);return{document:r?ze(r.toString("utf8"),e):null,identity:Oh(r)}}async function io(t){return(await zr(t))?.config??null}var Wt,Xe=T(()=>{"use strict";we();Z();Wt=".comet/config.yaml"});import{randomUUID as Rh}from"crypto";import{constants as Th,promises as N}from"fs";import q from"path";async function so(t,e){try{return await N.link(t,e),{linked:!0}}catch(r){let n=r.code;if(n!=="ENOTSUP"&&n!=="EOPNOTSUPP")throw r}return await N.copyFile(t,e,Th.COPYFILE_EXCL),{linked:!1}}function Qe(t,e){let r=q.relative(t,e);return r===""||!q.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${q.sep}`)}function Qr(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function Ih(t,e){return be(t,Qr(e))}function oo(t,e){return be(Qr(t),Qr(e))}function Ac(t,e){return oo(t,e)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.mtimeMs===e.mtimeMs&&t.size===e.size}async function Zr(t){let e=await N.lstat(t);if(!e.isDirectory()||e.isSymbolicLink())throw new Error(`Contained atomic write parent must be a real directory: ${t}`);return{path:t,realPath:await N.realpath(t),...Qr(e)}}async function Se(t){for(let e of t){let r=await N.lstat(e.path);if(!r.isDirectory()||r.isSymbolicLink()||!Ih(e,r)||await N.realpath(e.path)!==e.realPath)throw new Error(`Contained atomic write parent changed before commit: ${e.path}`)}}async function jh(t,e){let r=q.resolve(t),n=q.resolve(e);if(!Qe(r,n))throw new Error(`Contained atomic write parent is outside its managed root: ${e}`);let i=[await Zr(r)],o=q.relative(r,n).split(q.sep).filter(Boolean),s=r;for(let a of o){await Se(i),s=q.join(s,a);try{await N.mkdir(s)}catch(l){if(l.code!=="EEXIST")throw l}let c=await Zr(s);if(!Qe(i[0].realPath,c.realPath))throw new Error(`Contained atomic write parent resolves outside its managed root: ${s}`);i.push(c)}return await Se(i),i}async function qh(t,e){let r=q.resolve(t),n=q.resolve(e);if(!Qe(r,n))throw new Error(`Contained file parent is outside its managed root: ${e}`);let i=[await Zr(r)],o=q.relative(r,n).split(q.sep).filter(Boolean),s=r;for(let a of o){s=q.join(s,a);try{let c=await Zr(s);if(!Qe(i[0].realPath,c.realPath))throw new Error(`Contained file parent resolves outside its managed root: ${s}`);i.push(c)}catch(c){if(c.code==="ENOENT")return null;throw c}}return await Se(i),i}async function Nc(t){let e;try{e=await N.open(t,"r"),await e.sync()}catch(r){let n=r.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(n??""))throw r}finally{await e?.close()}}async function Lh(t,e,r){let n=q.dirname(t),i=await jh(r.containedRoot,n),o=q.join(n,`.${q.basename(t)}.${Rh()}.tmp`),s,a,c;try{await r.beforeTemporaryOpen?.(),s=await N.open(o,"wx"),a=await s.stat();let[l,u]=await Promise.all([N.lstat(o),N.realpath(o)]);if(await Se(i),!l.isFile()||l.isSymbolicLink()||!oo(a,l)||!Qe(i[0].realPath,u))throw new Error("Contained atomic write temporary file opened outside its managed parent");if(typeof e=="string"?await s.writeFile(e,"utf8"):await s.writeFile(e),await s.sync(),c=await s.stat(),!oo(a,c))throw new Error("Contained atomic write temporary file changed while writing");await s.close(),s=void 0,await r.beforeCommit?.(),await Se(i);let f=await N.lstat(o);if(!f.isFile()||f.isSymbolicLink()||!c||!Ac(f,c))throw new Error("Contained atomic write temporary file changed before commit");r.exclusive?(await so(o,t),await N.unlink(o)):await N.rename(o,t),await Nc(n)}catch(l){await s?.close();try{await Se(i),await N.rm(o,{force:!0})}catch{}throw l}}async function ee(t,e,r){await Lh(t,e,r)}async function ao(t,e){let r=q.dirname(t),n=await qh(e.containedRoot,r);if(!n)return!1;let i,o;try{i=await N.lstat(t),o=await N.realpath(t)}catch(c){if(c.code==="ENOENT")return!1;throw c}if(!i.isFile()||i.isSymbolicLink()||!Qe(n[0].realPath,o))throw new Error("Contained file removal target must be a regular file inside its managed root");await e.beforeRemove?.(),await Se(n);let[s,a]=await Promise.all([N.lstat(t),N.realpath(t)]);if(!s.isFile()||s.isSymbolicLink()||!Ac(i,s)||a!==o)throw new Error("Contained file removal target changed before removal");return await N.unlink(t),await Se(n),await Nc(r),!0}var Ce=T(()=>{"use strict";Gr()});var my,co=T(()=>{"use strict";Ce();Xe();Z();my=16*1024});var uo=T(()=>{"use strict";Ce();we();Xe();Z();co()});import W from"path";function Dc(t,e){let r=W.relative(t,e);return r===""||!W.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${W.sep}`)}function tm(t,e){let r=W.isAbsolute(e)?W.resolve(e):W.resolve(t,e),n=W.relative(W.resolve(t),r);return n===""||W.isAbsolute(n)||n===".."||n.startsWith(`..${W.sep}`)?null:n.replaceAll("\\","/")}function $c(t){return process.platform==="win32"?t.toLowerCase():t}async function mo(t,e,r=[]){let n=W.isAbsolute(e)?W.resolve(e):W.resolve(t,e),i=W.resolve(t);if(!Dc(i,n)||r.some(c=>Dc(W.resolve(c),n)))return null;let o=tm(t,e);if(!o)return null;let a=(await em(t)).allow_paths.find(c=>{let l=$c(o),u=$c(c);return l===u||l.startsWith(`${u}/`)});return a?`${o} (configured Hook allow path: ${a})`:null}var em,go=T(()=>{"use strict";it();Xe();em=Ee("hookWritePolicy",async t=>(await io(t))?.hook??{allow_paths:[]})});var on=T(()=>{"use strict"});var Hc=T(()=>{"use strict"});var bo=T(()=>{"use strict";on()});var Yc=T(()=>{"use strict";on();bo()});var km,Jc=T(()=>{"use strict";km=nt(Ye(),1);Ce();we();Z()});var yb,Vc=T(()=>{"use strict";Ce();Z();yb=4*1024*1024});var zc=T(()=>{"use strict";on();Ce();Hc();Yc();we();Jc();Z();Xe();uo();Vc();go();co();bo()});import{TextDecoder as Sm}from"util";function Xc(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function Cm(t,e){try{return new Sm("utf-8",{fatal:!0}).decode(t.bytes)}catch(r){throw new Error(`${e} is not valid UTF-8`,{cause:r})}}async function vo(t,e,r,n,i={}){try{let o=await H(t,e,r,{label:n,hooks:i.hooks});return{result:o,text:Cm(o,n)}}catch(o){let s=o.code;if(s==="ENOENT"||s==="ENOTDIR")return null;throw o}}async function Qc(t,e,r,n,i={}){return(await vo(t,e,r,n,i))?.text??null}async function Zc(t,e,r,n,i,o={}){if(Buffer.byteLength(r,"utf8")>n)throw new Error(`${i} exceeds ${n} bytes`);let s=await vo(t,e,n,i),a=await B(t,e,{label:i,expected:"file"});await ee(a.target,r,{containedRoot:a.projectRoot,beforeCommit:async()=>{await o.beforeCommit?.();let c=await vo(t,e,n,i);if(!(!s&&!c)){if(!s||!c)throw new Error(`${i} changed before commit`);if(s.result.realPath!==c.result.realPath||!be(Xc(s.result.stat),Xc(c.result.stat))||s.text!==c.text)throw new Error(`${i} changed before commit`)}}})}async function el(t,e,r,n={}){let i=await B(t,e,{label:r,expected:"file"});return i.exists?ao(i.target,{containedRoot:i.projectRoot,beforeRemove:n.beforeRemove}):!1}var tl=T(()=>{"use strict";zc();Gr()});var sl={};jl(sl,{RUN_STATE_FILE:()=>an,applyRunStateToDocument:()=>nl,readRunState:()=>ko,removeRunState:()=>ol,runStateFromDocument:()=>sn,writeRunState:()=>So});import Em from"path";function Bt(t,e){let r=t[e];if(typeof r!="string"||r.length===0)throw new Error(`Invalid Run state: ${e} must be a non-empty string`);return r}function Mt(t,e){let r=Bt(t,e);if(Em.isAbsolute(r)||/^(?:[A-Za-z]:|[\\/]|~)/u.test(r)||r.split(/[\\/]/u).includes(".."))throw new Error(`Invalid Run state: ${e} must stay inside the change directory`);return r}function _m(t){let e=t.run_retries??"{}",r;try{r=typeof e=="string"?JSON.parse(e):e}catch(n){throw new Error("Invalid Run state: run_retries must be a JSON object",{cause:n})}if(!r||typeof r!="object"||Array.isArray(r))throw new Error("Invalid Run state: run_retries must be a JSON object");for(let n of Object.values(r))if(!Number.isInteger(n)||Number(n)<0)throw new Error("Invalid Run state: retry counts must be non-negative integers");return r}function sn(t){if(!t.run_id)return null;let e=Bt(t,"run_id"),r=Bt(t,"skill"),n=Bt(t,"skill_version"),i=Bt(t,"skill_hash"),o=Mt(t,"pending_ref"),s=Mt(t,"trajectory_ref"),a=Mt(t,"context_ref"),c=Mt(t,"artifacts_ref"),l=Mt(t,"checkpoint_ref"),u=Number(t.iteration);if(!Number.isInteger(u)||u<0)throw new Error("Invalid Run state: iteration must be a non-negative integer");if(t.orchestration!=="deterministic"&&t.orchestration!=="adaptive")throw new Error("Invalid Run state: orchestration must be deterministic or adaptive");if(t.run_status!=="running"&&t.run_status!=="waiting"&&t.run_status!=="completed"&&t.run_status!=="failed")throw new Error("Invalid Run state: run_status is invalid");return{runId:e,skill:r,skillVersion:n,skillHash:i,orchestration:t.orchestration,currentStep:rl(t,"current_step"),iteration:u,pending:rl(t,"pending"),pendingRef:o,trajectoryRef:s,contextRef:a,artifactsRef:c,checkpointRef:l,status:t.run_status,retries:_m(t)}}function nl(t,e){e?t.run_id=e.runId:delete t.run_id}function Pm(t){return{runId:t.runId,skill:t.skill,skillVersion:t.skillVersion,skillHash:t.skillHash,orchestration:t.orchestration,currentStep:t.currentStep,iteration:t.iteration,pending:t.pending,pendingRef:t.pendingRef,trajectoryRef:t.trajectoryRef,contextRef:t.contextRef,artifactsRef:t.artifactsRef,checkpointRef:t.checkpointRef,status:t.status,retries:t.retries}}function xm(t){let e={run_id:t.runId,skill:t.skill,skill_version:t.skillVersion,skill_hash:t.skillHash,orchestration:t.orchestration,current_step:t.currentStep,iteration:t.iteration,pending:t.pending,pending_ref:t.pendingRef,trajectory_ref:t.trajectoryRef,context_ref:t.contextRef,artifacts_ref:t.artifactsRef,checkpoint_ref:t.checkpointRef,run_status:t.status,run_retries:JSON.stringify(t.retries)};return sn(e)}async function ko(t,e={}){let r=await Qc(t,an,il,"Run state",e);if(r===null)return null;let n=JSON.parse(r);return xm(n)}async function So(t,e,r={}){await Zc(t,an,JSON.stringify(Pm(e),null,2),il,"Run state",r)}async function ol(t,e={}){await el(t,an,"Run state",e)}var rl,an,il,cn=T(()=>{"use strict";tl();rl=(t,e)=>{let r=t[e];return r==null?null:String(r)};an=".comet/run-state.json",il=256*1024});import{promises as pn,readFileSync as Qm}from"fs";import K from"path";function Ao(t){return t.charCodeAt(0)===65279?t.slice(1):t}it();import{promises as Bh}from"fs";import F from"path";import{promises as Ll}from"fs";async function gn(t){try{return await Ll.access(t),!0}catch(e){if(Wl(e))return!1;throw e}}function Wl(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}we();Xe();uo();Z();var Ze=class extends Error{code="classic-layout-unavailable";constructor(e="Classic artifact layout is unavailable from .comet/config.yaml"){super(e),this.name="ClassicLayoutUnavailableError"}},Tc=".comet/config.yaml";function Fh(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function Kh(t){await B(t,Tc,{label:Tc,expected:"file"})}function Ic(t,e){let r=F.resolve(t),n=e==="docs"?F.join(r,"docs"):r,i=F.join(n,"openspec"),o=F.join(r,"docs","superpowers");return{projectRoot:r,artifactLayout:e,openSpecBase:n,openSpecRoot:i,changesDir:F.join(i,"changes"),archiveDir:F.join(i,"changes","archive"),specsDir:F.join(i,"specs"),superpowersRoot:o,superpowersSpecsDir:F.join(o,"specs"),superpowersPlansDir:F.join(o,"plans"),superpowersReportsDir:F.join(o,"reports")}}async function Uh(t){await Kh(t);let e=await zr(t,{allowPartialProject:!0,allowMissingNativeFields:!0});if(!e?.config)throw new Ze;if(!(e.config.workflows??[e.config.default_workflow]).includes("classic"))throw new Ze("Classic artifact layout is unavailable because Classic is not enabled");return e.classic?.artifact_layout??"legacy"}async function Gh(t,e){return Ic(t,e??await Uh(t))}async function Hh(t){try{return await Bh.lstat(t),!0}catch(e){if(Fh(e))return!1;throw e}}async function Yh(t,e){let r=await Gh(t,e),n=r.artifactLayout==="legacy"?"docs":"legacy",i=Ic(t,n).openSpecRoot,[o,s]=await Promise.all([B(r.projectRoot,L(r.projectRoot,r.openSpecRoot),{label:"Configured Classic OpenSpec root",expected:"directory"}),Hh(i)]),a=o.exists;return{paths:r,configuredRootExists:a,alternateRoot:i,alternateRootExists:s,dualRoots:a&&s}}async function Jh(t){let e=[t.openSpecRoot,t.changesDir,t.archiveDir,t.specsDir,t.superpowersRoot,t.superpowersSpecsDir,t.superpowersPlansDir,t.superpowersReportsDir];for(let r of e){let n=L(t.projectRoot,r);await B(t.projectRoot,n,{label:`Classic managed physical path ${n}`,expected:"directory"})}}async function Te(t,e){let r=await Yh(t,e);if(await Jh(r.paths),!r.configuredRootExists){let n=L(r.paths.projectRoot,r.paths.openSpecRoot),i=L(r.paths.projectRoot,r.alternateRoot);throw new Ze(`Configured Classic OpenSpec root is missing: ${n} (alternate ${i} is ${r.alternateRootExists?"present":"missing"})`)}return r.paths}async function fo(t,e){let r=F.join(F.resolve(t),".comet","classic-root-move.json");if(await gn(r))throw new Error("Classic root move transaction is incomplete; inspect it with comet doctor and recover it explicitly before writing");let n=await Te(t,e);if(!await gn(n.openSpecRoot))throw new Error(`Configured Classic OpenSpec root is missing: ${L(n.projectRoot,n.openSpecRoot)}`);return n}function L(t,e){return F.relative(F.resolve(t),e).replaceAll("\\","/")}import qc from"path";Ce();we();Z();import Dt from"path";var Ly=2*1024*1024;function zh(t,e,r){let n=Dt.resolve(t),i=Dt.isAbsolute(e)?Dt.resolve(e):Dt.resolve(n,e),o=Dt.relative(n,i).replaceAll("\\","/");return{root:n,relative:Ve(o,r),target:i}}async function et(t,e,r){let n=zh(t,e,r.label);return B(n.root,n.relative,r)}async function jc(t,e,r){return(await et(t,e,{label:r.label,expected:r.expected??"any"})).exists}function po(t){return t?/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u.test(t)?t.includes("..")?"Change name cannot contain '..' (path traversal not allowed)":null:`Invalid change name: '${t}'
143
+ Valid format: lowercase kebab-case (a-z, 0-9, single hyphens)`:"Change name cannot be empty"}function en(t){let e=po(t);if(e)throw new Error(e)}function Xh(t,e){return{label:L(t,e),directory:e}}async function Qh(t,e,r){let n=Xh(t,e);if(!(await et(t,e,{label:r,expected:"directory"})).exists)return{change:n,exists:!1,stateExists:!1};let o=await et(t,qc.join(e,".comet.yaml"),{label:`${r} state`,expected:"file"});return{change:n,exists:!0,stateExists:o.exists}}async function tt(t,e=process.cwd()){en(t);let r=await Te(e),n=await Qh(r.projectRoot,qc.join(r.changesDir,t),`Classic active change ${t}`);return{...n.change,exists:n.exists,stateExists:n.stateExists}}import{promises as ho}from"fs";import U from"path";function Lc(t,e){let r=U.relative(t,e);return r===""||r!==".."&&!r.startsWith(`..${U.sep}`)&&!U.isAbsolute(r)}async function Zh(t){let e=U.resolve(t),r=U.parse(e).root,n=[],i=e;for(;i&&i!==r;)try{let o=await ho.realpath(i);return U.join(o,...n.reverse())}catch(o){let s=o.code;if(s!=="ENOENT"&&s!=="ENOTDIR")throw o;n.push(U.basename(i)),i=U.dirname(i)}try{let o=await ho.realpath(r);return U.join(o,...n.reverse())}catch{return null}}async function Wc(t,e){let r=U.resolve(t),n=await ho.realpath(r),i=[],o=[];for(let s of e){let a=U.isAbsolute(s)?U.resolve(s):U.resolve(r,s),c=await Zh(a);((c?Lc(n,c):Lc(r,a))?i:o).push(s)}return{projectTargets:i,externalTargets:o}}go();var wo=nt(Ye(),1);it();import{execFileSync as Mc}from"child_process";import{randomUUID as rm}from"crypto";import{promises as $t}from"fs";import Bc from"path";function nm(t){try{let e=Mc("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();return e&&e!=="HEAD"?e:null}catch{return null}}var im=mn("liveGitBranch",t=>nm(t));function om(t){try{return Mc("git",["rev-parse","--is-inside-work-tree"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()==="true"}catch{return!1}}var sm=mn("isGitWorkTree",t=>om(t)),am=["current","branch","worktree"];function Fc(t){return am.includes(t)}function cm(t){return Fc(t.isolation)?t.boundBranch===null&&t.currentBranch===null&&t.gitWorkTree===!1?{status:"not-applicable"}:t.boundBranch===null?t.currentBranch===null?{status:"unbound-detached"}:{status:"needs-heal",branch:t.currentBranch}:t.currentBranch===t.boundBranch?{status:"ok"}:{status:"drift",boundBranch:t.boundBranch,currentBranch:t.currentBranch}:{status:"not-applicable"}}async function tn(t,e){let r=Bc.join(t,".comet.yaml"),n=(0,wo.parseDocument)(await $t.readFile(r,"utf8"),{uniqueKeys:!1});if(n.errors.length>0)throw new Error(`Invalid .comet.yaml: ${n.errors[0].message}`);let i=n.toJS()??{},o=typeof i.isolation=="string"?i.isolation:null,s=typeof i.bound_branch=="string"&&i.bound_branch!==""?i.bound_branch:null,a=Fc(o),c=im(e.cwd),l=a&&s===null&&c===null?sm(e.cwd):!0,u=cm({isolation:o,boundBranch:s,currentBranch:c,gitWorkTree:l});return u.status==="needs-heal"&&e.heal?(await lm(t,u.branch),{status:"healed",branch:u.branch,bindingRequired:a,currentBranch:c}):{...u,bindingRequired:a,currentBranch:c}}async function lm(t,e){let r=Bc.join(t,".comet.yaml"),n=(0,wo.parseDocument)(await $t.readFile(r,"utf8"),{uniqueKeys:!1});n.set("bound_branch",e);let i=`${r}.${rm()}.tmp`;try{await $t.writeFile(i,n.toString(),"utf8"),await $t.rename(i,r)}catch(o){throw await $t.rm(i,{force:!0}),o}}function um(t){return t??"detached HEAD"}function rn(t,e,r){return`change '${t}' is bound to branch '${e}', but current branch is '${um(r)}'`}function nn(t){return`change '${t}' uses a branch-bound workspace mode but has no bound branch and HEAD is detached; checkout a branch first before continuing.`}ro();import fm from"path";var yo="comet.selection.v2",dm=16*1024;function Uc(t){return fm.join(t,".comet","current-change.json")}function pm(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}function Kc(t){return t===null||typeof t=="string"}function hm(t){let e;try{e=JSON.parse(t)}catch(r){throw new Error(`current change selection contains invalid JSON: ${r instanceof Error?r.message:String(r)}`,{cause:r})}if(!pm(e))throw new Error("current change selection must be a JSON object");if(e.version===1){if(typeof e.change!="string")throw new Error("legacy current change selection change must be a string");if(e.branch!==void 0&&!Kc(e.branch))throw new Error("legacy current change selection branch must be a string or null");return{selection:{schema:yo,workflow:"classic",change:e.change,branch:e.branch??null},legacy:!0}}if(e.schema!==yo)throw new Error(`current change selection schema must be ${yo}`);if(e.workflow!=="native"&&e.workflow!=="classic")throw new Error("current change selection workflow must be native or classic");if(typeof e.change!="string")throw new Error("current change selection change must be a string");if(!Kc(e.branch))throw new Error("current change selection branch must be a string or null");if(e.workflow==="native"&&e.branch!==null)throw new Error("Native current change selection branch must be null");return{selection:e,legacy:!1}}async function Gc(t){let e;try{let n=Uc(t),{bytes:i}=await Jr(n,dm,{label:"current change selection"});e=i.toString("utf8")}catch(n){if(n.code==="ENOENT")return{status:"missing"};throw new Error(`cannot read current change selection: ${n instanceof Error?n.message:String(n)}`,{cause:n})}return{status:"selected",...hm(e)}}it();var fn=nt(Ye(),1);Ce();Z();import un from"path";cn();var Eo=["full","hotfix","tweak"],al=1,ll=["open","design","build","verify","archive"],Am=["en","zh-CN"],Nm=["off","beta"],Om=["subagent-driven-development","executing-plans","direct"],Rm=["plan-ready"],Tm=["confirmed"],Im=["tdd","direct"],jm=["off","standard","thorough"],qm=["current","branch","worktree"],Lm=["light","full"],Wm=["pending","pass","fail"],Dm=["pending","handled"],$m=["pending","confirmed"],_o=["workflow","language","phase","context_compression","build_mode","build_pause","subagent_dispatch","tdd_mode","review_mode","isolation","bound_branch","verify_mode","auto_transition","base_ref","design_doc","plan","verify_result","verify_failures","verification_report","branch_status","created_at","verified_at","archive_confirmation","archived","direct_override","handoff_context","handoff_hash","classic_profile","classic_migration"],Mm=["run_id"],ul=new Set([..._o,...Mm]),Bm=["workflow","phase","design_doc","plan","build_mode","isolation","verify_mode","verify_result","verified_at","archived"];function cl(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function rt(t,e){let r=t[e];if(r==null||r==="")return null;if(typeof r!="string")throw new Error(`Invalid Classic state: ${e} must be a string or null`);return r}function D(t,e,r,n=!0){let i=t[e];if(i==null||i===""){if(n)return null;throw new Error(`Invalid Classic state: ${e} is required`)}if(typeof i!="string"||!r.includes(i))throw new Error(`Invalid Classic state: ${e} must be one of ${r.join(", ")}${n?" or null":""}`);return i}function Co(t,e,r=!0){let n=t[e];if(n==null||n===""){if(r)return null;throw new Error(`Invalid Classic state: ${e} is required`)}if(typeof n!="boolean")throw new Error(`Invalid Classic state: ${e} must be true or false`);return n}function Fm(t,e,r=0){let n=t[e];if(n==null||n==="")return r;if(typeof n!="number"||!Number.isInteger(n)||n<0)throw new Error(`Invalid Classic state: ${e} must be a non-negative integer`);return n}function ln(t,e){let r=rt(t,e);if(r===null)return null;if(/^(?:[A-Za-z]:|[\\/]|~)/u.test(r)||r.split(/[\\/]/u).includes(".."))throw new Error(`Invalid Classic state: ${e} must be a relative repository path`);return r}function Km(t,e){let r=rt(t,e);if(r!==null&&!/^[a-f0-9]{64}$/u.test(r))throw new Error(`Invalid Classic state: ${e} must be a sha256 hex digest`);return r}function Um(t){let e=t.classic_migration;if(e==null||e==="")return null;if(e!==al)throw new Error(`Invalid Classic state: classic_migration must be ${al}`);return e}function Gm(t){if(!_o.some(r=>cl(t,r)))return null;for(let r of Bm)if(!cl(t,r))return null;return{workflow:D(t,"workflow",Eo,!1),language:D(t,"language",Am),phase:D(t,"phase",ll,!1),contextCompression:D(t,"context_compression",Nm),buildMode:D(t,"build_mode",Om),buildPause:D(t,"build_pause",Rm),subagentDispatch:D(t,"subagent_dispatch",Tm),tddMode:D(t,"tdd_mode",Im),reviewMode:D(t,"review_mode",jm),isolation:D(t,"isolation",qm),boundBranch:rt(t,"bound_branch"),verifyMode:D(t,"verify_mode",Lm),autoTransition:Co(t,"auto_transition"),baseRef:rt(t,"base_ref"),designDoc:ln(t,"design_doc"),plan:ln(t,"plan"),verifyResult:D(t,"verify_result",Wm,!1),verifyFailures:Fm(t,"verify_failures"),verificationReport:ln(t,"verification_report"),branchStatus:D(t,"branch_status",Dm),createdAt:rt(t,"created_at"),verifiedAt:rt(t,"verified_at"),archiveConfirmation:D(t,"archive_confirmation",$m),archived:Co(t,"archived",!1),directOverride:Co(t,"direct_override"),handoffContext:ln(t,"handoff_context"),handoffHash:Km(t,"handoff_hash"),classicProfile:D(t,"classic_profile",Eo),classicMigration:Um(t)}}function fl(t,e){let r=e??null;if(r===null&&e===void 0&&t.run_id&&t.skill)try{r=sn(t)}catch(n){let i=n instanceof Error?n.message:String(n);throw new Error(i.replace(/^Invalid Run state:/u,"Invalid Classic state:"),{cause:n})}return{classic:Gm(t),run:r,unknownKeys:Object.keys(t).filter(n=>!ul.has(n))}}function dl(t){let e=t.workflow,r=t.phase,n=t.archived,i=t.design_doc;return{workflow:typeof e=="string"&&Eo.includes(e)?e:null,phase:typeof r=="string"&&ll.includes(r)?r:null,archived:n===!0,designDoc:typeof i=="string"&&i!==""?i:null,unknownKeys:Object.keys(t).filter(o=>!ul.has(o))}}cn();var Hm=2*1024*1024;function Ft(t){let e=t.toJS();if(e===null)return{};if(typeof e!="object"||Array.isArray(e))throw new Error("Invalid Classic state document: root must be a mapping");return e}function Ym(t){let e=["skill","skill_version","skill_hash","orchestration","current_step","iteration","pending","pending_ref","trajectory_ref","context_ref","artifacts_ref","checkpoint_ref","run_status","run_retries"];for(let r of e)t.delete(r)}function Jm(t){let e=!1;for(let r of["build_command","verify_command"])t.has(r)&&(t.delete(r),e=!0);return e}async function pl(t){let e;try{e=(await H(un.dirname(t),un.basename(t),Hm,{label:"Classic state document"})).bytes.toString("utf8")}catch(n){if(n.code!=="ENOENT")throw n;return new fn.Document({})}let r=(0,fn.parseDocument)(e);if(r.errors.length>0)throw new Error(`Invalid Classic state document: ${r.errors[0].message}`);return Ft(r),r}async function dn(t,e={}){let r=e.migrate!==!1,n=un.join(t,".comet.yaml"),i=await pl(n),o=Ft(i),s=Jm(i);s&&(o=Ft(i));let a=await ko(t);if(!a&&o.run_id&&o.skill){let{runStateFromDocument:c}=await Promise.resolve().then(()=>(cn(),sl));a=c(o),a&&r&&(await So(t,a),Ym(i),s=!0)}return s&&r&&await ee(n,i.toString(),{containedRoot:t}),fl(Ft(i),a)}async function hl(t){let e=await pl(un.join(t,".comet.yaml"));return dl(Ft(e))}var Vm=nt(Ye(),1);var bv=8*1024*1024;var zm=Ee("readCometCurrentSelection",t=>Gc(t));async function Xm(t,e){en(e);let r=await tt(e,t);if(!r.stateExists)throw new Error(`Cannot select current change '${e}': active change state not found`);let n=await dn(r.directory,{migrate:!1});if(!n.classic)throw new Error(`Cannot select current change '${e}': Classic state is incomplete`);if(n.classic.archived)throw new Error(`Cannot select current change '${e}': change is archived`);return r.directory}async function ml(t){let e;try{e=await zm(t)}catch(o){return{status:"stale",reason:o instanceof Error?o.message:String(o)}}if(e.status==="missing")return{status:"missing"};if(e.selection.workflow!=="classic")return{status:"stale",reason:`current change '${e.selection.change}' belongs to Native, not Classic`};let r=e.selection,n;try{n=await Xm(t,r.change)}catch(o){return{status:"stale",reason:o instanceof Error?o.message:String(o)}}let i=await tn(n,{heal:!1,cwd:t});return i.status==="drift"?{status:"stale",reason:rn(r.change,i.boundBranch,i.currentBranch)}:i.status==="unbound-detached"?{status:"stale",reason:nn(r.change)}:i.status==="ok"?{status:"selected",selection:r}:r.branch!==null&&i.currentBranch!==r.branch?{status:"stale",reason:`current change '${r.change}' was selected on branch '${r.branch}', current branch is '${i.currentBranch??"detached HEAD"}'`}:{status:"selected",selection:r}}import Ie from"node:path";async function gl(t,e){if(!e||e==="null")return{status:"missing",recordedPath:null};let r=await Te(t),n=Ie.resolve(t,e),i=Ie.relative(r.superpowersPlansDir,n);return Ie.isAbsolute(e)||!i||i.startsWith(`..${Ie.sep}`)||Ie.isAbsolute(i)||i.includes(Ie.sep)||Ie.extname(i).toLowerCase()!==".md"?{status:"broken",recordedPath:e}:await jc(t,e,{label:`Classic build plan ${e}`,expected:"file"})?{status:"ready",recordedPath:e}:{status:"broken",recordedPath:e}}function z(t,e){return{exitCode:t,stderr:e+`
144
+ `}}function V(t){return z(0,`[COMET-HOOK] allowed: ${t}`)}function Zm(){if(process.env.FILE_PATH)return process.env.FILE_PATH;if(process.stdin.isTTY)return"";let t=Ao(Qm(0,"utf8"));if(!t)return"";try{let e=JSON.parse(t);return typeof e.tool_input?.file_path=="string"?e.tool_input.file_path:""}catch{return""}}function Ut(t){return t.replaceAll("\\","/").replace(/\/+/gu,"/")}function je(t){let e=Ut(t);return process.platform==="win32"?e.toLowerCase():e}function eg(t){let e=t.indexOf("--project-root"),r=e>=0?t[e+1]:void 0;return K.resolve(r&&!r.startsWith("--")?r:process.cwd())}function wl(t,e){let r=Ut(K.relative(e,t));return r===""?"":r.startsWith("../")||r===".."||K.isAbsolute(r)?null:r}async function tg(t){let e=K.resolve(t),r=K.parse(e).root,n=[],i=e;for(;i&&i!==r;)try{let o=await pn.realpath(i);return K.join(o,...n.reverse())}catch(o){let s=o.code;if(s!=="ENOENT"&&s!=="ENOTDIR")throw o;n.push(K.basename(i)),i=K.dirname(i)}try{let o=await pn.realpath(r);return K.join(o,...n.reverse())}catch{return null}}async function rg(t,e){let r=K.isAbsolute(t)?t:K.resolve(e,t),n=Ut(r),i=wl(r,e);if(i!==null)return i;try{let o=await tg(r),s=await pn.realpath(e);if(o){let a=wl(o,s);if(a!==null)return a;n=Ut(o)}}catch{if(!K.isAbsolute(t))return Ut(t).replace(/^\.\//u,"")}return n.replace(/^\.\//u,"")}async function kl(t){try{let e=await dn(t,{migrate:!1}),r=Array.from(new Set(e.unknownKeys)).sort();if(r.length>0)throw new Error(`Invalid Classic state: unknown field(s): ${r.join(", ")}`);if(!e.classic)throw new Error("Classic state projection is unavailable");return{changeDir:t,phase:e.classic.phase,classic:e.classic,archived:e.classic.archived}}catch(e){let r=await hl(t);return r.phase?{changeDir:t,phase:r.phase,classic:null,archived:r.archived,invalidState:e instanceof Error&&e.message.includes("unknown field")}:null}}async function ng(t){let e=(await Te(t)).changesDir,r=[];if(!(await et(t,e,{label:"Classic changes directory",expected:"directory"})).exists)return r;for(let i of(await pn.readdir(e,{withFileTypes:!0})).sort((o,s)=>o.name.localeCompare(s.name))){if(i.name==="archive"||po(i.name))continue;let o=await tt(i.name,t);if(!o.exists||!o.stateExists)continue;let s=await kl(o.directory);!s||s.archived||r.push(s)}return r}var Po=Ee("classicActiveChanges",t=>ng(t)),Sl=Ee("classicPlanReadiness",gl);function Cl(t,e){return`${L(t,e.superpowersRoot)}/`}function El(t,e){return je(t).startsWith(je(e))}function ig(t,e){return[{prefix:`${L(t,e.superpowersSpecsDir)}/`,field:"designDoc",wireField:"design_doc",phase:"design"},{prefix:`${L(t,e.superpowersPlansDir)}/`,field:"plan",wireField:"plan",phase:"build"},{prefix:`${L(t,e.superpowersReportsDir)}/`,field:"verificationReport",wireField:"verification_report",phase:"verify"}]}function og(t,e){let r=je(t),n=e.find(o=>r.startsWith(je(o.prefix)));if(!n)return null;let i=r.slice(je(n.prefix).length);return!i||i.includes("/")||!i.endsWith(".md")?null:n}function _l(t,e){return t.classic?.[e.field]??null}function sg(t,e){return t.classic!==null&&t.phase===e.phase&&!_l(t,e)}async function yl(t,e,r){return sg(e,r)?!0:r.field!=="plan"||e.phase!=="build"?!1:(await Sl(t,e.classic?.plan??null)).status==="broken"}function Pl(t){return t.phase==="design"||t.phase==="build"||t.phase==="verify"}function ie(t){return t.changeDir?K.basename(t.changeDir):null}var ag=new Set(["design","plan","verify","verification","verification-report","report"]);function bl(t){return t.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&")}function cg(t,e){return[e.classic?.designDoc,e.classic?.plan,e.classic?.verificationReport].some(n=>n&&je(n)===je(t))}function lg(t,e){let n=(t.split("/").at(-1)??t).replace(/\.[^.]+$/u,"");if(n===e)return!0;let i=[...ag].map(bl).join("|");return new RegExp(`(^|[-_.])${bl(e)}[-_.](${i})$`,"u").test(n)}async function ug(t,e){let r=await Po(e),n=r.find(s=>cg(t,s));if(n)return{governing:n,match:"recorded"};let o=r.filter(Pl).filter(s=>{let a=ie(s);return a!==null&&lg(t,a)}).sort((s,a)=>(ie(a)?.length??0)-(ie(s)?.length??0))[0];return o?{governing:o,match:"named"}:null}async function vl(t,e,r){let n=await Po(t);if(n.length===0)return null;if(r)return n.find(s=>ie(s)===r)??{blockedResult:Kt(e,`selected change '${r}' is no longer active`)};let i=await ml(t);if(i.status==="stale")return{blockedResult:Kt(e,i.reason)};if(i.status==="selected"){let o=n.find(s=>ie(s)===i.selection.change);return o||{blockedResult:Kt(e,`selected change '${i.selection.change}' is no longer active`)}}if(n.length===1){let o=n[0];if(o.changeDir!==null){let s=await tn(o.changeDir,{heal:!1,cwd:t}),a=ie(o)??"unknown";if(s.status==="drift")return{blockedResult:Kt(e,rn(a,s.boundBranch,s.currentBranch))};if(s.status==="unbound-detached")return{blockedResult:Kt(e,nn(a))}}return o}return{blockedResult:vg(e,n.map(o=>ie(o)).filter(Boolean))}}async function fg(t,e,r,n){let i=`${L(e,r.changesDir)}/`;if(t.startsWith(i)){let o=t.slice(i.length),[s]=o.split("/");if(s&&s!=="archive"){let a=await tt(s,e);if(a.stateExists){let c=await kl(a.directory);return c||{changeDir:a.directory,phase:"open",classic:null,archived:!1}}return{changeDir:a.directory,phase:"open",classic:null,archived:!1}}}if(El(t,Cl(e,r))){let o=await ug(t,e);if(o?.match==="recorded")return{...o.governing,superpowersArtifact:"matched"};let s=og(t,ig(e,r));if(o)return s?{...o.governing,superpowersArtifact:await yl(e,o.governing,s)?"matched":"unmatched",superpowersSlot:s}:{...o.governing,superpowersArtifact:"matched"};if(s){let l=await vl(e,t,n);return!l||"blockedResult"in l?l:{...l,superpowersArtifact:await yl(e,l,s)?"matched":"unmatched",superpowersSlot:s}}let a=await Po(e),c=n?a.find(l=>ie(l)===n)??null:a[0]??null;return c?{...c,superpowersArtifact:"unmatched"}:null}return vl(e,t,n)}function dg(t){return!t.includes("/")&&t.endsWith(".md")}function pg(t){return t.startsWith(".comet/")||t.includes("/.comet/")}function hg(t){return t===".superpowers"||t.startsWith(".superpowers/")}function mg(t,e,r){if(!t.startsWith(r))return null;let n=t.endsWith("/.comet.yaml")||t.endsWith("/.openspec.yaml"),i=t.endsWith("/proposal.md")||t.endsWith("/design.md")||t.endsWith("/tasks.md"),o=t.includes("/.comet/"),s=t.includes("/specs/");return e==="open"&&(i||n||o||s)?`${t} (phase: open, openspec artifacts)`:e==="design"&&(i||n||o||s)?`${t} (phase: design, handoff/spec)`:e==="build"&&(t.endsWith("/tasks.md")||n||s)?`${t} (phase: build, spec/tasks)`:e==="verify"&&(t.endsWith("/tasks.md")||n)?`${t} (phase: verify, tasks/state)`:e==="archive"&&n?`${t} (phase: archive, state)`:null}function gg(t,e){let r=e==="open"?[" BLOCKED: source writes are not allowed during open"," This phase does not allow source writes"," ALLOWED: create proposal/design/tasks artifacts and run guard"," NEXT: finish clarification and artifacts, then run guard --apply"]:e==="design"?[" BLOCKED: source writes are not allowed during design"," This phase does not allow source writes"," ALLOWED: run brainstorming, create the Design Doc, and run guard"," NEXT: finish the Design Doc, then run comet guard <change-name> design --apply to enter build"]:[" BLOCKED: source writes are not allowed during archive"," This phase does not allow source writes"," ALLOWED: confirm archive state and run the archive script"];return z(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝","",` Current phase: ${e}`,` Target file: ${t}`,"",...r,""].join(`
145
+ `))}function wg(t){return z(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝",""," Current phase: build (workflow: full), but design_doc is empty",` Target file: ${t}`,""," BLOCKED: full workflow source writes require a recorded Design Doc"," This phase does not allow source writes until design_doc is recorded"," NEXT: return to design, create/link the Design Doc, then run guard again",""].join(`
146
+ `))}function yg(t,e,r,n,i){let o=ie(e)??"<change-name>",s=r.status==="missing",a=s?"classic-build-plan-missing":"classic-build-plan-broken",c=s?"plan is not recorded":"the recorded plan path does not resolve to a file",l=s?[]:[`RECORDED_PLAN: ${r.recordedPath}`],u=e.changeDir?L(n,e.changeDir):"<classic-change-dir>",f=L(n,i.superpowersPlansDir),d=s?`comet state set ${o} plan <repository-relative-plan-path>`:`comet state set ${o} plan <new-repository-relative-plan-path>`,m=s?["2. Load the Superpowers writing-plans Skill.",`3. Read the Design Doc path from "comet state get ${o} design_doc" and read ${u}/tasks.md.`,`4. Create the implementation plan under ${f}/.`,"5. Record the plan path:",` ${d}`]:[`2. Restore the plan file at ${r.recordedPath}, or load the Superpowers writing-plans Skill and create a replacement under ${f}/.`,"3. When creating a replacement, record its path:",` ${d}`];return z(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝","",`ERROR_CODE: ${a}`,`CHANGE: ${o}`,"WORKFLOW: full","PHASE: build",`TARGET: ${t}`,`STATE: ${c}`,...l,"","BLOCKED: project source writes require a ready Superpowers implementation plan.","","ALLOWED_RECOVERY_WRITES:",`- ${f}/<plan-file>.md`,"- Comet state updates performed by the comet CLI",`- ${u} artifacts allowed by the build phase`,"","RECOVERY:",`1. Invoke /comet-build for ${o} and resume Step 1.`,...m,`${s?"6":"4"}. Verify recovery:`,` comet state check ${o} build --recover`,"","SUCCESS: plan is reported as DONE and recovery advances beyond plan creation.",`RETRY: retry the original Write/Edit for ${t} only after SUCCESS.`,"PROHIBITED: do not treat tasks.md as the implementation plan or write project source before SUCCESS.","If writing-plans is unavailable, stop and report the missing Skill instead of bypassing this check.",""].join(`
147
+ `))}function bg(t,e){let r=e.superpowersSlot,n=r?_l(e,r):null,i=r?e.phase!==r.phase?[` BLOCKED: ${r.wireField} cannot be first-written in phase ${e.phase}`,` Expected phase: ${r.phase}`," NEXT: resume the matching Comet phase or use an already recorded artifact path"]:n?[` BLOCKED: ${r.wireField} is already recorded for this change`,` Recorded path: ${n}`," NEXT: write the recorded artifact or explicitly correct the state path"]:[" BLOCKED: standard Superpowers artifact state is incomplete"," NEXT: validate the active change state, then retry the matching phase"]:[" BLOCKED: unmatched Superpowers artifact"," This docs/superpowers/ path does not match any active change artifact"," NEXT: use a recorded artifact path or a standard phase artifact directory"];return z(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝","",` Current phase: ${e.phase}`,` Target file: ${t}`,"",...i,""].join(`
148
+ `))}function vg(t,e){return z(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝",""," BLOCKED: multiple active changes require a current change",` Target file: ${t}`,` Active changes: ${e.join(", ")}`,""," NEXT: run comet state select <change-name>, then retry the source write",""].join(`
149
+ `))}function Kt(t,e){return z(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝",""," BLOCKED: current change selection is stale or invalid",` Target file: ${t}`,` Reason: ${e}`,""," NEXT: run comet state select <change-name>, then retry the source write",""].join(`
150
+ `))}async function kg(t,e,r,n=Wc){try{if((await n(t,[e])).projectTargets.length===0)return V(`${e} (outside guarded project)`)}catch(u){return z(2,[`[COMET-HOOK] blocked: scope could not be determined safely for ${e}.`,`REASON: ${u instanceof Error?u.message:String(u)}`,"NEXT: verify that the project root is accessible, then retry the write."].join(`
151
+ `))}let i=await rg(e,t),o;try{o=await fo(t)}catch(u){return z(2,`[COMET-HOOK] blocked: ${u instanceof Error?u.message:String(u)}`)}if(pg(i))return V(`${i} (whitelist: comet config)`);if(hg(i))return V(`${i} (whitelist: superpowers workspace)`);if(i==="CLAUDE.md"||i==="CHANGELOG.md"||i==="README.md"||dg(i))return V(`${i} (whitelist: root markdown)`);let s=await mo(t,e,[K.join(t,".comet"),o.openSpecRoot,o.superpowersRoot]);if(s)return V(s);let a;try{a=await fg(i,t,o,r)}catch(u){return z(2,`[COMET-HOOK] blocked: ${u instanceof Error?u.message:String(u)}`)}if(!a)return V("no active comet change");if("blockedResult"in a)return a.blockedResult;if(a.archived)return V(`${i} (own change archived)`);let c=a.phase,l=mg(i,c,`${L(t,o.openSpecRoot)}/`);if(l)return V(l);if(El(i,Cl(t,o))){if(a.superpowersArtifact==="matched"&&Pl(a))return V(`${i} (phase: ${c}, superpowers)`);if(a.superpowersArtifact==="unmatched")return bg(i,a)}if(a.invalidState)return z(2,`[COMET-HOOK] blocked: active Classic state is invalid; repair .comet.yaml before writing ${i}`);if(c==="build"&&a.classic?.workflow==="full"&&!a.classic.designDoc)return wg(i);if(c==="build"&&a.classic?.workflow==="full"){let u=await Sl(t,a.classic.plan);if(u.status!=="ready")return yg(i,a,u,t,o)}return c==="build"||c==="verify"?V(`${i} (phase: ${c})`):gg(i,c)}var xl=async t=>{let e=eg(t),r=Zm();return r?kg(e,r):V("no file path in tool input")};function Sg(t,e){return{exitCode:e.exitCode,stdout:JSON.stringify({command:t,exitCode:e.exitCode,...e.stdout===void 0?{}:{stdout:e.stdout},...e.stderr===void 0?{}:{stderr:e.stderr}})+`
152
+ `}}async function Al(t,e,r=process.argv.slice(2)){let n=r.includes("--json"),i=r.filter(a=>a!=="--json"),o;try{o=await e(i,{json:n})}catch(a){o={exitCode:70,stderr:a instanceof Error?a.message:String(a)}}let s=n?Sg(t,o):o;return s.stdout&&process.stdout.write(s.stdout),s.stderr&&process.stderr.write(s.stderr+(s.stderr.endsWith(`
153
153
  `)?"":`
154
- `)),s.exitCode}process.exitCode=await Pl("hook-guard",El);
154
+ `)),s.exitCode}process.exitCode=await Al("hook-guard",xl);