create-vorma 0.85.0-pre.8 → 0.86.0-pre.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.dist/main.mjs CHANGED
@@ -7,27 +7,34 @@ import * as path from "node:path";
7
7
  import { dirname } from "node:path";
8
8
  import { fileURLToPath } from "node:url";
9
9
  import { stripVTControlCharacters, styleText } from "node:util";
10
- import P, { stdin, stdout } from "node:process";
11
- import * as _ from "node:readline";
12
- import P$1 from "node:readline";
10
+ import V, { stdin, stdout } from "node:process";
11
+ import * as b from "node:readline";
12
+ import E from "node:readline";
13
13
  import { ReadStream } from "node:tty";
14
14
  //#region \0rolldown/runtime.js
15
- var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
15
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
16
16
  //#endregion
17
- //#region vorma/create/node_modules/fast-string-truncated-width/dist/utils.js
18
- const isAmbiguous = (x) => {
19
- 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;
20
- };
17
+ //#region node_modules/fast-string-truncated-width/dist/utils.js
18
+ const getCodePointsLength = (() => {
19
+ const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
20
+ return (input) => {
21
+ let surrogatePairsNr = 0;
22
+ SURROGATE_PAIR_RE.lastIndex = 0;
23
+ while (SURROGATE_PAIR_RE.test(input)) surrogatePairsNr += 1;
24
+ return input.length - surrogatePairsNr;
25
+ };
26
+ })();
21
27
  const isFullWidth = (x) => {
22
28
  return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
23
29
  };
24
- const isWide = (x) => {
25
- 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 >= 9800 && x <= 9811 || x === 9855 || 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 <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 19968 && 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 === 94193 || x >= 94208 && x <= 100343 || x >= 100352 && x <= 101589 || x >= 101632 && x <= 101640 || 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 === 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 <= 128727 || 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 <= 129672 || x >= 129680 && x <= 129725 || x >= 129727 && x <= 129733 || x >= 129742 && x <= 129755 || x >= 129760 && x <= 129768 || x >= 129776 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
30
+ const isWideNotCJKTNotEmoji = (x) => {
31
+ 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;
26
32
  };
27
33
  //#endregion
28
- //#region vorma/create/node_modules/fast-string-truncated-width/dist/index.js
29
- const ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
34
+ //#region node_modules/fast-string-truncated-width/dist/index.js
35
+ const ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
30
36
  const CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
37
+ 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;
31
38
  const TAB_RE = /\t{1,1000}/y;
32
39
  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;
33
40
  const LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
@@ -40,14 +47,21 @@ const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {
40
47
  const LIMIT = truncationOptions.limit ?? Infinity;
41
48
  const ELLIPSIS = truncationOptions.ellipsis ?? "";
42
49
  const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION$1, widthOptions).width : 0);
43
- const ANSI_WIDTH = widthOptions.ansiWidth ?? 0;
50
+ const ANSI_WIDTH = 0;
44
51
  const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
45
52
  const TAB_WIDTH = widthOptions.tabWidth ?? 8;
46
- const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;
47
53
  const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
48
- const FULL_WIDTH_WIDTH = widthOptions.fullWidthWidth ?? 2;
54
+ const FULL_WIDTH_WIDTH = 2;
49
55
  const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
50
- const WIDE_WIDTH = widthOptions.wideWidth ?? 2;
56
+ const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
57
+ const PARSE_BLOCKS = [
58
+ [LATIN_RE, REGULAR_WIDTH],
59
+ [ANSI_RE, ANSI_WIDTH],
60
+ [CONTROL_RE, CONTROL_WIDTH],
61
+ [TAB_RE, TAB_WIDTH],
62
+ [EMOJI_RE, EMOJI_WIDTH],
63
+ [CJKT_WIDE_RE, WIDE_WIDTH]
64
+ ];
51
65
  let indexPrev = 0;
52
66
  let index = 0;
53
67
  let length = input.length;
@@ -66,8 +80,7 @@ const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {
66
80
  for (const char of unmatched.replaceAll(MODIFIER_RE, "")) {
67
81
  const codePoint = char.codePointAt(0) || 0;
68
82
  if (isFullWidth(codePoint)) widthExtra = FULL_WIDTH_WIDTH;
69
- else if (isWide(codePoint)) widthExtra = WIDE_WIDTH;
70
- else if (AMBIGUOUS_WIDTH !== REGULAR_WIDTH && isAmbiguous(codePoint)) widthExtra = AMBIGUOUS_WIDTH;
83
+ else if (isWideNotCJKTNotEmoji(codePoint)) widthExtra = WIDE_WIDTH;
71
84
  else widthExtra = REGULAR_WIDTH;
72
85
  if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);
73
86
  if (width + widthExtra > LIMIT) {
@@ -79,77 +92,24 @@ const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {
79
92
  }
80
93
  unmatchedStart = unmatchedEnd = 0;
81
94
  }
82
- if (index >= length) break;
83
- LATIN_RE.lastIndex = index;
84
- if (LATIN_RE.test(input)) {
85
- lengthExtra = LATIN_RE.lastIndex - index;
86
- widthExtra = lengthExtra * REGULAR_WIDTH;
87
- if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / REGULAR_WIDTH));
88
- if (width + widthExtra > LIMIT) {
89
- truncationEnabled = true;
90
- break;
91
- }
92
- width += widthExtra;
93
- unmatchedStart = indexPrev;
94
- unmatchedEnd = index;
95
- index = indexPrev = LATIN_RE.lastIndex;
96
- continue;
97
- }
98
- ANSI_RE.lastIndex = index;
99
- if (ANSI_RE.test(input)) {
100
- if (width + ANSI_WIDTH > truncationLimit) truncationIndex = Math.min(truncationIndex, index);
101
- if (width + ANSI_WIDTH > LIMIT) {
102
- truncationEnabled = true;
103
- break;
104
- }
105
- width += ANSI_WIDTH;
106
- unmatchedStart = indexPrev;
107
- unmatchedEnd = index;
108
- index = indexPrev = ANSI_RE.lastIndex;
109
- continue;
110
- }
111
- CONTROL_RE.lastIndex = index;
112
- if (CONTROL_RE.test(input)) {
113
- lengthExtra = CONTROL_RE.lastIndex - index;
114
- widthExtra = lengthExtra * CONTROL_WIDTH;
115
- if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / CONTROL_WIDTH));
116
- if (width + widthExtra > LIMIT) {
117
- truncationEnabled = true;
118
- break;
119
- }
120
- width += widthExtra;
121
- unmatchedStart = indexPrev;
122
- unmatchedEnd = index;
123
- index = indexPrev = CONTROL_RE.lastIndex;
124
- continue;
125
- }
126
- TAB_RE.lastIndex = index;
127
- if (TAB_RE.test(input)) {
128
- lengthExtra = TAB_RE.lastIndex - index;
129
- widthExtra = lengthExtra * TAB_WIDTH;
130
- if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / TAB_WIDTH));
131
- if (width + widthExtra > LIMIT) {
132
- truncationEnabled = true;
133
- break;
134
- }
135
- width += widthExtra;
136
- unmatchedStart = indexPrev;
137
- unmatchedEnd = index;
138
- index = indexPrev = TAB_RE.lastIndex;
139
- continue;
140
- }
141
- EMOJI_RE.lastIndex = index;
142
- if (EMOJI_RE.test(input)) {
143
- if (width + EMOJI_WIDTH > truncationLimit) truncationIndex = Math.min(truncationIndex, index);
144
- if (width + EMOJI_WIDTH > LIMIT) {
145
- truncationEnabled = true;
146
- break;
95
+ if (index >= length) break outer;
96
+ for (let i = 0, l = PARSE_BLOCKS.length; i < l; i++) {
97
+ const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i];
98
+ BLOCK_RE.lastIndex = index;
99
+ if (BLOCK_RE.test(input)) {
100
+ lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
101
+ widthExtra = lengthExtra * BLOCK_WIDTH;
102
+ if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
103
+ if (width + widthExtra > LIMIT) {
104
+ truncationEnabled = true;
105
+ break outer;
106
+ }
107
+ width += widthExtra;
108
+ unmatchedStart = indexPrev;
109
+ unmatchedEnd = index;
110
+ index = indexPrev = BLOCK_RE.lastIndex;
111
+ continue outer;
147
112
  }
148
- width += EMOJI_WIDTH;
149
- unmatchedStart = indexPrev;
150
- unmatchedEnd = index;
151
- index = indexPrev = EMOJI_RE.lastIndex;
152
- continue;
153
113
  }
154
114
  index += 1;
155
115
  }
@@ -161,7 +121,7 @@ const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {
161
121
  };
162
122
  };
163
123
  //#endregion
164
- //#region vorma/create/node_modules/fast-string-width/dist/index.js
124
+ //#region node_modules/fast-string-width/dist/index.js
165
125
  const NO_TRUNCATION = {
166
126
  limit: Infinity,
167
127
  ellipsis: "",
@@ -171,7 +131,7 @@ const fastStringWidth = (input, options = {}) => {
171
131
  return getStringTruncatedWidth(input, NO_TRUNCATION, options).width;
172
132
  };
173
133
  //#endregion
174
- //#region vorma/create/node_modules/fast-wrap-ansi/lib/main.js
134
+ //#region node_modules/fast-wrap-ansi/lib/main.js
175
135
  const ESC = "\x1B";
176
136
  const CSI = "›";
177
137
  const END_CODE = 39;
@@ -308,8 +268,10 @@ const exec = (string, columns, options = {}) => {
308
268
  for (let i = 0; i < preString.length; i++) {
309
269
  const character = preString[i];
310
270
  returnValue += character;
311
- if (!inSurrogate) inSurrogate = character >= "\ud800" && character <= "\udbff";
312
- else continue;
271
+ if (!inSurrogate) {
272
+ inSurrogate = character >= "\ud800" && character <= "\udbff";
273
+ if (inSurrogate) continue;
274
+ } else inSurrogate = false;
313
275
  if (character === ESC || character === CSI) {
314
276
  GROUP_REGEX.lastIndex = i + 1;
315
277
  const groups = GROUP_REGEX.exec(preString)?.groups;
@@ -334,7 +296,7 @@ function wrapAnsi(string, columns, options) {
334
296
  return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
335
297
  }
336
298
  //#endregion
337
- //#region vorma/create/node_modules/@clack/core/dist/index.mjs
299
+ //#region node_modules/@clack/core/dist/index.mjs
338
300
  var import_src = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
339
301
  const ESC = "\x1B";
340
302
  const CSI = `${ESC}[`;
@@ -387,12 +349,12 @@ var import_src = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
387
349
  beep
388
350
  };
389
351
  })))();
390
- function d$1(r, t, e) {
391
- if (!e.some((o) => !o.disabled)) return r;
392
- const s = r + t, i = Math.max(e.length - 1, 0), n = s < 0 ? i : s > i ? 0 : s;
393
- return e[n].disabled ? d$1(n, t < 0 ? -1 : 1, e) : n;
352
+ function f(r, t, s) {
353
+ if (!s.some((o) => !o.disabled)) return r;
354
+ const e = r + t, i = Math.max(s.length - 1, 0), n = e < 0 ? i : e > i ? 0 : e;
355
+ return s[n].disabled ? f(n, t < 0 ? -1 : 1, s) : n;
394
356
  }
395
- const u = {
357
+ const h = {
396
358
  actions: new Set([
397
359
  "up",
398
360
  "down",
@@ -439,71 +401,74 @@ const u = {
439
401
  }
440
402
  }
441
403
  };
442
- function V$1(r, t) {
443
- if (typeof r == "string") return u.aliases.get(r) === t;
444
- for (const e of r) if (e !== void 0 && V$1(e, t)) return !0;
404
+ function C(r, t) {
405
+ if (typeof r == "string") return h.aliases.get(r) === t;
406
+ for (const s of r) if (s !== void 0 && C(s, t)) return !0;
445
407
  return !1;
446
408
  }
447
- function j(r, t) {
409
+ function z$1(r, t) {
448
410
  if (r === t) return;
449
- const e = r.split(`
450
- `), s = t.split(`
451
- `), i = Math.max(e.length, s.length), n = [];
452
- for (let o = 0; o < i; o++) e[o] !== s[o] && n.push(o);
411
+ const s = r.split(`
412
+ `), e = t.split(`
413
+ `), i = Math.max(s.length, e.length), n = [];
414
+ for (let o = 0; o < i; o++) s[o] !== e[o] && n.push(o);
453
415
  return {
454
416
  lines: n,
455
- numLinesBefore: e.length,
456
- numLinesAfter: s.length,
417
+ numLinesBefore: s.length,
418
+ numLinesAfter: e.length,
457
419
  numLines: i
458
420
  };
459
421
  }
460
- const Y$1 = globalThis.process.platform.startsWith("win"), C = Symbol("clack:cancel");
461
- function q(r) {
462
- return r === C;
422
+ const Y$1 = globalThis.process.platform.startsWith("win"), k = Symbol("clack:cancel");
423
+ function q$1(r) {
424
+ return r === k;
463
425
  }
464
426
  function w$1(r, t) {
465
- const e = r;
466
- e.isTTY && e.setRawMode(t);
427
+ const s = r;
428
+ s.isTTY && s.setRawMode(t);
467
429
  }
468
- function z$1({ input: r = stdin, output: t = stdout, overwrite: e = !0, hideCursor: s = !0 } = {}) {
469
- const i = _.createInterface({
430
+ function R$1({ input: r = stdin, output: t = stdout, overwrite: s = !0, hideCursor: e = !0 } = {}) {
431
+ const i = b.createInterface({
470
432
  input: r,
471
433
  output: t,
472
434
  prompt: "",
473
435
  tabSize: 1
474
436
  });
475
- _.emitKeypressEvents(r, i), r instanceof ReadStream && r.isTTY && r.setRawMode(!0);
476
- const n = (o, { name: a, sequence: h }) => {
477
- if (V$1([
437
+ b.emitKeypressEvents(r, i), r instanceof ReadStream && r.isTTY && r.setRawMode(!0);
438
+ const n = (o, { name: u, sequence: a }) => {
439
+ if (C([
478
440
  String(o),
479
- a,
480
- h
441
+ u,
442
+ a
481
443
  ], "cancel")) {
482
- s && t.write(import_src.cursor.show), process.exit(0);
444
+ e && t.write(import_src.cursor.show), process.exit(0);
483
445
  return;
484
446
  }
485
- if (!e) return;
486
- const f = a === "return" ? 0 : -1, v = a === "return" ? -1 : 0;
487
- _.moveCursor(t, f, v, () => {
488
- _.clearLine(t, 1, () => {
447
+ if (!s) return;
448
+ const c = u === "return" ? 0 : -1, y = u === "return" ? -1 : 0;
449
+ b.moveCursor(t, c, y, () => {
450
+ b.clearLine(t, 1, () => {
489
451
  r.once("keypress", n);
490
452
  });
491
453
  });
492
454
  };
493
- return s && t.write(import_src.cursor.hide), r.once("keypress", n), () => {
494
- r.off("keypress", n), s && t.write(import_src.cursor.show), r instanceof ReadStream && r.isTTY && !Y$1 && r.setRawMode(!1), i.terminal = !1, i.close();
455
+ return e && t.write(import_src.cursor.hide), r.once("keypress", n), () => {
456
+ 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();
495
457
  };
496
458
  }
497
- const O$1 = (r) => "columns" in r && typeof r.columns == "number" ? r.columns : 80, A = (r) => "rows" in r && typeof r.rows == "number" ? r.rows : 20;
498
- function R(r, t, e, s = e) {
499
- return wrapAnsi(t, O$1(r ?? stdout) - e.length, {
459
+ 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;
460
+ function W(r, t, s, e = s, i = s, n) {
461
+ return wrapAnsi(t, A(r ?? stdout) - s.length, {
500
462
  hard: !0,
501
463
  trim: !1
502
464
  }).split(`
503
- `).map((n, o) => `${o === 0 ? s : e}${n}`).join(`
465
+ `).map((u, a, l) => {
466
+ const c = n ? n(u, a) : u;
467
+ return a === 0 ? `${e}${c}` : a === l.length - 1 ? `${i}${c}` : `${s}${c}`;
468
+ }).join(`
504
469
  `);
505
470
  }
506
- let p = class {
471
+ let m = class {
507
472
  input;
508
473
  output;
509
474
  _abortSignal;
@@ -518,40 +483,40 @@ let p = class {
518
483
  error = "";
519
484
  value;
520
485
  userInput = "";
521
- constructor(t, e = !0) {
522
- const { input: s = stdin, output: i = stdout, render: n, signal: o, ...a } = t;
523
- this.opts = a, 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 = e, this._abortSignal = o, this.input = s, this.output = i;
486
+ constructor(t, s = !0) {
487
+ const { input: e = stdin, output: i = stdout, render: n, signal: o, ...u } = t;
488
+ 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;
524
489
  }
525
490
  unsubscribe() {
526
491
  this._subscribers.clear();
527
492
  }
528
- setSubscriber(t, e) {
529
- const s = this._subscribers.get(t) ?? [];
530
- s.push(e), this._subscribers.set(t, s);
493
+ setSubscriber(t, s) {
494
+ const e = this._subscribers.get(t) ?? [];
495
+ e.push(s), this._subscribers.set(t, e);
531
496
  }
532
- on(t, e) {
533
- this.setSubscriber(t, { cb: e });
497
+ on(t, s) {
498
+ this.setSubscriber(t, { cb: s });
534
499
  }
535
- once(t, e) {
500
+ once(t, s) {
536
501
  this.setSubscriber(t, {
537
- cb: e,
502
+ cb: s,
538
503
  once: !0
539
504
  });
540
505
  }
541
- emit(t, ...e) {
542
- const s = this._subscribers.get(t) ?? [], i = [];
543
- for (const n of s) n.cb(...e), n.once && i.push(() => s.splice(s.indexOf(n), 1));
506
+ emit(t, ...s) {
507
+ const e = this._subscribers.get(t) ?? [], i = [];
508
+ for (const n of e) n.cb(...s), n.once && i.push(() => e.splice(e.indexOf(n), 1));
544
509
  for (const n of i) n();
545
510
  }
546
511
  prompt() {
547
512
  return new Promise((t) => {
548
513
  if (this._abortSignal) {
549
- if (this._abortSignal.aborted) return this.state = "cancel", this.close(), t(C);
514
+ if (this._abortSignal.aborted) return this.state = "cancel", this.close(), t(k);
550
515
  this._abortSignal.addEventListener("abort", () => {
551
516
  this.state = "cancel", this.close();
552
517
  }, { once: !0 });
553
518
  }
554
- this.rl = P$1.createInterface({
519
+ this.rl = E.createInterface({
555
520
  input: this.input,
556
521
  tabSize: 2,
557
522
  prompt: "",
@@ -560,18 +525,21 @@ let p = class {
560
525
  }), 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", () => {
561
526
  this.output.write(import_src.cursor.show), this.output.off("resize", this.render), w$1(this.input, !1), t(this.value);
562
527
  }), this.once("cancel", () => {
563
- this.output.write(import_src.cursor.show), this.output.off("resize", this.render), w$1(this.input, !1), t(C);
528
+ this.output.write(import_src.cursor.show), this.output.off("resize", this.render), w$1(this.input, !1), t(k);
564
529
  });
565
530
  });
566
531
  }
567
- _isActionKey(t, e) {
532
+ _isActionKey(t, s) {
568
533
  return t === " ";
569
534
  }
535
+ _shouldSubmit(t, s) {
536
+ return !0;
537
+ }
570
538
  _setValue(t) {
571
539
  this.value = t, this.emit("value", this.value);
572
540
  }
573
- _setUserInput(t, e) {
574
- this.userInput = t ?? "", this.emit("userInput", this.userInput), e && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
541
+ _setUserInput(t, s) {
542
+ this.userInput = t ?? "", this.emit("userInput", this.userInput), s && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
575
543
  }
576
544
  _clearUserInput() {
577
545
  this.rl?.write(null, {
@@ -579,21 +547,21 @@ let p = class {
579
547
  name: "u"
580
548
  }), this._setUserInput("");
581
549
  }
582
- onKeypress(t, e) {
583
- if (this._track && e.name !== "return" && (e.name && this._isActionKey(t, e) && this.rl?.write(null, {
550
+ onKeypress(t, s) {
551
+ if (this._track && s.name !== "return" && (s.name && this._isActionKey(t, s) && this.rl?.write(null, {
584
552
  ctrl: !0,
585
553
  name: "h"
586
- }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), e?.name && (!this._track && u.aliases.has(e.name) && this.emit("cursor", u.aliases.get(e.name)), u.actions.has(e.name) && this.emit("cursor", e.name)), t && (t.toLowerCase() === "y" || t.toLowerCase() === "n") && this.emit("confirm", t.toLowerCase() === "y"), this.emit("key", t?.toLowerCase(), e), e?.name === "return") {
554
+ }), 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)) {
587
555
  if (this.opts.validate) {
588
- const s = this.opts.validate(this.value);
589
- s && (this.error = s instanceof Error ? s.message : s, this.state = "error", this.rl?.write(this.userInput));
556
+ const e = this.opts.validate(this.value);
557
+ e && (this.error = e instanceof Error ? e.message : e, this.state = "error", this.rl?.write(this.userInput));
590
558
  }
591
559
  this.state !== "error" && (this.state = "submit");
592
560
  }
593
- V$1([
561
+ C([
594
562
  t,
595
- e?.name,
596
- e?.sequence
563
+ s?.name,
564
+ s?.sequence
597
565
  ], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
598
566
  }
599
567
  close() {
@@ -616,30 +584,30 @@ let p = class {
616
584
  if (t !== this._prevFrame) {
617
585
  if (this.state === "initial") this.output.write(import_src.cursor.hide);
618
586
  else {
619
- const e = j(this._prevFrame, t), s = A(this.output);
620
- if (this.restoreCursor(), e) {
621
- const i = Math.max(0, e.numLinesAfter - s), n = Math.max(0, e.numLinesBefore - s);
622
- let o = e.lines.find((a) => a >= i);
587
+ const s = z$1(this._prevFrame, t), e = L(this.output);
588
+ if (this.restoreCursor(), s) {
589
+ const i = Math.max(0, s.numLinesAfter - e), n = Math.max(0, s.numLinesBefore - e);
590
+ let o = s.lines.find((u) => u >= i);
623
591
  if (o === void 0) {
624
592
  this._prevFrame = t;
625
593
  return;
626
594
  }
627
- if (e.lines.length === 1) {
595
+ if (s.lines.length === 1) {
628
596
  this.output.write(import_src.cursor.move(0, o - n)), this.output.write(import_src.erase.lines(1));
629
- const a = t.split(`
597
+ const u = t.split(`
630
598
  `);
631
- this.output.write(a[o]), this._prevFrame = t, this.output.write(import_src.cursor.move(0, a.length - o - 1));
599
+ this.output.write(u[o]), this._prevFrame = t, this.output.write(import_src.cursor.move(0, u.length - o - 1));
632
600
  return;
633
- } else if (e.lines.length > 1) {
601
+ } else if (s.lines.length > 1) {
634
602
  if (i < n) o = i;
635
603
  else {
636
- const h = o - n;
637
- h > 0 && this.output.write(import_src.cursor.move(0, h));
604
+ const a = o - n;
605
+ a > 0 && this.output.write(import_src.cursor.move(0, a));
638
606
  }
639
607
  this.output.write(import_src.erase.down());
640
- const a = t.split(`
608
+ const u = t.split(`
641
609
  `).slice(o);
642
- this.output.write(a.join(`
610
+ this.output.write(u.join(`
643
611
  `)), this._prevFrame = t;
644
612
  return;
645
613
  }
@@ -650,7 +618,7 @@ let p = class {
650
618
  }
651
619
  }
652
620
  };
653
- var Q$1 = class extends p {
621
+ var X = class extends m {
654
622
  get cursor() {
655
623
  return this.value ? 0 : 1;
656
624
  }
@@ -660,14 +628,14 @@ var Q$1 = class extends p {
660
628
  constructor(t) {
661
629
  super(t, !1), this.value = !!t.initialValue, this.on("userInput", () => {
662
630
  this.value = this._value;
663
- }), this.on("confirm", (e) => {
664
- this.output.write(import_src.cursor.move(0, -1)), this.value = e, this.state = "submit", this.close();
631
+ }), this.on("confirm", (s) => {
632
+ this.output.write(import_src.cursor.move(0, -1)), this.value = s, this.state = "submit", this.close();
665
633
  }), this.on("cursor", () => {
666
634
  this.value = !this.value;
667
635
  });
668
636
  }
669
637
  };
670
- var nt$1 = class extends p {
638
+ var ut$1 = class extends m {
671
639
  options;
672
640
  cursor = 0;
673
641
  get _selectedValue() {
@@ -678,29 +646,29 @@ var nt$1 = class extends p {
678
646
  }
679
647
  constructor(t) {
680
648
  super(t, !1), this.options = t.options;
681
- const e = this.options.findIndex(({ value: i }) => i === t.initialValue), s = e === -1 ? 0 : e;
682
- this.cursor = this.options[s].disabled ? d$1(s, 1, this.options) : s, this.changeValue(), this.on("cursor", (i) => {
649
+ const s = this.options.findIndex(({ value: i }) => i === t.initialValue), e = s === -1 ? 0 : s;
650
+ this.cursor = this.options[e].disabled ? f(e, 1, this.options) : e, this.changeValue(), this.on("cursor", (i) => {
683
651
  switch (i) {
684
652
  case "left":
685
653
  case "up":
686
- this.cursor = d$1(this.cursor, -1, this.options);
654
+ this.cursor = f(this.cursor, -1, this.options);
687
655
  break;
688
656
  case "down":
689
657
  case "right":
690
- this.cursor = d$1(this.cursor, 1, this.options);
658
+ this.cursor = f(this.cursor, 1, this.options);
691
659
  break;
692
660
  }
693
661
  this.changeValue();
694
662
  });
695
663
  }
696
664
  };
697
- var at$1 = class extends p {
665
+ var ht$1 = class extends m {
698
666
  get userInputWithCursor() {
699
667
  if (this.state === "submit") return this.userInput;
700
668
  const t = this.userInput;
701
669
  if (this.cursor >= t.length) return `${this.userInput}\u2588`;
702
- const e = t.slice(0, this.cursor), [s, ...i] = t.slice(this.cursor);
703
- return `${e}${styleText("inverse", s)}${i.join("")}`;
670
+ const s = t.slice(0, this.cursor), [e, ...i] = t.slice(this.cursor);
671
+ return `${s}${styleText("inverse", e)}${i.join("")}`;
704
672
  }
705
673
  get cursor() {
706
674
  return this._cursor;
@@ -709,22 +677,22 @@ var at$1 = class extends p {
709
677
  super({
710
678
  ...t,
711
679
  initialUserInput: t.initialUserInput ?? t.initialValue
712
- }), this.on("userInput", (e) => {
713
- this._setValue(e);
680
+ }), this.on("userInput", (s) => {
681
+ this._setValue(s);
714
682
  }), this.on("finalize", () => {
715
683
  this.value || (this.value = t.defaultValue), this.value === void 0 && (this.value = "");
716
684
  });
717
685
  }
718
686
  };
719
687
  //#endregion
720
- //#region vorma/create/node_modules/@clack/prompts/dist/index.mjs
721
- function Ze() {
722
- return P.platform !== "win32" ? P.env.TERM !== "linux" : !!P.env.CI || !!P.env.WT_SESSION || !!P.env.TERMINUS_SUBLIME || P.env.ConEmuTask === "{cmd::Cmder}" || P.env.TERM_PROGRAM === "Terminus-Sublime" || P.env.TERM_PROGRAM === "vscode" || P.env.TERM === "xterm-256color" || P.env.TERM === "alacritty" || P.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
688
+ //#region node_modules/@clack/prompts/dist/index.mjs
689
+ function ee() {
690
+ return V.platform !== "win32" ? V.env.TERM !== "linux" : !!V.env.CI || !!V.env.WT_SESSION || !!V.env.TERMINUS_SUBLIME || V.env.ConEmuTask === "{cmd::Cmder}" || V.env.TERM_PROGRAM === "Terminus-Sublime" || V.env.TERM_PROGRAM === "vscode" || V.env.TERM === "xterm-256color" || V.env.TERM === "alacritty" || V.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
723
691
  }
724
- const ee = Ze(), ae = () => process.env.CI === "true", w = (e, i) => ee ? e : i, _e = w("◆", "*"), oe = w("■", "x"), ue = w("▲", "x"), F = w("◇", "o"), le = w("┌", "T"), d = w("│", "|"), E = w("└", "—");
692
+ const tt = ee(), ot = () => process.env.CI === "true", w = (t, i) => tt ? t : i, Tt = w("◆", "*"), at = w("■", "x"), ut = w("▲", "x"), H = w("◇", "o"), lt = w("┌", "T"), $ = w("│", "|"), x = w("└", "—");
725
693
  w("┐", "T");
726
694
  w("┘", "—");
727
- const z = w("●", ">"), H = w("○", " ");
695
+ const z = w("●", ">"), U = w("○", " ");
728
696
  w("◻", "[•]");
729
697
  w("◼", "[+]");
730
698
  w("◻", "[ ]");
@@ -735,145 +703,145 @@ w("├", "+");
735
703
  w("╯", "+");
736
704
  w("╰", "+");
737
705
  w("╭", "+");
738
- const he = w("●", "•"), pe = w("◆", "*"), me = w("▲", "!"), ge = w("■", "x"), V = (e) => {
739
- switch (e) {
706
+ const ht = w("●", "•"), pt = w("◆", "*"), mt = w("▲", "!"), gt = w("■", "x"), P = (t) => {
707
+ switch (t) {
740
708
  case "initial":
741
- case "active": return styleText("cyan", _e);
742
- case "cancel": return styleText("red", oe);
743
- case "error": return styleText("yellow", ue);
744
- case "submit": return styleText("green", F);
709
+ case "active": return styleText("cyan", Tt);
710
+ case "cancel": return styleText("red", at);
711
+ case "error": return styleText("yellow", ut);
712
+ case "submit": return styleText("green", H);
745
713
  }
746
- }, ye = (e) => {
747
- switch (e) {
714
+ }, yt = (t) => {
715
+ switch (t) {
748
716
  case "initial":
749
- case "active": return styleText("cyan", d);
750
- case "cancel": return styleText("red", d);
751
- case "error": return styleText("yellow", d);
752
- case "submit": return styleText("green", d);
753
- }
754
- }, et = (e, i, s, r, u) => {
755
- let n = i, o = 0;
756
- for (let c = s; c < r; c++) {
757
- const a = e[c];
758
- if (n = n - a.length, o++, n <= u) break;
717
+ case "active": return styleText("cyan", $);
718
+ case "cancel": return styleText("red", $);
719
+ case "error": return styleText("yellow", $);
720
+ case "submit": return styleText("green", $);
759
721
  }
722
+ }, Ot = (t, i, s, r, u, n = !1) => {
723
+ let a = i, c = 0;
724
+ if (n) for (let o = r - 1; o >= s && (a -= t[o].length, c++, !(a <= u)); o--);
725
+ else for (let o = s; o < r && (a -= t[o].length, c++, !(a <= u)); o++);
760
726
  return {
761
- lineCount: n,
762
- removals: o
727
+ lineCount: a,
728
+ removals: c
763
729
  };
764
- }, Y = ({ cursor: e, options: i, style: s, output: r = process.stdout, maxItems: u = Number.POSITIVE_INFINITY, columnPadding: n = 0, rowPadding: o = 4 }) => {
765
- const c = O$1(r) - n, a = A(r), l = styleText("dim", "..."), $ = Math.max(a - o, 0), y = Math.max(Math.min(u, $), 5);
730
+ }, F = ({ cursor: t, options: i, style: s, output: r = process.stdout, maxItems: u = Number.POSITIVE_INFINITY, columnPadding: n = 0, rowPadding: a = 4 }) => {
731
+ const c = A(r) - n, o = L(r), l = styleText("dim", "..."), d = Math.max(o - a, 0), g = Math.max(Math.min(u, d), 5);
766
732
  let p = 0;
767
- e >= y - 3 && (p = Math.max(Math.min(e - y + 3, i.length - y), 0));
768
- let m = y < i.length && p > 0, g = y < i.length && p + y < i.length;
769
- const S = Math.min(p + y, i.length), h = [];
770
- let f = 0;
771
- m && f++, g && f++;
772
- const v = p + (m ? 1 : 0), T = S - (g ? 1 : 0);
773
- for (let b = v; b < T; b++) {
774
- const x = wrapAnsi(s(i[b], b === e), c, {
733
+ t >= g - 3 && (p = Math.max(Math.min(t - g + 3, i.length - g), 0));
734
+ let f = g < i.length && p > 0, h = g < i.length && p + g < i.length;
735
+ const I = Math.min(p + g, i.length), m = [];
736
+ let y = 0;
737
+ f && y++, h && y++;
738
+ const v = p + (f ? 1 : 0), C = I - (h ? 1 : 0);
739
+ for (let b = v; b < C; b++) {
740
+ const G = wrapAnsi(s(i[b], b === t), c, {
775
741
  hard: !0,
776
742
  trim: !1
777
743
  }).split(`
778
744
  `);
779
- h.push(x), f += x.length;
745
+ m.push(G), y += G.length;
780
746
  }
781
- if (f > $) {
782
- let b = 0, x = 0, G = f;
783
- const M = e - v, R = (j, D) => et(h, G, j, D, $);
784
- m ? ({lineCount: G, removals: b} = R(0, M), G > $ && ({lineCount: G, removals: x} = R(M + 1, h.length))) : ({lineCount: G, removals: x} = R(M + 1, h.length), G > $ && ({lineCount: G, removals: b} = R(0, M))), b > 0 && (m = !0, h.splice(0, b)), x > 0 && (g = !0, h.splice(h.length - x, x));
747
+ if (y > d) {
748
+ let b = 0, G = 0, M = y;
749
+ const N = t - v;
750
+ let O = d;
751
+ const j = () => Ot(m, M, 0, N, O), k = () => Ot(m, M, N + 1, m.length, O, !0);
752
+ f ? ({lineCount: M, removals: b} = j(), M > O && (h || (O -= 1), {lineCount: M, removals: G} = k())) : (h || (O -= 1), {lineCount: M, removals: G} = k(), M > O && (O -= 1, {lineCount: M, removals: b} = j())), b > 0 && (f = !0, m.splice(0, b)), G > 0 && (h = !0, m.splice(m.length - G, G));
785
753
  }
786
- const C = [];
787
- m && C.push(l);
788
- for (const b of h) for (const x of b) C.push(x);
789
- return g && C.push(l), C;
754
+ const S = [];
755
+ f && S.push(l);
756
+ for (const b of m) for (const G of b) S.push(G);
757
+ return h && S.push(l), S;
790
758
  };
791
- const ot = (e) => {
792
- const i = e.active ?? "Yes", s = e.inactive ?? "No";
793
- return new Q$1({
759
+ const ue = (t) => {
760
+ const i = t.active ?? "Yes", s = t.inactive ?? "No";
761
+ return new X({
794
762
  active: i,
795
763
  inactive: s,
796
- signal: e.signal,
797
- input: e.input,
798
- output: e.output,
799
- initialValue: e.initialValue ?? !0,
764
+ signal: t.signal,
765
+ input: t.input,
766
+ output: t.output,
767
+ initialValue: t.initialValue ?? !0,
800
768
  render() {
801
- const r = e.withGuide ?? u.withGuide, u$4 = `${V(this.state)} `, n = r ? `${styleText("gray", d)} ` : "", o = R(e.output, e.message, n, u$4), c = `${r ? `${styleText("gray", d)}
802
- ` : ""}${o}
803
- `, a = this.value ? i : s;
769
+ const r = t.withGuide ?? h.withGuide, u = `${P(this.state)} `, n = r ? `${styleText("gray", $)} ` : "", a = W(t.output, t.message, n, u), c = `${r ? `${styleText("gray", $)}
770
+ ` : ""}${a}
771
+ `, o = this.value ? i : s;
804
772
  switch (this.state) {
805
- case "submit": return `${c}${r ? `${styleText("gray", d)} ` : ""}${styleText("dim", a)}`;
806
- case "cancel": return `${c}${r ? `${styleText("gray", d)} ` : ""}${styleText(["strikethrough", "dim"], a)}${r ? `
807
- ${styleText("gray", d)}` : ""}`;
773
+ case "submit": return `${c}${r ? `${styleText("gray", $)} ` : ""}${styleText("dim", o)}`;
774
+ case "cancel": return `${c}${r ? `${styleText("gray", $)} ` : ""}${styleText(["strikethrough", "dim"], o)}${r ? `
775
+ ${styleText("gray", $)}` : ""}`;
808
776
  default: {
809
- const l = r ? `${styleText("cyan", d)} ` : "", $ = r ? styleText("cyan", E) : "";
810
- return `${c}${l}${this.value ? `${styleText("green", z)} ${i}` : `${styleText("dim", H)} ${styleText("dim", i)}`}${e.vertical ? r ? `
811
- ${styleText("cyan", d)} ` : `
812
- ` : ` ${styleText("dim", "/")} `}${this.value ? `${styleText("dim", H)} ${styleText("dim", s)}` : `${styleText("green", z)} ${s}`}
813
- ${$}
777
+ const l = r ? `${styleText("cyan", $)} ` : "", d = r ? styleText("cyan", x) : "";
778
+ return `${c}${l}${this.value ? `${styleText("green", z)} ${i}` : `${styleText("dim", U)} ${styleText("dim", i)}`}${t.vertical ? r ? `
779
+ ${styleText("cyan", $)} ` : `
780
+ ` : ` ${styleText("dim", "/")} `}${this.value ? `${styleText("dim", U)} ${styleText("dim", s)}` : `${styleText("green", z)} ${s}`}
781
+ ${d}
814
782
  `;
815
783
  }
816
784
  }
817
785
  }
818
786
  }).prompt();
819
- }, O = {
820
- message: (e = [], { symbol: i = styleText("gray", d), secondarySymbol: s = styleText("gray", d), output: r = process.stdout, spacing: u$7 = 1, withGuide: n } = {}) => {
821
- const o = [], c = n ?? u.withGuide, a = c ? s : "", l = c ? `${i} ` : "", $ = c ? `${s} ` : "";
822
- for (let p = 0; p < u$7; p++) o.push(a);
823
- const y = Array.isArray(e) ? e : e.split(`
787
+ }, R = {
788
+ message: (t = [], { symbol: i = styleText("gray", $), secondarySymbol: s = styleText("gray", $), output: r = process.stdout, spacing: u = 1, withGuide: n } = {}) => {
789
+ const a = [], c = n ?? h.withGuide, o = c ? s : "", l = c ? `${i} ` : "", d = c ? `${s} ` : "";
790
+ for (let p = 0; p < u; p++) a.push(o);
791
+ const g = Array.isArray(t) ? t : t.split(`
824
792
  `);
825
- if (y.length > 0) {
826
- const [p, ...m] = y;
827
- p.length > 0 ? o.push(`${l}${p}`) : o.push(c ? i : "");
828
- for (const g of m) g.length > 0 ? o.push(`${$}${g}`) : o.push(c ? s : "");
793
+ if (g.length > 0) {
794
+ const [p, ...f] = g;
795
+ p.length > 0 ? a.push(`${l}${p}`) : a.push(c ? i : "");
796
+ for (const h of f) h.length > 0 ? a.push(`${d}${h}`) : a.push(c ? s : "");
829
797
  }
830
- r.write(`${o.join(`
798
+ r.write(`${a.join(`
831
799
  `)}
832
800
  `);
833
801
  },
834
- info: (e, i) => {
835
- O.message(e, {
802
+ info: (t, i) => {
803
+ R.message(t, {
836
804
  ...i,
837
- symbol: styleText("blue", he)
805
+ symbol: styleText("blue", ht)
838
806
  });
839
807
  },
840
- success: (e, i) => {
841
- O.message(e, {
808
+ success: (t, i) => {
809
+ R.message(t, {
842
810
  ...i,
843
- symbol: styleText("green", pe)
811
+ symbol: styleText("green", pt)
844
812
  });
845
813
  },
846
- step: (e, i) => {
847
- O.message(e, {
814
+ step: (t, i) => {
815
+ R.message(t, {
848
816
  ...i,
849
- symbol: styleText("green", F)
817
+ symbol: styleText("green", H)
850
818
  });
851
819
  },
852
- warn: (e, i) => {
853
- O.message(e, {
820
+ warn: (t, i) => {
821
+ R.message(t, {
854
822
  ...i,
855
- symbol: styleText("yellow", me)
823
+ symbol: styleText("yellow", mt)
856
824
  });
857
825
  },
858
- warning: (e, i) => {
859
- O.warn(e, i);
826
+ warning: (t, i) => {
827
+ R.warn(t, i);
860
828
  },
861
- error: (e, i) => {
862
- O.message(e, {
829
+ error: (t, i) => {
830
+ R.message(t, {
863
831
  ...i,
864
- symbol: styleText("red", ge)
832
+ symbol: styleText("red", gt)
865
833
  });
866
834
  }
867
- }, pt = (e = "", i) => {
868
- const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${styleText("gray", E)} ` : "";
869
- s.write(`${r}${styleText("red", e)}
835
+ }, me = (t = "", i) => {
836
+ const s = i?.output ?? process.stdout, r = i?.withGuide ?? h.withGuide ? `${styleText("gray", x)} ` : "";
837
+ s.write(`${r}${styleText("red", t)}
870
838
 
871
839
  `);
872
- }, mt = (e = "", i) => {
873
- const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${styleText("gray", le)} ` : "";
874
- s.write(`${r}${e}
840
+ }, ge = (t = "", i) => {
841
+ const s = i?.output ?? process.stdout, r = i?.withGuide ?? h.withGuide ? `${styleText("gray", lt)} ` : "";
842
+ s.write(`${r}${t}
875
843
  `);
876
- }, Ct = (e) => styleText("magenta", e), fe = ({ indicator: e = "dots", onCancel: i, output: s = process.stdout, cancelMessage: r, errorMessage: u$11, frames: n = ee ? [
844
+ }, Te = (t) => styleText("magenta", t), ft = ({ indicator: t = "dots", onCancel: i, output: s = process.stdout, cancelMessage: r, errorMessage: u, frames: n = tt ? [
877
845
  "◒",
878
846
  "◐",
879
847
  "◓",
@@ -883,232 +851,232 @@ ${$}
883
851
  "o",
884
852
  "O",
885
853
  "0"
886
- ], delay: o = ee ? 80 : 120, signal: c, ...a } = {}) => {
887
- const l = ae();
888
- let $, y, p = !1, m = !1, g = "", S, h = performance.now();
889
- const f = O$1(s), v = a?.styleFrame ?? Ct, T = (_) => {
890
- const A = _ > 1 ? u$11 ?? u.messages.error : r ?? u.messages.cancel;
891
- m = _ === 1, p && (W(A, _), m && typeof i == "function" && i());
892
- }, C = () => T(2), b = () => T(1), x = () => {
893
- 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);
894
- }, G = () => {
895
- 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);
854
+ ], delay: a = tt ? 80 : 120, signal: c, ...o } = {}) => {
855
+ const l = ot();
856
+ let d, g, p = !1, f = !1, h$2 = "", I, m = performance.now();
857
+ const y = A(s), v = o?.styleFrame ?? Te, C = (_) => {
858
+ const A = _ > 1 ? u ?? h.messages.error : r ?? h.messages.cancel;
859
+ f = _ === 1, p && (W(A, _), f && typeof i == "function" && i());
860
+ }, S = () => C(2), b = () => C(1), G = () => {
861
+ process.on("uncaughtExceptionMonitor", S), process.on("unhandledRejection", S), process.on("SIGINT", b), process.on("SIGTERM", b), process.on("exit", C), c && c.addEventListener("abort", b);
896
862
  }, M = () => {
897
- if (S === void 0) return;
863
+ process.removeListener("uncaughtExceptionMonitor", S), process.removeListener("unhandledRejection", S), process.removeListener("SIGINT", b), process.removeListener("SIGTERM", b), process.removeListener("exit", C), c && c.removeEventListener("abort", b);
864
+ }, N = () => {
865
+ if (I === void 0) return;
898
866
  l && s.write(`
899
867
  `);
900
- const _ = wrapAnsi(S, f, {
868
+ const _ = wrapAnsi(I, y, {
901
869
  hard: !0,
902
870
  trim: !1
903
871
  }).split(`
904
872
  `);
905
873
  _.length > 1 && s.write(import_src.cursor.up(_.length - 1)), s.write(import_src.cursor.to(0)), s.write(import_src.erase.down());
906
- }, R = (_) => _.replace(/\.+$/, ""), j = (_) => {
907
- const A = (performance.now() - _) / 1e3, k = Math.floor(A / 60), L = Math.floor(A % 60);
908
- return k > 0 ? `[${k}m ${L}s]` : `[${L}s]`;
909
- }, D = a.withGuide ?? u.withGuide, ie = (_ = "") => {
910
- p = !0, $ = z$1({ output: s }), g = R(_), h = performance.now(), D && s.write(`${styleText("gray", d)}
874
+ }, O = (_) => _.replace(/\.+$/, ""), j = (_) => {
875
+ const A = (performance.now() - _) / 1e3, L = Math.floor(A / 60), D = Math.floor(A % 60);
876
+ return L > 0 ? `[${L}m ${D}s]` : `[${D}s]`;
877
+ }, k = o.withGuide ?? h.withGuide, rt = (_ = "") => {
878
+ p = !0, d = R$1({ output: s }), h$2 = O(_), m = performance.now(), k && s.write(`${styleText("gray", $)}
911
879
  `);
912
- let A = 0, k = 0;
913
- x(), y = setInterval(() => {
914
- if (l && g === S) return;
915
- M(), S = g;
916
- const L = v(n[A]);
880
+ let A = 0, L = 0;
881
+ G(), g = setInterval(() => {
882
+ if (l && h$2 === I) return;
883
+ N(), I = h$2;
884
+ const D = v(n[A]);
917
885
  let Z;
918
- if (l) Z = `${L} ${g}...`;
919
- else if (e === "timer") Z = `${L} ${g} ${j(h)}`;
886
+ if (l) Z = `${D} ${h$2}...`;
887
+ else if (t === "timer") Z = `${D} ${h$2} ${j(m)}`;
920
888
  else {
921
- const Be = ".".repeat(Math.floor(k)).slice(0, 3);
922
- Z = `${L} ${g}${Be}`;
889
+ const kt = ".".repeat(Math.floor(L)).slice(0, 3);
890
+ Z = `${D} ${h$2}${kt}`;
923
891
  }
924
- const Ne = wrapAnsi(Z, f, {
892
+ const Bt = wrapAnsi(Z, y, {
925
893
  hard: !0,
926
894
  trim: !1
927
895
  });
928
- s.write(Ne), A = A + 1 < n.length ? A + 1 : 0, k = k < 4 ? k + .125 : 0;
929
- }, o);
930
- }, W = (_ = "", A = 0, k = !1) => {
896
+ s.write(Bt), A = A + 1 < n.length ? A + 1 : 0, L = L < 4 ? L + .125 : 0;
897
+ }, a);
898
+ }, W = (_ = "", A = 0, L = !1) => {
931
899
  if (!p) return;
932
- p = !1, clearInterval(y), M();
933
- const L = A === 0 ? styleText("green", F) : A === 1 ? styleText("red", oe) : styleText("red", ue);
934
- g = _ ?? g, k || (e === "timer" ? s.write(`${L} ${g} ${j(h)}
935
- `) : s.write(`${L} ${g}
936
- `)), G(), $();
900
+ p = !1, clearInterval(g), N();
901
+ const D = A === 0 ? styleText("green", H) : A === 1 ? styleText("red", at) : styleText("red", ut);
902
+ h$2 = _ ?? h$2, L || (t === "timer" ? s.write(`${D} ${h$2} ${j(m)}
903
+ `) : s.write(`${D} ${h$2}
904
+ `)), M(), d();
937
905
  };
938
906
  return {
939
- start: ie,
907
+ start: rt,
940
908
  stop: (_ = "") => W(_, 0),
941
909
  message: (_ = "") => {
942
- g = R(_ ?? g);
910
+ h$2 = O(_ ?? h$2);
943
911
  },
944
912
  cancel: (_ = "") => W(_, 1),
945
913
  error: (_ = "") => W(_, 2),
946
914
  clear: () => W("", 0, !0),
947
915
  get isCancelled() {
948
- return m;
916
+ return f;
949
917
  }
950
918
  };
951
919
  };
952
920
  w("─", "-"), w("━", "="), w("█", "#");
953
- const re = (e, i) => e.includes(`
954
- `) ? e.split(`
921
+ const it = (t, i) => t.includes(`
922
+ `) ? t.split(`
955
923
  `).map((s) => i(s)).join(`
956
- `) : i(e), _t = (e) => {
924
+ `) : i(t), xe = (t) => {
957
925
  const i = (s, r) => {
958
926
  const u = s.label ?? String(s.value);
959
927
  switch (r) {
960
- case "disabled": return `${styleText("gray", H)} ${re(u, (n) => styleText("gray", n))}${s.hint ? ` ${styleText("dim", `(${s.hint ?? "disabled"})`)}` : ""}`;
961
- case "selected": return `${re(u, (n) => styleText("dim", n))}`;
928
+ case "disabled": return `${styleText("gray", U)} ${it(u, (n) => styleText("gray", n))}${s.hint ? ` ${styleText("dim", `(${s.hint ?? "disabled"})`)}` : ""}`;
929
+ case "selected": return `${it(u, (n) => styleText("dim", n))}`;
962
930
  case "active": return `${styleText("green", z)} ${u}${s.hint ? ` ${styleText("dim", `(${s.hint})`)}` : ""}`;
963
- case "cancelled": return `${re(u, (n) => styleText(["strikethrough", "dim"], n))}`;
964
- default: return `${styleText("dim", H)} ${re(u, (n) => styleText("dim", n))}`;
931
+ case "cancelled": return `${it(u, (n) => styleText(["strikethrough", "dim"], n))}`;
932
+ default: return `${styleText("dim", U)} ${it(u, (n) => styleText("dim", n))}`;
965
933
  }
966
934
  };
967
- return new nt$1({
968
- options: e.options,
969
- signal: e.signal,
970
- input: e.input,
971
- output: e.output,
972
- initialValue: e.initialValue,
935
+ return new ut$1({
936
+ options: t.options,
937
+ signal: t.signal,
938
+ input: t.input,
939
+ output: t.output,
940
+ initialValue: t.initialValue,
973
941
  render() {
974
- const s = e.withGuide ?? u.withGuide, r = `${V(this.state)} `, u$12 = `${ye(this.state)} `, n = R(e.output, e.message, u$12, r), o = `${s ? `${styleText("gray", d)}
942
+ const s = t.withGuide ?? h.withGuide, r = `${P(this.state)} `, u = `${yt(this.state)} `, n = W(t.output, t.message, u, r), a = `${s ? `${styleText("gray", $)}
975
943
  ` : ""}${n}
976
944
  `;
977
945
  switch (this.state) {
978
946
  case "submit": {
979
- const c = s ? `${styleText("gray", d)} ` : "";
980
- return `${o}${R(e.output, i(this.options[this.cursor], "selected"), c)}`;
947
+ const c = s ? `${styleText("gray", $)} ` : "";
948
+ return `${a}${W(t.output, i(this.options[this.cursor], "selected"), c)}`;
981
949
  }
982
950
  case "cancel": {
983
- const c = s ? `${styleText("gray", d)} ` : "";
984
- return `${o}${R(e.output, i(this.options[this.cursor], "cancelled"), c)}${s ? `
985
- ${styleText("gray", d)}` : ""}`;
951
+ const c = s ? `${styleText("gray", $)} ` : "";
952
+ return `${a}${W(t.output, i(this.options[this.cursor], "cancelled"), c)}${s ? `
953
+ ${styleText("gray", $)}` : ""}`;
986
954
  }
987
955
  default: {
988
- const c = s ? `${styleText("cyan", d)} ` : "", a = s ? styleText("cyan", E) : "", l = o.split(`
989
- `).length, $ = s ? 2 : 1;
990
- return `${o}${c}${Y({
991
- output: e.output,
956
+ const c = s ? `${styleText("cyan", $)} ` : "", o = s ? styleText("cyan", x) : "", l = a.split(`
957
+ `).length, d = s ? 2 : 1;
958
+ return `${a}${c}${F({
959
+ output: t.output,
992
960
  cursor: this.cursor,
993
961
  options: this.options,
994
- maxItems: e.maxItems,
962
+ maxItems: t.maxItems,
995
963
  columnPadding: c.length,
996
- rowPadding: l + $,
997
- style: (y, p) => i(y, y.disabled ? "disabled" : p ? "active" : "inactive")
964
+ rowPadding: l + d,
965
+ style: (g, p) => i(g, g.disabled ? "disabled" : p ? "active" : "inactive")
998
966
  }).join(`
999
967
  ${c}`)}
1000
- ${a}
968
+ ${o}
1001
969
  `;
1002
970
  }
1003
971
  }
1004
972
  }
1005
973
  }).prompt();
1006
- }, je = `${styleText("gray", d)} `, K = {
1007
- message: async (e, { symbol: i = styleText("gray", d) } = {}) => {
1008
- process.stdout.write(`${styleText("gray", d)}
974
+ }, Nt = `${styleText("gray", $)} `, q = {
975
+ message: async (t, { symbol: i = styleText("gray", $) } = {}) => {
976
+ process.stdout.write(`${styleText("gray", $)}
1009
977
  ${i} `);
1010
978
  let s = 3;
1011
- for await (let r of e) {
979
+ for await (let r of t) {
1012
980
  r = r.replace(/\n/g, `
1013
- ${je}`), r.includes(`
981
+ ${Nt}`), r.includes(`
1014
982
  `) && (s = 3 + stripVTControlCharacters(r.slice(r.lastIndexOf(`
1015
983
  `))).length);
1016
984
  const u = stripVTControlCharacters(r).length;
1017
985
  s + u < process.stdout.columns ? (s += u, process.stdout.write(r)) : (process.stdout.write(`
1018
- ${je}${r.trimStart()}`), s = 3 + stripVTControlCharacters(r.trimStart()).length);
986
+ ${Nt}${r.trimStart()}`), s = 3 + stripVTControlCharacters(r.trimStart()).length);
1019
987
  }
1020
988
  process.stdout.write(`
1021
989
  `);
1022
990
  },
1023
- info: (e) => K.message(e, { symbol: styleText("blue", he) }),
1024
- success: (e) => K.message(e, { symbol: styleText("green", pe) }),
1025
- step: (e) => K.message(e, { symbol: styleText("green", F) }),
1026
- warn: (e) => K.message(e, { symbol: styleText("yellow", me) }),
1027
- warning: (e) => K.warn(e),
1028
- error: (e) => K.message(e, { symbol: styleText("red", ge) })
1029
- }, Ot = (e) => new at$1({
1030
- validate: e.validate,
1031
- placeholder: e.placeholder,
1032
- defaultValue: e.defaultValue,
1033
- initialValue: e.initialValue,
1034
- output: e.output,
1035
- signal: e.signal,
1036
- input: e.input,
991
+ info: (t) => q.message(t, { symbol: styleText("blue", ht) }),
992
+ success: (t) => q.message(t, { symbol: styleText("green", pt) }),
993
+ step: (t) => q.message(t, { symbol: styleText("green", H) }),
994
+ warn: (t) => q.message(t, { symbol: styleText("yellow", mt) }),
995
+ warning: (t) => q.warn(t),
996
+ error: (t) => q.message(t, { symbol: styleText("red", gt) })
997
+ }, Pe = (t) => new ht$1({
998
+ validate: t.validate,
999
+ placeholder: t.placeholder,
1000
+ defaultValue: t.defaultValue,
1001
+ initialValue: t.initialValue,
1002
+ output: t.output,
1003
+ signal: t.signal,
1004
+ input: t.input,
1037
1005
  render() {
1038
- const i = e?.withGuide ?? u.withGuide, s = `${`${i ? `${styleText("gray", d)}
1039
- ` : ""}${V(this.state)} `}${e.message}
1040
- `, r = e.placeholder ? styleText("inverse", e.placeholder[0]) + styleText("dim", e.placeholder.slice(1)) : styleText(["inverse", "hidden"], "_"), u$13 = this.userInput ? this.userInputWithCursor : r, n = this.value ?? "";
1006
+ const i = t?.withGuide ?? h.withGuide, s = `${`${i ? `${styleText("gray", $)}
1007
+ ` : ""}${P(this.state)} `}${t.message}
1008
+ `, r = t.placeholder ? styleText("inverse", t.placeholder[0]) + styleText("dim", t.placeholder.slice(1)) : styleText(["inverse", "hidden"], "_"), u = this.userInput ? this.userInputWithCursor : r, n = this.value ?? "";
1041
1009
  switch (this.state) {
1042
1010
  case "error": {
1043
- const o = this.error ? ` ${styleText("yellow", this.error)}` : "", c = i ? `${styleText("yellow", d)} ` : "", a = i ? styleText("yellow", E) : "";
1011
+ const a = this.error ? ` ${styleText("yellow", this.error)}` : "", c = i ? `${styleText("yellow", $)} ` : "", o = i ? styleText("yellow", x) : "";
1044
1012
  return `${s.trim()}
1045
- ${c}${u$13}
1046
- ${a}${o}
1013
+ ${c}${u}
1014
+ ${o}${a}
1047
1015
  `;
1048
1016
  }
1049
1017
  case "submit": {
1050
- const o = n ? ` ${styleText("dim", n)}` : "";
1051
- return `${s}${i ? styleText("gray", d) : ""}${o}`;
1018
+ const a = n ? ` ${styleText("dim", n)}` : "";
1019
+ return `${s}${i ? styleText("gray", $) : ""}${a}`;
1052
1020
  }
1053
1021
  case "cancel": {
1054
- const o = n ? ` ${styleText(["strikethrough", "dim"], n)}` : "", c = i ? styleText("gray", d) : "";
1055
- return `${s}${c}${o}${n.trim() ? `
1022
+ const a = n ? ` ${styleText(["strikethrough", "dim"], n)}` : "", c = i ? styleText("gray", $) : "";
1023
+ return `${s}${c}${a}${n.trim() ? `
1056
1024
  ${c}` : ""}`;
1057
1025
  }
1058
- default: return `${s}${i ? `${styleText("cyan", d)} ` : ""}${u$13}
1059
- ${i ? styleText("cyan", E) : ""}
1026
+ default: return `${s}${i ? `${styleText("cyan", $)} ` : ""}${u}
1027
+ ${i ? styleText("cyan", x) : ""}
1060
1028
  `;
1061
1029
  }
1062
1030
  }
1063
1031
  }).prompt();
1064
1032
  //#endregion
1065
- //#region vorma/create/main.ts
1033
+ //#region packages/create-vorma/main.ts
1066
1034
  const __dirname = dirname(fileURLToPath(import.meta.url));
1067
1035
  async function main() {
1068
1036
  const isLocalTest = process.argv.slice(2).includes("--local-test");
1069
1037
  console.log();
1070
- mt("Welcome to the Vorma new app creator!");
1038
+ ge("Welcome to the Vorma new app creator!");
1071
1039
  let goVersion = "";
1072
1040
  try {
1073
1041
  goVersion = execSync("go version", { encoding: "utf8" }).trim();
1074
1042
  const versionMatch = goVersion.match(/go(\d+)\.(\d+)/);
1075
1043
  if (versionMatch) {
1076
1044
  if (!versionMatch[1] || !versionMatch[2]) {
1077
- pt("Go version not recognized. Please ensure Go is installed correctly. See https://go.dev/doc/install for installation instructions.");
1045
+ me("Go version not recognized. Please ensure Go is installed correctly. See https://go.dev/doc/install for installation instructions.");
1078
1046
  process.exit(1);
1079
1047
  }
1080
1048
  const major = parseInt(versionMatch[1]);
1081
1049
  const minor = parseInt(versionMatch[2]);
1082
1050
  if (major < 1 || major === 1 && minor < 24) {
1083
- pt("Go version 1.24 or higher is required. See https://go.dev/doc/install for installation instructions.");
1051
+ me("Go version 1.24 or higher is required. See https://go.dev/doc/install for installation instructions.");
1084
1052
  process.exit(1);
1085
1053
  }
1086
1054
  }
1087
1055
  } catch {
1088
- pt("Go is not installed. See https://go.dev/doc/install for installation instructions.");
1056
+ me("Go is not installed. See https://go.dev/doc/install for installation instructions.");
1089
1057
  process.exit(1);
1090
1058
  }
1091
1059
  const firstPart = process.version.split(".")[0];
1092
1060
  if (!firstPart || firstPart.length < 2 || !firstPart.startsWith("v")) {
1093
- pt("Node.js version not recognized. Please ensure Node.js is installed correctly.");
1061
+ me("Node.js version not recognized. Please ensure Node.js is installed correctly.");
1094
1062
  process.exit(1);
1095
1063
  }
1096
1064
  const nodeMajor = parseInt(firstPart.substring(1));
1097
1065
  if (nodeMajor < 22) {
1098
- pt("Node.js version 22.11 or higher is required");
1066
+ me("Node.js version 22.11 or higher is required");
1099
1067
  process.exit(1);
1100
1068
  }
1101
- const createNewDir = await ot({
1069
+ const createNewDir = await ue({
1102
1070
  message: "Create a new directory for your Vorma app?",
1103
1071
  initialValue: true
1104
1072
  });
1105
- if (q(createNewDir)) {
1106
- pt("Operation cancelled");
1073
+ if (q$1(createNewDir)) {
1074
+ me("Operation cancelled");
1107
1075
  process.exit(0);
1108
1076
  }
1109
1077
  let targetDir = process.cwd();
1110
1078
  if (createNewDir) {
1111
- const dirName = await Ot({
1079
+ const dirName = await Pe({
1112
1080
  message: "Enter directory name:",
1113
1081
  validate: (value) => {
1114
1082
  if (!value || value.trim() === "") return "Directory name is required";
@@ -1117,14 +1085,14 @@ async function main() {
1117
1085
  if (fs.existsSync(proposedPath)) return `Directory "${value}" already exists`;
1118
1086
  }
1119
1087
  });
1120
- if (q(dirName)) {
1121
- pt("Operation cancelled");
1088
+ if (q$1(dirName)) {
1089
+ me("Operation cancelled");
1122
1090
  process.exit(0);
1123
1091
  }
1124
1092
  targetDir = path.join(process.cwd(), dirName);
1125
1093
  fs.mkdirSync(targetDir, { recursive: true });
1126
1094
  process.chdir(targetDir);
1127
- O.success(`Created directory: ${dirName}`);
1095
+ R.success(`Created directory: ${dirName}`);
1128
1096
  }
1129
1097
  let goModPath = null;
1130
1098
  let moduleRoot = null;
@@ -1143,7 +1111,7 @@ async function main() {
1143
1111
  if (goModPath) {
1144
1112
  const moduleMatch = fs.readFileSync(goModPath, "utf8").match(/^module\s+(.+)$/m);
1145
1113
  if (moduleMatch && moduleMatch[1]) moduleName = moduleMatch[1].trim();
1146
- const moduleChoice = await _t({
1114
+ const moduleChoice = await xe({
1147
1115
  message: `Found parent Go module: ${moduleName}`,
1148
1116
  options: [{
1149
1117
  value: "new",
@@ -1153,8 +1121,8 @@ async function main() {
1153
1121
  label: "Use parent go.mod"
1154
1122
  }]
1155
1123
  });
1156
- if (q(moduleChoice)) {
1157
- pt("Operation cancelled");
1124
+ if (q$1(moduleChoice)) {
1125
+ me("Operation cancelled");
1158
1126
  process.exit(0);
1159
1127
  }
1160
1128
  if (moduleChoice === "new") {
@@ -1165,36 +1133,36 @@ async function main() {
1165
1133
  }
1166
1134
  } else createNewModule = true;
1167
1135
  if (createNewModule) {
1168
- const modNameInput = await Ot({
1136
+ const modNameInput = await Pe({
1169
1137
  message: "Enter module name (e.g., \"myapp\" or \"github.com/user/myapp\"):",
1170
1138
  validate: (value) => {
1171
1139
  if (!value || value.trim() === "") return "Module name is required";
1172
1140
  }
1173
1141
  });
1174
- if (q(modNameInput)) {
1175
- pt("Operation cancelled");
1142
+ if (q$1(modNameInput)) {
1143
+ me("Operation cancelled");
1176
1144
  process.exit(0);
1177
1145
  }
1178
1146
  moduleName = modNameInput;
1179
1147
  moduleRoot = process.cwd();
1180
- const s = fe();
1148
+ const s = ft();
1181
1149
  s.start("Initializing Go module");
1182
1150
  try {
1183
1151
  execSync(`go mod init ${moduleName}`, { cwd: moduleRoot });
1184
1152
  if (isLocalTest) {
1185
1153
  execSync(`go mod edit -replace github.com/vormadev/vorma=${path.resolve(__dirname, "../../../../../")}`, { cwd: moduleRoot });
1186
- O.info("Using local Vorma code for testing");
1154
+ R.info("Using local Vorma code for testing");
1187
1155
  }
1188
1156
  s.stop("Go module initialized");
1189
1157
  } catch (error) {
1190
1158
  s.stop("Failed to initialize module");
1191
- pt(`Error: ${error}`);
1159
+ me(`Error: ${error}`);
1192
1160
  process.exit(1);
1193
1161
  }
1194
1162
  }
1195
1163
  const underscoreSegments = (moduleRoot ? path.relative(moduleRoot, process.cwd()) : "").split(path.sep).filter((seg) => seg.length > 0).filter((seg) => seg.startsWith("_"));
1196
1164
  if (underscoreSegments.length > 0) {
1197
- pt(`Cannot create Vorma app in a path containing directories that start with underscores:\n ${underscoreSegments.join(", ")}\n Go ignores directories starting with underscores, which will cause build issues.`);
1165
+ me(`Cannot create Vorma app in a path containing directories that start with underscores:\n ${underscoreSegments.join(", ")}\n Go ignores directories starting with underscores, which will cause build issues.`);
1198
1166
  process.exit(1);
1199
1167
  }
1200
1168
  let importPath = moduleName;
@@ -1202,7 +1170,7 @@ async function main() {
1202
1170
  const relativePath = path.relative(moduleRoot, process.cwd());
1203
1171
  importPath = path.posix.join(moduleName, ...relativePath.split(path.sep));
1204
1172
  }
1205
- const uiVariant = await _t({
1173
+ const uiVariant = await xe({
1206
1174
  message: "Choose frontend UI library:",
1207
1175
  options: [
1208
1176
  {
@@ -1219,11 +1187,11 @@ async function main() {
1219
1187
  }
1220
1188
  ]
1221
1189
  });
1222
- if (q(uiVariant)) {
1223
- pt("Operation cancelled");
1190
+ if (q$1(uiVariant)) {
1191
+ me("Operation cancelled");
1224
1192
  process.exit(0);
1225
1193
  }
1226
- const packageManager = await _t({
1194
+ const packageManager = await xe({
1227
1195
  message: "Choose JS package manager:",
1228
1196
  options: [
1229
1197
  {
@@ -1244,11 +1212,11 @@ async function main() {
1244
1212
  }
1245
1213
  ]
1246
1214
  });
1247
- if (q(packageManager)) {
1248
- pt("Operation cancelled");
1215
+ if (q$1(packageManager)) {
1216
+ me("Operation cancelled");
1249
1217
  process.exit(0);
1250
1218
  }
1251
- const deploymentTarget = await _t({
1219
+ const deploymentTarget = await xe({
1252
1220
  message: "Choose deployment target:",
1253
1221
  options: [
1254
1222
  {
@@ -1265,16 +1233,16 @@ async function main() {
1265
1233
  }
1266
1234
  ]
1267
1235
  });
1268
- if (q(deploymentTarget)) {
1269
- pt("Operation cancelled");
1236
+ if (q$1(deploymentTarget)) {
1237
+ me("Operation cancelled");
1270
1238
  process.exit(0);
1271
1239
  }
1272
- const includeTailwind = await ot({
1240
+ const includeTailwind = await ue({
1273
1241
  message: "Include Tailwind CSS?",
1274
1242
  initialValue: false
1275
1243
  });
1276
- if (q(includeTailwind)) {
1277
- pt("Operation cancelled");
1244
+ if (q$1(includeTailwind)) {
1245
+ me("Operation cancelled");
1278
1246
  process.exit(0);
1279
1247
  }
1280
1248
  console.log();
@@ -1322,7 +1290,7 @@ func main() {
1322
1290
  throw error;
1323
1291
  }
1324
1292
  } catch (error) {
1325
- pt(`Error: ${error}`);
1293
+ me(`Error: ${error}`);
1326
1294
  process.exit(1);
1327
1295
  } finally {
1328
1296
  try {