@jannael/glinter 1.2.5 → 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 (2) hide show
  1. package/dist/index.js +913 -702
  2. package/package.json +6 -6
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 G 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,106 +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 K = ["up", "down", "left", "right", "space", "enter", "cancel"];
552
- var j = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
553
- var h = { actions: new Set(K), 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: [...j], 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 Y(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 q = globalThis.process.platform.startsWith("win");
573
- var k = Symbol("clack:cancel");
574
- function R(r) {
575
- return r === k;
576
- }
577
- function w(r, t) {
578
- const s = r;
579
- s.isTTY && s.setRawMode(t);
580
- }
581
- function W({ 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 && !q && 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 B(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
- function P(r, t) {
615
- if ("~standard" in r) {
616
- const s = r["~standard"].validate(t);
617
- if (s instanceof Promise)
670
+ function runValidation(e, n) {
671
+ if ("~standard" in e) {
672
+ const a = e["~standard"].validate(n);
673
+ if (a instanceof Promise)
618
674
  throw new TypeError("Schema validation must be synchronous. Update `validate()` and remove any asynchronous logic.");
619
- return s.issues?.at(0)?.message;
675
+ return a.issues?.at(0)?.message;
620
676
  }
621
- return r(t);
677
+ return e(n);
622
678
  }
623
679
 
624
- class m {
680
+ class V {
625
681
  input;
626
682
  output;
627
683
  _abortSignal;
@@ -630,270 +686,305 @@ class m {
630
686
  _render;
631
687
  _track = false;
632
688
  _prevFrame = "";
633
- _subscribers = new Map;
689
+ _subscribers = /* @__PURE__ */ new Map;
634
690
  _cursor = 0;
635
691
  state = "initial";
636
692
  error = "";
637
693
  value;
638
694
  userInput = "";
639
- constructor(t, s = true) {
640
- const { input: e = D, output: i = x, render: n, signal: o, ...u } = t;
641
- 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;
642
698
  }
643
699
  unsubscribe() {
644
700
  this._subscribers.clear();
645
701
  }
646
- setSubscriber(t, s) {
647
- const e = this._subscribers.get(t) ?? [];
648
- 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);
649
705
  }
650
- on(t, s) {
651
- this.setSubscriber(t, { cb: s });
706
+ on(t2, e) {
707
+ this.setSubscriber(t2, { cb: e });
652
708
  }
653
- once(t, s) {
654
- this.setSubscriber(t, { cb: s, once: true });
709
+ once(t2, e) {
710
+ this.setSubscriber(t2, { cb: e, once: true });
655
711
  }
656
- emit(t, ...s) {
657
- const e = this._subscribers.get(t) ?? [], i = [];
658
- for (const n of e)
659
- n.cb(...s), n.once && i.push(() => e.splice(e.indexOf(n), 1));
660
- for (const n of i)
661
- 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();
662
718
  }
663
719
  prompt() {
664
- return new Promise((t) => {
720
+ return new Promise((t2) => {
665
721
  if (this._abortSignal) {
666
722
  if (this._abortSignal.aborted)
667
- return this.state = "cancel", this.close(), t(k);
723
+ return this.state = "cancel", this.close(), t2(CANCEL_SYMBOL);
668
724
  this._abortSignal.addEventListener("abort", () => {
669
725
  this.state = "cancel", this.close();
670
726
  }, { once: true });
671
727
  }
672
- this.rl = G.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", () => {
673
- 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);
674
736
  }), this.once("cancel", () => {
675
- 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);
676
738
  });
677
739
  });
678
740
  }
679
- _isActionKey(t, s) {
680
- return t === "\t";
741
+ _isActionKey(t2, e) {
742
+ return t2 === "\t";
681
743
  }
682
- _shouldSubmit(t, s) {
744
+ _shouldSubmit(t2, e) {
683
745
  return true;
684
746
  }
685
- _setValue(t) {
686
- this.value = t, this.emit("value", this.value);
747
+ _setValue(t2) {
748
+ this.value = t2, this.emit("value", this.value);
687
749
  }
688
- _setUserInput(t, s) {
689
- 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);
690
752
  }
691
753
  _clearUserInput() {
692
754
  this.rl?.write(null, { ctrl: true, name: "u" }), this._setUserInput("");
693
755
  }
694
- onKeypress(t, s) {
695
- 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, 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)) {
696
758
  if (this.opts.validate) {
697
- const e = P(this.opts.validate, this.value);
698
- 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));
699
761
  }
700
762
  this.state !== "error" && (this.state = "submit");
701
763
  }
702
- 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();
703
765
  }
704
766
  close() {
705
767
  this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
706
- `), 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();
707
769
  }
708
770
  restoreCursor() {
709
- 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(`
710
772
  `).length - 1;
711
- this.output.write(import_sisteransi.cursor.move(-999, t * -1));
773
+ this.output.write(import_sisteransi.cursor.move(-999, t2 * -1));
712
774
  }
713
775
  render() {
714
- const t = wrapAnsi(this._render(this) ?? "", process.stdout.columns, { hard: true, trim: false });
715
- 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) {
716
781
  if (this.state === "initial")
717
782
  this.output.write(import_sisteransi.cursor.hide);
718
783
  else {
719
- const s = Y(this._prevFrame, t), e = L(this.output);
720
- if (this.restoreCursor(), s) {
721
- const i = Math.max(0, s.numLinesAfter - e), n = Math.max(0, s.numLinesBefore - e);
722
- let o = s.lines.find((u) => u >= i);
723
- if (o === undefined) {
724
- 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;
725
790
  return;
726
791
  }
727
- if (s.lines.length === 1) {
728
- this.output.write(import_sisteransi.cursor.move(0, o - n)), this.output.write(import_sisteransi.erase.lines(1));
729
- 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(`
730
795
  `);
731
- 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));
732
797
  return;
733
- } else if (s.lines.length > 1) {
734
- if (i < n)
735
- o = i;
798
+ } else if (e.lines.length > 1) {
799
+ if (n < s)
800
+ r = n;
736
801
  else {
737
- const a = o - n;
738
- 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));
739
804
  }
740
805
  this.output.write(import_sisteransi.erase.down());
741
- const u = t.split(`
742
- `).slice(o);
743
- this.output.write(u.join(`
744
- `)), this._prevFrame = t;
806
+ const f = t2.split(`
807
+ `).slice(r);
808
+ this.output.write(f.join(`
809
+ `)), this._prevFrame = t2;
745
810
  return;
746
811
  }
747
812
  }
748
813
  this.output.write(import_sisteransi.erase.down());
749
814
  }
750
- 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;
751
816
  }
752
817
  }
753
818
  }
754
- function J(r, t) {
755
- if (r === undefined || t.length === 0)
819
+ function p$1(l2, e) {
820
+ if (l2 === undefined || e.length === 0)
756
821
  return 0;
757
- const s = t.findIndex((e) => e.value === r);
758
- return s !== -1 ? s : 0;
822
+ const i = e.findIndex((s) => s.value === l2);
823
+ return i !== -1 ? i : 0;
759
824
  }
760
- function H(r, t) {
761
- 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());
762
827
  }
763
- function Q(r, t) {
764
- if (t)
765
- return r ? t : t[0];
828
+ function m(l2, e) {
829
+ if (e)
830
+ return l2 ? e : e[0];
766
831
  }
767
- var X2 = class extends m {
832
+ var T$1 = class T extends V {
768
833
  filteredOptions;
769
834
  multiple;
770
835
  isNavigating = false;
771
836
  selectedValues = [];
772
837
  focusedValue;
773
- #s = 0;
774
- #r = "";
838
+ #e = 0;
839
+ #s = "";
775
840
  #t;
841
+ #i;
776
842
  #n;
777
- #u;
778
843
  get cursor() {
779
- return this.#s;
844
+ return this.#e;
780
845
  }
781
846
  get userInputWithCursor() {
782
847
  if (!this.userInput)
783
- return v(["inverse", "hidden"], "_");
848
+ return styleText(["inverse", "hidden"], "_");
784
849
  if (this._cursor >= this.userInput.length)
785
850
  return `${this.userInput}\u2588`;
786
- const t = this.userInput.slice(0, this._cursor), [s, ...e] = this.userInput.slice(this._cursor);
787
- 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("")}`;
788
853
  }
789
854
  get options() {
790
- return typeof this.#n == "function" ? this.#n() : this.#n;
791
- }
792
- constructor(t) {
793
- super(t), this.#n = t.options, this.#u = t.placeholder;
794
- const s = this.options;
795
- this.filteredOptions = [...s], this.multiple = t.multiple === true, this.#t = typeof t.options == "function" ? t.filter : t.filter ?? H;
796
- let e;
797
- 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)
798
- for (const i of e) {
799
- const n = s.findIndex((o) => o.value === i);
800
- 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);
801
866
  }
802
- 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));
803
868
  }
804
- _isActionKey(t, s) {
805
- 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 !== "";
806
871
  }
807
- #e(t, s) {
808
- 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));
809
- 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) {
810
875
  this.userInput === "\t" && this._clearUserInput(), this._setUserInput(u, true), this.isNavigating = false;
811
876
  return;
812
877
  }
813
- 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 = Q(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);
814
879
  }
815
880
  deselectAll() {
816
881
  this.selectedValues = [];
817
882
  }
818
- toggleSelected(t) {
819
- 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]);
820
- }
821
- #i(t) {
822
- if (t !== this.#r) {
823
- this.#r = t;
824
- const s = this.options;
825
- t && this.#t ? this.filteredOptions = s.filter((n) => this.#t?.(t, n)) : this.filteredOptions = [...s];
826
- const e = J(this.focusedValue, this.filteredOptions);
827
- this.#s = f(e, 0, this.filteredOptions);
828
- const i = this.filteredOptions[this.#s];
829
- 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());
830
895
  }
831
896
  }
832
897
  };
833
898
 
834
- class Z extends m {
899
+ class r extends V {
835
900
  get cursor() {
836
901
  return this.value ? 0 : 1;
837
902
  }
838
903
  get _value() {
839
904
  return this.cursor === 0;
840
905
  }
841
- constructor(t) {
842
- super(t, false), this.value = !!t.initialValue, this.on("userInput", () => {
906
+ constructor(t2) {
907
+ super(t2, false), this.value = !!t2.initialValue, this.on("userInput", () => {
843
908
  this.value = this._value;
844
- }), this.on("confirm", (s) => {
845
- 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();
846
911
  }), this.on("cursor", () => {
847
912
  this.value = !this.value;
848
913
  });
849
914
  }
850
915
  }
851
- var tt = { Y: { type: "year", len: 4 }, M: { type: "month", len: 2 }, D: { type: "day", len: 2 } };
852
- function F(r) {
853
- return [...r].map((t) => tt[t]);
854
- }
855
- function st(r) {
856
- const t = new Intl.DateTimeFormat(r, { year: "numeric", month: "2-digit", day: "2-digit" }).formatToParts(new Date(2000, 0, 15)), s = [];
857
- let e = "/";
858
- for (const i of t)
859
- 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 });
860
- return { segments: s, separator: e };
861
- }
862
- function $(r) {
863
- return Number.parseInt((r || "0").replace(/_/g, "0"), 10) || 0;
864
- }
865
- function S(r) {
866
- return { year: $(r.year), month: $(r.month), day: $(r.day) };
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]);
923
+ }
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 };
934
+ }
935
+ function p(r2) {
936
+ return Number.parseInt((r2 || "0").replace(/_/g, "0"), 10) || 0;
937
+ }
938
+ function f(r2) {
939
+ return {
940
+ year: p(r2.year),
941
+ month: p(r2.month),
942
+ day: p(r2.day)
943
+ };
867
944
  }
868
- function U(r, t) {
869
- return new Date(r || 2001, t || 1, 0).getDate();
945
+ function c(r2, t2) {
946
+ return new Date(r2 || 2001, t2 || 1, 0).getDate();
870
947
  }
871
- function N(r) {
872
- const { year: t, month: s, day: e } = S(r);
873
- 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)
874
951
  return;
875
- const i = new Date(Date.UTC(t, s - 1, e));
876
- if (!(i.getUTCFullYear() !== t || i.getUTCMonth() !== s - 1 || i.getUTCDate() !== e))
877
- return { year: t, month: s, day: e };
878
- }
879
- function E(r) {
880
- const t = N(r);
881
- return t ? new Date(Date.UTC(t.year, t.month - 1, t.day)) : undefined;
882
- }
883
- function et(r, t, s, e) {
884
- 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;
885
- 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) };
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 };
955
+ }
956
+ function C(r2) {
957
+ const t2 = b(r2);
958
+ return t2 ? new Date(Date.UTC(t2.year, t2.month - 1, t2.day)) : undefined;
959
+ }
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
+ };
886
977
  }
887
978
 
888
- class it extends m {
889
- #s;
890
- #r;
979
+ class U extends V {
980
+ #i;
981
+ #o;
891
982
  #t;
892
- #n;
983
+ #h;
893
984
  #u;
894
985
  #e = { segmentIndex: 0, positionInSegment: 0 };
895
- #i = true;
896
- #o = null;
986
+ #n = true;
987
+ #s = null;
897
988
  inlineError = "";
898
989
  get segmentCursor() {
899
990
  return { ...this.#e };
@@ -902,172 +993,189 @@ class it extends m {
902
993
  return { ...this.#t };
903
994
  }
904
995
  get segments() {
905
- return this.#s;
996
+ return this.#i;
906
997
  }
907
998
  get separator() {
908
- return this.#r;
999
+ return this.#o;
909
1000
  }
910
1001
  get formattedValue() {
911
- return this.#c(this.#t);
912
- }
913
- #c(t) {
914
- return this.#s.map((s) => t[s.type]).join(this.#r);
1002
+ return this.#l(this.#t);
915
1003
  }
916
- #a() {
917
- this._setUserInput(this.#c(this.#t)), this._setValue(E(this.#t) ?? undefined);
918
- }
919
- constructor(t) {
920
- const s = t.format ? { segments: F(t.format), separator: t.separator ?? "/" } : st(t.locale), e = t.separator ?? s.separator, i = t.format ? F(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);
921
- 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);
922
1006
  }
923
- #h() {
924
- const t = Math.max(0, Math.min(this.#e.segmentIndex, this.#s.length - 1)), s = this.#s[t];
925
- if (s)
926
- 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);
927
1009
  }
928
- #l(t) {
929
- this.inlineError = "", this.#o = null;
930
- const s = this.#h();
931
- 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));
932
1017
  }
933
- #p(t) {
934
- const s = this.#h();
935
- 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)
936
1031
  return;
937
- 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 = et(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);
938
1033
  let a;
939
- 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();
940
- }
941
- #d(t) {
942
- if (t)
943
- 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) {
944
1042
  case "right":
945
- return this.#l(1);
1043
+ return this.#m(1);
946
1044
  case "left":
947
- return this.#l(-1);
1045
+ return this.#m(-1);
948
1046
  case "up":
949
- return this.#p(1);
1047
+ return this.#d(1);
950
1048
  case "down":
951
- return this.#p(-1);
1049
+ return this.#d(-1);
952
1050
  }
953
1051
  }
954
- #f(t, s) {
955
- 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") {
956
1054
  this.inlineError = "";
957
- const e = this.#h();
958
- if (!e)
1055
+ const n = this.#a();
1056
+ if (!n)
959
1057
  return;
960
- if (!this.#t[e.segment.type].replace(/_/g, "")) {
961
- this.#l(-1);
1058
+ if (!this.#t[n.segment.type].replace(/_/g, "")) {
1059
+ this.#m(-1);
962
1060
  return;
963
1061
  }
964
- 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();
965
1063
  return;
966
1064
  }
967
- if (s?.name === "tab") {
1065
+ if (i?.name === "tab") {
968
1066
  this.inlineError = "";
969
- const e = this.#h();
970
- if (!e)
1067
+ const n = this.#a();
1068
+ if (!n)
971
1069
  return;
972
- const i = s.shift ? -1 : 1, n = e.index + i;
973
- 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);
974
1072
  return;
975
1073
  }
976
- if (t && /^[0-9]$/.test(t)) {
977
- const e = this.#h();
978
- if (!e)
1074
+ if (t2 && /^[0-9]$/.test(t2)) {
1075
+ const n = this.#a();
1076
+ if (!n)
979
1077
  return;
980
- const { segment: i } = e, n = !this.#t[i.type].replace(/_/g, "");
981
- if (this.#i && this.#o !== null && !n) {
982
- const d = this.#o + t, g = { ...this.#t, [i.type]: d }, _ = this.#m(g, i);
983
- if (_) {
984
- 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;
985
1083
  return;
986
1084
  }
987
- 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);
988
1086
  return;
989
1087
  }
990
- this.#i && !n && (this.#t[i.type] = "_".repeat(i.len), this.#e.positionInSegment = 0), this.#i = false, this.#o = null;
991
- const o = this.#t[i.type], u = o.indexOf("_"), a = u >= 0 ? u : Math.min(this.#e.positionInSegment, i.len - 1);
992
- 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)
993
1091
  return;
994
- let l = o.slice(0, a) + t + o.slice(a + 1), c = false;
995
- if (a === 0 && o === "__" && (i.type === "month" || i.type === "day")) {
996
- const d = Number.parseInt(t, 10);
997
- 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);
998
1096
  }
999
- if (i.type === "year" && (l = (o.replace(/_/g, "") + t).padStart(i.len, "_")), !l.includes("_")) {
1000
- const d = { ...this.#t, [i.type]: l }, g = this.#m(d, i);
1001
- if (g) {
1002
- 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;
1003
1101
  return;
1004
1102
  }
1005
1103
  }
1006
- this.inlineError = "", this.#t[i.type] = l;
1007
- const y = l.includes("_") ? undefined : N(this.#t);
1104
+ this.inlineError = "", this.#t[e.type] = l2;
1105
+ const y = l2.includes("_") ? undefined : b(this.#t);
1008
1106
  if (y) {
1009
- const { year: d, month: g } = y, _ = U(d, g);
1010
- 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
+ };
1011
1113
  }
1012
- this.#a();
1013
- const T = l.indexOf("_");
1014
- 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);
1015
1117
  }
1016
1118
  }
1017
- #m(t, s) {
1018
- const { month: e, day: i } = S(t);
1019
- if (s.type === "month" && (e < 0 || e > 12))
1020
- return h.date.messages.invalidMonth;
1021
- if (s.type === "day" && (i < 0 || i > 31))
1022
- return h.date.messages.invalidDay(31, "any month");
1023
- }
1024
- #g(t) {
1025
- const { year: s, month: e, day: i } = S(this.#t);
1026
- if (s && e && i) {
1027
- const n = U(s, e);
1028
- 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
+ };
1029
1134
  }
1030
- this.value = E(this.#t) ?? t.defaultValue ?? undefined;
1135
+ this.value = C(this.#t) ?? t2.defaultValue ?? undefined;
1031
1136
  }
1032
1137
  }
1033
- var rt = class extends m {
1138
+ var u$1 = class u extends V {
1034
1139
  options;
1035
1140
  cursor = 0;
1036
- #s;
1037
- getGroupItems(t) {
1038
- return this.options.filter((s) => s.group === t);
1141
+ #t;
1142
+ getGroupItems(t2) {
1143
+ return this.options.filter((r2) => r2.group === t2);
1039
1144
  }
1040
- isGroupSelected(t) {
1041
- const s = this.getGroupItems(t), e = this.value;
1042
- 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));
1043
1148
  }
1044
1149
  toggleValue() {
1045
- const t = this.options[this.cursor];
1046
- if (this.value === undefined && (this.value = []), t.group === true) {
1047
- const s = t.value, e = this.getGroupItems(s);
1048
- 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));
1049
1154
  } else {
1050
- const s = this.value.includes(t.value);
1051
- 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];
1052
1157
  }
1053
1158
  }
1054
- constructor(t) {
1055
- super(t, false);
1056
- const { options: s } = t;
1057
- 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) => {
1058
1166
  switch (e) {
1059
1167
  case "left":
1060
1168
  case "up": {
1061
1169
  this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
1062
- const i = this.options[this.cursor]?.group === true;
1063
- !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);
1064
1172
  break;
1065
1173
  }
1066
1174
  case "down":
1067
1175
  case "right": {
1068
1176
  this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
1069
- const i = this.options[this.cursor]?.group === true;
1070
- !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);
1071
1179
  break;
1072
1180
  }
1073
1181
  case "space":
@@ -1077,126 +1185,126 @@ var rt = class extends m {
1077
1185
  });
1078
1186
  }
1079
1187
  };
1080
- var nt = new Set(["up", "down", "left", "right"]);
1188
+ var o$1 = /* @__PURE__ */ new Set(["up", "down", "left", "right"]);
1081
1189
 
1082
- class ot extends m {
1190
+ class h extends V {
1083
1191
  #s = false;
1084
- #r;
1192
+ #t;
1085
1193
  focused = "editor";
1086
1194
  get userInputWithCursor() {
1087
1195
  if (this.state === "submit")
1088
1196
  return this.userInput;
1089
- const t = this.userInput;
1090
- if (this.cursor >= t.length)
1091
- return `${t}\u2588`;
1092
- const s = t.slice(0, this.cursor), e = t[this.cursor], i = t.slice(this.cursor + 1);
1093
- 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 === `
1094
1202
  ` ? `${s}\u2588
1095
- ${i}` : `${s}${v("inverse", e)}${i}`;
1203
+ ${e}` : `${s}${styleText("inverse", r2)}${e}`;
1096
1204
  }
1097
1205
  get cursor() {
1098
1206
  return this._cursor;
1099
1207
  }
1100
- #t(t) {
1208
+ #r(t2) {
1101
1209
  if (this.userInput.length === 0) {
1102
- this._setUserInput(t);
1210
+ this._setUserInput(t2);
1103
1211
  return;
1104
1212
  }
1105
- 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));
1106
1214
  }
1107
- #n(t) {
1215
+ #i(t2) {
1108
1216
  const s = this.value ?? "";
1109
- switch (t) {
1217
+ switch (t2) {
1110
1218
  case "up":
1111
- this._cursor = I(this._cursor, 0, -1, s);
1219
+ this._cursor = findTextCursor(this._cursor, 0, -1, s);
1112
1220
  return;
1113
1221
  case "down":
1114
- this._cursor = I(this._cursor, 0, 1, s);
1222
+ this._cursor = findTextCursor(this._cursor, 0, 1, s);
1115
1223
  return;
1116
1224
  case "left":
1117
- this._cursor = I(this._cursor, -1, 0, s);
1225
+ this._cursor = findTextCursor(this._cursor, -1, 0, s);
1118
1226
  return;
1119
1227
  case "right":
1120
- this._cursor = I(this._cursor, 1, 0, s);
1228
+ this._cursor = findTextCursor(this._cursor, 1, 0, s);
1121
1229
  return;
1122
1230
  }
1123
1231
  }
1124
- _shouldSubmit(t, s) {
1125
- if (this.#r)
1126
- return this.focused === "submit" ? true : (this.#t(`
1232
+ _shouldSubmit(t2, s) {
1233
+ if (this.#t)
1234
+ return this.focused === "submit" ? true : (this.#r(`
1127
1235
  `), this._cursor++, false);
1128
- const e = this.#s;
1129
- return this.#s = true, e ? (this.userInput[this.cursor - 1] === `
1130
- ` && (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(`
1131
1239
  `), this._cursor++, false);
1132
1240
  }
1133
- constructor(t) {
1134
- super(t, false), this.#r = t.showSubmit ?? false, this.on("key", (s, e) => {
1135
- if (e?.name && nt.has(e.name)) {
1136
- 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);
1137
1245
  return;
1138
1246
  }
1139
- if (s === "\t" && this.#r) {
1247
+ if (s === "\t" && this.#t) {
1140
1248
  this.focused = this.focused === "editor" ? "submit" : "editor";
1141
1249
  return;
1142
1250
  }
1143
- if (e?.name !== "return") {
1144
- 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) {
1145
1253
  this._setUserInput(this.userInput.slice(0, this.cursor - 1) + this.userInput.slice(this.cursor)), this._cursor--;
1146
1254
  return;
1147
1255
  }
1148
- if (e?.name === "delete" && this.cursor < this.userInput.length) {
1256
+ if (r2?.name === "delete" && this.cursor < this.userInput.length) {
1149
1257
  this._setUserInput(this.userInput.slice(0, this.cursor) + this.userInput.slice(this.cursor + 1));
1150
1258
  return;
1151
1259
  }
1152
- 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++);
1153
1261
  }
1154
1262
  }), this.on("userInput", (s) => {
1155
1263
  this._setValue(s);
1156
1264
  }), this.on("finalize", () => {
1157
- this.value || (this.value = t.defaultValue), this.value === undefined && (this.value = "");
1265
+ this.value || (this.value = t2.defaultValue), this.value === undefined && (this.value = "");
1158
1266
  });
1159
1267
  }
1160
1268
  }
1161
- var ut = class extends m {
1269
+ var a$1 = class a extends V {
1162
1270
  options;
1163
1271
  cursor = 0;
1164
1272
  get _value() {
1165
1273
  return this.options[this.cursor].value;
1166
1274
  }
1167
1275
  get _enabledOptions() {
1168
- return this.options.filter((t) => t.disabled !== true);
1276
+ return this.options.filter((e) => e.disabled !== true);
1169
1277
  }
1170
1278
  toggleAll() {
1171
- const t = this._enabledOptions, s = this.value !== undefined && this.value.length === t.length;
1172
- 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);
1173
1281
  }
1174
1282
  toggleInvert() {
1175
- const t = this.value;
1176
- if (!t)
1283
+ const e = this.value;
1284
+ if (!e)
1177
1285
  return;
1178
- const s = this._enabledOptions.filter((e) => !t.includes(e.value));
1179
- 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);
1180
1288
  }
1181
1289
  toggleValue() {
1182
1290
  this.value === undefined && (this.value = []);
1183
- const t = this.value.includes(this._value);
1184
- this.value = t ? this.value.filter((s) => s !== this._value) : [...this.value, this._value];
1185
- }
1186
- constructor(t) {
1187
- super(t, false), this.options = t.options, this.value = [...t.initialValues ?? []];
1188
- const s = Math.max(this.options.findIndex(({ value: e }) => e === t.cursorAt), 0);
1189
- this.cursor = this.options[s].disabled ? f(s, 1, this.options) : s, this.on("key", (e, i) => {
1190
- i.name === "a" && this.toggleAll(), i.name === "i" && this.toggleInvert();
1191
- }), this.on("cursor", (e) => {
1192
- 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) {
1193
1301
  case "left":
1194
1302
  case "up":
1195
- this.cursor = f(this.cursor, -1, this.options);
1303
+ this.cursor = findCursor(this.cursor, -1, this.options);
1196
1304
  break;
1197
1305
  case "down":
1198
1306
  case "right":
1199
- this.cursor = f(this.cursor, 1, this.options);
1307
+ this.cursor = findCursor(this.cursor, 1, this.options);
1200
1308
  break;
1201
1309
  case "space":
1202
1310
  this.toggleValue();
@@ -1205,7 +1313,7 @@ var ut = class extends m {
1205
1313
  });
1206
1314
  }
1207
1315
  };
1208
- class ht extends m {
1316
+ class a2 extends V {
1209
1317
  options;
1210
1318
  cursor = 0;
1211
1319
  get _selectedValue() {
@@ -1214,393 +1322,496 @@ class ht extends m {
1214
1322
  changeValue() {
1215
1323
  this.value = this._selectedValue.value;
1216
1324
  }
1217
- constructor(t) {
1218
- super(t, false), this.options = t.options;
1219
- const s = this.options.findIndex(({ value: i }) => i === t.initialValue), e = s === -1 ? 0 : s;
1220
- this.cursor = this.options[e].disabled ? f(e, 1, this.options) : e, this.changeValue(), this.on("cursor", (i) => {
1221
- 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) {
1222
1330
  case "left":
1223
1331
  case "up":
1224
- this.cursor = f(this.cursor, -1, this.options);
1332
+ this.cursor = findCursor(this.cursor, -1, this.options);
1225
1333
  break;
1226
1334
  case "down":
1227
1335
  case "right":
1228
- this.cursor = f(this.cursor, 1, this.options);
1336
+ this.cursor = findCursor(this.cursor, 1, this.options);
1229
1337
  break;
1230
1338
  }
1231
1339
  this.changeValue();
1232
1340
  });
1233
1341
  }
1234
1342
  }
1235
- class ct extends m {
1343
+ class n extends V {
1236
1344
  get userInputWithCursor() {
1237
1345
  if (this.state === "submit")
1238
1346
  return this.userInput;
1239
- const t = this.userInput;
1240
- if (this.cursor >= t.length)
1347
+ const t2 = this.userInput;
1348
+ if (this.cursor >= t2.length)
1241
1349
  return `${this.userInput}\u2588`;
1242
- const s = t.slice(0, this.cursor), [e, ...i] = t.slice(this.cursor);
1243
- 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("")}`;
1244
1352
  }
1245
1353
  get cursor() {
1246
1354
  return this._cursor;
1247
1355
  }
1248
- constructor(t) {
1249
- super({ ...t, initialUserInput: t.initialUserInput ?? t.initialValue }), this.on("userInput", (s) => {
1250
- 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);
1251
1362
  }), this.on("finalize", () => {
1252
- this.value || (this.value = t.defaultValue), this.value === undefined && (this.value = "");
1363
+ this.value || (this.value = t2.defaultValue), this.value === undefined && (this.value = "");
1253
1364
  });
1254
1365
  }
1255
1366
  }
1256
1367
 
1257
1368
  // node_modules/@clack/prompts/dist/index.mjs
1258
- import { styleText as e, stripVTControlCharacters as ot2 } from "util";
1259
- import V2 from "process";
1369
+ import { styleText as styleText2, stripVTControlCharacters } from "util";
1370
+ import process$1 from "process";
1260
1371
  var import_sisteransi2 = __toESM(require_src(), 1);
1261
- function se() {
1262
- 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";
1263
- }
1264
- var tt2 = se();
1265
- var at2 = () => process.env.CI === "true";
1266
- var w2 = (t, i) => tt2 ? t : i;
1267
- var _t = w2("\u25C6", "*");
1268
- var ut2 = w2("\u25A0", "x");
1269
- var lt2 = w2("\u25B2", "x");
1270
- var H2 = w2("\u25C7", "o");
1271
- var ct2 = w2("\u250C", "T");
1272
- var $2 = w2("\u2502", "|");
1273
- var x2 = w2("\u2514", "\u2014");
1274
- var xt = w2("\u2510", "T");
1275
- var Et = w2("\u2518", "\u2014");
1276
- var z2 = w2("\u25CF", ">");
1277
- var U2 = w2("\u25CB", " ");
1278
- var et2 = w2("\u25FB", "[\u2022]");
1279
- var K2 = w2("\u25FC", "[+]");
1280
- var Y2 = w2("\u25FB", "[ ]");
1281
- var Gt = w2("\u25AA", "\u2022");
1282
- var st2 = w2("\u2500", "-");
1283
- var $t = w2("\u256E", "+");
1284
- var Mt = w2("\u251C", "+");
1285
- var dt = w2("\u256F", "+");
1286
- var ht2 = w2("\u2570", "+");
1287
- var Ot = w2("\u256D", "+");
1288
- var pt = w2("\u25CF", "\u2022");
1289
- var mt = w2("\u25C6", "*");
1290
- var gt = w2("\u25B2", "!");
1291
- var yt = w2("\u25A0", "x");
1292
- var P2 = (t) => {
1293
- 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) {
1294
1408
  case "initial":
1295
1409
  case "active":
1296
- return e("cyan", _t);
1410
+ return styleText2("cyan", S_STEP_ACTIVE);
1297
1411
  case "cancel":
1298
- return e("red", ut2);
1412
+ return styleText2("red", S_STEP_CANCEL);
1299
1413
  case "error":
1300
- return e("yellow", lt2);
1414
+ return styleText2("yellow", S_STEP_ERROR);
1301
1415
  case "submit":
1302
- return e("green", H2);
1416
+ return styleText2("green", S_STEP_SUBMIT);
1303
1417
  }
1304
1418
  };
1305
- var ft = (t) => {
1306
- switch (t) {
1419
+ var symbolBar = (e) => {
1420
+ switch (e) {
1307
1421
  case "initial":
1308
1422
  case "active":
1309
- return e("cyan", $2);
1423
+ return styleText2("cyan", S_BAR);
1310
1424
  case "cancel":
1311
- return e("red", $2);
1425
+ return styleText2("red", S_BAR);
1312
1426
  case "error":
1313
- return e("yellow", $2);
1427
+ return styleText2("yellow", S_BAR);
1314
1428
  case "submit":
1315
- return e("green", $2);
1429
+ return styleText2("green", S_BAR);
1316
1430
  }
1317
1431
  };
1318
- var Pt = (t, i, s, r, u, n = false) => {
1319
- let a = i, c = 0;
1320
- if (n)
1321
- 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--)
1322
1436
  ;
1323
1437
  else
1324
- 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++)
1325
1439
  ;
1326
- return { lineCount: a, removals: c };
1440
+ return { lineCount: r2, removals: w };
1327
1441
  };
1328
- var F2 = ({ cursor: t, options: i, style: s, output: r = process.stdout, maxItems: u = Number.POSITIVE_INFINITY, columnPadding: n = 0, rowPadding: a = 4 }) => {
1329
- 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);
1330
1452
  let p2 = 0;
1331
- t >= g - 3 && (p2 = Math.max(Math.min(t - g + 3, i.length - g), 0));
1332
- let f2 = g < i.length && p2 > 0, h2 = g < i.length && p2 + g < i.length;
1333
- const I2 = Math.min(p2 + g, i.length), m2 = [];
1334
- let y = 0;
1335
- f2 && y++, h2 && y++;
1336
- const v2 = p2 + (f2 ? 1 : 0), C2 = I2 - (h2 ? 1 : 0);
1337
- for (let b2 = v2;b2 < C2; b2++) {
1338
- 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(`
1339
1464
  `);
1340
- m2.push(G2), y += G2.length;
1341
- }
1342
- if (y > d) {
1343
- let b2 = 0, G2 = 0, M = y;
1344
- const N2 = t - v2;
1345
- let O2 = d;
1346
- const j2 = () => Pt(m2, M, 0, N2, O2), k2 = () => Pt(m2, M, N2 + 1, m2.length, O2, true);
1347
- 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));
1348
- }
1349
- const S2 = [];
1350
- f2 && S2.push(l);
1351
- for (const b2 of m2)
1352
- for (const G2 of b2)
1353
- S2.push(G2);
1354
- 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;
1355
1480
  };
1356
- var le = (t) => {
1357
- const i = t.active ?? "Yes", s = t.inactive ?? "No";
1358
- return new Z({ active: i, inactive: s, signal: t.signal, input: t.input, output: t.output, initialValue: t.initialValue ?? true, render() {
1359
- const r = t.withGuide ?? h.withGuide, u = `${P2(this.state)} `, n = r ? `${e("gray", $2)} ` : "", a = B(t.output, t.message, n, u), c = `${r ? `${e("gray", $2)}
1360
- ` : ""}${a}
1361
- `, o = this.value ? i : s;
1362
- switch (this.state) {
1363
- case "submit": {
1364
- const l = r ? `${e("gray", $2)} ` : "";
1365
- return `${c}${l}${e("dim", o)}`;
1366
- }
1367
- case "cancel": {
1368
- const l = r ? `${e("gray", $2)} ` : "";
1369
- return `${c}${l}${e(["strikethrough", "dim"], o)}${r ? `
1370
- ${e("gray", $2)}` : ""}`;
1371
- }
1372
- default: {
1373
- const l = r ? `${e("cyan", $2)} ` : "", d = r ? e("cyan", x2) : "";
1374
- return `${c}${l}${this.value ? `${e("green", z2)} ${i}` : `${e("dim", U2)} ${e("dim", i)}`}${t.vertical ? r ? `
1375
- ${e("cyan", $2)} ` : `
1376
- ` : ` ${e("dim", "/")} `}${this.value ? `${e("dim", U2)} ${e("dim", s)}` : `${e("green", z2)} ${s}`}
1377
- ${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}
1378
1510
  `;
1511
+ }
1379
1512
  }
1380
1513
  }
1381
- } }).prompt();
1514
+ }).prompt();
1382
1515
  };
1383
- var ge = (t = "", i) => {
1384
- const s = i?.output ?? process.stdout, r = i?.withGuide ?? h.withGuide ? `${e("gray", x2)} ` : "";
1385
- 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)}
1386
1519
 
1387
1520
  `);
1388
1521
  };
1389
- var ye = (t = "", i) => {
1390
- const s = i?.output ?? process.stdout, r = i?.withGuide ?? h.withGuide ? `${e("gray", ct2)} ` : "";
1391
- 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}
1392
1525
  `);
1393
1526
  };
1394
- var fe = (t = "", i) => {
1395
- const s = i?.output ?? process.stdout, r = i?.withGuide ?? h.withGuide ? `${e("gray", $2)}
1396
- ${e("gray", x2)} ` : "";
1397
- 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}
1398
1531
 
1399
1532
  `);
1400
1533
  };
1401
- var Q2 = (t, i) => t.split(`
1402
- `).map((s) => i(s)).join(`
1534
+ var d = (n2, a3) => n2.split(`
1535
+ `).map((m2) => a3(m2)).join(`
1403
1536
  `);
1404
- var we = (t) => {
1405
- const i = (r, u) => {
1406
- const n = r.label ?? String(r.value);
1407
- 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))}`;
1408
- }, s = t.required ?? true;
1409
- return new ut({ options: t.options, signal: t.signal, input: t.input, output: t.output, initialValues: t.initialValues, required: s, cursorAt: t.cursorAt, validate(r) {
1410
- if (s && (r === undefined || r.length === 0))
1411
- return `Please select at least one option.
1412
- ${e("reset", e("dim", `Press ${e(["gray", "bgWhite", "inverse"], " space ")} to select, ${e("gray", e("bgWhite", e("inverse", " enter ")))} to submit`))}`;
1413
- }, render() {
1414
- const r = t.withGuide ?? h.withGuide, u = B(t.output, t.message, r ? `${ft(this.state)} ` : "", `${P2(this.state)} `), n = `${r ? `${e("gray", $2)}
1415
- ` : ""}${u}
1416
- `, a = this.value ?? [], c = (o, l) => {
1417
- if (o.disabled)
1418
- return i(o, "disabled");
1419
- const d = a.includes(o.value);
1420
- return l && d ? i(o, "active-selected") : d ? i(o, "selected") : i(o, l ? "active" : "inactive");
1421
- };
1422
- switch (this.state) {
1423
- case "submit": {
1424
- const o = this.options.filter(({ value: d }) => a.includes(d)).map((d) => i(d, "submitted")).join(e("dim", ", ")) || e("dim", "none"), l = B(t.output, o, r ? `${e("gray", $2)} ` : "");
1425
- return `${n}${l}`;
1426
- }
1427
- case "cancel": {
1428
- const o = this.options.filter(({ value: d }) => a.includes(d)).map((d) => i(d, "cancelled")).join(e("dim", ", "));
1429
- if (o.trim() === "")
1430
- return `${n}${e("gray", $2)}`;
1431
- const l = B(t.output, o, r ? `${e("gray", $2)} ` : "");
1432
- return `${n}${l}${r ? `
1433
- ${e("gray", $2)}` : ""}`;
1434
- }
1435
- case "error": {
1436
- const o = r ? `${e("yellow", $2)} ` : "", l = this.error.split(`
1437
- `).map((p2, f2) => f2 === 0 ? `${r ? `${e("yellow", x2)} ` : ""}${e("yellow", p2)}` : ` ${p2}`).join(`
1438
- `), d = n.split(`
1439
- `).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(`
1440
1582
  `).length + 1;
1441
- 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(`
1442
- ${o}`)}
1443
- ${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}
1444
1594
  `;
1445
- }
1446
- default: {
1447
- const o = r ? `${e("cyan", $2)} ` : "", l = n.split(`
1448
- `).length, d = r ? 2 : 1;
1449
- 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(`
1450
- ${o}`)}
1451
- ${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) : ""}
1452
1610
  `;
1611
+ }
1453
1612
  }
1454
1613
  }
1455
- } }).prompt();
1614
+ }).prompt();
1456
1615
  };
1457
- var _e = (t) => e("magenta", t);
1458
- var vt = ({ 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 } = {}) => {
1459
- const l = at2();
1460
- let d, g, p2 = false, f2 = false, h2 = "", I2, m2 = performance.now();
1461
- const y = A(s), v2 = o?.styleFrame ?? _e, C2 = (_) => {
1462
- const A2 = _ > 1 ? u ?? h.messages.error : r ?? h.messages.cancel;
1463
- f2 = _ === 1, p2 && (W2(A2, _), f2 && typeof i == "function" && i());
1464
- }, S2 = () => C2(2), b2 = () => C2(1), G2 = () => {
1465
- 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);
1466
- }, M = () => {
1467
- 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);
1468
- }, N2 = () => {
1469
- 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)
1470
1639
  return;
1471
- l && s.write(`
1640
+ u3 && n2.write(`
1472
1641
  `);
1473
- const _ = wrapAnsi(I2, y, { hard: true, trim: false }).split(`
1642
+ const r2 = wrapAnsi(p2, x, {
1643
+ hard: true,
1644
+ trim: false
1645
+ }).split(`
1474
1646
  `);
1475
- _.length > 1 && s.write(import_sisteransi2.cursor.up(_.length - 1)), s.write(import_sisteransi2.cursor.to(0)), s.write(import_sisteransi2.erase.down());
1476
- }, O2 = (_) => _.replace(/\.+$/, ""), j2 = (_) => {
1477
- const A2 = (performance.now() - _) / 1000, L2 = Math.floor(A2 / 60), D2 = Math.floor(A2 % 60);
1478
- return L2 > 0 ? `[${L2}m ${D2}s]` : `[${D2}s]`;
1479
- }, k2 = o.withGuide ?? h.withGuide, rt2 = (_ = "") => {
1480
- p2 = true, d = W({ 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)}
1481
1653
  `);
1482
- let A2 = 0, L2 = 0;
1483
- G2(), g = setInterval(() => {
1484
- if (l && h2 === I2)
1654
+ let r2 = 0, t2 = 0;
1655
+ A(), T3 = setInterval(() => {
1656
+ if (u3 && s === p2)
1485
1657
  return;
1486
- N2(), I2 = h2;
1487
- const D2 = v2(n[A2]);
1488
- let Z2;
1489
- if (l)
1490
- Z2 = `${D2} ${h2}...`;
1491
- else if (t === "timer")
1492
- 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)}`;
1493
1665
  else {
1494
- const Lt = ".".repeat(Math.floor(L2)).slice(0, 3);
1495
- Z2 = `${D2} ${h2}${Lt}`;
1666
+ const B = ".".repeat(Math.floor(t2)).slice(0, 3);
1667
+ v = `${o2} ${s}${B}`;
1496
1668
  }
1497
- const kt = wrapAnsi(Z2, y, { hard: true, trim: false });
1498
- s.write(kt), A2 = A2 + 1 < n.length ? A2 + 1 : 0, L2 = L2 < 4 ? L2 + 0.125 : 0;
1499
- }, a);
1500
- }, W2 = (_ = "", A2 = 0, L2 = false) => {
1501
- 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)
1502
1677
  return;
1503
- p2 = false, clearInterval(g), N2();
1504
- const D2 = A2 === 0 ? e("green", H2) : A2 === 1 ? e("red", ut2) : e("red", lt2);
1505
- h2 = _ ?? h2, L2 || (t === "timer" ? s.write(`${D2} ${h2} ${j2(m2)}
1506
- `) : s.write(`${D2} ${h2}
1507
- `)), 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
+ }
1508
1696
  };
1509
- return { start: rt2, stop: (_ = "") => W2(_, 0), message: (_ = "") => {
1510
- h2 = O2(_ ?? h2);
1511
- }, cancel: (_ = "") => W2(_, 1), error: (_ = "") => W2(_, 2), clear: () => W2("", 0, true), get isCancelled() {
1512
- return f2;
1513
- } };
1514
1697
  };
1515
- var Nt = { light: w2("\u2500", "-"), heavy: w2("\u2501", "="), block: w2("\u2588", "#") };
1516
- var it2 = (t, i) => t.includes(`
1517
- `) ? t.split(`
1518
- `).map((s) => i(s)).join(`
1519
- `) : i(t);
1520
- var Ee = (t) => {
1521
- const i = (s, r) => {
1522
- const u = s.label ?? String(s.value);
1523
- 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) {
1524
1711
  case "disabled":
1525
- 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"})`)}` : ""}`;
1526
1713
  case "selected":
1527
- return `${it2(u, (n) => e("dim", n))}`;
1714
+ return `${c2(s, (n2) => styleText2("dim", n2))}`;
1528
1715
  case "active":
1529
- 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})`)}` : ""}`;
1530
1717
  case "cancelled":
1531
- return `${it2(u, (n) => e(["strikethrough", "dim"], n))}`;
1718
+ return `${c2(s, (n2) => styleText2(["strikethrough", "dim"], n2))}`;
1532
1719
  default:
1533
- return `${e("dim", U2)} ${it2(u, (n) => e("dim", n))}`;
1720
+ return `${styleText2("dim", S_RADIO_INACTIVE)} ${c2(s, (n2) => styleText2("dim", n2))}`;
1534
1721
  }
1535
1722
  };
1536
- return new ht({ options: t.options, signal: t.signal, input: t.input, output: t.output, initialValue: t.initialValue, render() {
1537
- const s = t.withGuide ?? h.withGuide, r = `${P2(this.state)} `, u = `${ft(this.state)} `, n = B(t.output, t.message, u, r), a = `${s ? `${e("gray", $2)}
1538
- ` : ""}${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}
1539
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}
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 ?? "";
1540
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
+ }
1541
1784
  case "submit": {
1542
- const c = s ? `${e("gray", $2)} ` : "", o = B(t.output, i(this.options[this.cursor], "selected"), c);
1543
- return `${a}${o}`;
1785
+ const n2 = a3 ? ` ${styleText2("dim", a3)}` : "", r2 = i2 ? styleText2("gray", S_BAR) : "";
1786
+ return `${s}${r2}${n2}`;
1544
1787
  }
1545
1788
  case "cancel": {
1546
- const c = s ? `${e("gray", $2)} ` : "", o = B(t.output, i(this.options[this.cursor], "cancelled"), c);
1547
- return `${a}${o}${s ? `
1548
- ${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}` : ""}`;
1549
1792
  }
1550
1793
  default: {
1551
- const c = s ? `${e("cyan", $2)} ` : "", o = s ? e("cyan", x2) : "", l = a.split(`
1552
- `).length, d = s ? 2 : 1;
1553
- 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(`
1554
- ${c}`)}
1555
- ${o}
1794
+ const n2 = i2 ? `${styleText2("cyan", S_BAR)} ` : "", r2 = i2 ? styleText2("cyan", S_BAR_END) : "";
1795
+ return `${s}${n2}${o2}
1796
+ ${r2}
1556
1797
  `;
1557
1798
  }
1558
1799
  }
1559
- } }).prompt();
1560
- };
1561
- var Bt = `${e("gray", $2)} `;
1562
- var Re = (t) => new ct({ validate: t.validate, placeholder: t.placeholder, defaultValue: t.defaultValue, initialValue: t.initialValue, output: t.output, signal: t.signal, input: t.input, render() {
1563
- const i = t?.withGuide ?? h.withGuide, s = `${`${i ? `${e("gray", $2)}
1564
- ` : ""}${P2(this.state)} `}${t.message}
1565
- `, 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 ?? "";
1566
- switch (this.state) {
1567
- case "error": {
1568
- const a = this.error ? ` ${e("yellow", this.error)}` : "", c = i ? `${e("yellow", $2)} ` : "", o = i ? e("yellow", x2) : "";
1569
- return `${s.trim()}
1570
- ${c}${u}
1571
- ${o}${a}
1572
- `;
1573
- }
1574
- case "submit": {
1575
- const a = n ? ` ${e("dim", n)}` : "", c = i ? e("gray", $2) : "";
1576
- return `${s}${c}${a}`;
1577
- }
1578
- case "cancel": {
1579
- const a = n ? ` ${e(["strikethrough", "dim"], n)}` : "", c = i ? e("gray", $2) : "";
1580
- return `${s}${c}${a}${n.trim() ? `
1581
- ${c}` : ""}`;
1582
- }
1583
- default: {
1584
- const a = i ? `${e("cyan", $2)} ` : "", c = i ? e("cyan", x2) : "";
1585
- return `${s}${a}${u}
1586
- ${c}
1587
- `;
1588
- }
1589
1800
  }
1590
- } }).prompt();
1801
+ }).prompt();
1591
1802
 
1592
1803
  // apps/cli/utils/multiselect.ts
1593
1804
  async function MultiSelect({
1594
1805
  message,
1595
1806
  options
1596
1807
  }) {
1597
- const selected = await we({
1808
+ const selected = await multiselect({
1598
1809
  message,
1599
1810
  options,
1600
1811
  required: true
1601
1812
  });
1602
- if (R(selected)) {
1603
- ge("Operation cancelled.");
1813
+ if (isCancel(selected)) {
1814
+ cancel("Operation cancelled.");
1604
1815
  process.exit(0);
1605
1816
  }
1606
1817
  return selected;
@@ -1621,7 +1832,7 @@ class AddCommand {
1621
1832
  console.log(`${CHECK({ text: "All changes are either staged or sensitive (like .env)." })}`);
1622
1833
  return;
1623
1834
  }
1624
- const options = changes.map((c) => ({ value: c.value, label: c.label }));
1835
+ const options = changes.map((c3) => ({ value: c3.value, label: c3.label }));
1625
1836
  const selectedChanges = await MultiSelect({
1626
1837
  message: `Select the changes you want to commit.
1627
1838
  ` + BLUE({ text: "[space] to select" }) + `
@@ -1633,7 +1844,7 @@ class AddCommand {
1633
1844
  });
1634
1845
  let selected = selectedChanges.map((file) => file.trim());
1635
1846
  if (selected.includes("all")) {
1636
- selected = changes.map((c) => c.value);
1847
+ selected = changes.map((c3) => c3.value);
1637
1848
  }
1638
1849
  if (selected.length > 0) {
1639
1850
  await this.stageChangesUseCase.execute(selected);
@@ -1698,8 +1909,8 @@ class Change {
1698
1909
  }
1699
1910
  static fromPorcelain(entries) {
1700
1911
  const changes = [];
1701
- for (let i = 0;i < entries.length; i++) {
1702
- const entry = entries[i];
1912
+ for (let i2 = 0;i2 < entries.length; i2++) {
1913
+ const entry = entries[i2];
1703
1914
  if (!entry)
1704
1915
  continue;
1705
1916
  const status = entry.slice(0, 2);
@@ -1710,7 +1921,7 @@ class Change {
1710
1921
  let displayPath = file;
1711
1922
  const value = file;
1712
1923
  if (status.startsWith("R") || status.startsWith("C")) {
1713
- const source = entries[++i];
1924
+ const source = entries[++i2];
1714
1925
  displayPath = `${source} -> ${file}`;
1715
1926
  }
1716
1927
  changes.push(new Change({ value, status, displayPath }));
@@ -1760,11 +1971,11 @@ class StageChangesUseCase {
1760
1971
  }
1761
1972
 
1762
1973
  // apps/cli/modules/add/infra/bun-git.repository.ts
1763
- var {$: $3 } = globalThis.Bun;
1974
+ var {$ } = globalThis.Bun;
1764
1975
  class BunGitRepository {
1765
1976
  async getEntries() {
1766
1977
  try {
1767
- const output = await $3`git status --porcelain -z`.quiet().text();
1978
+ const output = await $`git status --porcelain -z`.quiet().text();
1768
1979
  if (!output.trim()) {
1769
1980
  return [];
1770
1981
  }
@@ -1901,7 +2112,7 @@ async function Input({
1901
2112
  message,
1902
2113
  placeholder
1903
2114
  }) {
1904
- const value = await Re({
2115
+ const value = await text({
1905
2116
  message,
1906
2117
  placeholder,
1907
2118
  validate(input) {
@@ -1910,8 +2121,8 @@ async function Input({
1910
2121
  }
1911
2122
  }
1912
2123
  });
1913
- if (R(value)) {
1914
- ge("Operation cancelled.");
2124
+ if (isCancel(value)) {
2125
+ cancel("Operation cancelled.");
1915
2126
  process.exit(0);
1916
2127
  }
1917
2128
  return value.trim();
@@ -1922,12 +2133,12 @@ async function Select({
1922
2133
  message,
1923
2134
  options
1924
2135
  }) {
1925
- const selected = await Ee({
2136
+ const selected = await select({
1926
2137
  message,
1927
2138
  options
1928
2139
  });
1929
- if (R(selected)) {
1930
- ge("Operation cancelled.");
2140
+ if (isCancel(selected)) {
2141
+ cancel("Operation cancelled.");
1931
2142
  process.exit(0);
1932
2143
  }
1933
2144
  return selected;
@@ -2004,12 +2215,12 @@ async function Confirm({
2004
2215
  cancelMessage,
2005
2216
  exitOnCancel = true
2006
2217
  }) {
2007
- const confirmed = await le({
2218
+ const confirmed = await confirm({
2008
2219
  message
2009
2220
  });
2010
- if (R(confirmed)) {
2221
+ if (isCancel(confirmed)) {
2011
2222
  if (exitOnCancel) {
2012
- ge(cancelMessage ?? "Operation cancelled.");
2223
+ cancel(cancelMessage ?? "Operation cancelled.");
2013
2224
  process.exit(0);
2014
2225
  }
2015
2226
  return null;
@@ -2019,17 +2230,17 @@ async function Confirm({
2019
2230
 
2020
2231
  // apps/cli/utils/intro.ts
2021
2232
  function Intro(message) {
2022
- ye(message);
2233
+ intro(message);
2023
2234
  }
2024
2235
 
2025
2236
  // apps/cli/utils/outro.ts
2026
2237
  function Outro(message) {
2027
- fe(message);
2238
+ outro(message);
2028
2239
  }
2029
2240
 
2030
2241
  // apps/cli/utils/spinner.ts
2031
2242
  function Spinner() {
2032
- return vt();
2243
+ return spinner();
2033
2244
  }
2034
2245
 
2035
2246
  // apps/cli/modules/setup/app/setup-command.ts
@@ -2050,11 +2261,11 @@ class SetupCommand {
2050
2261
  Outro("Setup cancelled.");
2051
2262
  return;
2052
2263
  }
2053
- const spinner = Spinner();
2054
- spinner.start("Writing aliases...");
2264
+ const spinner2 = Spinner();
2265
+ spinner2.start("Writing aliases...");
2055
2266
  const { total } = await this.setupAliasesUseCase.execute();
2056
2267
  console.log("");
2057
- spinner.stop(`${CHECK({ text: `${total} aliases configured successfully.` })}`);
2268
+ spinner2.stop(`${CHECK({ text: `${total} aliases configured successfully.` })}`);
2058
2269
  Outro(`${GREEN({ text: "GLINTER" })}, if you like the project, give a star on github: https://github.com/jannael/glinter`);
2059
2270
  console.log("");
2060
2271
  console.log(MAGENTA({ text: "To use the aliases, please restart your terminal." }));
@@ -2213,8 +2424,8 @@ class Branch {
2213
2424
  }
2214
2425
  static fromGitBranch(entries) {
2215
2426
  const branches = [];
2216
- for (let i = 0;i < entries?.length; i++) {
2217
- const entry = entries[i];
2427
+ for (let i2 = 0;i2 < entries?.length; i2++) {
2428
+ const entry = entries[i2];
2218
2429
  if (!entry)
2219
2430
  continue;
2220
2431
  const current = entry.includes("*");
@@ -2299,11 +2510,11 @@ class SwitchCommand {
2299
2510
  }
2300
2511
 
2301
2512
  // apps/cli/modules/switch/infra/bun-switch-repository.ts
2302
- var {$: $4 } = globalThis.Bun;
2513
+ var {$: $2 } = globalThis.Bun;
2303
2514
  class BunSwitchRepository {
2304
2515
  async getBranches() {
2305
2516
  try {
2306
- const output = await $4`git branch -a`.quiet().text();
2517
+ const output = await $2`git branch -a`.quiet().text();
2307
2518
  if (!output.trim()) {
2308
2519
  return [];
2309
2520
  }