create-rstack 2.1.2 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,13 +1,12 @@
1
1
  import "node:module";
2
- import node_fs from "node:fs";
3
- import node_path, { delimiter, dirname, resolve } from "node:path";
2
+ import node_fs, { closeSync, openSync, readSync, statSync } from "node:fs";
3
+ import node_path, { basename, delimiter, dirname, normalize as external_node_path_normalize, resolve } from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import node_util, { styleText } from "node:util";
6
6
  import node_process, { cwd as external_node_process_cwd, stdin, stdout } from "node:process";
7
7
  import node_readline from "node:readline";
8
8
  import node_tty from "node:tty";
9
9
  import node_os from "node:os";
10
- import { createRequire } from "node:module";
11
10
  import { execFileSync, spawn } from "node:child_process";
12
11
  import { pipeline } from "node:stream/promises";
13
12
  import { PassThrough } from "node:stream";
@@ -834,10 +833,10 @@ function wrapAnsi(string, columns, options) {
834
833
  return String(string).normalize().split(CRLF_OR_LF).map((line)=>exec(line, columns, options)).join('\n');
835
834
  }
836
835
  const src = __webpack_require__("./node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js");
837
- function dist_d(r, t, s) {
836
+ function dist_f(r, t, s) {
838
837
  if (!s.some((o)=>!o.disabled)) return r;
839
838
  const e = r + t, i = Math.max(s.length - 1, 0), n = e < 0 ? i : e > i ? 0 : e;
840
- return s[n].disabled ? dist_d(n, t < 0 ? -1 : 1, s) : n;
839
+ return s[n].disabled ? dist_f(n, t < 0 ? -1 : 1, s) : n;
841
840
  }
842
841
  const dist_G = [
843
842
  "up",
@@ -926,7 +925,7 @@ function z(r, t) {
926
925
  }
927
926
  globalThis.process.platform.startsWith("win");
928
927
  const dist_k = Symbol("clack:cancel");
929
- function dist_q(r) {
928
+ function q(r) {
930
929
  return r === dist_k;
931
930
  }
932
931
  function w(r, t) {
@@ -934,19 +933,19 @@ function w(r, t) {
934
933
  s.isTTY && s.setRawMode(t);
935
934
  }
936
935
  const dist_A = (r)=>"columns" in r && "number" == typeof r.columns ? r.columns : 80, dist_L = (r)=>"rows" in r && "number" == typeof r.rows ? r.rows : 20;
937
- function dist_W(r, t, s, e = s, i) {
938
- const n = dist_A(r ?? stdout);
939
- return wrapAnsi(t, n - s.length, {
936
+ function dist_W(r, t, s, e = s, i = s, n) {
937
+ const o = dist_A(r ?? stdout);
938
+ return wrapAnsi(t, o - s.length, {
940
939
  hard: !0,
941
940
  trim: !1
942
941
  }).split(`
943
- `).map((o, u)=>{
944
- const a = i ? i(o, u) : o;
945
- return `${0 === u ? e : s}${a}`;
942
+ `).map((u, a, l)=>{
943
+ const c = n ? n(u, a) : u;
944
+ return 0 === a ? `${e}${c}` : a === l.length - 1 ? `${i}${c}` : `${s}${c}`;
946
945
  }).join(`
947
946
  `);
948
947
  }
949
- let dist_p = class {
948
+ let dist_m = class {
950
949
  input;
951
950
  output;
952
951
  _abortSignal;
@@ -1106,13 +1105,13 @@ function dist_B(r, t) {
1106
1105
  const s = t.findIndex((e)=>e.value === r);
1107
1106
  return -1 !== s ? s : 0;
1108
1107
  }
1109
- function J(r, t) {
1108
+ function dist_J(r, t) {
1110
1109
  return (t.label ?? String(t.value)).toLowerCase().includes(r.toLowerCase());
1111
1110
  }
1112
1111
  function H(r, t) {
1113
1112
  if (t) return r ? t : t[0];
1114
1113
  }
1115
- let Q = class extends dist_p {
1114
+ let Q = class extends dist_m {
1116
1115
  filteredOptions;
1117
1116
  multiple;
1118
1117
  isNavigating = !1;
@@ -1143,7 +1142,7 @@ let Q = class extends dist_p {
1143
1142
  const s = this.options;
1144
1143
  this.filteredOptions = [
1145
1144
  ...s
1146
- ], this.multiple = !0 === t.multiple, this.#t = "function" == typeof t.options ? t.filter : t.filter ?? J;
1145
+ ], this.multiple = !0 === t.multiple, this.#t = "function" == typeof t.options ? t.filter : t.filter ?? dist_J;
1147
1146
  let e;
1148
1147
  if (t.initialValue && Array.isArray(t.initialValue) ? this.multiple ? e = t.initialValue : e = t.initialValue.slice(0, 1) : !this.multiple && this.options.length > 0 && (e = [
1149
1148
  this.options[0].value
@@ -1157,12 +1156,12 @@ let Q = class extends dist_p {
1157
1156
  return " " === t || this.multiple && this.isNavigating && "space" === s.name && void 0 !== t && "" !== t;
1158
1157
  }
1159
1158
  #e(t, s) {
1160
- const e = "up" === s.name, i = "down" === s.name, n = "return" === s.name, o = "" === this.userInput || " " === this.userInput, u = this.#u, a = this.options, l = void 0 !== u && "" !== u && a.some((f)=>!f.disabled && (this.#t ? this.#t(u, f) : !0));
1159
+ const e = "up" === s.name, i = "down" === s.name, n = "return" === s.name, o = "" === this.userInput || " " === this.userInput, u = this.#u, a = this.options, l = void 0 !== u && "" !== u && a.some((c)=>!c.disabled && (this.#t ? this.#t(u, c) : !0));
1161
1160
  if ("tab" === s.name && o && l) {
1162
1161
  " " === this.userInput && this._clearUserInput(), this._setUserInput(u, !0), this.isNavigating = !1;
1163
1162
  return;
1164
1163
  }
1165
- e || i ? (this.#s = dist_d(this.#s, e ? -1 : 1, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#s]?.value, this.multiple || (this.selectedValues = [
1164
+ e || i ? (this.#s = dist_f(this.#s, e ? -1 : 1, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#s]?.value, this.multiple || (this.selectedValues = [
1166
1165
  this.focusedValue
1167
1166
  ]), this.isNavigating = !0) : n ? this.value = H(this.multiple, this.selectedValues) : this.multiple ? void 0 !== this.focusedValue && ("tab" === s.name || this.isNavigating && "space" === s.name) ? this.toggleSelected(this.focusedValue) : this.isNavigating = !1 : (this.focusedValue && (this.selectedValues = [
1168
1167
  this.focusedValue
@@ -1187,13 +1186,13 @@ let Q = class extends dist_p {
1187
1186
  ...s
1188
1187
  ];
1189
1188
  const e = dist_B(this.focusedValue, this.filteredOptions);
1190
- this.#s = dist_d(e, 0, this.filteredOptions);
1189
+ this.#s = dist_f(e, 0, this.filteredOptions);
1191
1190
  const i = this.filteredOptions[this.#s];
1192
1191
  i && !i.disabled ? this.focusedValue = i.value : this.focusedValue = void 0, this.multiple || (void 0 !== this.focusedValue ? this.toggleSelected(this.focusedValue) : this.deselectAll());
1193
1192
  }
1194
1193
  }
1195
1194
  };
1196
- class it extends dist_p {
1195
+ class it extends dist_m {
1197
1196
  options;
1198
1197
  cursor = 0;
1199
1198
  #s;
@@ -1260,7 +1259,7 @@ class it extends dist_p {
1260
1259
  });
1261
1260
  }
1262
1261
  }
1263
- let dist_nt = class extends dist_p {
1262
+ let dist_nt = class extends dist_m {
1264
1263
  options;
1265
1264
  cursor = 0;
1266
1265
  get _value() {
@@ -1292,17 +1291,17 @@ let dist_nt = class extends dist_p {
1292
1291
  ...t.initialValues ?? []
1293
1292
  ];
1294
1293
  const s = Math.max(this.options.findIndex(({ value: e })=>e === t.cursorAt), 0);
1295
- this.cursor = this.options[s].disabled ? dist_d(s, 1, this.options) : s, this.on("key", (e)=>{
1294
+ this.cursor = this.options[s].disabled ? dist_f(s, 1, this.options) : s, this.on("key", (e)=>{
1296
1295
  "a" === e && this.toggleAll(), "i" === e && this.toggleInvert();
1297
1296
  }), this.on("cursor", (e)=>{
1298
1297
  switch(e){
1299
1298
  case "left":
1300
1299
  case "up":
1301
- this.cursor = dist_d(this.cursor, -1, this.options);
1300
+ this.cursor = dist_f(this.cursor, -1, this.options);
1302
1301
  break;
1303
1302
  case "down":
1304
1303
  case "right":
1305
- this.cursor = dist_d(this.cursor, 1, this.options);
1304
+ this.cursor = dist_f(this.cursor, 1, this.options);
1306
1305
  break;
1307
1306
  case "space":
1308
1307
  this.toggleValue();
@@ -1311,7 +1310,7 @@ let dist_nt = class extends dist_p {
1311
1310
  });
1312
1311
  }
1313
1312
  };
1314
- class ut extends dist_p {
1313
+ class ut extends dist_m {
1315
1314
  options;
1316
1315
  cursor = 0;
1317
1316
  get _selectedValue() {
@@ -1323,22 +1322,22 @@ class ut extends dist_p {
1323
1322
  constructor(t){
1324
1323
  super(t, !1), this.options = t.options;
1325
1324
  const s = this.options.findIndex(({ value: i })=>i === t.initialValue), e = -1 === s ? 0 : s;
1326
- this.cursor = this.options[e].disabled ? dist_d(e, 1, this.options) : e, this.changeValue(), this.on("cursor", (i)=>{
1325
+ this.cursor = this.options[e].disabled ? dist_f(e, 1, this.options) : e, this.changeValue(), this.on("cursor", (i)=>{
1327
1326
  switch(i){
1328
1327
  case "left":
1329
1328
  case "up":
1330
- this.cursor = dist_d(this.cursor, -1, this.options);
1329
+ this.cursor = dist_f(this.cursor, -1, this.options);
1331
1330
  break;
1332
1331
  case "down":
1333
1332
  case "right":
1334
- this.cursor = dist_d(this.cursor, 1, this.options);
1333
+ this.cursor = dist_f(this.cursor, 1, this.options);
1335
1334
  break;
1336
1335
  }
1337
1336
  this.changeValue();
1338
1337
  });
1339
1338
  }
1340
1339
  }
1341
- class ht extends dist_p {
1340
+ class ht extends dist_m {
1342
1341
  get userInputWithCursor() {
1343
1342
  if ("submit" === this.state) return this.userInput;
1344
1343
  const t = this.userInput;
@@ -1360,20 +1359,20 @@ class ht extends dist_p {
1360
1359
  });
1361
1360
  }
1362
1361
  }
1363
- function te() {
1362
+ function ee() {
1364
1363
  return "win32" !== node_process.platform ? "linux" !== node_process.env.TERM : !!node_process.env.CI || !!node_process.env.WT_SESSION || !!node_process.env.TERMINUS_SUBLIME || "{cmd::Cmder}" === node_process.env.ConEmuTask || "Terminus-Sublime" === node_process.env.TERM_PROGRAM || "vscode" === node_process.env.TERM_PROGRAM || "xterm-256color" === node_process.env.TERM || "alacritty" === node_process.env.TERM || "JetBrains-JediTerm" === node_process.env.TERMINAL_EMULATOR;
1365
1364
  }
1366
- const dist_tt = te(), dist_at = ()=>"true" === process.env.CI, Tt = (t)=>!0 === t.isTTY, dist_w = (t, r)=>dist_tt ? t : r, _t = dist_w("\u25C6", "*"), dist_ot = dist_w("\u25A0", "x"), dist_ut = dist_w("\u25B2", "x"), dist_F = dist_w("\u25C7", "o"), dist_$ = (dist_w("\u250C", "T"), dist_w("\u2502", "|")), E = dist_w("\u2514", "\u2014"), dist_z = (dist_w("\u2510", "T"), dist_w("\u2518", "\u2014"), dist_w("\u25CF", ">")), dist_H = dist_w("\u25CB", " "), dist_et = dist_w("\u25FB", "[\u2022]"), dist_U = dist_w("\u25FC", "[+]"), dist_J = dist_w("\u25FB", "[ ]"), dist_st = (dist_w("\u25AA", "\u2022"), dist_w("\u2500", "-")), ct = dist_w("\u256E", "+"), xt = dist_w("\u251C", "+"), $t = dist_w("\u256F", "+"), dt = dist_w("\u2570", "+"), dist_ht = (dist_w("\u256D", "+"), dist_w("\u25CF", "\u2022")), pt = dist_w("\u25C6", "*"), mt = dist_w("\u25B2", "!"), gt = dist_w("\u25A0", "x"), M = (t)=>{
1365
+ const dist_tt = ee(), dist_ot = ()=>"true" === process.env.CI, It = (t)=>!0 === t.isTTY, dist_w = (t, i)=>dist_tt ? t : i, Tt = dist_w("\u25C6", "*"), dist_at = dist_w("\u25A0", "x"), dist_ut = dist_w("\u25B2", "x"), dist_H = dist_w("\u25C7", "o"), dist_$ = (dist_w("\u250C", "T"), dist_w("\u2502", "|")), dist_x = dist_w("\u2514", "\u2014"), dist_z = (dist_w("\u2510", "T"), dist_w("\u2518", "\u2014"), dist_w("\u25CF", ">")), dist_U = dist_w("\u25CB", " "), dist_et = dist_w("\u25FB", "[\u2022]"), dist_K = dist_w("\u25FC", "[+]"), dist_Y = dist_w("\u25FB", "[ ]"), dist_st = (dist_w("\u25AA", "\u2022"), dist_w("\u2500", "-")), ct = dist_w("\u256E", "+"), Gt = dist_w("\u251C", "+"), $t = dist_w("\u256F", "+"), dt = dist_w("\u2570", "+"), dist_ht = (dist_w("\u256D", "+"), dist_w("\u25CF", "\u2022")), pt = dist_w("\u25C6", "*"), mt = dist_w("\u25B2", "!"), gt = dist_w("\u25A0", "x"), dist_P = (t)=>{
1367
1366
  switch(t){
1368
1367
  case "initial":
1369
1368
  case "active":
1370
- return styleText("cyan", _t);
1369
+ return styleText("cyan", Tt);
1371
1370
  case "cancel":
1372
- return styleText("red", dist_ot);
1371
+ return styleText("red", dist_at);
1373
1372
  case "error":
1374
1373
  return styleText("yellow", dist_ut);
1375
1374
  case "submit":
1376
- return styleText("green", dist_F);
1375
+ return styleText("green", dist_H);
1377
1376
  }
1378
1377
  }, yt = (t)=>{
1379
1378
  switch(t){
@@ -1387,54 +1386,54 @@ const dist_tt = te(), dist_at = ()=>"true" === process.env.CI, Tt = (t)=>!0 ===
1387
1386
  case "submit":
1388
1387
  return styleText("green", dist_$);
1389
1388
  }
1390
- }, ee = (t, r, s, i, u)=>{
1391
- let n = r, o = 0;
1392
- for(let c = s; c < i; c++){
1393
- const a = t[c];
1394
- if (n -= a.length, o++, n <= u) break;
1395
- }
1389
+ }, Ot = (t, i, s, r, u, n = !1)=>{
1390
+ let a = i, c = 0;
1391
+ if (n) for(let o = r - 1; o >= s && (a -= t[o].length, c++, !(a <= u)); o--);
1392
+ else for(let o = s; o < r && (a -= t[o].length, c++, !(a <= u)); o++);
1396
1393
  return {
1397
- lineCount: n,
1398
- removals: o
1394
+ lineCount: a,
1395
+ removals: c
1399
1396
  };
1400
- }, dist_Y = ({ cursor: t, options: r, style: s, output: i = process.stdout, maxItems: u = 1 / 0, columnPadding: n = 0, rowPadding: o = 4 })=>{
1401
- const c = dist_A(i) - n, a = dist_L(i), l = styleText("dim", "..."), d = Math.max(a - o, 0), y = Math.max(Math.min(u, d), 5);
1397
+ }, dist_F = ({ cursor: t, options: i, style: s, output: r = process.stdout, maxItems: u = 1 / 0, columnPadding: n = 0, rowPadding: a = 4 })=>{
1398
+ const c = dist_A(r) - n, o = dist_L(r), l = styleText("dim", "..."), d = Math.max(o - a, 0), g = Math.max(Math.min(u, d), 5);
1402
1399
  let p = 0;
1403
- t >= y - 3 && (p = Math.max(Math.min(t - y + 3, r.length - y), 0));
1404
- let m = y < r.length && p > 0, g = y < r.length && p + y < r.length;
1405
- const S = Math.min(p + y, r.length), h = [];
1406
- let f = 0;
1407
- m && f++, g && f++;
1408
- const v = p + (m ? 1 : 0), T = S - (g ? 1 : 0);
1409
- for(let b = v; b < T; b++){
1410
- const G = wrapAnsi(s(r[b], b === t), c, {
1400
+ t >= g - 3 && (p = Math.max(Math.min(t - g + 3, i.length - g), 0));
1401
+ let f = g < i.length && p > 0, h = g < i.length && p + g < i.length;
1402
+ const I = Math.min(p + g, i.length), m = [];
1403
+ let y = 0;
1404
+ f && y++, h && y++;
1405
+ const v = p + (f ? 1 : 0), C = I - (h ? 1 : 0);
1406
+ for(let b = v; b < C; b++){
1407
+ const G = wrapAnsi(s(i[b], b === t), c, {
1411
1408
  hard: !0,
1412
1409
  trim: !1
1413
1410
  }).split(`
1414
1411
  `);
1415
- h.push(G), f += G.length;
1416
- }
1417
- if (f > d) {
1418
- let b = 0, G = 0, x = f;
1419
- const A = t - v, P = (N, D)=>ee(h, x, N, D, d);
1420
- m ? ({ lineCount: x, removals: b } = P(0, A), x > d && ({ lineCount: x, removals: G } = P(A + 1, h.length))) : ({ lineCount: x, removals: G } = P(A + 1, h.length), x > d && ({ lineCount: x, removals: b } = P(0, A))), b > 0 && (m = !0, h.splice(0, b)), G > 0 && (g = !0, h.splice(h.length - G, G));
1421
- }
1422
- const C = [];
1423
- m && C.push(l);
1424
- for (const b of h)for (const G of b)C.push(G);
1425
- return g && C.push(l), C;
1412
+ m.push(G), y += G.length;
1413
+ }
1414
+ if (y > d) {
1415
+ let b = 0, G = 0, M = y;
1416
+ const N = t - v;
1417
+ let O = d;
1418
+ const j = ()=>Ot(m, M, 0, N, O), k = ()=>Ot(m, M, N + 1, m.length, O, !0);
1419
+ f ? ({ lineCount: M, removals: b } = j(), M > O && (h || (O -= 1), { lineCount: M, removals: G } = k())) : (h || (O -= 1), { lineCount: M, removals: G } = k(), M > O && (O -= 1, { lineCount: M, removals: b } = j())), b > 0 && (f = !0, m.splice(0, b)), G > 0 && (h = !0, m.splice(m.length - G, G));
1420
+ }
1421
+ const S = [];
1422
+ f && S.push(l);
1423
+ for (const b of m)for (const G of b)S.push(G);
1424
+ return h && S.push(l), S;
1426
1425
  };
1427
- function Mt(t) {
1426
+ function Pt(t) {
1428
1427
  return t.label ?? String(t.value ?? "");
1429
1428
  }
1430
- function Rt(t, r) {
1429
+ function Rt(t, i) {
1431
1430
  if (!t) return !0;
1432
- const s = (r.label ?? String(r.value ?? "")).toLowerCase(), i = (r.hint ?? "").toLowerCase(), u = String(r.value).toLowerCase(), n = t.toLowerCase();
1433
- return s.includes(n) || i.includes(n) || u.includes(n);
1431
+ const s = (i.label ?? String(i.value ?? "")).toLowerCase(), r = (i.hint ?? "").toLowerCase(), u = String(i.value).toLowerCase(), n = t.toLowerCase();
1432
+ return s.includes(n) || r.includes(n) || u.includes(n);
1434
1433
  }
1435
- function se(t, r) {
1434
+ function se(t, i) {
1436
1435
  const s = [];
1437
- for (const i of r)t.includes(i.value) && s.push(i);
1436
+ for (const r of i)t.includes(r.value) && s.push(r);
1438
1437
  return s;
1439
1438
  }
1440
1439
  const At = (t)=>new Q({
@@ -1444,26 +1443,26 @@ const At = (t)=>new Q({
1444
1443
  ] : void 0,
1445
1444
  initialUserInput: t.initialUserInput,
1446
1445
  placeholder: t.placeholder,
1447
- filter: t.filter ?? ((r, s)=>Rt(r, s)),
1446
+ filter: t.filter ?? ((i, s)=>Rt(i, s)),
1448
1447
  signal: t.signal,
1449
1448
  input: t.input,
1450
1449
  output: t.output,
1451
1450
  validate: t.validate,
1452
1451
  render () {
1453
- const r = t.withGuide ?? dist_h.withGuide, s = r ? [
1452
+ const i = t.withGuide ?? dist_h.withGuide, s = i ? [
1454
1453
  `${styleText("gray", dist_$)}`,
1455
- `${M(this.state)} ${t.message}`
1454
+ `${dist_P(this.state)} ${t.message}`
1456
1455
  ] : [
1457
- `${M(this.state)} ${t.message}`
1458
- ], i = this.userInput, u = this.options, n = t.placeholder, o = "" === i && void 0 !== n, c = (a, l)=>{
1459
- const d = Mt(a), y = a.hint && a.value === this.focusedValue ? styleText("dim", ` (${a.hint})`) : "";
1456
+ `${dist_P(this.state)} ${t.message}`
1457
+ ], r = this.userInput, u = this.options, n = t.placeholder, a = "" === r && void 0 !== n, c = (o, l)=>{
1458
+ const d = Pt(o), g = o.hint && o.value === this.focusedValue ? styleText("dim", ` (${o.hint})`) : "";
1460
1459
  switch(l){
1461
1460
  case "active":
1462
- return `${styleText("green", dist_z)} ${d}${y}`;
1461
+ return `${styleText("green", dist_z)} ${d}${g}`;
1463
1462
  case "inactive":
1464
- return `${styleText("dim", dist_H)} ${styleText("dim", d)}`;
1463
+ return `${styleText("dim", dist_U)} ${styleText("dim", d)}`;
1465
1464
  case "disabled":
1466
- return `${styleText("gray", dist_H)} ${styleText([
1465
+ return `${styleText("gray", dist_U)} ${styleText([
1467
1466
  "strikethrough",
1468
1467
  "gray"
1469
1468
  ], d)}`;
@@ -1472,55 +1471,55 @@ const At = (t)=>new Q({
1472
1471
  switch(this.state){
1473
1472
  case "submit":
1474
1473
  {
1475
- const a = se(this.selectedValues, u), l = a.length > 0 ? ` ${styleText("dim", a.map(Mt).join(", "))}` : "", d = r ? styleText("gray", dist_$) : "";
1474
+ const o = se(this.selectedValues, u), l = o.length > 0 ? ` ${styleText("dim", o.map(Pt).join(", "))}` : "", d = i ? styleText("gray", dist_$) : "";
1476
1475
  return `${s.join(`
1477
1476
  `)}
1478
1477
  ${d}${l}`;
1479
1478
  }
1480
1479
  case "cancel":
1481
1480
  {
1482
- const a = i ? ` ${styleText([
1481
+ const o = r ? ` ${styleText([
1483
1482
  "strikethrough",
1484
1483
  "dim"
1485
- ], i)}` : "", l = r ? styleText("gray", dist_$) : "";
1484
+ ], r)}` : "", l = i ? styleText("gray", dist_$) : "";
1486
1485
  return `${s.join(`
1487
1486
  `)}
1488
- ${l}${a}`;
1487
+ ${l}${o}`;
1489
1488
  }
1490
1489
  default:
1491
1490
  {
1492
- const a = "error" === this.state ? "yellow" : "cyan", l = r ? `${styleText(a, dist_$)} ` : "", d = r ? styleText(a, E) : "";
1493
- let y = "";
1494
- if (this.isNavigating || o) {
1495
- const v = o ? n : i;
1496
- y = "" !== v ? ` ${styleText("dim", v)}` : "";
1497
- } else y = ` ${this.userInputWithCursor}`;
1498
- const p = this.filteredOptions.length !== u.length ? styleText("dim", ` (${this.filteredOptions.length} match${1 === this.filteredOptions.length ? "" : "es"})`) : "", m = 0 === this.filteredOptions.length && i ? [
1491
+ const o = "error" === this.state ? "yellow" : "cyan", l = i ? `${styleText(o, dist_$)} ` : "", d = i ? styleText(o, dist_x) : "";
1492
+ let g = "";
1493
+ if (this.isNavigating || a) {
1494
+ const v = a ? n : r;
1495
+ g = "" !== v ? ` ${styleText("dim", v)}` : "";
1496
+ } else g = ` ${this.userInputWithCursor}`;
1497
+ const p = this.filteredOptions.length !== u.length ? styleText("dim", ` (${this.filteredOptions.length} match${1 === this.filteredOptions.length ? "" : "es"})`) : "", f = 0 === this.filteredOptions.length && r ? [
1499
1498
  `${l}${styleText("yellow", "No matches found")}`
1500
- ] : [], g = "error" === this.state ? [
1499
+ ] : [], h = "error" === this.state ? [
1501
1500
  `${l}${styleText("yellow", this.error)}`
1502
1501
  ] : [];
1503
- r && s.push(`${l.trimEnd()}`), s.push(`${l}${styleText("dim", "Search:")}${y}${p}`, ...m, ...g);
1504
- const S = [
1502
+ i && s.push(`${l.trimEnd()}`), s.push(`${l}${styleText("dim", "Search:")}${g}${p}`, ...f, ...h);
1503
+ const I = [
1505
1504
  `${styleText("dim", "\u2191/\u2193")} to select`,
1506
1505
  `${styleText("dim", "Enter:")} confirm`,
1507
1506
  `${styleText("dim", "Type:")} to search`
1508
- ], h = [
1509
- `${l}${S.join(" \u2022 ")}`,
1507
+ ], m = [
1508
+ `${l}${I.join(" \u2022 ")}`,
1510
1509
  d
1511
- ], f = 0 === this.filteredOptions.length ? [] : dist_Y({
1510
+ ], y = 0 === this.filteredOptions.length ? [] : dist_F({
1512
1511
  cursor: this.cursor,
1513
1512
  options: this.filteredOptions,
1514
- columnPadding: r ? 3 : 0,
1515
- rowPadding: s.length + h.length,
1516
- style: (v, T)=>c(v, v.disabled ? "disabled" : T ? "active" : "inactive"),
1513
+ columnPadding: i ? 3 : 0,
1514
+ rowPadding: s.length + m.length,
1515
+ style: (v, C)=>c(v, v.disabled ? "disabled" : C ? "active" : "inactive"),
1517
1516
  maxItems: t.maxItems,
1518
1517
  output: t.output
1519
1518
  });
1520
1519
  return [
1521
1520
  ...s,
1522
- ...f.map((v)=>`${l}${v}`),
1523
- ...h
1521
+ ...y.map((v)=>`${l}${v}`),
1522
+ ...m
1524
1523
  ].join(`
1525
1524
  `);
1526
1525
  }
@@ -1528,31 +1527,29 @@ ${l}${a}`;
1528
1527
  }
1529
1528
  }).prompt();
1530
1529
  const pe = (t)=>{
1531
- const { selectableGroups: r = !0, groupSpacing: s = 0 } = t, i = (n, o, c = [])=>{
1532
- const a = n.label ?? String(n.value), l = "string" == typeof n.group, d = l && (c[c.indexOf(n) + 1] ?? {
1530
+ const { selectableGroups: i = !0, groupSpacing: s = 0 } = t, r = (n, a, c = [])=>{
1531
+ const o = n.label ?? String(n.value), l = "string" == typeof n.group, d = l && (c[c.indexOf(n) + 1] ?? {
1533
1532
  group: !0
1534
- }), y = l && d && !0 === d.group, p = l ? r ? `${y ? E : dist_$} ` : " " : "";
1535
- let m = "";
1536
- if (s > 0 && !l) {
1537
- const S = `
1538
- ${styleText("cyan", dist_$)}`;
1539
- m = `${S.repeat(s - 1)}${S} `;
1540
- }
1541
- if ("active" === o) return `${m}${styleText("dim", p)}${styleText("cyan", dist_et)} ${a}${n.hint ? ` ${styleText("dim", `(${n.hint})`)}` : ""}`;
1542
- if ("group-active" === o) return `${m}${p}${styleText("cyan", dist_et)} ${styleText("dim", a)}`;
1543
- if ("group-active-selected" === o) return `${m}${p}${styleText("green", dist_U)} ${styleText("dim", a)}`;
1544
- if ("selected" === o) {
1545
- const S = l || r ? styleText("green", dist_U) : "";
1546
- return `${m}${styleText("dim", p)}${S} ${styleText("dim", a)}${n.hint ? ` ${styleText("dim", `(${n.hint})`)}` : ""}`;
1547
- }
1548
- if ("cancelled" === o) return `${styleText([
1533
+ }), g = l && d && !0 === d.group;
1534
+ let p = "", f = "";
1535
+ l && (i ? (p = g ? `${dist_x} ` : `${dist_$} `, f = g ? " " : `${dist_$} `) : p = " ");
1536
+ let h = "";
1537
+ if (s > 0 && !l && (h = `
1538
+ `.repeat(s)), "active" === a) return dist_W(t.output, `${o}${n.hint ? ` ${styleText("dim", `(${n.hint})`)}` : ""}`, `${h}${styleText("dim", p)} `, `${h}${styleText("dim", p)}${styleText("cyan", dist_et)} `, `${h}${styleText("dim", f)} `);
1539
+ if ("group-active" === a) return dist_W(t.output, o, `${h}${p} `, `${h}${p}${styleText("cyan", dist_et)} `, `${h}${f} `, (m)=>styleText("dim", m));
1540
+ if ("group-active-selected" === a) return dist_W(t.output, o, `${h}${p} `, `${h}${p}${styleText("green", dist_K)} `, `${h}${f} `, (m)=>styleText("dim", m));
1541
+ if ("selected" === a) {
1542
+ const m = l || i ? styleText("green", dist_K) : "";
1543
+ return dist_W(t.output, `${o}${n.hint ? ` (${n.hint})` : ""}`, `${h}${styleText("dim", p)} `, `${h}${styleText("dim", p)}${m} `, `${h}${styleText("dim", f)} `, (y)=>styleText("dim", y));
1544
+ }
1545
+ if ("cancelled" === a) return `${styleText([
1549
1546
  "strikethrough",
1550
1547
  "dim"
1551
- ], a)}`;
1552
- if ("active-selected" === o) return `${m}${styleText("dim", p)}${styleText("green", dist_U)} ${a}${n.hint ? ` ${styleText("dim", `(${n.hint})`)}` : ""}`;
1553
- if ("submitted" === o) return `${styleText("dim", a)}`;
1554
- const g = l || r ? styleText("dim", dist_J) : "";
1555
- return `${m}${styleText("dim", p)}${g} ${styleText("dim", a)}`;
1548
+ ], o)}`;
1549
+ if ("active-selected" === a) return dist_W(t.output, `${o}${n.hint ? ` ${styleText("dim", `(${n.hint})`)}` : ""}`, `${h}${styleText("dim", p)} `, `${h}${styleText("dim", p)}${styleText("green", dist_K)} `, `${h}${styleText("dim", f)} `);
1550
+ if ("submitted" === a) return `${styleText("dim", o)}`;
1551
+ const I = l || i ? styleText("dim", dist_Y) : "";
1552
+ return dist_W(t.output, o, `${h}${styleText("dim", p)} `, `${h}${styleText("dim", p)}${I} `, `${h}${styleText("dim", f)} `, (m)=>styleText("dim", m));
1556
1553
  }, u = t.required ?? !0;
1557
1554
  return new it({
1558
1555
  options: t.options,
@@ -1562,7 +1559,7 @@ ${styleText("cyan", dist_$)}`;
1562
1559
  initialValues: t.initialValues,
1563
1560
  required: u,
1564
1561
  cursorAt: t.cursorAt,
1565
- selectableGroups: r,
1562
+ selectableGroups: i,
1566
1563
  validate (n) {
1567
1564
  if (u && (void 0 === n || 0 === n.length)) return `Please select at least one option.
1568
1565
  ${styleText("reset", styleText("dim", `Press ${styleText([
@@ -1575,122 +1572,135 @@ ${styleText("reset", styleText("dim", `Press ${styleText([
1575
1572
  ], " enter "))} to submit`))}`;
1576
1573
  },
1577
1574
  render () {
1578
- const n = t.withGuide ?? dist_h.withGuide, o = `${n ? `${styleText("gray", dist_$)}
1579
- ` : ""}${M(this.state)} ${t.message}
1580
- `, c = this.value ?? [];
1575
+ const n = t.withGuide ?? dist_h.withGuide, a = `${n ? `${styleText("gray", dist_$)}
1576
+ ` : ""}${dist_P(this.state)} ${t.message}
1577
+ `, c = this.value ?? [], o = (l, d)=>{
1578
+ const g = this.options, p = c.includes(l.value) || !0 === l.group && this.isGroupSelected(`${l.value}`);
1579
+ return d || "string" != typeof l.group || this.options[this.cursor].value !== l.group ? d && p ? r(l, "active-selected", g) : p ? r(l, "selected", g) : r(l, d ? "active" : "inactive", g) : r(l, p ? "group-active-selected" : "group-active", g);
1580
+ };
1581
1581
  switch(this.state){
1582
1582
  case "submit":
1583
1583
  {
1584
- const a = this.options.filter(({ value: d })=>c.includes(d)).map((d)=>i(d, "submitted")), l = 0 === a.length ? "" : ` ${a.join(styleText("dim", ", "))}`;
1585
- return `${o}${n ? styleText("gray", dist_$) : ""}${l}`;
1584
+ const l = this.options.filter(({ value: g })=>c.includes(g)).map((g)=>r(g, "submitted")), d = 0 === l.length ? "" : ` ${l.join(styleText("dim", ", "))}`;
1585
+ return `${a}${n ? styleText("gray", dist_$) : ""}${d}`;
1586
1586
  }
1587
1587
  case "cancel":
1588
1588
  {
1589
- const a = this.options.filter(({ value: l })=>c.includes(l)).map((l)=>i(l, "cancelled")).join(styleText("dim", ", "));
1590
- return `${o}${n ? `${styleText("gray", dist_$)} ` : ""}${a.trim() ? `${a}${n ? `
1589
+ const l = this.options.filter(({ value: d })=>c.includes(d)).map((d)=>r(d, "cancelled")).join(styleText("dim", ", "));
1590
+ return `${a}${n ? `${styleText("gray", dist_$)} ` : ""}${l.trim() ? `${l}${n ? `
1591
1591
  ${styleText("gray", dist_$)}` : ""}` : ""}`;
1592
1592
  }
1593
1593
  case "error":
1594
1594
  {
1595
- const a = this.error.split(`
1596
- `).map((l, d)=>0 === d ? `${n ? `${styleText("yellow", E)} ` : ""}${styleText("yellow", l)}` : ` ${l}`).join(`
1597
- `);
1598
- return `${o}${n ? `${styleText("yellow", dist_$)} ` : ""}${this.options.map((l, d, y)=>{
1599
- const p = c.includes(l.value) || !0 === l.group && this.isGroupSelected(`${l.value}`), m = d === this.cursor;
1600
- return m || "string" != typeof l.group || this.options[this.cursor].value !== l.group ? m && p ? i(l, "active-selected", y) : p ? i(l, "selected", y) : i(l, m ? "active" : "inactive", y) : i(l, p ? "group-active-selected" : "group-active", y);
1595
+ const l = n ? `${styleText("yellow", dist_$)} ` : "", d = this.error.split(`
1596
+ `).map((h, I)=>0 === I ? `${n ? `${styleText("yellow", dist_x)} ` : ""}${styleText("yellow", h)}` : ` ${h}`).join(`
1597
+ `), g = a.split(`
1598
+ `).length, p = d.split(`
1599
+ `).length + 1, f = dist_F({
1600
+ output: t.output,
1601
+ options: this.options,
1602
+ cursor: this.cursor,
1603
+ maxItems: t.maxItems,
1604
+ columnPadding: l.length,
1605
+ rowPadding: g + p,
1606
+ style: o
1601
1607
  }).join(`
1602
- ${n ? `${styleText("yellow", dist_$)} ` : ""}`)}
1603
- ${a}
1608
+ ${l}`);
1609
+ return `${a}${l}${f}
1610
+ ${d}
1604
1611
  `;
1605
1612
  }
1606
1613
  default:
1607
1614
  {
1608
- const a = this.options.map((d, y, p)=>{
1609
- const m = c.includes(d.value) || !0 === d.group && this.isGroupSelected(`${d.value}`), g = y === this.cursor, S = !g && "string" == typeof d.group && this.options[this.cursor].value === d.group;
1610
- let h = "";
1611
- return S ? h = i(d, m ? "group-active-selected" : "group-active", p) : g && m ? h = i(d, "active-selected", p) : m ? h = i(d, "selected", p) : h = i(d, g ? "active" : "inactive", p), `${0 !== y && !h.startsWith(`
1612
- `) ? " " : ""}${h}`;
1615
+ const l = n ? `${styleText("cyan", dist_$)} ` : "", d = a.split(`
1616
+ `).length, g = (n ? 1 : 0) + 1, p = dist_F({
1617
+ output: t.output,
1618
+ options: this.options,
1619
+ cursor: this.cursor,
1620
+ maxItems: t.maxItems,
1621
+ columnPadding: l.length,
1622
+ rowPadding: d + g,
1623
+ style: o
1613
1624
  }).join(`
1614
- ${n ? styleText("cyan", dist_$) : ""}`), l = a.startsWith(`
1615
- `) ? "" : " ";
1616
- return `${o}${n ? styleText("cyan", dist_$) : ""}${l}${a}
1617
- ${n ? styleText("cyan", E) : ""}
1625
+ ${l}`);
1626
+ return `${a}${l}${p}
1627
+ ${n ? styleText("cyan", dist_x) : ""}
1618
1628
  `;
1619
1629
  }
1620
1630
  }
1621
1631
  }
1622
1632
  }).prompt();
1623
1633
  }, dist_R = {
1624
- message: (t = [], { symbol: r = styleText("gray", dist_$), secondarySymbol: s = styleText("gray", dist_$), output: i = process.stdout, spacing: u = 1, withGuide: n } = {})=>{
1625
- const o = [], c = n ?? dist_h.withGuide, a = c ? s : "", l = c ? `${r} ` : "", d = c ? `${s} ` : "";
1626
- for(let p = 0; p < u; p++)o.push(a);
1627
- const y = Array.isArray(t) ? t : t.split(`
1634
+ message: (t = [], { symbol: i = styleText("gray", dist_$), secondarySymbol: s = styleText("gray", dist_$), output: r = process.stdout, spacing: u = 1, withGuide: n } = {})=>{
1635
+ const a = [], c = n ?? dist_h.withGuide, o = c ? s : "", l = c ? `${i} ` : "", d = c ? `${s} ` : "";
1636
+ for(let p = 0; p < u; p++)a.push(o);
1637
+ const g = Array.isArray(t) ? t : t.split(`
1628
1638
  `);
1629
- if (y.length > 0) {
1630
- const [p, ...m] = y;
1631
- p.length > 0 ? o.push(`${l}${p}`) : o.push(c ? r : "");
1632
- for (const g of m)g.length > 0 ? o.push(`${d}${g}`) : o.push(c ? s : "");
1639
+ if (g.length > 0) {
1640
+ const [p, ...f] = g;
1641
+ p.length > 0 ? a.push(`${l}${p}`) : a.push(c ? i : "");
1642
+ for (const h of f)h.length > 0 ? a.push(`${d}${h}`) : a.push(c ? s : "");
1633
1643
  }
1634
- i.write(`${o.join(`
1644
+ r.write(`${a.join(`
1635
1645
  `)}
1636
1646
  `);
1637
1647
  },
1638
- info: (t, r)=>{
1648
+ info: (t, i)=>{
1639
1649
  dist_R.message(t, {
1640
- ...r,
1650
+ ...i,
1641
1651
  symbol: styleText("blue", dist_ht)
1642
1652
  });
1643
1653
  },
1644
- success: (t, r)=>{
1654
+ success: (t, i)=>{
1645
1655
  dist_R.message(t, {
1646
- ...r,
1656
+ ...i,
1647
1657
  symbol: styleText("green", pt)
1648
1658
  });
1649
1659
  },
1650
- step: (t, r)=>{
1660
+ step: (t, i)=>{
1651
1661
  dist_R.message(t, {
1652
- ...r,
1653
- symbol: styleText("green", dist_F)
1662
+ ...i,
1663
+ symbol: styleText("green", dist_H)
1654
1664
  });
1655
1665
  },
1656
- warn: (t, r)=>{
1666
+ warn: (t, i)=>{
1657
1667
  dist_R.message(t, {
1658
- ...r,
1668
+ ...i,
1659
1669
  symbol: styleText("yellow", mt)
1660
1670
  });
1661
1671
  },
1662
- warning: (t, r)=>{
1663
- dist_R.warn(t, r);
1672
+ warning: (t, i)=>{
1673
+ dist_R.warn(t, i);
1664
1674
  },
1665
- error: (t, r)=>{
1675
+ error: (t, i)=>{
1666
1676
  dist_R.message(t, {
1667
- ...r,
1677
+ ...i,
1668
1678
  symbol: styleText("red", gt)
1669
1679
  });
1670
1680
  }
1671
- }, me = (t = "", r)=>{
1672
- const s = r?.output ?? process.stdout, i = r?.withGuide ?? dist_h.withGuide ? `${styleText("gray", E)} ` : "";
1673
- s.write(`${i}${styleText("red", t)}
1681
+ }, me = (t = "", i)=>{
1682
+ const s = i?.output ?? process.stdout, r = i?.withGuide ?? dist_h.withGuide ? `${styleText("gray", dist_x)} ` : "";
1683
+ s.write(`${r}${styleText("red", t)}
1674
1684
 
1675
1685
  `);
1676
- }, ye = (t = "", r)=>{
1677
- const s = r?.output ?? process.stdout, i = r?.withGuide ?? dist_h.withGuide ? `${styleText("gray", dist_$)}
1678
- ${styleText("gray", E)} ` : "";
1679
- s.write(`${i}${t}
1686
+ }, ye = (t = "", i)=>{
1687
+ const s = i?.output ?? process.stdout, r = i?.withGuide ?? dist_h.withGuide ? `${styleText("gray", dist_$)}
1688
+ ${styleText("gray", dist_x)} ` : "";
1689
+ s.write(`${r}${t}
1680
1690
 
1681
1691
  `);
1682
- }, dist_Q = (t, r)=>t.split(`
1683
- `).map((s)=>r(s)).join(`
1692
+ }, dist_Q = (t, i)=>t.split(`
1693
+ `).map((s)=>i(s)).join(`
1684
1694
  `), ve = (t)=>{
1685
- const r = (i, u)=>{
1686
- const n = i.label ?? String(i.value);
1687
- return "disabled" === u ? `${styleText("gray", dist_J)} ${dist_Q(n, (o)=>styleText([
1695
+ const i = (r, u)=>{
1696
+ const n = r.label ?? String(r.value);
1697
+ return "disabled" === u ? `${styleText("gray", dist_Y)} ${dist_Q(n, (a)=>styleText([
1688
1698
  "strikethrough",
1689
1699
  "gray"
1690
- ], o))}${i.hint ? ` ${styleText("dim", `(${i.hint ?? "disabled"})`)}` : ""}` : "active" === u ? `${styleText("cyan", dist_et)} ${n}${i.hint ? ` ${styleText("dim", `(${i.hint})`)}` : ""}` : "selected" === u ? `${styleText("green", dist_U)} ${dist_Q(n, (o)=>styleText("dim", o))}${i.hint ? ` ${styleText("dim", `(${i.hint})`)}` : ""}` : "cancelled" === u ? `${dist_Q(n, (o)=>styleText([
1700
+ ], a))}${r.hint ? ` ${styleText("dim", `(${r.hint ?? "disabled"})`)}` : ""}` : "active" === u ? `${styleText("cyan", dist_et)} ${n}${r.hint ? ` ${styleText("dim", `(${r.hint})`)}` : ""}` : "selected" === u ? `${styleText("green", dist_K)} ${dist_Q(n, (a)=>styleText("dim", a))}${r.hint ? ` ${styleText("dim", `(${r.hint})`)}` : ""}` : "cancelled" === u ? `${dist_Q(n, (a)=>styleText([
1691
1701
  "strikethrough",
1692
1702
  "dim"
1693
- ], o))}` : "active-selected" === u ? `${styleText("green", dist_U)} ${n}${i.hint ? ` ${styleText("dim", `(${i.hint})`)}` : ""}` : "submitted" === u ? `${dist_Q(n, (o)=>styleText("dim", o))}` : `${styleText("dim", dist_J)} ${dist_Q(n, (o)=>styleText("dim", o))}`;
1703
+ ], a))}` : "active-selected" === u ? `${styleText("green", dist_K)} ${n}${r.hint ? ` ${styleText("dim", `(${r.hint})`)}` : ""}` : "submitted" === u ? `${dist_Q(n, (a)=>styleText("dim", a))}` : `${styleText("dim", dist_Y)} ${dist_Q(n, (a)=>styleText("dim", a))}`;
1694
1704
  }, s = t.required ?? !0;
1695
1705
  return new dist_nt({
1696
1706
  options: t.options,
@@ -1700,8 +1710,8 @@ ${styleText("gray", E)} ` : "";
1700
1710
  initialValues: t.initialValues,
1701
1711
  required: s,
1702
1712
  cursorAt: t.cursorAt,
1703
- validate (i) {
1704
- if (s && (void 0 === i || 0 === i.length)) return `Please select at least one option.
1713
+ validate (r) {
1714
+ if (s && (void 0 === r || 0 === r.length)) return `Please select at least one option.
1705
1715
  ${styleText("reset", styleText("dim", `Press ${styleText([
1706
1716
  "gray",
1707
1717
  "bgWhite",
@@ -1709,101 +1719,101 @@ ${styleText("reset", styleText("dim", `Press ${styleText([
1709
1719
  ], " space ")} to select, ${styleText("gray", styleText("bgWhite", styleText("inverse", " enter ")))} to submit`))}`;
1710
1720
  },
1711
1721
  render () {
1712
- const i = t.withGuide ?? dist_h.withGuide, u = dist_W(t.output, t.message, i ? `${yt(this.state)} ` : "", `${M(this.state)} `), n = `${i ? `${styleText("gray", dist_$)}
1722
+ const r = t.withGuide ?? dist_h.withGuide, u = dist_W(t.output, t.message, r ? `${yt(this.state)} ` : "", `${dist_P(this.state)} `), n = `${r ? `${styleText("gray", dist_$)}
1713
1723
  ` : ""}${u}
1714
- `, o = this.value ?? [], c = (a, l)=>{
1715
- if (a.disabled) return r(a, "disabled");
1716
- const d = o.includes(a.value);
1717
- return l && d ? r(a, "active-selected") : d ? r(a, "selected") : r(a, l ? "active" : "inactive");
1724
+ `, a = this.value ?? [], c = (o, l)=>{
1725
+ if (o.disabled) return i(o, "disabled");
1726
+ const d = a.includes(o.value);
1727
+ return l && d ? i(o, "active-selected") : d ? i(o, "selected") : i(o, l ? "active" : "inactive");
1718
1728
  };
1719
1729
  switch(this.state){
1720
1730
  case "submit":
1721
1731
  {
1722
- const a = this.options.filter(({ value: d })=>o.includes(d)).map((d)=>r(d, "submitted")).join(styleText("dim", ", ")) || styleText("dim", "none"), l = dist_W(t.output, a, i ? `${styleText("gray", dist_$)} ` : "");
1732
+ const o = this.options.filter(({ value: d })=>a.includes(d)).map((d)=>i(d, "submitted")).join(styleText("dim", ", ")) || styleText("dim", "none"), l = dist_W(t.output, o, r ? `${styleText("gray", dist_$)} ` : "");
1723
1733
  return `${n}${l}`;
1724
1734
  }
1725
1735
  case "cancel":
1726
1736
  {
1727
- const a = this.options.filter(({ value: d })=>o.includes(d)).map((d)=>r(d, "cancelled")).join(styleText("dim", ", "));
1728
- if ("" === a.trim()) return `${n}${styleText("gray", dist_$)}`;
1729
- const l = dist_W(t.output, a, i ? `${styleText("gray", dist_$)} ` : "");
1730
- return `${n}${l}${i ? `
1737
+ const o = this.options.filter(({ value: d })=>a.includes(d)).map((d)=>i(d, "cancelled")).join(styleText("dim", ", "));
1738
+ if ("" === o.trim()) return `${n}${styleText("gray", dist_$)}`;
1739
+ const l = dist_W(t.output, o, r ? `${styleText("gray", dist_$)} ` : "");
1740
+ return `${n}${l}${r ? `
1731
1741
  ${styleText("gray", dist_$)}` : ""}`;
1732
1742
  }
1733
1743
  case "error":
1734
1744
  {
1735
- const a = i ? `${styleText("yellow", dist_$)} ` : "", l = this.error.split(`
1736
- `).map((p, m)=>0 === m ? `${i ? `${styleText("yellow", E)} ` : ""}${styleText("yellow", p)}` : ` ${p}`).join(`
1745
+ const o = r ? `${styleText("yellow", dist_$)} ` : "", l = this.error.split(`
1746
+ `).map((p, f)=>0 === f ? `${r ? `${styleText("yellow", dist_x)} ` : ""}${styleText("yellow", p)}` : ` ${p}`).join(`
1737
1747
  `), d = n.split(`
1738
- `).length, y = l.split(`
1748
+ `).length, g = l.split(`
1739
1749
  `).length + 1;
1740
- return `${n}${a}${dist_Y({
1750
+ return `${n}${o}${dist_F({
1741
1751
  output: t.output,
1742
1752
  options: this.options,
1743
1753
  cursor: this.cursor,
1744
1754
  maxItems: t.maxItems,
1745
- columnPadding: a.length,
1746
- rowPadding: d + y,
1755
+ columnPadding: o.length,
1756
+ rowPadding: d + g,
1747
1757
  style: c
1748
1758
  }).join(`
1749
- ${a}`)}
1759
+ ${o}`)}
1750
1760
  ${l}
1751
1761
  `;
1752
1762
  }
1753
1763
  default:
1754
1764
  {
1755
- const a = i ? `${styleText("cyan", dist_$)} ` : "", l = n.split(`
1756
- `).length, d = i ? 2 : 1;
1757
- return `${n}${a}${dist_Y({
1765
+ const o = r ? `${styleText("cyan", dist_$)} ` : "", l = n.split(`
1766
+ `).length, d = r ? 2 : 1;
1767
+ return `${n}${o}${dist_F({
1758
1768
  output: t.output,
1759
1769
  options: this.options,
1760
1770
  cursor: this.cursor,
1761
1771
  maxItems: t.maxItems,
1762
- columnPadding: a.length,
1772
+ columnPadding: o.length,
1763
1773
  rowPadding: l + d,
1764
1774
  style: c
1765
1775
  }).join(`
1766
- ${a}`)}
1767
- ${i ? styleText("cyan", E) : ""}
1776
+ ${o}`)}
1777
+ ${r ? styleText("cyan", dist_x) : ""}
1768
1778
  `;
1769
1779
  }
1770
1780
  }
1771
1781
  }
1772
1782
  }).prompt();
1773
- }, we = (t)=>styleText("dim", t), be = (t, r, s)=>{
1774
- const i = {
1783
+ }, we = (t)=>styleText("dim", t), be = (t, i, s)=>{
1784
+ const r = {
1775
1785
  hard: !0,
1776
1786
  trim: !1
1777
- }, u = wrapAnsi(t, r, i).split(`
1778
- `), n = u.reduce((a, l)=>Math.max(fast_string_width_dist(l), a), 0), o = u.map(s).reduce((a, l)=>Math.max(fast_string_width_dist(l), a), 0), c = r - (o - n);
1779
- return wrapAnsi(t, c, i);
1780
- }, Se = (t = "", r = "", s)=>{
1781
- const i = s?.output ?? node_process.stdout, u = s?.withGuide ?? dist_h.withGuide, n = s?.format ?? we, o = [
1787
+ }, u = wrapAnsi(t, i, r).split(`
1788
+ `), n = u.reduce((o, l)=>Math.max(fast_string_width_dist(l), o), 0), a = u.map(s).reduce((o, l)=>Math.max(fast_string_width_dist(l), o), 0), c = i - (a - n);
1789
+ return wrapAnsi(t, c, r);
1790
+ }, Se = (t = "", i = "", s)=>{
1791
+ const r = s?.output ?? node_process.stdout, u = s?.withGuide ?? dist_h.withGuide, n = s?.format ?? we, a = [
1782
1792
  "",
1783
- ...be(t, dist_A(i) - 6, n).split(`
1793
+ ...be(t, dist_A(r) - 6, n).split(`
1784
1794
  `).map(n),
1785
1795
  ""
1786
- ], c = fast_string_width_dist(r), a = Math.max(o.reduce((p, m)=>{
1787
- const g = fast_string_width_dist(m);
1788
- return g > p ? g : p;
1789
- }, 0), c) + 2, l = o.map((p)=>`${styleText("gray", dist_$)} ${p}${" ".repeat(a - fast_string_width_dist(p))}${styleText("gray", dist_$)}`).join(`
1796
+ ], c = fast_string_width_dist(i), o = Math.max(a.reduce((p, f)=>{
1797
+ const h = fast_string_width_dist(f);
1798
+ return h > p ? h : p;
1799
+ }, 0), c) + 2, l = a.map((p)=>`${styleText("gray", dist_$)} ${p}${" ".repeat(o - fast_string_width_dist(p))}${styleText("gray", dist_$)}`).join(`
1790
1800
  `), d = u ? `${styleText("gray", dist_$)}
1791
- ` : "", y = u ? xt : dt;
1792
- i.write(`${d}${styleText("green", dist_F)} ${styleText("reset", r)} ${styleText("gray", dist_st.repeat(Math.max(a - c - 1, 1)) + ct)}
1801
+ ` : "", g = u ? Gt : dt;
1802
+ r.write(`${d}${styleText("green", dist_H)} ${styleText("reset", i)} ${styleText("gray", dist_st.repeat(Math.max(o - c - 1, 1)) + ct)}
1793
1803
  ${l}
1794
- ${styleText("gray", y + dist_st.repeat(a + 2) + $t)}
1804
+ ${styleText("gray", g + dist_st.repeat(o + 2) + $t)}
1795
1805
  `);
1796
1806
  };
1797
1807
  dist_w("\u2500", "-"), dist_w("\u2501", "="), dist_w("\u2588", "#");
1798
- const dist_it = (t, r)=>t.includes(`
1808
+ const dist_it = (t, i)=>t.includes(`
1799
1809
  `) ? t.split(`
1800
- `).map((s)=>r(s)).join(`
1801
- `) : r(t), Ee = (t)=>{
1802
- const r = (s, i)=>{
1810
+ `).map((s)=>i(s)).join(`
1811
+ `) : i(t), xe = (t)=>{
1812
+ const i = (s, r)=>{
1803
1813
  const u = s.label ?? String(s.value);
1804
- switch(i){
1814
+ switch(r){
1805
1815
  case "disabled":
1806
- return `${styleText("gray", dist_H)} ${dist_it(u, (n)=>styleText("gray", n))}${s.hint ? ` ${styleText("dim", `(${s.hint ?? "disabled"})`)}` : ""}`;
1816
+ return `${styleText("gray", dist_U)} ${dist_it(u, (n)=>styleText("gray", n))}${s.hint ? ` ${styleText("dim", `(${s.hint ?? "disabled"})`)}` : ""}`;
1807
1817
  case "selected":
1808
1818
  return `${dist_it(u, (n)=>styleText("dim", n))}`;
1809
1819
  case "active":
@@ -1814,7 +1824,7 @@ const dist_it = (t, r)=>t.includes(`
1814
1824
  "dim"
1815
1825
  ], n))}`;
1816
1826
  default:
1817
- return `${styleText("dim", dist_H)} ${dist_it(u, (n)=>styleText("dim", n))}`;
1827
+ return `${styleText("dim", dist_U)} ${dist_it(u, (n)=>styleText("dim", n))}`;
1818
1828
  }
1819
1829
  };
1820
1830
  return new ut({
@@ -1824,163 +1834,163 @@ const dist_it = (t, r)=>t.includes(`
1824
1834
  output: t.output,
1825
1835
  initialValue: t.initialValue,
1826
1836
  render () {
1827
- const s = t.withGuide ?? dist_h.withGuide, i = `${M(this.state)} `, u = `${yt(this.state)} `, n = dist_W(t.output, t.message, u, i), o = `${s ? `${styleText("gray", dist_$)}
1837
+ const s = t.withGuide ?? dist_h.withGuide, r = `${dist_P(this.state)} `, u = `${yt(this.state)} `, n = dist_W(t.output, t.message, u, r), a = `${s ? `${styleText("gray", dist_$)}
1828
1838
  ` : ""}${n}
1829
1839
  `;
1830
1840
  switch(this.state){
1831
1841
  case "submit":
1832
1842
  {
1833
- const c = s ? `${styleText("gray", dist_$)} ` : "", a = dist_W(t.output, r(this.options[this.cursor], "selected"), c);
1834
- return `${o}${a}`;
1843
+ const c = s ? `${styleText("gray", dist_$)} ` : "", o = dist_W(t.output, i(this.options[this.cursor], "selected"), c);
1844
+ return `${a}${o}`;
1835
1845
  }
1836
1846
  case "cancel":
1837
1847
  {
1838
- const c = s ? `${styleText("gray", dist_$)} ` : "", a = dist_W(t.output, r(this.options[this.cursor], "cancelled"), c);
1839
- return `${o}${a}${s ? `
1848
+ const c = s ? `${styleText("gray", dist_$)} ` : "", o = dist_W(t.output, i(this.options[this.cursor], "cancelled"), c);
1849
+ return `${a}${o}${s ? `
1840
1850
  ${styleText("gray", dist_$)}` : ""}`;
1841
1851
  }
1842
1852
  default:
1843
1853
  {
1844
- const c = s ? `${styleText("cyan", dist_$)} ` : "", a = s ? styleText("cyan", E) : "", l = o.split(`
1854
+ const c = s ? `${styleText("cyan", dist_$)} ` : "", o = s ? styleText("cyan", dist_x) : "", l = a.split(`
1845
1855
  `).length, d = s ? 2 : 1;
1846
- return `${o}${c}${dist_Y({
1856
+ return `${a}${c}${dist_F({
1847
1857
  output: t.output,
1848
1858
  cursor: this.cursor,
1849
1859
  options: this.options,
1850
1860
  maxItems: t.maxItems,
1851
1861
  columnPadding: c.length,
1852
1862
  rowPadding: l + d,
1853
- style: (y, p)=>r(y, y.disabled ? "disabled" : p ? "active" : "inactive")
1863
+ style: (g, p)=>i(g, g.disabled ? "disabled" : p ? "active" : "inactive")
1854
1864
  }).join(`
1855
1865
  ${c}`)}
1856
- ${a}
1866
+ ${o}
1857
1867
  `;
1858
1868
  }
1859
1869
  }
1860
1870
  }
1861
1871
  }).prompt();
1862
- }, Oe = (styleText("gray", dist_$), (t)=>t.replace(/\x1b\[(?:\d+;)*\d*[ABCDEFGHfJKSTsu]|\x1b\[(s|u)/g, "")), Me = (t)=>{
1863
- const r = t.output ?? process.stdout, s = dist_A(r), i = styleText("gray", dist_$), u = t.spacing ?? 1, n = 3, o = !0 === t.retainLog, c = !dist_at() && Tt(r);
1864
- r.write(`${i}
1865
- `), r.write(`${styleText("green", dist_F)} ${t.title}
1872
+ }, Me = (styleText("gray", dist_$), (t)=>t.replace(/\x1b\[(?:\d+;)*\d*[ABCDEFGHfJKSTsu]|\x1b\[(s|u)/g, "")), Oe = (t)=>{
1873
+ const i = t.output ?? process.stdout, s = dist_A(i), r = styleText("gray", dist_$), u = t.spacing ?? 1, n = 3, a = !0 === t.retainLog, c = !dist_ot() && It(i);
1874
+ i.write(`${r}
1875
+ `), i.write(`${styleText("green", dist_H)} ${t.title}
1866
1876
  `);
1867
- for(let h = 0; h < u; h++)r.write(`${i}
1877
+ for(let m = 0; m < u; m++)i.write(`${r}
1868
1878
  `);
1869
- const a = [
1879
+ const o = [
1870
1880
  {
1871
1881
  value: "",
1872
1882
  full: ""
1873
1883
  }
1874
1884
  ];
1875
1885
  let l = !1;
1876
- const d = (h)=>{
1877
- if (0 === a.length) return;
1878
- let f = 0;
1879
- h && (f += u + 2);
1880
- for (const v of a){
1881
- const { value: T, result: C } = v;
1882
- let b = C?.message ?? T;
1886
+ const d = (m)=>{
1887
+ if (0 === o.length) return;
1888
+ let y = 0;
1889
+ m && (y += u + 2);
1890
+ for (const v of o){
1891
+ const { value: C, result: S } = v;
1892
+ let b = S?.message ?? C;
1883
1893
  if (0 === b.length) continue;
1884
- void 0 === C && void 0 !== v.header && "" !== v.header && (b += `
1894
+ void 0 === S && void 0 !== v.header && "" !== v.header && (b += `
1885
1895
  ${v.header}`);
1886
1896
  const G = b.split(`
1887
- `).reduce((x, A)=>"" === A ? x + 1 : x + Math.ceil((A.length + n) / s), 0);
1888
- f += G;
1889
- }
1890
- f > 0 && (f += 1, r.write(src.erase.lines(f)));
1891
- }, y = (h, f, v)=>{
1892
- const T = v ? `${h.full}
1893
- ${h.value}` : h.value;
1894
- void 0 !== h.header && "" !== h.header && dist_R.message(h.header.split(`
1895
- `).map((C)=>styleText("bold", C)), {
1896
- output: r,
1897
- secondarySymbol: i,
1898
- symbol: i,
1897
+ `).reduce((M, N)=>"" === N ? M + 1 : M + Math.ceil((N.length + n) / s), 0);
1898
+ y += G;
1899
+ }
1900
+ y > 0 && (y += 1, i.write(src.erase.lines(y)));
1901
+ }, g = (m, y, v)=>{
1902
+ const C = v ? `${m.full}
1903
+ ${m.value}` : m.value;
1904
+ void 0 !== m.header && "" !== m.header && dist_R.message(m.header.split(`
1905
+ `).map((S)=>styleText("bold", S)), {
1906
+ output: i,
1907
+ secondarySymbol: r,
1908
+ symbol: r,
1899
1909
  spacing: 0
1900
- }), dist_R.message(T.split(`
1901
- `).map((C)=>styleText("dim", C)), {
1902
- output: r,
1903
- secondarySymbol: i,
1904
- symbol: i,
1905
- spacing: f ?? u
1910
+ }), dist_R.message(C.split(`
1911
+ `).map((S)=>styleText("dim", S)), {
1912
+ output: i,
1913
+ secondarySymbol: r,
1914
+ symbol: r,
1915
+ spacing: y ?? u
1906
1916
  });
1907
1917
  }, p = ()=>{
1908
- for (const h of a){
1909
- const { header: f, value: v, full: T } = h;
1910
- (void 0 === f || 0 === f.length) && 0 === v.length || y(h, void 0, !0 === o && T.length > 0);
1911
- }
1912
- }, m = (h, f, v)=>{
1913
- if (d(!1), v?.raw === !0 && l || "" === h.value || (h.value += `
1914
- `), h.value += Oe(f), l = v?.raw === !0, void 0 !== t.limit) {
1915
- const T = h.value.split(`
1916
- `), C = T.length - t.limit;
1917
- if (C > 0) {
1918
- const b = T.splice(0, C);
1919
- o && (h.full += ("" === h.full ? "" : `
1918
+ for (const m of o){
1919
+ const { header: y, value: v, full: C } = m;
1920
+ (void 0 === y || 0 === y.length) && 0 === v.length || g(m, void 0, !0 === a && C.length > 0);
1921
+ }
1922
+ }, f = (m, y, v)=>{
1923
+ if (d(!1), v?.raw === !0 && l || "" === m.value || (m.value += `
1924
+ `), m.value += Me(y), l = v?.raw === !0, void 0 !== t.limit) {
1925
+ const C = m.value.split(`
1926
+ `), S = C.length - t.limit;
1927
+ if (S > 0) {
1928
+ const b = C.splice(0, S);
1929
+ a && (m.full += ("" === m.full ? "" : `
1920
1930
  `) + b.join(`
1921
1931
  `));
1922
1932
  }
1923
- h.value = T.join(`
1933
+ m.value = C.join(`
1924
1934
  `);
1925
1935
  }
1926
- c && g();
1927
- }, g = ()=>{
1928
- for (const h of a)h.result ? "error" === h.result.status ? dist_R.error(h.result.message, {
1929
- output: r,
1930
- secondarySymbol: i,
1936
+ c && h();
1937
+ }, h = ()=>{
1938
+ for (const m of o)m.result ? "error" === m.result.status ? dist_R.error(m.result.message, {
1939
+ output: i,
1940
+ secondarySymbol: r,
1931
1941
  spacing: 0
1932
- }) : dist_R.success(h.result.message, {
1933
- output: r,
1934
- secondarySymbol: i,
1942
+ }) : dist_R.success(m.result.message, {
1943
+ output: i,
1944
+ secondarySymbol: r,
1935
1945
  spacing: 0
1936
- }) : "" !== h.value && y(h, 0);
1937
- }, S = (h, f)=>{
1938
- d(!1), h.result = f, c && g();
1946
+ }) : "" !== m.value && g(m, 0);
1947
+ }, I = (m, y)=>{
1948
+ d(!1), m.result = y, c && h();
1939
1949
  };
1940
1950
  return {
1941
- message (h, f) {
1942
- m(a[0], h, f);
1951
+ message (m, y) {
1952
+ f(o[0], m, y);
1943
1953
  },
1944
- group (h) {
1945
- const f = {
1946
- header: h,
1954
+ group (m) {
1955
+ const y = {
1956
+ header: m,
1947
1957
  value: "",
1948
1958
  full: ""
1949
1959
  };
1950
- return a.push(f), {
1951
- message (v, T) {
1952
- m(f, v, T);
1960
+ return o.push(y), {
1961
+ message (v, C) {
1962
+ f(y, v, C);
1953
1963
  },
1954
1964
  error (v) {
1955
- S(f, {
1965
+ I(y, {
1956
1966
  status: "error",
1957
1967
  message: v
1958
1968
  });
1959
1969
  },
1960
1970
  success (v) {
1961
- S(f, {
1971
+ I(y, {
1962
1972
  status: "success",
1963
1973
  message: v
1964
1974
  });
1965
1975
  }
1966
1976
  };
1967
1977
  },
1968
- error (h, f) {
1969
- d(!0), dist_R.error(h, {
1970
- output: r,
1971
- secondarySymbol: i,
1978
+ error (m, y) {
1979
+ d(!0), dist_R.error(m, {
1980
+ output: i,
1981
+ secondarySymbol: r,
1972
1982
  spacing: 1
1973
- }), f?.showLog !== !1 && p(), a.splice(1, a.length - 1), a[0].value = "", a[0].full = "";
1983
+ }), y?.showLog !== !1 && p(), o.splice(1, o.length - 1), o[0].value = "", o[0].full = "";
1974
1984
  },
1975
- success (h, f) {
1976
- d(!0), dist_R.success(h, {
1977
- output: r,
1978
- secondarySymbol: i,
1985
+ success (m, y) {
1986
+ d(!0), dist_R.success(m, {
1987
+ output: i,
1988
+ secondarySymbol: r,
1979
1989
  spacing: 1
1980
- }), f?.showLog === !0 && p(), a.splice(1, a.length - 1), a[0].value = "", a[0].full = "";
1990
+ }), y?.showLog === !0 && p(), o.splice(1, o.length - 1), o[0].value = "", o[0].full = "";
1981
1991
  }
1982
1992
  };
1983
- }, Re = (t)=>new ht({
1993
+ }, Pe = (t)=>new ht({
1984
1994
  validate: t.validate,
1985
1995
  placeholder: t.placeholder,
1986
1996
  defaultValue: t.defaultValue,
@@ -1989,39 +1999,39 @@ ${h.value}` : h.value;
1989
1999
  signal: t.signal,
1990
2000
  input: t.input,
1991
2001
  render () {
1992
- const r = t?.withGuide ?? dist_h.withGuide, s = `${r ? `${styleText("gray", dist_$)}
1993
- ` : ""}${M(this.state)} ${t.message}
1994
- `, i = t.placeholder ? styleText("inverse", t.placeholder[0]) + styleText("dim", t.placeholder.slice(1)) : styleText([
2002
+ const i = t?.withGuide ?? dist_h.withGuide, s = `${i ? `${styleText("gray", dist_$)}
2003
+ ` : ""}${dist_P(this.state)} ${t.message}
2004
+ `, r = t.placeholder ? styleText("inverse", t.placeholder[0]) + styleText("dim", t.placeholder.slice(1)) : styleText([
1995
2005
  "inverse",
1996
2006
  "hidden"
1997
- ], "_"), u = this.userInput ? this.userInputWithCursor : i, n = this.value ?? "";
2007
+ ], "_"), u = this.userInput ? this.userInputWithCursor : r, n = this.value ?? "";
1998
2008
  switch(this.state){
1999
2009
  case "error":
2000
2010
  {
2001
- const o = this.error ? ` ${styleText("yellow", this.error)}` : "", c = r ? `${styleText("yellow", dist_$)} ` : "", a = r ? styleText("yellow", E) : "";
2011
+ const a = this.error ? ` ${styleText("yellow", this.error)}` : "", c = i ? `${styleText("yellow", dist_$)} ` : "", o = i ? styleText("yellow", dist_x) : "";
2002
2012
  return `${s.trim()}
2003
2013
  ${c}${u}
2004
- ${a}${o}
2014
+ ${o}${a}
2005
2015
  `;
2006
2016
  }
2007
2017
  case "submit":
2008
2018
  {
2009
- const o = n ? ` ${styleText("dim", n)}` : "", c = r ? styleText("gray", dist_$) : "";
2010
- return `${s}${c}${o}`;
2019
+ const a = n ? ` ${styleText("dim", n)}` : "", c = i ? styleText("gray", dist_$) : "";
2020
+ return `${s}${c}${a}`;
2011
2021
  }
2012
2022
  case "cancel":
2013
2023
  {
2014
- const o = n ? ` ${styleText([
2024
+ const a = n ? ` ${styleText([
2015
2025
  "strikethrough",
2016
2026
  "dim"
2017
- ], n)}` : "", c = r ? styleText("gray", dist_$) : "";
2018
- return `${s}${c}${o}${n.trim() ? `
2027
+ ], n)}` : "", c = i ? styleText("gray", dist_$) : "";
2028
+ return `${s}${c}${a}${n.trim() ? `
2019
2029
  ${c}` : ""}`;
2020
2030
  }
2021
2031
  default:
2022
2032
  {
2023
- const o = r ? `${styleText("cyan", dist_$)} ` : "", c = r ? styleText("cyan", E) : "";
2024
- return `${s}${o}${u}
2033
+ const a = i ? `${styleText("cyan", dist_$)} ` : "", c = i ? styleText("cyan", dist_x) : "";
2034
+ return `${s}${a}${u}
2025
2035
  ${c}
2026
2036
  `;
2027
2037
  }
@@ -2299,18 +2309,14 @@ let createLogger = (options = {})=>{
2299
2309
  return logger;
2300
2310
  };
2301
2311
  let src_logger = createLogger();
2302
- var main_u = (e, t)=>()=>(t || (e((t = {
2303
- exports: {}
2304
- }).exports, t), e = null), t.exports);
2305
- var main_d = /* @__PURE__ */ createRequire(import.meta.url);
2306
- const main_f = /^path$/i;
2307
- const main_p = {
2312
+ const main_h = /^path$/i;
2313
+ const main_g = {
2308
2314
  key: "PATH",
2309
2315
  value: ""
2310
2316
  };
2311
- function main_m(e) {
2317
+ function main_(e) {
2312
2318
  for(const t in e){
2313
- if (!Object.prototype.hasOwnProperty.call(e, t) || !main_f.test(t)) continue;
2319
+ if (!Object.prototype.hasOwnProperty.call(e, t) || !main_h.test(t)) continue;
2314
2320
  const n = e[t];
2315
2321
  if (!n) break;
2316
2322
  return {
@@ -2318,18 +2324,18 @@ function main_m(e) {
2318
2324
  value: n
2319
2325
  };
2320
2326
  }
2321
- return main_p;
2327
+ return main_g;
2322
2328
  }
2323
- function main_h(e, t) {
2329
+ function main_v(e, t) {
2324
2330
  const n = t.value.split(delimiter);
2325
2331
  const r = [];
2326
- let s = e;
2332
+ let o = e;
2327
2333
  let c;
2328
2334
  do {
2329
- r.push(resolve(s, "node_modules", ".bin"));
2330
- c = s;
2331
- s = dirname(s);
2332
- }while (s !== c);
2335
+ r.push(resolve(o, "node_modules", ".bin"));
2336
+ c = o;
2337
+ o = dirname(o);
2338
+ }while (o !== c);
2333
2339
  r.push(dirname(process.execPath));
2334
2340
  const l = r.concat(n).join(delimiter);
2335
2341
  return {
@@ -2337,16 +2343,17 @@ function main_h(e, t) {
2337
2343
  value: l
2338
2344
  };
2339
2345
  }
2340
- function main_g(e, t) {
2341
- const n = {
2346
+ function main_y(e, t, n = true) {
2347
+ const r = {
2342
2348
  ...process.env,
2343
2349
  ...t
2344
2350
  };
2345
- const r = main_h(e, main_m(n));
2346
- n[r.key] = r.value;
2347
- return n;
2351
+ if (!n) return r;
2352
+ const i = main_v(e, main_(r));
2353
+ r[i.key] = i.value;
2354
+ return r;
2348
2355
  }
2349
- const main_ = (e)=>{
2356
+ const main_b = (e)=>{
2350
2357
  let t = e.length;
2351
2358
  const n = new PassThrough();
2352
2359
  const r = ()=>{
@@ -2357,396 +2364,112 @@ const main_ = (e)=>{
2357
2364
  }).then(r).catch(r);
2358
2365
  return n;
2359
2366
  };
2360
- var main_v = /* @__PURE__ */ main_u((e, t)=>{
2361
- t.exports = a;
2362
- a.sync = o;
2363
- var n = main_d("fs");
2364
- function r(e, t) {
2365
- var n = void 0 !== t.pathExt ? t.pathExt : process.env.PATHEXT;
2366
- if (!n) return true;
2367
- n = n.split(";");
2368
- if (-1 !== n.indexOf("")) return true;
2369
- for(var r = 0; r < n.length; r++){
2370
- var i = n[r].toLowerCase();
2371
- if (i && e.substr(-i.length).toLowerCase() === i) return true;
2372
- }
2373
- return false;
2374
- }
2375
- function i(e, t, n) {
2376
- if (!e.isSymbolicLink() && !e.isFile()) return false;
2377
- return r(t, n);
2378
- }
2379
- function a(e, t, r) {
2380
- n.stat(e, function(n, a) {
2381
- r(n, n ? false : i(a, e, t));
2382
- });
2383
- }
2384
- function o(e, t) {
2385
- return i(n.statSync(e), e, t);
2386
- }
2387
- });
2388
- var main_y = /* @__PURE__ */ main_u((e, t)=>{
2389
- t.exports = r;
2390
- r.sync = i;
2391
- var n = main_d("fs");
2392
- function r(e, t, r) {
2393
- n.stat(e, function(e, n) {
2394
- r(e, e ? false : a(n, t));
2395
- });
2396
- }
2397
- function i(e, t) {
2398
- return a(n.statSync(e), t);
2399
- }
2400
- function a(e, t) {
2401
- return e.isFile() && o(e, t);
2402
- }
2403
- function o(e, t) {
2404
- var n = e.mode;
2405
- var r = e.uid;
2406
- var i = e.gid;
2407
- var a = void 0 !== t.uid ? t.uid : process.getuid && process.getuid();
2408
- var o = void 0 !== t.gid ? t.gid : process.getgid && process.getgid();
2409
- var s = parseInt("100", 8);
2410
- var c = parseInt("010", 8);
2411
- var l = parseInt("001", 8);
2412
- var u = s | c;
2413
- return n & l || n & c && i === o || n & s && r === a || n & u && 0 === a;
2414
- }
2415
- });
2416
- var main_b = /* @__PURE__ */ main_u((e, t)=>{
2417
- main_d("fs");
2418
- var n;
2419
- n = "win32" === process.platform || global.TESTING_WINDOWS ? main_v() : main_y();
2420
- t.exports = r;
2421
- r.sync = i;
2422
- function r(e, t, i) {
2423
- if ("function" == typeof t) {
2424
- i = t;
2425
- t = {};
2426
- }
2427
- if (!i) {
2428
- if ("function" != typeof Promise) throw new TypeError("callback not provided");
2429
- return new Promise(function(n, i) {
2430
- r(e, t || {}, function(e, t) {
2431
- if (e) i(e);
2432
- else n(t);
2433
- });
2434
- });
2435
- }
2436
- n(e, t || {}, function(e, n) {
2437
- if (e) {
2438
- if ("EACCES" === e.code || t && t.ignoreErrors) {
2439
- e = null;
2440
- n = false;
2441
- }
2442
- }
2443
- i(e, n);
2444
- });
2445
- }
2446
- function i(e, t) {
2367
+ const main_x = /([()\][%!^"`<>&|;, *?])/g;
2368
+ const main_S = /^#!\s*(.+)/;
2369
+ const main_C = /\.(?:com|exe)$/i;
2370
+ const main_w = /node_modules[\\/]\.bin[\\/][^\\/]+\.cmd$/i;
2371
+ const main_T = "win32" === process.platform;
2372
+ const main_E = [
2373
+ ".EXE",
2374
+ ".CMD",
2375
+ ".BAT",
2376
+ ".COM"
2377
+ ];
2378
+ function main_D(e, t = [], n = {}) {
2379
+ if (true === n.shell || !main_T) return {
2380
+ command: e,
2381
+ args: t,
2382
+ options: n
2383
+ };
2384
+ let i = main_O(e, n);
2385
+ let a = null;
2386
+ if (null !== i) {
2387
+ const e = 150;
2388
+ const t = Buffer.alloc(e);
2389
+ let n = null;
2447
2390
  try {
2448
- return n.sync(e, t || {});
2449
- } catch (e) {
2450
- if (t && t.ignoreErrors || "EACCES" === e.code) return false;
2451
- throw e;
2452
- }
2453
- }
2454
- });
2455
- var main_x = /* @__PURE__ */ main_u((e, t)=>{
2456
- const n = "win32" === process.platform || "cygwin" === process.env.OSTYPE || "msys" === process.env.OSTYPE;
2457
- const r = main_d("path");
2458
- const i = n ? ";" : ":";
2459
- const a = main_b();
2460
- const o = (e)=>Object.assign(/* @__PURE__ */ new Error(`not found: ${e}`), {
2461
- code: "ENOENT"
2462
- });
2463
- const s = (e, t)=>{
2464
- const r = t.colon || i;
2465
- const a = e.match(/\//) || n && e.match(/\\/) ? [
2466
- ""
2467
- ] : [
2468
- ...n ? [
2469
- process.cwd()
2470
- ] : [],
2471
- ...(t.path || process.env.PATH || "").split(r)
2391
+ n = openSync(i, "r");
2392
+ readSync(n, t, 0, e, 0);
2393
+ } catch {} finally{
2394
+ if (null !== n) closeSync(n);
2395
+ }
2396
+ const o = t.toString().match(main_S);
2397
+ if (null !== o) {
2398
+ const e = o[1].trim();
2399
+ const t = e.indexOf(" ");
2400
+ const n = -1 !== t ? e.slice(0, t) : e;
2401
+ const i = -1 !== t ? e.slice(t + 1) : "";
2402
+ const s = basename(n);
2403
+ a = "env" === s ? i || null : s;
2404
+ }
2405
+ }
2406
+ if (null !== a && null !== i) {
2407
+ t = [
2408
+ i,
2409
+ ...t
2472
2410
  ];
2473
- const o = n ? t.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
2474
- const s = n ? o.split(r) : [
2475
- ""
2411
+ e = a;
2412
+ i = main_O(e, n);
2413
+ }
2414
+ if (null === i || !main_C.test(i)) {
2415
+ const r = null !== i && main_w.test(i);
2416
+ e = external_node_path_normalize(e);
2417
+ e = e.replace(main_x, "^$1");
2418
+ t = t.map((e)=>{
2419
+ e = e.replace(/(?=(\\+?)?)\1"/g, "$1$1\\\"");
2420
+ e = e.replace(/(?=(\\+?)?)\1$/, "$1$1");
2421
+ e = `"${e}"`;
2422
+ e = e.replace(main_x, "^$1");
2423
+ if (r) e = e.replace(main_x, "^$1");
2424
+ return e;
2425
+ });
2426
+ t = [
2427
+ "/d",
2428
+ "/s",
2429
+ "/c",
2430
+ `"${[
2431
+ e,
2432
+ ...t
2433
+ ].join(" ")}"`
2476
2434
  ];
2477
- if (n) {
2478
- if (-1 !== e.indexOf(".") && "" !== s[0]) s.unshift("");
2479
- }
2480
- return {
2481
- pathEnv: a,
2482
- pathExt: s,
2483
- pathExtExe: o
2435
+ e = n.env?.comspec ?? "cmd.exe";
2436
+ n = {
2437
+ ...n,
2438
+ windowsVerbatimArguments: true
2484
2439
  };
2485
- };
2486
- const c = (e, t, n)=>{
2487
- if ("function" == typeof t) {
2488
- n = t;
2489
- t = {};
2490
- }
2491
- if (!t) t = {};
2492
- const { pathEnv: i, pathExt: c, pathExtExe: l } = s(e, t);
2493
- const u = [];
2494
- const d = (n)=>new Promise((a, s)=>{
2495
- if (n === i.length) return t.all && u.length ? a(u) : s(o(e));
2496
- const c = i[n];
2497
- const l = /^".*"$/.test(c) ? c.slice(1, -1) : c;
2498
- const d = r.join(l, e);
2499
- a(f(!l && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + d : d, n, 0));
2500
- });
2501
- const f = (e, n, r)=>new Promise((i, o)=>{
2502
- if (r === c.length) return i(d(n + 1));
2503
- const s = c[r];
2504
- a(e + s, {
2505
- pathExt: l
2506
- }, (a, o)=>{
2507
- if (!a && o) if (!t.all) return i(e + s);
2508
- else u.push(e + s);
2509
- return i(f(e, n, r + 1));
2510
- });
2511
- });
2512
- return n ? d(0).then((e)=>n(null, e), n) : d(0);
2513
- };
2514
- const l = (e, t)=>{
2515
- t = t || {};
2516
- const { pathEnv: n, pathExt: i, pathExtExe: c } = s(e, t);
2517
- const l = [];
2518
- for(let o = 0; o < n.length; o++){
2519
- const s = n[o];
2520
- const u = /^".*"$/.test(s) ? s.slice(1, -1) : s;
2521
- const d = r.join(u, e);
2522
- const f = !u && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + d : d;
2523
- for(let e = 0; e < i.length; e++){
2524
- const n = f + i[e];
2525
- try {
2526
- if (a.sync(n, {
2527
- pathExt: c
2528
- })) if (!t.all) return n;
2529
- else l.push(n);
2530
- } catch (e) {}
2531
- }
2532
- }
2533
- if (t.all && l.length) return l;
2534
- if (t.nothrow) return null;
2535
- throw o(e);
2536
- };
2537
- t.exports = c;
2538
- c.sync = l;
2539
- });
2540
- var main_S = /* @__PURE__ */ main_u((e, t)=>{
2541
- const n = (e = {})=>{
2542
- const t = e.env || process.env;
2543
- if ("win32" !== (e.platform || process.platform)) return "PATH";
2544
- return Object.keys(t).reverse().find((e)=>"PATH" === e.toUpperCase()) || "Path";
2545
- };
2546
- t.exports = n;
2547
- t.exports.default = n;
2548
- });
2549
- var main_C = /* @__PURE__ */ main_u((e, t)=>{
2550
- const n = main_d("path");
2551
- const r = main_x();
2552
- const i = main_S();
2553
- function a(e, t) {
2554
- const a = e.options.env || process.env;
2555
- const o = process.cwd();
2556
- const s = null != e.options.cwd;
2557
- const c = s && void 0 !== process.chdir && !process.chdir.disabled;
2558
- if (c) try {
2559
- process.chdir(e.options.cwd);
2560
- } catch (e) {}
2561
- let l;
2562
- try {
2563
- l = r.sync(e.command, {
2564
- path: a[i({
2565
- env: a
2566
- })],
2567
- pathExt: t ? n.delimiter : void 0
2568
- });
2569
- } catch (e) {} finally{
2570
- if (c) process.chdir(o);
2571
- }
2572
- if (l) l = n.resolve(s ? e.options.cwd : "", l);
2573
- return l;
2574
- }
2575
- function o(e) {
2576
- return a(e) || a(e, true);
2577
2440
  }
2578
- t.exports = o;
2579
- });
2580
- var main_w = /* @__PURE__ */ main_u((e, t)=>{
2581
- const n = /([()\][%!^"`<>&|;, *?])/g;
2582
- function r(e) {
2583
- e = e.replace(n, "^$1");
2584
- return e;
2585
- }
2586
- function i(e, t) {
2587
- e = `${e}`;
2588
- e = e.replace(/(?=(\\+?)?)\1"/g, "$1$1\\\"");
2589
- e = e.replace(/(?=(\\+?)?)\1$/, "$1$1");
2590
- e = `"${e}"`;
2591
- e = e.replace(n, "^$1");
2592
- if (t) e = e.replace(n, "^$1");
2593
- return e;
2594
- }
2595
- t.exports.command = r;
2596
- t.exports.argument = i;
2597
- });
2598
- var main_T = /* @__PURE__ */ main_u((e, t)=>{
2599
- t.exports = /^#!(.*)/;
2600
- });
2601
- var main_E = /* @__PURE__ */ main_u((e, t)=>{
2602
- const n = main_T();
2603
- t.exports = (e = "")=>{
2604
- const t = e.match(n);
2605
- if (!t) return null;
2606
- const [r, i] = t[0].replace(/#! ?/, "").split(" ");
2607
- const a = r.split("/").pop();
2608
- if ("env" === a) return i;
2609
- return i ? `${a} ${i}` : a;
2441
+ return {
2442
+ command: e,
2443
+ args: t,
2444
+ options: n
2610
2445
  };
2611
- });
2612
- var main_D = /* @__PURE__ */ main_u((e, t)=>{
2613
- const n = main_d("fs");
2614
- const r = main_E();
2615
- function i(e) {
2616
- const t = 150;
2617
- const i = Buffer.alloc(t);
2618
- let a;
2619
- try {
2620
- a = n.openSync(e, "r");
2621
- n.readSync(a, i, 0, t, 0);
2622
- n.closeSync(a);
2623
- } catch (e) {}
2624
- return r(i.toString());
2625
- }
2626
- t.exports = i;
2627
- });
2628
- var main_O = /* @__PURE__ */ main_u((e, t)=>{
2629
- const n = main_d("path");
2630
- const r = main_C();
2631
- const i = main_w();
2632
- const a = main_D();
2633
- const o = "win32" === process.platform;
2634
- const s = /\.(?:com|exe)$/i;
2635
- const c = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
2636
- function l(e) {
2637
- e.file = r(e);
2638
- const t = e.file && a(e.file);
2639
- if (t) {
2640
- e.args.unshift(e.file);
2641
- e.command = t;
2642
- return r(e);
2643
- }
2644
- return e.file;
2645
- }
2646
- function u(e) {
2647
- if (!o) return e;
2648
- const t = l(e);
2649
- const r = !s.test(t);
2650
- if (e.options.forceShell || r) {
2651
- const r = c.test(t);
2652
- e.command = n.normalize(e.command);
2653
- e.command = i.command(e.command);
2654
- e.args = e.args.map((e)=>i.argument(e, r));
2655
- e.args = [
2656
- "/d",
2657
- "/s",
2658
- "/c",
2659
- `"${[
2660
- e.command
2661
- ].concat(e.args).join(" ")}"`
2662
- ];
2663
- e.command = process.env.comspec || "cmd.exe";
2664
- e.options.windowsVerbatimArguments = true;
2665
- }
2666
- return e;
2667
- }
2668
- function f(e, t, n) {
2669
- if (t && !Array.isArray(t)) {
2670
- n = t;
2671
- t = null;
2672
- }
2673
- t = t ? t.slice(0) : [];
2674
- n = Object.assign({}, n);
2675
- const r = {
2676
- command: e,
2677
- args: t,
2678
- options: n,
2679
- file: void 0,
2680
- original: {
2681
- command: e,
2682
- args: t
2683
- }
2684
- };
2685
- return n.shell ? r : u(r);
2686
- }
2687
- t.exports = f;
2688
- });
2689
- var main_k = /* @__PURE__ */ main_u((e, t)=>{
2690
- const n = "win32" === process.platform;
2691
- function r(e, t) {
2692
- return Object.assign(/* @__PURE__ */ new Error(`${t} ${e.command} ENOENT`), {
2693
- code: "ENOENT",
2694
- errno: "ENOENT",
2695
- syscall: `${t} ${e.command}`,
2696
- path: e.command,
2697
- spawnargs: e.args
2698
- });
2699
- }
2700
- function i(e, t) {
2701
- if (!n) return;
2702
- const r = e.emit;
2703
- e.emit = function(n, i) {
2704
- if ("exit" === n) {
2705
- const n = a(i, t);
2706
- if (n) return r.call(e, "error", n);
2707
- }
2708
- return r.apply(e, arguments);
2709
- };
2710
- }
2711
- function a(e, t) {
2712
- if (n && 1 === e && !t.file) return r(t.original, "spawn");
2713
- return null;
2714
- }
2715
- function o(e, t) {
2716
- if (n && 1 === e && !t.file) return r(t.original, "spawnSync");
2717
- return null;
2446
+ }
2447
+ function main_O(e, t) {
2448
+ const r = (t.cwd ?? external_node_process_cwd()).toString();
2449
+ const a = t.env ?? process.env;
2450
+ const o = main_(a).value;
2451
+ const c = e.includes("/") || e.includes("\\") ? [
2452
+ ""
2453
+ ] : [
2454
+ r,
2455
+ ...o.split(delimiter)
2456
+ ];
2457
+ const l = a.PATHEXT ? a.PATHEXT.split(delimiter) : main_E;
2458
+ if (e.includes(".") && "" !== l[0]) l.unshift("");
2459
+ for (const t of c){
2460
+ const n = resolve(r, t.startsWith("\"") && t.endsWith("\"") && t.length > 1 ? t.slice(1, -1) : t, e);
2461
+ for (const e of l){
2462
+ const t = n + e;
2463
+ try {
2464
+ if (statSync(t).isFile()) return t;
2465
+ } catch {}
2466
+ }
2718
2467
  }
2719
- t.exports = {
2720
- hookChildProcess: i,
2721
- verifyENOENT: a,
2722
- verifyENOENTSync: o,
2723
- notFoundError: r
2724
- };
2725
- });
2726
- var main_A = /* @__PURE__ */ main_u((e, t)=>{
2727
- const n = main_d("child_process");
2728
- const r = main_O();
2729
- const i = main_k();
2730
- function a(e, t, a) {
2731
- const o = r(e, t, a);
2732
- const s = n.spawn(o.command, o.args, o.options);
2733
- i.hookChildProcess(s, o);
2734
- return s;
2735
- }
2736
- function o(e, t, a) {
2737
- const o = r(e, t, a);
2738
- const s = n.spawnSync(o.command, o.args, o.options);
2739
- s.error = s.error || i.verifyENOENTSync(s.status, o);
2740
- return s;
2741
- }
2742
- t.exports = a;
2743
- t.exports.spawn = a;
2744
- t.exports.sync = o;
2745
- t.exports._parse = r;
2746
- t.exports._enoent = i;
2747
- });
2748
- var main_j = main_A();
2749
- var main_M = class extends Error {
2468
+ return null;
2469
+ }
2470
+ var main_k = class extends Error {
2471
+ result;
2472
+ output;
2750
2473
  get exitCode() {
2751
2474
  if (null !== this.result.exitCode) return this.result.exitCode;
2752
2475
  }
@@ -2756,14 +2479,14 @@ var main_M = class extends Error {
2756
2479
  this.output = t;
2757
2480
  }
2758
2481
  };
2759
- const main_P = {
2482
+ const main_j = {
2760
2483
  timeout: void 0,
2761
2484
  persist: false
2762
2485
  };
2763
- const main_I = {
2486
+ const main_N = {
2764
2487
  windowsHide: true
2765
2488
  };
2766
- function main_L(e) {
2489
+ function main_P(e) {
2767
2490
  const t = new AbortController();
2768
2491
  for (const n of e){
2769
2492
  if (n.aborted) {
@@ -2779,14 +2502,14 @@ function main_L(e) {
2779
2502
  }
2780
2503
  return t.signal;
2781
2504
  }
2782
- async function main_R(e) {
2505
+ async function main_F(e) {
2783
2506
  let t = "";
2784
2507
  try {
2785
2508
  for await (const n of e)t += n.toString();
2786
2509
  } catch {}
2787
2510
  return t;
2788
2511
  }
2789
- var main_z = class {
2512
+ var main_I = class {
2790
2513
  _process;
2791
2514
  _aborted = false;
2792
2515
  _options;
@@ -2806,7 +2529,7 @@ var main_z = class {
2806
2529
  }
2807
2530
  constructor(e, t, n){
2808
2531
  this._options = {
2809
- ...main_P,
2532
+ ...main_j,
2810
2533
  ...n
2811
2534
  };
2812
2535
  this._command = e;
@@ -2825,7 +2548,7 @@ var main_z = class {
2825
2548
  return this._process?.killed === true;
2826
2549
  }
2827
2550
  pipe(e, t, n) {
2828
- return main_H(e, t, {
2551
+ return main_z(e, t, {
2829
2552
  ...n,
2830
2553
  stdin: this
2831
2554
  });
@@ -2836,7 +2559,7 @@ var main_z = class {
2836
2559
  const t = [];
2837
2560
  if (this._streamErr) t.push(this._streamErr);
2838
2561
  if (this._streamOut) t.push(this._streamOut);
2839
- const n = main_(t);
2562
+ const n = main_b(t);
2840
2563
  const r = node_readline.createInterface({
2841
2564
  input: n
2842
2565
  });
@@ -2844,14 +2567,14 @@ var main_z = class {
2844
2567
  await this._processClosed;
2845
2568
  e.removeAllListeners();
2846
2569
  if (this._thrownError) throw this._thrownError;
2847
- if (this._options?.throwOnError && 0 !== this.exitCode && void 0 !== this.exitCode) throw new main_M(this);
2570
+ if (this._options?.throwOnError && 0 !== this.exitCode && void 0 !== this.exitCode) throw new main_k(this);
2848
2571
  }
2849
2572
  async _waitForOutput() {
2850
2573
  const e = this._process;
2851
2574
  if (!e) throw new Error("No process was started");
2852
2575
  const [t, n] = await Promise.all([
2853
- this._streamOut ? main_R(this._streamOut) : "",
2854
- this._streamErr ? main_R(this._streamErr) : ""
2576
+ this._streamOut ? main_F(this._streamOut) : "",
2577
+ this._streamErr ? main_F(this._streamErr) : ""
2855
2578
  ]);
2856
2579
  await this._processClosed;
2857
2580
  const { stdin: r } = this._options;
@@ -2863,7 +2586,7 @@ var main_z = class {
2863
2586
  stdout: t,
2864
2587
  exitCode: this.exitCode
2865
2588
  };
2866
- if (this._options.throwOnError && 0 !== this.exitCode && void 0 !== this.exitCode) throw new main_M(this, i);
2589
+ if (this._options.throwOnError && 0 !== this.exitCode && void 0 !== this.exitCode) throw new main_k(this, i);
2867
2590
  return i;
2868
2591
  }
2869
2592
  then(e, t) {
@@ -2872,20 +2595,20 @@ var main_z = class {
2872
2595
  _streamOut;
2873
2596
  _streamErr;
2874
2597
  spawn() {
2875
- const e = external_node_process_cwd();
2876
- const n = this._options;
2598
+ const t = external_node_process_cwd();
2599
+ const r = this._options;
2877
2600
  const i = {
2878
- ...main_I,
2879
- ...n.nodeOptions
2601
+ ...main_N,
2602
+ ...r.nodeOptions
2880
2603
  };
2881
2604
  const a = [];
2882
2605
  this._resetState();
2883
- if (void 0 !== n.timeout) a.push(AbortSignal.timeout(n.timeout));
2884
- if (void 0 !== n.signal) a.push(n.signal);
2885
- if (true === n.persist) i.detached = true;
2886
- if (a.length > 0) i.signal = main_L(a);
2887
- i.env = main_g(e, i.env);
2888
- const o = (0, main_j._parse)(this._command, this._args, i);
2606
+ if (void 0 !== r.timeout) a.push(AbortSignal.timeout(r.timeout));
2607
+ if (void 0 !== r.signal) a.push(r.signal);
2608
+ if (true === r.persist) i.detached = true;
2609
+ if (a.length > 0) i.signal = main_P(a);
2610
+ i.env = main_y(t, i.env, r.nodePath);
2611
+ const o = main_D(this._command, this._args, i);
2889
2612
  const s = spawn(o.command, o.args, o.options);
2890
2613
  if (s.stderr) this._streamErr = s.stderr;
2891
2614
  if (s.stdout) this._streamOut = s.stdout;
@@ -2893,7 +2616,7 @@ var main_z = class {
2893
2616
  s.once("error", this._onError);
2894
2617
  s.once("close", this._onClose);
2895
2618
  if (s.stdin) {
2896
- const { stdin: e } = n;
2619
+ const { stdin: e } = r;
2897
2620
  if ("string" == typeof e) s.stdin.end(e);
2898
2621
  else e?.process?.stdout?.pipe(s.stdin);
2899
2622
  }
@@ -2916,12 +2639,12 @@ var main_z = class {
2916
2639
  if (this._resolveClose) this._resolveClose();
2917
2640
  };
2918
2641
  };
2919
- const main_V = (e, t, n)=>{
2920
- const r = new main_z(e, t, n);
2642
+ const main_R = (e, t, n)=>{
2643
+ const r = new main_I(e, t, n);
2921
2644
  r.spawn();
2922
2645
  return r;
2923
2646
  };
2924
- const main_H = main_V;
2647
+ const main_z = main_R;
2925
2648
  const NPM_TEMPLATE_PREFIX = 'npm:';
2926
2649
  const VALID_NPM_NAME = /^(@[\w.-]+\/)?[\w.-]+$/;
2927
2650
  const VALID_NPM_VERSION = /^[\w.\-+^~>=<* ]+$/;
@@ -3019,7 +2742,7 @@ function cancelAndExit() {
3019
2742
  process.exit(0);
3020
2743
  }
3021
2744
  function checkCancel(value) {
3022
- if (dist_q(value)) cancelAndExit();
2745
+ if (q(value)) cancelAndExit();
3023
2746
  return value;
3024
2747
  }
3025
2748
  function formatProjectName(input) {
@@ -3206,7 +2929,7 @@ async function runCommand(command, cwd, packageManager) {
3206
2929
  if (replacement) command = command.replace('npm create ', replacement).replace(' -- --', ' --');
3207
2930
  if ('yarn' === packageManager) command = command.replace('@latest', '');
3208
2931
  }
3209
- const result = await main_V(command, [], {
2932
+ const result = await main_R(command, [], {
3210
2933
  nodeOptions: {
3211
2934
  shell: true,
3212
2935
  stdio: 'inherit',
@@ -3242,10 +2965,10 @@ async function runSkillCommand(skills, cwd) {
3242
2965
  dist_R.info(`Running skill install command: ${color.dim(command)}`);
3243
2966
  const skillLabel = skills.map((skill)=>skill.value).join(', ');
3244
2967
  const skillNoun = 1 === skills.length ? 'skill' : 'skills';
3245
- const installationTaskLog = Me({
2968
+ const installationTaskLog = Oe({
3246
2969
  title: `Installing ${skillNoun} ${skillLabel}`
3247
2970
  });
3248
- const proc = main_V('npx', args, {
2971
+ const proc = main_R('npx', args, {
3249
2972
  nodeOptions: {
3250
2973
  cwd,
3251
2974
  stdio: 'pipe'
@@ -3287,7 +3010,7 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
3287
3010
  packageManager
3288
3011
  };
3289
3012
  if (!version) version = (await readPackageJson(root)).version;
3290
- const projectName = argv.dir ?? checkCancel(await Re({
3013
+ const projectName = argv.dir ?? checkCancel(await Pe({
3291
3014
  message: 'Project name or path',
3292
3015
  placeholder: `${name.toLowerCase()}-project`,
3293
3016
  defaultValue: `${name.toLowerCase()}-project`,
@@ -3300,7 +3023,7 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
3300
3023
  const packageName = argv.packageName || formatted.packageName;
3301
3024
  const distFolder = node_path.isAbsolute(targetDir) ? targetDir : node_path.join(cwd, targetDir);
3302
3025
  if (!argv.override && node_fs.existsSync(distFolder) && !isEmptyDir(distFolder)) {
3303
- const option = checkCancel(await Ee({
3026
+ const option = checkCancel(await xe({
3304
3027
  message: `"${targetDir}" is not empty, please choose:`,
3305
3028
  options: [
3306
3029
  {
@@ -3603,4 +3326,4 @@ function collectAgentsFiles(agentsMdSearchDirs) {
3603
3326
  }
3604
3327
  return agentsFiles;
3605
3328
  }
3606
- export { At as autocomplete, BUILTIN_TOOLS, Ee as select, Re as text, checkCancel, collectAgentsFiles, copyFolder, create, isNpmTemplate, mergeAgentsFiles, mergePackageJson, pe as groupMultiselect, resolveCustomTemplate, resolveNpmTemplate, sanitizeCacheKey, ve as multiselect };
3329
+ export { At as autocomplete, BUILTIN_TOOLS, Pe as text, checkCancel, collectAgentsFiles, copyFolder, create, isNpmTemplate, mergeAgentsFiles, mergePackageJson, pe as groupMultiselect, resolveCustomTemplate, resolveNpmTemplate, sanitizeCacheKey, ve as multiselect, xe as select };