openspecui 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (304) hide show
  1. package/dist/cli.mjs +4537 -49
  2. package/dist/index.mjs +1 -1
  3. package/dist/{src-CNuprcB-.mjs → src-D7s-EgJ2.mjs} +216 -29
  4. package/package.json +8 -5
  5. package/web/assets/abap-BdImnpbu.js +1 -0
  6. package/web/assets/actionscript-3-CfeIJUat.js +1 -0
  7. package/web/assets/ada-bCR0ucgS.js +1 -0
  8. package/web/assets/andromeeda-C-Jbm3Hp.js +1 -0
  9. package/web/assets/angular-html-CU67Zn6k.js +1 -0
  10. package/web/assets/angular-ts-BwZT4LLn.js +1 -0
  11. package/web/assets/apache-Pmp26Uib.js +1 -0
  12. package/web/assets/apex-DDbsPZ6N.js +1 -0
  13. package/web/assets/apl-dKokRX4l.js +1 -0
  14. package/web/assets/applescript-Co6uUVPk.js +1 -0
  15. package/web/assets/ara-BRHolxvo.js +1 -0
  16. package/web/assets/asciidoc-Dv7Oe6Be.js +1 -0
  17. package/web/assets/asm-D_Q5rh1f.js +1 -0
  18. package/web/assets/astro-CbQHKStN.js +1 -0
  19. package/web/assets/aurora-x-D-2ljcwZ.js +1 -0
  20. package/web/assets/awk-DMzUqQB5.js +1 -0
  21. package/web/assets/ayu-dark-Cv9koXgw.js +1 -0
  22. package/web/assets/ballerina-BFfxhgS-.js +1 -0
  23. package/web/assets/bat-BkioyH1T.js +1 -0
  24. package/web/assets/beancount-k_qm7-4y.js +1 -0
  25. package/web/assets/berry-uYugtg8r.js +1 -0
  26. package/web/assets/bibtex-CHM0blh-.js +1 -0
  27. package/web/assets/bicep-Bmn6On1c.js +1 -0
  28. package/web/assets/blade-DVc8C-J4.js +1 -0
  29. package/web/assets/bsl-BO_Y6i37.js +1 -0
  30. package/web/assets/c-BIGW1oBm.js +1 -0
  31. package/web/assets/cadence-Bv_4Rxtq.js +1 -0
  32. package/web/assets/cairo-KRGpt6FW.js +1 -0
  33. package/web/assets/catppuccin-frappe-DFWUc33u.js +1 -0
  34. package/web/assets/catppuccin-latte-C9dUb6Cb.js +1 -0
  35. package/web/assets/catppuccin-macchiato-DQyhUUbL.js +1 -0
  36. package/web/assets/catppuccin-mocha-D87Tk5Gz.js +1 -0
  37. package/web/assets/clarity-D53aC0YG.js +1 -0
  38. package/web/assets/clojure-P80f7IUj.js +1 -0
  39. package/web/assets/cmake-D1j8_8rp.js +1 -0
  40. package/web/assets/cobol-nwyudZeR.js +1 -0
  41. package/web/assets/codeowners-Bp6g37R7.js +1 -0
  42. package/web/assets/codeql-DsOJ9woJ.js +1 -0
  43. package/web/assets/coffee-Ch7k5sss.js +1 -0
  44. package/web/assets/common-lisp-Cg-RD9OK.js +1 -0
  45. package/web/assets/coq-DkFqJrB1.js +1 -0
  46. package/web/assets/cpp-CofmeUqb.js +1 -0
  47. package/web/assets/crystal-tKQVLTB8.js +1 -0
  48. package/web/assets/csharp-K5feNrxe.js +1 -0
  49. package/web/assets/css-DPfMkruS.js +1 -0
  50. package/web/assets/csv-fuZLfV_i.js +1 -0
  51. package/web/assets/cue-D82EKSYY.js +1 -0
  52. package/web/assets/cypher-COkxafJQ.js +1 -0
  53. package/web/assets/d-85-TOEBH.js +1 -0
  54. package/web/assets/dark-plus-C3mMm8J8.js +1 -0
  55. package/web/assets/dart-CF10PKvl.js +1 -0
  56. package/web/assets/dax-CEL-wOlO.js +1 -0
  57. package/web/assets/desktop-BmXAJ9_W.js +1 -0
  58. package/web/assets/diff-D97Zzqfu.js +1 -0
  59. package/web/assets/docker-BcOcwvcX.js +1 -0
  60. package/web/assets/dotenv-Da5cRb03.js +1 -0
  61. package/web/assets/dracula-BzJJZx-M.js +1 -0
  62. package/web/assets/dracula-soft-BXkSAIEj.js +1 -0
  63. package/web/assets/dream-maker-BtqSS_iP.js +1 -0
  64. package/web/assets/edge-BkV0erSs.js +1 -0
  65. package/web/assets/elixir-CDX3lj18.js +1 -0
  66. package/web/assets/elm-DbKCFpqz.js +1 -0
  67. package/web/assets/emacs-lisp-C9XAeP06.js +1 -0
  68. package/web/assets/erb-BOJIQeun.js +1 -0
  69. package/web/assets/erlang-DsQrWhSR.js +1 -0
  70. package/web/assets/everforest-dark-BgDCqdQA.js +1 -0
  71. package/web/assets/everforest-light-C8M2exoo.js +1 -0
  72. package/web/assets/fennel-BYunw83y.js +1 -0
  73. package/web/assets/fish-BvzEVeQv.js +1 -0
  74. package/web/assets/fluent-C4IJs8-o.js +1 -0
  75. package/web/assets/fortran-fixed-form-BZjJHVRy.js +1 -0
  76. package/web/assets/fortran-free-form-D22FLkUw.js +1 -0
  77. package/web/assets/fsharp-CXgrBDvD.js +1 -0
  78. package/web/assets/gdresource-B7Tvp0Sc.js +1 -0
  79. package/web/assets/gdscript-DTMYz4Jt.js +1 -0
  80. package/web/assets/gdshader-DkwncUOv.js +1 -0
  81. package/web/assets/genie-D0YGMca9.js +1 -0
  82. package/web/assets/gherkin-DyxjwDmM.js +1 -0
  83. package/web/assets/git-commit-F4YmCXRG.js +1 -0
  84. package/web/assets/git-rebase-r7XF79zn.js +1 -0
  85. package/web/assets/github-dark-DHJKELXO.js +1 -0
  86. package/web/assets/github-dark-default-Cuk6v7N8.js +1 -0
  87. package/web/assets/github-dark-dimmed-DH5Ifo-i.js +1 -0
  88. package/web/assets/github-dark-high-contrast-E3gJ1_iC.js +1 -0
  89. package/web/assets/github-light-DAi9KRSo.js +1 -0
  90. package/web/assets/github-light-default-D7oLnXFd.js +1 -0
  91. package/web/assets/github-light-high-contrast-BfjtVDDH.js +1 -0
  92. package/web/assets/gleam-BspZqrRM.js +1 -0
  93. package/web/assets/glimmer-js-Rg0-pVw9.js +1 -0
  94. package/web/assets/glimmer-ts-U6CK756n.js +1 -0
  95. package/web/assets/glsl-DplSGwfg.js +1 -0
  96. package/web/assets/gnuplot-DdkO51Og.js +1 -0
  97. package/web/assets/go-Dn2_MT6a.js +1 -0
  98. package/web/assets/graphql-ChdNCCLP.js +1 -0
  99. package/web/assets/groovy-gcz8RCvz.js +1 -0
  100. package/web/assets/gruvbox-dark-hard-CFHQjOhq.js +1 -0
  101. package/web/assets/gruvbox-dark-medium-GsRaNv29.js +1 -0
  102. package/web/assets/gruvbox-dark-soft-CVdnzihN.js +1 -0
  103. package/web/assets/gruvbox-light-hard-CH1njM8p.js +1 -0
  104. package/web/assets/gruvbox-light-medium-DRw_LuNl.js +1 -0
  105. package/web/assets/gruvbox-light-soft-hJgmCMqR.js +1 -0
  106. package/web/assets/hack-CaT9iCJl.js +1 -0
  107. package/web/assets/haml-B8DHNrY2.js +1 -0
  108. package/web/assets/handlebars-BL8al0AC.js +1 -0
  109. package/web/assets/haskell-Df6bDoY_.js +1 -0
  110. package/web/assets/haxe-CzTSHFRz.js +1 -0
  111. package/web/assets/hcl-BWvSN4gD.js +1 -0
  112. package/web/assets/hjson-D5-asLiD.js +1 -0
  113. package/web/assets/hlsl-D3lLCCz7.js +1 -0
  114. package/web/assets/houston-DnULxvSX.js +1 -0
  115. package/web/assets/html-GMplVEZG.js +1 -0
  116. package/web/assets/html-derivative-BFtXZ54Q.js +1 -0
  117. package/web/assets/http-jrhK8wxY.js +1 -0
  118. package/web/assets/hurl-irOxFIW8.js +1 -0
  119. package/web/assets/hxml-Bvhsp5Yf.js +1 -0
  120. package/web/assets/hy-DFXneXwc.js +1 -0
  121. package/web/assets/imba-DGztddWO.js +1 -0
  122. package/web/assets/index-DIHAzyX3.js +332 -0
  123. package/web/assets/index-DuIo-wPB.css +1 -0
  124. package/web/assets/ini-BEwlwnbL.js +1 -0
  125. package/web/assets/java-CylS5w8V.js +1 -0
  126. package/web/assets/javascript-wDzz0qaB.js +1 -0
  127. package/web/assets/jinja-4LBKfQ-Z.js +1 -0
  128. package/web/assets/jison-wvAkD_A8.js +1 -0
  129. package/web/assets/json-Cp-IABpG.js +1 -0
  130. package/web/assets/json5-C9tS-k6U.js +1 -0
  131. package/web/assets/jsonc-Des-eS-w.js +1 -0
  132. package/web/assets/jsonl-DcaNXYhu.js +1 -0
  133. package/web/assets/jsonnet-DFQXde-d.js +1 -0
  134. package/web/assets/jssm-C2t-YnRu.js +1 -0
  135. package/web/assets/jsx-g9-lgVsj.js +1 -0
  136. package/web/assets/julia-C8NyazO9.js +1 -0
  137. package/web/assets/kanagawa-dragon-CkXjmgJE.js +1 -0
  138. package/web/assets/kanagawa-lotus-CfQXZHmo.js +1 -0
  139. package/web/assets/kanagawa-wave-DWedfzmr.js +1 -0
  140. package/web/assets/kdl-DV7GczEv.js +1 -0
  141. package/web/assets/kotlin-BdnUsdx6.js +1 -0
  142. package/web/assets/kusto-BvAqAH-y.js +1 -0
  143. package/web/assets/laserwave-DUszq2jm.js +1 -0
  144. package/web/assets/latex-BdAV_C_H.js +1 -0
  145. package/web/assets/lean-Bc6EcWN3.js +1 -0
  146. package/web/assets/less-B1dDrJ26.js +1 -0
  147. package/web/assets/light-plus-B7mTdjB0.js +1 -0
  148. package/web/assets/liquid-DYVedYrR.js +1 -0
  149. package/web/assets/llvm-BtvRca6l.js +1 -0
  150. package/web/assets/log-2UxHyX5q.js +1 -0
  151. package/web/assets/logo-BtOb2qkB.js +1 -0
  152. package/web/assets/lua-BbnMAYS6.js +1 -0
  153. package/web/assets/luau-CXu1NL6O.js +1 -0
  154. package/web/assets/make-CHLpvVh8.js +1 -0
  155. package/web/assets/markdown-Cvjx9yec.js +1 -0
  156. package/web/assets/marko-CPi9NSCl.js +1 -0
  157. package/web/assets/material-theme-D5KoaKCx.js +1 -0
  158. package/web/assets/material-theme-darker-BfHTSMKl.js +1 -0
  159. package/web/assets/material-theme-lighter-B0m2ddpp.js +1 -0
  160. package/web/assets/material-theme-ocean-CyktbL80.js +1 -0
  161. package/web/assets/material-theme-palenight-Csfq5Kiy.js +1 -0
  162. package/web/assets/matlab-D7o27uSR.js +1 -0
  163. package/web/assets/mdc-DUICxH0z.js +1 -0
  164. package/web/assets/mdx-Cmh6b_Ma.js +1 -0
  165. package/web/assets/mermaid-DKYwYmdq.js +1 -0
  166. package/web/assets/min-dark-CafNBF8u.js +1 -0
  167. package/web/assets/min-light-CTRr51gU.js +1 -0
  168. package/web/assets/mipsasm-CKIfxQSi.js +1 -0
  169. package/web/assets/mojo-1DNp92w6.js +1 -0
  170. package/web/assets/monokai-D4h5O-jR.js +1 -0
  171. package/web/assets/move-Bu9oaDYs.js +1 -0
  172. package/web/assets/narrat-DRg8JJMk.js +1 -0
  173. package/web/assets/nextflow-BrzmwbiE.js +1 -0
  174. package/web/assets/nginx-DknmC5AR.js +1 -0
  175. package/web/assets/night-owl-C39BiMTA.js +1 -0
  176. package/web/assets/nim-CVrawwO9.js +1 -0
  177. package/web/assets/nix-c8nO5XWb.js +1 -0
  178. package/web/assets/nord-Ddv68eIx.js +1 -0
  179. package/web/assets/nushell-C-sUppwS.js +1 -0
  180. package/web/assets/objective-c-DXmwc3jG.js +1 -0
  181. package/web/assets/objective-cpp-CLxacb5B.js +1 -0
  182. package/web/assets/ocaml-C0hk2d4L.js +1 -0
  183. package/web/assets/one-dark-pro-DVMEJ2y_.js +1 -0
  184. package/web/assets/one-light-PoHY5YXO.js +1 -0
  185. package/web/assets/openscad-C4EeE6gA.js +1 -0
  186. package/web/assets/pascal-D93ZcfNL.js +1 -0
  187. package/web/assets/perl-C0TMdlhV.js +1 -0
  188. package/web/assets/php-CDn_0X-4.js +1 -0
  189. package/web/assets/pkl-u5AG7uiY.js +1 -0
  190. package/web/assets/plastic-3e1v2bzS.js +1 -0
  191. package/web/assets/plsql-ChMvpjG-.js +1 -0
  192. package/web/assets/po-BTJTHyun.js +1 -0
  193. package/web/assets/poimandres-CS3Unz2-.js +1 -0
  194. package/web/assets/polar-C0HS_06l.js +1 -0
  195. package/web/assets/postcss-CXtECtnM.js +1 -0
  196. package/web/assets/powerquery-CEu0bR-o.js +1 -0
  197. package/web/assets/powershell-Dpen1YoG.js +1 -0
  198. package/web/assets/prisma-Dd19v3D-.js +1 -0
  199. package/web/assets/prolog-CbFg5uaA.js +1 -0
  200. package/web/assets/proto-DyJlTyXw.js +1 -0
  201. package/web/assets/pug-CGlum2m_.js +1 -0
  202. package/web/assets/puppet-BMWR74SV.js +1 -0
  203. package/web/assets/purescript-CklMAg4u.js +1 -0
  204. package/web/assets/python-B6aJPvgy.js +1 -0
  205. package/web/assets/qml-3beO22l8.js +1 -0
  206. package/web/assets/qmldir-C8lEn-DE.js +1 -0
  207. package/web/assets/qss-IeuSbFQv.js +1 -0
  208. package/web/assets/r-DiinP2Uv.js +1 -0
  209. package/web/assets/racket-BqYA7rlc.js +1 -0
  210. package/web/assets/raku-DXvB9xmW.js +1 -0
  211. package/web/assets/razor-CE9lU5zL.js +1 -0
  212. package/web/assets/red-bN70gL4F.js +1 -0
  213. package/web/assets/reg-C-SQnVFl.js +1 -0
  214. package/web/assets/regexp-CDVJQ6XC.js +1 -0
  215. package/web/assets/rel-C3B-1QV4.js +1 -0
  216. package/web/assets/riscv-BM1_JUlF.js +1 -0
  217. package/web/assets/rose-pine-dawn-DHQR4-dF.js +1 -0
  218. package/web/assets/rose-pine-moon-D4_iv3hh.js +1 -0
  219. package/web/assets/rose-pine-qdsjHGoJ.js +1 -0
  220. package/web/assets/rosmsg-BJDFO7_C.js +1 -0
  221. package/web/assets/rst-B0xPkSld.js +1 -0
  222. package/web/assets/ruby-BvKwtOVI.js +1 -0
  223. package/web/assets/rust-B1yitclQ.js +1 -0
  224. package/web/assets/sas-cz2c8ADy.js +1 -0
  225. package/web/assets/sass-Cj5Yp3dK.js +1 -0
  226. package/web/assets/scala-C151Ov-r.js +1 -0
  227. package/web/assets/scheme-C98Dy4si.js +1 -0
  228. package/web/assets/scss-OYdSNvt2.js +1 -0
  229. package/web/assets/sdbl-DVxCFoDh.js +1 -0
  230. package/web/assets/shaderlab-Dg9Lc6iA.js +1 -0
  231. package/web/assets/shellscript-Yzrsuije.js +1 -0
  232. package/web/assets/shellsession-BADoaaVG.js +1 -0
  233. package/web/assets/slack-dark-BthQWCQV.js +1 -0
  234. package/web/assets/slack-ochin-DqwNpetd.js +1 -0
  235. package/web/assets/smalltalk-BERRCDM3.js +1 -0
  236. package/web/assets/snazzy-light-Bw305WKR.js +1 -0
  237. package/web/assets/solarized-dark-DXbdFlpD.js +1 -0
  238. package/web/assets/solarized-light-L9t79GZl.js +1 -0
  239. package/web/assets/solidity-rGO070M0.js +1 -0
  240. package/web/assets/soy-Brmx7dQM.js +1 -0
  241. package/web/assets/sparql-rVzFXLq3.js +1 -0
  242. package/web/assets/splunk-BtCnVYZw.js +1 -0
  243. package/web/assets/sql-BLtJtn59.js +1 -0
  244. package/web/assets/ssh-config-_ykCGR6B.js +1 -0
  245. package/web/assets/stata-BH5u7GGu.js +1 -0
  246. package/web/assets/stylus-BEDo0Tqx.js +1 -0
  247. package/web/assets/svelte-3Dk4HxPD.js +1 -0
  248. package/web/assets/swift-Dg5xB15N.js +1 -0
  249. package/web/assets/synthwave-84-CbfX1IO0.js +1 -0
  250. package/web/assets/system-verilog-CnnmHF94.js +1 -0
  251. package/web/assets/systemd-4A_iFExJ.js +1 -0
  252. package/web/assets/talonscript-CkByrt1z.js +1 -0
  253. package/web/assets/tasl-QIJgUcNo.js +1 -0
  254. package/web/assets/tcl-dwOrl1Do.js +1 -0
  255. package/web/assets/templ-W15q3VgB.js +1 -0
  256. package/web/assets/terraform-BETggiCN.js +1 -0
  257. package/web/assets/tex-CxkMU7Pf.js +1 -0
  258. package/web/assets/tokyo-night-hegEt444.js +1 -0
  259. package/web/assets/toml-vGWfd6FD.js +1 -0
  260. package/web/assets/ts-tags-zn1MmPIZ.js +1 -0
  261. package/web/assets/tsv-B_m7g4N7.js +1 -0
  262. package/web/assets/tsx-COt5Ahok.js +1 -0
  263. package/web/assets/turtle-BsS91CYL.js +1 -0
  264. package/web/assets/twig-CO9l9SDP.js +1 -0
  265. package/web/assets/typescript-BPQ3VLAy.js +1 -0
  266. package/web/assets/typespec-BGHnOYBU.js +1 -0
  267. package/web/assets/typst-DHCkPAjA.js +1 -0
  268. package/web/assets/v-BcVCzyr7.js +1 -0
  269. package/web/assets/vala-CsfeWuGM.js +1 -0
  270. package/web/assets/vb-D17OF-Vu.js +1 -0
  271. package/web/assets/verilog-BQ8w6xss.js +1 -0
  272. package/web/assets/vesper-DU1UobuO.js +1 -0
  273. package/web/assets/vhdl-CeAyd5Ju.js +1 -0
  274. package/web/assets/viml-CJc9bBzg.js +1 -0
  275. package/web/assets/vitesse-black-Bkuqu6BP.js +1 -0
  276. package/web/assets/vitesse-dark-D0r3Knsf.js +1 -0
  277. package/web/assets/vitesse-light-CVO1_9PV.js +1 -0
  278. package/web/assets/vue-DnHKYNfI.js +1 -0
  279. package/web/assets/vue-html-CChd_i61.js +1 -0
  280. package/web/assets/vue-vine-8moa0y9V.js +1 -0
  281. package/web/assets/vyper-CDx5xZoG.js +1 -0
  282. package/web/assets/wasm-CG6Dc4jp.js +1 -0
  283. package/web/assets/wasm-MzD3tlZU.js +1 -0
  284. package/web/assets/wenyan-BV7otONQ.js +1 -0
  285. package/web/assets/wgsl-Dx-B1_4e.js +1 -0
  286. package/web/assets/wikitext-BhOHFoWU.js +1 -0
  287. package/web/assets/wit-5i3qLPDT.js +1 -0
  288. package/web/assets/wolfram-lXgVvXCa.js +1 -0
  289. package/web/assets/xml-sdJ4AIDG.js +1 -0
  290. package/web/assets/xsl-CtQFsRM5.js +1 -0
  291. package/web/assets/yaml-Buea-lGh.js +1 -0
  292. package/web/assets/zenscript-DVFEvuxE.js +1 -0
  293. package/web/assets/zig-VOosw3JB.js +1 -0
  294. package/web/index.html +4 -4
  295. package/web/logo.svg +8 -0
  296. package/web/openspec_pixel_dark.svg +89 -0
  297. package/web/openspec_pixel_light.svg +89 -0
  298. package/web/assets/index-BhzIZ_eQ.js +0 -150
  299. package/web/assets/index-D6x5Q1lW.css +0 -1
  300. package/web/dist/assets/index-BhzIZ_eQ.js +0 -150
  301. package/web/dist/assets/index-CqKOZnDE.css +0 -1
  302. package/web/dist/assets/index-D6x5Q1lW.css +0 -1
  303. package/web/dist/assets/index-Om_P2_SF.js +0 -155
  304. package/web/dist/index.html +0 -14
package/dist/cli.mjs CHANGED
@@ -1,71 +1,4559 @@
1
1
  #!/usr/bin/env node
2
- import { t as startServer } from "./src-CNuprcB-.mjs";
2
+ import { a as __commonJS, o as __toESM, t as startServer } from "./src-D7s-EgJ2.mjs";
3
+ import { createRequire } from "node:module";
4
+ import { fileURLToPath } from "url";
5
+ import { basename, dirname, extname, join, normalize, relative, resolve } from "path";
6
+ import { readFileSync, readdirSync, statSync, writeFile } from "fs";
7
+ import { readFileSync as readFileSync$1, readdirSync as readdirSync$1 } from "node:fs";
8
+ import { dirname as dirname$1, join as join$1 } from "node:path";
9
+ import { fileURLToPath as fileURLToPath$1 } from "node:url";
10
+ import { notStrictEqual, strictEqual } from "assert";
11
+ import { format, inspect } from "util";
3
12
 
4
- //#region src/cli.ts
5
- function parseArgs(args) {
6
- const result = {
7
- port: 3100,
8
- projectDir: process.cwd(),
9
- open: true,
10
- help: false
11
- };
12
- for (let i = 0; i < args.length; i++) {
13
- const arg = args[i];
14
- if (arg === "-p" || arg === "--port") {
15
- const next = args[++i];
16
- if (next) result.port = parseInt(next, 10);
17
- } else if (arg === "-d" || arg === "--dir") {
18
- const next = args[++i];
19
- if (next) result.projectDir = next;
20
- } else if (arg === "--no-open") result.open = false;
21
- else if (arg === "-h" || arg === "--help") result.help = true;
22
- else if (!arg.startsWith("-")) result.projectDir = arg;
23
- }
24
- return result;
25
- }
26
- function printHelp() {
27
- console.log(`
28
- OpenSpec UI - Visual interface for OpenSpec
13
+ //#region ../../node_modules/.pnpm/cliui@9.0.1/node_modules/cliui/build/lib/index.js
14
+ const align = {
15
+ right: alignRight,
16
+ center: alignCenter
17
+ };
18
+ const top = 0;
19
+ const right = 1;
20
+ const bottom = 2;
21
+ const left = 3;
22
+ var UI = class {
23
+ constructor(opts) {
24
+ var _a$1;
25
+ this.width = opts.width;
26
+ this.wrap = (_a$1 = opts.wrap) !== null && _a$1 !== void 0 ? _a$1 : true;
27
+ this.rows = [];
28
+ }
29
+ span(...args) {
30
+ const cols = this.div(...args);
31
+ cols.span = true;
32
+ }
33
+ resetOutput() {
34
+ this.rows = [];
35
+ }
36
+ div(...args) {
37
+ if (args.length === 0) this.div("");
38
+ if (this.wrap && this.shouldApplyLayoutDSL(...args) && typeof args[0] === "string") return this.applyLayoutDSL(args[0]);
39
+ const cols = args.map((arg) => {
40
+ if (typeof arg === "string") return this.colFromString(arg);
41
+ return arg;
42
+ });
43
+ this.rows.push(cols);
44
+ return cols;
45
+ }
46
+ shouldApplyLayoutDSL(...args) {
47
+ return args.length === 1 && typeof args[0] === "string" && /[\t\n]/.test(args[0]);
48
+ }
49
+ applyLayoutDSL(str) {
50
+ const rows = str.split("\n").map((row) => row.split(" "));
51
+ let leftColumnWidth = 0;
52
+ rows.forEach((columns) => {
53
+ if (columns.length > 1 && mixin$1.stringWidth(columns[0]) > leftColumnWidth) leftColumnWidth = Math.min(Math.floor(this.width * .5), mixin$1.stringWidth(columns[0]));
54
+ });
55
+ rows.forEach((columns) => {
56
+ this.div(...columns.map((r, i) => {
57
+ return {
58
+ text: r.trim(),
59
+ padding: this.measurePadding(r),
60
+ width: i === 0 && columns.length > 1 ? leftColumnWidth : void 0
61
+ };
62
+ }));
63
+ });
64
+ return this.rows[this.rows.length - 1];
65
+ }
66
+ colFromString(text) {
67
+ return {
68
+ text,
69
+ padding: this.measurePadding(text)
70
+ };
71
+ }
72
+ measurePadding(str) {
73
+ const noAnsi = mixin$1.stripAnsi(str);
74
+ return [
75
+ 0,
76
+ noAnsi.match(/\s*$/)[0].length,
77
+ 0,
78
+ noAnsi.match(/^\s*/)[0].length
79
+ ];
80
+ }
81
+ toString() {
82
+ const lines = [];
83
+ this.rows.forEach((row) => {
84
+ this.rowToString(row, lines);
85
+ });
86
+ return lines.filter((line) => !line.hidden).map((line) => line.text).join("\n");
87
+ }
88
+ rowToString(row, lines) {
89
+ this.rasterize(row).forEach((rrow, r) => {
90
+ let str = "";
91
+ rrow.forEach((col, c) => {
92
+ const { width } = row[c];
93
+ const wrapWidth = this.negatePadding(row[c]);
94
+ let ts = col;
95
+ if (wrapWidth > mixin$1.stringWidth(col)) ts += " ".repeat(wrapWidth - mixin$1.stringWidth(col));
96
+ if (row[c].align && row[c].align !== "left" && this.wrap) {
97
+ const fn = align[row[c].align];
98
+ ts = fn(ts, wrapWidth);
99
+ if (mixin$1.stringWidth(ts) < wrapWidth) ts += " ".repeat((width || 0) - mixin$1.stringWidth(ts) - 1);
100
+ }
101
+ const padding = row[c].padding || [
102
+ 0,
103
+ 0,
104
+ 0,
105
+ 0
106
+ ];
107
+ if (padding[left]) str += " ".repeat(padding[left]);
108
+ str += addBorder(row[c], ts, "| ");
109
+ str += ts;
110
+ str += addBorder(row[c], ts, " |");
111
+ if (padding[right]) str += " ".repeat(padding[right]);
112
+ if (r === 0 && lines.length > 0) str = this.renderInline(str, lines[lines.length - 1]);
113
+ });
114
+ lines.push({
115
+ text: str.replace(/ +$/, ""),
116
+ span: row.span
117
+ });
118
+ });
119
+ return lines;
120
+ }
121
+ renderInline(source, previousLine) {
122
+ const match = source.match(/^ */);
123
+ const leadingWhitespace = match ? match[0].length : 0;
124
+ const target = previousLine.text;
125
+ const targetTextWidth = mixin$1.stringWidth(target.trimRight());
126
+ if (!previousLine.span) return source;
127
+ if (!this.wrap) {
128
+ previousLine.hidden = true;
129
+ return target + source;
130
+ }
131
+ if (leadingWhitespace < targetTextWidth) return source;
132
+ previousLine.hidden = true;
133
+ return target.trimRight() + " ".repeat(leadingWhitespace - targetTextWidth) + source.trimLeft();
134
+ }
135
+ rasterize(row) {
136
+ const rrows = [];
137
+ const widths = this.columnWidths(row);
138
+ let wrapped;
139
+ row.forEach((col, c) => {
140
+ col.width = widths[c];
141
+ if (this.wrap) wrapped = mixin$1.wrap(col.text, this.negatePadding(col), { hard: true }).split("\n");
142
+ else wrapped = col.text.split("\n");
143
+ if (col.border) {
144
+ wrapped.unshift("." + "-".repeat(this.negatePadding(col) + 2) + ".");
145
+ wrapped.push("'" + "-".repeat(this.negatePadding(col) + 2) + "'");
146
+ }
147
+ if (col.padding) {
148
+ wrapped.unshift(...new Array(col.padding[top] || 0).fill(""));
149
+ wrapped.push(...new Array(col.padding[bottom] || 0).fill(""));
150
+ }
151
+ wrapped.forEach((str, r) => {
152
+ if (!rrows[r]) rrows.push([]);
153
+ const rrow = rrows[r];
154
+ for (let i = 0; i < c; i++) if (rrow[i] === void 0) rrow.push("");
155
+ rrow.push(str);
156
+ });
157
+ });
158
+ return rrows;
159
+ }
160
+ negatePadding(col) {
161
+ let wrapWidth = col.width || 0;
162
+ if (col.padding) wrapWidth -= (col.padding[left] || 0) + (col.padding[right] || 0);
163
+ if (col.border) wrapWidth -= 4;
164
+ return wrapWidth;
165
+ }
166
+ columnWidths(row) {
167
+ if (!this.wrap) return row.map((col) => {
168
+ return col.width || mixin$1.stringWidth(col.text);
169
+ });
170
+ let unset = row.length;
171
+ let remainingWidth = this.width;
172
+ const widths = row.map((col) => {
173
+ if (col.width) {
174
+ unset--;
175
+ remainingWidth -= col.width;
176
+ return col.width;
177
+ }
178
+ });
179
+ const unsetWidth = unset ? Math.floor(remainingWidth / unset) : 0;
180
+ return widths.map((w, i) => {
181
+ if (w === void 0) return Math.max(unsetWidth, _minWidth(row[i]));
182
+ return w;
183
+ });
184
+ }
185
+ };
186
+ function addBorder(col, ts, style) {
187
+ if (col.border) {
188
+ if (/[.']-+[.']/.test(ts)) return "";
189
+ if (ts.trim().length !== 0) return style;
190
+ return " ";
191
+ }
192
+ return "";
193
+ }
194
+ function _minWidth(col) {
195
+ const padding = col.padding || [];
196
+ const minWidth = 1 + (padding[left] || 0) + (padding[right] || 0);
197
+ if (col.border) return minWidth + 4;
198
+ return minWidth;
199
+ }
200
+ function getWindowWidth() {
201
+ /* c8 ignore next 5: depends on terminal */
202
+ if (typeof process === "object" && process.stdout && process.stdout.columns) return process.stdout.columns;
203
+ return 80;
204
+ }
205
+ function alignRight(str, width) {
206
+ str = str.trim();
207
+ const strWidth = mixin$1.stringWidth(str);
208
+ if (strWidth < width) return " ".repeat(width - strWidth) + str;
209
+ return str;
210
+ }
211
+ function alignCenter(str, width) {
212
+ str = str.trim();
213
+ const strWidth = mixin$1.stringWidth(str);
214
+ /* c8 ignore next 3 */
215
+ if (strWidth >= width) return str;
216
+ return " ".repeat(width - strWidth >> 1) + str;
217
+ }
218
+ let mixin$1;
219
+ function cliui(opts, _mixin) {
220
+ mixin$1 = _mixin;
221
+ return new UI({
222
+ width: (opts === null || opts === void 0 ? void 0 : opts.width) || getWindowWidth(),
223
+ wrap: opts === null || opts === void 0 ? void 0 : opts.wrap
224
+ });
225
+ }
226
+
227
+ //#endregion
228
+ //#region ../../node_modules/.pnpm/ansi-regex@6.2.2/node_modules/ansi-regex/index.js
229
+ function ansiRegex({ onlyFirst = false } = {}) {
230
+ return new RegExp(`(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]`, onlyFirst ? void 0 : "g");
231
+ }
232
+
233
+ //#endregion
234
+ //#region ../../node_modules/.pnpm/strip-ansi@7.1.2/node_modules/strip-ansi/index.js
235
+ const regex = ansiRegex();
236
+ function stripAnsi(string) {
237
+ if (typeof string !== "string") throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
238
+ return string.replace(regex, "");
239
+ }
240
+
241
+ //#endregion
242
+ //#region ../../node_modules/.pnpm/get-east-asian-width@1.4.0/node_modules/get-east-asian-width/lookup.js
243
+ function isAmbiguous(x) {
244
+ return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
245
+ }
246
+ function isFullWidth(x) {
247
+ return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
248
+ }
249
+ function isWide(x) {
250
+ return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9776 && x <= 9783 || x >= 9800 && x <= 9811 || x === 9855 || x >= 9866 && x <= 9871 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12773 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x >= 94192 && x <= 94198 || x >= 94208 && x <= 101589 || x >= 101631 && x <= 101662 || x >= 101760 && x <= 101874 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x >= 119552 && x <= 119638 || x >= 119648 && x <= 119670 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128728 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129674 || x >= 129678 && x <= 129734 || x === 129736 || x >= 129741 && x <= 129756 || x >= 129759 && x <= 129770 || x >= 129775 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
251
+ }
252
+
253
+ //#endregion
254
+ //#region ../../node_modules/.pnpm/get-east-asian-width@1.4.0/node_modules/get-east-asian-width/index.js
255
+ function validate(codePoint) {
256
+ if (!Number.isSafeInteger(codePoint)) throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
257
+ }
258
+ function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
259
+ validate(codePoint);
260
+ if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) return 2;
261
+ return 1;
262
+ }
263
+
264
+ //#endregion
265
+ //#region ../../node_modules/.pnpm/emoji-regex@10.6.0/node_modules/emoji-regex/index.js
266
+ var require_emoji_regex = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/emoji-regex@10.6.0/node_modules/emoji-regex/index.js": ((exports, module) => {
267
+ module.exports = () => {
268
+ return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
269
+ };
270
+ }) });
271
+
272
+ //#endregion
273
+ //#region ../../node_modules/.pnpm/string-width@7.2.0/node_modules/string-width/index.js
274
+ var import_emoji_regex = /* @__PURE__ */ __toESM(require_emoji_regex(), 1);
275
+ const segmenter = new Intl.Segmenter();
276
+ const defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
277
+ function stringWidth(string, options = {}) {
278
+ if (typeof string !== "string" || string.length === 0) return 0;
279
+ const { ambiguousIsNarrow = true, countAnsiEscapeCodes = false } = options;
280
+ if (!countAnsiEscapeCodes) string = stripAnsi(string);
281
+ if (string.length === 0) return 0;
282
+ let width = 0;
283
+ const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
284
+ for (const { segment: character } of segmenter.segment(string)) {
285
+ const codePoint = character.codePointAt(0);
286
+ if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) continue;
287
+ if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) continue;
288
+ if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) continue;
289
+ if (codePoint >= 55296 && codePoint <= 57343) continue;
290
+ if (codePoint >= 65024 && codePoint <= 65039) continue;
291
+ if (defaultIgnorableCodePointRegex.test(character)) continue;
292
+ if ((0, import_emoji_regex.default)().test(character)) {
293
+ width += 2;
294
+ continue;
295
+ }
296
+ width += eastAsianWidth(codePoint, eastAsianWidthOptions);
297
+ }
298
+ return width;
299
+ }
300
+
301
+ //#endregion
302
+ //#region ../../node_modules/.pnpm/ansi-styles@6.2.3/node_modules/ansi-styles/index.js
303
+ const ANSI_BACKGROUND_OFFSET = 10;
304
+ const wrapAnsi16 = (offset = 0) => (code) => `\u001B[${code + offset}m`;
305
+ const wrapAnsi256 = (offset = 0) => (code) => `\u001B[${38 + offset};5;${code}m`;
306
+ const wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`;
307
+ const styles = {
308
+ modifier: {
309
+ reset: [0, 0],
310
+ bold: [1, 22],
311
+ dim: [2, 22],
312
+ italic: [3, 23],
313
+ underline: [4, 24],
314
+ overline: [53, 55],
315
+ inverse: [7, 27],
316
+ hidden: [8, 28],
317
+ strikethrough: [9, 29]
318
+ },
319
+ color: {
320
+ black: [30, 39],
321
+ red: [31, 39],
322
+ green: [32, 39],
323
+ yellow: [33, 39],
324
+ blue: [34, 39],
325
+ magenta: [35, 39],
326
+ cyan: [36, 39],
327
+ white: [37, 39],
328
+ blackBright: [90, 39],
329
+ gray: [90, 39],
330
+ grey: [90, 39],
331
+ redBright: [91, 39],
332
+ greenBright: [92, 39],
333
+ yellowBright: [93, 39],
334
+ blueBright: [94, 39],
335
+ magentaBright: [95, 39],
336
+ cyanBright: [96, 39],
337
+ whiteBright: [97, 39]
338
+ },
339
+ bgColor: {
340
+ bgBlack: [40, 49],
341
+ bgRed: [41, 49],
342
+ bgGreen: [42, 49],
343
+ bgYellow: [43, 49],
344
+ bgBlue: [44, 49],
345
+ bgMagenta: [45, 49],
346
+ bgCyan: [46, 49],
347
+ bgWhite: [47, 49],
348
+ bgBlackBright: [100, 49],
349
+ bgGray: [100, 49],
350
+ bgGrey: [100, 49],
351
+ bgRedBright: [101, 49],
352
+ bgGreenBright: [102, 49],
353
+ bgYellowBright: [103, 49],
354
+ bgBlueBright: [104, 49],
355
+ bgMagentaBright: [105, 49],
356
+ bgCyanBright: [106, 49],
357
+ bgWhiteBright: [107, 49]
358
+ }
359
+ };
360
+ const modifierNames = Object.keys(styles.modifier);
361
+ const foregroundColorNames = Object.keys(styles.color);
362
+ const backgroundColorNames = Object.keys(styles.bgColor);
363
+ const colorNames = [...foregroundColorNames, ...backgroundColorNames];
364
+ function assembleStyles() {
365
+ const codes = /* @__PURE__ */ new Map();
366
+ for (const [groupName, group] of Object.entries(styles)) {
367
+ for (const [styleName, style] of Object.entries(group)) {
368
+ styles[styleName] = {
369
+ open: `\u001B[${style[0]}m`,
370
+ close: `\u001B[${style[1]}m`
371
+ };
372
+ group[styleName] = styles[styleName];
373
+ codes.set(style[0], style[1]);
374
+ }
375
+ Object.defineProperty(styles, groupName, {
376
+ value: group,
377
+ enumerable: false
378
+ });
379
+ }
380
+ Object.defineProperty(styles, "codes", {
381
+ value: codes,
382
+ enumerable: false
383
+ });
384
+ styles.color.close = "\x1B[39m";
385
+ styles.bgColor.close = "\x1B[49m";
386
+ styles.color.ansi = wrapAnsi16();
387
+ styles.color.ansi256 = wrapAnsi256();
388
+ styles.color.ansi16m = wrapAnsi16m();
389
+ styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
390
+ styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
391
+ styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
392
+ Object.defineProperties(styles, {
393
+ rgbToAnsi256: {
394
+ value(red, green, blue) {
395
+ if (red === green && green === blue) {
396
+ if (red < 8) return 16;
397
+ if (red > 248) return 231;
398
+ return Math.round((red - 8) / 247 * 24) + 232;
399
+ }
400
+ return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
401
+ },
402
+ enumerable: false
403
+ },
404
+ hexToRgb: {
405
+ value(hex) {
406
+ const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
407
+ if (!matches) return [
408
+ 0,
409
+ 0,
410
+ 0
411
+ ];
412
+ let [colorString] = matches;
413
+ if (colorString.length === 3) colorString = [...colorString].map((character) => character + character).join("");
414
+ const integer = Number.parseInt(colorString, 16);
415
+ return [
416
+ integer >> 16 & 255,
417
+ integer >> 8 & 255,
418
+ integer & 255
419
+ ];
420
+ },
421
+ enumerable: false
422
+ },
423
+ hexToAnsi256: {
424
+ value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
425
+ enumerable: false
426
+ },
427
+ ansi256ToAnsi: {
428
+ value(code) {
429
+ if (code < 8) return 30 + code;
430
+ if (code < 16) return 90 + (code - 8);
431
+ let red;
432
+ let green;
433
+ let blue;
434
+ if (code >= 232) {
435
+ red = ((code - 232) * 10 + 8) / 255;
436
+ green = red;
437
+ blue = red;
438
+ } else {
439
+ code -= 16;
440
+ const remainder = code % 36;
441
+ red = Math.floor(code / 36) / 5;
442
+ green = Math.floor(remainder / 6) / 5;
443
+ blue = remainder % 6 / 5;
444
+ }
445
+ const value = Math.max(red, green, blue) * 2;
446
+ if (value === 0) return 30;
447
+ let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
448
+ if (value === 2) result += 60;
449
+ return result;
450
+ },
451
+ enumerable: false
452
+ },
453
+ rgbToAnsi: {
454
+ value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
455
+ enumerable: false
456
+ },
457
+ hexToAnsi: {
458
+ value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
459
+ enumerable: false
460
+ }
461
+ });
462
+ return styles;
463
+ }
464
+ const ansiStyles = assembleStyles();
465
+ var ansi_styles_default = ansiStyles;
466
+
467
+ //#endregion
468
+ //#region ../../node_modules/.pnpm/wrap-ansi@9.0.2/node_modules/wrap-ansi/index.js
469
+ const ESCAPES = new Set(["\x1B", "›"]);
470
+ const END_CODE = 39;
471
+ const ANSI_ESCAPE_BELL = "\x07";
472
+ const ANSI_CSI = "[";
473
+ const ANSI_OSC = "]";
474
+ const ANSI_SGR_TERMINATOR = "m";
475
+ const ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
476
+ const wrapAnsiCode = (code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
477
+ const wrapAnsiHyperlink = (url) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
478
+ const wordLengths = (string) => string.split(" ").map((character) => stringWidth(character));
479
+ const wrapWord = (rows, word, columns) => {
480
+ const characters = [...word];
481
+ let isInsideEscape = false;
482
+ let isInsideLinkEscape = false;
483
+ let visible = stringWidth(stripAnsi(rows.at(-1)));
484
+ for (const [index, character] of characters.entries()) {
485
+ const characterLength = stringWidth(character);
486
+ if (visible + characterLength <= columns) rows[rows.length - 1] += character;
487
+ else {
488
+ rows.push(character);
489
+ visible = 0;
490
+ }
491
+ if (ESCAPES.has(character)) {
492
+ isInsideEscape = true;
493
+ isInsideLinkEscape = characters.slice(index + 1, index + 1 + ANSI_ESCAPE_LINK.length).join("") === ANSI_ESCAPE_LINK;
494
+ }
495
+ if (isInsideEscape) {
496
+ if (isInsideLinkEscape) {
497
+ if (character === ANSI_ESCAPE_BELL) {
498
+ isInsideEscape = false;
499
+ isInsideLinkEscape = false;
500
+ }
501
+ } else if (character === ANSI_SGR_TERMINATOR) isInsideEscape = false;
502
+ continue;
503
+ }
504
+ visible += characterLength;
505
+ if (visible === columns && index < characters.length - 1) {
506
+ rows.push("");
507
+ visible = 0;
508
+ }
509
+ }
510
+ if (!visible && rows.at(-1).length > 0 && rows.length > 1) rows[rows.length - 2] += rows.pop();
511
+ };
512
+ const stringVisibleTrimSpacesRight = (string) => {
513
+ const words = string.split(" ");
514
+ let last = words.length;
515
+ while (last > 0) {
516
+ if (stringWidth(words[last - 1]) > 0) break;
517
+ last--;
518
+ }
519
+ if (last === words.length) return string;
520
+ return words.slice(0, last).join(" ") + words.slice(last).join("");
521
+ };
522
+ const exec = (string, columns, options = {}) => {
523
+ if (options.trim !== false && string.trim() === "") return "";
524
+ let returnValue = "";
525
+ let escapeCode;
526
+ let escapeUrl;
527
+ const lengths = wordLengths(string);
528
+ let rows = [""];
529
+ for (const [index, word] of string.split(" ").entries()) {
530
+ if (options.trim !== false) rows[rows.length - 1] = rows.at(-1).trimStart();
531
+ let rowLength = stringWidth(rows.at(-1));
532
+ if (index !== 0) {
533
+ if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
534
+ rows.push("");
535
+ rowLength = 0;
536
+ }
537
+ if (rowLength > 0 || options.trim === false) {
538
+ rows[rows.length - 1] += " ";
539
+ rowLength++;
540
+ }
541
+ }
542
+ if (options.hard && lengths[index] > columns) {
543
+ const remainingColumns = columns - rowLength;
544
+ const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
545
+ if (Math.floor((lengths[index] - 1) / columns) < breaksStartingThisLine) rows.push("");
546
+ wrapWord(rows, word, columns);
547
+ continue;
548
+ }
549
+ if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {
550
+ if (options.wordWrap === false && rowLength < columns) {
551
+ wrapWord(rows, word, columns);
552
+ continue;
553
+ }
554
+ rows.push("");
555
+ }
556
+ if (rowLength + lengths[index] > columns && options.wordWrap === false) {
557
+ wrapWord(rows, word, columns);
558
+ continue;
559
+ }
560
+ rows[rows.length - 1] += word;
561
+ }
562
+ if (options.trim !== false) rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
563
+ const preString = rows.join("\n");
564
+ const pre = [...preString];
565
+ let preStringIndex = 0;
566
+ for (const [index, character] of pre.entries()) {
567
+ returnValue += character;
568
+ if (ESCAPES.has(character)) {
569
+ const { groups } = (/* @__PURE__ */ new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`)).exec(preString.slice(preStringIndex)) || { groups: {} };
570
+ if (groups.code !== void 0) {
571
+ const code$1 = Number.parseFloat(groups.code);
572
+ escapeCode = code$1 === END_CODE ? void 0 : code$1;
573
+ } else if (groups.uri !== void 0) escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
574
+ }
575
+ const code = ansi_styles_default.codes.get(Number(escapeCode));
576
+ if (pre[index + 1] === "\n") {
577
+ if (escapeUrl) returnValue += wrapAnsiHyperlink("");
578
+ if (escapeCode && code) returnValue += wrapAnsiCode(code);
579
+ } else if (character === "\n") {
580
+ if (escapeCode && code) returnValue += wrapAnsiCode(escapeCode);
581
+ if (escapeUrl) returnValue += wrapAnsiHyperlink(escapeUrl);
582
+ }
583
+ preStringIndex += character.length;
584
+ }
585
+ return returnValue;
586
+ };
587
+ function wrapAnsi(string, columns, options) {
588
+ return String(string).normalize().replaceAll("\r\n", "\n").split("\n").map((line) => exec(line, columns, options)).join("\n");
589
+ }
590
+
591
+ //#endregion
592
+ //#region ../../node_modules/.pnpm/cliui@9.0.1/node_modules/cliui/index.mjs
593
+ function ui(opts) {
594
+ return cliui(opts, {
595
+ stringWidth,
596
+ stripAnsi,
597
+ wrap: wrapAnsi
598
+ });
599
+ }
600
+
601
+ //#endregion
602
+ //#region ../../node_modules/.pnpm/escalade@3.2.0/node_modules/escalade/sync/index.mjs
603
+ function sync_default(start, callback) {
604
+ let dir = resolve(".", start);
605
+ let tmp;
606
+ if (!statSync(dir).isDirectory()) dir = dirname(dir);
607
+ while (true) {
608
+ tmp = callback(dir, readdirSync(dir));
609
+ if (tmp) return resolve(dir, tmp);
610
+ dir = dirname(tmp = dir);
611
+ if (tmp === dir) break;
612
+ }
613
+ }
614
+
615
+ //#endregion
616
+ //#region ../../node_modules/.pnpm/yargs-parser@22.0.0/node_modules/yargs-parser/build/lib/string-utils.js
617
+ /**
618
+ * @license
619
+ * Copyright (c) 2016, Contributors
620
+ * SPDX-License-Identifier: ISC
621
+ */
622
+ function camelCase(str) {
623
+ if (!(str !== str.toLowerCase() && str !== str.toUpperCase())) str = str.toLowerCase();
624
+ if (str.indexOf("-") === -1 && str.indexOf("_") === -1) return str;
625
+ else {
626
+ let camelcase = "";
627
+ let nextChrUpper = false;
628
+ const leadingHyphens = str.match(/^-+/);
629
+ for (let i = leadingHyphens ? leadingHyphens[0].length : 0; i < str.length; i++) {
630
+ let chr = str.charAt(i);
631
+ if (nextChrUpper) {
632
+ nextChrUpper = false;
633
+ chr = chr.toUpperCase();
634
+ }
635
+ if (i !== 0 && (chr === "-" || chr === "_")) nextChrUpper = true;
636
+ else if (chr !== "-" && chr !== "_") camelcase += chr;
637
+ }
638
+ return camelcase;
639
+ }
640
+ }
641
+ function decamelize(str, joinString) {
642
+ const lowercase = str.toLowerCase();
643
+ joinString = joinString || "-";
644
+ let notCamelcase = "";
645
+ for (let i = 0; i < str.length; i++) {
646
+ const chrLower = lowercase.charAt(i);
647
+ const chrString = str.charAt(i);
648
+ if (chrLower !== chrString && i > 0) notCamelcase += `${joinString}${lowercase.charAt(i)}`;
649
+ else notCamelcase += chrString;
650
+ }
651
+ return notCamelcase;
652
+ }
653
+ function looksLikeNumber(x) {
654
+ if (x === null || x === void 0) return false;
655
+ if (typeof x === "number") return true;
656
+ if (/^0x[0-9a-f]+$/i.test(x)) return true;
657
+ if (/^0[^.]/.test(x)) return false;
658
+ return /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
659
+ }
660
+
661
+ //#endregion
662
+ //#region ../../node_modules/.pnpm/yargs-parser@22.0.0/node_modules/yargs-parser/build/lib/tokenize-arg-string.js
663
+ /**
664
+ * @license
665
+ * Copyright (c) 2016, Contributors
666
+ * SPDX-License-Identifier: ISC
667
+ */
668
+ function tokenizeArgString(argString) {
669
+ if (Array.isArray(argString)) return argString.map((e) => typeof e !== "string" ? e + "" : e);
670
+ argString = argString.trim();
671
+ let i = 0;
672
+ let prevC = null;
673
+ let c = null;
674
+ let opening = null;
675
+ const args = [];
676
+ for (let ii = 0; ii < argString.length; ii++) {
677
+ prevC = c;
678
+ c = argString.charAt(ii);
679
+ if (c === " " && !opening) {
680
+ if (!(prevC === " ")) i++;
681
+ continue;
682
+ }
683
+ if (c === opening) opening = null;
684
+ else if ((c === "'" || c === "\"") && !opening) opening = c;
685
+ if (!args[i]) args[i] = "";
686
+ args[i] += c;
687
+ }
688
+ return args;
689
+ }
690
+
691
+ //#endregion
692
+ //#region ../../node_modules/.pnpm/yargs-parser@22.0.0/node_modules/yargs-parser/build/lib/yargs-parser-types.js
693
+ /**
694
+ * @license
695
+ * Copyright (c) 2016, Contributors
696
+ * SPDX-License-Identifier: ISC
697
+ */
698
+ var DefaultValuesForTypeKey;
699
+ (function(DefaultValuesForTypeKey$1) {
700
+ DefaultValuesForTypeKey$1["BOOLEAN"] = "boolean";
701
+ DefaultValuesForTypeKey$1["STRING"] = "string";
702
+ DefaultValuesForTypeKey$1["NUMBER"] = "number";
703
+ DefaultValuesForTypeKey$1["ARRAY"] = "array";
704
+ })(DefaultValuesForTypeKey || (DefaultValuesForTypeKey = {}));
705
+
706
+ //#endregion
707
+ //#region ../../node_modules/.pnpm/yargs-parser@22.0.0/node_modules/yargs-parser/build/lib/yargs-parser.js
708
+ /**
709
+ * @license
710
+ * Copyright (c) 2016, Contributors
711
+ * SPDX-License-Identifier: ISC
712
+ */
713
+ let mixin;
714
+ var YargsParser = class {
715
+ constructor(_mixin) {
716
+ mixin = _mixin;
717
+ }
718
+ parse(argsInput, options) {
719
+ const opts = Object.assign({
720
+ alias: void 0,
721
+ array: void 0,
722
+ boolean: void 0,
723
+ config: void 0,
724
+ configObjects: void 0,
725
+ configuration: void 0,
726
+ coerce: void 0,
727
+ count: void 0,
728
+ default: void 0,
729
+ envPrefix: void 0,
730
+ narg: void 0,
731
+ normalize: void 0,
732
+ string: void 0,
733
+ number: void 0,
734
+ __: void 0,
735
+ key: void 0
736
+ }, options);
737
+ const args = tokenizeArgString(argsInput);
738
+ const inputIsString = typeof argsInput === "string";
739
+ const aliases = combineAliases(Object.assign(Object.create(null), opts.alias));
740
+ const configuration = Object.assign({
741
+ "boolean-negation": true,
742
+ "camel-case-expansion": true,
743
+ "combine-arrays": false,
744
+ "dot-notation": true,
745
+ "duplicate-arguments-array": true,
746
+ "flatten-duplicate-arrays": true,
747
+ "greedy-arrays": true,
748
+ "halt-at-non-option": false,
749
+ "nargs-eats-options": false,
750
+ "negation-prefix": "no-",
751
+ "parse-numbers": true,
752
+ "parse-positional-numbers": true,
753
+ "populate--": false,
754
+ "set-placeholder-key": false,
755
+ "short-option-groups": true,
756
+ "strip-aliased": false,
757
+ "strip-dashed": false,
758
+ "unknown-options-as-args": false
759
+ }, opts.configuration);
760
+ const defaults = Object.assign(Object.create(null), opts.default);
761
+ const configObjects = opts.configObjects || [];
762
+ const envPrefix = opts.envPrefix;
763
+ const notFlagsOption = configuration["populate--"];
764
+ const notFlagsArgv = notFlagsOption ? "--" : "_";
765
+ const newAliases = Object.create(null);
766
+ const defaulted = Object.create(null);
767
+ const __ = opts.__ || mixin.format;
768
+ const flags = {
769
+ aliases: Object.create(null),
770
+ arrays: Object.create(null),
771
+ bools: Object.create(null),
772
+ strings: Object.create(null),
773
+ numbers: Object.create(null),
774
+ counts: Object.create(null),
775
+ normalize: Object.create(null),
776
+ configs: Object.create(null),
777
+ nargs: Object.create(null),
778
+ coercions: Object.create(null),
779
+ keys: []
780
+ };
781
+ const negative = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/;
782
+ const negatedBoolean = /* @__PURE__ */ new RegExp("^--" + configuration["negation-prefix"] + "(.+)");
783
+ [].concat(opts.array || []).filter(Boolean).forEach(function(opt) {
784
+ const key = typeof opt === "object" ? opt.key : opt;
785
+ const assignment = Object.keys(opt).map(function(key$1) {
786
+ return {
787
+ boolean: "bools",
788
+ string: "strings",
789
+ number: "numbers"
790
+ }[key$1];
791
+ }).filter(Boolean).pop();
792
+ if (assignment) flags[assignment][key] = true;
793
+ flags.arrays[key] = true;
794
+ flags.keys.push(key);
795
+ });
796
+ [].concat(opts.boolean || []).filter(Boolean).forEach(function(key) {
797
+ flags.bools[key] = true;
798
+ flags.keys.push(key);
799
+ });
800
+ [].concat(opts.string || []).filter(Boolean).forEach(function(key) {
801
+ flags.strings[key] = true;
802
+ flags.keys.push(key);
803
+ });
804
+ [].concat(opts.number || []).filter(Boolean).forEach(function(key) {
805
+ flags.numbers[key] = true;
806
+ flags.keys.push(key);
807
+ });
808
+ [].concat(opts.count || []).filter(Boolean).forEach(function(key) {
809
+ flags.counts[key] = true;
810
+ flags.keys.push(key);
811
+ });
812
+ [].concat(opts.normalize || []).filter(Boolean).forEach(function(key) {
813
+ flags.normalize[key] = true;
814
+ flags.keys.push(key);
815
+ });
816
+ if (typeof opts.narg === "object") Object.entries(opts.narg).forEach(([key, value]) => {
817
+ if (typeof value === "number") {
818
+ flags.nargs[key] = value;
819
+ flags.keys.push(key);
820
+ }
821
+ });
822
+ if (typeof opts.coerce === "object") Object.entries(opts.coerce).forEach(([key, value]) => {
823
+ if (typeof value === "function") {
824
+ flags.coercions[key] = value;
825
+ flags.keys.push(key);
826
+ }
827
+ });
828
+ if (typeof opts.config !== "undefined") {
829
+ if (Array.isArray(opts.config) || typeof opts.config === "string") [].concat(opts.config).filter(Boolean).forEach(function(key) {
830
+ flags.configs[key] = true;
831
+ });
832
+ else if (typeof opts.config === "object") Object.entries(opts.config).forEach(([key, value]) => {
833
+ if (typeof value === "boolean" || typeof value === "function") flags.configs[key] = value;
834
+ });
835
+ }
836
+ extendAliases(opts.key, aliases, opts.default, flags.arrays);
837
+ Object.keys(defaults).forEach(function(key) {
838
+ (flags.aliases[key] || []).forEach(function(alias) {
839
+ defaults[alias] = defaults[key];
840
+ });
841
+ });
842
+ let error = null;
843
+ checkConfiguration();
844
+ let notFlags = [];
845
+ const argv = Object.assign(Object.create(null), { _: [] });
846
+ const argvReturn = {};
847
+ for (let i = 0; i < args.length; i++) {
848
+ const arg = args[i];
849
+ const truncatedArg = arg.replace(/^-{3,}/, "---");
850
+ let broken;
851
+ let key;
852
+ let letters;
853
+ let m;
854
+ let next;
855
+ let value;
856
+ if (arg !== "--" && /^-/.test(arg) && isUnknownOptionAsArg(arg)) pushPositional(arg);
857
+ else if (truncatedArg.match(/^---+(=|$)/)) {
858
+ pushPositional(arg);
859
+ continue;
860
+ } else if (arg.match(/^--.+=/) || !configuration["short-option-groups"] && arg.match(/^-.+=/)) {
861
+ m = arg.match(/^--?([^=]+)=([\s\S]*)$/);
862
+ if (m !== null && Array.isArray(m) && m.length >= 3) if (checkAllAliases(m[1], flags.arrays)) i = eatArray(i, m[1], args, m[2]);
863
+ else if (checkAllAliases(m[1], flags.nargs) !== false) i = eatNargs(i, m[1], args, m[2]);
864
+ else setArg(m[1], m[2], true);
865
+ } else if (arg.match(negatedBoolean) && configuration["boolean-negation"]) {
866
+ m = arg.match(negatedBoolean);
867
+ if (m !== null && Array.isArray(m) && m.length >= 2) {
868
+ key = m[1];
869
+ setArg(key, checkAllAliases(key, flags.arrays) ? [false] : false);
870
+ }
871
+ } else if (arg.match(/^--.+/) || !configuration["short-option-groups"] && arg.match(/^-[^-]+/)) {
872
+ m = arg.match(/^--?(.+)/);
873
+ if (m !== null && Array.isArray(m) && m.length >= 2) {
874
+ key = m[1];
875
+ if (checkAllAliases(key, flags.arrays)) i = eatArray(i, key, args);
876
+ else if (checkAllAliases(key, flags.nargs) !== false) i = eatNargs(i, key, args);
877
+ else {
878
+ next = args[i + 1];
879
+ if (next !== void 0 && (!next.match(/^-/) || next.match(negative)) && !checkAllAliases(key, flags.bools) && !checkAllAliases(key, flags.counts)) {
880
+ setArg(key, next);
881
+ i++;
882
+ } else if (/^(true|false)$/.test(next)) {
883
+ setArg(key, next);
884
+ i++;
885
+ } else setArg(key, defaultValue(key));
886
+ }
887
+ }
888
+ } else if (arg.match(/^-.\..+=/)) {
889
+ m = arg.match(/^-([^=]+)=([\s\S]*)$/);
890
+ if (m !== null && Array.isArray(m) && m.length >= 3) setArg(m[1], m[2]);
891
+ } else if (arg.match(/^-.\..+/) && !arg.match(negative)) {
892
+ next = args[i + 1];
893
+ m = arg.match(/^-(.\..+)/);
894
+ if (m !== null && Array.isArray(m) && m.length >= 2) {
895
+ key = m[1];
896
+ if (next !== void 0 && !next.match(/^-/) && !checkAllAliases(key, flags.bools) && !checkAllAliases(key, flags.counts)) {
897
+ setArg(key, next);
898
+ i++;
899
+ } else setArg(key, defaultValue(key));
900
+ }
901
+ } else if (arg.match(/^-[^-]+/) && !arg.match(negative)) {
902
+ letters = arg.slice(1, -1).split("");
903
+ broken = false;
904
+ for (let j = 0; j < letters.length; j++) {
905
+ next = arg.slice(j + 2);
906
+ if (letters[j + 1] && letters[j + 1] === "=") {
907
+ value = arg.slice(j + 3);
908
+ key = letters[j];
909
+ if (checkAllAliases(key, flags.arrays)) i = eatArray(i, key, args, value);
910
+ else if (checkAllAliases(key, flags.nargs) !== false) i = eatNargs(i, key, args, value);
911
+ else setArg(key, value);
912
+ broken = true;
913
+ break;
914
+ }
915
+ if (next === "-") {
916
+ setArg(letters[j], next);
917
+ continue;
918
+ }
919
+ if (/[A-Za-z]/.test(letters[j]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next) && checkAllAliases(next, flags.bools) === false) {
920
+ setArg(letters[j], next);
921
+ broken = true;
922
+ break;
923
+ }
924
+ if (letters[j + 1] && letters[j + 1].match(/\W/)) {
925
+ setArg(letters[j], next);
926
+ broken = true;
927
+ break;
928
+ } else setArg(letters[j], defaultValue(letters[j]));
929
+ }
930
+ key = arg.slice(-1)[0];
931
+ if (!broken && key !== "-") if (checkAllAliases(key, flags.arrays)) i = eatArray(i, key, args);
932
+ else if (checkAllAliases(key, flags.nargs) !== false) i = eatNargs(i, key, args);
933
+ else {
934
+ next = args[i + 1];
935
+ if (next !== void 0 && (!/^(-|--)[^-]/.test(next) || next.match(negative)) && !checkAllAliases(key, flags.bools) && !checkAllAliases(key, flags.counts)) {
936
+ setArg(key, next);
937
+ i++;
938
+ } else if (/^(true|false)$/.test(next)) {
939
+ setArg(key, next);
940
+ i++;
941
+ } else setArg(key, defaultValue(key));
942
+ }
943
+ } else if (arg.match(/^-[0-9]$/) && arg.match(negative) && checkAllAliases(arg.slice(1), flags.bools)) {
944
+ key = arg.slice(1);
945
+ setArg(key, defaultValue(key));
946
+ } else if (arg === "--") {
947
+ notFlags = args.slice(i + 1);
948
+ break;
949
+ } else if (configuration["halt-at-non-option"]) {
950
+ notFlags = args.slice(i);
951
+ break;
952
+ } else pushPositional(arg);
953
+ }
954
+ applyEnvVars(argv, true);
955
+ applyEnvVars(argv, false);
956
+ setConfig(argv);
957
+ setConfigObjects();
958
+ applyDefaultsAndAliases(argv, flags.aliases, defaults, true);
959
+ applyCoercions(argv);
960
+ if (configuration["set-placeholder-key"]) setPlaceholderKeys(argv);
961
+ Object.keys(flags.counts).forEach(function(key) {
962
+ if (!hasKey(argv, key.split("."))) setArg(key, 0);
963
+ });
964
+ if (notFlagsOption && notFlags.length) argv[notFlagsArgv] = [];
965
+ notFlags.forEach(function(key) {
966
+ argv[notFlagsArgv].push(key);
967
+ });
968
+ if (configuration["camel-case-expansion"] && configuration["strip-dashed"]) Object.keys(argv).filter((key) => key !== "--" && key.includes("-")).forEach((key) => {
969
+ delete argv[key];
970
+ });
971
+ if (configuration["strip-aliased"]) [].concat(...Object.keys(aliases).map((k) => aliases[k])).forEach((alias) => {
972
+ if (configuration["camel-case-expansion"] && alias.includes("-")) delete argv[alias.split(".").map((prop) => camelCase(prop)).join(".")];
973
+ delete argv[alias];
974
+ });
975
+ function pushPositional(arg) {
976
+ const maybeCoercedNumber = maybeCoerceNumber("_", arg);
977
+ if (typeof maybeCoercedNumber === "string" || typeof maybeCoercedNumber === "number") argv._.push(maybeCoercedNumber);
978
+ }
979
+ function eatNargs(i, key, args$1, argAfterEqualSign) {
980
+ let ii;
981
+ let toEat = checkAllAliases(key, flags.nargs);
982
+ toEat = typeof toEat !== "number" || isNaN(toEat) ? 1 : toEat;
983
+ if (toEat === 0) {
984
+ if (!isUndefined(argAfterEqualSign)) error = Error(__("Argument unexpected for: %s", key));
985
+ setArg(key, defaultValue(key));
986
+ return i;
987
+ }
988
+ let available = isUndefined(argAfterEqualSign) ? 0 : 1;
989
+ if (configuration["nargs-eats-options"]) {
990
+ if (args$1.length - (i + 1) + available < toEat) error = Error(__("Not enough arguments following: %s", key));
991
+ available = toEat;
992
+ } else {
993
+ for (ii = i + 1; ii < args$1.length; ii++) if (!args$1[ii].match(/^-[^0-9]/) || args$1[ii].match(negative) || isUnknownOptionAsArg(args$1[ii])) available++;
994
+ else break;
995
+ if (available < toEat) error = Error(__("Not enough arguments following: %s", key));
996
+ }
997
+ let consumed = Math.min(available, toEat);
998
+ if (!isUndefined(argAfterEqualSign) && consumed > 0) {
999
+ setArg(key, argAfterEqualSign);
1000
+ consumed--;
1001
+ }
1002
+ for (ii = i + 1; ii < consumed + i + 1; ii++) setArg(key, args$1[ii]);
1003
+ return i + consumed;
1004
+ }
1005
+ function eatArray(i, key, args$1, argAfterEqualSign) {
1006
+ let argsToSet = [];
1007
+ let next = argAfterEqualSign || args$1[i + 1];
1008
+ const nargsCount = checkAllAliases(key, flags.nargs);
1009
+ if (checkAllAliases(key, flags.bools) && !/^(true|false)$/.test(next)) argsToSet.push(true);
1010
+ else if (isUndefined(next) || isUndefined(argAfterEqualSign) && /^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next)) {
1011
+ if (defaults[key] !== void 0) {
1012
+ const defVal = defaults[key];
1013
+ argsToSet = Array.isArray(defVal) ? defVal : [defVal];
1014
+ }
1015
+ } else {
1016
+ if (!isUndefined(argAfterEqualSign)) argsToSet.push(processValue(key, argAfterEqualSign, true));
1017
+ for (let ii = i + 1; ii < args$1.length; ii++) {
1018
+ if (!configuration["greedy-arrays"] && argsToSet.length > 0 || nargsCount && typeof nargsCount === "number" && argsToSet.length >= nargsCount) break;
1019
+ next = args$1[ii];
1020
+ if (/^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next)) break;
1021
+ i = ii;
1022
+ argsToSet.push(processValue(key, next, inputIsString));
1023
+ }
1024
+ }
1025
+ if (typeof nargsCount === "number" && (nargsCount && argsToSet.length < nargsCount || isNaN(nargsCount) && argsToSet.length === 0)) error = Error(__("Not enough arguments following: %s", key));
1026
+ setArg(key, argsToSet);
1027
+ return i;
1028
+ }
1029
+ function setArg(key, val, shouldStripQuotes = inputIsString) {
1030
+ if (/-/.test(key) && configuration["camel-case-expansion"]) addNewAlias(key, key.split(".").map(function(prop) {
1031
+ return camelCase(prop);
1032
+ }).join("."));
1033
+ const value = processValue(key, val, shouldStripQuotes);
1034
+ const splitKey = key.split(".");
1035
+ setKey(argv, splitKey, value);
1036
+ if (flags.aliases[key]) flags.aliases[key].forEach(function(x) {
1037
+ setKey(argv, x.split("."), value);
1038
+ });
1039
+ if (splitKey.length > 1 && configuration["dot-notation"]) (flags.aliases[splitKey[0]] || []).forEach(function(x) {
1040
+ let keyProperties = x.split(".");
1041
+ const a = [].concat(splitKey);
1042
+ a.shift();
1043
+ keyProperties = keyProperties.concat(a);
1044
+ if (!(flags.aliases[key] || []).includes(keyProperties.join("."))) setKey(argv, keyProperties, value);
1045
+ });
1046
+ if (checkAllAliases(key, flags.normalize) && !checkAllAliases(key, flags.arrays)) [key].concat(flags.aliases[key] || []).forEach(function(key$1) {
1047
+ Object.defineProperty(argvReturn, key$1, {
1048
+ enumerable: true,
1049
+ get() {
1050
+ return val;
1051
+ },
1052
+ set(value$1) {
1053
+ val = typeof value$1 === "string" ? mixin.normalize(value$1) : value$1;
1054
+ }
1055
+ });
1056
+ });
1057
+ }
1058
+ function addNewAlias(key, alias) {
1059
+ if (!(flags.aliases[key] && flags.aliases[key].length)) {
1060
+ flags.aliases[key] = [alias];
1061
+ newAliases[alias] = true;
1062
+ }
1063
+ if (!(flags.aliases[alias] && flags.aliases[alias].length)) addNewAlias(alias, key);
1064
+ }
1065
+ function processValue(key, val, shouldStripQuotes) {
1066
+ if (shouldStripQuotes) val = stripQuotes(val);
1067
+ if (checkAllAliases(key, flags.bools) || checkAllAliases(key, flags.counts)) {
1068
+ if (typeof val === "string") val = val === "true";
1069
+ }
1070
+ let value = Array.isArray(val) ? val.map(function(v) {
1071
+ return maybeCoerceNumber(key, v);
1072
+ }) : maybeCoerceNumber(key, val);
1073
+ if (checkAllAliases(key, flags.counts) && (isUndefined(value) || typeof value === "boolean")) value = increment();
1074
+ if (checkAllAliases(key, flags.normalize) && checkAllAliases(key, flags.arrays)) if (Array.isArray(val)) value = val.map((val$1) => {
1075
+ return mixin.normalize(val$1);
1076
+ });
1077
+ else value = mixin.normalize(val);
1078
+ return value;
1079
+ }
1080
+ function maybeCoerceNumber(key, value) {
1081
+ if (!configuration["parse-positional-numbers"] && key === "_") return value;
1082
+ if (!checkAllAliases(key, flags.strings) && !checkAllAliases(key, flags.bools) && !Array.isArray(value)) {
1083
+ if (looksLikeNumber(value) && configuration["parse-numbers"] && Number.isSafeInteger(Math.floor(parseFloat(`${value}`))) || !isUndefined(value) && checkAllAliases(key, flags.numbers)) value = Number(value);
1084
+ }
1085
+ return value;
1086
+ }
1087
+ function setConfig(argv$1) {
1088
+ const configLookup = Object.create(null);
1089
+ applyDefaultsAndAliases(configLookup, flags.aliases, defaults);
1090
+ Object.keys(flags.configs).forEach(function(configKey) {
1091
+ const configPath = argv$1[configKey] || configLookup[configKey];
1092
+ if (configPath) try {
1093
+ let config = null;
1094
+ const resolvedConfigPath = mixin.resolve(mixin.cwd(), configPath);
1095
+ const resolveConfig = flags.configs[configKey];
1096
+ if (typeof resolveConfig === "function") {
1097
+ try {
1098
+ config = resolveConfig(resolvedConfigPath);
1099
+ } catch (e) {
1100
+ config = e;
1101
+ }
1102
+ if (config instanceof Error) {
1103
+ error = config;
1104
+ return;
1105
+ }
1106
+ } else config = mixin.require(resolvedConfigPath);
1107
+ setConfigObject(config);
1108
+ } catch (ex) {
1109
+ if (ex.name === "PermissionDenied") error = ex;
1110
+ else if (argv$1[configKey]) error = Error(__("Invalid JSON config file: %s", configPath));
1111
+ }
1112
+ });
1113
+ }
1114
+ function setConfigObject(config, prev) {
1115
+ Object.keys(config).forEach(function(key) {
1116
+ const value = config[key];
1117
+ const fullKey = prev ? prev + "." + key : key;
1118
+ if (typeof value === "object" && value !== null && !Array.isArray(value) && configuration["dot-notation"]) setConfigObject(value, fullKey);
1119
+ else if (!hasKey(argv, fullKey.split(".")) || checkAllAliases(fullKey, flags.arrays) && configuration["combine-arrays"]) setArg(fullKey, value);
1120
+ });
1121
+ }
1122
+ function setConfigObjects() {
1123
+ if (typeof configObjects !== "undefined") configObjects.forEach(function(configObject) {
1124
+ setConfigObject(configObject);
1125
+ });
1126
+ }
1127
+ function applyEnvVars(argv$1, configOnly) {
1128
+ if (typeof envPrefix === "undefined") return;
1129
+ const prefix = typeof envPrefix === "string" ? envPrefix : "";
1130
+ const env$1 = mixin.env();
1131
+ Object.keys(env$1).forEach(function(envVar) {
1132
+ if (prefix === "" || envVar.lastIndexOf(prefix, 0) === 0) {
1133
+ const keys = envVar.split("__").map(function(key, i) {
1134
+ if (i === 0) key = key.substring(prefix.length);
1135
+ return camelCase(key);
1136
+ });
1137
+ if ((configOnly && flags.configs[keys.join(".")] || !configOnly) && !hasKey(argv$1, keys)) setArg(keys.join("."), env$1[envVar]);
1138
+ }
1139
+ });
1140
+ }
1141
+ function applyCoercions(argv$1) {
1142
+ let coerce;
1143
+ const applied = /* @__PURE__ */ new Set();
1144
+ Object.keys(argv$1).forEach(function(key) {
1145
+ if (!applied.has(key)) {
1146
+ coerce = checkAllAliases(key, flags.coercions);
1147
+ if (typeof coerce === "function") try {
1148
+ const value = maybeCoerceNumber(key, coerce(argv$1[key]));
1149
+ [].concat(flags.aliases[key] || [], key).forEach((ali) => {
1150
+ applied.add(ali);
1151
+ argv$1[ali] = value;
1152
+ });
1153
+ } catch (err) {
1154
+ error = err;
1155
+ }
1156
+ }
1157
+ });
1158
+ }
1159
+ function setPlaceholderKeys(argv$1) {
1160
+ flags.keys.forEach((key) => {
1161
+ if (~key.indexOf(".")) return;
1162
+ if (typeof argv$1[key] === "undefined") argv$1[key] = void 0;
1163
+ });
1164
+ return argv$1;
1165
+ }
1166
+ function applyDefaultsAndAliases(obj, aliases$1, defaults$1, canLog = false) {
1167
+ Object.keys(defaults$1).forEach(function(key) {
1168
+ if (!hasKey(obj, key.split("."))) {
1169
+ setKey(obj, key.split("."), defaults$1[key]);
1170
+ if (canLog) defaulted[key] = true;
1171
+ (aliases$1[key] || []).forEach(function(x) {
1172
+ if (hasKey(obj, x.split("."))) return;
1173
+ setKey(obj, x.split("."), defaults$1[key]);
1174
+ });
1175
+ }
1176
+ });
1177
+ }
1178
+ function hasKey(obj, keys) {
1179
+ let o = obj;
1180
+ if (!configuration["dot-notation"]) keys = [keys.join(".")];
1181
+ keys.slice(0, -1).forEach(function(key$1) {
1182
+ o = o[key$1] || {};
1183
+ });
1184
+ const key = keys[keys.length - 1];
1185
+ if (typeof o !== "object") return false;
1186
+ else return key in o;
1187
+ }
1188
+ function setKey(obj, keys, value) {
1189
+ let o = obj;
1190
+ if (!configuration["dot-notation"]) keys = [keys.join(".")];
1191
+ keys.slice(0, -1).forEach(function(key$1) {
1192
+ key$1 = sanitizeKey(key$1);
1193
+ if (typeof o === "object" && o[key$1] === void 0) o[key$1] = {};
1194
+ if (typeof o[key$1] !== "object" || Array.isArray(o[key$1])) {
1195
+ if (Array.isArray(o[key$1])) o[key$1].push({});
1196
+ else o[key$1] = [o[key$1], {}];
1197
+ o = o[key$1][o[key$1].length - 1];
1198
+ } else o = o[key$1];
1199
+ });
1200
+ const key = sanitizeKey(keys[keys.length - 1]);
1201
+ const isTypeArray = checkAllAliases(keys.join("."), flags.arrays);
1202
+ const isValueArray = Array.isArray(value);
1203
+ let duplicate = configuration["duplicate-arguments-array"];
1204
+ if (!duplicate && checkAllAliases(key, flags.nargs)) {
1205
+ duplicate = true;
1206
+ if (!isUndefined(o[key]) && flags.nargs[key] === 1 || Array.isArray(o[key]) && o[key].length === flags.nargs[key]) o[key] = void 0;
1207
+ }
1208
+ if (value === increment()) o[key] = increment(o[key]);
1209
+ else if (Array.isArray(o[key])) if (duplicate && isTypeArray && isValueArray) o[key] = configuration["flatten-duplicate-arrays"] ? o[key].concat(value) : (Array.isArray(o[key][0]) ? o[key] : [o[key]]).concat([value]);
1210
+ else if (!duplicate && Boolean(isTypeArray) === Boolean(isValueArray)) o[key] = value;
1211
+ else o[key] = o[key].concat([value]);
1212
+ else if (o[key] === void 0 && isTypeArray) o[key] = isValueArray ? value : [value];
1213
+ else if (duplicate && !(o[key] === void 0 || checkAllAliases(key, flags.counts) || checkAllAliases(key, flags.bools))) o[key] = [o[key], value];
1214
+ else o[key] = value;
1215
+ }
1216
+ function extendAliases(...args$1) {
1217
+ args$1.forEach(function(obj) {
1218
+ Object.keys(obj || {}).forEach(function(key) {
1219
+ if (flags.aliases[key]) return;
1220
+ flags.aliases[key] = [].concat(aliases[key] || []);
1221
+ flags.aliases[key].concat(key).forEach(function(x) {
1222
+ if (/-/.test(x) && configuration["camel-case-expansion"]) {
1223
+ const c = camelCase(x);
1224
+ if (c !== key && flags.aliases[key].indexOf(c) === -1) {
1225
+ flags.aliases[key].push(c);
1226
+ newAliases[c] = true;
1227
+ }
1228
+ }
1229
+ });
1230
+ flags.aliases[key].concat(key).forEach(function(x) {
1231
+ if (x.length > 1 && /[A-Z]/.test(x) && configuration["camel-case-expansion"]) {
1232
+ const c = decamelize(x, "-");
1233
+ if (c !== key && flags.aliases[key].indexOf(c) === -1) {
1234
+ flags.aliases[key].push(c);
1235
+ newAliases[c] = true;
1236
+ }
1237
+ }
1238
+ });
1239
+ flags.aliases[key].forEach(function(x) {
1240
+ flags.aliases[x] = [key].concat(flags.aliases[key].filter(function(y) {
1241
+ return x !== y;
1242
+ }));
1243
+ });
1244
+ });
1245
+ });
1246
+ }
1247
+ function checkAllAliases(key, flag) {
1248
+ const toCheck = [].concat(flags.aliases[key] || [], key);
1249
+ const keys = Object.keys(flag);
1250
+ const setAlias = toCheck.find((key$1) => keys.includes(key$1));
1251
+ return setAlias ? flag[setAlias] : false;
1252
+ }
1253
+ function hasAnyFlag(key) {
1254
+ const flagsKeys = Object.keys(flags);
1255
+ return [].concat(flagsKeys.map((k) => flags[k])).some(function(flag) {
1256
+ return Array.isArray(flag) ? flag.includes(key) : flag[key];
1257
+ });
1258
+ }
1259
+ function hasFlagsMatching(arg, ...patterns) {
1260
+ return [].concat(...patterns).some(function(pattern) {
1261
+ const match = arg.match(pattern);
1262
+ return match && hasAnyFlag(match[1]);
1263
+ });
1264
+ }
1265
+ function hasAllShortFlags(arg) {
1266
+ if (arg.match(negative) || !arg.match(/^-[^-]+/)) return false;
1267
+ let hasAllFlags = true;
1268
+ let next;
1269
+ const letters = arg.slice(1).split("");
1270
+ for (let j = 0; j < letters.length; j++) {
1271
+ next = arg.slice(j + 2);
1272
+ if (!hasAnyFlag(letters[j])) {
1273
+ hasAllFlags = false;
1274
+ break;
1275
+ }
1276
+ if (letters[j + 1] && letters[j + 1] === "=" || next === "-" || /[A-Za-z]/.test(letters[j]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next) || letters[j + 1] && letters[j + 1].match(/\W/)) break;
1277
+ }
1278
+ return hasAllFlags;
1279
+ }
1280
+ function isUnknownOptionAsArg(arg) {
1281
+ return configuration["unknown-options-as-args"] && isUnknownOption(arg);
1282
+ }
1283
+ function isUnknownOption(arg) {
1284
+ arg = arg.replace(/^-{3,}/, "--");
1285
+ if (arg.match(negative)) return false;
1286
+ if (hasAllShortFlags(arg)) return false;
1287
+ return !hasFlagsMatching(arg, /^-+([^=]+?)=[\s\S]*$/, negatedBoolean, /^-+([^=]+?)$/, /^-+([^=]+?)-$/, /^-+([^=]+?\d+)$/, /^-+([^=]+?)\W+.*$/);
1288
+ }
1289
+ function defaultValue(key) {
1290
+ if (!checkAllAliases(key, flags.bools) && !checkAllAliases(key, flags.counts) && `${key}` in defaults) return defaults[key];
1291
+ else return defaultForType(guessType$1(key));
1292
+ }
1293
+ function defaultForType(type) {
1294
+ return {
1295
+ [DefaultValuesForTypeKey.BOOLEAN]: true,
1296
+ [DefaultValuesForTypeKey.STRING]: "",
1297
+ [DefaultValuesForTypeKey.NUMBER]: void 0,
1298
+ [DefaultValuesForTypeKey.ARRAY]: []
1299
+ }[type];
1300
+ }
1301
+ function guessType$1(key) {
1302
+ let type = DefaultValuesForTypeKey.BOOLEAN;
1303
+ if (checkAllAliases(key, flags.strings)) type = DefaultValuesForTypeKey.STRING;
1304
+ else if (checkAllAliases(key, flags.numbers)) type = DefaultValuesForTypeKey.NUMBER;
1305
+ else if (checkAllAliases(key, flags.bools)) type = DefaultValuesForTypeKey.BOOLEAN;
1306
+ else if (checkAllAliases(key, flags.arrays)) type = DefaultValuesForTypeKey.ARRAY;
1307
+ return type;
1308
+ }
1309
+ function isUndefined(num) {
1310
+ return num === void 0;
1311
+ }
1312
+ function checkConfiguration() {
1313
+ Object.keys(flags.counts).find((key) => {
1314
+ if (checkAllAliases(key, flags.arrays)) {
1315
+ error = Error(__("Invalid configuration: %s, opts.count excludes opts.array.", key));
1316
+ return true;
1317
+ } else if (checkAllAliases(key, flags.nargs)) {
1318
+ error = Error(__("Invalid configuration: %s, opts.count excludes opts.narg.", key));
1319
+ return true;
1320
+ }
1321
+ return false;
1322
+ });
1323
+ }
1324
+ return {
1325
+ aliases: Object.assign({}, flags.aliases),
1326
+ argv: Object.assign(argvReturn, argv),
1327
+ configuration,
1328
+ defaulted: Object.assign({}, defaulted),
1329
+ error,
1330
+ newAliases: Object.assign({}, newAliases)
1331
+ };
1332
+ }
1333
+ };
1334
+ function combineAliases(aliases) {
1335
+ const aliasArrays = [];
1336
+ const combined = Object.create(null);
1337
+ let change = true;
1338
+ Object.keys(aliases).forEach(function(key) {
1339
+ aliasArrays.push([].concat(aliases[key], key));
1340
+ });
1341
+ while (change) {
1342
+ change = false;
1343
+ for (let i = 0; i < aliasArrays.length; i++) for (let ii = i + 1; ii < aliasArrays.length; ii++) if (aliasArrays[i].filter(function(v) {
1344
+ return aliasArrays[ii].indexOf(v) !== -1;
1345
+ }).length) {
1346
+ aliasArrays[i] = aliasArrays[i].concat(aliasArrays[ii]);
1347
+ aliasArrays.splice(ii, 1);
1348
+ change = true;
1349
+ break;
1350
+ }
1351
+ }
1352
+ aliasArrays.forEach(function(aliasArray) {
1353
+ aliasArray = aliasArray.filter(function(v, i, self) {
1354
+ return self.indexOf(v) === i;
1355
+ });
1356
+ const lastAlias = aliasArray.pop();
1357
+ if (lastAlias !== void 0 && typeof lastAlias === "string") combined[lastAlias] = aliasArray;
1358
+ });
1359
+ return combined;
1360
+ }
1361
+ function increment(orig) {
1362
+ return orig !== void 0 ? orig + 1 : 1;
1363
+ }
1364
+ function sanitizeKey(key) {
1365
+ if (key === "__proto__") return "___proto___";
1366
+ return key;
1367
+ }
1368
+ function stripQuotes(val) {
1369
+ return typeof val === "string" && (val[0] === "'" || val[0] === "\"") && val[val.length - 1] === val[0] ? val.substring(1, val.length - 1) : val;
1370
+ }
1371
+
1372
+ //#endregion
1373
+ //#region ../../node_modules/.pnpm/yargs-parser@22.0.0/node_modules/yargs-parser/build/lib/index.js
1374
+ /**
1375
+ * @fileoverview Main entrypoint for libraries using yargs-parser in Node.js
1376
+ *
1377
+ * @license
1378
+ * Copyright (c) 2016, Contributors
1379
+ * SPDX-License-Identifier: ISC
1380
+ */
1381
+ var _a, _b, _c;
1382
+ const minNodeVersion = process && process.env && process.env.YARGS_MIN_NODE_VERSION ? Number(process.env.YARGS_MIN_NODE_VERSION) : 20;
1383
+ const nodeVersion = (_b = (_a = process === null || process === void 0 ? void 0 : process.versions) === null || _a === void 0 ? void 0 : _a.node) !== null && _b !== void 0 ? _b : (_c = process === null || process === void 0 ? void 0 : process.version) === null || _c === void 0 ? void 0 : _c.slice(1);
1384
+ if (nodeVersion) {
1385
+ if (Number(nodeVersion.match(/^([^.]+)/)[1]) < minNodeVersion) throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);
1386
+ }
1387
+ const env = process ? process.env : {};
1388
+ const require$1 = createRequire ? createRequire(import.meta.url) : void 0;
1389
+ const parser = new YargsParser({
1390
+ cwd: process.cwd,
1391
+ env: () => {
1392
+ return env;
1393
+ },
1394
+ format,
1395
+ normalize,
1396
+ resolve,
1397
+ require: (path$1) => {
1398
+ if (typeof require$1 !== "undefined") return require$1(path$1);
1399
+ else if (path$1.match(/\.json$/)) return JSON.parse(readFileSync(path$1, "utf8"));
1400
+ else throw Error("only .json config files are supported in ESM");
1401
+ }
1402
+ });
1403
+ const yargsParser = function Parser(args, opts) {
1404
+ return parser.parse(args.slice(), opts).argv;
1405
+ };
1406
+ yargsParser.detailed = function(args, opts) {
1407
+ return parser.parse(args.slice(), opts);
1408
+ };
1409
+ yargsParser.camelCase = camelCase;
1410
+ yargsParser.decamelize = decamelize;
1411
+ yargsParser.looksLikeNumber = looksLikeNumber;
1412
+ var lib_default = yargsParser;
1413
+
1414
+ //#endregion
1415
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/utils/process-argv.js
1416
+ function getProcessArgvBinIndex() {
1417
+ if (isBundledElectronApp()) return 0;
1418
+ return 1;
1419
+ }
1420
+ function isBundledElectronApp() {
1421
+ return isElectronApp() && !process.defaultApp;
1422
+ }
1423
+ function isElectronApp() {
1424
+ return !!process.versions.electron;
1425
+ }
1426
+ function hideBin(argv) {
1427
+ return argv.slice(getProcessArgvBinIndex() + 1);
1428
+ }
1429
+ function getProcessArgvBin() {
1430
+ return process.argv[getProcessArgvBinIndex()];
1431
+ }
1432
+
1433
+ //#endregion
1434
+ //#region ../../node_modules/.pnpm/y18n@5.0.8/node_modules/y18n/build/lib/platform-shims/node.js
1435
+ var node_default = {
1436
+ fs: {
1437
+ readFileSync,
1438
+ writeFile
1439
+ },
1440
+ format,
1441
+ resolve,
1442
+ exists: (file) => {
1443
+ try {
1444
+ return statSync(file).isFile();
1445
+ } catch (err) {
1446
+ return false;
1447
+ }
1448
+ }
1449
+ };
1450
+
1451
+ //#endregion
1452
+ //#region ../../node_modules/.pnpm/y18n@5.0.8/node_modules/y18n/build/lib/index.js
1453
+ let shim$1;
1454
+ var Y18N = class {
1455
+ constructor(opts) {
1456
+ opts = opts || {};
1457
+ this.directory = opts.directory || "./locales";
1458
+ this.updateFiles = typeof opts.updateFiles === "boolean" ? opts.updateFiles : true;
1459
+ this.locale = opts.locale || "en";
1460
+ this.fallbackToLanguage = typeof opts.fallbackToLanguage === "boolean" ? opts.fallbackToLanguage : true;
1461
+ this.cache = Object.create(null);
1462
+ this.writeQueue = [];
1463
+ }
1464
+ __(...args) {
1465
+ if (typeof arguments[0] !== "string") return this._taggedLiteral(arguments[0], ...arguments);
1466
+ const str = args.shift();
1467
+ let cb = function() {};
1468
+ if (typeof args[args.length - 1] === "function") cb = args.pop();
1469
+ cb = cb || function() {};
1470
+ if (!this.cache[this.locale]) this._readLocaleFile();
1471
+ if (!this.cache[this.locale][str] && this.updateFiles) {
1472
+ this.cache[this.locale][str] = str;
1473
+ this._enqueueWrite({
1474
+ directory: this.directory,
1475
+ locale: this.locale,
1476
+ cb
1477
+ });
1478
+ } else cb();
1479
+ return shim$1.format.apply(shim$1.format, [this.cache[this.locale][str] || str].concat(args));
1480
+ }
1481
+ __n() {
1482
+ const args = Array.prototype.slice.call(arguments);
1483
+ const singular = args.shift();
1484
+ const plural = args.shift();
1485
+ const quantity = args.shift();
1486
+ let cb = function() {};
1487
+ if (typeof args[args.length - 1] === "function") cb = args.pop();
1488
+ if (!this.cache[this.locale]) this._readLocaleFile();
1489
+ let str = quantity === 1 ? singular : plural;
1490
+ if (this.cache[this.locale][singular]) str = this.cache[this.locale][singular][quantity === 1 ? "one" : "other"];
1491
+ if (!this.cache[this.locale][singular] && this.updateFiles) {
1492
+ this.cache[this.locale][singular] = {
1493
+ one: singular,
1494
+ other: plural
1495
+ };
1496
+ this._enqueueWrite({
1497
+ directory: this.directory,
1498
+ locale: this.locale,
1499
+ cb
1500
+ });
1501
+ } else cb();
1502
+ const values = [str];
1503
+ if (~str.indexOf("%d")) values.push(quantity);
1504
+ return shim$1.format.apply(shim$1.format, values.concat(args));
1505
+ }
1506
+ setLocale(locale) {
1507
+ this.locale = locale;
1508
+ }
1509
+ getLocale() {
1510
+ return this.locale;
1511
+ }
1512
+ updateLocale(obj) {
1513
+ if (!this.cache[this.locale]) this._readLocaleFile();
1514
+ for (const key in obj) if (Object.prototype.hasOwnProperty.call(obj, key)) this.cache[this.locale][key] = obj[key];
1515
+ }
1516
+ _taggedLiteral(parts, ...args) {
1517
+ let str = "";
1518
+ parts.forEach(function(part, i) {
1519
+ const arg = args[i + 1];
1520
+ str += part;
1521
+ if (typeof arg !== "undefined") str += "%s";
1522
+ });
1523
+ return this.__.apply(this, [str].concat([].slice.call(args, 1)));
1524
+ }
1525
+ _enqueueWrite(work) {
1526
+ this.writeQueue.push(work);
1527
+ if (this.writeQueue.length === 1) this._processWriteQueue();
1528
+ }
1529
+ _processWriteQueue() {
1530
+ const _this = this;
1531
+ const work = this.writeQueue[0];
1532
+ const directory = work.directory;
1533
+ const locale = work.locale;
1534
+ const cb = work.cb;
1535
+ const languageFile = this._resolveLocaleFile(directory, locale);
1536
+ const serializedLocale = JSON.stringify(this.cache[locale], null, 2);
1537
+ shim$1.fs.writeFile(languageFile, serializedLocale, "utf-8", function(err) {
1538
+ _this.writeQueue.shift();
1539
+ if (_this.writeQueue.length > 0) _this._processWriteQueue();
1540
+ cb(err);
1541
+ });
1542
+ }
1543
+ _readLocaleFile() {
1544
+ let localeLookup = {};
1545
+ const languageFile = this._resolveLocaleFile(this.directory, this.locale);
1546
+ try {
1547
+ if (shim$1.fs.readFileSync) localeLookup = JSON.parse(shim$1.fs.readFileSync(languageFile, "utf-8"));
1548
+ } catch (err) {
1549
+ if (err instanceof SyntaxError) err.message = "syntax error in " + languageFile;
1550
+ if (err.code === "ENOENT") localeLookup = {};
1551
+ else throw err;
1552
+ }
1553
+ this.cache[this.locale] = localeLookup;
1554
+ }
1555
+ _resolveLocaleFile(directory, locale) {
1556
+ let file = shim$1.resolve(directory, "./", locale + ".json");
1557
+ if (this.fallbackToLanguage && !this._fileExistsSync(file) && ~locale.lastIndexOf("_")) {
1558
+ const languageFile = shim$1.resolve(directory, "./", locale.split("_")[0] + ".json");
1559
+ if (this._fileExistsSync(languageFile)) file = languageFile;
1560
+ }
1561
+ return file;
1562
+ }
1563
+ _fileExistsSync(file) {
1564
+ return shim$1.exists(file);
1565
+ }
1566
+ };
1567
+ function y18n(opts, _shim) {
1568
+ shim$1 = _shim;
1569
+ const y18n$2 = new Y18N(opts);
1570
+ return {
1571
+ __: y18n$2.__.bind(y18n$2),
1572
+ __n: y18n$2.__n.bind(y18n$2),
1573
+ setLocale: y18n$2.setLocale.bind(y18n$2),
1574
+ getLocale: y18n$2.getLocale.bind(y18n$2),
1575
+ updateLocale: y18n$2.updateLocale.bind(y18n$2),
1576
+ locale: y18n$2.locale
1577
+ };
1578
+ }
1579
+
1580
+ //#endregion
1581
+ //#region ../../node_modules/.pnpm/y18n@5.0.8/node_modules/y18n/index.mjs
1582
+ const y18n$1 = (opts) => {
1583
+ return y18n(opts, node_default);
1584
+ };
1585
+ var y18n_default = y18n$1;
1586
+
1587
+ //#endregion
1588
+ //#region ../../node_modules/.pnpm/get-caller-file@2.0.5/node_modules/get-caller-file/index.js
1589
+ var require_get_caller_file = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/get-caller-file@2.0.5/node_modules/get-caller-file/index.js": ((exports, module) => {
1590
+ module.exports = function getCallerFile$1(position) {
1591
+ if (position === void 0) position = 2;
1592
+ if (position >= Error.stackTraceLimit) throw new TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `" + position + "` and Error.stackTraceLimit was: `" + Error.stackTraceLimit + "`");
1593
+ var oldPrepareStackTrace = Error.prepareStackTrace;
1594
+ Error.prepareStackTrace = function(_, stack$1) {
1595
+ return stack$1;
1596
+ };
1597
+ var stack = (/* @__PURE__ */ new Error()).stack;
1598
+ Error.prepareStackTrace = oldPrepareStackTrace;
1599
+ if (stack !== null && typeof stack === "object") return stack[position] ? stack[position].getFileName() : void 0;
1600
+ };
1601
+ }) });
1602
+
1603
+ //#endregion
1604
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/lib/platform-shims/esm.mjs
1605
+ var import_get_caller_file = /* @__PURE__ */ __toESM(require_get_caller_file(), 1);
1606
+ const __dirname$1 = fileURLToPath(import.meta.url);
1607
+ const mainFilename = __dirname$1.substring(0, __dirname$1.lastIndexOf("node_modules"));
1608
+ const require = createRequire(import.meta.url);
1609
+ var esm_default = {
1610
+ assert: {
1611
+ notStrictEqual,
1612
+ strictEqual
1613
+ },
1614
+ cliui: ui,
1615
+ findUp: sync_default,
1616
+ getEnv: (key) => {
1617
+ return process.env[key];
1618
+ },
1619
+ inspect,
1620
+ getProcessArgvBin,
1621
+ mainFilename: mainFilename || process.cwd(),
1622
+ Parser: lib_default,
1623
+ path: {
1624
+ basename,
1625
+ dirname,
1626
+ extname,
1627
+ relative,
1628
+ resolve,
1629
+ join
1630
+ },
1631
+ process: {
1632
+ argv: () => process.argv,
1633
+ cwd: process.cwd,
1634
+ emitWarning: (warning, type) => process.emitWarning(warning, type),
1635
+ execPath: () => process.execPath,
1636
+ exit: (code) => {
1637
+ process.exit(code);
1638
+ },
1639
+ nextTick: process.nextTick,
1640
+ stdColumns: typeof process.stdout.columns !== "undefined" ? process.stdout.columns : null
1641
+ },
1642
+ readFileSync: readFileSync$1,
1643
+ readdirSync: readdirSync$1,
1644
+ require,
1645
+ getCallerFile: () => {
1646
+ const callerFile = (0, import_get_caller_file.default)(3);
1647
+ return callerFile.match(/^file:\/\//) ? fileURLToPath(callerFile) : callerFile;
1648
+ },
1649
+ stringWidth,
1650
+ y18n: y18n_default({
1651
+ directory: resolve(__dirname$1, "../../../locales"),
1652
+ updateFiles: false
1653
+ })
1654
+ };
1655
+
1656
+ //#endregion
1657
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/typings/common-types.js
1658
+ function assertNotStrictEqual(actual, expected, shim$2, message) {
1659
+ shim$2.assert.notStrictEqual(actual, expected, message);
1660
+ }
1661
+ function assertSingleKey(actual, shim$2) {
1662
+ shim$2.assert.strictEqual(typeof actual, "string");
1663
+ }
1664
+ function objectKeys(object) {
1665
+ return Object.keys(object);
1666
+ }
1667
+
1668
+ //#endregion
1669
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/utils/is-promise.js
1670
+ function isPromise(maybePromise) {
1671
+ return !!maybePromise && !!maybePromise.then && typeof maybePromise.then === "function";
1672
+ }
1673
+
1674
+ //#endregion
1675
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/yerror.js
1676
+ var YError = class YError extends Error {
1677
+ constructor(msg) {
1678
+ super(msg || "yargs error");
1679
+ this.name = "YError";
1680
+ if (Error.captureStackTrace) Error.captureStackTrace(this, YError);
1681
+ }
1682
+ };
1683
+
1684
+ //#endregion
1685
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/parse-command.js
1686
+ function parseCommand(cmd) {
1687
+ const splitCommand = cmd.replace(/\s{2,}/g, " ").split(/\s+(?![^[]*]|[^<]*>)/);
1688
+ const bregex = /\.*[\][<>]/g;
1689
+ const firstCommand = splitCommand.shift();
1690
+ if (!firstCommand) throw new Error(`No command found in: ${cmd}`);
1691
+ const parsedCommand = {
1692
+ cmd: firstCommand.replace(bregex, ""),
1693
+ demanded: [],
1694
+ optional: []
1695
+ };
1696
+ splitCommand.forEach((cmd$1, i) => {
1697
+ let variadic = false;
1698
+ cmd$1 = cmd$1.replace(/\s/g, "");
1699
+ if (/\.+[\]>]/.test(cmd$1) && i === splitCommand.length - 1) variadic = true;
1700
+ if (/^\[/.test(cmd$1)) parsedCommand.optional.push({
1701
+ cmd: cmd$1.replace(bregex, "").split("|"),
1702
+ variadic
1703
+ });
1704
+ else parsedCommand.demanded.push({
1705
+ cmd: cmd$1.replace(bregex, "").split("|"),
1706
+ variadic
1707
+ });
1708
+ });
1709
+ return parsedCommand;
1710
+ }
1711
+
1712
+ //#endregion
1713
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/argsert.js
1714
+ const positionName = [
1715
+ "first",
1716
+ "second",
1717
+ "third",
1718
+ "fourth",
1719
+ "fifth",
1720
+ "sixth"
1721
+ ];
1722
+ function argsert(arg1, arg2, arg3) {
1723
+ function parseArgs() {
1724
+ return typeof arg1 === "object" ? [
1725
+ {
1726
+ demanded: [],
1727
+ optional: []
1728
+ },
1729
+ arg1,
1730
+ arg2
1731
+ ] : [
1732
+ parseCommand(`cmd ${arg1}`),
1733
+ arg2,
1734
+ arg3
1735
+ ];
1736
+ }
1737
+ try {
1738
+ let position = 0;
1739
+ const [parsed, callerArguments, _length] = parseArgs();
1740
+ const args = [].slice.call(callerArguments);
1741
+ while (args.length && args[args.length - 1] === void 0) args.pop();
1742
+ const length = _length || args.length;
1743
+ if (length < parsed.demanded.length) throw new YError(`Not enough arguments provided. Expected ${parsed.demanded.length} but received ${args.length}.`);
1744
+ const totalCommands = parsed.demanded.length + parsed.optional.length;
1745
+ if (length > totalCommands) throw new YError(`Too many arguments provided. Expected max ${totalCommands} but received ${length}.`);
1746
+ parsed.demanded.forEach((demanded) => {
1747
+ const observedType = guessType(args.shift());
1748
+ if (demanded.cmd.filter((type) => type === observedType || type === "*").length === 0) argumentTypeError(observedType, demanded.cmd, position);
1749
+ position += 1;
1750
+ });
1751
+ parsed.optional.forEach((optional) => {
1752
+ if (args.length === 0) return;
1753
+ const observedType = guessType(args.shift());
1754
+ if (optional.cmd.filter((type) => type === observedType || type === "*").length === 0) argumentTypeError(observedType, optional.cmd, position);
1755
+ position += 1;
1756
+ });
1757
+ } catch (err) {
1758
+ console.warn(err.stack);
1759
+ }
1760
+ }
1761
+ function guessType(arg) {
1762
+ if (Array.isArray(arg)) return "array";
1763
+ else if (arg === null) return "null";
1764
+ return typeof arg;
1765
+ }
1766
+ function argumentTypeError(observedType, allowedTypes, position) {
1767
+ throw new YError(`Invalid ${positionName[position] || "manyith"} argument. Expected ${allowedTypes.join(" or ")} but received ${observedType}.`);
1768
+ }
1769
+
1770
+ //#endregion
1771
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/middleware.js
1772
+ var GlobalMiddleware = class {
1773
+ constructor(yargs) {
1774
+ this.globalMiddleware = [];
1775
+ this.frozens = [];
1776
+ this.yargs = yargs;
1777
+ }
1778
+ addMiddleware(callback, applyBeforeValidation, global = true, mutates = false) {
1779
+ argsert("<array|function> [boolean] [boolean] [boolean]", [
1780
+ callback,
1781
+ applyBeforeValidation,
1782
+ global
1783
+ ], arguments.length);
1784
+ if (Array.isArray(callback)) {
1785
+ for (let i = 0; i < callback.length; i++) {
1786
+ if (typeof callback[i] !== "function") throw Error("middleware must be a function");
1787
+ const m = callback[i];
1788
+ m.applyBeforeValidation = applyBeforeValidation;
1789
+ m.global = global;
1790
+ }
1791
+ Array.prototype.push.apply(this.globalMiddleware, callback);
1792
+ } else if (typeof callback === "function") {
1793
+ const m = callback;
1794
+ m.applyBeforeValidation = applyBeforeValidation;
1795
+ m.global = global;
1796
+ m.mutates = mutates;
1797
+ this.globalMiddleware.push(callback);
1798
+ }
1799
+ return this.yargs;
1800
+ }
1801
+ addCoerceMiddleware(callback, option) {
1802
+ const aliases = this.yargs.getAliases();
1803
+ this.globalMiddleware = this.globalMiddleware.filter((m) => {
1804
+ const toCheck = [...aliases[option] || [], option];
1805
+ if (!m.option) return true;
1806
+ else return !toCheck.includes(m.option);
1807
+ });
1808
+ callback.option = option;
1809
+ return this.addMiddleware(callback, true, true, true);
1810
+ }
1811
+ getMiddleware() {
1812
+ return this.globalMiddleware;
1813
+ }
1814
+ freeze() {
1815
+ this.frozens.push([...this.globalMiddleware]);
1816
+ }
1817
+ unfreeze() {
1818
+ const frozen = this.frozens.pop();
1819
+ if (frozen !== void 0) this.globalMiddleware = frozen;
1820
+ }
1821
+ reset() {
1822
+ this.globalMiddleware = this.globalMiddleware.filter((m) => m.global);
1823
+ }
1824
+ };
1825
+ function commandMiddlewareFactory(commandMiddleware) {
1826
+ if (!commandMiddleware) return [];
1827
+ return commandMiddleware.map((middleware) => {
1828
+ middleware.applyBeforeValidation = false;
1829
+ return middleware;
1830
+ });
1831
+ }
1832
+ function applyMiddleware(argv, yargs, middlewares, beforeValidation) {
1833
+ return middlewares.reduce((acc, middleware) => {
1834
+ if (middleware.applyBeforeValidation !== beforeValidation) return acc;
1835
+ if (middleware.mutates) {
1836
+ if (middleware.applied) return acc;
1837
+ middleware.applied = true;
1838
+ }
1839
+ if (isPromise(acc)) return acc.then((initialObj) => Promise.all([initialObj, middleware(initialObj, yargs)])).then(([initialObj, middlewareObj]) => Object.assign(initialObj, middlewareObj));
1840
+ else {
1841
+ const result = middleware(acc, yargs);
1842
+ return isPromise(result) ? result.then((middlewareObj) => Object.assign(acc, middlewareObj)) : Object.assign(acc, result);
1843
+ }
1844
+ }, argv);
1845
+ }
1846
+
1847
+ //#endregion
1848
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/utils/maybe-async-result.js
1849
+ function maybeAsyncResult(getResult, resultHandler, errorHandler = (err) => {
1850
+ throw err;
1851
+ }) {
1852
+ try {
1853
+ const result = isFunction(getResult) ? getResult() : getResult;
1854
+ return isPromise(result) ? result.then((result$1) => resultHandler(result$1)) : resultHandler(result);
1855
+ } catch (err) {
1856
+ return errorHandler(err);
1857
+ }
1858
+ }
1859
+ function isFunction(arg) {
1860
+ return typeof arg === "function";
1861
+ }
1862
+
1863
+ //#endregion
1864
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/command.js
1865
+ const DEFAULT_MARKER = /(^\*)|(^\$0)/;
1866
+ var CommandInstance = class {
1867
+ constructor(usage$1, validation$1, globalMiddleware, shim$2) {
1868
+ this.requireCache = /* @__PURE__ */ new Set();
1869
+ this.handlers = {};
1870
+ this.aliasMap = {};
1871
+ this.frozens = [];
1872
+ this.shim = shim$2;
1873
+ this.usage = usage$1;
1874
+ this.globalMiddleware = globalMiddleware;
1875
+ this.validation = validation$1;
1876
+ }
1877
+ addDirectory(dir, req, callerFile, opts) {
1878
+ opts = opts || {};
1879
+ this.requireCache.add(callerFile);
1880
+ const fullDirPath = this.shim.path.resolve(this.shim.path.dirname(callerFile), dir);
1881
+ const files = this.shim.readdirSync(fullDirPath, { recursive: opts.recurse ? true : false });
1882
+ if (!Array.isArray(opts.extensions)) opts.extensions = ["js"];
1883
+ const visit = typeof opts.visit === "function" ? opts.visit : (o) => o;
1884
+ for (const fileb of files) {
1885
+ const file = fileb.toString();
1886
+ if (opts.exclude) {
1887
+ let exclude = false;
1888
+ if (typeof opts.exclude === "function") exclude = opts.exclude(file);
1889
+ else exclude = opts.exclude.test(file);
1890
+ if (exclude) continue;
1891
+ }
1892
+ if (opts.include) {
1893
+ let include = false;
1894
+ if (typeof opts.include === "function") include = opts.include(file);
1895
+ else include = opts.include.test(file);
1896
+ if (!include) continue;
1897
+ }
1898
+ let supportedExtension = false;
1899
+ for (const ext of opts.extensions) if (file.endsWith(ext)) supportedExtension = true;
1900
+ if (supportedExtension) {
1901
+ const joined = this.shim.path.join(fullDirPath, file);
1902
+ const module$1 = req(joined);
1903
+ const extendableModule = Object.create(null, Object.getOwnPropertyDescriptors({ ...module$1 }));
1904
+ if (visit(extendableModule, joined, file)) {
1905
+ if (this.requireCache.has(joined)) continue;
1906
+ else this.requireCache.add(joined);
1907
+ if (!extendableModule.command) extendableModule.command = this.shim.path.basename(joined, this.shim.path.extname(joined));
1908
+ this.addHandler(extendableModule);
1909
+ }
1910
+ }
1911
+ }
1912
+ }
1913
+ addHandler(cmd, description, builder, handler, commandMiddleware, deprecated) {
1914
+ let aliases = [];
1915
+ const middlewares = commandMiddlewareFactory(commandMiddleware);
1916
+ handler = handler || (() => {});
1917
+ if (Array.isArray(cmd)) if (isCommandAndAliases(cmd)) [cmd, ...aliases] = cmd;
1918
+ else for (const command$1 of cmd) this.addHandler(command$1);
1919
+ else if (isCommandHandlerDefinition(cmd)) {
1920
+ let command$1 = Array.isArray(cmd.command) || typeof cmd.command === "string" ? cmd.command : null;
1921
+ if (command$1 === null) throw new Error(`No command name given for module: ${this.shim.inspect(cmd)}`);
1922
+ if (cmd.aliases) command$1 = [].concat(command$1).concat(cmd.aliases);
1923
+ this.addHandler(command$1, this.extractDesc(cmd), cmd.builder, cmd.handler, cmd.middlewares, cmd.deprecated);
1924
+ return;
1925
+ } else if (isCommandBuilderDefinition(builder)) {
1926
+ this.addHandler([cmd].concat(aliases), description, builder.builder, builder.handler, builder.middlewares, builder.deprecated);
1927
+ return;
1928
+ }
1929
+ if (typeof cmd === "string") {
1930
+ const parsedCommand = parseCommand(cmd);
1931
+ aliases = aliases.map((alias) => parseCommand(alias).cmd);
1932
+ let isDefault = false;
1933
+ const parsedAliases = [parsedCommand.cmd].concat(aliases).filter((c) => {
1934
+ if (DEFAULT_MARKER.test(c)) {
1935
+ isDefault = true;
1936
+ return false;
1937
+ }
1938
+ return true;
1939
+ });
1940
+ if (parsedAliases.length === 0 && isDefault) parsedAliases.push("$0");
1941
+ if (isDefault) {
1942
+ parsedCommand.cmd = parsedAliases[0];
1943
+ aliases = parsedAliases.slice(1);
1944
+ cmd = cmd.replace(DEFAULT_MARKER, parsedCommand.cmd);
1945
+ }
1946
+ aliases.forEach((alias) => {
1947
+ this.aliasMap[alias] = parsedCommand.cmd;
1948
+ });
1949
+ if (description !== false) this.usage.command(cmd, description, isDefault, aliases, deprecated);
1950
+ this.handlers[parsedCommand.cmd] = {
1951
+ original: cmd,
1952
+ description,
1953
+ handler,
1954
+ builder: builder || {},
1955
+ middlewares,
1956
+ deprecated,
1957
+ demanded: parsedCommand.demanded,
1958
+ optional: parsedCommand.optional
1959
+ };
1960
+ if (isDefault) this.defaultCommand = this.handlers[parsedCommand.cmd];
1961
+ }
1962
+ }
1963
+ getCommandHandlers() {
1964
+ return this.handlers;
1965
+ }
1966
+ getCommands() {
1967
+ return Object.keys(this.handlers).concat(Object.keys(this.aliasMap));
1968
+ }
1969
+ hasDefaultCommand() {
1970
+ return !!this.defaultCommand;
1971
+ }
1972
+ runCommand(command$1, yargs, parsed, commandIndex, helpOnly, helpOrVersionSet) {
1973
+ const commandHandler = this.handlers[command$1] || this.handlers[this.aliasMap[command$1]] || this.defaultCommand;
1974
+ const currentContext = yargs.getInternalMethods().getContext();
1975
+ const parentCommands = currentContext.commands.slice();
1976
+ const isDefaultCommand = !command$1;
1977
+ if (command$1) {
1978
+ currentContext.commands.push(command$1);
1979
+ currentContext.fullCommands.push(commandHandler.original);
1980
+ }
1981
+ const builderResult = this.applyBuilderUpdateUsageAndParse(isDefaultCommand, commandHandler, yargs, parsed.aliases, parentCommands, commandIndex, helpOnly, helpOrVersionSet);
1982
+ return isPromise(builderResult) ? builderResult.then((result) => this.applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, result.innerArgv, currentContext, helpOnly, result.aliases, yargs)) : this.applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, builderResult.innerArgv, currentContext, helpOnly, builderResult.aliases, yargs);
1983
+ }
1984
+ applyBuilderUpdateUsageAndParse(isDefaultCommand, commandHandler, yargs, aliases, parentCommands, commandIndex, helpOnly, helpOrVersionSet) {
1985
+ const builder = commandHandler.builder;
1986
+ let innerYargs = yargs;
1987
+ if (isCommandBuilderCallback(builder)) {
1988
+ yargs.getInternalMethods().getUsageInstance().freeze();
1989
+ const builderOutput = builder(yargs.getInternalMethods().reset(aliases), helpOrVersionSet);
1990
+ if (isPromise(builderOutput)) return builderOutput.then((output) => {
1991
+ innerYargs = isYargsInstance(output) ? output : yargs;
1992
+ return this.parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly);
1993
+ });
1994
+ } else if (isCommandBuilderOptionDefinitions(builder)) {
1995
+ yargs.getInternalMethods().getUsageInstance().freeze();
1996
+ innerYargs = yargs.getInternalMethods().reset(aliases);
1997
+ Object.keys(commandHandler.builder).forEach((key) => {
1998
+ innerYargs.option(key, builder[key]);
1999
+ });
2000
+ }
2001
+ return this.parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly);
2002
+ }
2003
+ parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly) {
2004
+ if (isDefaultCommand) innerYargs.getInternalMethods().getUsageInstance().unfreeze(true);
2005
+ if (this.shouldUpdateUsage(innerYargs)) innerYargs.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(parentCommands, commandHandler), commandHandler.description);
2006
+ const innerArgv = innerYargs.getInternalMethods().runYargsParserAndExecuteCommands(null, void 0, true, commandIndex, helpOnly);
2007
+ return isPromise(innerArgv) ? innerArgv.then((argv) => ({
2008
+ aliases: innerYargs.parsed.aliases,
2009
+ innerArgv: argv
2010
+ })) : {
2011
+ aliases: innerYargs.parsed.aliases,
2012
+ innerArgv
2013
+ };
2014
+ }
2015
+ shouldUpdateUsage(yargs) {
2016
+ return !yargs.getInternalMethods().getUsageInstance().getUsageDisabled() && yargs.getInternalMethods().getUsageInstance().getUsage().length === 0;
2017
+ }
2018
+ usageFromParentCommandsCommandHandler(parentCommands, commandHandler) {
2019
+ const c = DEFAULT_MARKER.test(commandHandler.original) ? commandHandler.original.replace(DEFAULT_MARKER, "").trim() : commandHandler.original;
2020
+ const pc = parentCommands.filter((c$1) => {
2021
+ return !DEFAULT_MARKER.test(c$1);
2022
+ });
2023
+ pc.push(c);
2024
+ return `$0 ${pc.join(" ")}`;
2025
+ }
2026
+ handleValidationAndGetResult(isDefaultCommand, commandHandler, innerArgv, currentContext, aliases, yargs, middlewares, positionalMap) {
2027
+ if (!yargs.getInternalMethods().getHasOutput()) {
2028
+ const validation$1 = yargs.getInternalMethods().runValidation(aliases, positionalMap, yargs.parsed.error, isDefaultCommand);
2029
+ innerArgv = maybeAsyncResult(innerArgv, (result) => {
2030
+ validation$1(result);
2031
+ return result;
2032
+ });
2033
+ }
2034
+ if (commandHandler.handler && !yargs.getInternalMethods().getHasOutput()) {
2035
+ yargs.getInternalMethods().setHasOutput();
2036
+ const populateDoubleDash = !!yargs.getOptions().configuration["populate--"];
2037
+ yargs.getInternalMethods().postProcess(innerArgv, populateDoubleDash, false, false);
2038
+ innerArgv = applyMiddleware(innerArgv, yargs, middlewares, false);
2039
+ innerArgv = maybeAsyncResult(innerArgv, (result) => {
2040
+ const handlerResult = commandHandler.handler(result);
2041
+ return isPromise(handlerResult) ? handlerResult.then(() => result) : result;
2042
+ });
2043
+ if (!isDefaultCommand) yargs.getInternalMethods().getUsageInstance().cacheHelpMessage();
2044
+ if (isPromise(innerArgv) && !yargs.getInternalMethods().hasParseCallback()) innerArgv.catch((error) => {
2045
+ try {
2046
+ yargs.getInternalMethods().getUsageInstance().fail(null, error);
2047
+ } catch (_err) {}
2048
+ });
2049
+ }
2050
+ if (!isDefaultCommand) {
2051
+ currentContext.commands.pop();
2052
+ currentContext.fullCommands.pop();
2053
+ }
2054
+ return innerArgv;
2055
+ }
2056
+ applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, innerArgv, currentContext, helpOnly, aliases, yargs) {
2057
+ let positionalMap = {};
2058
+ if (helpOnly) return innerArgv;
2059
+ if (!yargs.getInternalMethods().getHasOutput()) positionalMap = this.populatePositionals(commandHandler, innerArgv, currentContext, yargs);
2060
+ const middlewares = this.globalMiddleware.getMiddleware().slice(0).concat(commandHandler.middlewares);
2061
+ const maybePromiseArgv = applyMiddleware(innerArgv, yargs, middlewares, true);
2062
+ return isPromise(maybePromiseArgv) ? maybePromiseArgv.then((resolvedInnerArgv) => this.handleValidationAndGetResult(isDefaultCommand, commandHandler, resolvedInnerArgv, currentContext, aliases, yargs, middlewares, positionalMap)) : this.handleValidationAndGetResult(isDefaultCommand, commandHandler, maybePromiseArgv, currentContext, aliases, yargs, middlewares, positionalMap);
2063
+ }
2064
+ populatePositionals(commandHandler, argv, context, yargs) {
2065
+ argv._ = argv._.slice(context.commands.length);
2066
+ const demanded = commandHandler.demanded.slice(0);
2067
+ const optional = commandHandler.optional.slice(0);
2068
+ const positionalMap = {};
2069
+ this.validation.positionalCount(demanded.length, argv._.length);
2070
+ while (demanded.length) {
2071
+ const demand = demanded.shift();
2072
+ this.populatePositional(demand, argv, positionalMap);
2073
+ }
2074
+ while (optional.length) {
2075
+ const maybe = optional.shift();
2076
+ this.populatePositional(maybe, argv, positionalMap);
2077
+ }
2078
+ argv._ = context.commands.concat(argv._.map((a) => "" + a));
2079
+ this.postProcessPositionals(argv, positionalMap, this.cmdToParseOptions(commandHandler.original), yargs);
2080
+ return positionalMap;
2081
+ }
2082
+ populatePositional(positional, argv, positionalMap) {
2083
+ const cmd = positional.cmd[0];
2084
+ if (positional.variadic) positionalMap[cmd] = argv._.splice(0).map(String);
2085
+ else if (argv._.length) positionalMap[cmd] = [String(argv._.shift())];
2086
+ }
2087
+ cmdToParseOptions(cmdString) {
2088
+ const parseOptions = {
2089
+ array: [],
2090
+ default: {},
2091
+ alias: {},
2092
+ demand: {}
2093
+ };
2094
+ const parsed = parseCommand(cmdString);
2095
+ parsed.demanded.forEach((d) => {
2096
+ const [cmd, ...aliases] = d.cmd;
2097
+ if (d.variadic) {
2098
+ parseOptions.array.push(cmd);
2099
+ parseOptions.default[cmd] = [];
2100
+ }
2101
+ parseOptions.alias[cmd] = aliases;
2102
+ parseOptions.demand[cmd] = true;
2103
+ });
2104
+ parsed.optional.forEach((o) => {
2105
+ const [cmd, ...aliases] = o.cmd;
2106
+ if (o.variadic) {
2107
+ parseOptions.array.push(cmd);
2108
+ parseOptions.default[cmd] = [];
2109
+ }
2110
+ parseOptions.alias[cmd] = aliases;
2111
+ });
2112
+ return parseOptions;
2113
+ }
2114
+ postProcessPositionals(argv, positionalMap, parseOptions, yargs) {
2115
+ const options = Object.assign({}, yargs.getOptions());
2116
+ options.default = Object.assign(parseOptions.default, options.default);
2117
+ for (const key of Object.keys(parseOptions.alias)) options.alias[key] = (options.alias[key] || []).concat(parseOptions.alias[key]);
2118
+ options.array = options.array.concat(parseOptions.array);
2119
+ options.config = {};
2120
+ const unparsed = [];
2121
+ Object.keys(positionalMap).forEach((key) => {
2122
+ positionalMap[key].map((value) => {
2123
+ if (options.configuration["unknown-options-as-args"]) options.key[key] = true;
2124
+ unparsed.push(`--${key}`);
2125
+ unparsed.push(value);
2126
+ });
2127
+ });
2128
+ if (!unparsed.length) return;
2129
+ const config = Object.assign({}, options.configuration, { "populate--": false });
2130
+ const parsed = this.shim.Parser.detailed(unparsed, Object.assign({}, options, { configuration: config }));
2131
+ if (parsed.error) yargs.getInternalMethods().getUsageInstance().fail(parsed.error.message, parsed.error);
2132
+ else {
2133
+ const positionalKeys = Object.keys(positionalMap);
2134
+ Object.keys(positionalMap).forEach((key) => {
2135
+ positionalKeys.push(...parsed.aliases[key]);
2136
+ });
2137
+ Object.keys(parsed.argv).forEach((key) => {
2138
+ if (positionalKeys.includes(key)) {
2139
+ if (!positionalMap[key]) positionalMap[key] = parsed.argv[key];
2140
+ if (!this.isInConfigs(yargs, key) && !this.isDefaulted(yargs, key) && Object.prototype.hasOwnProperty.call(argv, key) && Object.prototype.hasOwnProperty.call(parsed.argv, key) && (Array.isArray(argv[key]) || Array.isArray(parsed.argv[key]))) argv[key] = [].concat(argv[key], parsed.argv[key]);
2141
+ else argv[key] = parsed.argv[key];
2142
+ }
2143
+ });
2144
+ }
2145
+ }
2146
+ isDefaulted(yargs, key) {
2147
+ const { default: defaults } = yargs.getOptions();
2148
+ return Object.prototype.hasOwnProperty.call(defaults, key) || Object.prototype.hasOwnProperty.call(defaults, this.shim.Parser.camelCase(key));
2149
+ }
2150
+ isInConfigs(yargs, key) {
2151
+ const { configObjects } = yargs.getOptions();
2152
+ return configObjects.some((c) => Object.prototype.hasOwnProperty.call(c, key)) || configObjects.some((c) => Object.prototype.hasOwnProperty.call(c, this.shim.Parser.camelCase(key)));
2153
+ }
2154
+ runDefaultBuilderOn(yargs) {
2155
+ if (!this.defaultCommand) return;
2156
+ if (this.shouldUpdateUsage(yargs)) {
2157
+ const commandString = DEFAULT_MARKER.test(this.defaultCommand.original) ? this.defaultCommand.original : this.defaultCommand.original.replace(/^[^[\]<>]*/, "$0 ");
2158
+ yargs.getInternalMethods().getUsageInstance().usage(commandString, this.defaultCommand.description);
2159
+ }
2160
+ const builder = this.defaultCommand.builder;
2161
+ if (isCommandBuilderCallback(builder)) return builder(yargs, true);
2162
+ else if (!isCommandBuilderDefinition(builder)) Object.keys(builder).forEach((key) => {
2163
+ yargs.option(key, builder[key]);
2164
+ });
2165
+ }
2166
+ extractDesc({ describe, description, desc }) {
2167
+ for (const test of [
2168
+ describe,
2169
+ description,
2170
+ desc
2171
+ ]) {
2172
+ if (typeof test === "string" || test === false) return test;
2173
+ assertNotStrictEqual(test, true, this.shim);
2174
+ }
2175
+ return false;
2176
+ }
2177
+ freeze() {
2178
+ this.frozens.push({
2179
+ handlers: this.handlers,
2180
+ aliasMap: this.aliasMap,
2181
+ defaultCommand: this.defaultCommand
2182
+ });
2183
+ }
2184
+ unfreeze() {
2185
+ const frozen = this.frozens.pop();
2186
+ assertNotStrictEqual(frozen, void 0, this.shim);
2187
+ ({handlers: this.handlers, aliasMap: this.aliasMap, defaultCommand: this.defaultCommand} = frozen);
2188
+ }
2189
+ reset() {
2190
+ this.handlers = {};
2191
+ this.aliasMap = {};
2192
+ this.defaultCommand = void 0;
2193
+ this.requireCache = /* @__PURE__ */ new Set();
2194
+ return this;
2195
+ }
2196
+ };
2197
+ function command(usage$1, validation$1, globalMiddleware, shim$2) {
2198
+ return new CommandInstance(usage$1, validation$1, globalMiddleware, shim$2);
2199
+ }
2200
+ function isCommandBuilderDefinition(builder) {
2201
+ return typeof builder === "object" && !!builder.builder && typeof builder.handler === "function";
2202
+ }
2203
+ function isCommandAndAliases(cmd) {
2204
+ return cmd.every((c) => typeof c === "string");
2205
+ }
2206
+ function isCommandBuilderCallback(builder) {
2207
+ return typeof builder === "function";
2208
+ }
2209
+ function isCommandBuilderOptionDefinitions(builder) {
2210
+ return typeof builder === "object";
2211
+ }
2212
+ function isCommandHandlerDefinition(cmd) {
2213
+ return typeof cmd === "object" && !Array.isArray(cmd);
2214
+ }
2215
+
2216
+ //#endregion
2217
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/utils/obj-filter.js
2218
+ function objFilter(original = {}, filter = () => true) {
2219
+ const obj = {};
2220
+ objectKeys(original).forEach((key) => {
2221
+ if (filter(key, original[key])) obj[key] = original[key];
2222
+ });
2223
+ return obj;
2224
+ }
2225
+
2226
+ //#endregion
2227
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/utils/set-blocking.js
2228
+ function setBlocking(blocking) {
2229
+ if (typeof process === "undefined") return;
2230
+ [process.stdout, process.stderr].forEach((_stream) => {
2231
+ const stream = _stream;
2232
+ if (stream._handle && stream.isTTY && typeof stream._handle.setBlocking === "function") stream._handle.setBlocking(blocking);
2233
+ });
2234
+ }
2235
+
2236
+ //#endregion
2237
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/usage.js
2238
+ function isBoolean(fail) {
2239
+ return typeof fail === "boolean";
2240
+ }
2241
+ function usage(yargs, shim$2) {
2242
+ const __ = shim$2.y18n.__;
2243
+ const self = {};
2244
+ const fails = [];
2245
+ self.failFn = function failFn(f) {
2246
+ fails.push(f);
2247
+ };
2248
+ let failMessage = null;
2249
+ let globalFailMessage = null;
2250
+ let showHelpOnFail = true;
2251
+ self.showHelpOnFail = function showHelpOnFailFn(arg1 = true, arg2) {
2252
+ const [enabled, message] = typeof arg1 === "string" ? [true, arg1] : [arg1, arg2];
2253
+ if (yargs.getInternalMethods().isGlobalContext()) globalFailMessage = message;
2254
+ failMessage = message;
2255
+ showHelpOnFail = enabled;
2256
+ return self;
2257
+ };
2258
+ let failureOutput = false;
2259
+ self.fail = function fail(msg, err) {
2260
+ const logger = yargs.getInternalMethods().getLoggerInstance();
2261
+ if (fails.length) for (let i = fails.length - 1; i >= 0; --i) {
2262
+ const fail$1 = fails[i];
2263
+ if (isBoolean(fail$1)) {
2264
+ if (err) throw err;
2265
+ else if (msg) throw Error(msg);
2266
+ } else fail$1(msg, err, self);
2267
+ }
2268
+ else {
2269
+ if (yargs.getExitProcess()) setBlocking(true);
2270
+ if (!failureOutput) {
2271
+ failureOutput = true;
2272
+ if (showHelpOnFail) {
2273
+ yargs.showHelp("error");
2274
+ logger.error();
2275
+ }
2276
+ if (msg || err) logger.error(msg || err);
2277
+ const globalOrCommandFailMessage = failMessage || globalFailMessage;
2278
+ if (globalOrCommandFailMessage) {
2279
+ if (msg || err) logger.error("");
2280
+ logger.error(globalOrCommandFailMessage);
2281
+ }
2282
+ }
2283
+ err = err || new YError(msg);
2284
+ if (yargs.getExitProcess()) return yargs.exit(1);
2285
+ else if (yargs.getInternalMethods().hasParseCallback()) return yargs.exit(1, err);
2286
+ else throw err;
2287
+ }
2288
+ };
2289
+ let usages = [];
2290
+ let usageDisabled = false;
2291
+ self.usage = (msg, description) => {
2292
+ if (msg === null) {
2293
+ usageDisabled = true;
2294
+ usages = [];
2295
+ return self;
2296
+ }
2297
+ usageDisabled = false;
2298
+ usages.push([msg, description || ""]);
2299
+ return self;
2300
+ };
2301
+ self.getUsage = () => {
2302
+ return usages;
2303
+ };
2304
+ self.getUsageDisabled = () => {
2305
+ return usageDisabled;
2306
+ };
2307
+ self.getPositionalGroupName = () => {
2308
+ return __("Positionals:");
2309
+ };
2310
+ let examples = [];
2311
+ self.example = (cmd, description) => {
2312
+ examples.push([cmd, description || ""]);
2313
+ };
2314
+ let commands = [];
2315
+ self.command = function command$1(cmd, description, isDefault, aliases, deprecated = false) {
2316
+ if (isDefault) commands = commands.map((cmdArray) => {
2317
+ cmdArray[2] = false;
2318
+ return cmdArray;
2319
+ });
2320
+ commands.push([
2321
+ cmd,
2322
+ description || "",
2323
+ isDefault,
2324
+ aliases,
2325
+ deprecated
2326
+ ]);
2327
+ };
2328
+ self.getCommands = () => commands;
2329
+ let descriptions = {};
2330
+ self.describe = function describe(keyOrKeys, desc) {
2331
+ if (Array.isArray(keyOrKeys)) keyOrKeys.forEach((k) => {
2332
+ self.describe(k, desc);
2333
+ });
2334
+ else if (typeof keyOrKeys === "object") Object.keys(keyOrKeys).forEach((k) => {
2335
+ self.describe(k, keyOrKeys[k]);
2336
+ });
2337
+ else descriptions[keyOrKeys] = desc;
2338
+ };
2339
+ self.getDescriptions = () => descriptions;
2340
+ let epilogs = [];
2341
+ self.epilog = (msg) => {
2342
+ epilogs.push(msg);
2343
+ };
2344
+ let wrapSet = false;
2345
+ let wrap;
2346
+ self.wrap = (cols) => {
2347
+ wrapSet = true;
2348
+ wrap = cols;
2349
+ };
2350
+ self.getWrap = () => {
2351
+ if (shim$2.getEnv("YARGS_DISABLE_WRAP")) return null;
2352
+ if (!wrapSet) {
2353
+ wrap = windowWidth();
2354
+ wrapSet = true;
2355
+ }
2356
+ return wrap;
2357
+ };
2358
+ const deferY18nLookupPrefix = "__yargsString__:";
2359
+ self.deferY18nLookup = (str) => deferY18nLookupPrefix + str;
2360
+ self.help = function help() {
2361
+ if (cachedHelpMessage) return cachedHelpMessage;
2362
+ normalizeAliases();
2363
+ const base$0 = yargs.customScriptName ? yargs.$0 : shim$2.path.basename(yargs.$0);
2364
+ const demandedOptions = yargs.getDemandedOptions();
2365
+ const demandedCommands = yargs.getDemandedCommands();
2366
+ const deprecatedOptions = yargs.getDeprecatedOptions();
2367
+ const groups = yargs.getGroups();
2368
+ const options = yargs.getOptions();
2369
+ let keys = [];
2370
+ keys = keys.concat(Object.keys(descriptions));
2371
+ keys = keys.concat(Object.keys(demandedOptions));
2372
+ keys = keys.concat(Object.keys(demandedCommands));
2373
+ keys = keys.concat(Object.keys(options.default));
2374
+ keys = keys.filter(filterHiddenOptions);
2375
+ keys = Object.keys(keys.reduce((acc, key) => {
2376
+ if (key !== "_") acc[key] = true;
2377
+ return acc;
2378
+ }, {}));
2379
+ const theWrap = self.getWrap();
2380
+ const ui$1 = shim$2.cliui({
2381
+ width: theWrap,
2382
+ wrap: !!theWrap
2383
+ });
2384
+ if (!usageDisabled) {
2385
+ if (usages.length) {
2386
+ usages.forEach((usage$1) => {
2387
+ ui$1.div({ text: `${usage$1[0].replace(/\$0/g, base$0)}` });
2388
+ if (usage$1[1]) ui$1.div({
2389
+ text: `${usage$1[1]}`,
2390
+ padding: [
2391
+ 1,
2392
+ 0,
2393
+ 0,
2394
+ 0
2395
+ ]
2396
+ });
2397
+ });
2398
+ ui$1.div();
2399
+ } else if (commands.length) {
2400
+ let u = null;
2401
+ if (demandedCommands._) u = `${base$0} <${__("command")}>\n`;
2402
+ else u = `${base$0} [${__("command")}]\n`;
2403
+ ui$1.div(`${u}`);
2404
+ }
2405
+ }
2406
+ if (commands.length > 1 || commands.length === 1 && !commands[0][2]) {
2407
+ ui$1.div(__("Commands:"));
2408
+ const context = yargs.getInternalMethods().getContext();
2409
+ const parentCommands = context.commands.length ? `${context.commands.join(" ")} ` : "";
2410
+ if (yargs.getInternalMethods().getParserConfiguration()["sort-commands"] === true) commands = commands.sort((a, b) => a[0].localeCompare(b[0]));
2411
+ const prefix = base$0 ? `${base$0} ` : "";
2412
+ commands.forEach((command$1) => {
2413
+ const commandString = `${prefix}${parentCommands}${command$1[0].replace(/^\$0 ?/, "")}`;
2414
+ ui$1.span({
2415
+ text: commandString,
2416
+ padding: [
2417
+ 0,
2418
+ 2,
2419
+ 0,
2420
+ 2
2421
+ ],
2422
+ width: maxWidth(commands, theWrap, `${base$0}${parentCommands}`) + 4
2423
+ }, { text: command$1[1] });
2424
+ const hints = [];
2425
+ if (command$1[2]) hints.push(`[${__("default")}]`);
2426
+ if (command$1[3] && command$1[3].length) hints.push(`[${__("aliases:")} ${command$1[3].join(", ")}]`);
2427
+ if (command$1[4]) if (typeof command$1[4] === "string") hints.push(`[${__("deprecated: %s", command$1[4])}]`);
2428
+ else hints.push(`[${__("deprecated")}]`);
2429
+ if (hints.length) ui$1.div({
2430
+ text: hints.join(" "),
2431
+ padding: [
2432
+ 0,
2433
+ 0,
2434
+ 0,
2435
+ 2
2436
+ ],
2437
+ align: "right"
2438
+ });
2439
+ else ui$1.div();
2440
+ });
2441
+ ui$1.div();
2442
+ }
2443
+ const aliasKeys = (Object.keys(options.alias) || []).concat(Object.keys(yargs.parsed.newAliases) || []);
2444
+ keys = keys.filter((key) => !yargs.parsed.newAliases[key] && aliasKeys.every((alias) => (options.alias[alias] || []).indexOf(key) === -1));
2445
+ const defaultGroup = __("Options:");
2446
+ if (!groups[defaultGroup]) groups[defaultGroup] = [];
2447
+ addUngroupedKeys(keys, options.alias, groups, defaultGroup);
2448
+ const isLongSwitch = (sw) => /^--/.test(getText(sw));
2449
+ const displayedGroups = Object.keys(groups).filter((groupName) => groups[groupName].length > 0).map((groupName) => {
2450
+ return {
2451
+ groupName,
2452
+ normalizedKeys: groups[groupName].filter(filterHiddenOptions).map((key) => {
2453
+ if (aliasKeys.includes(key)) return key;
2454
+ for (let i = 0, aliasKey; (aliasKey = aliasKeys[i]) !== void 0; i++) if ((options.alias[aliasKey] || []).includes(key)) return aliasKey;
2455
+ return key;
2456
+ })
2457
+ };
2458
+ }).filter(({ normalizedKeys }) => normalizedKeys.length > 0).map(({ groupName, normalizedKeys }) => {
2459
+ return {
2460
+ groupName,
2461
+ normalizedKeys,
2462
+ switches: normalizedKeys.reduce((acc, key) => {
2463
+ acc[key] = [key].concat(options.alias[key] || []).map((sw) => {
2464
+ if (groupName === self.getPositionalGroupName()) return sw;
2465
+ else return (/^[0-9]$/.test(sw) ? options.boolean.includes(key) ? "-" : "--" : sw.length > 1 ? "--" : "-") + sw;
2466
+ }).sort((sw1, sw2) => isLongSwitch(sw1) === isLongSwitch(sw2) ? 0 : isLongSwitch(sw1) ? 1 : -1).join(", ");
2467
+ return acc;
2468
+ }, {})
2469
+ };
2470
+ });
2471
+ if (displayedGroups.filter(({ groupName }) => groupName !== self.getPositionalGroupName()).some(({ normalizedKeys, switches }) => !normalizedKeys.every((key) => isLongSwitch(switches[key])))) displayedGroups.filter(({ groupName }) => groupName !== self.getPositionalGroupName()).forEach(({ normalizedKeys, switches }) => {
2472
+ normalizedKeys.forEach((key) => {
2473
+ if (isLongSwitch(switches[key])) switches[key] = addIndentation(switches[key], 4);
2474
+ });
2475
+ });
2476
+ displayedGroups.forEach(({ groupName, normalizedKeys, switches }) => {
2477
+ ui$1.div(groupName);
2478
+ normalizedKeys.forEach((key) => {
2479
+ const kswitch = switches[key];
2480
+ let desc = descriptions[key] || "";
2481
+ let type = null;
2482
+ if (desc.includes(deferY18nLookupPrefix)) desc = __(desc.substring(16));
2483
+ if (options.boolean.includes(key)) type = `[${__("boolean")}]`;
2484
+ if (options.count.includes(key)) type = `[${__("count")}]`;
2485
+ if (options.string.includes(key)) type = `[${__("string")}]`;
2486
+ if (options.normalize.includes(key)) type = `[${__("string")}]`;
2487
+ if (options.array.includes(key)) type = `[${__("array")}]`;
2488
+ if (options.number.includes(key)) type = `[${__("number")}]`;
2489
+ const deprecatedExtra = (deprecated) => typeof deprecated === "string" ? `[${__("deprecated: %s", deprecated)}]` : `[${__("deprecated")}]`;
2490
+ const extra = [
2491
+ key in deprecatedOptions ? deprecatedExtra(deprecatedOptions[key]) : null,
2492
+ type,
2493
+ key in demandedOptions ? `[${__("required")}]` : null,
2494
+ options.choices && options.choices[key] ? `[${__("choices:")} ${self.stringifiedValues(options.choices[key])}]` : null,
2495
+ defaultString(options.default[key], options.defaultDescription[key])
2496
+ ].filter(Boolean).join(" ");
2497
+ ui$1.span({
2498
+ text: getText(kswitch),
2499
+ padding: [
2500
+ 0,
2501
+ 2,
2502
+ 0,
2503
+ 2 + getIndentation(kswitch)
2504
+ ],
2505
+ width: maxWidth(switches, theWrap) + 4
2506
+ }, desc);
2507
+ const shouldHideOptionExtras = yargs.getInternalMethods().getUsageConfiguration()["hide-types"] === true;
2508
+ if (extra && !shouldHideOptionExtras) ui$1.div({
2509
+ text: extra,
2510
+ padding: [
2511
+ 0,
2512
+ 0,
2513
+ 0,
2514
+ 2
2515
+ ],
2516
+ align: "right"
2517
+ });
2518
+ else ui$1.div();
2519
+ });
2520
+ ui$1.div();
2521
+ });
2522
+ if (examples.length) {
2523
+ ui$1.div(__("Examples:"));
2524
+ examples.forEach((example) => {
2525
+ example[0] = example[0].replace(/\$0/g, base$0);
2526
+ });
2527
+ examples.forEach((example) => {
2528
+ if (example[1] === "") ui$1.div({
2529
+ text: example[0],
2530
+ padding: [
2531
+ 0,
2532
+ 2,
2533
+ 0,
2534
+ 2
2535
+ ]
2536
+ });
2537
+ else ui$1.div({
2538
+ text: example[0],
2539
+ padding: [
2540
+ 0,
2541
+ 2,
2542
+ 0,
2543
+ 2
2544
+ ],
2545
+ width: maxWidth(examples, theWrap) + 4
2546
+ }, { text: example[1] });
2547
+ });
2548
+ ui$1.div();
2549
+ }
2550
+ if (epilogs.length > 0) {
2551
+ const e = epilogs.map((epilog) => epilog.replace(/\$0/g, base$0)).join("\n");
2552
+ ui$1.div(`${e}\n`);
2553
+ }
2554
+ return ui$1.toString().replace(/\s*$/, "");
2555
+ };
2556
+ function maxWidth(table, theWrap, modifier) {
2557
+ let width = 0;
2558
+ if (!Array.isArray(table)) table = Object.values(table).map((v) => [v]);
2559
+ table.forEach((v) => {
2560
+ width = Math.max(shim$2.stringWidth(modifier ? `${modifier} ${getText(v[0])}` : getText(v[0])) + getIndentation(v[0]), width);
2561
+ });
2562
+ if (theWrap) width = Math.min(width, parseInt((theWrap * .5).toString(), 10));
2563
+ return width;
2564
+ }
2565
+ function normalizeAliases() {
2566
+ const demandedOptions = yargs.getDemandedOptions();
2567
+ const options = yargs.getOptions();
2568
+ (Object.keys(options.alias) || []).forEach((key) => {
2569
+ options.alias[key].forEach((alias) => {
2570
+ if (descriptions[alias]) self.describe(key, descriptions[alias]);
2571
+ if (alias in demandedOptions) yargs.demandOption(key, demandedOptions[alias]);
2572
+ if (options.boolean.includes(alias)) yargs.boolean(key);
2573
+ if (options.count.includes(alias)) yargs.count(key);
2574
+ if (options.string.includes(alias)) yargs.string(key);
2575
+ if (options.normalize.includes(alias)) yargs.normalize(key);
2576
+ if (options.array.includes(alias)) yargs.array(key);
2577
+ if (options.number.includes(alias)) yargs.number(key);
2578
+ });
2579
+ });
2580
+ }
2581
+ let cachedHelpMessage;
2582
+ self.cacheHelpMessage = function() {
2583
+ cachedHelpMessage = this.help();
2584
+ };
2585
+ self.clearCachedHelpMessage = function() {
2586
+ cachedHelpMessage = void 0;
2587
+ };
2588
+ self.hasCachedHelpMessage = function() {
2589
+ return !!cachedHelpMessage;
2590
+ };
2591
+ function addUngroupedKeys(keys, aliases, groups, defaultGroup) {
2592
+ let groupedKeys = [];
2593
+ let toCheck = null;
2594
+ Object.keys(groups).forEach((group) => {
2595
+ groupedKeys = groupedKeys.concat(groups[group]);
2596
+ });
2597
+ keys.forEach((key) => {
2598
+ toCheck = [key].concat(aliases[key]);
2599
+ if (!toCheck.some((k) => groupedKeys.indexOf(k) !== -1)) groups[defaultGroup].push(key);
2600
+ });
2601
+ return groupedKeys;
2602
+ }
2603
+ function filterHiddenOptions(key) {
2604
+ return yargs.getOptions().hiddenOptions.indexOf(key) < 0 || yargs.parsed.argv[yargs.getOptions().showHiddenOpt];
2605
+ }
2606
+ self.showHelp = (level) => {
2607
+ const logger = yargs.getInternalMethods().getLoggerInstance();
2608
+ if (!level) level = "error";
2609
+ (typeof level === "function" ? level : logger[level])(self.help());
2610
+ };
2611
+ self.functionDescription = (fn) => {
2612
+ return [
2613
+ "(",
2614
+ fn.name ? shim$2.Parser.decamelize(fn.name, "-") : __("generated-value"),
2615
+ ")"
2616
+ ].join("");
2617
+ };
2618
+ self.stringifiedValues = function stringifiedValues(values, separator) {
2619
+ let string = "";
2620
+ const sep = separator || ", ";
2621
+ const array = [].concat(values);
2622
+ if (!values || !array.length) return string;
2623
+ array.forEach((value) => {
2624
+ if (string.length) string += sep;
2625
+ string += JSON.stringify(value);
2626
+ });
2627
+ return string;
2628
+ };
2629
+ function defaultString(value, defaultDescription) {
2630
+ let string = `[${__("default:")} `;
2631
+ if (value === void 0 && !defaultDescription) return null;
2632
+ if (defaultDescription) string += defaultDescription;
2633
+ else switch (typeof value) {
2634
+ case "string":
2635
+ string += `"${value}"`;
2636
+ break;
2637
+ case "object":
2638
+ string += JSON.stringify(value);
2639
+ break;
2640
+ default: string += value;
2641
+ }
2642
+ return `${string}]`;
2643
+ }
2644
+ function windowWidth() {
2645
+ const maxWidth$1 = 80;
2646
+ if (shim$2.process.stdColumns) return Math.min(maxWidth$1, shim$2.process.stdColumns);
2647
+ else return maxWidth$1;
2648
+ }
2649
+ let version = null;
2650
+ self.version = (ver) => {
2651
+ version = ver;
2652
+ };
2653
+ self.showVersion = (level) => {
2654
+ const logger = yargs.getInternalMethods().getLoggerInstance();
2655
+ if (!level) level = "error";
2656
+ (typeof level === "function" ? level : logger[level])(version);
2657
+ };
2658
+ self.reset = function reset(localLookup) {
2659
+ failMessage = null;
2660
+ failureOutput = false;
2661
+ usages = [];
2662
+ usageDisabled = false;
2663
+ epilogs = [];
2664
+ examples = [];
2665
+ commands = [];
2666
+ descriptions = objFilter(descriptions, (k) => !localLookup[k]);
2667
+ return self;
2668
+ };
2669
+ const frozens = [];
2670
+ self.freeze = function freeze() {
2671
+ frozens.push({
2672
+ failMessage,
2673
+ failureOutput,
2674
+ usages,
2675
+ usageDisabled,
2676
+ epilogs,
2677
+ examples,
2678
+ commands,
2679
+ descriptions
2680
+ });
2681
+ };
2682
+ self.unfreeze = function unfreeze(defaultCommand = false) {
2683
+ const frozen = frozens.pop();
2684
+ if (!frozen) return;
2685
+ if (defaultCommand) {
2686
+ descriptions = {
2687
+ ...frozen.descriptions,
2688
+ ...descriptions
2689
+ };
2690
+ commands = [...frozen.commands, ...commands];
2691
+ usages = [...frozen.usages, ...usages];
2692
+ examples = [...frozen.examples, ...examples];
2693
+ epilogs = [...frozen.epilogs, ...epilogs];
2694
+ } else ({failMessage, failureOutput, usages, usageDisabled, epilogs, examples, commands, descriptions} = frozen);
2695
+ };
2696
+ return self;
2697
+ }
2698
+ function isIndentedText(text) {
2699
+ return typeof text === "object";
2700
+ }
2701
+ function addIndentation(text, indent) {
2702
+ return isIndentedText(text) ? {
2703
+ text: text.text,
2704
+ indentation: text.indentation + indent
2705
+ } : {
2706
+ text,
2707
+ indentation: indent
2708
+ };
2709
+ }
2710
+ function getIndentation(text) {
2711
+ return isIndentedText(text) ? text.indentation : 0;
2712
+ }
2713
+ function getText(text) {
2714
+ return isIndentedText(text) ? text.text : text;
2715
+ }
2716
+
2717
+ //#endregion
2718
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/completion-templates.js
2719
+ const completionShTemplate = `###-begin-{{app_name}}-completions-###
2720
+ #
2721
+ # yargs command completion script
2722
+ #
2723
+ # Installation: {{app_path}} {{completion_command}} >> ~/.bashrc
2724
+ # or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.
2725
+ #
2726
+ _{{app_name}}_yargs_completions()
2727
+ {
2728
+ local cur_word args type_list
2729
+
2730
+ cur_word="\${COMP_WORDS[COMP_CWORD]}"
2731
+ args=("\${COMP_WORDS[@]}")
2732
+
2733
+ # ask yargs to generate completions.
2734
+ # see https://stackoverflow.com/a/40944195/7080036 for the spaces-handling awk
2735
+ mapfile -t type_list < <({{app_path}} --get-yargs-completions "\${args[@]}")
2736
+ mapfile -t COMPREPLY < <(compgen -W "$( printf '%q ' "\${type_list[@]}" )" -- "\${cur_word}" |
2737
+ awk '/ / { print "\\""$0"\\"" } /^[^ ]+$/ { print $0 }')
2738
+
2739
+ # if no match was found, fall back to filename completion
2740
+ if [ \${#COMPREPLY[@]} -eq 0 ]; then
2741
+ COMPREPLY=()
2742
+ fi
2743
+
2744
+ return 0
2745
+ }
2746
+ complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}
2747
+ ###-end-{{app_name}}-completions-###
2748
+ `;
2749
+ const completionZshTemplate = `#compdef {{app_name}}
2750
+ ###-begin-{{app_name}}-completions-###
2751
+ #
2752
+ # yargs command completion script
2753
+ #
2754
+ # Installation: {{app_path}} {{completion_command}} >> ~/.zshrc
2755
+ # or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX.
2756
+ #
2757
+ _{{app_name}}_yargs_completions()
2758
+ {
2759
+ local reply
2760
+ local si=$IFS
2761
+ IFS=$'\n' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "\${words[@]}"))
2762
+ IFS=$si
2763
+ if [[ \${#reply} -gt 0 ]]; then
2764
+ _describe 'values' reply
2765
+ else
2766
+ _default
2767
+ fi
2768
+ }
2769
+ if [[ "'\${zsh_eval_context[-1]}" == "loadautofunc" ]]; then
2770
+ _{{app_name}}_yargs_completions "$@"
2771
+ else
2772
+ compdef _{{app_name}}_yargs_completions {{app_name}}
2773
+ fi
2774
+ ###-end-{{app_name}}-completions-###
2775
+ `;
2776
+
2777
+ //#endregion
2778
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/completion.js
2779
+ var Completion = class {
2780
+ constructor(yargs, usage$1, command$1, shim$2) {
2781
+ var _a$1, _b$1, _c$1;
2782
+ this.yargs = yargs;
2783
+ this.usage = usage$1;
2784
+ this.command = command$1;
2785
+ this.shim = shim$2;
2786
+ this.completionKey = "get-yargs-completions";
2787
+ this.aliases = null;
2788
+ this.customCompletionFunction = null;
2789
+ this.indexAfterLastReset = 0;
2790
+ this.zshShell = (_c$1 = ((_a$1 = this.shim.getEnv("SHELL")) === null || _a$1 === void 0 ? void 0 : _a$1.includes("zsh")) || ((_b$1 = this.shim.getEnv("ZSH_NAME")) === null || _b$1 === void 0 ? void 0 : _b$1.includes("zsh"))) !== null && _c$1 !== void 0 ? _c$1 : false;
2791
+ }
2792
+ defaultCompletion(args, argv, current, done) {
2793
+ const handlers = this.command.getCommandHandlers();
2794
+ for (let i = 0, ii = args.length; i < ii; ++i) if (handlers[args[i]] && handlers[args[i]].builder) {
2795
+ const builder = handlers[args[i]].builder;
2796
+ if (isCommandBuilderCallback(builder)) {
2797
+ this.indexAfterLastReset = i + 1;
2798
+ const y = this.yargs.getInternalMethods().reset();
2799
+ builder(y, true);
2800
+ return y.argv;
2801
+ }
2802
+ }
2803
+ const completions = [];
2804
+ this.commandCompletions(completions, args, current);
2805
+ this.optionCompletions(completions, args, argv, current);
2806
+ this.choicesFromOptionsCompletions(completions, args, argv, current);
2807
+ this.choicesFromPositionalsCompletions(completions, args, argv, current);
2808
+ done(null, completions);
2809
+ }
2810
+ commandCompletions(completions, args, current) {
2811
+ const parentCommands = this.yargs.getInternalMethods().getContext().commands;
2812
+ if (!current.match(/^-/) && parentCommands[parentCommands.length - 1] !== current && !this.previousArgHasChoices(args)) this.usage.getCommands().forEach((usageCommand) => {
2813
+ const commandName = parseCommand(usageCommand[0]).cmd;
2814
+ if (args.indexOf(commandName) === -1) if (!this.zshShell) completions.push(commandName);
2815
+ else {
2816
+ const desc = usageCommand[1] || "";
2817
+ completions.push(commandName.replace(/:/g, "\\:") + ":" + desc);
2818
+ }
2819
+ });
2820
+ }
2821
+ optionCompletions(completions, args, argv, current) {
2822
+ if ((current.match(/^-/) || current === "" && completions.length === 0) && !this.previousArgHasChoices(args)) {
2823
+ const options = this.yargs.getOptions();
2824
+ const positionalKeys = this.yargs.getGroups()[this.usage.getPositionalGroupName()] || [];
2825
+ Object.keys(options.key).forEach((key) => {
2826
+ const negable = !!options.configuration["boolean-negation"] && options.boolean.includes(key);
2827
+ if (!positionalKeys.includes(key) && !options.hiddenOptions.includes(key) && !this.argsContainKey(args, key, negable)) this.completeOptionKey(key, completions, current, negable && !!options.default[key]);
2828
+ });
2829
+ }
2830
+ }
2831
+ choicesFromOptionsCompletions(completions, args, argv, current) {
2832
+ if (this.previousArgHasChoices(args)) {
2833
+ const choices = this.getPreviousArgChoices(args);
2834
+ if (choices && choices.length > 0) completions.push(...choices.map((c) => c.replace(/:/g, "\\:")));
2835
+ }
2836
+ }
2837
+ choicesFromPositionalsCompletions(completions, args, argv, current) {
2838
+ if (current === "" && completions.length > 0 && this.previousArgHasChoices(args)) return;
2839
+ const positionalKeys = this.yargs.getGroups()[this.usage.getPositionalGroupName()] || [];
2840
+ const offset = Math.max(this.indexAfterLastReset, this.yargs.getInternalMethods().getContext().commands.length + 1);
2841
+ const positionalKey = positionalKeys[argv._.length - offset - 1];
2842
+ if (!positionalKey) return;
2843
+ const choices = this.yargs.getOptions().choices[positionalKey] || [];
2844
+ for (const choice of choices) if (choice.startsWith(current)) completions.push(choice.replace(/:/g, "\\:"));
2845
+ }
2846
+ getPreviousArgChoices(args) {
2847
+ if (args.length < 1) return;
2848
+ let previousArg = args[args.length - 1];
2849
+ let filter = "";
2850
+ if (!previousArg.startsWith("-") && args.length > 1) {
2851
+ filter = previousArg;
2852
+ previousArg = args[args.length - 2];
2853
+ }
2854
+ if (!previousArg.startsWith("-")) return;
2855
+ const previousArgKey = previousArg.replace(/^-+/, "");
2856
+ const options = this.yargs.getOptions();
2857
+ const possibleAliases = [previousArgKey, ...this.yargs.getAliases()[previousArgKey] || []];
2858
+ let choices;
2859
+ for (const possibleAlias of possibleAliases) if (Object.prototype.hasOwnProperty.call(options.key, possibleAlias) && Array.isArray(options.choices[possibleAlias])) {
2860
+ choices = options.choices[possibleAlias];
2861
+ break;
2862
+ }
2863
+ if (choices) return choices.filter((choice) => !filter || choice.startsWith(filter));
2864
+ }
2865
+ previousArgHasChoices(args) {
2866
+ const choices = this.getPreviousArgChoices(args);
2867
+ return choices !== void 0 && choices.length > 0;
2868
+ }
2869
+ argsContainKey(args, key, negable) {
2870
+ const argsContains = (s) => args.indexOf((/^[^0-9]$/.test(s) ? "-" : "--") + s) !== -1;
2871
+ if (argsContains(key)) return true;
2872
+ if (negable && argsContains(`no-${key}`)) return true;
2873
+ if (this.aliases) {
2874
+ for (const alias of this.aliases[key]) if (argsContains(alias)) return true;
2875
+ }
2876
+ return false;
2877
+ }
2878
+ completeOptionKey(key, completions, current, negable) {
2879
+ var _a$1, _b$1, _c$1, _d;
2880
+ let keyWithDesc = key;
2881
+ if (this.zshShell) {
2882
+ const descs = this.usage.getDescriptions();
2883
+ const aliasKey = (_b$1 = (_a$1 = this === null || this === void 0 ? void 0 : this.aliases) === null || _a$1 === void 0 ? void 0 : _a$1[key]) === null || _b$1 === void 0 ? void 0 : _b$1.find((alias) => {
2884
+ const desc$1 = descs[alias];
2885
+ return typeof desc$1 === "string" && desc$1.length > 0;
2886
+ });
2887
+ const descFromAlias = aliasKey ? descs[aliasKey] : void 0;
2888
+ const desc = (_d = (_c$1 = descs[key]) !== null && _c$1 !== void 0 ? _c$1 : descFromAlias) !== null && _d !== void 0 ? _d : "";
2889
+ keyWithDesc = `${key.replace(/:/g, "\\:")}:${desc.replace("__yargsString__:", "").replace(/(\r\n|\n|\r)/gm, " ")}`;
2890
+ }
2891
+ const startsByTwoDashes = (s) => /^--/.test(s);
2892
+ const isShortOption = (s) => /^[^0-9]$/.test(s);
2893
+ const dashes = !startsByTwoDashes(current) && isShortOption(key) ? "-" : "--";
2894
+ completions.push(dashes + keyWithDesc);
2895
+ if (negable) completions.push(dashes + "no-" + keyWithDesc);
2896
+ }
2897
+ customCompletion(args, argv, current, done) {
2898
+ assertNotStrictEqual(this.customCompletionFunction, null, this.shim);
2899
+ if (isSyncCompletionFunction(this.customCompletionFunction)) {
2900
+ const result = this.customCompletionFunction(current, argv);
2901
+ if (isPromise(result)) return result.then((list) => {
2902
+ this.shim.process.nextTick(() => {
2903
+ done(null, list);
2904
+ });
2905
+ }).catch((err) => {
2906
+ this.shim.process.nextTick(() => {
2907
+ done(err, void 0);
2908
+ });
2909
+ });
2910
+ return done(null, result);
2911
+ } else if (isFallbackCompletionFunction(this.customCompletionFunction)) return this.customCompletionFunction(current, argv, (onCompleted = done) => this.defaultCompletion(args, argv, current, onCompleted), (completions) => {
2912
+ done(null, completions);
2913
+ });
2914
+ else return this.customCompletionFunction(current, argv, (completions) => {
2915
+ done(null, completions);
2916
+ });
2917
+ }
2918
+ getCompletion(args, done) {
2919
+ const current = args.length ? args[args.length - 1] : "";
2920
+ const argv = this.yargs.parse(args, true);
2921
+ const completionFunction = this.customCompletionFunction ? (argv$1) => this.customCompletion(args, argv$1, current, done) : (argv$1) => this.defaultCompletion(args, argv$1, current, done);
2922
+ return isPromise(argv) ? argv.then(completionFunction) : completionFunction(argv);
2923
+ }
2924
+ generateCompletionScript($0, cmd) {
2925
+ let script = this.zshShell ? completionZshTemplate : completionShTemplate;
2926
+ const name = this.shim.path.basename($0);
2927
+ if ($0.match(/\.js$/)) $0 = `./${$0}`;
2928
+ script = script.replace(/{{app_name}}/g, name);
2929
+ script = script.replace(/{{completion_command}}/g, cmd);
2930
+ return script.replace(/{{app_path}}/g, $0);
2931
+ }
2932
+ registerFunction(fn) {
2933
+ this.customCompletionFunction = fn;
2934
+ }
2935
+ setParsed(parsed) {
2936
+ this.aliases = parsed.aliases;
2937
+ }
2938
+ };
2939
+ function completion(yargs, usage$1, command$1, shim$2) {
2940
+ return new Completion(yargs, usage$1, command$1, shim$2);
2941
+ }
2942
+ function isSyncCompletionFunction(completionFunction) {
2943
+ return completionFunction.length < 3;
2944
+ }
2945
+ function isFallbackCompletionFunction(completionFunction) {
2946
+ return completionFunction.length > 3;
2947
+ }
2948
+
2949
+ //#endregion
2950
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/utils/levenshtein.js
2951
+ function levenshtein(a, b) {
2952
+ if (a.length === 0) return b.length;
2953
+ if (b.length === 0) return a.length;
2954
+ const matrix = [];
2955
+ let i;
2956
+ for (i = 0; i <= b.length; i++) matrix[i] = [i];
2957
+ let j;
2958
+ for (j = 0; j <= a.length; j++) matrix[0][j] = j;
2959
+ for (i = 1; i <= b.length; i++) for (j = 1; j <= a.length; j++) if (b.charAt(i - 1) === a.charAt(j - 1)) matrix[i][j] = matrix[i - 1][j - 1];
2960
+ else if (i > 1 && j > 1 && b.charAt(i - 2) === a.charAt(j - 1) && b.charAt(i - 1) === a.charAt(j - 2)) matrix[i][j] = matrix[i - 2][j - 2] + 1;
2961
+ else matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, Math.min(matrix[i][j - 1] + 1, matrix[i - 1][j] + 1));
2962
+ return matrix[b.length][a.length];
2963
+ }
29
2964
 
30
- Usage: openspecui [options] [project-dir]
2965
+ //#endregion
2966
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/validation.js
2967
+ const specialKeys = [
2968
+ "$0",
2969
+ "--",
2970
+ "_"
2971
+ ];
2972
+ function validation(yargs, usage$1, shim$2) {
2973
+ const __ = shim$2.y18n.__;
2974
+ const __n = shim$2.y18n.__n;
2975
+ const self = {};
2976
+ self.nonOptionCount = function nonOptionCount(argv) {
2977
+ const demandedCommands = yargs.getDemandedCommands();
2978
+ const _s = argv._.length + (argv["--"] ? argv["--"].length : 0) - yargs.getInternalMethods().getContext().commands.length;
2979
+ if (demandedCommands._ && (_s < demandedCommands._.min || _s > demandedCommands._.max)) {
2980
+ if (_s < demandedCommands._.min) if (demandedCommands._.minMsg !== void 0) usage$1.fail(demandedCommands._.minMsg ? demandedCommands._.minMsg.replace(/\$0/g, _s.toString()).replace(/\$1/, demandedCommands._.min.toString()) : null);
2981
+ else usage$1.fail(__n("Not enough non-option arguments: got %s, need at least %s", "Not enough non-option arguments: got %s, need at least %s", _s, _s.toString(), demandedCommands._.min.toString()));
2982
+ else if (_s > demandedCommands._.max) if (demandedCommands._.maxMsg !== void 0) usage$1.fail(demandedCommands._.maxMsg ? demandedCommands._.maxMsg.replace(/\$0/g, _s.toString()).replace(/\$1/, demandedCommands._.max.toString()) : null);
2983
+ else usage$1.fail(__n("Too many non-option arguments: got %s, maximum of %s", "Too many non-option arguments: got %s, maximum of %s", _s, _s.toString(), demandedCommands._.max.toString()));
2984
+ }
2985
+ };
2986
+ self.positionalCount = function positionalCount(required, observed) {
2987
+ if (observed < required) usage$1.fail(__n("Not enough non-option arguments: got %s, need at least %s", "Not enough non-option arguments: got %s, need at least %s", observed, observed + "", required + ""));
2988
+ };
2989
+ self.requiredArguments = function requiredArguments(argv, demandedOptions) {
2990
+ let missing = null;
2991
+ for (const key of Object.keys(demandedOptions)) if (!Object.prototype.hasOwnProperty.call(argv, key) || typeof argv[key] === "undefined") {
2992
+ missing = missing || {};
2993
+ missing[key] = demandedOptions[key];
2994
+ }
2995
+ if (missing) {
2996
+ const customMsgs = [];
2997
+ for (const key of Object.keys(missing)) {
2998
+ const msg = missing[key];
2999
+ if (msg && customMsgs.indexOf(msg) < 0) customMsgs.push(msg);
3000
+ }
3001
+ const customMsg = customMsgs.length ? `\n${customMsgs.join("\n")}` : "";
3002
+ usage$1.fail(__n("Missing required argument: %s", "Missing required arguments: %s", Object.keys(missing).length, Object.keys(missing).join(", ") + customMsg));
3003
+ }
3004
+ };
3005
+ self.unknownArguments = function unknownArguments(argv, aliases, positionalMap, isDefaultCommand, checkPositionals = true) {
3006
+ var _a$1;
3007
+ const commandKeys = yargs.getInternalMethods().getCommandInstance().getCommands();
3008
+ const unknown = [];
3009
+ const currentContext = yargs.getInternalMethods().getContext();
3010
+ Object.keys(argv).forEach((key) => {
3011
+ if (!specialKeys.includes(key) && !Object.prototype.hasOwnProperty.call(positionalMap, key) && !Object.prototype.hasOwnProperty.call(yargs.getInternalMethods().getParseContext(), key) && !self.isValidAndSomeAliasIsNotNew(key, aliases)) unknown.push(key);
3012
+ });
3013
+ if (checkPositionals && (currentContext.commands.length > 0 || commandKeys.length > 0 || isDefaultCommand)) argv._.slice(currentContext.commands.length).forEach((key) => {
3014
+ if (!commandKeys.includes("" + key)) unknown.push("" + key);
3015
+ });
3016
+ if (checkPositionals) {
3017
+ const maxNonOptDemanded = ((_a$1 = yargs.getDemandedCommands()._) === null || _a$1 === void 0 ? void 0 : _a$1.max) || 0;
3018
+ const expected = currentContext.commands.length + maxNonOptDemanded;
3019
+ if (expected < argv._.length) argv._.slice(expected).forEach((key) => {
3020
+ key = String(key);
3021
+ if (!currentContext.commands.includes(key) && !unknown.includes(key)) unknown.push(key);
3022
+ });
3023
+ }
3024
+ if (unknown.length) usage$1.fail(__n("Unknown argument: %s", "Unknown arguments: %s", unknown.length, unknown.map((s) => s.trim() ? s : `"${s}"`).join(", ")));
3025
+ };
3026
+ self.unknownCommands = function unknownCommands(argv) {
3027
+ const commandKeys = yargs.getInternalMethods().getCommandInstance().getCommands();
3028
+ const unknown = [];
3029
+ const currentContext = yargs.getInternalMethods().getContext();
3030
+ if (currentContext.commands.length > 0 || commandKeys.length > 0) argv._.slice(currentContext.commands.length).forEach((key) => {
3031
+ if (!commandKeys.includes("" + key)) unknown.push("" + key);
3032
+ });
3033
+ if (unknown.length > 0) {
3034
+ usage$1.fail(__n("Unknown command: %s", "Unknown commands: %s", unknown.length, unknown.join(", ")));
3035
+ return true;
3036
+ } else return false;
3037
+ };
3038
+ self.isValidAndSomeAliasIsNotNew = function isValidAndSomeAliasIsNotNew(key, aliases) {
3039
+ if (!Object.prototype.hasOwnProperty.call(aliases, key)) return false;
3040
+ const newAliases = yargs.parsed.newAliases;
3041
+ return [key, ...aliases[key]].some((a) => !Object.prototype.hasOwnProperty.call(newAliases, a) || !newAliases[key]);
3042
+ };
3043
+ self.limitedChoices = function limitedChoices(argv) {
3044
+ const options = yargs.getOptions();
3045
+ const invalid = {};
3046
+ if (!Object.keys(options.choices).length) return;
3047
+ Object.keys(argv).forEach((key) => {
3048
+ if (specialKeys.indexOf(key) === -1 && Object.prototype.hasOwnProperty.call(options.choices, key)) [].concat(argv[key]).forEach((value) => {
3049
+ if (options.choices[key].indexOf(value) === -1 && value !== void 0) invalid[key] = (invalid[key] || []).concat(value);
3050
+ });
3051
+ });
3052
+ const invalidKeys = Object.keys(invalid);
3053
+ if (!invalidKeys.length) return;
3054
+ let msg = __("Invalid values:");
3055
+ invalidKeys.forEach((key) => {
3056
+ msg += `\n ${__("Argument: %s, Given: %s, Choices: %s", key, usage$1.stringifiedValues(invalid[key]), usage$1.stringifiedValues(options.choices[key]))}`;
3057
+ });
3058
+ usage$1.fail(msg);
3059
+ };
3060
+ let implied = {};
3061
+ self.implies = function implies(key, value) {
3062
+ argsert("<string|object> [array|number|string]", [key, value], arguments.length);
3063
+ if (typeof key === "object") Object.keys(key).forEach((k) => {
3064
+ self.implies(k, key[k]);
3065
+ });
3066
+ else {
3067
+ yargs.global(key);
3068
+ if (!implied[key]) implied[key] = [];
3069
+ if (Array.isArray(value)) value.forEach((i) => self.implies(key, i));
3070
+ else {
3071
+ assertNotStrictEqual(value, void 0, shim$2);
3072
+ implied[key].push(value);
3073
+ }
3074
+ }
3075
+ };
3076
+ self.getImplied = function getImplied() {
3077
+ return implied;
3078
+ };
3079
+ function keyExists(argv, val) {
3080
+ const num = Number(val);
3081
+ val = isNaN(num) ? val : num;
3082
+ if (typeof val === "number") val = argv._.length >= val;
3083
+ else if (val.match(/^--no-.+/)) {
3084
+ val = val.match(/^--no-(.+)/)[1];
3085
+ val = !Object.prototype.hasOwnProperty.call(argv, val);
3086
+ } else val = Object.prototype.hasOwnProperty.call(argv, val);
3087
+ return val;
3088
+ }
3089
+ self.implications = function implications(argv) {
3090
+ const implyFail = [];
3091
+ Object.keys(implied).forEach((key) => {
3092
+ const origKey = key;
3093
+ (implied[key] || []).forEach((value) => {
3094
+ let key$1 = origKey;
3095
+ const origValue = value;
3096
+ key$1 = keyExists(argv, key$1);
3097
+ value = keyExists(argv, value);
3098
+ if (key$1 && !value) implyFail.push(` ${origKey} -> ${origValue}`);
3099
+ });
3100
+ });
3101
+ if (implyFail.length) {
3102
+ let msg = `${__("Implications failed:")}\n`;
3103
+ implyFail.forEach((value) => {
3104
+ msg += value;
3105
+ });
3106
+ usage$1.fail(msg);
3107
+ }
3108
+ };
3109
+ let conflicting = {};
3110
+ self.conflicts = function conflicts(key, value) {
3111
+ argsert("<string|object> [array|string]", [key, value], arguments.length);
3112
+ if (typeof key === "object") Object.keys(key).forEach((k) => {
3113
+ self.conflicts(k, key[k]);
3114
+ });
3115
+ else {
3116
+ yargs.global(key);
3117
+ if (!conflicting[key]) conflicting[key] = [];
3118
+ if (Array.isArray(value)) value.forEach((i) => self.conflicts(key, i));
3119
+ else conflicting[key].push(value);
3120
+ }
3121
+ };
3122
+ self.getConflicting = () => conflicting;
3123
+ self.conflicting = function conflictingFn(argv) {
3124
+ Object.keys(argv).forEach((key) => {
3125
+ if (conflicting[key]) conflicting[key].forEach((value) => {
3126
+ if (value && argv[key] !== void 0 && argv[value] !== void 0) usage$1.fail(__("Arguments %s and %s are mutually exclusive", key, value));
3127
+ });
3128
+ });
3129
+ if (yargs.getInternalMethods().getParserConfiguration()["strip-dashed"]) Object.keys(conflicting).forEach((key) => {
3130
+ conflicting[key].forEach((value) => {
3131
+ if (value && argv[shim$2.Parser.camelCase(key)] !== void 0 && argv[shim$2.Parser.camelCase(value)] !== void 0) usage$1.fail(__("Arguments %s and %s are mutually exclusive", key, value));
3132
+ });
3133
+ });
3134
+ };
3135
+ self.recommendCommands = function recommendCommands(cmd, potentialCommands) {
3136
+ const threshold = 3;
3137
+ potentialCommands = potentialCommands.sort((a, b) => b.length - a.length);
3138
+ let recommended = null;
3139
+ let bestDistance = Infinity;
3140
+ for (let i = 0, candidate; (candidate = potentialCommands[i]) !== void 0; i++) {
3141
+ const d = levenshtein(cmd, candidate);
3142
+ if (d <= threshold && d < bestDistance) {
3143
+ bestDistance = d;
3144
+ recommended = candidate;
3145
+ }
3146
+ }
3147
+ if (recommended) usage$1.fail(__("Did you mean %s?", recommended));
3148
+ };
3149
+ self.reset = function reset(localLookup) {
3150
+ implied = objFilter(implied, (k) => !localLookup[k]);
3151
+ conflicting = objFilter(conflicting, (k) => !localLookup[k]);
3152
+ return self;
3153
+ };
3154
+ const frozens = [];
3155
+ self.freeze = function freeze() {
3156
+ frozens.push({
3157
+ implied,
3158
+ conflicting
3159
+ });
3160
+ };
3161
+ self.unfreeze = function unfreeze() {
3162
+ const frozen = frozens.pop();
3163
+ assertNotStrictEqual(frozen, void 0, shim$2);
3164
+ ({implied, conflicting} = frozen);
3165
+ };
3166
+ return self;
3167
+ }
31
3168
 
32
- Options:
33
- -p, --port <port> Port to run the server on (default: 3100)
34
- -d, --dir <path> Project directory containing openspec/ (default: cwd)
35
- --no-open Don't automatically open the browser
36
- -h, --help Show this help message
3169
+ //#endregion
3170
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/utils/apply-extends.js
3171
+ let previouslyVisitedConfigs = [];
3172
+ let shim;
3173
+ function applyExtends(config, cwd, mergeExtends, _shim) {
3174
+ shim = _shim;
3175
+ let defaultConfig = {};
3176
+ if (Object.prototype.hasOwnProperty.call(config, "extends")) {
3177
+ if (typeof config.extends !== "string") return defaultConfig;
3178
+ const isPath = /\.json|\..*rc$/.test(config.extends);
3179
+ let pathToDefault = null;
3180
+ if (!isPath) try {
3181
+ pathToDefault = import.meta.resolve(config.extends);
3182
+ } catch (_err) {
3183
+ return config;
3184
+ }
3185
+ else pathToDefault = getPathToDefaultConfig(cwd, config.extends);
3186
+ checkForCircularExtends(pathToDefault);
3187
+ previouslyVisitedConfigs.push(pathToDefault);
3188
+ defaultConfig = isPath ? JSON.parse(shim.readFileSync(pathToDefault, "utf8")) : _shim.require(config.extends);
3189
+ delete config.extends;
3190
+ defaultConfig = applyExtends(defaultConfig, shim.path.dirname(pathToDefault), mergeExtends, shim);
3191
+ }
3192
+ previouslyVisitedConfigs = [];
3193
+ return mergeExtends ? mergeDeep(defaultConfig, config) : Object.assign({}, defaultConfig, config);
3194
+ }
3195
+ function checkForCircularExtends(cfgPath) {
3196
+ if (previouslyVisitedConfigs.indexOf(cfgPath) > -1) throw new YError(`Circular extended configurations: '${cfgPath}'.`);
3197
+ }
3198
+ function getPathToDefaultConfig(cwd, pathToExtend) {
3199
+ return shim.path.resolve(cwd, pathToExtend);
3200
+ }
3201
+ function mergeDeep(config1, config2) {
3202
+ const target = {};
3203
+ function isObject(obj) {
3204
+ return obj && typeof obj === "object" && !Array.isArray(obj);
3205
+ }
3206
+ Object.assign(target, config1);
3207
+ for (const key of Object.keys(config2)) if (isObject(config2[key]) && isObject(target[key])) target[key] = mergeDeep(config1[key], config2[key]);
3208
+ else target[key] = config2[key];
3209
+ return target;
3210
+ }
37
3211
 
38
- Examples:
39
- openspecui # Start in current directory
40
- openspecui ./my-project # Start with specific project
41
- openspecui -p 8080 # Start on custom port
42
- openspecui --no-open # Start without opening browser
43
- `);
3212
+ //#endregion
3213
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/yargs-factory.js
3214
+ var __classPrivateFieldSet = void 0 && (void 0).__classPrivateFieldSet || function(receiver, state, value, kind, f) {
3215
+ if (kind === "m") throw new TypeError("Private method is not writable");
3216
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
3217
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
3218
+ return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
3219
+ };
3220
+ var __classPrivateFieldGet = void 0 && (void 0).__classPrivateFieldGet || function(receiver, state, kind, f) {
3221
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3222
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
3223
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
3224
+ };
3225
+ var _YargsInstance_command, _YargsInstance_cwd, _YargsInstance_context, _YargsInstance_completion, _YargsInstance_completionCommand, _YargsInstance_defaultShowHiddenOpt, _YargsInstance_exitError, _YargsInstance_detectLocale, _YargsInstance_emittedWarnings, _YargsInstance_exitProcess, _YargsInstance_frozens, _YargsInstance_globalMiddleware, _YargsInstance_groups, _YargsInstance_hasOutput, _YargsInstance_helpOpt, _YargsInstance_isGlobalContext, _YargsInstance_logger, _YargsInstance_output, _YargsInstance_options, _YargsInstance_parentRequire, _YargsInstance_parserConfig, _YargsInstance_parseFn, _YargsInstance_parseContext, _YargsInstance_pkgs, _YargsInstance_preservedGroups, _YargsInstance_processArgs, _YargsInstance_recommendCommands, _YargsInstance_shim, _YargsInstance_strict, _YargsInstance_strictCommands, _YargsInstance_strictOptions, _YargsInstance_usage, _YargsInstance_usageConfig, _YargsInstance_versionOpt, _YargsInstance_validation;
3226
+ function YargsFactory(_shim) {
3227
+ return (processArgs = [], cwd = _shim.process.cwd(), parentRequire) => {
3228
+ const yargs = new YargsInstance(processArgs, cwd, parentRequire, _shim);
3229
+ Object.defineProperty(yargs, "argv", {
3230
+ get: () => {
3231
+ return yargs.parse();
3232
+ },
3233
+ enumerable: true
3234
+ });
3235
+ yargs.help();
3236
+ yargs.version();
3237
+ return yargs;
3238
+ };
44
3239
  }
45
- async function main() {
46
- const args = parseArgs(process.argv.slice(2));
47
- if (args.help) {
48
- printHelp();
49
- process.exit(0);
3240
+ const kCopyDoubleDash = Symbol("copyDoubleDash");
3241
+ const kCreateLogger = Symbol("copyDoubleDash");
3242
+ const kDeleteFromParserHintObject = Symbol("deleteFromParserHintObject");
3243
+ const kEmitWarning = Symbol("emitWarning");
3244
+ const kFreeze = Symbol("freeze");
3245
+ const kGetDollarZero = Symbol("getDollarZero");
3246
+ const kGetParserConfiguration = Symbol("getParserConfiguration");
3247
+ const kGetUsageConfiguration = Symbol("getUsageConfiguration");
3248
+ const kGuessLocale = Symbol("guessLocale");
3249
+ const kGuessVersion = Symbol("guessVersion");
3250
+ const kParsePositionalNumbers = Symbol("parsePositionalNumbers");
3251
+ const kPkgUp = Symbol("pkgUp");
3252
+ const kPopulateParserHintArray = Symbol("populateParserHintArray");
3253
+ const kPopulateParserHintSingleValueDictionary = Symbol("populateParserHintSingleValueDictionary");
3254
+ const kPopulateParserHintArrayDictionary = Symbol("populateParserHintArrayDictionary");
3255
+ const kPopulateParserHintDictionary = Symbol("populateParserHintDictionary");
3256
+ const kSanitizeKey = Symbol("sanitizeKey");
3257
+ const kSetKey = Symbol("setKey");
3258
+ const kUnfreeze = Symbol("unfreeze");
3259
+ const kValidateAsync = Symbol("validateAsync");
3260
+ const kGetCommandInstance = Symbol("getCommandInstance");
3261
+ const kGetContext = Symbol("getContext");
3262
+ const kGetHasOutput = Symbol("getHasOutput");
3263
+ const kGetLoggerInstance = Symbol("getLoggerInstance");
3264
+ const kGetParseContext = Symbol("getParseContext");
3265
+ const kGetUsageInstance = Symbol("getUsageInstance");
3266
+ const kGetValidationInstance = Symbol("getValidationInstance");
3267
+ const kHasParseCallback = Symbol("hasParseCallback");
3268
+ const kIsGlobalContext = Symbol("isGlobalContext");
3269
+ const kPostProcess = Symbol("postProcess");
3270
+ const kRebase = Symbol("rebase");
3271
+ const kReset = Symbol("reset");
3272
+ const kRunYargsParserAndExecuteCommands = Symbol("runYargsParserAndExecuteCommands");
3273
+ const kRunValidation = Symbol("runValidation");
3274
+ const kSetHasOutput = Symbol("setHasOutput");
3275
+ const kTrackManuallySetKeys = Symbol("kTrackManuallySetKeys");
3276
+ const DEFAULT_LOCALE = "en_US";
3277
+ var YargsInstance = class {
3278
+ constructor(processArgs = [], cwd, parentRequire, shim$2) {
3279
+ this.customScriptName = false;
3280
+ this.parsed = false;
3281
+ _YargsInstance_command.set(this, void 0);
3282
+ _YargsInstance_cwd.set(this, void 0);
3283
+ _YargsInstance_context.set(this, {
3284
+ commands: [],
3285
+ fullCommands: []
3286
+ });
3287
+ _YargsInstance_completion.set(this, null);
3288
+ _YargsInstance_completionCommand.set(this, null);
3289
+ _YargsInstance_defaultShowHiddenOpt.set(this, "show-hidden");
3290
+ _YargsInstance_exitError.set(this, null);
3291
+ _YargsInstance_detectLocale.set(this, true);
3292
+ _YargsInstance_emittedWarnings.set(this, {});
3293
+ _YargsInstance_exitProcess.set(this, true);
3294
+ _YargsInstance_frozens.set(this, []);
3295
+ _YargsInstance_globalMiddleware.set(this, void 0);
3296
+ _YargsInstance_groups.set(this, {});
3297
+ _YargsInstance_hasOutput.set(this, false);
3298
+ _YargsInstance_helpOpt.set(this, null);
3299
+ _YargsInstance_isGlobalContext.set(this, true);
3300
+ _YargsInstance_logger.set(this, void 0);
3301
+ _YargsInstance_output.set(this, "");
3302
+ _YargsInstance_options.set(this, void 0);
3303
+ _YargsInstance_parentRequire.set(this, void 0);
3304
+ _YargsInstance_parserConfig.set(this, {});
3305
+ _YargsInstance_parseFn.set(this, null);
3306
+ _YargsInstance_parseContext.set(this, null);
3307
+ _YargsInstance_pkgs.set(this, {});
3308
+ _YargsInstance_preservedGroups.set(this, {});
3309
+ _YargsInstance_processArgs.set(this, void 0);
3310
+ _YargsInstance_recommendCommands.set(this, false);
3311
+ _YargsInstance_shim.set(this, void 0);
3312
+ _YargsInstance_strict.set(this, false);
3313
+ _YargsInstance_strictCommands.set(this, false);
3314
+ _YargsInstance_strictOptions.set(this, false);
3315
+ _YargsInstance_usage.set(this, void 0);
3316
+ _YargsInstance_usageConfig.set(this, {});
3317
+ _YargsInstance_versionOpt.set(this, null);
3318
+ _YargsInstance_validation.set(this, void 0);
3319
+ __classPrivateFieldSet(this, _YargsInstance_shim, shim$2, "f");
3320
+ __classPrivateFieldSet(this, _YargsInstance_processArgs, processArgs, "f");
3321
+ __classPrivateFieldSet(this, _YargsInstance_cwd, cwd, "f");
3322
+ __classPrivateFieldSet(this, _YargsInstance_parentRequire, parentRequire, "f");
3323
+ __classPrivateFieldSet(this, _YargsInstance_globalMiddleware, new GlobalMiddleware(this), "f");
3324
+ this.$0 = this[kGetDollarZero]();
3325
+ this[kReset]();
3326
+ __classPrivateFieldSet(this, _YargsInstance_command, __classPrivateFieldGet(this, _YargsInstance_command, "f"), "f");
3327
+ __classPrivateFieldSet(this, _YargsInstance_usage, __classPrivateFieldGet(this, _YargsInstance_usage, "f"), "f");
3328
+ __classPrivateFieldSet(this, _YargsInstance_validation, __classPrivateFieldGet(this, _YargsInstance_validation, "f"), "f");
3329
+ __classPrivateFieldSet(this, _YargsInstance_options, __classPrivateFieldGet(this, _YargsInstance_options, "f"), "f");
3330
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").showHiddenOpt = __classPrivateFieldGet(this, _YargsInstance_defaultShowHiddenOpt, "f");
3331
+ __classPrivateFieldSet(this, _YargsInstance_logger, this[kCreateLogger](), "f");
3332
+ __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.setLocale(DEFAULT_LOCALE);
3333
+ }
3334
+ addHelpOpt(opt, msg) {
3335
+ const defaultHelpOpt = "help";
3336
+ argsert("[string|boolean] [string]", [opt, msg], arguments.length);
3337
+ if (__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")) {
3338
+ this[kDeleteFromParserHintObject](__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f"));
3339
+ __classPrivateFieldSet(this, _YargsInstance_helpOpt, null, "f");
3340
+ }
3341
+ if (opt === false && msg === void 0) return this;
3342
+ __classPrivateFieldSet(this, _YargsInstance_helpOpt, typeof opt === "string" ? opt : defaultHelpOpt, "f");
3343
+ this.boolean(__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f"));
3344
+ this.describe(__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f"), msg || __classPrivateFieldGet(this, _YargsInstance_usage, "f").deferY18nLookup("Show help"));
3345
+ return this;
3346
+ }
3347
+ help(opt, msg) {
3348
+ return this.addHelpOpt(opt, msg);
3349
+ }
3350
+ addShowHiddenOpt(opt, msg) {
3351
+ argsert("[string|boolean] [string]", [opt, msg], arguments.length);
3352
+ if (opt === false && msg === void 0) return this;
3353
+ const showHiddenOpt = typeof opt === "string" ? opt : __classPrivateFieldGet(this, _YargsInstance_defaultShowHiddenOpt, "f");
3354
+ this.boolean(showHiddenOpt);
3355
+ this.describe(showHiddenOpt, msg || __classPrivateFieldGet(this, _YargsInstance_usage, "f").deferY18nLookup("Show hidden options"));
3356
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").showHiddenOpt = showHiddenOpt;
3357
+ return this;
3358
+ }
3359
+ showHidden(opt, msg) {
3360
+ return this.addShowHiddenOpt(opt, msg);
3361
+ }
3362
+ alias(key, value) {
3363
+ argsert("<object|string|array> [string|array]", [key, value], arguments.length);
3364
+ this[kPopulateParserHintArrayDictionary](this.alias.bind(this), "alias", key, value);
3365
+ return this;
3366
+ }
3367
+ array(keys) {
3368
+ argsert("<array|string>", [keys], arguments.length);
3369
+ this[kPopulateParserHintArray]("array", keys);
3370
+ this[kTrackManuallySetKeys](keys);
3371
+ return this;
3372
+ }
3373
+ boolean(keys) {
3374
+ argsert("<array|string>", [keys], arguments.length);
3375
+ this[kPopulateParserHintArray]("boolean", keys);
3376
+ this[kTrackManuallySetKeys](keys);
3377
+ return this;
3378
+ }
3379
+ check(f, global) {
3380
+ argsert("<function> [boolean]", [f, global], arguments.length);
3381
+ this.middleware((argv, _yargs) => {
3382
+ return maybeAsyncResult(() => {
3383
+ return f(argv, _yargs.getOptions());
3384
+ }, (result) => {
3385
+ if (!result) __classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(__classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.__("Argument check failed: %s", f.toString()));
3386
+ else if (typeof result === "string" || result instanceof Error) __classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(result.toString(), result);
3387
+ return argv;
3388
+ }, (err) => {
3389
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(err.message ? err.message : err.toString(), err);
3390
+ return argv;
3391
+ });
3392
+ }, false, global);
3393
+ return this;
3394
+ }
3395
+ choices(key, value) {
3396
+ argsert("<object|string|array> [string|array]", [key, value], arguments.length);
3397
+ this[kPopulateParserHintArrayDictionary](this.choices.bind(this), "choices", key, value);
3398
+ return this;
3399
+ }
3400
+ coerce(keys, value) {
3401
+ argsert("<object|string|array> [function]", [keys, value], arguments.length);
3402
+ if (Array.isArray(keys)) {
3403
+ if (!value) throw new YError("coerce callback must be provided");
3404
+ for (const key of keys) this.coerce(key, value);
3405
+ return this;
3406
+ } else if (typeof keys === "object") {
3407
+ for (const key of Object.keys(keys)) this.coerce(key, keys[key]);
3408
+ return this;
3409
+ }
3410
+ if (!value) throw new YError("coerce callback must be provided");
3411
+ const coerceKey = keys;
3412
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").key[coerceKey] = true;
3413
+ __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").addCoerceMiddleware((argv, yargs) => {
3414
+ var _a$1;
3415
+ const argvKeys = [coerceKey, ...(_a$1 = yargs.getAliases()[coerceKey]) !== null && _a$1 !== void 0 ? _a$1 : []].filter((key) => Object.prototype.hasOwnProperty.call(argv, key));
3416
+ if (argvKeys.length === 0) return argv;
3417
+ return maybeAsyncResult(() => {
3418
+ return value(argv[argvKeys[0]]);
3419
+ }, (result) => {
3420
+ argvKeys.forEach((key) => {
3421
+ argv[key] = result;
3422
+ });
3423
+ return argv;
3424
+ }, (err) => {
3425
+ throw new YError(err.message);
3426
+ });
3427
+ }, coerceKey);
3428
+ return this;
3429
+ }
3430
+ conflicts(key1, key2) {
3431
+ argsert("<string|object> [string|array]", [key1, key2], arguments.length);
3432
+ __classPrivateFieldGet(this, _YargsInstance_validation, "f").conflicts(key1, key2);
3433
+ return this;
3434
+ }
3435
+ config(key = "config", msg, parseFn) {
3436
+ argsert("[object|string] [string|function] [function]", [
3437
+ key,
3438
+ msg,
3439
+ parseFn
3440
+ ], arguments.length);
3441
+ if (typeof key === "object" && !Array.isArray(key)) {
3442
+ key = applyExtends(key, __classPrivateFieldGet(this, _YargsInstance_cwd, "f"), this[kGetParserConfiguration]()["deep-merge-config"] || false, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
3443
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects = (__classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects || []).concat(key);
3444
+ return this;
3445
+ }
3446
+ if (typeof msg === "function") {
3447
+ parseFn = msg;
3448
+ msg = void 0;
3449
+ }
3450
+ this.describe(key, msg || __classPrivateFieldGet(this, _YargsInstance_usage, "f").deferY18nLookup("Path to JSON config file"));
3451
+ (Array.isArray(key) ? key : [key]).forEach((k) => {
3452
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").config[k] = parseFn || true;
3453
+ });
3454
+ return this;
3455
+ }
3456
+ completion(cmd, desc, fn) {
3457
+ argsert("[string] [string|boolean|function] [function]", [
3458
+ cmd,
3459
+ desc,
3460
+ fn
3461
+ ], arguments.length);
3462
+ if (typeof desc === "function") {
3463
+ fn = desc;
3464
+ desc = void 0;
3465
+ }
3466
+ __classPrivateFieldSet(this, _YargsInstance_completionCommand, cmd || __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f") || "completion", "f");
3467
+ if (!desc && desc !== false) desc = "generate completion script";
3468
+ this.command(__classPrivateFieldGet(this, _YargsInstance_completionCommand, "f"), desc);
3469
+ if (fn) __classPrivateFieldGet(this, _YargsInstance_completion, "f").registerFunction(fn);
3470
+ return this;
3471
+ }
3472
+ command(cmd, description, builder, handler, middlewares, deprecated) {
3473
+ argsert("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]", [
3474
+ cmd,
3475
+ description,
3476
+ builder,
3477
+ handler,
3478
+ middlewares,
3479
+ deprecated
3480
+ ], arguments.length);
3481
+ __classPrivateFieldGet(this, _YargsInstance_command, "f").addHandler(cmd, description, builder, handler, middlewares, deprecated);
3482
+ return this;
3483
+ }
3484
+ commands(cmd, description, builder, handler, middlewares, deprecated) {
3485
+ return this.command(cmd, description, builder, handler, middlewares, deprecated);
3486
+ }
3487
+ commandDir(dir, opts) {
3488
+ argsert("<string> [object]", [dir, opts], arguments.length);
3489
+ const req = __classPrivateFieldGet(this, _YargsInstance_parentRequire, "f") || __classPrivateFieldGet(this, _YargsInstance_shim, "f").require;
3490
+ __classPrivateFieldGet(this, _YargsInstance_command, "f").addDirectory(dir, req, __classPrivateFieldGet(this, _YargsInstance_shim, "f").getCallerFile(), opts);
3491
+ return this;
3492
+ }
3493
+ count(keys) {
3494
+ argsert("<array|string>", [keys], arguments.length);
3495
+ this[kPopulateParserHintArray]("count", keys);
3496
+ this[kTrackManuallySetKeys](keys);
3497
+ return this;
3498
+ }
3499
+ default(key, value, defaultDescription) {
3500
+ argsert("<object|string|array> [*] [string]", [
3501
+ key,
3502
+ value,
3503
+ defaultDescription
3504
+ ], arguments.length);
3505
+ if (defaultDescription) {
3506
+ assertSingleKey(key, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
3507
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").defaultDescription[key] = defaultDescription;
3508
+ }
3509
+ if (typeof value === "function") {
3510
+ assertSingleKey(key, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
3511
+ if (!__classPrivateFieldGet(this, _YargsInstance_options, "f").defaultDescription[key]) __classPrivateFieldGet(this, _YargsInstance_options, "f").defaultDescription[key] = __classPrivateFieldGet(this, _YargsInstance_usage, "f").functionDescription(value);
3512
+ value = value.call();
3513
+ }
3514
+ this[kPopulateParserHintSingleValueDictionary](this.default.bind(this), "default", key, value);
3515
+ return this;
3516
+ }
3517
+ defaults(key, value, defaultDescription) {
3518
+ return this.default(key, value, defaultDescription);
3519
+ }
3520
+ demandCommand(min = 1, max, minMsg, maxMsg) {
3521
+ argsert("[number] [number|string] [string|null|undefined] [string|null|undefined]", [
3522
+ min,
3523
+ max,
3524
+ minMsg,
3525
+ maxMsg
3526
+ ], arguments.length);
3527
+ if (typeof max !== "number") {
3528
+ minMsg = max;
3529
+ max = Infinity;
3530
+ }
3531
+ this.global("_", false);
3532
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").demandedCommands._ = {
3533
+ min,
3534
+ max,
3535
+ minMsg,
3536
+ maxMsg
3537
+ };
3538
+ return this;
3539
+ }
3540
+ demand(keys, max, msg) {
3541
+ if (Array.isArray(max)) {
3542
+ max.forEach((key) => {
3543
+ assertNotStrictEqual(msg, true, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
3544
+ this.demandOption(key, msg);
3545
+ });
3546
+ max = Infinity;
3547
+ } else if (typeof max !== "number") {
3548
+ msg = max;
3549
+ max = Infinity;
3550
+ }
3551
+ if (typeof keys === "number") {
3552
+ assertNotStrictEqual(msg, true, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
3553
+ this.demandCommand(keys, max, msg, msg);
3554
+ } else if (Array.isArray(keys)) keys.forEach((key) => {
3555
+ assertNotStrictEqual(msg, true, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
3556
+ this.demandOption(key, msg);
3557
+ });
3558
+ else if (typeof msg === "string") this.demandOption(keys, msg);
3559
+ else if (msg === true || typeof msg === "undefined") this.demandOption(keys);
3560
+ return this;
3561
+ }
3562
+ demandOption(keys, msg) {
3563
+ argsert("<object|string|array> [string]", [keys, msg], arguments.length);
3564
+ this[kPopulateParserHintSingleValueDictionary](this.demandOption.bind(this), "demandedOptions", keys, msg);
3565
+ return this;
3566
+ }
3567
+ deprecateOption(option, message) {
3568
+ argsert("<string> [string|boolean]", [option, message], arguments.length);
3569
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").deprecatedOptions[option] = message;
3570
+ return this;
3571
+ }
3572
+ describe(keys, description) {
3573
+ argsert("<object|string|array> [string]", [keys, description], arguments.length);
3574
+ this[kSetKey](keys, true);
3575
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").describe(keys, description);
3576
+ return this;
3577
+ }
3578
+ detectLocale(detect) {
3579
+ argsert("<boolean>", [detect], arguments.length);
3580
+ __classPrivateFieldSet(this, _YargsInstance_detectLocale, detect, "f");
3581
+ return this;
3582
+ }
3583
+ env(prefix) {
3584
+ argsert("[string|boolean]", [prefix], arguments.length);
3585
+ if (prefix === false) delete __classPrivateFieldGet(this, _YargsInstance_options, "f").envPrefix;
3586
+ else __classPrivateFieldGet(this, _YargsInstance_options, "f").envPrefix = prefix || "";
3587
+ return this;
3588
+ }
3589
+ epilogue(msg) {
3590
+ argsert("<string>", [msg], arguments.length);
3591
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").epilog(msg);
3592
+ return this;
3593
+ }
3594
+ epilog(msg) {
3595
+ return this.epilogue(msg);
3596
+ }
3597
+ example(cmd, description) {
3598
+ argsert("<string|array> [string]", [cmd, description], arguments.length);
3599
+ if (Array.isArray(cmd)) cmd.forEach((exampleParams) => this.example(...exampleParams));
3600
+ else __classPrivateFieldGet(this, _YargsInstance_usage, "f").example(cmd, description);
3601
+ return this;
3602
+ }
3603
+ exit(code, err) {
3604
+ __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f");
3605
+ __classPrivateFieldSet(this, _YargsInstance_exitError, err, "f");
3606
+ if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f")) __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.exit(code);
3607
+ }
3608
+ exitProcess(enabled = true) {
3609
+ argsert("[boolean]", [enabled], arguments.length);
3610
+ __classPrivateFieldSet(this, _YargsInstance_exitProcess, enabled, "f");
3611
+ return this;
3612
+ }
3613
+ fail(f) {
3614
+ argsert("<function|boolean>", [f], arguments.length);
3615
+ if (typeof f === "boolean" && f !== false) throw new YError("Invalid first argument. Expected function or boolean 'false'");
3616
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").failFn(f);
3617
+ return this;
3618
+ }
3619
+ getAliases() {
3620
+ return this.parsed ? this.parsed.aliases : {};
50
3621
  }
3622
+ async getCompletion(args, done) {
3623
+ argsert("<array> [function]", [args, done], arguments.length);
3624
+ if (!done) return new Promise((resolve$1, reject) => {
3625
+ __classPrivateFieldGet(this, _YargsInstance_completion, "f").getCompletion(args, (err, completions) => {
3626
+ if (err) reject(err);
3627
+ else resolve$1(completions);
3628
+ });
3629
+ });
3630
+ else return __classPrivateFieldGet(this, _YargsInstance_completion, "f").getCompletion(args, done);
3631
+ }
3632
+ getDemandedOptions() {
3633
+ argsert([], 0);
3634
+ return __classPrivateFieldGet(this, _YargsInstance_options, "f").demandedOptions;
3635
+ }
3636
+ getDemandedCommands() {
3637
+ argsert([], 0);
3638
+ return __classPrivateFieldGet(this, _YargsInstance_options, "f").demandedCommands;
3639
+ }
3640
+ getDeprecatedOptions() {
3641
+ argsert([], 0);
3642
+ return __classPrivateFieldGet(this, _YargsInstance_options, "f").deprecatedOptions;
3643
+ }
3644
+ getDetectLocale() {
3645
+ return __classPrivateFieldGet(this, _YargsInstance_detectLocale, "f");
3646
+ }
3647
+ getExitProcess() {
3648
+ return __classPrivateFieldGet(this, _YargsInstance_exitProcess, "f");
3649
+ }
3650
+ getGroups() {
3651
+ return Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_groups, "f"), __classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f"));
3652
+ }
3653
+ getHelp() {
3654
+ __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f");
3655
+ if (!__classPrivateFieldGet(this, _YargsInstance_usage, "f").hasCachedHelpMessage()) {
3656
+ if (!this.parsed) {
3657
+ const parse = this[kRunYargsParserAndExecuteCommands](__classPrivateFieldGet(this, _YargsInstance_processArgs, "f"), void 0, void 0, 0, true);
3658
+ if (isPromise(parse)) return parse.then(() => {
3659
+ return __classPrivateFieldGet(this, _YargsInstance_usage, "f").help();
3660
+ });
3661
+ }
3662
+ const builderResponse = __classPrivateFieldGet(this, _YargsInstance_command, "f").runDefaultBuilderOn(this);
3663
+ if (isPromise(builderResponse)) return builderResponse.then(() => {
3664
+ return __classPrivateFieldGet(this, _YargsInstance_usage, "f").help();
3665
+ });
3666
+ }
3667
+ return Promise.resolve(__classPrivateFieldGet(this, _YargsInstance_usage, "f").help());
3668
+ }
3669
+ getOptions() {
3670
+ return __classPrivateFieldGet(this, _YargsInstance_options, "f");
3671
+ }
3672
+ getStrict() {
3673
+ return __classPrivateFieldGet(this, _YargsInstance_strict, "f");
3674
+ }
3675
+ getStrictCommands() {
3676
+ return __classPrivateFieldGet(this, _YargsInstance_strictCommands, "f");
3677
+ }
3678
+ getStrictOptions() {
3679
+ return __classPrivateFieldGet(this, _YargsInstance_strictOptions, "f");
3680
+ }
3681
+ global(globals, global) {
3682
+ argsert("<string|array> [boolean]", [globals, global], arguments.length);
3683
+ globals = [].concat(globals);
3684
+ if (global !== false) __classPrivateFieldGet(this, _YargsInstance_options, "f").local = __classPrivateFieldGet(this, _YargsInstance_options, "f").local.filter((l) => globals.indexOf(l) === -1);
3685
+ else globals.forEach((g) => {
3686
+ if (!__classPrivateFieldGet(this, _YargsInstance_options, "f").local.includes(g)) __classPrivateFieldGet(this, _YargsInstance_options, "f").local.push(g);
3687
+ });
3688
+ return this;
3689
+ }
3690
+ group(opts, groupName) {
3691
+ argsert("<string|array> <string>", [opts, groupName], arguments.length);
3692
+ const existing = __classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f")[groupName] || __classPrivateFieldGet(this, _YargsInstance_groups, "f")[groupName];
3693
+ if (__classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f")[groupName]) delete __classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f")[groupName];
3694
+ const seen = {};
3695
+ __classPrivateFieldGet(this, _YargsInstance_groups, "f")[groupName] = (existing || []).concat(opts).filter((key) => {
3696
+ if (seen[key]) return false;
3697
+ return seen[key] = true;
3698
+ });
3699
+ return this;
3700
+ }
3701
+ hide(key) {
3702
+ argsert("<string>", [key], arguments.length);
3703
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").hiddenOptions.push(key);
3704
+ return this;
3705
+ }
3706
+ implies(key, value) {
3707
+ argsert("<string|object> [number|string|array]", [key, value], arguments.length);
3708
+ __classPrivateFieldGet(this, _YargsInstance_validation, "f").implies(key, value);
3709
+ return this;
3710
+ }
3711
+ locale(locale) {
3712
+ argsert("[string]", [locale], arguments.length);
3713
+ if (locale === void 0) {
3714
+ this[kGuessLocale]();
3715
+ return __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.getLocale();
3716
+ }
3717
+ __classPrivateFieldSet(this, _YargsInstance_detectLocale, false, "f");
3718
+ __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.setLocale(locale);
3719
+ return this;
3720
+ }
3721
+ middleware(callback, applyBeforeValidation, global) {
3722
+ return __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").addMiddleware(callback, !!applyBeforeValidation, global);
3723
+ }
3724
+ nargs(key, value) {
3725
+ argsert("<string|object|array> [number]", [key, value], arguments.length);
3726
+ this[kPopulateParserHintSingleValueDictionary](this.nargs.bind(this), "narg", key, value);
3727
+ return this;
3728
+ }
3729
+ normalize(keys) {
3730
+ argsert("<array|string>", [keys], arguments.length);
3731
+ this[kPopulateParserHintArray]("normalize", keys);
3732
+ return this;
3733
+ }
3734
+ number(keys) {
3735
+ argsert("<array|string>", [keys], arguments.length);
3736
+ this[kPopulateParserHintArray]("number", keys);
3737
+ this[kTrackManuallySetKeys](keys);
3738
+ return this;
3739
+ }
3740
+ option(key, opt) {
3741
+ argsert("<string|object> [object]", [key, opt], arguments.length);
3742
+ if (typeof key === "object") Object.keys(key).forEach((k) => {
3743
+ this.options(k, key[k]);
3744
+ });
3745
+ else {
3746
+ if (typeof opt !== "object") opt = {};
3747
+ this[kTrackManuallySetKeys](key);
3748
+ if (__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f") && (key === "version" || (opt === null || opt === void 0 ? void 0 : opt.alias) === "version")) this[kEmitWarning]([
3749
+ "\"version\" is a reserved word.",
3750
+ "Please do one of the following:",
3751
+ "- Disable version with `yargs.version(false)` if using \"version\" as an option",
3752
+ "- Use the built-in `yargs.version` method instead (if applicable)",
3753
+ "- Use a different option key",
3754
+ "https://yargs.js.org/docs/#api-reference-version"
3755
+ ].join("\n"), void 0, "versionWarning");
3756
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").key[key] = true;
3757
+ if (opt.alias) this.alias(key, opt.alias);
3758
+ const deprecate = opt.deprecate || opt.deprecated;
3759
+ if (deprecate) this.deprecateOption(key, deprecate);
3760
+ const demand = opt.demand || opt.required || opt.require;
3761
+ if (demand) this.demand(key, demand);
3762
+ if (opt.demandOption) this.demandOption(key, typeof opt.demandOption === "string" ? opt.demandOption : void 0);
3763
+ if (opt.conflicts) this.conflicts(key, opt.conflicts);
3764
+ if ("default" in opt) this.default(key, opt.default);
3765
+ if (opt.implies !== void 0) this.implies(key, opt.implies);
3766
+ if (opt.nargs !== void 0) this.nargs(key, opt.nargs);
3767
+ if (opt.config) this.config(key, opt.configParser);
3768
+ if (opt.normalize) this.normalize(key);
3769
+ if (opt.choices) this.choices(key, opt.choices);
3770
+ if (opt.coerce) this.coerce(key, opt.coerce);
3771
+ if (opt.group) this.group(key, opt.group);
3772
+ if (opt.boolean || opt.type === "boolean") {
3773
+ this.boolean(key);
3774
+ if (opt.alias) this.boolean(opt.alias);
3775
+ }
3776
+ if (opt.array || opt.type === "array") {
3777
+ this.array(key);
3778
+ if (opt.alias) this.array(opt.alias);
3779
+ }
3780
+ if (opt.number || opt.type === "number") {
3781
+ this.number(key);
3782
+ if (opt.alias) this.number(opt.alias);
3783
+ }
3784
+ if (opt.string || opt.type === "string") {
3785
+ this.string(key);
3786
+ if (opt.alias) this.string(opt.alias);
3787
+ }
3788
+ if (opt.count || opt.type === "count") this.count(key);
3789
+ if (typeof opt.global === "boolean") this.global(key, opt.global);
3790
+ if (opt.defaultDescription) __classPrivateFieldGet(this, _YargsInstance_options, "f").defaultDescription[key] = opt.defaultDescription;
3791
+ if (opt.skipValidation) this.skipValidation(key);
3792
+ const desc = opt.describe || opt.description || opt.desc;
3793
+ const descriptions = __classPrivateFieldGet(this, _YargsInstance_usage, "f").getDescriptions();
3794
+ if (!Object.prototype.hasOwnProperty.call(descriptions, key) || typeof desc === "string") this.describe(key, desc);
3795
+ if (opt.hidden) this.hide(key);
3796
+ if (opt.requiresArg) this.requiresArg(key);
3797
+ }
3798
+ return this;
3799
+ }
3800
+ options(key, opt) {
3801
+ return this.option(key, opt);
3802
+ }
3803
+ parse(args, shortCircuit, _parseFn) {
3804
+ argsert("[string|array] [function|boolean|object] [function]", [
3805
+ args,
3806
+ shortCircuit,
3807
+ _parseFn
3808
+ ], arguments.length);
3809
+ this[kFreeze]();
3810
+ if (typeof args === "undefined") args = __classPrivateFieldGet(this, _YargsInstance_processArgs, "f");
3811
+ if (typeof shortCircuit === "object") {
3812
+ __classPrivateFieldSet(this, _YargsInstance_parseContext, shortCircuit, "f");
3813
+ shortCircuit = _parseFn;
3814
+ }
3815
+ if (typeof shortCircuit === "function") {
3816
+ __classPrivateFieldSet(this, _YargsInstance_parseFn, shortCircuit, "f");
3817
+ shortCircuit = false;
3818
+ }
3819
+ if (!shortCircuit) __classPrivateFieldSet(this, _YargsInstance_processArgs, args, "f");
3820
+ if (__classPrivateFieldGet(this, _YargsInstance_parseFn, "f")) __classPrivateFieldSet(this, _YargsInstance_exitProcess, false, "f");
3821
+ const parsed = this[kRunYargsParserAndExecuteCommands](args, !!shortCircuit);
3822
+ const tmpParsed = this.parsed;
3823
+ __classPrivateFieldGet(this, _YargsInstance_completion, "f").setParsed(this.parsed);
3824
+ if (isPromise(parsed)) return parsed.then((argv) => {
3825
+ if (__classPrivateFieldGet(this, _YargsInstance_parseFn, "f")) __classPrivateFieldGet(this, _YargsInstance_parseFn, "f").call(this, __classPrivateFieldGet(this, _YargsInstance_exitError, "f"), argv, __classPrivateFieldGet(this, _YargsInstance_output, "f"));
3826
+ return argv;
3827
+ }).catch((err) => {
3828
+ if (__classPrivateFieldGet(this, _YargsInstance_parseFn, "f")) __classPrivateFieldGet(this, _YargsInstance_parseFn, "f")(err, this.parsed.argv, __classPrivateFieldGet(this, _YargsInstance_output, "f"));
3829
+ throw err;
3830
+ }).finally(() => {
3831
+ this[kUnfreeze]();
3832
+ this.parsed = tmpParsed;
3833
+ });
3834
+ else {
3835
+ if (__classPrivateFieldGet(this, _YargsInstance_parseFn, "f")) __classPrivateFieldGet(this, _YargsInstance_parseFn, "f").call(this, __classPrivateFieldGet(this, _YargsInstance_exitError, "f"), parsed, __classPrivateFieldGet(this, _YargsInstance_output, "f"));
3836
+ this[kUnfreeze]();
3837
+ this.parsed = tmpParsed;
3838
+ }
3839
+ return parsed;
3840
+ }
3841
+ parseAsync(args, shortCircuit, _parseFn) {
3842
+ const maybePromise = this.parse(args, shortCircuit, _parseFn);
3843
+ return !isPromise(maybePromise) ? Promise.resolve(maybePromise) : maybePromise;
3844
+ }
3845
+ parseSync(args, shortCircuit, _parseFn) {
3846
+ const maybePromise = this.parse(args, shortCircuit, _parseFn);
3847
+ if (isPromise(maybePromise)) throw new YError(".parseSync() must not be used with asynchronous builders, handlers, or middleware");
3848
+ return maybePromise;
3849
+ }
3850
+ parserConfiguration(config) {
3851
+ argsert("<object>", [config], arguments.length);
3852
+ __classPrivateFieldSet(this, _YargsInstance_parserConfig, config, "f");
3853
+ return this;
3854
+ }
3855
+ pkgConf(key, rootPath) {
3856
+ argsert("<string> [string]", [key, rootPath], arguments.length);
3857
+ let conf = null;
3858
+ const obj = this[kPkgUp](rootPath || __classPrivateFieldGet(this, _YargsInstance_cwd, "f"));
3859
+ if (obj[key] && typeof obj[key] === "object") {
3860
+ conf = applyExtends(obj[key], rootPath || __classPrivateFieldGet(this, _YargsInstance_cwd, "f"), this[kGetParserConfiguration]()["deep-merge-config"] || false, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
3861
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects = (__classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects || []).concat(conf);
3862
+ }
3863
+ return this;
3864
+ }
3865
+ positional(key, opts) {
3866
+ argsert("<string> <object>", [key, opts], arguments.length);
3867
+ const supportedOpts = [
3868
+ "default",
3869
+ "defaultDescription",
3870
+ "implies",
3871
+ "normalize",
3872
+ "choices",
3873
+ "conflicts",
3874
+ "coerce",
3875
+ "type",
3876
+ "describe",
3877
+ "desc",
3878
+ "description",
3879
+ "alias"
3880
+ ];
3881
+ opts = objFilter(opts, (k, v) => {
3882
+ if (k === "type" && ![
3883
+ "string",
3884
+ "number",
3885
+ "boolean"
3886
+ ].includes(v)) return false;
3887
+ return supportedOpts.includes(k);
3888
+ });
3889
+ const fullCommand = __classPrivateFieldGet(this, _YargsInstance_context, "f").fullCommands[__classPrivateFieldGet(this, _YargsInstance_context, "f").fullCommands.length - 1];
3890
+ const parseOptions = fullCommand ? __classPrivateFieldGet(this, _YargsInstance_command, "f").cmdToParseOptions(fullCommand) : {
3891
+ array: [],
3892
+ alias: {},
3893
+ default: {},
3894
+ demand: {}
3895
+ };
3896
+ objectKeys(parseOptions).forEach((pk) => {
3897
+ const parseOption = parseOptions[pk];
3898
+ if (Array.isArray(parseOption)) {
3899
+ if (parseOption.indexOf(key) !== -1) opts[pk] = true;
3900
+ } else if (parseOption[key] && !(pk in opts)) opts[pk] = parseOption[key];
3901
+ });
3902
+ this.group(key, __classPrivateFieldGet(this, _YargsInstance_usage, "f").getPositionalGroupName());
3903
+ return this.option(key, opts);
3904
+ }
3905
+ recommendCommands(recommend = true) {
3906
+ argsert("[boolean]", [recommend], arguments.length);
3907
+ __classPrivateFieldSet(this, _YargsInstance_recommendCommands, recommend, "f");
3908
+ return this;
3909
+ }
3910
+ required(keys, max, msg) {
3911
+ return this.demand(keys, max, msg);
3912
+ }
3913
+ require(keys, max, msg) {
3914
+ return this.demand(keys, max, msg);
3915
+ }
3916
+ requiresArg(keys) {
3917
+ argsert("<array|string|object> [number]", [keys], arguments.length);
3918
+ if (typeof keys === "string" && __classPrivateFieldGet(this, _YargsInstance_options, "f").narg[keys]) return this;
3919
+ else this[kPopulateParserHintSingleValueDictionary](this.requiresArg.bind(this), "narg", keys, NaN);
3920
+ return this;
3921
+ }
3922
+ showCompletionScript($0, cmd) {
3923
+ argsert("[string] [string]", [$0, cmd], arguments.length);
3924
+ $0 = $0 || this.$0;
3925
+ __classPrivateFieldGet(this, _YargsInstance_logger, "f").log(__classPrivateFieldGet(this, _YargsInstance_completion, "f").generateCompletionScript($0, cmd || __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f") || "completion"));
3926
+ return this;
3927
+ }
3928
+ showHelp(level) {
3929
+ argsert("[string|function]", [level], arguments.length);
3930
+ __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f");
3931
+ if (!__classPrivateFieldGet(this, _YargsInstance_usage, "f").hasCachedHelpMessage()) {
3932
+ if (!this.parsed) {
3933
+ const parse = this[kRunYargsParserAndExecuteCommands](__classPrivateFieldGet(this, _YargsInstance_processArgs, "f"), void 0, void 0, 0, true);
3934
+ if (isPromise(parse)) {
3935
+ parse.then(() => {
3936
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").showHelp(level);
3937
+ });
3938
+ return this;
3939
+ }
3940
+ }
3941
+ const builderResponse = __classPrivateFieldGet(this, _YargsInstance_command, "f").runDefaultBuilderOn(this);
3942
+ if (isPromise(builderResponse)) {
3943
+ builderResponse.then(() => {
3944
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").showHelp(level);
3945
+ });
3946
+ return this;
3947
+ }
3948
+ }
3949
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").showHelp(level);
3950
+ return this;
3951
+ }
3952
+ scriptName(scriptName) {
3953
+ this.customScriptName = true;
3954
+ this.$0 = scriptName;
3955
+ return this;
3956
+ }
3957
+ showHelpOnFail(enabled, message) {
3958
+ argsert("[boolean|string] [string]", [enabled, message], arguments.length);
3959
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").showHelpOnFail(enabled, message);
3960
+ return this;
3961
+ }
3962
+ showVersion(level) {
3963
+ argsert("[string|function]", [level], arguments.length);
3964
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").showVersion(level);
3965
+ return this;
3966
+ }
3967
+ skipValidation(keys) {
3968
+ argsert("<array|string>", [keys], arguments.length);
3969
+ this[kPopulateParserHintArray]("skipValidation", keys);
3970
+ return this;
3971
+ }
3972
+ strict(enabled) {
3973
+ argsert("[boolean]", [enabled], arguments.length);
3974
+ __classPrivateFieldSet(this, _YargsInstance_strict, enabled !== false, "f");
3975
+ return this;
3976
+ }
3977
+ strictCommands(enabled) {
3978
+ argsert("[boolean]", [enabled], arguments.length);
3979
+ __classPrivateFieldSet(this, _YargsInstance_strictCommands, enabled !== false, "f");
3980
+ return this;
3981
+ }
3982
+ strictOptions(enabled) {
3983
+ argsert("[boolean]", [enabled], arguments.length);
3984
+ __classPrivateFieldSet(this, _YargsInstance_strictOptions, enabled !== false, "f");
3985
+ return this;
3986
+ }
3987
+ string(keys) {
3988
+ argsert("<array|string>", [keys], arguments.length);
3989
+ this[kPopulateParserHintArray]("string", keys);
3990
+ this[kTrackManuallySetKeys](keys);
3991
+ return this;
3992
+ }
3993
+ terminalWidth() {
3994
+ argsert([], 0);
3995
+ return __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.stdColumns;
3996
+ }
3997
+ updateLocale(obj) {
3998
+ return this.updateStrings(obj);
3999
+ }
4000
+ updateStrings(obj) {
4001
+ argsert("<object>", [obj], arguments.length);
4002
+ __classPrivateFieldSet(this, _YargsInstance_detectLocale, false, "f");
4003
+ __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.updateLocale(obj);
4004
+ return this;
4005
+ }
4006
+ usage(msg, description, builder, handler) {
4007
+ argsert("<string|null|undefined> [string|boolean] [function|object] [function]", [
4008
+ msg,
4009
+ description,
4010
+ builder,
4011
+ handler
4012
+ ], arguments.length);
4013
+ if (description !== void 0) {
4014
+ assertNotStrictEqual(msg, null, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
4015
+ if ((msg || "").match(/^\$0( |$)/)) return this.command(msg, description, builder, handler);
4016
+ else throw new YError(".usage() description must start with $0 if being used as alias for .command()");
4017
+ } else {
4018
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").usage(msg);
4019
+ return this;
4020
+ }
4021
+ }
4022
+ usageConfiguration(config) {
4023
+ argsert("<object>", [config], arguments.length);
4024
+ __classPrivateFieldSet(this, _YargsInstance_usageConfig, config, "f");
4025
+ return this;
4026
+ }
4027
+ version(opt, msg, ver) {
4028
+ const defaultVersionOpt = "version";
4029
+ argsert("[boolean|string] [string] [string]", [
4030
+ opt,
4031
+ msg,
4032
+ ver
4033
+ ], arguments.length);
4034
+ if (__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f")) {
4035
+ this[kDeleteFromParserHintObject](__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f"));
4036
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").version(void 0);
4037
+ __classPrivateFieldSet(this, _YargsInstance_versionOpt, null, "f");
4038
+ }
4039
+ if (arguments.length === 0) {
4040
+ ver = this[kGuessVersion]();
4041
+ opt = defaultVersionOpt;
4042
+ } else if (arguments.length === 1) {
4043
+ if (opt === false) return this;
4044
+ ver = opt;
4045
+ opt = defaultVersionOpt;
4046
+ } else if (arguments.length === 2) {
4047
+ ver = msg;
4048
+ msg = void 0;
4049
+ }
4050
+ __classPrivateFieldSet(this, _YargsInstance_versionOpt, typeof opt === "string" ? opt : defaultVersionOpt, "f");
4051
+ msg = msg || __classPrivateFieldGet(this, _YargsInstance_usage, "f").deferY18nLookup("Show version number");
4052
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").version(ver || void 0);
4053
+ this.boolean(__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f"));
4054
+ this.describe(__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f"), msg);
4055
+ return this;
4056
+ }
4057
+ wrap(cols) {
4058
+ argsert("<number|null|undefined>", [cols], arguments.length);
4059
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").wrap(cols);
4060
+ return this;
4061
+ }
4062
+ [(_YargsInstance_command = /* @__PURE__ */ new WeakMap(), _YargsInstance_cwd = /* @__PURE__ */ new WeakMap(), _YargsInstance_context = /* @__PURE__ */ new WeakMap(), _YargsInstance_completion = /* @__PURE__ */ new WeakMap(), _YargsInstance_completionCommand = /* @__PURE__ */ new WeakMap(), _YargsInstance_defaultShowHiddenOpt = /* @__PURE__ */ new WeakMap(), _YargsInstance_exitError = /* @__PURE__ */ new WeakMap(), _YargsInstance_detectLocale = /* @__PURE__ */ new WeakMap(), _YargsInstance_emittedWarnings = /* @__PURE__ */ new WeakMap(), _YargsInstance_exitProcess = /* @__PURE__ */ new WeakMap(), _YargsInstance_frozens = /* @__PURE__ */ new WeakMap(), _YargsInstance_globalMiddleware = /* @__PURE__ */ new WeakMap(), _YargsInstance_groups = /* @__PURE__ */ new WeakMap(), _YargsInstance_hasOutput = /* @__PURE__ */ new WeakMap(), _YargsInstance_helpOpt = /* @__PURE__ */ new WeakMap(), _YargsInstance_isGlobalContext = /* @__PURE__ */ new WeakMap(), _YargsInstance_logger = /* @__PURE__ */ new WeakMap(), _YargsInstance_output = /* @__PURE__ */ new WeakMap(), _YargsInstance_options = /* @__PURE__ */ new WeakMap(), _YargsInstance_parentRequire = /* @__PURE__ */ new WeakMap(), _YargsInstance_parserConfig = /* @__PURE__ */ new WeakMap(), _YargsInstance_parseFn = /* @__PURE__ */ new WeakMap(), _YargsInstance_parseContext = /* @__PURE__ */ new WeakMap(), _YargsInstance_pkgs = /* @__PURE__ */ new WeakMap(), _YargsInstance_preservedGroups = /* @__PURE__ */ new WeakMap(), _YargsInstance_processArgs = /* @__PURE__ */ new WeakMap(), _YargsInstance_recommendCommands = /* @__PURE__ */ new WeakMap(), _YargsInstance_shim = /* @__PURE__ */ new WeakMap(), _YargsInstance_strict = /* @__PURE__ */ new WeakMap(), _YargsInstance_strictCommands = /* @__PURE__ */ new WeakMap(), _YargsInstance_strictOptions = /* @__PURE__ */ new WeakMap(), _YargsInstance_usage = /* @__PURE__ */ new WeakMap(), _YargsInstance_usageConfig = /* @__PURE__ */ new WeakMap(), _YargsInstance_versionOpt = /* @__PURE__ */ new WeakMap(), _YargsInstance_validation = /* @__PURE__ */ new WeakMap(), kCopyDoubleDash)](argv) {
4063
+ if (!argv._ || !argv["--"]) return argv;
4064
+ argv._.push.apply(argv._, argv["--"]);
4065
+ try {
4066
+ delete argv["--"];
4067
+ } catch (_err) {}
4068
+ return argv;
4069
+ }
4070
+ [kCreateLogger]() {
4071
+ return {
4072
+ log: (...args) => {
4073
+ if (!this[kHasParseCallback]()) console.log(...args);
4074
+ __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f");
4075
+ if (__classPrivateFieldGet(this, _YargsInstance_output, "f").length) __classPrivateFieldSet(this, _YargsInstance_output, __classPrivateFieldGet(this, _YargsInstance_output, "f") + "\n", "f");
4076
+ __classPrivateFieldSet(this, _YargsInstance_output, __classPrivateFieldGet(this, _YargsInstance_output, "f") + args.join(" "), "f");
4077
+ },
4078
+ error: (...args) => {
4079
+ if (!this[kHasParseCallback]()) console.error(...args);
4080
+ __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f");
4081
+ if (__classPrivateFieldGet(this, _YargsInstance_output, "f").length) __classPrivateFieldSet(this, _YargsInstance_output, __classPrivateFieldGet(this, _YargsInstance_output, "f") + "\n", "f");
4082
+ __classPrivateFieldSet(this, _YargsInstance_output, __classPrivateFieldGet(this, _YargsInstance_output, "f") + args.join(" "), "f");
4083
+ }
4084
+ };
4085
+ }
4086
+ [kDeleteFromParserHintObject](optionKey) {
4087
+ objectKeys(__classPrivateFieldGet(this, _YargsInstance_options, "f")).forEach((hintKey) => {
4088
+ if (((key) => key === "configObjects")(hintKey)) return;
4089
+ const hint = __classPrivateFieldGet(this, _YargsInstance_options, "f")[hintKey];
4090
+ if (Array.isArray(hint)) {
4091
+ if (hint.includes(optionKey)) hint.splice(hint.indexOf(optionKey), 1);
4092
+ } else if (typeof hint === "object") delete hint[optionKey];
4093
+ });
4094
+ delete __classPrivateFieldGet(this, _YargsInstance_usage, "f").getDescriptions()[optionKey];
4095
+ }
4096
+ [kEmitWarning](warning, type, deduplicationId) {
4097
+ if (!__classPrivateFieldGet(this, _YargsInstance_emittedWarnings, "f")[deduplicationId]) {
4098
+ __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.emitWarning(warning, type);
4099
+ __classPrivateFieldGet(this, _YargsInstance_emittedWarnings, "f")[deduplicationId] = true;
4100
+ }
4101
+ }
4102
+ [kFreeze]() {
4103
+ __classPrivateFieldGet(this, _YargsInstance_frozens, "f").push({
4104
+ options: __classPrivateFieldGet(this, _YargsInstance_options, "f"),
4105
+ configObjects: __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects.slice(0),
4106
+ exitProcess: __classPrivateFieldGet(this, _YargsInstance_exitProcess, "f"),
4107
+ groups: __classPrivateFieldGet(this, _YargsInstance_groups, "f"),
4108
+ strict: __classPrivateFieldGet(this, _YargsInstance_strict, "f"),
4109
+ strictCommands: __classPrivateFieldGet(this, _YargsInstance_strictCommands, "f"),
4110
+ strictOptions: __classPrivateFieldGet(this, _YargsInstance_strictOptions, "f"),
4111
+ completionCommand: __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f"),
4112
+ output: __classPrivateFieldGet(this, _YargsInstance_output, "f"),
4113
+ exitError: __classPrivateFieldGet(this, _YargsInstance_exitError, "f"),
4114
+ hasOutput: __classPrivateFieldGet(this, _YargsInstance_hasOutput, "f"),
4115
+ parsed: this.parsed,
4116
+ parseFn: __classPrivateFieldGet(this, _YargsInstance_parseFn, "f"),
4117
+ parseContext: __classPrivateFieldGet(this, _YargsInstance_parseContext, "f")
4118
+ });
4119
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").freeze();
4120
+ __classPrivateFieldGet(this, _YargsInstance_validation, "f").freeze();
4121
+ __classPrivateFieldGet(this, _YargsInstance_command, "f").freeze();
4122
+ __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").freeze();
4123
+ }
4124
+ [kGetDollarZero]() {
4125
+ let $0 = "";
4126
+ let default$0;
4127
+ if (/\b(node|iojs|electron)(\.exe)?$/.test(__classPrivateFieldGet(this, _YargsInstance_shim, "f").process.argv()[0])) default$0 = __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.argv().slice(1, 2);
4128
+ else default$0 = __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.argv().slice(0, 1);
4129
+ $0 = default$0.map((x) => {
4130
+ const b = this[kRebase](__classPrivateFieldGet(this, _YargsInstance_cwd, "f"), x);
4131
+ return x.match(/^(\/|([a-zA-Z]:)?\\)/) && b.length < x.length ? b : x;
4132
+ }).join(" ").trim();
4133
+ if (__classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv("_") && __classPrivateFieldGet(this, _YargsInstance_shim, "f").getProcessArgvBin() === __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv("_")) $0 = __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv("_").replace(`${__classPrivateFieldGet(this, _YargsInstance_shim, "f").path.dirname(__classPrivateFieldGet(this, _YargsInstance_shim, "f").process.execPath())}/`, "");
4134
+ return $0;
4135
+ }
4136
+ [kGetParserConfiguration]() {
4137
+ return __classPrivateFieldGet(this, _YargsInstance_parserConfig, "f");
4138
+ }
4139
+ [kGetUsageConfiguration]() {
4140
+ return __classPrivateFieldGet(this, _YargsInstance_usageConfig, "f");
4141
+ }
4142
+ [kGuessLocale]() {
4143
+ if (!__classPrivateFieldGet(this, _YargsInstance_detectLocale, "f")) return;
4144
+ const locale = __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv("LC_ALL") || __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv("LC_MESSAGES") || __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv("LANG") || __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv("LANGUAGE") || "en_US";
4145
+ this.locale(locale.replace(/[.:].*/, ""));
4146
+ }
4147
+ [kGuessVersion]() {
4148
+ return this[kPkgUp]().version || "unknown";
4149
+ }
4150
+ [kParsePositionalNumbers](argv) {
4151
+ const args = argv["--"] ? argv["--"] : argv._;
4152
+ for (let i = 0, arg; (arg = args[i]) !== void 0; i++) if (__classPrivateFieldGet(this, _YargsInstance_shim, "f").Parser.looksLikeNumber(arg) && Number.isSafeInteger(Math.floor(parseFloat(`${arg}`)))) args[i] = Number(arg);
4153
+ return argv;
4154
+ }
4155
+ [kPkgUp](rootPath) {
4156
+ const npath = rootPath || "*";
4157
+ if (__classPrivateFieldGet(this, _YargsInstance_pkgs, "f")[npath]) return __classPrivateFieldGet(this, _YargsInstance_pkgs, "f")[npath];
4158
+ let obj = {};
4159
+ try {
4160
+ let startDir = rootPath || __classPrivateFieldGet(this, _YargsInstance_shim, "f").mainFilename;
4161
+ if (__classPrivateFieldGet(this, _YargsInstance_shim, "f").path.extname(startDir)) startDir = __classPrivateFieldGet(this, _YargsInstance_shim, "f").path.dirname(startDir);
4162
+ const pkgJsonPath = __classPrivateFieldGet(this, _YargsInstance_shim, "f").findUp(startDir, (dir, names) => {
4163
+ if (names.includes("package.json")) return "package.json";
4164
+ else return;
4165
+ });
4166
+ assertNotStrictEqual(pkgJsonPath, void 0, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
4167
+ obj = JSON.parse(__classPrivateFieldGet(this, _YargsInstance_shim, "f").readFileSync(pkgJsonPath, "utf8"));
4168
+ } catch (_noop) {}
4169
+ __classPrivateFieldGet(this, _YargsInstance_pkgs, "f")[npath] = obj || {};
4170
+ return __classPrivateFieldGet(this, _YargsInstance_pkgs, "f")[npath];
4171
+ }
4172
+ [kPopulateParserHintArray](type, keys) {
4173
+ keys = [].concat(keys);
4174
+ keys.forEach((key) => {
4175
+ key = this[kSanitizeKey](key);
4176
+ __classPrivateFieldGet(this, _YargsInstance_options, "f")[type].push(key);
4177
+ });
4178
+ }
4179
+ [kPopulateParserHintSingleValueDictionary](builder, type, key, value) {
4180
+ this[kPopulateParserHintDictionary](builder, type, key, value, (type$1, key$1, value$1) => {
4181
+ __classPrivateFieldGet(this, _YargsInstance_options, "f")[type$1][key$1] = value$1;
4182
+ });
4183
+ }
4184
+ [kPopulateParserHintArrayDictionary](builder, type, key, value) {
4185
+ this[kPopulateParserHintDictionary](builder, type, key, value, (type$1, key$1, value$1) => {
4186
+ __classPrivateFieldGet(this, _YargsInstance_options, "f")[type$1][key$1] = (__classPrivateFieldGet(this, _YargsInstance_options, "f")[type$1][key$1] || []).concat(value$1);
4187
+ });
4188
+ }
4189
+ [kPopulateParserHintDictionary](builder, type, key, value, singleKeyHandler) {
4190
+ if (Array.isArray(key)) key.forEach((k) => {
4191
+ builder(k, value);
4192
+ });
4193
+ else if (((key$1) => typeof key$1 === "object")(key)) for (const k of objectKeys(key)) builder(k, key[k]);
4194
+ else singleKeyHandler(type, this[kSanitizeKey](key), value);
4195
+ }
4196
+ [kSanitizeKey](key) {
4197
+ if (key === "__proto__") return "___proto___";
4198
+ return key;
4199
+ }
4200
+ [kSetKey](key, set) {
4201
+ this[kPopulateParserHintSingleValueDictionary](this[kSetKey].bind(this), "key", key, set);
4202
+ return this;
4203
+ }
4204
+ [kUnfreeze]() {
4205
+ var _a$1, _b$1, _c$1, _d, _e, _f, _g, _h, _j, _k, _l, _m;
4206
+ const frozen = __classPrivateFieldGet(this, _YargsInstance_frozens, "f").pop();
4207
+ assertNotStrictEqual(frozen, void 0, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
4208
+ let configObjects;
4209
+ _a$1 = this, _b$1 = this, _c$1 = this, _d = this, _e = this, _f = this, _g = this, _h = this, _j = this, _k = this, _l = this, _m = this, {options: { set value(_o) {
4210
+ __classPrivateFieldSet(_a$1, _YargsInstance_options, _o, "f");
4211
+ } }.value, configObjects, exitProcess: { set value(_o) {
4212
+ __classPrivateFieldSet(_b$1, _YargsInstance_exitProcess, _o, "f");
4213
+ } }.value, groups: { set value(_o) {
4214
+ __classPrivateFieldSet(_c$1, _YargsInstance_groups, _o, "f");
4215
+ } }.value, output: { set value(_o) {
4216
+ __classPrivateFieldSet(_d, _YargsInstance_output, _o, "f");
4217
+ } }.value, exitError: { set value(_o) {
4218
+ __classPrivateFieldSet(_e, _YargsInstance_exitError, _o, "f");
4219
+ } }.value, hasOutput: { set value(_o) {
4220
+ __classPrivateFieldSet(_f, _YargsInstance_hasOutput, _o, "f");
4221
+ } }.value, parsed: this.parsed, strict: { set value(_o) {
4222
+ __classPrivateFieldSet(_g, _YargsInstance_strict, _o, "f");
4223
+ } }.value, strictCommands: { set value(_o) {
4224
+ __classPrivateFieldSet(_h, _YargsInstance_strictCommands, _o, "f");
4225
+ } }.value, strictOptions: { set value(_o) {
4226
+ __classPrivateFieldSet(_j, _YargsInstance_strictOptions, _o, "f");
4227
+ } }.value, completionCommand: { set value(_o) {
4228
+ __classPrivateFieldSet(_k, _YargsInstance_completionCommand, _o, "f");
4229
+ } }.value, parseFn: { set value(_o) {
4230
+ __classPrivateFieldSet(_l, _YargsInstance_parseFn, _o, "f");
4231
+ } }.value, parseContext: { set value(_o) {
4232
+ __classPrivateFieldSet(_m, _YargsInstance_parseContext, _o, "f");
4233
+ } }.value} = frozen;
4234
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects = configObjects;
4235
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").unfreeze();
4236
+ __classPrivateFieldGet(this, _YargsInstance_validation, "f").unfreeze();
4237
+ __classPrivateFieldGet(this, _YargsInstance_command, "f").unfreeze();
4238
+ __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").unfreeze();
4239
+ }
4240
+ [kValidateAsync](validation$1, argv) {
4241
+ return maybeAsyncResult(argv, (result) => {
4242
+ validation$1(result);
4243
+ return result;
4244
+ });
4245
+ }
4246
+ getInternalMethods() {
4247
+ return {
4248
+ getCommandInstance: this[kGetCommandInstance].bind(this),
4249
+ getContext: this[kGetContext].bind(this),
4250
+ getHasOutput: this[kGetHasOutput].bind(this),
4251
+ getLoggerInstance: this[kGetLoggerInstance].bind(this),
4252
+ getParseContext: this[kGetParseContext].bind(this),
4253
+ getParserConfiguration: this[kGetParserConfiguration].bind(this),
4254
+ getUsageConfiguration: this[kGetUsageConfiguration].bind(this),
4255
+ getUsageInstance: this[kGetUsageInstance].bind(this),
4256
+ getValidationInstance: this[kGetValidationInstance].bind(this),
4257
+ hasParseCallback: this[kHasParseCallback].bind(this),
4258
+ isGlobalContext: this[kIsGlobalContext].bind(this),
4259
+ postProcess: this[kPostProcess].bind(this),
4260
+ reset: this[kReset].bind(this),
4261
+ runValidation: this[kRunValidation].bind(this),
4262
+ runYargsParserAndExecuteCommands: this[kRunYargsParserAndExecuteCommands].bind(this),
4263
+ setHasOutput: this[kSetHasOutput].bind(this)
4264
+ };
4265
+ }
4266
+ [kGetCommandInstance]() {
4267
+ return __classPrivateFieldGet(this, _YargsInstance_command, "f");
4268
+ }
4269
+ [kGetContext]() {
4270
+ return __classPrivateFieldGet(this, _YargsInstance_context, "f");
4271
+ }
4272
+ [kGetHasOutput]() {
4273
+ return __classPrivateFieldGet(this, _YargsInstance_hasOutput, "f");
4274
+ }
4275
+ [kGetLoggerInstance]() {
4276
+ return __classPrivateFieldGet(this, _YargsInstance_logger, "f");
4277
+ }
4278
+ [kGetParseContext]() {
4279
+ return __classPrivateFieldGet(this, _YargsInstance_parseContext, "f") || {};
4280
+ }
4281
+ [kGetUsageInstance]() {
4282
+ return __classPrivateFieldGet(this, _YargsInstance_usage, "f");
4283
+ }
4284
+ [kGetValidationInstance]() {
4285
+ return __classPrivateFieldGet(this, _YargsInstance_validation, "f");
4286
+ }
4287
+ [kHasParseCallback]() {
4288
+ return !!__classPrivateFieldGet(this, _YargsInstance_parseFn, "f");
4289
+ }
4290
+ [kIsGlobalContext]() {
4291
+ return __classPrivateFieldGet(this, _YargsInstance_isGlobalContext, "f");
4292
+ }
4293
+ [kPostProcess](argv, populateDoubleDash, calledFromCommand, runGlobalMiddleware) {
4294
+ if (calledFromCommand) return argv;
4295
+ if (isPromise(argv)) return argv;
4296
+ if (!populateDoubleDash) argv = this[kCopyDoubleDash](argv);
4297
+ if (this[kGetParserConfiguration]()["parse-positional-numbers"] || this[kGetParserConfiguration]()["parse-positional-numbers"] === void 0) argv = this[kParsePositionalNumbers](argv);
4298
+ if (runGlobalMiddleware) argv = applyMiddleware(argv, this, __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").getMiddleware(), false);
4299
+ return argv;
4300
+ }
4301
+ [kReset](aliases = {}) {
4302
+ __classPrivateFieldSet(this, _YargsInstance_options, __classPrivateFieldGet(this, _YargsInstance_options, "f") || {}, "f");
4303
+ const tmpOptions = {};
4304
+ tmpOptions.local = __classPrivateFieldGet(this, _YargsInstance_options, "f").local || [];
4305
+ tmpOptions.configObjects = __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects || [];
4306
+ const localLookup = {};
4307
+ tmpOptions.local.forEach((l) => {
4308
+ localLookup[l] = true;
4309
+ (aliases[l] || []).forEach((a) => {
4310
+ localLookup[a] = true;
4311
+ });
4312
+ });
4313
+ Object.assign(__classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f"), Object.keys(__classPrivateFieldGet(this, _YargsInstance_groups, "f")).reduce((acc, groupName) => {
4314
+ const keys = __classPrivateFieldGet(this, _YargsInstance_groups, "f")[groupName].filter((key) => !(key in localLookup));
4315
+ if (keys.length > 0) acc[groupName] = keys;
4316
+ return acc;
4317
+ }, {}));
4318
+ __classPrivateFieldSet(this, _YargsInstance_groups, {}, "f");
4319
+ const arrayOptions = [
4320
+ "array",
4321
+ "boolean",
4322
+ "string",
4323
+ "skipValidation",
4324
+ "count",
4325
+ "normalize",
4326
+ "number",
4327
+ "hiddenOptions"
4328
+ ];
4329
+ const objectOptions = [
4330
+ "narg",
4331
+ "key",
4332
+ "alias",
4333
+ "default",
4334
+ "defaultDescription",
4335
+ "config",
4336
+ "choices",
4337
+ "demandedOptions",
4338
+ "demandedCommands",
4339
+ "deprecatedOptions"
4340
+ ];
4341
+ arrayOptions.forEach((k) => {
4342
+ tmpOptions[k] = (__classPrivateFieldGet(this, _YargsInstance_options, "f")[k] || []).filter((k$1) => !localLookup[k$1]);
4343
+ });
4344
+ objectOptions.forEach((k) => {
4345
+ tmpOptions[k] = objFilter(__classPrivateFieldGet(this, _YargsInstance_options, "f")[k], (k$1) => !localLookup[k$1]);
4346
+ });
4347
+ tmpOptions.envPrefix = __classPrivateFieldGet(this, _YargsInstance_options, "f").envPrefix;
4348
+ __classPrivateFieldSet(this, _YargsInstance_options, tmpOptions, "f");
4349
+ __classPrivateFieldSet(this, _YargsInstance_usage, __classPrivateFieldGet(this, _YargsInstance_usage, "f") ? __classPrivateFieldGet(this, _YargsInstance_usage, "f").reset(localLookup) : usage(this, __classPrivateFieldGet(this, _YargsInstance_shim, "f")), "f");
4350
+ __classPrivateFieldSet(this, _YargsInstance_validation, __classPrivateFieldGet(this, _YargsInstance_validation, "f") ? __classPrivateFieldGet(this, _YargsInstance_validation, "f").reset(localLookup) : validation(this, __classPrivateFieldGet(this, _YargsInstance_usage, "f"), __classPrivateFieldGet(this, _YargsInstance_shim, "f")), "f");
4351
+ __classPrivateFieldSet(this, _YargsInstance_command, __classPrivateFieldGet(this, _YargsInstance_command, "f") ? __classPrivateFieldGet(this, _YargsInstance_command, "f").reset() : command(__classPrivateFieldGet(this, _YargsInstance_usage, "f"), __classPrivateFieldGet(this, _YargsInstance_validation, "f"), __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f"), __classPrivateFieldGet(this, _YargsInstance_shim, "f")), "f");
4352
+ if (!__classPrivateFieldGet(this, _YargsInstance_completion, "f")) __classPrivateFieldSet(this, _YargsInstance_completion, completion(this, __classPrivateFieldGet(this, _YargsInstance_usage, "f"), __classPrivateFieldGet(this, _YargsInstance_command, "f"), __classPrivateFieldGet(this, _YargsInstance_shim, "f")), "f");
4353
+ __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").reset();
4354
+ __classPrivateFieldSet(this, _YargsInstance_completionCommand, null, "f");
4355
+ __classPrivateFieldSet(this, _YargsInstance_output, "", "f");
4356
+ __classPrivateFieldSet(this, _YargsInstance_exitError, null, "f");
4357
+ __classPrivateFieldSet(this, _YargsInstance_hasOutput, false, "f");
4358
+ this.parsed = false;
4359
+ return this;
4360
+ }
4361
+ [kRebase](base, dir) {
4362
+ return __classPrivateFieldGet(this, _YargsInstance_shim, "f").path.relative(base, dir);
4363
+ }
4364
+ [kRunYargsParserAndExecuteCommands](args, shortCircuit, calledFromCommand, commandIndex = 0, helpOnly = false) {
4365
+ var _a$1, _b$1, _c$1, _d;
4366
+ let skipValidation = !!calledFromCommand || helpOnly;
4367
+ args = args || __classPrivateFieldGet(this, _YargsInstance_processArgs, "f");
4368
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").__ = __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.__;
4369
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration = this[kGetParserConfiguration]();
4370
+ const populateDoubleDash = !!__classPrivateFieldGet(this, _YargsInstance_options, "f").configuration["populate--"];
4371
+ const config = Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration, { "populate--": true });
4372
+ const parsed = __classPrivateFieldGet(this, _YargsInstance_shim, "f").Parser.detailed(args, Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f"), { configuration: {
4373
+ "parse-positional-numbers": false,
4374
+ ...config
4375
+ } }));
4376
+ const argv = Object.assign(parsed.argv, __classPrivateFieldGet(this, _YargsInstance_parseContext, "f"));
4377
+ let argvPromise = void 0;
4378
+ const aliases = parsed.aliases;
4379
+ let helpOptSet = false;
4380
+ let versionOptSet = false;
4381
+ Object.keys(argv).forEach((key) => {
4382
+ if (key === __classPrivateFieldGet(this, _YargsInstance_helpOpt, "f") && argv[key]) helpOptSet = true;
4383
+ else if (key === __classPrivateFieldGet(this, _YargsInstance_versionOpt, "f") && argv[key]) versionOptSet = true;
4384
+ });
4385
+ argv.$0 = this.$0;
4386
+ this.parsed = parsed;
4387
+ if (commandIndex === 0) __classPrivateFieldGet(this, _YargsInstance_usage, "f").clearCachedHelpMessage();
4388
+ try {
4389
+ this[kGuessLocale]();
4390
+ if (shortCircuit) return this[kPostProcess](argv, populateDoubleDash, !!calledFromCommand, false);
4391
+ if (__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")) {
4392
+ if ([__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")].concat(aliases[__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")] || []).filter((k) => k.length > 1).includes("" + argv._[argv._.length - 1])) {
4393
+ argv._.pop();
4394
+ helpOptSet = true;
4395
+ }
4396
+ }
4397
+ __classPrivateFieldSet(this, _YargsInstance_isGlobalContext, false, "f");
4398
+ const handlerKeys = __classPrivateFieldGet(this, _YargsInstance_command, "f").getCommands();
4399
+ const requestCompletions = ((_a$1 = __classPrivateFieldGet(this, _YargsInstance_completion, "f")) === null || _a$1 === void 0 ? void 0 : _a$1.completionKey) ? [(_b$1 = __classPrivateFieldGet(this, _YargsInstance_completion, "f")) === null || _b$1 === void 0 ? void 0 : _b$1.completionKey, ...(_d = this.getAliases()[(_c$1 = __classPrivateFieldGet(this, _YargsInstance_completion, "f")) === null || _c$1 === void 0 ? void 0 : _c$1.completionKey]) !== null && _d !== void 0 ? _d : []].some((key) => Object.prototype.hasOwnProperty.call(argv, key)) : false;
4400
+ const skipRecommendation = helpOptSet || requestCompletions || helpOnly;
4401
+ if (argv._.length) {
4402
+ if (handlerKeys.length) {
4403
+ let firstUnknownCommand;
4404
+ for (let i = commandIndex || 0, cmd; argv._[i] !== void 0; i++) {
4405
+ cmd = String(argv._[i]);
4406
+ if (handlerKeys.includes(cmd) && cmd !== __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f")) {
4407
+ const innerArgv = __classPrivateFieldGet(this, _YargsInstance_command, "f").runCommand(cmd, this, parsed, i + 1, helpOnly, helpOptSet || versionOptSet || helpOnly);
4408
+ return this[kPostProcess](innerArgv, populateDoubleDash, !!calledFromCommand, false);
4409
+ } else if (!firstUnknownCommand && cmd !== __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f")) {
4410
+ firstUnknownCommand = cmd;
4411
+ break;
4412
+ }
4413
+ }
4414
+ if (!__classPrivateFieldGet(this, _YargsInstance_command, "f").hasDefaultCommand() && __classPrivateFieldGet(this, _YargsInstance_recommendCommands, "f") && firstUnknownCommand && !skipRecommendation) __classPrivateFieldGet(this, _YargsInstance_validation, "f").recommendCommands(firstUnknownCommand, handlerKeys);
4415
+ }
4416
+ if (__classPrivateFieldGet(this, _YargsInstance_completionCommand, "f") && argv._.includes(__classPrivateFieldGet(this, _YargsInstance_completionCommand, "f")) && !requestCompletions) {
4417
+ if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f")) setBlocking(true);
4418
+ this.showCompletionScript();
4419
+ this.exit(0);
4420
+ }
4421
+ }
4422
+ if (__classPrivateFieldGet(this, _YargsInstance_command, "f").hasDefaultCommand() && !skipRecommendation) {
4423
+ const innerArgv = __classPrivateFieldGet(this, _YargsInstance_command, "f").runCommand(null, this, parsed, 0, helpOnly, helpOptSet || versionOptSet || helpOnly);
4424
+ return this[kPostProcess](innerArgv, populateDoubleDash, !!calledFromCommand, false);
4425
+ }
4426
+ if (requestCompletions) {
4427
+ if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f")) setBlocking(true);
4428
+ args = [].concat(args);
4429
+ const completionArgs = args.slice(args.indexOf(`--${__classPrivateFieldGet(this, _YargsInstance_completion, "f").completionKey}`) + 1);
4430
+ __classPrivateFieldGet(this, _YargsInstance_completion, "f").getCompletion(completionArgs, (err, completions) => {
4431
+ if (err) throw new YError(err.message);
4432
+ (completions || []).forEach((completion$1) => {
4433
+ __classPrivateFieldGet(this, _YargsInstance_logger, "f").log(completion$1);
4434
+ });
4435
+ this.exit(0);
4436
+ });
4437
+ return this[kPostProcess](argv, !populateDoubleDash, !!calledFromCommand, false);
4438
+ }
4439
+ if (!__classPrivateFieldGet(this, _YargsInstance_hasOutput, "f")) {
4440
+ if (helpOptSet) {
4441
+ if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f")) setBlocking(true);
4442
+ skipValidation = true;
4443
+ this.showHelp((message) => {
4444
+ __classPrivateFieldGet(this, _YargsInstance_logger, "f").log(message);
4445
+ this.exit(0);
4446
+ });
4447
+ } else if (versionOptSet) {
4448
+ if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f")) setBlocking(true);
4449
+ skipValidation = true;
4450
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").showVersion("log");
4451
+ this.exit(0);
4452
+ }
4453
+ }
4454
+ if (!skipValidation && __classPrivateFieldGet(this, _YargsInstance_options, "f").skipValidation.length > 0) skipValidation = Object.keys(argv).some((key) => __classPrivateFieldGet(this, _YargsInstance_options, "f").skipValidation.indexOf(key) >= 0 && argv[key] === true);
4455
+ if (!skipValidation) {
4456
+ if (parsed.error) throw new YError(parsed.error.message);
4457
+ if (!requestCompletions) {
4458
+ const validation$1 = this[kRunValidation](aliases, {}, parsed.error);
4459
+ if (!calledFromCommand) argvPromise = applyMiddleware(argv, this, __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").getMiddleware(), true);
4460
+ argvPromise = this[kValidateAsync](validation$1, argvPromise !== null && argvPromise !== void 0 ? argvPromise : argv);
4461
+ if (isPromise(argvPromise) && !calledFromCommand) argvPromise = argvPromise.then(() => {
4462
+ return applyMiddleware(argv, this, __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").getMiddleware(), false);
4463
+ });
4464
+ }
4465
+ }
4466
+ } catch (err) {
4467
+ if (err instanceof YError) __classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(err.message, err);
4468
+ else throw err;
4469
+ }
4470
+ return this[kPostProcess](argvPromise !== null && argvPromise !== void 0 ? argvPromise : argv, populateDoubleDash, !!calledFromCommand, true);
4471
+ }
4472
+ [kRunValidation](aliases, positionalMap, parseErrors, isDefaultCommand) {
4473
+ const demandedOptions = { ...this.getDemandedOptions() };
4474
+ return (argv) => {
4475
+ if (parseErrors) throw new YError(parseErrors.message);
4476
+ __classPrivateFieldGet(this, _YargsInstance_validation, "f").nonOptionCount(argv);
4477
+ __classPrivateFieldGet(this, _YargsInstance_validation, "f").requiredArguments(argv, demandedOptions);
4478
+ let failedStrictCommands = false;
4479
+ if (__classPrivateFieldGet(this, _YargsInstance_strictCommands, "f")) failedStrictCommands = __classPrivateFieldGet(this, _YargsInstance_validation, "f").unknownCommands(argv);
4480
+ if (__classPrivateFieldGet(this, _YargsInstance_strict, "f") && !failedStrictCommands) __classPrivateFieldGet(this, _YargsInstance_validation, "f").unknownArguments(argv, aliases, positionalMap, !!isDefaultCommand);
4481
+ else if (__classPrivateFieldGet(this, _YargsInstance_strictOptions, "f")) __classPrivateFieldGet(this, _YargsInstance_validation, "f").unknownArguments(argv, aliases, {}, false, false);
4482
+ __classPrivateFieldGet(this, _YargsInstance_validation, "f").limitedChoices(argv);
4483
+ __classPrivateFieldGet(this, _YargsInstance_validation, "f").implications(argv);
4484
+ __classPrivateFieldGet(this, _YargsInstance_validation, "f").conflicting(argv);
4485
+ };
4486
+ }
4487
+ [kSetHasOutput]() {
4488
+ __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f");
4489
+ }
4490
+ [kTrackManuallySetKeys](keys) {
4491
+ if (typeof keys === "string") __classPrivateFieldGet(this, _YargsInstance_options, "f").key[keys] = true;
4492
+ else for (const k of keys) __classPrivateFieldGet(this, _YargsInstance_options, "f").key[k] = true;
4493
+ }
4494
+ };
4495
+ function isYargsInstance(y) {
4496
+ return !!y && typeof y.getInternalMethods === "function";
4497
+ }
4498
+
4499
+ //#endregion
4500
+ //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/index.mjs
4501
+ const Yargs = YargsFactory(esm_default);
4502
+ var yargs_default = Yargs;
4503
+
4504
+ //#endregion
4505
+ //#region src/cli.ts
4506
+ const __dirname = dirname$1(fileURLToPath$1(import.meta.url));
4507
+ /**
4508
+ * Read version from package.json
4509
+ */
4510
+ function getVersion() {
4511
+ try {
4512
+ const pkgPath = join$1(__dirname, "..", "package.json");
4513
+ return JSON.parse(readFileSync$1(pkgPath, "utf-8")).version || "0.0.0";
4514
+ } catch {
4515
+ return "0.0.0";
4516
+ }
4517
+ }
4518
+ async function main() {
4519
+ const argv = await yargs_default(hideBin(process.argv)).scriptName("openspecui").usage("$0 [project-dir]", "Visual interface for spec-driven development").positional("project-dir", {
4520
+ describe: "Project directory containing openspec/",
4521
+ type: "string",
4522
+ default: process.cwd()
4523
+ }).option("port", {
4524
+ alias: "p",
4525
+ describe: "Port to run the server on",
4526
+ type: "number",
4527
+ default: 3100
4528
+ }).option("dir", {
4529
+ alias: "d",
4530
+ describe: "Project directory containing openspec/",
4531
+ type: "string",
4532
+ default: process.cwd()
4533
+ }).option("open", {
4534
+ describe: "Automatically open the browser",
4535
+ type: "boolean",
4536
+ default: true
4537
+ }).example("$0", "Start in current directory").example("$0 ./my-project", "Start with specific project").example("$0 -p 8080", "Start on custom port").example("$0 --no-open", "Start without opening browser").version(getVersion()).alias("v", "version").help().alias("h", "help").strict().parse();
4538
+ const projectDir = argv._[0]?.toString() || argv.dir;
51
4539
  console.log(`
52
4540
  ┌─────────────────────────────────────────────┐
53
4541
  │ OpenSpec UI │
54
4542
  │ Visual interface for spec-driven dev │
55
4543
  └─────────────────────────────────────────────┘
56
4544
  `);
57
- console.log(`📁 Project: ${args.projectDir}`);
58
- console.log(`🔌 Port: ${args.port}`);
4545
+ console.log(`📁 Project: ${projectDir}`);
4546
+ console.log(`🔌 Port: ${argv.port}`);
59
4547
  console.log("");
60
4548
  try {
61
4549
  const server = await startServer({
62
- projectDir: args.projectDir,
63
- port: args.port,
64
- open: args.open
4550
+ projectDir,
4551
+ port: argv.port,
4552
+ open: argv.open
65
4553
  });
66
4554
  console.log(`✅ Server running at ${server.url}`);
67
4555
  console.log("");
68
- if (args.open) {
4556
+ if (argv.open) {
69
4557
  await (await import("./open-CmiqsyCQ.mjs")).default(server.url);
70
4558
  console.log("🌐 Browser opened");
71
4559
  }