create-rstack 2.1.0 → 2.1.2

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,6 +1,6 @@
1
1
  import "node:module";
2
2
  import node_fs from "node:fs";
3
- import node_path, { delimiter, dirname, normalize as external_node_path_normalize, resolve } from "node:path";
3
+ import node_path, { delimiter, dirname, 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";
@@ -542,11 +542,20 @@ __webpack_require__.add({
542
542
  module.exports = __rspack_createRequire_require("node:fs/promises");
543
543
  }
544
544
  });
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;
545
+ const getCodePointsLength = (()=>{
546
+ const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
547
+ return (input)=>{
548
+ let surrogatePairsNr = 0;
549
+ SURROGATE_PAIR_RE.lastIndex = 0;
550
+ while(SURROGATE_PAIR_RE.test(input))surrogatePairsNr += 1;
551
+ return input.length - surrogatePairsNr;
552
+ };
553
+ })();
546
554
  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;
555
+ 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;
556
+ const ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
549
557
  const CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
558
+ 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
559
  const TAB_RE = /\t{1,1000}/y;
551
560
  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
561
  const LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
@@ -559,14 +568,39 @@ const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {
559
568
  const LIMIT = truncationOptions.limit ?? 1 / 0;
560
569
  const ELLIPSIS = truncationOptions.ellipsis ?? '';
561
570
  const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
562
- const ANSI_WIDTH = widthOptions.ansiWidth ?? 0;
571
+ const ANSI_WIDTH = 0;
563
572
  const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
564
573
  const TAB_WIDTH = widthOptions.tabWidth ?? 8;
565
- const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;
566
574
  const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
567
- const FULL_WIDTH_WIDTH = widthOptions.fullWidthWidth ?? 2;
575
+ const FULL_WIDTH_WIDTH = 2;
568
576
  const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
569
- const WIDE_WIDTH = widthOptions.wideWidth ?? 2;
577
+ const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
578
+ const PARSE_BLOCKS = [
579
+ [
580
+ LATIN_RE,
581
+ REGULAR_WIDTH
582
+ ],
583
+ [
584
+ ANSI_RE,
585
+ ANSI_WIDTH
586
+ ],
587
+ [
588
+ CONTROL_RE,
589
+ CONTROL_WIDTH
590
+ ],
591
+ [
592
+ TAB_RE,
593
+ TAB_WIDTH
594
+ ],
595
+ [
596
+ EMOJI_RE,
597
+ EMOJI_WIDTH
598
+ ],
599
+ [
600
+ CJKT_WIDE_RE,
601
+ WIDE_WIDTH
602
+ ]
603
+ ];
570
604
  let indexPrev = 0;
571
605
  let index = 0;
572
606
  let length = input.length;
@@ -584,7 +618,7 @@ const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {
584
618
  lengthExtra = 0;
585
619
  for (const char of unmatched.replaceAll(MODIFIER_RE, '')){
586
620
  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;
621
+ widthExtra = isFullWidth(codePoint) ? FULL_WIDTH_WIDTH : isWideNotCJKTNotEmoji(codePoint) ? WIDE_WIDTH : REGULAR_WIDTH;
588
622
  if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);
589
623
  if (width + widthExtra > LIMIT) {
590
624
  truncationEnabled = true;
@@ -596,76 +630,23 @@ const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {
596
630
  unmatchedStart = unmatchedEnd = 0;
597
631
  }
598
632
  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;
633
+ for(let i = 0, l = PARSE_BLOCKS.length; i < l; i++){
634
+ const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i];
635
+ BLOCK_RE.lastIndex = index;
636
+ if (BLOCK_RE.test(input)) {
637
+ lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
638
+ widthExtra = lengthExtra * BLOCK_WIDTH;
639
+ if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
640
+ if (width + widthExtra > LIMIT) {
641
+ truncationEnabled = true;
642
+ break outer;
643
+ }
644
+ width += widthExtra;
645
+ unmatchedStart = indexPrev;
646
+ unmatchedEnd = index;
647
+ index = indexPrev = BLOCK_RE.lastIndex;
648
+ continue outer;
663
649
  }
664
- width += EMOJI_WIDTH;
665
- unmatchedStart = indexPrev;
666
- unmatchedEnd = index;
667
- index = indexPrev = EMOJI_RE.lastIndex;
668
- continue;
669
650
  }
670
651
  index += 1;
671
652
  }
@@ -823,25 +804,27 @@ const exec = (string, columns, options = {})=>{
823
804
  for(let i = 0; i < preString.length; i++){
824
805
  const character = preString[i];
825
806
  returnValue += character;
826
- if (!inSurrogate) {
807
+ if (inSurrogate) inSurrogate = false;
808
+ else {
827
809
  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
- }
810
+ if (inSurrogate) continue;
811
+ }
812
+ if (character === ESC || character === CSI) {
813
+ GROUP_REGEX.lastIndex = i + 1;
814
+ const groupsResult = GROUP_REGEX.exec(preString);
815
+ const groups = groupsResult?.groups;
816
+ if (groups?.code !== void 0) {
817
+ const code = Number.parseFloat(groups.code);
818
+ escapeCode = code === END_CODE ? void 0 : code;
819
+ } else if (groups?.uri !== void 0) escapeUrl = 0 === groups.uri.length ? void 0 : groups.uri;
820
+ }
821
+ if ('\n' === preString[i + 1]) {
822
+ if (escapeUrl) returnValue += wrapAnsiHyperlink('');
823
+ const closingCode = escapeCode ? getClosingCode(escapeCode) : void 0;
824
+ if (escapeCode && closingCode) returnValue += wrapAnsiCode(closingCode);
825
+ } else if ('\n' === character) {
826
+ if (escapeCode && getClosingCode(escapeCode)) returnValue += wrapAnsiCode(escapeCode);
827
+ if (escapeUrl) returnValue += wrapAnsiHyperlink(escapeUrl);
845
828
  }
846
829
  }
847
830
  return returnValue;
@@ -851,12 +834,12 @@ function wrapAnsi(string, columns, options) {
851
834
  return String(string).normalize().split(CRLF_OR_LF).map((line)=>exec(line, columns, options)).join('\n');
852
835
  }
853
836
  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;
837
+ function dist_d(r, t, s) {
838
+ if (!s.some((o)=>!o.disabled)) return r;
839
+ const e = r + t, i = Math.max(s.length - 1, 0), n = e < 0 ? i : e > i ? 0 : e;
840
+ return s[n].disabled ? dist_d(n, t < 0 ? -1 : 1, s) : n;
858
841
  }
859
- const E = [
842
+ const dist_G = [
860
843
  "up",
861
844
  "down",
862
845
  "left",
@@ -864,7 +847,7 @@ const E = [
864
847
  "space",
865
848
  "enter",
866
849
  "cancel"
867
- ], dist_G = [
850
+ ], K = [
868
851
  "January",
869
852
  "February",
870
853
  "March",
@@ -877,8 +860,8 @@ const E = [
877
860
  "October",
878
861
  "November",
879
862
  "December"
880
- ], dist_u = {
881
- actions: new Set(E),
863
+ ], dist_h = {
864
+ actions: new Set(dist_G),
882
865
  aliases: new Map([
883
866
  [
884
867
  "k",
@@ -912,7 +895,7 @@ const E = [
912
895
  withGuide: !0,
913
896
  date: {
914
897
  monthNames: [
915
- ...dist_G
898
+ ...K
916
899
  ],
917
900
  messages: {
918
901
  required: "Please enter a valid date",
@@ -923,41 +906,44 @@ const E = [
923
906
  }
924
907
  }
925
908
  };
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;
909
+ function dist_C(r, t) {
910
+ if ("string" == typeof r) return dist_h.aliases.get(r) === t;
911
+ for (const s of r)if (void 0 !== s && dist_C(s, t)) return !0;
929
912
  return !1;
930
913
  }
931
- function dist_j(r, t) {
914
+ function z(r, t) {
932
915
  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);
916
+ const s = r.split(`
917
+ `), e = t.split(`
918
+ `), i = Math.max(s.length, e.length), n = [];
919
+ for(let o = 0; o < i; o++)s[o] !== e[o] && n.push(o);
937
920
  return {
938
921
  lines: n,
939
- numLinesBefore: e.length,
940
- numLinesAfter: s.length,
922
+ numLinesBefore: s.length,
923
+ numLinesAfter: e.length,
941
924
  numLines: i
942
925
  };
943
926
  }
944
927
  globalThis.process.platform.startsWith("win");
945
- const dist_C = Symbol("clack:cancel");
928
+ const dist_k = Symbol("clack:cancel");
946
929
  function dist_q(r) {
947
- return r === dist_C;
930
+ return r === dist_k;
948
931
  }
949
932
  function w(r, t) {
950
- const e = r;
951
- e.isTTY && e.setRawMode(t);
933
+ const s = r;
934
+ s.isTTY && s.setRawMode(t);
952
935
  }
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, {
936
+ 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;
937
+ function dist_W(r, t, s, e = s, i) {
938
+ const n = dist_A(r ?? stdout);
939
+ return wrapAnsi(t, n - s.length, {
957
940
  hard: !0,
958
941
  trim: !1
959
942
  }).split(`
960
- `).map((n, o)=>`${0 === o ? s : e}${n}`).join(`
943
+ `).map((o, u)=>{
944
+ const a = i ? i(o, u) : o;
945
+ return `${0 === u ? e : s}${a}`;
946
+ }).join(`
961
947
  `);
962
948
  }
963
949
  let dist_p = class {
@@ -975,37 +961,37 @@ let dist_p = class {
975
961
  error = "";
976
962
  value;
977
963
  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;
964
+ constructor(t, s = !0){
965
+ const { input: e = stdin, output: i = stdout, render: n, signal: o, ...u } = t;
966
+ 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
967
  }
982
968
  unsubscribe() {
983
969
  this._subscribers.clear();
984
970
  }
985
- setSubscriber(t, e) {
986
- const s = this._subscribers.get(t) ?? [];
987
- s.push(e), this._subscribers.set(t, s);
971
+ setSubscriber(t, s) {
972
+ const e = this._subscribers.get(t) ?? [];
973
+ e.push(s), this._subscribers.set(t, e);
988
974
  }
989
- on(t, e) {
975
+ on(t, s) {
990
976
  this.setSubscriber(t, {
991
- cb: e
977
+ cb: s
992
978
  });
993
979
  }
994
- once(t, e) {
980
+ once(t, s) {
995
981
  this.setSubscriber(t, {
996
- cb: e,
982
+ cb: s,
997
983
  once: !0
998
984
  });
999
985
  }
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));
986
+ emit(t, ...s) {
987
+ const e = this._subscribers.get(t) ?? [], i = [];
988
+ for (const n of e)n.cb(...s), n.once && i.push(()=>e.splice(e.indexOf(n), 1));
1003
989
  for (const n of i)n();
1004
990
  }
1005
991
  prompt() {
1006
992
  return new Promise((t)=>{
1007
993
  if (this._abortSignal) {
1008
- if (this._abortSignal.aborted) return this.state = "cancel", this.close(), t(dist_C);
994
+ if (this._abortSignal.aborted) return this.state = "cancel", this.close(), t(dist_k);
1009
995
  this._abortSignal.addEventListener("abort", ()=>{
1010
996
  this.state = "cancel", this.close();
1011
997
  }, {
@@ -1021,18 +1007,21 @@ let dist_p = class {
1021
1007
  }), 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
1008
  this.output.write(src.cursor.show), this.output.off("resize", this.render), w(this.input, !1), t(this.value);
1023
1009
  }), this.once("cancel", ()=>{
1024
- this.output.write(src.cursor.show), this.output.off("resize", this.render), w(this.input, !1), t(dist_C);
1010
+ this.output.write(src.cursor.show), this.output.off("resize", this.render), w(this.input, !1), t(dist_k);
1025
1011
  });
1026
1012
  });
1027
1013
  }
1028
- _isActionKey(t, e) {
1014
+ _isActionKey(t, s) {
1029
1015
  return " " === t;
1030
1016
  }
1017
+ _shouldSubmit(t, s) {
1018
+ return !0;
1019
+ }
1031
1020
  _setValue(t) {
1032
1021
  this.value = t, this.emit("value", this.value);
1033
1022
  }
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);
1023
+ _setUserInput(t, s) {
1024
+ this.userInput = t ?? "", this.emit("userInput", this.userInput), s && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
1036
1025
  }
1037
1026
  _clearUserInput() {
1038
1027
  this.rl?.write(null, {
@@ -1040,21 +1029,21 @@ let dist_p = class {
1040
1029
  name: "u"
1041
1030
  }), this._setUserInput("");
1042
1031
  }
1043
- onKeypress(t, e) {
1044
- if (this._track && "return" !== e.name && (e.name && this._isActionKey(t, e) && this.rl?.write(null, {
1032
+ onKeypress(t, s) {
1033
+ if (this._track && "return" !== s.name && (s.name && this._isActionKey(t, s) && this.rl?.write(null, {
1045
1034
  ctrl: !0,
1046
1035
  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") {
1036
+ }), 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
1037
  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));
1038
+ const e = this.opts.validate(this.value);
1039
+ e && (this.error = e instanceof Error ? e.message : e, this.state = "error", this.rl?.write(this.userInput));
1051
1040
  }
1052
1041
  "error" !== this.state && (this.state = "submit");
1053
1042
  }
1054
- V([
1043
+ dist_C([
1055
1044
  t,
1056
- e?.name,
1057
- e?.sequence
1045
+ s?.name,
1046
+ s?.sequence
1058
1047
  ], "cancel") && (this.state = "cancel"), ("submit" === this.state || "cancel" === this.state) && this.emit("finalize"), this.render(), ("submit" === this.state || "cancel" === this.state) && this.close();
1059
1048
  }
1060
1049
  close() {
@@ -1077,31 +1066,31 @@ let dist_p = class {
1077
1066
  if (t !== this._prevFrame) {
1078
1067
  if ("initial" === this.state) this.output.write(src.cursor.hide);
1079
1068
  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);
1069
+ const s = z(this._prevFrame, t), e = dist_L(this.output);
1070
+ if (this.restoreCursor(), s) {
1071
+ const i = Math.max(0, s.numLinesAfter - e), n = Math.max(0, s.numLinesBefore - e);
1072
+ let o = s.lines.find((u)=>u >= i);
1084
1073
  if (void 0 === o) {
1085
1074
  this._prevFrame = t;
1086
1075
  return;
1087
1076
  }
1088
- if (1 === e.lines.length) {
1077
+ if (1 === s.lines.length) {
1089
1078
  this.output.write(src.cursor.move(0, o - n)), this.output.write(src.erase.lines(1));
1090
- const a = t.split(`
1079
+ const u = t.split(`
1091
1080
  `);
1092
- this.output.write(a[o]), this._prevFrame = t, this.output.write(src.cursor.move(0, a.length - o - 1));
1081
+ this.output.write(u[o]), this._prevFrame = t, this.output.write(src.cursor.move(0, u.length - o - 1));
1093
1082
  return;
1094
1083
  }
1095
- if (e.lines.length > 1) {
1084
+ if (s.lines.length > 1) {
1096
1085
  if (i < n) o = i;
1097
1086
  else {
1098
- const h = o - n;
1099
- h > 0 && this.output.write(src.cursor.move(0, h));
1087
+ const a = o - n;
1088
+ a > 0 && this.output.write(src.cursor.move(0, a));
1100
1089
  }
1101
1090
  this.output.write(src.erase.down());
1102
- const a = t.split(`
1091
+ const u = t.split(`
1103
1092
  `).slice(o);
1104
- this.output.write(a.join(`
1093
+ this.output.write(u.join(`
1105
1094
  `)), this._prevFrame = t;
1106
1095
  return;
1107
1096
  }
@@ -1112,30 +1101,30 @@ let dist_p = class {
1112
1101
  }
1113
1102
  }
1114
1103
  };
1115
- function dist_W(r, t) {
1104
+ function dist_B(r, t) {
1116
1105
  if (void 0 === r || 0 === t.length) return 0;
1117
- const e = t.findIndex((s)=>s.value === r);
1118
- return -1 !== e ? e : 0;
1106
+ const s = t.findIndex((e)=>e.value === r);
1107
+ return -1 !== s ? s : 0;
1119
1108
  }
1120
- function dist_B(r, t) {
1109
+ function J(r, t) {
1121
1110
  return (t.label ?? String(t.value)).toLowerCase().includes(r.toLowerCase());
1122
1111
  }
1123
- function J(r, t) {
1112
+ function H(r, t) {
1124
1113
  if (t) return r ? t : t[0];
1125
1114
  }
1126
- let H = class extends dist_p {
1115
+ let Q = class extends dist_p {
1127
1116
  filteredOptions;
1128
1117
  multiple;
1129
1118
  isNavigating = !1;
1130
1119
  selectedValues = [];
1131
1120
  focusedValue;
1132
- #e = 0;
1133
- #o = "";
1121
+ #s = 0;
1122
+ #r = "";
1134
1123
  #t;
1135
1124
  #n;
1136
- #a;
1125
+ #u;
1137
1126
  get cursor() {
1138
- return this.#e;
1127
+ return this.#s;
1139
1128
  }
1140
1129
  get userInputWithCursor() {
1141
1130
  if (!this.userInput) return styleText([
@@ -1143,39 +1132,39 @@ let H = class extends dist_p {
1143
1132
  "hidden"
1144
1133
  ], "_");
1145
1134
  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("")}`;
1135
+ const t = this.userInput.slice(0, this._cursor), [s, ...e] = this.userInput.slice(this._cursor);
1136
+ return `${t}${styleText("inverse", s)}${e.join("")}`;
1148
1137
  }
1149
1138
  get options() {
1150
1139
  return "function" == typeof this.#n ? this.#n() : this.#n;
1151
1140
  }
1152
1141
  constructor(t){
1153
- super(t), this.#n = t.options, this.#a = t.placeholder;
1154
- const e = this.options;
1142
+ super(t), this.#n = t.options, this.#u = t.placeholder;
1143
+ const s = this.options;
1155
1144
  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 = [
1145
+ ...s
1146
+ ], this.multiple = !0 === t.multiple, this.#t = "function" == typeof t.options ? t.filter : t.filter ?? J;
1147
+ let e;
1148
+ 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
1149
  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);
1150
+ ]), e) for (const i of e){
1151
+ const n = s.findIndex((o)=>o.value === i);
1152
+ -1 !== n && (this.toggleSelected(i), this.#s = n);
1164
1153
  }
1165
- this.focusedValue = this.options[this.#e]?.value, this.on("key", (i, n)=>this.#s(i, n)), this.on("userInput", (i)=>this.#i(i));
1154
+ this.focusedValue = this.options[this.#s]?.value, this.on("key", (i, n)=>this.#e(i, n)), this.on("userInput", (i)=>this.#i(i));
1166
1155
  }
1167
- _isActionKey(t, e) {
1168
- return " " === t || this.multiple && this.isNavigating && "space" === e.name && void 0 !== t && "" !== t;
1156
+ _isActionKey(t, s) {
1157
+ return " " === t || this.multiple && this.isNavigating && "space" === s.name && void 0 !== t && "" !== t;
1169
1158
  }
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;
1159
+ #e(t, s) {
1160
+ 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((f)=>!f.disabled && (this.#t ? this.#t(u, f) : !0));
1161
+ if ("tab" === s.name && o && l) {
1162
+ " " === this.userInput && this._clearUserInput(), this._setUserInput(u, !0), this.isNavigating = !1;
1174
1163
  return;
1175
1164
  }
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 = [
1165
+ e || i ? (this.#s = dist_d(this.#s, e ? -1 : 1, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#s]?.value, this.multiple || (this.selectedValues = [
1177
1166
  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 = [
1167
+ ]), 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
1168
  this.focusedValue
1180
1169
  ]), this.isNavigating = !1);
1181
1170
  }
@@ -1183,7 +1172,7 @@ let H = class extends dist_p {
1183
1172
  this.selectedValues = [];
1184
1173
  }
1185
1174
  toggleSelected(t) {
1186
- 0 !== this.filteredOptions.length && (this.multiple ? this.selectedValues.includes(t) ? this.selectedValues = this.selectedValues.filter((e)=>e !== t) : this.selectedValues = [
1175
+ 0 !== this.filteredOptions.length && (this.multiple ? this.selectedValues.includes(t) ? this.selectedValues = this.selectedValues.filter((s)=>s !== t) : this.selectedValues = [
1187
1176
  ...this.selectedValues,
1188
1177
  t
1189
1178
  ] : this.selectedValues = [
@@ -1191,41 +1180,41 @@ let H = class extends dist_p {
1191
1180
  ]);
1192
1181
  }
1193
1182
  #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
1183
+ if (t !== this.#r) {
1184
+ this.#r = t;
1185
+ const s = this.options;
1186
+ t && this.#t ? this.filteredOptions = s.filter((n)=>this.#t?.(t, n)) : this.filteredOptions = [
1187
+ ...s
1199
1188
  ];
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];
1189
+ const e = dist_B(this.focusedValue, this.filteredOptions);
1190
+ this.#s = dist_d(e, 0, this.filteredOptions);
1191
+ const i = this.filteredOptions[this.#s];
1203
1192
  i && !i.disabled ? this.focusedValue = i.value : this.focusedValue = void 0, this.multiple || (void 0 !== this.focusedValue ? this.toggleSelected(this.focusedValue) : this.deselectAll());
1204
1193
  }
1205
1194
  }
1206
1195
  };
1207
- class st extends dist_p {
1196
+ class it extends dist_p {
1208
1197
  options;
1209
1198
  cursor = 0;
1210
- #e;
1199
+ #s;
1211
1200
  getGroupItems(t) {
1212
- return this.options.filter((e)=>e.group === t);
1201
+ return this.options.filter((s)=>s.group === t);
1213
1202
  }
1214
1203
  isGroupSelected(t) {
1215
- const e = this.getGroupItems(t), s = this.value;
1216
- return void 0 === s ? !1 : e.every((i)=>s.includes(i.value));
1204
+ const s = this.getGroupItems(t), e = this.value;
1205
+ return void 0 === e ? !1 : s.every((i)=>e.includes(i.value));
1217
1206
  }
1218
1207
  toggleValue() {
1219
1208
  const t = this.options[this.cursor];
1220
1209
  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 = [
1210
+ const s = t.value, e = this.getGroupItems(s);
1211
+ this.isGroupSelected(s) ? this.value = this.value.filter((i)=>-1 === e.findIndex((n)=>n.value === i)) : this.value = [
1223
1212
  ...this.value,
1224
- ...s.map((i)=>i.value)
1213
+ ...e.map((i)=>i.value)
1225
1214
  ], this.value = Array.from(new Set(this.value));
1226
1215
  } else {
1227
- const e = this.value.includes(t.value);
1228
- this.value = e ? this.value.filter((s)=>s !== t.value) : [
1216
+ const s = this.value.includes(t.value);
1217
+ this.value = s ? this.value.filter((e)=>e !== t.value) : [
1229
1218
  ...this.value,
1230
1219
  t.value
1231
1220
  ];
@@ -1233,27 +1222,27 @@ class st extends dist_p {
1233
1222
  }
1234
1223
  constructor(t){
1235
1224
  super(t, !1);
1236
- const { options: e } = t;
1237
- this.#e = !1 !== t.selectableGroups, this.options = Object.entries(e).flatMap(([s, i])=>[
1225
+ const { options: s } = t;
1226
+ this.#s = !1 !== t.selectableGroups, this.options = Object.entries(s).flatMap(([e, i])=>[
1238
1227
  {
1239
- value: s,
1228
+ value: e,
1240
1229
  group: !0,
1241
- label: s
1230
+ label: e
1242
1231
  },
1243
1232
  ...i.map((n)=>({
1244
1233
  ...n,
1245
- group: s
1234
+ group: e
1246
1235
  }))
1247
1236
  ]), this.value = [
1248
1237
  ...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){
1238
+ ], this.cursor = Math.max(this.options.findIndex(({ value: e })=>e === t.cursorAt), this.#s ? 0 : 1), this.on("cursor", (e)=>{
1239
+ switch(e){
1251
1240
  case "left":
1252
1241
  case "up":
1253
1242
  {
1254
1243
  this.cursor = 0 === this.cursor ? this.options.length - 1 : this.cursor - 1;
1255
1244
  const i = this.options[this.cursor]?.group === !0;
1256
- !this.#e && i && (this.cursor = 0 === this.cursor ? this.options.length - 1 : this.cursor - 1);
1245
+ !this.#s && i && (this.cursor = 0 === this.cursor ? this.options.length - 1 : this.cursor - 1);
1257
1246
  break;
1258
1247
  }
1259
1248
  case "down":
@@ -1261,7 +1250,7 @@ class st extends dist_p {
1261
1250
  {
1262
1251
  this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
1263
1252
  const i = this.options[this.cursor]?.group === !0;
1264
- !this.#e && i && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
1253
+ !this.#s && i && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
1265
1254
  break;
1266
1255
  }
1267
1256
  case "space":
@@ -1271,7 +1260,7 @@ class st extends dist_p {
1271
1260
  });
1272
1261
  }
1273
1262
  }
1274
- let it = class extends dist_p {
1263
+ let dist_nt = class extends dist_p {
1275
1264
  options;
1276
1265
  cursor = 0;
1277
1266
  get _value() {
@@ -1281,19 +1270,19 @@ let it = class extends dist_p {
1281
1270
  return this.options.filter((t)=>!0 !== t.disabled);
1282
1271
  }
1283
1272
  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);
1273
+ const t = this._enabledOptions, s = void 0 !== this.value && this.value.length === t.length;
1274
+ this.value = s ? [] : t.map((e)=>e.value);
1286
1275
  }
1287
1276
  toggleInvert() {
1288
1277
  const t = this.value;
1289
1278
  if (!t) return;
1290
- const e = this._enabledOptions.filter((s)=>!t.includes(s.value));
1291
- this.value = e.map((s)=>s.value);
1279
+ const s = this._enabledOptions.filter((e)=>!t.includes(e.value));
1280
+ this.value = s.map((e)=>e.value);
1292
1281
  }
1293
1282
  toggleValue() {
1294
1283
  void 0 === this.value && (this.value = []);
1295
1284
  const t = this.value.includes(this._value);
1296
- this.value = t ? this.value.filter((e)=>e !== this._value) : [
1285
+ this.value = t ? this.value.filter((s)=>s !== this._value) : [
1297
1286
  ...this.value,
1298
1287
  this._value
1299
1288
  ];
@@ -1302,11 +1291,11 @@ let it = class extends dist_p {
1302
1291
  super(t, !1), this.options = t.options, this.value = [
1303
1292
  ...t.initialValues ?? []
1304
1293
  ];
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){
1294
+ const s = Math.max(this.options.findIndex(({ value: e })=>e === t.cursorAt), 0);
1295
+ this.cursor = this.options[s].disabled ? dist_d(s, 1, this.options) : s, this.on("key", (e)=>{
1296
+ "a" === e && this.toggleAll(), "i" === e && this.toggleInvert();
1297
+ }), this.on("cursor", (e)=>{
1298
+ switch(e){
1310
1299
  case "left":
1311
1300
  case "up":
1312
1301
  this.cursor = dist_d(this.cursor, -1, this.options);
@@ -1322,7 +1311,7 @@ let it = class extends dist_p {
1322
1311
  });
1323
1312
  }
1324
1313
  };
1325
- class nt extends dist_p {
1314
+ class ut extends dist_p {
1326
1315
  options;
1327
1316
  cursor = 0;
1328
1317
  get _selectedValue() {
@@ -1333,8 +1322,8 @@ class nt extends dist_p {
1333
1322
  }
1334
1323
  constructor(t){
1335
1324
  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)=>{
1325
+ const s = this.options.findIndex(({ value: i })=>i === t.initialValue), e = -1 === s ? 0 : s;
1326
+ this.cursor = this.options[e].disabled ? dist_d(e, 1, this.options) : e, this.changeValue(), this.on("cursor", (i)=>{
1338
1327
  switch(i){
1339
1328
  case "left":
1340
1329
  case "up":
@@ -1349,13 +1338,13 @@ class nt extends dist_p {
1349
1338
  });
1350
1339
  }
1351
1340
  }
1352
- class at extends dist_p {
1341
+ class ht extends dist_p {
1353
1342
  get userInputWithCursor() {
1354
1343
  if ("submit" === this.state) return this.userInput;
1355
1344
  const t = this.userInput;
1356
1345
  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("")}`;
1346
+ const s = t.slice(0, this.cursor), [e, ...i] = t.slice(this.cursor);
1347
+ return `${s}${styleText("inverse", e)}${i.join("")}`;
1359
1348
  }
1360
1349
  get cursor() {
1361
1350
  return this._cursor;
@@ -1364,169 +1353,169 @@ class at extends dist_p {
1364
1353
  super({
1365
1354
  ...t,
1366
1355
  initialUserInput: t.initialUserInput ?? t.initialValue
1367
- }), this.on("userInput", (e)=>{
1368
- this._setValue(e);
1356
+ }), this.on("userInput", (s)=>{
1357
+ this._setValue(s);
1369
1358
  }), this.on("finalize", ()=>{
1370
1359
  this.value || (this.value = t.defaultValue), void 0 === this.value && (this.value = "");
1371
1360
  });
1372
1361
  }
1373
1362
  }
1374
- function Ze() {
1363
+ function te() {
1375
1364
  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
1365
  }
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){
1366
+ const dist_tt = te(), dist_at = ()=>"true" === process.env.CI, Tt = (t)=>!0 === t.isTTY, dist_w = (t, r)=>dist_tt ? t : r, _t = dist_w("\u25C6", "*"), dist_ot = dist_w("\u25A0", "x"), dist_ut = dist_w("\u25B2", "x"), dist_F = dist_w("\u25C7", "o"), dist_$ = (dist_w("\u250C", "T"), dist_w("\u2502", "|")), E = dist_w("\u2514", "\u2014"), dist_z = (dist_w("\u2510", "T"), dist_w("\u2518", "\u2014"), dist_w("\u25CF", ">")), dist_H = dist_w("\u25CB", " "), dist_et = dist_w("\u25FB", "[\u2022]"), dist_U = dist_w("\u25FC", "[+]"), dist_J = dist_w("\u25FB", "[ ]"), dist_st = (dist_w("\u25AA", "\u2022"), dist_w("\u2500", "-")), ct = dist_w("\u256E", "+"), xt = 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"), M = (t)=>{
1367
+ switch(t){
1379
1368
  case "initial":
1380
1369
  case "active":
1381
- return styleText("cyan", _e);
1370
+ return styleText("cyan", _t);
1382
1371
  case "cancel":
1383
- return styleText("red", oe);
1372
+ return styleText("red", dist_ot);
1384
1373
  case "error":
1385
- return styleText("yellow", ue);
1374
+ return styleText("yellow", dist_ut);
1386
1375
  case "submit":
1387
1376
  return styleText("green", dist_F);
1388
1377
  }
1389
- }, ye = (e)=>{
1390
- switch(e){
1378
+ }, yt = (t)=>{
1379
+ switch(t){
1391
1380
  case "initial":
1392
1381
  case "active":
1393
- return styleText("cyan", prompts_dist_d);
1382
+ return styleText("cyan", dist_$);
1394
1383
  case "cancel":
1395
- return styleText("red", prompts_dist_d);
1384
+ return styleText("red", dist_$);
1396
1385
  case "error":
1397
- return styleText("yellow", prompts_dist_d);
1386
+ return styleText("yellow", dist_$);
1398
1387
  case "submit":
1399
- return styleText("green", prompts_dist_d);
1388
+ return styleText("green", dist_$);
1400
1389
  }
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];
1390
+ }, ee = (t, r, s, i, u)=>{
1391
+ let n = r, o = 0;
1392
+ for(let c = s; c < i; c++){
1393
+ const a = t[c];
1405
1394
  if (n -= a.length, o++, n <= u) break;
1406
1395
  }
1407
1396
  return {
1408
1397
  lineCount: n,
1409
1398
  removals: o
1410
1399
  };
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);
1400
+ }, dist_Y = ({ cursor: t, options: r, style: s, output: i = process.stdout, maxItems: u = 1 / 0, columnPadding: n = 0, rowPadding: o = 4 })=>{
1401
+ const c = dist_A(i) - n, a = dist_L(i), l = styleText("dim", "..."), d = Math.max(a - o, 0), y = Math.max(Math.min(u, d), 5);
1413
1402
  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 = [];
1403
+ t >= y - 3 && (p = Math.max(Math.min(t - y + 3, r.length - y), 0));
1404
+ let m = y < r.length && p > 0, g = y < r.length && p + y < r.length;
1405
+ const S = Math.min(p + y, r.length), h = [];
1417
1406
  let f = 0;
1418
1407
  m && f++, g && f++;
1419
1408
  const v = p + (m ? 1 : 0), T = S - (g ? 1 : 0);
1420
1409
  for(let b = v; b < T; b++){
1421
- const x = wrapAnsi(s(i[b], b === e), c, {
1410
+ const G = wrapAnsi(s(r[b], b === t), c, {
1422
1411
  hard: !0,
1423
1412
  trim: !1
1424
1413
  }).split(`
1425
1414
  `);
1426
- h.push(x), f += x.length;
1415
+ h.push(G), f += G.length;
1427
1416
  }
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));
1417
+ if (f > d) {
1418
+ let b = 0, G = 0, x = f;
1419
+ const A = t - v, P = (N, D)=>ee(h, x, N, D, d);
1420
+ m ? ({ lineCount: x, removals: b } = P(0, A), x > d && ({ lineCount: x, removals: G } = P(A + 1, h.length))) : ({ lineCount: x, removals: G } = P(A + 1, h.length), x > d && ({ lineCount: x, removals: b } = P(0, A))), b > 0 && (m = !0, h.splice(0, b)), G > 0 && (g = !0, h.splice(h.length - G, G));
1432
1421
  }
1433
1422
  const C = [];
1434
1423
  m && C.push(l);
1435
- for (const b of h)for (const x of b)C.push(x);
1424
+ for (const b of h)for (const G of b)C.push(G);
1436
1425
  return g && C.push(l), C;
1437
1426
  };
1438
- function Me(e) {
1439
- return e.label ?? String(e.value ?? "");
1427
+ function Mt(t) {
1428
+ return t.label ?? String(t.value ?? "");
1440
1429
  }
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();
1444
- return s.includes(n) || r.includes(n) || u.includes(n);
1430
+ function Rt(t, r) {
1431
+ if (!t) return !0;
1432
+ const s = (r.label ?? String(r.value ?? "")).toLowerCase(), i = (r.hint ?? "").toLowerCase(), u = String(r.value).toLowerCase(), n = t.toLowerCase();
1433
+ return s.includes(n) || i.includes(n) || u.includes(n);
1445
1434
  }
1446
- function dist_tt(e, i) {
1435
+ function se(t, r) {
1447
1436
  const s = [];
1448
- for (const r of i)e.includes(r.value) && s.push(r);
1437
+ for (const i of r)t.includes(i.value) && s.push(i);
1449
1438
  return s;
1450
1439
  }
1451
- const Ae = (e)=>new H({
1452
- options: e.options,
1453
- initialValue: e.initialValue ? [
1454
- e.initialValue
1440
+ const At = (t)=>new Q({
1441
+ options: t.options,
1442
+ initialValue: t.initialValue ? [
1443
+ t.initialValue
1455
1444
  ] : 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,
1445
+ initialUserInput: t.initialUserInput,
1446
+ placeholder: t.placeholder,
1447
+ filter: t.filter ?? ((r, s)=>Rt(r, s)),
1448
+ signal: t.signal,
1449
+ input: t.input,
1450
+ output: t.output,
1451
+ validate: t.validate,
1463
1452
  render () {
1464
- const i = e.withGuide ?? dist_u.withGuide, s = i ? [
1465
- `${styleText("gray", prompts_dist_d)}`,
1466
- `${dist_V(this.state)} ${e.message}`
1453
+ const r = t.withGuide ?? dist_h.withGuide, s = r ? [
1454
+ `${styleText("gray", dist_$)}`,
1455
+ `${M(this.state)} ${t.message}`
1467
1456
  ] : [
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})`) : "";
1457
+ `${M(this.state)} ${t.message}`
1458
+ ], i = this.userInput, u = this.options, n = t.placeholder, o = "" === i && void 0 !== n, c = (a, l)=>{
1459
+ const d = Mt(a), y = a.hint && a.value === this.focusedValue ? styleText("dim", ` (${a.hint})`) : "";
1471
1460
  switch(l){
1472
1461
  case "active":
1473
- return `${styleText("green", dist_z)} ${$}${y}`;
1462
+ return `${styleText("green", dist_z)} ${d}${y}`;
1474
1463
  case "inactive":
1475
- return `${styleText("dim", dist_H)} ${styleText("dim", $)}`;
1464
+ return `${styleText("dim", dist_H)} ${styleText("dim", d)}`;
1476
1465
  case "disabled":
1477
1466
  return `${styleText("gray", dist_H)} ${styleText([
1478
1467
  "strikethrough",
1479
1468
  "gray"
1480
- ], $)}`;
1469
+ ], d)}`;
1481
1470
  }
1482
1471
  };
1483
1472
  switch(this.state){
1484
1473
  case "submit":
1485
1474
  {
1486
- const a = dist_tt(this.selectedValues, u), l = a.length > 0 ? ` ${styleText("dim", a.map(Me).join(", "))}` : "", $ = i ? styleText("gray", prompts_dist_d) : "";
1475
+ const a = se(this.selectedValues, u), l = a.length > 0 ? ` ${styleText("dim", a.map(Mt).join(", "))}` : "", d = r ? styleText("gray", dist_$) : "";
1487
1476
  return `${s.join(`
1488
1477
  `)}
1489
- ${$}${l}`;
1478
+ ${d}${l}`;
1490
1479
  }
1491
1480
  case "cancel":
1492
1481
  {
1493
- const a = r ? ` ${styleText([
1482
+ const a = i ? ` ${styleText([
1494
1483
  "strikethrough",
1495
1484
  "dim"
1496
- ], r)}` : "", l = i ? styleText("gray", prompts_dist_d) : "";
1485
+ ], i)}` : "", l = r ? styleText("gray", dist_$) : "";
1497
1486
  return `${s.join(`
1498
1487
  `)}
1499
1488
  ${l}${a}`;
1500
1489
  }
1501
1490
  default:
1502
1491
  {
1503
- const a = "error" === this.state ? "yellow" : "cyan", l = i ? `${styleText(a, prompts_dist_d)} ` : "", $ = i ? styleText(a, dist_E) : "";
1492
+ const a = "error" === this.state ? "yellow" : "cyan", l = r ? `${styleText(a, dist_$)} ` : "", d = r ? styleText(a, E) : "";
1504
1493
  let y = "";
1505
1494
  if (this.isNavigating || o) {
1506
- const v = o ? n : r;
1495
+ const v = o ? n : i;
1507
1496
  y = "" !== v ? ` ${styleText("dim", v)}` : "";
1508
1497
  } 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 ? [
1498
+ const p = this.filteredOptions.length !== u.length ? styleText("dim", ` (${this.filteredOptions.length} match${1 === this.filteredOptions.length ? "" : "es"})`) : "", m = 0 === this.filteredOptions.length && i ? [
1510
1499
  `${l}${styleText("yellow", "No matches found")}`
1511
1500
  ] : [], g = "error" === this.state ? [
1512
1501
  `${l}${styleText("yellow", this.error)}`
1513
1502
  ] : [];
1514
- i && s.push(`${l.trimEnd()}`), s.push(`${l}${styleText("dim", "Search:")}${y}${p}`, ...m, ...g);
1503
+ r && s.push(`${l.trimEnd()}`), s.push(`${l}${styleText("dim", "Search:")}${y}${p}`, ...m, ...g);
1515
1504
  const S = [
1516
1505
  `${styleText("dim", "\u2191/\u2193")} to select`,
1517
1506
  `${styleText("dim", "Enter:")} confirm`,
1518
1507
  `${styleText("dim", "Type:")} to search`
1519
1508
  ], h = [
1520
1509
  `${l}${S.join(" \u2022 ")}`,
1521
- $
1510
+ d
1522
1511
  ], f = 0 === this.filteredOptions.length ? [] : dist_Y({
1523
1512
  cursor: this.cursor,
1524
1513
  options: this.filteredOptions,
1525
- columnPadding: i ? 3 : 0,
1514
+ columnPadding: r ? 3 : 0,
1526
1515
  rowPadding: s.length + h.length,
1527
1516
  style: (v, T)=>c(v, v.disabled ? "disabled" : T ? "active" : "inactive"),
1528
- maxItems: e.maxItems,
1529
- output: e.output
1517
+ maxItems: t.maxItems,
1518
+ output: t.output
1530
1519
  });
1531
1520
  return [
1532
1521
  ...s,
@@ -1538,22 +1527,22 @@ ${l}${a}`;
1538
1527
  }
1539
1528
  }
1540
1529
  }).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] ?? {
1530
+ const pe = (t)=>{
1531
+ const { selectableGroups: r = !0, groupSpacing: s = 0 } = t, i = (n, o, c = [])=>{
1532
+ const a = n.label ?? String(n.value), l = "string" == typeof n.group, d = l && (c[c.indexOf(n) + 1] ?? {
1544
1533
  group: !0
1545
- }), y = l && $ && !0 === $.group, p = l ? i ? `${y ? dist_E : prompts_dist_d} ` : " " : "";
1534
+ }), y = l && d && !0 === d.group, p = l ? r ? `${y ? E : dist_$} ` : " " : "";
1546
1535
  let m = "";
1547
1536
  if (s > 0 && !l) {
1548
1537
  const S = `
1549
- ${styleText("cyan", prompts_dist_d)}`;
1538
+ ${styleText("cyan", dist_$)}`;
1550
1539
  m = `${S.repeat(s - 1)}${S} `;
1551
1540
  }
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)}`;
1541
+ if ("active" === o) return `${m}${styleText("dim", p)}${styleText("cyan", dist_et)} ${a}${n.hint ? ` ${styleText("dim", `(${n.hint})`)}` : ""}`;
1542
+ if ("group-active" === o) return `${m}${p}${styleText("cyan", dist_et)} ${styleText("dim", a)}`;
1554
1543
  if ("group-active-selected" === o) return `${m}${p}${styleText("green", dist_U)} ${styleText("dim", a)}`;
1555
1544
  if ("selected" === o) {
1556
- const S = l || i ? styleText("green", dist_U) : "";
1545
+ const S = l || r ? styleText("green", dist_U) : "";
1557
1546
  return `${m}${styleText("dim", p)}${S} ${styleText("dim", a)}${n.hint ? ` ${styleText("dim", `(${n.hint})`)}` : ""}`;
1558
1547
  }
1559
1548
  if ("cancelled" === o) return `${styleText([
@@ -1562,18 +1551,18 @@ ${styleText("cyan", prompts_dist_d)}`;
1562
1551
  ], a)}`;
1563
1552
  if ("active-selected" === o) return `${m}${styleText("dim", p)}${styleText("green", dist_U)} ${a}${n.hint ? ` ${styleText("dim", `(${n.hint})`)}` : ""}`;
1564
1553
  if ("submitted" === o) return `${styleText("dim", a)}`;
1565
- const g = l || i ? styleText("dim", dist_J) : "";
1554
+ const g = l || r ? styleText("dim", dist_J) : "";
1566
1555
  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,
1556
+ }, u = t.required ?? !0;
1557
+ return new it({
1558
+ options: t.options,
1559
+ signal: t.signal,
1560
+ input: t.input,
1561
+ output: t.output,
1562
+ initialValues: t.initialValues,
1574
1563
  required: u,
1575
- cursorAt: e.cursorAt,
1576
- selectableGroups: i,
1564
+ cursorAt: t.cursorAt,
1565
+ selectableGroups: r,
1577
1566
  validate (n) {
1578
1567
  if (u && (void 0 === n || 0 === n.length)) return `Please select at least one option.
1579
1568
  ${styleText("reset", styleText("dim", `Press ${styleText([
@@ -1586,133 +1575,133 @@ ${styleText("reset", styleText("dim", `Press ${styleText([
1586
1575
  ], " enter "))} to submit`))}`;
1587
1576
  },
1588
1577
  render () {
1589
- const n = e.withGuide ?? dist_u.withGuide, o = `${n ? `${styleText("gray", prompts_dist_d)}
1590
- ` : ""}${dist_V(this.state)} ${e.message}
1578
+ const n = t.withGuide ?? dist_h.withGuide, o = `${n ? `${styleText("gray", dist_$)}
1579
+ ` : ""}${M(this.state)} ${t.message}
1591
1580
  `, c = this.value ?? [];
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 a = this.options.filter(({ value: d })=>c.includes(d)).map((d)=>i(d, "submitted")), l = 0 === a.length ? "" : ` ${a.join(styleText("dim", ", "))}`;
1585
+ return `${o}${n ? styleText("gray", dist_$) : ""}${l}`;
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 a = this.options.filter(({ value: l })=>c.includes(l)).map((l)=>i(l, "cancelled")).join(styleText("dim", ", "));
1590
+ return `${o}${n ? `${styleText("gray", dist_$)} ` : ""}${a.trim() ? `${a}${n ? `
1591
+ ${styleText("gray", dist_$)}` : ""}` : ""}`;
1603
1592
  }
1604
1593
  case "error":
1605
1594
  {
1606
1595
  const a = this.error.split(`
1607
- `).map((l, $)=>0 === $ ? `${n ? `${styleText("yellow", dist_E)} ` : ""}${styleText("yellow", l)}` : ` ${l}`).join(`
1596
+ `).map((l, d)=>0 === d ? `${n ? `${styleText("yellow", E)} ` : ""}${styleText("yellow", l)}` : ` ${l}`).join(`
1608
1597
  `);
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);
1598
+ return `${o}${n ? `${styleText("yellow", dist_$)} ` : ""}${this.options.map((l, d, y)=>{
1599
+ const p = c.includes(l.value) || !0 === l.group && this.isGroupSelected(`${l.value}`), m = d === this.cursor;
1600
+ return m || "string" != typeof l.group || this.options[this.cursor].value !== l.group ? m && p ? i(l, "active-selected", y) : p ? i(l, "selected", y) : i(l, m ? "active" : "inactive", y) : i(l, p ? "group-active-selected" : "group-active", y);
1612
1601
  }).join(`
1613
- ${n ? `${styleText("yellow", prompts_dist_d)} ` : ""}`)}
1602
+ ${n ? `${styleText("yellow", dist_$)} ` : ""}`)}
1614
1603
  ${a}
1615
1604
  `;
1616
1605
  }
1617
1606
  default:
1618
1607
  {
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;
1608
+ const a = this.options.map((d, y, p)=>{
1609
+ const m = c.includes(d.value) || !0 === d.group && this.isGroupSelected(`${d.value}`), g = y === this.cursor, S = !g && "string" == typeof d.group && this.options[this.cursor].value === d.group;
1621
1610
  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(`
1611
+ return S ? h = i(d, m ? "group-active-selected" : "group-active", p) : g && m ? h = i(d, "active-selected", p) : m ? h = i(d, "selected", p) : h = i(d, g ? "active" : "inactive", p), `${0 !== y && !h.startsWith(`
1623
1612
  `) ? " " : ""}${h}`;
1624
1613
  }).join(`
1625
- ${n ? styleText("cyan", prompts_dist_d) : ""}`), l = a.startsWith(`
1614
+ ${n ? styleText("cyan", dist_$) : ""}`), l = a.startsWith(`
1626
1615
  `) ? "" : " ";
1627
- return `${o}${n ? styleText("cyan", prompts_dist_d) : ""}${l}${a}
1628
- ${n ? styleText("cyan", dist_E) : ""}
1616
+ return `${o}${n ? styleText("cyan", dist_$) : ""}${l}${a}
1617
+ ${n ? styleText("cyan", E) : ""}
1629
1618
  `;
1630
1619
  }
1631
1620
  }
1632
1621
  }
1633
1622
  }).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} ` : "";
1623
+ }, dist_R = {
1624
+ message: (t = [], { symbol: r = styleText("gray", dist_$), secondarySymbol: s = styleText("gray", dist_$), output: i = process.stdout, spacing: u = 1, withGuide: n } = {})=>{
1625
+ const o = [], c = n ?? dist_h.withGuide, a = c ? s : "", l = c ? `${r} ` : "", d = c ? `${s} ` : "";
1637
1626
  for(let p = 0; p < u; p++)o.push(a);
1638
- const y = Array.isArray(e) ? e : e.split(`
1627
+ const y = Array.isArray(t) ? t : t.split(`
1639
1628
  `);
1640
1629
  if (y.length > 0) {
1641
1630
  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 : "");
1631
+ p.length > 0 ? o.push(`${l}${p}`) : o.push(c ? r : "");
1632
+ for (const g of m)g.length > 0 ? o.push(`${d}${g}`) : o.push(c ? s : "");
1644
1633
  }
1645
- r.write(`${o.join(`
1634
+ i.write(`${o.join(`
1646
1635
  `)}
1647
1636
  `);
1648
1637
  },
1649
- info: (e, i)=>{
1650
- dist_O.message(e, {
1651
- ...i,
1652
- symbol: styleText("blue", he)
1638
+ info: (t, r)=>{
1639
+ dist_R.message(t, {
1640
+ ...r,
1641
+ symbol: styleText("blue", dist_ht)
1653
1642
  });
1654
1643
  },
1655
- success: (e, i)=>{
1656
- dist_O.message(e, {
1657
- ...i,
1658
- symbol: styleText("green", pe)
1644
+ success: (t, r)=>{
1645
+ dist_R.message(t, {
1646
+ ...r,
1647
+ symbol: styleText("green", pt)
1659
1648
  });
1660
1649
  },
1661
- step: (e, i)=>{
1662
- dist_O.message(e, {
1663
- ...i,
1650
+ step: (t, r)=>{
1651
+ dist_R.message(t, {
1652
+ ...r,
1664
1653
  symbol: styleText("green", dist_F)
1665
1654
  });
1666
1655
  },
1667
- warn: (e, i)=>{
1668
- dist_O.message(e, {
1669
- ...i,
1670
- symbol: styleText("yellow", me)
1656
+ warn: (t, r)=>{
1657
+ dist_R.message(t, {
1658
+ ...r,
1659
+ symbol: styleText("yellow", mt)
1671
1660
  });
1672
1661
  },
1673
- warning: (e, i)=>{
1674
- dist_O.warn(e, i);
1662
+ warning: (t, r)=>{
1663
+ dist_R.warn(t, r);
1675
1664
  },
1676
- error: (e, i)=>{
1677
- dist_O.message(e, {
1678
- ...i,
1679
- symbol: styleText("red", ge)
1665
+ error: (t, r)=>{
1666
+ dist_R.message(t, {
1667
+ ...r,
1668
+ symbol: styleText("red", gt)
1680
1669
  });
1681
1670
  }
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)}
1671
+ }, me = (t = "", r)=>{
1672
+ const s = r?.output ?? process.stdout, i = r?.withGuide ?? dist_h.withGuide ? `${styleText("gray", E)} ` : "";
1673
+ s.write(`${i}${styleText("red", t)}
1685
1674
 
1686
1675
  `);
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}
1676
+ }, ye = (t = "", r)=>{
1677
+ const s = r?.output ?? process.stdout, i = r?.withGuide ?? dist_h.withGuide ? `${styleText("gray", dist_$)}
1678
+ ${styleText("gray", E)} ` : "";
1679
+ s.write(`${i}${t}
1691
1680
 
1692
1681
  `);
1693
- }, dist_Q = (e, i)=>e.split(`
1694
- `).map((s)=>i(s)).join(`
1695
- `), yt = (e)=>{
1696
- const i = (r, u)=>{
1697
- const n = r.label ?? String(r.value);
1682
+ }, dist_Q = (t, r)=>t.split(`
1683
+ `).map((s)=>r(s)).join(`
1684
+ `), ve = (t)=>{
1685
+ const r = (i, u)=>{
1686
+ const n = i.label ?? String(i.value);
1698
1687
  return "disabled" === u ? `${styleText("gray", dist_J)} ${dist_Q(n, (o)=>styleText([
1699
1688
  "strikethrough",
1700
1689
  "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([
1690
+ ], o))}${i.hint ? ` ${styleText("dim", `(${i.hint ?? "disabled"})`)}` : ""}` : "active" === u ? `${styleText("cyan", dist_et)} ${n}${i.hint ? ` ${styleText("dim", `(${i.hint})`)}` : ""}` : "selected" === u ? `${styleText("green", dist_U)} ${dist_Q(n, (o)=>styleText("dim", o))}${i.hint ? ` ${styleText("dim", `(${i.hint})`)}` : ""}` : "cancelled" === u ? `${dist_Q(n, (o)=>styleText([
1702
1691
  "strikethrough",
1703
1692
  "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,
1693
+ ], o))}` : "active-selected" === u ? `${styleText("green", dist_U)} ${n}${i.hint ? ` ${styleText("dim", `(${i.hint})`)}` : ""}` : "submitted" === u ? `${dist_Q(n, (o)=>styleText("dim", o))}` : `${styleText("dim", dist_J)} ${dist_Q(n, (o)=>styleText("dim", o))}`;
1694
+ }, s = t.required ?? !0;
1695
+ return new dist_nt({
1696
+ options: t.options,
1697
+ signal: t.signal,
1698
+ input: t.input,
1699
+ output: t.output,
1700
+ initialValues: t.initialValues,
1712
1701
  required: s,
1713
- cursorAt: e.cursorAt,
1714
- validate (r) {
1715
- if (s && (void 0 === r || 0 === r.length)) return `Please select at least one option.
1702
+ cursorAt: t.cursorAt,
1703
+ validate (i) {
1704
+ if (s && (void 0 === i || 0 === i.length)) return `Please select at least one option.
1716
1705
  ${styleText("reset", styleText("dim", `Press ${styleText([
1717
1706
  "gray",
1718
1707
  "bgWhite",
@@ -1720,41 +1709,41 @@ ${styleText("reset", styleText("dim", `Press ${styleText([
1720
1709
  ], " space ")} to select, ${styleText("gray", styleText("bgWhite", styleText("inverse", " enter ")))} to submit`))}`;
1721
1710
  },
1722
1711
  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)}
1712
+ const i = t.withGuide ?? dist_h.withGuide, u = dist_W(t.output, t.message, i ? `${yt(this.state)} ` : "", `${M(this.state)} `), n = `${i ? `${styleText("gray", dist_$)}
1724
1713
  ` : ""}${u}
1725
1714
  `, 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");
1715
+ if (a.disabled) return r(a, "disabled");
1716
+ const d = o.includes(a.value);
1717
+ return l && d ? r(a, "active-selected") : d ? r(a, "selected") : r(a, l ? "active" : "inactive");
1729
1718
  };
1730
1719
  switch(this.state){
1731
1720
  case "submit":
1732
1721
  {
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)} ` : "");
1722
+ const a = this.options.filter(({ value: d })=>o.includes(d)).map((d)=>r(d, "submitted")).join(styleText("dim", ", ")) || styleText("dim", "none"), l = dist_W(t.output, a, i ? `${styleText("gray", dist_$)} ` : "");
1734
1723
  return `${n}${l}`;
1735
1724
  }
1736
1725
  case "cancel":
1737
1726
  {
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)} ` : "");
1741
- return `${n}${l}${r ? `
1742
- ${styleText("gray", prompts_dist_d)}` : ""}`;
1727
+ const a = this.options.filter(({ value: d })=>o.includes(d)).map((d)=>r(d, "cancelled")).join(styleText("dim", ", "));
1728
+ if ("" === a.trim()) return `${n}${styleText("gray", dist_$)}`;
1729
+ const l = dist_W(t.output, a, i ? `${styleText("gray", dist_$)} ` : "");
1730
+ return `${n}${l}${i ? `
1731
+ ${styleText("gray", dist_$)}` : ""}`;
1743
1732
  }
1744
1733
  case "error":
1745
1734
  {
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(`
1735
+ const a = i ? `${styleText("yellow", dist_$)} ` : "", l = this.error.split(`
1736
+ `).map((p, m)=>0 === m ? `${i ? `${styleText("yellow", E)} ` : ""}${styleText("yellow", p)}` : ` ${p}`).join(`
1737
+ `), d = n.split(`
1749
1738
  `).length, y = l.split(`
1750
1739
  `).length + 1;
1751
1740
  return `${n}${a}${dist_Y({
1752
- output: e.output,
1741
+ output: t.output,
1753
1742
  options: this.options,
1754
1743
  cursor: this.cursor,
1755
- maxItems: e.maxItems,
1744
+ maxItems: t.maxItems,
1756
1745
  columnPadding: a.length,
1757
- rowPadding: $ + y,
1746
+ rowPadding: d + y,
1758
1747
  style: c
1759
1748
  }).join(`
1760
1749
  ${a}`)}
@@ -1763,105 +1752,105 @@ ${l}
1763
1752
  }
1764
1753
  default:
1765
1754
  {
1766
- const a = r ? `${styleText("cyan", prompts_dist_d)} ` : "", l = n.split(`
1767
- `).length, $ = r ? 2 : 1;
1755
+ const a = i ? `${styleText("cyan", dist_$)} ` : "", l = n.split(`
1756
+ `).length, d = i ? 2 : 1;
1768
1757
  return `${n}${a}${dist_Y({
1769
- output: e.output,
1758
+ output: t.output,
1770
1759
  options: this.options,
1771
1760
  cursor: this.cursor,
1772
- maxItems: e.maxItems,
1761
+ maxItems: t.maxItems,
1773
1762
  columnPadding: a.length,
1774
- rowPadding: l + $,
1763
+ rowPadding: l + d,
1775
1764
  style: c
1776
1765
  }).join(`
1777
1766
  ${a}`)}
1778
- ${r ? styleText("cyan", dist_E) : ""}
1767
+ ${i ? styleText("cyan", E) : ""}
1779
1768
  `;
1780
1769
  }
1781
1770
  }
1782
1771
  }
1783
1772
  }).prompt();
1784
- }, ft = (e)=>styleText("dim", e), vt = (e, i, s)=>{
1785
- const r = {
1773
+ }, we = (t)=>styleText("dim", t), be = (t, r, s)=>{
1774
+ const i = {
1786
1775
  hard: !0,
1787
1776
  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 = [
1777
+ }, u = wrapAnsi(t, r, i).split(`
1778
+ `), 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 = r - (o - n);
1779
+ return wrapAnsi(t, c, i);
1780
+ }, Se = (t = "", r = "", s)=>{
1781
+ const i = s?.output ?? node_process.stdout, u = s?.withGuide ?? dist_h.withGuide, n = s?.format ?? we, o = [
1793
1782
  "",
1794
- ...vt(e, O(r) - 6, n).split(`
1783
+ ...be(t, dist_A(i) - 6, n).split(`
1795
1784
  `).map(n),
1796
1785
  ""
1797
- ], c = fast_string_width_dist(i), a = Math.max(o.reduce((p, m)=>{
1786
+ ], c = fast_string_width_dist(r), a = Math.max(o.reduce((p, m)=>{
1798
1787
  const g = fast_string_width_dist(m);
1799
1788
  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)}
1789
+ }, 0), c) + 2, l = o.map((p)=>`${styleText("gray", dist_$)} ${p}${" ".repeat(a - fast_string_width_dist(p))}${styleText("gray", dist_$)}`).join(`
1790
+ `), d = u ? `${styleText("gray", dist_$)}
1791
+ ` : "", y = u ? xt : dt;
1792
+ i.write(`${d}${styleText("green", dist_F)} ${styleText("reset", r)} ${styleText("gray", dist_st.repeat(Math.max(a - c - 1, 1)) + ct)}
1804
1793
  ${l}
1805
- ${styleText("gray", y + se.repeat(a + 2) + $e)}
1794
+ ${styleText("gray", y + dist_st.repeat(a + 2) + $t)}
1806
1795
  `);
1807
1796
  };
1808
1797
  dist_w("\u2500", "-"), dist_w("\u2501", "="), dist_w("\u2588", "#");
1809
- const re = (e, i)=>e.includes(`
1810
- `) ? e.split(`
1811
- `).map((s)=>i(s)).join(`
1812
- `) : i(e), _t = (e)=>{
1813
- const i = (s, r)=>{
1798
+ const dist_it = (t, r)=>t.includes(`
1799
+ `) ? t.split(`
1800
+ `).map((s)=>r(s)).join(`
1801
+ `) : r(t), Ee = (t)=>{
1802
+ const r = (s, i)=>{
1814
1803
  const u = s.label ?? String(s.value);
1815
- switch(r){
1804
+ switch(i){
1816
1805
  case "disabled":
1817
- return `${styleText("gray", dist_H)} ${re(u, (n)=>styleText("gray", n))}${s.hint ? ` ${styleText("dim", `(${s.hint ?? "disabled"})`)}` : ""}`;
1806
+ return `${styleText("gray", dist_H)} ${dist_it(u, (n)=>styleText("gray", n))}${s.hint ? ` ${styleText("dim", `(${s.hint ?? "disabled"})`)}` : ""}`;
1818
1807
  case "selected":
1819
- return `${re(u, (n)=>styleText("dim", n))}`;
1808
+ return `${dist_it(u, (n)=>styleText("dim", n))}`;
1820
1809
  case "active":
1821
1810
  return `${styleText("green", dist_z)} ${u}${s.hint ? ` ${styleText("dim", `(${s.hint})`)}` : ""}`;
1822
1811
  case "cancelled":
1823
- return `${re(u, (n)=>styleText([
1812
+ return `${dist_it(u, (n)=>styleText([
1824
1813
  "strikethrough",
1825
1814
  "dim"
1826
1815
  ], n))}`;
1827
1816
  default:
1828
- return `${styleText("dim", dist_H)} ${re(u, (n)=>styleText("dim", n))}`;
1817
+ return `${styleText("dim", dist_H)} ${dist_it(u, (n)=>styleText("dim", n))}`;
1829
1818
  }
1830
1819
  };
1831
- return new nt({
1832
- options: e.options,
1833
- signal: e.signal,
1834
- input: e.input,
1835
- output: e.output,
1836
- initialValue: e.initialValue,
1820
+ return new ut({
1821
+ options: t.options,
1822
+ signal: t.signal,
1823
+ input: t.input,
1824
+ output: t.output,
1825
+ initialValue: t.initialValue,
1837
1826
  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)}
1827
+ const s = t.withGuide ?? dist_h.withGuide, i = `${M(this.state)} `, u = `${yt(this.state)} `, n = dist_W(t.output, t.message, u, i), o = `${s ? `${styleText("gray", dist_$)}
1839
1828
  ` : ""}${n}
1840
1829
  `;
1841
1830
  switch(this.state){
1842
1831
  case "submit":
1843
1832
  {
1844
- const c = s ? `${styleText("gray", prompts_dist_d)} ` : "", a = dist_R(e.output, i(this.options[this.cursor], "selected"), c);
1833
+ const c = s ? `${styleText("gray", dist_$)} ` : "", a = dist_W(t.output, r(this.options[this.cursor], "selected"), c);
1845
1834
  return `${o}${a}`;
1846
1835
  }
1847
1836
  case "cancel":
1848
1837
  {
1849
- const c = s ? `${styleText("gray", prompts_dist_d)} ` : "", a = dist_R(e.output, i(this.options[this.cursor], "cancelled"), c);
1838
+ const c = s ? `${styleText("gray", dist_$)} ` : "", a = dist_W(t.output, r(this.options[this.cursor], "cancelled"), c);
1850
1839
  return `${o}${a}${s ? `
1851
- ${styleText("gray", prompts_dist_d)}` : ""}`;
1840
+ ${styleText("gray", dist_$)}` : ""}`;
1852
1841
  }
1853
1842
  default:
1854
1843
  {
1855
- const c = s ? `${styleText("cyan", prompts_dist_d)} ` : "", a = s ? styleText("cyan", dist_E) : "", l = o.split(`
1856
- `).length, $ = s ? 2 : 1;
1844
+ const c = s ? `${styleText("cyan", dist_$)} ` : "", a = s ? styleText("cyan", E) : "", l = o.split(`
1845
+ `).length, d = s ? 2 : 1;
1857
1846
  return `${o}${c}${dist_Y({
1858
- output: e.output,
1847
+ output: t.output,
1859
1848
  cursor: this.cursor,
1860
1849
  options: this.options,
1861
- maxItems: e.maxItems,
1850
+ maxItems: t.maxItems,
1862
1851
  columnPadding: c.length,
1863
- rowPadding: l + $,
1864
- style: (y, p)=>i(y, y.disabled ? "disabled" : p ? "active" : "inactive")
1852
+ rowPadding: l + d,
1853
+ style: (y, p)=>r(y, y.disabled ? "disabled" : p ? "active" : "inactive")
1865
1854
  }).join(`
1866
1855
  ${c}`)}
1867
1856
  ${a}
@@ -1870,12 +1859,12 @@ ${a}
1870
1859
  }
1871
1860
  }
1872
1861
  }).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);
1875
- i.write(`${r}
1876
- `), i.write(`${styleText("green", dist_F)} ${e.title}
1862
+ }, Oe = (styleText("gray", dist_$), (t)=>t.replace(/\x1b\[(?:\d+;)*\d*[ABCDEFGHfJKSTsu]|\x1b\[(s|u)/g, "")), Me = (t)=>{
1863
+ const r = t.output ?? process.stdout, s = dist_A(r), i = styleText("gray", dist_$), u = t.spacing ?? 1, n = 3, o = !0 === t.retainLog, c = !dist_at() && Tt(r);
1864
+ r.write(`${i}
1865
+ `), r.write(`${styleText("green", dist_F)} ${t.title}
1877
1866
  `);
1878
- for(let h = 0; h < u; h++)i.write(`${r}
1867
+ for(let h = 0; h < u; h++)r.write(`${i}
1879
1868
  `);
1880
1869
  const a = [
1881
1870
  {
@@ -1884,7 +1873,7 @@ ${a}
1884
1873
  }
1885
1874
  ];
1886
1875
  let l = !1;
1887
- const $ = (h)=>{
1876
+ const d = (h)=>{
1888
1877
  if (0 === a.length) return;
1889
1878
  let f = 0;
1890
1879
  h && (f += u + 2);
@@ -1894,25 +1883,25 @@ ${a}
1894
1883
  if (0 === b.length) continue;
1895
1884
  void 0 === C && void 0 !== v.header && "" !== v.header && (b += `
1896
1885
  ${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;
1886
+ const G = b.split(`
1887
+ `).reduce((x, A)=>"" === A ? x + 1 : x + Math.ceil((A.length + n) / s), 0);
1888
+ f += G;
1900
1889
  }
1901
- f > 0 && (f += 1, i.write(src.erase.lines(f)));
1890
+ f > 0 && (f += 1, r.write(src.erase.lines(f)));
1902
1891
  }, y = (h, f, v)=>{
1903
1892
  const T = v ? `${h.full}
1904
1893
  ${h.value}` : h.value;
1905
- void 0 !== h.header && "" !== h.header && dist_O.message(h.header.split(`
1894
+ void 0 !== h.header && "" !== h.header && dist_R.message(h.header.split(`
1906
1895
  `).map((C)=>styleText("bold", C)), {
1907
- output: i,
1908
- secondarySymbol: r,
1909
- symbol: r,
1896
+ output: r,
1897
+ secondarySymbol: i,
1898
+ symbol: i,
1910
1899
  spacing: 0
1911
- }), dist_O.message(T.split(`
1900
+ }), dist_R.message(T.split(`
1912
1901
  `).map((C)=>styleText("dim", C)), {
1913
- output: i,
1914
- secondarySymbol: r,
1915
- symbol: r,
1902
+ output: r,
1903
+ secondarySymbol: i,
1904
+ symbol: i,
1916
1905
  spacing: f ?? u
1917
1906
  });
1918
1907
  }, p = ()=>{
@@ -1921,10 +1910,10 @@ ${h.value}` : h.value;
1921
1910
  (void 0 === f || 0 === f.length) && 0 === v.length || y(h, void 0, !0 === o && T.length > 0);
1922
1911
  }
1923
1912
  }, 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) {
1913
+ if (d(!1), v?.raw === !0 && l || "" === h.value || (h.value += `
1914
+ `), h.value += Oe(f), l = v?.raw === !0, void 0 !== t.limit) {
1926
1915
  const T = h.value.split(`
1927
- `), C = T.length - e.limit;
1916
+ `), C = T.length - t.limit;
1928
1917
  if (C > 0) {
1929
1918
  const b = T.splice(0, C);
1930
1919
  o && (h.full += ("" === h.full ? "" : `
@@ -1936,17 +1925,17 @@ ${h.value}` : h.value;
1936
1925
  }
1937
1926
  c && g();
1938
1927
  }, g = ()=>{
1939
- for (const h of a)h.result ? "error" === h.result.status ? dist_O.error(h.result.message, {
1940
- output: i,
1941
- secondarySymbol: r,
1928
+ for (const h of a)h.result ? "error" === h.result.status ? dist_R.error(h.result.message, {
1929
+ output: r,
1930
+ secondarySymbol: i,
1942
1931
  spacing: 0
1943
- }) : dist_O.success(h.result.message, {
1944
- output: i,
1945
- secondarySymbol: r,
1932
+ }) : dist_R.success(h.result.message, {
1933
+ output: r,
1934
+ secondarySymbol: i,
1946
1935
  spacing: 0
1947
1936
  }) : "" !== h.value && y(h, 0);
1948
1937
  }, S = (h, f)=>{
1949
- $(!1), h.result = f, c && g();
1938
+ d(!1), h.result = f, c && g();
1950
1939
  };
1951
1940
  return {
1952
1941
  message (h, f) {
@@ -1977,39 +1966,39 @@ ${h.value}` : h.value;
1977
1966
  };
1978
1967
  },
1979
1968
  error (h, f) {
1980
- $(!0), dist_O.error(h, {
1981
- output: i,
1982
- secondarySymbol: r,
1969
+ d(!0), dist_R.error(h, {
1970
+ output: r,
1971
+ secondarySymbol: i,
1983
1972
  spacing: 1
1984
1973
  }), f?.showLog !== !1 && p(), a.splice(1, a.length - 1), a[0].value = "", a[0].full = "";
1985
1974
  },
1986
1975
  success (h, f) {
1987
- $(!0), dist_O.success(h, {
1988
- output: i,
1989
- secondarySymbol: r,
1976
+ d(!0), dist_R.success(h, {
1977
+ output: r,
1978
+ secondarySymbol: i,
1990
1979
  spacing: 1
1991
1980
  }), f?.showLog === !0 && p(), a.splice(1, a.length - 1), a[0].value = "", a[0].full = "";
1992
1981
  }
1993
1982
  };
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,
1983
+ }, Re = (t)=>new ht({
1984
+ validate: t.validate,
1985
+ placeholder: t.placeholder,
1986
+ defaultValue: t.defaultValue,
1987
+ initialValue: t.initialValue,
1988
+ output: t.output,
1989
+ signal: t.signal,
1990
+ input: t.input,
2002
1991
  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([
1992
+ const r = t?.withGuide ?? dist_h.withGuide, s = `${r ? `${styleText("gray", dist_$)}
1993
+ ` : ""}${M(this.state)} ${t.message}
1994
+ `, i = t.placeholder ? styleText("inverse", t.placeholder[0]) + styleText("dim", t.placeholder.slice(1)) : styleText([
2006
1995
  "inverse",
2007
1996
  "hidden"
2008
- ], "_"), u = this.userInput ? this.userInputWithCursor : r, n = this.value ?? "";
1997
+ ], "_"), u = this.userInput ? this.userInputWithCursor : i, n = this.value ?? "";
2009
1998
  switch(this.state){
2010
1999
  case "error":
2011
2000
  {
2012
- const o = this.error ? ` ${styleText("yellow", this.error)}` : "", c = i ? `${styleText("yellow", prompts_dist_d)} ` : "", a = i ? styleText("yellow", dist_E) : "";
2001
+ const o = this.error ? ` ${styleText("yellow", this.error)}` : "", c = r ? `${styleText("yellow", dist_$)} ` : "", a = r ? styleText("yellow", E) : "";
2013
2002
  return `${s.trim()}
2014
2003
  ${c}${u}
2015
2004
  ${a}${o}
@@ -2017,7 +2006,7 @@ ${a}${o}
2017
2006
  }
2018
2007
  case "submit":
2019
2008
  {
2020
- const o = n ? ` ${styleText("dim", n)}` : "", c = i ? styleText("gray", prompts_dist_d) : "";
2009
+ const o = n ? ` ${styleText("dim", n)}` : "", c = r ? styleText("gray", dist_$) : "";
2021
2010
  return `${s}${c}${o}`;
2022
2011
  }
2023
2012
  case "cancel":
@@ -2025,13 +2014,13 @@ ${a}${o}
2025
2014
  const o = n ? ` ${styleText([
2026
2015
  "strikethrough",
2027
2016
  "dim"
2028
- ], n)}` : "", c = i ? styleText("gray", prompts_dist_d) : "";
2017
+ ], n)}` : "", c = r ? styleText("gray", dist_$) : "";
2029
2018
  return `${s}${c}${o}${n.trim() ? `
2030
2019
  ${c}` : ""}`;
2031
2020
  }
2032
2021
  default:
2033
2022
  {
2034
- const o = i ? `${styleText("cyan", prompts_dist_d)} ` : "", c = i ? styleText("cyan", dist_E) : "";
2023
+ const o = r ? `${styleText("cyan", dist_$)} ` : "", c = r ? styleText("cyan", E) : "";
2035
2024
  return `${s}${o}${u}
2036
2025
  ${c}
2037
2026
  `;
@@ -2310,18 +2299,18 @@ let createLogger = (options = {})=>{
2310
2299
  return logger;
2311
2300
  };
2312
2301
  let src_logger = createLogger();
2313
- var main_d = (e, t)=>()=>(t || e((t = {
2302
+ var main_u = (e, t)=>()=>(t || (e((t = {
2314
2303
  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 = {
2304
+ }).exports, t), e = null), t.exports);
2305
+ var main_d = /* @__PURE__ */ createRequire(import.meta.url);
2306
+ const main_f = /^path$/i;
2307
+ const main_p = {
2319
2308
  key: "PATH",
2320
2309
  value: ""
2321
2310
  };
2322
- function main_h(e) {
2311
+ function main_m(e) {
2323
2312
  for(const t in e){
2324
- if (!Object.prototype.hasOwnProperty.call(e, t) || !main_p.test(t)) continue;
2313
+ if (!Object.prototype.hasOwnProperty.call(e, t) || !main_f.test(t)) continue;
2325
2314
  const n = e[t];
2326
2315
  if (!n) break;
2327
2316
  return {
@@ -2329,35 +2318,35 @@ function main_h(e) {
2329
2318
  value: n
2330
2319
  };
2331
2320
  }
2332
- return main_m;
2321
+ return main_p;
2333
2322
  }
2334
- function main_g(e, t) {
2323
+ function main_h(e, t) {
2335
2324
  const n = t.value.split(delimiter);
2336
- const a = [];
2325
+ const r = [];
2337
2326
  let s = e;
2338
2327
  let c;
2339
2328
  do {
2340
- a.push(resolve(s, "node_modules", ".bin"));
2329
+ r.push(resolve(s, "node_modules", ".bin"));
2341
2330
  c = s;
2342
2331
  s = dirname(s);
2343
2332
  }while (s !== c);
2344
- a.push(dirname(process.execPath));
2345
- const l = a.concat(n).join(delimiter);
2333
+ r.push(dirname(process.execPath));
2334
+ const l = r.concat(n).join(delimiter);
2346
2335
  return {
2347
2336
  key: t.key,
2348
2337
  value: l
2349
2338
  };
2350
2339
  }
2351
- function main_(e, t) {
2340
+ function main_g(e, t) {
2352
2341
  const n = {
2353
2342
  ...process.env,
2354
2343
  ...t
2355
2344
  };
2356
- const r = main_g(e, main_h(n));
2345
+ const r = main_h(e, main_m(n));
2357
2346
  n[r.key] = r.value;
2358
2347
  return n;
2359
2348
  }
2360
- const main_v = (e)=>{
2349
+ const main_ = (e)=>{
2361
2350
  let t = e.length;
2362
2351
  const n = new PassThrough();
2363
2352
  const r = ()=>{
@@ -2368,10 +2357,10 @@ const main_v = (e)=>{
2368
2357
  }).then(r).catch(r);
2369
2358
  return n;
2370
2359
  };
2371
- var main_y = /* @__PURE__ */ main_d((e, t)=>{
2360
+ var main_v = /* @__PURE__ */ main_u((e, t)=>{
2372
2361
  t.exports = a;
2373
2362
  a.sync = o;
2374
- var n = main_f("fs");
2363
+ var n = main_d("fs");
2375
2364
  function r(e, t) {
2376
2365
  var n = void 0 !== t.pathExt ? t.pathExt : process.env.PATHEXT;
2377
2366
  if (!n) return true;
@@ -2396,10 +2385,10 @@ var main_y = /* @__PURE__ */ main_d((e, t)=>{
2396
2385
  return i(n.statSync(e), e, t);
2397
2386
  }
2398
2387
  });
2399
- var main_b = /* @__PURE__ */ main_d((e, t)=>{
2388
+ var main_y = /* @__PURE__ */ main_u((e, t)=>{
2400
2389
  t.exports = r;
2401
2390
  r.sync = i;
2402
- var n = main_f("fs");
2391
+ var n = main_d("fs");
2403
2392
  function r(e, t, r) {
2404
2393
  n.stat(e, function(e, n) {
2405
2394
  r(e, e ? false : a(n, t));
@@ -2424,10 +2413,10 @@ var main_b = /* @__PURE__ */ main_d((e, t)=>{
2424
2413
  return n & l || n & c && i === o || n & s && r === a || n & u && 0 === a;
2425
2414
  }
2426
2415
  });
2427
- var main_x = /* @__PURE__ */ main_d((e, t)=>{
2428
- main_f("fs");
2416
+ var main_b = /* @__PURE__ */ main_u((e, t)=>{
2417
+ main_d("fs");
2429
2418
  var n;
2430
- n = "win32" === process.platform || global.TESTING_WINDOWS ? main_y() : main_b();
2419
+ n = "win32" === process.platform || global.TESTING_WINDOWS ? main_v() : main_y();
2431
2420
  t.exports = r;
2432
2421
  r.sync = i;
2433
2422
  function r(e, t, i) {
@@ -2463,11 +2452,11 @@ var main_x = /* @__PURE__ */ main_d((e, t)=>{
2463
2452
  }
2464
2453
  }
2465
2454
  });
2466
- var main_S = /* @__PURE__ */ main_d((e, t)=>{
2455
+ var main_x = /* @__PURE__ */ main_u((e, t)=>{
2467
2456
  const n = "win32" === process.platform || "cygwin" === process.env.OSTYPE || "msys" === process.env.OSTYPE;
2468
- const r = main_f("path");
2457
+ const r = main_d("path");
2469
2458
  const i = n ? ";" : ":";
2470
- const a = main_x();
2459
+ const a = main_b();
2471
2460
  const o = (e)=>Object.assign(/* @__PURE__ */ new Error(`not found: ${e}`), {
2472
2461
  code: "ENOENT"
2473
2462
  });
@@ -2548,7 +2537,7 @@ var main_S = /* @__PURE__ */ main_d((e, t)=>{
2548
2537
  t.exports = c;
2549
2538
  c.sync = l;
2550
2539
  });
2551
- var main_C = /* @__PURE__ */ main_d((e, t)=>{
2540
+ var main_S = /* @__PURE__ */ main_u((e, t)=>{
2552
2541
  const n = (e = {})=>{
2553
2542
  const t = e.env || process.env;
2554
2543
  if ("win32" !== (e.platform || process.platform)) return "PATH";
@@ -2557,10 +2546,10 @@ var main_C = /* @__PURE__ */ main_d((e, t)=>{
2557
2546
  t.exports = n;
2558
2547
  t.exports.default = n;
2559
2548
  });
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();
2549
+ var main_C = /* @__PURE__ */ main_u((e, t)=>{
2550
+ const n = main_d("path");
2551
+ const r = main_x();
2552
+ const i = main_S();
2564
2553
  function a(e, t) {
2565
2554
  const a = e.options.env || process.env;
2566
2555
  const o = process.cwd();
@@ -2588,7 +2577,7 @@ var main_w = /* @__PURE__ */ main_d((e, t)=>{
2588
2577
  }
2589
2578
  t.exports = o;
2590
2579
  });
2591
- var main_T = /* @__PURE__ */ main_d((e, t)=>{
2580
+ var main_w = /* @__PURE__ */ main_u((e, t)=>{
2592
2581
  const n = /([()\][%!^"`<>&|;, *?])/g;
2593
2582
  function r(e) {
2594
2583
  e = e.replace(n, "^$1");
@@ -2606,11 +2595,11 @@ var main_T = /* @__PURE__ */ main_d((e, t)=>{
2606
2595
  t.exports.command = r;
2607
2596
  t.exports.argument = i;
2608
2597
  });
2609
- var main_E = /* @__PURE__ */ main_d((e, t)=>{
2598
+ var main_T = /* @__PURE__ */ main_u((e, t)=>{
2610
2599
  t.exports = /^#!(.*)/;
2611
2600
  });
2612
- var main_D = /* @__PURE__ */ main_d((e, t)=>{
2613
- const n = main_E();
2601
+ var main_E = /* @__PURE__ */ main_u((e, t)=>{
2602
+ const n = main_T();
2614
2603
  t.exports = (e = "")=>{
2615
2604
  const t = e.match(n);
2616
2605
  if (!t) return null;
@@ -2620,9 +2609,9 @@ var main_D = /* @__PURE__ */ main_d((e, t)=>{
2620
2609
  return i ? `${a} ${i}` : a;
2621
2610
  };
2622
2611
  });
2623
- var main_O = /* @__PURE__ */ main_d((e, t)=>{
2624
- const n = main_f("fs");
2625
- const r = main_D();
2612
+ var main_D = /* @__PURE__ */ main_u((e, t)=>{
2613
+ const n = main_d("fs");
2614
+ const r = main_E();
2626
2615
  function i(e) {
2627
2616
  const t = 150;
2628
2617
  const i = Buffer.alloc(t);
@@ -2636,11 +2625,11 @@ var main_O = /* @__PURE__ */ main_d((e, t)=>{
2636
2625
  }
2637
2626
  t.exports = i;
2638
2627
  });
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();
2628
+ var main_O = /* @__PURE__ */ main_u((e, t)=>{
2629
+ const n = main_d("path");
2630
+ const r = main_C();
2631
+ const i = main_w();
2632
+ const a = main_D();
2644
2633
  const o = "win32" === process.platform;
2645
2634
  const s = /\.(?:com|exe)$/i;
2646
2635
  const c = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
@@ -2676,7 +2665,7 @@ var main_k = /* @__PURE__ */ main_d((e, t)=>{
2676
2665
  }
2677
2666
  return e;
2678
2667
  }
2679
- function d(e, t, n) {
2668
+ function f(e, t, n) {
2680
2669
  if (t && !Array.isArray(t)) {
2681
2670
  n = t;
2682
2671
  t = null;
@@ -2695,9 +2684,9 @@ var main_k = /* @__PURE__ */ main_d((e, t)=>{
2695
2684
  };
2696
2685
  return n.shell ? r : u(r);
2697
2686
  }
2698
- t.exports = d;
2687
+ t.exports = f;
2699
2688
  });
2700
- var main_A = /* @__PURE__ */ main_d((e, t)=>{
2689
+ var main_k = /* @__PURE__ */ main_u((e, t)=>{
2701
2690
  const n = "win32" === process.platform;
2702
2691
  function r(e, t) {
2703
2692
  return Object.assign(/* @__PURE__ */ new Error(`${t} ${e.command} ENOENT`), {
@@ -2734,10 +2723,10 @@ var main_A = /* @__PURE__ */ main_d((e, t)=>{
2734
2723
  notFoundError: r
2735
2724
  };
2736
2725
  });
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();
2726
+ var main_A = /* @__PURE__ */ main_u((e, t)=>{
2727
+ const n = main_d("child_process");
2728
+ const r = main_O();
2729
+ const i = main_k();
2741
2730
  function a(e, t, a) {
2742
2731
  const o = r(e, t, a);
2743
2732
  const s = n.spawn(o.command, o.args, o.options);
@@ -2756,8 +2745,8 @@ var main_j = /* @__PURE__ */ main_d((e, t)=>{
2756
2745
  t.exports._parse = r;
2757
2746
  t.exports._enoent = i;
2758
2747
  });
2759
- var main_M = main_j();
2760
- var main_N = class extends Error {
2748
+ var main_j = main_A();
2749
+ var main_M = class extends Error {
2761
2750
  get exitCode() {
2762
2751
  if (null !== this.result.exitCode) return this.result.exitCode;
2763
2752
  }
@@ -2767,20 +2756,14 @@ var main_N = class extends Error {
2767
2756
  this.output = t;
2768
2757
  }
2769
2758
  };
2770
- const main_F = {
2759
+ const main_P = {
2771
2760
  timeout: void 0,
2772
2761
  persist: false
2773
2762
  };
2774
- const main_L = {
2763
+ const main_I = {
2775
2764
  windowsHide: true
2776
2765
  };
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) {
2766
+ function main_L(e) {
2784
2767
  const t = new AbortController();
2785
2768
  for (const n of e){
2786
2769
  if (n.aborted) {
@@ -2796,14 +2779,14 @@ function main_z(e) {
2796
2779
  }
2797
2780
  return t.signal;
2798
2781
  }
2799
- async function main_B(e) {
2782
+ async function main_R(e) {
2800
2783
  let t = "";
2801
2784
  try {
2802
2785
  for await (const n of e)t += n.toString();
2803
2786
  } catch {}
2804
2787
  return t;
2805
2788
  }
2806
- var main_V = class {
2789
+ var main_z = class {
2807
2790
  _process;
2808
2791
  _aborted = false;
2809
2792
  _options;
@@ -2823,7 +2806,7 @@ var main_V = class {
2823
2806
  }
2824
2807
  constructor(e, t, n){
2825
2808
  this._options = {
2826
- ...main_F,
2809
+ ...main_P,
2827
2810
  ...n
2828
2811
  };
2829
2812
  this._command = e;
@@ -2842,7 +2825,7 @@ var main_V = class {
2842
2825
  return this._process?.killed === true;
2843
2826
  }
2844
2827
  pipe(e, t, n) {
2845
- return main_W(e, t, {
2828
+ return main_H(e, t, {
2846
2829
  ...n,
2847
2830
  stdin: this
2848
2831
  });
@@ -2853,7 +2836,7 @@ var main_V = class {
2853
2836
  const t = [];
2854
2837
  if (this._streamErr) t.push(this._streamErr);
2855
2838
  if (this._streamOut) t.push(this._streamOut);
2856
- const n = main_v(t);
2839
+ const n = main_(t);
2857
2840
  const r = node_readline.createInterface({
2858
2841
  input: n
2859
2842
  });
@@ -2861,14 +2844,14 @@ var main_V = class {
2861
2844
  await this._processClosed;
2862
2845
  e.removeAllListeners();
2863
2846
  if (this._thrownError) throw this._thrownError;
2864
- if (this._options?.throwOnError && 0 !== this.exitCode && void 0 !== this.exitCode) throw new main_N(this);
2847
+ if (this._options?.throwOnError && 0 !== this.exitCode && void 0 !== this.exitCode) throw new main_M(this);
2865
2848
  }
2866
2849
  async _waitForOutput() {
2867
2850
  const e = this._process;
2868
2851
  if (!e) throw new Error("No process was started");
2869
2852
  const [t, n] = await Promise.all([
2870
- this._streamOut ? main_B(this._streamOut) : "",
2871
- this._streamErr ? main_B(this._streamErr) : ""
2853
+ this._streamOut ? main_R(this._streamOut) : "",
2854
+ this._streamErr ? main_R(this._streamErr) : ""
2872
2855
  ]);
2873
2856
  await this._processClosed;
2874
2857
  const { stdin: r } = this._options;
@@ -2880,7 +2863,7 @@ var main_V = class {
2880
2863
  stdout: t,
2881
2864
  exitCode: this.exitCode
2882
2865
  };
2883
- if (this._options.throwOnError && 0 !== this.exitCode && void 0 !== this.exitCode) throw new main_N(this, i);
2866
+ if (this._options.throwOnError && 0 !== this.exitCode && void 0 !== this.exitCode) throw new main_M(this, i);
2884
2867
  return i;
2885
2868
  }
2886
2869
  then(e, t) {
@@ -2891,29 +2874,28 @@ var main_V = class {
2891
2874
  spawn() {
2892
2875
  const e = external_node_process_cwd();
2893
2876
  const n = this._options;
2894
- const r = {
2895
- ...main_L,
2877
+ const i = {
2878
+ ...main_I,
2896
2879
  ...n.nodeOptions
2897
2880
  };
2898
- const i = [];
2881
+ const a = [];
2899
2882
  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) {
2883
+ if (void 0 !== n.timeout) a.push(AbortSignal.timeout(n.timeout));
2884
+ if (void 0 !== n.signal) a.push(n.signal);
2885
+ if (true === n.persist) i.detached = true;
2886
+ if (a.length > 0) i.signal = main_L(a);
2887
+ i.env = main_g(e, i.env);
2888
+ const o = (0, main_j._parse)(this._command, this._args, i);
2889
+ const s = spawn(o.command, o.args, o.options);
2890
+ if (s.stderr) this._streamErr = s.stderr;
2891
+ if (s.stdout) this._streamOut = s.stdout;
2892
+ this._process = s;
2893
+ s.once("error", this._onError);
2894
+ s.once("close", this._onClose);
2895
+ if (s.stdin) {
2914
2896
  const { stdin: e } = n;
2915
- if ("string" == typeof e) l.stdin.end(e);
2916
- else e?.process?.stdout?.pipe(l.stdin);
2897
+ if ("string" == typeof e) s.stdin.end(e);
2898
+ else e?.process?.stdout?.pipe(s.stdin);
2917
2899
  }
2918
2900
  }
2919
2901
  _resetState() {
@@ -2934,12 +2916,12 @@ var main_V = class {
2934
2916
  if (this._resolveClose) this._resolveClose();
2935
2917
  };
2936
2918
  };
2937
- const main_U = (e, t, n)=>{
2938
- const r = new main_V(e, t, n);
2919
+ const main_V = (e, t, n)=>{
2920
+ const r = new main_z(e, t, n);
2939
2921
  r.spawn();
2940
2922
  return r;
2941
2923
  };
2942
- const main_W = main_U;
2924
+ const main_H = main_V;
2943
2925
  const NPM_TEMPLATE_PREFIX = 'npm:';
2944
2926
  const VALID_NPM_NAME = /^(@[\w.-]+\/)?[\w.-]+$/;
2945
2927
  const VALID_NPM_VERSION = /^[\w.\-+^~>=<* ]+$/;
@@ -3033,7 +3015,7 @@ var minimist_default = /*#__PURE__*/ __webpack_require__.n(minimist);
3033
3015
  const src_filename = fileURLToPath(import.meta.url);
3034
3016
  const src_dirname = dirname(src_filename);
3035
3017
  function cancelAndExit() {
3036
- pt('Operation cancelled.');
3018
+ me('Operation cancelled.');
3037
3019
  process.exit(0);
3038
3020
  }
3039
3021
  function checkCancel(value) {
@@ -3129,12 +3111,12 @@ async function getTools({ tools, dir, template }, extraTools, templateName) {
3129
3111
  if (dir && template) return [];
3130
3112
  const options = [
3131
3113
  {
3132
- value: 'eslint',
3133
- label: 'ESLint - linting'
3114
+ value: 'rslint',
3115
+ label: 'Rslint - linting'
3134
3116
  },
3135
3117
  {
3136
- value: 'rslint',
3137
- label: 'Rslint - linting (experimental)'
3118
+ value: 'eslint',
3119
+ label: 'ESLint - linting'
3138
3120
  },
3139
3121
  {
3140
3122
  value: 'prettier',
@@ -3154,7 +3136,7 @@ async function getTools({ tools, dir, template }, extraTools, templateName) {
3154
3136
  options.unshift(...filteredExtraTools.filter((tool)=>'pre' === tool.order).map(normalize));
3155
3137
  options.push(...filteredExtraTools.filter((tool)=>'pre' !== tool.order).map(normalize));
3156
3138
  }
3157
- return checkCancel(await yt({
3139
+ return checkCancel(await ve({
3158
3140
  message: 'Select additional tools (Use <space> to select, <enter> to continue)',
3159
3141
  options,
3160
3142
  required: false
@@ -3177,7 +3159,7 @@ function orderExtraSkills(extraSkills) {
3177
3159
  ...extraSkills.filter((extraSkill)=>'post' === extraSkill.order)
3178
3160
  ];
3179
3161
  }
3180
- async function getSkills({ skill, dir, template }, extraSkills, templateName, tools = [], promptMultiselect = yt) {
3162
+ async function getSkills({ skill, dir, template }, extraSkills, templateName, tools = [], promptMultiselect = ve) {
3181
3163
  const parsedSkills = parseSkillsOption(skill);
3182
3164
  const filteredExtraSkills = filterExtraSkills(extraSkills, templateName, tools);
3183
3165
  if (null !== parsedSkills) return parsedSkills.filter((value)=>extraSkills?.some((extraSkill)=>extraSkill.value === value));
@@ -3224,7 +3206,7 @@ async function runCommand(command, cwd, packageManager) {
3224
3206
  if (replacement) command = command.replace('npm create ', replacement).replace(' -- --', ' --');
3225
3207
  if ('yarn' === packageManager) command = command.replace('@latest', '');
3226
3208
  }
3227
- const result = await main_U(command, [], {
3209
+ const result = await main_V(command, [], {
3228
3210
  nodeOptions: {
3229
3211
  shell: true,
3230
3212
  stdio: 'inherit',
@@ -3257,13 +3239,13 @@ async function runSkillCommand(skills, cwd) {
3257
3239
  ...installArgs
3258
3240
  ];
3259
3241
  const command = `npx ${args.join(' ')}`;
3260
- dist_O.info(`Running skill install command: ${color.dim(command)}`);
3242
+ dist_R.info(`Running skill install command: ${color.dim(command)}`);
3261
3243
  const skillLabel = skills.map((skill)=>skill.value).join(', ');
3262
3244
  const skillNoun = 1 === skills.length ? 'skill' : 'skills';
3263
- const installationTaskLog = Gt({
3245
+ const installationTaskLog = Me({
3264
3246
  title: `Installing ${skillNoun} ${skillLabel}`
3265
3247
  });
3266
- const proc = main_U('npx', args, {
3248
+ const proc = main_V('npx', args, {
3267
3249
  nodeOptions: {
3268
3250
  cwd,
3269
3251
  stdio: 'pipe'
@@ -3286,10 +3268,10 @@ function logNextStepsAndOutro(noteInformation, targetDir, packageManager) {
3286
3268
  `3. ${color.cyan(`${packageManager} install`)}`,
3287
3269
  `4. ${color.cyan(`${packageManager} run dev`)}`
3288
3270
  ];
3289
- if (nextSteps.length) wt(nextSteps.map((step)=>color.reset(step)).join('\n'), 'Next steps');
3290
- gt('All set, happy coding!');
3271
+ if (nextSteps.length) Se(nextSteps.map((step)=>color.reset(step)).join('\n'), 'Next steps');
3272
+ ye('All set, happy coding!');
3291
3273
  }
3292
- async function create({ name, root, templates, skipFiles, getTemplateName, mapESLintTemplate, version, noteInformation, extraTools, extraSkills, argv: processArgv = process.argv }) {
3274
+ async function create({ name, root, templates, skipFiles, getTemplateName, mapESLintTemplate, mapRslintTemplate, version, noteInformation, extraTools, extraSkills, argv: processArgv = process.argv }) {
3293
3275
  src_logger.greet(`\n◆ Create ${upperFirst(name)} Project`);
3294
3276
  const { isAgent } = await (0, dist_0.determineAgent)();
3295
3277
  if (isAgent) {
@@ -3305,7 +3287,7 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
3305
3287
  packageManager
3306
3288
  };
3307
3289
  if (!version) version = (await readPackageJson(root)).version;
3308
- const projectName = argv.dir ?? checkCancel(await Ot({
3290
+ const projectName = argv.dir ?? checkCancel(await Re({
3309
3291
  message: 'Project name or path',
3310
3292
  placeholder: `${name.toLowerCase()}-project`,
3311
3293
  defaultValue: `${name.toLowerCase()}-project`,
@@ -3318,7 +3300,7 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
3318
3300
  const packageName = argv.packageName || formatted.packageName;
3319
3301
  const distFolder = node_path.isAbsolute(targetDir) ? targetDir : node_path.join(cwd, targetDir);
3320
3302
  if (!argv.override && node_fs.existsSync(distFolder) && !isEmptyDir(distFolder)) {
3321
- const option = checkCancel(await _t({
3303
+ const option = checkCancel(await Ee({
3322
3304
  message: `"${targetDir}" is not empty, please choose:`,
3323
3305
  options: [
3324
3306
  {
@@ -3352,7 +3334,7 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
3352
3334
  return;
3353
3335
  }
3354
3336
  const tools = await getTools(argv, extraTools, templateName);
3355
- const skills = await getSkills(argv, extraSkills, templateName, tools, yt);
3337
+ const skills = await getSkills(argv, extraSkills, templateName, tools, ve);
3356
3338
  const commonFolder = node_path.join(root, 'template-common');
3357
3339
  if (!node_fs.existsSync(srcFolder)) throw new Error(`Invalid input: template "${templateName}" not found.`);
3358
3340
  copyFolder({
@@ -3423,6 +3405,24 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
3423
3405
  agentsMdSearchDirs.push(subFolder);
3424
3406
  continue;
3425
3407
  }
3408
+ if ('rslint' === tool) {
3409
+ const rslintTemplateName = mapRslintTemplate ? mapRslintTemplate(templateName, {
3410
+ distFolder
3411
+ }) : 'vanilla-ts';
3412
+ if (!rslintTemplateName) continue;
3413
+ const subFolder = node_path.join(toolFolder, rslintTemplateName);
3414
+ copyFolder({
3415
+ from: subFolder,
3416
+ to: distFolder,
3417
+ version,
3418
+ skipFiles,
3419
+ templateParameters,
3420
+ isMergePackageJson: true
3421
+ });
3422
+ agentsMdSearchDirs.push(toolFolder);
3423
+ agentsMdSearchDirs.push(subFolder);
3424
+ continue;
3425
+ }
3426
3426
  copyFolder({
3427
3427
  from: toolFolder,
3428
3428
  to: distFolder,
@@ -3603,4 +3603,4 @@ function collectAgentsFiles(agentsMdSearchDirs) {
3603
3603
  }
3604
3604
  return agentsFiles;
3605
3605
  }
3606
- 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 };
3606
+ export { At as autocomplete, BUILTIN_TOOLS, Ee as select, Re as text, checkCancel, collectAgentsFiles, copyFolder, create, isNpmTemplate, mergeAgentsFiles, mergePackageJson, pe as groupMultiselect, resolveCustomTemplate, resolveNpmTemplate, sanitizeCacheKey, ve as multiselect };