void 0.10.5 → 0.10.6

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 (217) hide show
  1. package/dist/agents-Bmr5tFFb.mjs +1454 -0
  2. package/dist/{auth-cmd-UoCwfDQv.mjs → auth-cmd-DlgNwByu.mjs} +10 -10
  3. package/dist/{better-auth-shared-D0Mbmx5V.mjs → better-auth-shared-BQooDxbw.mjs} +1 -1
  4. package/dist/{better-auth-shared-jkksALri.d.mts → better-auth-shared-BvnM9px6.d.mts} +2 -2
  5. package/dist/{build-cmd-CVyuBHjP.mjs → build-cmd-Br8qL0rA.mjs} +15 -17
  6. package/dist/{cache-ACORQCIq.mjs → cache-wH-mP8UE.mjs} +10 -12
  7. package/dist/{cancel-deploy-Gi8zmoZC.mjs → cancel-deploy-BEBOEgtu.mjs} +16 -18
  8. package/dist/cli/cli.mjs +47 -49
  9. package/dist/{client-BlbnA92X.mjs → client-Cj96iiBH.mjs} +74 -8
  10. package/dist/{config-8dLIngKW.mjs → config-1twldYCW.mjs} +10 -10
  11. package/dist/{config-CbJS4Krx.mjs → config-BdUctCZD.mjs} +4 -4
  12. package/dist/{create-project-LjvkYziS.mjs → create-project-DD9n8Ho-.mjs} +28 -23
  13. package/dist/{db-C00yjN01.mjs → db-DjKE2-A-.mjs} +147 -149
  14. package/dist/{delete-CplfvTgU.mjs → delete-D2kr3Kmk.mjs} +13 -15
  15. package/dist/{deploy-CISNL5uK.mjs → deploy-C4PbkFyE.mjs} +97 -100
  16. package/dist/{discover-ZWuBvt22.mjs → discover-BuVVSAum.mjs} +3 -3
  17. package/dist/{dist-5cGIJHQQ.mjs → dist-BuiRJkTd.mjs} +59 -27
  18. package/dist/{domain-B4HpcgNG.mjs → domain-_luIsM_B.mjs} +14 -16
  19. package/dist/{env-DNMJpeVF.mjs → env-CO5XAS9t.mjs} +23 -25
  20. package/dist/{env-helpers-B_ks681T.d.mts → env-helpers-z4stu8uc.d.mts} +1 -1
  21. package/dist/{env-types-BS8cZead.mjs → env-types-D51bnR-c.mjs} +3 -3
  22. package/dist/{env-validation-BxbtBbjh.mjs → env-validation-CeC2FL66.mjs} +4 -4
  23. package/dist/{fetch-error-C6qffTl2.mjs → fetch-error-Dj3crt0e.mjs} +3 -3
  24. package/dist/{gen-C0pV2gRQ.mjs → gen-Cf79J4aw.mjs} +42 -44
  25. package/dist/{github-cmd-CwtLD1yI.mjs → github-cmd-DnqxyOsb.mjs} +88 -90
  26. package/dist/{handler-B7rCOy21.d.mts → handler-imD0UVDT.d.mts} +4 -5
  27. package/dist/{headers-BNWymgnH.mjs → headers-BwvFGhkx.mjs} +3 -3
  28. package/dist/index.d.mts +3 -3
  29. package/dist/index.mjs +102 -83
  30. package/dist/{init-D58GxCtt.mjs → init-KirOzVDs.mjs} +132 -134
  31. package/dist/link-CUmiosyb.mjs +45 -0
  32. package/dist/{list-CbNNjXTm.mjs → list-3GEw7b6m.mjs} +10 -12
  33. package/dist/{login-CvxxF_9z.mjs → login-DJReaT_Q.mjs} +14 -15
  34. package/dist/{logs-BDZ9AuhM.mjs → logs-D-rQ56Lq.mjs} +9 -11
  35. package/dist/{magic-string.es-C1Fb0uxq.mjs → magic-string.es-ZQjdJFFn.mjs} +3 -3
  36. package/dist/{mcp-C8BjRt_z.mjs → mcp-D7yc0dXY.mjs} +2 -3
  37. package/dist/{node-B07cZs0d.mjs → node-yFFk626c.mjs} +6 -6
  38. package/dist/{package-json-Bg_GJdJB.mjs → package-json-B0NuUWGd.mjs} +1 -1
  39. package/dist/pages/client.d.mts +1 -1
  40. package/dist/pages/client.mjs +2 -1
  41. package/dist/pages/head-client.d.mts +1 -1
  42. package/dist/pages/head.d.mts +1 -1
  43. package/dist/pages/index.d.mts +2 -2
  44. package/dist/pages/index.mjs +5 -5
  45. package/dist/pages/islands-plugin.d.mts +1 -1
  46. package/dist/pages/islands-plugin.mjs +3 -3
  47. package/dist/pages/protocol.d.mts +2 -2
  48. package/dist/pages/protocol.mjs +5 -2
  49. package/dist/{plugin-inference-D04iL1mW.mjs → plugin-inference-CJxi_fWI.mjs} +3 -3
  50. package/dist/{prepare-DUo9q8cM.mjs → prepare-C_cVurhP.mjs} +15 -18
  51. package/dist/{preset-D0My64KQ.mjs → preset-CVvwCeIy.mjs} +4 -4
  52. package/dist/{project-cmd-Dd1gNRdd.mjs → project-cmd-DnU7u9QF.mjs} +13 -14
  53. package/dist/{project-paths-CCMrHYQm.mjs → project-paths-tpdR1mJR.mjs} +2 -2
  54. package/dist/{project-tsconfig-DMBV55K2.mjs → project-tsconfig-D9uSVVpA.mjs} +2 -2
  55. package/dist/{protocol-6UZCowS1.d.mts → protocol-6hTJ04T1.d.mts} +3 -3
  56. package/dist/{resolve-project-D4O1_fZz.mjs → resolve-project-D2HI3TrG.mjs} +2 -2
  57. package/dist/{rollback-DzmCCrFg.mjs → rollback-Yh7bCKob.mjs} +21 -23
  58. package/dist/{route-types-BpSJEW20.mjs → route-types-CfKfhbIg.mjs} +234 -3
  59. package/dist/{runner-BQyKUqAL.mjs → runner-h272wcPj.mjs} +4 -5
  60. package/dist/{runner-pg-EuhrFW3D.mjs → runner-pg-waxJOnBb.mjs} +1 -1
  61. package/dist/runtime/ai.mjs +2 -2
  62. package/dist/runtime/auth.d.mts +1 -1
  63. package/dist/runtime/better-auth-pg.d.mts +1 -1
  64. package/dist/runtime/better-auth-pg.mjs +3 -3
  65. package/dist/runtime/better-auth.d.mts +1 -1
  66. package/dist/runtime/better-auth.mjs +2 -2
  67. package/dist/runtime/client-react.d.mts +2 -2
  68. package/dist/runtime/client-react.mjs +1 -1
  69. package/dist/runtime/client-solid.d.mts +2 -2
  70. package/dist/runtime/client-solid.mjs +1 -1
  71. package/dist/runtime/client-svelte.d.mts +2 -2
  72. package/dist/runtime/client-svelte.mjs +1 -1
  73. package/dist/runtime/client-vue.d.mts +2 -2
  74. package/dist/runtime/client-vue.mjs +1 -1
  75. package/dist/runtime/client.d.mts +2 -2
  76. package/dist/runtime/client.mjs +1 -1
  77. package/dist/runtime/db-pg.d.mts +1 -1
  78. package/dist/runtime/env-helpers.d.mts +1 -1
  79. package/dist/runtime/env-public-client.d.mts +1 -1
  80. package/dist/runtime/env-public-client.mjs +2 -0
  81. package/dist/runtime/env-public.d.mts +3 -4
  82. package/dist/runtime/env-public.mjs +3 -1
  83. package/dist/runtime/env.mjs +1 -1
  84. package/dist/runtime/fetch-stream.d.mts +1 -1
  85. package/dist/runtime/fetch-stream.mjs +1 -1
  86. package/dist/runtime/fetch.d.mts +1 -1
  87. package/dist/runtime/fetch.mjs +1 -1
  88. package/dist/runtime/handler.d.mts +2 -2
  89. package/dist/runtime/handler.mjs +1 -1
  90. package/dist/runtime/isr.mjs +1 -1
  91. package/dist/runtime/live-server.mjs +2 -0
  92. package/dist/runtime/live.d.mts +2 -2
  93. package/dist/runtime/live.mjs +3 -1
  94. package/dist/runtime/migration-handler-pg.mjs +1 -1
  95. package/dist/runtime/migration-handler.mjs +1 -1
  96. package/dist/runtime/remote/index.mjs +11 -1
  97. package/dist/runtime/sandbox.d.mts +1 -4
  98. package/dist/runtime/sandbox.mjs +1 -1
  99. package/dist/runtime/validator.d.mts +1 -1
  100. package/dist/runtime/ws-server.d.mts +2 -2
  101. package/dist/runtime/ws-server.mjs +2 -0
  102. package/dist/runtime/ws.d.mts +3 -3
  103. package/dist/runtime/ws.mjs +2 -0
  104. package/dist/{scan-VCAM1oh3.mjs → scan-Dp_Gyzs3.mjs} +3 -3
  105. package/dist/{scan---8wfN58.mjs → scan-i7Yz54fv.mjs} +26 -8
  106. package/dist/{secret-CMLYWkE-.mjs → secret-u7FRvg8d.mjs} +22 -24
  107. package/dist/{skills-Dl3u05da.mjs → skills-DsdNDtX3.mjs} +6 -7
  108. package/dist/{subcommand-prompt-B8ng0FTS.mjs → subcommand-prompt-DtES-oP6.mjs} +34 -35
  109. package/dist/sveltekit.mjs +1 -1
  110. package/dist/validate-DT7nFMlf.mjs +504 -0
  111. package/dist/{yarn-pnp-WLW2IHUY.mjs → yarn-pnp-CW8LB6g_.mjs} +1 -1
  112. package/package.json +19 -19
  113. package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/CHANGELOG.md +94 -0
  114. package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/README.md +32 -11
  115. package/skills/void/docs/node_modules/void/node_modules/@cloudflare/sandbox/README.md +45 -0
  116. package/skills/void/docs/node_modules/void/node_modules/@electric-sql/pglite/README.md +5 -5
  117. package/skills/void/docs/node_modules/void/node_modules/@types/node/README.md +1 -1
  118. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@types/node/README.md +1 -1
  119. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-exit/README.md +4 -1
  120. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-attrs/README.md +29 -12
  121. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/tinyglobby/README.md +1 -1
  122. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/AGENTS.md +1 -0
  123. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/README.md +18 -6
  124. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/build.md +1 -1
  125. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/check.md +35 -0
  126. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/create.md +70 -0
  127. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/fmt.md +3 -1
  128. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/index.md +11 -7
  129. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/lint.md +3 -1
  130. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/pack.md +1 -1
  131. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/run.md +141 -26
  132. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/staged.md +1 -1
  133. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/test.md +1 -1
  134. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/automatic-data-tracking.md +145 -0
  135. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/cache.md +16 -28
  136. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/check.md +16 -0
  137. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/ci.md +15 -17
  138. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/commit-hooks.md +9 -0
  139. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/create.md +255 -2
  140. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/docker.md +175 -0
  141. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/env.md +70 -5
  142. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/github-actions-cache.md +165 -0
  143. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/ide-integration.md +2 -2
  144. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/index.md +9 -3
  145. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/install.md +63 -11
  146. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/migrate-rules.md +347 -0
  147. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/migrate.md +27 -3
  148. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/monorepo.md +176 -0
  149. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/pack.md +8 -0
  150. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/run.md +36 -4
  151. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/troubleshooting.md +11 -35
  152. package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/upgrade.md +65 -13
  153. package/skills/void/docs/node_modules/void/node_modules/es-module-lexer/README.md +403 -390
  154. package/skills/void/docs/node_modules/void/node_modules/pg/README.md +2 -1
  155. package/skills/void/docs/node_modules/void/node_modules/tinyglobby/README.md +1 -1
  156. package/skills/void/docs/node_modules/void/node_modules/vite-plus/AGENTS.md +1 -0
  157. package/skills/void/docs/node_modules/void/node_modules/vite-plus/README.md +18 -6
  158. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/build.md +1 -1
  159. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/check.md +35 -0
  160. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/create.md +70 -0
  161. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/fmt.md +3 -1
  162. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/index.md +11 -7
  163. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/lint.md +3 -1
  164. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/pack.md +1 -1
  165. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/run.md +141 -26
  166. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/staged.md +1 -1
  167. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/test.md +1 -1
  168. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/automatic-data-tracking.md +145 -0
  169. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/cache.md +16 -28
  170. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/check.md +16 -0
  171. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/ci.md +15 -17
  172. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/commit-hooks.md +9 -0
  173. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/create.md +255 -2
  174. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/docker.md +175 -0
  175. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/env.md +70 -5
  176. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/github-actions-cache.md +165 -0
  177. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/ide-integration.md +2 -2
  178. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/index.md +9 -3
  179. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/install.md +63 -11
  180. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/migrate-rules.md +347 -0
  181. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/migrate.md +27 -3
  182. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/monorepo.md +176 -0
  183. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/pack.md +8 -0
  184. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/run.md +36 -4
  185. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/troubleshooting.md +11 -35
  186. package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/upgrade.md +65 -13
  187. package/skills/void/docs/reference/cli.md +5 -1
  188. package/dist/agents-MhSzNMiC.mjs +0 -151
  189. package/dist/collect-9rO3JFNM.mjs +0 -55
  190. package/dist/config-hhMYPVRT.mjs +0 -21
  191. package/dist/dist-abzUneor.mjs +0 -1287
  192. package/dist/drizzle-DqstQTGq.mjs +0 -232
  193. package/dist/link-ZFmboqY3.mjs +0 -47
  194. package/dist/output-DeiS4oEX.mjs +0 -139
  195. package/dist/plan-aD3wRDqF.mjs +0 -271
  196. package/dist/project-CH9pdo16.mjs +0 -72
  197. package/dist/project-slug-rX3kTOfY.mjs +0 -10
  198. package/dist/validate-CNWm-PsL.mjs +0 -186
  199. /package/dist/{auth-migrations-BP-hMzYl.mjs → auth-migrations-BTZ-ATvQ.mjs} +0 -0
  200. /package/dist/{auth-Dz2CCn4T.d.mts → auth-qgMlYp7Z.d.mts} +0 -0
  201. /package/dist/{canonical-json-CEyQaVDa.mjs → canonical-json-DuDiiUsQ.mjs} +0 -0
  202. /package/dist/{cf-access-DKDsgwOU.mjs → cf-access-Bqw81xAf.mjs} +0 -0
  203. /package/dist/{defer-C-bdSM_b.mjs → defer-YsYDUoii.mjs} +0 -0
  204. /package/dist/{dotenv-lS94ymhM.mjs → dotenv-D_UbC_vc.mjs} +0 -0
  205. /package/dist/{env-raw-Dtj1UAoK.mjs → env-raw-CoS20LHP.mjs} +0 -0
  206. /package/dist/{fetch-error-B6RaJ-eZ.d.mts → fetch-error-Sp1R4mZv.d.mts} +0 -0
  207. /package/dist/{git-metadata-Ce0AtSZL.mjs → git-metadata-CBKaL0v5.mjs} +0 -0
  208. /package/dist/{head-eOUCWUNy.d.mts → head-nmvOgFjd.d.mts} +0 -0
  209. /package/dist/{log-BdD_Fpms.mjs → log-ChfPKsVd.mjs} +0 -0
  210. /package/dist/{pathe.M-eThtNZ-BrPhGF_K.mjs → pathe.M-eThtNZ-CQzLbt4c.mjs} +0 -0
  211. /package/dist/{pg-CempqvEJ.mjs → pg-J2HbZIkX.mjs} +0 -0
  212. /package/dist/{providers-BJIoduK9.d.mts → providers-BNKRacMr.d.mts} +0 -0
  213. /package/dist/{providers-BwPbdHdi.mjs → providers-CJlNS3kT.mjs} +0 -0
  214. /package/dist/{proxy-M3pxItg2.mjs → proxy-D-3_D-Gl.mjs} +0 -0
  215. /package/dist/{chunk-DJd-R1mw.mjs → rolldown-runtime-DJK8HYOj.mjs} +0 -0
  216. /package/dist/{standard-schema-Cy0lfeWv.d.mts → standard-schema-DJ0HW7QP.d.mts} +0 -0
  217. /package/dist/{types-BodZGegX.d.mts → types-lLjNE9Qp.d.mts} +0 -0
@@ -1,1287 +0,0 @@
1
- import { n as __exportAll, t as __commonJSMin } from "./chunk-DJd-R1mw.mjs";
2
- import "node:fs";
3
- import { stripVTControlCharacters, styleText } from "node:util";
4
- import j, { stdin, stdout } from "node:process";
5
- import * as b from "node:readline";
6
- import E from "node:readline";
7
- import { ReadStream } from "node:tty";
8
- import "node:path";
9
- //#region ../../node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
10
- const getCodePointsLength = (() => {
11
- const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
12
- return (input) => {
13
- let surrogatePairsNr = 0;
14
- SURROGATE_PAIR_RE.lastIndex = 0;
15
- while (SURROGATE_PAIR_RE.test(input)) surrogatePairsNr += 1;
16
- return input.length - surrogatePairsNr;
17
- };
18
- })();
19
- const isFullWidth = (x) => {
20
- return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
21
- };
22
- const isWideNotCJKTNotEmoji = (x) => {
23
- return x === 8987 || x === 9001 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
24
- };
25
- //#endregion
26
- //#region ../../node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js
27
- const ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
28
- const CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
29
- const CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy;
30
- const TAB_RE = /\t{1,1000}/y;
31
- const EMOJI_RE = /[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy;
32
- const LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
33
- const MODIFIER_RE = /\p{M}+/gu;
34
- const NO_TRUNCATION$1 = {
35
- limit: Infinity,
36
- ellipsis: ""
37
- };
38
- const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {}) => {
39
- const LIMIT = truncationOptions.limit ?? Infinity;
40
- const ELLIPSIS = truncationOptions.ellipsis ?? "";
41
- const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION$1, widthOptions).width : 0);
42
- const ANSI_WIDTH = 0;
43
- const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
44
- const TAB_WIDTH = widthOptions.tabWidth ?? 8;
45
- const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
46
- const FULL_WIDTH_WIDTH = 2;
47
- const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
48
- const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
49
- const PARSE_BLOCKS = [
50
- [LATIN_RE, REGULAR_WIDTH],
51
- [ANSI_RE, ANSI_WIDTH],
52
- [CONTROL_RE, CONTROL_WIDTH],
53
- [TAB_RE, TAB_WIDTH],
54
- [EMOJI_RE, EMOJI_WIDTH],
55
- [CJKT_WIDE_RE, WIDE_WIDTH]
56
- ];
57
- let indexPrev = 0;
58
- let index = 0;
59
- let length = input.length;
60
- let lengthExtra = 0;
61
- let truncationEnabled = false;
62
- let truncationIndex = length;
63
- let truncationLimit = Math.max(0, LIMIT - ELLIPSIS_WIDTH);
64
- let unmatchedStart = 0;
65
- let unmatchedEnd = 0;
66
- let width = 0;
67
- let widthExtra = 0;
68
- outer: while (true) {
69
- if (unmatchedEnd > unmatchedStart || index >= length && index > indexPrev) {
70
- const unmatched = input.slice(unmatchedStart, unmatchedEnd) || input.slice(indexPrev, index);
71
- lengthExtra = 0;
72
- for (const char of unmatched.replaceAll(MODIFIER_RE, "")) {
73
- const codePoint = char.codePointAt(0) || 0;
74
- if (isFullWidth(codePoint)) widthExtra = FULL_WIDTH_WIDTH;
75
- else if (isWideNotCJKTNotEmoji(codePoint)) widthExtra = WIDE_WIDTH;
76
- else widthExtra = REGULAR_WIDTH;
77
- if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);
78
- if (width + widthExtra > LIMIT) {
79
- truncationEnabled = true;
80
- break outer;
81
- }
82
- lengthExtra += char.length;
83
- width += widthExtra;
84
- }
85
- unmatchedStart = unmatchedEnd = 0;
86
- }
87
- if (index >= length) break outer;
88
- for (let i = 0, l = PARSE_BLOCKS.length; i < l; i++) {
89
- const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i];
90
- BLOCK_RE.lastIndex = index;
91
- if (BLOCK_RE.test(input)) {
92
- lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
93
- widthExtra = lengthExtra * BLOCK_WIDTH;
94
- if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
95
- if (width + widthExtra > LIMIT) {
96
- truncationEnabled = true;
97
- break outer;
98
- }
99
- width += widthExtra;
100
- unmatchedStart = indexPrev;
101
- unmatchedEnd = index;
102
- index = indexPrev = BLOCK_RE.lastIndex;
103
- continue outer;
104
- }
105
- }
106
- index += 1;
107
- }
108
- return {
109
- width: truncationEnabled ? truncationLimit : width,
110
- index: truncationEnabled ? truncationIndex : length,
111
- truncated: truncationEnabled,
112
- ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH
113
- };
114
- };
115
- //#endregion
116
- //#region ../../node_modules/.pnpm/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js
117
- const NO_TRUNCATION = {
118
- limit: Infinity,
119
- ellipsis: "",
120
- ellipsisWidth: 0
121
- };
122
- const fastStringWidth = (input, options = {}) => {
123
- return getStringTruncatedWidth(input, NO_TRUNCATION, options).width;
124
- };
125
- //#endregion
126
- //#region ../../node_modules/.pnpm/fast-wrap-ansi@0.2.0/node_modules/fast-wrap-ansi/lib/main.js
127
- const ESC = "\x1B";
128
- const CSI = "›";
129
- const END_CODE = 39;
130
- const ANSI_ESCAPE_BELL = "\x07";
131
- const ANSI_CSI = "[";
132
- const ANSI_OSC = "]";
133
- const ANSI_SGR_TERMINATOR = "m";
134
- const ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
135
- const GROUP_REGEX = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`, "y");
136
- const getClosingCode = (openingCode) => {
137
- if (openingCode >= 30 && openingCode <= 37) return 39;
138
- if (openingCode >= 90 && openingCode <= 97) return 39;
139
- if (openingCode >= 40 && openingCode <= 47) return 49;
140
- if (openingCode >= 100 && openingCode <= 107) return 49;
141
- if (openingCode === 1 || openingCode === 2) return 22;
142
- if (openingCode === 3) return 23;
143
- if (openingCode === 4) return 24;
144
- if (openingCode === 7) return 27;
145
- if (openingCode === 8) return 28;
146
- if (openingCode === 9) return 29;
147
- if (openingCode === 0) return 0;
148
- };
149
- const wrapAnsiCode = (code) => `${ESC}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
150
- const wrapAnsiHyperlink = (url) => `${ESC}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
151
- const wrapWord = (rows, word, columns) => {
152
- const characters = word[Symbol.iterator]();
153
- let isInsideEscape = false;
154
- let isInsideLinkEscape = false;
155
- let lastRow = rows.at(-1);
156
- let visible = lastRow === void 0 ? 0 : fastStringWidth(lastRow);
157
- let currentCharacter = characters.next();
158
- let nextCharacter = characters.next();
159
- let rawCharacterIndex = 0;
160
- while (!currentCharacter.done) {
161
- const character = currentCharacter.value;
162
- const characterLength = fastStringWidth(character);
163
- if (visible + characterLength <= columns) rows[rows.length - 1] += character;
164
- else {
165
- rows.push(character);
166
- visible = 0;
167
- }
168
- if (character === ESC || character === CSI) {
169
- isInsideEscape = true;
170
- isInsideLinkEscape = word.startsWith(ANSI_ESCAPE_LINK, rawCharacterIndex + 1);
171
- }
172
- if (isInsideEscape) {
173
- if (isInsideLinkEscape) {
174
- if (character === ANSI_ESCAPE_BELL) {
175
- isInsideEscape = false;
176
- isInsideLinkEscape = false;
177
- }
178
- } else if (character === ANSI_SGR_TERMINATOR) isInsideEscape = false;
179
- } else {
180
- visible += characterLength;
181
- if (visible === columns && !nextCharacter.done) {
182
- rows.push("");
183
- visible = 0;
184
- }
185
- }
186
- currentCharacter = nextCharacter;
187
- nextCharacter = characters.next();
188
- rawCharacterIndex += character.length;
189
- }
190
- lastRow = rows.at(-1);
191
- if (!visible && lastRow !== void 0 && lastRow.length && rows.length > 1) rows[rows.length - 2] += rows.pop();
192
- };
193
- const stringVisibleTrimSpacesRight = (string) => {
194
- const words = string.split(" ");
195
- let last = words.length;
196
- while (last) {
197
- if (fastStringWidth(words[last - 1])) break;
198
- last--;
199
- }
200
- if (last === words.length) return string;
201
- return words.slice(0, last).join(" ") + words.slice(last).join("");
202
- };
203
- const exec = (string, columns, options = {}) => {
204
- if (options.trim !== false && string.trim() === "") return "";
205
- let returnValue = "";
206
- let escapeCode;
207
- let escapeUrl;
208
- const words = string.split(" ");
209
- let rows = [""];
210
- let rowLength = 0;
211
- for (let index = 0; index < words.length; index++) {
212
- const word = words[index];
213
- if (options.trim !== false) {
214
- const row = rows.at(-1) ?? "";
215
- const trimmed = row.trimStart();
216
- if (row.length !== trimmed.length) {
217
- rows[rows.length - 1] = trimmed;
218
- rowLength = fastStringWidth(trimmed);
219
- }
220
- }
221
- if (index !== 0) {
222
- if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
223
- rows.push("");
224
- rowLength = 0;
225
- }
226
- if (rowLength || options.trim === false) {
227
- rows[rows.length - 1] += " ";
228
- rowLength++;
229
- }
230
- }
231
- const wordLength = fastStringWidth(word);
232
- if (options.hard && wordLength > columns) {
233
- const remainingColumns = columns - rowLength;
234
- const breaksStartingThisLine = 1 + Math.floor((wordLength - remainingColumns - 1) / columns);
235
- if (Math.floor((wordLength - 1) / columns) < breaksStartingThisLine) rows.push("");
236
- wrapWord(rows, word, columns);
237
- rowLength = fastStringWidth(rows.at(-1) ?? "");
238
- continue;
239
- }
240
- if (rowLength + wordLength > columns && rowLength && wordLength) {
241
- if (options.wordWrap === false && rowLength < columns) {
242
- wrapWord(rows, word, columns);
243
- rowLength = fastStringWidth(rows.at(-1) ?? "");
244
- continue;
245
- }
246
- rows.push("");
247
- rowLength = 0;
248
- }
249
- if (rowLength + wordLength > columns && options.wordWrap === false) {
250
- wrapWord(rows, word, columns);
251
- rowLength = fastStringWidth(rows.at(-1) ?? "");
252
- continue;
253
- }
254
- rows[rows.length - 1] += word;
255
- rowLength += wordLength;
256
- }
257
- if (options.trim !== false) rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
258
- const preString = rows.join("\n");
259
- let inSurrogate = false;
260
- for (let i = 0; i < preString.length; i++) {
261
- const character = preString[i];
262
- returnValue += character;
263
- if (!inSurrogate) {
264
- inSurrogate = character >= "\ud800" && character <= "\udbff";
265
- if (inSurrogate) continue;
266
- } else inSurrogate = false;
267
- if (character === ESC || character === CSI) {
268
- GROUP_REGEX.lastIndex = i + 1;
269
- const groups = GROUP_REGEX.exec(preString)?.groups;
270
- if (groups?.code !== void 0) {
271
- const code = Number.parseFloat(groups.code);
272
- escapeCode = code === END_CODE ? void 0 : code;
273
- } else if (groups?.uri !== void 0) escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
274
- }
275
- if (preString[i + 1] === "\n") {
276
- if (escapeUrl) returnValue += wrapAnsiHyperlink("");
277
- const closingCode = escapeCode ? getClosingCode(escapeCode) : void 0;
278
- if (escapeCode && closingCode) returnValue += wrapAnsiCode(closingCode);
279
- } else if (character === "\n") {
280
- if (escapeCode && getClosingCode(escapeCode)) returnValue += wrapAnsiCode(escapeCode);
281
- if (escapeUrl) returnValue += wrapAnsiHyperlink(escapeUrl);
282
- }
283
- }
284
- return returnValue;
285
- };
286
- const CRLF_OR_LF = /\r?\n/;
287
- function wrapAnsi(string, columns, options) {
288
- return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
289
- }
290
- //#endregion
291
- //#region ../../node_modules/.pnpm/@clack+core@1.3.0/node_modules/@clack/core/dist/index.mjs
292
- var import_src = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
293
- const ESC = "\x1B";
294
- const CSI = `${ESC}[`;
295
- const beep = "\x07";
296
- const cursor = {
297
- to(x, y) {
298
- if (!y) return `${CSI}${x + 1}G`;
299
- return `${CSI}${y + 1};${x + 1}H`;
300
- },
301
- move(x, y) {
302
- let ret = "";
303
- if (x < 0) ret += `${CSI}${-x}D`;
304
- else if (x > 0) ret += `${CSI}${x}C`;
305
- if (y < 0) ret += `${CSI}${-y}A`;
306
- else if (y > 0) ret += `${CSI}${y}B`;
307
- return ret;
308
- },
309
- up: (count = 1) => `${CSI}${count}A`,
310
- down: (count = 1) => `${CSI}${count}B`,
311
- forward: (count = 1) => `${CSI}${count}C`,
312
- backward: (count = 1) => `${CSI}${count}D`,
313
- nextLine: (count = 1) => `${CSI}E`.repeat(count),
314
- prevLine: (count = 1) => `${CSI}F`.repeat(count),
315
- left: `${CSI}G`,
316
- hide: `${CSI}?25l`,
317
- show: `${CSI}?25h`,
318
- save: `${ESC}7`,
319
- restore: `${ESC}8`
320
- };
321
- module.exports = {
322
- cursor,
323
- scroll: {
324
- up: (count = 1) => `${CSI}S`.repeat(count),
325
- down: (count = 1) => `${CSI}T`.repeat(count)
326
- },
327
- erase: {
328
- screen: `${CSI}2J`,
329
- up: (count = 1) => `${CSI}1J`.repeat(count),
330
- down: (count = 1) => `${CSI}J`.repeat(count),
331
- line: `${CSI}2K`,
332
- lineEnd: `${CSI}K`,
333
- lineStart: `${CSI}1K`,
334
- lines(count) {
335
- let clear = "";
336
- for (let i = 0; i < count; i++) clear += this.line + (i < count - 1 ? cursor.up() : "");
337
- if (count) clear += cursor.left;
338
- return clear;
339
- }
340
- },
341
- beep
342
- };
343
- })))();
344
- function d(r, t, s) {
345
- if (!s.some((o) => !o.disabled)) return r;
346
- const e = r + t, i = Math.max(s.length - 1, 0), n = e < 0 ? i : e > i ? 0 : e;
347
- return s[n].disabled ? d(n, t < 0 ? -1 : 1, s) : n;
348
- }
349
- const h = {
350
- actions: new Set([
351
- "up",
352
- "down",
353
- "left",
354
- "right",
355
- "space",
356
- "enter",
357
- "cancel"
358
- ]),
359
- aliases: new Map([
360
- ["k", "up"],
361
- ["j", "down"],
362
- ["h", "left"],
363
- ["l", "right"],
364
- ["", "cancel"],
365
- ["escape", "cancel"]
366
- ]),
367
- messages: {
368
- cancel: "Canceled",
369
- error: "Something went wrong"
370
- },
371
- withGuide: !0,
372
- date: {
373
- monthNames: [...[
374
- "January",
375
- "February",
376
- "March",
377
- "April",
378
- "May",
379
- "June",
380
- "July",
381
- "August",
382
- "September",
383
- "October",
384
- "November",
385
- "December"
386
- ]],
387
- messages: {
388
- required: "Please enter a valid date",
389
- invalidMonth: "There are only 12 months in a year",
390
- invalidDay: (r, t) => `There are only ${r} days in ${t}`,
391
- afterMin: (r) => `Date must be on or after ${r.toISOString().slice(0, 10)}`,
392
- beforeMax: (r) => `Date must be on or before ${r.toISOString().slice(0, 10)}`
393
- }
394
- }
395
- };
396
- function C(r, t) {
397
- if (typeof r == "string") return h.aliases.get(r) === t;
398
- for (const s of r) if (s !== void 0 && C(s, t)) return !0;
399
- return !1;
400
- }
401
- function z$1(r, t) {
402
- if (r === t) return;
403
- const s = r.split(`
404
- `), e = t.split(`
405
- `), i = Math.max(s.length, e.length), n = [];
406
- for (let o = 0; o < i; o++) s[o] !== e[o] && n.push(o);
407
- return {
408
- lines: n,
409
- numLinesBefore: s.length,
410
- numLinesAfter: e.length,
411
- numLines: i
412
- };
413
- }
414
- const Y$1 = globalThis.process.platform.startsWith("win"), k = Symbol("clack:cancel");
415
- function q(r) {
416
- return r === k;
417
- }
418
- function w$1(r, t) {
419
- const s = r;
420
- s.isTTY && s.setRawMode(t);
421
- }
422
- function R$1({ input: r = stdin, output: t = stdout, overwrite: s = !0, hideCursor: e = !0 } = {}) {
423
- const i = b.createInterface({
424
- input: r,
425
- output: t,
426
- prompt: "",
427
- tabSize: 1
428
- });
429
- b.emitKeypressEvents(r, i), r instanceof ReadStream && r.isTTY && r.setRawMode(!0);
430
- const n = (o, { name: u, sequence: a }) => {
431
- if (C([
432
- String(o),
433
- u,
434
- a
435
- ], "cancel")) {
436
- e && t.write(import_src.cursor.show), process.exit(0);
437
- return;
438
- }
439
- if (!s) return;
440
- const f = u === "return" ? 0 : -1, y = u === "return" ? -1 : 0;
441
- b.moveCursor(t, f, y, () => {
442
- b.clearLine(t, 1, () => {
443
- r.once("keypress", n);
444
- });
445
- });
446
- };
447
- return e && t.write(import_src.cursor.hide), r.once("keypress", n), () => {
448
- r.off("keypress", n), e && t.write(import_src.cursor.show), r instanceof ReadStream && r.isTTY && !Y$1 && r.setRawMode(!1), i.terminal = !1, i.close();
449
- };
450
- }
451
- const A = (r) => "columns" in r && typeof r.columns == "number" ? r.columns : 80, L = (r) => "rows" in r && typeof r.rows == "number" ? r.rows : 20;
452
- function W(r, t, s, e = s, i) {
453
- return wrapAnsi(t, A(r ?? stdout) - s.length, {
454
- hard: !0,
455
- trim: !1
456
- }).split(`
457
- `).map((o, u) => {
458
- const a = i ? i(o, u) : o;
459
- return `${u === 0 ? e : s}${a}`;
460
- }).join(`
461
- `);
462
- }
463
- let p = class {
464
- input;
465
- output;
466
- _abortSignal;
467
- rl;
468
- opts;
469
- _render;
470
- _track = !1;
471
- _prevFrame = "";
472
- _subscribers = /* @__PURE__ */ new Map();
473
- _cursor = 0;
474
- state = "initial";
475
- error = "";
476
- value;
477
- userInput = "";
478
- constructor(t, s = !0) {
479
- const { input: e = stdin, output: i = stdout, render: n, signal: o, ...u } = t;
480
- this.opts = u, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = n.bind(this), this._track = s, this._abortSignal = o, this.input = e, this.output = i;
481
- }
482
- unsubscribe() {
483
- this._subscribers.clear();
484
- }
485
- setSubscriber(t, s) {
486
- const e = this._subscribers.get(t) ?? [];
487
- e.push(s), this._subscribers.set(t, e);
488
- }
489
- on(t, s) {
490
- this.setSubscriber(t, { cb: s });
491
- }
492
- once(t, s) {
493
- this.setSubscriber(t, {
494
- cb: s,
495
- once: !0
496
- });
497
- }
498
- emit(t, ...s) {
499
- const e = this._subscribers.get(t) ?? [], i = [];
500
- for (const n of e) n.cb(...s), n.once && i.push(() => e.splice(e.indexOf(n), 1));
501
- for (const n of i) n();
502
- }
503
- prompt() {
504
- return new Promise((t) => {
505
- if (this._abortSignal) {
506
- if (this._abortSignal.aborted) return this.state = "cancel", this.close(), t(k);
507
- this._abortSignal.addEventListener("abort", () => {
508
- this.state = "cancel", this.close();
509
- }, { once: !0 });
510
- }
511
- this.rl = E.createInterface({
512
- input: this.input,
513
- tabSize: 2,
514
- prompt: "",
515
- escapeCodeTimeout: 50,
516
- terminal: !0
517
- }), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, !0), this.input.on("keypress", this.onKeypress), w$1(this.input, !0), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
518
- this.output.write(import_src.cursor.show), this.output.off("resize", this.render), w$1(this.input, !1), t(this.value);
519
- }), this.once("cancel", () => {
520
- this.output.write(import_src.cursor.show), this.output.off("resize", this.render), w$1(this.input, !1), t(k);
521
- });
522
- });
523
- }
524
- _isActionKey(t, s) {
525
- return t === " ";
526
- }
527
- _shouldSubmit(t, s) {
528
- return !0;
529
- }
530
- _setValue(t) {
531
- this.value = t, this.emit("value", this.value);
532
- }
533
- _setUserInput(t, s) {
534
- this.userInput = t ?? "", this.emit("userInput", this.userInput), s && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
535
- }
536
- _clearUserInput() {
537
- this.rl?.write(null, {
538
- ctrl: !0,
539
- name: "u"
540
- }), this._setUserInput("");
541
- }
542
- onKeypress(t, s) {
543
- if (this._track && s.name !== "return" && (s.name && this._isActionKey(t, s) && this.rl?.write(null, {
544
- ctrl: !0,
545
- name: "h"
546
- }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), s?.name && (!this._track && h.aliases.has(s.name) && this.emit("cursor", h.aliases.get(s.name)), h.actions.has(s.name) && this.emit("cursor", s.name)), t && (t.toLowerCase() === "y" || t.toLowerCase() === "n") && this.emit("confirm", t.toLowerCase() === "y"), this.emit("key", t?.toLowerCase(), s), s?.name === "return" && this._shouldSubmit(t, s)) {
547
- if (this.opts.validate) {
548
- const e = this.opts.validate(this.value);
549
- e && (this.error = e instanceof Error ? e.message : e, this.state = "error", this.rl?.write(this.userInput));
550
- }
551
- this.state !== "error" && (this.state = "submit");
552
- }
553
- C([
554
- t,
555
- s?.name,
556
- s?.sequence
557
- ], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
558
- }
559
- close() {
560
- this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
561
- `), w$1(this.input, !1), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
562
- }
563
- restoreCursor() {
564
- const t = wrapAnsi(this._prevFrame, process.stdout.columns, {
565
- hard: !0,
566
- trim: !1
567
- }).split(`
568
- `).length - 1;
569
- this.output.write(import_src.cursor.move(-999, t * -1));
570
- }
571
- render() {
572
- const t = wrapAnsi(this._render(this) ?? "", process.stdout.columns, {
573
- hard: !0,
574
- trim: !1
575
- });
576
- if (t !== this._prevFrame) {
577
- if (this.state === "initial") this.output.write(import_src.cursor.hide);
578
- else {
579
- const s = z$1(this._prevFrame, t), e = L(this.output);
580
- if (this.restoreCursor(), s) {
581
- const i = Math.max(0, s.numLinesAfter - e), n = Math.max(0, s.numLinesBefore - e);
582
- let o = s.lines.find((u) => u >= i);
583
- if (o === void 0) {
584
- this._prevFrame = t;
585
- return;
586
- }
587
- if (s.lines.length === 1) {
588
- this.output.write(import_src.cursor.move(0, o - n)), this.output.write(import_src.erase.lines(1));
589
- const u = t.split(`
590
- `);
591
- this.output.write(u[o]), this._prevFrame = t, this.output.write(import_src.cursor.move(0, u.length - o - 1));
592
- return;
593
- } else if (s.lines.length > 1) {
594
- if (i < n) o = i;
595
- else {
596
- const a = o - n;
597
- a > 0 && this.output.write(import_src.cursor.move(0, a));
598
- }
599
- this.output.write(import_src.erase.down());
600
- const u = t.split(`
601
- `).slice(o);
602
- this.output.write(u.join(`
603
- `)), this._prevFrame = t;
604
- return;
605
- }
606
- }
607
- this.output.write(import_src.erase.down());
608
- }
609
- this.output.write(t), this.state === "initial" && (this.state = "active"), this._prevFrame = t;
610
- }
611
- }
612
- };
613
- function B(r, t) {
614
- if (r === void 0 || t.length === 0) return 0;
615
- const s = t.findIndex((e) => e.value === r);
616
- return s !== -1 ? s : 0;
617
- }
618
- function J$1(r, t) {
619
- return (t.label ?? String(t.value)).toLowerCase().includes(r.toLowerCase());
620
- }
621
- function H$1(r, t) {
622
- if (t) return r ? t : t[0];
623
- }
624
- let Q$1 = class extends p {
625
- filteredOptions;
626
- multiple;
627
- isNavigating = !1;
628
- selectedValues = [];
629
- focusedValue;
630
- #s = 0;
631
- #r = "";
632
- #t;
633
- #n;
634
- #u;
635
- get cursor() {
636
- return this.#s;
637
- }
638
- get userInputWithCursor() {
639
- if (!this.userInput) return styleText(["inverse", "hidden"], "_");
640
- if (this._cursor >= this.userInput.length) return `${this.userInput}\u2588`;
641
- const t = this.userInput.slice(0, this._cursor), [s, ...e] = this.userInput.slice(this._cursor);
642
- return `${t}${styleText("inverse", s)}${e.join("")}`;
643
- }
644
- get options() {
645
- return typeof this.#n == "function" ? this.#n() : this.#n;
646
- }
647
- constructor(t) {
648
- super(t), this.#n = t.options, this.#u = t.placeholder;
649
- const s = this.options;
650
- this.filteredOptions = [...s], this.multiple = t.multiple === !0, this.#t = typeof t.options == "function" ? t.filter : t.filter ?? J$1;
651
- let e;
652
- if (t.initialValue && Array.isArray(t.initialValue) ? this.multiple ? e = t.initialValue : e = t.initialValue.slice(0, 1) : !this.multiple && this.options.length > 0 && (e = [this.options[0].value]), e) for (const i of e) {
653
- const n = s.findIndex((o) => o.value === i);
654
- n !== -1 && (this.toggleSelected(i), this.#s = n);
655
- }
656
- this.focusedValue = this.options[this.#s]?.value, this.on("key", (i, n) => this.#e(i, n)), this.on("userInput", (i) => this.#i(i));
657
- }
658
- _isActionKey(t, s) {
659
- return t === " " || this.multiple && this.isNavigating && s.name === "space" && t !== void 0 && t !== "";
660
- }
661
- #e(t, s) {
662
- const e = s.name === "up", i = s.name === "down", n = s.name === "return", o = this.userInput === "" || this.userInput === " ", u = this.#u, a = this.options, l = u !== void 0 && u !== "" && a.some((f) => !f.disabled && (this.#t ? this.#t(u, f) : !0));
663
- if (s.name === "tab" && o && l) {
664
- this.userInput === " " && this._clearUserInput(), this._setUserInput(u, !0), this.isNavigating = !1;
665
- return;
666
- }
667
- e || i ? (this.#s = d(this.#s, e ? -1 : 1, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#s]?.value, this.multiple || (this.selectedValues = [this.focusedValue]), this.isNavigating = !0) : n ? this.value = H$1(this.multiple, this.selectedValues) : this.multiple ? this.focusedValue !== void 0 && (s.name === "tab" || this.isNavigating && s.name === "space") ? this.toggleSelected(this.focusedValue) : this.isNavigating = !1 : (this.focusedValue && (this.selectedValues = [this.focusedValue]), this.isNavigating = !1);
668
- }
669
- deselectAll() {
670
- this.selectedValues = [];
671
- }
672
- toggleSelected(t) {
673
- this.filteredOptions.length !== 0 && (this.multiple ? this.selectedValues.includes(t) ? this.selectedValues = this.selectedValues.filter((s) => s !== t) : this.selectedValues = [...this.selectedValues, t] : this.selectedValues = [t]);
674
- }
675
- #i(t) {
676
- if (t !== this.#r) {
677
- this.#r = t;
678
- const s = this.options;
679
- t && this.#t ? this.filteredOptions = s.filter((n) => this.#t?.(t, n)) : this.filteredOptions = [...s];
680
- const e = B(this.focusedValue, this.filteredOptions);
681
- this.#s = d(e, 0, this.filteredOptions);
682
- const i = this.filteredOptions[this.#s];
683
- i && !i.disabled ? this.focusedValue = i.value : this.focusedValue = void 0, this.multiple || (this.focusedValue !== void 0 ? this.toggleSelected(this.focusedValue) : this.deselectAll());
684
- }
685
- }
686
- };
687
- var X = class extends p {
688
- get cursor() {
689
- return this.value ? 0 : 1;
690
- }
691
- get _value() {
692
- return this.cursor === 0;
693
- }
694
- constructor(t) {
695
- super(t, !1), this.value = !!t.initialValue, this.on("userInput", () => {
696
- this.value = this._value;
697
- }), this.on("confirm", (s) => {
698
- this.output.write(import_src.cursor.move(0, -1)), this.value = s, this.state = "submit", this.close();
699
- }), this.on("cursor", () => {
700
- this.value = !this.value;
701
- });
702
- }
703
- };
704
- var ot$1 = class extends p {
705
- _mask = "•";
706
- get cursor() {
707
- return this._cursor;
708
- }
709
- get masked() {
710
- return this.userInput.replaceAll(/./g, this._mask);
711
- }
712
- get userInputWithCursor() {
713
- if (this.state === "submit" || this.state === "cancel") return this.masked;
714
- const t = this.userInput;
715
- if (this.cursor >= t.length) return `${this.masked}${styleText(["inverse", "hidden"], "_")}`;
716
- const s = this.masked, e = s.slice(0, this.cursor), i = s.slice(this.cursor);
717
- return `${e}${styleText("inverse", i[0])}${i.slice(1)}`;
718
- }
719
- clear() {
720
- this._clearUserInput();
721
- }
722
- constructor({ mask: t, ...s }) {
723
- super(s), this._mask = t ?? "•", this.on("userInput", (e) => {
724
- this._setValue(e);
725
- });
726
- }
727
- };
728
- var ut$1 = class extends p {
729
- options;
730
- cursor = 0;
731
- get _selectedValue() {
732
- return this.options[this.cursor];
733
- }
734
- changeValue() {
735
- this.value = this._selectedValue.value;
736
- }
737
- constructor(t) {
738
- super(t, !1), this.options = t.options;
739
- const s = this.options.findIndex(({ value: i }) => i === t.initialValue), e = s === -1 ? 0 : s;
740
- this.cursor = this.options[e].disabled ? d(e, 1, this.options) : e, this.changeValue(), this.on("cursor", (i) => {
741
- switch (i) {
742
- case "left":
743
- case "up":
744
- this.cursor = d(this.cursor, -1, this.options);
745
- break;
746
- case "down":
747
- case "right":
748
- this.cursor = d(this.cursor, 1, this.options);
749
- break;
750
- }
751
- this.changeValue();
752
- });
753
- }
754
- };
755
- var ht$1 = class extends p {
756
- get userInputWithCursor() {
757
- if (this.state === "submit") return this.userInput;
758
- const t = this.userInput;
759
- if (this.cursor >= t.length) return `${this.userInput}\u2588`;
760
- const s = t.slice(0, this.cursor), [e, ...i] = t.slice(this.cursor);
761
- return `${s}${styleText("inverse", e)}${i.join("")}`;
762
- }
763
- get cursor() {
764
- return this._cursor;
765
- }
766
- constructor(t) {
767
- super({
768
- ...t,
769
- initialUserInput: t.initialUserInput ?? t.initialValue
770
- }), this.on("userInput", (s) => {
771
- this._setValue(s);
772
- }), this.on("finalize", () => {
773
- this.value || (this.value = t.defaultValue), this.value === void 0 && (this.value = "");
774
- });
775
- }
776
- };
777
- //#endregion
778
- //#region ../../node_modules/.pnpm/@clack+prompts@1.3.0/node_modules/@clack/prompts/dist/index.mjs
779
- var dist_exports = /* @__PURE__ */ __exportAll({
780
- S_BAR: () => $,
781
- S_BAR_END: () => E$1,
782
- S_BAR_END_RIGHT: () => Et,
783
- S_BAR_H: () => st,
784
- S_BAR_START: () => lt,
785
- S_BAR_START_RIGHT: () => It,
786
- S_CHECKBOX_ACTIVE: () => et,
787
- S_CHECKBOX_INACTIVE: () => J,
788
- S_CHECKBOX_SELECTED: () => U,
789
- S_CONNECT_LEFT: () => xt,
790
- S_CORNER_BOTTOM_LEFT: () => dt,
791
- S_CORNER_BOTTOM_RIGHT: () => $t,
792
- S_CORNER_TOP_LEFT: () => Ot,
793
- S_CORNER_TOP_RIGHT: () => ct,
794
- S_ERROR: () => gt,
795
- S_INFO: () => ht,
796
- S_PASSWORD_MASK: () => Gt,
797
- S_RADIO_ACTIVE: () => z,
798
- S_RADIO_INACTIVE: () => H,
799
- S_STEP_ACTIVE: () => _t,
800
- S_STEP_CANCEL: () => ot,
801
- S_STEP_ERROR: () => ut,
802
- S_STEP_SUBMIT: () => F,
803
- S_SUCCESS: () => pt,
804
- S_WARN: () => mt,
805
- autocomplete: () => At,
806
- cancel: () => me,
807
- confirm: () => ue,
808
- intro: () => ge,
809
- isCI: () => at,
810
- isCancel: () => q,
811
- isTTY: () => Tt,
812
- limitOptions: () => Y,
813
- log: () => R,
814
- note: () => Se,
815
- outro: () => ye,
816
- password: () => Ce,
817
- select: () => Ee,
818
- spinner: () => ft,
819
- stream: () => K,
820
- symbol: () => M,
821
- symbolBar: () => yt,
822
- text: () => Re,
823
- unicode: () => tt,
824
- unicodeOr: () => w
825
- });
826
- function te() {
827
- return j.platform !== "win32" ? j.env.TERM !== "linux" : !!j.env.CI || !!j.env.WT_SESSION || !!j.env.TERMINUS_SUBLIME || j.env.ConEmuTask === "{cmd::Cmder}" || j.env.TERM_PROGRAM === "Terminus-Sublime" || j.env.TERM_PROGRAM === "vscode" || j.env.TERM === "xterm-256color" || j.env.TERM === "alacritty" || j.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
828
- }
829
- const tt = te(), at = () => process.env.CI === "true", Tt = (t) => t.isTTY === !0, w = (t, r) => tt ? t : r, _t = w("◆", "*"), ot = w("■", "x"), ut = w("▲", "x"), F = w("◇", "o"), lt = w("┌", "T"), $ = w("│", "|"), E$1 = w("└", "—"), It = w("┐", "T"), Et = w("┘", "—"), z = w("●", ">"), H = w("○", " "), et = w("◻", "[•]"), U = w("◼", "[+]"), J = w("◻", "[ ]"), Gt = w("▪", "•"), st = w("─", "-"), ct = w("╮", "+"), xt = w("├", "+"), $t = w("╯", "+"), dt = w("╰", "+"), Ot = w("╭", "+"), ht = w("●", "•"), pt = w("◆", "*"), mt = w("▲", "!"), gt = w("■", "x"), M = (t) => {
830
- switch (t) {
831
- case "initial":
832
- case "active": return styleText("cyan", _t);
833
- case "cancel": return styleText("red", ot);
834
- case "error": return styleText("yellow", ut);
835
- case "submit": return styleText("green", F);
836
- }
837
- }, yt = (t) => {
838
- switch (t) {
839
- case "initial":
840
- case "active": return styleText("cyan", $);
841
- case "cancel": return styleText("red", $);
842
- case "error": return styleText("yellow", $);
843
- case "submit": return styleText("green", $);
844
- }
845
- }, ee = (t, r, s, i, u) => {
846
- let n = r, o = 0;
847
- for (let c = s; c < i; c++) {
848
- const a = t[c];
849
- if (n = n - a.length, o++, n <= u) break;
850
- }
851
- return {
852
- lineCount: n,
853
- removals: o
854
- };
855
- }, Y = ({ cursor: t, options: r, style: s, output: i = process.stdout, maxItems: u = Number.POSITIVE_INFINITY, columnPadding: n = 0, rowPadding: o = 4 }) => {
856
- const c = A(i) - n, a = L(i), l = styleText("dim", "..."), d = Math.max(a - o, 0), y = Math.max(Math.min(u, d), 5);
857
- let p = 0;
858
- t >= y - 3 && (p = Math.max(Math.min(t - y + 3, r.length - y), 0));
859
- let m = y < r.length && p > 0, g = y < r.length && p + y < r.length;
860
- const S = Math.min(p + y, r.length), h = [];
861
- let f = 0;
862
- m && f++, g && f++;
863
- const v = p + (m ? 1 : 0), T = S - (g ? 1 : 0);
864
- for (let b = v; b < T; b++) {
865
- const G = wrapAnsi(s(r[b], b === t), c, {
866
- hard: !0,
867
- trim: !1
868
- }).split(`
869
- `);
870
- h.push(G), f += G.length;
871
- }
872
- if (f > d) {
873
- let b = 0, G = 0, x = f;
874
- const A = t - v, P = (N, D) => ee(h, x, N, D, d);
875
- m ? ({lineCount: x, removals: b} = P(0, A), x > d && ({lineCount: x, removals: G} = P(A + 1, h.length))) : ({lineCount: x, removals: G} = P(A + 1, h.length), x > d && ({lineCount: x, removals: b} = P(0, A))), b > 0 && (m = !0, h.splice(0, b)), G > 0 && (g = !0, h.splice(h.length - G, G));
876
- }
877
- const C = [];
878
- m && C.push(l);
879
- for (const b of h) for (const G of b) C.push(G);
880
- return g && C.push(l), C;
881
- };
882
- function Mt(t) {
883
- return t.label ?? String(t.value ?? "");
884
- }
885
- function Rt(t, r) {
886
- if (!t) return !0;
887
- const s = (r.label ?? String(r.value ?? "")).toLowerCase(), i = (r.hint ?? "").toLowerCase(), u = String(r.value).toLowerCase(), n = t.toLowerCase();
888
- return s.includes(n) || i.includes(n) || u.includes(n);
889
- }
890
- function se(t, r) {
891
- const s = [];
892
- for (const i of r) t.includes(i.value) && s.push(i);
893
- return s;
894
- }
895
- const At = (t) => new Q$1({
896
- options: t.options,
897
- initialValue: t.initialValue ? [t.initialValue] : void 0,
898
- initialUserInput: t.initialUserInput,
899
- placeholder: t.placeholder,
900
- filter: t.filter ?? ((r, s) => Rt(r, s)),
901
- signal: t.signal,
902
- input: t.input,
903
- output: t.output,
904
- validate: t.validate,
905
- render() {
906
- const r = t.withGuide ?? h.withGuide, s = r ? [`${styleText("gray", $)}`, `${M(this.state)} ${t.message}`] : [`${M(this.state)} ${t.message}`], i = this.userInput, u = this.options, n = t.placeholder, o = i === "" && n !== void 0, c = (a, l) => {
907
- const d = Mt(a), y = a.hint && a.value === this.focusedValue ? styleText("dim", ` (${a.hint})`) : "";
908
- switch (l) {
909
- case "active": return `${styleText("green", z)} ${d}${y}`;
910
- case "inactive": return `${styleText("dim", H)} ${styleText("dim", d)}`;
911
- case "disabled": return `${styleText("gray", H)} ${styleText(["strikethrough", "gray"], d)}`;
912
- }
913
- };
914
- switch (this.state) {
915
- case "submit": {
916
- const a = se(this.selectedValues, u), l = a.length > 0 ? ` ${styleText("dim", a.map(Mt).join(", "))}` : "", d = r ? styleText("gray", $) : "";
917
- return `${s.join(`
918
- `)}
919
- ${d}${l}`;
920
- }
921
- case "cancel": {
922
- const a = i ? ` ${styleText(["strikethrough", "dim"], i)}` : "", l = r ? styleText("gray", $) : "";
923
- return `${s.join(`
924
- `)}
925
- ${l}${a}`;
926
- }
927
- default: {
928
- const a = this.state === "error" ? "yellow" : "cyan", l = r ? `${styleText(a, $)} ` : "", d = r ? styleText(a, E$1) : "";
929
- let y = "";
930
- if (this.isNavigating || o) {
931
- const v = o ? n : i;
932
- y = v !== "" ? ` ${styleText("dim", v)}` : "";
933
- } else y = ` ${this.userInputWithCursor}`;
934
- const p = this.filteredOptions.length !== u.length ? styleText("dim", ` (${this.filteredOptions.length} match${this.filteredOptions.length === 1 ? "" : "es"})`) : "", m = this.filteredOptions.length === 0 && i ? [`${l}${styleText("yellow", "No matches found")}`] : [], g = this.state === "error" ? [`${l}${styleText("yellow", this.error)}`] : [];
935
- r && s.push(`${l.trimEnd()}`), s.push(`${l}${styleText("dim", "Search:")}${y}${p}`, ...m, ...g);
936
- const h = [`${l}${[
937
- `${styleText("dim", "↑/↓")} to select`,
938
- `${styleText("dim", "Enter:")} confirm`,
939
- `${styleText("dim", "Type:")} to search`
940
- ].join(" • ")}`, d], f = this.filteredOptions.length === 0 ? [] : Y({
941
- cursor: this.cursor,
942
- options: this.filteredOptions,
943
- columnPadding: r ? 3 : 0,
944
- rowPadding: s.length + h.length,
945
- style: (v, T) => c(v, v.disabled ? "disabled" : T ? "active" : "inactive"),
946
- maxItems: t.maxItems,
947
- output: t.output
948
- });
949
- return [
950
- ...s,
951
- ...f.map((v) => `${l}${v}`),
952
- ...h
953
- ].join(`
954
- `);
955
- }
956
- }
957
- }
958
- }).prompt(), ue = (t) => {
959
- const r = t.active ?? "Yes", s = t.inactive ?? "No";
960
- return new X({
961
- active: r,
962
- inactive: s,
963
- signal: t.signal,
964
- input: t.input,
965
- output: t.output,
966
- initialValue: t.initialValue ?? !0,
967
- render() {
968
- const i = t.withGuide ?? h.withGuide, u = `${M(this.state)} `, n = i ? `${styleText("gray", $)} ` : "", o = W(t.output, t.message, n, u), c = `${i ? `${styleText("gray", $)}
969
- ` : ""}${o}
970
- `, a = this.value ? r : s;
971
- switch (this.state) {
972
- case "submit": return `${c}${i ? `${styleText("gray", $)} ` : ""}${styleText("dim", a)}`;
973
- case "cancel": return `${c}${i ? `${styleText("gray", $)} ` : ""}${styleText(["strikethrough", "dim"], a)}${i ? `
974
- ${styleText("gray", $)}` : ""}`;
975
- default: {
976
- const l = i ? `${styleText("cyan", $)} ` : "", d = i ? styleText("cyan", E$1) : "";
977
- return `${c}${l}${this.value ? `${styleText("green", z)} ${r}` : `${styleText("dim", H)} ${styleText("dim", r)}`}${t.vertical ? i ? `
978
- ${styleText("cyan", $)} ` : `
979
- ` : ` ${styleText("dim", "/")} `}${this.value ? `${styleText("dim", H)} ${styleText("dim", s)}` : `${styleText("green", z)} ${s}`}
980
- ${d}
981
- `;
982
- }
983
- }
984
- }
985
- }).prompt();
986
- }, R = {
987
- message: (t = [], { symbol: r = styleText("gray", $), secondarySymbol: s = styleText("gray", $), output: i = process.stdout, spacing: u = 1, withGuide: n } = {}) => {
988
- const o = [], c = n ?? h.withGuide, a = c ? s : "", l = c ? `${r} ` : "", d = c ? `${s} ` : "";
989
- for (let p = 0; p < u; p++) o.push(a);
990
- const y = Array.isArray(t) ? t : t.split(`
991
- `);
992
- if (y.length > 0) {
993
- const [p, ...m] = y;
994
- p.length > 0 ? o.push(`${l}${p}`) : o.push(c ? r : "");
995
- for (const g of m) g.length > 0 ? o.push(`${d}${g}`) : o.push(c ? s : "");
996
- }
997
- i.write(`${o.join(`
998
- `)}
999
- `);
1000
- },
1001
- info: (t, r) => {
1002
- R.message(t, {
1003
- ...r,
1004
- symbol: styleText("blue", ht)
1005
- });
1006
- },
1007
- success: (t, r) => {
1008
- R.message(t, {
1009
- ...r,
1010
- symbol: styleText("green", pt)
1011
- });
1012
- },
1013
- step: (t, r) => {
1014
- R.message(t, {
1015
- ...r,
1016
- symbol: styleText("green", F)
1017
- });
1018
- },
1019
- warn: (t, r) => {
1020
- R.message(t, {
1021
- ...r,
1022
- symbol: styleText("yellow", mt)
1023
- });
1024
- },
1025
- warning: (t, r) => {
1026
- R.warn(t, r);
1027
- },
1028
- error: (t, r) => {
1029
- R.message(t, {
1030
- ...r,
1031
- symbol: styleText("red", gt)
1032
- });
1033
- }
1034
- }, me = (t = "", r) => {
1035
- const s = r?.output ?? process.stdout, i = r?.withGuide ?? h.withGuide ? `${styleText("gray", E$1)} ` : "";
1036
- s.write(`${i}${styleText("red", t)}
1037
-
1038
- `);
1039
- }, ge = (t = "", r) => {
1040
- const s = r?.output ?? process.stdout, i = r?.withGuide ?? h.withGuide ? `${styleText("gray", lt)} ` : "";
1041
- s.write(`${i}${t}
1042
- `);
1043
- }, ye = (t = "", r) => {
1044
- const s = r?.output ?? process.stdout, i = r?.withGuide ?? h.withGuide ? `${styleText("gray", $)}
1045
- ${styleText("gray", E$1)} ` : "";
1046
- s.write(`${i}${t}
1047
-
1048
- `);
1049
- }, we = (t) => styleText("dim", t), be = (t, r, s) => {
1050
- const i = {
1051
- hard: !0,
1052
- trim: !1
1053
- }, u = wrapAnsi(t, r, i).split(`
1054
- `), n = u.reduce((a, l) => Math.max(fastStringWidth(l), a), 0);
1055
- return wrapAnsi(t, r - (u.map(s).reduce((a, l) => Math.max(fastStringWidth(l), a), 0) - n), i);
1056
- }, Se = (t = "", r = "", s) => {
1057
- const i = s?.output ?? j.stdout, u = s?.withGuide ?? h.withGuide, n = s?.format ?? we, o = [
1058
- "",
1059
- ...be(t, A(i) - 6, n).split(`
1060
- `).map(n),
1061
- ""
1062
- ], c = fastStringWidth(r), a = Math.max(o.reduce((p, m) => {
1063
- const g = fastStringWidth(m);
1064
- return g > p ? g : p;
1065
- }, 0), c) + 2, l = o.map((p) => `${styleText("gray", $)} ${p}${" ".repeat(a - fastStringWidth(p))}${styleText("gray", $)}`).join(`
1066
- `), d = u ? `${styleText("gray", $)}
1067
- ` : "", y = u ? xt : dt;
1068
- i.write(`${d}${styleText("green", F)} ${styleText("reset", r)} ${styleText("gray", st.repeat(Math.max(a - c - 1, 1)) + ct)}
1069
- ${l}
1070
- ${styleText("gray", y + st.repeat(a + 2) + $t)}
1071
- `);
1072
- }, Ce = (t) => new ot$1({
1073
- validate: t.validate,
1074
- mask: t.mask ?? Gt,
1075
- signal: t.signal,
1076
- input: t.input,
1077
- output: t.output,
1078
- render() {
1079
- const r = t.withGuide ?? h.withGuide, s = `${r ? `${styleText("gray", $)}
1080
- ` : ""}${M(this.state)} ${t.message}
1081
- `, i = this.userInputWithCursor, u = this.masked;
1082
- switch (this.state) {
1083
- case "error": {
1084
- const n = r ? `${styleText("yellow", $)} ` : "", o = r ? `${styleText("yellow", E$1)} ` : "", c = u ?? "";
1085
- return t.clearOnError && this.clear(), `${s.trim()}
1086
- ${n}${c}
1087
- ${o}${styleText("yellow", this.error)}
1088
- `;
1089
- }
1090
- case "submit": return `${s}${r ? `${styleText("gray", $)} ` : ""}${u ? styleText("dim", u) : ""}`;
1091
- case "cancel": return `${s}${r ? `${styleText("gray", $)} ` : ""}${u ? styleText(["strikethrough", "dim"], u) : ""}${u && r ? `
1092
- ${styleText("gray", $)}` : ""}`;
1093
- default: return `${s}${r ? `${styleText("cyan", $)} ` : ""}${i}
1094
- ${r ? styleText("cyan", E$1) : ""}
1095
- `;
1096
- }
1097
- }
1098
- }).prompt(), _e = (t) => styleText("magenta", t), ft = ({ indicator: t = "dots", onCancel: r, output: s = process.stdout, cancelMessage: i, errorMessage: u, frames: n = tt ? [
1099
- "◒",
1100
- "◐",
1101
- "◓",
1102
- "◑"
1103
- ] : [
1104
- "•",
1105
- "o",
1106
- "O",
1107
- "0"
1108
- ], delay: o = tt ? 80 : 120, signal: c, ...a } = {}) => {
1109
- const l = at();
1110
- let d, y, p = !1, m = !1, g = "", S, h$2 = performance.now();
1111
- const f = A(s), v = a?.styleFrame ?? _e, T = (I) => {
1112
- const V = I > 1 ? u ?? h.messages.error : i ?? h.messages.cancel;
1113
- m = I === 1, p && (W(V, I), m && typeof r == "function" && r());
1114
- }, C = () => T(2), b = () => T(1), G = () => {
1115
- process.on("uncaughtExceptionMonitor", C), process.on("unhandledRejection", C), process.on("SIGINT", b), process.on("SIGTERM", b), process.on("exit", T), c && c.addEventListener("abort", b);
1116
- }, x = () => {
1117
- process.removeListener("uncaughtExceptionMonitor", C), process.removeListener("unhandledRejection", C), process.removeListener("SIGINT", b), process.removeListener("SIGTERM", b), process.removeListener("exit", T), c && c.removeEventListener("abort", b);
1118
- }, A$2 = () => {
1119
- if (S === void 0) return;
1120
- l && s.write(`
1121
- `);
1122
- const I = wrapAnsi(S, f, {
1123
- hard: !0,
1124
- trim: !1
1125
- }).split(`
1126
- `);
1127
- I.length > 1 && s.write(import_src.cursor.up(I.length - 1)), s.write(import_src.cursor.to(0)), s.write(import_src.erase.down());
1128
- }, P = (I) => I.replace(/\.+$/, ""), N = (I) => {
1129
- const V = (performance.now() - I) / 1e3, B = Math.floor(V / 60), L = Math.floor(V % 60);
1130
- return B > 0 ? `[${B}m ${L}s]` : `[${L}s]`;
1131
- }, D = a.withGuide ?? h.withGuide, rt = (I = "") => {
1132
- p = !0, d = R$1({ output: s }), g = P(I), h$2 = performance.now(), D && s.write(`${styleText("gray", $)}
1133
- `);
1134
- let V = 0, B = 0;
1135
- G(), y = setInterval(() => {
1136
- if (l && g === S) return;
1137
- A$2(), S = g;
1138
- const L = v(n[V]);
1139
- let Z;
1140
- if (l) Z = `${L} ${g}...`;
1141
- else if (t === "timer") Z = `${L} ${g} ${N(h$2)}`;
1142
- else {
1143
- const kt = ".".repeat(Math.floor(B)).slice(0, 3);
1144
- Z = `${L} ${g}${kt}`;
1145
- }
1146
- const Nt = wrapAnsi(Z, f, {
1147
- hard: !0,
1148
- trim: !1
1149
- });
1150
- s.write(Nt), V = V + 1 < n.length ? V + 1 : 0, B = B < 4 ? B + .125 : 0;
1151
- }, o);
1152
- }, W = (I = "", V = 0, B = !1) => {
1153
- if (!p) return;
1154
- p = !1, clearInterval(y), A$2();
1155
- const L = V === 0 ? styleText("green", F) : V === 1 ? styleText("red", ot) : styleText("red", ut);
1156
- g = I ?? g, B || (t === "timer" ? s.write(`${L} ${g} ${N(h$2)}
1157
- `) : s.write(`${L} ${g}
1158
- `)), x(), d();
1159
- };
1160
- return {
1161
- start: rt,
1162
- stop: (I = "") => W(I, 0),
1163
- message: (I = "") => {
1164
- g = P(I ?? g);
1165
- },
1166
- cancel: (I = "") => W(I, 1),
1167
- error: (I = "") => W(I, 2),
1168
- clear: () => W("", 0, !0),
1169
- get isCancelled() {
1170
- return m;
1171
- }
1172
- };
1173
- };
1174
- w("─", "-"), w("━", "="), w("█", "#");
1175
- const it = (t, r) => t.includes(`
1176
- `) ? t.split(`
1177
- `).map((s) => r(s)).join(`
1178
- `) : r(t), Ee = (t) => {
1179
- const r = (s, i) => {
1180
- const u = s.label ?? String(s.value);
1181
- switch (i) {
1182
- case "disabled": return `${styleText("gray", H)} ${it(u, (n) => styleText("gray", n))}${s.hint ? ` ${styleText("dim", `(${s.hint ?? "disabled"})`)}` : ""}`;
1183
- case "selected": return `${it(u, (n) => styleText("dim", n))}`;
1184
- case "active": return `${styleText("green", z)} ${u}${s.hint ? ` ${styleText("dim", `(${s.hint})`)}` : ""}`;
1185
- case "cancelled": return `${it(u, (n) => styleText(["strikethrough", "dim"], n))}`;
1186
- default: return `${styleText("dim", H)} ${it(u, (n) => styleText("dim", n))}`;
1187
- }
1188
- };
1189
- return new ut$1({
1190
- options: t.options,
1191
- signal: t.signal,
1192
- input: t.input,
1193
- output: t.output,
1194
- initialValue: t.initialValue,
1195
- render() {
1196
- const s = t.withGuide ?? h.withGuide, i = `${M(this.state)} `, u = `${yt(this.state)} `, n = W(t.output, t.message, u, i), o = `${s ? `${styleText("gray", $)}
1197
- ` : ""}${n}
1198
- `;
1199
- switch (this.state) {
1200
- case "submit": {
1201
- const c = s ? `${styleText("gray", $)} ` : "";
1202
- return `${o}${W(t.output, r(this.options[this.cursor], "selected"), c)}`;
1203
- }
1204
- case "cancel": {
1205
- const c = s ? `${styleText("gray", $)} ` : "";
1206
- return `${o}${W(t.output, r(this.options[this.cursor], "cancelled"), c)}${s ? `
1207
- ${styleText("gray", $)}` : ""}`;
1208
- }
1209
- default: {
1210
- const c = s ? `${styleText("cyan", $)} ` : "", a = s ? styleText("cyan", E$1) : "", l = o.split(`
1211
- `).length, d = s ? 2 : 1;
1212
- return `${o}${c}${Y({
1213
- output: t.output,
1214
- cursor: this.cursor,
1215
- options: this.options,
1216
- maxItems: t.maxItems,
1217
- columnPadding: c.length,
1218
- rowPadding: l + d,
1219
- style: (y, p) => r(y, y.disabled ? "disabled" : p ? "active" : "inactive")
1220
- }).join(`
1221
- ${c}`)}
1222
- ${a}
1223
- `;
1224
- }
1225
- }
1226
- }
1227
- }).prompt();
1228
- }, jt = `${styleText("gray", $)} `, K = {
1229
- message: async (t, { symbol: r = styleText("gray", $) } = {}) => {
1230
- process.stdout.write(`${styleText("gray", $)}
1231
- ${r} `);
1232
- let s = 3;
1233
- for await (let i of t) {
1234
- i = i.replace(/\n/g, `
1235
- ${jt}`), i.includes(`
1236
- `) && (s = 3 + stripVTControlCharacters(i.slice(i.lastIndexOf(`
1237
- `))).length);
1238
- const u = stripVTControlCharacters(i).length;
1239
- s + u < process.stdout.columns ? (s += u, process.stdout.write(i)) : (process.stdout.write(`
1240
- ${jt}${i.trimStart()}`), s = 3 + stripVTControlCharacters(i.trimStart()).length);
1241
- }
1242
- process.stdout.write(`
1243
- `);
1244
- },
1245
- info: (t) => K.message(t, { symbol: styleText("blue", ht) }),
1246
- success: (t) => K.message(t, { symbol: styleText("green", pt) }),
1247
- step: (t) => K.message(t, { symbol: styleText("green", F) }),
1248
- warn: (t) => K.message(t, { symbol: styleText("yellow", mt) }),
1249
- warning: (t) => K.warn(t),
1250
- error: (t) => K.message(t, { symbol: styleText("red", gt) })
1251
- }, Re = (t) => new ht$1({
1252
- validate: t.validate,
1253
- placeholder: t.placeholder,
1254
- defaultValue: t.defaultValue,
1255
- initialValue: t.initialValue,
1256
- output: t.output,
1257
- signal: t.signal,
1258
- input: t.input,
1259
- render() {
1260
- const r = t?.withGuide ?? h.withGuide, s = `${`${r ? `${styleText("gray", $)}
1261
- ` : ""}${M(this.state)} `}${t.message}
1262
- `, i = t.placeholder ? styleText("inverse", t.placeholder[0]) + styleText("dim", t.placeholder.slice(1)) : styleText(["inverse", "hidden"], "_"), u = this.userInput ? this.userInputWithCursor : i, n = this.value ?? "";
1263
- switch (this.state) {
1264
- case "error": {
1265
- const o = this.error ? ` ${styleText("yellow", this.error)}` : "", c = r ? `${styleText("yellow", $)} ` : "", a = r ? styleText("yellow", E$1) : "";
1266
- return `${s.trim()}
1267
- ${c}${u}
1268
- ${a}${o}
1269
- `;
1270
- }
1271
- case "submit": {
1272
- const o = n ? ` ${styleText("dim", n)}` : "";
1273
- return `${s}${r ? styleText("gray", $) : ""}${o}`;
1274
- }
1275
- case "cancel": {
1276
- const o = n ? ` ${styleText(["strikethrough", "dim"], n)}` : "", c = r ? styleText("gray", $) : "";
1277
- return `${s}${c}${o}${n.trim() ? `
1278
- ${c}` : ""}`;
1279
- }
1280
- default: return `${s}${r ? `${styleText("cyan", $)} ` : ""}${u}
1281
- ${r ? styleText("cyan", E$1) : ""}
1282
- `;
1283
- }
1284
- }
1285
- }).prompt();
1286
- //#endregion
1287
- export { me as _, F as a, z as b, R as c, _t as d, at as f, ge as g, ft as h, Ee as i, Re as l, et as m, Ce as n, H as o, dist_exports as p, E$1 as r, J as s, $ as t, Se as u, ue as v, q as x, ye as y };