create-rstack 2.1.1 → 2.1.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.
package/dist/index.js CHANGED
@@ -1,13 +1,12 @@
1
1
  import "node:module";
2
- import node_fs from "node:fs";
3
- import node_path, { delimiter, dirname, normalize as external_node_path_normalize, resolve } from "node:path";
2
+ import node_fs, { closeSync, openSync, readSync, statSync } from "node:fs";
3
+ import node_path, { basename, delimiter, dirname, normalize as external_node_path_normalize, resolve } from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import node_util, { styleText } from "node:util";
6
6
  import node_process, { cwd as external_node_process_cwd, stdin, stdout } from "node:process";
7
7
  import node_readline from "node:readline";
8
8
  import node_tty from "node:tty";
9
9
  import node_os from "node:os";
10
- import { createRequire } from "node:module";
11
10
  import { execFileSync, spawn } from "node:child_process";
12
11
  import { pipeline } from "node:stream/promises";
13
12
  import { PassThrough } from "node:stream";
@@ -542,11 +541,20 @@ __webpack_require__.add({
542
541
  module.exports = __rspack_createRequire_require("node:fs/promises");
543
542
  }
544
543
  });
545
- const isAmbiguous = (x)=>0xA1 === x || 0xA4 === x || 0xA7 === x || 0xA8 === x || 0xAA === x || 0xAD === x || 0xAE === x || x >= 0xB0 && x <= 0xB4 || x >= 0xB6 && x <= 0xBA || x >= 0xBC && x <= 0xBF || 0xC6 === x || 0xD0 === x || 0xD7 === x || 0xD8 === x || x >= 0xDE && x <= 0xE1 || 0xE6 === x || x >= 0xE8 && x <= 0xEA || 0xEC === x || 0xED === x || 0xF0 === x || 0xF2 === x || 0xF3 === x || x >= 0xF7 && x <= 0xFA || 0xFC === x || 0xFE === x || 0x101 === x || 0x111 === x || 0x113 === x || 0x11B === x || 0x126 === x || 0x127 === x || 0x12B === x || x >= 0x131 && x <= 0x133 || 0x138 === x || x >= 0x13F && x <= 0x142 || 0x144 === x || x >= 0x148 && x <= 0x14B || 0x14D === x || 0x152 === x || 0x153 === x || 0x166 === x || 0x167 === x || 0x16B === x || 0x1CE === x || 0x1D0 === x || 0x1D2 === x || 0x1D4 === x || 0x1D6 === x || 0x1D8 === x || 0x1DA === x || 0x1DC === x || 0x251 === x || 0x261 === x || 0x2C4 === x || 0x2C7 === x || x >= 0x2C9 && x <= 0x2CB || 0x2CD === x || 0x2D0 === x || x >= 0x2D8 && x <= 0x2DB || 0x2DD === x || 0x2DF === x || x >= 0x300 && x <= 0x36F || x >= 0x391 && x <= 0x3A1 || x >= 0x3A3 && x <= 0x3A9 || x >= 0x3B1 && x <= 0x3C1 || x >= 0x3C3 && x <= 0x3C9 || 0x401 === x || x >= 0x410 && x <= 0x44F || 0x451 === x || 0x2010 === x || x >= 0x2013 && x <= 0x2016 || 0x2018 === x || 0x2019 === x || 0x201C === x || 0x201D === x || x >= 0x2020 && x <= 0x2022 || x >= 0x2024 && x <= 0x2027 || 0x2030 === x || 0x2032 === x || 0x2033 === x || 0x2035 === x || 0x203B === x || 0x203E === x || 0x2074 === x || 0x207F === x || x >= 0x2081 && x <= 0x2084 || 0x20AC === x || 0x2103 === x || 0x2105 === x || 0x2109 === x || 0x2113 === x || 0x2116 === x || 0x2121 === x || 0x2122 === x || 0x2126 === x || 0x212B === x || 0x2153 === x || 0x2154 === x || x >= 0x215B && x <= 0x215E || x >= 0x2160 && x <= 0x216B || x >= 0x2170 && x <= 0x2179 || 0x2189 === x || x >= 0x2190 && x <= 0x2199 || 0x21B8 === x || 0x21B9 === x || 0x21D2 === x || 0x21D4 === x || 0x21E7 === x || 0x2200 === x || 0x2202 === x || 0x2203 === x || 0x2207 === x || 0x2208 === x || 0x220B === x || 0x220F === x || 0x2211 === x || 0x2215 === x || 0x221A === x || x >= 0x221D && x <= 0x2220 || 0x2223 === x || 0x2225 === x || x >= 0x2227 && x <= 0x222C || 0x222E === x || x >= 0x2234 && x <= 0x2237 || 0x223C === x || 0x223D === x || 0x2248 === x || 0x224C === x || 0x2252 === x || 0x2260 === x || 0x2261 === x || x >= 0x2264 && x <= 0x2267 || 0x226A === x || 0x226B === x || 0x226E === x || 0x226F === x || 0x2282 === x || 0x2283 === x || 0x2286 === x || 0x2287 === x || 0x2295 === x || 0x2299 === x || 0x22A5 === x || 0x22BF === x || 0x2312 === x || x >= 0x2460 && x <= 0x24E9 || x >= 0x24EB && x <= 0x254B || x >= 0x2550 && x <= 0x2573 || x >= 0x2580 && x <= 0x258F || x >= 0x2592 && x <= 0x2595 || 0x25A0 === x || 0x25A1 === x || x >= 0x25A3 && x <= 0x25A9 || 0x25B2 === x || 0x25B3 === x || 0x25B6 === x || 0x25B7 === x || 0x25BC === x || 0x25BD === x || 0x25C0 === x || 0x25C1 === x || x >= 0x25C6 && x <= 0x25C8 || 0x25CB === x || x >= 0x25CE && x <= 0x25D1 || x >= 0x25E2 && x <= 0x25E5 || 0x25EF === x || 0x2605 === x || 0x2606 === x || 0x2609 === x || 0x260E === x || 0x260F === x || 0x261C === x || 0x261E === x || 0x2640 === x || 0x2642 === x || 0x2660 === x || 0x2661 === x || x >= 0x2663 && x <= 0x2665 || x >= 0x2667 && x <= 0x266A || 0x266C === x || 0x266D === x || 0x266F === x || 0x269E === x || 0x269F === x || 0x26BF === x || x >= 0x26C6 && x <= 0x26CD || x >= 0x26CF && x <= 0x26D3 || x >= 0x26D5 && x <= 0x26E1 || 0x26E3 === x || 0x26E8 === x || 0x26E9 === x || x >= 0x26EB && x <= 0x26F1 || 0x26F4 === x || x >= 0x26F6 && x <= 0x26F9 || 0x26FB === x || 0x26FC === x || 0x26FE === x || 0x26FF === x || 0x273D === x || x >= 0x2776 && x <= 0x277F || x >= 0x2B56 && x <= 0x2B59 || x >= 0x3248 && x <= 0x324F || x >= 0xE000 && x <= 0xF8FF || x >= 0xFE00 && x <= 0xFE0F || 0xFFFD === x || x >= 0x1F100 && x <= 0x1F10A || x >= 0x1F110 && x <= 0x1F12D || x >= 0x1F130 && x <= 0x1F169 || x >= 0x1F170 && x <= 0x1F18D || 0x1F18F === x || 0x1F190 === x || x >= 0x1F19B && x <= 0x1F1AC || x >= 0xE0100 && x <= 0xE01EF || x >= 0xF0000 && x <= 0xFFFFD || x >= 0x100000 && x <= 0x10FFFD;
544
+ const getCodePointsLength = (()=>{
545
+ const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
546
+ return (input)=>{
547
+ let surrogatePairsNr = 0;
548
+ SURROGATE_PAIR_RE.lastIndex = 0;
549
+ while(SURROGATE_PAIR_RE.test(input))surrogatePairsNr += 1;
550
+ return input.length - surrogatePairsNr;
551
+ };
552
+ })();
546
553
  const isFullWidth = (x)=>0x3000 === x || x >= 0xFF01 && x <= 0xFF60 || x >= 0xFFE0 && x <= 0xFFE6;
547
- const isWide = (x)=>x >= 0x1100 && x <= 0x115F || 0x231A === x || 0x231B === x || 0x2329 === x || 0x232A === x || x >= 0x23E9 && x <= 0x23EC || 0x23F0 === x || 0x23F3 === x || 0x25FD === x || 0x25FE === x || 0x2614 === x || 0x2615 === x || x >= 0x2648 && x <= 0x2653 || 0x267F === x || 0x2693 === x || 0x26A1 === x || 0x26AA === x || 0x26AB === x || 0x26BD === x || 0x26BE === x || 0x26C4 === x || 0x26C5 === x || 0x26CE === x || 0x26D4 === x || 0x26EA === x || 0x26F2 === x || 0x26F3 === x || 0x26F5 === x || 0x26FA === x || 0x26FD === x || 0x2705 === x || 0x270A === x || 0x270B === x || 0x2728 === x || 0x274C === x || 0x274E === x || x >= 0x2753 && x <= 0x2755 || 0x2757 === x || x >= 0x2795 && x <= 0x2797 || 0x27B0 === x || 0x27BF === x || 0x2B1B === x || 0x2B1C === x || 0x2B50 === x || 0x2B55 === x || x >= 0x2E80 && x <= 0x2E99 || x >= 0x2E9B && x <= 0x2EF3 || x >= 0x2F00 && x <= 0x2FD5 || x >= 0x2FF0 && x <= 0x2FFF || x >= 0x3001 && x <= 0x303E || x >= 0x3041 && x <= 0x3096 || x >= 0x3099 && x <= 0x30FF || x >= 0x3105 && x <= 0x312F || x >= 0x3131 && x <= 0x318E || x >= 0x3190 && x <= 0x31E3 || x >= 0x31EF && x <= 0x321E || x >= 0x3220 && x <= 0x3247 || x >= 0x3250 && x <= 0x4DBF || x >= 0x4E00 && x <= 0xA48C || x >= 0xA490 && x <= 0xA4C6 || x >= 0xA960 && x <= 0xA97C || x >= 0xAC00 && x <= 0xD7A3 || x >= 0xF900 && x <= 0xFAFF || x >= 0xFE10 && x <= 0xFE19 || x >= 0xFE30 && x <= 0xFE52 || x >= 0xFE54 && x <= 0xFE66 || x >= 0xFE68 && x <= 0xFE6B || x >= 0x16FE0 && x <= 0x16FE4 || 0x16FF0 === x || 0x16FF1 === x || x >= 0x17000 && x <= 0x187F7 || x >= 0x18800 && x <= 0x18CD5 || x >= 0x18D00 && x <= 0x18D08 || x >= 0x1AFF0 && x <= 0x1AFF3 || x >= 0x1AFF5 && x <= 0x1AFFB || 0x1AFFD === x || 0x1AFFE === x || x >= 0x1B000 && x <= 0x1B122 || 0x1B132 === x || x >= 0x1B150 && x <= 0x1B152 || 0x1B155 === x || x >= 0x1B164 && x <= 0x1B167 || x >= 0x1B170 && x <= 0x1B2FB || 0x1F004 === x || 0x1F0CF === x || 0x1F18E === x || x >= 0x1F191 && x <= 0x1F19A || x >= 0x1F200 && x <= 0x1F202 || x >= 0x1F210 && x <= 0x1F23B || x >= 0x1F240 && x <= 0x1F248 || 0x1F250 === x || 0x1F251 === x || x >= 0x1F260 && x <= 0x1F265 || x >= 0x1F300 && x <= 0x1F320 || x >= 0x1F32D && x <= 0x1F335 || x >= 0x1F337 && x <= 0x1F37C || x >= 0x1F37E && x <= 0x1F393 || x >= 0x1F3A0 && x <= 0x1F3CA || x >= 0x1F3CF && x <= 0x1F3D3 || x >= 0x1F3E0 && x <= 0x1F3F0 || 0x1F3F4 === x || x >= 0x1F3F8 && x <= 0x1F43E || 0x1F440 === x || x >= 0x1F442 && x <= 0x1F4FC || x >= 0x1F4FF && x <= 0x1F53D || x >= 0x1F54B && x <= 0x1F54E || x >= 0x1F550 && x <= 0x1F567 || 0x1F57A === x || 0x1F595 === x || 0x1F596 === x || 0x1F5A4 === x || x >= 0x1F5FB && x <= 0x1F64F || x >= 0x1F680 && x <= 0x1F6C5 || 0x1F6CC === x || x >= 0x1F6D0 && x <= 0x1F6D2 || x >= 0x1F6D5 && x <= 0x1F6D7 || x >= 0x1F6DC && x <= 0x1F6DF || 0x1F6EB === x || 0x1F6EC === x || x >= 0x1F6F4 && x <= 0x1F6FC || x >= 0x1F7E0 && x <= 0x1F7EB || 0x1F7F0 === x || x >= 0x1F90C && x <= 0x1F93A || x >= 0x1F93C && x <= 0x1F945 || x >= 0x1F947 && x <= 0x1F9FF || x >= 0x1FA70 && x <= 0x1FA7C || x >= 0x1FA80 && x <= 0x1FA88 || x >= 0x1FA90 && x <= 0x1FABD || x >= 0x1FABF && x <= 0x1FAC5 || x >= 0x1FACE && x <= 0x1FADB || x >= 0x1FAE0 && x <= 0x1FAE8 || x >= 0x1FAF0 && x <= 0x1FAF8 || x >= 0x20000 && x <= 0x2FFFD || x >= 0x30000 && x <= 0x3FFFD;
548
- const ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
554
+ const isWideNotCJKTNotEmoji = (x)=>0x231B === x || 0x2329 === x || x >= 0x2FF0 && x <= 0x2FFF || x >= 0x3001 && x <= 0x303E || x >= 0x3099 && x <= 0x30FF || x >= 0x3105 && x <= 0x312F || x >= 0x3131 && x <= 0x318E || x >= 0x3190 && x <= 0x31E3 || x >= 0x31EF && x <= 0x321E || x >= 0x3220 && x <= 0x3247 || x >= 0x3250 && x <= 0x4DBF || x >= 0xFE10 && x <= 0xFE19 || x >= 0xFE30 && x <= 0xFE52 || x >= 0xFE54 && x <= 0xFE66 || x >= 0xFE68 && x <= 0xFE6B || x >= 0x1F200 && x <= 0x1F202 || x >= 0x1F210 && x <= 0x1F23B || x >= 0x1F240 && x <= 0x1F248 || x >= 0x20000 && x <= 0x2FFFD || x >= 0x30000 && x <= 0x3FFFD;
555
+ const ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
549
556
  const CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
557
+ const CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu;
550
558
  const TAB_RE = /\t{1,1000}/y;
551
559
  const EMOJI_RE = /[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu;
552
560
  const LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
@@ -559,14 +567,39 @@ const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {
559
567
  const LIMIT = truncationOptions.limit ?? 1 / 0;
560
568
  const ELLIPSIS = truncationOptions.ellipsis ?? '';
561
569
  const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
562
- const ANSI_WIDTH = widthOptions.ansiWidth ?? 0;
570
+ const ANSI_WIDTH = 0;
563
571
  const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
564
572
  const TAB_WIDTH = widthOptions.tabWidth ?? 8;
565
- const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;
566
573
  const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
567
- const FULL_WIDTH_WIDTH = widthOptions.fullWidthWidth ?? 2;
574
+ const FULL_WIDTH_WIDTH = 2;
568
575
  const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
569
- const WIDE_WIDTH = widthOptions.wideWidth ?? 2;
576
+ const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
577
+ const PARSE_BLOCKS = [
578
+ [
579
+ LATIN_RE,
580
+ REGULAR_WIDTH
581
+ ],
582
+ [
583
+ ANSI_RE,
584
+ ANSI_WIDTH
585
+ ],
586
+ [
587
+ CONTROL_RE,
588
+ CONTROL_WIDTH
589
+ ],
590
+ [
591
+ TAB_RE,
592
+ TAB_WIDTH
593
+ ],
594
+ [
595
+ EMOJI_RE,
596
+ EMOJI_WIDTH
597
+ ],
598
+ [
599
+ CJKT_WIDE_RE,
600
+ WIDE_WIDTH
601
+ ]
602
+ ];
570
603
  let indexPrev = 0;
571
604
  let index = 0;
572
605
  let length = input.length;
@@ -584,7 +617,7 @@ const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {
584
617
  lengthExtra = 0;
585
618
  for (const char of unmatched.replaceAll(MODIFIER_RE, '')){
586
619
  const codePoint = char.codePointAt(0) || 0;
587
- widthExtra = isFullWidth(codePoint) ? FULL_WIDTH_WIDTH : isWide(codePoint) ? WIDE_WIDTH : AMBIGUOUS_WIDTH !== REGULAR_WIDTH && isAmbiguous(codePoint) ? AMBIGUOUS_WIDTH : REGULAR_WIDTH;
620
+ widthExtra = isFullWidth(codePoint) ? FULL_WIDTH_WIDTH : isWideNotCJKTNotEmoji(codePoint) ? WIDE_WIDTH : REGULAR_WIDTH;
588
621
  if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);
589
622
  if (width + widthExtra > LIMIT) {
590
623
  truncationEnabled = true;
@@ -596,76 +629,23 @@ const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {
596
629
  unmatchedStart = unmatchedEnd = 0;
597
630
  }
598
631
  if (index >= length) break;
599
- LATIN_RE.lastIndex = index;
600
- if (LATIN_RE.test(input)) {
601
- lengthExtra = LATIN_RE.lastIndex - index;
602
- widthExtra = lengthExtra * REGULAR_WIDTH;
603
- if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / REGULAR_WIDTH));
604
- if (width + widthExtra > LIMIT) {
605
- truncationEnabled = true;
606
- break;
607
- }
608
- width += widthExtra;
609
- unmatchedStart = indexPrev;
610
- unmatchedEnd = index;
611
- index = indexPrev = LATIN_RE.lastIndex;
612
- continue;
613
- }
614
- ANSI_RE.lastIndex = index;
615
- if (ANSI_RE.test(input)) {
616
- if (width + ANSI_WIDTH > truncationLimit) truncationIndex = Math.min(truncationIndex, index);
617
- if (width + ANSI_WIDTH > LIMIT) {
618
- truncationEnabled = true;
619
- break;
620
- }
621
- width += ANSI_WIDTH;
622
- unmatchedStart = indexPrev;
623
- unmatchedEnd = index;
624
- index = indexPrev = ANSI_RE.lastIndex;
625
- continue;
626
- }
627
- CONTROL_RE.lastIndex = index;
628
- if (CONTROL_RE.test(input)) {
629
- lengthExtra = CONTROL_RE.lastIndex - index;
630
- widthExtra = lengthExtra * CONTROL_WIDTH;
631
- if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / CONTROL_WIDTH));
632
- if (width + widthExtra > LIMIT) {
633
- truncationEnabled = true;
634
- break;
635
- }
636
- width += widthExtra;
637
- unmatchedStart = indexPrev;
638
- unmatchedEnd = index;
639
- index = indexPrev = CONTROL_RE.lastIndex;
640
- continue;
641
- }
642
- TAB_RE.lastIndex = index;
643
- if (TAB_RE.test(input)) {
644
- lengthExtra = TAB_RE.lastIndex - index;
645
- widthExtra = lengthExtra * TAB_WIDTH;
646
- if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / TAB_WIDTH));
647
- if (width + widthExtra > LIMIT) {
648
- truncationEnabled = true;
649
- break;
650
- }
651
- width += widthExtra;
652
- unmatchedStart = indexPrev;
653
- unmatchedEnd = index;
654
- index = indexPrev = TAB_RE.lastIndex;
655
- continue;
656
- }
657
- EMOJI_RE.lastIndex = index;
658
- if (EMOJI_RE.test(input)) {
659
- if (width + EMOJI_WIDTH > truncationLimit) truncationIndex = Math.min(truncationIndex, index);
660
- if (width + EMOJI_WIDTH > LIMIT) {
661
- truncationEnabled = true;
662
- break;
632
+ for(let i = 0, l = PARSE_BLOCKS.length; i < l; i++){
633
+ const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i];
634
+ BLOCK_RE.lastIndex = index;
635
+ if (BLOCK_RE.test(input)) {
636
+ lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
637
+ widthExtra = lengthExtra * BLOCK_WIDTH;
638
+ if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
639
+ if (width + widthExtra > LIMIT) {
640
+ truncationEnabled = true;
641
+ break outer;
642
+ }
643
+ width += widthExtra;
644
+ unmatchedStart = indexPrev;
645
+ unmatchedEnd = index;
646
+ index = indexPrev = BLOCK_RE.lastIndex;
647
+ continue outer;
663
648
  }
664
- width += EMOJI_WIDTH;
665
- unmatchedStart = indexPrev;
666
- unmatchedEnd = index;
667
- index = indexPrev = EMOJI_RE.lastIndex;
668
- continue;
669
649
  }
670
650
  index += 1;
671
651
  }
@@ -823,25 +803,27 @@ const exec = (string, columns, options = {})=>{
823
803
  for(let i = 0; i < preString.length; i++){
824
804
  const character = preString[i];
825
805
  returnValue += character;
826
- if (!inSurrogate) {
806
+ if (inSurrogate) inSurrogate = false;
807
+ else {
827
808
  inSurrogate = character >= '\ud800' && character <= '\udbff';
828
- if (character === ESC || character === CSI) {
829
- GROUP_REGEX.lastIndex = i + 1;
830
- const groupsResult = GROUP_REGEX.exec(preString);
831
- const groups = groupsResult?.groups;
832
- if (groups?.code !== void 0) {
833
- const code = Number.parseFloat(groups.code);
834
- escapeCode = code === END_CODE ? void 0 : code;
835
- } else if (groups?.uri !== void 0) escapeUrl = 0 === groups.uri.length ? void 0 : groups.uri;
836
- }
837
- if ('\n' === preString[i + 1]) {
838
- if (escapeUrl) returnValue += wrapAnsiHyperlink('');
839
- const closingCode = escapeCode ? getClosingCode(escapeCode) : void 0;
840
- if (escapeCode && closingCode) returnValue += wrapAnsiCode(closingCode);
841
- } else if ('\n' === character) {
842
- if (escapeCode && getClosingCode(escapeCode)) returnValue += wrapAnsiCode(escapeCode);
843
- if (escapeUrl) returnValue += wrapAnsiHyperlink(escapeUrl);
844
- }
809
+ if (inSurrogate) continue;
810
+ }
811
+ if (character === ESC || character === CSI) {
812
+ GROUP_REGEX.lastIndex = i + 1;
813
+ const groupsResult = GROUP_REGEX.exec(preString);
814
+ const groups = groupsResult?.groups;
815
+ if (groups?.code !== void 0) {
816
+ const code = Number.parseFloat(groups.code);
817
+ escapeCode = code === END_CODE ? void 0 : code;
818
+ } else if (groups?.uri !== void 0) escapeUrl = 0 === groups.uri.length ? void 0 : groups.uri;
819
+ }
820
+ if ('\n' === preString[i + 1]) {
821
+ if (escapeUrl) returnValue += wrapAnsiHyperlink('');
822
+ const closingCode = escapeCode ? getClosingCode(escapeCode) : void 0;
823
+ if (escapeCode && closingCode) returnValue += wrapAnsiCode(closingCode);
824
+ } else if ('\n' === character) {
825
+ if (escapeCode && getClosingCode(escapeCode)) returnValue += wrapAnsiCode(escapeCode);
826
+ if (escapeUrl) returnValue += wrapAnsiHyperlink(escapeUrl);
845
827
  }
846
828
  }
847
829
  return returnValue;
@@ -851,12 +833,12 @@ function wrapAnsi(string, columns, options) {
851
833
  return String(string).normalize().split(CRLF_OR_LF).map((line)=>exec(line, columns, options)).join('\n');
852
834
  }
853
835
  const src = __webpack_require__("./node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js");
854
- function dist_d(r, t, e) {
855
- if (!e.some((o)=>!o.disabled)) return r;
856
- const s = r + t, i = Math.max(e.length - 1, 0), n = s < 0 ? i : s > i ? 0 : s;
857
- return e[n].disabled ? dist_d(n, t < 0 ? -1 : 1, e) : n;
836
+ function dist_f(r, t, s) {
837
+ if (!s.some((o)=>!o.disabled)) return r;
838
+ const e = r + t, i = Math.max(s.length - 1, 0), n = e < 0 ? i : e > i ? 0 : e;
839
+ return s[n].disabled ? dist_f(n, t < 0 ? -1 : 1, s) : n;
858
840
  }
859
- const E = [
841
+ const dist_G = [
860
842
  "up",
861
843
  "down",
862
844
  "left",
@@ -864,7 +846,7 @@ const E = [
864
846
  "space",
865
847
  "enter",
866
848
  "cancel"
867
- ], dist_G = [
849
+ ], K = [
868
850
  "January",
869
851
  "February",
870
852
  "March",
@@ -877,8 +859,8 @@ const E = [
877
859
  "October",
878
860
  "November",
879
861
  "December"
880
- ], dist_u = {
881
- actions: new Set(E),
862
+ ], dist_h = {
863
+ actions: new Set(dist_G),
882
864
  aliases: new Map([
883
865
  [
884
866
  "k",
@@ -912,7 +894,7 @@ const E = [
912
894
  withGuide: !0,
913
895
  date: {
914
896
  monthNames: [
915
- ...dist_G
897
+ ...K
916
898
  ],
917
899
  messages: {
918
900
  required: "Please enter a valid date",
@@ -923,44 +905,47 @@ const E = [
923
905
  }
924
906
  }
925
907
  };
926
- function V(r, t) {
927
- if ("string" == typeof r) return dist_u.aliases.get(r) === t;
928
- for (const e of r)if (void 0 !== e && V(e, t)) return !0;
908
+ function dist_C(r, t) {
909
+ if ("string" == typeof r) return dist_h.aliases.get(r) === t;
910
+ for (const s of r)if (void 0 !== s && dist_C(s, t)) return !0;
929
911
  return !1;
930
912
  }
931
- function dist_j(r, t) {
913
+ function z(r, t) {
932
914
  if (r === t) return;
933
- const e = r.split(`
934
- `), s = t.split(`
935
- `), i = Math.max(e.length, s.length), n = [];
936
- for(let o = 0; o < i; o++)e[o] !== s[o] && n.push(o);
915
+ const s = r.split(`
916
+ `), e = t.split(`
917
+ `), i = Math.max(s.length, e.length), n = [];
918
+ for(let o = 0; o < i; o++)s[o] !== e[o] && n.push(o);
937
919
  return {
938
920
  lines: n,
939
- numLinesBefore: e.length,
940
- numLinesAfter: s.length,
921
+ numLinesBefore: s.length,
922
+ numLinesAfter: e.length,
941
923
  numLines: i
942
924
  };
943
925
  }
944
926
  globalThis.process.platform.startsWith("win");
945
- const dist_C = Symbol("clack:cancel");
946
- function dist_q(r) {
947
- return r === dist_C;
927
+ const dist_k = Symbol("clack:cancel");
928
+ function q(r) {
929
+ return r === dist_k;
948
930
  }
949
931
  function w(r, t) {
950
- const e = r;
951
- e.isTTY && e.setRawMode(t);
932
+ const s = r;
933
+ s.isTTY && s.setRawMode(t);
952
934
  }
953
- const O = (r)=>"columns" in r && "number" == typeof r.columns ? r.columns : 80, dist_A = (r)=>"rows" in r && "number" == typeof r.rows ? r.rows : 20;
954
- function dist_R(r, t, e, s = e) {
955
- const i = O(r ?? stdout);
956
- return wrapAnsi(t, i - e.length, {
935
+ const dist_A = (r)=>"columns" in r && "number" == typeof r.columns ? r.columns : 80, dist_L = (r)=>"rows" in r && "number" == typeof r.rows ? r.rows : 20;
936
+ function dist_W(r, t, s, e = s, i = s, n) {
937
+ const o = dist_A(r ?? stdout);
938
+ return wrapAnsi(t, o - s.length, {
957
939
  hard: !0,
958
940
  trim: !1
959
941
  }).split(`
960
- `).map((n, o)=>`${0 === o ? s : e}${n}`).join(`
942
+ `).map((u, a, l)=>{
943
+ const c = n ? n(u, a) : u;
944
+ return 0 === a ? `${e}${c}` : a === l.length - 1 ? `${i}${c}` : `${s}${c}`;
945
+ }).join(`
961
946
  `);
962
947
  }
963
- let dist_p = class {
948
+ let dist_m = class {
964
949
  input;
965
950
  output;
966
951
  _abortSignal;
@@ -975,37 +960,37 @@ let dist_p = class {
975
960
  error = "";
976
961
  value;
977
962
  userInput = "";
978
- constructor(t, e = !0){
979
- const { input: s = stdin, output: i = stdout, render: n, signal: o, ...a } = t;
980
- 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;
963
+ constructor(t, s = !0){
964
+ const { input: e = stdin, output: i = stdout, render: n, signal: o, ...u } = t;
965
+ 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;
981
966
  }
982
967
  unsubscribe() {
983
968
  this._subscribers.clear();
984
969
  }
985
- setSubscriber(t, e) {
986
- const s = this._subscribers.get(t) ?? [];
987
- s.push(e), this._subscribers.set(t, s);
970
+ setSubscriber(t, s) {
971
+ const e = this._subscribers.get(t) ?? [];
972
+ e.push(s), this._subscribers.set(t, e);
988
973
  }
989
- on(t, e) {
974
+ on(t, s) {
990
975
  this.setSubscriber(t, {
991
- cb: e
976
+ cb: s
992
977
  });
993
978
  }
994
- once(t, e) {
979
+ once(t, s) {
995
980
  this.setSubscriber(t, {
996
- cb: e,
981
+ cb: s,
997
982
  once: !0
998
983
  });
999
984
  }
1000
- emit(t, ...e) {
1001
- const s = this._subscribers.get(t) ?? [], i = [];
1002
- for (const n of s)n.cb(...e), n.once && i.push(()=>s.splice(s.indexOf(n), 1));
985
+ emit(t, ...s) {
986
+ const e = this._subscribers.get(t) ?? [], i = [];
987
+ for (const n of e)n.cb(...s), n.once && i.push(()=>e.splice(e.indexOf(n), 1));
1003
988
  for (const n of i)n();
1004
989
  }
1005
990
  prompt() {
1006
991
  return new Promise((t)=>{
1007
992
  if (this._abortSignal) {
1008
- if (this._abortSignal.aborted) return this.state = "cancel", this.close(), t(dist_C);
993
+ if (this._abortSignal.aborted) return this.state = "cancel", this.close(), t(dist_k);
1009
994
  this._abortSignal.addEventListener("abort", ()=>{
1010
995
  this.state = "cancel", this.close();
1011
996
  }, {
@@ -1021,18 +1006,21 @@ let dist_p = class {
1021
1006
  }), this.rl.prompt(), void 0 !== this.opts.initialUserInput && this._setUserInput(this.opts.initialUserInput, !0), this.input.on("keypress", this.onKeypress), w(this.input, !0), this.output.on("resize", this.render), this.render(), this.once("submit", ()=>{
1022
1007
  this.output.write(src.cursor.show), this.output.off("resize", this.render), w(this.input, !1), t(this.value);
1023
1008
  }), this.once("cancel", ()=>{
1024
- this.output.write(src.cursor.show), this.output.off("resize", this.render), w(this.input, !1), t(dist_C);
1009
+ this.output.write(src.cursor.show), this.output.off("resize", this.render), w(this.input, !1), t(dist_k);
1025
1010
  });
1026
1011
  });
1027
1012
  }
1028
- _isActionKey(t, e) {
1013
+ _isActionKey(t, s) {
1029
1014
  return " " === t;
1030
1015
  }
1016
+ _shouldSubmit(t, s) {
1017
+ return !0;
1018
+ }
1031
1019
  _setValue(t) {
1032
1020
  this.value = t, this.emit("value", this.value);
1033
1021
  }
1034
- _setUserInput(t, e) {
1035
- this.userInput = t ?? "", this.emit("userInput", this.userInput), e && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
1022
+ _setUserInput(t, s) {
1023
+ this.userInput = t ?? "", this.emit("userInput", this.userInput), s && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
1036
1024
  }
1037
1025
  _clearUserInput() {
1038
1026
  this.rl?.write(null, {
@@ -1040,21 +1028,21 @@ let dist_p = class {
1040
1028
  name: "u"
1041
1029
  }), this._setUserInput("");
1042
1030
  }
1043
- onKeypress(t, e) {
1044
- if (this._track && "return" !== e.name && (e.name && this._isActionKey(t, e) && this.rl?.write(null, {
1031
+ onKeypress(t, s) {
1032
+ if (this._track && "return" !== s.name && (s.name && this._isActionKey(t, s) && this.rl?.write(null, {
1045
1033
  ctrl: !0,
1046
1034
  name: "h"
1047
- }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), "error" === this.state && (this.state = "active"), e?.name && (!this._track && dist_u.aliases.has(e.name) && this.emit("cursor", dist_u.aliases.get(e.name)), dist_u.actions.has(e.name) && this.emit("cursor", e.name)), t && ("y" === t.toLowerCase() || "n" === t.toLowerCase()) && this.emit("confirm", "y" === t.toLowerCase()), this.emit("key", t?.toLowerCase(), e), e?.name === "return") {
1035
+ }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), "error" === this.state && (this.state = "active"), s?.name && (!this._track && dist_h.aliases.has(s.name) && this.emit("cursor", dist_h.aliases.get(s.name)), dist_h.actions.has(s.name) && this.emit("cursor", s.name)), t && ("y" === t.toLowerCase() || "n" === t.toLowerCase()) && this.emit("confirm", "y" === t.toLowerCase()), this.emit("key", t?.toLowerCase(), s), s?.name === "return" && this._shouldSubmit(t, s)) {
1048
1036
  if (this.opts.validate) {
1049
- const s = this.opts.validate(this.value);
1050
- s && (this.error = s instanceof Error ? s.message : s, this.state = "error", this.rl?.write(this.userInput));
1037
+ const e = this.opts.validate(this.value);
1038
+ e && (this.error = e instanceof Error ? e.message : e, this.state = "error", this.rl?.write(this.userInput));
1051
1039
  }
1052
1040
  "error" !== this.state && (this.state = "submit");
1053
1041
  }
1054
- V([
1042
+ dist_C([
1055
1043
  t,
1056
- e?.name,
1057
- e?.sequence
1044
+ s?.name,
1045
+ s?.sequence
1058
1046
  ], "cancel") && (this.state = "cancel"), ("submit" === this.state || "cancel" === this.state) && this.emit("finalize"), this.render(), ("submit" === this.state || "cancel" === this.state) && this.close();
1059
1047
  }
1060
1048
  close() {
@@ -1077,31 +1065,31 @@ let dist_p = class {
1077
1065
  if (t !== this._prevFrame) {
1078
1066
  if ("initial" === this.state) this.output.write(src.cursor.hide);
1079
1067
  else {
1080
- const e = dist_j(this._prevFrame, t), s = dist_A(this.output);
1081
- if (this.restoreCursor(), e) {
1082
- const i = Math.max(0, e.numLinesAfter - s), n = Math.max(0, e.numLinesBefore - s);
1083
- let o = e.lines.find((a)=>a >= i);
1068
+ const s = z(this._prevFrame, t), e = dist_L(this.output);
1069
+ if (this.restoreCursor(), s) {
1070
+ const i = Math.max(0, s.numLinesAfter - e), n = Math.max(0, s.numLinesBefore - e);
1071
+ let o = s.lines.find((u)=>u >= i);
1084
1072
  if (void 0 === o) {
1085
1073
  this._prevFrame = t;
1086
1074
  return;
1087
1075
  }
1088
- if (1 === e.lines.length) {
1076
+ if (1 === s.lines.length) {
1089
1077
  this.output.write(src.cursor.move(0, o - n)), this.output.write(src.erase.lines(1));
1090
- const a = t.split(`
1078
+ const u = t.split(`
1091
1079
  `);
1092
- this.output.write(a[o]), this._prevFrame = t, this.output.write(src.cursor.move(0, a.length - o - 1));
1080
+ this.output.write(u[o]), this._prevFrame = t, this.output.write(src.cursor.move(0, u.length - o - 1));
1093
1081
  return;
1094
1082
  }
1095
- if (e.lines.length > 1) {
1083
+ if (s.lines.length > 1) {
1096
1084
  if (i < n) o = i;
1097
1085
  else {
1098
- const h = o - n;
1099
- h > 0 && this.output.write(src.cursor.move(0, h));
1086
+ const a = o - n;
1087
+ a > 0 && this.output.write(src.cursor.move(0, a));
1100
1088
  }
1101
1089
  this.output.write(src.erase.down());
1102
- const a = t.split(`
1090
+ const u = t.split(`
1103
1091
  `).slice(o);
1104
- this.output.write(a.join(`
1092
+ this.output.write(u.join(`
1105
1093
  `)), this._prevFrame = t;
1106
1094
  return;
1107
1095
  }
@@ -1112,30 +1100,30 @@ let dist_p = class {
1112
1100
  }
1113
1101
  }
1114
1102
  };
1115
- function dist_W(r, t) {
1103
+ function dist_B(r, t) {
1116
1104
  if (void 0 === r || 0 === t.length) return 0;
1117
- const e = t.findIndex((s)=>s.value === r);
1118
- return -1 !== e ? e : 0;
1105
+ const s = t.findIndex((e)=>e.value === r);
1106
+ return -1 !== s ? s : 0;
1119
1107
  }
1120
- function dist_B(r, t) {
1108
+ function dist_J(r, t) {
1121
1109
  return (t.label ?? String(t.value)).toLowerCase().includes(r.toLowerCase());
1122
1110
  }
1123
- function J(r, t) {
1111
+ function H(r, t) {
1124
1112
  if (t) return r ? t : t[0];
1125
1113
  }
1126
- let H = class extends dist_p {
1114
+ let Q = class extends dist_m {
1127
1115
  filteredOptions;
1128
1116
  multiple;
1129
1117
  isNavigating = !1;
1130
1118
  selectedValues = [];
1131
1119
  focusedValue;
1132
- #e = 0;
1133
- #o = "";
1120
+ #s = 0;
1121
+ #r = "";
1134
1122
  #t;
1135
1123
  #n;
1136
- #a;
1124
+ #u;
1137
1125
  get cursor() {
1138
- return this.#e;
1126
+ return this.#s;
1139
1127
  }
1140
1128
  get userInputWithCursor() {
1141
1129
  if (!this.userInput) return styleText([
@@ -1143,39 +1131,39 @@ let H = class extends dist_p {
1143
1131
  "hidden"
1144
1132
  ], "_");
1145
1133
  if (this._cursor >= this.userInput.length) return `${this.userInput}\u2588`;
1146
- const t = this.userInput.slice(0, this._cursor), [e, ...s] = this.userInput.slice(this._cursor);
1147
- return `${t}${styleText("inverse", e)}${s.join("")}`;
1134
+ const t = this.userInput.slice(0, this._cursor), [s, ...e] = this.userInput.slice(this._cursor);
1135
+ return `${t}${styleText("inverse", s)}${e.join("")}`;
1148
1136
  }
1149
1137
  get options() {
1150
1138
  return "function" == typeof this.#n ? this.#n() : this.#n;
1151
1139
  }
1152
1140
  constructor(t){
1153
- super(t), this.#n = t.options, this.#a = t.placeholder;
1154
- const e = this.options;
1141
+ super(t), this.#n = t.options, this.#u = t.placeholder;
1142
+ const s = this.options;
1155
1143
  this.filteredOptions = [
1156
- ...e
1157
- ], this.multiple = !0 === t.multiple, this.#t = "function" == typeof t.options ? t.filter : t.filter ?? dist_B;
1158
- let s;
1159
- 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 = [
1144
+ ...s
1145
+ ], this.multiple = !0 === t.multiple, this.#t = "function" == typeof t.options ? t.filter : t.filter ?? dist_J;
1146
+ let e;
1147
+ 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 = [
1160
1148
  this.options[0].value
1161
- ]), s) for (const i of s){
1162
- const n = e.findIndex((o)=>o.value === i);
1163
- -1 !== n && (this.toggleSelected(i), this.#e = n);
1149
+ ]), e) for (const i of e){
1150
+ const n = s.findIndex((o)=>o.value === i);
1151
+ -1 !== n && (this.toggleSelected(i), this.#s = n);
1164
1152
  }
1165
- this.focusedValue = this.options[this.#e]?.value, this.on("key", (i, n)=>this.#s(i, n)), this.on("userInput", (i)=>this.#i(i));
1153
+ this.focusedValue = this.options[this.#s]?.value, this.on("key", (i, n)=>this.#e(i, n)), this.on("userInput", (i)=>this.#i(i));
1166
1154
  }
1167
- _isActionKey(t, e) {
1168
- return " " === t || this.multiple && this.isNavigating && "space" === e.name && void 0 !== t && "" !== t;
1155
+ _isActionKey(t, s) {
1156
+ return " " === t || this.multiple && this.isNavigating && "space" === s.name && void 0 !== t && "" !== t;
1169
1157
  }
1170
- #s(t, e) {
1171
- const s = "up" === e.name, i = "down" === e.name, n = "return" === e.name, o = "" === this.userInput || " " === this.userInput, a = this.#a, h = this.options, l = void 0 !== a && "" !== a && h.some((f)=>!f.disabled && (this.#t ? this.#t(a, f) : !0));
1172
- if ("tab" === e.name && o && l) {
1173
- " " === this.userInput && this._clearUserInput(), this._setUserInput(a, !0), this.isNavigating = !1;
1158
+ #e(t, s) {
1159
+ const e = "up" === s.name, i = "down" === s.name, n = "return" === s.name, o = "" === this.userInput || " " === this.userInput, u = this.#u, a = this.options, l = void 0 !== u && "" !== u && a.some((c)=>!c.disabled && (this.#t ? this.#t(u, c) : !0));
1160
+ if ("tab" === s.name && o && l) {
1161
+ " " === this.userInput && this._clearUserInput(), this._setUserInput(u, !0), this.isNavigating = !1;
1174
1162
  return;
1175
1163
  }
1176
- s || i ? (this.#e = dist_d(this.#e, s ? -1 : 1, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#e]?.value, this.multiple || (this.selectedValues = [
1164
+ e || i ? (this.#s = dist_f(this.#s, e ? -1 : 1, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#s]?.value, this.multiple || (this.selectedValues = [
1177
1165
  this.focusedValue
1178
- ]), this.isNavigating = !0) : n ? this.value = J(this.multiple, this.selectedValues) : this.multiple ? void 0 !== this.focusedValue && ("tab" === e.name || this.isNavigating && "space" === e.name) ? this.toggleSelected(this.focusedValue) : this.isNavigating = !1 : (this.focusedValue && (this.selectedValues = [
1166
+ ]), this.isNavigating = !0) : n ? this.value = H(this.multiple, this.selectedValues) : this.multiple ? void 0 !== this.focusedValue && ("tab" === s.name || this.isNavigating && "space" === s.name) ? this.toggleSelected(this.focusedValue) : this.isNavigating = !1 : (this.focusedValue && (this.selectedValues = [
1179
1167
  this.focusedValue
1180
1168
  ]), this.isNavigating = !1);
1181
1169
  }
@@ -1183,7 +1171,7 @@ let H = class extends dist_p {
1183
1171
  this.selectedValues = [];
1184
1172
  }
1185
1173
  toggleSelected(t) {
1186
- 0 !== this.filteredOptions.length && (this.multiple ? this.selectedValues.includes(t) ? this.selectedValues = this.selectedValues.filter((e)=>e !== t) : this.selectedValues = [
1174
+ 0 !== this.filteredOptions.length && (this.multiple ? this.selectedValues.includes(t) ? this.selectedValues = this.selectedValues.filter((s)=>s !== t) : this.selectedValues = [
1187
1175
  ...this.selectedValues,
1188
1176
  t
1189
1177
  ] : this.selectedValues = [
@@ -1191,41 +1179,41 @@ let H = class extends dist_p {
1191
1179
  ]);
1192
1180
  }
1193
1181
  #i(t) {
1194
- if (t !== this.#o) {
1195
- this.#o = t;
1196
- const e = this.options;
1197
- t && this.#t ? this.filteredOptions = e.filter((n)=>this.#t?.(t, n)) : this.filteredOptions = [
1198
- ...e
1182
+ if (t !== this.#r) {
1183
+ this.#r = t;
1184
+ const s = this.options;
1185
+ t && this.#t ? this.filteredOptions = s.filter((n)=>this.#t?.(t, n)) : this.filteredOptions = [
1186
+ ...s
1199
1187
  ];
1200
- const s = dist_W(this.focusedValue, this.filteredOptions);
1201
- this.#e = dist_d(s, 0, this.filteredOptions);
1202
- const i = this.filteredOptions[this.#e];
1188
+ const e = dist_B(this.focusedValue, this.filteredOptions);
1189
+ this.#s = dist_f(e, 0, this.filteredOptions);
1190
+ const i = this.filteredOptions[this.#s];
1203
1191
  i && !i.disabled ? this.focusedValue = i.value : this.focusedValue = void 0, this.multiple || (void 0 !== this.focusedValue ? this.toggleSelected(this.focusedValue) : this.deselectAll());
1204
1192
  }
1205
1193
  }
1206
1194
  };
1207
- class st extends dist_p {
1195
+ class it extends dist_m {
1208
1196
  options;
1209
1197
  cursor = 0;
1210
- #e;
1198
+ #s;
1211
1199
  getGroupItems(t) {
1212
- return this.options.filter((e)=>e.group === t);
1200
+ return this.options.filter((s)=>s.group === t);
1213
1201
  }
1214
1202
  isGroupSelected(t) {
1215
- const e = this.getGroupItems(t), s = this.value;
1216
- return void 0 === s ? !1 : e.every((i)=>s.includes(i.value));
1203
+ const s = this.getGroupItems(t), e = this.value;
1204
+ return void 0 === e ? !1 : s.every((i)=>e.includes(i.value));
1217
1205
  }
1218
1206
  toggleValue() {
1219
1207
  const t = this.options[this.cursor];
1220
1208
  if (void 0 === this.value && (this.value = []), !0 === t.group) {
1221
- const e = t.value, s = this.getGroupItems(e);
1222
- this.isGroupSelected(e) ? this.value = this.value.filter((i)=>-1 === s.findIndex((n)=>n.value === i)) : this.value = [
1209
+ const s = t.value, e = this.getGroupItems(s);
1210
+ this.isGroupSelected(s) ? this.value = this.value.filter((i)=>-1 === e.findIndex((n)=>n.value === i)) : this.value = [
1223
1211
  ...this.value,
1224
- ...s.map((i)=>i.value)
1212
+ ...e.map((i)=>i.value)
1225
1213
  ], this.value = Array.from(new Set(this.value));
1226
1214
  } else {
1227
- const e = this.value.includes(t.value);
1228
- this.value = e ? this.value.filter((s)=>s !== t.value) : [
1215
+ const s = this.value.includes(t.value);
1216
+ this.value = s ? this.value.filter((e)=>e !== t.value) : [
1229
1217
  ...this.value,
1230
1218
  t.value
1231
1219
  ];
@@ -1233,27 +1221,27 @@ class st extends dist_p {
1233
1221
  }
1234
1222
  constructor(t){
1235
1223
  super(t, !1);
1236
- const { options: e } = t;
1237
- this.#e = !1 !== t.selectableGroups, this.options = Object.entries(e).flatMap(([s, i])=>[
1224
+ const { options: s } = t;
1225
+ this.#s = !1 !== t.selectableGroups, this.options = Object.entries(s).flatMap(([e, i])=>[
1238
1226
  {
1239
- value: s,
1227
+ value: e,
1240
1228
  group: !0,
1241
- label: s
1229
+ label: e
1242
1230
  },
1243
1231
  ...i.map((n)=>({
1244
1232
  ...n,
1245
- group: s
1233
+ group: e
1246
1234
  }))
1247
1235
  ]), this.value = [
1248
1236
  ...t.initialValues ?? []
1249
- ], this.cursor = Math.max(this.options.findIndex(({ value: s })=>s === t.cursorAt), this.#e ? 0 : 1), this.on("cursor", (s)=>{
1250
- switch(s){
1237
+ ], this.cursor = Math.max(this.options.findIndex(({ value: e })=>e === t.cursorAt), this.#s ? 0 : 1), this.on("cursor", (e)=>{
1238
+ switch(e){
1251
1239
  case "left":
1252
1240
  case "up":
1253
1241
  {
1254
1242
  this.cursor = 0 === this.cursor ? this.options.length - 1 : this.cursor - 1;
1255
1243
  const i = this.options[this.cursor]?.group === !0;
1256
- !this.#e && i && (this.cursor = 0 === this.cursor ? this.options.length - 1 : this.cursor - 1);
1244
+ !this.#s && i && (this.cursor = 0 === this.cursor ? this.options.length - 1 : this.cursor - 1);
1257
1245
  break;
1258
1246
  }
1259
1247
  case "down":
@@ -1261,7 +1249,7 @@ class st extends dist_p {
1261
1249
  {
1262
1250
  this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
1263
1251
  const i = this.options[this.cursor]?.group === !0;
1264
- !this.#e && i && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
1252
+ !this.#s && i && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
1265
1253
  break;
1266
1254
  }
1267
1255
  case "space":
@@ -1271,7 +1259,7 @@ class st extends dist_p {
1271
1259
  });
1272
1260
  }
1273
1261
  }
1274
- let it = class extends dist_p {
1262
+ let dist_nt = class extends dist_m {
1275
1263
  options;
1276
1264
  cursor = 0;
1277
1265
  get _value() {
@@ -1281,19 +1269,19 @@ let it = class extends dist_p {
1281
1269
  return this.options.filter((t)=>!0 !== t.disabled);
1282
1270
  }
1283
1271
  toggleAll() {
1284
- const t = this._enabledOptions, e = void 0 !== this.value && this.value.length === t.length;
1285
- this.value = e ? [] : t.map((s)=>s.value);
1272
+ const t = this._enabledOptions, s = void 0 !== this.value && this.value.length === t.length;
1273
+ this.value = s ? [] : t.map((e)=>e.value);
1286
1274
  }
1287
1275
  toggleInvert() {
1288
1276
  const t = this.value;
1289
1277
  if (!t) return;
1290
- const e = this._enabledOptions.filter((s)=>!t.includes(s.value));
1291
- this.value = e.map((s)=>s.value);
1278
+ const s = this._enabledOptions.filter((e)=>!t.includes(e.value));
1279
+ this.value = s.map((e)=>e.value);
1292
1280
  }
1293
1281
  toggleValue() {
1294
1282
  void 0 === this.value && (this.value = []);
1295
1283
  const t = this.value.includes(this._value);
1296
- this.value = t ? this.value.filter((e)=>e !== this._value) : [
1284
+ this.value = t ? this.value.filter((s)=>s !== this._value) : [
1297
1285
  ...this.value,
1298
1286
  this._value
1299
1287
  ];
@@ -1302,18 +1290,18 @@ let it = class extends dist_p {
1302
1290
  super(t, !1), this.options = t.options, this.value = [
1303
1291
  ...t.initialValues ?? []
1304
1292
  ];
1305
- const e = Math.max(this.options.findIndex(({ value: s })=>s === t.cursorAt), 0);
1306
- this.cursor = this.options[e].disabled ? dist_d(e, 1, this.options) : e, this.on("key", (s)=>{
1307
- "a" === s && this.toggleAll(), "i" === s && this.toggleInvert();
1308
- }), this.on("cursor", (s)=>{
1309
- switch(s){
1293
+ const s = Math.max(this.options.findIndex(({ value: e })=>e === t.cursorAt), 0);
1294
+ this.cursor = this.options[s].disabled ? dist_f(s, 1, this.options) : s, this.on("key", (e)=>{
1295
+ "a" === e && this.toggleAll(), "i" === e && this.toggleInvert();
1296
+ }), this.on("cursor", (e)=>{
1297
+ switch(e){
1310
1298
  case "left":
1311
1299
  case "up":
1312
- this.cursor = dist_d(this.cursor, -1, this.options);
1300
+ this.cursor = dist_f(this.cursor, -1, this.options);
1313
1301
  break;
1314
1302
  case "down":
1315
1303
  case "right":
1316
- this.cursor = dist_d(this.cursor, 1, this.options);
1304
+ this.cursor = dist_f(this.cursor, 1, this.options);
1317
1305
  break;
1318
1306
  case "space":
1319
1307
  this.toggleValue();
@@ -1322,7 +1310,7 @@ let it = class extends dist_p {
1322
1310
  });
1323
1311
  }
1324
1312
  };
1325
- class nt extends dist_p {
1313
+ class ut extends dist_m {
1326
1314
  options;
1327
1315
  cursor = 0;
1328
1316
  get _selectedValue() {
@@ -1333,29 +1321,29 @@ class nt extends dist_p {
1333
1321
  }
1334
1322
  constructor(t){
1335
1323
  super(t, !1), this.options = t.options;
1336
- const e = this.options.findIndex(({ value: i })=>i === t.initialValue), s = -1 === e ? 0 : e;
1337
- this.cursor = this.options[s].disabled ? dist_d(s, 1, this.options) : s, this.changeValue(), this.on("cursor", (i)=>{
1324
+ const s = this.options.findIndex(({ value: i })=>i === t.initialValue), e = -1 === s ? 0 : s;
1325
+ this.cursor = this.options[e].disabled ? dist_f(e, 1, this.options) : e, this.changeValue(), this.on("cursor", (i)=>{
1338
1326
  switch(i){
1339
1327
  case "left":
1340
1328
  case "up":
1341
- this.cursor = dist_d(this.cursor, -1, this.options);
1329
+ this.cursor = dist_f(this.cursor, -1, this.options);
1342
1330
  break;
1343
1331
  case "down":
1344
1332
  case "right":
1345
- this.cursor = dist_d(this.cursor, 1, this.options);
1333
+ this.cursor = dist_f(this.cursor, 1, this.options);
1346
1334
  break;
1347
1335
  }
1348
1336
  this.changeValue();
1349
1337
  });
1350
1338
  }
1351
1339
  }
1352
- class at extends dist_p {
1340
+ class ht extends dist_m {
1353
1341
  get userInputWithCursor() {
1354
1342
  if ("submit" === this.state) return this.userInput;
1355
1343
  const t = this.userInput;
1356
1344
  if (this.cursor >= t.length) return `${this.userInput}\u2588`;
1357
- const e = t.slice(0, this.cursor), [s, ...i] = t.slice(this.cursor);
1358
- return `${e}${styleText("inverse", s)}${i.join("")}`;
1345
+ const s = t.slice(0, this.cursor), [e, ...i] = t.slice(this.cursor);
1346
+ return `${s}${styleText("inverse", e)}${i.join("")}`;
1359
1347
  }
1360
1348
  get cursor() {
1361
1349
  return this._cursor;
@@ -1364,215 +1352,213 @@ class at extends dist_p {
1364
1352
  super({
1365
1353
  ...t,
1366
1354
  initialUserInput: t.initialUserInput ?? t.initialValue
1367
- }), this.on("userInput", (e)=>{
1368
- this._setValue(e);
1355
+ }), this.on("userInput", (s)=>{
1356
+ this._setValue(s);
1369
1357
  }), this.on("finalize", ()=>{
1370
1358
  this.value || (this.value = t.defaultValue), void 0 === this.value && (this.value = "");
1371
1359
  });
1372
1360
  }
1373
1361
  }
1374
- function Ze() {
1362
+ function ee() {
1375
1363
  return "win32" !== node_process.platform ? "linux" !== node_process.env.TERM : !!node_process.env.CI || !!node_process.env.WT_SESSION || !!node_process.env.TERMINUS_SUBLIME || "{cmd::Cmder}" === node_process.env.ConEmuTask || "Terminus-Sublime" === node_process.env.TERM_PROGRAM || "vscode" === node_process.env.TERM_PROGRAM || "xterm-256color" === node_process.env.TERM || "alacritty" === node_process.env.TERM || "JetBrains-JediTerm" === node_process.env.TERMINAL_EMULATOR;
1376
1364
  }
1377
- const ee = Ze(), ae = ()=>"true" === process.env.CI, Te = (e)=>!0 === e.isTTY, dist_w = (e, i)=>ee ? e : i, _e = dist_w("\u25C6", "*"), oe = dist_w("\u25A0", "x"), ue = dist_w("\u25B2", "x"), dist_F = dist_w("\u25C7", "o"), prompts_dist_d = (dist_w("\u250C", "T"), dist_w("\u2502", "|")), dist_E = dist_w("\u2514", "\u2014"), dist_z = (dist_w("\u2510", "T"), dist_w("\u2518", "\u2014"), dist_w("\u25CF", ">")), dist_H = dist_w("\u25CB", " "), te = dist_w("\u25FB", "[\u2022]"), dist_U = dist_w("\u25FC", "[+]"), dist_J = dist_w("\u25FB", "[ ]"), se = (dist_w("\u25AA", "\u2022"), dist_w("\u2500", "-")), ce = dist_w("\u256E", "+"), Ge = dist_w("\u251C", "+"), $e = dist_w("\u256F", "+"), de = dist_w("\u2570", "+"), he = (dist_w("\u256D", "+"), dist_w("\u25CF", "\u2022")), pe = dist_w("\u25C6", "*"), me = dist_w("\u25B2", "!"), ge = dist_w("\u25A0", "x"), dist_V = (e)=>{
1378
- switch(e){
1365
+ const dist_tt = ee(), dist_ot = ()=>"true" === process.env.CI, It = (t)=>!0 === t.isTTY, dist_w = (t, i)=>dist_tt ? t : i, Tt = dist_w("\u25C6", "*"), dist_at = dist_w("\u25A0", "x"), dist_ut = dist_w("\u25B2", "x"), dist_H = dist_w("\u25C7", "o"), dist_$ = (dist_w("\u250C", "T"), dist_w("\u2502", "|")), dist_x = dist_w("\u2514", "\u2014"), dist_z = (dist_w("\u2510", "T"), dist_w("\u2518", "\u2014"), dist_w("\u25CF", ">")), dist_U = dist_w("\u25CB", " "), dist_et = dist_w("\u25FB", "[\u2022]"), dist_K = dist_w("\u25FC", "[+]"), dist_Y = dist_w("\u25FB", "[ ]"), dist_st = (dist_w("\u25AA", "\u2022"), dist_w("\u2500", "-")), ct = dist_w("\u256E", "+"), Gt = dist_w("\u251C", "+"), $t = dist_w("\u256F", "+"), dt = dist_w("\u2570", "+"), dist_ht = (dist_w("\u256D", "+"), dist_w("\u25CF", "\u2022")), pt = dist_w("\u25C6", "*"), mt = dist_w("\u25B2", "!"), gt = dist_w("\u25A0", "x"), dist_P = (t)=>{
1366
+ switch(t){
1379
1367
  case "initial":
1380
1368
  case "active":
1381
- return styleText("cyan", _e);
1369
+ return styleText("cyan", Tt);
1382
1370
  case "cancel":
1383
- return styleText("red", oe);
1371
+ return styleText("red", dist_at);
1384
1372
  case "error":
1385
- return styleText("yellow", ue);
1373
+ return styleText("yellow", dist_ut);
1386
1374
  case "submit":
1387
- return styleText("green", dist_F);
1375
+ return styleText("green", dist_H);
1388
1376
  }
1389
- }, ye = (e)=>{
1390
- switch(e){
1377
+ }, yt = (t)=>{
1378
+ switch(t){
1391
1379
  case "initial":
1392
1380
  case "active":
1393
- return styleText("cyan", prompts_dist_d);
1381
+ return styleText("cyan", dist_$);
1394
1382
  case "cancel":
1395
- return styleText("red", prompts_dist_d);
1383
+ return styleText("red", dist_$);
1396
1384
  case "error":
1397
- return styleText("yellow", prompts_dist_d);
1385
+ return styleText("yellow", dist_$);
1398
1386
  case "submit":
1399
- return styleText("green", prompts_dist_d);
1400
- }
1401
- }, dist_et = (e, i, s, r, u)=>{
1402
- let n = i, o = 0;
1403
- for(let c = s; c < r; c++){
1404
- const a = e[c];
1405
- if (n -= a.length, o++, n <= u) break;
1387
+ return styleText("green", dist_$);
1406
1388
  }
1389
+ }, Ot = (t, i, s, r, u, n = !1)=>{
1390
+ let a = i, c = 0;
1391
+ if (n) for(let o = r - 1; o >= s && (a -= t[o].length, c++, !(a <= u)); o--);
1392
+ else for(let o = s; o < r && (a -= t[o].length, c++, !(a <= u)); o++);
1407
1393
  return {
1408
- lineCount: n,
1409
- removals: o
1394
+ lineCount: a,
1395
+ removals: c
1410
1396
  };
1411
- }, dist_Y = ({ cursor: e, options: i, style: s, output: r = process.stdout, maxItems: u = 1 / 0, columnPadding: n = 0, rowPadding: o = 4 })=>{
1412
- const c = O(r) - n, a = dist_A(r), l = styleText("dim", "..."), $ = Math.max(a - o, 0), y = Math.max(Math.min(u, $), 5);
1397
+ }, dist_F = ({ cursor: t, options: i, style: s, output: r = process.stdout, maxItems: u = 1 / 0, columnPadding: n = 0, rowPadding: a = 4 })=>{
1398
+ const c = dist_A(r) - n, o = dist_L(r), l = styleText("dim", "..."), d = Math.max(o - a, 0), g = Math.max(Math.min(u, d), 5);
1413
1399
  let p = 0;
1414
- e >= y - 3 && (p = Math.max(Math.min(e - y + 3, i.length - y), 0));
1415
- let m = y < i.length && p > 0, g = y < i.length && p + y < i.length;
1416
- const S = Math.min(p + y, i.length), h = [];
1417
- let f = 0;
1418
- m && f++, g && f++;
1419
- const v = p + (m ? 1 : 0), T = S - (g ? 1 : 0);
1420
- for(let b = v; b < T; b++){
1421
- const x = wrapAnsi(s(i[b], b === e), c, {
1400
+ t >= g - 3 && (p = Math.max(Math.min(t - g + 3, i.length - g), 0));
1401
+ let f = g < i.length && p > 0, h = g < i.length && p + g < i.length;
1402
+ const I = Math.min(p + g, i.length), m = [];
1403
+ let y = 0;
1404
+ f && y++, h && y++;
1405
+ const v = p + (f ? 1 : 0), C = I - (h ? 1 : 0);
1406
+ for(let b = v; b < C; b++){
1407
+ const G = wrapAnsi(s(i[b], b === t), c, {
1422
1408
  hard: !0,
1423
1409
  trim: !1
1424
1410
  }).split(`
1425
1411
  `);
1426
- h.push(x), f += x.length;
1427
- }
1428
- if (f > $) {
1429
- let b = 0, x = 0, G = f;
1430
- const M = e - v, R = (j, D)=>dist_et(h, G, j, D, $);
1431
- m ? ({ lineCount: G, removals: b } = R(0, M), G > $ && ({ lineCount: G, removals: x } = R(M + 1, h.length))) : ({ lineCount: G, removals: x } = R(M + 1, h.length), G > $ && ({ lineCount: G, removals: b } = R(0, M))), b > 0 && (m = !0, h.splice(0, b)), x > 0 && (g = !0, h.splice(h.length - x, x));
1432
- }
1433
- const C = [];
1434
- m && C.push(l);
1435
- for (const b of h)for (const x of b)C.push(x);
1436
- return g && C.push(l), C;
1412
+ m.push(G), y += G.length;
1413
+ }
1414
+ if (y > d) {
1415
+ let b = 0, G = 0, M = y;
1416
+ const N = t - v;
1417
+ let O = d;
1418
+ const j = ()=>Ot(m, M, 0, N, O), k = ()=>Ot(m, M, N + 1, m.length, O, !0);
1419
+ f ? ({ lineCount: M, removals: b } = j(), M > O && (h || (O -= 1), { lineCount: M, removals: G } = k())) : (h || (O -= 1), { lineCount: M, removals: G } = k(), M > O && (O -= 1, { lineCount: M, removals: b } = j())), b > 0 && (f = !0, m.splice(0, b)), G > 0 && (h = !0, m.splice(m.length - G, G));
1420
+ }
1421
+ const S = [];
1422
+ f && S.push(l);
1423
+ for (const b of m)for (const G of b)S.push(G);
1424
+ return h && S.push(l), S;
1437
1425
  };
1438
- function Me(e) {
1439
- return e.label ?? String(e.value ?? "");
1426
+ function Pt(t) {
1427
+ return t.label ?? String(t.value ?? "");
1440
1428
  }
1441
- function Re(e, i) {
1442
- if (!e) return !0;
1443
- const s = (i.label ?? String(i.value ?? "")).toLowerCase(), r = (i.hint ?? "").toLowerCase(), u = String(i.value).toLowerCase(), n = e.toLowerCase();
1429
+ function Rt(t, i) {
1430
+ if (!t) return !0;
1431
+ const s = (i.label ?? String(i.value ?? "")).toLowerCase(), r = (i.hint ?? "").toLowerCase(), u = String(i.value).toLowerCase(), n = t.toLowerCase();
1444
1432
  return s.includes(n) || r.includes(n) || u.includes(n);
1445
1433
  }
1446
- function dist_tt(e, i) {
1434
+ function se(t, i) {
1447
1435
  const s = [];
1448
- for (const r of i)e.includes(r.value) && s.push(r);
1436
+ for (const r of i)t.includes(r.value) && s.push(r);
1449
1437
  return s;
1450
1438
  }
1451
- const Ae = (e)=>new H({
1452
- options: e.options,
1453
- initialValue: e.initialValue ? [
1454
- e.initialValue
1439
+ const At = (t)=>new Q({
1440
+ options: t.options,
1441
+ initialValue: t.initialValue ? [
1442
+ t.initialValue
1455
1443
  ] : void 0,
1456
- initialUserInput: e.initialUserInput,
1457
- placeholder: e.placeholder,
1458
- filter: e.filter ?? ((i, s)=>Re(i, s)),
1459
- signal: e.signal,
1460
- input: e.input,
1461
- output: e.output,
1462
- validate: e.validate,
1444
+ initialUserInput: t.initialUserInput,
1445
+ placeholder: t.placeholder,
1446
+ filter: t.filter ?? ((i, s)=>Rt(i, s)),
1447
+ signal: t.signal,
1448
+ input: t.input,
1449
+ output: t.output,
1450
+ validate: t.validate,
1463
1451
  render () {
1464
- const i = e.withGuide ?? dist_u.withGuide, s = i ? [
1465
- `${styleText("gray", prompts_dist_d)}`,
1466
- `${dist_V(this.state)} ${e.message}`
1452
+ const i = t.withGuide ?? dist_h.withGuide, s = i ? [
1453
+ `${styleText("gray", dist_$)}`,
1454
+ `${dist_P(this.state)} ${t.message}`
1467
1455
  ] : [
1468
- `${dist_V(this.state)} ${e.message}`
1469
- ], r = this.userInput, u = this.options, n = e.placeholder, o = "" === r && void 0 !== n, c = (a, l)=>{
1470
- const $ = Me(a), y = a.hint && a.value === this.focusedValue ? styleText("dim", ` (${a.hint})`) : "";
1456
+ `${dist_P(this.state)} ${t.message}`
1457
+ ], r = this.userInput, u = this.options, n = t.placeholder, a = "" === r && void 0 !== n, c = (o, l)=>{
1458
+ const d = Pt(o), g = o.hint && o.value === this.focusedValue ? styleText("dim", ` (${o.hint})`) : "";
1471
1459
  switch(l){
1472
1460
  case "active":
1473
- return `${styleText("green", dist_z)} ${$}${y}`;
1461
+ return `${styleText("green", dist_z)} ${d}${g}`;
1474
1462
  case "inactive":
1475
- return `${styleText("dim", dist_H)} ${styleText("dim", $)}`;
1463
+ return `${styleText("dim", dist_U)} ${styleText("dim", d)}`;
1476
1464
  case "disabled":
1477
- return `${styleText("gray", dist_H)} ${styleText([
1465
+ return `${styleText("gray", dist_U)} ${styleText([
1478
1466
  "strikethrough",
1479
1467
  "gray"
1480
- ], $)}`;
1468
+ ], d)}`;
1481
1469
  }
1482
1470
  };
1483
1471
  switch(this.state){
1484
1472
  case "submit":
1485
1473
  {
1486
- const a = dist_tt(this.selectedValues, u), l = a.length > 0 ? ` ${styleText("dim", a.map(Me).join(", "))}` : "", $ = i ? styleText("gray", prompts_dist_d) : "";
1474
+ const o = se(this.selectedValues, u), l = o.length > 0 ? ` ${styleText("dim", o.map(Pt).join(", "))}` : "", d = i ? styleText("gray", dist_$) : "";
1487
1475
  return `${s.join(`
1488
1476
  `)}
1489
- ${$}${l}`;
1477
+ ${d}${l}`;
1490
1478
  }
1491
1479
  case "cancel":
1492
1480
  {
1493
- const a = r ? ` ${styleText([
1481
+ const o = r ? ` ${styleText([
1494
1482
  "strikethrough",
1495
1483
  "dim"
1496
- ], r)}` : "", l = i ? styleText("gray", prompts_dist_d) : "";
1484
+ ], r)}` : "", l = i ? styleText("gray", dist_$) : "";
1497
1485
  return `${s.join(`
1498
1486
  `)}
1499
- ${l}${a}`;
1487
+ ${l}${o}`;
1500
1488
  }
1501
1489
  default:
1502
1490
  {
1503
- const a = "error" === this.state ? "yellow" : "cyan", l = i ? `${styleText(a, prompts_dist_d)} ` : "", $ = i ? styleText(a, dist_E) : "";
1504
- let y = "";
1505
- if (this.isNavigating || o) {
1506
- const v = o ? n : r;
1507
- y = "" !== v ? ` ${styleText("dim", v)}` : "";
1508
- } else y = ` ${this.userInputWithCursor}`;
1509
- const p = this.filteredOptions.length !== u.length ? styleText("dim", ` (${this.filteredOptions.length} match${1 === this.filteredOptions.length ? "" : "es"})`) : "", m = 0 === this.filteredOptions.length && r ? [
1491
+ const o = "error" === this.state ? "yellow" : "cyan", l = i ? `${styleText(o, dist_$)} ` : "", d = i ? styleText(o, dist_x) : "";
1492
+ let g = "";
1493
+ if (this.isNavigating || a) {
1494
+ const v = a ? n : r;
1495
+ g = "" !== v ? ` ${styleText("dim", v)}` : "";
1496
+ } else g = ` ${this.userInputWithCursor}`;
1497
+ const p = this.filteredOptions.length !== u.length ? styleText("dim", ` (${this.filteredOptions.length} match${1 === this.filteredOptions.length ? "" : "es"})`) : "", f = 0 === this.filteredOptions.length && r ? [
1510
1498
  `${l}${styleText("yellow", "No matches found")}`
1511
- ] : [], g = "error" === this.state ? [
1499
+ ] : [], h = "error" === this.state ? [
1512
1500
  `${l}${styleText("yellow", this.error)}`
1513
1501
  ] : [];
1514
- i && s.push(`${l.trimEnd()}`), s.push(`${l}${styleText("dim", "Search:")}${y}${p}`, ...m, ...g);
1515
- const S = [
1502
+ i && s.push(`${l.trimEnd()}`), s.push(`${l}${styleText("dim", "Search:")}${g}${p}`, ...f, ...h);
1503
+ const I = [
1516
1504
  `${styleText("dim", "\u2191/\u2193")} to select`,
1517
1505
  `${styleText("dim", "Enter:")} confirm`,
1518
1506
  `${styleText("dim", "Type:")} to search`
1519
- ], h = [
1520
- `${l}${S.join(" \u2022 ")}`,
1521
- $
1522
- ], f = 0 === this.filteredOptions.length ? [] : dist_Y({
1507
+ ], m = [
1508
+ `${l}${I.join(" \u2022 ")}`,
1509
+ d
1510
+ ], y = 0 === this.filteredOptions.length ? [] : dist_F({
1523
1511
  cursor: this.cursor,
1524
1512
  options: this.filteredOptions,
1525
1513
  columnPadding: i ? 3 : 0,
1526
- rowPadding: s.length + h.length,
1527
- style: (v, T)=>c(v, v.disabled ? "disabled" : T ? "active" : "inactive"),
1528
- maxItems: e.maxItems,
1529
- output: e.output
1514
+ rowPadding: s.length + m.length,
1515
+ style: (v, C)=>c(v, v.disabled ? "disabled" : C ? "active" : "inactive"),
1516
+ maxItems: t.maxItems,
1517
+ output: t.output
1530
1518
  });
1531
1519
  return [
1532
1520
  ...s,
1533
- ...f.map((v)=>`${l}${v}`),
1534
- ...h
1521
+ ...y.map((v)=>`${l}${v}`),
1522
+ ...m
1535
1523
  ].join(`
1536
1524
  `);
1537
1525
  }
1538
1526
  }
1539
1527
  }
1540
1528
  }).prompt();
1541
- const ht = (e)=>{
1542
- const { selectableGroups: i = !0, groupSpacing: s = 0 } = e, r = (n, o, c = [])=>{
1543
- const a = n.label ?? String(n.value), l = "string" == typeof n.group, $ = l && (c[c.indexOf(n) + 1] ?? {
1529
+ const pe = (t)=>{
1530
+ const { selectableGroups: i = !0, groupSpacing: s = 0 } = t, r = (n, a, c = [])=>{
1531
+ const o = n.label ?? String(n.value), l = "string" == typeof n.group, d = l && (c[c.indexOf(n) + 1] ?? {
1544
1532
  group: !0
1545
- }), y = l && $ && !0 === $.group, p = l ? i ? `${y ? dist_E : prompts_dist_d} ` : " " : "";
1546
- let m = "";
1547
- if (s > 0 && !l) {
1548
- const S = `
1549
- ${styleText("cyan", prompts_dist_d)}`;
1550
- m = `${S.repeat(s - 1)}${S} `;
1551
- }
1552
- if ("active" === o) return `${m}${styleText("dim", p)}${styleText("cyan", te)} ${a}${n.hint ? ` ${styleText("dim", `(${n.hint})`)}` : ""}`;
1553
- if ("group-active" === o) return `${m}${p}${styleText("cyan", te)} ${styleText("dim", a)}`;
1554
- if ("group-active-selected" === o) return `${m}${p}${styleText("green", dist_U)} ${styleText("dim", a)}`;
1555
- if ("selected" === o) {
1556
- const S = l || i ? styleText("green", dist_U) : "";
1557
- return `${m}${styleText("dim", p)}${S} ${styleText("dim", a)}${n.hint ? ` ${styleText("dim", `(${n.hint})`)}` : ""}`;
1558
- }
1559
- if ("cancelled" === o) return `${styleText([
1533
+ }), g = l && d && !0 === d.group;
1534
+ let p = "", f = "";
1535
+ l && (i ? (p = g ? `${dist_x} ` : `${dist_$} `, f = g ? " " : `${dist_$} `) : p = " ");
1536
+ let h = "";
1537
+ if (s > 0 && !l && (h = `
1538
+ `.repeat(s)), "active" === a) return dist_W(t.output, `${o}${n.hint ? ` ${styleText("dim", `(${n.hint})`)}` : ""}`, `${h}${styleText("dim", p)} `, `${h}${styleText("dim", p)}${styleText("cyan", dist_et)} `, `${h}${styleText("dim", f)} `);
1539
+ if ("group-active" === a) return dist_W(t.output, o, `${h}${p} `, `${h}${p}${styleText("cyan", dist_et)} `, `${h}${f} `, (m)=>styleText("dim", m));
1540
+ if ("group-active-selected" === a) return dist_W(t.output, o, `${h}${p} `, `${h}${p}${styleText("green", dist_K)} `, `${h}${f} `, (m)=>styleText("dim", m));
1541
+ if ("selected" === a) {
1542
+ const m = l || i ? styleText("green", dist_K) : "";
1543
+ return dist_W(t.output, `${o}${n.hint ? ` (${n.hint})` : ""}`, `${h}${styleText("dim", p)} `, `${h}${styleText("dim", p)}${m} `, `${h}${styleText("dim", f)} `, (y)=>styleText("dim", y));
1544
+ }
1545
+ if ("cancelled" === a) return `${styleText([
1560
1546
  "strikethrough",
1561
1547
  "dim"
1562
- ], a)}`;
1563
- if ("active-selected" === o) return `${m}${styleText("dim", p)}${styleText("green", dist_U)} ${a}${n.hint ? ` ${styleText("dim", `(${n.hint})`)}` : ""}`;
1564
- if ("submitted" === o) return `${styleText("dim", a)}`;
1565
- const g = l || i ? styleText("dim", dist_J) : "";
1566
- return `${m}${styleText("dim", p)}${g} ${styleText("dim", a)}`;
1567
- }, u = e.required ?? !0;
1568
- return new st({
1569
- options: e.options,
1570
- signal: e.signal,
1571
- input: e.input,
1572
- output: e.output,
1573
- initialValues: e.initialValues,
1548
+ ], o)}`;
1549
+ if ("active-selected" === a) return dist_W(t.output, `${o}${n.hint ? ` ${styleText("dim", `(${n.hint})`)}` : ""}`, `${h}${styleText("dim", p)} `, `${h}${styleText("dim", p)}${styleText("green", dist_K)} `, `${h}${styleText("dim", f)} `);
1550
+ if ("submitted" === a) return `${styleText("dim", o)}`;
1551
+ const I = l || i ? styleText("dim", dist_Y) : "";
1552
+ return dist_W(t.output, o, `${h}${styleText("dim", p)} `, `${h}${styleText("dim", p)}${I} `, `${h}${styleText("dim", f)} `, (m)=>styleText("dim", m));
1553
+ }, u = t.required ?? !0;
1554
+ return new it({
1555
+ options: t.options,
1556
+ signal: t.signal,
1557
+ input: t.input,
1558
+ output: t.output,
1559
+ initialValues: t.initialValues,
1574
1560
  required: u,
1575
- cursorAt: e.cursorAt,
1561
+ cursorAt: t.cursorAt,
1576
1562
  selectableGroups: i,
1577
1563
  validate (n) {
1578
1564
  if (u && (void 0 === n || 0 === n.length)) return `Please select at least one option.
@@ -1586,131 +1572,144 @@ ${styleText("reset", styleText("dim", `Press ${styleText([
1586
1572
  ], " enter "))} to submit`))}`;
1587
1573
  },
1588
1574
  render () {
1589
- const n = e.withGuide ?? dist_u.withGuide, o = `${n ? `${styleText("gray", prompts_dist_d)}
1590
- ` : ""}${dist_V(this.state)} ${e.message}
1591
- `, c = this.value ?? [];
1575
+ const n = t.withGuide ?? dist_h.withGuide, a = `${n ? `${styleText("gray", dist_$)}
1576
+ ` : ""}${dist_P(this.state)} ${t.message}
1577
+ `, c = this.value ?? [], o = (l, d)=>{
1578
+ const g = this.options, p = c.includes(l.value) || !0 === l.group && this.isGroupSelected(`${l.value}`);
1579
+ return d || "string" != typeof l.group || this.options[this.cursor].value !== l.group ? d && p ? r(l, "active-selected", g) : p ? r(l, "selected", g) : r(l, d ? "active" : "inactive", g) : r(l, p ? "group-active-selected" : "group-active", g);
1580
+ };
1592
1581
  switch(this.state){
1593
1582
  case "submit":
1594
1583
  {
1595
- const a = this.options.filter(({ value: $ })=>c.includes($)).map(($)=>r($, "submitted")), l = 0 === a.length ? "" : ` ${a.join(styleText("dim", ", "))}`;
1596
- return `${o}${n ? styleText("gray", prompts_dist_d) : ""}${l}`;
1584
+ const l = this.options.filter(({ value: g })=>c.includes(g)).map((g)=>r(g, "submitted")), d = 0 === l.length ? "" : ` ${l.join(styleText("dim", ", "))}`;
1585
+ return `${a}${n ? styleText("gray", dist_$) : ""}${d}`;
1597
1586
  }
1598
1587
  case "cancel":
1599
1588
  {
1600
- const a = this.options.filter(({ value: l })=>c.includes(l)).map((l)=>r(l, "cancelled")).join(styleText("dim", ", "));
1601
- return `${o}${n ? `${styleText("gray", prompts_dist_d)} ` : ""}${a.trim() ? `${a}${n ? `
1602
- ${styleText("gray", prompts_dist_d)}` : ""}` : ""}`;
1589
+ const l = this.options.filter(({ value: d })=>c.includes(d)).map((d)=>r(d, "cancelled")).join(styleText("dim", ", "));
1590
+ return `${a}${n ? `${styleText("gray", dist_$)} ` : ""}${l.trim() ? `${l}${n ? `
1591
+ ${styleText("gray", dist_$)}` : ""}` : ""}`;
1603
1592
  }
1604
1593
  case "error":
1605
1594
  {
1606
- const a = this.error.split(`
1607
- `).map((l, $)=>0 === $ ? `${n ? `${styleText("yellow", dist_E)} ` : ""}${styleText("yellow", l)}` : ` ${l}`).join(`
1608
- `);
1609
- return `${o}${n ? `${styleText("yellow", prompts_dist_d)} ` : ""}${this.options.map((l, $, y)=>{
1610
- const p = c.includes(l.value) || !0 === l.group && this.isGroupSelected(`${l.value}`), m = $ === this.cursor;
1611
- return m || "string" != typeof l.group || this.options[this.cursor].value !== l.group ? m && p ? r(l, "active-selected", y) : p ? r(l, "selected", y) : r(l, m ? "active" : "inactive", y) : r(l, p ? "group-active-selected" : "group-active", y);
1595
+ const l = n ? `${styleText("yellow", dist_$)} ` : "", d = this.error.split(`
1596
+ `).map((h, I)=>0 === I ? `${n ? `${styleText("yellow", dist_x)} ` : ""}${styleText("yellow", h)}` : ` ${h}`).join(`
1597
+ `), g = a.split(`
1598
+ `).length, p = d.split(`
1599
+ `).length + 1, f = dist_F({
1600
+ output: t.output,
1601
+ options: this.options,
1602
+ cursor: this.cursor,
1603
+ maxItems: t.maxItems,
1604
+ columnPadding: l.length,
1605
+ rowPadding: g + p,
1606
+ style: o
1612
1607
  }).join(`
1613
- ${n ? `${styleText("yellow", prompts_dist_d)} ` : ""}`)}
1614
- ${a}
1608
+ ${l}`);
1609
+ return `${a}${l}${f}
1610
+ ${d}
1615
1611
  `;
1616
1612
  }
1617
1613
  default:
1618
1614
  {
1619
- const a = this.options.map(($, y, p)=>{
1620
- const m = c.includes($.value) || !0 === $.group && this.isGroupSelected(`${$.value}`), g = y === this.cursor, S = !g && "string" == typeof $.group && this.options[this.cursor].value === $.group;
1621
- let h = "";
1622
- return S ? h = r($, m ? "group-active-selected" : "group-active", p) : g && m ? h = r($, "active-selected", p) : m ? h = r($, "selected", p) : h = r($, g ? "active" : "inactive", p), `${0 !== y && !h.startsWith(`
1623
- `) ? " " : ""}${h}`;
1615
+ const l = n ? `${styleText("cyan", dist_$)} ` : "", d = a.split(`
1616
+ `).length, g = (n ? 1 : 0) + 1, p = dist_F({
1617
+ output: t.output,
1618
+ options: this.options,
1619
+ cursor: this.cursor,
1620
+ maxItems: t.maxItems,
1621
+ columnPadding: l.length,
1622
+ rowPadding: d + g,
1623
+ style: o
1624
1624
  }).join(`
1625
- ${n ? styleText("cyan", prompts_dist_d) : ""}`), l = a.startsWith(`
1626
- `) ? "" : " ";
1627
- return `${o}${n ? styleText("cyan", prompts_dist_d) : ""}${l}${a}
1628
- ${n ? styleText("cyan", dist_E) : ""}
1625
+ ${l}`);
1626
+ return `${a}${l}${p}
1627
+ ${n ? styleText("cyan", dist_x) : ""}
1629
1628
  `;
1630
1629
  }
1631
1630
  }
1632
1631
  }
1633
1632
  }).prompt();
1634
- }, dist_O = {
1635
- message: (e = [], { symbol: i = styleText("gray", prompts_dist_d), secondarySymbol: s = styleText("gray", prompts_dist_d), output: r = process.stdout, spacing: u = 1, withGuide: n } = {})=>{
1636
- const o = [], c = n ?? dist_u.withGuide, a = c ? s : "", l = c ? `${i} ` : "", $ = c ? `${s} ` : "";
1637
- for(let p = 0; p < u; p++)o.push(a);
1638
- const y = Array.isArray(e) ? e : e.split(`
1633
+ }, dist_R = {
1634
+ message: (t = [], { symbol: i = styleText("gray", dist_$), secondarySymbol: s = styleText("gray", dist_$), output: r = process.stdout, spacing: u = 1, withGuide: n } = {})=>{
1635
+ const a = [], c = n ?? dist_h.withGuide, o = c ? s : "", l = c ? `${i} ` : "", d = c ? `${s} ` : "";
1636
+ for(let p = 0; p < u; p++)a.push(o);
1637
+ const g = Array.isArray(t) ? t : t.split(`
1639
1638
  `);
1640
- if (y.length > 0) {
1641
- const [p, ...m] = y;
1642
- p.length > 0 ? o.push(`${l}${p}`) : o.push(c ? i : "");
1643
- for (const g of m)g.length > 0 ? o.push(`${$}${g}`) : o.push(c ? s : "");
1639
+ if (g.length > 0) {
1640
+ const [p, ...f] = g;
1641
+ p.length > 0 ? a.push(`${l}${p}`) : a.push(c ? i : "");
1642
+ for (const h of f)h.length > 0 ? a.push(`${d}${h}`) : a.push(c ? s : "");
1644
1643
  }
1645
- r.write(`${o.join(`
1644
+ r.write(`${a.join(`
1646
1645
  `)}
1647
1646
  `);
1648
1647
  },
1649
- info: (e, i)=>{
1650
- dist_O.message(e, {
1648
+ info: (t, i)=>{
1649
+ dist_R.message(t, {
1651
1650
  ...i,
1652
- symbol: styleText("blue", he)
1651
+ symbol: styleText("blue", dist_ht)
1653
1652
  });
1654
1653
  },
1655
- success: (e, i)=>{
1656
- dist_O.message(e, {
1654
+ success: (t, i)=>{
1655
+ dist_R.message(t, {
1657
1656
  ...i,
1658
- symbol: styleText("green", pe)
1657
+ symbol: styleText("green", pt)
1659
1658
  });
1660
1659
  },
1661
- step: (e, i)=>{
1662
- dist_O.message(e, {
1660
+ step: (t, i)=>{
1661
+ dist_R.message(t, {
1663
1662
  ...i,
1664
- symbol: styleText("green", dist_F)
1663
+ symbol: styleText("green", dist_H)
1665
1664
  });
1666
1665
  },
1667
- warn: (e, i)=>{
1668
- dist_O.message(e, {
1666
+ warn: (t, i)=>{
1667
+ dist_R.message(t, {
1669
1668
  ...i,
1670
- symbol: styleText("yellow", me)
1669
+ symbol: styleText("yellow", mt)
1671
1670
  });
1672
1671
  },
1673
- warning: (e, i)=>{
1674
- dist_O.warn(e, i);
1672
+ warning: (t, i)=>{
1673
+ dist_R.warn(t, i);
1675
1674
  },
1676
- error: (e, i)=>{
1677
- dist_O.message(e, {
1675
+ error: (t, i)=>{
1676
+ dist_R.message(t, {
1678
1677
  ...i,
1679
- symbol: styleText("red", ge)
1678
+ symbol: styleText("red", gt)
1680
1679
  });
1681
1680
  }
1682
- }, pt = (e = "", i)=>{
1683
- const s = i?.output ?? process.stdout, r = i?.withGuide ?? dist_u.withGuide ? `${styleText("gray", dist_E)} ` : "";
1684
- s.write(`${r}${styleText("red", e)}
1681
+ }, me = (t = "", i)=>{
1682
+ const s = i?.output ?? process.stdout, r = i?.withGuide ?? dist_h.withGuide ? `${styleText("gray", dist_x)} ` : "";
1683
+ s.write(`${r}${styleText("red", t)}
1685
1684
 
1686
1685
  `);
1687
- }, gt = (e = "", i)=>{
1688
- const s = i?.output ?? process.stdout, r = i?.withGuide ?? dist_u.withGuide ? `${styleText("gray", prompts_dist_d)}
1689
- ${styleText("gray", dist_E)} ` : "";
1690
- s.write(`${r}${e}
1686
+ }, ye = (t = "", i)=>{
1687
+ const s = i?.output ?? process.stdout, r = i?.withGuide ?? dist_h.withGuide ? `${styleText("gray", dist_$)}
1688
+ ${styleText("gray", dist_x)} ` : "";
1689
+ s.write(`${r}${t}
1691
1690
 
1692
1691
  `);
1693
- }, dist_Q = (e, i)=>e.split(`
1692
+ }, dist_Q = (t, i)=>t.split(`
1694
1693
  `).map((s)=>i(s)).join(`
1695
- `), yt = (e)=>{
1694
+ `), ve = (t)=>{
1696
1695
  const i = (r, u)=>{
1697
1696
  const n = r.label ?? String(r.value);
1698
- return "disabled" === u ? `${styleText("gray", dist_J)} ${dist_Q(n, (o)=>styleText([
1697
+ return "disabled" === u ? `${styleText("gray", dist_Y)} ${dist_Q(n, (a)=>styleText([
1699
1698
  "strikethrough",
1700
1699
  "gray"
1701
- ], o))}${r.hint ? ` ${styleText("dim", `(${r.hint ?? "disabled"})`)}` : ""}` : "active" === u ? `${styleText("cyan", te)} ${n}${r.hint ? ` ${styleText("dim", `(${r.hint})`)}` : ""}` : "selected" === u ? `${styleText("green", dist_U)} ${dist_Q(n, (o)=>styleText("dim", o))}${r.hint ? ` ${styleText("dim", `(${r.hint})`)}` : ""}` : "cancelled" === u ? `${dist_Q(n, (o)=>styleText([
1700
+ ], a))}${r.hint ? ` ${styleText("dim", `(${r.hint ?? "disabled"})`)}` : ""}` : "active" === u ? `${styleText("cyan", dist_et)} ${n}${r.hint ? ` ${styleText("dim", `(${r.hint})`)}` : ""}` : "selected" === u ? `${styleText("green", dist_K)} ${dist_Q(n, (a)=>styleText("dim", a))}${r.hint ? ` ${styleText("dim", `(${r.hint})`)}` : ""}` : "cancelled" === u ? `${dist_Q(n, (a)=>styleText([
1702
1701
  "strikethrough",
1703
1702
  "dim"
1704
- ], o))}` : "active-selected" === u ? `${styleText("green", dist_U)} ${n}${r.hint ? ` ${styleText("dim", `(${r.hint})`)}` : ""}` : "submitted" === u ? `${dist_Q(n, (o)=>styleText("dim", o))}` : `${styleText("dim", dist_J)} ${dist_Q(n, (o)=>styleText("dim", o))}`;
1705
- }, s = e.required ?? !0;
1706
- return new it({
1707
- options: e.options,
1708
- signal: e.signal,
1709
- input: e.input,
1710
- output: e.output,
1711
- initialValues: e.initialValues,
1703
+ ], a))}` : "active-selected" === u ? `${styleText("green", dist_K)} ${n}${r.hint ? ` ${styleText("dim", `(${r.hint})`)}` : ""}` : "submitted" === u ? `${dist_Q(n, (a)=>styleText("dim", a))}` : `${styleText("dim", dist_Y)} ${dist_Q(n, (a)=>styleText("dim", a))}`;
1704
+ }, s = t.required ?? !0;
1705
+ return new dist_nt({
1706
+ options: t.options,
1707
+ signal: t.signal,
1708
+ input: t.input,
1709
+ output: t.output,
1710
+ initialValues: t.initialValues,
1712
1711
  required: s,
1713
- cursorAt: e.cursorAt,
1712
+ cursorAt: t.cursorAt,
1714
1713
  validate (r) {
1715
1714
  if (s && (void 0 === r || 0 === r.length)) return `Please select at least one option.
1716
1715
  ${styleText("reset", styleText("dim", `Press ${styleText([
@@ -1720,319 +1719,319 @@ ${styleText("reset", styleText("dim", `Press ${styleText([
1720
1719
  ], " space ")} to select, ${styleText("gray", styleText("bgWhite", styleText("inverse", " enter ")))} to submit`))}`;
1721
1720
  },
1722
1721
  render () {
1723
- const r = e.withGuide ?? dist_u.withGuide, u = dist_R(e.output, e.message, r ? `${ye(this.state)} ` : "", `${dist_V(this.state)} `), n = `${r ? `${styleText("gray", prompts_dist_d)}
1722
+ const r = t.withGuide ?? dist_h.withGuide, u = dist_W(t.output, t.message, r ? `${yt(this.state)} ` : "", `${dist_P(this.state)} `), n = `${r ? `${styleText("gray", dist_$)}
1724
1723
  ` : ""}${u}
1725
- `, o = this.value ?? [], c = (a, l)=>{
1726
- if (a.disabled) return i(a, "disabled");
1727
- const $ = o.includes(a.value);
1728
- return l && $ ? i(a, "active-selected") : $ ? i(a, "selected") : i(a, l ? "active" : "inactive");
1724
+ `, a = this.value ?? [], c = (o, l)=>{
1725
+ if (o.disabled) return i(o, "disabled");
1726
+ const d = a.includes(o.value);
1727
+ return l && d ? i(o, "active-selected") : d ? i(o, "selected") : i(o, l ? "active" : "inactive");
1729
1728
  };
1730
1729
  switch(this.state){
1731
1730
  case "submit":
1732
1731
  {
1733
- const a = this.options.filter(({ value: $ })=>o.includes($)).map(($)=>i($, "submitted")).join(styleText("dim", ", ")) || styleText("dim", "none"), l = dist_R(e.output, a, r ? `${styleText("gray", prompts_dist_d)} ` : "");
1732
+ const o = this.options.filter(({ value: d })=>a.includes(d)).map((d)=>i(d, "submitted")).join(styleText("dim", ", ")) || styleText("dim", "none"), l = dist_W(t.output, o, r ? `${styleText("gray", dist_$)} ` : "");
1734
1733
  return `${n}${l}`;
1735
1734
  }
1736
1735
  case "cancel":
1737
1736
  {
1738
- const a = this.options.filter(({ value: $ })=>o.includes($)).map(($)=>i($, "cancelled")).join(styleText("dim", ", "));
1739
- if ("" === a.trim()) return `${n}${styleText("gray", prompts_dist_d)}`;
1740
- const l = dist_R(e.output, a, r ? `${styleText("gray", prompts_dist_d)} ` : "");
1737
+ const o = this.options.filter(({ value: d })=>a.includes(d)).map((d)=>i(d, "cancelled")).join(styleText("dim", ", "));
1738
+ if ("" === o.trim()) return `${n}${styleText("gray", dist_$)}`;
1739
+ const l = dist_W(t.output, o, r ? `${styleText("gray", dist_$)} ` : "");
1741
1740
  return `${n}${l}${r ? `
1742
- ${styleText("gray", prompts_dist_d)}` : ""}`;
1741
+ ${styleText("gray", dist_$)}` : ""}`;
1743
1742
  }
1744
1743
  case "error":
1745
1744
  {
1746
- const a = r ? `${styleText("yellow", prompts_dist_d)} ` : "", l = this.error.split(`
1747
- `).map((p, m)=>0 === m ? `${r ? `${styleText("yellow", dist_E)} ` : ""}${styleText("yellow", p)}` : ` ${p}`).join(`
1748
- `), $ = n.split(`
1749
- `).length, y = l.split(`
1745
+ const o = r ? `${styleText("yellow", dist_$)} ` : "", l = this.error.split(`
1746
+ `).map((p, f)=>0 === f ? `${r ? `${styleText("yellow", dist_x)} ` : ""}${styleText("yellow", p)}` : ` ${p}`).join(`
1747
+ `), d = n.split(`
1748
+ `).length, g = l.split(`
1750
1749
  `).length + 1;
1751
- return `${n}${a}${dist_Y({
1752
- output: e.output,
1750
+ return `${n}${o}${dist_F({
1751
+ output: t.output,
1753
1752
  options: this.options,
1754
1753
  cursor: this.cursor,
1755
- maxItems: e.maxItems,
1756
- columnPadding: a.length,
1757
- rowPadding: $ + y,
1754
+ maxItems: t.maxItems,
1755
+ columnPadding: o.length,
1756
+ rowPadding: d + g,
1758
1757
  style: c
1759
1758
  }).join(`
1760
- ${a}`)}
1759
+ ${o}`)}
1761
1760
  ${l}
1762
1761
  `;
1763
1762
  }
1764
1763
  default:
1765
1764
  {
1766
- const a = r ? `${styleText("cyan", prompts_dist_d)} ` : "", l = n.split(`
1767
- `).length, $ = r ? 2 : 1;
1768
- return `${n}${a}${dist_Y({
1769
- output: e.output,
1765
+ const o = r ? `${styleText("cyan", dist_$)} ` : "", l = n.split(`
1766
+ `).length, d = r ? 2 : 1;
1767
+ return `${n}${o}${dist_F({
1768
+ output: t.output,
1770
1769
  options: this.options,
1771
1770
  cursor: this.cursor,
1772
- maxItems: e.maxItems,
1773
- columnPadding: a.length,
1774
- rowPadding: l + $,
1771
+ maxItems: t.maxItems,
1772
+ columnPadding: o.length,
1773
+ rowPadding: l + d,
1775
1774
  style: c
1776
1775
  }).join(`
1777
- ${a}`)}
1778
- ${r ? styleText("cyan", dist_E) : ""}
1776
+ ${o}`)}
1777
+ ${r ? styleText("cyan", dist_x) : ""}
1779
1778
  `;
1780
1779
  }
1781
1780
  }
1782
1781
  }
1783
1782
  }).prompt();
1784
- }, ft = (e)=>styleText("dim", e), vt = (e, i, s)=>{
1783
+ }, we = (t)=>styleText("dim", t), be = (t, i, s)=>{
1785
1784
  const r = {
1786
1785
  hard: !0,
1787
1786
  trim: !1
1788
- }, u = wrapAnsi(e, i, r).split(`
1789
- `), n = u.reduce((a, l)=>Math.max(fast_string_width_dist(l), a), 0), o = u.map(s).reduce((a, l)=>Math.max(fast_string_width_dist(l), a), 0), c = i - (o - n);
1790
- return wrapAnsi(e, c, r);
1791
- }, wt = (e = "", i = "", s)=>{
1792
- const r = s?.output ?? node_process.stdout, u = s?.withGuide ?? dist_u.withGuide, n = s?.format ?? ft, o = [
1787
+ }, u = wrapAnsi(t, i, r).split(`
1788
+ `), n = u.reduce((o, l)=>Math.max(fast_string_width_dist(l), o), 0), a = u.map(s).reduce((o, l)=>Math.max(fast_string_width_dist(l), o), 0), c = i - (a - n);
1789
+ return wrapAnsi(t, c, r);
1790
+ }, Se = (t = "", i = "", s)=>{
1791
+ const r = s?.output ?? node_process.stdout, u = s?.withGuide ?? dist_h.withGuide, n = s?.format ?? we, a = [
1793
1792
  "",
1794
- ...vt(e, O(r) - 6, n).split(`
1793
+ ...be(t, dist_A(r) - 6, n).split(`
1795
1794
  `).map(n),
1796
1795
  ""
1797
- ], c = fast_string_width_dist(i), a = Math.max(o.reduce((p, m)=>{
1798
- const g = fast_string_width_dist(m);
1799
- return g > p ? g : p;
1800
- }, 0), c) + 2, l = o.map((p)=>`${styleText("gray", prompts_dist_d)} ${p}${" ".repeat(a - fast_string_width_dist(p))}${styleText("gray", prompts_dist_d)}`).join(`
1801
- `), $ = u ? `${styleText("gray", prompts_dist_d)}
1802
- ` : "", y = u ? Ge : de;
1803
- r.write(`${$}${styleText("green", dist_F)} ${styleText("reset", i)} ${styleText("gray", se.repeat(Math.max(a - c - 1, 1)) + ce)}
1796
+ ], c = fast_string_width_dist(i), o = Math.max(a.reduce((p, f)=>{
1797
+ const h = fast_string_width_dist(f);
1798
+ return h > p ? h : p;
1799
+ }, 0), c) + 2, l = a.map((p)=>`${styleText("gray", dist_$)} ${p}${" ".repeat(o - fast_string_width_dist(p))}${styleText("gray", dist_$)}`).join(`
1800
+ `), d = u ? `${styleText("gray", dist_$)}
1801
+ ` : "", g = u ? Gt : dt;
1802
+ r.write(`${d}${styleText("green", dist_H)} ${styleText("reset", i)} ${styleText("gray", dist_st.repeat(Math.max(o - c - 1, 1)) + ct)}
1804
1803
  ${l}
1805
- ${styleText("gray", y + se.repeat(a + 2) + $e)}
1804
+ ${styleText("gray", g + dist_st.repeat(o + 2) + $t)}
1806
1805
  `);
1807
1806
  };
1808
1807
  dist_w("\u2500", "-"), dist_w("\u2501", "="), dist_w("\u2588", "#");
1809
- const re = (e, i)=>e.includes(`
1810
- `) ? e.split(`
1808
+ const dist_it = (t, i)=>t.includes(`
1809
+ `) ? t.split(`
1811
1810
  `).map((s)=>i(s)).join(`
1812
- `) : i(e), _t = (e)=>{
1811
+ `) : i(t), xe = (t)=>{
1813
1812
  const i = (s, r)=>{
1814
1813
  const u = s.label ?? String(s.value);
1815
1814
  switch(r){
1816
1815
  case "disabled":
1817
- return `${styleText("gray", dist_H)} ${re(u, (n)=>styleText("gray", n))}${s.hint ? ` ${styleText("dim", `(${s.hint ?? "disabled"})`)}` : ""}`;
1816
+ return `${styleText("gray", dist_U)} ${dist_it(u, (n)=>styleText("gray", n))}${s.hint ? ` ${styleText("dim", `(${s.hint ?? "disabled"})`)}` : ""}`;
1818
1817
  case "selected":
1819
- return `${re(u, (n)=>styleText("dim", n))}`;
1818
+ return `${dist_it(u, (n)=>styleText("dim", n))}`;
1820
1819
  case "active":
1821
1820
  return `${styleText("green", dist_z)} ${u}${s.hint ? ` ${styleText("dim", `(${s.hint})`)}` : ""}`;
1822
1821
  case "cancelled":
1823
- return `${re(u, (n)=>styleText([
1822
+ return `${dist_it(u, (n)=>styleText([
1824
1823
  "strikethrough",
1825
1824
  "dim"
1826
1825
  ], n))}`;
1827
1826
  default:
1828
- return `${styleText("dim", dist_H)} ${re(u, (n)=>styleText("dim", n))}`;
1827
+ return `${styleText("dim", dist_U)} ${dist_it(u, (n)=>styleText("dim", n))}`;
1829
1828
  }
1830
1829
  };
1831
- return new nt({
1832
- options: e.options,
1833
- signal: e.signal,
1834
- input: e.input,
1835
- output: e.output,
1836
- initialValue: e.initialValue,
1830
+ return new ut({
1831
+ options: t.options,
1832
+ signal: t.signal,
1833
+ input: t.input,
1834
+ output: t.output,
1835
+ initialValue: t.initialValue,
1837
1836
  render () {
1838
- const s = e.withGuide ?? dist_u.withGuide, r = `${dist_V(this.state)} `, u = `${ye(this.state)} `, n = dist_R(e.output, e.message, u, r), o = `${s ? `${styleText("gray", prompts_dist_d)}
1837
+ const s = t.withGuide ?? dist_h.withGuide, r = `${dist_P(this.state)} `, u = `${yt(this.state)} `, n = dist_W(t.output, t.message, u, r), a = `${s ? `${styleText("gray", dist_$)}
1839
1838
  ` : ""}${n}
1840
1839
  `;
1841
1840
  switch(this.state){
1842
1841
  case "submit":
1843
1842
  {
1844
- const c = s ? `${styleText("gray", prompts_dist_d)} ` : "", a = dist_R(e.output, i(this.options[this.cursor], "selected"), c);
1845
- return `${o}${a}`;
1843
+ const c = s ? `${styleText("gray", dist_$)} ` : "", o = dist_W(t.output, i(this.options[this.cursor], "selected"), c);
1844
+ return `${a}${o}`;
1846
1845
  }
1847
1846
  case "cancel":
1848
1847
  {
1849
- const c = s ? `${styleText("gray", prompts_dist_d)} ` : "", a = dist_R(e.output, i(this.options[this.cursor], "cancelled"), c);
1850
- return `${o}${a}${s ? `
1851
- ${styleText("gray", prompts_dist_d)}` : ""}`;
1848
+ const c = s ? `${styleText("gray", dist_$)} ` : "", o = dist_W(t.output, i(this.options[this.cursor], "cancelled"), c);
1849
+ return `${a}${o}${s ? `
1850
+ ${styleText("gray", dist_$)}` : ""}`;
1852
1851
  }
1853
1852
  default:
1854
1853
  {
1855
- const c = s ? `${styleText("cyan", prompts_dist_d)} ` : "", a = s ? styleText("cyan", dist_E) : "", l = o.split(`
1856
- `).length, $ = s ? 2 : 1;
1857
- return `${o}${c}${dist_Y({
1858
- output: e.output,
1854
+ const c = s ? `${styleText("cyan", dist_$)} ` : "", o = s ? styleText("cyan", dist_x) : "", l = a.split(`
1855
+ `).length, d = s ? 2 : 1;
1856
+ return `${a}${c}${dist_F({
1857
+ output: t.output,
1859
1858
  cursor: this.cursor,
1860
1859
  options: this.options,
1861
- maxItems: e.maxItems,
1860
+ maxItems: t.maxItems,
1862
1861
  columnPadding: c.length,
1863
- rowPadding: l + $,
1864
- style: (y, p)=>i(y, y.disabled ? "disabled" : p ? "active" : "inactive")
1862
+ rowPadding: l + d,
1863
+ style: (g, p)=>i(g, g.disabled ? "disabled" : p ? "active" : "inactive")
1865
1864
  }).join(`
1866
1865
  ${c}`)}
1867
- ${a}
1866
+ ${o}
1868
1867
  `;
1869
1868
  }
1870
1869
  }
1871
1870
  }
1872
1871
  }).prompt();
1873
- }, xt = (styleText("gray", prompts_dist_d), (e)=>e.replace(/\x1b\[(?:\d+;)*\d*[ABCDEFGHfJKSTsu]|\x1b\[(s|u)/g, "")), Gt = (e)=>{
1874
- const i = e.output ?? process.stdout, s = O(i), r = styleText("gray", prompts_dist_d), u = e.spacing ?? 1, n = 3, o = !0 === e.retainLog, c = !ae() && Te(i);
1872
+ }, Me = (styleText("gray", dist_$), (t)=>t.replace(/\x1b\[(?:\d+;)*\d*[ABCDEFGHfJKSTsu]|\x1b\[(s|u)/g, "")), Oe = (t)=>{
1873
+ const i = t.output ?? process.stdout, s = dist_A(i), r = styleText("gray", dist_$), u = t.spacing ?? 1, n = 3, a = !0 === t.retainLog, c = !dist_ot() && It(i);
1875
1874
  i.write(`${r}
1876
- `), i.write(`${styleText("green", dist_F)} ${e.title}
1875
+ `), i.write(`${styleText("green", dist_H)} ${t.title}
1877
1876
  `);
1878
- for(let h = 0; h < u; h++)i.write(`${r}
1877
+ for(let m = 0; m < u; m++)i.write(`${r}
1879
1878
  `);
1880
- const a = [
1879
+ const o = [
1881
1880
  {
1882
1881
  value: "",
1883
1882
  full: ""
1884
1883
  }
1885
1884
  ];
1886
1885
  let l = !1;
1887
- const $ = (h)=>{
1888
- if (0 === a.length) return;
1889
- let f = 0;
1890
- h && (f += u + 2);
1891
- for (const v of a){
1892
- const { value: T, result: C } = v;
1893
- let b = C?.message ?? T;
1886
+ const d = (m)=>{
1887
+ if (0 === o.length) return;
1888
+ let y = 0;
1889
+ m && (y += u + 2);
1890
+ for (const v of o){
1891
+ const { value: C, result: S } = v;
1892
+ let b = S?.message ?? C;
1894
1893
  if (0 === b.length) continue;
1895
- void 0 === C && void 0 !== v.header && "" !== v.header && (b += `
1894
+ void 0 === S && void 0 !== v.header && "" !== v.header && (b += `
1896
1895
  ${v.header}`);
1897
- const x = b.split(`
1898
- `).reduce((G, M)=>"" === M ? G + 1 : G + Math.ceil((M.length + n) / s), 0);
1899
- f += x;
1900
- }
1901
- f > 0 && (f += 1, i.write(src.erase.lines(f)));
1902
- }, y = (h, f, v)=>{
1903
- const T = v ? `${h.full}
1904
- ${h.value}` : h.value;
1905
- void 0 !== h.header && "" !== h.header && dist_O.message(h.header.split(`
1906
- `).map((C)=>styleText("bold", C)), {
1896
+ const G = b.split(`
1897
+ `).reduce((M, N)=>"" === N ? M + 1 : M + Math.ceil((N.length + n) / s), 0);
1898
+ y += G;
1899
+ }
1900
+ y > 0 && (y += 1, i.write(src.erase.lines(y)));
1901
+ }, g = (m, y, v)=>{
1902
+ const C = v ? `${m.full}
1903
+ ${m.value}` : m.value;
1904
+ void 0 !== m.header && "" !== m.header && dist_R.message(m.header.split(`
1905
+ `).map((S)=>styleText("bold", S)), {
1907
1906
  output: i,
1908
1907
  secondarySymbol: r,
1909
1908
  symbol: r,
1910
1909
  spacing: 0
1911
- }), dist_O.message(T.split(`
1912
- `).map((C)=>styleText("dim", C)), {
1910
+ }), dist_R.message(C.split(`
1911
+ `).map((S)=>styleText("dim", S)), {
1913
1912
  output: i,
1914
1913
  secondarySymbol: r,
1915
1914
  symbol: r,
1916
- spacing: f ?? u
1915
+ spacing: y ?? u
1917
1916
  });
1918
1917
  }, p = ()=>{
1919
- for (const h of a){
1920
- const { header: f, value: v, full: T } = h;
1921
- (void 0 === f || 0 === f.length) && 0 === v.length || y(h, void 0, !0 === o && T.length > 0);
1922
- }
1923
- }, m = (h, f, v)=>{
1924
- if ($(!1), v?.raw === !0 && l || "" === h.value || (h.value += `
1925
- `), h.value += xt(f), l = v?.raw === !0, void 0 !== e.limit) {
1926
- const T = h.value.split(`
1927
- `), C = T.length - e.limit;
1928
- if (C > 0) {
1929
- const b = T.splice(0, C);
1930
- o && (h.full += ("" === h.full ? "" : `
1918
+ for (const m of o){
1919
+ const { header: y, value: v, full: C } = m;
1920
+ (void 0 === y || 0 === y.length) && 0 === v.length || g(m, void 0, !0 === a && C.length > 0);
1921
+ }
1922
+ }, f = (m, y, v)=>{
1923
+ if (d(!1), v?.raw === !0 && l || "" === m.value || (m.value += `
1924
+ `), m.value += Me(y), l = v?.raw === !0, void 0 !== t.limit) {
1925
+ const C = m.value.split(`
1926
+ `), S = C.length - t.limit;
1927
+ if (S > 0) {
1928
+ const b = C.splice(0, S);
1929
+ a && (m.full += ("" === m.full ? "" : `
1931
1930
  `) + b.join(`
1932
1931
  `));
1933
1932
  }
1934
- h.value = T.join(`
1933
+ m.value = C.join(`
1935
1934
  `);
1936
1935
  }
1937
- c && g();
1938
- }, g = ()=>{
1939
- for (const h of a)h.result ? "error" === h.result.status ? dist_O.error(h.result.message, {
1936
+ c && h();
1937
+ }, h = ()=>{
1938
+ for (const m of o)m.result ? "error" === m.result.status ? dist_R.error(m.result.message, {
1940
1939
  output: i,
1941
1940
  secondarySymbol: r,
1942
1941
  spacing: 0
1943
- }) : dist_O.success(h.result.message, {
1942
+ }) : dist_R.success(m.result.message, {
1944
1943
  output: i,
1945
1944
  secondarySymbol: r,
1946
1945
  spacing: 0
1947
- }) : "" !== h.value && y(h, 0);
1948
- }, S = (h, f)=>{
1949
- $(!1), h.result = f, c && g();
1946
+ }) : "" !== m.value && g(m, 0);
1947
+ }, I = (m, y)=>{
1948
+ d(!1), m.result = y, c && h();
1950
1949
  };
1951
1950
  return {
1952
- message (h, f) {
1953
- m(a[0], h, f);
1951
+ message (m, y) {
1952
+ f(o[0], m, y);
1954
1953
  },
1955
- group (h) {
1956
- const f = {
1957
- header: h,
1954
+ group (m) {
1955
+ const y = {
1956
+ header: m,
1958
1957
  value: "",
1959
1958
  full: ""
1960
1959
  };
1961
- return a.push(f), {
1962
- message (v, T) {
1963
- m(f, v, T);
1960
+ return o.push(y), {
1961
+ message (v, C) {
1962
+ f(y, v, C);
1964
1963
  },
1965
1964
  error (v) {
1966
- S(f, {
1965
+ I(y, {
1967
1966
  status: "error",
1968
1967
  message: v
1969
1968
  });
1970
1969
  },
1971
1970
  success (v) {
1972
- S(f, {
1971
+ I(y, {
1973
1972
  status: "success",
1974
1973
  message: v
1975
1974
  });
1976
1975
  }
1977
1976
  };
1978
1977
  },
1979
- error (h, f) {
1980
- $(!0), dist_O.error(h, {
1978
+ error (m, y) {
1979
+ d(!0), dist_R.error(m, {
1981
1980
  output: i,
1982
1981
  secondarySymbol: r,
1983
1982
  spacing: 1
1984
- }), f?.showLog !== !1 && p(), a.splice(1, a.length - 1), a[0].value = "", a[0].full = "";
1983
+ }), y?.showLog !== !1 && p(), o.splice(1, o.length - 1), o[0].value = "", o[0].full = "";
1985
1984
  },
1986
- success (h, f) {
1987
- $(!0), dist_O.success(h, {
1985
+ success (m, y) {
1986
+ d(!0), dist_R.success(m, {
1988
1987
  output: i,
1989
1988
  secondarySymbol: r,
1990
1989
  spacing: 1
1991
- }), f?.showLog === !0 && p(), a.splice(1, a.length - 1), a[0].value = "", a[0].full = "";
1990
+ }), y?.showLog === !0 && p(), o.splice(1, o.length - 1), o[0].value = "", o[0].full = "";
1992
1991
  }
1993
1992
  };
1994
- }, Ot = (e)=>new at({
1995
- validate: e.validate,
1996
- placeholder: e.placeholder,
1997
- defaultValue: e.defaultValue,
1998
- initialValue: e.initialValue,
1999
- output: e.output,
2000
- signal: e.signal,
2001
- input: e.input,
1993
+ }, Pe = (t)=>new ht({
1994
+ validate: t.validate,
1995
+ placeholder: t.placeholder,
1996
+ defaultValue: t.defaultValue,
1997
+ initialValue: t.initialValue,
1998
+ output: t.output,
1999
+ signal: t.signal,
2000
+ input: t.input,
2002
2001
  render () {
2003
- const i = e?.withGuide ?? dist_u.withGuide, s = `${i ? `${styleText("gray", prompts_dist_d)}
2004
- ` : ""}${dist_V(this.state)} ${e.message}
2005
- `, r = e.placeholder ? styleText("inverse", e.placeholder[0]) + styleText("dim", e.placeholder.slice(1)) : styleText([
2002
+ const i = t?.withGuide ?? dist_h.withGuide, s = `${i ? `${styleText("gray", dist_$)}
2003
+ ` : ""}${dist_P(this.state)} ${t.message}
2004
+ `, r = t.placeholder ? styleText("inverse", t.placeholder[0]) + styleText("dim", t.placeholder.slice(1)) : styleText([
2006
2005
  "inverse",
2007
2006
  "hidden"
2008
2007
  ], "_"), u = this.userInput ? this.userInputWithCursor : r, n = this.value ?? "";
2009
2008
  switch(this.state){
2010
2009
  case "error":
2011
2010
  {
2012
- const o = this.error ? ` ${styleText("yellow", this.error)}` : "", c = i ? `${styleText("yellow", prompts_dist_d)} ` : "", a = i ? styleText("yellow", dist_E) : "";
2011
+ const a = this.error ? ` ${styleText("yellow", this.error)}` : "", c = i ? `${styleText("yellow", dist_$)} ` : "", o = i ? styleText("yellow", dist_x) : "";
2013
2012
  return `${s.trim()}
2014
2013
  ${c}${u}
2015
- ${a}${o}
2014
+ ${o}${a}
2016
2015
  `;
2017
2016
  }
2018
2017
  case "submit":
2019
2018
  {
2020
- const o = n ? ` ${styleText("dim", n)}` : "", c = i ? styleText("gray", prompts_dist_d) : "";
2021
- return `${s}${c}${o}`;
2019
+ const a = n ? ` ${styleText("dim", n)}` : "", c = i ? styleText("gray", dist_$) : "";
2020
+ return `${s}${c}${a}`;
2022
2021
  }
2023
2022
  case "cancel":
2024
2023
  {
2025
- const o = n ? ` ${styleText([
2024
+ const a = n ? ` ${styleText([
2026
2025
  "strikethrough",
2027
2026
  "dim"
2028
- ], n)}` : "", c = i ? styleText("gray", prompts_dist_d) : "";
2029
- return `${s}${c}${o}${n.trim() ? `
2027
+ ], n)}` : "", c = i ? styleText("gray", dist_$) : "";
2028
+ return `${s}${c}${a}${n.trim() ? `
2030
2029
  ${c}` : ""}`;
2031
2030
  }
2032
2031
  default:
2033
2032
  {
2034
- const o = i ? `${styleText("cyan", prompts_dist_d)} ` : "", c = i ? styleText("cyan", dist_E) : "";
2035
- return `${s}${o}${u}
2033
+ const a = i ? `${styleText("cyan", dist_$)} ` : "", c = i ? styleText("cyan", dist_x) : "";
2034
+ return `${s}${a}${u}
2036
2035
  ${c}
2037
2036
  `;
2038
2037
  }
@@ -2310,18 +2309,14 @@ let createLogger = (options = {})=>{
2310
2309
  return logger;
2311
2310
  };
2312
2311
  let src_logger = createLogger();
2313
- var main_d = (e, t)=>()=>(t || e((t = {
2314
- exports: {}
2315
- }).exports, t), t.exports);
2316
- var main_f = /* @__PURE__ */ createRequire(import.meta.url);
2317
- const main_p = /^path$/i;
2318
- const main_m = {
2312
+ const main_h = /^path$/i;
2313
+ const main_g = {
2319
2314
  key: "PATH",
2320
2315
  value: ""
2321
2316
  };
2322
- function main_h(e) {
2317
+ function main_(e) {
2323
2318
  for(const t in e){
2324
- if (!Object.prototype.hasOwnProperty.call(e, t) || !main_p.test(t)) continue;
2319
+ if (!Object.prototype.hasOwnProperty.call(e, t) || !main_h.test(t)) continue;
2325
2320
  const n = e[t];
2326
2321
  if (!n) break;
2327
2322
  return {
@@ -2329,35 +2324,36 @@ function main_h(e) {
2329
2324
  value: n
2330
2325
  };
2331
2326
  }
2332
- return main_m;
2327
+ return main_g;
2333
2328
  }
2334
- function main_g(e, t) {
2329
+ function main_v(e, t) {
2335
2330
  const n = t.value.split(delimiter);
2336
- const a = [];
2337
- let s = e;
2331
+ const r = [];
2332
+ let o = e;
2338
2333
  let c;
2339
2334
  do {
2340
- a.push(resolve(s, "node_modules", ".bin"));
2341
- c = s;
2342
- s = dirname(s);
2343
- }while (s !== c);
2344
- a.push(dirname(process.execPath));
2345
- const l = a.concat(n).join(delimiter);
2335
+ r.push(resolve(o, "node_modules", ".bin"));
2336
+ c = o;
2337
+ o = dirname(o);
2338
+ }while (o !== c);
2339
+ r.push(dirname(process.execPath));
2340
+ const l = r.concat(n).join(delimiter);
2346
2341
  return {
2347
2342
  key: t.key,
2348
2343
  value: l
2349
2344
  };
2350
2345
  }
2351
- function main_(e, t) {
2352
- const n = {
2346
+ function main_y(e, t, n = true) {
2347
+ const r = {
2353
2348
  ...process.env,
2354
2349
  ...t
2355
2350
  };
2356
- const r = main_g(e, main_h(n));
2357
- n[r.key] = r.value;
2358
- return n;
2351
+ if (!n) return r;
2352
+ const i = main_v(e, main_(r));
2353
+ r[i.key] = i.value;
2354
+ return r;
2359
2355
  }
2360
- const main_v = (e)=>{
2356
+ const main_b = (e)=>{
2361
2357
  let t = e.length;
2362
2358
  const n = new PassThrough();
2363
2359
  const r = ()=>{
@@ -2368,396 +2364,112 @@ const main_v = (e)=>{
2368
2364
  }).then(r).catch(r);
2369
2365
  return n;
2370
2366
  };
2371
- var main_y = /* @__PURE__ */ main_d((e, t)=>{
2372
- t.exports = a;
2373
- a.sync = o;
2374
- var n = main_f("fs");
2375
- function r(e, t) {
2376
- var n = void 0 !== t.pathExt ? t.pathExt : process.env.PATHEXT;
2377
- if (!n) return true;
2378
- n = n.split(";");
2379
- if (-1 !== n.indexOf("")) return true;
2380
- for(var r = 0; r < n.length; r++){
2381
- var i = n[r].toLowerCase();
2382
- if (i && e.substr(-i.length).toLowerCase() === i) return true;
2383
- }
2384
- return false;
2385
- }
2386
- function i(e, t, n) {
2387
- if (!e.isSymbolicLink() && !e.isFile()) return false;
2388
- return r(t, n);
2389
- }
2390
- function a(e, t, r) {
2391
- n.stat(e, function(n, a) {
2392
- r(n, n ? false : i(a, e, t));
2393
- });
2394
- }
2395
- function o(e, t) {
2396
- return i(n.statSync(e), e, t);
2397
- }
2398
- });
2399
- var main_b = /* @__PURE__ */ main_d((e, t)=>{
2400
- t.exports = r;
2401
- r.sync = i;
2402
- var n = main_f("fs");
2403
- function r(e, t, r) {
2404
- n.stat(e, function(e, n) {
2405
- r(e, e ? false : a(n, t));
2406
- });
2407
- }
2408
- function i(e, t) {
2409
- return a(n.statSync(e), t);
2410
- }
2411
- function a(e, t) {
2412
- return e.isFile() && o(e, t);
2413
- }
2414
- function o(e, t) {
2415
- var n = e.mode;
2416
- var r = e.uid;
2417
- var i = e.gid;
2418
- var a = void 0 !== t.uid ? t.uid : process.getuid && process.getuid();
2419
- var o = void 0 !== t.gid ? t.gid : process.getgid && process.getgid();
2420
- var s = parseInt("100", 8);
2421
- var c = parseInt("010", 8);
2422
- var l = parseInt("001", 8);
2423
- var u = s | c;
2424
- return n & l || n & c && i === o || n & s && r === a || n & u && 0 === a;
2425
- }
2426
- });
2427
- var main_x = /* @__PURE__ */ main_d((e, t)=>{
2428
- main_f("fs");
2429
- var n;
2430
- n = "win32" === process.platform || global.TESTING_WINDOWS ? main_y() : main_b();
2431
- t.exports = r;
2432
- r.sync = i;
2433
- function r(e, t, i) {
2434
- if ("function" == typeof t) {
2435
- i = t;
2436
- t = {};
2437
- }
2438
- if (!i) {
2439
- if ("function" != typeof Promise) throw new TypeError("callback not provided");
2440
- return new Promise(function(n, i) {
2441
- r(e, t || {}, function(e, t) {
2442
- if (e) i(e);
2443
- else n(t);
2444
- });
2445
- });
2446
- }
2447
- n(e, t || {}, function(e, n) {
2448
- if (e) {
2449
- if ("EACCES" === e.code || t && t.ignoreErrors) {
2450
- e = null;
2451
- n = false;
2452
- }
2453
- }
2454
- i(e, n);
2455
- });
2456
- }
2457
- function i(e, t) {
2367
+ const main_x = /([()\][%!^"`<>&|;, *?])/g;
2368
+ const main_S = /^#!\s*(.+)/;
2369
+ const main_C = /\.(?:com|exe)$/i;
2370
+ const main_w = /node_modules[\\/]\.bin[\\/][^\\/]+\.cmd$/i;
2371
+ const main_T = "win32" === process.platform;
2372
+ const main_E = [
2373
+ ".EXE",
2374
+ ".CMD",
2375
+ ".BAT",
2376
+ ".COM"
2377
+ ];
2378
+ function main_D(e, t = [], n = {}) {
2379
+ if (true === n.shell || !main_T) return {
2380
+ command: e,
2381
+ args: t,
2382
+ options: n
2383
+ };
2384
+ let i = main_O(e, n);
2385
+ let a = null;
2386
+ if (null !== i) {
2387
+ const e = 150;
2388
+ const t = Buffer.alloc(e);
2389
+ let n = null;
2458
2390
  try {
2459
- return n.sync(e, t || {});
2460
- } catch (e) {
2461
- if (t && t.ignoreErrors || "EACCES" === e.code) return false;
2462
- throw e;
2463
- }
2464
- }
2465
- });
2466
- var main_S = /* @__PURE__ */ main_d((e, t)=>{
2467
- const n = "win32" === process.platform || "cygwin" === process.env.OSTYPE || "msys" === process.env.OSTYPE;
2468
- const r = main_f("path");
2469
- const i = n ? ";" : ":";
2470
- const a = main_x();
2471
- const o = (e)=>Object.assign(/* @__PURE__ */ new Error(`not found: ${e}`), {
2472
- code: "ENOENT"
2473
- });
2474
- const s = (e, t)=>{
2475
- const r = t.colon || i;
2476
- const a = e.match(/\//) || n && e.match(/\\/) ? [
2477
- ""
2478
- ] : [
2479
- ...n ? [
2480
- process.cwd()
2481
- ] : [],
2482
- ...(t.path || process.env.PATH || "").split(r)
2391
+ n = openSync(i, "r");
2392
+ readSync(n, t, 0, e, 0);
2393
+ } catch {} finally{
2394
+ if (null !== n) closeSync(n);
2395
+ }
2396
+ const o = t.toString().match(main_S);
2397
+ if (null !== o) {
2398
+ const e = o[1].trim();
2399
+ const t = e.indexOf(" ");
2400
+ const n = -1 !== t ? e.slice(0, t) : e;
2401
+ const i = -1 !== t ? e.slice(t + 1) : "";
2402
+ const s = basename(n);
2403
+ a = "env" === s ? i || null : s;
2404
+ }
2405
+ }
2406
+ if (null !== a && null !== i) {
2407
+ t = [
2408
+ i,
2409
+ ...t
2483
2410
  ];
2484
- const o = n ? t.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
2485
- const s = n ? o.split(r) : [
2486
- ""
2411
+ e = a;
2412
+ i = main_O(e, n);
2413
+ }
2414
+ if (null === i || !main_C.test(i)) {
2415
+ const r = null !== i && main_w.test(i);
2416
+ e = external_node_path_normalize(e);
2417
+ e = e.replace(main_x, "^$1");
2418
+ t = t.map((e)=>{
2419
+ e = e.replace(/(?=(\\+?)?)\1"/g, "$1$1\\\"");
2420
+ e = e.replace(/(?=(\\+?)?)\1$/, "$1$1");
2421
+ e = `"${e}"`;
2422
+ e = e.replace(main_x, "^$1");
2423
+ if (r) e = e.replace(main_x, "^$1");
2424
+ return e;
2425
+ });
2426
+ t = [
2427
+ "/d",
2428
+ "/s",
2429
+ "/c",
2430
+ `"${[
2431
+ e,
2432
+ ...t
2433
+ ].join(" ")}"`
2487
2434
  ];
2488
- if (n) {
2489
- if (-1 !== e.indexOf(".") && "" !== s[0]) s.unshift("");
2490
- }
2491
- return {
2492
- pathEnv: a,
2493
- pathExt: s,
2494
- pathExtExe: o
2435
+ e = n.env?.comspec ?? "cmd.exe";
2436
+ n = {
2437
+ ...n,
2438
+ windowsVerbatimArguments: true
2495
2439
  };
2496
- };
2497
- const c = (e, t, n)=>{
2498
- if ("function" == typeof t) {
2499
- n = t;
2500
- t = {};
2501
- }
2502
- if (!t) t = {};
2503
- const { pathEnv: i, pathExt: c, pathExtExe: l } = s(e, t);
2504
- const u = [];
2505
- const d = (n)=>new Promise((a, s)=>{
2506
- if (n === i.length) return t.all && u.length ? a(u) : s(o(e));
2507
- const c = i[n];
2508
- const l = /^".*"$/.test(c) ? c.slice(1, -1) : c;
2509
- const d = r.join(l, e);
2510
- a(f(!l && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + d : d, n, 0));
2511
- });
2512
- const f = (e, n, r)=>new Promise((i, o)=>{
2513
- if (r === c.length) return i(d(n + 1));
2514
- const s = c[r];
2515
- a(e + s, {
2516
- pathExt: l
2517
- }, (a, o)=>{
2518
- if (!a && o) if (!t.all) return i(e + s);
2519
- else u.push(e + s);
2520
- return i(f(e, n, r + 1));
2521
- });
2522
- });
2523
- return n ? d(0).then((e)=>n(null, e), n) : d(0);
2524
- };
2525
- const l = (e, t)=>{
2526
- t = t || {};
2527
- const { pathEnv: n, pathExt: i, pathExtExe: c } = s(e, t);
2528
- const l = [];
2529
- for(let o = 0; o < n.length; o++){
2530
- const s = n[o];
2531
- const u = /^".*"$/.test(s) ? s.slice(1, -1) : s;
2532
- const d = r.join(u, e);
2533
- const f = !u && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + d : d;
2534
- for(let e = 0; e < i.length; e++){
2535
- const n = f + i[e];
2536
- try {
2537
- if (a.sync(n, {
2538
- pathExt: c
2539
- })) if (!t.all) return n;
2540
- else l.push(n);
2541
- } catch (e) {}
2542
- }
2543
- }
2544
- if (t.all && l.length) return l;
2545
- if (t.nothrow) return null;
2546
- throw o(e);
2547
- };
2548
- t.exports = c;
2549
- c.sync = l;
2550
- });
2551
- var main_C = /* @__PURE__ */ main_d((e, t)=>{
2552
- const n = (e = {})=>{
2553
- const t = e.env || process.env;
2554
- if ("win32" !== (e.platform || process.platform)) return "PATH";
2555
- return Object.keys(t).reverse().find((e)=>"PATH" === e.toUpperCase()) || "Path";
2556
- };
2557
- t.exports = n;
2558
- t.exports.default = n;
2559
- });
2560
- var main_w = /* @__PURE__ */ main_d((e, t)=>{
2561
- const n = main_f("path");
2562
- const r = main_S();
2563
- const i = main_C();
2564
- function a(e, t) {
2565
- const a = e.options.env || process.env;
2566
- const o = process.cwd();
2567
- const s = null != e.options.cwd;
2568
- const c = s && void 0 !== process.chdir && !process.chdir.disabled;
2569
- if (c) try {
2570
- process.chdir(e.options.cwd);
2571
- } catch (e) {}
2572
- let l;
2573
- try {
2574
- l = r.sync(e.command, {
2575
- path: a[i({
2576
- env: a
2577
- })],
2578
- pathExt: t ? n.delimiter : void 0
2579
- });
2580
- } catch (e) {} finally{
2581
- if (c) process.chdir(o);
2582
- }
2583
- if (l) l = n.resolve(s ? e.options.cwd : "", l);
2584
- return l;
2585
2440
  }
2586
- function o(e) {
2587
- return a(e) || a(e, true);
2588
- }
2589
- t.exports = o;
2590
- });
2591
- var main_T = /* @__PURE__ */ main_d((e, t)=>{
2592
- const n = /([()\][%!^"`<>&|;, *?])/g;
2593
- function r(e) {
2594
- e = e.replace(n, "^$1");
2595
- return e;
2596
- }
2597
- function i(e, t) {
2598
- e = `${e}`;
2599
- e = e.replace(/(?=(\\+?)?)\1"/g, "$1$1\\\"");
2600
- e = e.replace(/(?=(\\+?)?)\1$/, "$1$1");
2601
- e = `"${e}"`;
2602
- e = e.replace(n, "^$1");
2603
- if (t) e = e.replace(n, "^$1");
2604
- return e;
2605
- }
2606
- t.exports.command = r;
2607
- t.exports.argument = i;
2608
- });
2609
- var main_E = /* @__PURE__ */ main_d((e, t)=>{
2610
- t.exports = /^#!(.*)/;
2611
- });
2612
- var main_D = /* @__PURE__ */ main_d((e, t)=>{
2613
- const n = main_E();
2614
- t.exports = (e = "")=>{
2615
- const t = e.match(n);
2616
- if (!t) return null;
2617
- const [r, i] = t[0].replace(/#! ?/, "").split(" ");
2618
- const a = r.split("/").pop();
2619
- if ("env" === a) return i;
2620
- return i ? `${a} ${i}` : a;
2441
+ return {
2442
+ command: e,
2443
+ args: t,
2444
+ options: n
2621
2445
  };
2622
- });
2623
- var main_O = /* @__PURE__ */ main_d((e, t)=>{
2624
- const n = main_f("fs");
2625
- const r = main_D();
2626
- function i(e) {
2627
- const t = 150;
2628
- const i = Buffer.alloc(t);
2629
- let a;
2630
- try {
2631
- a = n.openSync(e, "r");
2632
- n.readSync(a, i, 0, t, 0);
2633
- n.closeSync(a);
2634
- } catch (e) {}
2635
- return r(i.toString());
2636
- }
2637
- t.exports = i;
2638
- });
2639
- var main_k = /* @__PURE__ */ main_d((e, t)=>{
2640
- const n = main_f("path");
2641
- const r = main_w();
2642
- const i = main_T();
2643
- const a = main_O();
2644
- const o = "win32" === process.platform;
2645
- const s = /\.(?:com|exe)$/i;
2646
- const c = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
2647
- function l(e) {
2648
- e.file = r(e);
2649
- const t = e.file && a(e.file);
2650
- if (t) {
2651
- e.args.unshift(e.file);
2652
- e.command = t;
2653
- return r(e);
2654
- }
2655
- return e.file;
2656
- }
2657
- function u(e) {
2658
- if (!o) return e;
2659
- const t = l(e);
2660
- const r = !s.test(t);
2661
- if (e.options.forceShell || r) {
2662
- const r = c.test(t);
2663
- e.command = n.normalize(e.command);
2664
- e.command = i.command(e.command);
2665
- e.args = e.args.map((e)=>i.argument(e, r));
2666
- e.args = [
2667
- "/d",
2668
- "/s",
2669
- "/c",
2670
- `"${[
2671
- e.command
2672
- ].concat(e.args).join(" ")}"`
2673
- ];
2674
- e.command = process.env.comspec || "cmd.exe";
2675
- e.options.windowsVerbatimArguments = true;
2676
- }
2677
- return e;
2678
- }
2679
- function d(e, t, n) {
2680
- if (t && !Array.isArray(t)) {
2681
- n = t;
2682
- t = null;
2683
- }
2684
- t = t ? t.slice(0) : [];
2685
- n = Object.assign({}, n);
2686
- const r = {
2687
- command: e,
2688
- args: t,
2689
- options: n,
2690
- file: void 0,
2691
- original: {
2692
- command: e,
2693
- args: t
2694
- }
2695
- };
2696
- return n.shell ? r : u(r);
2697
- }
2698
- t.exports = d;
2699
- });
2700
- var main_A = /* @__PURE__ */ main_d((e, t)=>{
2701
- const n = "win32" === process.platform;
2702
- function r(e, t) {
2703
- return Object.assign(/* @__PURE__ */ new Error(`${t} ${e.command} ENOENT`), {
2704
- code: "ENOENT",
2705
- errno: "ENOENT",
2706
- syscall: `${t} ${e.command}`,
2707
- path: e.command,
2708
- spawnargs: e.args
2709
- });
2710
- }
2711
- function i(e, t) {
2712
- if (!n) return;
2713
- const r = e.emit;
2714
- e.emit = function(n, i) {
2715
- if ("exit" === n) {
2716
- const n = a(i, t);
2717
- if (n) return r.call(e, "error", n);
2718
- }
2719
- return r.apply(e, arguments);
2720
- };
2721
- }
2722
- function a(e, t) {
2723
- if (n && 1 === e && !t.file) return r(t.original, "spawn");
2724
- return null;
2725
- }
2726
- function o(e, t) {
2727
- if (n && 1 === e && !t.file) return r(t.original, "spawnSync");
2728
- return null;
2446
+ }
2447
+ function main_O(e, t) {
2448
+ const r = (t.cwd ?? external_node_process_cwd()).toString();
2449
+ const a = t.env ?? process.env;
2450
+ const o = main_(a).value;
2451
+ const c = e.includes("/") || e.includes("\\") ? [
2452
+ ""
2453
+ ] : [
2454
+ r,
2455
+ ...o.split(delimiter)
2456
+ ];
2457
+ const l = a.PATHEXT ? a.PATHEXT.split(delimiter) : main_E;
2458
+ if (e.includes(".") && "" !== l[0]) l.unshift("");
2459
+ for (const t of c){
2460
+ const n = resolve(r, t.startsWith("\"") && t.endsWith("\"") && t.length > 1 ? t.slice(1, -1) : t, e);
2461
+ for (const e of l){
2462
+ const t = n + e;
2463
+ try {
2464
+ if (statSync(t).isFile()) return t;
2465
+ } catch {}
2466
+ }
2729
2467
  }
2730
- t.exports = {
2731
- hookChildProcess: i,
2732
- verifyENOENT: a,
2733
- verifyENOENTSync: o,
2734
- notFoundError: r
2735
- };
2736
- });
2737
- var main_j = /* @__PURE__ */ main_d((e, t)=>{
2738
- const n = main_f("child_process");
2739
- const r = main_k();
2740
- const i = main_A();
2741
- function a(e, t, a) {
2742
- const o = r(e, t, a);
2743
- const s = n.spawn(o.command, o.args, o.options);
2744
- i.hookChildProcess(s, o);
2745
- return s;
2746
- }
2747
- function o(e, t, a) {
2748
- const o = r(e, t, a);
2749
- const s = n.spawnSync(o.command, o.args, o.options);
2750
- s.error = s.error || i.verifyENOENTSync(s.status, o);
2751
- return s;
2752
- }
2753
- t.exports = a;
2754
- t.exports.spawn = a;
2755
- t.exports.sync = o;
2756
- t.exports._parse = r;
2757
- t.exports._enoent = i;
2758
- });
2759
- var main_M = main_j();
2760
- var main_N = class extends Error {
2468
+ return null;
2469
+ }
2470
+ var main_k = class extends Error {
2471
+ result;
2472
+ output;
2761
2473
  get exitCode() {
2762
2474
  if (null !== this.result.exitCode) return this.result.exitCode;
2763
2475
  }
@@ -2767,20 +2479,14 @@ var main_N = class extends Error {
2767
2479
  this.output = t;
2768
2480
  }
2769
2481
  };
2770
- const main_F = {
2482
+ const main_j = {
2771
2483
  timeout: void 0,
2772
2484
  persist: false
2773
2485
  };
2774
- const main_L = {
2486
+ const main_N = {
2775
2487
  windowsHide: true
2776
2488
  };
2777
- function main_R(e, t) {
2778
- return {
2779
- command: external_node_path_normalize(e),
2780
- args: t ?? []
2781
- };
2782
- }
2783
- function main_z(e) {
2489
+ function main_P(e) {
2784
2490
  const t = new AbortController();
2785
2491
  for (const n of e){
2786
2492
  if (n.aborted) {
@@ -2796,14 +2502,14 @@ function main_z(e) {
2796
2502
  }
2797
2503
  return t.signal;
2798
2504
  }
2799
- async function main_B(e) {
2505
+ async function main_F(e) {
2800
2506
  let t = "";
2801
2507
  try {
2802
2508
  for await (const n of e)t += n.toString();
2803
2509
  } catch {}
2804
2510
  return t;
2805
2511
  }
2806
- var main_V = class {
2512
+ var main_I = class {
2807
2513
  _process;
2808
2514
  _aborted = false;
2809
2515
  _options;
@@ -2823,7 +2529,7 @@ var main_V = class {
2823
2529
  }
2824
2530
  constructor(e, t, n){
2825
2531
  this._options = {
2826
- ...main_F,
2532
+ ...main_j,
2827
2533
  ...n
2828
2534
  };
2829
2535
  this._command = e;
@@ -2842,7 +2548,7 @@ var main_V = class {
2842
2548
  return this._process?.killed === true;
2843
2549
  }
2844
2550
  pipe(e, t, n) {
2845
- return main_W(e, t, {
2551
+ return main_z(e, t, {
2846
2552
  ...n,
2847
2553
  stdin: this
2848
2554
  });
@@ -2853,7 +2559,7 @@ var main_V = class {
2853
2559
  const t = [];
2854
2560
  if (this._streamErr) t.push(this._streamErr);
2855
2561
  if (this._streamOut) t.push(this._streamOut);
2856
- const n = main_v(t);
2562
+ const n = main_b(t);
2857
2563
  const r = node_readline.createInterface({
2858
2564
  input: n
2859
2565
  });
@@ -2861,14 +2567,14 @@ var main_V = class {
2861
2567
  await this._processClosed;
2862
2568
  e.removeAllListeners();
2863
2569
  if (this._thrownError) throw this._thrownError;
2864
- if (this._options?.throwOnError && 0 !== this.exitCode && void 0 !== this.exitCode) throw new main_N(this);
2570
+ if (this._options?.throwOnError && 0 !== this.exitCode && void 0 !== this.exitCode) throw new main_k(this);
2865
2571
  }
2866
2572
  async _waitForOutput() {
2867
2573
  const e = this._process;
2868
2574
  if (!e) throw new Error("No process was started");
2869
2575
  const [t, n] = await Promise.all([
2870
- this._streamOut ? main_B(this._streamOut) : "",
2871
- this._streamErr ? main_B(this._streamErr) : ""
2576
+ this._streamOut ? main_F(this._streamOut) : "",
2577
+ this._streamErr ? main_F(this._streamErr) : ""
2872
2578
  ]);
2873
2579
  await this._processClosed;
2874
2580
  const { stdin: r } = this._options;
@@ -2880,7 +2586,7 @@ var main_V = class {
2880
2586
  stdout: t,
2881
2587
  exitCode: this.exitCode
2882
2588
  };
2883
- if (this._options.throwOnError && 0 !== this.exitCode && void 0 !== this.exitCode) throw new main_N(this, i);
2589
+ if (this._options.throwOnError && 0 !== this.exitCode && void 0 !== this.exitCode) throw new main_k(this, i);
2884
2590
  return i;
2885
2591
  }
2886
2592
  then(e, t) {
@@ -2889,31 +2595,30 @@ var main_V = class {
2889
2595
  _streamOut;
2890
2596
  _streamErr;
2891
2597
  spawn() {
2892
- const e = external_node_process_cwd();
2893
- const n = this._options;
2894
- const r = {
2895
- ...main_L,
2896
- ...n.nodeOptions
2598
+ const t = external_node_process_cwd();
2599
+ const r = this._options;
2600
+ const i = {
2601
+ ...main_N,
2602
+ ...r.nodeOptions
2897
2603
  };
2898
- const i = [];
2604
+ const a = [];
2899
2605
  this._resetState();
2900
- if (void 0 !== n.timeout) i.push(AbortSignal.timeout(n.timeout));
2901
- if (void 0 !== n.signal) i.push(n.signal);
2902
- if (true === n.persist) r.detached = true;
2903
- if (i.length > 0) r.signal = main_z(i);
2904
- r.env = main_(e, r.env);
2905
- const { command: a, args: o } = main_R(this._command, this._args);
2906
- const c = (0, main_M._parse)(a, o, r);
2907
- const l = spawn(c.command, c.args, c.options);
2908
- if (l.stderr) this._streamErr = l.stderr;
2909
- if (l.stdout) this._streamOut = l.stdout;
2910
- this._process = l;
2911
- l.once("error", this._onError);
2912
- l.once("close", this._onClose);
2913
- if (l.stdin) {
2914
- const { stdin: e } = n;
2915
- if ("string" == typeof e) l.stdin.end(e);
2916
- else e?.process?.stdout?.pipe(l.stdin);
2606
+ if (void 0 !== r.timeout) a.push(AbortSignal.timeout(r.timeout));
2607
+ if (void 0 !== r.signal) a.push(r.signal);
2608
+ if (true === r.persist) i.detached = true;
2609
+ if (a.length > 0) i.signal = main_P(a);
2610
+ i.env = main_y(t, i.env, r.nodePath);
2611
+ const o = main_D(this._command, this._args, i);
2612
+ const s = spawn(o.command, o.args, o.options);
2613
+ if (s.stderr) this._streamErr = s.stderr;
2614
+ if (s.stdout) this._streamOut = s.stdout;
2615
+ this._process = s;
2616
+ s.once("error", this._onError);
2617
+ s.once("close", this._onClose);
2618
+ if (s.stdin) {
2619
+ const { stdin: e } = r;
2620
+ if ("string" == typeof e) s.stdin.end(e);
2621
+ else e?.process?.stdout?.pipe(s.stdin);
2917
2622
  }
2918
2623
  }
2919
2624
  _resetState() {
@@ -2934,12 +2639,12 @@ var main_V = class {
2934
2639
  if (this._resolveClose) this._resolveClose();
2935
2640
  };
2936
2641
  };
2937
- const main_U = (e, t, n)=>{
2938
- const r = new main_V(e, t, n);
2642
+ const main_R = (e, t, n)=>{
2643
+ const r = new main_I(e, t, n);
2939
2644
  r.spawn();
2940
2645
  return r;
2941
2646
  };
2942
- const main_W = main_U;
2647
+ const main_z = main_R;
2943
2648
  const NPM_TEMPLATE_PREFIX = 'npm:';
2944
2649
  const VALID_NPM_NAME = /^(@[\w.-]+\/)?[\w.-]+$/;
2945
2650
  const VALID_NPM_VERSION = /^[\w.\-+^~>=<* ]+$/;
@@ -3033,11 +2738,11 @@ var minimist_default = /*#__PURE__*/ __webpack_require__.n(minimist);
3033
2738
  const src_filename = fileURLToPath(import.meta.url);
3034
2739
  const src_dirname = dirname(src_filename);
3035
2740
  function cancelAndExit() {
3036
- pt('Operation cancelled.');
2741
+ me('Operation cancelled.');
3037
2742
  process.exit(0);
3038
2743
  }
3039
2744
  function checkCancel(value) {
3040
- if (dist_q(value)) cancelAndExit();
2745
+ if (q(value)) cancelAndExit();
3041
2746
  return value;
3042
2747
  }
3043
2748
  function formatProjectName(input) {
@@ -3129,12 +2834,12 @@ async function getTools({ tools, dir, template }, extraTools, templateName) {
3129
2834
  if (dir && template) return [];
3130
2835
  const options = [
3131
2836
  {
3132
- value: 'eslint',
3133
- label: 'ESLint - linting'
2837
+ value: 'rslint',
2838
+ label: 'Rslint - linting'
3134
2839
  },
3135
2840
  {
3136
- value: 'rslint',
3137
- label: 'Rslint - linting (experimental)'
2841
+ value: 'eslint',
2842
+ label: 'ESLint - linting'
3138
2843
  },
3139
2844
  {
3140
2845
  value: 'prettier',
@@ -3154,7 +2859,7 @@ async function getTools({ tools, dir, template }, extraTools, templateName) {
3154
2859
  options.unshift(...filteredExtraTools.filter((tool)=>'pre' === tool.order).map(normalize));
3155
2860
  options.push(...filteredExtraTools.filter((tool)=>'pre' !== tool.order).map(normalize));
3156
2861
  }
3157
- return checkCancel(await yt({
2862
+ return checkCancel(await ve({
3158
2863
  message: 'Select additional tools (Use <space> to select, <enter> to continue)',
3159
2864
  options,
3160
2865
  required: false
@@ -3177,7 +2882,7 @@ function orderExtraSkills(extraSkills) {
3177
2882
  ...extraSkills.filter((extraSkill)=>'post' === extraSkill.order)
3178
2883
  ];
3179
2884
  }
3180
- async function getSkills({ skill, dir, template }, extraSkills, templateName, tools = [], promptMultiselect = yt) {
2885
+ async function getSkills({ skill, dir, template }, extraSkills, templateName, tools = [], promptMultiselect = ve) {
3181
2886
  const parsedSkills = parseSkillsOption(skill);
3182
2887
  const filteredExtraSkills = filterExtraSkills(extraSkills, templateName, tools);
3183
2888
  if (null !== parsedSkills) return parsedSkills.filter((value)=>extraSkills?.some((extraSkill)=>extraSkill.value === value));
@@ -3224,7 +2929,7 @@ async function runCommand(command, cwd, packageManager) {
3224
2929
  if (replacement) command = command.replace('npm create ', replacement).replace(' -- --', ' --');
3225
2930
  if ('yarn' === packageManager) command = command.replace('@latest', '');
3226
2931
  }
3227
- const result = await main_U(command, [], {
2932
+ const result = await main_R(command, [], {
3228
2933
  nodeOptions: {
3229
2934
  shell: true,
3230
2935
  stdio: 'inherit',
@@ -3257,13 +2962,13 @@ async function runSkillCommand(skills, cwd) {
3257
2962
  ...installArgs
3258
2963
  ];
3259
2964
  const command = `npx ${args.join(' ')}`;
3260
- dist_O.info(`Running skill install command: ${color.dim(command)}`);
2965
+ dist_R.info(`Running skill install command: ${color.dim(command)}`);
3261
2966
  const skillLabel = skills.map((skill)=>skill.value).join(', ');
3262
2967
  const skillNoun = 1 === skills.length ? 'skill' : 'skills';
3263
- const installationTaskLog = Gt({
2968
+ const installationTaskLog = Oe({
3264
2969
  title: `Installing ${skillNoun} ${skillLabel}`
3265
2970
  });
3266
- const proc = main_U('npx', args, {
2971
+ const proc = main_R('npx', args, {
3267
2972
  nodeOptions: {
3268
2973
  cwd,
3269
2974
  stdio: 'pipe'
@@ -3286,8 +2991,8 @@ function logNextStepsAndOutro(noteInformation, targetDir, packageManager) {
3286
2991
  `3. ${color.cyan(`${packageManager} install`)}`,
3287
2992
  `4. ${color.cyan(`${packageManager} run dev`)}`
3288
2993
  ];
3289
- if (nextSteps.length) wt(nextSteps.map((step)=>color.reset(step)).join('\n'), 'Next steps');
3290
- gt('All set, happy coding!');
2994
+ if (nextSteps.length) Se(nextSteps.map((step)=>color.reset(step)).join('\n'), 'Next steps');
2995
+ ye('All set, happy coding!');
3291
2996
  }
3292
2997
  async function create({ name, root, templates, skipFiles, getTemplateName, mapESLintTemplate, mapRslintTemplate, version, noteInformation, extraTools, extraSkills, argv: processArgv = process.argv }) {
3293
2998
  src_logger.greet(`\n◆ Create ${upperFirst(name)} Project`);
@@ -3305,7 +3010,7 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
3305
3010
  packageManager
3306
3011
  };
3307
3012
  if (!version) version = (await readPackageJson(root)).version;
3308
- const projectName = argv.dir ?? checkCancel(await Ot({
3013
+ const projectName = argv.dir ?? checkCancel(await Pe({
3309
3014
  message: 'Project name or path',
3310
3015
  placeholder: `${name.toLowerCase()}-project`,
3311
3016
  defaultValue: `${name.toLowerCase()}-project`,
@@ -3318,7 +3023,7 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
3318
3023
  const packageName = argv.packageName || formatted.packageName;
3319
3024
  const distFolder = node_path.isAbsolute(targetDir) ? targetDir : node_path.join(cwd, targetDir);
3320
3025
  if (!argv.override && node_fs.existsSync(distFolder) && !isEmptyDir(distFolder)) {
3321
- const option = checkCancel(await _t({
3026
+ const option = checkCancel(await xe({
3322
3027
  message: `"${targetDir}" is not empty, please choose:`,
3323
3028
  options: [
3324
3029
  {
@@ -3352,7 +3057,7 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
3352
3057
  return;
3353
3058
  }
3354
3059
  const tools = await getTools(argv, extraTools, templateName);
3355
- const skills = await getSkills(argv, extraSkills, templateName, tools, yt);
3060
+ const skills = await getSkills(argv, extraSkills, templateName, tools, ve);
3356
3061
  const commonFolder = node_path.join(root, 'template-common');
3357
3062
  if (!node_fs.existsSync(srcFolder)) throw new Error(`Invalid input: template "${templateName}" not found.`);
3358
3063
  copyFolder({
@@ -3621,4 +3326,4 @@ function collectAgentsFiles(agentsMdSearchDirs) {
3621
3326
  }
3622
3327
  return agentsFiles;
3623
3328
  }
3624
- export { Ae as autocomplete, BUILTIN_TOOLS, Ot as text, _t as select, checkCancel, collectAgentsFiles, copyFolder, create, ht as groupMultiselect, isNpmTemplate, mergeAgentsFiles, mergePackageJson, resolveCustomTemplate, resolveNpmTemplate, sanitizeCacheKey, yt as multiselect };
3329
+ export { At as autocomplete, BUILTIN_TOOLS, Pe as text, checkCancel, collectAgentsFiles, copyFolder, create, isNpmTemplate, mergeAgentsFiles, mergePackageJson, pe as groupMultiselect, resolveCustomTemplate, resolveNpmTemplate, sanitizeCacheKey, ve as multiselect, xe as select };