@jannael/glinter 1.2.4 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +102 -102
  2. package/dist/index.js +914 -693
  3. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -174,10 +174,10 @@ function errorHandler(error) {
174
174
  }
175
175
 
176
176
  // node_modules/@clack/core/dist/index.mjs
177
- import { styleText as v } from "util";
178
- import { stdout as x, stdin as D } from "process";
179
- import * as b from "readline";
180
- import E from "readline";
177
+ import { styleText } from "util";
178
+ import { stdout, stdin } from "process";
179
+ import * as l from "readline";
180
+ import l__default from "readline";
181
181
 
182
182
  // node_modules/fast-string-truncated-width/dist/utils.js
183
183
  var getCodePointsLength = (() => {
@@ -522,96 +522,162 @@ function wrapAnsi(string, columns, options) {
522
522
 
523
523
  // node_modules/@clack/core/dist/index.mjs
524
524
  var import_sisteransi = __toESM(require_src(), 1);
525
- import { ReadStream as O } from "tty";
526
- function f(r, t, s) {
527
- if (!s.some((o) => !o.disabled))
528
- return r;
529
- const e = r + t, i = Math.max(s.length - 1, 0), n = e < 0 ? i : e > i ? 0 : e;
530
- return s[n].disabled ? f(n, t < 0 ? -1 : 1, s) : n;
531
- }
532
- function I(r, t, s, e) {
533
- const i = e.split(`
525
+ import { ReadStream } from "tty";
526
+ function findCursor(s, o, l2) {
527
+ if (!l2.some((r) => !r.disabled))
528
+ return s;
529
+ const t = s + o, n = Math.max(l2.length - 1, 0), e = t < 0 ? n : t > n ? 0 : t;
530
+ return l2[e].disabled ? findCursor(e, o < 0 ? -1 : 1, l2) : e;
531
+ }
532
+ function findTextCursor(s, o, l2, i) {
533
+ const t = i.split(`
534
534
  `);
535
- let n = 0, o = r;
536
- for (const a of i) {
537
- if (o <= a.length)
535
+ let n = 0, e = s;
536
+ for (const r of t) {
537
+ if (e <= r.length)
538
538
  break;
539
- o -= a.length + 1, n++;
540
- }
541
- for (n = Math.max(0, Math.min(i.length - 1, n + s)), o = Math.min(o, i[n].length) + t;o < 0 && n > 0; )
542
- n--, o += i[n].length + 1;
543
- for (;o > i[n].length && n < i.length - 1; )
544
- o -= i[n].length + 1, n++;
545
- o = Math.max(0, Math.min(i[n].length, o));
546
- let u = 0;
547
- for (let a = 0;a < n; a++)
548
- u += i[a].length + 1;
549
- return u + o;
550
- }
551
- var G = ["up", "down", "left", "right", "space", "enter", "cancel"];
552
- var K = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
553
- var h = { actions: new Set(G), aliases: new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["\x03", "cancel"], ["escape", "cancel"]]), messages: { cancel: "Canceled", error: "Something went wrong" }, withGuide: true, date: { monthNames: [...K], messages: { required: "Please enter a valid date", invalidMonth: "There are only 12 months in a year", invalidDay: (r, t) => `There are only ${r} days in ${t}`, afterMin: (r) => `Date must be on or after ${r.toISOString().slice(0, 10)}`, beforeMax: (r) => `Date must be on or before ${r.toISOString().slice(0, 10)}` } } };
554
- function C(r, t) {
555
- if (typeof r == "string")
556
- return h.aliases.get(r) === t;
557
- for (const s of r)
558
- if (s !== undefined && C(s, t))
539
+ e -= r.length + 1, n++;
540
+ }
541
+ for (n = Math.max(0, Math.min(t.length - 1, n + l2)), e = Math.min(e, t[n].length) + o;e < 0 && n > 0; )
542
+ n--, e += t[n].length + 1;
543
+ for (;e > t[n].length && n < t.length - 1; )
544
+ e -= t[n].length + 1, n++;
545
+ e = Math.max(0, Math.min(t[n].length, e));
546
+ let h = 0;
547
+ for (let r = 0;r < n; r++)
548
+ h += t[r].length + 1;
549
+ return h + e;
550
+ }
551
+ var a$2 = ["up", "down", "left", "right", "space", "enter", "cancel"];
552
+ var t = [
553
+ "January",
554
+ "February",
555
+ "March",
556
+ "April",
557
+ "May",
558
+ "June",
559
+ "July",
560
+ "August",
561
+ "September",
562
+ "October",
563
+ "November",
564
+ "December"
565
+ ];
566
+ var settings = {
567
+ actions: new Set(a$2),
568
+ aliases: /* @__PURE__ */ new Map([
569
+ ["k", "up"],
570
+ ["j", "down"],
571
+ ["h", "left"],
572
+ ["l", "right"],
573
+ ["\x03", "cancel"],
574
+ ["escape", "cancel"]
575
+ ]),
576
+ messages: {
577
+ cancel: "Canceled",
578
+ error: "Something went wrong"
579
+ },
580
+ withGuide: true,
581
+ date: {
582
+ monthNames: [...t],
583
+ messages: {
584
+ required: "Please enter a valid date",
585
+ invalidMonth: "There are only 12 months in a year",
586
+ invalidDay: (n, e) => `There are only ${n} days in ${e}`,
587
+ afterMin: (n) => `Date must be on or after ${n.toISOString().slice(0, 10)}`,
588
+ beforeMax: (n) => `Date must be on or before ${n.toISOString().slice(0, 10)}`
589
+ }
590
+ }
591
+ };
592
+ function isActionKey(n, e) {
593
+ if (typeof n == "string")
594
+ return settings.aliases.get(n) === e;
595
+ for (const s of n)
596
+ if (s !== undefined && isActionKey(s, e))
559
597
  return true;
560
598
  return false;
561
599
  }
562
- function z(r, t) {
563
- if (r === t)
600
+ function diffLines(i, s) {
601
+ if (i === s)
564
602
  return;
565
- const s = r.split(`
566
- `), e = t.split(`
567
- `), i = Math.max(s.length, e.length), n = [];
568
- for (let o = 0;o < i; o++)
569
- s[o] !== e[o] && n.push(o);
570
- return { lines: n, numLinesBefore: s.length, numLinesAfter: e.length, numLines: i };
571
- }
572
- var Y = globalThis.process.platform.startsWith("win");
573
- var k = Symbol("clack:cancel");
574
- function q(r) {
575
- return r === k;
576
- }
577
- function w(r, t) {
578
- const s = r;
579
- s.isTTY && s.setRawMode(t);
580
- }
581
- function R({ input: r = D, output: t = x, overwrite: s = true, hideCursor: e = true } = {}) {
582
- const i = b.createInterface({ input: r, output: t, prompt: "", tabSize: 1 });
583
- b.emitKeypressEvents(r, i), r instanceof O && r.isTTY && r.setRawMode(true);
584
- const n = (o, { name: u, sequence: a }) => {
585
- const l = String(o);
586
- if (C([l, u, a], "cancel")) {
587
- e && t.write(import_sisteransi.cursor.show), process.exit(0);
603
+ const e = i.split(`
604
+ `), t2 = s.split(`
605
+ `), r = Math.max(e.length, t2.length), f = [];
606
+ for (let n = 0;n < r; n++)
607
+ e[n] !== t2[n] && f.push(n);
608
+ return {
609
+ lines: f,
610
+ numLinesBefore: e.length,
611
+ numLinesAfter: t2.length,
612
+ numLines: r
613
+ };
614
+ }
615
+ var R = globalThis.process.platform.startsWith("win");
616
+ var CANCEL_SYMBOL = Symbol("clack:cancel");
617
+ function isCancel(e) {
618
+ return e === CANCEL_SYMBOL;
619
+ }
620
+ function setRawMode(e, r) {
621
+ const o = e;
622
+ o.isTTY && o.setRawMode(r);
623
+ }
624
+ function block({
625
+ input: e = stdin,
626
+ output: r = stdout,
627
+ overwrite: o = true,
628
+ hideCursor: t2 = true
629
+ } = {}) {
630
+ const s = l.createInterface({
631
+ input: e,
632
+ output: r,
633
+ prompt: "",
634
+ tabSize: 1
635
+ });
636
+ l.emitKeypressEvents(e, s), e instanceof ReadStream && e.isTTY && e.setRawMode(true);
637
+ const n = (f, { name: a, sequence: p }) => {
638
+ const c = String(f);
639
+ if (isActionKey([c, a, p], "cancel")) {
640
+ t2 && r.write(import_sisteransi.cursor.show), process.exit(0);
588
641
  return;
589
642
  }
590
- if (!s)
643
+ if (!o)
591
644
  return;
592
- const c = u === "return" ? 0 : -1, y = u === "return" ? -1 : 0;
593
- b.moveCursor(t, c, y, () => {
594
- b.clearLine(t, 1, () => {
595
- r.once("keypress", n);
645
+ const i = a === "return" ? 0 : -1, m = a === "return" ? -1 : 0;
646
+ l.moveCursor(r, i, m, () => {
647
+ l.clearLine(r, 1, () => {
648
+ e.once("keypress", n);
596
649
  });
597
650
  });
598
651
  };
599
- return e && t.write(import_sisteransi.cursor.hide), r.once("keypress", n), () => {
600
- r.off("keypress", n), e && t.write(import_sisteransi.cursor.show), r instanceof O && r.isTTY && !Y && r.setRawMode(false), i.terminal = false, i.close();
652
+ return t2 && r.write(import_sisteransi.cursor.hide), e.once("keypress", n), () => {
653
+ e.off("keypress", n), t2 && r.write(import_sisteransi.cursor.show), e instanceof ReadStream && e.isTTY && !R && e.setRawMode(false), s.terminal = false, s.close();
601
654
  };
602
655
  }
603
- var A = (r) => ("columns" in r) && typeof r.columns == "number" ? r.columns : 80;
604
- var L = (r) => ("rows" in r) && typeof r.rows == "number" ? r.rows : 20;
605
- function W(r, t, s, e = s, i = s, n) {
606
- const o = A(r ?? x);
607
- return wrapAnsi(t, o - s.length, { hard: true, trim: false }).split(`
608
- `).map((u, a, l) => {
609
- const c = n ? n(u, a) : u;
610
- return a === 0 ? `${e}${c}` : a === l.length - 1 ? `${i}${c}` : `${s}${c}`;
656
+ var getColumns = (e) => ("columns" in e) && typeof e.columns == "number" ? e.columns : 80;
657
+ var getRows = (e) => ("rows" in e) && typeof e.rows == "number" ? e.rows : 20;
658
+ function wrapTextWithPrefix(e, r, o, t2 = o, s = o, n) {
659
+ const f = getColumns(e ?? stdout);
660
+ return wrapAnsi(r, f - o.length, {
661
+ hard: true,
662
+ trim: false
663
+ }).split(`
664
+ `).map((c, i, m) => {
665
+ const d = n ? n(c, i) : c;
666
+ return i === 0 ? `${t2}${d}` : i === m.length - 1 ? `${s}${d}` : `${o}${d}`;
611
667
  }).join(`
612
668
  `);
613
669
  }
614
- var m = class {
670
+ function runValidation(e, n) {
671
+ if ("~standard" in e) {
672
+ const a = e["~standard"].validate(n);
673
+ if (a instanceof Promise)
674
+ throw new TypeError("Schema validation must be synchronous. Update `validate()` and remove any asynchronous logic.");
675
+ return a.issues?.at(0)?.message;
676
+ }
677
+ return e(n);
678
+ }
679
+
680
+ class V {
615
681
  input;
616
682
  output;
617
683
  _abortSignal;
@@ -620,270 +686,305 @@ var m = class {
620
686
  _render;
621
687
  _track = false;
622
688
  _prevFrame = "";
623
- _subscribers = new Map;
689
+ _subscribers = /* @__PURE__ */ new Map;
624
690
  _cursor = 0;
625
691
  state = "initial";
626
692
  error = "";
627
693
  value;
628
694
  userInput = "";
629
- constructor(t, s = true) {
630
- const { input: e = D, output: i = x, render: n, signal: o, ...u } = t;
631
- this.opts = u, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = n.bind(this), this._track = s, this._abortSignal = o, this.input = e, this.output = i;
695
+ constructor(t2, e = true) {
696
+ const { input: i = stdin, output: n = stdout, render: s, signal: r, ...o } = t2;
697
+ this.opts = o, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = s.bind(this), this._track = e, this._abortSignal = r, this.input = i, this.output = n;
632
698
  }
633
699
  unsubscribe() {
634
700
  this._subscribers.clear();
635
701
  }
636
- setSubscriber(t, s) {
637
- const e = this._subscribers.get(t) ?? [];
638
- e.push(s), this._subscribers.set(t, e);
702
+ setSubscriber(t2, e) {
703
+ const i = this._subscribers.get(t2) ?? [];
704
+ i.push(e), this._subscribers.set(t2, i);
639
705
  }
640
- on(t, s) {
641
- this.setSubscriber(t, { cb: s });
706
+ on(t2, e) {
707
+ this.setSubscriber(t2, { cb: e });
642
708
  }
643
- once(t, s) {
644
- this.setSubscriber(t, { cb: s, once: true });
709
+ once(t2, e) {
710
+ this.setSubscriber(t2, { cb: e, once: true });
645
711
  }
646
- emit(t, ...s) {
647
- const e = this._subscribers.get(t) ?? [], i = [];
648
- for (const n of e)
649
- n.cb(...s), n.once && i.push(() => e.splice(e.indexOf(n), 1));
650
- for (const n of i)
651
- n();
712
+ emit(t2, ...e) {
713
+ const i = this._subscribers.get(t2) ?? [], n = [];
714
+ for (const s of i)
715
+ s.cb(...e), s.once && n.push(() => i.splice(i.indexOf(s), 1));
716
+ for (const s of n)
717
+ s();
652
718
  }
653
719
  prompt() {
654
- return new Promise((t) => {
720
+ return new Promise((t2) => {
655
721
  if (this._abortSignal) {
656
722
  if (this._abortSignal.aborted)
657
- return this.state = "cancel", this.close(), t(k);
723
+ return this.state = "cancel", this.close(), t2(CANCEL_SYMBOL);
658
724
  this._abortSignal.addEventListener("abort", () => {
659
725
  this.state = "cancel", this.close();
660
726
  }, { once: true });
661
727
  }
662
- this.rl = E.createInterface({ input: this.input, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), this.rl.prompt(), this.opts.initialUserInput !== undefined && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), w(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
663
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t(this.value);
728
+ this.rl = l__default.createInterface({
729
+ input: this.input,
730
+ tabSize: 2,
731
+ prompt: "",
732
+ escapeCodeTimeout: 50,
733
+ terminal: true
734
+ }), this.rl.prompt(), this.opts.initialUserInput !== undefined && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), setRawMode(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
735
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(this.value);
664
736
  }), this.once("cancel", () => {
665
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t(k);
737
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(CANCEL_SYMBOL);
666
738
  });
667
739
  });
668
740
  }
669
- _isActionKey(t, s) {
670
- return t === "\t";
741
+ _isActionKey(t2, e) {
742
+ return t2 === "\t";
671
743
  }
672
- _shouldSubmit(t, s) {
744
+ _shouldSubmit(t2, e) {
673
745
  return true;
674
746
  }
675
- _setValue(t) {
676
- this.value = t, this.emit("value", this.value);
747
+ _setValue(t2) {
748
+ this.value = t2, this.emit("value", this.value);
677
749
  }
678
- _setUserInput(t, s) {
679
- this.userInput = t ?? "", this.emit("userInput", this.userInput), s && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
750
+ _setUserInput(t2, e) {
751
+ this.userInput = t2 ?? "", this.emit("userInput", this.userInput), e && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
680
752
  }
681
753
  _clearUserInput() {
682
754
  this.rl?.write(null, { ctrl: true, name: "u" }), this._setUserInput("");
683
755
  }
684
- onKeypress(t, s) {
685
- if (this._track && s.name !== "return" && (s.name && this._isActionKey(t, s) && this.rl?.write(null, { ctrl: true, name: "h" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), s?.name && (!this._track && h.aliases.has(s.name) && this.emit("cursor", h.aliases.get(s.name)), h.actions.has(s.name) && this.emit("cursor", s.name)), t && (t.toLowerCase() === "y" || t.toLowerCase() === "n") && this.emit("confirm", t.toLowerCase() === "y"), this.emit("key", t?.toLowerCase(), s), s?.name === "return" && this._shouldSubmit(t, s)) {
756
+ onKeypress(t2, e) {
757
+ if (this._track && e.name !== "return" && (e.name && this._isActionKey(t2, e) && this.rl?.write(null, { ctrl: true, name: "h" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), e?.name && (!this._track && settings.aliases.has(e.name) && this.emit("cursor", settings.aliases.get(e.name)), settings.actions.has(e.name) && this.emit("cursor", e.name)), t2 && (t2.toLowerCase() === "y" || t2.toLowerCase() === "n") && this.emit("confirm", t2.toLowerCase() === "y"), this.emit("key", t2, e), e?.name === "return" && this._shouldSubmit(t2, e)) {
686
758
  if (this.opts.validate) {
687
- const e = this.opts.validate(this.value);
688
- e && (this.error = e instanceof Error ? e.message : e, this.state = "error", this.rl?.write(this.userInput));
759
+ const i = runValidation(this.opts.validate, this.value);
760
+ i && (this.error = i instanceof Error ? i.message : i, this.state = "error", this.rl?.write(this.userInput));
689
761
  }
690
762
  this.state !== "error" && (this.state = "submit");
691
763
  }
692
- C([t, s?.name, s?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
764
+ isActionKey([t2, e?.name, e?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
693
765
  }
694
766
  close() {
695
767
  this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
696
- `), w(this.input, false), this.rl?.close(), this.rl = undefined, this.emit(`${this.state}`, this.value), this.unsubscribe();
768
+ `), setRawMode(this.input, false), this.rl?.close(), this.rl = undefined, this.emit(`${this.state}`, this.value), this.unsubscribe();
697
769
  }
698
770
  restoreCursor() {
699
- const t = wrapAnsi(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split(`
771
+ const t2 = wrapAnsi(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split(`
700
772
  `).length - 1;
701
- this.output.write(import_sisteransi.cursor.move(-999, t * -1));
773
+ this.output.write(import_sisteransi.cursor.move(-999, t2 * -1));
702
774
  }
703
775
  render() {
704
- const t = wrapAnsi(this._render(this) ?? "", process.stdout.columns, { hard: true, trim: false });
705
- if (t !== this._prevFrame) {
776
+ const t2 = wrapAnsi(this._render(this) ?? "", process.stdout.columns, {
777
+ hard: true,
778
+ trim: false
779
+ });
780
+ if (t2 !== this._prevFrame) {
706
781
  if (this.state === "initial")
707
782
  this.output.write(import_sisteransi.cursor.hide);
708
783
  else {
709
- const s = z(this._prevFrame, t), e = L(this.output);
710
- if (this.restoreCursor(), s) {
711
- const i = Math.max(0, s.numLinesAfter - e), n = Math.max(0, s.numLinesBefore - e);
712
- let o = s.lines.find((u) => u >= i);
713
- if (o === undefined) {
714
- this._prevFrame = t;
784
+ const e = diffLines(this._prevFrame, t2), i = getRows(this.output);
785
+ if (this.restoreCursor(), e) {
786
+ const n = Math.max(0, e.numLinesAfter - i), s = Math.max(0, e.numLinesBefore - i);
787
+ let r = e.lines.find((o) => o >= n);
788
+ if (r === undefined) {
789
+ this._prevFrame = t2;
715
790
  return;
716
791
  }
717
- if (s.lines.length === 1) {
718
- this.output.write(import_sisteransi.cursor.move(0, o - n)), this.output.write(import_sisteransi.erase.lines(1));
719
- const u = t.split(`
792
+ if (e.lines.length === 1) {
793
+ this.output.write(import_sisteransi.cursor.move(0, r - s)), this.output.write(import_sisteransi.erase.lines(1));
794
+ const o = t2.split(`
720
795
  `);
721
- this.output.write(u[o]), this._prevFrame = t, this.output.write(import_sisteransi.cursor.move(0, u.length - o - 1));
796
+ this.output.write(o[r]), this._prevFrame = t2, this.output.write(import_sisteransi.cursor.move(0, o.length - r - 1));
722
797
  return;
723
- } else if (s.lines.length > 1) {
724
- if (i < n)
725
- o = i;
798
+ } else if (e.lines.length > 1) {
799
+ if (n < s)
800
+ r = n;
726
801
  else {
727
- const a = o - n;
728
- a > 0 && this.output.write(import_sisteransi.cursor.move(0, a));
802
+ const h = r - s;
803
+ h > 0 && this.output.write(import_sisteransi.cursor.move(0, h));
729
804
  }
730
805
  this.output.write(import_sisteransi.erase.down());
731
- const u = t.split(`
732
- `).slice(o);
733
- this.output.write(u.join(`
734
- `)), this._prevFrame = t;
806
+ const f = t2.split(`
807
+ `).slice(r);
808
+ this.output.write(f.join(`
809
+ `)), this._prevFrame = t2;
735
810
  return;
736
811
  }
737
812
  }
738
813
  this.output.write(import_sisteransi.erase.down());
739
814
  }
740
- this.output.write(t), this.state === "initial" && (this.state = "active"), this._prevFrame = t;
815
+ this.output.write(t2), this.state === "initial" && (this.state = "active"), this._prevFrame = t2;
741
816
  }
742
817
  }
743
- };
744
- function B(r, t) {
745
- if (r === undefined || t.length === 0)
818
+ }
819
+ function p$1(l2, e) {
820
+ if (l2 === undefined || e.length === 0)
746
821
  return 0;
747
- const s = t.findIndex((e) => e.value === r);
748
- return s !== -1 ? s : 0;
822
+ const i = e.findIndex((s) => s.value === l2);
823
+ return i !== -1 ? i : 0;
749
824
  }
750
- function J(r, t) {
751
- return (t.label ?? String(t.value)).toLowerCase().includes(r.toLowerCase());
825
+ function g(l2, e) {
826
+ return (e.label ?? String(e.value)).toLowerCase().includes(l2.toLowerCase());
752
827
  }
753
- function H(r, t) {
754
- if (t)
755
- return r ? t : t[0];
828
+ function m(l2, e) {
829
+ if (e)
830
+ return l2 ? e : e[0];
756
831
  }
757
- var Q = class extends m {
832
+ var T$1 = class T extends V {
758
833
  filteredOptions;
759
834
  multiple;
760
835
  isNavigating = false;
761
836
  selectedValues = [];
762
837
  focusedValue;
763
- #s = 0;
764
- #r = "";
838
+ #e = 0;
839
+ #s = "";
765
840
  #t;
841
+ #i;
766
842
  #n;
767
- #u;
768
843
  get cursor() {
769
- return this.#s;
844
+ return this.#e;
770
845
  }
771
846
  get userInputWithCursor() {
772
847
  if (!this.userInput)
773
- return v(["inverse", "hidden"], "_");
848
+ return styleText(["inverse", "hidden"], "_");
774
849
  if (this._cursor >= this.userInput.length)
775
850
  return `${this.userInput}\u2588`;
776
- const t = this.userInput.slice(0, this._cursor), [s, ...e] = this.userInput.slice(this._cursor);
777
- return `${t}${v("inverse", s)}${e.join("")}`;
851
+ const e = this.userInput.slice(0, this._cursor), [t2, ...i] = this.userInput.slice(this._cursor);
852
+ return `${e}${styleText("inverse", t2)}${i.join("")}`;
778
853
  }
779
854
  get options() {
780
- return typeof this.#n == "function" ? this.#n() : this.#n;
781
- }
782
- constructor(t) {
783
- super(t), this.#n = t.options, this.#u = t.placeholder;
784
- const s = this.options;
785
- this.filteredOptions = [...s], this.multiple = t.multiple === true, this.#t = typeof t.options == "function" ? t.filter : t.filter ?? J;
786
- let e;
787
- if (t.initialValue && Array.isArray(t.initialValue) ? this.multiple ? e = t.initialValue : e = t.initialValue.slice(0, 1) : !this.multiple && this.options.length > 0 && (e = [this.options[0].value]), e)
788
- for (const i of e) {
789
- const n = s.findIndex((o) => o.value === i);
790
- n !== -1 && (this.toggleSelected(i), this.#s = n);
855
+ return typeof this.#i == "function" ? this.#i() : this.#i;
856
+ }
857
+ constructor(e) {
858
+ super(e), this.#i = e.options, this.#n = e.placeholder;
859
+ const t2 = this.options;
860
+ this.filteredOptions = [...t2], this.multiple = e.multiple === true, this.#t = typeof e.options == "function" ? e.filter : e.filter ?? g;
861
+ let i;
862
+ if (e.initialValue && Array.isArray(e.initialValue) ? this.multiple ? i = e.initialValue : i = e.initialValue.slice(0, 1) : !this.multiple && this.options.length > 0 && (i = [this.options[0].value]), i)
863
+ for (const s of i) {
864
+ const n = t2.findIndex((o) => o.value === s);
865
+ n !== -1 && (this.toggleSelected(s), this.#e = n);
791
866
  }
792
- this.focusedValue = this.options[this.#s]?.value, this.on("key", (i, n) => this.#e(i, n)), this.on("userInput", (i) => this.#i(i));
867
+ this.focusedValue = this.options[this.#e]?.value, this.on("key", (s, n) => this.#l(s, n)), this.on("userInput", (s) => this.#u(s));
793
868
  }
794
- _isActionKey(t, s) {
795
- return t === "\t" || this.multiple && this.isNavigating && s.name === "space" && t !== undefined && t !== "";
869
+ _isActionKey(e, t2) {
870
+ return e === "\t" || this.multiple && this.isNavigating && t2.name === "space" && e !== undefined && e !== "";
796
871
  }
797
- #e(t, s) {
798
- const e = s.name === "up", i = s.name === "down", n = s.name === "return", o = this.userInput === "" || this.userInput === "\t", u = this.#u, a = this.options, l = u !== undefined && u !== "" && a.some((c) => !c.disabled && (this.#t ? this.#t(u, c) : true));
799
- if (s.name === "tab" && o && l) {
872
+ #l(e, t2) {
873
+ const i = t2.name === "up", s = t2.name === "down", n = t2.name === "return", o = this.userInput === "" || this.userInput === "\t", u = this.#n, h = this.options, f = u !== undefined && u !== "" && h.some((r) => !r.disabled && (this.#t ? this.#t(u, r) : true));
874
+ if (t2.name === "tab" && o && f) {
800
875
  this.userInput === "\t" && this._clearUserInput(), this._setUserInput(u, true), this.isNavigating = false;
801
876
  return;
802
877
  }
803
- e || i ? (this.#s = f(this.#s, e ? -1 : 1, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#s]?.value, this.multiple || (this.selectedValues = [this.focusedValue]), this.isNavigating = true) : n ? this.value = H(this.multiple, this.selectedValues) : this.multiple ? this.focusedValue !== undefined && (s.name === "tab" || this.isNavigating && s.name === "space") ? this.toggleSelected(this.focusedValue) : this.isNavigating = false : (this.focusedValue && (this.selectedValues = [this.focusedValue]), this.isNavigating = false);
878
+ i || s ? (this.#e = findCursor(this.#e, i ? -1 : 1, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#e]?.value, this.multiple || (this.selectedValues = [this.focusedValue]), this.isNavigating = true) : n ? this.value = m(this.multiple, this.selectedValues) : this.multiple ? this.focusedValue !== undefined && (t2.name === "tab" || this.isNavigating && t2.name === "space") ? this.toggleSelected(this.focusedValue) : this.isNavigating = false : (this.focusedValue && (this.selectedValues = [this.focusedValue]), this.isNavigating = false);
804
879
  }
805
880
  deselectAll() {
806
881
  this.selectedValues = [];
807
882
  }
808
- toggleSelected(t) {
809
- this.filteredOptions.length !== 0 && (this.multiple ? this.selectedValues.includes(t) ? this.selectedValues = this.selectedValues.filter((s) => s !== t) : this.selectedValues = [...this.selectedValues, t] : this.selectedValues = [t]);
810
- }
811
- #i(t) {
812
- if (t !== this.#r) {
813
- this.#r = t;
814
- const s = this.options;
815
- t && this.#t ? this.filteredOptions = s.filter((n) => this.#t?.(t, n)) : this.filteredOptions = [...s];
816
- const e = B(this.focusedValue, this.filteredOptions);
817
- this.#s = f(e, 0, this.filteredOptions);
818
- const i = this.filteredOptions[this.#s];
819
- i && !i.disabled ? this.focusedValue = i.value : this.focusedValue = undefined, this.multiple || (this.focusedValue !== undefined ? this.toggleSelected(this.focusedValue) : this.deselectAll());
883
+ toggleSelected(e) {
884
+ this.filteredOptions.length !== 0 && (this.multiple ? this.selectedValues.includes(e) ? this.selectedValues = this.selectedValues.filter((t2) => t2 !== e) : this.selectedValues = [...this.selectedValues, e] : this.selectedValues = [e]);
885
+ }
886
+ #u(e) {
887
+ if (e !== this.#s) {
888
+ this.#s = e;
889
+ const t2 = this.options;
890
+ e && this.#t ? this.filteredOptions = t2.filter((n) => this.#t?.(e, n)) : this.filteredOptions = [...t2];
891
+ const i = p$1(this.focusedValue, this.filteredOptions);
892
+ this.#e = findCursor(i, 0, this.filteredOptions);
893
+ const s = this.filteredOptions[this.#e];
894
+ s && !s.disabled ? this.focusedValue = s.value : this.focusedValue = undefined, this.multiple || (this.focusedValue !== undefined ? this.toggleSelected(this.focusedValue) : this.deselectAll());
820
895
  }
821
896
  }
822
897
  };
823
898
 
824
- class X2 extends m {
899
+ class r extends V {
825
900
  get cursor() {
826
901
  return this.value ? 0 : 1;
827
902
  }
828
903
  get _value() {
829
904
  return this.cursor === 0;
830
905
  }
831
- constructor(t) {
832
- super(t, false), this.value = !!t.initialValue, this.on("userInput", () => {
906
+ constructor(t2) {
907
+ super(t2, false), this.value = !!t2.initialValue, this.on("userInput", () => {
833
908
  this.value = this._value;
834
- }), this.on("confirm", (s) => {
835
- this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = s, this.state = "submit", this.close();
909
+ }), this.on("confirm", (i) => {
910
+ this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = i, this.state = "submit", this.close();
836
911
  }), this.on("cursor", () => {
837
912
  this.value = !this.value;
838
913
  });
839
914
  }
840
915
  }
841
- var Z = { Y: { type: "year", len: 4 }, M: { type: "month", len: 2 }, D: { type: "day", len: 2 } };
842
- function P(r) {
843
- return [...r].map((t) => Z[t]);
916
+ var _ = {
917
+ Y: { type: "year", len: 4 },
918
+ M: { type: "month", len: 2 },
919
+ D: { type: "day", len: 2 }
920
+ };
921
+ function M(r2) {
922
+ return [...r2].map((t2) => _[t2]);
844
923
  }
845
- function tt(r) {
846
- const t = new Intl.DateTimeFormat(r, { year: "numeric", month: "2-digit", day: "2-digit" }).formatToParts(new Date(2000, 0, 15)), s = [];
847
- let e = "/";
848
- for (const i of t)
849
- i.type === "literal" ? e = i.value.trim() || i.value : (i.type === "year" || i.type === "month" || i.type === "day") && s.push({ type: i.type, len: i.type === "year" ? 4 : 2 });
850
- return { segments: s, separator: e };
924
+ function P(r2) {
925
+ const i = new Intl.DateTimeFormat(r2, {
926
+ year: "numeric",
927
+ month: "2-digit",
928
+ day: "2-digit"
929
+ }).formatToParts(new Date(2000, 0, 15)), s = [];
930
+ let n = "/";
931
+ for (const e of i)
932
+ e.type === "literal" ? n = e.value.trim() || e.value : (e.type === "year" || e.type === "month" || e.type === "day") && s.push({ type: e.type, len: e.type === "year" ? 4 : 2 });
933
+ return { segments: s, separator: n };
851
934
  }
852
- function $(r) {
853
- return Number.parseInt((r || "0").replace(/_/g, "0"), 10) || 0;
935
+ function p(r2) {
936
+ return Number.parseInt((r2 || "0").replace(/_/g, "0"), 10) || 0;
854
937
  }
855
- function S(r) {
856
- return { year: $(r.year), month: $(r.month), day: $(r.day) };
938
+ function f(r2) {
939
+ return {
940
+ year: p(r2.year),
941
+ month: p(r2.month),
942
+ day: p(r2.day)
943
+ };
857
944
  }
858
- function U(r, t) {
859
- return new Date(r || 2001, t || 1, 0).getDate();
945
+ function c(r2, t2) {
946
+ return new Date(r2 || 2001, t2 || 1, 0).getDate();
860
947
  }
861
- function F(r) {
862
- const { year: t, month: s, day: e } = S(r);
863
- if (!t || t < 0 || t > 9999 || !s || s < 1 || s > 12 || !e || e < 1)
948
+ function b(r2) {
949
+ const { year: t2, month: i, day: s } = f(r2);
950
+ if (!t2 || t2 < 0 || t2 > 9999 || !i || i < 1 || i > 12 || !s || s < 1)
864
951
  return;
865
- const i = new Date(Date.UTC(t, s - 1, e));
866
- if (!(i.getUTCFullYear() !== t || i.getUTCMonth() !== s - 1 || i.getUTCDate() !== e))
867
- return { year: t, month: s, day: e };
952
+ const n = new Date(Date.UTC(t2, i - 1, s));
953
+ if (!(n.getUTCFullYear() !== t2 || n.getUTCMonth() !== i - 1 || n.getUTCDate() !== s))
954
+ return { year: t2, month: i, day: s };
868
955
  }
869
- function N(r) {
870
- const t = F(r);
871
- return t ? new Date(Date.UTC(t.year, t.month - 1, t.day)) : undefined;
956
+ function C(r2) {
957
+ const t2 = b(r2);
958
+ return t2 ? new Date(Date.UTC(t2.year, t2.month - 1, t2.day)) : undefined;
872
959
  }
873
- function st(r, t, s, e) {
874
- const i = s ? { year: s.getUTCFullYear(), month: s.getUTCMonth() + 1, day: s.getUTCDate() } : null, n = e ? { year: e.getUTCFullYear(), month: e.getUTCMonth() + 1, day: e.getUTCDate() } : null;
875
- return r === "year" ? { min: i?.year ?? 1, max: n?.year ?? 9999 } : r === "month" ? { min: i && t.year === i.year ? i.month : 1, max: n && t.year === n.year ? n.month : 12 } : { min: i && t.year === i.year && t.month === i.month ? i.day : 1, max: n && t.year === n.year && t.month === n.month ? n.day : U(t.year, t.month) };
960
+ function T2(r2, t2, i, s) {
961
+ const n = i ? {
962
+ year: i.getUTCFullYear(),
963
+ month: i.getUTCMonth() + 1,
964
+ day: i.getUTCDate()
965
+ } : null, e = s ? {
966
+ year: s.getUTCFullYear(),
967
+ month: s.getUTCMonth() + 1,
968
+ day: s.getUTCDate()
969
+ } : null;
970
+ return r2 === "year" ? { min: n?.year ?? 1, max: e?.year ?? 9999 } : r2 === "month" ? {
971
+ min: n && t2.year === n.year ? n.month : 1,
972
+ max: e && t2.year === e.year ? e.month : 12
973
+ } : {
974
+ min: n && t2.year === n.year && t2.month === n.month ? n.day : 1,
975
+ max: e && t2.year === e.year && t2.month === e.month ? e.day : c(t2.year, t2.month)
976
+ };
876
977
  }
877
978
 
878
- class et extends m {
879
- #s;
880
- #r;
979
+ class U extends V {
980
+ #i;
981
+ #o;
881
982
  #t;
882
- #n;
983
+ #h;
883
984
  #u;
884
985
  #e = { segmentIndex: 0, positionInSegment: 0 };
885
- #i = true;
886
- #o = null;
986
+ #n = true;
987
+ #s = null;
887
988
  inlineError = "";
888
989
  get segmentCursor() {
889
990
  return { ...this.#e };
@@ -892,173 +993,189 @@ class et extends m {
892
993
  return { ...this.#t };
893
994
  }
894
995
  get segments() {
895
- return this.#s;
996
+ return this.#i;
896
997
  }
897
998
  get separator() {
898
- return this.#r;
999
+ return this.#o;
899
1000
  }
900
1001
  get formattedValue() {
901
- return this.#c(this.#t);
902
- }
903
- #c(t) {
904
- return this.#s.map((s) => t[s.type]).join(this.#r);
905
- }
906
- #a() {
907
- this._setUserInput(this.#c(this.#t)), this._setValue(N(this.#t) ?? undefined);
1002
+ return this.#l(this.#t);
908
1003
  }
909
- constructor(t) {
910
- const s = t.format ? { segments: P(t.format), separator: t.separator ?? "/" } : tt(t.locale), e = t.separator ?? s.separator, i = t.format ? P(t.format) : s.segments, n = t.initialValue ?? t.defaultValue, o = n ? { year: String(n.getUTCFullYear()).padStart(4, "0"), month: String(n.getUTCMonth() + 1).padStart(2, "0"), day: String(n.getUTCDate()).padStart(2, "0") } : { year: "____", month: "__", day: "__" }, u = i.map((a) => o[a.type]).join(e);
911
- super({ ...t, initialUserInput: u }, false), this.#s = i, this.#r = e, this.#t = o, this.#n = t.minDate, this.#u = t.maxDate, this.#a(), this.on("cursor", (a) => this.#d(a)), this.on("key", (a, l) => this.#f(a, l)), this.on("finalize", () => this.#g(t));
1004
+ #l(t2) {
1005
+ return this.#i.map((i) => t2[i.type]).join(this.#o);
912
1006
  }
913
- #h() {
914
- const t = Math.max(0, Math.min(this.#e.segmentIndex, this.#s.length - 1)), s = this.#s[t];
915
- if (s)
916
- return this.#e.positionInSegment = Math.max(0, Math.min(this.#e.positionInSegment, s.len - 1)), { segment: s, index: t };
1007
+ #r() {
1008
+ this._setUserInput(this.#l(this.#t)), this._setValue(C(this.#t) ?? undefined);
917
1009
  }
918
- #l(t) {
919
- this.inlineError = "", this.#o = null;
920
- const s = this.#h();
921
- s && (this.#e.segmentIndex = Math.max(0, Math.min(this.#s.length - 1, s.index + t)), this.#e.positionInSegment = 0, this.#i = true);
1010
+ constructor(t2) {
1011
+ const i = t2.format ? { segments: M(t2.format), separator: t2.separator ?? "/" } : P(t2.locale), s = t2.separator ?? i.separator, n = t2.format ? M(t2.format) : i.segments, e = t2.initialValue ?? t2.defaultValue, m2 = e ? {
1012
+ year: String(e.getUTCFullYear()).padStart(4, "0"),
1013
+ month: String(e.getUTCMonth() + 1).padStart(2, "0"),
1014
+ day: String(e.getUTCDate()).padStart(2, "0")
1015
+ } : { year: "____", month: "__", day: "__" }, o = n.map((a) => m2[a.type]).join(s);
1016
+ super({ ...t2, initialUserInput: o }, false), this.#i = n, this.#o = s, this.#t = m2, this.#h = t2.minDate, this.#u = t2.maxDate, this.#r(), this.on("cursor", (a) => this.#f(a)), this.on("key", (a, u) => this.#y(a, u)), this.on("finalize", () => this.#p(t2));
922
1017
  }
923
- #p(t) {
924
- const s = this.#h();
925
- if (!s)
1018
+ #a() {
1019
+ const t2 = Math.max(0, Math.min(this.#e.segmentIndex, this.#i.length - 1)), i = this.#i[t2];
1020
+ if (i)
1021
+ return this.#e.positionInSegment = Math.max(0, Math.min(this.#e.positionInSegment, i.len - 1)), { segment: i, index: t2 };
1022
+ }
1023
+ #m(t2) {
1024
+ this.inlineError = "", this.#s = null;
1025
+ const i = this.#a();
1026
+ i && (this.#e.segmentIndex = Math.max(0, Math.min(this.#i.length - 1, i.index + t2)), this.#e.positionInSegment = 0, this.#n = true);
1027
+ }
1028
+ #d(t2) {
1029
+ const i = this.#a();
1030
+ if (!i)
926
1031
  return;
927
- const { segment: e } = s, i = this.#t[e.type], n = !i || i.replace(/_/g, "") === "", o = Number.parseInt((i || "0").replace(/_/g, "0"), 10) || 0, u = st(e.type, S(this.#t), this.#n, this.#u);
1032
+ const { segment: s } = i, n = this.#t[s.type], e = !n || n.replace(/_/g, "") === "", m2 = Number.parseInt((n || "0").replace(/_/g, "0"), 10) || 0, o = T2(s.type, f(this.#t), this.#h, this.#u);
928
1033
  let a;
929
- n ? a = t === 1 ? u.min : u.max : a = Math.max(Math.min(u.max, o + t), u.min), this.#t = { ...this.#t, [e.type]: a.toString().padStart(e.len, "0") }, this.#i = true, this.#o = null, this.#a();
930
- }
931
- #d(t) {
932
- if (t)
933
- switch (t) {
1034
+ e ? a = t2 === 1 ? o.min : o.max : a = Math.max(Math.min(o.max, m2 + t2), o.min), this.#t = {
1035
+ ...this.#t,
1036
+ [s.type]: a.toString().padStart(s.len, "0")
1037
+ }, this.#n = true, this.#s = null, this.#r();
1038
+ }
1039
+ #f(t2) {
1040
+ if (t2)
1041
+ switch (t2) {
934
1042
  case "right":
935
- return this.#l(1);
1043
+ return this.#m(1);
936
1044
  case "left":
937
- return this.#l(-1);
1045
+ return this.#m(-1);
938
1046
  case "up":
939
- return this.#p(1);
1047
+ return this.#d(1);
940
1048
  case "down":
941
- return this.#p(-1);
1049
+ return this.#d(-1);
942
1050
  }
943
1051
  }
944
- #f(t, s) {
945
- if (s?.name === "backspace" || s?.sequence === "\x7F" || s?.sequence === "\b" || t === "\x7F" || t === "\b") {
1052
+ #y(t2, i) {
1053
+ if (i?.name === "backspace" || i?.sequence === "\x7F" || i?.sequence === "\b" || t2 === "\x7F" || t2 === "\b") {
946
1054
  this.inlineError = "";
947
- const e = this.#h();
948
- if (!e)
1055
+ const n = this.#a();
1056
+ if (!n)
949
1057
  return;
950
- if (!this.#t[e.segment.type].replace(/_/g, "")) {
951
- this.#l(-1);
1058
+ if (!this.#t[n.segment.type].replace(/_/g, "")) {
1059
+ this.#m(-1);
952
1060
  return;
953
1061
  }
954
- this.#t[e.segment.type] = "_".repeat(e.segment.len), this.#i = true, this.#e.positionInSegment = 0, this.#a();
1062
+ this.#t[n.segment.type] = "_".repeat(n.segment.len), this.#n = true, this.#e.positionInSegment = 0, this.#r();
955
1063
  return;
956
1064
  }
957
- if (s?.name === "tab") {
1065
+ if (i?.name === "tab") {
958
1066
  this.inlineError = "";
959
- const e = this.#h();
960
- if (!e)
1067
+ const n = this.#a();
1068
+ if (!n)
961
1069
  return;
962
- const i = s.shift ? -1 : 1, n = e.index + i;
963
- n >= 0 && n < this.#s.length && (this.#e.segmentIndex = n, this.#e.positionInSegment = 0, this.#i = true);
1070
+ const e = i.shift ? -1 : 1, m2 = n.index + e;
1071
+ m2 >= 0 && m2 < this.#i.length && (this.#e.segmentIndex = m2, this.#e.positionInSegment = 0, this.#n = true);
964
1072
  return;
965
1073
  }
966
- if (t && /^[0-9]$/.test(t)) {
967
- const e = this.#h();
968
- if (!e)
1074
+ if (t2 && /^[0-9]$/.test(t2)) {
1075
+ const n = this.#a();
1076
+ if (!n)
969
1077
  return;
970
- const { segment: i } = e, n = !this.#t[i.type].replace(/_/g, "");
971
- if (this.#i && this.#o !== null && !n) {
972
- const d = this.#o + t, g = { ...this.#t, [i.type]: d }, _ = this.#m(g, i);
973
- if (_) {
974
- this.inlineError = _, this.#o = null, this.#i = false;
1078
+ const { segment: e } = n, m2 = !this.#t[e.type].replace(/_/g, "");
1079
+ if (this.#n && this.#s !== null && !m2) {
1080
+ const h = this.#s + t2, d = { ...this.#t, [e.type]: h }, g2 = this.#g(d, e);
1081
+ if (g2) {
1082
+ this.inlineError = g2, this.#s = null, this.#n = false;
975
1083
  return;
976
1084
  }
977
- this.inlineError = "", this.#t[i.type] = d, this.#o = null, this.#i = false, this.#a(), e.index < this.#s.length - 1 && (this.#e.segmentIndex = e.index + 1, this.#e.positionInSegment = 0, this.#i = true);
1085
+ this.inlineError = "", this.#t[e.type] = h, this.#s = null, this.#n = false, this.#r(), n.index < this.#i.length - 1 && (this.#e.segmentIndex = n.index + 1, this.#e.positionInSegment = 0, this.#n = true);
978
1086
  return;
979
1087
  }
980
- this.#i && !n && (this.#t[i.type] = "_".repeat(i.len), this.#e.positionInSegment = 0), this.#i = false, this.#o = null;
981
- const o = this.#t[i.type], u = o.indexOf("_"), a = u >= 0 ? u : Math.min(this.#e.positionInSegment, i.len - 1);
982
- if (a < 0 || a >= i.len)
1088
+ this.#n && !m2 && (this.#t[e.type] = "_".repeat(e.len), this.#e.positionInSegment = 0), this.#n = false, this.#s = null;
1089
+ const o = this.#t[e.type], a = o.indexOf("_"), u = a >= 0 ? a : Math.min(this.#e.positionInSegment, e.len - 1);
1090
+ if (u < 0 || u >= e.len)
983
1091
  return;
984
- let l = o.slice(0, a) + t + o.slice(a + 1), c = false;
985
- if (a === 0 && o === "__" && (i.type === "month" || i.type === "day")) {
986
- const d = Number.parseInt(t, 10);
987
- l = `0${t}`, c = d <= (i.type === "month" ? 1 : 2);
1092
+ let l2 = o.slice(0, u) + t2 + o.slice(u + 1), D = false;
1093
+ if (u === 0 && o === "__" && (e.type === "month" || e.type === "day")) {
1094
+ const h = Number.parseInt(t2, 10);
1095
+ l2 = `0${t2}`, D = h <= (e.type === "month" ? 1 : 2);
988
1096
  }
989
- if (i.type === "year" && (l = (o.replace(/_/g, "") + t).padStart(i.len, "_")), !l.includes("_")) {
990
- const d = { ...this.#t, [i.type]: l }, g = this.#m(d, i);
991
- if (g) {
992
- this.inlineError = g;
1097
+ if (e.type === "year" && (l2 = (o.replace(/_/g, "") + t2).padStart(e.len, "_")), !l2.includes("_")) {
1098
+ const h = { ...this.#t, [e.type]: l2 }, d = this.#g(h, e);
1099
+ if (d) {
1100
+ this.inlineError = d;
993
1101
  return;
994
1102
  }
995
1103
  }
996
- this.inlineError = "", this.#t[i.type] = l;
997
- const y = l.includes("_") ? undefined : F(this.#t);
1104
+ this.inlineError = "", this.#t[e.type] = l2;
1105
+ const y = l2.includes("_") ? undefined : b(this.#t);
998
1106
  if (y) {
999
- const { year: d, month: g } = y, _ = U(d, g);
1000
- this.#t = { year: String(Math.max(0, Math.min(9999, d))).padStart(4, "0"), month: String(Math.max(1, Math.min(12, g))).padStart(2, "0"), day: String(Math.max(1, Math.min(_, y.day))).padStart(2, "0") };
1107
+ const { year: h, month: d } = y, g2 = c(h, d);
1108
+ this.#t = {
1109
+ year: String(Math.max(0, Math.min(9999, h))).padStart(4, "0"),
1110
+ month: String(Math.max(1, Math.min(12, d))).padStart(2, "0"),
1111
+ day: String(Math.max(1, Math.min(g2, y.day))).padStart(2, "0")
1112
+ };
1001
1113
  }
1002
- this.#a();
1003
- const T = l.indexOf("_");
1004
- c ? (this.#i = true, this.#o = t) : T >= 0 ? this.#e.positionInSegment = T : u >= 0 && e.index < this.#s.length - 1 ? (this.#e.segmentIndex = e.index + 1, this.#e.positionInSegment = 0, this.#i = true) : this.#e.positionInSegment = Math.min(a + 1, i.len - 1);
1114
+ this.#r();
1115
+ const S = l2.indexOf("_");
1116
+ D ? (this.#n = true, this.#s = t2) : S >= 0 ? this.#e.positionInSegment = S : a >= 0 && n.index < this.#i.length - 1 ? (this.#e.segmentIndex = n.index + 1, this.#e.positionInSegment = 0, this.#n = true) : this.#e.positionInSegment = Math.min(u + 1, e.len - 1);
1005
1117
  }
1006
1118
  }
1007
- #m(t, s) {
1008
- const { month: e, day: i } = S(t);
1009
- if (s.type === "month" && (e < 0 || e > 12))
1010
- return h.date.messages.invalidMonth;
1011
- if (s.type === "day" && (i < 0 || i > 31))
1012
- return h.date.messages.invalidDay(31, "any month");
1013
- }
1014
- #g(t) {
1015
- const { year: s, month: e, day: i } = S(this.#t);
1016
- if (s && e && i) {
1017
- const n = U(s, e);
1018
- this.#t = { ...this.#t, day: String(Math.min(i, n)).padStart(2, "0") };
1119
+ #g(t2, i) {
1120
+ const { month: s, day: n } = f(t2);
1121
+ if (i.type === "month" && (s < 0 || s > 12))
1122
+ return settings.date.messages.invalidMonth;
1123
+ if (i.type === "day" && (n < 0 || n > 31))
1124
+ return settings.date.messages.invalidDay(31, "any month");
1125
+ }
1126
+ #p(t2) {
1127
+ const { year: i, month: s, day: n } = f(this.#t);
1128
+ if (i && s && n) {
1129
+ const e = c(i, s);
1130
+ this.#t = {
1131
+ ...this.#t,
1132
+ day: String(Math.min(n, e)).padStart(2, "0")
1133
+ };
1019
1134
  }
1020
- this.value = N(this.#t) ?? t.defaultValue ?? undefined;
1135
+ this.value = C(this.#t) ?? t2.defaultValue ?? undefined;
1021
1136
  }
1022
1137
  }
1023
-
1024
- class it extends m {
1138
+ var u$1 = class u extends V {
1025
1139
  options;
1026
1140
  cursor = 0;
1027
- #s;
1028
- getGroupItems(t) {
1029
- return this.options.filter((s) => s.group === t);
1141
+ #t;
1142
+ getGroupItems(t2) {
1143
+ return this.options.filter((r2) => r2.group === t2);
1030
1144
  }
1031
- isGroupSelected(t) {
1032
- const s = this.getGroupItems(t), e = this.value;
1033
- return e === undefined ? false : s.every((i) => e.includes(i.value));
1145
+ isGroupSelected(t2) {
1146
+ const r2 = this.getGroupItems(t2), e = this.value;
1147
+ return e === undefined ? false : r2.every((s) => e.includes(s.value));
1034
1148
  }
1035
1149
  toggleValue() {
1036
- const t = this.options[this.cursor];
1037
- if (this.value === undefined && (this.value = []), t.group === true) {
1038
- const s = t.value, e = this.getGroupItems(s);
1039
- this.isGroupSelected(s) ? this.value = this.value.filter((i) => e.findIndex((n) => n.value === i) === -1) : this.value = [...this.value, ...e.map((i) => i.value)], this.value = Array.from(new Set(this.value));
1150
+ const t2 = this.options[this.cursor];
1151
+ if (this.value === undefined && (this.value = []), t2.group === true) {
1152
+ const r2 = t2.value, e = this.getGroupItems(r2);
1153
+ this.isGroupSelected(r2) ? this.value = this.value.filter((s) => e.findIndex((i) => i.value === s) === -1) : this.value = [...this.value, ...e.map((s) => s.value)], this.value = Array.from(new Set(this.value));
1040
1154
  } else {
1041
- const s = this.value.includes(t.value);
1042
- this.value = s ? this.value.filter((e) => e !== t.value) : [...this.value, t.value];
1155
+ const r2 = this.value.includes(t2.value);
1156
+ this.value = r2 ? this.value.filter((e) => e !== t2.value) : [...this.value, t2.value];
1043
1157
  }
1044
1158
  }
1045
- constructor(t) {
1046
- super(t, false);
1047
- const { options: s } = t;
1048
- this.#s = t.selectableGroups !== false, this.options = Object.entries(s).flatMap(([e, i]) => [{ value: e, group: true, label: e }, ...i.map((n) => ({ ...n, group: e }))]), this.value = [...t.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: e }) => e === t.cursorAt), this.#s ? 0 : 1), this.on("cursor", (e) => {
1159
+ constructor(t2) {
1160
+ super(t2, false);
1161
+ const { options: r2 } = t2;
1162
+ this.#t = t2.selectableGroups !== false, this.options = Object.entries(r2).flatMap(([e, s]) => [
1163
+ { value: e, group: true, label: e },
1164
+ ...s.map((i) => ({ ...i, group: e }))
1165
+ ]), this.value = [...t2.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: e }) => e === t2.cursorAt), this.#t ? 0 : 1), this.on("cursor", (e) => {
1049
1166
  switch (e) {
1050
1167
  case "left":
1051
1168
  case "up": {
1052
1169
  this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
1053
- const i = this.options[this.cursor]?.group === true;
1054
- !this.#s && i && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);
1170
+ const s = this.options[this.cursor]?.group === true;
1171
+ !this.#t && s && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);
1055
1172
  break;
1056
1173
  }
1057
1174
  case "down":
1058
1175
  case "right": {
1059
1176
  this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
1060
- const i = this.options[this.cursor]?.group === true;
1061
- !this.#s && i && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
1177
+ const s = this.options[this.cursor]?.group === true;
1178
+ !this.#t && s && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
1062
1179
  break;
1063
1180
  }
1064
1181
  case "space":
@@ -1067,126 +1184,127 @@ class it extends m {
1067
1184
  }
1068
1185
  });
1069
1186
  }
1070
- }
1187
+ };
1188
+ var o$1 = /* @__PURE__ */ new Set(["up", "down", "left", "right"]);
1071
1189
 
1072
- class rt extends m {
1190
+ class h extends V {
1073
1191
  #s = false;
1074
- #r;
1192
+ #t;
1075
1193
  focused = "editor";
1076
1194
  get userInputWithCursor() {
1077
1195
  if (this.state === "submit")
1078
1196
  return this.userInput;
1079
- const t = this.userInput;
1080
- if (this.cursor >= t.length)
1081
- return `${t}\u2588`;
1082
- const s = t.slice(0, this.cursor), e = t[this.cursor], i = t.slice(this.cursor + 1);
1083
- return e === `
1197
+ const t2 = this.userInput;
1198
+ if (this.cursor >= t2.length)
1199
+ return `${t2}\u2588`;
1200
+ const s = t2.slice(0, this.cursor), r2 = t2[this.cursor], e = t2.slice(this.cursor + 1);
1201
+ return r2 === `
1084
1202
  ` ? `${s}\u2588
1085
- ${i}` : `${s}${v("inverse", e)}${i}`;
1203
+ ${e}` : `${s}${styleText("inverse", r2)}${e}`;
1086
1204
  }
1087
1205
  get cursor() {
1088
1206
  return this._cursor;
1089
1207
  }
1090
- #t(t) {
1208
+ #r(t2) {
1091
1209
  if (this.userInput.length === 0) {
1092
- this._setUserInput(t);
1210
+ this._setUserInput(t2);
1093
1211
  return;
1094
1212
  }
1095
- this._setUserInput(this.userInput.slice(0, this.cursor) + t + this.userInput.slice(this.cursor));
1213
+ this._setUserInput(this.userInput.slice(0, this.cursor) + t2 + this.userInput.slice(this.cursor));
1096
1214
  }
1097
- #n(t) {
1215
+ #i(t2) {
1098
1216
  const s = this.value ?? "";
1099
- switch (t) {
1217
+ switch (t2) {
1100
1218
  case "up":
1101
- this._cursor = I(this._cursor, 0, -1, s);
1219
+ this._cursor = findTextCursor(this._cursor, 0, -1, s);
1102
1220
  return;
1103
1221
  case "down":
1104
- this._cursor = I(this._cursor, 0, 1, s);
1222
+ this._cursor = findTextCursor(this._cursor, 0, 1, s);
1105
1223
  return;
1106
1224
  case "left":
1107
- this._cursor = I(this._cursor, -1, 0, s);
1225
+ this._cursor = findTextCursor(this._cursor, -1, 0, s);
1108
1226
  return;
1109
1227
  case "right":
1110
- this._cursor = I(this._cursor, 1, 0, s);
1228
+ this._cursor = findTextCursor(this._cursor, 1, 0, s);
1111
1229
  return;
1112
1230
  }
1113
1231
  }
1114
- _shouldSubmit(t, s) {
1115
- if (this.#r)
1116
- return this.focused === "submit" ? true : (this.#t(`
1232
+ _shouldSubmit(t2, s) {
1233
+ if (this.#t)
1234
+ return this.focused === "submit" ? true : (this.#r(`
1117
1235
  `), this._cursor++, false);
1118
- const e = this.#s;
1119
- return this.#s = true, e ? (this.userInput[this.cursor - 1] === `
1120
- ` && (this._setUserInput(this.userInput.slice(0, this.cursor - 1) + this.userInput.slice(this.cursor)), this._cursor--), true) : (this.#t(`
1236
+ const r2 = this.#s;
1237
+ return this.#s = true, r2 ? (this.userInput[this.cursor - 1] === `
1238
+ ` && (this._setUserInput(this.userInput.slice(0, this.cursor - 1) + this.userInput.slice(this.cursor)), this._cursor--), true) : (this.#r(`
1121
1239
  `), this._cursor++, false);
1122
1240
  }
1123
- constructor(t) {
1124
- super(t, false), this.#r = t.showSubmit ?? false, this.on("key", (s, e) => {
1125
- if (e?.name && h.actions.has(e.name)) {
1126
- this.#n(e.name);
1241
+ constructor(t2) {
1242
+ super(t2, false), this.#t = t2.showSubmit ?? false, this.on("key", (s, r2) => {
1243
+ if (r2?.name && o$1.has(r2.name)) {
1244
+ this.#i(r2.name);
1127
1245
  return;
1128
1246
  }
1129
- if (s === "\t" && this.#r) {
1247
+ if (s === "\t" && this.#t) {
1130
1248
  this.focused = this.focused === "editor" ? "submit" : "editor";
1131
1249
  return;
1132
1250
  }
1133
- if (e?.name !== "return") {
1134
- if (this.#s = false, e?.name === "backspace" && this.cursor > 0) {
1251
+ if (r2?.name !== "return") {
1252
+ if (this.#s = false, r2?.name === "backspace" && this.cursor > 0) {
1135
1253
  this._setUserInput(this.userInput.slice(0, this.cursor - 1) + this.userInput.slice(this.cursor)), this._cursor--;
1136
1254
  return;
1137
1255
  }
1138
- if (e?.name === "delete" && this.cursor < this.userInput.length) {
1256
+ if (r2?.name === "delete" && this.cursor < this.userInput.length) {
1139
1257
  this._setUserInput(this.userInput.slice(0, this.cursor) + this.userInput.slice(this.cursor + 1));
1140
1258
  return;
1141
1259
  }
1142
- s && (this.#r && this.focused === "submit" && (this.focused = "editor"), this.#t(s ?? ""), this._cursor++);
1260
+ s && (this.#t && this.focused === "submit" && (this.focused = "editor"), this.#r(s ?? ""), this._cursor++);
1143
1261
  }
1144
1262
  }), this.on("userInput", (s) => {
1145
1263
  this._setValue(s);
1146
1264
  }), this.on("finalize", () => {
1147
- this.value || (this.value = t.defaultValue), this.value === undefined && (this.value = "");
1265
+ this.value || (this.value = t2.defaultValue), this.value === undefined && (this.value = "");
1148
1266
  });
1149
1267
  }
1150
1268
  }
1151
- var nt = class extends m {
1269
+ var a$1 = class a extends V {
1152
1270
  options;
1153
1271
  cursor = 0;
1154
1272
  get _value() {
1155
1273
  return this.options[this.cursor].value;
1156
1274
  }
1157
1275
  get _enabledOptions() {
1158
- return this.options.filter((t) => t.disabled !== true);
1276
+ return this.options.filter((e) => e.disabled !== true);
1159
1277
  }
1160
1278
  toggleAll() {
1161
- const t = this._enabledOptions, s = this.value !== undefined && this.value.length === t.length;
1162
- this.value = s ? [] : t.map((e) => e.value);
1279
+ const e = this._enabledOptions, i = this.value !== undefined && this.value.length === e.length;
1280
+ this.value = i ? [] : e.map((t2) => t2.value);
1163
1281
  }
1164
1282
  toggleInvert() {
1165
- const t = this.value;
1166
- if (!t)
1283
+ const e = this.value;
1284
+ if (!e)
1167
1285
  return;
1168
- const s = this._enabledOptions.filter((e) => !t.includes(e.value));
1169
- this.value = s.map((e) => e.value);
1286
+ const i = this._enabledOptions.filter((t2) => !e.includes(t2.value));
1287
+ this.value = i.map((t2) => t2.value);
1170
1288
  }
1171
1289
  toggleValue() {
1172
1290
  this.value === undefined && (this.value = []);
1173
- const t = this.value.includes(this._value);
1174
- this.value = t ? this.value.filter((s) => s !== this._value) : [...this.value, this._value];
1175
- }
1176
- constructor(t) {
1177
- super(t, false), this.options = t.options, this.value = [...t.initialValues ?? []];
1178
- const s = Math.max(this.options.findIndex(({ value: e }) => e === t.cursorAt), 0);
1179
- this.cursor = this.options[s].disabled ? f(s, 1, this.options) : s, this.on("key", (e) => {
1180
- e === "a" && this.toggleAll(), e === "i" && this.toggleInvert();
1181
- }), this.on("cursor", (e) => {
1182
- switch (e) {
1291
+ const e = this.value.includes(this._value);
1292
+ this.value = e ? this.value.filter((i) => i !== this._value) : [...this.value, this._value];
1293
+ }
1294
+ constructor(e) {
1295
+ super(e, false), this.options = e.options, this.value = [...e.initialValues ?? []];
1296
+ const i = Math.max(this.options.findIndex(({ value: t2 }) => t2 === e.cursorAt), 0);
1297
+ this.cursor = this.options[i].disabled ? findCursor(i, 1, this.options) : i, this.on("key", (t2, l2) => {
1298
+ l2.name === "a" && this.toggleAll(), l2.name === "i" && this.toggleInvert();
1299
+ }), this.on("cursor", (t2) => {
1300
+ switch (t2) {
1183
1301
  case "left":
1184
1302
  case "up":
1185
- this.cursor = f(this.cursor, -1, this.options);
1303
+ this.cursor = findCursor(this.cursor, -1, this.options);
1186
1304
  break;
1187
1305
  case "down":
1188
1306
  case "right":
1189
- this.cursor = f(this.cursor, 1, this.options);
1307
+ this.cursor = findCursor(this.cursor, 1, this.options);
1190
1308
  break;
1191
1309
  case "space":
1192
1310
  this.toggleValue();
@@ -1195,7 +1313,7 @@ var nt = class extends m {
1195
1313
  });
1196
1314
  }
1197
1315
  };
1198
- class ut extends m {
1316
+ class a2 extends V {
1199
1317
  options;
1200
1318
  cursor = 0;
1201
1319
  get _selectedValue() {
@@ -1204,393 +1322,496 @@ class ut extends m {
1204
1322
  changeValue() {
1205
1323
  this.value = this._selectedValue.value;
1206
1324
  }
1207
- constructor(t) {
1208
- super(t, false), this.options = t.options;
1209
- const s = this.options.findIndex(({ value: i }) => i === t.initialValue), e = s === -1 ? 0 : s;
1210
- this.cursor = this.options[e].disabled ? f(e, 1, this.options) : e, this.changeValue(), this.on("cursor", (i) => {
1211
- switch (i) {
1325
+ constructor(t2) {
1326
+ super(t2, false), this.options = t2.options;
1327
+ const i = this.options.findIndex(({ value: s }) => s === t2.initialValue), e = i === -1 ? 0 : i;
1328
+ this.cursor = this.options[e].disabled ? findCursor(e, 1, this.options) : e, this.changeValue(), this.on("cursor", (s) => {
1329
+ switch (s) {
1212
1330
  case "left":
1213
1331
  case "up":
1214
- this.cursor = f(this.cursor, -1, this.options);
1332
+ this.cursor = findCursor(this.cursor, -1, this.options);
1215
1333
  break;
1216
1334
  case "down":
1217
1335
  case "right":
1218
- this.cursor = f(this.cursor, 1, this.options);
1336
+ this.cursor = findCursor(this.cursor, 1, this.options);
1219
1337
  break;
1220
1338
  }
1221
1339
  this.changeValue();
1222
1340
  });
1223
1341
  }
1224
1342
  }
1225
- class ht extends m {
1343
+ class n extends V {
1226
1344
  get userInputWithCursor() {
1227
1345
  if (this.state === "submit")
1228
1346
  return this.userInput;
1229
- const t = this.userInput;
1230
- if (this.cursor >= t.length)
1347
+ const t2 = this.userInput;
1348
+ if (this.cursor >= t2.length)
1231
1349
  return `${this.userInput}\u2588`;
1232
- const s = t.slice(0, this.cursor), [e, ...i] = t.slice(this.cursor);
1233
- return `${s}${v("inverse", e)}${i.join("")}`;
1350
+ const e = t2.slice(0, this.cursor), [s, ...r2] = t2.slice(this.cursor);
1351
+ return `${e}${styleText("inverse", s)}${r2.join("")}`;
1234
1352
  }
1235
1353
  get cursor() {
1236
1354
  return this._cursor;
1237
1355
  }
1238
- constructor(t) {
1239
- super({ ...t, initialUserInput: t.initialUserInput ?? t.initialValue }), this.on("userInput", (s) => {
1240
- this._setValue(s);
1356
+ constructor(t2) {
1357
+ super({
1358
+ ...t2,
1359
+ initialUserInput: t2.initialUserInput ?? t2.initialValue
1360
+ }), this.on("userInput", (e) => {
1361
+ this._setValue(e);
1241
1362
  }), this.on("finalize", () => {
1242
- this.value || (this.value = t.defaultValue), this.value === undefined && (this.value = "");
1363
+ this.value || (this.value = t2.defaultValue), this.value === undefined && (this.value = "");
1243
1364
  });
1244
1365
  }
1245
1366
  }
1246
1367
 
1247
1368
  // node_modules/@clack/prompts/dist/index.mjs
1248
- import { styleText as e, stripVTControlCharacters as nt2 } from "util";
1249
- import V2 from "process";
1369
+ import { styleText as styleText2, stripVTControlCharacters } from "util";
1370
+ import process$1 from "process";
1250
1371
  var import_sisteransi2 = __toESM(require_src(), 1);
1251
- function ee() {
1252
- return V2.platform !== "win32" ? V2.env.TERM !== "linux" : !!V2.env.CI || !!V2.env.WT_SESSION || !!V2.env.TERMINUS_SUBLIME || V2.env.ConEmuTask === "{cmd::Cmder}" || V2.env.TERM_PROGRAM === "Terminus-Sublime" || V2.env.TERM_PROGRAM === "vscode" || V2.env.TERM === "xterm-256color" || V2.env.TERM === "alacritty" || V2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
1253
- }
1254
- var tt2 = ee();
1255
- var ot2 = () => process.env.CI === "true";
1256
- var w2 = (t, i) => tt2 ? t : i;
1257
- var Tt = w2("\u25C6", "*");
1258
- var at2 = w2("\u25A0", "x");
1259
- var ut2 = w2("\u25B2", "x");
1260
- var H2 = w2("\u25C7", "o");
1261
- var lt = w2("\u250C", "T");
1262
- var $2 = w2("\u2502", "|");
1263
- var x2 = w2("\u2514", "\u2014");
1264
- var _t = w2("\u2510", "T");
1265
- var xt = w2("\u2518", "\u2014");
1266
- var z2 = w2("\u25CF", ">");
1267
- var U2 = w2("\u25CB", " ");
1268
- var et2 = w2("\u25FB", "[\u2022]");
1269
- var K2 = w2("\u25FC", "[+]");
1270
- var Y2 = w2("\u25FB", "[ ]");
1271
- var Et = w2("\u25AA", "\u2022");
1272
- var st2 = w2("\u2500", "-");
1273
- var ct = w2("\u256E", "+");
1274
- var Gt = w2("\u251C", "+");
1275
- var $t = w2("\u256F", "+");
1276
- var dt = w2("\u2570", "+");
1277
- var Mt = w2("\u256D", "+");
1278
- var ht2 = w2("\u25CF", "\u2022");
1279
- var pt = w2("\u25C6", "*");
1280
- var mt = w2("\u25B2", "!");
1281
- var gt = w2("\u25A0", "x");
1282
- var P2 = (t) => {
1283
- switch (t) {
1372
+ function isUnicodeSupported() {
1373
+ if (process$1.platform !== "win32") {
1374
+ return process$1.env.TERM !== "linux";
1375
+ }
1376
+ return Boolean(process$1.env.CI) || Boolean(process$1.env.WT_SESSION) || Boolean(process$1.env.TERMINUS_SUBLIME) || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
1377
+ }
1378
+ var unicode = isUnicodeSupported();
1379
+ var isCI = () => process.env.CI === "true";
1380
+ var unicodeOr = (e, o2) => unicode ? e : o2;
1381
+ var S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
1382
+ var S_STEP_CANCEL = unicodeOr("\u25A0", "x");
1383
+ var S_STEP_ERROR = unicodeOr("\u25B2", "x");
1384
+ var S_STEP_SUBMIT = unicodeOr("\u25C7", "o");
1385
+ var S_BAR_START = unicodeOr("\u250C", "T");
1386
+ var S_BAR = unicodeOr("\u2502", "|");
1387
+ var S_BAR_END = unicodeOr("\u2514", "\u2014");
1388
+ var S_BAR_START_RIGHT = unicodeOr("\u2510", "T");
1389
+ var S_BAR_END_RIGHT = unicodeOr("\u2518", "\u2014");
1390
+ var S_RADIO_ACTIVE = unicodeOr("\u25CF", ">");
1391
+ var S_RADIO_INACTIVE = unicodeOr("\u25CB", " ");
1392
+ var S_CHECKBOX_ACTIVE = unicodeOr("\u25FB", "[\u2022]");
1393
+ var S_CHECKBOX_SELECTED = unicodeOr("\u25FC", "[+]");
1394
+ var S_CHECKBOX_INACTIVE = unicodeOr("\u25FB", "[ ]");
1395
+ var S_PASSWORD_MASK = unicodeOr("\u25AA", "\u2022");
1396
+ var S_BAR_H = unicodeOr("\u2500", "-");
1397
+ var S_CORNER_TOP_RIGHT = unicodeOr("\u256E", "+");
1398
+ var S_CONNECT_LEFT = unicodeOr("\u251C", "+");
1399
+ var S_CORNER_BOTTOM_RIGHT = unicodeOr("\u256F", "+");
1400
+ var S_CORNER_BOTTOM_LEFT = unicodeOr("\u2570", "+");
1401
+ var S_CORNER_TOP_LEFT = unicodeOr("\u256D", "+");
1402
+ var S_INFO = unicodeOr("\u25CF", "\u2022");
1403
+ var S_SUCCESS = unicodeOr("\u25C6", "*");
1404
+ var S_WARN = unicodeOr("\u25B2", "!");
1405
+ var S_ERROR = unicodeOr("\u25A0", "x");
1406
+ var symbol = (e) => {
1407
+ switch (e) {
1284
1408
  case "initial":
1285
1409
  case "active":
1286
- return e("cyan", Tt);
1410
+ return styleText2("cyan", S_STEP_ACTIVE);
1287
1411
  case "cancel":
1288
- return e("red", at2);
1412
+ return styleText2("red", S_STEP_CANCEL);
1289
1413
  case "error":
1290
- return e("yellow", ut2);
1414
+ return styleText2("yellow", S_STEP_ERROR);
1291
1415
  case "submit":
1292
- return e("green", H2);
1416
+ return styleText2("green", S_STEP_SUBMIT);
1293
1417
  }
1294
1418
  };
1295
- var yt = (t) => {
1296
- switch (t) {
1419
+ var symbolBar = (e) => {
1420
+ switch (e) {
1297
1421
  case "initial":
1298
1422
  case "active":
1299
- return e("cyan", $2);
1423
+ return styleText2("cyan", S_BAR);
1300
1424
  case "cancel":
1301
- return e("red", $2);
1425
+ return styleText2("red", S_BAR);
1302
1426
  case "error":
1303
- return e("yellow", $2);
1427
+ return styleText2("yellow", S_BAR);
1304
1428
  case "submit":
1305
- return e("green", $2);
1429
+ return styleText2("green", S_BAR);
1306
1430
  }
1307
1431
  };
1308
- var Ot = (t, i, s, r, u, n = false) => {
1309
- let a = i, c = 0;
1310
- if (n)
1311
- for (let o = r - 1;o >= s && (a -= t[o].length, c++, !(a <= u)); o--)
1432
+ var E$1 = (l2, o2, g2, c2, h2, O = false) => {
1433
+ let r2 = o2, w = 0;
1434
+ if (O)
1435
+ for (let i = c2 - 1;i >= g2 && (r2 -= l2[i].length, w++, !(r2 <= h2)); i--)
1312
1436
  ;
1313
1437
  else
1314
- for (let o = s;o < r && (a -= t[o].length, c++, !(a <= u)); o++)
1438
+ for (let i = g2;i < c2 && (r2 -= l2[i].length, w++, !(r2 <= h2)); i++)
1315
1439
  ;
1316
- return { lineCount: a, removals: c };
1440
+ return { lineCount: r2, removals: w };
1317
1441
  };
1318
- var F2 = ({ cursor: t, options: i, style: s, output: r = process.stdout, maxItems: u = Number.POSITIVE_INFINITY, columnPadding: n = 0, rowPadding: a = 4 }) => {
1319
- const c = A(r) - n, o = L(r), l = e("dim", "..."), d = Math.max(o - a, 0), g = Math.max(Math.min(u, d), 5);
1442
+ var limitOptions = ({
1443
+ cursor: l2,
1444
+ options: o2,
1445
+ style: g2,
1446
+ output: c2 = process.stdout,
1447
+ maxItems: h2 = Number.POSITIVE_INFINITY,
1448
+ columnPadding: O = 0,
1449
+ rowPadding: r2 = 4
1450
+ }) => {
1451
+ const i = getColumns(c2) - O, I = getRows(c2), C2 = styleText2("dim", "..."), x = Math.max(I - r2, 0), m2 = Math.max(Math.min(h2, x), 5);
1320
1452
  let p2 = 0;
1321
- t >= g - 3 && (p2 = Math.max(Math.min(t - g + 3, i.length - g), 0));
1322
- let f2 = g < i.length && p2 > 0, h2 = g < i.length && p2 + g < i.length;
1323
- const I2 = Math.min(p2 + g, i.length), m2 = [];
1324
- let y = 0;
1325
- f2 && y++, h2 && y++;
1326
- const v2 = p2 + (f2 ? 1 : 0), C2 = I2 - (h2 ? 1 : 0);
1327
- for (let b2 = v2;b2 < C2; b2++) {
1328
- const G2 = wrapAnsi(s(i[b2], b2 === t), c, { hard: true, trim: false }).split(`
1453
+ l2 >= m2 - 3 && (p2 = Math.max(Math.min(l2 - m2 + 3, o2.length - m2), 0));
1454
+ let f2 = m2 < o2.length && p2 > 0, u3 = m2 < o2.length && p2 + m2 < o2.length;
1455
+ const W = Math.min(p2 + m2, o2.length), e = [];
1456
+ let d = 0;
1457
+ f2 && d++, u3 && d++;
1458
+ const v = p2 + (f2 ? 1 : 0), P2 = W - (u3 ? 1 : 0);
1459
+ for (let t2 = v;t2 < P2; t2++) {
1460
+ const n2 = wrapAnsi(g2(o2[t2], t2 === l2), i, {
1461
+ hard: true,
1462
+ trim: false
1463
+ }).split(`
1329
1464
  `);
1330
- m2.push(G2), y += G2.length;
1331
- }
1332
- if (y > d) {
1333
- let b2 = 0, G2 = 0, M = y;
1334
- const N2 = t - v2;
1335
- let O2 = d;
1336
- const j2 = () => Ot(m2, M, 0, N2, O2), k2 = () => Ot(m2, M, N2 + 1, m2.length, O2, true);
1337
- f2 ? ({ lineCount: M, removals: b2 } = j2(), M > O2 && (h2 || (O2 -= 1), { lineCount: M, removals: G2 } = k2())) : (h2 || (O2 -= 1), { lineCount: M, removals: G2 } = k2(), M > O2 && (O2 -= 1, { lineCount: M, removals: b2 } = j2())), b2 > 0 && (f2 = true, m2.splice(0, b2)), G2 > 0 && (h2 = true, m2.splice(m2.length - G2, G2));
1338
- }
1339
- const S2 = [];
1340
- f2 && S2.push(l);
1341
- for (const b2 of m2)
1342
- for (const G2 of b2)
1343
- S2.push(G2);
1344
- return h2 && S2.push(l), S2;
1465
+ e.push(n2), d += n2.length;
1466
+ }
1467
+ if (d > x) {
1468
+ let t2 = 0, n2 = 0, s = d;
1469
+ const M2 = l2 - v;
1470
+ let a3 = x;
1471
+ const T3 = () => E$1(e, s, 0, M2, a3), L = () => E$1(e, s, M2 + 1, e.length, a3, true);
1472
+ f2 ? ({ lineCount: s, removals: t2 } = T3(), s > a3 && (u3 || (a3 -= 1), { lineCount: s, removals: n2 } = L())) : (u3 || (a3 -= 1), { lineCount: s, removals: n2 } = L(), s > a3 && (a3 -= 1, { lineCount: s, removals: t2 } = T3())), t2 > 0 && (f2 = true, e.splice(0, t2)), n2 > 0 && (u3 = true, e.splice(e.length - n2, n2));
1473
+ }
1474
+ const b2 = [];
1475
+ f2 && b2.push(C2);
1476
+ for (const t2 of e)
1477
+ for (const n2 of t2)
1478
+ b2.push(n2);
1479
+ return u3 && b2.push(C2), b2;
1345
1480
  };
1346
- var ue = (t) => {
1347
- const i = t.active ?? "Yes", s = t.inactive ?? "No";
1348
- return new X2({ active: i, inactive: s, signal: t.signal, input: t.input, output: t.output, initialValue: t.initialValue ?? true, render() {
1349
- const r = t.withGuide ?? h.withGuide, u = `${P2(this.state)} `, n = r ? `${e("gray", $2)} ` : "", a = W(t.output, t.message, n, u), c = `${r ? `${e("gray", $2)}
1350
- ` : ""}${a}
1351
- `, o = this.value ? i : s;
1352
- switch (this.state) {
1353
- case "submit": {
1354
- const l = r ? `${e("gray", $2)} ` : "";
1355
- return `${c}${l}${e("dim", o)}`;
1356
- }
1357
- case "cancel": {
1358
- const l = r ? `${e("gray", $2)} ` : "";
1359
- return `${c}${l}${e(["strikethrough", "dim"], o)}${r ? `
1360
- ${e("gray", $2)}` : ""}`;
1361
- }
1362
- default: {
1363
- const l = r ? `${e("cyan", $2)} ` : "", d = r ? e("cyan", x2) : "";
1364
- return `${c}${l}${this.value ? `${e("green", z2)} ${i}` : `${e("dim", U2)} ${e("dim", i)}`}${t.vertical ? r ? `
1365
- ${e("cyan", $2)} ` : `
1366
- ` : ` ${e("dim", "/")} `}${this.value ? `${e("dim", U2)} ${e("dim", s)}` : `${e("green", z2)} ${s}`}
1367
- ${d}
1481
+ var confirm = (i) => {
1482
+ const a3 = i.active ?? "Yes", s = i.inactive ?? "No";
1483
+ return new r({
1484
+ active: a3,
1485
+ inactive: s,
1486
+ signal: i.signal,
1487
+ input: i.input,
1488
+ output: i.output,
1489
+ initialValue: i.initialValue ?? true,
1490
+ render() {
1491
+ const e = i.withGuide ?? settings.withGuide, u3 = `${symbol(this.state)} `, l2 = e ? `${styleText2("gray", S_BAR)} ` : "", f2 = wrapTextWithPrefix(i.output, i.message, l2, u3), o2 = `${e ? `${styleText2("gray", S_BAR)}
1492
+ ` : ""}${f2}
1493
+ `, c2 = this.value ? a3 : s;
1494
+ switch (this.state) {
1495
+ case "submit": {
1496
+ const r2 = e ? `${styleText2("gray", S_BAR)} ` : "";
1497
+ return `${o2}${r2}${styleText2("dim", c2)}`;
1498
+ }
1499
+ case "cancel": {
1500
+ const r2 = e ? `${styleText2("gray", S_BAR)} ` : "";
1501
+ return `${o2}${r2}${styleText2(["strikethrough", "dim"], c2)}${e ? `
1502
+ ${styleText2("gray", S_BAR)}` : ""}`;
1503
+ }
1504
+ default: {
1505
+ const r2 = e ? `${styleText2("cyan", S_BAR)} ` : "", g2 = e ? styleText2("cyan", S_BAR_END) : "";
1506
+ return `${o2}${r2}${this.value ? `${styleText2("green", S_RADIO_ACTIVE)} ${a3}` : `${styleText2("dim", S_RADIO_INACTIVE)} ${styleText2("dim", a3)}`}${i.vertical ? e ? `
1507
+ ${styleText2("cyan", S_BAR)} ` : `
1508
+ ` : ` ${styleText2("dim", "/")} `}${this.value ? `${styleText2("dim", S_RADIO_INACTIVE)} ${styleText2("dim", s)}` : `${styleText2("green", S_RADIO_ACTIVE)} ${s}`}
1509
+ ${g2}
1368
1510
  `;
1511
+ }
1369
1512
  }
1370
1513
  }
1371
- } }).prompt();
1514
+ }).prompt();
1372
1515
  };
1373
- var me = (t = "", i) => {
1374
- const s = i?.output ?? process.stdout, r = i?.withGuide ?? h.withGuide ? `${e("gray", x2)} ` : "";
1375
- s.write(`${r}${e("red", t)}
1516
+ var cancel = (o2 = "", t2) => {
1517
+ const i = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_END)} ` : "";
1518
+ i.write(`${e}${styleText2("red", o2)}
1376
1519
 
1377
1520
  `);
1378
1521
  };
1379
- var ge = (t = "", i) => {
1380
- const s = i?.output ?? process.stdout, r = i?.withGuide ?? h.withGuide ? `${e("gray", lt)} ` : "";
1381
- s.write(`${r}${t}
1522
+ var intro = (o2 = "", t2) => {
1523
+ const i = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_START)} ` : "";
1524
+ i.write(`${e}${o2}
1382
1525
  `);
1383
1526
  };
1384
- var ye = (t = "", i) => {
1385
- const s = i?.output ?? process.stdout, r = i?.withGuide ?? h.withGuide ? `${e("gray", $2)}
1386
- ${e("gray", x2)} ` : "";
1387
- s.write(`${r}${t}
1527
+ var outro = (o2 = "", t2) => {
1528
+ const i = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR)}
1529
+ ${styleText2("gray", S_BAR_END)} ` : "";
1530
+ i.write(`${e}${o2}
1388
1531
 
1389
1532
  `);
1390
1533
  };
1391
- var Q2 = (t, i) => t.split(`
1392
- `).map((s) => i(s)).join(`
1534
+ var d = (n2, a3) => n2.split(`
1535
+ `).map((m2) => a3(m2)).join(`
1393
1536
  `);
1394
- var ve = (t) => {
1395
- const i = (r, u) => {
1396
- const n = r.label ?? String(r.value);
1397
- return u === "disabled" ? `${e("gray", Y2)} ${Q2(n, (a) => e(["strikethrough", "gray"], a))}${r.hint ? ` ${e("dim", `(${r.hint ?? "disabled"})`)}` : ""}` : u === "active" ? `${e("cyan", et2)} ${n}${r.hint ? ` ${e("dim", `(${r.hint})`)}` : ""}` : u === "selected" ? `${e("green", K2)} ${Q2(n, (a) => e("dim", a))}${r.hint ? ` ${e("dim", `(${r.hint})`)}` : ""}` : u === "cancelled" ? `${Q2(n, (a) => e(["strikethrough", "dim"], a))}` : u === "active-selected" ? `${e("green", K2)} ${n}${r.hint ? ` ${e("dim", `(${r.hint})`)}` : ""}` : u === "submitted" ? `${Q2(n, (a) => e("dim", a))}` : `${e("dim", Y2)} ${Q2(n, (a) => e("dim", a))}`;
1398
- }, s = t.required ?? true;
1399
- return new nt({ options: t.options, signal: t.signal, input: t.input, output: t.output, initialValues: t.initialValues, required: s, cursorAt: t.cursorAt, validate(r) {
1400
- if (s && (r === undefined || r.length === 0))
1401
- return `Please select at least one option.
1402
- ${e("reset", e("dim", `Press ${e(["gray", "bgWhite", "inverse"], " space ")} to select, ${e("gray", e("bgWhite", e("inverse", " enter ")))} to submit`))}`;
1403
- }, render() {
1404
- const r = t.withGuide ?? h.withGuide, u = W(t.output, t.message, r ? `${yt(this.state)} ` : "", `${P2(this.state)} `), n = `${r ? `${e("gray", $2)}
1405
- ` : ""}${u}
1406
- `, a = this.value ?? [], c = (o, l) => {
1407
- if (o.disabled)
1408
- return i(o, "disabled");
1409
- const d = a.includes(o.value);
1410
- return l && d ? i(o, "active-selected") : d ? i(o, "selected") : i(o, l ? "active" : "inactive");
1411
- };
1412
- switch (this.state) {
1413
- case "submit": {
1414
- const o = this.options.filter(({ value: d }) => a.includes(d)).map((d) => i(d, "submitted")).join(e("dim", ", ")) || e("dim", "none"), l = W(t.output, o, r ? `${e("gray", $2)} ` : "");
1415
- return `${n}${l}`;
1416
- }
1417
- case "cancel": {
1418
- const o = this.options.filter(({ value: d }) => a.includes(d)).map((d) => i(d, "cancelled")).join(e("dim", ", "));
1419
- if (o.trim() === "")
1420
- return `${n}${e("gray", $2)}`;
1421
- const l = W(t.output, o, r ? `${e("gray", $2)} ` : "");
1422
- return `${n}${l}${r ? `
1423
- ${e("gray", $2)}` : ""}`;
1424
- }
1425
- case "error": {
1426
- const o = r ? `${e("yellow", $2)} ` : "", l = this.error.split(`
1427
- `).map((p2, f2) => f2 === 0 ? `${r ? `${e("yellow", x2)} ` : ""}${e("yellow", p2)}` : ` ${p2}`).join(`
1428
- `), d = n.split(`
1429
- `).length, g = l.split(`
1537
+ var multiselect = (n2) => {
1538
+ const a3 = (t2, o2) => {
1539
+ const r2 = t2.label ?? String(t2.value);
1540
+ return o2 === "disabled" ? `${styleText2("gray", S_CHECKBOX_INACTIVE)} ${d(r2, (l2) => styleText2(["strikethrough", "gray"], l2))}${t2.hint ? ` ${styleText2("dim", `(${t2.hint ?? "disabled"})`)}` : ""}` : o2 === "active" ? `${styleText2("cyan", S_CHECKBOX_ACTIVE)} ${r2}${t2.hint ? ` ${styleText2("dim", `(${t2.hint})`)}` : ""}` : o2 === "selected" ? `${styleText2("green", S_CHECKBOX_SELECTED)} ${d(r2, (l2) => styleText2("dim", l2))}${t2.hint ? ` ${styleText2("dim", `(${t2.hint})`)}` : ""}` : o2 === "cancelled" ? `${d(r2, (l2) => styleText2(["strikethrough", "dim"], l2))}` : o2 === "active-selected" ? `${styleText2("green", S_CHECKBOX_SELECTED)} ${r2}${t2.hint ? ` ${styleText2("dim", `(${t2.hint})`)}` : ""}` : o2 === "submitted" ? `${d(r2, (l2) => styleText2("dim", l2))}` : `${styleText2("dim", S_CHECKBOX_INACTIVE)} ${d(r2, (l2) => styleText2("dim", l2))}`;
1541
+ }, m2 = n2.required ?? true;
1542
+ return new a$1({
1543
+ options: n2.options,
1544
+ signal: n2.signal,
1545
+ input: n2.input,
1546
+ output: n2.output,
1547
+ initialValues: n2.initialValues,
1548
+ required: m2,
1549
+ cursorAt: n2.cursorAt,
1550
+ validate(t2) {
1551
+ if (m2 && (t2 === undefined || t2.length === 0))
1552
+ return `Please select at least one option.
1553
+ ${styleText2("reset", styleText2("dim", `Press ${styleText2(["gray", "bgWhite", "inverse"], " space ")} to select, ${styleText2("gray", styleText2("bgWhite", styleText2("inverse", " enter ")))} to submit`))}`;
1554
+ },
1555
+ render() {
1556
+ const t2 = n2.withGuide ?? settings.withGuide, o2 = wrapTextWithPrefix(n2.output, n2.message, t2 ? `${symbolBar(this.state)} ` : "", `${symbol(this.state)} `), r2 = `${t2 ? `${styleText2("gray", S_BAR)}
1557
+ ` : ""}${o2}
1558
+ `, l2 = this.value ?? [], g2 = (i, u3) => {
1559
+ if (i.disabled)
1560
+ return a3(i, "disabled");
1561
+ const s = l2.includes(i.value);
1562
+ return u3 && s ? a3(i, "active-selected") : s ? a3(i, "selected") : a3(i, u3 ? "active" : "inactive");
1563
+ };
1564
+ switch (this.state) {
1565
+ case "submit": {
1566
+ const i = this.options.filter(({ value: s }) => l2.includes(s)).map((s) => a3(s, "submitted")).join(styleText2("dim", ", ")) || styleText2("dim", "none"), u3 = wrapTextWithPrefix(n2.output, i, t2 ? `${styleText2("gray", S_BAR)} ` : "");
1567
+ return `${r2}${u3}`;
1568
+ }
1569
+ case "cancel": {
1570
+ const i = this.options.filter(({ value: s }) => l2.includes(s)).map((s) => a3(s, "cancelled")).join(styleText2("dim", ", "));
1571
+ if (i.trim() === "")
1572
+ return `${r2}${styleText2("gray", S_BAR)}`;
1573
+ const u3 = wrapTextWithPrefix(n2.output, i, t2 ? `${styleText2("gray", S_BAR)} ` : "");
1574
+ return `${r2}${u3}${t2 ? `
1575
+ ${styleText2("gray", S_BAR)}` : ""}`;
1576
+ }
1577
+ case "error": {
1578
+ const i = t2 ? `${styleText2("yellow", S_BAR)} ` : "", u3 = this.error.split(`
1579
+ `).map((h2, x) => x === 0 ? `${t2 ? `${styleText2("yellow", S_BAR_END)} ` : ""}${styleText2("yellow", h2)}` : ` ${h2}`).join(`
1580
+ `), s = r2.split(`
1581
+ `).length, v = u3.split(`
1430
1582
  `).length + 1;
1431
- return `${n}${o}${F2({ output: t.output, options: this.options, cursor: this.cursor, maxItems: t.maxItems, columnPadding: o.length, rowPadding: d + g, style: c }).join(`
1432
- ${o}`)}
1433
- ${l}
1583
+ return `${r2}${i}${limitOptions({
1584
+ output: n2.output,
1585
+ options: this.options,
1586
+ cursor: this.cursor,
1587
+ maxItems: n2.maxItems,
1588
+ columnPadding: i.length,
1589
+ rowPadding: s + v,
1590
+ style: g2
1591
+ }).join(`
1592
+ ${i}`)}
1593
+ ${u3}
1434
1594
  `;
1435
- }
1436
- default: {
1437
- const o = r ? `${e("cyan", $2)} ` : "", l = n.split(`
1438
- `).length, d = r ? 2 : 1;
1439
- return `${n}${o}${F2({ output: t.output, options: this.options, cursor: this.cursor, maxItems: t.maxItems, columnPadding: o.length, rowPadding: l + d, style: c }).join(`
1440
- ${o}`)}
1441
- ${r ? e("cyan", x2) : ""}
1595
+ }
1596
+ default: {
1597
+ const i = t2 ? `${styleText2("cyan", S_BAR)} ` : "", u3 = r2.split(`
1598
+ `).length, s = t2 ? 2 : 1;
1599
+ return `${r2}${i}${limitOptions({
1600
+ output: n2.output,
1601
+ options: this.options,
1602
+ cursor: this.cursor,
1603
+ maxItems: n2.maxItems,
1604
+ columnPadding: i.length,
1605
+ rowPadding: u3 + s,
1606
+ style: g2
1607
+ }).join(`
1608
+ ${i}`)}
1609
+ ${t2 ? styleText2("cyan", S_BAR_END) : ""}
1442
1610
  `;
1611
+ }
1443
1612
  }
1444
1613
  }
1445
- } }).prompt();
1614
+ }).prompt();
1446
1615
  };
1447
- var Te = (t) => e("magenta", t);
1448
- var ft = ({ indicator: t = "dots", onCancel: i, output: s = process.stdout, cancelMessage: r, errorMessage: u, frames: n = tt2 ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], delay: a = tt2 ? 80 : 120, signal: c, ...o } = {}) => {
1449
- const l = ot2();
1450
- let d, g, p2 = false, f2 = false, h2 = "", I2, m2 = performance.now();
1451
- const y = A(s), v2 = o?.styleFrame ?? Te, C2 = (_) => {
1452
- const A2 = _ > 1 ? u ?? h.messages.error : r ?? h.messages.cancel;
1453
- f2 = _ === 1, p2 && (W2(A2, _), f2 && typeof i == "function" && i());
1454
- }, S2 = () => C2(2), b2 = () => C2(1), G2 = () => {
1455
- process.on("uncaughtExceptionMonitor", S2), process.on("unhandledRejection", S2), process.on("SIGINT", b2), process.on("SIGTERM", b2), process.on("exit", C2), c && c.addEventListener("abort", b2);
1456
- }, M = () => {
1457
- process.removeListener("uncaughtExceptionMonitor", S2), process.removeListener("unhandledRejection", S2), process.removeListener("SIGINT", b2), process.removeListener("SIGTERM", b2), process.removeListener("exit", C2), c && c.removeEventListener("abort", b2);
1458
- }, N2 = () => {
1459
- if (I2 === undefined)
1616
+ var W = (l2) => styleText2("magenta", l2);
1617
+ var spinner = ({
1618
+ indicator: l2 = "dots",
1619
+ onCancel: h2,
1620
+ output: n2 = process.stdout,
1621
+ cancelMessage: G,
1622
+ errorMessage: O,
1623
+ frames: E = unicode ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"],
1624
+ delay: F = unicode ? 80 : 120,
1625
+ signal: m2,
1626
+ ...I
1627
+ } = {}) => {
1628
+ const u3 = isCI();
1629
+ let M2, T3, d2 = false, S = false, s = "", p2, w = performance.now();
1630
+ const x = getColumns(n2), k = I?.styleFrame ?? W, g2 = (e) => {
1631
+ const r2 = e > 1 ? O ?? settings.messages.error : G ?? settings.messages.cancel;
1632
+ S = e === 1, d2 && (a3(r2, e), S && typeof h2 == "function" && h2());
1633
+ }, f2 = () => g2(2), i = () => g2(1), A = () => {
1634
+ process.on("uncaughtExceptionMonitor", f2), process.on("unhandledRejection", f2), process.on("SIGINT", i), process.on("SIGTERM", i), process.on("exit", g2), m2 && m2.addEventListener("abort", i);
1635
+ }, H = () => {
1636
+ process.removeListener("uncaughtExceptionMonitor", f2), process.removeListener("unhandledRejection", f2), process.removeListener("SIGINT", i), process.removeListener("SIGTERM", i), process.removeListener("exit", g2), m2 && m2.removeEventListener("abort", i);
1637
+ }, y = () => {
1638
+ if (p2 === undefined)
1460
1639
  return;
1461
- l && s.write(`
1640
+ u3 && n2.write(`
1462
1641
  `);
1463
- const _ = wrapAnsi(I2, y, { hard: true, trim: false }).split(`
1642
+ const r2 = wrapAnsi(p2, x, {
1643
+ hard: true,
1644
+ trim: false
1645
+ }).split(`
1464
1646
  `);
1465
- _.length > 1 && s.write(import_sisteransi2.cursor.up(_.length - 1)), s.write(import_sisteransi2.cursor.to(0)), s.write(import_sisteransi2.erase.down());
1466
- }, O2 = (_) => _.replace(/\.+$/, ""), j2 = (_) => {
1467
- const A2 = (performance.now() - _) / 1000, L2 = Math.floor(A2 / 60), D2 = Math.floor(A2 % 60);
1468
- return L2 > 0 ? `[${L2}m ${D2}s]` : `[${D2}s]`;
1469
- }, k2 = o.withGuide ?? h.withGuide, rt2 = (_ = "") => {
1470
- p2 = true, d = R({ output: s }), h2 = O2(_), m2 = performance.now(), k2 && s.write(`${e("gray", $2)}
1647
+ r2.length > 1 && n2.write(import_sisteransi2.cursor.up(r2.length - 1)), n2.write(import_sisteransi2.cursor.to(0)), n2.write(import_sisteransi2.erase.down());
1648
+ }, C2 = (e) => e.replace(/\.+$/, ""), _2 = (e) => {
1649
+ const r2 = (performance.now() - e) / 1000, t2 = Math.floor(r2 / 60), o2 = Math.floor(r2 % 60);
1650
+ return t2 > 0 ? `[${t2}m ${o2}s]` : `[${o2}s]`;
1651
+ }, N = I.withGuide ?? settings.withGuide, P2 = (e = "") => {
1652
+ d2 = true, M2 = block({ output: n2 }), s = C2(e), w = performance.now(), N && n2.write(`${styleText2("gray", S_BAR)}
1471
1653
  `);
1472
- let A2 = 0, L2 = 0;
1473
- G2(), g = setInterval(() => {
1474
- if (l && h2 === I2)
1654
+ let r2 = 0, t2 = 0;
1655
+ A(), T3 = setInterval(() => {
1656
+ if (u3 && s === p2)
1475
1657
  return;
1476
- N2(), I2 = h2;
1477
- const D2 = v2(n[A2]);
1478
- let Z2;
1479
- if (l)
1480
- Z2 = `${D2} ${h2}...`;
1481
- else if (t === "timer")
1482
- Z2 = `${D2} ${h2} ${j2(m2)}`;
1658
+ y(), p2 = s;
1659
+ const o2 = k(E[r2]);
1660
+ let v;
1661
+ if (u3)
1662
+ v = `${o2} ${s}...`;
1663
+ else if (l2 === "timer")
1664
+ v = `${o2} ${s} ${_2(w)}`;
1483
1665
  else {
1484
- const kt = ".".repeat(Math.floor(L2)).slice(0, 3);
1485
- Z2 = `${D2} ${h2}${kt}`;
1666
+ const B = ".".repeat(Math.floor(t2)).slice(0, 3);
1667
+ v = `${o2} ${s}${B}`;
1486
1668
  }
1487
- const Bt = wrapAnsi(Z2, y, { hard: true, trim: false });
1488
- s.write(Bt), A2 = A2 + 1 < n.length ? A2 + 1 : 0, L2 = L2 < 4 ? L2 + 0.125 : 0;
1489
- }, a);
1490
- }, W2 = (_ = "", A2 = 0, L2 = false) => {
1491
- if (!p2)
1669
+ const j = wrapAnsi(v, x, {
1670
+ hard: true,
1671
+ trim: false
1672
+ });
1673
+ n2.write(j), r2 = r2 + 1 < E.length ? r2 + 1 : 0, t2 = t2 < 4 ? t2 + 0.125 : 0;
1674
+ }, F);
1675
+ }, a3 = (e = "", r2 = 0, t2 = false) => {
1676
+ if (!d2)
1492
1677
  return;
1493
- p2 = false, clearInterval(g), N2();
1494
- const D2 = A2 === 0 ? e("green", H2) : A2 === 1 ? e("red", at2) : e("red", ut2);
1495
- h2 = _ ?? h2, L2 || (t === "timer" ? s.write(`${D2} ${h2} ${j2(m2)}
1496
- `) : s.write(`${D2} ${h2}
1497
- `)), M(), d();
1678
+ d2 = false, clearInterval(T3), y();
1679
+ const o2 = r2 === 0 ? styleText2("green", S_STEP_SUBMIT) : r2 === 1 ? styleText2("red", S_STEP_CANCEL) : styleText2("red", S_STEP_ERROR);
1680
+ s = e ?? s, t2 || (l2 === "timer" ? n2.write(`${o2} ${s} ${_2(w)}
1681
+ `) : n2.write(`${o2} ${s}
1682
+ `)), H(), M2();
1683
+ };
1684
+ return {
1685
+ start: P2,
1686
+ stop: (e = "") => a3(e, 0),
1687
+ message: (e = "") => {
1688
+ s = C2(e ?? s);
1689
+ },
1690
+ cancel: (e = "") => a3(e, 1),
1691
+ error: (e = "") => a3(e, 2),
1692
+ clear: () => a3("", 0, true),
1693
+ get isCancelled() {
1694
+ return S;
1695
+ }
1498
1696
  };
1499
- return { start: rt2, stop: (_ = "") => W2(_, 0), message: (_ = "") => {
1500
- h2 = O2(_ ?? h2);
1501
- }, cancel: (_ = "") => W2(_, 1), error: (_ = "") => W2(_, 2), clear: () => W2("", 0, true), get isCancelled() {
1502
- return f2;
1503
- } };
1504
1697
  };
1505
- var jt = { light: w2("\u2500", "-"), heavy: w2("\u2501", "="), block: w2("\u2588", "#") };
1506
- var it2 = (t, i) => t.includes(`
1507
- `) ? t.split(`
1508
- `).map((s) => i(s)).join(`
1509
- `) : i(t);
1510
- var xe = (t) => {
1511
- const i = (s, r) => {
1512
- const u = s.label ?? String(s.value);
1513
- switch (r) {
1698
+ var u3 = {
1699
+ light: unicodeOr("\u2500", "-"),
1700
+ heavy: unicodeOr("\u2501", "="),
1701
+ block: unicodeOr("\u2588", "#")
1702
+ };
1703
+ var c2 = (e, a3) => e.includes(`
1704
+ `) ? e.split(`
1705
+ `).map((t2) => a3(t2)).join(`
1706
+ `) : a3(e);
1707
+ var select = (e) => {
1708
+ const a3 = (t2, d2) => {
1709
+ const s = t2.label ?? String(t2.value);
1710
+ switch (d2) {
1514
1711
  case "disabled":
1515
- return `${e("gray", U2)} ${it2(u, (n) => e("gray", n))}${s.hint ? ` ${e("dim", `(${s.hint ?? "disabled"})`)}` : ""}`;
1712
+ return `${styleText2("gray", S_RADIO_INACTIVE)} ${c2(s, (n2) => styleText2("gray", n2))}${t2.hint ? ` ${styleText2("dim", `(${t2.hint ?? "disabled"})`)}` : ""}`;
1516
1713
  case "selected":
1517
- return `${it2(u, (n) => e("dim", n))}`;
1714
+ return `${c2(s, (n2) => styleText2("dim", n2))}`;
1518
1715
  case "active":
1519
- return `${e("green", z2)} ${u}${s.hint ? ` ${e("dim", `(${s.hint})`)}` : ""}`;
1716
+ return `${styleText2("green", S_RADIO_ACTIVE)} ${s}${t2.hint ? ` ${styleText2("dim", `(${t2.hint})`)}` : ""}`;
1520
1717
  case "cancelled":
1521
- return `${it2(u, (n) => e(["strikethrough", "dim"], n))}`;
1718
+ return `${c2(s, (n2) => styleText2(["strikethrough", "dim"], n2))}`;
1522
1719
  default:
1523
- return `${e("dim", U2)} ${it2(u, (n) => e("dim", n))}`;
1720
+ return `${styleText2("dim", S_RADIO_INACTIVE)} ${c2(s, (n2) => styleText2("dim", n2))}`;
1524
1721
  }
1525
1722
  };
1526
- return new ut({ options: t.options, signal: t.signal, input: t.input, output: t.output, initialValue: t.initialValue, render() {
1527
- const s = t.withGuide ?? h.withGuide, r = `${P2(this.state)} `, u = `${yt(this.state)} `, n = W(t.output, t.message, u, r), a = `${s ? `${e("gray", $2)}
1528
- ` : ""}${n}
1723
+ return new a2({
1724
+ options: e.options,
1725
+ signal: e.signal,
1726
+ input: e.input,
1727
+ output: e.output,
1728
+ initialValue: e.initialValue,
1729
+ render() {
1730
+ const t2 = e.withGuide ?? settings.withGuide, d2 = `${symbol(this.state)} `, s = `${symbolBar(this.state)} `, n2 = wrapTextWithPrefix(e.output, e.message, s, d2), u4 = `${t2 ? `${styleText2("gray", S_BAR)}
1731
+ ` : ""}${n2}
1732
+ `;
1733
+ switch (this.state) {
1734
+ case "submit": {
1735
+ const r2 = t2 ? `${styleText2("gray", S_BAR)} ` : "", l2 = wrapTextWithPrefix(e.output, a3(this.options[this.cursor], "selected"), r2);
1736
+ return `${u4}${l2}`;
1737
+ }
1738
+ case "cancel": {
1739
+ const r2 = t2 ? `${styleText2("gray", S_BAR)} ` : "", l2 = wrapTextWithPrefix(e.output, a3(this.options[this.cursor], "cancelled"), r2);
1740
+ return `${u4}${l2}${t2 ? `
1741
+ ${styleText2("gray", S_BAR)}` : ""}`;
1742
+ }
1743
+ default: {
1744
+ const r2 = t2 ? `${styleText2("cyan", S_BAR)} ` : "", l2 = t2 ? styleText2("cyan", S_BAR_END) : "", g2 = u4.split(`
1745
+ `).length, h2 = t2 ? 2 : 1;
1746
+ return `${u4}${r2}${limitOptions({
1747
+ output: e.output,
1748
+ cursor: this.cursor,
1749
+ options: this.options,
1750
+ maxItems: e.maxItems,
1751
+ columnPadding: r2.length,
1752
+ rowPadding: g2 + h2,
1753
+ style: (p2, b2) => a3(p2, p2.disabled ? "disabled" : b2 ? "active" : "inactive")
1754
+ }).join(`
1755
+ ${r2}`)}
1756
+ ${l2}
1529
1757
  `;
1758
+ }
1759
+ }
1760
+ }
1761
+ }).prompt();
1762
+ };
1763
+ var i = `${styleText2("gray", S_BAR)} `;
1764
+ var text = (t2) => new n({
1765
+ validate: t2.validate,
1766
+ placeholder: t2.placeholder,
1767
+ defaultValue: t2.defaultValue,
1768
+ initialValue: t2.initialValue,
1769
+ output: t2.output,
1770
+ signal: t2.signal,
1771
+ input: t2.input,
1772
+ render() {
1773
+ const i2 = t2?.withGuide ?? settings.withGuide, s = `${`${i2 ? `${styleText2("gray", S_BAR)}
1774
+ ` : ""}${symbol(this.state)} `}${t2.message}
1775
+ `, c3 = t2.placeholder ? styleText2("inverse", t2.placeholder[0]) + styleText2("dim", t2.placeholder.slice(1)) : styleText2(["inverse", "hidden"], "_"), o2 = this.userInput ? this.userInputWithCursor : c3, a3 = this.value ?? "";
1530
1776
  switch (this.state) {
1777
+ case "error": {
1778
+ const n2 = this.error ? ` ${styleText2("yellow", this.error)}` : "", r2 = i2 ? `${styleText2("yellow", S_BAR)} ` : "", d2 = i2 ? styleText2("yellow", S_BAR_END) : "";
1779
+ return `${s.trim()}
1780
+ ${r2}${o2}
1781
+ ${d2}${n2}
1782
+ `;
1783
+ }
1531
1784
  case "submit": {
1532
- const c = s ? `${e("gray", $2)} ` : "", o = W(t.output, i(this.options[this.cursor], "selected"), c);
1533
- return `${a}${o}`;
1785
+ const n2 = a3 ? ` ${styleText2("dim", a3)}` : "", r2 = i2 ? styleText2("gray", S_BAR) : "";
1786
+ return `${s}${r2}${n2}`;
1534
1787
  }
1535
1788
  case "cancel": {
1536
- const c = s ? `${e("gray", $2)} ` : "", o = W(t.output, i(this.options[this.cursor], "cancelled"), c);
1537
- return `${a}${o}${s ? `
1538
- ${e("gray", $2)}` : ""}`;
1789
+ const n2 = a3 ? ` ${styleText2(["strikethrough", "dim"], a3)}` : "", r2 = i2 ? styleText2("gray", S_BAR) : "";
1790
+ return `${s}${r2}${n2}${a3.trim() ? `
1791
+ ${r2}` : ""}`;
1539
1792
  }
1540
1793
  default: {
1541
- const c = s ? `${e("cyan", $2)} ` : "", o = s ? e("cyan", x2) : "", l = a.split(`
1542
- `).length, d = s ? 2 : 1;
1543
- return `${a}${c}${F2({ output: t.output, cursor: this.cursor, options: this.options, maxItems: t.maxItems, columnPadding: c.length, rowPadding: l + d, style: (g, p2) => i(g, g.disabled ? "disabled" : p2 ? "active" : "inactive") }).join(`
1544
- ${c}`)}
1545
- ${o}
1794
+ const n2 = i2 ? `${styleText2("cyan", S_BAR)} ` : "", r2 = i2 ? styleText2("cyan", S_BAR_END) : "";
1795
+ return `${s}${n2}${o2}
1796
+ ${r2}
1546
1797
  `;
1547
1798
  }
1548
1799
  }
1549
- } }).prompt();
1550
- };
1551
- var Nt = `${e("gray", $2)} `;
1552
- var Pe = (t) => new ht({ validate: t.validate, placeholder: t.placeholder, defaultValue: t.defaultValue, initialValue: t.initialValue, output: t.output, signal: t.signal, input: t.input, render() {
1553
- const i = t?.withGuide ?? h.withGuide, s = `${`${i ? `${e("gray", $2)}
1554
- ` : ""}${P2(this.state)} `}${t.message}
1555
- `, r = t.placeholder ? e("inverse", t.placeholder[0]) + e("dim", t.placeholder.slice(1)) : e(["inverse", "hidden"], "_"), u = this.userInput ? this.userInputWithCursor : r, n = this.value ?? "";
1556
- switch (this.state) {
1557
- case "error": {
1558
- const a = this.error ? ` ${e("yellow", this.error)}` : "", c = i ? `${e("yellow", $2)} ` : "", o = i ? e("yellow", x2) : "";
1559
- return `${s.trim()}
1560
- ${c}${u}
1561
- ${o}${a}
1562
- `;
1563
- }
1564
- case "submit": {
1565
- const a = n ? ` ${e("dim", n)}` : "", c = i ? e("gray", $2) : "";
1566
- return `${s}${c}${a}`;
1567
- }
1568
- case "cancel": {
1569
- const a = n ? ` ${e(["strikethrough", "dim"], n)}` : "", c = i ? e("gray", $2) : "";
1570
- return `${s}${c}${a}${n.trim() ? `
1571
- ${c}` : ""}`;
1572
- }
1573
- default: {
1574
- const a = i ? `${e("cyan", $2)} ` : "", c = i ? e("cyan", x2) : "";
1575
- return `${s}${a}${u}
1576
- ${c}
1577
- `;
1578
- }
1579
1800
  }
1580
- } }).prompt();
1801
+ }).prompt();
1581
1802
 
1582
1803
  // apps/cli/utils/multiselect.ts
1583
1804
  async function MultiSelect({
1584
1805
  message,
1585
1806
  options
1586
1807
  }) {
1587
- const selected = await ve({
1808
+ const selected = await multiselect({
1588
1809
  message,
1589
1810
  options,
1590
1811
  required: true
1591
1812
  });
1592
- if (q(selected)) {
1593
- me("Operation cancelled.");
1813
+ if (isCancel(selected)) {
1814
+ cancel("Operation cancelled.");
1594
1815
  process.exit(0);
1595
1816
  }
1596
1817
  return selected;
@@ -1611,7 +1832,7 @@ class AddCommand {
1611
1832
  console.log(`${CHECK({ text: "All changes are either staged or sensitive (like .env)." })}`);
1612
1833
  return;
1613
1834
  }
1614
- const options = changes.map((c) => ({ value: c.value, label: c.label }));
1835
+ const options = changes.map((c3) => ({ value: c3.value, label: c3.label }));
1615
1836
  const selectedChanges = await MultiSelect({
1616
1837
  message: `Select the changes you want to commit.
1617
1838
  ` + BLUE({ text: "[space] to select" }) + `
@@ -1623,7 +1844,7 @@ class AddCommand {
1623
1844
  });
1624
1845
  let selected = selectedChanges.map((file) => file.trim());
1625
1846
  if (selected.includes("all")) {
1626
- selected = changes.map((c) => c.value);
1847
+ selected = changes.map((c3) => c3.value);
1627
1848
  }
1628
1849
  if (selected.length > 0) {
1629
1850
  await this.stageChangesUseCase.execute(selected);
@@ -1688,8 +1909,8 @@ class Change {
1688
1909
  }
1689
1910
  static fromPorcelain(entries) {
1690
1911
  const changes = [];
1691
- for (let i = 0;i < entries.length; i++) {
1692
- const entry = entries[i];
1912
+ for (let i2 = 0;i2 < entries.length; i2++) {
1913
+ const entry = entries[i2];
1693
1914
  if (!entry)
1694
1915
  continue;
1695
1916
  const status = entry.slice(0, 2);
@@ -1700,7 +1921,7 @@ class Change {
1700
1921
  let displayPath = file;
1701
1922
  const value = file;
1702
1923
  if (status.startsWith("R") || status.startsWith("C")) {
1703
- const source = entries[++i];
1924
+ const source = entries[++i2];
1704
1925
  displayPath = `${source} -> ${file}`;
1705
1926
  }
1706
1927
  changes.push(new Change({ value, status, displayPath }));
@@ -1750,11 +1971,11 @@ class StageChangesUseCase {
1750
1971
  }
1751
1972
 
1752
1973
  // apps/cli/modules/add/infra/bun-git.repository.ts
1753
- var {$: $3 } = globalThis.Bun;
1974
+ var {$ } = globalThis.Bun;
1754
1975
  class BunGitRepository {
1755
1976
  async getEntries() {
1756
1977
  try {
1757
- const output = await $3`git status --porcelain -z`.quiet().text();
1978
+ const output = await $`git status --porcelain -z`.quiet().text();
1758
1979
  if (!output.trim()) {
1759
1980
  return [];
1760
1981
  }
@@ -1891,7 +2112,7 @@ async function Input({
1891
2112
  message,
1892
2113
  placeholder
1893
2114
  }) {
1894
- const value = await Pe({
2115
+ const value = await text({
1895
2116
  message,
1896
2117
  placeholder,
1897
2118
  validate(input) {
@@ -1900,8 +2121,8 @@ async function Input({
1900
2121
  }
1901
2122
  }
1902
2123
  });
1903
- if (q(value)) {
1904
- me("Operation cancelled.");
2124
+ if (isCancel(value)) {
2125
+ cancel("Operation cancelled.");
1905
2126
  process.exit(0);
1906
2127
  }
1907
2128
  return value.trim();
@@ -1912,12 +2133,12 @@ async function Select({
1912
2133
  message,
1913
2134
  options
1914
2135
  }) {
1915
- const selected = await xe({
2136
+ const selected = await select({
1916
2137
  message,
1917
2138
  options
1918
2139
  });
1919
- if (q(selected)) {
1920
- me("Operation cancelled.");
2140
+ if (isCancel(selected)) {
2141
+ cancel("Operation cancelled.");
1921
2142
  process.exit(0);
1922
2143
  }
1923
2144
  return selected;
@@ -1994,12 +2215,12 @@ async function Confirm({
1994
2215
  cancelMessage,
1995
2216
  exitOnCancel = true
1996
2217
  }) {
1997
- const confirmed = await ue({
2218
+ const confirmed = await confirm({
1998
2219
  message
1999
2220
  });
2000
- if (q(confirmed)) {
2221
+ if (isCancel(confirmed)) {
2001
2222
  if (exitOnCancel) {
2002
- me(cancelMessage ?? "Operation cancelled.");
2223
+ cancel(cancelMessage ?? "Operation cancelled.");
2003
2224
  process.exit(0);
2004
2225
  }
2005
2226
  return null;
@@ -2009,17 +2230,17 @@ async function Confirm({
2009
2230
 
2010
2231
  // apps/cli/utils/intro.ts
2011
2232
  function Intro(message) {
2012
- ge(message);
2233
+ intro(message);
2013
2234
  }
2014
2235
 
2015
2236
  // apps/cli/utils/outro.ts
2016
2237
  function Outro(message) {
2017
- ye(message);
2238
+ outro(message);
2018
2239
  }
2019
2240
 
2020
2241
  // apps/cli/utils/spinner.ts
2021
2242
  function Spinner() {
2022
- return ft();
2243
+ return spinner();
2023
2244
  }
2024
2245
 
2025
2246
  // apps/cli/modules/setup/app/setup-command.ts
@@ -2040,11 +2261,11 @@ class SetupCommand {
2040
2261
  Outro("Setup cancelled.");
2041
2262
  return;
2042
2263
  }
2043
- const spinner = Spinner();
2044
- spinner.start("Writing aliases...");
2264
+ const spinner2 = Spinner();
2265
+ spinner2.start("Writing aliases...");
2045
2266
  const { total } = await this.setupAliasesUseCase.execute();
2046
2267
  console.log("");
2047
- spinner.stop(`${CHECK({ text: `${total} aliases configured successfully.` })}`);
2268
+ spinner2.stop(`${CHECK({ text: `${total} aliases configured successfully.` })}`);
2048
2269
  Outro(`${GREEN({ text: "GLINTER" })}, if you like the project, give a star on github: https://github.com/jannael/glinter`);
2049
2270
  console.log("");
2050
2271
  console.log(MAGENTA({ text: "To use the aliases, please restart your terminal." }));
@@ -2203,8 +2424,8 @@ class Branch {
2203
2424
  }
2204
2425
  static fromGitBranch(entries) {
2205
2426
  const branches = [];
2206
- for (let i = 0;i < entries?.length; i++) {
2207
- const entry = entries[i];
2427
+ for (let i2 = 0;i2 < entries?.length; i2++) {
2428
+ const entry = entries[i2];
2208
2429
  if (!entry)
2209
2430
  continue;
2210
2431
  const current = entry.includes("*");
@@ -2289,11 +2510,11 @@ class SwitchCommand {
2289
2510
  }
2290
2511
 
2291
2512
  // apps/cli/modules/switch/infra/bun-switch-repository.ts
2292
- var {$: $4 } = globalThis.Bun;
2513
+ var {$: $2 } = globalThis.Bun;
2293
2514
  class BunSwitchRepository {
2294
2515
  async getBranches() {
2295
2516
  try {
2296
- const output = await $4`git branch -a`.quiet().text();
2517
+ const output = await $2`git branch -a`.quiet().text();
2297
2518
  if (!output.trim()) {
2298
2519
  return [];
2299
2520
  }