@jannael/glinter 1.2.1 → 1.2.3

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 (3) hide show
  1. package/README.md +93 -80
  2. package/dist/index.js +652 -598
  3. package/package.json +27 -14
package/dist/index.js CHANGED
@@ -95,38 +95,33 @@ var AVAILABLE_COMMANDS = [
95
95
  {
96
96
  name: "add",
97
97
  command: "g add",
98
- description: "Interactive add",
99
- allowGitArgs: true
98
+ description: "Interactive add"
100
99
  },
101
100
  {
102
101
  name: "commit",
103
102
  command: "g commit",
104
- description: "Interactive commit",
105
- allowGitArgs: true
103
+ description: "Interactive commit"
106
104
  },
107
105
  {
108
106
  name: "switch",
109
107
  command: "g switch",
110
- description: "Interactive switch",
111
- allowGitArgs: true
108
+ description: "Interactive switch"
112
109
  },
113
110
  {
114
111
  name: "alias",
115
112
  command: "g alias",
116
- description: "Show all the aliases",
117
- allowGitArgs: false
113
+ description: "Show all the aliases"
118
114
  },
119
115
  {
120
116
  name: "setup",
121
117
  command: "g setup",
122
- description: "Setup alias for git and glinter",
123
- allowGitArgs: true
118
+ description: "Setup alias for git and glinter"
124
119
  }
125
120
  ];
126
121
 
127
122
  // apps/cli/error/error-constructor.ts
123
+ var capitalize = (text) => text.charAt(0).toUpperCase() + text.slice(1);
128
124
  function CreateError(name) {
129
- const capitalize = (text) => text.charAt(0).toUpperCase() + text.slice(1);
130
125
  return class extends Error {
131
126
  description;
132
127
  constructor(message, description) {
@@ -179,25 +174,34 @@ function errorHandler(error) {
179
174
  }
180
175
 
181
176
  // node_modules/@clack/core/dist/index.mjs
182
- import { styleText as y } from "util";
183
- import { stdout as S, stdin as $ } from "process";
184
- import * as _ from "readline";
185
- import P from "readline";
177
+ import { styleText as v } from "util";
178
+ import { stdout as x, stdin as D } from "process";
179
+ import * as b from "readline";
180
+ import E from "readline";
186
181
 
187
182
  // node_modules/fast-string-truncated-width/dist/utils.js
188
- var isAmbiguous = (x) => {
189
- 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;
190
- };
183
+ var getCodePointsLength = (() => {
184
+ const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
185
+ return (input) => {
186
+ let surrogatePairsNr = 0;
187
+ SURROGATE_PAIR_RE.lastIndex = 0;
188
+ while (SURROGATE_PAIR_RE.test(input)) {
189
+ surrogatePairsNr += 1;
190
+ }
191
+ return input.length - surrogatePairsNr;
192
+ };
193
+ })();
191
194
  var isFullWidth = (x) => {
192
195
  return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
193
196
  };
194
- var isWide = (x) => {
195
- 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;
197
+ var isWideNotCJKTNotEmoji = (x) => {
198
+ 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;
196
199
  };
197
200
 
198
201
  // node_modules/fast-string-truncated-width/dist/index.js
199
- var ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
202
+ var ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
200
203
  var CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
204
+ var CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu;
201
205
  var TAB_RE = /\t{1,1000}/y;
202
206
  var 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?))*/yu;
203
207
  var LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
@@ -207,14 +211,21 @@ var getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {})
207
211
  const LIMIT = truncationOptions.limit ?? Infinity;
208
212
  const ELLIPSIS = truncationOptions.ellipsis ?? "";
209
213
  const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
210
- const ANSI_WIDTH = widthOptions.ansiWidth ?? 0;
214
+ const ANSI_WIDTH = 0;
211
215
  const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
212
216
  const TAB_WIDTH = widthOptions.tabWidth ?? 8;
213
- const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;
214
217
  const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
215
- const FULL_WIDTH_WIDTH = widthOptions.fullWidthWidth ?? 2;
218
+ const FULL_WIDTH_WIDTH = 2;
216
219
  const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
217
- const WIDE_WIDTH = widthOptions.wideWidth ?? 2;
220
+ const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
221
+ const PARSE_BLOCKS = [
222
+ [LATIN_RE, REGULAR_WIDTH],
223
+ [ANSI_RE, ANSI_WIDTH],
224
+ [CONTROL_RE, CONTROL_WIDTH],
225
+ [TAB_RE, TAB_WIDTH],
226
+ [EMOJI_RE, EMOJI_WIDTH],
227
+ [CJKT_WIDE_RE, WIDE_WIDTH]
228
+ ];
218
229
  let indexPrev = 0;
219
230
  let index = 0;
220
231
  let length = input.length;
@@ -235,10 +246,8 @@ var getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {})
235
246
  const codePoint = char.codePointAt(0) || 0;
236
247
  if (isFullWidth(codePoint)) {
237
248
  widthExtra = FULL_WIDTH_WIDTH;
238
- } else if (isWide(codePoint)) {
249
+ } else if (isWideNotCJKTNotEmoji(codePoint)) {
239
250
  widthExtra = WIDE_WIDTH;
240
- } else if (AMBIGUOUS_WIDTH !== REGULAR_WIDTH && isAmbiguous(codePoint)) {
241
- widthExtra = AMBIGUOUS_WIDTH;
242
251
  } else {
243
252
  widthExtra = REGULAR_WIDTH;
244
253
  }
@@ -254,88 +263,28 @@ var getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {})
254
263
  }
255
264
  unmatchedStart = unmatchedEnd = 0;
256
265
  }
257
- if (index >= length)
258
- break;
259
- LATIN_RE.lastIndex = index;
260
- if (LATIN_RE.test(input)) {
261
- lengthExtra = LATIN_RE.lastIndex - index;
262
- widthExtra = lengthExtra * REGULAR_WIDTH;
263
- if (width + widthExtra > truncationLimit) {
264
- truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / REGULAR_WIDTH));
265
- }
266
- if (width + widthExtra > LIMIT) {
267
- truncationEnabled = true;
268
- break;
269
- }
270
- width += widthExtra;
271
- unmatchedStart = indexPrev;
272
- unmatchedEnd = index;
273
- index = indexPrev = LATIN_RE.lastIndex;
274
- continue;
275
- }
276
- ANSI_RE.lastIndex = index;
277
- if (ANSI_RE.test(input)) {
278
- if (width + ANSI_WIDTH > truncationLimit) {
279
- truncationIndex = Math.min(truncationIndex, index);
280
- }
281
- if (width + ANSI_WIDTH > LIMIT) {
282
- truncationEnabled = true;
283
- break;
284
- }
285
- width += ANSI_WIDTH;
286
- unmatchedStart = indexPrev;
287
- unmatchedEnd = index;
288
- index = indexPrev = ANSI_RE.lastIndex;
289
- continue;
290
- }
291
- CONTROL_RE.lastIndex = index;
292
- if (CONTROL_RE.test(input)) {
293
- lengthExtra = CONTROL_RE.lastIndex - index;
294
- widthExtra = lengthExtra * CONTROL_WIDTH;
295
- if (width + widthExtra > truncationLimit) {
296
- truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / CONTROL_WIDTH));
297
- }
298
- if (width + widthExtra > LIMIT) {
299
- truncationEnabled = true;
300
- break;
301
- }
302
- width += widthExtra;
303
- unmatchedStart = indexPrev;
304
- unmatchedEnd = index;
305
- index = indexPrev = CONTROL_RE.lastIndex;
306
- continue;
307
- }
308
- TAB_RE.lastIndex = index;
309
- if (TAB_RE.test(input)) {
310
- lengthExtra = TAB_RE.lastIndex - index;
311
- widthExtra = lengthExtra * TAB_WIDTH;
312
- if (width + widthExtra > truncationLimit) {
313
- truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / TAB_WIDTH));
314
- }
315
- if (width + widthExtra > LIMIT) {
316
- truncationEnabled = true;
317
- break;
318
- }
319
- width += widthExtra;
320
- unmatchedStart = indexPrev;
321
- unmatchedEnd = index;
322
- index = indexPrev = TAB_RE.lastIndex;
323
- continue;
266
+ if (index >= length) {
267
+ break outer;
324
268
  }
325
- EMOJI_RE.lastIndex = index;
326
- if (EMOJI_RE.test(input)) {
327
- if (width + EMOJI_WIDTH > truncationLimit) {
328
- truncationIndex = Math.min(truncationIndex, index);
329
- }
330
- if (width + EMOJI_WIDTH > LIMIT) {
331
- truncationEnabled = true;
332
- break;
269
+ for (let i = 0, l = PARSE_BLOCKS.length;i < l; i++) {
270
+ const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i];
271
+ BLOCK_RE.lastIndex = index;
272
+ if (BLOCK_RE.test(input)) {
273
+ lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
274
+ widthExtra = lengthExtra * BLOCK_WIDTH;
275
+ if (width + widthExtra > truncationLimit) {
276
+ truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
277
+ }
278
+ if (width + widthExtra > LIMIT) {
279
+ truncationEnabled = true;
280
+ break outer;
281
+ }
282
+ width += widthExtra;
283
+ unmatchedStart = indexPrev;
284
+ unmatchedEnd = index;
285
+ index = indexPrev = BLOCK_RE.lastIndex;
286
+ continue outer;
333
287
  }
334
- width += EMOJI_WIDTH;
335
- unmatchedStart = indexPrev;
336
- unmatchedEnd = index;
337
- index = indexPrev = EMOJI_RE.lastIndex;
338
- continue;
339
288
  }
340
289
  index += 1;
341
290
  }
@@ -527,8 +476,11 @@ var exec = (string, columns, options = {}) => {
527
476
  returnValue += character;
528
477
  if (!inSurrogate) {
529
478
  inSurrogate = character >= "\uD800" && character <= "\uDBFF";
479
+ if (inSurrogate) {
480
+ continue;
481
+ }
530
482
  } else {
531
- continue;
483
+ inSurrogate = false;
532
484
  }
533
485
  if (character === ESC || character === CSI) {
534
486
  GROUP_REGEX.lastIndex = i + 1;
@@ -570,74 +522,96 @@ function wrapAnsi(string, columns, options) {
570
522
 
571
523
  // node_modules/@clack/core/dist/index.mjs
572
524
  var import_sisteransi = __toESM(require_src(), 1);
573
- import { ReadStream as D } from "tty";
574
- function d(r, t, e) {
575
- if (!e.some((o) => !o.disabled))
525
+ import { ReadStream as O } from "tty";
526
+ function f(r, t, s) {
527
+ if (!s.some((o) => !o.disabled))
576
528
  return r;
577
- const s = r + t, i = Math.max(e.length - 1, 0), n = s < 0 ? i : s > i ? 0 : s;
578
- return e[n].disabled ? d(n, t < 0 ? -1 : 1, e) : n;
529
+ const e = r + t, i = Math.max(s.length - 1, 0), n = e < 0 ? i : e > i ? 0 : e;
530
+ return s[n].disabled ? f(n, t < 0 ? -1 : 1, s) : n;
531
+ }
532
+ function I(r, t, s, e) {
533
+ const i = e.split(`
534
+ `);
535
+ let n = 0, o = r;
536
+ for (const a of i) {
537
+ if (o <= a.length)
538
+ break;
539
+ o -= a.length + 1, n++;
540
+ }
541
+ for (n = Math.max(0, Math.min(i.length - 1, n + s)), o = Math.min(o, i[n].length) + t;o < 0 && n > 0; )
542
+ n--, o += i[n].length + 1;
543
+ for (;o > i[n].length && n < i.length - 1; )
544
+ o -= i[n].length + 1, n++;
545
+ o = Math.max(0, Math.min(i[n].length, o));
546
+ let u = 0;
547
+ for (let a = 0;a < n; a++)
548
+ u += i[a].length + 1;
549
+ return u + o;
579
550
  }
580
- var E = ["up", "down", "left", "right", "space", "enter", "cancel"];
581
- var G = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
582
- var u = { actions: new Set(E), aliases: new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["\x03", "cancel"], ["escape", "cancel"]]), messages: { cancel: "Canceled", error: "Something went wrong" }, withGuide: true, date: { monthNames: [...G], messages: { required: "Please enter a valid date", invalidMonth: "There are only 12 months in a year", invalidDay: (r, t) => `There are only ${r} days in ${t}`, afterMin: (r) => `Date must be on or after ${r.toISOString().slice(0, 10)}`, beforeMax: (r) => `Date must be on or before ${r.toISOString().slice(0, 10)}` } } };
583
- function V(r, t) {
551
+ var G = ["up", "down", "left", "right", "space", "enter", "cancel"];
552
+ var K = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
553
+ var h = { actions: new Set(G), aliases: new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["\x03", "cancel"], ["escape", "cancel"]]), messages: { cancel: "Canceled", error: "Something went wrong" }, withGuide: true, date: { monthNames: [...K], messages: { required: "Please enter a valid date", invalidMonth: "There are only 12 months in a year", invalidDay: (r, t) => `There are only ${r} days in ${t}`, afterMin: (r) => `Date must be on or after ${r.toISOString().slice(0, 10)}`, beforeMax: (r) => `Date must be on or before ${r.toISOString().slice(0, 10)}` } } };
554
+ function C(r, t) {
584
555
  if (typeof r == "string")
585
- return u.aliases.get(r) === t;
586
- for (const e of r)
587
- if (e !== undefined && V(e, t))
556
+ return h.aliases.get(r) === t;
557
+ for (const s of r)
558
+ if (s !== undefined && C(s, t))
588
559
  return true;
589
560
  return false;
590
561
  }
591
- function j(r, t) {
562
+ function z(r, t) {
592
563
  if (r === t)
593
564
  return;
594
- const e = r.split(`
595
- `), s = t.split(`
596
- `), i = Math.max(e.length, s.length), n = [];
565
+ const s = r.split(`
566
+ `), e = t.split(`
567
+ `), i = Math.max(s.length, e.length), n = [];
597
568
  for (let o = 0;o < i; o++)
598
- e[o] !== s[o] && n.push(o);
599
- return { lines: n, numLinesBefore: e.length, numLinesAfter: s.length, numLines: i };
569
+ s[o] !== e[o] && n.push(o);
570
+ return { lines: n, numLinesBefore: s.length, numLinesAfter: e.length, numLines: i };
600
571
  }
601
572
  var Y = globalThis.process.platform.startsWith("win");
602
- var C = Symbol("clack:cancel");
573
+ var k = Symbol("clack:cancel");
603
574
  function q(r) {
604
- return r === C;
575
+ return r === k;
605
576
  }
606
577
  function w(r, t) {
607
- const e = r;
608
- e.isTTY && e.setRawMode(t);
578
+ const s = r;
579
+ s.isTTY && s.setRawMode(t);
609
580
  }
610
- function z({ input: r = $, output: t = S, overwrite: e = true, hideCursor: s = true } = {}) {
611
- const i = _.createInterface({ input: r, output: t, prompt: "", tabSize: 1 });
612
- _.emitKeypressEvents(r, i), r instanceof D && r.isTTY && r.setRawMode(true);
613
- const n = (o, { name: a, sequence: h }) => {
581
+ function R({ input: r = D, output: t = x, overwrite: s = true, hideCursor: e = true } = {}) {
582
+ const i = b.createInterface({ input: r, output: t, prompt: "", tabSize: 1 });
583
+ b.emitKeypressEvents(r, i), r instanceof O && r.isTTY && r.setRawMode(true);
584
+ const n = (o, { name: u, sequence: a }) => {
614
585
  const l = String(o);
615
- if (V([l, a, h], "cancel")) {
616
- s && t.write(import_sisteransi.cursor.show), process.exit(0);
586
+ if (C([l, u, a], "cancel")) {
587
+ e && t.write(import_sisteransi.cursor.show), process.exit(0);
617
588
  return;
618
589
  }
619
- if (!e)
590
+ if (!s)
620
591
  return;
621
- const f = a === "return" ? 0 : -1, v = a === "return" ? -1 : 0;
622
- _.moveCursor(t, f, v, () => {
623
- _.clearLine(t, 1, () => {
592
+ const c = u === "return" ? 0 : -1, y = u === "return" ? -1 : 0;
593
+ b.moveCursor(t, c, y, () => {
594
+ b.clearLine(t, 1, () => {
624
595
  r.once("keypress", n);
625
596
  });
626
597
  });
627
598
  };
628
- return s && t.write(import_sisteransi.cursor.hide), r.once("keypress", n), () => {
629
- r.off("keypress", n), s && t.write(import_sisteransi.cursor.show), r instanceof D && r.isTTY && !Y && r.setRawMode(false), i.terminal = false, i.close();
599
+ return e && t.write(import_sisteransi.cursor.hide), r.once("keypress", n), () => {
600
+ r.off("keypress", n), e && t.write(import_sisteransi.cursor.show), r instanceof O && r.isTTY && !Y && r.setRawMode(false), i.terminal = false, i.close();
630
601
  };
631
602
  }
632
- var O = (r) => ("columns" in r) && typeof r.columns == "number" ? r.columns : 80;
633
- var A = (r) => ("rows" in r) && typeof r.rows == "number" ? r.rows : 20;
634
- function R(r, t, e, s = e) {
635
- const i = O(r ?? S);
636
- return wrapAnsi(t, i - e.length, { hard: true, trim: false }).split(`
637
- `).map((n, o) => `${o === 0 ? s : e}${n}`).join(`
603
+ var A = (r) => ("columns" in r) && typeof r.columns == "number" ? r.columns : 80;
604
+ var L = (r) => ("rows" in r) && typeof r.rows == "number" ? r.rows : 20;
605
+ function W(r, t, s, e = s, i = s, n) {
606
+ const o = A(r ?? x);
607
+ return wrapAnsi(t, o - s.length, { hard: true, trim: false }).split(`
608
+ `).map((u, a, l) => {
609
+ const c = n ? n(u, a) : u;
610
+ return a === 0 ? `${e}${c}` : a === l.length - 1 ? `${i}${c}` : `${s}${c}`;
611
+ }).join(`
638
612
  `);
639
613
  }
640
- var p = class {
614
+ var m = class {
641
615
  input;
642
616
  output;
643
617
  _abortSignal;
@@ -652,27 +626,27 @@ var p = class {
652
626
  error = "";
653
627
  value;
654
628
  userInput = "";
655
- constructor(t, e = true) {
656
- const { input: s = $, output: i = S, render: n, signal: o, ...a } = t;
657
- 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;
629
+ constructor(t, s = true) {
630
+ const { input: e = D, output: i = x, render: n, signal: o, ...u } = t;
631
+ 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;
658
632
  }
659
633
  unsubscribe() {
660
634
  this._subscribers.clear();
661
635
  }
662
- setSubscriber(t, e) {
663
- const s = this._subscribers.get(t) ?? [];
664
- s.push(e), this._subscribers.set(t, s);
636
+ setSubscriber(t, s) {
637
+ const e = this._subscribers.get(t) ?? [];
638
+ e.push(s), this._subscribers.set(t, e);
665
639
  }
666
- on(t, e) {
667
- this.setSubscriber(t, { cb: e });
640
+ on(t, s) {
641
+ this.setSubscriber(t, { cb: s });
668
642
  }
669
- once(t, e) {
670
- this.setSubscriber(t, { cb: e, once: true });
643
+ once(t, s) {
644
+ this.setSubscriber(t, { cb: s, once: true });
671
645
  }
672
- emit(t, ...e) {
673
- const s = this._subscribers.get(t) ?? [], i = [];
674
- for (const n of s)
675
- n.cb(...e), n.once && i.push(() => s.splice(s.indexOf(n), 1));
646
+ emit(t, ...s) {
647
+ const e = this._subscribers.get(t) ?? [], i = [];
648
+ for (const n of e)
649
+ n.cb(...s), n.once && i.push(() => e.splice(e.indexOf(n), 1));
676
650
  for (const n of i)
677
651
  n();
678
652
  }
@@ -680,39 +654,42 @@ var p = class {
680
654
  return new Promise((t) => {
681
655
  if (this._abortSignal) {
682
656
  if (this._abortSignal.aborted)
683
- return this.state = "cancel", this.close(), t(C);
657
+ return this.state = "cancel", this.close(), t(k);
684
658
  this._abortSignal.addEventListener("abort", () => {
685
659
  this.state = "cancel", this.close();
686
660
  }, { once: true });
687
661
  }
688
- this.rl = P.createInterface({ input: this.input, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), this.rl.prompt(), this.opts.initialUserInput !== undefined && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), w(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
662
+ this.rl = E.createInterface({ input: this.input, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), this.rl.prompt(), this.opts.initialUserInput !== undefined && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), w(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
689
663
  this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t(this.value);
690
664
  }), this.once("cancel", () => {
691
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t(C);
665
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t(k);
692
666
  });
693
667
  });
694
668
  }
695
- _isActionKey(t, e) {
669
+ _isActionKey(t, s) {
696
670
  return t === "\t";
697
671
  }
672
+ _shouldSubmit(t, s) {
673
+ return true;
674
+ }
698
675
  _setValue(t) {
699
676
  this.value = t, this.emit("value", this.value);
700
677
  }
701
- _setUserInput(t, e) {
702
- this.userInput = t ?? "", this.emit("userInput", this.userInput), e && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
678
+ _setUserInput(t, s) {
679
+ this.userInput = t ?? "", this.emit("userInput", this.userInput), s && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
703
680
  }
704
681
  _clearUserInput() {
705
682
  this.rl?.write(null, { ctrl: true, name: "u" }), this._setUserInput("");
706
683
  }
707
- onKeypress(t, e) {
708
- if (this._track && e.name !== "return" && (e.name && this._isActionKey(t, e) && this.rl?.write(null, { ctrl: true, name: "h" }), 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") {
684
+ onKeypress(t, s) {
685
+ if (this._track && s.name !== "return" && (s.name && this._isActionKey(t, s) && this.rl?.write(null, { ctrl: true, name: "h" }), 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)) {
709
686
  if (this.opts.validate) {
710
- const s = this.opts.validate(this.value);
711
- s && (this.error = s instanceof Error ? s.message : s, this.state = "error", this.rl?.write(this.userInput));
687
+ const e = this.opts.validate(this.value);
688
+ e && (this.error = e instanceof Error ? e.message : e, this.state = "error", this.rl?.write(this.userInput));
712
689
  }
713
690
  this.state !== "error" && (this.state = "submit");
714
691
  }
715
- V([t, e?.name, e?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
692
+ C([t, s?.name, s?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
716
693
  }
717
694
  close() {
718
695
  this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
@@ -729,31 +706,31 @@ var p = class {
729
706
  if (this.state === "initial")
730
707
  this.output.write(import_sisteransi.cursor.hide);
731
708
  else {
732
- const e = j(this._prevFrame, t), s = A(this.output);
733
- if (this.restoreCursor(), e) {
734
- const i = Math.max(0, e.numLinesAfter - s), n = Math.max(0, e.numLinesBefore - s);
735
- let o = e.lines.find((a) => a >= i);
709
+ const s = z(this._prevFrame, t), e = L(this.output);
710
+ if (this.restoreCursor(), s) {
711
+ const i = Math.max(0, s.numLinesAfter - e), n = Math.max(0, s.numLinesBefore - e);
712
+ let o = s.lines.find((u) => u >= i);
736
713
  if (o === undefined) {
737
714
  this._prevFrame = t;
738
715
  return;
739
716
  }
740
- if (e.lines.length === 1) {
717
+ if (s.lines.length === 1) {
741
718
  this.output.write(import_sisteransi.cursor.move(0, o - n)), this.output.write(import_sisteransi.erase.lines(1));
742
- const a = t.split(`
719
+ const u = t.split(`
743
720
  `);
744
- this.output.write(a[o]), this._prevFrame = t, this.output.write(import_sisteransi.cursor.move(0, a.length - o - 1));
721
+ this.output.write(u[o]), this._prevFrame = t, this.output.write(import_sisteransi.cursor.move(0, u.length - o - 1));
745
722
  return;
746
- } else if (e.lines.length > 1) {
723
+ } else if (s.lines.length > 1) {
747
724
  if (i < n)
748
725
  o = i;
749
726
  else {
750
- const h = o - n;
751
- h > 0 && this.output.write(import_sisteransi.cursor.move(0, h));
727
+ const a = o - n;
728
+ a > 0 && this.output.write(import_sisteransi.cursor.move(0, a));
752
729
  }
753
730
  this.output.write(import_sisteransi.erase.down());
754
- const a = t.split(`
731
+ const u = t.split(`
755
732
  `).slice(o);
756
- this.output.write(a.join(`
733
+ this.output.write(u.join(`
757
734
  `)), this._prevFrame = t;
758
735
  return;
759
736
  }
@@ -764,87 +741,87 @@ var p = class {
764
741
  }
765
742
  }
766
743
  };
767
- function W(r, t) {
744
+ function B(r, t) {
768
745
  if (r === undefined || t.length === 0)
769
746
  return 0;
770
- const e = t.findIndex((s) => s.value === r);
771
- return e !== -1 ? e : 0;
747
+ const s = t.findIndex((e) => e.value === r);
748
+ return s !== -1 ? s : 0;
772
749
  }
773
- function B(r, t) {
750
+ function J(r, t) {
774
751
  return (t.label ?? String(t.value)).toLowerCase().includes(r.toLowerCase());
775
752
  }
776
- function J(r, t) {
753
+ function H(r, t) {
777
754
  if (t)
778
755
  return r ? t : t[0];
779
756
  }
780
- var H = class extends p {
757
+ var Q = class extends m {
781
758
  filteredOptions;
782
759
  multiple;
783
760
  isNavigating = false;
784
761
  selectedValues = [];
785
762
  focusedValue;
786
- #e = 0;
787
- #o = "";
763
+ #s = 0;
764
+ #r = "";
788
765
  #t;
789
766
  #n;
790
- #a;
767
+ #u;
791
768
  get cursor() {
792
- return this.#e;
769
+ return this.#s;
793
770
  }
794
771
  get userInputWithCursor() {
795
772
  if (!this.userInput)
796
- return y(["inverse", "hidden"], "_");
773
+ return v(["inverse", "hidden"], "_");
797
774
  if (this._cursor >= this.userInput.length)
798
775
  return `${this.userInput}\u2588`;
799
- const t = this.userInput.slice(0, this._cursor), [e, ...s] = this.userInput.slice(this._cursor);
800
- return `${t}${y("inverse", e)}${s.join("")}`;
776
+ const t = this.userInput.slice(0, this._cursor), [s, ...e] = this.userInput.slice(this._cursor);
777
+ return `${t}${v("inverse", s)}${e.join("")}`;
801
778
  }
802
779
  get options() {
803
780
  return typeof this.#n == "function" ? this.#n() : this.#n;
804
781
  }
805
782
  constructor(t) {
806
- super(t), this.#n = t.options, this.#a = t.placeholder;
807
- const e = this.options;
808
- this.filteredOptions = [...e], this.multiple = t.multiple === true, this.#t = typeof t.options == "function" ? t.filter : t.filter ?? B;
809
- let s;
810
- if (t.initialValue && Array.isArray(t.initialValue) ? this.multiple ? s = t.initialValue : s = t.initialValue.slice(0, 1) : !this.multiple && this.options.length > 0 && (s = [this.options[0].value]), s)
811
- for (const i of s) {
812
- const n = e.findIndex((o) => o.value === i);
813
- n !== -1 && (this.toggleSelected(i), this.#e = n);
783
+ super(t), this.#n = t.options, this.#u = t.placeholder;
784
+ const s = this.options;
785
+ this.filteredOptions = [...s], this.multiple = t.multiple === true, this.#t = typeof t.options == "function" ? t.filter : t.filter ?? J;
786
+ let e;
787
+ 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)
788
+ for (const i of e) {
789
+ const n = s.findIndex((o) => o.value === i);
790
+ n !== -1 && (this.toggleSelected(i), this.#s = n);
814
791
  }
815
- this.focusedValue = this.options[this.#e]?.value, this.on("key", (i, n) => this.#s(i, n)), this.on("userInput", (i) => this.#i(i));
792
+ this.focusedValue = this.options[this.#s]?.value, this.on("key", (i, n) => this.#e(i, n)), this.on("userInput", (i) => this.#i(i));
816
793
  }
817
- _isActionKey(t, e) {
818
- return t === "\t" || this.multiple && this.isNavigating && e.name === "space" && t !== undefined && t !== "";
794
+ _isActionKey(t, s) {
795
+ return t === "\t" || this.multiple && this.isNavigating && s.name === "space" && t !== undefined && t !== "";
819
796
  }
820
- #s(t, e) {
821
- const s = e.name === "up", i = e.name === "down", n = e.name === "return", o = this.userInput === "" || this.userInput === "\t", a = this.#a, h = this.options, l = a !== undefined && a !== "" && h.some((f) => !f.disabled && (this.#t ? this.#t(a, f) : true));
822
- if (e.name === "tab" && o && l) {
823
- this.userInput === "\t" && this._clearUserInput(), this._setUserInput(a, true), this.isNavigating = false;
797
+ #e(t, s) {
798
+ const e = s.name === "up", i = s.name === "down", n = s.name === "return", o = this.userInput === "" || this.userInput === "\t", u = this.#u, a = this.options, l = u !== undefined && u !== "" && a.some((c) => !c.disabled && (this.#t ? this.#t(u, c) : true));
799
+ if (s.name === "tab" && o && l) {
800
+ this.userInput === "\t" && this._clearUserInput(), this._setUserInput(u, true), this.isNavigating = false;
824
801
  return;
825
802
  }
826
- s || i ? (this.#e = d(this.#e, s ? -1 : 1, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#e]?.value, this.multiple || (this.selectedValues = [this.focusedValue]), this.isNavigating = true) : n ? this.value = J(this.multiple, this.selectedValues) : this.multiple ? this.focusedValue !== undefined && (e.name === "tab" || this.isNavigating && e.name === "space") ? this.toggleSelected(this.focusedValue) : this.isNavigating = false : (this.focusedValue && (this.selectedValues = [this.focusedValue]), this.isNavigating = false);
803
+ e || i ? (this.#s = f(this.#s, e ? -1 : 1, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#s]?.value, this.multiple || (this.selectedValues = [this.focusedValue]), this.isNavigating = true) : n ? this.value = H(this.multiple, this.selectedValues) : this.multiple ? this.focusedValue !== undefined && (s.name === "tab" || this.isNavigating && s.name === "space") ? this.toggleSelected(this.focusedValue) : this.isNavigating = false : (this.focusedValue && (this.selectedValues = [this.focusedValue]), this.isNavigating = false);
827
804
  }
828
805
  deselectAll() {
829
806
  this.selectedValues = [];
830
807
  }
831
808
  toggleSelected(t) {
832
- this.filteredOptions.length !== 0 && (this.multiple ? this.selectedValues.includes(t) ? this.selectedValues = this.selectedValues.filter((e) => e !== t) : this.selectedValues = [...this.selectedValues, t] : this.selectedValues = [t]);
809
+ 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]);
833
810
  }
834
811
  #i(t) {
835
- if (t !== this.#o) {
836
- this.#o = t;
837
- const e = this.options;
838
- t && this.#t ? this.filteredOptions = e.filter((n) => this.#t?.(t, n)) : this.filteredOptions = [...e];
839
- const s = W(this.focusedValue, this.filteredOptions);
840
- this.#e = d(s, 0, this.filteredOptions);
841
- const i = this.filteredOptions[this.#e];
812
+ if (t !== this.#r) {
813
+ this.#r = t;
814
+ const s = this.options;
815
+ t && this.#t ? this.filteredOptions = s.filter((n) => this.#t?.(t, n)) : this.filteredOptions = [...s];
816
+ const e = B(this.focusedValue, this.filteredOptions);
817
+ this.#s = f(e, 0, this.filteredOptions);
818
+ const i = this.filteredOptions[this.#s];
842
819
  i && !i.disabled ? this.focusedValue = i.value : this.focusedValue = undefined, this.multiple || (this.focusedValue !== undefined ? this.toggleSelected(this.focusedValue) : this.deselectAll());
843
820
  }
844
821
  }
845
822
  };
846
823
 
847
- class Q extends p {
824
+ class X2 extends m {
848
825
  get cursor() {
849
826
  return this.value ? 0 : 1;
850
827
  }
@@ -854,102 +831,102 @@ class Q extends p {
854
831
  constructor(t) {
855
832
  super(t, false), this.value = !!t.initialValue, this.on("userInput", () => {
856
833
  this.value = this._value;
857
- }), this.on("confirm", (e) => {
858
- this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = e, this.state = "submit", this.close();
834
+ }), this.on("confirm", (s) => {
835
+ this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = s, this.state = "submit", this.close();
859
836
  }), this.on("cursor", () => {
860
837
  this.value = !this.value;
861
838
  });
862
839
  }
863
840
  }
864
- var X2 = { Y: { type: "year", len: 4 }, M: { type: "month", len: 2 }, D: { type: "day", len: 2 } };
865
- function L(r) {
866
- return [...r].map((t) => X2[t]);
841
+ var Z = { Y: { type: "year", len: 4 }, M: { type: "month", len: 2 }, D: { type: "day", len: 2 } };
842
+ function P(r) {
843
+ return [...r].map((t) => Z[t]);
867
844
  }
868
- function Z(r) {
869
- const t = new Intl.DateTimeFormat(r, { year: "numeric", month: "2-digit", day: "2-digit" }).formatToParts(new Date(2000, 0, 15)), e = [];
870
- let s = "/";
845
+ function tt(r) {
846
+ const t = new Intl.DateTimeFormat(r, { year: "numeric", month: "2-digit", day: "2-digit" }).formatToParts(new Date(2000, 0, 15)), s = [];
847
+ let e = "/";
871
848
  for (const i of t)
872
- i.type === "literal" ? s = i.value.trim() || i.value : (i.type === "year" || i.type === "month" || i.type === "day") && e.push({ type: i.type, len: i.type === "year" ? 4 : 2 });
873
- return { segments: e, separator: s };
849
+ i.type === "literal" ? e = i.value.trim() || i.value : (i.type === "year" || i.type === "month" || i.type === "day") && s.push({ type: i.type, len: i.type === "year" ? 4 : 2 });
850
+ return { segments: s, separator: e };
874
851
  }
875
- function k(r) {
852
+ function $(r) {
876
853
  return Number.parseInt((r || "0").replace(/_/g, "0"), 10) || 0;
877
854
  }
878
- function I(r) {
879
- return { year: k(r.year), month: k(r.month), day: k(r.day) };
855
+ function S(r) {
856
+ return { year: $(r.year), month: $(r.month), day: $(r.day) };
880
857
  }
881
- function T(r, t) {
858
+ function U(r, t) {
882
859
  return new Date(r || 2001, t || 1, 0).getDate();
883
860
  }
884
861
  function F(r) {
885
- const { year: t, month: e, day: s } = I(r);
886
- if (!t || t < 0 || t > 9999 || !e || e < 1 || e > 12 || !s || s < 1)
862
+ const { year: t, month: s, day: e } = S(r);
863
+ if (!t || t < 0 || t > 9999 || !s || s < 1 || s > 12 || !e || e < 1)
887
864
  return;
888
- const i = new Date(Date.UTC(t, e - 1, s));
889
- if (!(i.getUTCFullYear() !== t || i.getUTCMonth() !== e - 1 || i.getUTCDate() !== s))
890
- return { year: t, month: e, day: s };
865
+ const i = new Date(Date.UTC(t, s - 1, e));
866
+ if (!(i.getUTCFullYear() !== t || i.getUTCMonth() !== s - 1 || i.getUTCDate() !== e))
867
+ return { year: t, month: s, day: e };
891
868
  }
892
869
  function N(r) {
893
870
  const t = F(r);
894
871
  return t ? new Date(Date.UTC(t.year, t.month - 1, t.day)) : undefined;
895
872
  }
896
- function tt(r, t, e, s) {
897
- const i = e ? { year: e.getUTCFullYear(), month: e.getUTCMonth() + 1, day: e.getUTCDate() } : null, n = s ? { year: s.getUTCFullYear(), month: s.getUTCMonth() + 1, day: s.getUTCDate() } : null;
898
- return r === "year" ? { min: i?.year ?? 1, max: n?.year ?? 9999 } : r === "month" ? { min: i && t.year === i.year ? i.month : 1, max: n && t.year === n.year ? n.month : 12 } : { min: i && t.year === i.year && t.month === i.month ? i.day : 1, max: n && t.year === n.year && t.month === n.month ? n.day : T(t.year, t.month) };
873
+ function st(r, t, s, e) {
874
+ const i = s ? { year: s.getUTCFullYear(), month: s.getUTCMonth() + 1, day: s.getUTCDate() } : null, n = e ? { year: e.getUTCFullYear(), month: e.getUTCMonth() + 1, day: e.getUTCDate() } : null;
875
+ return r === "year" ? { min: i?.year ?? 1, max: n?.year ?? 9999 } : r === "month" ? { min: i && t.year === i.year ? i.month : 1, max: n && t.year === n.year ? n.month : 12 } : { min: i && t.year === i.year && t.month === i.month ? i.day : 1, max: n && t.year === n.year && t.month === n.month ? n.day : U(t.year, t.month) };
899
876
  }
900
877
 
901
- class et extends p {
902
- #e;
903
- #o;
878
+ class et extends m {
879
+ #s;
880
+ #r;
904
881
  #t;
905
882
  #n;
906
- #a;
907
- #s = { segmentIndex: 0, positionInSegment: 0 };
883
+ #u;
884
+ #e = { segmentIndex: 0, positionInSegment: 0 };
908
885
  #i = true;
909
- #r = null;
886
+ #o = null;
910
887
  inlineError = "";
911
888
  get segmentCursor() {
912
- return { ...this.#s };
889
+ return { ...this.#e };
913
890
  }
914
891
  get segmentValues() {
915
892
  return { ...this.#t };
916
893
  }
917
894
  get segments() {
918
- return this.#e;
895
+ return this.#s;
919
896
  }
920
897
  get separator() {
921
- return this.#o;
898
+ return this.#r;
922
899
  }
923
900
  get formattedValue() {
924
901
  return this.#c(this.#t);
925
902
  }
926
903
  #c(t) {
927
- return this.#e.map((e) => t[e.type]).join(this.#o);
904
+ return this.#s.map((s) => t[s.type]).join(this.#r);
928
905
  }
929
- #h() {
906
+ #a() {
930
907
  this._setUserInput(this.#c(this.#t)), this._setValue(N(this.#t) ?? undefined);
931
908
  }
932
909
  constructor(t) {
933
- const e = t.format ? { segments: L(t.format), separator: t.separator ?? "/" } : Z(t.locale), s = t.separator ?? e.separator, i = t.format ? L(t.format) : e.segments, n = t.initialValue ?? t.defaultValue, o = n ? { year: String(n.getUTCFullYear()).padStart(4, "0"), month: String(n.getUTCMonth() + 1).padStart(2, "0"), day: String(n.getUTCDate()).padStart(2, "0") } : { year: "____", month: "__", day: "__" }, a = i.map((h) => o[h.type]).join(s);
934
- super({ ...t, initialUserInput: a }, false), this.#e = i, this.#o = s, this.#t = o, this.#n = t.minDate, this.#a = t.maxDate, this.#h(), this.on("cursor", (h) => this.#d(h)), this.on("key", (h, l) => this.#f(h, l)), this.on("finalize", () => this.#g(t));
910
+ const s = t.format ? { segments: P(t.format), separator: t.separator ?? "/" } : tt(t.locale), e = t.separator ?? s.separator, i = t.format ? P(t.format) : s.segments, n = t.initialValue ?? t.defaultValue, o = n ? { year: String(n.getUTCFullYear()).padStart(4, "0"), month: String(n.getUTCMonth() + 1).padStart(2, "0"), day: String(n.getUTCDate()).padStart(2, "0") } : { year: "____", month: "__", day: "__" }, u = i.map((a) => o[a.type]).join(e);
911
+ super({ ...t, initialUserInput: u }, false), this.#s = i, this.#r = e, this.#t = o, this.#n = t.minDate, this.#u = t.maxDate, this.#a(), this.on("cursor", (a) => this.#d(a)), this.on("key", (a, l) => this.#f(a, l)), this.on("finalize", () => this.#g(t));
935
912
  }
936
- #u() {
937
- const t = Math.max(0, Math.min(this.#s.segmentIndex, this.#e.length - 1)), e = this.#e[t];
938
- if (e)
939
- return this.#s.positionInSegment = Math.max(0, Math.min(this.#s.positionInSegment, e.len - 1)), { segment: e, index: t };
913
+ #h() {
914
+ const t = Math.max(0, Math.min(this.#e.segmentIndex, this.#s.length - 1)), s = this.#s[t];
915
+ if (s)
916
+ return this.#e.positionInSegment = Math.max(0, Math.min(this.#e.positionInSegment, s.len - 1)), { segment: s, index: t };
940
917
  }
941
918
  #l(t) {
942
- this.inlineError = "", this.#r = null;
943
- const e = this.#u();
944
- e && (this.#s.segmentIndex = Math.max(0, Math.min(this.#e.length - 1, e.index + t)), this.#s.positionInSegment = 0, this.#i = true);
919
+ this.inlineError = "", this.#o = null;
920
+ const s = this.#h();
921
+ s && (this.#e.segmentIndex = Math.max(0, Math.min(this.#s.length - 1, s.index + t)), this.#e.positionInSegment = 0, this.#i = true);
945
922
  }
946
923
  #p(t) {
947
- const e = this.#u();
948
- if (!e)
924
+ const s = this.#h();
925
+ if (!s)
949
926
  return;
950
- const { segment: s } = e, i = this.#t[s.type], n = !i || i.replace(/_/g, "") === "", o = Number.parseInt((i || "0").replace(/_/g, "0"), 10) || 0, a = tt(s.type, I(this.#t), this.#n, this.#a);
951
- let h;
952
- n ? h = t === 1 ? a.min : a.max : h = Math.max(Math.min(a.max, o + t), a.min), this.#t = { ...this.#t, [s.type]: h.toString().padStart(s.len, "0") }, this.#i = true, this.#r = null, this.#h();
927
+ const { segment: e } = s, i = this.#t[e.type], n = !i || i.replace(/_/g, "") === "", o = Number.parseInt((i || "0").replace(/_/g, "0"), 10) || 0, u = st(e.type, S(this.#t), this.#n, this.#u);
928
+ let a;
929
+ n ? a = t === 1 ? u.min : u.max : a = Math.max(Math.min(u.max, o + t), u.min), this.#t = { ...this.#t, [e.type]: a.toString().padStart(e.len, "0") }, this.#i = true, this.#o = null, this.#a();
953
930
  }
954
931
  #d(t) {
955
932
  if (t)
@@ -964,124 +941,124 @@ class et extends p {
964
941
  return this.#p(-1);
965
942
  }
966
943
  }
967
- #f(t, e) {
968
- if (e?.name === "backspace" || e?.sequence === "\x7F" || e?.sequence === "\b" || t === "\x7F" || t === "\b") {
944
+ #f(t, s) {
945
+ if (s?.name === "backspace" || s?.sequence === "\x7F" || s?.sequence === "\b" || t === "\x7F" || t === "\b") {
969
946
  this.inlineError = "";
970
- const s = this.#u();
971
- if (!s)
947
+ const e = this.#h();
948
+ if (!e)
972
949
  return;
973
- if (!this.#t[s.segment.type].replace(/_/g, "")) {
950
+ if (!this.#t[e.segment.type].replace(/_/g, "")) {
974
951
  this.#l(-1);
975
952
  return;
976
953
  }
977
- this.#t[s.segment.type] = "_".repeat(s.segment.len), this.#i = true, this.#s.positionInSegment = 0, this.#h();
954
+ this.#t[e.segment.type] = "_".repeat(e.segment.len), this.#i = true, this.#e.positionInSegment = 0, this.#a();
978
955
  return;
979
956
  }
980
- if (e?.name === "tab") {
957
+ if (s?.name === "tab") {
981
958
  this.inlineError = "";
982
- const s = this.#u();
983
- if (!s)
959
+ const e = this.#h();
960
+ if (!e)
984
961
  return;
985
- const i = e.shift ? -1 : 1, n = s.index + i;
986
- n >= 0 && n < this.#e.length && (this.#s.segmentIndex = n, this.#s.positionInSegment = 0, this.#i = true);
962
+ const i = s.shift ? -1 : 1, n = e.index + i;
963
+ n >= 0 && n < this.#s.length && (this.#e.segmentIndex = n, this.#e.positionInSegment = 0, this.#i = true);
987
964
  return;
988
965
  }
989
966
  if (t && /^[0-9]$/.test(t)) {
990
- const s = this.#u();
991
- if (!s)
967
+ const e = this.#h();
968
+ if (!e)
992
969
  return;
993
- const { segment: i } = s, n = !this.#t[i.type].replace(/_/g, "");
994
- if (this.#i && this.#r !== null && !n) {
995
- const m = this.#r + t, g = { ...this.#t, [i.type]: m }, b = this.#m(g, i);
996
- if (b) {
997
- this.inlineError = b, this.#r = null, this.#i = false;
970
+ const { segment: i } = e, n = !this.#t[i.type].replace(/_/g, "");
971
+ if (this.#i && this.#o !== null && !n) {
972
+ const d = this.#o + t, g = { ...this.#t, [i.type]: d }, _ = this.#m(g, i);
973
+ if (_) {
974
+ this.inlineError = _, this.#o = null, this.#i = false;
998
975
  return;
999
976
  }
1000
- this.inlineError = "", this.#t[i.type] = m, this.#r = null, this.#i = false, this.#h(), s.index < this.#e.length - 1 && (this.#s.segmentIndex = s.index + 1, this.#s.positionInSegment = 0, this.#i = true);
977
+ this.inlineError = "", this.#t[i.type] = d, this.#o = null, this.#i = false, this.#a(), e.index < this.#s.length - 1 && (this.#e.segmentIndex = e.index + 1, this.#e.positionInSegment = 0, this.#i = true);
1001
978
  return;
1002
979
  }
1003
- this.#i && !n && (this.#t[i.type] = "_".repeat(i.len), this.#s.positionInSegment = 0), this.#i = false, this.#r = null;
1004
- const o = this.#t[i.type], a = o.indexOf("_"), h = a >= 0 ? a : Math.min(this.#s.positionInSegment, i.len - 1);
1005
- if (h < 0 || h >= i.len)
980
+ this.#i && !n && (this.#t[i.type] = "_".repeat(i.len), this.#e.positionInSegment = 0), this.#i = false, this.#o = null;
981
+ const o = this.#t[i.type], u = o.indexOf("_"), a = u >= 0 ? u : Math.min(this.#e.positionInSegment, i.len - 1);
982
+ if (a < 0 || a >= i.len)
1006
983
  return;
1007
- let l = o.slice(0, h) + t + o.slice(h + 1), f = false;
1008
- if (h === 0 && o === "__" && (i.type === "month" || i.type === "day")) {
1009
- const m = Number.parseInt(t, 10);
1010
- l = `0${t}`, f = m <= (i.type === "month" ? 1 : 2);
984
+ let l = o.slice(0, a) + t + o.slice(a + 1), c = false;
985
+ if (a === 0 && o === "__" && (i.type === "month" || i.type === "day")) {
986
+ const d = Number.parseInt(t, 10);
987
+ l = `0${t}`, c = d <= (i.type === "month" ? 1 : 2);
1011
988
  }
1012
989
  if (i.type === "year" && (l = (o.replace(/_/g, "") + t).padStart(i.len, "_")), !l.includes("_")) {
1013
- const m = { ...this.#t, [i.type]: l }, g = this.#m(m, i);
990
+ const d = { ...this.#t, [i.type]: l }, g = this.#m(d, i);
1014
991
  if (g) {
1015
992
  this.inlineError = g;
1016
993
  return;
1017
994
  }
1018
995
  }
1019
996
  this.inlineError = "", this.#t[i.type] = l;
1020
- const v = l.includes("_") ? undefined : F(this.#t);
1021
- if (v) {
1022
- const { year: m, month: g } = v, b = T(m, g);
1023
- this.#t = { year: String(Math.max(0, Math.min(9999, m))).padStart(4, "0"), month: String(Math.max(1, Math.min(12, g))).padStart(2, "0"), day: String(Math.max(1, Math.min(b, v.day))).padStart(2, "0") };
997
+ const y = l.includes("_") ? undefined : F(this.#t);
998
+ if (y) {
999
+ const { year: d, month: g } = y, _ = U(d, g);
1000
+ this.#t = { year: String(Math.max(0, Math.min(9999, d))).padStart(4, "0"), month: String(Math.max(1, Math.min(12, g))).padStart(2, "0"), day: String(Math.max(1, Math.min(_, y.day))).padStart(2, "0") };
1024
1001
  }
1025
- this.#h();
1026
- const U = l.indexOf("_");
1027
- f ? (this.#i = true, this.#r = t) : U >= 0 ? this.#s.positionInSegment = U : a >= 0 && s.index < this.#e.length - 1 ? (this.#s.segmentIndex = s.index + 1, this.#s.positionInSegment = 0, this.#i = true) : this.#s.positionInSegment = Math.min(h + 1, i.len - 1);
1002
+ this.#a();
1003
+ const T = l.indexOf("_");
1004
+ c ? (this.#i = true, this.#o = t) : T >= 0 ? this.#e.positionInSegment = T : u >= 0 && e.index < this.#s.length - 1 ? (this.#e.segmentIndex = e.index + 1, this.#e.positionInSegment = 0, this.#i = true) : this.#e.positionInSegment = Math.min(a + 1, i.len - 1);
1028
1005
  }
1029
1006
  }
1030
- #m(t, e) {
1031
- const { month: s, day: i } = I(t);
1032
- if (e.type === "month" && (s < 0 || s > 12))
1033
- return u.date.messages.invalidMonth;
1034
- if (e.type === "day" && (i < 0 || i > 31))
1035
- return u.date.messages.invalidDay(31, "any month");
1007
+ #m(t, s) {
1008
+ const { month: e, day: i } = S(t);
1009
+ if (s.type === "month" && (e < 0 || e > 12))
1010
+ return h.date.messages.invalidMonth;
1011
+ if (s.type === "day" && (i < 0 || i > 31))
1012
+ return h.date.messages.invalidDay(31, "any month");
1036
1013
  }
1037
1014
  #g(t) {
1038
- const { year: e, month: s, day: i } = I(this.#t);
1039
- if (e && s && i) {
1040
- const n = T(e, s);
1015
+ const { year: s, month: e, day: i } = S(this.#t);
1016
+ if (s && e && i) {
1017
+ const n = U(s, e);
1041
1018
  this.#t = { ...this.#t, day: String(Math.min(i, n)).padStart(2, "0") };
1042
1019
  }
1043
1020
  this.value = N(this.#t) ?? t.defaultValue ?? undefined;
1044
1021
  }
1045
1022
  }
1046
1023
 
1047
- class st extends p {
1024
+ class it extends m {
1048
1025
  options;
1049
1026
  cursor = 0;
1050
- #e;
1027
+ #s;
1051
1028
  getGroupItems(t) {
1052
- return this.options.filter((e) => e.group === t);
1029
+ return this.options.filter((s) => s.group === t);
1053
1030
  }
1054
1031
  isGroupSelected(t) {
1055
- const e = this.getGroupItems(t), s = this.value;
1056
- return s === undefined ? false : e.every((i) => s.includes(i.value));
1032
+ const s = this.getGroupItems(t), e = this.value;
1033
+ return e === undefined ? false : s.every((i) => e.includes(i.value));
1057
1034
  }
1058
1035
  toggleValue() {
1059
1036
  const t = this.options[this.cursor];
1060
1037
  if (this.value === undefined && (this.value = []), t.group === true) {
1061
- const e = t.value, s = this.getGroupItems(e);
1062
- this.isGroupSelected(e) ? this.value = this.value.filter((i) => s.findIndex((n) => n.value === i) === -1) : this.value = [...this.value, ...s.map((i) => i.value)], this.value = Array.from(new Set(this.value));
1038
+ const s = t.value, e = this.getGroupItems(s);
1039
+ this.isGroupSelected(s) ? this.value = this.value.filter((i) => e.findIndex((n) => n.value === i) === -1) : this.value = [...this.value, ...e.map((i) => i.value)], this.value = Array.from(new Set(this.value));
1063
1040
  } else {
1064
- const e = this.value.includes(t.value);
1065
- this.value = e ? this.value.filter((s) => s !== t.value) : [...this.value, t.value];
1041
+ const s = this.value.includes(t.value);
1042
+ this.value = s ? this.value.filter((e) => e !== t.value) : [...this.value, t.value];
1066
1043
  }
1067
1044
  }
1068
1045
  constructor(t) {
1069
1046
  super(t, false);
1070
- const { options: e } = t;
1071
- this.#e = t.selectableGroups !== false, this.options = Object.entries(e).flatMap(([s, i]) => [{ value: s, group: true, label: s }, ...i.map((n) => ({ ...n, group: s }))]), this.value = [...t.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: s }) => s === t.cursorAt), this.#e ? 0 : 1), this.on("cursor", (s) => {
1072
- switch (s) {
1047
+ const { options: s } = t;
1048
+ this.#s = t.selectableGroups !== false, this.options = Object.entries(s).flatMap(([e, i]) => [{ value: e, group: true, label: e }, ...i.map((n) => ({ ...n, group: e }))]), this.value = [...t.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: e }) => e === t.cursorAt), this.#s ? 0 : 1), this.on("cursor", (e) => {
1049
+ switch (e) {
1073
1050
  case "left":
1074
1051
  case "up": {
1075
1052
  this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
1076
1053
  const i = this.options[this.cursor]?.group === true;
1077
- !this.#e && i && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);
1054
+ !this.#s && i && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);
1078
1055
  break;
1079
1056
  }
1080
1057
  case "down":
1081
1058
  case "right": {
1082
1059
  this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
1083
1060
  const i = this.options[this.cursor]?.group === true;
1084
- !this.#e && i && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
1061
+ !this.#s && i && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
1085
1062
  break;
1086
1063
  }
1087
1064
  case "space":
@@ -1091,7 +1068,87 @@ class st extends p {
1091
1068
  });
1092
1069
  }
1093
1070
  }
1094
- var it = class extends p {
1071
+
1072
+ class rt extends m {
1073
+ #s = false;
1074
+ #r;
1075
+ focused = "editor";
1076
+ get userInputWithCursor() {
1077
+ if (this.state === "submit")
1078
+ return this.userInput;
1079
+ const t = this.userInput;
1080
+ if (this.cursor >= t.length)
1081
+ return `${t}\u2588`;
1082
+ const s = t.slice(0, this.cursor), e = t[this.cursor], i = t.slice(this.cursor + 1);
1083
+ return e === `
1084
+ ` ? `${s}\u2588
1085
+ ${i}` : `${s}${v("inverse", e)}${i}`;
1086
+ }
1087
+ get cursor() {
1088
+ return this._cursor;
1089
+ }
1090
+ #t(t) {
1091
+ if (this.userInput.length === 0) {
1092
+ this._setUserInput(t);
1093
+ return;
1094
+ }
1095
+ this._setUserInput(this.userInput.slice(0, this.cursor) + t + this.userInput.slice(this.cursor));
1096
+ }
1097
+ #n(t) {
1098
+ const s = this.value ?? "";
1099
+ switch (t) {
1100
+ case "up":
1101
+ this._cursor = I(this._cursor, 0, -1, s);
1102
+ return;
1103
+ case "down":
1104
+ this._cursor = I(this._cursor, 0, 1, s);
1105
+ return;
1106
+ case "left":
1107
+ this._cursor = I(this._cursor, -1, 0, s);
1108
+ return;
1109
+ case "right":
1110
+ this._cursor = I(this._cursor, 1, 0, s);
1111
+ return;
1112
+ }
1113
+ }
1114
+ _shouldSubmit(t, s) {
1115
+ if (this.#r)
1116
+ return this.focused === "submit" ? true : (this.#t(`
1117
+ `), this._cursor++, false);
1118
+ const e = this.#s;
1119
+ return this.#s = true, e ? (this.userInput[this.cursor - 1] === `
1120
+ ` && (this._setUserInput(this.userInput.slice(0, this.cursor - 1) + this.userInput.slice(this.cursor)), this._cursor--), true) : (this.#t(`
1121
+ `), this._cursor++, false);
1122
+ }
1123
+ constructor(t) {
1124
+ super(t, false), this.#r = t.showSubmit ?? false, this.on("key", (s, e) => {
1125
+ if (e?.name && h.actions.has(e.name)) {
1126
+ this.#n(e.name);
1127
+ return;
1128
+ }
1129
+ if (s === "\t" && this.#r) {
1130
+ this.focused = this.focused === "editor" ? "submit" : "editor";
1131
+ return;
1132
+ }
1133
+ if (e?.name !== "return") {
1134
+ if (this.#s = false, e?.name === "backspace" && this.cursor > 0) {
1135
+ this._setUserInput(this.userInput.slice(0, this.cursor - 1) + this.userInput.slice(this.cursor)), this._cursor--;
1136
+ return;
1137
+ }
1138
+ if (e?.name === "delete" && this.cursor < this.userInput.length) {
1139
+ this._setUserInput(this.userInput.slice(0, this.cursor) + this.userInput.slice(this.cursor + 1));
1140
+ return;
1141
+ }
1142
+ s && (this.#r && this.focused === "submit" && (this.focused = "editor"), this.#t(s ?? ""), this._cursor++);
1143
+ }
1144
+ }), this.on("userInput", (s) => {
1145
+ this._setValue(s);
1146
+ }), this.on("finalize", () => {
1147
+ this.value || (this.value = t.defaultValue), this.value === undefined && (this.value = "");
1148
+ });
1149
+ }
1150
+ }
1151
+ var nt = class extends m {
1095
1152
  options;
1096
1153
  cursor = 0;
1097
1154
  get _value() {
@@ -1101,35 +1158,35 @@ var it = class extends p {
1101
1158
  return this.options.filter((t) => t.disabled !== true);
1102
1159
  }
1103
1160
  toggleAll() {
1104
- const t = this._enabledOptions, e = this.value !== undefined && this.value.length === t.length;
1105
- this.value = e ? [] : t.map((s) => s.value);
1161
+ const t = this._enabledOptions, s = this.value !== undefined && this.value.length === t.length;
1162
+ this.value = s ? [] : t.map((e) => e.value);
1106
1163
  }
1107
1164
  toggleInvert() {
1108
1165
  const t = this.value;
1109
1166
  if (!t)
1110
1167
  return;
1111
- const e = this._enabledOptions.filter((s) => !t.includes(s.value));
1112
- this.value = e.map((s) => s.value);
1168
+ const s = this._enabledOptions.filter((e) => !t.includes(e.value));
1169
+ this.value = s.map((e) => e.value);
1113
1170
  }
1114
1171
  toggleValue() {
1115
1172
  this.value === undefined && (this.value = []);
1116
1173
  const t = this.value.includes(this._value);
1117
- this.value = t ? this.value.filter((e) => e !== this._value) : [...this.value, this._value];
1174
+ this.value = t ? this.value.filter((s) => s !== this._value) : [...this.value, this._value];
1118
1175
  }
1119
1176
  constructor(t) {
1120
1177
  super(t, false), this.options = t.options, this.value = [...t.initialValues ?? []];
1121
- const e = Math.max(this.options.findIndex(({ value: s }) => s === t.cursorAt), 0);
1122
- this.cursor = this.options[e].disabled ? d(e, 1, this.options) : e, this.on("key", (s) => {
1123
- s === "a" && this.toggleAll(), s === "i" && this.toggleInvert();
1124
- }), this.on("cursor", (s) => {
1125
- switch (s) {
1178
+ const s = Math.max(this.options.findIndex(({ value: e }) => e === t.cursorAt), 0);
1179
+ this.cursor = this.options[s].disabled ? f(s, 1, this.options) : s, this.on("key", (e) => {
1180
+ e === "a" && this.toggleAll(), e === "i" && this.toggleInvert();
1181
+ }), this.on("cursor", (e) => {
1182
+ switch (e) {
1126
1183
  case "left":
1127
1184
  case "up":
1128
- this.cursor = d(this.cursor, -1, this.options);
1185
+ this.cursor = f(this.cursor, -1, this.options);
1129
1186
  break;
1130
1187
  case "down":
1131
1188
  case "right":
1132
- this.cursor = d(this.cursor, 1, this.options);
1189
+ this.cursor = f(this.cursor, 1, this.options);
1133
1190
  break;
1134
1191
  case "space":
1135
1192
  this.toggleValue();
@@ -1138,7 +1195,7 @@ var it = class extends p {
1138
1195
  });
1139
1196
  }
1140
1197
  };
1141
- class nt extends p {
1198
+ class ut extends m {
1142
1199
  options;
1143
1200
  cursor = 0;
1144
1201
  get _selectedValue() {
@@ -1149,38 +1206,38 @@ class nt extends p {
1149
1206
  }
1150
1207
  constructor(t) {
1151
1208
  super(t, false), this.options = t.options;
1152
- const e = this.options.findIndex(({ value: i }) => i === t.initialValue), s = e === -1 ? 0 : e;
1153
- this.cursor = this.options[s].disabled ? d(s, 1, this.options) : s, this.changeValue(), this.on("cursor", (i) => {
1209
+ const s = this.options.findIndex(({ value: i }) => i === t.initialValue), e = s === -1 ? 0 : s;
1210
+ this.cursor = this.options[e].disabled ? f(e, 1, this.options) : e, this.changeValue(), this.on("cursor", (i) => {
1154
1211
  switch (i) {
1155
1212
  case "left":
1156
1213
  case "up":
1157
- this.cursor = d(this.cursor, -1, this.options);
1214
+ this.cursor = f(this.cursor, -1, this.options);
1158
1215
  break;
1159
1216
  case "down":
1160
1217
  case "right":
1161
- this.cursor = d(this.cursor, 1, this.options);
1218
+ this.cursor = f(this.cursor, 1, this.options);
1162
1219
  break;
1163
1220
  }
1164
1221
  this.changeValue();
1165
1222
  });
1166
1223
  }
1167
1224
  }
1168
- class at extends p {
1225
+ class ht extends m {
1169
1226
  get userInputWithCursor() {
1170
1227
  if (this.state === "submit")
1171
1228
  return this.userInput;
1172
1229
  const t = this.userInput;
1173
1230
  if (this.cursor >= t.length)
1174
1231
  return `${this.userInput}\u2588`;
1175
- const e = t.slice(0, this.cursor), [s, ...i] = t.slice(this.cursor);
1176
- return `${e}${y("inverse", s)}${i.join("")}`;
1232
+ const s = t.slice(0, this.cursor), [e, ...i] = t.slice(this.cursor);
1233
+ return `${s}${v("inverse", e)}${i.join("")}`;
1177
1234
  }
1178
1235
  get cursor() {
1179
1236
  return this._cursor;
1180
1237
  }
1181
1238
  constructor(t) {
1182
- super({ ...t, initialUserInput: t.initialUserInput ?? t.initialValue }), this.on("userInput", (e) => {
1183
- this._setValue(e);
1239
+ super({ ...t, initialUserInput: t.initialUserInput ?? t.initialValue }), this.on("userInput", (s) => {
1240
+ this._setValue(s);
1184
1241
  }), this.on("finalize", () => {
1185
1242
  this.value || (this.value = t.defaultValue), this.value === undefined && (this.value = "");
1186
1243
  });
@@ -1188,332 +1245,335 @@ class at extends p {
1188
1245
  }
1189
1246
 
1190
1247
  // node_modules/@clack/prompts/dist/index.mjs
1191
- import { styleText as t, stripVTControlCharacters as ne } from "util";
1192
- import P2 from "process";
1248
+ import { styleText as e, stripVTControlCharacters as nt2 } from "util";
1249
+ import V2 from "process";
1193
1250
  var import_sisteransi2 = __toESM(require_src(), 1);
1194
- function Ze() {
1195
- return P2.platform !== "win32" ? P2.env.TERM !== "linux" : !!P2.env.CI || !!P2.env.WT_SESSION || !!P2.env.TERMINUS_SUBLIME || P2.env.ConEmuTask === "{cmd::Cmder}" || P2.env.TERM_PROGRAM === "Terminus-Sublime" || P2.env.TERM_PROGRAM === "vscode" || P2.env.TERM === "xterm-256color" || P2.env.TERM === "alacritty" || P2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
1251
+ function ee() {
1252
+ return V2.platform !== "win32" ? V2.env.TERM !== "linux" : !!V2.env.CI || !!V2.env.WT_SESSION || !!V2.env.TERMINUS_SUBLIME || V2.env.ConEmuTask === "{cmd::Cmder}" || V2.env.TERM_PROGRAM === "Terminus-Sublime" || V2.env.TERM_PROGRAM === "vscode" || V2.env.TERM === "xterm-256color" || V2.env.TERM === "alacritty" || V2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
1196
1253
  }
1197
- var ee = Ze();
1198
- var ae = () => process.env.CI === "true";
1199
- var w2 = (e, i) => ee ? e : i;
1200
- var _e = w2("\u25C6", "*");
1201
- var oe = w2("\u25A0", "x");
1202
- var ue = w2("\u25B2", "x");
1203
- var F2 = w2("\u25C7", "o");
1204
- var le = w2("\u250C", "T");
1205
- var d2 = w2("\u2502", "|");
1206
- var E2 = w2("\u2514", "\u2014");
1207
- var Ie = w2("\u2510", "T");
1208
- var Ee = w2("\u2518", "\u2014");
1254
+ var tt2 = ee();
1255
+ var ot2 = () => process.env.CI === "true";
1256
+ var w2 = (t, i) => tt2 ? t : i;
1257
+ var Tt = w2("\u25C6", "*");
1258
+ var at2 = w2("\u25A0", "x");
1259
+ var ut2 = w2("\u25B2", "x");
1260
+ var H2 = w2("\u25C7", "o");
1261
+ var lt = w2("\u250C", "T");
1262
+ var $2 = w2("\u2502", "|");
1263
+ var x2 = w2("\u2514", "\u2014");
1264
+ var _t = w2("\u2510", "T");
1265
+ var xt = w2("\u2518", "\u2014");
1209
1266
  var z2 = w2("\u25CF", ">");
1210
- var H2 = w2("\u25CB", " ");
1211
- var te = w2("\u25FB", "[\u2022]");
1212
- var U = w2("\u25FC", "[+]");
1213
- var J2 = w2("\u25FB", "[ ]");
1214
- var xe = w2("\u25AA", "\u2022");
1215
- var se = w2("\u2500", "-");
1216
- var ce = w2("\u256E", "+");
1217
- var Ge = w2("\u251C", "+");
1218
- var $e = w2("\u256F", "+");
1219
- var de = w2("\u2570", "+");
1220
- var Oe = w2("\u256D", "+");
1221
- var he = w2("\u25CF", "\u2022");
1222
- var pe = w2("\u25C6", "*");
1223
- var me = w2("\u25B2", "!");
1224
- var ge = w2("\u25A0", "x");
1225
- var V2 = (e) => {
1226
- switch (e) {
1267
+ var U2 = w2("\u25CB", " ");
1268
+ var et2 = w2("\u25FB", "[\u2022]");
1269
+ var K2 = w2("\u25FC", "[+]");
1270
+ var Y2 = w2("\u25FB", "[ ]");
1271
+ var Et = w2("\u25AA", "\u2022");
1272
+ var st2 = w2("\u2500", "-");
1273
+ var ct = w2("\u256E", "+");
1274
+ var Gt = w2("\u251C", "+");
1275
+ var $t = w2("\u256F", "+");
1276
+ var dt = w2("\u2570", "+");
1277
+ var Mt = w2("\u256D", "+");
1278
+ var ht2 = w2("\u25CF", "\u2022");
1279
+ var pt = w2("\u25C6", "*");
1280
+ var mt = w2("\u25B2", "!");
1281
+ var gt = w2("\u25A0", "x");
1282
+ var P2 = (t) => {
1283
+ switch (t) {
1227
1284
  case "initial":
1228
1285
  case "active":
1229
- return t("cyan", _e);
1286
+ return e("cyan", Tt);
1230
1287
  case "cancel":
1231
- return t("red", oe);
1288
+ return e("red", at2);
1232
1289
  case "error":
1233
- return t("yellow", ue);
1290
+ return e("yellow", ut2);
1234
1291
  case "submit":
1235
- return t("green", F2);
1292
+ return e("green", H2);
1236
1293
  }
1237
1294
  };
1238
- var ye = (e) => {
1239
- switch (e) {
1295
+ var yt = (t) => {
1296
+ switch (t) {
1240
1297
  case "initial":
1241
1298
  case "active":
1242
- return t("cyan", d2);
1299
+ return e("cyan", $2);
1243
1300
  case "cancel":
1244
- return t("red", d2);
1301
+ return e("red", $2);
1245
1302
  case "error":
1246
- return t("yellow", d2);
1303
+ return e("yellow", $2);
1247
1304
  case "submit":
1248
- return t("green", d2);
1305
+ return e("green", $2);
1249
1306
  }
1250
1307
  };
1251
- var et2 = (e, i, s, r, u2) => {
1252
- let n = i, o = 0;
1253
- for (let c2 = s;c2 < r; c2++) {
1254
- const a = e[c2];
1255
- if (n = n - a.length, o++, n <= u2)
1256
- break;
1257
- }
1258
- return { lineCount: n, removals: o };
1308
+ var Ot = (t, i, s, r, u, n = false) => {
1309
+ let a = i, c = 0;
1310
+ if (n)
1311
+ for (let o = r - 1;o >= s && (a -= t[o].length, c++, !(a <= u)); o--)
1312
+ ;
1313
+ else
1314
+ for (let o = s;o < r && (a -= t[o].length, c++, !(a <= u)); o++)
1315
+ ;
1316
+ return { lineCount: a, removals: c };
1259
1317
  };
1260
- var Y2 = ({ cursor: e, options: i, style: s, output: r = process.stdout, maxItems: u2 = Number.POSITIVE_INFINITY, columnPadding: n = 0, rowPadding: o = 4 }) => {
1261
- const c2 = O(r) - n, a = A(r), l = t("dim", "..."), $2 = Math.max(a - o, 0), y2 = Math.max(Math.min(u2, $2), 5);
1318
+ var F2 = ({ cursor: t, options: i, style: s, output: r = process.stdout, maxItems: u = Number.POSITIVE_INFINITY, columnPadding: n = 0, rowPadding: a = 4 }) => {
1319
+ const c = A(r) - n, o = L(r), l = e("dim", "..."), d = Math.max(o - a, 0), g = Math.max(Math.min(u, d), 5);
1262
1320
  let p2 = 0;
1263
- e >= y2 - 3 && (p2 = Math.max(Math.min(e - y2 + 3, i.length - y2), 0));
1264
- let m = y2 < i.length && p2 > 0, g = y2 < i.length && p2 + y2 < i.length;
1265
- const S2 = Math.min(p2 + y2, i.length), h = [];
1266
- let f = 0;
1267
- m && f++, g && f++;
1268
- const v = p2 + (m ? 1 : 0), T2 = S2 - (g ? 1 : 0);
1269
- for (let b = v;b < T2; b++) {
1270
- const x = wrapAnsi(s(i[b], b === e), c2, { hard: true, trim: false }).split(`
1321
+ t >= g - 3 && (p2 = Math.max(Math.min(t - g + 3, i.length - g), 0));
1322
+ let f2 = g < i.length && p2 > 0, h2 = g < i.length && p2 + g < i.length;
1323
+ const I2 = Math.min(p2 + g, i.length), m2 = [];
1324
+ let y = 0;
1325
+ f2 && y++, h2 && y++;
1326
+ const v2 = p2 + (f2 ? 1 : 0), C2 = I2 - (h2 ? 1 : 0);
1327
+ for (let b2 = v2;b2 < C2; b2++) {
1328
+ const G2 = wrapAnsi(s(i[b2], b2 === t), c, { hard: true, trim: false }).split(`
1271
1329
  `);
1272
- h.push(x), f += x.length;
1273
- }
1274
- if (f > $2) {
1275
- let b = 0, x = 0, G2 = f;
1276
- const M2 = e - v, R2 = (j2, D2) => et2(h, G2, j2, D2, $2);
1277
- m ? ({ lineCount: G2, removals: b } = R2(0, M2), G2 > $2 && ({ lineCount: G2, removals: x } = R2(M2 + 1, h.length))) : ({ lineCount: G2, removals: x } = R2(M2 + 1, h.length), G2 > $2 && ({ lineCount: G2, removals: b } = R2(0, M2))), b > 0 && (m = true, h.splice(0, b)), x > 0 && (g = true, h.splice(h.length - x, x));
1278
- }
1279
- const C2 = [];
1280
- m && C2.push(l);
1281
- for (const b of h)
1282
- for (const x of b)
1283
- C2.push(x);
1284
- return g && C2.push(l), C2;
1330
+ m2.push(G2), y += G2.length;
1331
+ }
1332
+ if (y > d) {
1333
+ let b2 = 0, G2 = 0, M = y;
1334
+ const N2 = t - v2;
1335
+ let O2 = d;
1336
+ const j2 = () => Ot(m2, M, 0, N2, O2), k2 = () => Ot(m2, M, N2 + 1, m2.length, O2, true);
1337
+ f2 ? ({ lineCount: M, removals: b2 } = j2(), M > O2 && (h2 || (O2 -= 1), { lineCount: M, removals: G2 } = k2())) : (h2 || (O2 -= 1), { lineCount: M, removals: G2 } = k2(), M > O2 && (O2 -= 1, { lineCount: M, removals: b2 } = j2())), b2 > 0 && (f2 = true, m2.splice(0, b2)), G2 > 0 && (h2 = true, m2.splice(m2.length - G2, G2));
1338
+ }
1339
+ const S2 = [];
1340
+ f2 && S2.push(l);
1341
+ for (const b2 of m2)
1342
+ for (const G2 of b2)
1343
+ S2.push(G2);
1344
+ return h2 && S2.push(l), S2;
1285
1345
  };
1286
- var ot2 = (e) => {
1287
- const i = e.active ?? "Yes", s = e.inactive ?? "No";
1288
- return new Q({ active: i, inactive: s, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue ?? true, render() {
1289
- const r = e.withGuide ?? u.withGuide, u2 = `${V2(this.state)} `, n = r ? `${t("gray", d2)} ` : "", o = R(e.output, e.message, n, u2), c2 = `${r ? `${t("gray", d2)}
1290
- ` : ""}${o}
1291
- `, a = this.value ? i : s;
1346
+ var ue = (t) => {
1347
+ const i = t.active ?? "Yes", s = t.inactive ?? "No";
1348
+ return new X2({ active: i, inactive: s, signal: t.signal, input: t.input, output: t.output, initialValue: t.initialValue ?? true, render() {
1349
+ const r = t.withGuide ?? h.withGuide, u = `${P2(this.state)} `, n = r ? `${e("gray", $2)} ` : "", a = W(t.output, t.message, n, u), c = `${r ? `${e("gray", $2)}
1350
+ ` : ""}${a}
1351
+ `, o = this.value ? i : s;
1292
1352
  switch (this.state) {
1293
1353
  case "submit": {
1294
- const l = r ? `${t("gray", d2)} ` : "";
1295
- return `${c2}${l}${t("dim", a)}`;
1354
+ const l = r ? `${e("gray", $2)} ` : "";
1355
+ return `${c}${l}${e("dim", o)}`;
1296
1356
  }
1297
1357
  case "cancel": {
1298
- const l = r ? `${t("gray", d2)} ` : "";
1299
- return `${c2}${l}${t(["strikethrough", "dim"], a)}${r ? `
1300
- ${t("gray", d2)}` : ""}`;
1358
+ const l = r ? `${e("gray", $2)} ` : "";
1359
+ return `${c}${l}${e(["strikethrough", "dim"], o)}${r ? `
1360
+ ${e("gray", $2)}` : ""}`;
1301
1361
  }
1302
1362
  default: {
1303
- const l = r ? `${t("cyan", d2)} ` : "", $2 = r ? t("cyan", E2) : "";
1304
- return `${c2}${l}${this.value ? `${t("green", z2)} ${i}` : `${t("dim", H2)} ${t("dim", i)}`}${e.vertical ? r ? `
1305
- ${t("cyan", d2)} ` : `
1306
- ` : ` ${t("dim", "/")} `}${this.value ? `${t("dim", H2)} ${t("dim", s)}` : `${t("green", z2)} ${s}`}
1307
- ${$2}
1363
+ const l = r ? `${e("cyan", $2)} ` : "", d = r ? e("cyan", x2) : "";
1364
+ return `${c}${l}${this.value ? `${e("green", z2)} ${i}` : `${e("dim", U2)} ${e("dim", i)}`}${t.vertical ? r ? `
1365
+ ${e("cyan", $2)} ` : `
1366
+ ` : ` ${e("dim", "/")} `}${this.value ? `${e("dim", U2)} ${e("dim", s)}` : `${e("green", z2)} ${s}`}
1367
+ ${d}
1308
1368
  `;
1309
1369
  }
1310
1370
  }
1311
1371
  } }).prompt();
1312
1372
  };
1313
- var pt = (e = "", i) => {
1314
- const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${t("gray", E2)} ` : "";
1315
- s.write(`${r}${t("red", e)}
1373
+ var me = (t = "", i) => {
1374
+ const s = i?.output ?? process.stdout, r = i?.withGuide ?? h.withGuide ? `${e("gray", x2)} ` : "";
1375
+ s.write(`${r}${e("red", t)}
1316
1376
 
1317
1377
  `);
1318
1378
  };
1319
- var mt = (e = "", i) => {
1320
- const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${t("gray", le)} ` : "";
1321
- s.write(`${r}${e}
1379
+ var ge = (t = "", i) => {
1380
+ const s = i?.output ?? process.stdout, r = i?.withGuide ?? h.withGuide ? `${e("gray", lt)} ` : "";
1381
+ s.write(`${r}${t}
1322
1382
  `);
1323
1383
  };
1324
- var gt = (e = "", i) => {
1325
- const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${t("gray", d2)}
1326
- ${t("gray", E2)} ` : "";
1327
- s.write(`${r}${e}
1384
+ var ye = (t = "", i) => {
1385
+ const s = i?.output ?? process.stdout, r = i?.withGuide ?? h.withGuide ? `${e("gray", $2)}
1386
+ ${e("gray", x2)} ` : "";
1387
+ s.write(`${r}${t}
1328
1388
 
1329
1389
  `);
1330
1390
  };
1331
- var Q2 = (e, i) => e.split(`
1391
+ var Q2 = (t, i) => t.split(`
1332
1392
  `).map((s) => i(s)).join(`
1333
1393
  `);
1334
- var yt = (e) => {
1335
- const i = (r, u2) => {
1394
+ var ve = (t) => {
1395
+ const i = (r, u) => {
1336
1396
  const n = r.label ?? String(r.value);
1337
- return u2 === "disabled" ? `${t("gray", J2)} ${Q2(n, (o) => t(["strikethrough", "gray"], o))}${r.hint ? ` ${t("dim", `(${r.hint ?? "disabled"})`)}` : ""}` : u2 === "active" ? `${t("cyan", te)} ${n}${r.hint ? ` ${t("dim", `(${r.hint})`)}` : ""}` : u2 === "selected" ? `${t("green", U)} ${Q2(n, (o) => t("dim", o))}${r.hint ? ` ${t("dim", `(${r.hint})`)}` : ""}` : u2 === "cancelled" ? `${Q2(n, (o) => t(["strikethrough", "dim"], o))}` : u2 === "active-selected" ? `${t("green", U)} ${n}${r.hint ? ` ${t("dim", `(${r.hint})`)}` : ""}` : u2 === "submitted" ? `${Q2(n, (o) => t("dim", o))}` : `${t("dim", J2)} ${Q2(n, (o) => t("dim", o))}`;
1338
- }, s = e.required ?? true;
1339
- return new it({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValues: e.initialValues, required: s, cursorAt: e.cursorAt, validate(r) {
1397
+ return u === "disabled" ? `${e("gray", Y2)} ${Q2(n, (a) => e(["strikethrough", "gray"], a))}${r.hint ? ` ${e("dim", `(${r.hint ?? "disabled"})`)}` : ""}` : u === "active" ? `${e("cyan", et2)} ${n}${r.hint ? ` ${e("dim", `(${r.hint})`)}` : ""}` : u === "selected" ? `${e("green", K2)} ${Q2(n, (a) => e("dim", a))}${r.hint ? ` ${e("dim", `(${r.hint})`)}` : ""}` : u === "cancelled" ? `${Q2(n, (a) => e(["strikethrough", "dim"], a))}` : u === "active-selected" ? `${e("green", K2)} ${n}${r.hint ? ` ${e("dim", `(${r.hint})`)}` : ""}` : u === "submitted" ? `${Q2(n, (a) => e("dim", a))}` : `${e("dim", Y2)} ${Q2(n, (a) => e("dim", a))}`;
1398
+ }, s = t.required ?? true;
1399
+ return new nt({ options: t.options, signal: t.signal, input: t.input, output: t.output, initialValues: t.initialValues, required: s, cursorAt: t.cursorAt, validate(r) {
1340
1400
  if (s && (r === undefined || r.length === 0))
1341
1401
  return `Please select at least one option.
1342
- ${t("reset", t("dim", `Press ${t(["gray", "bgWhite", "inverse"], " space ")} to select, ${t("gray", t("bgWhite", t("inverse", " enter ")))} to submit`))}`;
1402
+ ${e("reset", e("dim", `Press ${e(["gray", "bgWhite", "inverse"], " space ")} to select, ${e("gray", e("bgWhite", e("inverse", " enter ")))} to submit`))}`;
1343
1403
  }, render() {
1344
- const r = e.withGuide ?? u.withGuide, u2 = R(e.output, e.message, r ? `${ye(this.state)} ` : "", `${V2(this.state)} `), n = `${r ? `${t("gray", d2)}
1345
- ` : ""}${u2}
1346
- `, o = this.value ?? [], c2 = (a, l) => {
1347
- if (a.disabled)
1348
- return i(a, "disabled");
1349
- const $2 = o.includes(a.value);
1350
- return l && $2 ? i(a, "active-selected") : $2 ? i(a, "selected") : i(a, l ? "active" : "inactive");
1404
+ const r = t.withGuide ?? h.withGuide, u = W(t.output, t.message, r ? `${yt(this.state)} ` : "", `${P2(this.state)} `), n = `${r ? `${e("gray", $2)}
1405
+ ` : ""}${u}
1406
+ `, a = this.value ?? [], c = (o, l) => {
1407
+ if (o.disabled)
1408
+ return i(o, "disabled");
1409
+ const d = a.includes(o.value);
1410
+ return l && d ? i(o, "active-selected") : d ? i(o, "selected") : i(o, l ? "active" : "inactive");
1351
1411
  };
1352
1412
  switch (this.state) {
1353
1413
  case "submit": {
1354
- const a = this.options.filter(({ value: $2 }) => o.includes($2)).map(($2) => i($2, "submitted")).join(t("dim", ", ")) || t("dim", "none"), l = R(e.output, a, r ? `${t("gray", d2)} ` : "");
1414
+ const o = this.options.filter(({ value: d }) => a.includes(d)).map((d) => i(d, "submitted")).join(e("dim", ", ")) || e("dim", "none"), l = W(t.output, o, r ? `${e("gray", $2)} ` : "");
1355
1415
  return `${n}${l}`;
1356
1416
  }
1357
1417
  case "cancel": {
1358
- const a = this.options.filter(({ value: $2 }) => o.includes($2)).map(($2) => i($2, "cancelled")).join(t("dim", ", "));
1359
- if (a.trim() === "")
1360
- return `${n}${t("gray", d2)}`;
1361
- const l = R(e.output, a, r ? `${t("gray", d2)} ` : "");
1418
+ const o = this.options.filter(({ value: d }) => a.includes(d)).map((d) => i(d, "cancelled")).join(e("dim", ", "));
1419
+ if (o.trim() === "")
1420
+ return `${n}${e("gray", $2)}`;
1421
+ const l = W(t.output, o, r ? `${e("gray", $2)} ` : "");
1362
1422
  return `${n}${l}${r ? `
1363
- ${t("gray", d2)}` : ""}`;
1423
+ ${e("gray", $2)}` : ""}`;
1364
1424
  }
1365
1425
  case "error": {
1366
- const a = r ? `${t("yellow", d2)} ` : "", l = this.error.split(`
1367
- `).map((p2, m) => m === 0 ? `${r ? `${t("yellow", E2)} ` : ""}${t("yellow", p2)}` : ` ${p2}`).join(`
1368
- `), $2 = n.split(`
1369
- `).length, y2 = l.split(`
1426
+ const o = r ? `${e("yellow", $2)} ` : "", l = this.error.split(`
1427
+ `).map((p2, f2) => f2 === 0 ? `${r ? `${e("yellow", x2)} ` : ""}${e("yellow", p2)}` : ` ${p2}`).join(`
1428
+ `), d = n.split(`
1429
+ `).length, g = l.split(`
1370
1430
  `).length + 1;
1371
- return `${n}${a}${Y2({ output: e.output, options: this.options, cursor: this.cursor, maxItems: e.maxItems, columnPadding: a.length, rowPadding: $2 + y2, style: c2 }).join(`
1372
- ${a}`)}
1431
+ return `${n}${o}${F2({ output: t.output, options: this.options, cursor: this.cursor, maxItems: t.maxItems, columnPadding: o.length, rowPadding: d + g, style: c }).join(`
1432
+ ${o}`)}
1373
1433
  ${l}
1374
1434
  `;
1375
1435
  }
1376
1436
  default: {
1377
- const a = r ? `${t("cyan", d2)} ` : "", l = n.split(`
1378
- `).length, $2 = r ? 2 : 1;
1379
- return `${n}${a}${Y2({ output: e.output, options: this.options, cursor: this.cursor, maxItems: e.maxItems, columnPadding: a.length, rowPadding: l + $2, style: c2 }).join(`
1380
- ${a}`)}
1381
- ${r ? t("cyan", E2) : ""}
1437
+ const o = r ? `${e("cyan", $2)} ` : "", l = n.split(`
1438
+ `).length, d = r ? 2 : 1;
1439
+ return `${n}${o}${F2({ output: t.output, options: this.options, cursor: this.cursor, maxItems: t.maxItems, columnPadding: o.length, rowPadding: l + d, style: c }).join(`
1440
+ ${o}`)}
1441
+ ${r ? e("cyan", x2) : ""}
1382
1442
  `;
1383
1443
  }
1384
1444
  }
1385
1445
  } }).prompt();
1386
1446
  };
1387
- var Ct = (e) => t("magenta", e);
1388
- var fe = ({ indicator: e = "dots", onCancel: i, output: s = process.stdout, cancelMessage: r, errorMessage: u2, frames: n = ee ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], delay: o = ee ? 80 : 120, signal: c2, ...a } = {}) => {
1389
- const l = ae();
1390
- let $2, y2, p2 = false, m = false, g = "", S2, h = performance.now();
1391
- const f = O(s), v = a?.styleFrame ?? Ct, T2 = (_2) => {
1392
- const A2 = _2 > 1 ? u2 ?? u.messages.error : r ?? u.messages.cancel;
1393
- m = _2 === 1, p2 && (W2(A2, _2), m && typeof i == "function" && i());
1394
- }, C2 = () => T2(2), b = () => T2(1), x = () => {
1395
- process.on("uncaughtExceptionMonitor", C2), process.on("unhandledRejection", C2), process.on("SIGINT", b), process.on("SIGTERM", b), process.on("exit", T2), c2 && c2.addEventListener("abort", b);
1396
- }, G2 = () => {
1397
- process.removeListener("uncaughtExceptionMonitor", C2), process.removeListener("unhandledRejection", C2), process.removeListener("SIGINT", b), process.removeListener("SIGTERM", b), process.removeListener("exit", T2), c2 && c2.removeEventListener("abort", b);
1398
- }, M2 = () => {
1399
- if (S2 === undefined)
1447
+ var Te = (t) => e("magenta", t);
1448
+ var ft = ({ indicator: t = "dots", onCancel: i, output: s = process.stdout, cancelMessage: r, errorMessage: u, frames: n = tt2 ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], delay: a = tt2 ? 80 : 120, signal: c, ...o } = {}) => {
1449
+ const l = ot2();
1450
+ let d, g, p2 = false, f2 = false, h2 = "", I2, m2 = performance.now();
1451
+ const y = A(s), v2 = o?.styleFrame ?? Te, C2 = (_) => {
1452
+ const A2 = _ > 1 ? u ?? h.messages.error : r ?? h.messages.cancel;
1453
+ f2 = _ === 1, p2 && (W2(A2, _), f2 && typeof i == "function" && i());
1454
+ }, S2 = () => C2(2), b2 = () => C2(1), G2 = () => {
1455
+ process.on("uncaughtExceptionMonitor", S2), process.on("unhandledRejection", S2), process.on("SIGINT", b2), process.on("SIGTERM", b2), process.on("exit", C2), c && c.addEventListener("abort", b2);
1456
+ }, M = () => {
1457
+ process.removeListener("uncaughtExceptionMonitor", S2), process.removeListener("unhandledRejection", S2), process.removeListener("SIGINT", b2), process.removeListener("SIGTERM", b2), process.removeListener("exit", C2), c && c.removeEventListener("abort", b2);
1458
+ }, N2 = () => {
1459
+ if (I2 === undefined)
1400
1460
  return;
1401
1461
  l && s.write(`
1402
1462
  `);
1403
- const _2 = wrapAnsi(S2, f, { hard: true, trim: false }).split(`
1463
+ const _ = wrapAnsi(I2, y, { hard: true, trim: false }).split(`
1404
1464
  `);
1405
- _2.length > 1 && s.write(import_sisteransi2.cursor.up(_2.length - 1)), s.write(import_sisteransi2.cursor.to(0)), s.write(import_sisteransi2.erase.down());
1406
- }, R2 = (_2) => _2.replace(/\.+$/, ""), j2 = (_2) => {
1407
- const A2 = (performance.now() - _2) / 1000, k2 = Math.floor(A2 / 60), L2 = Math.floor(A2 % 60);
1408
- return k2 > 0 ? `[${k2}m ${L2}s]` : `[${L2}s]`;
1409
- }, D2 = a.withGuide ?? u.withGuide, ie = (_2 = "") => {
1410
- p2 = true, $2 = z({ output: s }), g = R2(_2), h = performance.now(), D2 && s.write(`${t("gray", d2)}
1465
+ _.length > 1 && s.write(import_sisteransi2.cursor.up(_.length - 1)), s.write(import_sisteransi2.cursor.to(0)), s.write(import_sisteransi2.erase.down());
1466
+ }, O2 = (_) => _.replace(/\.+$/, ""), j2 = (_) => {
1467
+ const A2 = (performance.now() - _) / 1000, L2 = Math.floor(A2 / 60), D2 = Math.floor(A2 % 60);
1468
+ return L2 > 0 ? `[${L2}m ${D2}s]` : `[${D2}s]`;
1469
+ }, k2 = o.withGuide ?? h.withGuide, rt2 = (_ = "") => {
1470
+ p2 = true, d = R({ output: s }), h2 = O2(_), m2 = performance.now(), k2 && s.write(`${e("gray", $2)}
1411
1471
  `);
1412
- let A2 = 0, k2 = 0;
1413
- x(), y2 = setInterval(() => {
1414
- if (l && g === S2)
1472
+ let A2 = 0, L2 = 0;
1473
+ G2(), g = setInterval(() => {
1474
+ if (l && h2 === I2)
1415
1475
  return;
1416
- M2(), S2 = g;
1417
- const L2 = v(n[A2]);
1476
+ N2(), I2 = h2;
1477
+ const D2 = v2(n[A2]);
1418
1478
  let Z2;
1419
1479
  if (l)
1420
- Z2 = `${L2} ${g}...`;
1421
- else if (e === "timer")
1422
- Z2 = `${L2} ${g} ${j2(h)}`;
1480
+ Z2 = `${D2} ${h2}...`;
1481
+ else if (t === "timer")
1482
+ Z2 = `${D2} ${h2} ${j2(m2)}`;
1423
1483
  else {
1424
- const Be = ".".repeat(Math.floor(k2)).slice(0, 3);
1425
- Z2 = `${L2} ${g}${Be}`;
1484
+ const kt = ".".repeat(Math.floor(L2)).slice(0, 3);
1485
+ Z2 = `${D2} ${h2}${kt}`;
1426
1486
  }
1427
- const Ne = wrapAnsi(Z2, f, { hard: true, trim: false });
1428
- s.write(Ne), A2 = A2 + 1 < n.length ? A2 + 1 : 0, k2 = k2 < 4 ? k2 + 0.125 : 0;
1429
- }, o);
1430
- }, W2 = (_2 = "", A2 = 0, k2 = false) => {
1487
+ const Bt = wrapAnsi(Z2, y, { hard: true, trim: false });
1488
+ s.write(Bt), A2 = A2 + 1 < n.length ? A2 + 1 : 0, L2 = L2 < 4 ? L2 + 0.125 : 0;
1489
+ }, a);
1490
+ }, W2 = (_ = "", A2 = 0, L2 = false) => {
1431
1491
  if (!p2)
1432
1492
  return;
1433
- p2 = false, clearInterval(y2), M2();
1434
- const L2 = A2 === 0 ? t("green", F2) : A2 === 1 ? t("red", oe) : t("red", ue);
1435
- g = _2 ?? g, k2 || (e === "timer" ? s.write(`${L2} ${g} ${j2(h)}
1436
- `) : s.write(`${L2} ${g}
1437
- `)), G2(), $2();
1493
+ p2 = false, clearInterval(g), N2();
1494
+ const D2 = A2 === 0 ? e("green", H2) : A2 === 1 ? e("red", at2) : e("red", ut2);
1495
+ h2 = _ ?? h2, L2 || (t === "timer" ? s.write(`${D2} ${h2} ${j2(m2)}
1496
+ `) : s.write(`${D2} ${h2}
1497
+ `)), M(), d();
1438
1498
  };
1439
- return { start: ie, stop: (_2 = "") => W2(_2, 0), message: (_2 = "") => {
1440
- g = R2(_2 ?? g);
1441
- }, cancel: (_2 = "") => W2(_2, 1), error: (_2 = "") => W2(_2, 2), clear: () => W2("", 0, true), get isCancelled() {
1442
- return m;
1499
+ return { start: rt2, stop: (_ = "") => W2(_, 0), message: (_ = "") => {
1500
+ h2 = O2(_ ?? h2);
1501
+ }, cancel: (_ = "") => W2(_, 1), error: (_ = "") => W2(_, 2), clear: () => W2("", 0, true), get isCancelled() {
1502
+ return f2;
1443
1503
  } };
1444
1504
  };
1445
- var Ve = { light: w2("\u2500", "-"), heavy: w2("\u2501", "="), block: w2("\u2588", "#") };
1446
- var re = (e, i) => e.includes(`
1447
- `) ? e.split(`
1505
+ var jt = { light: w2("\u2500", "-"), heavy: w2("\u2501", "="), block: w2("\u2588", "#") };
1506
+ var it2 = (t, i) => t.includes(`
1507
+ `) ? t.split(`
1448
1508
  `).map((s) => i(s)).join(`
1449
- `) : i(e);
1450
- var _t = (e) => {
1509
+ `) : i(t);
1510
+ var xe = (t) => {
1451
1511
  const i = (s, r) => {
1452
- const u2 = s.label ?? String(s.value);
1512
+ const u = s.label ?? String(s.value);
1453
1513
  switch (r) {
1454
1514
  case "disabled":
1455
- return `${t("gray", H2)} ${re(u2, (n) => t("gray", n))}${s.hint ? ` ${t("dim", `(${s.hint ?? "disabled"})`)}` : ""}`;
1515
+ return `${e("gray", U2)} ${it2(u, (n) => e("gray", n))}${s.hint ? ` ${e("dim", `(${s.hint ?? "disabled"})`)}` : ""}`;
1456
1516
  case "selected":
1457
- return `${re(u2, (n) => t("dim", n))}`;
1517
+ return `${it2(u, (n) => e("dim", n))}`;
1458
1518
  case "active":
1459
- return `${t("green", z2)} ${u2}${s.hint ? ` ${t("dim", `(${s.hint})`)}` : ""}`;
1519
+ return `${e("green", z2)} ${u}${s.hint ? ` ${e("dim", `(${s.hint})`)}` : ""}`;
1460
1520
  case "cancelled":
1461
- return `${re(u2, (n) => t(["strikethrough", "dim"], n))}`;
1521
+ return `${it2(u, (n) => e(["strikethrough", "dim"], n))}`;
1462
1522
  default:
1463
- return `${t("dim", H2)} ${re(u2, (n) => t("dim", n))}`;
1523
+ return `${e("dim", U2)} ${it2(u, (n) => e("dim", n))}`;
1464
1524
  }
1465
1525
  };
1466
- return new nt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue, render() {
1467
- const s = e.withGuide ?? u.withGuide, r = `${V2(this.state)} `, u2 = `${ye(this.state)} `, n = R(e.output, e.message, u2, r), o = `${s ? `${t("gray", d2)}
1526
+ return new ut({ options: t.options, signal: t.signal, input: t.input, output: t.output, initialValue: t.initialValue, render() {
1527
+ const s = t.withGuide ?? h.withGuide, r = `${P2(this.state)} `, u = `${yt(this.state)} `, n = W(t.output, t.message, u, r), a = `${s ? `${e("gray", $2)}
1468
1528
  ` : ""}${n}
1469
1529
  `;
1470
1530
  switch (this.state) {
1471
1531
  case "submit": {
1472
- const c2 = s ? `${t("gray", d2)} ` : "", a = R(e.output, i(this.options[this.cursor], "selected"), c2);
1473
- return `${o}${a}`;
1532
+ const c = s ? `${e("gray", $2)} ` : "", o = W(t.output, i(this.options[this.cursor], "selected"), c);
1533
+ return `${a}${o}`;
1474
1534
  }
1475
1535
  case "cancel": {
1476
- const c2 = s ? `${t("gray", d2)} ` : "", a = R(e.output, i(this.options[this.cursor], "cancelled"), c2);
1477
- return `${o}${a}${s ? `
1478
- ${t("gray", d2)}` : ""}`;
1536
+ const c = s ? `${e("gray", $2)} ` : "", o = W(t.output, i(this.options[this.cursor], "cancelled"), c);
1537
+ return `${a}${o}${s ? `
1538
+ ${e("gray", $2)}` : ""}`;
1479
1539
  }
1480
1540
  default: {
1481
- const c2 = s ? `${t("cyan", d2)} ` : "", a = s ? t("cyan", E2) : "", l = o.split(`
1482
- `).length, $2 = s ? 2 : 1;
1483
- return `${o}${c2}${Y2({ output: e.output, cursor: this.cursor, options: this.options, maxItems: e.maxItems, columnPadding: c2.length, rowPadding: l + $2, style: (y2, p2) => i(y2, y2.disabled ? "disabled" : p2 ? "active" : "inactive") }).join(`
1484
- ${c2}`)}
1485
- ${a}
1541
+ const c = s ? `${e("cyan", $2)} ` : "", o = s ? e("cyan", x2) : "", l = a.split(`
1542
+ `).length, d = s ? 2 : 1;
1543
+ return `${a}${c}${F2({ output: t.output, cursor: this.cursor, options: this.options, maxItems: t.maxItems, columnPadding: c.length, rowPadding: l + d, style: (g, p2) => i(g, g.disabled ? "disabled" : p2 ? "active" : "inactive") }).join(`
1544
+ ${c}`)}
1545
+ ${o}
1486
1546
  `;
1487
1547
  }
1488
1548
  }
1489
1549
  } }).prompt();
1490
1550
  };
1491
- var je = `${t("gray", d2)} `;
1492
- var Ot = (e) => new at({ validate: e.validate, placeholder: e.placeholder, defaultValue: e.defaultValue, initialValue: e.initialValue, output: e.output, signal: e.signal, input: e.input, render() {
1493
- const i = e?.withGuide ?? u.withGuide, s = `${`${i ? `${t("gray", d2)}
1494
- ` : ""}${V2(this.state)} `}${e.message}
1495
- `, r = e.placeholder ? t("inverse", e.placeholder[0]) + t("dim", e.placeholder.slice(1)) : t(["inverse", "hidden"], "_"), u2 = this.userInput ? this.userInputWithCursor : r, n = this.value ?? "";
1551
+ var Nt = `${e("gray", $2)} `;
1552
+ var Pe = (t) => new ht({ validate: t.validate, placeholder: t.placeholder, defaultValue: t.defaultValue, initialValue: t.initialValue, output: t.output, signal: t.signal, input: t.input, render() {
1553
+ const i = t?.withGuide ?? h.withGuide, s = `${`${i ? `${e("gray", $2)}
1554
+ ` : ""}${P2(this.state)} `}${t.message}
1555
+ `, r = t.placeholder ? e("inverse", t.placeholder[0]) + e("dim", t.placeholder.slice(1)) : e(["inverse", "hidden"], "_"), u = this.userInput ? this.userInputWithCursor : r, n = this.value ?? "";
1496
1556
  switch (this.state) {
1497
1557
  case "error": {
1498
- const o = this.error ? ` ${t("yellow", this.error)}` : "", c2 = i ? `${t("yellow", d2)} ` : "", a = i ? t("yellow", E2) : "";
1558
+ const a = this.error ? ` ${e("yellow", this.error)}` : "", c = i ? `${e("yellow", $2)} ` : "", o = i ? e("yellow", x2) : "";
1499
1559
  return `${s.trim()}
1500
- ${c2}${u2}
1501
- ${a}${o}
1560
+ ${c}${u}
1561
+ ${o}${a}
1502
1562
  `;
1503
1563
  }
1504
1564
  case "submit": {
1505
- const o = n ? ` ${t("dim", n)}` : "", c2 = i ? t("gray", d2) : "";
1506
- return `${s}${c2}${o}`;
1565
+ const a = n ? ` ${e("dim", n)}` : "", c = i ? e("gray", $2) : "";
1566
+ return `${s}${c}${a}`;
1507
1567
  }
1508
1568
  case "cancel": {
1509
- const o = n ? ` ${t(["strikethrough", "dim"], n)}` : "", c2 = i ? t("gray", d2) : "";
1510
- return `${s}${c2}${o}${n.trim() ? `
1511
- ${c2}` : ""}`;
1569
+ const a = n ? ` ${e(["strikethrough", "dim"], n)}` : "", c = i ? e("gray", $2) : "";
1570
+ return `${s}${c}${a}${n.trim() ? `
1571
+ ${c}` : ""}`;
1512
1572
  }
1513
1573
  default: {
1514
- const o = i ? `${t("cyan", d2)} ` : "", c2 = i ? t("cyan", E2) : "";
1515
- return `${s}${o}${u2}
1516
- ${c2}
1574
+ const a = i ? `${e("cyan", $2)} ` : "", c = i ? e("cyan", x2) : "";
1575
+ return `${s}${a}${u}
1576
+ ${c}
1517
1577
  `;
1518
1578
  }
1519
1579
  }
@@ -1524,13 +1584,13 @@ async function MultiSelect({
1524
1584
  message,
1525
1585
  options
1526
1586
  }) {
1527
- const selected = await yt({
1587
+ const selected = await ve({
1528
1588
  message,
1529
1589
  options,
1530
1590
  required: true
1531
1591
  });
1532
1592
  if (q(selected)) {
1533
- pt("Operation cancelled.");
1593
+ me("Operation cancelled.");
1534
1594
  process.exit(0);
1535
1595
  }
1536
1596
  return selected;
@@ -1551,9 +1611,7 @@ class AddCommand {
1551
1611
  console.log(`${CHECK({ text: "All changes are either staged or sensitive (like .env)." })}`);
1552
1612
  return;
1553
1613
  }
1554
- const options = [
1555
- ...changes.map((c2) => ({ value: c2.value, label: c2.label }))
1556
- ];
1614
+ const options = changes.map((c) => ({ value: c.value, label: c.label }));
1557
1615
  const selectedChanges = await MultiSelect({
1558
1616
  message: `Select the changes you want to commit.
1559
1617
  ` + BLUE({ text: "[space] to select" }) + `
@@ -1565,7 +1623,7 @@ class AddCommand {
1565
1623
  });
1566
1624
  let selected = selectedChanges.map((file) => file.trim());
1567
1625
  if (selected.includes("all")) {
1568
- selected = changes.map((c2) => c2.value);
1626
+ selected = changes.map((c) => c.value);
1569
1627
  }
1570
1628
  if (selected.length > 0) {
1571
1629
  await this.stageChangesUseCase.execute(selected);
@@ -1692,11 +1750,11 @@ class StageChangesUseCase {
1692
1750
  }
1693
1751
 
1694
1752
  // apps/cli/modules/add/infra/bun-git.repository.ts
1695
- var {$: $2 } = globalThis.Bun;
1753
+ var {$: $3 } = globalThis.Bun;
1696
1754
  class BunGitRepository {
1697
1755
  async getEntries() {
1698
1756
  try {
1699
- const output = await $2`git status --porcelain -z`.quiet().text();
1757
+ const output = await $3`git status --porcelain -z`.quiet().text();
1700
1758
  if (!output.trim()) {
1701
1759
  return [];
1702
1760
  }
@@ -1723,8 +1781,8 @@ async function addCommand() {
1723
1781
  const gitRepository = new BunGitRepository;
1724
1782
  const getChangesUseCase = new GetChangesUseCase(gitRepository);
1725
1783
  const stageChangesUseCase = new StageChangesUseCase(gitRepository);
1726
- const addCommand2 = new AddCommand(getChangesUseCase, stageChangesUseCase);
1727
- await addCommand2.execute();
1784
+ const addCmd = new AddCommand(getChangesUseCase, stageChangesUseCase);
1785
+ await addCmd.execute();
1728
1786
  }
1729
1787
 
1730
1788
  // apps/cli/alias.ts
@@ -1833,7 +1891,7 @@ async function Input({
1833
1891
  message,
1834
1892
  placeholder
1835
1893
  }) {
1836
- const value = await Ot({
1894
+ const value = await Pe({
1837
1895
  message,
1838
1896
  placeholder,
1839
1897
  validate(input) {
@@ -1843,7 +1901,7 @@ async function Input({
1843
1901
  }
1844
1902
  });
1845
1903
  if (q(value)) {
1846
- pt("Operation cancelled.");
1904
+ me("Operation cancelled.");
1847
1905
  process.exit(0);
1848
1906
  }
1849
1907
  return value.trim();
@@ -1854,12 +1912,12 @@ async function Select({
1854
1912
  message,
1855
1913
  options
1856
1914
  }) {
1857
- const selected = await _t({
1915
+ const selected = await xe({
1858
1916
  message,
1859
1917
  options
1860
1918
  });
1861
1919
  if (q(selected)) {
1862
- pt("Operation cancelled.");
1920
+ me("Operation cancelled.");
1863
1921
  process.exit(0);
1864
1922
  }
1865
1923
  return selected;
@@ -1907,8 +1965,8 @@ class BunCommitRepository {
1907
1965
  async function commitCommand() {
1908
1966
  const commitRepository = new BunCommitRepository;
1909
1967
  const commitUseCase = new CommitUseCase(commitRepository);
1910
- const commitCommand2 = new CommitCommand(commitUseCase);
1911
- await commitCommand2.execute();
1968
+ const commitCmd = new CommitCommand(commitUseCase);
1969
+ await commitCmd.execute();
1912
1970
  }
1913
1971
 
1914
1972
  // apps/cli/modules/setup/app/setup-aliases.use-case.ts
@@ -1936,12 +1994,12 @@ async function Confirm({
1936
1994
  cancelMessage,
1937
1995
  exitOnCancel = true
1938
1996
  }) {
1939
- const confirmed = await ot2({
1997
+ const confirmed = await ue({
1940
1998
  message
1941
1999
  });
1942
2000
  if (q(confirmed)) {
1943
2001
  if (exitOnCancel) {
1944
- pt(cancelMessage ?? "Operation cancelled.");
2002
+ me(cancelMessage ?? "Operation cancelled.");
1945
2003
  process.exit(0);
1946
2004
  }
1947
2005
  return null;
@@ -1951,17 +2009,17 @@ async function Confirm({
1951
2009
 
1952
2010
  // apps/cli/utils/intro.ts
1953
2011
  function Intro(message) {
1954
- mt(message);
2012
+ ge(message);
1955
2013
  }
1956
2014
 
1957
2015
  // apps/cli/utils/outro.ts
1958
2016
  function Outro(message) {
1959
- gt(message);
2017
+ ye(message);
1960
2018
  }
1961
2019
 
1962
2020
  // apps/cli/utils/spinner.ts
1963
2021
  function Spinner() {
1964
- return fe();
2022
+ return ft();
1965
2023
  }
1966
2024
 
1967
2025
  // apps/cli/modules/setup/app/setup-command.ts
@@ -2121,8 +2179,8 @@ class BunAliasRepository {
2121
2179
  async function setupCommand() {
2122
2180
  const aliasRepository = new BunAliasRepository;
2123
2181
  const setupAliasesUseCase = new SetupAliasesUseCase(aliasRepository);
2124
- const setupCommand2 = new SetupCommand(setupAliasesUseCase);
2125
- await setupCommand2.execute();
2182
+ const setupCmd = new SetupCommand(setupAliasesUseCase);
2183
+ await setupCmd.execute();
2126
2184
  }
2127
2185
 
2128
2186
  // apps/cli/modules/switch/domain/branch.ts
@@ -2231,11 +2289,11 @@ class SwitchCommand {
2231
2289
  }
2232
2290
 
2233
2291
  // apps/cli/modules/switch/infra/bun-switch-repository.ts
2234
- var {$: $3 } = globalThis.Bun;
2292
+ var {$: $4 } = globalThis.Bun;
2235
2293
  class BunSwitchRepository {
2236
2294
  async getBranches() {
2237
2295
  try {
2238
- const output = await $3`git branch -a`.quiet().text();
2296
+ const output = await $4`git branch -a`.quiet().text();
2239
2297
  if (!output.trim()) {
2240
2298
  return [];
2241
2299
  }
@@ -2261,8 +2319,8 @@ async function switchCommand() {
2261
2319
  const switchRepo = new BunSwitchRepository;
2262
2320
  const switchBranchUseCase = new SwitchBranch(switchRepo);
2263
2321
  const getBranchesUseCase = new GetBranchesUseCase(switchRepo);
2264
- const switchCommand2 = new SwitchCommand(getBranchesUseCase, switchBranchUseCase);
2265
- await switchCommand2.execute();
2322
+ const switchCmd = new SwitchCommand(getBranchesUseCase, switchBranchUseCase);
2323
+ await switchCmd.execute();
2266
2324
  }
2267
2325
 
2268
2326
  // apps/cli/commands-fn.ts
@@ -2276,12 +2334,8 @@ var COMMANDS_FN = {
2276
2334
 
2277
2335
  // apps/cli/index.ts
2278
2336
  var args = Bun.argv.slice(2);
2279
- var command = AVAILABLE_COMMANDS.find((command2) => command2.name === args[0]);
2280
- if (command) {
2281
- if (args.length > 1 && !command.allowGitArgs) {
2282
- console.error("This command does not accept any arguments");
2283
- process.exit(1);
2284
- }
2337
+ var command = AVAILABLE_COMMANDS.find((cmd) => cmd.name === args[0]);
2338
+ if (command && args.length === 1) {
2285
2339
  await COMMANDS_FN[command.name]?.(args.slice(1));
2286
2340
  } else {
2287
2341
  const proc = Bun.spawn(["git", ...args], {