use-agentz 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -5,25 +5,43 @@ var __getProtoOf = Object.getPrototypeOf;
5
5
  var __defProp = Object.defineProperty;
6
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ function __accessProp(key) {
9
+ return this[key];
10
+ }
11
+ var __toESMCache_node;
12
+ var __toESMCache_esm;
8
13
  var __toESM = (mod, isNodeMode, target) => {
14
+ var canCache = mod != null && typeof mod === "object";
15
+ if (canCache) {
16
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
17
+ var cached = cache.get(mod);
18
+ if (cached)
19
+ return cached;
20
+ }
9
21
  target = mod != null ? __create(__getProtoOf(mod)) : {};
10
22
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
11
23
  for (let key of __getOwnPropNames(mod))
12
24
  if (!__hasOwnProp.call(to, key))
13
25
  __defProp(to, key, {
14
- get: () => mod[key],
26
+ get: __accessProp.bind(mod, key),
15
27
  enumerable: true
16
28
  });
29
+ if (canCache)
30
+ cache.set(mod, to);
17
31
  return to;
18
32
  };
19
33
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
34
+ var __returnValue = (v) => v;
35
+ function __exportSetter(name, newValue) {
36
+ this[name] = __returnValue.bind(null, newValue);
37
+ }
20
38
  var __export = (target, all) => {
21
39
  for (var name in all)
22
40
  __defProp(target, name, {
23
41
  get: all[name],
24
42
  enumerable: true,
25
43
  configurable: true,
26
- set: (newValue) => all[name] = () => newValue
44
+ set: __exportSetter.bind(all, name)
27
45
  });
28
46
  };
29
47
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
@@ -11261,7 +11279,7 @@ function finalize(ctx, schema) {
11261
11279
  result.$schema = "http://json-schema.org/draft-07/schema#";
11262
11280
  } else if (ctx.target === "draft-04") {
11263
11281
  result.$schema = "http://json-schema.org/draft-04/schema#";
11264
- } else if (ctx.target === "openapi-3.0") {} else {}
11282
+ } else if (ctx.target === "openapi-3.0") {}
11265
11283
  if (ctx.external?.uri) {
11266
11284
  const id = ctx.external.registry.get(schema)?.id;
11267
11285
  if (!id)
@@ -11522,7 +11540,7 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
11522
11540
  if (val === undefined) {
11523
11541
  if (ctx.unrepresentable === "throw") {
11524
11542
  throw new Error("Literal `undefined` cannot be represented in JSON Schema");
11525
- } else {}
11543
+ }
11526
11544
  } else if (typeof val === "bigint") {
11527
11545
  if (ctx.unrepresentable === "throw") {
11528
11546
  throw new Error("BigInt literals cannot be represented in JSON Schema");
@@ -15926,131 +15944,131 @@ import * as l3 from "readline";
15926
15944
  import l__default from "readline";
15927
15945
  import { ReadStream } from "tty";
15928
15946
  function findCursor(s3, o5, l4) {
15929
- if (!l4.some((r6) => !r6.disabled))
15947
+ if (!l4.some((r7) => !r7.disabled))
15930
15948
  return s3;
15931
- const t5 = s3 + o5, n5 = Math.max(l4.length - 1, 0), e5 = t5 < 0 ? n5 : t5 > n5 ? 0 : t5;
15932
- return l4[e5].disabled ? findCursor(e5, o5 < 0 ? -1 : 1, l4) : e5;
15949
+ const t6 = s3 + o5, n6 = Math.max(l4.length - 1, 0), e6 = t6 < 0 ? n6 : t6 > n6 ? 0 : t6;
15950
+ return l4[e6]?.disabled ? findCursor(e6, o5 < 0 ? -1 : 1, l4) : e6;
15933
15951
  }
15934
15952
  function findTextCursor(s3, o5, l4, i8) {
15935
- const t5 = i8.split(`
15953
+ const t6 = i8.split(`
15936
15954
  `);
15937
- let n5 = 0, e5 = s3;
15938
- for (const r6 of t5) {
15939
- if (e5 <= r6.length)
15955
+ let n6 = 0, e6 = s3;
15956
+ for (const r7 of t6) {
15957
+ if (e6 <= r7.length)
15940
15958
  break;
15941
- e5 -= r6.length + 1, n5++;
15959
+ e6 -= r7.length + 1, n6++;
15942
15960
  }
15943
- for (n5 = Math.max(0, Math.min(t5.length - 1, n5 + l4)), e5 = Math.min(e5, t5[n5].length) + o5;e5 < 0 && n5 > 0; )
15944
- n5--, e5 += t5[n5].length + 1;
15945
- for (;e5 > t5[n5].length && n5 < t5.length - 1; )
15946
- e5 -= t5[n5].length + 1, n5++;
15947
- e5 = Math.max(0, Math.min(t5[n5].length, e5));
15961
+ for (n6 = Math.max(0, Math.min(t6.length - 1, n6 + l4)), e6 = Math.min(e6, t6[n6].length) + o5;e6 < 0 && n6 > 0; )
15962
+ n6--, e6 += t6[n6].length + 1;
15963
+ for (;e6 > t6[n6].length && n6 < t6.length - 1; )
15964
+ e6 -= t6[n6].length + 1, n6++;
15965
+ e6 = Math.max(0, Math.min(t6[n6].length, e6));
15948
15966
  let h4 = 0;
15949
- for (let r6 = 0;r6 < n5; r6++)
15950
- h4 += t5[r6].length + 1;
15951
- return h4 + e5;
15952
- }
15953
- function updateSettings(n5) {
15954
- if (n5.aliases !== undefined) {
15955
- const e5 = n5.aliases;
15956
- for (const s3 in e5) {
15957
- if (!Object.hasOwn(e5, s3))
15967
+ for (let r7 = 0;r7 < n6; r7++)
15968
+ h4 += t6[r7].length + 1;
15969
+ return h4 + e6;
15970
+ }
15971
+ function updateSettings(n6) {
15972
+ if (n6.aliases !== undefined) {
15973
+ const e6 = n6.aliases;
15974
+ for (const s3 in e6) {
15975
+ if (!Object.hasOwn(e6, s3))
15958
15976
  continue;
15959
- const i8 = e5[s3];
15960
- settings.actions.has(i8) && (settings.aliases.has(s3) || settings.aliases.set(s3, i8));
15977
+ const i8 = e6[s3];
15978
+ i8 === undefined || !settings.actions.has(i8) || settings.aliases.has(s3) || settings.aliases.set(s3, i8);
15961
15979
  }
15962
15980
  }
15963
- if (n5.messages !== undefined) {
15964
- const e5 = n5.messages;
15965
- e5.cancel !== undefined && (settings.messages.cancel = e5.cancel), e5.error !== undefined && (settings.messages.error = e5.error);
15981
+ if (n6.messages !== undefined) {
15982
+ const e6 = n6.messages;
15983
+ e6.cancel !== undefined && (settings.messages.cancel = e6.cancel), e6.error !== undefined && (settings.messages.error = e6.error);
15966
15984
  }
15967
- if (n5.withGuide !== undefined && (settings.withGuide = n5.withGuide !== false), n5.date !== undefined) {
15968
- const e5 = n5.date;
15969
- e5.monthNames !== undefined && (settings.date.monthNames = [...e5.monthNames]), e5.messages !== undefined && (e5.messages.required !== undefined && (settings.date.messages.required = e5.messages.required), e5.messages.invalidMonth !== undefined && (settings.date.messages.invalidMonth = e5.messages.invalidMonth), e5.messages.invalidDay !== undefined && (settings.date.messages.invalidDay = e5.messages.invalidDay), e5.messages.afterMin !== undefined && (settings.date.messages.afterMin = e5.messages.afterMin), e5.messages.beforeMax !== undefined && (settings.date.messages.beforeMax = e5.messages.beforeMax));
15985
+ if (n6.withGuide !== undefined && (settings.withGuide = n6.withGuide !== false), n6.date !== undefined) {
15986
+ const e6 = n6.date;
15987
+ e6.monthNames !== undefined && (settings.date.monthNames = [...e6.monthNames]), e6.messages !== undefined && (e6.messages.required !== undefined && (settings.date.messages.required = e6.messages.required), e6.messages.invalidMonth !== undefined && (settings.date.messages.invalidMonth = e6.messages.invalidMonth), e6.messages.invalidDay !== undefined && (settings.date.messages.invalidDay = e6.messages.invalidDay), e6.messages.afterMin !== undefined && (settings.date.messages.afterMin = e6.messages.afterMin), e6.messages.beforeMax !== undefined && (settings.date.messages.beforeMax = e6.messages.beforeMax));
15970
15988
  }
15971
15989
  }
15972
- function isActionKey(n5, e5) {
15973
- if (typeof n5 == "string")
15974
- return settings.aliases.get(n5) === e5;
15975
- for (const s3 of n5)
15976
- if (s3 !== undefined && isActionKey(s3, e5))
15990
+ function isActionKey(n6, e6) {
15991
+ if (typeof n6 == "string")
15992
+ return settings.aliases.get(n6) === e6;
15993
+ for (const s3 of n6)
15994
+ if (s3 !== undefined && isActionKey(s3, e6))
15977
15995
  return true;
15978
15996
  return false;
15979
15997
  }
15980
15998
  function diffLines(i8, s3) {
15981
15999
  if (i8 === s3)
15982
16000
  return;
15983
- const e5 = i8.split(`
15984
- `), t6 = s3.split(`
15985
- `), r6 = Math.max(e5.length, t6.length), f4 = [];
15986
- for (let n5 = 0;n5 < r6; n5++)
15987
- e5[n5] !== t6[n5] && f4.push(n5);
16001
+ const e6 = i8.split(`
16002
+ `), t7 = s3.split(`
16003
+ `), r7 = Math.max(e6.length, t7.length), f4 = [];
16004
+ for (let n6 = 0;n6 < r7; n6++)
16005
+ e6[n6] !== t7[n6] && f4.push(n6);
15988
16006
  return {
15989
16007
  lines: f4,
15990
- numLinesBefore: e5.length,
15991
- numLinesAfter: t6.length,
15992
- numLines: r6
16008
+ numLinesBefore: e6.length,
16009
+ numLinesAfter: t7.length,
16010
+ numLines: r7
15993
16011
  };
15994
16012
  }
15995
- function isCancel(e5) {
15996
- return e5 === CANCEL_SYMBOL;
16013
+ function isCancel(e6) {
16014
+ return e6 === CANCEL_SYMBOL;
15997
16015
  }
15998
- function setRawMode(e5, r6) {
15999
- const o5 = e5;
16000
- o5.isTTY && o5.setRawMode(r6);
16016
+ function setRawMode(e6, r7) {
16017
+ const o5 = e6;
16018
+ o5.isTTY && o5.setRawMode(r7);
16001
16019
  }
16002
16020
  function block({
16003
- input: e5 = stdin,
16004
- output: r6 = stdout,
16021
+ input: e6 = stdin,
16022
+ output: r7 = stdout,
16005
16023
  overwrite: o5 = true,
16006
- hideCursor: t6 = true
16024
+ hideCursor: t7 = true
16007
16025
  } = {}) {
16008
16026
  const s3 = l3.createInterface({
16009
- input: e5,
16010
- output: r6,
16027
+ input: e6,
16028
+ output: r7,
16011
16029
  prompt: "",
16012
16030
  tabSize: 1
16013
16031
  });
16014
- l3.emitKeypressEvents(e5, s3), e5 instanceof ReadStream && e5.isTTY && e5.setRawMode(true);
16015
- const n5 = (f4, { name: a7, sequence: p4 }) => {
16032
+ l3.emitKeypressEvents(e6, s3), e6 instanceof ReadStream && e6.isTTY && e6.setRawMode(true);
16033
+ const n6 = (f4, { name: a7, sequence: p4 }) => {
16016
16034
  const c3 = String(f4);
16017
16035
  if (isActionKey([c3, a7, p4], "cancel")) {
16018
- t6 && r6.write(import_sisteransi.cursor.show), process.exit(0);
16036
+ t7 && r7.write(import_sisteransi.cursor.show), process.exit(0);
16019
16037
  return;
16020
16038
  }
16021
16039
  if (!o5)
16022
16040
  return;
16023
16041
  const i8 = a7 === "return" ? 0 : -1, m4 = a7 === "return" ? -1 : 0;
16024
- l3.moveCursor(r6, i8, m4, () => {
16025
- l3.clearLine(r6, 1, () => {
16026
- e5.once("keypress", n5);
16042
+ l3.moveCursor(r7, i8, m4, () => {
16043
+ l3.clearLine(r7, 1, () => {
16044
+ e6.once("keypress", n6);
16027
16045
  });
16028
16046
  });
16029
16047
  };
16030
- return t6 && r6.write(import_sisteransi.cursor.hide), e5.once("keypress", n5), () => {
16031
- e5.off("keypress", n5), t6 && r6.write(import_sisteransi.cursor.show), e5 instanceof ReadStream && e5.isTTY && !R2 && e5.setRawMode(false), s3.terminal = false, s3.close();
16048
+ return t7 && r7.write(import_sisteransi.cursor.hide), e6.once("keypress", n6), () => {
16049
+ e6.off("keypress", n6), t7 && r7.write(import_sisteransi.cursor.show), e6 instanceof ReadStream && e6.isTTY && !R2 && e6.setRawMode(false), s3.terminal = false, s3.close();
16032
16050
  };
16033
16051
  }
16034
- function wrapTextWithPrefix(e5, r6, o5, t6 = o5, s3 = o5, n5) {
16035
- const f4 = getColumns(e5 ?? stdout);
16036
- return wrapAnsi(r6, f4 - o5.length, {
16052
+ function wrapTextWithPrefix(e6, r7, o5, t7 = o5, s3 = o5, n6) {
16053
+ const f4 = getColumns(e6 ?? stdout);
16054
+ return wrapAnsi(r7, f4 - o5.length, {
16037
16055
  hard: true,
16038
16056
  trim: false
16039
16057
  }).split(`
16040
16058
  `).map((c3, i8, m4) => {
16041
- const d4 = n5 ? n5(c3, i8) : c3;
16042
- return i8 === 0 ? `${t6}${d4}` : i8 === m4.length - 1 ? `${s3}${d4}` : `${o5}${d4}`;
16059
+ const d5 = n6 ? n6(c3, i8) : c3;
16060
+ return i8 === 0 ? `${t7}${d5}` : i8 === m4.length - 1 ? `${s3}${d5}` : `${o5}${d5}`;
16043
16061
  }).join(`
16044
16062
  `);
16045
16063
  }
16046
- function runValidation(e5, n5) {
16047
- if ("~standard" in e5) {
16048
- const a7 = e5["~standard"].validate(n5);
16064
+ function runValidation(e6, n6) {
16065
+ if ("~standard" in e6) {
16066
+ const a7 = e6["~standard"].validate(n6);
16049
16067
  if (a7 instanceof Promise)
16050
16068
  throw new TypeError("Schema validation must be synchronous. Update `validate()` and remove any asynchronous logic.");
16051
16069
  return a7.issues?.at(0)?.message;
16052
16070
  }
16053
- return e5(n5);
16071
+ return e6(n6);
16054
16072
  }
16055
16073
 
16056
16074
  class V2 {
@@ -16068,35 +16086,35 @@ class V2 {
16068
16086
  error = "";
16069
16087
  value;
16070
16088
  userInput = "";
16071
- constructor(t6, e5 = true) {
16072
- const { input: i8 = stdin, output: n5 = stdout, render: s3, signal: r6, ...o5 } = t6;
16073
- this.opts = o5, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = s3.bind(this), this._track = e5, this._abortSignal = r6, this.input = i8, this.output = n5;
16089
+ constructor(t7, e6 = true) {
16090
+ const { input: i8 = stdin, output: n6 = stdout, render: s3, signal: r7, ...o5 } = t7;
16091
+ this.opts = o5, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = s3.bind(this), this._track = e6, this._abortSignal = r7, this.input = i8, this.output = n6;
16074
16092
  }
16075
16093
  unsubscribe() {
16076
16094
  this._subscribers.clear();
16077
16095
  }
16078
- setSubscriber(t6, e5) {
16079
- const i8 = this._subscribers.get(t6) ?? [];
16080
- i8.push(e5), this._subscribers.set(t6, i8);
16096
+ setSubscriber(t7, e6) {
16097
+ const i8 = this._subscribers.get(t7) ?? [];
16098
+ i8.push(e6), this._subscribers.set(t7, i8);
16081
16099
  }
16082
- on(t6, e5) {
16083
- this.setSubscriber(t6, { cb: e5 });
16100
+ on(t7, e6) {
16101
+ this.setSubscriber(t7, { cb: e6 });
16084
16102
  }
16085
- once(t6, e5) {
16086
- this.setSubscriber(t6, { cb: e5, once: true });
16103
+ once(t7, e6) {
16104
+ this.setSubscriber(t7, { cb: e6, once: true });
16087
16105
  }
16088
- emit(t6, ...e5) {
16089
- const i8 = this._subscribers.get(t6) ?? [], n5 = [];
16106
+ emit(t7, ...e6) {
16107
+ const i8 = this._subscribers.get(t7) ?? [], n6 = [];
16090
16108
  for (const s3 of i8)
16091
- s3.cb(...e5), s3.once && n5.push(() => i8.splice(i8.indexOf(s3), 1));
16092
- for (const s3 of n5)
16109
+ s3.cb(...e6), s3.once && n6.push(() => i8.splice(i8.indexOf(s3), 1));
16110
+ for (const s3 of n6)
16093
16111
  s3();
16094
16112
  }
16095
16113
  prompt() {
16096
- return new Promise((t6) => {
16114
+ return new Promise((t7) => {
16097
16115
  if (this._abortSignal) {
16098
16116
  if (this._abortSignal.aborted)
16099
- return this.state = "cancel", this.close(), t6(CANCEL_SYMBOL);
16117
+ return this.state = "cancel", this.close(), t7(CANCEL_SYMBOL);
16100
16118
  this._abortSignal.addEventListener("abort", () => {
16101
16119
  this.state = "cancel", this.close();
16102
16120
  }, { once: true });
@@ -16108,166 +16126,166 @@ class V2 {
16108
16126
  escapeCodeTimeout: 50,
16109
16127
  terminal: true
16110
16128
  }), 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", () => {
16111
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t6(this.value);
16129
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t7(this.value);
16112
16130
  }), this.once("cancel", () => {
16113
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t6(CANCEL_SYMBOL);
16131
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t7(CANCEL_SYMBOL);
16114
16132
  });
16115
16133
  });
16116
16134
  }
16117
- _isActionKey(t6, e5) {
16118
- return t6 === "\t";
16135
+ _isActionKey(t7, e6) {
16136
+ return t7 === "\t";
16119
16137
  }
16120
- _shouldSubmit(t6, e5) {
16138
+ _shouldSubmit(t7, e6) {
16121
16139
  return true;
16122
16140
  }
16123
- _setValue(t6) {
16124
- this.value = t6, this.emit("value", this.value);
16141
+ _setValue(t7) {
16142
+ this.value = t7, this.emit("value", this.value);
16125
16143
  }
16126
- _setUserInput(t6, e5) {
16127
- this.userInput = t6 ?? "", this.emit("userInput", this.userInput), e5 && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
16144
+ _setUserInput(t7, e6) {
16145
+ this.userInput = t7 ?? "", this.emit("userInput", this.userInput), e6 && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
16128
16146
  }
16129
16147
  _clearUserInput() {
16130
16148
  this.rl?.write(null, { ctrl: true, name: "u" }), this._setUserInput("");
16131
16149
  }
16132
- onKeypress(t6, e5) {
16133
- if (this._track && e5.name !== "return" && (e5.name && this._isActionKey(t6, e5) && 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"), e5?.name && (!this._track && settings.aliases.has(e5.name) && this.emit("cursor", settings.aliases.get(e5.name)), settings.actions.has(e5.name) && this.emit("cursor", e5.name)), t6 && (t6.toLowerCase() === "y" || t6.toLowerCase() === "n") && this.emit("confirm", t6.toLowerCase() === "y"), this.emit("key", t6, e5), e5?.name === "return" && this._shouldSubmit(t6, e5)) {
16150
+ onKeypress(t7, e6) {
16151
+ if (this._track && e6.name !== "return" && (e6.name && this._isActionKey(t7, e6) && 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"), e6?.name && (!this._track && settings.aliases.has(e6.name) && this.emit("cursor", settings.aliases.get(e6.name)), settings.actions.has(e6.name) && this.emit("cursor", e6.name)), t7 && (t7.toLowerCase() === "y" || t7.toLowerCase() === "n") && this.emit("confirm", t7.toLowerCase() === "y"), this.emit("key", t7, e6), e6?.name === "return" && this._shouldSubmit(t7, e6)) {
16134
16152
  if (this.opts.validate) {
16135
16153
  const i8 = runValidation(this.opts.validate, this.value);
16136
16154
  i8 && (this.error = i8 instanceof Error ? i8.message : i8, this.state = "error", this.rl?.write(this.userInput));
16137
16155
  }
16138
16156
  this.state !== "error" && (this.state = "submit");
16139
16157
  }
16140
- isActionKey([t6, e5?.name, e5?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
16158
+ isActionKey([t7, e6?.name, e6?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
16141
16159
  }
16142
16160
  close() {
16143
16161
  this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
16144
16162
  `), setRawMode(this.input, false), this.rl?.close(), this.rl = undefined, this.emit(`${this.state}`, this.value), this.unsubscribe();
16145
16163
  }
16146
16164
  restoreCursor() {
16147
- const t6 = wrapAnsi(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split(`
16165
+ const t7 = wrapAnsi(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split(`
16148
16166
  `).length - 1;
16149
- this.output.write(import_sisteransi.cursor.move(-999, t6 * -1));
16167
+ this.output.write(import_sisteransi.cursor.move(-999, t7 * -1));
16150
16168
  }
16151
16169
  render() {
16152
- const t6 = wrapAnsi(this._render(this) ?? "", process.stdout.columns, {
16170
+ const t7 = wrapAnsi(this._render(this) ?? "", process.stdout.columns, {
16153
16171
  hard: true,
16154
16172
  trim: false
16155
16173
  });
16156
- if (t6 !== this._prevFrame) {
16174
+ if (t7 !== this._prevFrame) {
16157
16175
  if (this.state === "initial")
16158
16176
  this.output.write(import_sisteransi.cursor.hide);
16159
16177
  else {
16160
- const e5 = diffLines(this._prevFrame, t6), i8 = getRows(this.output);
16161
- if (this.restoreCursor(), e5) {
16162
- const n5 = Math.max(0, e5.numLinesAfter - i8), s3 = Math.max(0, e5.numLinesBefore - i8);
16163
- let r6 = e5.lines.find((o5) => o5 >= n5);
16164
- if (r6 === undefined) {
16165
- this._prevFrame = t6;
16178
+ const e6 = diffLines(this._prevFrame, t7), i8 = getRows(this.output);
16179
+ if (this.restoreCursor(), e6) {
16180
+ const n6 = Math.max(0, e6.numLinesAfter - i8), s3 = Math.max(0, e6.numLinesBefore - i8);
16181
+ let r7 = e6.lines.find((o5) => o5 >= n6);
16182
+ if (r7 === undefined) {
16183
+ this._prevFrame = t7;
16166
16184
  return;
16167
16185
  }
16168
- if (e5.lines.length === 1) {
16169
- this.output.write(import_sisteransi.cursor.move(0, r6 - s3)), this.output.write(import_sisteransi.erase.lines(1));
16170
- const o5 = t6.split(`
16186
+ if (e6.lines.length === 1) {
16187
+ this.output.write(import_sisteransi.cursor.move(0, r7 - s3)), this.output.write(import_sisteransi.erase.lines(1));
16188
+ const o5 = t7.split(`
16171
16189
  `);
16172
- this.output.write(o5[r6]), this._prevFrame = t6, this.output.write(import_sisteransi.cursor.move(0, o5.length - r6 - 1));
16190
+ this.output.write(o5[r7]), this._prevFrame = t7, this.output.write(import_sisteransi.cursor.move(0, o5.length - r7 - 1));
16173
16191
  return;
16174
- } else if (e5.lines.length > 1) {
16175
- if (n5 < s3)
16176
- r6 = n5;
16192
+ } else if (e6.lines.length > 1) {
16193
+ if (n6 < s3)
16194
+ r7 = n6;
16177
16195
  else {
16178
- const h4 = r6 - s3;
16196
+ const h4 = r7 - s3;
16179
16197
  h4 > 0 && this.output.write(import_sisteransi.cursor.move(0, h4));
16180
16198
  }
16181
16199
  this.output.write(import_sisteransi.erase.down());
16182
- const f4 = t6.split(`
16183
- `).slice(r6);
16200
+ const f4 = t7.split(`
16201
+ `).slice(r7);
16184
16202
  this.output.write(f4.join(`
16185
- `)), this._prevFrame = t6;
16203
+ `)), this._prevFrame = t7;
16186
16204
  return;
16187
16205
  }
16188
16206
  }
16189
16207
  this.output.write(import_sisteransi.erase.down());
16190
16208
  }
16191
- this.output.write(t6), this.state === "initial" && (this.state = "active"), this._prevFrame = t6;
16209
+ this.output.write(t7), this.state === "initial" && (this.state = "active"), this._prevFrame = t7;
16192
16210
  }
16193
16211
  }
16194
16212
  }
16195
- function p$1(l4, e5) {
16196
- if (l4 === undefined || e5.length === 0)
16213
+ function p$1(l4, e6) {
16214
+ if (l4 === undefined || e6.length === 0)
16197
16215
  return 0;
16198
- const i8 = e5.findIndex((s3) => s3.value === l4);
16216
+ const i8 = e6.findIndex((s3) => s3.value === l4);
16199
16217
  return i8 !== -1 ? i8 : 0;
16200
16218
  }
16201
- function g3(l4, e5) {
16202
- return (e5.label ?? String(e5.value)).toLowerCase().includes(l4.toLowerCase());
16219
+ function g3(l4, e6) {
16220
+ return (e6.label ?? String(e6.value)).toLowerCase().includes(l4.toLowerCase());
16203
16221
  }
16204
- function m4(l4, e5) {
16205
- if (e5)
16206
- return l4 ? e5 : e5[0];
16222
+ function m4(l4, e6) {
16223
+ if (e6)
16224
+ return l4 ? e6 : e6[0];
16207
16225
  }
16208
- function M2(r7) {
16209
- return [...r7].map((t6) => _3[t6]);
16226
+ function M2(r8) {
16227
+ return [...r8].map((t7) => _3[t7]);
16210
16228
  }
16211
- function P2(r7) {
16212
- const i8 = new Intl.DateTimeFormat(r7, {
16229
+ function P2(r8) {
16230
+ const i8 = new Intl.DateTimeFormat(r8, {
16213
16231
  year: "numeric",
16214
16232
  month: "2-digit",
16215
16233
  day: "2-digit"
16216
16234
  }).formatToParts(new Date(2000, 0, 15)), s3 = [];
16217
- let n5 = "/";
16218
- for (const e5 of i8)
16219
- e5.type === "literal" ? n5 = e5.value.trim() || e5.value : (e5.type === "year" || e5.type === "month" || e5.type === "day") && s3.push({ type: e5.type, len: e5.type === "year" ? 4 : 2 });
16220
- return { segments: s3, separator: n5 };
16235
+ let n6 = "/";
16236
+ for (const e6 of i8)
16237
+ e6.type === "literal" ? n6 = e6.value.trim() || e6.value : (e6.type === "year" || e6.type === "month" || e6.type === "day") && s3.push({ type: e6.type, len: e6.type === "year" ? 4 : 2 });
16238
+ return { segments: s3, separator: n6 };
16221
16239
  }
16222
- function p4(r7) {
16223
- return Number.parseInt((r7 || "0").replace(/_/g, "0"), 10) || 0;
16240
+ function p4(r8) {
16241
+ return Number.parseInt((r8 || "0").replace(/_/g, "0"), 10) || 0;
16224
16242
  }
16225
- function f4(r7) {
16243
+ function f4(r8) {
16226
16244
  return {
16227
- year: p4(r7.year),
16228
- month: p4(r7.month),
16229
- day: p4(r7.day)
16245
+ year: p4(r8.year),
16246
+ month: p4(r8.month),
16247
+ day: p4(r8.day)
16230
16248
  };
16231
16249
  }
16232
- function c3(r7, t6) {
16233
- return new Date(r7 || 2001, t6 || 1, 0).getDate();
16250
+ function c3(r8, t7) {
16251
+ return new Date(r8 || 2001, t7 || 1, 0).getDate();
16234
16252
  }
16235
- function b3(r7) {
16236
- const { year: t6, month: i8, day: s3 } = f4(r7);
16237
- if (!t6 || t6 < 0 || t6 > 9999 || !i8 || i8 < 1 || i8 > 12 || !s3 || s3 < 1)
16253
+ function b3(r8) {
16254
+ const { year: t7, month: i8, day: s3 } = f4(r8);
16255
+ if (!t7 || t7 < 0 || t7 > 9999 || !i8 || i8 < 1 || i8 > 12 || !s3 || s3 < 1)
16238
16256
  return;
16239
- const n5 = new Date(Date.UTC(t6, i8 - 1, s3));
16240
- if (!(n5.getUTCFullYear() !== t6 || n5.getUTCMonth() !== i8 - 1 || n5.getUTCDate() !== s3))
16241
- return { year: t6, month: i8, day: s3 };
16257
+ const n6 = new Date(Date.UTC(t7, i8 - 1, s3));
16258
+ if (!(n6.getUTCFullYear() !== t7 || n6.getUTCMonth() !== i8 - 1 || n6.getUTCDate() !== s3))
16259
+ return { year: t7, month: i8, day: s3 };
16242
16260
  }
16243
- function C3(r7) {
16244
- const t6 = b3(r7);
16245
- return t6 ? new Date(Date.UTC(t6.year, t6.month - 1, t6.day)) : undefined;
16261
+ function C3(r8) {
16262
+ const t7 = b3(r8);
16263
+ return t7 ? new Date(Date.UTC(t7.year, t7.month - 1, t7.day)) : undefined;
16246
16264
  }
16247
- function T4(r7, t6, i8, s3) {
16248
- const n5 = i8 ? {
16265
+ function T4(r8, t7, i8, s3) {
16266
+ const n6 = i8 ? {
16249
16267
  year: i8.getUTCFullYear(),
16250
16268
  month: i8.getUTCMonth() + 1,
16251
16269
  day: i8.getUTCDate()
16252
- } : null, e5 = s3 ? {
16270
+ } : null, e6 = s3 ? {
16253
16271
  year: s3.getUTCFullYear(),
16254
16272
  month: s3.getUTCMonth() + 1,
16255
16273
  day: s3.getUTCDate()
16256
16274
  } : null;
16257
- return r7 === "year" ? { min: n5?.year ?? 1, max: e5?.year ?? 9999 } : r7 === "month" ? {
16258
- min: n5 && t6.year === n5.year ? n5.month : 1,
16259
- max: e5 && t6.year === e5.year ? e5.month : 12
16275
+ return r8 === "year" ? { min: n6?.year ?? 1, max: e6?.year ?? 9999 } : r8 === "month" ? {
16276
+ min: n6 && t7.year === n6.year ? n6.month : 1,
16277
+ max: e6 && t7.year === e6.year ? e6.month : 12
16260
16278
  } : {
16261
- min: n5 && t6.year === n5.year && t6.month === n5.month ? n5.day : 1,
16262
- max: e5 && t6.year === e5.year && t6.month === e5.month ? e5.day : c3(t6.year, t6.month)
16279
+ min: n6 && t7.year === n6.year && t7.month === n6.month ? n6.day : 1,
16280
+ max: e6 && t7.year === e6.year && t7.month === e6.month ? e6.day : c3(t7.year, t7.month)
16263
16281
  };
16264
16282
  }
16265
- var import_sisteransi, a$2, t5, settings, R2, CANCEL_SYMBOL, getColumns = (e5) => ("columns" in e5) && typeof e5.columns == "number" ? e5.columns : 80, getRows = (e5) => ("rows" in e5) && typeof e5.rows == "number" ? e5.rows : 20, T$1, r6, _3, U2, u$1, o$1, h4, a$1, o5, a8, u4, n5;
16283
+ var import_sisteransi, a$1, t6, settings, R2, CANCEL_SYMBOL, getColumns = (e6) => ("columns" in e6) && typeof e6.columns == "number" ? e6.columns : 80, getRows = (e6) => ("rows" in e6) && typeof e6.rows == "number" ? e6.rows : 20, T$1, r7, _3, U2, u$2, o5, h4, a7, u$1, n$1, u6, n7;
16266
16284
  var init_dist3 = __esm(() => {
16267
16285
  init_main();
16268
16286
  import_sisteransi = __toESM(require_src(), 1);
16269
- a$2 = ["up", "down", "left", "right", "space", "enter", "cancel"];
16270
- t5 = [
16287
+ a$1 = ["up", "down", "left", "right", "space", "enter", "cancel"];
16288
+ t6 = [
16271
16289
  "January",
16272
16290
  "February",
16273
16291
  "March",
@@ -16282,7 +16300,7 @@ var init_dist3 = __esm(() => {
16282
16300
  "December"
16283
16301
  ];
16284
16302
  settings = {
16285
- actions: new Set(a$2),
16303
+ actions: new Set(a$1),
16286
16304
  aliases: /* @__PURE__ */ new Map([
16287
16305
  ["k", "up"],
16288
16306
  ["j", "down"],
@@ -16297,13 +16315,13 @@ var init_dist3 = __esm(() => {
16297
16315
  },
16298
16316
  withGuide: true,
16299
16317
  date: {
16300
- monthNames: [...t5],
16318
+ monthNames: [...t6],
16301
16319
  messages: {
16302
16320
  required: "Please enter a valid date",
16303
16321
  invalidMonth: "There are only 12 months in a year",
16304
- invalidDay: (n5, e5) => `There are only ${n5} days in ${e5}`,
16305
- afterMin: (n5) => `Date must be on or after ${n5.toISOString().slice(0, 10)}`,
16306
- beforeMax: (n5) => `Date must be on or before ${n5.toISOString().slice(0, 10)}`
16322
+ invalidDay: (n6, e6) => `There are only ${n6} days in ${e6}`,
16323
+ afterMin: (n6) => `Date must be on or after ${n6.toISOString().slice(0, 10)}`,
16324
+ beforeMax: (n6) => `Date must be on or before ${n6.toISOString().slice(0, 10)}`
16307
16325
  }
16308
16326
  }
16309
16327
  };
@@ -16328,46 +16346,46 @@ var init_dist3 = __esm(() => {
16328
16346
  return styleText(["inverse", "hidden"], "_");
16329
16347
  if (this._cursor >= this.userInput.length)
16330
16348
  return `${this.userInput}\u2588`;
16331
- const e5 = this.userInput.slice(0, this._cursor), [t6, ...i8] = this.userInput.slice(this._cursor);
16332
- return `${e5}${styleText("inverse", t6)}${i8.join("")}`;
16349
+ const e6 = this.userInput.slice(0, this.cursor), t7 = this.userInput.slice(this.cursor, this.cursor + 1), i8 = this.userInput.slice(this.cursor + 1);
16350
+ return `${e6}${styleText("inverse", t7)}${i8}`;
16333
16351
  }
16334
16352
  get options() {
16335
16353
  return typeof this.#i == "function" ? this.#i() : this.#i;
16336
16354
  }
16337
- constructor(e5) {
16338
- super(e5), this.#i = e5.options, this.#n = e5.placeholder;
16339
- const t6 = this.options;
16340
- this.filteredOptions = [...t6], this.multiple = e5.multiple === true, this.#t = typeof e5.options == "function" ? e5.filter : e5.filter ?? g3;
16355
+ constructor(e6) {
16356
+ super(e6), this.#i = e6.options, this.#n = e6.placeholder;
16357
+ const t7 = this.options;
16358
+ this.filteredOptions = [...t7], this.multiple = e6.multiple === true, this.#t = typeof e6.options == "function" ? e6.filter : e6.filter ?? g3;
16341
16359
  let i8;
16342
- if (e5.initialValue && Array.isArray(e5.initialValue) ? this.multiple ? i8 = e5.initialValue : i8 = e5.initialValue.slice(0, 1) : !this.multiple && this.options.length > 0 && (i8 = [this.options[0].value]), i8)
16360
+ if (e6.initialValue && Array.isArray(e6.initialValue) ? this.multiple ? i8 = e6.initialValue : i8 = e6.initialValue.slice(0, 1) : !this.multiple && this.options.length > 0 && (i8 = [this.options[0]?.value]), i8)
16343
16361
  for (const s3 of i8) {
16344
- const n5 = t6.findIndex((o5) => o5.value === s3);
16345
- n5 !== -1 && (this.toggleSelected(s3), this.#e = n5);
16362
+ const n6 = t7.findIndex((o5) => o5.value === s3);
16363
+ n6 !== -1 && (this.toggleSelected(s3), this.#e = n6);
16346
16364
  }
16347
- this.focusedValue = this.options[this.#e]?.value, this.on("key", (s3, n5) => this.#l(s3, n5)), this.on("userInput", (s3) => this.#u(s3));
16365
+ this.focusedValue = this.options[this.#e]?.value, this.on("key", (s3, n6) => this.#l(s3, n6)), this.on("userInput", (s3) => this.#u(s3));
16348
16366
  }
16349
- _isActionKey(e5, t6) {
16350
- return e5 === "\t" || this.multiple && this.isNavigating && t6.name === "space" && e5 !== undefined && e5 !== "";
16367
+ _isActionKey(e6, t7) {
16368
+ return e6 === "\t" || this.multiple && this.isNavigating && t7.name === "space" && e6 !== undefined && e6 !== "";
16351
16369
  }
16352
- #l(e5, t6) {
16353
- const i8 = t6.name === "up", s3 = t6.name === "down", n5 = t6.name === "return", o5 = this.userInput === "" || this.userInput === "\t", u3 = this.#n, h4 = this.options, f4 = u3 !== undefined && u3 !== "" && h4.some((r6) => !r6.disabled && (this.#t ? this.#t(u3, r6) : true));
16354
- if (t6.name === "tab" && o5 && f4) {
16355
- this.userInput === "\t" && this._clearUserInput(), this._setUserInput(u3, true), this.isNavigating = false;
16370
+ #l(e6, t7) {
16371
+ const i8 = t7.name === "up", s3 = t7.name === "down", n6 = t7.name === "return", o5 = this.userInput === "" || this.userInput === "\t", u4 = this.#n, a7 = this.options, f4 = u4 !== undefined && u4 !== "" && a7.some((r7) => !r7.disabled && (this.#t ? this.#t(u4, r7) : true));
16372
+ if (t7.name === "tab" && o5 && f4) {
16373
+ this.userInput === "\t" && this._clearUserInput(), this._setUserInput(u4, true), this.isNavigating = false;
16356
16374
  return;
16357
16375
  }
16358
- i8 || s3 ? (this.#e = findCursor(this.#e, i8 ? -1 : 1, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#e]?.value, this.multiple || (this.selectedValues = [this.focusedValue]), this.isNavigating = true) : n5 ? this.value = m4(this.multiple, this.selectedValues) : this.multiple ? this.focusedValue !== undefined && (t6.name === "tab" || this.isNavigating && t6.name === "space") ? this.toggleSelected(this.focusedValue) : this.isNavigating = false : (this.focusedValue && (this.selectedValues = [this.focusedValue]), this.isNavigating = false);
16376
+ i8 || s3 ? (this.#e = findCursor(this.#e, i8 ? -1 : 1, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#e]?.value, this.multiple || (this.selectedValues = [this.focusedValue]), this.isNavigating = true) : n6 ? this.value = m4(this.multiple, this.selectedValues) : this.multiple ? this.focusedValue !== undefined && (t7.name === "tab" || this.isNavigating && t7.name === "space") ? this.toggleSelected(this.focusedValue) : this.isNavigating = false : (this.focusedValue && (this.selectedValues = [this.focusedValue]), this.isNavigating = false);
16359
16377
  }
16360
16378
  deselectAll() {
16361
16379
  this.selectedValues = [];
16362
16380
  }
16363
- toggleSelected(e5) {
16364
- this.filteredOptions.length !== 0 && (this.multiple ? this.selectedValues.includes(e5) ? this.selectedValues = this.selectedValues.filter((t6) => t6 !== e5) : this.selectedValues = [...this.selectedValues, e5] : this.selectedValues = [e5]);
16381
+ toggleSelected(e6) {
16382
+ this.filteredOptions.length !== 0 && (this.multiple ? this.selectedValues.includes(e6) ? this.selectedValues = this.selectedValues.filter((t7) => t7 !== e6) : this.selectedValues = [...this.selectedValues, e6] : this.selectedValues = [e6]);
16365
16383
  }
16366
- #u(e5) {
16367
- if (e5 !== this.#s) {
16368
- this.#s = e5;
16369
- const t6 = this.options;
16370
- e5 && this.#t ? this.filteredOptions = t6.filter((n5) => this.#t?.(e5, n5)) : this.filteredOptions = [...t6];
16384
+ #u(e6) {
16385
+ if (e6 !== this.#s) {
16386
+ this.#s = e6;
16387
+ const t7 = this.options;
16388
+ e6 && this.#t ? this.filteredOptions = t7.filter((n6) => this.#t?.(e6, n6)) : this.filteredOptions = [...t7];
16371
16389
  const i8 = p$1(this.focusedValue, this.filteredOptions);
16372
16390
  this.#e = findCursor(i8, 0, this.filteredOptions);
16373
16391
  const s3 = this.filteredOptions[this.#e];
@@ -16375,15 +16393,15 @@ var init_dist3 = __esm(() => {
16375
16393
  }
16376
16394
  }
16377
16395
  };
16378
- r6 = class r6 extends V2 {
16396
+ r7 = class r7 extends V2 {
16379
16397
  get cursor() {
16380
16398
  return this.value ? 0 : 1;
16381
16399
  }
16382
16400
  get _value() {
16383
16401
  return this.cursor === 0;
16384
16402
  }
16385
- constructor(t6) {
16386
- super(t6, false), this.value = !!t6.initialValue, this.on("userInput", () => {
16403
+ constructor(t7) {
16404
+ super(t7, false), this.value = !!t7.initialValue, this.on("userInput", () => {
16387
16405
  this.value = this._value;
16388
16406
  }), this.on("confirm", (i8) => {
16389
16407
  this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = i8, this.state = "submit", this.close();
@@ -16422,44 +16440,44 @@ var init_dist3 = __esm(() => {
16422
16440
  get formattedValue() {
16423
16441
  return this.#l(this.#t);
16424
16442
  }
16425
- #l(t6) {
16426
- return this.#i.map((i8) => t6[i8.type]).join(this.#o);
16443
+ #l(t7) {
16444
+ return this.#i.map((i8) => t7[i8.type]).join(this.#o);
16427
16445
  }
16428
16446
  #r() {
16429
16447
  this._setUserInput(this.#l(this.#t)), this._setValue(C3(this.#t) ?? undefined);
16430
16448
  }
16431
- constructor(t6) {
16432
- const i8 = t6.format ? { segments: M2(t6.format), separator: t6.separator ?? "/" } : P2(t6.locale), s3 = t6.separator ?? i8.separator, n5 = t6.format ? M2(t6.format) : i8.segments, e5 = t6.initialValue ?? t6.defaultValue, m5 = e5 ? {
16433
- year: String(e5.getUTCFullYear()).padStart(4, "0"),
16434
- month: String(e5.getUTCMonth() + 1).padStart(2, "0"),
16435
- day: String(e5.getUTCDate()).padStart(2, "0")
16436
- } : { year: "____", month: "__", day: "__" }, o5 = n5.map((a7) => m5[a7.type]).join(s3);
16437
- super({ ...t6, initialUserInput: o5 }, false), this.#i = n5, this.#o = s3, this.#t = m5, this.#h = t6.minDate, this.#u = t6.maxDate, this.#r(), this.on("cursor", (a7) => this.#f(a7)), this.on("key", (a7, u3) => this.#y(a7, u3)), this.on("finalize", () => this.#p(t6));
16449
+ constructor(t7) {
16450
+ const i8 = t7.format ? { segments: M2(t7.format), separator: t7.separator ?? "/" } : P2(t7.locale), s3 = t7.separator ?? i8.separator, n6 = t7.format ? M2(t7.format) : i8.segments, e6 = t7.initialValue ?? t7.defaultValue, m5 = e6 ? {
16451
+ year: String(e6.getUTCFullYear()).padStart(4, "0"),
16452
+ month: String(e6.getUTCMonth() + 1).padStart(2, "0"),
16453
+ day: String(e6.getUTCDate()).padStart(2, "0")
16454
+ } : { year: "____", month: "__", day: "__" }, o5 = n6.map((a7) => m5[a7.type]).join(s3);
16455
+ super({ ...t7, initialUserInput: o5 }, false), this.#i = n6, this.#o = s3, this.#t = m5, this.#h = t7.minDate, this.#u = t7.maxDate, this.#r(), this.on("cursor", (a7) => this.#f(a7)), this.on("key", (a7, u4) => this.#y(a7, u4)), this.on("finalize", () => this.#p(t7));
16438
16456
  }
16439
16457
  #a() {
16440
- const t6 = Math.max(0, Math.min(this.#e.segmentIndex, this.#i.length - 1)), i8 = this.#i[t6];
16458
+ const t7 = Math.max(0, Math.min(this.#e.segmentIndex, this.#i.length - 1)), i8 = this.#i[t7];
16441
16459
  if (i8)
16442
- return this.#e.positionInSegment = Math.max(0, Math.min(this.#e.positionInSegment, i8.len - 1)), { segment: i8, index: t6 };
16460
+ return this.#e.positionInSegment = Math.max(0, Math.min(this.#e.positionInSegment, i8.len - 1)), { segment: i8, index: t7 };
16443
16461
  }
16444
- #m(t6) {
16462
+ #m(t7) {
16445
16463
  this.inlineError = "", this.#s = null;
16446
16464
  const i8 = this.#a();
16447
- i8 && (this.#e.segmentIndex = Math.max(0, Math.min(this.#i.length - 1, i8.index + t6)), this.#e.positionInSegment = 0, this.#n = true);
16465
+ i8 && (this.#e.segmentIndex = Math.max(0, Math.min(this.#i.length - 1, i8.index + t7)), this.#e.positionInSegment = 0, this.#n = true);
16448
16466
  }
16449
- #d(t6) {
16467
+ #d(t7) {
16450
16468
  const i8 = this.#a();
16451
16469
  if (!i8)
16452
16470
  return;
16453
- const { segment: s3 } = i8, n5 = this.#t[s3.type], e5 = !n5 || n5.replace(/_/g, "") === "", m5 = Number.parseInt((n5 || "0").replace(/_/g, "0"), 10) || 0, o5 = T4(s3.type, f4(this.#t), this.#h, this.#u);
16471
+ const { segment: s3 } = i8, n6 = this.#t[s3.type], e6 = !n6 || n6.replace(/_/g, "") === "", m5 = Number.parseInt((n6 || "0").replace(/_/g, "0"), 10) || 0, o5 = T4(s3.type, f4(this.#t), this.#h, this.#u);
16454
16472
  let a7;
16455
- e5 ? a7 = t6 === 1 ? o5.min : o5.max : a7 = Math.max(Math.min(o5.max, m5 + t6), o5.min), this.#t = {
16473
+ e6 ? a7 = t7 === 1 ? o5.min : o5.max : a7 = Math.max(Math.min(o5.max, m5 + t7), o5.min), this.#t = {
16456
16474
  ...this.#t,
16457
16475
  [s3.type]: a7.toString().padStart(s3.len, "0")
16458
16476
  }, this.#n = true, this.#s = null, this.#r();
16459
16477
  }
16460
- #f(t6) {
16461
- if (t6)
16462
- switch (t6) {
16478
+ #f(t7) {
16479
+ if (t7)
16480
+ switch (t7) {
16463
16481
  case "right":
16464
16482
  return this.#m(1);
16465
16483
  case "left":
@@ -16470,121 +16488,122 @@ var init_dist3 = __esm(() => {
16470
16488
  return this.#d(-1);
16471
16489
  }
16472
16490
  }
16473
- #y(t6, i8) {
16474
- if (i8?.name === "backspace" || i8?.sequence === "\x7F" || i8?.sequence === "\b" || t6 === "\x7F" || t6 === "\b") {
16491
+ #y(t7, i8) {
16492
+ if (i8?.name === "backspace" || i8?.sequence === "\x7F" || i8?.sequence === "\b" || t7 === "\x7F" || t7 === "\b") {
16475
16493
  this.inlineError = "";
16476
- const n5 = this.#a();
16477
- if (!n5)
16494
+ const n6 = this.#a();
16495
+ if (!n6)
16478
16496
  return;
16479
- if (!this.#t[n5.segment.type].replace(/_/g, "")) {
16497
+ if (!this.#t[n6.segment.type].replace(/_/g, "")) {
16480
16498
  this.#m(-1);
16481
16499
  return;
16482
16500
  }
16483
- this.#t[n5.segment.type] = "_".repeat(n5.segment.len), this.#n = true, this.#e.positionInSegment = 0, this.#r();
16501
+ this.#t[n6.segment.type] = "_".repeat(n6.segment.len), this.#n = true, this.#e.positionInSegment = 0, this.#r();
16484
16502
  return;
16485
16503
  }
16486
16504
  if (i8?.name === "tab") {
16487
16505
  this.inlineError = "";
16488
- const n5 = this.#a();
16489
- if (!n5)
16506
+ const n6 = this.#a();
16507
+ if (!n6)
16490
16508
  return;
16491
- const e5 = i8.shift ? -1 : 1, m5 = n5.index + e5;
16509
+ const e6 = i8.shift ? -1 : 1, m5 = n6.index + e6;
16492
16510
  m5 >= 0 && m5 < this.#i.length && (this.#e.segmentIndex = m5, this.#e.positionInSegment = 0, this.#n = true);
16493
16511
  return;
16494
16512
  }
16495
- if (t6 && /^[0-9]$/.test(t6)) {
16496
- const n5 = this.#a();
16497
- if (!n5)
16513
+ if (t7 && /^[0-9]$/.test(t7)) {
16514
+ const n6 = this.#a();
16515
+ if (!n6)
16498
16516
  return;
16499
- const { segment: e5 } = n5, m5 = !this.#t[e5.type].replace(/_/g, "");
16517
+ const { segment: e6 } = n6, m5 = !this.#t[e6.type].replace(/_/g, "");
16500
16518
  if (this.#n && this.#s !== null && !m5) {
16501
- const h4 = this.#s + t6, d4 = { ...this.#t, [e5.type]: h4 }, g4 = this.#g(d4, e5);
16519
+ const h4 = this.#s + t7, d5 = { ...this.#t, [e6.type]: h4 }, g4 = this.#g(d5, e6);
16502
16520
  if (g4) {
16503
16521
  this.inlineError = g4, this.#s = null, this.#n = false;
16504
16522
  return;
16505
16523
  }
16506
- this.inlineError = "", this.#t[e5.type] = h4, this.#s = null, this.#n = false, this.#r(), n5.index < this.#i.length - 1 && (this.#e.segmentIndex = n5.index + 1, this.#e.positionInSegment = 0, this.#n = true);
16524
+ this.inlineError = "", this.#t[e6.type] = h4, this.#s = null, this.#n = false, this.#r(), n6.index < this.#i.length - 1 && (this.#e.segmentIndex = n6.index + 1, this.#e.positionInSegment = 0, this.#n = true);
16507
16525
  return;
16508
16526
  }
16509
- this.#n && !m5 && (this.#t[e5.type] = "_".repeat(e5.len), this.#e.positionInSegment = 0), this.#n = false, this.#s = null;
16510
- const o5 = this.#t[e5.type], a7 = o5.indexOf("_"), u3 = a7 >= 0 ? a7 : Math.min(this.#e.positionInSegment, e5.len - 1);
16511
- if (u3 < 0 || u3 >= e5.len)
16527
+ this.#n && !m5 && (this.#t[e6.type] = "_".repeat(e6.len), this.#e.positionInSegment = 0), this.#n = false, this.#s = null;
16528
+ const o5 = this.#t[e6.type], a7 = o5.indexOf("_"), u4 = a7 >= 0 ? a7 : Math.min(this.#e.positionInSegment, e6.len - 1);
16529
+ if (u4 < 0 || u4 >= e6.len)
16512
16530
  return;
16513
- let l4 = o5.slice(0, u3) + t6 + o5.slice(u3 + 1), D2 = false;
16514
- if (u3 === 0 && o5 === "__" && (e5.type === "month" || e5.type === "day")) {
16515
- const h4 = Number.parseInt(t6, 10);
16516
- l4 = `0${t6}`, D2 = h4 <= (e5.type === "month" ? 1 : 2);
16517
- }
16518
- if (e5.type === "year" && (l4 = (o5.replace(/_/g, "") + t6).padStart(e5.len, "_")), !l4.includes("_")) {
16519
- const h4 = { ...this.#t, [e5.type]: l4 }, d4 = this.#g(h4, e5);
16520
- if (d4) {
16521
- this.inlineError = d4;
16531
+ let l4 = o5.slice(0, u4) + t7 + o5.slice(u4 + 1), D2 = false;
16532
+ if (u4 === 0 && o5 === "__" && (e6.type === "month" || e6.type === "day")) {
16533
+ const h4 = Number.parseInt(t7, 10);
16534
+ l4 = `0${t7}`, D2 = h4 <= (e6.type === "month" ? 1 : 2);
16535
+ }
16536
+ if (e6.type === "year" && (l4 = (o5.replace(/_/g, "") + t7).padStart(e6.len, "_")), !l4.includes("_")) {
16537
+ const h4 = { ...this.#t, [e6.type]: l4 }, d5 = this.#g(h4, e6);
16538
+ if (d5) {
16539
+ this.inlineError = d5;
16522
16540
  return;
16523
16541
  }
16524
16542
  }
16525
- this.inlineError = "", this.#t[e5.type] = l4;
16543
+ this.inlineError = "", this.#t[e6.type] = l4;
16526
16544
  const y3 = l4.includes("_") ? undefined : b3(this.#t);
16527
16545
  if (y3) {
16528
- const { year: h4, month: d4 } = y3, g4 = c3(h4, d4);
16546
+ const { year: h4, month: d5 } = y3, g4 = c3(h4, d5);
16529
16547
  this.#t = {
16530
16548
  year: String(Math.max(0, Math.min(9999, h4))).padStart(4, "0"),
16531
- month: String(Math.max(1, Math.min(12, d4))).padStart(2, "0"),
16549
+ month: String(Math.max(1, Math.min(12, d5))).padStart(2, "0"),
16532
16550
  day: String(Math.max(1, Math.min(g4, y3.day))).padStart(2, "0")
16533
16551
  };
16534
16552
  }
16535
16553
  this.#r();
16536
16554
  const S3 = l4.indexOf("_");
16537
- D2 ? (this.#n = true, this.#s = t6) : S3 >= 0 ? this.#e.positionInSegment = S3 : a7 >= 0 && n5.index < this.#i.length - 1 ? (this.#e.segmentIndex = n5.index + 1, this.#e.positionInSegment = 0, this.#n = true) : this.#e.positionInSegment = Math.min(u3 + 1, e5.len - 1);
16555
+ D2 ? (this.#n = true, this.#s = t7) : S3 >= 0 ? this.#e.positionInSegment = S3 : a7 >= 0 && n6.index < this.#i.length - 1 ? (this.#e.segmentIndex = n6.index + 1, this.#e.positionInSegment = 0, this.#n = true) : this.#e.positionInSegment = Math.min(u4 + 1, e6.len - 1);
16538
16556
  }
16539
16557
  }
16540
- #g(t6, i8) {
16541
- const { month: s3, day: n5 } = f4(t6);
16558
+ #g(t7, i8) {
16559
+ const { month: s3, day: n6 } = f4(t7);
16542
16560
  if (i8.type === "month" && (s3 < 0 || s3 > 12))
16543
16561
  return settings.date.messages.invalidMonth;
16544
- if (i8.type === "day" && (n5 < 0 || n5 > 31))
16562
+ if (i8.type === "day" && (n6 < 0 || n6 > 31))
16545
16563
  return settings.date.messages.invalidDay(31, "any month");
16546
16564
  }
16547
- #p(t6) {
16548
- const { year: i8, month: s3, day: n5 } = f4(this.#t);
16549
- if (i8 && s3 && n5) {
16550
- const e5 = c3(i8, s3);
16565
+ #p(t7) {
16566
+ const { year: i8, month: s3, day: n6 } = f4(this.#t);
16567
+ if (i8 && s3 && n6) {
16568
+ const e6 = c3(i8, s3);
16551
16569
  this.#t = {
16552
16570
  ...this.#t,
16553
- day: String(Math.min(n5, e5)).padStart(2, "0")
16571
+ day: String(Math.min(n6, e6)).padStart(2, "0")
16554
16572
  };
16555
16573
  }
16556
- this.value = C3(this.#t) ?? t6.defaultValue ?? undefined;
16574
+ this.value = C3(this.#t) ?? t7.defaultValue ?? undefined;
16557
16575
  }
16558
16576
  };
16559
- u$1 = class u3 extends V2 {
16577
+ u$2 = class u4 extends V2 {
16560
16578
  options;
16561
16579
  cursor = 0;
16562
16580
  #t;
16563
- getGroupItems(t6) {
16564
- return this.options.filter((r7) => r7.group === t6);
16581
+ getGroupItems(t7) {
16582
+ return this.options.filter((r8) => r8.group === t7);
16565
16583
  }
16566
- isGroupSelected(t6) {
16567
- const r7 = this.getGroupItems(t6), e5 = this.value;
16568
- return e5 === undefined ? false : r7.every((s3) => e5.includes(s3.value));
16584
+ isGroupSelected(t7) {
16585
+ const r8 = this.getGroupItems(t7), e6 = this.value;
16586
+ return e6 === undefined ? false : r8.every((s3) => e6.includes(s3.value));
16569
16587
  }
16570
16588
  toggleValue() {
16571
- const t6 = this.options[this.cursor];
16572
- if (this.value === undefined && (this.value = []), t6.group === true) {
16573
- const r7 = t6.value, e5 = this.getGroupItems(r7);
16574
- this.isGroupSelected(r7) ? this.value = this.value.filter((s3) => e5.findIndex((i8) => i8.value === s3) === -1) : this.value = [...this.value, ...e5.map((s3) => s3.value)], this.value = Array.from(new Set(this.value));
16575
- } else {
16576
- const r7 = this.value.includes(t6.value);
16577
- this.value = r7 ? this.value.filter((e5) => e5 !== t6.value) : [...this.value, t6.value];
16578
- }
16579
- }
16580
- constructor(t6) {
16581
- super(t6, false);
16582
- const { options: r7 } = t6;
16583
- this.#t = t6.selectableGroups !== false, this.options = Object.entries(r7).flatMap(([e5, s3]) => [
16584
- { value: e5, group: true, label: e5 },
16585
- ...s3.map((i8) => ({ ...i8, group: e5 }))
16586
- ]), this.value = [...t6.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: e5 }) => e5 === t6.cursorAt), this.#t ? 0 : 1), this.on("cursor", (e5) => {
16587
- switch (e5) {
16589
+ const t7 = this.options[this.cursor];
16590
+ if (t7 !== undefined)
16591
+ if (this.value === undefined && (this.value = []), t7.group === true) {
16592
+ const r8 = t7.value, e6 = this.getGroupItems(r8);
16593
+ this.isGroupSelected(r8) ? this.value = this.value.filter((s3) => e6.findIndex((i8) => i8.value === s3) === -1) : this.value = [...this.value, ...e6.map((s3) => s3.value)], this.value = Array.from(new Set(this.value));
16594
+ } else {
16595
+ const r8 = this.value.includes(t7.value);
16596
+ this.value = r8 ? this.value.filter((e6) => e6 !== t7.value) : [...this.value, t7.value];
16597
+ }
16598
+ }
16599
+ constructor(t7) {
16600
+ super(t7, false);
16601
+ const { options: r8 } = t7;
16602
+ this.#t = t7.selectableGroups !== false, this.options = Object.entries(r8).flatMap(([e6, s3]) => [
16603
+ { value: e6, group: true, label: e6 },
16604
+ ...s3.map((i8) => ({ ...i8, group: e6 }))
16605
+ ]), this.value = [...t7.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: e6 }) => e6 === t7.cursorAt), this.#t ? 0 : 1), this.on("cursor", (e6) => {
16606
+ switch (e6) {
16588
16607
  case "left":
16589
16608
  case "up": {
16590
16609
  this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
@@ -16606,35 +16625,35 @@ var init_dist3 = __esm(() => {
16606
16625
  });
16607
16626
  }
16608
16627
  };
16609
- o$1 = /* @__PURE__ */ new Set(["up", "down", "left", "right"]);
16628
+ o5 = /* @__PURE__ */ new Set(["up", "down", "left", "right"]);
16610
16629
  h4 = class h4 extends V2 {
16611
- #s = false;
16612
- #t;
16630
+ #t = false;
16631
+ #s;
16613
16632
  focused = "editor";
16614
16633
  get userInputWithCursor() {
16615
16634
  if (this.state === "submit")
16616
16635
  return this.userInput;
16617
- const t6 = this.userInput;
16618
- if (this.cursor >= t6.length)
16619
- return `${t6}\u2588`;
16620
- const s3 = t6.slice(0, this.cursor), r7 = t6[this.cursor], e5 = t6.slice(this.cursor + 1);
16621
- return r7 === `
16636
+ const t7 = this.userInput;
16637
+ if (this.cursor >= t7.length)
16638
+ return `${t7}\u2588`;
16639
+ const s3 = t7.slice(0, this.cursor), r8 = t7.slice(this.cursor, this.cursor + 1), i8 = t7.slice(this.cursor + 1);
16640
+ return r8 === `
16622
16641
  ` ? `${s3}\u2588
16623
- ${e5}` : `${s3}${styleText("inverse", r7)}${e5}`;
16642
+ ${i8}` : `${s3}${styleText("inverse", r8)}${i8}`;
16624
16643
  }
16625
16644
  get cursor() {
16626
16645
  return this._cursor;
16627
16646
  }
16628
- #r(t6) {
16647
+ #r(t7) {
16629
16648
  if (this.userInput.length === 0) {
16630
- this._setUserInput(t6);
16649
+ this._setUserInput(t7);
16631
16650
  return;
16632
16651
  }
16633
- this._setUserInput(this.userInput.slice(0, this.cursor) + t6 + this.userInput.slice(this.cursor));
16652
+ this._setUserInput(this.userInput.slice(0, this.cursor) + t7 + this.userInput.slice(this.cursor));
16634
16653
  }
16635
- #i(t6) {
16654
+ #i(t7) {
16636
16655
  const s3 = this.value ?? "";
16637
- switch (t6) {
16656
+ switch (t7) {
16638
16657
  case "up":
16639
16658
  this._cursor = findTextCursor(this._cursor, 0, -1, s3);
16640
16659
  return;
@@ -16649,75 +16668,79 @@ ${e5}` : `${s3}${styleText("inverse", r7)}${e5}`;
16649
16668
  return;
16650
16669
  }
16651
16670
  }
16652
- _shouldSubmit(t6, s3) {
16653
- if (this.#t)
16671
+ _shouldSubmit(t7, s3) {
16672
+ if (this.#s)
16654
16673
  return this.focused === "submit" ? true : (this.#r(`
16655
16674
  `), this._cursor++, false);
16656
- const r7 = this.#s;
16657
- return this.#s = true, r7 ? (this.userInput[this.cursor - 1] === `
16675
+ const r8 = this.#t;
16676
+ return this.#t = true, r8 && this.cursor === this.userInput.length ? (this.userInput[this.cursor - 1] === `
16658
16677
  ` && (this._setUserInput(this.userInput.slice(0, this.cursor - 1) + this.userInput.slice(this.cursor)), this._cursor--), true) : (this.#r(`
16659
16678
  `), this._cursor++, false);
16660
16679
  }
16661
- constructor(t6) {
16662
- super(t6, false), this.#t = t6.showSubmit ?? false, this.on("key", (s3, r7) => {
16663
- if (r7?.name && o$1.has(r7.name)) {
16664
- this.#i(r7.name);
16680
+ constructor(t7) {
16681
+ const s3 = t7.initialUserInput ?? t7.initialValue;
16682
+ super({
16683
+ ...t7,
16684
+ initialUserInput: s3
16685
+ }, false), s3 !== undefined && (this._cursor = s3.length), this.#s = t7.showSubmit ?? false, this.on("key", (r8, i8) => {
16686
+ if (i8?.name && o5.has(i8.name)) {
16687
+ this.#t = false, this.#i(i8.name);
16665
16688
  return;
16666
16689
  }
16667
- if (s3 === "\t" && this.#t) {
16690
+ if (r8 === "\t" && this.#s) {
16668
16691
  this.focused = this.focused === "editor" ? "submit" : "editor";
16669
16692
  return;
16670
16693
  }
16671
- if (r7?.name !== "return") {
16672
- if (this.#s = false, r7?.name === "backspace" && this.cursor > 0) {
16694
+ if (i8?.name !== "return") {
16695
+ if (this.#t = false, i8?.name === "backspace" && this.cursor > 0) {
16673
16696
  this._setUserInput(this.userInput.slice(0, this.cursor - 1) + this.userInput.slice(this.cursor)), this._cursor--;
16674
16697
  return;
16675
16698
  }
16676
- if (r7?.name === "delete" && this.cursor < this.userInput.length) {
16699
+ if (i8?.name === "delete" && this.cursor < this.userInput.length) {
16677
16700
  this._setUserInput(this.userInput.slice(0, this.cursor) + this.userInput.slice(this.cursor + 1));
16678
16701
  return;
16679
16702
  }
16680
- s3 && (this.#t && this.focused === "submit" && (this.focused = "editor"), this.#r(s3 ?? ""), this._cursor++);
16703
+ r8 && (this.#s && this.focused === "submit" && (this.focused = "editor"), this.#r(r8 ?? ""), this._cursor++);
16681
16704
  }
16682
- }), this.on("userInput", (s3) => {
16683
- this._setValue(s3);
16705
+ }), this.on("userInput", (r8) => {
16706
+ this._setValue(r8);
16684
16707
  }), this.on("finalize", () => {
16685
- this.value || (this.value = t6.defaultValue), this.value === undefined && (this.value = "");
16708
+ this.value || (this.value = t7.defaultValue), this.value === undefined && (this.value = "");
16686
16709
  });
16687
16710
  }
16688
16711
  };
16689
- a$1 = class a7 extends V2 {
16712
+ a7 = class a7 extends V2 {
16690
16713
  options;
16691
16714
  cursor = 0;
16692
16715
  get _value() {
16693
- return this.options[this.cursor].value;
16716
+ return this.options[this.cursor]?.value;
16694
16717
  }
16695
16718
  get _enabledOptions() {
16696
- return this.options.filter((e5) => e5.disabled !== true);
16719
+ return this.options.filter((e6) => e6.disabled !== true);
16697
16720
  }
16698
16721
  toggleAll() {
16699
- const e5 = this._enabledOptions, i8 = this.value !== undefined && this.value.length === e5.length;
16700
- this.value = i8 ? [] : e5.map((t6) => t6.value);
16722
+ const e6 = this._enabledOptions, i8 = this.value !== undefined && this.value.length === e6.length;
16723
+ this.value = i8 ? [] : e6.map((t7) => t7.value);
16701
16724
  }
16702
16725
  toggleInvert() {
16703
- const e5 = this.value;
16704
- if (!e5)
16726
+ const e6 = this.value;
16727
+ if (!e6)
16705
16728
  return;
16706
- const i8 = this._enabledOptions.filter((t6) => !e5.includes(t6.value));
16707
- this.value = i8.map((t6) => t6.value);
16729
+ const i8 = this._enabledOptions.filter((t7) => !e6.includes(t7.value));
16730
+ this.value = i8.map((t7) => t7.value);
16708
16731
  }
16709
16732
  toggleValue() {
16710
16733
  this.value === undefined && (this.value = []);
16711
- const e5 = this.value.includes(this._value);
16712
- this.value = e5 ? this.value.filter((i8) => i8 !== this._value) : [...this.value, this._value];
16734
+ const e6 = this.value.includes(this._value);
16735
+ this.value = e6 ? this.value.filter((i8) => i8 !== this._value) : [...this.value, this._value];
16713
16736
  }
16714
- constructor(e5) {
16715
- super(e5, false), this.options = e5.options, this.value = [...e5.initialValues ?? []];
16716
- const i8 = Math.max(this.options.findIndex(({ value: t6 }) => t6 === e5.cursorAt), 0);
16717
- this.cursor = this.options[i8].disabled ? findCursor(i8, 1, this.options) : i8, this.on("key", (t6, l4) => {
16737
+ constructor(e6) {
16738
+ super(e6, false), this.options = e6.options, this.value = [...e6.initialValues ?? []];
16739
+ const i8 = Math.max(this.options.findIndex(({ value: t7 }) => t7 === e6.cursorAt), 0);
16740
+ this.cursor = this.options[i8]?.disabled ? findCursor(i8, 1, this.options) : i8, this.on("key", (t7, l4) => {
16718
16741
  l4.name === "a" && this.toggleAll(), l4.name === "i" && this.toggleInvert();
16719
- }), this.on("cursor", (t6) => {
16720
- switch (t6) {
16742
+ }), this.on("cursor", (t7) => {
16743
+ switch (t7) {
16721
16744
  case "left":
16722
16745
  case "up":
16723
16746
  this.cursor = findCursor(this.cursor, -1, this.options);
@@ -16733,7 +16756,7 @@ ${e5}` : `${s3}${styleText("inverse", r7)}${e5}`;
16733
16756
  });
16734
16757
  }
16735
16758
  };
16736
- o5 = class o5 extends V2 {
16759
+ u$1 = class u5 extends V2 {
16737
16760
  _mask = "\u2022";
16738
16761
  get cursor() {
16739
16762
  return this._cursor;
@@ -16744,34 +16767,37 @@ ${e5}` : `${s3}${styleText("inverse", r7)}${e5}`;
16744
16767
  get userInputWithCursor() {
16745
16768
  if (this.state === "submit" || this.state === "cancel")
16746
16769
  return this.masked;
16747
- const t6 = this.userInput;
16748
- if (this.cursor >= t6.length)
16770
+ const t7 = this.userInput;
16771
+ if (this.cursor >= t7.length)
16749
16772
  return `${this.masked}${styleText(["inverse", "hidden"], "_")}`;
16750
- const s3 = this.masked, r7 = s3.slice(0, this.cursor), e5 = s3.slice(this.cursor);
16751
- return `${r7}${styleText("inverse", e5[0])}${e5.slice(1)}`;
16773
+ const s3 = this.masked, r8 = s3.slice(0, this.cursor), i8 = s3.slice(this.cursor, this.cursor + 1), o6 = s3.slice(this.cursor + 1);
16774
+ return `${r8}${styleText("inverse", i8)}${o6}`;
16752
16775
  }
16753
16776
  clear() {
16754
16777
  this._clearUserInput();
16755
16778
  }
16756
- constructor({ mask: t6, ...s3 }) {
16757
- super(s3), this._mask = t6 ?? "\u2022", this.on("userInput", (r7) => {
16758
- this._setValue(r7);
16779
+ constructor({ mask: t7, ...s3 }) {
16780
+ super(s3), this._mask = t7 ?? "\u2022", this.on("userInput", (r8) => {
16781
+ this._setValue(r8);
16782
+ }), this.on("finalize", () => {
16783
+ this.value === undefined && (this.value = "");
16759
16784
  });
16760
16785
  }
16761
16786
  };
16762
- a8 = class a8 extends V2 {
16787
+ n$1 = class n6 extends V2 {
16763
16788
  options;
16764
16789
  cursor = 0;
16765
16790
  get _selectedValue() {
16766
16791
  return this.options[this.cursor];
16767
16792
  }
16768
16793
  changeValue() {
16769
- this.value = this._selectedValue.value;
16794
+ const e6 = this._selectedValue;
16795
+ this.value = e6 === undefined ? undefined : e6.value;
16770
16796
  }
16771
- constructor(t6) {
16772
- super(t6, false), this.options = t6.options;
16773
- const i8 = this.options.findIndex(({ value: s3 }) => s3 === t6.initialValue), e5 = i8 === -1 ? 0 : i8;
16774
- this.cursor = this.options[e5].disabled ? findCursor(e5, 1, this.options) : e5, this.changeValue(), this.on("cursor", (s3) => {
16797
+ constructor(e6) {
16798
+ super(e6, false), this.options = e6.options;
16799
+ const o6 = this.options.findIndex(({ value: s3 }) => s3 === e6.initialValue), t7 = o6 === -1 ? 0 : o6;
16800
+ this.cursor = this.options[t7]?.disabled ? findCursor(t7, 1, this.options) : t7, this.changeValue(), this.on("cursor", (s3) => {
16775
16801
  switch (s3) {
16776
16802
  case "left":
16777
16803
  case "up":
@@ -16786,44 +16812,44 @@ ${e5}` : `${s3}${styleText("inverse", r7)}${e5}`;
16786
16812
  });
16787
16813
  }
16788
16814
  };
16789
- u4 = class u4 extends V2 {
16815
+ u6 = class u6 extends V2 {
16790
16816
  options;
16791
16817
  cursor = 0;
16792
- constructor(t6) {
16793
- super(t6, false), this.options = t6.options;
16794
- const s3 = t6.caseSensitive === true, i8 = this.options.map(({ value: [e5] }) => s3 ? e5 : e5?.toLowerCase());
16795
- this.cursor = Math.max(i8.indexOf(t6.initialValue), 0), this.on("key", (e5) => {
16796
- if (!e5)
16818
+ constructor(t7) {
16819
+ super(t7, false), this.options = t7.options;
16820
+ const s3 = t7.caseSensitive === true, i8 = this.options.map(({ value: [e6] }) => s3 ? e6 : e6?.toLowerCase());
16821
+ this.cursor = Math.max(i8.indexOf(t7.initialValue), 0), this.on("key", (e6) => {
16822
+ if (!e6)
16797
16823
  return;
16798
- const o6 = s3 ? e5 : e5.toLowerCase();
16824
+ const o6 = s3 ? e6 : e6.toLowerCase();
16799
16825
  if (!i8.includes(o6))
16800
16826
  return;
16801
- const n5 = this.options.find(({ value: [r7] }) => s3 ? r7 === o6 : r7?.toLowerCase() === o6);
16802
- n5 && (this.value = n5.value, this.state = "submit", this.emit("submit"));
16827
+ const n7 = this.options.find(({ value: [r8] }) => s3 ? r8 === o6 : r8?.toLowerCase() === o6);
16828
+ n7 && (this.value = n7.value, this.state = "submit", this.emit("submit"));
16803
16829
  });
16804
16830
  }
16805
16831
  };
16806
- n5 = class n5 extends V2 {
16832
+ n7 = class n7 extends V2 {
16807
16833
  get userInputWithCursor() {
16808
16834
  if (this.state === "submit")
16809
16835
  return this.userInput;
16810
- const t6 = this.userInput;
16811
- if (this.cursor >= t6.length)
16836
+ const t7 = this.userInput;
16837
+ if (this.cursor >= t7.length)
16812
16838
  return `${this.userInput}\u2588`;
16813
- const e5 = t6.slice(0, this.cursor), [s3, ...r7] = t6.slice(this.cursor);
16814
- return `${e5}${styleText("inverse", s3)}${r7.join("")}`;
16839
+ const r8 = t7.slice(0, this.cursor), s3 = t7.slice(this.cursor, this.cursor + 1), e6 = t7.slice(this.cursor + 1);
16840
+ return `${r8}${styleText("inverse", s3)}${e6}`;
16815
16841
  }
16816
16842
  get cursor() {
16817
16843
  return this._cursor;
16818
16844
  }
16819
- constructor(t6) {
16845
+ constructor(t7) {
16820
16846
  super({
16821
- ...t6,
16822
- initialUserInput: t6.initialUserInput ?? t6.initialValue
16823
- }), this.on("userInput", (e5) => {
16824
- this._setValue(e5);
16847
+ ...t7,
16848
+ initialUserInput: t7.initialUserInput ?? t7.initialValue
16849
+ }), this.on("userInput", (r8) => {
16850
+ this._setValue(r8);
16825
16851
  }), this.on("finalize", () => {
16826
- this.value || (this.value = t6.defaultValue), this.value === undefined && (this.value = "");
16852
+ this.value || (this.value = t7.defaultValue), this.value === undefined && (this.value = "");
16827
16853
  });
16828
16854
  }
16829
16855
  };
@@ -16860,6 +16886,7 @@ __export(exports_dist, {
16860
16886
  intro: () => intro,
16861
16887
  groupMultiselect: () => groupMultiselect,
16862
16888
  group: () => group,
16889
+ formatInstructionFooter: () => formatInstructionFooter,
16863
16890
  date: () => date5,
16864
16891
  confirm: () => confirm,
16865
16892
  cancel: () => cancel,
@@ -16890,7 +16917,9 @@ __export(exports_dist, {
16890
16917
  S_BAR_H: () => S_BAR_H,
16891
16918
  S_BAR_END_RIGHT: () => S_BAR_END_RIGHT,
16892
16919
  S_BAR_END: () => S_BAR_END,
16893
- S_BAR: () => S_BAR
16920
+ S_BAR: () => S_BAR,
16921
+ SELECT_INSTRUCTIONS: () => SELECT_INSTRUCTIONS,
16922
+ MULTISELECT_INSTRUCTIONS: () => MULTISELECT_INSTRUCTIONS
16894
16923
  });
16895
16924
  import { styleText as styleText2, stripVTControlCharacters } from "util";
16896
16925
  import process$1 from "process";
@@ -16902,38 +16931,42 @@ function isUnicodeSupported() {
16902
16931
  }
16903
16932
  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";
16904
16933
  }
16905
- function P3(t6) {
16906
- return t6.label ?? String(t6.value ?? "");
16934
+ function formatInstructionFooter(o6, e6) {
16935
+ const r8 = [`${e6 ? `${styleText2("cyan", S_BAR)} ` : ""}${o6.join(" \u2022 ")}`];
16936
+ return e6 && r8.push(styleText2("cyan", S_BAR_END)), r8;
16907
16937
  }
16908
- function E2(t6, c4) {
16909
- if (!t6)
16938
+ function P3(t7) {
16939
+ return t7.label ?? String(t7.value ?? "");
16940
+ }
16941
+ function E2(t7, c4) {
16942
+ if (!t7)
16910
16943
  return true;
16911
- const n6 = (c4.label ?? String(c4.value ?? "")).toLowerCase(), i8 = (c4.hint ?? "").toLowerCase(), l4 = String(c4.value).toLowerCase(), o6 = t6.toLowerCase();
16912
- return n6.includes(o6) || i8.includes(o6) || l4.includes(o6);
16944
+ const n8 = (c4.label ?? String(c4.value ?? "")).toLowerCase(), i8 = (c4.hint ?? "").toLowerCase(), l4 = String(c4.value).toLowerCase(), o6 = t7.toLowerCase();
16945
+ return n8.includes(o6) || i8.includes(o6) || l4.includes(o6);
16913
16946
  }
16914
- function N2(t6, c4) {
16915
- const n6 = [];
16947
+ function N2(t7, c4) {
16948
+ const n8 = [];
16916
16949
  for (const i8 of c4)
16917
- t6.includes(i8.value) && n6.push(i8);
16918
- return n6;
16919
- }
16920
- function A$1(n6, e5, t6, o6) {
16921
- let i8 = t6, f5 = t6;
16922
- return o6 === "center" ? i8 = Math.floor((e5 - n6) / 2) : o6 === "right" && (i8 = e5 - n6 - t6), f5 = e5 - i8 - n6, [i8, f5];
16923
- }
16924
- function b4(e5, r7) {
16925
- const { segmentValues: t6, segmentCursor: o6 } = e5;
16926
- if (r7 === "submit" || r7 === "cancel")
16927
- return e5.formattedValue;
16928
- const i8 = styleText2("gray", e5.separator);
16929
- return e5.segments.map((l4, d4) => {
16930
- const c4 = d4 === o6.segmentIndex && !["submit", "cancel"].includes(r7), a9 = p5[l4.type];
16931
- return x3(t6[l4.type], { isActive: c4, label: a9 });
16950
+ t7.includes(i8.value) && n8.push(i8);
16951
+ return n8;
16952
+ }
16953
+ function A$1(n8, e6, t7, o6) {
16954
+ let i8 = t7, f5 = t7;
16955
+ return o6 === "center" ? i8 = Math.floor((e6 - n8) / 2) : o6 === "right" && (i8 = e6 - n8 - t7), f5 = e6 - i8 - n8, [i8, f5];
16956
+ }
16957
+ function b4(e6, r8) {
16958
+ const { segmentValues: t7, segmentCursor: o6 } = e6;
16959
+ if (r8 === "submit" || r8 === "cancel")
16960
+ return e6.formattedValue;
16961
+ const i8 = styleText2("gray", e6.separator);
16962
+ return e6.segments.map((l4, d5) => {
16963
+ const c4 = d5 === o6.segmentIndex && !["submit", "cancel"].includes(r8), a8 = p5[l4.type];
16964
+ return x3(t7[l4.type], { isActive: c4, label: a8 });
16932
16965
  }).join(i8);
16933
16966
  }
16934
- function x3(e5, r7) {
16935
- const t6 = !e5 || e5.replace(/_/g, "") === "";
16936
- return r7.isActive ? styleText2("inverse", t6 ? r7.label : e5.replace(/_/g, " ")) : t6 ? styleText2("dim", r7.label) : e5.replace(/_/g, styleText2("dim", " "));
16967
+ function x3(e6, r8) {
16968
+ const t7 = !e6 || e6.replace(/_/g, "") === "";
16969
+ return r8.isActive ? styleText2("inverse", t7 ? r8.label : e6.replace(/_/g, " ")) : t7 ? styleText2("dim", r8.label) : e6.replace(/_/g, styleText2("dim", " "));
16937
16970
  }
16938
16971
  function progress({
16939
16972
  style: o6 = "heavy",
@@ -16941,42 +16974,42 @@ function progress({
16941
16974
  size: v3 = 40,
16942
16975
  ...x4
16943
16976
  } = {}) {
16944
- const r7 = spinner(x4);
16945
- let a9 = 0, n6 = "";
16946
- const c4 = Math.max(1, d5), l4 = Math.max(1, v3), S3 = (t6) => {
16947
- switch (t6) {
16977
+ const r8 = spinner(x4);
16978
+ let a8 = 0, n8 = "";
16979
+ const c4 = Math.max(1, d5), l4 = Math.max(1, v3), S3 = (t7) => {
16980
+ switch (t7) {
16948
16981
  case "initial":
16949
16982
  case "active":
16950
- return (e5) => styleText2("magenta", e5);
16983
+ return (e6) => styleText2("magenta", e6);
16951
16984
  case "error":
16952
16985
  case "cancel":
16953
- return (e5) => styleText2("red", e5);
16986
+ return (e6) => styleText2("red", e6);
16954
16987
  case "submit":
16955
- return (e5) => styleText2("green", e5);
16988
+ return (e6) => styleText2("green", e6);
16956
16989
  default:
16957
- return (e5) => styleText2("magenta", e5);
16990
+ return (e6) => styleText2("magenta", e6);
16958
16991
  }
16959
- }, p6 = (t6, e5) => {
16960
- const m5 = Math.floor(a9 / c4 * l4);
16961
- return `${S3(t6)(u5[o6].repeat(m5))}${styleText2("dim", u5[o6].repeat(l4 - m5))} ${e5}`;
16962
- }, h5 = (t6 = "") => {
16963
- n6 = t6, r7.start(p6("initial", t6));
16964
- }, g4 = (t6 = 1, e5) => {
16965
- a9 = Math.min(c4, t6 + a9), r7.message(p6("active", e5 ?? n6)), n6 = e5 ?? n6;
16992
+ }, p6 = (t7, e6) => {
16993
+ const m6 = Math.floor(a8 / c4 * l4);
16994
+ return `${S3(t7)(u7[o6].repeat(m6))}${styleText2("dim", u7[o6].repeat(l4 - m6))} ${e6}`;
16995
+ }, h5 = (t7 = "") => {
16996
+ n8 = t7, r8.start(p6("initial", t7));
16997
+ }, g4 = (t7 = 1, e6) => {
16998
+ a8 = Math.min(c4, t7 + a8), r8.message(p6("active", e6 ?? n8)), n8 = e6 ?? n8;
16966
16999
  };
16967
17000
  return {
16968
17001
  start: h5,
16969
- stop: r7.stop,
16970
- cancel: r7.cancel,
16971
- error: r7.error,
16972
- clear: r7.clear,
17002
+ stop: r8.stop,
17003
+ cancel: r8.cancel,
17004
+ error: r8.error,
17005
+ clear: r8.clear,
16973
17006
  advance: g4,
16974
- isCancelled: r7.isCancelled,
16975
- message: (t6) => g4(0, t6)
17007
+ isCancelled: r8.isCancelled,
17008
+ message: (t7) => g4(0, t7)
16976
17009
  };
16977
17010
  }
16978
- var import_sisteransi2, unicode, isCI = () => process.env.CI === "true", isTTY = (e5) => e5.isTTY === true, unicodeOr = (e5, o6) => unicode ? e5 : o6, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_BAR_START, S_BAR, S_BAR_END, S_BAR_START_RIGHT, S_BAR_END_RIGHT, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_CHECKBOX_ACTIVE, S_CHECKBOX_SELECTED, S_CHECKBOX_INACTIVE, S_PASSWORD_MASK, S_BAR_H, S_CORNER_TOP_RIGHT, S_CONNECT_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_BOTTOM_LEFT, S_CORNER_TOP_LEFT, S_INFO, S_SUCCESS, S_WARN, S_ERROR, symbol2 = (e5) => {
16979
- switch (e5) {
17011
+ var import_sisteransi2, unicode, isCI = () => process.env.CI === "true", isTTY = (o6) => o6.isTTY === true, unicodeOr = (o6, e6) => unicode ? o6 : e6, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_BAR_START, S_BAR, S_BAR_END, S_BAR_START_RIGHT, S_BAR_END_RIGHT, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_CHECKBOX_ACTIVE, S_CHECKBOX_SELECTED, S_CHECKBOX_INACTIVE, S_PASSWORD_MASK, S_BAR_H, S_CORNER_TOP_RIGHT, S_CONNECT_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_BOTTOM_LEFT, S_CORNER_TOP_LEFT, S_INFO, S_SUCCESS, S_WARN, S_ERROR, symbol2 = (o6) => {
17012
+ switch (o6) {
16980
17013
  case "initial":
16981
17014
  case "active":
16982
17015
  return styleText2("cyan", S_STEP_ACTIVE);
@@ -16987,8 +17020,8 @@ var import_sisteransi2, unicode, isCI = () => process.env.CI === "true", isTTY =
16987
17020
  case "submit":
16988
17021
  return styleText2("green", S_STEP_SUBMIT);
16989
17022
  }
16990
- }, symbolBar = (e5) => {
16991
- switch (e5) {
17023
+ }, symbolBar = (o6) => {
17024
+ switch (o6) {
16992
17025
  case "initial":
16993
17026
  case "active":
16994
17027
  return styleText2("cyan", S_BAR);
@@ -16999,169 +17032,175 @@ var import_sisteransi2, unicode, isCI = () => process.env.CI === "true", isTTY =
16999
17032
  case "submit":
17000
17033
  return styleText2("green", S_BAR);
17001
17034
  }
17002
- }, E$1 = (l4, o6, g4, c4, h5, O2 = false) => {
17003
- let r7 = o6, w3 = 0;
17004
- if (O2)
17005
- for (let i8 = c4 - 1;i8 >= g4 && (r7 -= l4[i8].length, w3++, !(r7 <= h5)); i8--)
17006
- ;
17035
+ }, I2 = (l4, e6, w3, p5, b4, C4 = false) => {
17036
+ let r8 = e6, O2 = 0;
17037
+ if (C4)
17038
+ for (let i8 = p5 - 1;i8 >= w3; i8--) {
17039
+ const m5 = l4[i8];
17040
+ if (m5 && (r8 -= m5.length), O2++, r8 <= b4)
17041
+ break;
17042
+ }
17007
17043
  else
17008
- for (let i8 = g4;i8 < c4 && (r7 -= l4[i8].length, w3++, !(r7 <= h5)); i8++)
17009
- ;
17010
- return { lineCount: r7, removals: w3 };
17044
+ for (let i8 = w3;i8 < p5; i8++) {
17045
+ const m5 = l4[i8];
17046
+ if (m5 && (r8 -= m5.length), O2++, r8 <= b4)
17047
+ break;
17048
+ }
17049
+ return { lineCount: r8, removals: O2 };
17011
17050
  }, limitOptions = ({
17012
17051
  cursor: l4,
17013
- options: o6,
17014
- style: g4,
17015
- output: c4 = process.stdout,
17016
- maxItems: h5 = Number.POSITIVE_INFINITY,
17017
- columnPadding: O2 = 0,
17018
- rowPadding: r7 = 4
17052
+ options: e6,
17053
+ style: w3,
17054
+ output: p5 = process.stdout,
17055
+ maxItems: b4 = Number.POSITIVE_INFINITY,
17056
+ columnPadding: C4 = 0,
17057
+ rowPadding: r8 = 4
17019
17058
  }) => {
17020
- const i8 = getColumns(c4) - O2, I2 = getRows(c4), C4 = styleText2("dim", "..."), x3 = Math.max(I2 - r7, 0), m5 = Math.max(Math.min(h5, x3), 5);
17021
- let p5 = 0;
17022
- l4 >= m5 - 3 && (p5 = Math.max(Math.min(l4 - m5 + 3, o6.length - m5), 0));
17023
- let f5 = m5 < o6.length && p5 > 0, u5 = m5 < o6.length && p5 + m5 < o6.length;
17024
- const W2 = Math.min(p5 + m5, o6.length), e5 = [];
17025
- let d4 = 0;
17026
- f5 && d4++, u5 && d4++;
17027
- const v3 = p5 + (f5 ? 1 : 0), P3 = W2 - (u5 ? 1 : 0);
17028
- for (let t6 = v3;t6 < P3; t6++) {
17029
- const n6 = wrapAnsi(g4(o6[t6], t6 === l4), i8, {
17059
+ const i8 = getColumns(p5) - C4, m5 = getRows(p5), M3 = styleText2("dim", "..."), v3 = Math.max(m5 - r8, 0), a8 = Math.max(Math.min(b4, v3), 5);
17060
+ let f5 = 0;
17061
+ l4 >= a8 - 3 && (f5 = Math.max(Math.min(l4 - a8 + 3, e6.length - a8), 0));
17062
+ let d5 = a8 < e6.length && f5 > 0, c4 = a8 < e6.length && f5 + a8 < e6.length;
17063
+ const W2 = Math.min(f5 + a8, e6.length), s3 = [];
17064
+ let g4 = 0;
17065
+ d5 && g4++, c4 && g4++;
17066
+ const T5 = f5 + (d5 ? 1 : 0), y3 = W2 - (c4 ? 1 : 0);
17067
+ for (let t7 = T5;t7 < y3; t7++) {
17068
+ const n8 = e6[t7], o6 = n8 ? w3(n8, t7 === l4) : "", h5 = wrapAnsi(o6, i8, {
17030
17069
  hard: true,
17031
17070
  trim: false
17032
17071
  }).split(`
17033
17072
  `);
17034
- e5.push(n6), d4 += n6.length;
17035
- }
17036
- if (d4 > x3) {
17037
- let t6 = 0, n6 = 0, s3 = d4;
17038
- const M3 = l4 - v3;
17039
- let a9 = x3;
17040
- const T5 = () => E$1(e5, s3, 0, M3, a9), L2 = () => E$1(e5, s3, M3 + 1, e5.length, a9, true);
17041
- f5 ? ({ lineCount: s3, removals: t6 } = T5(), s3 > a9 && (u5 || (a9 -= 1), { lineCount: s3, removals: n6 } = L2())) : (u5 || (a9 -= 1), { lineCount: s3, removals: n6 } = L2(), s3 > a9 && (a9 -= 1, { lineCount: s3, removals: t6 } = T5())), t6 > 0 && (f5 = true, e5.splice(0, t6)), n6 > 0 && (u5 = true, e5.splice(e5.length - n6, n6));
17042
- }
17043
- const b4 = [];
17044
- f5 && b4.push(C4);
17045
- for (const t6 of e5)
17046
- for (const n6 of t6)
17047
- b4.push(n6);
17048
- return u5 && b4.push(C4), b4;
17049
- }, autocomplete = (t6) => new T$1({
17050
- options: t6.options,
17051
- initialValue: t6.initialValue ? [t6.initialValue] : undefined,
17052
- initialUserInput: t6.initialUserInput,
17053
- placeholder: t6.placeholder,
17054
- filter: t6.filter ?? ((n6, i8) => E2(n6, i8)),
17055
- signal: t6.signal,
17056
- input: t6.input,
17057
- output: t6.output,
17058
- validate: t6.validate,
17073
+ s3.push(h5), g4 += h5.length;
17074
+ }
17075
+ if (g4 > v3) {
17076
+ let t7 = 0, n8 = 0, o6 = g4;
17077
+ const h5 = l4 - T5;
17078
+ let u7 = v3;
17079
+ const L2 = () => I2(s3, o6, 0, h5, u7), E2 = () => I2(s3, o6, h5 + 1, s3.length, u7, true);
17080
+ d5 ? ({ lineCount: o6, removals: t7 } = L2(), o6 > u7 && (c4 || (u7 -= 1), { lineCount: o6, removals: n8 } = E2())) : (c4 || (u7 -= 1), { lineCount: o6, removals: n8 } = E2(), o6 > u7 && (u7 -= 1, { lineCount: o6, removals: t7 } = L2())), t7 > 0 && (d5 = true, s3.splice(0, t7)), n8 > 0 && (c4 = true, s3.splice(s3.length - n8, n8));
17081
+ }
17082
+ const x3 = [];
17083
+ d5 && x3.push(M3);
17084
+ for (const t7 of s3)
17085
+ for (const n8 of t7)
17086
+ x3.push(n8);
17087
+ return c4 && x3.push(M3), x3;
17088
+ }, autocomplete = (t7) => new T$1({
17089
+ options: t7.options,
17090
+ initialValue: t7.initialValue ? [t7.initialValue] : undefined,
17091
+ initialUserInput: t7.initialUserInput,
17092
+ placeholder: t7.placeholder,
17093
+ filter: t7.filter ?? ((n8, i8) => E2(n8, i8)),
17094
+ signal: t7.signal,
17095
+ input: t7.input,
17096
+ output: t7.output,
17097
+ validate: t7.validate,
17059
17098
  render() {
17060
- const n6 = t6.withGuide ?? settings.withGuide, i8 = n6 ? [`${styleText2("gray", S_BAR)}`, `${symbol2(this.state)} ${t6.message}`] : [`${symbol2(this.state)} ${t6.message}`], l4 = this.userInput, o6 = this.options, m5 = t6.placeholder, p5 = l4 === "" && m5 !== undefined, $2 = (r7, s3) => {
17061
- const a9 = P3(r7), u5 = r7.hint && r7.value === this.focusedValue ? styleText2("dim", ` (${r7.hint})`) : "";
17099
+ const n8 = t7.withGuide ?? settings.withGuide, i8 = n8 ? [`${styleText2("gray", S_BAR)}`, `${symbol2(this.state)} ${t7.message}`] : [`${symbol2(this.state)} ${t7.message}`], l4 = this.userInput, o6 = this.options, m5 = t7.placeholder, p5 = l4 === "" && m5 !== undefined, $2 = (r8, s3) => {
17100
+ const a8 = P3(r8), u7 = r8.hint && r8.value === this.focusedValue ? styleText2("dim", ` (${r8.hint})`) : "";
17062
17101
  switch (s3) {
17063
17102
  case "active":
17064
- return `${styleText2("green", S_RADIO_ACTIVE)} ${a9}${u5}`;
17103
+ return `${styleText2("green", S_RADIO_ACTIVE)} ${a8}${u7}`;
17065
17104
  case "inactive":
17066
- return `${styleText2("dim", S_RADIO_INACTIVE)} ${styleText2("dim", a9)}`;
17105
+ return `${styleText2("dim", S_RADIO_INACTIVE)} ${styleText2("dim", a8)}`;
17067
17106
  case "disabled":
17068
- return `${styleText2("gray", S_RADIO_INACTIVE)} ${styleText2(["strikethrough", "gray"], a9)}`;
17107
+ return `${styleText2("gray", S_RADIO_INACTIVE)} ${styleText2(["strikethrough", "gray"], a8)}`;
17069
17108
  }
17070
17109
  };
17071
17110
  switch (this.state) {
17072
17111
  case "submit": {
17073
- const r7 = N2(this.selectedValues, o6), s3 = r7.length > 0 ? ` ${styleText2("dim", r7.map(P3).join(", "))}` : "", a9 = n6 ? styleText2("gray", S_BAR) : "";
17112
+ const r8 = N2(this.selectedValues, o6), s3 = r8.length > 0 ? ` ${styleText2("dim", r8.map(P3).join(", "))}` : "", a8 = n8 ? styleText2("gray", S_BAR) : "";
17074
17113
  return `${i8.join(`
17075
17114
  `)}
17076
- ${a9}${s3}`;
17115
+ ${a8}${s3}`;
17077
17116
  }
17078
17117
  case "cancel": {
17079
- const r7 = l4 ? ` ${styleText2(["strikethrough", "dim"], l4)}` : "", s3 = n6 ? styleText2("gray", S_BAR) : "";
17118
+ const r8 = l4 ? ` ${styleText2(["strikethrough", "dim"], l4)}` : "", s3 = n8 ? styleText2("gray", S_BAR) : "";
17080
17119
  return `${i8.join(`
17081
17120
  `)}
17082
- ${s3}${r7}`;
17121
+ ${s3}${r8}`;
17083
17122
  }
17084
17123
  default: {
17085
- const r7 = this.state === "error" ? "yellow" : "cyan", s3 = n6 ? `${styleText2(r7, S_BAR)} ` : "", a9 = n6 ? styleText2(r7, S_BAR_END) : "";
17086
- let u5 = "";
17124
+ const r8 = this.state === "error" ? "yellow" : "cyan", s3 = n8 ? `${styleText2(r8, S_BAR)} ` : "", a8 = n8 ? styleText2(r8, S_BAR_END) : "";
17125
+ let u7 = "";
17087
17126
  if (this.isNavigating || p5) {
17088
- const d4 = p5 ? m5 : l4;
17089
- u5 = d4 !== "" ? ` ${styleText2("dim", d4)}` : "";
17127
+ const d5 = p5 ? m5 : l4;
17128
+ u7 = d5 !== "" ? ` ${styleText2("dim", d5)}` : "";
17090
17129
  } else
17091
- u5 = ` ${this.userInputWithCursor}`;
17130
+ u7 = ` ${this.userInputWithCursor}`;
17092
17131
  const V3 = this.filteredOptions.length !== o6.length ? styleText2("dim", ` (${this.filteredOptions.length} match${this.filteredOptions.length === 1 ? "" : "es"})`) : "", y3 = this.filteredOptions.length === 0 && l4 ? [`${s3}${styleText2("yellow", "No matches found")}`] : [], b4 = this.state === "error" ? [`${s3}${styleText2("yellow", this.error)}`] : [];
17093
- n6 && i8.push(`${s3.trimEnd()}`), i8.push(`${s3}${styleText2("dim", "Search:")}${u5}${V3}`, ...y3, ...b4);
17132
+ n8 && i8.push(`${s3.trimEnd()}`), i8.push(`${s3}${styleText2("dim", "Search:")}${u7}${V3}`, ...y3, ...b4);
17094
17133
  const v3 = [
17095
17134
  `${styleText2("dim", "\u2191/\u2193")} to select`,
17096
17135
  `${styleText2("dim", "Enter:")} confirm`,
17097
17136
  `${styleText2("dim", "Type:")} to search`
17098
- ], g4 = [`${s3}${v3.join(" \u2022 ")}`, a9], O2 = this.filteredOptions.length === 0 ? [] : limitOptions({
17137
+ ], g4 = [`${s3}${v3.join(" \u2022 ")}`, a8], O2 = this.filteredOptions.length === 0 ? [] : limitOptions({
17099
17138
  cursor: this.cursor,
17100
17139
  options: this.filteredOptions,
17101
- columnPadding: n6 ? 3 : 0,
17140
+ columnPadding: n8 ? 3 : 0,
17102
17141
  rowPadding: i8.length + g4.length,
17103
- style: (d4, f5) => $2(d4, d4.disabled ? "disabled" : f5 ? "active" : "inactive"),
17104
- maxItems: t6.maxItems,
17105
- output: t6.output
17142
+ style: (d5, f5) => $2(d5, d5.disabled ? "disabled" : f5 ? "active" : "inactive"),
17143
+ maxItems: t7.maxItems,
17144
+ output: t7.output
17106
17145
  });
17107
17146
  return [
17108
17147
  ...i8,
17109
- ...O2.map((d4) => `${s3}${d4}`),
17148
+ ...O2.map((d5) => `${s3}${d5}`),
17110
17149
  ...g4
17111
17150
  ].join(`
17112
17151
  `);
17113
17152
  }
17114
17153
  }
17115
17154
  }
17116
- }).prompt(), autocompleteMultiselect = (t6) => {
17155
+ }).prompt(), autocompleteMultiselect = (t7) => {
17117
17156
  const c4 = (i8, l4, o6, m5) => {
17118
- const p5 = o6.includes(i8.value), $2 = i8.label ?? String(i8.value ?? ""), r7 = i8.hint && m5 !== undefined && i8.value === m5 ? styleText2("dim", ` (${i8.hint})`) : "", s3 = p5 ? styleText2("green", S_CHECKBOX_SELECTED) : styleText2("dim", S_CHECKBOX_INACTIVE);
17119
- return i8.disabled ? `${styleText2("gray", S_CHECKBOX_INACTIVE)} ${styleText2(["strikethrough", "gray"], $2)}` : l4 ? `${s3} ${$2}${r7}` : `${s3} ${styleText2("dim", $2)}`;
17120
- }, n6 = new T$1({
17121
- options: t6.options,
17157
+ const p5 = o6.includes(i8.value), $2 = i8.label ?? String(i8.value ?? ""), r8 = i8.hint && m5 !== undefined && i8.value === m5 ? styleText2("dim", ` (${i8.hint})`) : "", s3 = p5 ? styleText2("green", S_CHECKBOX_SELECTED) : styleText2("dim", S_CHECKBOX_INACTIVE);
17158
+ return i8.disabled ? `${styleText2("gray", S_CHECKBOX_INACTIVE)} ${styleText2(["strikethrough", "gray"], $2)}` : l4 ? `${s3} ${$2}${r8}` : `${s3} ${styleText2("dim", $2)}`;
17159
+ }, n8 = new T$1({
17160
+ options: t7.options,
17122
17161
  multiple: true,
17123
- placeholder: t6.placeholder,
17124
- filter: t6.filter ?? ((i8, l4) => E2(i8, l4)),
17162
+ placeholder: t7.placeholder,
17163
+ filter: t7.filter ?? ((i8, l4) => E2(i8, l4)),
17125
17164
  validate: () => {
17126
- if (t6.required && n6.selectedValues.length === 0)
17165
+ if (t7.required && n8.selectedValues.length === 0)
17127
17166
  return "Please select at least one item";
17128
17167
  },
17129
- initialValue: t6.initialValues,
17130
- signal: t6.signal,
17131
- input: t6.input,
17132
- output: t6.output,
17168
+ initialValue: t7.initialValues,
17169
+ signal: t7.signal,
17170
+ input: t7.input,
17171
+ output: t7.output,
17133
17172
  render() {
17134
- const i8 = t6.withGuide ?? settings.withGuide, l4 = `${i8 ? `${styleText2("gray", S_BAR)}
17135
- ` : ""}${symbol2(this.state)} ${t6.message}
17136
- `, o6 = this.userInput, m5 = t6.placeholder, p5 = o6 === "" && m5 !== undefined, $2 = this.isNavigating || p5 ? styleText2("dim", p5 ? m5 : o6) : this.userInputWithCursor, r7 = this.options, s3 = this.filteredOptions.length !== r7.length ? styleText2("dim", ` (${this.filteredOptions.length} match${this.filteredOptions.length === 1 ? "" : "es"})`) : "";
17173
+ const i8 = t7.withGuide ?? settings.withGuide, l4 = `${i8 ? `${styleText2("gray", S_BAR)}
17174
+ ` : ""}${symbol2(this.state)} ${t7.message}
17175
+ `, o6 = this.userInput, m5 = t7.placeholder, p5 = o6 === "" && m5 !== undefined, $2 = this.isNavigating || p5 ? styleText2("dim", p5 ? m5 : o6) : this.userInputWithCursor, r8 = this.options, s3 = this.filteredOptions.length !== r8.length ? styleText2("dim", ` (${this.filteredOptions.length} match${this.filteredOptions.length === 1 ? "" : "es"})`) : "";
17137
17176
  switch (this.state) {
17138
17177
  case "submit":
17139
17178
  return `${l4}${i8 ? `${styleText2("gray", S_BAR)} ` : ""}${styleText2("dim", `${this.selectedValues.length} items selected`)}`;
17140
17179
  case "cancel":
17141
17180
  return `${l4}${i8 ? `${styleText2("gray", S_BAR)} ` : ""}${styleText2(["strikethrough", "dim"], o6)}`;
17142
17181
  default: {
17143
- const a9 = this.state === "error" ? "yellow" : "cyan", u5 = i8 ? `${styleText2(a9, S_BAR)} ` : "", V3 = i8 ? styleText2(a9, S_BAR_END) : "", y3 = [
17182
+ const a8 = this.state === "error" ? "yellow" : "cyan", u7 = i8 ? `${styleText2(a8, S_BAR)} ` : "", V3 = i8 ? styleText2(a8, S_BAR_END) : "", y3 = [
17144
17183
  `${styleText2("dim", "\u2191/\u2193")} to navigate`,
17145
17184
  `${styleText2("dim", this.isNavigating ? "Space/Tab:" : "Tab:")} select`,
17146
17185
  `${styleText2("dim", "Enter:")} confirm`,
17147
17186
  `${styleText2("dim", "Type:")} to search`
17148
- ], b4 = this.filteredOptions.length === 0 && o6 ? [`${u5}${styleText2("yellow", "No matches found")}`] : [], v3 = this.state === "error" ? [`${u5}${styleText2("yellow", this.error)}`] : [], g4 = [
17149
- ...`${l4}${i8 ? styleText2(a9, S_BAR) : ""}`.split(`
17187
+ ], b4 = this.filteredOptions.length === 0 && o6 ? [`${u7}${styleText2("yellow", "No matches found")}`] : [], v3 = this.state === "error" ? [`${u7}${styleText2("yellow", this.error)}`] : [], g4 = [
17188
+ ...`${l4}${i8 ? styleText2(a8, S_BAR) : ""}`.split(`
17150
17189
  `),
17151
- `${u5}${styleText2("dim", "Search:")} ${$2}${s3}`,
17190
+ `${u7}${styleText2("dim", "Search:")} ${$2}${s3}`,
17152
17191
  ...b4,
17153
17192
  ...v3
17154
- ], O2 = [`${u5}${y3.join(" \u2022 ")}`, V3], d4 = limitOptions({
17193
+ ], O2 = [`${u7}${y3.join(" \u2022 ")}`, V3], d5 = limitOptions({
17155
17194
  cursor: this.cursor,
17156
17195
  options: this.filteredOptions,
17157
17196
  style: (f5, _4) => c4(f5, _4, this.selectedValues, this.focusedValue),
17158
- maxItems: t6.maxItems,
17159
- output: t6.output,
17197
+ maxItems: t7.maxItems,
17198
+ output: t7.output,
17160
17199
  rowPadding: g4.length + O2.length
17161
17200
  });
17162
17201
  return [
17163
17202
  ...g4,
17164
- ...d4.map((f5) => `${u5}${f5}`),
17203
+ ...d5.map((f5) => `${u7}${f5}`),
17165
17204
  ...O2
17166
17205
  ].join(`
17167
17206
  `);
@@ -17169,63 +17208,63 @@ ${s3}${r7}`;
17169
17208
  }
17170
17209
  }
17171
17210
  });
17172
- return n6.prompt();
17173
- }, J2, K2, Q2 = (n6) => n6, box = (n6 = "", e5 = "", t6) => {
17174
- const o6 = t6?.output ?? process.stdout, i8 = getColumns(o6), R3 = 1 * 2, u5 = t6?.titlePadding ?? 1, h5 = t6?.contentPadding ?? 2, w3 = t6?.width === undefined || t6.width === "auto" ? 1 : Math.min(1, t6.width), m5 = t6?.withGuide ?? settings.withGuide ? `${S_BAR} ` : "", b4 = t6?.formatBorder ?? Q2, a9 = ((t6?.rounded) ? J2 : K2).map(b4), _4 = b4(S_BAR_H), B2 = b4(S_BAR), p5 = dist_default2(m5), x3 = dist_default2(e5), O2 = i8 - p5;
17175
- let r7 = Math.floor(i8 * w3) - p5;
17176
- if (t6?.width === "auto") {
17177
- const c4 = n6.split(`
17211
+ return n8.prompt();
17212
+ }, J2, K2, Q2 = (n8) => n8, box = (n8 = "", e6 = "", t7) => {
17213
+ const o6 = t7?.output ?? process.stdout, i8 = getColumns(o6), R3 = 1 * 2, u7 = t7?.titlePadding ?? 1, h5 = t7?.contentPadding ?? 2, w3 = t7?.width === undefined || t7.width === "auto" ? 1 : Math.min(1, t7.width), m5 = t7?.withGuide ?? settings.withGuide ? `${S_BAR} ` : "", b4 = t7?.formatBorder ?? Q2, a8 = ((t7?.rounded) ? J2 : K2).map(b4), _4 = b4(S_BAR_H), B2 = b4(S_BAR), p5 = dist_default2(m5), x3 = dist_default2(e6), O2 = i8 - p5;
17214
+ let r8 = Math.floor(i8 * w3) - p5;
17215
+ if (t7?.width === "auto") {
17216
+ const c4 = n8.split(`
17178
17217
  `);
17179
- let s3 = x3 + u5 * 2;
17218
+ let s3 = x3 + u7 * 2;
17180
17219
  for (const G2 of c4) {
17181
17220
  const P4 = dist_default2(G2) + h5 * 2;
17182
17221
  P4 > s3 && (s3 = P4);
17183
17222
  }
17184
17223
  const g4 = s3 + R3;
17185
- g4 < r7 && (r7 = g4);
17224
+ g4 < r8 && (r8 = g4);
17186
17225
  }
17187
- r7 % 2 !== 0 && (r7 < O2 ? r7++ : r7--);
17188
- const d4 = r7 - R3, S3 = d4 - u5 * 2, T5 = x3 > S3 ? `${e5.slice(0, S3 - 3)}...` : e5, [y3, W2] = A$1(dist_default2(T5), d4, u5, t6?.titleAlign), L2 = wrapAnsi(n6, d4 - h5 * 2, {
17226
+ r8 % 2 !== 0 && (r8 < O2 ? r8++ : r8--);
17227
+ const d5 = r8 - R3, S3 = d5 - u7 * 2, T5 = x3 > S3 ? `${e6.slice(0, S3 - 3)}...` : e6, [y3, W2] = A$1(dist_default2(T5), d5, u7, t7?.titleAlign), L2 = wrapAnsi(n8, d5 - h5 * 2, {
17189
17228
  hard: true,
17190
17229
  trim: false
17191
17230
  });
17192
- o6.write(`${m5}${a9[0]}${_4.repeat(y3)}${T5}${_4.repeat(W2)}${a9[1]}
17231
+ o6.write(`${m5}${a8[0]}${_4.repeat(y3)}${T5}${_4.repeat(W2)}${a8[1]}
17193
17232
  `);
17194
17233
  const E3 = L2.split(`
17195
17234
  `);
17196
17235
  for (const c4 of E3) {
17197
- const [s3, g4] = A$1(dist_default2(c4), d4, h5, t6?.contentAlign);
17236
+ const [s3, g4] = A$1(dist_default2(c4), d5, h5, t7?.contentAlign);
17198
17237
  o6.write(`${m5}${B2}${" ".repeat(s3)}${c4}${" ".repeat(g4)}${B2}
17199
17238
  `);
17200
17239
  }
17201
- o6.write(`${m5}${a9[2]}${_4.repeat(d4)}${a9[3]}
17240
+ o6.write(`${m5}${a8[2]}${_4.repeat(d5)}${a8[3]}
17202
17241
  `);
17203
17242
  }, confirm = (i8) => {
17204
- const a9 = i8.active ?? "Yes", s3 = i8.inactive ?? "No";
17205
- return new r6({
17206
- active: a9,
17243
+ const a8 = i8.active ?? "Yes", s3 = i8.inactive ?? "No";
17244
+ return new r7({
17245
+ active: a8,
17207
17246
  inactive: s3,
17208
17247
  signal: i8.signal,
17209
17248
  input: i8.input,
17210
17249
  output: i8.output,
17211
17250
  initialValue: i8.initialValue ?? true,
17212
17251
  render() {
17213
- const e5 = i8.withGuide ?? settings.withGuide, u5 = `${symbol2(this.state)} `, l4 = e5 ? `${styleText2("gray", S_BAR)} ` : "", f5 = wrapTextWithPrefix(i8.output, i8.message, l4, u5), o6 = `${e5 ? `${styleText2("gray", S_BAR)}
17252
+ const e6 = i8.withGuide ?? settings.withGuide, u7 = `${symbol2(this.state)} `, l4 = e6 ? `${styleText2("gray", S_BAR)} ` : "", f5 = wrapTextWithPrefix(i8.output, i8.message, l4, u7), o6 = `${e6 ? `${styleText2("gray", S_BAR)}
17214
17253
  ` : ""}${f5}
17215
- `, c4 = this.value ? a9 : s3;
17254
+ `, c4 = this.value ? a8 : s3;
17216
17255
  switch (this.state) {
17217
17256
  case "submit": {
17218
- const r7 = e5 ? `${styleText2("gray", S_BAR)} ` : "";
17219
- return `${o6}${r7}${styleText2("dim", c4)}`;
17257
+ const r8 = e6 ? `${styleText2("gray", S_BAR)} ` : "";
17258
+ return `${o6}${r8}${styleText2("dim", c4)}`;
17220
17259
  }
17221
17260
  case "cancel": {
17222
- const r7 = e5 ? `${styleText2("gray", S_BAR)} ` : "";
17223
- return `${o6}${r7}${styleText2(["strikethrough", "dim"], c4)}${e5 ? `
17261
+ const r8 = e6 ? `${styleText2("gray", S_BAR)} ` : "";
17262
+ return `${o6}${r8}${styleText2(["strikethrough", "dim"], c4)}${e6 ? `
17224
17263
  ${styleText2("gray", S_BAR)}` : ""}`;
17225
17264
  }
17226
17265
  default: {
17227
- const r7 = e5 ? `${styleText2("cyan", S_BAR)} ` : "", g4 = e5 ? styleText2("cyan", S_BAR_END) : "";
17228
- return `${o6}${r7}${this.value ? `${styleText2("green", S_RADIO_ACTIVE)} ${a9}` : `${styleText2("dim", S_RADIO_INACTIVE)} ${styleText2("dim", a9)}`}${i8.vertical ? e5 ? `
17266
+ const r8 = e6 ? `${styleText2("cyan", S_BAR)} ` : "", g4 = e6 ? styleText2("cyan", S_BAR_END) : "";
17267
+ return `${o6}${r8}${this.value ? `${styleText2("green", S_RADIO_ACTIVE)} ${a8}` : `${styleText2("dim", S_RADIO_INACTIVE)} ${styleText2("dim", a8)}`}${i8.vertical ? e6 ? `
17229
17268
  ${styleText2("cyan", S_BAR)} ` : `
17230
17269
  ` : ` ${styleText2("dim", "/")} `}${this.value ? `${styleText2("dim", S_RADIO_INACTIVE)} ${styleText2("dim", s3)}` : `${styleText2("green", S_RADIO_ACTIVE)} ${s3}`}
17231
17270
  ${g4}
@@ -17234,377 +17273,379 @@ ${g4}
17234
17273
  }
17235
17274
  }
17236
17275
  }).prompt();
17237
- }, date5 = (e5) => {
17238
- const r7 = e5.validate;
17276
+ }, date5 = (e6) => {
17277
+ const r8 = e6.validate;
17239
17278
  return new U2({
17240
- ...e5,
17241
- validate(t6) {
17242
- if (t6 === undefined)
17243
- return e5.defaultValue !== undefined ? undefined : r7 ? runValidation(r7, t6) : settings.date.messages.required;
17279
+ ...e6,
17280
+ validate(t7) {
17281
+ if (t7 === undefined)
17282
+ return e6.defaultValue !== undefined ? undefined : r8 ? runValidation(r8, t7) : settings.date.messages.required;
17244
17283
  const o6 = (i8) => i8.toISOString().slice(0, 10);
17245
- if (e5.minDate && o6(t6) < o6(e5.minDate))
17246
- return settings.date.messages.afterMin(e5.minDate);
17247
- if (e5.maxDate && o6(t6) > o6(e5.maxDate))
17248
- return settings.date.messages.beforeMax(e5.maxDate);
17249
- if (r7)
17250
- return runValidation(r7, t6);
17284
+ if (e6.minDate && o6(t7) < o6(e6.minDate))
17285
+ return settings.date.messages.afterMin(e6.minDate);
17286
+ if (e6.maxDate && o6(t7) > o6(e6.maxDate))
17287
+ return settings.date.messages.beforeMax(e6.maxDate);
17288
+ if (r8)
17289
+ return runValidation(r8, t7);
17251
17290
  },
17252
17291
  render() {
17253
- const t6 = (e5?.withGuide ?? settings.withGuide) !== false, i8 = `${`${t6 ? `${styleText2("gray", S_BAR)}
17254
- ` : ""}${symbol2(this.state)} `}${e5.message}
17255
- `, l4 = this.state !== "initial" ? this.state : "active", d4 = b4(this, l4), c4 = this.value instanceof Date ? this.formattedValue : "";
17292
+ const t7 = (e6?.withGuide ?? settings.withGuide) !== false, i8 = `${`${t7 ? `${styleText2("gray", S_BAR)}
17293
+ ` : ""}${symbol2(this.state)} `}${e6.message}
17294
+ `, l4 = this.state !== "initial" ? this.state : "active", d5 = b4(this, l4), c4 = this.value instanceof Date ? this.formattedValue : "";
17256
17295
  switch (this.state) {
17257
17296
  case "error": {
17258
- const a9 = this.error ? ` ${styleText2("yellow", this.error)}` : "", s3 = t6 ? `${styleText2("yellow", S_BAR)} ` : "", f5 = t6 ? styleText2("yellow", S_BAR_END) : "";
17297
+ const a8 = this.error ? ` ${styleText2("yellow", this.error)}` : "", s3 = t7 ? `${styleText2("yellow", S_BAR)} ` : "", f5 = t7 ? styleText2("yellow", S_BAR_END) : "";
17259
17298
  return `${i8.trim()}
17260
- ${s3}${d4}
17261
- ${f5}${a9}
17299
+ ${s3}${d5}
17300
+ ${f5}${a8}
17262
17301
  `;
17263
17302
  }
17264
17303
  case "submit": {
17265
- const a9 = c4 ? ` ${styleText2("dim", c4)}` : "", s3 = t6 ? styleText2("gray", S_BAR) : "";
17266
- return `${i8}${s3}${a9}`;
17304
+ const a8 = c4 ? ` ${styleText2("dim", c4)}` : "", s3 = t7 ? styleText2("gray", S_BAR) : "";
17305
+ return `${i8}${s3}${a8}`;
17267
17306
  }
17268
17307
  case "cancel": {
17269
- const a9 = c4 ? ` ${styleText2(["strikethrough", "dim"], c4)}` : "", s3 = t6 ? styleText2("gray", S_BAR) : "";
17270
- return `${i8}${s3}${a9}${c4.trim() ? `
17308
+ const a8 = c4 ? ` ${styleText2(["strikethrough", "dim"], c4)}` : "", s3 = t7 ? styleText2("gray", S_BAR) : "";
17309
+ return `${i8}${s3}${a8}${c4.trim() ? `
17271
17310
  ${s3}` : ""}`;
17272
17311
  }
17273
17312
  default: {
17274
- const a9 = t6 ? `${styleText2("cyan", S_BAR)} ` : "", s3 = t6 ? styleText2("cyan", S_BAR_END) : "", f5 = t6 ? `${styleText2("cyan", S_BAR)} ` : "", g4 = this.inlineError ? `
17313
+ const a8 = t7 ? `${styleText2("cyan", S_BAR)} ` : "", s3 = t7 ? styleText2("cyan", S_BAR_END) : "", f5 = t7 ? `${styleText2("cyan", S_BAR)} ` : "", g4 = this.inlineError ? `
17275
17314
  ${f5}${styleText2("yellow", this.inlineError)}` : "";
17276
- return `${i8}${a9}${d4}${g4}
17315
+ return `${i8}${a8}${d5}${g4}
17277
17316
  ${s3}
17278
17317
  `;
17279
17318
  }
17280
17319
  }
17281
17320
  }
17282
17321
  }).prompt();
17283
- }, p5, group = async (o6, r7) => {
17284
- const t6 = {}, p6 = Object.keys(o6);
17285
- for (const e5 of p6) {
17286
- const i8 = o6[e5], n6 = await i8({ results: t6 })?.catch((a9) => {
17287
- throw a9;
17322
+ }, p5, group = async (o6, r8) => {
17323
+ const t7 = {}, p6 = Object.keys(o6);
17324
+ for (const e6 of p6) {
17325
+ const i8 = o6[e6], n8 = await i8({ results: t7 })?.catch((a8) => {
17326
+ throw a8;
17288
17327
  });
17289
- if (typeof r7?.onCancel == "function" && isCancel(n6)) {
17290
- t6[e5] = "canceled", r7.onCancel({ results: t6 });
17328
+ if (typeof r8?.onCancel == "function" && isCancel(n8)) {
17329
+ t7[e6] = "canceled", r8.onCancel({ results: t7 });
17291
17330
  continue;
17292
17331
  }
17293
- t6[e5] = n6;
17294
- }
17295
- return t6;
17296
- }, groupMultiselect = (u5) => {
17297
- const { selectableGroups: h5 = true, groupSpacing: x4 = 0 } = u5, m5 = (i8, l4, g4 = []) => {
17298
- const c4 = i8.label ?? String(i8.value), t6 = typeof i8.group == "string", s3 = t6 && (g4[g4.indexOf(i8) + 1] ?? { group: true }), o6 = t6 && s3 && s3.group === true;
17299
- let n6 = "", a9 = "";
17300
- t6 && (h5 ? (n6 = o6 ? `${S_BAR_END} ` : `${S_BAR} `, a9 = o6 ? " " : `${S_BAR} `) : n6 = " ");
17301
- let r7 = "";
17302
- if (x4 > 0 && !t6 && (r7 = `
17332
+ t7[e6] = n8;
17333
+ }
17334
+ return t7;
17335
+ }, MULTISELECT_INSTRUCTIONS, m5 = (i8, u7) => i8.split(`
17336
+ `).map((d5) => u7(d5)).join(`
17337
+ `), multiselect = (i8) => {
17338
+ const u7 = (t7, a8) => {
17339
+ const r8 = t7.label ?? String(t7.value);
17340
+ return a8 === "disabled" ? `${styleText2("gray", S_CHECKBOX_INACTIVE)} ${m5(r8, (o6) => styleText2(["strikethrough", "gray"], o6))}${t7.hint ? ` ${styleText2("dim", `(${t7.hint ?? "disabled"})`)}` : ""}` : a8 === "active" ? `${styleText2("cyan", S_CHECKBOX_ACTIVE)} ${r8}${t7.hint ? ` ${styleText2("dim", `(${t7.hint})`)}` : ""}` : a8 === "selected" ? `${styleText2("green", S_CHECKBOX_SELECTED)} ${m5(r8, (o6) => styleText2("dim", o6))}${t7.hint ? ` ${styleText2("dim", `(${t7.hint})`)}` : ""}` : a8 === "cancelled" ? `${m5(r8, (o6) => styleText2(["strikethrough", "dim"], o6))}` : a8 === "active-selected" ? `${styleText2("green", S_CHECKBOX_SELECTED)} ${r8}${t7.hint ? ` ${styleText2("dim", `(${t7.hint})`)}` : ""}` : a8 === "submitted" ? `${m5(r8, (o6) => styleText2("dim", o6))}` : `${styleText2("dim", S_CHECKBOX_INACTIVE)} ${m5(r8, (o6) => styleText2("dim", o6))}`;
17341
+ }, d5 = i8.required ?? true, v3 = i8.showInstructions ?? true;
17342
+ return new a7({
17343
+ options: i8.options,
17344
+ signal: i8.signal,
17345
+ input: i8.input,
17346
+ output: i8.output,
17347
+ initialValues: i8.initialValues,
17348
+ required: d5,
17349
+ cursorAt: i8.cursorAt,
17350
+ validate(t7) {
17351
+ if (d5 && (t7 === undefined || t7.length === 0))
17352
+ return `Please select at least one option.
17353
+ ${styleText2("reset", styleText2("dim", `Press ${styleText2(["gray", "bgWhite", "inverse"], " space ")} to select, ${styleText2("gray", styleText2("bgWhite", styleText2("inverse", " enter ")))} to submit`))}`;
17354
+ },
17355
+ render() {
17356
+ const t7 = i8.withGuide ?? settings.withGuide, a8 = wrapTextWithPrefix(i8.output, i8.message, t7 ? `${symbolBar(this.state)} ` : "", `${symbol2(this.state)} `), r8 = `${t7 ? `${styleText2("gray", S_BAR)}
17357
+ ` : ""}${a8}
17358
+ `, o6 = this.value ?? [], p6 = (n8, l4) => {
17359
+ if (n8.disabled)
17360
+ return u7(n8, "disabled");
17361
+ const s3 = o6.includes(n8.value);
17362
+ return l4 && s3 ? u7(n8, "active-selected") : s3 ? u7(n8, "selected") : u7(n8, l4 ? "active" : "inactive");
17363
+ };
17364
+ switch (this.state) {
17365
+ case "submit": {
17366
+ const n8 = this.options.filter(({ value: s3 }) => o6.includes(s3)).map((s3) => u7(s3, "submitted")).join(styleText2("dim", ", ")) || styleText2("dim", "none"), l4 = wrapTextWithPrefix(i8.output, n8, t7 ? `${styleText2("gray", S_BAR)} ` : "");
17367
+ return `${r8}${l4}`;
17368
+ }
17369
+ case "cancel": {
17370
+ const n8 = this.options.filter(({ value: s3 }) => o6.includes(s3)).map((s3) => u7(s3, "cancelled")).join(styleText2("dim", ", "));
17371
+ if (n8.trim() === "")
17372
+ return `${r8}${styleText2("gray", S_BAR)}`;
17373
+ const l4 = wrapTextWithPrefix(i8.output, n8, t7 ? `${styleText2("gray", S_BAR)} ` : "");
17374
+ return `${r8}${l4}${t7 ? `
17375
+ ${styleText2("gray", S_BAR)}` : ""}`;
17376
+ }
17377
+ case "error": {
17378
+ const n8 = t7 ? `${styleText2("yellow", S_BAR)} ` : "", l4 = this.error.split(`
17379
+ `).map(($2, C4) => C4 === 0 ? `${t7 ? `${styleText2("yellow", S_BAR_END)} ` : ""}${styleText2("yellow", $2)}` : ` ${$2}`).join(`
17380
+ `), s3 = r8.split(`
17381
+ `).length, h5 = l4.split(`
17382
+ `).length + 1;
17383
+ return `${r8}${n8}${limitOptions({
17384
+ output: i8.output,
17385
+ options: this.options,
17386
+ cursor: this.cursor,
17387
+ maxItems: i8.maxItems,
17388
+ columnPadding: n8.length,
17389
+ rowPadding: s3 + h5,
17390
+ style: p6
17391
+ }).join(`
17392
+ ${n8}`)}
17393
+ ${l4}
17394
+ `;
17395
+ }
17396
+ default: {
17397
+ const n8 = t7 ? `${styleText2("cyan", S_BAR)} ` : "", l4 = r8.split(`
17398
+ `).length, s3 = v3 ? formatInstructionFooter(MULTISELECT_INSTRUCTIONS, t7) : t7 ? [styleText2("cyan", S_BAR_END)] : [], h5 = s3.join(`
17399
+ `), $2 = s3.length + 1;
17400
+ return `${r8}${n8}${limitOptions({
17401
+ output: i8.output,
17402
+ options: this.options,
17403
+ cursor: this.cursor,
17404
+ maxItems: i8.maxItems,
17405
+ columnPadding: n8.length,
17406
+ rowPadding: l4 + $2,
17407
+ style: p6
17408
+ }).join(`
17409
+ ${n8}`)}
17410
+ ${h5}
17411
+ `;
17412
+ }
17413
+ }
17414
+ }
17415
+ }).prompt();
17416
+ }, groupMultiselect = (o6) => {
17417
+ const { selectableGroups: h5 = true, groupSpacing: x4 = 0 } = o6, m6 = (n8, l4, g4 = []) => {
17418
+ const a8 = n8.label ?? String(n8.value), t7 = typeof n8.group == "string", s3 = t7 && (g4[g4.indexOf(n8) + 1] ?? { group: true }), u7 = t7 && s3 && s3.group === true;
17419
+ let r8 = "", c4 = "";
17420
+ t7 && (h5 ? (r8 = u7 ? `${S_BAR_END} ` : `${S_BAR} `, c4 = u7 ? " " : `${S_BAR} `) : r8 = " ");
17421
+ let i8 = "";
17422
+ if (x4 > 0 && !t7 && (i8 = `
17303
17423
  `.repeat(x4)), l4 === "active")
17304
- return wrapTextWithPrefix(u5.output, `${c4}${i8.hint ? ` ${styleText2("dim", `(${i8.hint})`)}` : ""}`, `${r7}${styleText2("dim", n6)} `, `${r7}${styleText2("dim", n6)}${styleText2("cyan", S_CHECKBOX_ACTIVE)} `, `${r7}${styleText2("dim", a9)} `);
17424
+ return wrapTextWithPrefix(o6.output, `${a8}${n8.hint ? ` ${styleText2("dim", `(${n8.hint})`)}` : ""}`, `${i8}${styleText2("dim", r8)} `, `${i8}${styleText2("dim", r8)}${styleText2("cyan", S_CHECKBOX_ACTIVE)} `, `${i8}${styleText2("dim", c4)} `);
17305
17425
  if (l4 === "group-active")
17306
- return wrapTextWithPrefix(u5.output, c4, `${r7}${n6} `, `${r7}${n6}${styleText2("cyan", S_CHECKBOX_ACTIVE)} `, `${r7}${a9} `, (d4) => styleText2("dim", d4));
17426
+ return wrapTextWithPrefix(o6.output, a8, `${i8}${r8} `, `${i8}${r8}${styleText2("cyan", S_CHECKBOX_ACTIVE)} `, `${i8}${c4} `, (d5) => styleText2("dim", d5));
17307
17427
  if (l4 === "group-active-selected")
17308
- return wrapTextWithPrefix(u5.output, c4, `${r7}${n6} `, `${r7}${n6}${styleText2("green", S_CHECKBOX_SELECTED)} `, `${r7}${a9} `, (d4) => styleText2("dim", d4));
17428
+ return wrapTextWithPrefix(o6.output, a8, `${i8}${r8} `, `${i8}${r8}${styleText2("green", S_CHECKBOX_SELECTED)} `, `${i8}${c4} `, (d5) => styleText2("dim", d5));
17309
17429
  if (l4 === "selected") {
17310
- const d4 = t6 || h5 ? styleText2("green", S_CHECKBOX_SELECTED) : "";
17311
- return wrapTextWithPrefix(u5.output, `${c4}${i8.hint ? ` (${i8.hint})` : ""}`, `${r7}${styleText2("dim", n6)} `, `${r7}${styleText2("dim", n6)}${d4} `, `${r7}${styleText2("dim", a9)} `, (V3) => styleText2("dim", V3));
17430
+ const d5 = t7 || h5 ? styleText2("green", S_CHECKBOX_SELECTED) : "";
17431
+ return wrapTextWithPrefix(o6.output, `${a8}${n8.hint ? ` (${n8.hint})` : ""}`, `${i8}${styleText2("dim", r8)} `, `${i8}${styleText2("dim", r8)}${d5} `, `${i8}${styleText2("dim", c4)} `, (S3) => styleText2("dim", S3));
17312
17432
  }
17313
17433
  if (l4 === "cancelled")
17314
- return `${styleText2(["strikethrough", "dim"], c4)}`;
17434
+ return `${styleText2(["strikethrough", "dim"], a8)}`;
17315
17435
  if (l4 === "active-selected")
17316
- return wrapTextWithPrefix(u5.output, `${c4}${i8.hint ? ` ${styleText2("dim", `(${i8.hint})`)}` : ""}`, `${r7}${styleText2("dim", n6)} `, `${r7}${styleText2("dim", n6)}${styleText2("green", S_CHECKBOX_SELECTED)} `, `${r7}${styleText2("dim", a9)} `);
17436
+ return wrapTextWithPrefix(o6.output, `${a8}${n8.hint ? ` ${styleText2("dim", `(${n8.hint})`)}` : ""}`, `${i8}${styleText2("dim", r8)} `, `${i8}${styleText2("dim", r8)}${styleText2("green", S_CHECKBOX_SELECTED)} `, `${i8}${styleText2("dim", c4)} `);
17317
17437
  if (l4 === "submitted")
17318
- return `${styleText2("dim", c4)}`;
17319
- const f5 = t6 || h5 ? styleText2("dim", S_CHECKBOX_INACTIVE) : "";
17320
- return wrapTextWithPrefix(u5.output, c4, `${r7}${styleText2("dim", n6)} `, `${r7}${styleText2("dim", n6)}${f5} `, `${r7}${styleText2("dim", a9)} `, (d4) => styleText2("dim", d4));
17321
- }, y3 = u5.required ?? true;
17322
- return new u$1({
17323
- options: u5.options,
17324
- signal: u5.signal,
17325
- input: u5.input,
17326
- output: u5.output,
17327
- initialValues: u5.initialValues,
17438
+ return `${styleText2("dim", a8)}`;
17439
+ const f5 = t7 || h5 ? styleText2("dim", S_CHECKBOX_INACTIVE) : "";
17440
+ return wrapTextWithPrefix(o6.output, a8, `${i8}${styleText2("dim", r8)} `, `${i8}${styleText2("dim", r8)}${f5} `, `${i8}${styleText2("dim", c4)} `, (d5) => styleText2("dim", d5));
17441
+ }, y3 = o6.required ?? true, I3 = o6.showInstructions ?? true;
17442
+ return new u$2({
17443
+ options: o6.options,
17444
+ signal: o6.signal,
17445
+ input: o6.input,
17446
+ output: o6.output,
17447
+ initialValues: o6.initialValues,
17328
17448
  required: y3,
17329
- cursorAt: u5.cursorAt,
17449
+ cursorAt: o6.cursorAt,
17330
17450
  selectableGroups: h5,
17331
- validate(i8) {
17332
- if (y3 && (i8 === undefined || i8.length === 0))
17451
+ validate(n8) {
17452
+ if (y3 && (n8 === undefined || n8.length === 0))
17333
17453
  return `Please select at least one option.
17334
17454
  ${styleText2("reset", styleText2("dim", `Press ${styleText2(["gray", "bgWhite", "inverse"], " space ")} to select, ${styleText2("gray", styleText2(["bgWhite", "inverse"], " enter "))} to submit`))}`;
17335
17455
  },
17336
17456
  render() {
17337
- const i8 = u5.withGuide ?? settings.withGuide, l4 = `${i8 ? `${styleText2("gray", S_BAR)}
17338
- ` : ""}${symbol2(this.state)} ${u5.message}
17339
- `, g4 = this.value ?? [], c4 = (t6, s3) => {
17340
- const o6 = this.options, n6 = g4.includes(t6.value) || t6.group === true && this.isGroupSelected(`${t6.value}`);
17341
- return !s3 && typeof t6.group == "string" && this.options[this.cursor].value === t6.group ? m5(t6, n6 ? "group-active-selected" : "group-active", o6) : s3 && n6 ? m5(t6, "active-selected", o6) : n6 ? m5(t6, "selected", o6) : m5(t6, s3 ? "active" : "inactive", o6);
17457
+ const n8 = o6.withGuide ?? settings.withGuide, l4 = `${n8 ? `${styleText2("gray", S_BAR)}
17458
+ ` : ""}${symbol2(this.state)} ${o6.message}
17459
+ `, g4 = this.value ?? [], a8 = (t7, s3) => {
17460
+ const u7 = this.options, r8 = g4.includes(t7.value) || t7.group === true && this.isGroupSelected(`${t7.value}`);
17461
+ return !s3 && typeof t7.group == "string" && this.options[this.cursor]?.value === t7.group ? m6(t7, r8 ? "group-active-selected" : "group-active", u7) : s3 && r8 ? m6(t7, "active-selected", u7) : r8 ? m6(t7, "selected", u7) : m6(t7, s3 ? "active" : "inactive", u7);
17342
17462
  };
17343
17463
  switch (this.state) {
17344
17464
  case "submit": {
17345
- const t6 = this.options.filter(({ value: o6 }) => g4.includes(o6)).map((o6) => m5(o6, "submitted")), s3 = t6.length === 0 ? "" : ` ${t6.join(styleText2("dim", ", "))}`;
17346
- return `${l4}${i8 ? styleText2("gray", S_BAR) : ""}${s3}`;
17465
+ const t7 = this.options.filter(({ value: u7 }) => g4.includes(u7)).map((u7) => m6(u7, "submitted")), s3 = t7.length === 0 ? "" : ` ${t7.join(styleText2("dim", ", "))}`;
17466
+ return `${l4}${n8 ? styleText2("gray", S_BAR) : ""}${s3}`;
17347
17467
  }
17348
17468
  case "cancel": {
17349
- const t6 = this.options.filter(({ value: s3 }) => g4.includes(s3)).map((s3) => m5(s3, "cancelled")).join(styleText2("dim", ", "));
17350
- return `${l4}${i8 ? `${styleText2("gray", S_BAR)} ` : ""}${t6.trim() ? `${t6}${i8 ? `
17469
+ const t7 = this.options.filter(({ value: s3 }) => g4.includes(s3)).map((s3) => m6(s3, "cancelled")).join(styleText2("dim", ", "));
17470
+ return `${l4}${n8 ? `${styleText2("gray", S_BAR)} ` : ""}${t7.trim() ? `${t7}${n8 ? `
17351
17471
  ${styleText2("gray", S_BAR)}` : ""}` : ""}`;
17352
17472
  }
17353
17473
  case "error": {
17354
- const t6 = i8 ? `${styleText2("yellow", S_BAR)} ` : "", s3 = this.error.split(`
17355
- `).map((r7, f5) => f5 === 0 ? `${i8 ? `${styleText2("yellow", S_BAR_END)} ` : ""}${styleText2("yellow", r7)}` : ` ${r7}`).join(`
17356
- `), o6 = l4.split(`
17357
- `).length, n6 = s3.split(`
17358
- `).length + 1, a9 = limitOptions({
17359
- output: u5.output,
17474
+ const t7 = n8 ? `${styleText2("yellow", S_BAR)} ` : "", s3 = this.error.split(`
17475
+ `).map((i8, f5) => f5 === 0 ? `${n8 ? `${styleText2("yellow", S_BAR_END)} ` : ""}${styleText2("yellow", i8)}` : ` ${i8}`).join(`
17476
+ `), u7 = l4.split(`
17477
+ `).length, r8 = s3.split(`
17478
+ `).length + 1, c4 = limitOptions({
17479
+ output: o6.output,
17360
17480
  options: this.options,
17361
17481
  cursor: this.cursor,
17362
- maxItems: u5.maxItems,
17363
- columnPadding: t6.length,
17364
- rowPadding: o6 + n6,
17365
- style: c4
17482
+ maxItems: o6.maxItems,
17483
+ columnPadding: t7.length,
17484
+ rowPadding: u7 + r8,
17485
+ style: a8
17366
17486
  }).join(`
17367
- ${t6}`);
17368
- return `${l4}${t6}${a9}
17487
+ ${t7}`);
17488
+ return `${l4}${t7}${c4}
17369
17489
  ${s3}
17370
17490
  `;
17371
17491
  }
17372
17492
  default: {
17373
- const t6 = i8 ? `${styleText2("cyan", S_BAR)} ` : "", s3 = l4.split(`
17374
- `).length, o6 = (i8 ? 1 : 0) + 1, n6 = limitOptions({
17375
- output: u5.output,
17493
+ const t7 = n8 ? `${styleText2("cyan", S_BAR)} ` : "", s3 = l4.split(`
17494
+ `).length, u7 = I3 ? formatInstructionFooter(MULTISELECT_INSTRUCTIONS, n8) : n8 ? [styleText2("cyan", S_BAR_END)] : [], r8 = u7.join(`
17495
+ `), c4 = u7.length + 1, i8 = limitOptions({
17496
+ output: o6.output,
17376
17497
  options: this.options,
17377
17498
  cursor: this.cursor,
17378
- maxItems: u5.maxItems,
17379
- columnPadding: t6.length,
17380
- rowPadding: s3 + o6,
17381
- style: c4
17499
+ maxItems: o6.maxItems,
17500
+ columnPadding: t7.length,
17501
+ rowPadding: s3 + c4,
17502
+ style: a8
17382
17503
  }).join(`
17383
- ${t6}`);
17384
- return `${l4}${t6}${n6}
17385
- ${i8 ? styleText2("cyan", S_BAR_END) : ""}
17504
+ ${t7}`);
17505
+ return `${l4}${t7}${i8}
17506
+ ${r8}
17386
17507
  `;
17387
17508
  }
17388
17509
  }
17389
17510
  }
17390
17511
  }).prompt();
17391
- }, log, cancel = (o6 = "", t6) => {
17392
- const i8 = t6?.output ?? process.stdout, e5 = t6?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_END)} ` : "";
17393
- i8.write(`${e5}${styleText2("red", o6)}
17512
+ }, log, cancel = (o6 = "", t7) => {
17513
+ const i8 = t7?.output ?? process.stdout, e6 = t7?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_END)} ` : "";
17514
+ i8.write(`${e6}${styleText2("red", o6)}
17394
17515
 
17395
17516
  `);
17396
- }, intro = (o6 = "", t6) => {
17397
- const i8 = t6?.output ?? process.stdout, e5 = t6?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_START)} ` : "";
17398
- i8.write(`${e5}${o6}
17517
+ }, intro = (o6 = "", t7) => {
17518
+ const i8 = t7?.output ?? process.stdout, e6 = t7?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_START)} ` : "";
17519
+ i8.write(`${e6}${o6}
17399
17520
  `);
17400
- }, outro = (o6 = "", t6) => {
17401
- const i8 = t6?.output ?? process.stdout, e5 = t6?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR)}
17521
+ }, outro = (o6 = "", t7) => {
17522
+ const i8 = t7?.output ?? process.stdout, e6 = t7?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR)}
17402
17523
  ${styleText2("gray", S_BAR_END)} ` : "";
17403
- i8.write(`${e5}${o6}
17524
+ i8.write(`${e6}${o6}
17404
17525
 
17405
17526
  `);
17406
- }, multiline = (e5) => new h4({
17407
- validate: e5.validate,
17408
- placeholder: e5.placeholder,
17409
- defaultValue: e5.defaultValue,
17410
- initialValue: e5.initialValue,
17411
- showSubmit: e5.showSubmit,
17412
- output: e5.output,
17413
- signal: e5.signal,
17414
- input: e5.input,
17527
+ }, multiline = (e6) => new h4({
17528
+ validate: e6.validate,
17529
+ placeholder: e6.placeholder,
17530
+ defaultValue: e6.defaultValue,
17531
+ initialValue: e6.initialValue,
17532
+ showSubmit: e6.showSubmit,
17533
+ output: e6.output,
17534
+ signal: e6.signal,
17535
+ input: e6.input,
17415
17536
  render() {
17416
- const i8 = e5?.withGuide ?? settings.withGuide, o6 = `${`${i8 ? `${styleText2("gray", S_BAR)}
17417
- ` : ""}${symbol2(this.state)} `}${e5.message}
17418
- `, h5 = e5.placeholder ? styleText2("inverse", e5.placeholder[0]) + styleText2("dim", e5.placeholder.slice(1)) : styleText2(["inverse", "hidden"], "_"), a9 = this.userInput ? this.userInputWithCursor : h5, s3 = this.value ?? "", c4 = e5.showSubmit ? `
17537
+ const i8 = e6?.withGuide ?? settings.withGuide, o6 = `${`${i8 ? `${styleText2("gray", S_BAR)}
17538
+ ` : ""}${symbol2(this.state)} `}${e6.message}
17539
+ `, m6 = e6.placeholder && e6.placeholder.length > 0 ? styleText2("inverse", e6.placeholder[0]) + styleText2("dim", e6.placeholder.slice(1)) : styleText2(["inverse", "hidden"], "_"), a8 = this.userInput ? this.userInputWithCursor : m6, l4 = this.value ?? "", c4 = e6.showSubmit ? `
17419
17540
  ${styleText2(this.focused === "submit" ? "cyan" : "dim", "[ submit ]")}` : "";
17420
17541
  switch (this.state) {
17421
17542
  case "error": {
17422
- const n6 = `${styleText2("yellow", S_BAR)} `, r7 = i8 ? wrapTextWithPrefix(e5.output, a9, n6, undefined) : a9, u5 = styleText2("yellow", S_BAR_END);
17423
- return `${o6}${r7}
17424
- ${u5} ${styleText2("yellow", this.error)}${c4}
17543
+ const n8 = `${styleText2("yellow", S_BAR)} `, r8 = i8 ? wrapTextWithPrefix(e6.output, a8, n8, undefined) : a8, u7 = styleText2("yellow", S_BAR_END);
17544
+ return `${o6}${r8}
17545
+ ${u7} ${styleText2("yellow", this.error)}${c4}
17425
17546
  `;
17426
17547
  }
17427
17548
  case "submit": {
17428
- const n6 = `${styleText2("gray", S_BAR)} `, r7 = i8 ? wrapTextWithPrefix(e5.output, s3, n6, undefined, undefined, (u5) => styleText2("dim", u5)) : s3 ? styleText2("dim", s3) : "";
17429
- return `${o6}${r7}`;
17549
+ const n8 = `${styleText2("gray", S_BAR)} `, r8 = i8 ? wrapTextWithPrefix(e6.output, l4, n8, undefined, undefined, (u7) => styleText2("dim", u7)) : l4 ? styleText2("dim", l4) : "";
17550
+ return `${o6}${r8}`;
17430
17551
  }
17431
17552
  case "cancel": {
17432
- const n6 = `${styleText2("gray", S_BAR)} `, r7 = i8 ? wrapTextWithPrefix(e5.output, s3, n6, undefined, undefined, (u5) => styleText2(["strikethrough", "dim"], u5)) : s3 ? styleText2(["strikethrough", "dim"], s3) : "";
17433
- return `${o6}${r7}`;
17553
+ const n8 = `${styleText2("gray", S_BAR)} `, r8 = i8 ? wrapTextWithPrefix(e6.output, l4, n8, undefined, undefined, (u7) => styleText2(["strikethrough", "dim"], u7)) : l4 ? styleText2(["strikethrough", "dim"], l4) : "";
17554
+ return `${o6}${r8}`;
17434
17555
  }
17435
17556
  default: {
17436
- const n6 = i8 ? `${styleText2("cyan", S_BAR)} ` : "", r7 = i8 ? styleText2("cyan", S_BAR_END) : "", u5 = i8 ? wrapTextWithPrefix(e5.output, a9, n6) : a9;
17437
- return `${o6}${u5}
17438
- ${r7}${c4}
17557
+ const n8 = i8 ? `${styleText2("cyan", S_BAR)} ` : "", r8 = i8 ? styleText2("cyan", S_BAR_END) : "", u7 = i8 ? wrapTextWithPrefix(e6.output, a8, n8) : a8;
17558
+ return `${o6}${u7}
17559
+ ${r8}${c4}
17439
17560
  `;
17440
17561
  }
17441
17562
  }
17442
17563
  }
17443
- }).prompt(), d4 = (n6, a9) => n6.split(`
17444
- `).map((m5) => a9(m5)).join(`
17445
- `), multiselect = (n6) => {
17446
- const a9 = (t6, o6) => {
17447
- const r7 = t6.label ?? String(t6.value);
17448
- return o6 === "disabled" ? `${styleText2("gray", S_CHECKBOX_INACTIVE)} ${d4(r7, (l4) => styleText2(["strikethrough", "gray"], l4))}${t6.hint ? ` ${styleText2("dim", `(${t6.hint ?? "disabled"})`)}` : ""}` : o6 === "active" ? `${styleText2("cyan", S_CHECKBOX_ACTIVE)} ${r7}${t6.hint ? ` ${styleText2("dim", `(${t6.hint})`)}` : ""}` : o6 === "selected" ? `${styleText2("green", S_CHECKBOX_SELECTED)} ${d4(r7, (l4) => styleText2("dim", l4))}${t6.hint ? ` ${styleText2("dim", `(${t6.hint})`)}` : ""}` : o6 === "cancelled" ? `${d4(r7, (l4) => styleText2(["strikethrough", "dim"], l4))}` : o6 === "active-selected" ? `${styleText2("green", S_CHECKBOX_SELECTED)} ${r7}${t6.hint ? ` ${styleText2("dim", `(${t6.hint})`)}` : ""}` : o6 === "submitted" ? `${d4(r7, (l4) => styleText2("dim", l4))}` : `${styleText2("dim", S_CHECKBOX_INACTIVE)} ${d4(r7, (l4) => styleText2("dim", l4))}`;
17449
- }, m5 = n6.required ?? true;
17450
- return new a$1({
17451
- options: n6.options,
17452
- signal: n6.signal,
17453
- input: n6.input,
17454
- output: n6.output,
17455
- initialValues: n6.initialValues,
17456
- required: m5,
17457
- cursorAt: n6.cursorAt,
17458
- validate(t6) {
17459
- if (m5 && (t6 === undefined || t6.length === 0))
17460
- return `Please select at least one option.
17461
- ${styleText2("reset", styleText2("dim", `Press ${styleText2(["gray", "bgWhite", "inverse"], " space ")} to select, ${styleText2("gray", styleText2("bgWhite", styleText2("inverse", " enter ")))} to submit`))}`;
17462
- },
17463
- render() {
17464
- const t6 = n6.withGuide ?? settings.withGuide, o6 = wrapTextWithPrefix(n6.output, n6.message, t6 ? `${symbolBar(this.state)} ` : "", `${symbol2(this.state)} `), r7 = `${t6 ? `${styleText2("gray", S_BAR)}
17465
- ` : ""}${o6}
17466
- `, l4 = this.value ?? [], g4 = (i8, u5) => {
17467
- if (i8.disabled)
17468
- return a9(i8, "disabled");
17469
- const s3 = l4.includes(i8.value);
17470
- return u5 && s3 ? a9(i8, "active-selected") : s3 ? a9(i8, "selected") : a9(i8, u5 ? "active" : "inactive");
17471
- };
17472
- switch (this.state) {
17473
- case "submit": {
17474
- const i8 = this.options.filter(({ value: s3 }) => l4.includes(s3)).map((s3) => a9(s3, "submitted")).join(styleText2("dim", ", ")) || styleText2("dim", "none"), u5 = wrapTextWithPrefix(n6.output, i8, t6 ? `${styleText2("gray", S_BAR)} ` : "");
17475
- return `${r7}${u5}`;
17476
- }
17477
- case "cancel": {
17478
- const i8 = this.options.filter(({ value: s3 }) => l4.includes(s3)).map((s3) => a9(s3, "cancelled")).join(styleText2("dim", ", "));
17479
- if (i8.trim() === "")
17480
- return `${r7}${styleText2("gray", S_BAR)}`;
17481
- const u5 = wrapTextWithPrefix(n6.output, i8, t6 ? `${styleText2("gray", S_BAR)} ` : "");
17482
- return `${r7}${u5}${t6 ? `
17483
- ${styleText2("gray", S_BAR)}` : ""}`;
17484
- }
17485
- case "error": {
17486
- const i8 = t6 ? `${styleText2("yellow", S_BAR)} ` : "", u5 = this.error.split(`
17487
- `).map((h5, x4) => x4 === 0 ? `${t6 ? `${styleText2("yellow", S_BAR_END)} ` : ""}${styleText2("yellow", h5)}` : ` ${h5}`).join(`
17488
- `), s3 = r7.split(`
17489
- `).length, v3 = u5.split(`
17490
- `).length + 1;
17491
- return `${r7}${i8}${limitOptions({
17492
- output: n6.output,
17493
- options: this.options,
17494
- cursor: this.cursor,
17495
- maxItems: n6.maxItems,
17496
- columnPadding: i8.length,
17497
- rowPadding: s3 + v3,
17498
- style: g4
17499
- }).join(`
17500
- ${i8}`)}
17501
- ${u5}
17502
- `;
17503
- }
17504
- default: {
17505
- const i8 = t6 ? `${styleText2("cyan", S_BAR)} ` : "", u5 = r7.split(`
17506
- `).length, s3 = t6 ? 2 : 1;
17507
- return `${r7}${i8}${limitOptions({
17508
- output: n6.output,
17509
- options: this.options,
17510
- cursor: this.cursor,
17511
- maxItems: n6.maxItems,
17512
- columnPadding: i8.length,
17513
- rowPadding: u5 + s3,
17514
- style: g4
17515
- }).join(`
17516
- ${i8}`)}
17517
- ${t6 ? styleText2("cyan", S_BAR_END) : ""}
17518
- `;
17519
- }
17520
- }
17521
- }
17522
- }).prompt();
17523
- }, W$1 = (o6) => styleText2("dim", o6), C4 = (o6, e5, s3) => {
17524
- const a9 = {
17564
+ }).prompt(), W$1 = (o6) => o6, C4 = (o6, e6, s3) => {
17565
+ const a8 = {
17525
17566
  hard: true,
17526
17567
  trim: false
17527
- }, i8 = wrapAnsi(o6, e5, a9).split(`
17528
- `), c4 = i8.reduce((n6, r7) => Math.max(dist_default2(r7), n6), 0), u5 = i8.map(s3).reduce((n6, r7) => Math.max(dist_default2(r7), n6), 0), g4 = e5 - (u5 - c4);
17529
- return wrapAnsi(o6, g4, a9);
17530
- }, note = (o6 = "", e5 = "", s3) => {
17531
- const a9 = s3?.output ?? process$1.stdout, i8 = s3?.withGuide ?? settings.withGuide, c4 = s3?.format ?? W$1, g4 = ["", ...C4(o6, getColumns(a9) - 6, c4).split(`
17532
- `).map(c4), ""], n6 = dist_default2(e5), r7 = Math.max(g4.reduce((m5, F3) => {
17568
+ }, i8 = wrapAnsi(o6, e6, a8).split(`
17569
+ `), c4 = i8.reduce((n8, t7) => Math.max(dist_default2(t7), n8), 0), u7 = i8.map(s3).reduce((n8, t7) => Math.max(dist_default2(t7), n8), 0), g4 = e6 - (u7 - c4);
17570
+ return wrapAnsi(o6, g4, a8);
17571
+ }, note = (o6 = "", e6 = "", s3) => {
17572
+ const a8 = s3?.output ?? process$1.stdout, i8 = s3?.withGuide ?? settings.withGuide, c4 = s3?.format ?? W$1, g4 = ["", ...C4(o6, getColumns(a8) - 6, c4).split(`
17573
+ `).map(c4), ""], n8 = dist_default2(e6), t7 = Math.max(g4.reduce((m6, F3) => {
17533
17574
  const O2 = dist_default2(F3);
17534
- return O2 > m5 ? O2 : m5;
17535
- }, 0), n6) + 2, h5 = g4.map((m5) => `${styleText2("gray", S_BAR)} ${m5}${" ".repeat(r7 - dist_default2(m5))}${styleText2("gray", S_BAR)}`).join(`
17575
+ return O2 > m6 ? O2 : m6;
17576
+ }, 0), n8) + 2, h5 = g4.map((m6) => `${styleText2("gray", S_BAR)} ${m6}${" ".repeat(t7 - dist_default2(m6))}${styleText2("gray", S_BAR)}`).join(`
17536
17577
  `), T5 = i8 ? `${styleText2("gray", S_BAR)}
17537
17578
  ` : "", l$1 = i8 ? S_CONNECT_LEFT : S_CORNER_BOTTOM_LEFT;
17538
- a9.write(`${T5}${styleText2("green", S_STEP_SUBMIT)} ${styleText2("reset", e5)} ${styleText2("gray", S_BAR_H.repeat(Math.max(r7 - n6 - 1, 1)) + S_CORNER_TOP_RIGHT)}
17579
+ a8.write(`${T5}${styleText2("green", S_STEP_SUBMIT)} ${styleText2("reset", e6)} ${styleText2("gray", S_BAR_H.repeat(Math.max(t7 - n8 - 1, 1)) + S_CORNER_TOP_RIGHT)}
17539
17580
  ${h5}
17540
- ${styleText2("gray", l$1 + S_BAR_H.repeat(r7 + 2) + S_CORNER_BOTTOM_RIGHT)}
17581
+ ${styleText2("gray", l$1 + S_BAR_H.repeat(t7 + 2) + S_CORNER_BOTTOM_RIGHT)}
17541
17582
  `);
17542
- }, password = (r7) => new o5({
17543
- validate: r7.validate,
17544
- mask: r7.mask ?? S_PASSWORD_MASK,
17545
- signal: r7.signal,
17546
- input: r7.input,
17547
- output: r7.output,
17583
+ }, password = (r8) => new u$1({
17584
+ validate: r8.validate,
17585
+ mask: r8.mask ?? S_PASSWORD_MASK,
17586
+ signal: r8.signal,
17587
+ input: r8.input,
17588
+ output: r8.output,
17548
17589
  render() {
17549
- const e5 = r7.withGuide ?? settings.withGuide, o6 = `${e5 ? `${styleText2("gray", S_BAR)}
17550
- ` : ""}${symbol2(this.state)} ${r7.message}
17590
+ const e6 = r8.withGuide ?? settings.withGuide, o6 = `${e6 ? `${styleText2("gray", S_BAR)}
17591
+ ` : ""}${symbol2(this.state)} ${r8.message}
17551
17592
  `, c4 = this.userInputWithCursor, i8 = this.masked;
17552
17593
  switch (this.state) {
17553
17594
  case "error": {
17554
- const s3 = e5 ? `${styleText2("yellow", S_BAR)} ` : "", n6 = e5 ? `${styleText2("yellow", S_BAR_END)} ` : "", l4 = i8 ?? "";
17555
- return r7.clearOnError && this.clear(), `${o6.trim()}
17595
+ const s3 = e6 ? `${styleText2("yellow", S_BAR)} ` : "", n8 = e6 ? `${styleText2("yellow", S_BAR_END)} ` : "", l4 = i8 ?? "";
17596
+ return r8.clearOnError && this.clear(), `${o6.trim()}
17556
17597
  ${s3}${l4}
17557
- ${n6}${styleText2("yellow", this.error)}
17598
+ ${n8}${styleText2("yellow", this.error)}
17558
17599
  `;
17559
17600
  }
17560
17601
  case "submit": {
17561
- const s3 = e5 ? `${styleText2("gray", S_BAR)} ` : "", n6 = i8 ? styleText2("dim", i8) : "";
17562
- return `${o6}${s3}${n6}`;
17602
+ const s3 = e6 ? `${styleText2("gray", S_BAR)} ` : "", n8 = i8 ? styleText2("dim", i8) : "";
17603
+ return `${o6}${s3}${n8}`;
17563
17604
  }
17564
17605
  case "cancel": {
17565
- const s3 = e5 ? `${styleText2("gray", S_BAR)} ` : "", n6 = i8 ? styleText2(["strikethrough", "dim"], i8) : "";
17566
- return `${o6}${s3}${n6}${i8 && e5 ? `
17606
+ const s3 = e6 ? `${styleText2("gray", S_BAR)} ` : "", n8 = i8 ? styleText2(["strikethrough", "dim"], i8) : "";
17607
+ return `${o6}${s3}${n8}${i8 && e6 ? `
17567
17608
  ${styleText2("gray", S_BAR)}` : ""}`;
17568
17609
  }
17569
17610
  default: {
17570
- const s3 = e5 ? `${styleText2("cyan", S_BAR)} ` : "", n6 = e5 ? styleText2("cyan", S_BAR_END) : "";
17611
+ const s3 = e6 ? `${styleText2("cyan", S_BAR)} ` : "", n8 = e6 ? styleText2("cyan", S_BAR_END) : "";
17571
17612
  return `${o6}${s3}${c4}
17572
- ${n6}
17613
+ ${n8}
17573
17614
  `;
17574
17615
  }
17575
17616
  }
17576
17617
  }
17577
- }).prompt(), path = (e5) => {
17578
- const a9 = e5.validate;
17618
+ }).prompt(), path = (e6) => {
17619
+ const a8 = e6.validate;
17579
17620
  return autocomplete({
17580
- ...e5,
17581
- initialUserInput: e5.initialValue ?? e5.root ?? process.cwd(),
17621
+ ...e6,
17622
+ initialUserInput: e6.initialValue ?? e6.root ?? process.cwd(),
17582
17623
  maxItems: 5,
17583
- validate(t6) {
17584
- if (!Array.isArray(t6)) {
17585
- if (!t6)
17624
+ validate(t7) {
17625
+ if (!Array.isArray(t7)) {
17626
+ if (!t7)
17586
17627
  return "Please select a path";
17587
- if (a9)
17588
- return runValidation(a9, t6);
17628
+ if (a8)
17629
+ return runValidation(a8, t7);
17589
17630
  }
17590
17631
  },
17591
17632
  options() {
17592
- const t6 = this.userInput;
17593
- if (t6 === "")
17633
+ const t7 = this.userInput;
17634
+ if (t7 === "")
17594
17635
  return [];
17595
17636
  try {
17596
17637
  let i8;
17597
- existsSync9(t6) ? lstatSync(t6).isDirectory() && (!e5.directory || t6.endsWith("/")) ? i8 = t6 : i8 = dirname6(t6) : i8 = dirname6(t6);
17598
- const c4 = t6.length > 1 && t6.endsWith("/") ? t6.slice(0, -1) : t6;
17599
- return readdirSync(i8).map((r7) => {
17600
- const n6 = join12(i8, r7), m5 = lstatSync(n6);
17638
+ existsSync9(t7) ? lstatSync(t7).isDirectory() && (!e6.directory || t7.endsWith("/")) ? i8 = t7 : i8 = dirname6(t7) : i8 = dirname6(t7);
17639
+ const c4 = t7.length > 1 && t7.endsWith("/") ? t7.slice(0, -1) : t7;
17640
+ return readdirSync(i8).map((r8) => {
17641
+ const n8 = join12(i8, r8), m6 = lstatSync(n8);
17601
17642
  return {
17602
- name: r7,
17603
- path: n6,
17604
- isDirectory: m5.isDirectory()
17643
+ name: r8,
17644
+ path: n8,
17645
+ isDirectory: m6.isDirectory()
17605
17646
  };
17606
- }).filter(({ path: r7, isDirectory: n6 }) => r7.startsWith(c4) && (n6 || !e5.directory)).map((r7) => ({
17607
- value: r7.path
17647
+ }).filter(({ path: r8, isDirectory: n8 }) => r8.startsWith(c4) && (n8 || !e6.directory)).map((r8) => ({
17648
+ value: r8.path
17608
17649
  }));
17609
17650
  } catch {
17610
17651
  return [];
@@ -17614,328 +17655,333 @@ ${n6}
17614
17655
  }, W2 = (l4) => styleText2("magenta", l4), spinner = ({
17615
17656
  indicator: l4 = "dots",
17616
17657
  onCancel: h5,
17617
- output: n6 = process.stdout,
17658
+ output: n8 = process.stdout,
17618
17659
  cancelMessage: G2,
17619
17660
  errorMessage: O2,
17620
17661
  frames: E3 = unicode ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"],
17621
17662
  delay: F3 = unicode ? 80 : 120,
17622
- signal: m5,
17623
- ...I2
17663
+ signal: m6,
17664
+ ...I3
17624
17665
  } = {}) => {
17625
- const u5 = isCI();
17666
+ const u7 = isCI();
17626
17667
  let M3, T5, d5 = false, S3 = false, s3 = "", p6, w3 = performance.now();
17627
- const x4 = getColumns(n6), k2 = I2?.styleFrame ?? W2, g4 = (e5) => {
17628
- const r7 = e5 > 1 ? O2 ?? settings.messages.error : G2 ?? settings.messages.cancel;
17629
- S3 = e5 === 1, d5 && (a9(r7, e5), S3 && typeof h5 == "function" && h5());
17668
+ const x4 = getColumns(n8), k2 = I3?.styleFrame ?? W2, g4 = (e6) => {
17669
+ const r8 = e6 > 1 ? O2 ?? settings.messages.error : G2 ?? settings.messages.cancel;
17670
+ S3 = e6 === 1, d5 && (a8(r8, e6), S3 && typeof h5 == "function" && h5());
17630
17671
  }, f5 = () => g4(2), i8 = () => g4(1), A2 = () => {
17631
- process.on("uncaughtExceptionMonitor", f5), process.on("unhandledRejection", f5), process.on("SIGINT", i8), process.on("SIGTERM", i8), process.on("exit", g4), m5 && m5.addEventListener("abort", i8);
17672
+ process.on("uncaughtExceptionMonitor", f5), process.on("unhandledRejection", f5), process.on("SIGINT", i8), process.on("SIGTERM", i8), process.on("exit", g4), m6 && m6.addEventListener("abort", i8);
17632
17673
  }, H2 = () => {
17633
- process.removeListener("uncaughtExceptionMonitor", f5), process.removeListener("unhandledRejection", f5), process.removeListener("SIGINT", i8), process.removeListener("SIGTERM", i8), process.removeListener("exit", g4), m5 && m5.removeEventListener("abort", i8);
17674
+ process.removeListener("uncaughtExceptionMonitor", f5), process.removeListener("unhandledRejection", f5), process.removeListener("SIGINT", i8), process.removeListener("SIGTERM", i8), process.removeListener("exit", g4), m6 && m6.removeEventListener("abort", i8);
17634
17675
  }, y3 = () => {
17635
17676
  if (p6 === undefined)
17636
17677
  return;
17637
- u5 && n6.write(`
17678
+ u7 && n8.write(`
17638
17679
  `);
17639
- const r7 = wrapAnsi(p6, x4, {
17680
+ const r8 = wrapAnsi(p6, x4, {
17640
17681
  hard: true,
17641
17682
  trim: false
17642
17683
  }).split(`
17643
17684
  `);
17644
- r7.length > 1 && n6.write(import_sisteransi2.cursor.up(r7.length - 1)), n6.write(import_sisteransi2.cursor.to(0)), n6.write(import_sisteransi2.erase.down());
17645
- }, C5 = (e5) => e5.replace(/\.+$/, ""), _4 = (e5) => {
17646
- const r7 = (performance.now() - e5) / 1000, t6 = Math.floor(r7 / 60), o6 = Math.floor(r7 % 60);
17647
- return t6 > 0 ? `[${t6}m ${o6}s]` : `[${o6}s]`;
17648
- }, N3 = I2.withGuide ?? settings.withGuide, P4 = (e5 = "") => {
17649
- d5 = true, M3 = block({ output: n6 }), s3 = C5(e5), w3 = performance.now(), N3 && n6.write(`${styleText2("gray", S_BAR)}
17685
+ r8.length > 1 && n8.write(import_sisteransi2.cursor.up(r8.length - 1)), n8.write(import_sisteransi2.cursor.to(0)), n8.write(import_sisteransi2.erase.down());
17686
+ }, C5 = (e6) => e6.replace(/\.+$/, ""), _4 = (e6) => {
17687
+ const r8 = (performance.now() - e6) / 1000, t7 = Math.floor(r8 / 60), o6 = Math.floor(r8 % 60);
17688
+ return t7 > 0 ? `[${t7}m ${o6}s]` : `[${o6}s]`;
17689
+ }, N3 = I3.withGuide ?? settings.withGuide, P4 = (e6 = "") => {
17690
+ d5 = true, M3 = block({ output: n8 }), s3 = C5(e6), w3 = performance.now(), N3 && n8.write(`${styleText2("gray", S_BAR)}
17650
17691
  `);
17651
- let r7 = 0, t6 = 0;
17692
+ let r8 = 0, t7 = 0;
17652
17693
  A2(), T5 = setInterval(() => {
17653
- if (u5 && s3 === p6)
17694
+ if (u7 && s3 === p6)
17654
17695
  return;
17655
17696
  y3(), p6 = s3;
17656
- const o6 = k2(E3[r7]);
17697
+ const o6 = k2(E3[r8]);
17657
17698
  let v3;
17658
- if (u5)
17699
+ if (u7)
17659
17700
  v3 = `${o6} ${s3}...`;
17660
17701
  else if (l4 === "timer")
17661
17702
  v3 = `${o6} ${s3} ${_4(w3)}`;
17662
17703
  else {
17663
- const B2 = ".".repeat(Math.floor(t6)).slice(0, 3);
17704
+ const B2 = ".".repeat(Math.floor(t7)).slice(0, 3);
17664
17705
  v3 = `${o6} ${s3}${B2}`;
17665
17706
  }
17666
17707
  const j2 = wrapAnsi(v3, x4, {
17667
17708
  hard: true,
17668
17709
  trim: false
17669
17710
  });
17670
- n6.write(j2), r7 = r7 + 1 < E3.length ? r7 + 1 : 0, t6 = t6 < 4 ? t6 + 0.125 : 0;
17711
+ n8.write(j2), r8 = r8 + 1 < E3.length ? r8 + 1 : 0, t7 = t7 < 4 ? t7 + 0.125 : 0;
17671
17712
  }, F3);
17672
- }, a9 = (e5 = "", r7 = 0, t6 = false) => {
17713
+ }, a8 = (e6 = "", r8 = 0, t7 = false) => {
17673
17714
  if (!d5)
17674
17715
  return;
17675
17716
  d5 = false, clearInterval(T5), y3();
17676
- const o6 = r7 === 0 ? styleText2("green", S_STEP_SUBMIT) : r7 === 1 ? styleText2("red", S_STEP_CANCEL) : styleText2("red", S_STEP_ERROR);
17677
- s3 = e5 ?? s3, t6 || (l4 === "timer" ? n6.write(`${o6} ${s3} ${_4(w3)}
17678
- `) : n6.write(`${o6} ${s3}
17717
+ const o6 = r8 === 0 ? styleText2("green", S_STEP_SUBMIT) : r8 === 1 ? styleText2("red", S_STEP_CANCEL) : styleText2("red", S_STEP_ERROR);
17718
+ s3 = e6 ?? s3, t7 || (l4 === "timer" ? n8.write(`${o6} ${s3} ${_4(w3)}
17719
+ `) : n8.write(`${o6} ${s3}
17679
17720
  `)), H2(), M3();
17680
17721
  };
17681
17722
  return {
17682
17723
  start: P4,
17683
- stop: (e5 = "") => a9(e5, 0),
17684
- message: (e5 = "") => {
17685
- s3 = C5(e5 ?? s3);
17724
+ stop: (e6 = "") => a8(e6, 0),
17725
+ message: (e6 = "") => {
17726
+ s3 = C5(e6 ?? s3);
17686
17727
  },
17687
- cancel: (e5 = "") => a9(e5, 1),
17688
- error: (e5 = "") => a9(e5, 2),
17689
- clear: () => a9("", 0, true),
17728
+ cancel: (e6 = "") => a8(e6, 1),
17729
+ error: (e6 = "") => a8(e6, 2),
17730
+ clear: () => a8("", 0, true),
17690
17731
  get isCancelled() {
17691
17732
  return S3;
17692
17733
  }
17693
17734
  };
17694
- }, u5, c4 = (e5, a9) => e5.includes(`
17695
- `) ? e5.split(`
17696
- `).map((t6) => a9(t6)).join(`
17697
- `) : a9(e5), select = (e5) => {
17698
- const a9 = (t6, d5) => {
17699
- const s3 = t6.label ?? String(t6.value);
17700
- switch (d5) {
17735
+ }, u7, SELECT_INSTRUCTIONS, c4 = (t7, o6) => t7.includes(`
17736
+ `) ? t7.split(`
17737
+ `).map((d5) => o6(d5)).join(`
17738
+ `) : o6(t7), select = (t7) => {
17739
+ const o6 = (n8, m6) => {
17740
+ if (n8 === undefined)
17741
+ return "";
17742
+ const s3 = n8.label ?? String(n8.value);
17743
+ switch (m6) {
17701
17744
  case "disabled":
17702
- return `${styleText2("gray", S_RADIO_INACTIVE)} ${c4(s3, (n6) => styleText2("gray", n6))}${t6.hint ? ` ${styleText2("dim", `(${t6.hint ?? "disabled"})`)}` : ""}`;
17745
+ return `${styleText2("gray", S_RADIO_INACTIVE)} ${c4(s3, (i8) => styleText2("gray", i8))}${n8.hint ? ` ${styleText2("dim", `(${n8.hint ?? "disabled"})`)}` : ""}`;
17703
17746
  case "selected":
17704
- return `${c4(s3, (n6) => styleText2("dim", n6))}`;
17747
+ return `${c4(s3, (i8) => styleText2("dim", i8))}`;
17705
17748
  case "active":
17706
- return `${styleText2("green", S_RADIO_ACTIVE)} ${s3}${t6.hint ? ` ${styleText2("dim", `(${t6.hint})`)}` : ""}`;
17749
+ return `${styleText2("green", S_RADIO_ACTIVE)} ${s3}${n8.hint ? ` ${styleText2("dim", `(${n8.hint})`)}` : ""}`;
17707
17750
  case "cancelled":
17708
- return `${c4(s3, (n6) => styleText2(["strikethrough", "dim"], n6))}`;
17751
+ return `${c4(s3, (i8) => styleText2(["strikethrough", "dim"], i8))}`;
17709
17752
  default:
17710
- return `${styleText2("dim", S_RADIO_INACTIVE)} ${c4(s3, (n6) => styleText2("dim", n6))}`;
17711
- }
17712
- };
17713
- return new a8({
17714
- options: e5.options,
17715
- signal: e5.signal,
17716
- input: e5.input,
17717
- output: e5.output,
17718
- initialValue: e5.initialValue,
17753
+ return `${styleText2("dim", S_RADIO_INACTIVE)} ${c4(s3, (i8) => styleText2("dim", i8))}`;
17754
+ }
17755
+ }, d5 = t7.showInstructions ?? true;
17756
+ return new n$1({
17757
+ options: t7.options,
17758
+ signal: t7.signal,
17759
+ input: t7.input,
17760
+ output: t7.output,
17761
+ initialValue: t7.initialValue,
17719
17762
  render() {
17720
- const t6 = e5.withGuide ?? settings.withGuide, d5 = `${symbol2(this.state)} `, s3 = `${symbolBar(this.state)} `, n6 = wrapTextWithPrefix(e5.output, e5.message, s3, d5), u6 = `${t6 ? `${styleText2("gray", S_BAR)}
17721
- ` : ""}${n6}
17763
+ const n8 = t7.withGuide ?? settings.withGuide, m6 = `${symbol2(this.state)} `, s3 = `${symbolBar(this.state)} `, i8 = wrapTextWithPrefix(t7.output, t7.message, s3, m6), u8 = `${n8 ? `${styleText2("gray", S_BAR)}
17764
+ ` : ""}${i8}
17722
17765
  `;
17723
17766
  switch (this.state) {
17724
17767
  case "submit": {
17725
- const r7 = t6 ? `${styleText2("gray", S_BAR)} ` : "", l4 = wrapTextWithPrefix(e5.output, a9(this.options[this.cursor], "selected"), r7);
17726
- return `${u6}${l4}`;
17768
+ const r8 = n8 ? `${styleText2("gray", S_BAR)} ` : "", a8 = wrapTextWithPrefix(t7.output, o6(this.options[this.cursor], "selected"), r8);
17769
+ return `${u8}${a8}`;
17727
17770
  }
17728
17771
  case "cancel": {
17729
- const r7 = t6 ? `${styleText2("gray", S_BAR)} ` : "", l4 = wrapTextWithPrefix(e5.output, a9(this.options[this.cursor], "cancelled"), r7);
17730
- return `${u6}${l4}${t6 ? `
17772
+ const r8 = n8 ? `${styleText2("gray", S_BAR)} ` : "", a8 = wrapTextWithPrefix(t7.output, o6(this.options[this.cursor], "cancelled"), r8);
17773
+ return `${u8}${a8}${n8 ? `
17731
17774
  ${styleText2("gray", S_BAR)}` : ""}`;
17732
17775
  }
17733
17776
  default: {
17734
- const r7 = t6 ? `${styleText2("cyan", S_BAR)} ` : "", l4 = t6 ? styleText2("cyan", S_BAR_END) : "", g4 = u6.split(`
17735
- `).length, h5 = t6 ? 2 : 1;
17736
- return `${u6}${r7}${limitOptions({
17737
- output: e5.output,
17777
+ const r8 = n8 ? `${styleText2("cyan", S_BAR)} ` : "", a8 = u8.split(`
17778
+ `).length, p6 = d5 ? formatInstructionFooter(SELECT_INSTRUCTIONS, n8) : n8 ? [styleText2("cyan", S_BAR_END)] : [], b5 = p6.join(`
17779
+ `), f5 = p6.length + 1;
17780
+ return `${u8}${r8}${limitOptions({
17781
+ output: t7.output,
17738
17782
  cursor: this.cursor,
17739
17783
  options: this.options,
17740
- maxItems: e5.maxItems,
17741
- columnPadding: r7.length,
17742
- rowPadding: g4 + h5,
17743
- style: (p6, b5) => a9(p6, p6.disabled ? "disabled" : b5 ? "active" : "inactive")
17784
+ maxItems: t7.maxItems,
17785
+ columnPadding: r8.length,
17786
+ rowPadding: a8 + f5,
17787
+ style: (g4, x4) => o6(g4, g4.disabled ? "disabled" : x4 ? "active" : "inactive")
17744
17788
  }).join(`
17745
- ${r7}`)}
17746
- ${l4}
17789
+ ${r8}`)}
17790
+ ${b5}
17747
17791
  `;
17748
17792
  }
17749
17793
  }
17750
17794
  }
17751
17795
  }).prompt();
17752
- }, selectKey = (t6) => {
17753
- const l4 = (e5, a9 = "inactive") => {
17754
- const n6 = e5.label ?? String(e5.value);
17755
- return a9 === "selected" ? `${styleText2("dim", n6)}` : a9 === "cancelled" ? `${styleText2(["strikethrough", "dim"], n6)}` : a9 === "active" ? `${styleText2(["bgCyan", "gray"], ` ${e5.value} `)} ${n6}${e5.hint ? ` ${styleText2("dim", `(${e5.hint})`)}` : ""}` : `${styleText2(["gray", "bgWhite", "inverse"], ` ${e5.value} `)} ${n6}${e5.hint ? ` ${styleText2("dim", `(${e5.hint})`)}` : ""}`;
17756
- };
17757
- return new u4({
17758
- options: t6.options,
17759
- signal: t6.signal,
17760
- input: t6.input,
17761
- output: t6.output,
17762
- initialValue: t6.initialValue,
17763
- caseSensitive: t6.caseSensitive,
17796
+ }, selectKey = (t7) => {
17797
+ const l4 = (e6, a8 = "inactive") => {
17798
+ if (e6 === undefined)
17799
+ return "";
17800
+ const n8 = e6.label ?? String(e6.value);
17801
+ return a8 === "selected" ? `${styleText2("dim", n8)}` : a8 === "cancelled" ? `${styleText2(["strikethrough", "dim"], n8)}` : a8 === "active" ? `${styleText2(["bgCyan", "gray"], ` ${e6.value} `)} ${n8}${e6.hint ? ` ${styleText2("dim", `(${e6.hint})`)}` : ""}` : `${styleText2(["gray", "bgWhite", "inverse"], ` ${e6.value} `)} ${n8}${e6.hint ? ` ${styleText2("dim", `(${e6.hint})`)}` : ""}`;
17802
+ };
17803
+ return new u6({
17804
+ options: t7.options,
17805
+ signal: t7.signal,
17806
+ input: t7.input,
17807
+ output: t7.output,
17808
+ initialValue: t7.initialValue,
17809
+ caseSensitive: t7.caseSensitive,
17764
17810
  render() {
17765
- const e5 = t6.withGuide ?? settings.withGuide, a9 = `${e5 ? `${styleText2("gray", S_BAR)}
17766
- ` : ""}${symbol2(this.state)} ${t6.message}
17811
+ const e6 = t7.withGuide ?? settings.withGuide, a8 = `${e6 ? `${styleText2("gray", S_BAR)}
17812
+ ` : ""}${symbol2(this.state)} ${t7.message}
17767
17813
  `;
17768
17814
  switch (this.state) {
17769
17815
  case "submit": {
17770
- const n6 = e5 ? `${styleText2("gray", S_BAR)} ` : "", s3 = this.options.find((u6) => u6.value === this.value) ?? t6.options[0], c5 = wrapTextWithPrefix(t6.output, l4(s3, "selected"), n6);
17771
- return `${a9}${c5}`;
17816
+ const n8 = e6 ? `${styleText2("gray", S_BAR)} ` : "", s3 = this.options.find((u8) => u8.value === this.value) ?? t7.options[0], c5 = wrapTextWithPrefix(t7.output, l4(s3, "selected"), n8);
17817
+ return `${a8}${c5}`;
17772
17818
  }
17773
17819
  case "cancel": {
17774
- const n6 = e5 ? `${styleText2("gray", S_BAR)} ` : "", s3 = wrapTextWithPrefix(t6.output, l4(this.options[0], "cancelled"), n6);
17775
- return `${a9}${s3}${e5 ? `
17820
+ const n8 = e6 ? `${styleText2("gray", S_BAR)} ` : "", s3 = wrapTextWithPrefix(t7.output, l4(this.options[0], "cancelled"), n8);
17821
+ return `${a8}${s3}${e6 ? `
17776
17822
  ${styleText2("gray", S_BAR)}` : ""}`;
17777
17823
  }
17778
17824
  default: {
17779
- const n6 = e5 ? `${styleText2("cyan", S_BAR)} ` : "", s3 = e5 ? styleText2("cyan", S_BAR_END) : "", c5 = this.options.map((u6, $2) => wrapTextWithPrefix(t6.output, l4(u6, $2 === this.cursor ? "active" : "inactive"), n6)).join(`
17825
+ const n8 = e6 ? `${styleText2("cyan", S_BAR)} ` : "", s3 = e6 ? styleText2("cyan", S_BAR_END) : "", c5 = this.options.map((u8, d5) => wrapTextWithPrefix(t7.output, l4(u8, d5 === this.cursor ? "active" : "inactive"), n8)).join(`
17780
17826
  `);
17781
- return `${a9}${c5}
17827
+ return `${a8}${c5}
17782
17828
  ${s3}
17783
17829
  `;
17784
17830
  }
17785
17831
  }
17786
17832
  }
17787
17833
  }).prompt();
17788
- }, i8, stream, tasks = async (o6, e5) => {
17789
- for (const t6 of o6) {
17790
- if (t6.enabled === false)
17834
+ }, i8, stream, tasks = async (o6, e6) => {
17835
+ for (const t7 of o6) {
17836
+ if (t7.enabled === false)
17791
17837
  continue;
17792
- const s3 = spinner(e5);
17793
- s3.start(t6.title);
17794
- const n6 = await t6.task(s3.message);
17795
- s3.stop(n6 || t6.title);
17838
+ const s3 = spinner(e6);
17839
+ s3.start(t7.title);
17840
+ const n8 = await t7.task(s3.message);
17841
+ s3.stop(n8 || t7.title);
17796
17842
  }
17797
17843
  }, A2 = (l4) => l4.replace(/\x1b\[(?:\d+;)*\d*[ABCDEFGHfJKSTsu]|\x1b\[(s|u)/g, ""), taskLog = (l4) => {
17798
- const r7 = l4.output ?? process.stdout, O2 = getColumns(r7), i9 = styleText2("gray", S_BAR), p6 = l4.spacing ?? 1, k2 = 3, m5 = l4.retainLog === true, d5 = !isCI() && isTTY(r7);
17799
- r7.write(`${i9}
17800
- `), r7.write(`${styleText2("green", S_STEP_SUBMIT)} ${l4.title}
17844
+ const r8 = l4.output ?? process.stdout, O2 = getColumns(r8), i9 = styleText2("gray", S_BAR), p6 = l4.spacing ?? 1, k2 = 3, m6 = l4.retainLog === true, d5 = !isCI() && isTTY(r8);
17845
+ r8.write(`${i9}
17846
+ `), r8.write(`${styleText2("green", S_STEP_SUBMIT)} ${l4.title}
17801
17847
  `);
17802
- for (let e5 = 0;e5 < p6; e5++)
17803
- r7.write(`${i9}
17848
+ for (let e6 = 0;e6 < p6; e6++)
17849
+ r8.write(`${i9}
17804
17850
  `);
17805
- const n6 = [
17851
+ const n8 = [
17806
17852
  {
17807
17853
  value: "",
17808
17854
  full: ""
17809
17855
  }
17810
17856
  ];
17811
17857
  let v3 = false;
17812
- const f5 = (e5) => {
17813
- if (n6.length === 0)
17858
+ const f5 = (e6) => {
17859
+ if (n8.length === 0)
17814
17860
  return;
17815
17861
  let s3 = 0;
17816
- e5 && (s3 += p6 + 2);
17817
- for (const t6 of n6) {
17818
- const { value: o6, result: a9 } = t6;
17819
- let g4 = a9?.message ?? o6;
17862
+ e6 && (s3 += p6 + 2);
17863
+ for (const t7 of n8) {
17864
+ const { value: o6, result: a8 } = t7;
17865
+ let g4 = a8?.message ?? o6;
17820
17866
  if (g4.length === 0)
17821
17867
  continue;
17822
- a9 === undefined && t6.header !== undefined && t6.header !== "" && (g4 += `
17823
- ${t6.header}`);
17824
- const x4 = g4.split(`
17868
+ a8 === undefined && t7.header !== undefined && t7.header !== "" && (g4 += `
17869
+ ${t7.header}`);
17870
+ const E3 = g4.split(`
17825
17871
  `).reduce((b5, w3) => w3 === "" ? b5 + 1 : b5 + Math.ceil((w3.length + k2) / O2), 0);
17826
- s3 += x4;
17827
- }
17828
- s3 > 0 && (s3 += 1, r7.write(import_sisteransi2.erase.lines(s3)));
17829
- }, h5 = (e5, s3, t6) => {
17830
- const o6 = t6 ? `${e5.full}
17831
- ${e5.value}` : e5.value;
17832
- e5.header !== undefined && e5.header !== "" && log.message(e5.header.split(`
17833
- `).map((a9) => styleText2("bold", a9)), {
17834
- output: r7,
17872
+ s3 += E3;
17873
+ }
17874
+ s3 > 0 && (s3 += 1, r8.write(import_sisteransi2.erase.lines(s3)));
17875
+ }, h5 = (e6, s3, t7) => {
17876
+ const o6 = t7 ? `${e6.full}
17877
+ ${e6.value}` : e6.value;
17878
+ e6.header !== undefined && e6.header !== "" && log.message(e6.header.split(`
17879
+ `).map((a8) => styleText2("bold", a8)), {
17880
+ output: r8,
17835
17881
  secondarySymbol: i9,
17836
17882
  symbol: i9,
17837
17883
  spacing: 0
17838
17884
  }), log.message(o6.split(`
17839
- `).map((a9) => styleText2("dim", a9)), {
17840
- output: r7,
17885
+ `).map((a8) => styleText2("dim", a8)), {
17886
+ output: r8,
17841
17887
  secondarySymbol: i9,
17842
17888
  symbol: i9,
17843
17889
  spacing: s3 ?? p6
17844
17890
  });
17845
17891
  }, T5 = () => {
17846
- for (const e5 of n6) {
17847
- const { header: s3, value: t6, full: o6 } = e5;
17848
- (s3 === undefined || s3.length === 0) && t6.length === 0 || h5(e5, undefined, m5 === true && o6.length > 0);
17849
- }
17850
- }, L2 = (e5, s3, t6) => {
17851
- if (f5(false), (t6?.raw !== true || !v3) && e5.value !== "" && (e5.value += `
17852
- `), e5.value += A2(s3), v3 = t6?.raw === true, l4.limit !== undefined) {
17853
- const o6 = e5.value.split(`
17854
- `), a9 = o6.length - l4.limit;
17855
- if (a9 > 0) {
17856
- const g4 = o6.splice(0, a9);
17857
- m5 && (e5.full += (e5.full === "" ? "" : `
17892
+ for (const e6 of n8) {
17893
+ const { header: s3, value: t7, full: o6 } = e6;
17894
+ (s3 === undefined || s3.length === 0) && t7.length === 0 || h5(e6, undefined, m6 === true && o6.length > 0);
17895
+ }
17896
+ }, L2 = (e6, s3, t7) => {
17897
+ if (f5(false), (t7?.raw !== true || !v3) && e6.value !== "" && (e6.value += `
17898
+ `), e6.value += A2(s3), v3 = t7?.raw === true, l4.limit !== undefined) {
17899
+ const o6 = e6.value.split(`
17900
+ `), a8 = o6.length - l4.limit;
17901
+ if (a8 > 0) {
17902
+ const g4 = o6.splice(0, a8);
17903
+ m6 && (e6.full += (e6.full === "" ? "" : `
17858
17904
  `) + g4.join(`
17859
17905
  `));
17860
17906
  }
17861
- e5.value = o6.join(`
17907
+ e6.value = o6.join(`
17862
17908
  `);
17863
17909
  }
17864
17910
  d5 && y3();
17865
17911
  }, y3 = () => {
17866
- for (const e5 of n6)
17867
- e5.result ? e5.result.status === "error" ? log.error(e5.result.message, { output: r7, secondarySymbol: i9, spacing: 0 }) : log.success(e5.result.message, { output: r7, secondarySymbol: i9, spacing: 0 }) : e5.value !== "" && h5(e5, 0);
17868
- }, B2 = (e5, s3) => {
17869
- f5(false), e5.result = s3, d5 && y3();
17912
+ for (const e6 of n8)
17913
+ e6.result ? e6.result.status === "error" ? log.error(e6.result.message, { output: r8, secondarySymbol: i9, spacing: 0 }) : log.success(e6.result.message, { output: r8, secondarySymbol: i9, spacing: 0 }) : e6.value !== "" && h5(e6, 0);
17914
+ }, B2 = (e6, s3) => {
17915
+ f5(false), e6.result = s3, d5 && y3();
17870
17916
  };
17871
17917
  return {
17872
- message(e5, s3) {
17873
- L2(n6[0], e5, s3);
17918
+ message(e6, s3) {
17919
+ L2(n8[0], e6, s3);
17874
17920
  },
17875
- group(e5) {
17921
+ group(e6) {
17876
17922
  const s3 = {
17877
- header: e5,
17923
+ header: e6,
17878
17924
  value: "",
17879
17925
  full: ""
17880
17926
  };
17881
- return n6.push(s3), {
17882
- message(t6, o6) {
17883
- L2(s3, t6, o6);
17927
+ return n8.push(s3), {
17928
+ message(t7, o6) {
17929
+ L2(s3, t7, o6);
17884
17930
  },
17885
- error(t6) {
17931
+ error(t7) {
17886
17932
  B2(s3, {
17887
17933
  status: "error",
17888
- message: t6
17934
+ message: t7
17889
17935
  });
17890
17936
  },
17891
- success(t6) {
17937
+ success(t7) {
17892
17938
  B2(s3, {
17893
17939
  status: "success",
17894
- message: t6
17940
+ message: t7
17895
17941
  });
17896
17942
  }
17897
17943
  };
17898
17944
  },
17899
- error(e5, s3) {
17900
- f5(true), log.error(e5, { output: r7, secondarySymbol: i9, spacing: 1 }), s3?.showLog !== false && T5(), n6.splice(1, n6.length - 1), n6[0].value = "", n6[0].full = "";
17945
+ error(e6, s3) {
17946
+ f5(true), log.error(e6, { output: r8, secondarySymbol: i9, spacing: 1 }), s3?.showLog !== false && T5(), n8.splice(1, n8.length - 1), n8[0].value = "", n8[0].full = "";
17901
17947
  },
17902
- success(e5, s3) {
17903
- f5(true), log.success(e5, { output: r7, secondarySymbol: i9, spacing: 1 }), s3?.showLog === true && T5(), n6.splice(1, n6.length - 1), n6[0].value = "", n6[0].full = "";
17904
- }
17905
- };
17906
- }, text = (t6) => new n5({
17907
- validate: t6.validate,
17908
- placeholder: t6.placeholder,
17909
- defaultValue: t6.defaultValue,
17910
- initialValue: t6.initialValue,
17911
- output: t6.output,
17912
- signal: t6.signal,
17913
- input: t6.input,
17948
+ success(e6, s3) {
17949
+ f5(true), log.success(e6, { output: r8, secondarySymbol: i9, spacing: 1 }), s3?.showLog === true && T5(), n8.splice(1, n8.length - 1), n8[0].value = "", n8[0].full = "";
17950
+ }
17951
+ };
17952
+ }, text = (e6) => new n7({
17953
+ validate: e6.validate,
17954
+ placeholder: e6.placeholder,
17955
+ defaultValue: e6.defaultValue,
17956
+ initialValue: e6.initialValue,
17957
+ output: e6.output,
17958
+ signal: e6.signal,
17959
+ input: e6.input,
17914
17960
  render() {
17915
- const i9 = t6?.withGuide ?? settings.withGuide, s3 = `${`${i9 ? `${styleText2("gray", S_BAR)}
17916
- ` : ""}${symbol2(this.state)} `}${t6.message}
17917
- `, c5 = t6.placeholder ? styleText2("inverse", t6.placeholder[0]) + styleText2("dim", t6.placeholder.slice(1)) : styleText2(["inverse", "hidden"], "_"), o6 = this.userInput ? this.userInputWithCursor : c5, a9 = this.value ?? "";
17961
+ const i9 = e6?.withGuide ?? settings.withGuide, s3 = `${`${i9 ? `${styleText2("gray", S_BAR)}
17962
+ ` : ""}${symbol2(this.state)} `}${e6.message}
17963
+ `, c5 = e6.placeholder && e6.placeholder.length > 0 ? styleText2("inverse", e6.placeholder[0]) + styleText2("dim", e6.placeholder.slice(1)) : styleText2(["inverse", "hidden"], "_"), o6 = this.userInput ? this.userInputWithCursor : c5, l4 = this.value ?? "";
17918
17964
  switch (this.state) {
17919
17965
  case "error": {
17920
- const n6 = this.error ? ` ${styleText2("yellow", this.error)}` : "", r7 = i9 ? `${styleText2("yellow", S_BAR)} ` : "", d5 = i9 ? styleText2("yellow", S_BAR_END) : "";
17966
+ const n8 = this.error ? ` ${styleText2("yellow", this.error)}` : "", r8 = i9 ? `${styleText2("yellow", S_BAR)} ` : "", d5 = i9 ? styleText2("yellow", S_BAR_END) : "";
17921
17967
  return `${s3.trim()}
17922
- ${r7}${o6}
17923
- ${d5}${n6}
17968
+ ${r8}${o6}
17969
+ ${d5}${n8}
17924
17970
  `;
17925
17971
  }
17926
17972
  case "submit": {
17927
- const n6 = a9 ? ` ${styleText2("dim", a9)}` : "", r7 = i9 ? styleText2("gray", S_BAR) : "";
17928
- return `${s3}${r7}${n6}`;
17973
+ const n8 = l4 ? ` ${styleText2("dim", l4)}` : "", r8 = i9 ? styleText2("gray", S_BAR) : "";
17974
+ return `${s3}${r8}${n8}`;
17929
17975
  }
17930
17976
  case "cancel": {
17931
- const n6 = a9 ? ` ${styleText2(["strikethrough", "dim"], a9)}` : "", r7 = i9 ? styleText2("gray", S_BAR) : "";
17932
- return `${s3}${r7}${n6}${a9.trim() ? `
17933
- ${r7}` : ""}`;
17977
+ const n8 = l4 ? ` ${styleText2(["strikethrough", "dim"], l4)}` : "", r8 = i9 ? styleText2("gray", S_BAR) : "";
17978
+ return `${s3}${r8}${n8}${l4.trim() ? `
17979
+ ${r8}` : ""}`;
17934
17980
  }
17935
17981
  default: {
17936
- const n6 = i9 ? `${styleText2("cyan", S_BAR)} ` : "", r7 = i9 ? styleText2("cyan", S_BAR_END) : "";
17937
- return `${s3}${n6}${o6}
17938
- ${r7}
17982
+ const n8 = i9 ? `${styleText2("cyan", S_BAR)} ` : "", r8 = i9 ? styleText2("cyan", S_BAR_END) : "";
17983
+ return `${s3}${n8}${o6}
17984
+ ${r8}
17939
17985
  `;
17940
17986
  }
17941
17987
  }
@@ -17985,77 +18031,86 @@ var init_dist4 = __esm(() => {
17985
18031
  month: "mm",
17986
18032
  day: "dd"
17987
18033
  };
18034
+ MULTISELECT_INSTRUCTIONS = [
18035
+ `${styleText2("dim", "\u2191/\u2193")} to navigate`,
18036
+ `${styleText2("dim", "Space:")} select`,
18037
+ `${styleText2("dim", "Enter:")} confirm`
18038
+ ];
17988
18039
  log = {
17989
18040
  message: (s3 = [], {
17990
- symbol: e5 = styleText2("gray", S_BAR),
17991
- secondarySymbol: r7 = styleText2("gray", S_BAR),
17992
- output: m5 = process.stdout,
18041
+ symbol: e6 = styleText2("gray", S_BAR),
18042
+ secondarySymbol: r8 = styleText2("gray", S_BAR),
18043
+ output: m6 = process.stdout,
17993
18044
  spacing: l4 = 1,
17994
18045
  withGuide: c4
17995
18046
  } = {}) => {
17996
- const t6 = [], o6 = c4 ?? settings.withGuide, f5 = o6 ? r7 : "", O2 = o6 ? `${e5} ` : "", u5 = o6 ? `${r7} ` : "";
18047
+ const t7 = [], o6 = c4 ?? settings.withGuide, f5 = o6 ? r8 : "", O2 = o6 ? `${e6} ` : "", u7 = o6 ? `${r8} ` : "";
17997
18048
  for (let i8 = 0;i8 < l4; i8++)
17998
- t6.push(f5);
18049
+ t7.push(f5);
17999
18050
  const g4 = Array.isArray(s3) ? s3 : s3.split(`
18000
18051
  `);
18001
18052
  if (g4.length > 0) {
18002
18053
  const [i8, ...y3] = g4;
18003
- i8.length > 0 ? t6.push(`${O2}${i8}`) : t6.push(o6 ? e5 : "");
18054
+ i8.length > 0 ? t7.push(`${O2}${i8}`) : t7.push(o6 ? e6 : "");
18004
18055
  for (const p6 of y3)
18005
- p6.length > 0 ? t6.push(`${u5}${p6}`) : t6.push(o6 ? r7 : "");
18056
+ p6.length > 0 ? t7.push(`${u7}${p6}`) : t7.push(o6 ? r8 : "");
18006
18057
  }
18007
- m5.write(`${t6.join(`
18058
+ m6.write(`${t7.join(`
18008
18059
  `)}
18009
18060
  `);
18010
18061
  },
18011
- info: (s3, e5) => {
18012
- log.message(s3, { ...e5, symbol: styleText2("blue", S_INFO) });
18062
+ info: (s3, e6) => {
18063
+ log.message(s3, { ...e6, symbol: styleText2("blue", S_INFO) });
18013
18064
  },
18014
- success: (s3, e5) => {
18015
- log.message(s3, { ...e5, symbol: styleText2("green", S_SUCCESS) });
18065
+ success: (s3, e6) => {
18066
+ log.message(s3, { ...e6, symbol: styleText2("green", S_SUCCESS) });
18016
18067
  },
18017
- step: (s3, e5) => {
18018
- log.message(s3, { ...e5, symbol: styleText2("green", S_STEP_SUBMIT) });
18068
+ step: (s3, e6) => {
18069
+ log.message(s3, { ...e6, symbol: styleText2("green", S_STEP_SUBMIT) });
18019
18070
  },
18020
- warn: (s3, e5) => {
18021
- log.message(s3, { ...e5, symbol: styleText2("yellow", S_WARN) });
18071
+ warn: (s3, e6) => {
18072
+ log.message(s3, { ...e6, symbol: styleText2("yellow", S_WARN) });
18022
18073
  },
18023
- warning: (s3, e5) => {
18024
- log.warn(s3, e5);
18074
+ warning: (s3, e6) => {
18075
+ log.warn(s3, e6);
18025
18076
  },
18026
- error: (s3, e5) => {
18027
- log.message(s3, { ...e5, symbol: styleText2("red", S_ERROR) });
18077
+ error: (s3, e6) => {
18078
+ log.message(s3, { ...e6, symbol: styleText2("red", S_ERROR) });
18028
18079
  }
18029
18080
  };
18030
- u5 = {
18081
+ u7 = {
18031
18082
  light: unicodeOr("\u2500", "-"),
18032
18083
  heavy: unicodeOr("\u2501", "="),
18033
18084
  block: unicodeOr("\u2588", "#")
18034
18085
  };
18086
+ SELECT_INSTRUCTIONS = [
18087
+ `${styleText2("dim", "\u2191/\u2193")} to navigate`,
18088
+ `${styleText2("dim", "Enter:")} confirm`
18089
+ ];
18035
18090
  i8 = `${styleText2("gray", S_BAR)} `;
18036
18091
  stream = {
18037
- message: async (e5, { symbol: l4 = styleText2("gray", S_BAR) } = {}) => {
18092
+ message: async (e6, { symbol: l4 = styleText2("gray", S_BAR) } = {}) => {
18038
18093
  process.stdout.write(`${styleText2("gray", S_BAR)}
18039
18094
  ${l4} `);
18040
18095
  let s3 = 3;
18041
- for await (let r7 of e5) {
18042
- r7 = r7.replace(/\n/g, `
18043
- ${i8}`), r7.includes(`
18044
- `) && (s3 = 3 + stripVTControlCharacters(r7.slice(r7.lastIndexOf(`
18096
+ for await (let r8 of e6) {
18097
+ r8 = r8.replace(/\n/g, `
18098
+ ${i8}`), r8.includes(`
18099
+ `) && (s3 = 3 + stripVTControlCharacters(r8.slice(r8.lastIndexOf(`
18045
18100
  `))).length);
18046
- const o6 = stripVTControlCharacters(r7).length;
18047
- s3 + o6 < process.stdout.columns ? (s3 += o6, process.stdout.write(r7)) : (process.stdout.write(`
18048
- ${i8}${r7.trimStart()}`), s3 = 3 + stripVTControlCharacters(r7.trimStart()).length);
18101
+ const o6 = stripVTControlCharacters(r8).length;
18102
+ s3 + o6 < process.stdout.columns ? (s3 += o6, process.stdout.write(r8)) : (process.stdout.write(`
18103
+ ${i8}${r8.trimStart()}`), s3 = 3 + stripVTControlCharacters(r8.trimStart()).length);
18049
18104
  }
18050
18105
  process.stdout.write(`
18051
18106
  `);
18052
18107
  },
18053
- info: (e5) => stream.message(e5, { symbol: styleText2("blue", S_INFO) }),
18054
- success: (e5) => stream.message(e5, { symbol: styleText2("green", S_SUCCESS) }),
18055
- step: (e5) => stream.message(e5, { symbol: styleText2("green", S_STEP_SUBMIT) }),
18056
- warn: (e5) => stream.message(e5, { symbol: styleText2("yellow", S_WARN) }),
18057
- warning: (e5) => stream.warn(e5),
18058
- error: (e5) => stream.message(e5, { symbol: styleText2("red", S_ERROR) })
18108
+ info: (e6) => stream.message(e6, { symbol: styleText2("blue", S_INFO) }),
18109
+ success: (e6) => stream.message(e6, { symbol: styleText2("green", S_SUCCESS) }),
18110
+ step: (e6) => stream.message(e6, { symbol: styleText2("green", S_STEP_SUBMIT) }),
18111
+ warn: (e6) => stream.message(e6, { symbol: styleText2("yellow", S_WARN) }),
18112
+ warning: (e6) => stream.warn(e6),
18113
+ error: (e6) => stream.message(e6, { symbol: styleText2("red", S_ERROR) })
18059
18114
  };
18060
18115
  });
18061
18116
 
@@ -18069,7 +18124,7 @@ function collectExternalDeps(setup) {
18069
18124
  const selected = new Set(setup.spec.targets);
18070
18125
  const lspApplies = (lsp) => {
18071
18126
  const lspTargets = lsp.targets ?? DEFAULT_LSP_TARGETS;
18072
- return lspTargets.some((t6) => selected.has(t6));
18127
+ return lspTargets.some((t7) => selected.has(t7));
18073
18128
  };
18074
18129
  const seen = new Set;
18075
18130
  const out = [];
@@ -18204,14 +18259,14 @@ function anyPathExists(dep, opts) {
18204
18259
  return dep.checkPaths.some((p6) => existsSync10(expandPath(p6, opts.projectDir, home)));
18205
18260
  }
18206
18261
  function reportFailures(results) {
18207
- const failed = results.filter((r7) => r7.status === "failed");
18262
+ const failed = results.filter((r8) => r8.status === "failed");
18208
18263
  if (failed.length === 0)
18209
18264
  return;
18210
18265
  console.log(pc.yellow(`
18211
- ${failed.length} external dependency install(s) failed: ` + failed.map((r7) => r7.dep.label).join(", ") + ". The installed item(s) may not work until these are installed."));
18266
+ ${failed.length} external dependency install(s) failed: ` + failed.map((r8) => r8.dep.label).join(", ") + ". The installed item(s) may not work until these are installed."));
18212
18267
  }
18213
18268
  function fmt(argv) {
18214
- return argv.map((a9) => /\s/.test(a9) ? JSON.stringify(a9) : a9).join(" ");
18269
+ return argv.map((a8) => /\s/.test(a8) ? JSON.stringify(a8) : a8).join(" ");
18215
18270
  }
18216
18271
  function defaultSpawn(argv, cwd) {
18217
18272
  const [command, ...args] = argv;
@@ -18312,10 +18367,10 @@ function ownershipKeys(items) {
18312
18367
  files.add(lockPathKey(f5));
18313
18368
  for (const b5 of i9.blocks ?? [])
18314
18369
  blocks.add(`${lockPathKey(b5)}\x00${b5.marker}`);
18315
- for (const e5 of i9.jsonEntries ?? [])
18316
- json2.add(`${lockPathKey(e5)}\x00${e5.key}\x00${e5.value}`);
18317
- for (const e5 of i9.objectEntries ?? [])
18318
- objects.add(`${lockPathKey(e5)}\x00${e5.key}\x00${e5.subKey}`);
18370
+ for (const e6 of i9.jsonEntries ?? [])
18371
+ json2.add(`${lockPathKey(e6)}\x00${e6.key}\x00${e6.value}`);
18372
+ for (const e6 of i9.objectEntries ?? [])
18373
+ objects.add(`${lockPathKey(e6)}\x00${e6.key}\x00${e6.subKey}`);
18319
18374
  }
18320
18375
  return { files, blocks, json: json2, objects };
18321
18376
  }
@@ -18323,8 +18378,8 @@ function renderPrunePlan(items, projectDir, remaining = []) {
18323
18378
  const keep = ownershipKeys(remaining);
18324
18379
  const fileDeletes = items.flatMap((i9) => i9.files.filter((f5) => !keep.files.has(lockPathKey(f5))).map((f5) => resolveLockedPath(projectDir, f5)));
18325
18380
  const blockStrips = items.flatMap((i9) => (i9.blocks ?? []).filter((b5) => !keep.blocks.has(`${lockPathKey(b5)}\x00${b5.marker}`)).map((b5) => ({ ...b5, path: resolveLockedPath(projectDir, b5) })));
18326
- const jsonStrips = items.flatMap((i9) => (i9.jsonEntries ?? []).filter((e5) => !keep.json.has(`${lockPathKey(e5)}\x00${e5.key}\x00${e5.value}`)).map((e5) => ({ ...e5, path: resolveLockedPath(projectDir, e5) })));
18327
- const objectStrips = items.flatMap((i9) => (i9.objectEntries ?? []).filter((e5) => !keep.objects.has(`${lockPathKey(e5)}\x00${e5.key}\x00${e5.subKey}`)).map((e5) => ({ ...e5, path: resolveLockedPath(projectDir, e5) })));
18381
+ const jsonStrips = items.flatMap((i9) => (i9.jsonEntries ?? []).filter((e6) => !keep.json.has(`${lockPathKey(e6)}\x00${e6.key}\x00${e6.value}`)).map((e6) => ({ ...e6, path: resolveLockedPath(projectDir, e6) })));
18382
+ const objectStrips = items.flatMap((i9) => (i9.objectEntries ?? []).filter((e6) => !keep.objects.has(`${lockPathKey(e6)}\x00${e6.key}\x00${e6.subKey}`)).map((e6) => ({ ...e6, path: resolveLockedPath(projectDir, e6) })));
18328
18383
  if (fileDeletes.length) {
18329
18384
  console.log(pc2.bold("Files to delete:"));
18330
18385
  for (const p6 of fileDeletes)
@@ -18338,14 +18393,14 @@ function renderPrunePlan(items, projectDir, remaining = []) {
18338
18393
  }
18339
18394
  if (jsonStrips.length) {
18340
18395
  console.log(pc2.bold("Config entries to prune:"));
18341
- for (const e5 of jsonStrips) {
18342
- console.log(` ${pc2.magenta("unset")} ${e5.key}[]=${e5.value} in ${shorten(e5.path, projectDir)}`);
18396
+ for (const e6 of jsonStrips) {
18397
+ console.log(` ${pc2.magenta("unset")} ${e6.key}[]=${e6.value} in ${shorten(e6.path, projectDir)}`);
18343
18398
  }
18344
18399
  }
18345
18400
  if (objectStrips.length) {
18346
18401
  console.log(pc2.bold("Config entries to prune:"));
18347
- for (const e5 of objectStrips) {
18348
- console.log(` ${pc2.magenta("unset")} ${e5.key}.${e5.subKey} in ${shorten(e5.path, projectDir)}`);
18402
+ for (const e6 of objectStrips) {
18403
+ console.log(` ${pc2.magenta("unset")} ${e6.key}.${e6.subKey} in ${shorten(e6.path, projectDir)}`);
18349
18404
  }
18350
18405
  }
18351
18406
  }
@@ -18400,12 +18455,12 @@ function executePrune(items, projectDir, remaining = [], mutatedConfig) {
18400
18455
  console.log(`${pc2.blue("updated".padEnd(10))} ${shorten(block2.path, projectDir)} (block stripped)`);
18401
18456
  }
18402
18457
  }
18403
- const jsonEntries = items.flatMap((i9) => (i9.jsonEntries ?? []).filter((e5) => !keep.json.has(`${lockPathKey(e5)}\x00${e5.key}\x00${e5.value}`)).map((e5) => ({ ...e5, path: resolveLockedPath(projectDir, e5) })));
18458
+ const jsonEntries = items.flatMap((i9) => (i9.jsonEntries ?? []).filter((e6) => !keep.json.has(`${lockPathKey(e6)}\x00${e6.key}\x00${e6.value}`)).map((e6) => ({ ...e6, path: resolveLockedPath(projectDir, e6) })));
18404
18459
  const byPath = new Map;
18405
- for (const e5 of jsonEntries) {
18406
- const list = byPath.get(e5.path) ?? [];
18407
- list.push(e5);
18408
- byPath.set(e5.path, list);
18460
+ for (const e6 of jsonEntries) {
18461
+ const list = byPath.get(e6.path) ?? [];
18462
+ list.push(e6);
18463
+ byPath.set(e6.path, list);
18409
18464
  }
18410
18465
  for (const [path2, entries] of byPath) {
18411
18466
  if (!existsSync11(path2))
@@ -18417,12 +18472,12 @@ function executePrune(items, projectDir, remaining = [], mutatedConfig) {
18417
18472
  mutatedConfig?.add(relative6(projectDir, path2));
18418
18473
  console.log(`${pc2.blue("updated".padEnd(10))} ${shorten(path2, projectDir)} (config entries pruned)`);
18419
18474
  }
18420
- const objectEntries = items.flatMap((i9) => (i9.objectEntries ?? []).filter((e5) => !keep.objects.has(`${lockPathKey(e5)}\x00${e5.key}\x00${e5.subKey}`)).map((e5) => ({ ...e5, path: resolveLockedPath(projectDir, e5) })));
18475
+ const objectEntries = items.flatMap((i9) => (i9.objectEntries ?? []).filter((e6) => !keep.objects.has(`${lockPathKey(e6)}\x00${e6.key}\x00${e6.subKey}`)).map((e6) => ({ ...e6, path: resolveLockedPath(projectDir, e6) })));
18421
18476
  const objByPath = new Map;
18422
- for (const e5 of objectEntries) {
18423
- const list = objByPath.get(e5.path) ?? [];
18424
- list.push(e5);
18425
- objByPath.set(e5.path, list);
18477
+ for (const e6 of objectEntries) {
18478
+ const list = objByPath.get(e6.path) ?? [];
18479
+ list.push(e6);
18480
+ objByPath.set(e6.path, list);
18426
18481
  }
18427
18482
  for (const [path2, entries] of objByPath) {
18428
18483
  if (!existsSync11(path2))
@@ -18615,7 +18670,7 @@ function actionLabel(action) {
18615
18670
  function renderPlans(plans, projectDir) {
18616
18671
  const lines = [];
18617
18672
  for (const plan of plans) {
18618
- const visible = plan.actions.filter((a9) => a9.kind !== "remove-block");
18673
+ const visible = plan.actions.filter((a8) => a8.kind !== "remove-block");
18619
18674
  lines.push(pc2.bold(`${plan.target} (${visible.length} file action(s))`));
18620
18675
  for (const action of plan.actions) {
18621
18676
  if (action.kind === "remove-block")
@@ -18733,7 +18788,7 @@ async function confirmExecItems(items, choices) {
18733
18788
  }
18734
18789
  if (risky.length === 0)
18735
18790
  return true;
18736
- const count = risky.reduce((n6, r7) => n6 + r7.infos.length, 0);
18791
+ const count = risky.reduce((n8, r8) => n8 + r8.infos.length, 0);
18737
18792
  console.log(pc2.yellow(`
18738
18793
  The following item(s) run a local command from a non-builtin registry:`));
18739
18794
  for (const { item, infos } of risky) {
@@ -18822,9 +18877,9 @@ function warnHollowFablePack(items, lockedAgentIds) {
18822
18877
  function lockedAgentIds(lock) {
18823
18878
  const out = [];
18824
18879
  for (const item of lock.items) {
18825
- const m5 = /(?:^|\/)agent:([a-z0-9][a-z0-9-]*)$/.exec(item.ref);
18826
- if (m5)
18827
- out.push(m5[1]);
18880
+ const m6 = /(?:^|\/)agent:([a-z0-9][a-z0-9-]*)$/.exec(item.ref);
18881
+ if (m6)
18882
+ out.push(m6[1]);
18828
18883
  }
18829
18884
  return out;
18830
18885
  }
@@ -18850,10 +18905,10 @@ async function registryDefaultModels(sources) {
18850
18905
  async function installedPresetModels(sources, lock) {
18851
18906
  const out = {};
18852
18907
  for (const item of lock.items) {
18853
- const m5 = PRESET_REF.exec(item.ref);
18854
- if (!m5)
18908
+ const m6 = PRESET_REF.exec(item.ref);
18909
+ if (!m6)
18855
18910
  continue;
18856
- const name = m5[1];
18911
+ const name = m6[1];
18857
18912
  try {
18858
18913
  const manifest = await sources.loadManifest("preset", name);
18859
18914
  const models = manifest.meta?.models;
@@ -18916,140 +18971,128 @@ import { dirname as dirname3 } from "path";
18916
18971
 
18917
18972
  // src/core/configfile.ts
18918
18973
  import { pathToFileURL } from "url";
18919
-
18920
- // node_modules/confbox/dist/_chunks/_format.mjs
18921
- var t = Symbol.for(`__confbox_fmt__`);
18922
- var n = /^(\s+)/;
18923
- var r = /(\s+)$/;
18924
- function i(e, t2 = {}) {
18925
- return { sample: t2.indent === undefined && t2.preserveIndentation !== false && e.slice(0, t2?.sampleSize || 1024), whiteSpace: t2.preserveWhitespace === false ? undefined : { start: n.exec(e)?.[0] || ``, end: r.exec(e)?.[0] || `` } };
18926
- }
18927
- function a(e, n2, r2) {
18928
- !n2 || typeof n2 != `object` || Object.defineProperty(n2, t, { enumerable: false, configurable: true, writable: true, value: i(e, r2) });
18929
- }
18930
-
18931
18974
  // node_modules/confbox/dist/_chunks/libs/jsonc-parser.mjs
18932
- function e(e2, i2 = false) {
18933
- let a2 = e2.length, o = 0, s = ``, c = 0, l = 16, u = 0, d = 0, f = 0, p = 0, m = 0;
18934
- function h(t2, n2) {
18935
- let r2 = 0, i3 = 0;
18936
- for (;r2 < t2 || !n2; ) {
18937
- let t3 = e2.charCodeAt(o);
18938
- if (t3 >= 48 && t3 <= 57)
18939
- i3 = i3 * 16 + t3 - 48;
18940
- else if (t3 >= 65 && t3 <= 70)
18941
- i3 = i3 * 16 + t3 - 65 + 10;
18942
- else if (t3 >= 97 && t3 <= 102)
18943
- i3 = i3 * 16 + t3 - 97 + 10;
18975
+ function e(e2, i = false) {
18976
+ let a = e2.length, o = 0, s = ``, c = 0, l = 16, u = 0, d = 0, f = 0, p = 0, m = 0;
18977
+ function h(t, n) {
18978
+ let r = 0, i2 = 0;
18979
+ for (;r < t || !n; ) {
18980
+ let t2 = e2.charCodeAt(o);
18981
+ if (t2 >= 48 && t2 <= 57)
18982
+ i2 = i2 * 16 + t2 - 48;
18983
+ else if (t2 >= 65 && t2 <= 70)
18984
+ i2 = i2 * 16 + t2 - 65 + 10;
18985
+ else if (t2 >= 97 && t2 <= 102)
18986
+ i2 = i2 * 16 + t2 - 97 + 10;
18944
18987
  else
18945
18988
  break;
18946
- o++, r2++;
18989
+ o++, r++;
18947
18990
  }
18948
- return r2 < t2 && (i3 = -1), i3;
18991
+ return r < t && (i2 = -1), i2;
18949
18992
  }
18950
18993
  function g(e3) {
18951
18994
  o = e3, s = ``, c = 0, l = 16, m = 0;
18952
18995
  }
18953
18996
  function _() {
18954
- let t2 = o;
18997
+ let t = o;
18955
18998
  if (e2.charCodeAt(o) === 48)
18956
18999
  o++;
18957
19000
  else
18958
- for (o++;o < e2.length && r2(e2.charCodeAt(o)); )
19001
+ for (o++;o < e2.length && r(e2.charCodeAt(o)); )
18959
19002
  o++;
18960
19003
  if (o < e2.length && e2.charCodeAt(o) === 46)
18961
- if (o++, o < e2.length && r2(e2.charCodeAt(o)))
18962
- for (o++;o < e2.length && r2(e2.charCodeAt(o)); )
19004
+ if (o++, o < e2.length && r(e2.charCodeAt(o)))
19005
+ for (o++;o < e2.length && r(e2.charCodeAt(o)); )
18963
19006
  o++;
18964
19007
  else
18965
- return m = 3, e2.substring(t2, o);
18966
- let n2 = o;
19008
+ return m = 3, e2.substring(t, o);
19009
+ let n = o;
18967
19010
  if (o < e2.length && (e2.charCodeAt(o) === 69 || e2.charCodeAt(o) === 101))
18968
- if (o++, (o < e2.length && e2.charCodeAt(o) === 43 || e2.charCodeAt(o) === 45) && o++, o < e2.length && r2(e2.charCodeAt(o))) {
18969
- for (o++;o < e2.length && r2(e2.charCodeAt(o)); )
19011
+ if (o++, (o < e2.length && e2.charCodeAt(o) === 43 || e2.charCodeAt(o) === 45) && o++, o < e2.length && r(e2.charCodeAt(o))) {
19012
+ for (o++;o < e2.length && r(e2.charCodeAt(o)); )
18970
19013
  o++;
18971
- n2 = o;
19014
+ n = o;
18972
19015
  } else
18973
19016
  m = 3;
18974
- return e2.substring(t2, n2);
19017
+ return e2.substring(t, n);
18975
19018
  }
18976
19019
  function v() {
18977
- let t2 = ``, r2 = o;
19020
+ let t = ``, r = o;
18978
19021
  for (;; ) {
18979
- if (o >= a2) {
18980
- t2 += e2.substring(r2, o), m = 2;
19022
+ if (o >= a) {
19023
+ t += e2.substring(r, o), m = 2;
18981
19024
  break;
18982
19025
  }
18983
- let i3 = e2.charCodeAt(o);
18984
- if (i3 === 34) {
18985
- t2 += e2.substring(r2, o), o++;
19026
+ let i2 = e2.charCodeAt(o);
19027
+ if (i2 === 34) {
19028
+ t += e2.substring(r, o), o++;
18986
19029
  break;
18987
19030
  }
18988
- if (i3 === 92) {
18989
- if (t2 += e2.substring(r2, o), o++, o >= a2) {
19031
+ if (i2 === 92) {
19032
+ if (t += e2.substring(r, o), o++, o >= a) {
18990
19033
  m = 2;
18991
19034
  break;
18992
19035
  }
18993
19036
  switch (e2.charCodeAt(o++)) {
18994
19037
  case 34:
18995
- t2 += `"`;
19038
+ t += `"`;
18996
19039
  break;
18997
19040
  case 92:
18998
- t2 += `\\`;
19041
+ t += `\\`;
18999
19042
  break;
19000
19043
  case 47:
19001
- t2 += `/`;
19044
+ t += `/`;
19002
19045
  break;
19003
19046
  case 98:
19004
- t2 += `\b`;
19047
+ t += `\b`;
19005
19048
  break;
19006
19049
  case 102:
19007
- t2 += `\f`;
19050
+ t += `\f`;
19008
19051
  break;
19009
19052
  case 110:
19010
- t2 += `
19053
+ t += `
19011
19054
  `;
19012
19055
  break;
19013
19056
  case 114:
19014
- t2 += `\r`;
19057
+ t += `\r`;
19015
19058
  break;
19016
19059
  case 116:
19017
- t2 += ` `;
19060
+ t += ` `;
19018
19061
  break;
19019
19062
  case 117:
19020
19063
  let e3 = h(4, true);
19021
- e3 >= 0 ? t2 += String.fromCharCode(e3) : m = 4;
19064
+ e3 >= 0 ? t += String.fromCharCode(e3) : m = 4;
19022
19065
  break;
19023
19066
  default:
19024
19067
  m = 5;
19025
19068
  }
19026
- r2 = o;
19069
+ r = o;
19027
19070
  continue;
19028
19071
  }
19029
- if (i3 >= 0 && i3 <= 31)
19030
- if (n2(i3)) {
19031
- t2 += e2.substring(r2, o), m = 2;
19072
+ if (i2 >= 0 && i2 <= 31)
19073
+ if (n(i2)) {
19074
+ t += e2.substring(r, o), m = 2;
19032
19075
  break;
19033
19076
  } else
19034
19077
  m = 6;
19035
19078
  o++;
19036
19079
  }
19037
- return t2;
19080
+ return t;
19038
19081
  }
19039
19082
  function y() {
19040
- if (s = ``, m = 0, c = o, d = u, p = f, o >= a2)
19041
- return c = a2, l = 17;
19042
- let i3 = e2.charCodeAt(o);
19043
- if (t2(i3)) {
19083
+ if (s = ``, m = 0, c = o, d = u, p = f, o >= a)
19084
+ return c = a, l = 17;
19085
+ let i2 = e2.charCodeAt(o);
19086
+ if (t(i2)) {
19044
19087
  do
19045
- o++, s += String.fromCharCode(i3), i3 = e2.charCodeAt(o);
19046
- while (t2(i3));
19088
+ o++, s += String.fromCharCode(i2), i2 = e2.charCodeAt(o);
19089
+ while (t(i2));
19047
19090
  return l = 15;
19048
19091
  }
19049
- if (n2(i3))
19050
- return o++, s += String.fromCharCode(i3), i3 === 13 && e2.charCodeAt(o) === 10 && (o++, s += `
19092
+ if (n(i2))
19093
+ return o++, s += String.fromCharCode(i2), i2 === 13 && e2.charCodeAt(o) === 10 && (o++, s += `
19051
19094
  `), u++, f = o, l = 14;
19052
- switch (i3) {
19095
+ switch (i2) {
19053
19096
  case 123:
19054
19097
  return o++, l = 1;
19055
19098
  case 125:
@@ -19065,28 +19108,28 @@ function e(e2, i2 = false) {
19065
19108
  case 34:
19066
19109
  return o++, s = v(), l = 10;
19067
19110
  case 47:
19068
- let t2 = o - 1;
19111
+ let t = o - 1;
19069
19112
  if (e2.charCodeAt(o + 1) === 47) {
19070
- for (o += 2;o < a2 && !n2(e2.charCodeAt(o)); )
19113
+ for (o += 2;o < a && !n(e2.charCodeAt(o)); )
19071
19114
  o++;
19072
- return s = e2.substring(t2, o), l = 12;
19115
+ return s = e2.substring(t, o), l = 12;
19073
19116
  }
19074
19117
  if (e2.charCodeAt(o + 1) === 42) {
19075
19118
  o += 2;
19076
- let r2 = a2 - 1, i4 = false;
19077
- for (;o < r2; ) {
19078
- let t3 = e2.charCodeAt(o);
19079
- if (t3 === 42 && e2.charCodeAt(o + 1) === 47) {
19080
- o += 2, i4 = true;
19119
+ let r = a - 1, i3 = false;
19120
+ for (;o < r; ) {
19121
+ let t2 = e2.charCodeAt(o);
19122
+ if (t2 === 42 && e2.charCodeAt(o + 1) === 47) {
19123
+ o += 2, i3 = true;
19081
19124
  break;
19082
19125
  }
19083
- o++, n2(t3) && (t3 === 13 && e2.charCodeAt(o) === 10 && o++, u++, f = o);
19126
+ o++, n(t2) && (t2 === 13 && e2.charCodeAt(o) === 10 && o++, u++, f = o);
19084
19127
  }
19085
- return i4 || (o++, m = 1), s = e2.substring(t2, o), l = 13;
19128
+ return i3 || (o++, m = 1), s = e2.substring(t, o), l = 13;
19086
19129
  }
19087
- return s += String.fromCharCode(i3), o++, l = 16;
19130
+ return s += String.fromCharCode(i2), o++, l = 16;
19088
19131
  case 45:
19089
- if (s += String.fromCharCode(i3), o++, o === a2 || !r2(e2.charCodeAt(o)))
19132
+ if (s += String.fromCharCode(i2), o++, o === a || !r(e2.charCodeAt(o)))
19090
19133
  return l = 16;
19091
19134
  case 48:
19092
19135
  case 49:
@@ -19100,8 +19143,8 @@ function e(e2, i2 = false) {
19100
19143
  case 57:
19101
19144
  return s += _(), l = 11;
19102
19145
  default:
19103
- for (;o < a2 && b(i3); )
19104
- o++, i3 = e2.charCodeAt(o);
19146
+ for (;o < a && b(i2); )
19147
+ o++, i2 = e2.charCodeAt(o);
19105
19148
  if (c !== o) {
19106
19149
  switch (s = e2.substring(c, o), s) {
19107
19150
  case `true`:
@@ -19113,11 +19156,11 @@ function e(e2, i2 = false) {
19113
19156
  }
19114
19157
  return l = 16;
19115
19158
  }
19116
- return s += String.fromCharCode(i3), o++, l = 16;
19159
+ return s += String.fromCharCode(i2), o++, l = 16;
19117
19160
  }
19118
19161
  }
19119
19162
  function b(e3) {
19120
- if (t2(e3) || n2(e3))
19163
+ if (t(e3) || n(e3))
19121
19164
  return false;
19122
19165
  switch (e3) {
19123
19166
  case 125:
@@ -19139,76 +19182,76 @@ function e(e2, i2 = false) {
19139
19182
  while (e3 >= 12 && e3 <= 15);
19140
19183
  return e3;
19141
19184
  }
19142
- return { setPosition: g, getPosition: () => o, scan: i2 ? x : y, getToken: () => l, getTokenValue: () => s, getTokenOffset: () => c, getTokenLength: () => o - c, getTokenStartLine: () => d, getTokenStartCharacter: () => c - p, getTokenError: () => m };
19185
+ return { setPosition: g, getPosition: () => o, scan: i ? x : y, getToken: () => l, getTokenValue: () => s, getTokenOffset: () => c, getTokenLength: () => o - c, getTokenStartLine: () => d, getTokenStartCharacter: () => c - p, getTokenError: () => m };
19143
19186
  }
19144
- function t2(e2) {
19187
+ function t(e2) {
19145
19188
  return e2 === 32 || e2 === 9;
19146
19189
  }
19147
- function n2(e2) {
19190
+ function n(e2) {
19148
19191
  return e2 === 10 || e2 === 13;
19149
19192
  }
19150
- function r2(e2) {
19193
+ function r(e2) {
19151
19194
  return e2 >= 48 && e2 <= 57;
19152
19195
  }
19153
- var i2;
19196
+ var i;
19154
19197
  (function(e2) {
19155
19198
  e2[e2.lineFeed = 10] = `lineFeed`, e2[e2.carriageReturn = 13] = `carriageReturn`, e2[e2.space = 32] = `space`, e2[e2._0 = 48] = `_0`, e2[e2._1 = 49] = `_1`, e2[e2._2 = 50] = `_2`, e2[e2._3 = 51] = `_3`, e2[e2._4 = 52] = `_4`, e2[e2._5 = 53] = `_5`, e2[e2._6 = 54] = `_6`, e2[e2._7 = 55] = `_7`, e2[e2._8 = 56] = `_8`, e2[e2._9 = 57] = `_9`, e2[e2.a = 97] = `a`, e2[e2.b = 98] = `b`, e2[e2.c = 99] = `c`, e2[e2.d = 100] = `d`, e2[e2.e = 101] = `e`, e2[e2.f = 102] = `f`, e2[e2.g = 103] = `g`, e2[e2.h = 104] = `h`, e2[e2.i = 105] = `i`, e2[e2.j = 106] = `j`, e2[e2.k = 107] = `k`, e2[e2.l = 108] = `l`, e2[e2.m = 109] = `m`, e2[e2.n = 110] = `n`, e2[e2.o = 111] = `o`, e2[e2.p = 112] = `p`, e2[e2.q = 113] = `q`, e2[e2.r = 114] = `r`, e2[e2.s = 115] = `s`, e2[e2.t = 116] = `t`, e2[e2.u = 117] = `u`, e2[e2.v = 118] = `v`, e2[e2.w = 119] = `w`, e2[e2.x = 120] = `x`, e2[e2.y = 121] = `y`, e2[e2.z = 122] = `z`, e2[e2.A = 65] = `A`, e2[e2.B = 66] = `B`, e2[e2.C = 67] = `C`, e2[e2.D = 68] = `D`, e2[e2.E = 69] = `E`, e2[e2.F = 70] = `F`, e2[e2.G = 71] = `G`, e2[e2.H = 72] = `H`, e2[e2.I = 73] = `I`, e2[e2.J = 74] = `J`, e2[e2.K = 75] = `K`, e2[e2.L = 76] = `L`, e2[e2.M = 77] = `M`, e2[e2.N = 78] = `N`, e2[e2.O = 79] = `O`, e2[e2.P = 80] = `P`, e2[e2.Q = 81] = `Q`, e2[e2.R = 82] = `R`, e2[e2.S = 83] = `S`, e2[e2.T = 84] = `T`, e2[e2.U = 85] = `U`, e2[e2.V = 86] = `V`, e2[e2.W = 87] = `W`, e2[e2.X = 88] = `X`, e2[e2.Y = 89] = `Y`, e2[e2.Z = 90] = `Z`, e2[e2.asterisk = 42] = `asterisk`, e2[e2.backslash = 92] = `backslash`, e2[e2.closeBrace = 125] = `closeBrace`, e2[e2.closeBracket = 93] = `closeBracket`, e2[e2.colon = 58] = `colon`, e2[e2.comma = 44] = `comma`, e2[e2.dot = 46] = `dot`, e2[e2.doubleQuote = 34] = `doubleQuote`, e2[e2.minus = 45] = `minus`, e2[e2.openBrace = 123] = `openBrace`, e2[e2.openBracket = 91] = `openBracket`, e2[e2.plus = 43] = `plus`, e2[e2.slash = 47] = `slash`, e2[e2.formFeed = 12] = `formFeed`, e2[e2.tab = 9] = `tab`;
19156
- })(i2 ||= {}), Array(20).fill(0).map((e2, t3) => ` `.repeat(t3)), Array(200).fill(0).map((e2, t3) => `
19157
- ` + ` `.repeat(t3)), Array(200).fill(0).map((e2, t3) => `\r` + ` `.repeat(t3)), Array(200).fill(0).map((e2, t3) => `\r
19158
- ` + ` `.repeat(t3)), Array(200).fill(0).map((e2, t3) => `
19159
- ` + ` `.repeat(t3)), Array(200).fill(0).map((e2, t3) => `\r` + ` `.repeat(t3)), Array(200).fill(0).map((e2, t3) => `\r
19160
- ` + ` `.repeat(t3));
19161
- var a2;
19199
+ })(i ||= {}), Array(20).fill(0).map((e2, t2) => ` `.repeat(t2)), Array(200).fill(0).map((e2, t2) => `
19200
+ ` + ` `.repeat(t2)), Array(200).fill(0).map((e2, t2) => `\r` + ` `.repeat(t2)), Array(200).fill(0).map((e2, t2) => `\r
19201
+ ` + ` `.repeat(t2)), Array(200).fill(0).map((e2, t2) => `
19202
+ ` + ` `.repeat(t2)), Array(200).fill(0).map((e2, t2) => `\r` + ` `.repeat(t2)), Array(200).fill(0).map((e2, t2) => `\r
19203
+ ` + ` `.repeat(t2));
19204
+ var a;
19162
19205
  (function(e2) {
19163
19206
  e2.DEFAULT = { allowTrailingComma: false };
19164
- })(a2 ||= {});
19165
- function o(e2, t3 = [], n3 = a2.DEFAULT) {
19166
- let r3 = null, i3 = [], o2 = [];
19207
+ })(a ||= {});
19208
+ function o(e2, t2 = [], n2 = a.DEFAULT) {
19209
+ let r2 = null, i2 = [], o2 = [];
19167
19210
  function s(e3) {
19168
- Array.isArray(i3) ? i3.push(e3) : r3 !== null && (i3[r3] = e3);
19211
+ Array.isArray(i2) ? i2.push(e3) : r2 !== null && (i2[r2] = e3);
19169
19212
  }
19170
19213
  return d(e2, { onObjectBegin: () => {
19171
19214
  let e3 = {};
19172
- s(e3), o2.push(i3), i3 = e3, r3 = null;
19215
+ s(e3), o2.push(i2), i2 = e3, r2 = null;
19173
19216
  }, onObjectProperty: (e3) => {
19174
- r3 = e3;
19217
+ r2 = e3;
19175
19218
  }, onObjectEnd: () => {
19176
- i3 = o2.pop();
19219
+ i2 = o2.pop();
19177
19220
  }, onArrayBegin: () => {
19178
19221
  let e3 = [];
19179
- s(e3), o2.push(i3), i3 = e3, r3 = null;
19222
+ s(e3), o2.push(i2), i2 = e3, r2 = null;
19180
19223
  }, onArrayEnd: () => {
19181
- i3 = o2.pop();
19182
- }, onLiteralValue: s, onError: (e3, n4, r4) => {
19183
- t3.push({ error: e3, offset: n4, length: r4 });
19184
- } }, n3), i3[0];
19224
+ i2 = o2.pop();
19225
+ }, onLiteralValue: s, onError: (e3, n3, r3) => {
19226
+ t2.push({ error: e3, offset: n3, length: r3 });
19227
+ } }, n2), i2[0];
19185
19228
  }
19186
- function d(t3, n3, r3 = a2.DEFAULT) {
19187
- let i3 = e(t3, false), o2 = [], s = 0;
19229
+ function d(t2, n2, r2 = a.DEFAULT) {
19230
+ let i2 = e(t2, false), o2 = [], s = 0;
19188
19231
  function c(e2) {
19189
- return e2 ? () => s === 0 && e2(i3.getTokenOffset(), i3.getTokenLength(), i3.getTokenStartLine(), i3.getTokenStartCharacter()) : () => true;
19232
+ return e2 ? () => s === 0 && e2(i2.getTokenOffset(), i2.getTokenLength(), i2.getTokenStartLine(), i2.getTokenStartCharacter()) : () => true;
19190
19233
  }
19191
19234
  function l(e2) {
19192
- return e2 ? (t4) => s === 0 && e2(t4, i3.getTokenOffset(), i3.getTokenLength(), i3.getTokenStartLine(), i3.getTokenStartCharacter()) : () => true;
19235
+ return e2 ? (t3) => s === 0 && e2(t3, i2.getTokenOffset(), i2.getTokenLength(), i2.getTokenStartLine(), i2.getTokenStartCharacter()) : () => true;
19193
19236
  }
19194
19237
  function u(e2) {
19195
- return e2 ? (t4) => s === 0 && e2(t4, i3.getTokenOffset(), i3.getTokenLength(), i3.getTokenStartLine(), i3.getTokenStartCharacter(), () => o2.slice()) : () => true;
19238
+ return e2 ? (t3) => s === 0 && e2(t3, i2.getTokenOffset(), i2.getTokenLength(), i2.getTokenStartLine(), i2.getTokenStartCharacter(), () => o2.slice()) : () => true;
19196
19239
  }
19197
19240
  function d2(e2) {
19198
19241
  return e2 ? () => {
19199
- s > 0 ? s++ : e2(i3.getTokenOffset(), i3.getTokenLength(), i3.getTokenStartLine(), i3.getTokenStartCharacter(), () => o2.slice()) === false && (s = 1);
19242
+ s > 0 ? s++ : e2(i2.getTokenOffset(), i2.getTokenLength(), i2.getTokenStartLine(), i2.getTokenStartCharacter(), () => o2.slice()) === false && (s = 1);
19200
19243
  } : () => true;
19201
19244
  }
19202
19245
  function f(e2) {
19203
19246
  return e2 ? () => {
19204
- s > 0 && s--, s === 0 && e2(i3.getTokenOffset(), i3.getTokenLength(), i3.getTokenStartLine(), i3.getTokenStartCharacter());
19247
+ s > 0 && s--, s === 0 && e2(i2.getTokenOffset(), i2.getTokenLength(), i2.getTokenStartLine(), i2.getTokenStartCharacter());
19205
19248
  } : () => true;
19206
19249
  }
19207
- let p = d2(n3.onObjectBegin), m = u(n3.onObjectProperty), h = f(n3.onObjectEnd), g = d2(n3.onArrayBegin), _ = f(n3.onArrayEnd), v = u(n3.onLiteralValue), y = l(n3.onSeparator), b = c(n3.onComment), x = l(n3.onError), S = r3 && r3.disallowComments, C = r3 && r3.allowTrailingComma;
19250
+ let p = d2(n2.onObjectBegin), m = u(n2.onObjectProperty), h = f(n2.onObjectEnd), g = d2(n2.onArrayBegin), _ = f(n2.onArrayEnd), v = u(n2.onLiteralValue), y = l(n2.onSeparator), b = c(n2.onComment), x = l(n2.onError), S = r2 && r2.disallowComments, C = r2 && r2.allowTrailingComma;
19208
19251
  function w() {
19209
19252
  for (;; ) {
19210
- let e2 = i3.scan();
19211
- switch (i3.getTokenError()) {
19253
+ let e2 = i2.scan();
19254
+ switch (i2.getTokenError()) {
19212
19255
  case 4:
19213
19256
  T(14);
19214
19257
  break;
@@ -19244,28 +19287,28 @@ function d(t3, n3, r3 = a2.DEFAULT) {
19244
19287
  }
19245
19288
  }
19246
19289
  }
19247
- function T(e2, t4 = [], n4 = []) {
19248
- if (x(e2), t4.length + n4.length > 0) {
19249
- let e3 = i3.getToken();
19290
+ function T(e2, t3 = [], n3 = []) {
19291
+ if (x(e2), t3.length + n3.length > 0) {
19292
+ let e3 = i2.getToken();
19250
19293
  for (;e3 !== 17; ) {
19251
- if (t4.indexOf(e3) !== -1) {
19294
+ if (t3.indexOf(e3) !== -1) {
19252
19295
  w();
19253
19296
  break;
19254
- } else if (n4.indexOf(e3) !== -1)
19297
+ } else if (n3.indexOf(e3) !== -1)
19255
19298
  break;
19256
19299
  e3 = w();
19257
19300
  }
19258
19301
  }
19259
19302
  }
19260
19303
  function E(e2) {
19261
- let t4 = i3.getTokenValue();
19262
- return e2 ? v(t4) : (m(t4), o2.push(t4)), w(), true;
19304
+ let t3 = i2.getTokenValue();
19305
+ return e2 ? v(t3) : (m(t3), o2.push(t3)), w(), true;
19263
19306
  }
19264
19307
  function D() {
19265
- switch (i3.getToken()) {
19308
+ switch (i2.getToken()) {
19266
19309
  case 11:
19267
- let e2 = i3.getTokenValue(), t4 = Number(e2);
19268
- isNaN(t4) && (T(2), t4 = 0), v(t4);
19310
+ let e2 = i2.getTokenValue(), t3 = Number(e2);
19311
+ isNaN(t3) && (T(2), t3 = 0), v(t3);
19269
19312
  break;
19270
19313
  case 7:
19271
19314
  v(null);
@@ -19282,36 +19325,36 @@ function d(t3, n3, r3 = a2.DEFAULT) {
19282
19325
  return w(), true;
19283
19326
  }
19284
19327
  function O() {
19285
- return i3.getToken() === 10 ? (E(false), i3.getToken() === 6 ? (y(`:`), w(), j() || T(4, [], [2, 5])) : T(5, [], [2, 5]), o2.pop(), true) : (T(3, [], [2, 5]), false);
19328
+ return i2.getToken() === 10 ? (E(false), i2.getToken() === 6 ? (y(`:`), w(), j() || T(4, [], [2, 5])) : T(5, [], [2, 5]), o2.pop(), true) : (T(3, [], [2, 5]), false);
19286
19329
  }
19287
19330
  function k() {
19288
19331
  p(), w();
19289
19332
  let e2 = false;
19290
- for (;i3.getToken() !== 2 && i3.getToken() !== 17; ) {
19291
- if (i3.getToken() === 5) {
19292
- if (e2 || T(4, [], []), y(`,`), w(), i3.getToken() === 2 && C)
19333
+ for (;i2.getToken() !== 2 && i2.getToken() !== 17; ) {
19334
+ if (i2.getToken() === 5) {
19335
+ if (e2 || T(4, [], []), y(`,`), w(), i2.getToken() === 2 && C)
19293
19336
  break;
19294
19337
  } else
19295
19338
  e2 && T(6, [], []);
19296
19339
  O() || T(4, [], [2, 5]), e2 = true;
19297
19340
  }
19298
- return h(), i3.getToken() === 2 ? w() : T(7, [2], []), true;
19341
+ return h(), i2.getToken() === 2 ? w() : T(7, [2], []), true;
19299
19342
  }
19300
19343
  function A() {
19301
19344
  g(), w();
19302
- let e2 = true, t4 = false;
19303
- for (;i3.getToken() !== 4 && i3.getToken() !== 17; ) {
19304
- if (i3.getToken() === 5) {
19305
- if (t4 || T(4, [], []), y(`,`), w(), i3.getToken() === 4 && C)
19345
+ let e2 = true, t3 = false;
19346
+ for (;i2.getToken() !== 4 && i2.getToken() !== 17; ) {
19347
+ if (i2.getToken() === 5) {
19348
+ if (t3 || T(4, [], []), y(`,`), w(), i2.getToken() === 4 && C)
19306
19349
  break;
19307
19350
  } else
19308
- t4 && T(6, [], []);
19309
- e2 ? (o2.push(0), e2 = false) : o2[o2.length - 1]++, j() || T(4, [], [4, 5]), t4 = true;
19351
+ t3 && T(6, [], []);
19352
+ e2 ? (o2.push(0), e2 = false) : o2[o2.length - 1]++, j() || T(4, [], [4, 5]), t3 = true;
19310
19353
  }
19311
- return _(), e2 || o2.pop(), i3.getToken() === 4 ? w() : T(8, [4], []), true;
19354
+ return _(), e2 || o2.pop(), i2.getToken() === 4 ? w() : T(8, [4], []), true;
19312
19355
  }
19313
19356
  function j() {
19314
- switch (i3.getToken()) {
19357
+ switch (i2.getToken()) {
19315
19358
  case 3:
19316
19359
  return A();
19317
19360
  case 1:
@@ -19322,7 +19365,7 @@ function d(t3, n3, r3 = a2.DEFAULT) {
19322
19365
  return D();
19323
19366
  }
19324
19367
  }
19325
- return w(), i3.getToken() === 17 ? r3.allowEmptyContent ? true : (T(4, [], []), false) : j() ? (i3.getToken() !== 17 && T(9, [], []), true) : (T(4, [], []), false);
19368
+ return w(), i2.getToken() === 17 ? r2.allowEmptyContent ? true : (T(4, [], []), false) : j() ? (i2.getToken() !== 17 && T(9, [], []), true) : (T(4, [], []), false);
19326
19369
  }
19327
19370
  var f;
19328
19371
  (function(e2) {
@@ -19337,11 +19380,21 @@ var h;
19337
19380
  (function(e2) {
19338
19381
  e2[e2.InvalidSymbol = 1] = `InvalidSymbol`, e2[e2.InvalidNumberFormat = 2] = `InvalidNumberFormat`, e2[e2.PropertyNameExpected = 3] = `PropertyNameExpected`, e2[e2.ValueExpected = 4] = `ValueExpected`, e2[e2.ColonExpected = 5] = `ColonExpected`, e2[e2.CommaExpected = 6] = `CommaExpected`, e2[e2.CloseBraceExpected = 7] = `CloseBraceExpected`, e2[e2.CloseBracketExpected = 8] = `CloseBracketExpected`, e2[e2.EndOfFileExpected = 9] = `EndOfFileExpected`, e2[e2.InvalidCommentToken = 10] = `InvalidCommentToken`, e2[e2.UnexpectedEndOfComment = 11] = `UnexpectedEndOfComment`, e2[e2.UnexpectedEndOfString = 12] = `UnexpectedEndOfString`, e2[e2.UnexpectedEndOfNumber = 13] = `UnexpectedEndOfNumber`, e2[e2.InvalidUnicode = 14] = `InvalidUnicode`, e2[e2.InvalidEscapeCharacter = 15] = `InvalidEscapeCharacter`, e2[e2.InvalidCharacter = 16] = `InvalidCharacter`;
19339
19382
  })(h ||= {});
19383
+ // node_modules/confbox/dist/_chunks/_format.mjs
19384
+ var t2 = Symbol.for(`__confbox_fmt__`);
19385
+ var n2 = /^(\s+)/;
19386
+ var r2 = /(\s+)$/;
19387
+ function i2(e2, t3 = {}) {
19388
+ return { sample: t3.indent === undefined && t3.preserveIndentation !== false && e2.slice(0, t3?.sampleSize || 1024), whiteSpace: t3.preserveWhitespace === false ? undefined : { start: n2.exec(e2)?.[0] || ``, end: r2.exec(e2)?.[0] || `` } };
19389
+ }
19390
+ function a2(e2, n3, r3) {
19391
+ !n3 || typeof n3 != `object` || Object.defineProperty(n3, t2, { enumerable: false, configurable: true, writable: true, value: i2(e2, r3) });
19392
+ }
19340
19393
 
19341
19394
  // node_modules/confbox/dist/jsonc.mjs
19342
19395
  function r3(n3, r4) {
19343
19396
  let i3 = m(n3, r4?.errors, r4);
19344
- return a(n3, i3, r4), i3;
19397
+ return a2(n3, i3, r4), i3;
19345
19398
  }
19346
19399
 
19347
19400
  // node_modules/confbox/dist/_chunks/libs/js-yaml.mjs
@@ -20504,7 +20557,7 @@ var Ln = Fn.dump;
20504
20557
  // node_modules/confbox/dist/yaml.mjs
20505
20558
  function i4(t4, r5) {
20506
20559
  let i5 = In(t4, r5);
20507
- return a(t4, i5, r5), i5;
20560
+ return a2(t4, i5, r5), i5;
20508
20561
  }
20509
20562
 
20510
20563
  // node_modules/confbox/dist/_chunks/libs/smol-toml.mjs
@@ -21107,9 +21160,8 @@ function T2(e5, { maxDepth: t5 = 1000, integersAsBigInt: r6 } = {}) {
21107
21160
  // node_modules/confbox/dist/toml.mjs
21108
21161
  function i6(t5) {
21109
21162
  let r6 = T2(t5);
21110
- return a(t5, r6, { preserveIndentation: false }), r6;
21163
+ return a2(t5, r6, { preserveIndentation: false }), r6;
21111
21164
  }
21112
-
21113
21165
  // src/core/configfile.ts
21114
21166
  init_state();
21115
21167
  function isCodeConfig(path) {
@@ -22251,7 +22303,7 @@ function settingsFromEnv(env) {
22251
22303
  function expand(value) {
22252
22304
  if (value === undefined)
22253
22305
  return {};
22254
- return Object.fromEntries(TARGET_IDS.map((t5) => [t5, value]));
22306
+ return Object.fromEntries(TARGET_IDS.map((t6) => [t6, value]));
22255
22307
  }
22256
22308
  }
22257
22309
  function stateEnv(env, suffix) {
@@ -22334,7 +22386,7 @@ function ruleBlockActions(setup, memoryPath, vars) {
22334
22386
  return actions;
22335
22387
  }
22336
22388
  function agentsMdOwners(setup) {
22337
- return (setup.rules ?? []).filter((r6) => r6.placement === "agents-md").map((r6) => ({ type: "rule", name: r6.name }));
22389
+ return (setup.rules ?? []).filter((r7) => r7.placement === "agents-md").map((r7) => ({ type: "rule", name: r7.name }));
22338
22390
  }
22339
22391
  function modelVars(setup, target) {
22340
22392
  return {
@@ -22354,7 +22406,7 @@ function installedListVars(setup, target) {
22354
22406
  `);
22355
22407
  const skills = setup.skills.map((s3) => `- ${s3.id}${tail(s3.description)}`).join(`
22356
22408
  `);
22357
- const tools = setup.tools.map((t5) => `- ${t5.id}${tail(t5.description)}`).join(`
22409
+ const tools = setup.tools.map((t6) => `- ${t6.id}${tail(t6.description)}`).join(`
22358
22410
  `);
22359
22411
  const mcps = setup.mcps.map((m4) => `- ${m4.id}${tail(m4.description)}`).join(`
22360
22412
  `);
@@ -22650,7 +22702,7 @@ var opencode = {
22650
22702
  }
22651
22703
  const instructionPaths = [];
22652
22704
  const instructionOwners = [];
22653
- const instructionRules = (setup.rules ?? []).filter((r6) => r6.placement === "instructions");
22705
+ const instructionRules = (setup.rules ?? []).filter((r7) => r7.placement === "instructions");
22654
22706
  for (const rule of instructionRules) {
22655
22707
  const filePath = join5(cfgDir, "rules", `${rule.name}.md`);
22656
22708
  actions.push(write(filePath, withManagedHeader(render(rule.content, vars, setup.flags))));
@@ -22661,7 +22713,7 @@ var opencode = {
22661
22713
  if (setup.agentsMdBlock && ctx.scope === "project") {
22662
22714
  const agentsMdEntry = relative4(ctx.projectDir, agentsMdPath);
22663
22715
  instructionPaths.unshift(agentsMdEntry);
22664
- const agentsMdRules = (setup.rules ?? []).filter((r6) => r6.placement === "agents-md");
22716
+ const agentsMdRules = (setup.rules ?? []).filter((r7) => r7.placement === "agents-md");
22665
22717
  for (const rule of agentsMdRules) {
22666
22718
  instructionOwners.push({ key: "instructions", value: agentsMdEntry, ruleName: rule.name });
22667
22719
  }
@@ -23125,7 +23177,7 @@ function fileContent(item, fallbackPath) {
23125
23177
  return file2.content;
23126
23178
  }
23127
23179
  function depNames(item, type) {
23128
- return (item.dependencies ?? []).filter((d4) => d4.startsWith(`${type}:`)).map((d4) => d4.slice(type.length + 1)).map((d4) => d4.includes("/") ? d4.slice(d4.lastIndexOf("/") + 1) : d4);
23180
+ return (item.dependencies ?? []).filter((d5) => d5.startsWith(`${type}:`)).map((d5) => d5.slice(type.length + 1)).map((d5) => d5.includes("/") ? d5.slice(d5.lastIndexOf("/") + 1) : d5);
23129
23181
  }
23130
23182
  function toAgentDef(item) {
23131
23183
  const cfg = item.config?.agents ?? {};
@@ -23299,7 +23351,7 @@ function assertRuleInvariants(rules) {
23299
23351
  }
23300
23352
  }
23301
23353
  function composeAgentsMdBlock(rules) {
23302
- const agentsMd = rules.filter((r6) => r6.placement === "agents-md");
23354
+ const agentsMd = rules.filter((r7) => r7.placement === "agents-md");
23303
23355
  if (agentsMd.length === 0)
23304
23356
  return null;
23305
23357
  const sorted = [...agentsMd].sort((a7, b3) => {
@@ -23307,7 +23359,7 @@ function composeAgentsMdBlock(rules) {
23307
23359
  const ob = b3.order ?? 100;
23308
23360
  return oa !== ob ? oa - ob : a7.name.localeCompare(b3.name);
23309
23361
  });
23310
- return sorted.map((r6) => r6.content).join(`
23362
+ return sorted.map((r7) => r7.content).join(`
23311
23363
 
23312
23364
  `);
23313
23365
  }
@@ -23387,7 +23439,7 @@ function planManifests(items, config2, ctx) {
23387
23439
  guardManifestPaths(items);
23388
23440
  const { vars, flags } = splitVars(config2.vars);
23389
23441
  const notes = [];
23390
- const byType = (t5) => items.filter((i8) => i8.type === t5);
23442
+ const byType = (t6) => items.filter((i8) => i8.type === t6);
23391
23443
  const presets = byType("preset");
23392
23444
  const agentOverrides = config2.agents ?? {};
23393
23445
  const agents = byType("agent").map(toAgentDef).map((a7) => applyAgentOverride(a7, agentOverrides[a7.id]));
@@ -23487,7 +23539,7 @@ function planManifests(items, config2, ctx) {
23487
23539
  validateVars(items, available);
23488
23540
  const missingTierModels = [...requiredTiers].filter((tier) => tierDefaults[tier] === undefined && settings.models[tier] === undefined);
23489
23541
  if (missingTierModels.length > 0) {
23490
- throw new Error(`Missing model id(s) for tier(s): ${missingTierModels.map((t5) => `model.${t5}`).sort().join(", ")}. Set them in agentz.json "vars".`);
23542
+ throw new Error(`Missing model id(s) for tier(s): ${missingTierModels.map((t6) => `model.${t6}`).sort().join(", ")}. Set them in agentz.json "vars".`);
23491
23543
  }
23492
23544
  const modelFor = (tier, target) => {
23493
23545
  try {
@@ -23505,7 +23557,7 @@ function planManifests(items, config2, ctx) {
23505
23557
  for (const [k2, v3] of Object.entries(vars))
23506
23558
  if (!k2.startsWith("model."))
23507
23559
  extraVars[k2] = v3;
23508
- const hasScratchpad = tools.some((t5) => t5.id === "scratchpad");
23560
+ const hasScratchpad = tools.some((t6) => t6.id === "scratchpad");
23509
23561
  const mergedFlags = {
23510
23562
  ...flags,
23511
23563
  ...installedFlags({ agents, tools, mcps }),
@@ -23521,7 +23573,7 @@ function planManifests(items, config2, ctx) {
23521
23573
  skillGroups: [],
23522
23574
  mcps: mcps.map((m4) => m4.id),
23523
23575
  ...lsps.length ? { lsps: lsps.map((l3) => l3.id) } : {},
23524
- tools: tools.map((t5) => t5.id),
23576
+ tools: tools.map((t6) => t6.id),
23525
23577
  agentsMd: effectiveAgentsMd,
23526
23578
  disableDefaults: effectiveDisableDefaults,
23527
23579
  scratchpad: hasScratchpad,
@@ -23536,7 +23588,7 @@ function planManifests(items, config2, ctx) {
23536
23588
  ...commands.length ? { commands } : {},
23537
23589
  ...Object.keys(opencodeSettings).length ? { opencodeSettings } : {},
23538
23590
  agentsMdBlock: effectiveAgentsMd ? agentsMdBlock : null,
23539
- rules: allRules.filter((r6) => r6.placement === "agents-md" ? effectiveAgentsMd : true),
23591
+ rules: allRules.filter((r7) => r7.placement === "agents-md" ? effectiveAgentsMd : true),
23540
23592
  notes,
23541
23593
  flags: mergedFlags,
23542
23594
  extraVars,
@@ -23641,7 +23693,7 @@ added ${items.length} item(s); lock updated.`));
23641
23693
  function forceOverwrite(plans) {
23642
23694
  return plans.map((plan) => ({
23643
23695
  ...plan,
23644
- actions: plan.actions.map((a9) => a9.kind === "write" && a9.overwrite === "ifManaged" ? { ...a9, overwrite: "always" } : a9)
23696
+ actions: plan.actions.map((a8) => a8.kind === "write" && a8.overwrite === "ifManaged" ? { ...a8, overwrite: "always" } : a8)
23645
23697
  }));
23646
23698
  }
23647
23699
  function buildLockItems(items, plans, lockRef, projectDir, results, prevLock) {
@@ -23650,25 +23702,25 @@ function buildLockItems(items, plans, lockRef, projectDir, results, prevLock) {
23650
23702
  const mergeActions = plans.flatMap((p6) => p6.actions).filter(isMergeJson);
23651
23703
  const ownedPath = (path2) => normalizeLockPath(path2, projectDir);
23652
23704
  const pathKey = (path2) => lockPathKey(ownedPath(path2));
23653
- const addedSet = results ? new Set(results.flatMap((r7) => (r7.addedArrayEntries ?? []).map((e5) => `${pathKey(r7.action.path)}\x00${e5.key}\x00${e5.value}\x00${e5.ruleName}`))) : null;
23654
- const addedObjSet = results ? new Set(results.flatMap((r7) => (r7.addedObjectEntries ?? []).map((e5) => `${pathKey(r7.action.path)}\x00${e5.key}\x00${e5.subKey}\x00${e5.ownerName}`))) : null;
23655
- const updatedObjSet = results ? new Set(results.flatMap((r7) => (r7.updatedObjectEntries ?? []).map((e5) => `${pathKey(r7.action.path)}\x00${e5.key}\x00${e5.subKey}\x00${e5.ownerName}`))) : null;
23705
+ const addedSet = results ? new Set(results.flatMap((r8) => (r8.addedArrayEntries ?? []).map((e6) => `${pathKey(r8.action.path)}\x00${e6.key}\x00${e6.value}\x00${e6.ruleName}`))) : null;
23706
+ const addedObjSet = results ? new Set(results.flatMap((r8) => (r8.addedObjectEntries ?? []).map((e6) => `${pathKey(r8.action.path)}\x00${e6.key}\x00${e6.subKey}\x00${e6.ownerName}`))) : null;
23707
+ const updatedObjSet = results ? new Set(results.flatMap((r8) => (r8.updatedObjectEntries ?? []).map((e6) => `${pathKey(r8.action.path)}\x00${e6.key}\x00${e6.subKey}\x00${e6.ownerName}`))) : null;
23656
23708
  const writtenSideAssets = results ? new Set(results.filter((result) => result.action.kind === "write" && result.action.sideAsset === true && (result.status === "created" || result.status === "updated")).map((result) => pathKey(result.action.path))) : null;
23657
23709
  const previouslyOwnedSideAssets = new Set((prevLock?.items ?? []).flatMap((item) => item.files.filter((file2) => file2.sideAsset).map((file2) => `${lockPathKey(file2)}\x00${file2.hash}`)));
23658
23710
  const prevByRef = new Map(prevLock?.items.map((i9) => [i9.ref, i9]) ?? []);
23659
- const prevOwnedKey = (ref) => new Set((prevByRef.get(ref)?.jsonEntries ?? []).map((e5) => `${lockPathKey(e5)}\x00${e5.key}\x00${e5.value}`));
23660
- const anyPrevOwned = new Set((prevLock?.items ?? []).flatMap((i9) => (i9.jsonEntries ?? []).map((e5) => `${lockPathKey(e5)}\x00${e5.key}\x00${e5.value}`)));
23661
- const prevOwnedObjKey = (ref) => new Set((prevByRef.get(ref)?.objectEntries ?? []).map((e5) => `${lockPathKey(e5)}\x00${e5.key}\x00${e5.subKey}\x00${e5.value ?? ""}`));
23711
+ const prevOwnedKey = (ref) => new Set((prevByRef.get(ref)?.jsonEntries ?? []).map((e6) => `${lockPathKey(e6)}\x00${e6.key}\x00${e6.value}`));
23712
+ const anyPrevOwned = new Set((prevLock?.items ?? []).flatMap((i9) => (i9.jsonEntries ?? []).map((e6) => `${lockPathKey(e6)}\x00${e6.key}\x00${e6.value}`)));
23713
+ const prevOwnedObjKey = (ref) => new Set((prevByRef.get(ref)?.objectEntries ?? []).map((e6) => `${lockPathKey(e6)}\x00${e6.key}\x00${e6.subKey}\x00${e6.value ?? ""}`));
23662
23714
  const anyPrevOwnedObj = new Set((prevLock?.items ?? []).flatMap((item) => (item.objectEntries ?? []).filter((entry) => entry.value !== undefined).map((entry) => `${lockPathKey(entry)}\x00${entry.key}\x00${entry.subKey}\x00${entry.value}`)));
23663
23715
  const out = [];
23664
23716
  for (const item of items) {
23665
- const m5 = item.manifest;
23717
+ const m6 = item.manifest;
23666
23718
  const ref = lockRef(item);
23667
23719
  const prevOwned = prevOwnedKey(ref);
23668
- const owned = writeActions.filter((a9) => ownsWriteAction(m5.name, m5.type, a9));
23669
- const files = owned.map((a9) => ({
23670
- action: a9,
23671
- entry: fileEntry(a9.path, projectDir, manifestLogical(m5, a9.path), a9.sideAsset === true)
23720
+ const owned = writeActions.filter((a8) => ownsWriteAction(m6.name, m6.type, a8));
23721
+ const files = owned.map((a8) => ({
23722
+ action: a8,
23723
+ entry: fileEntry(a8.path, projectDir, manifestLogical(m6, a8.path), a8.sideAsset === true)
23672
23724
  })).filter((candidate) => {
23673
23725
  if (candidate.entry === null)
23674
23726
  return false;
@@ -23676,19 +23728,19 @@ function buildLockItems(items, plans, lockRef, projectDir, results, prevLock) {
23676
23728
  return true;
23677
23729
  return writtenSideAssets.has(pathKey(candidate.action.path)) || previouslyOwnedSideAssets.has(`${lockPathKey(candidate.entry)}\x00${candidate.entry.hash}`);
23678
23730
  }).map((candidate) => candidate.entry);
23679
- const blocks = blockActions.filter((action) => ownsBlockAction(m5, action)).map((action) => ({
23731
+ const blocks = blockActions.filter((action) => ownsBlockAction(m6, action)).map((action) => ({
23680
23732
  ...ownedPath(action.path),
23681
23733
  marker: action.marker,
23682
23734
  comment: action.comment,
23683
23735
  hash: hashContent(blockText(action.marker, action.content, action.comment))
23684
23736
  }));
23685
- const jsonEntries = m5.type === "rule" ? mergeActions.flatMap((a9) => (a9.arrayEntries ?? []).filter((e5) => e5.ruleName === m5.name).filter((e5) => addedSet === null || addedSet.has(`${pathKey(a9.path)}\x00${e5.key}\x00${e5.value}\x00${e5.ruleName}`) || prevOwned.has(`${pathKey(a9.path)}\x00${e5.key}\x00${e5.value}`) || anyPrevOwned.has(`${pathKey(a9.path)}\x00${e5.key}\x00${e5.value}`)).map((e5) => ({ ...ownedPath(a9.path), key: e5.key, value: e5.value }))) : [];
23737
+ const jsonEntries = m6.type === "rule" ? mergeActions.flatMap((a8) => (a8.arrayEntries ?? []).filter((e6) => e6.ruleName === m6.name).filter((e6) => addedSet === null || addedSet.has(`${pathKey(a8.path)}\x00${e6.key}\x00${e6.value}\x00${e6.ruleName}`) || prevOwned.has(`${pathKey(a8.path)}\x00${e6.key}\x00${e6.value}`) || anyPrevOwned.has(`${pathKey(a8.path)}\x00${e6.key}\x00${e6.value}`)).map((e6) => ({ ...ownedPath(a8.path), key: e6.key, value: e6.value }))) : [];
23686
23738
  const prevOwnedObj = prevOwnedObjKey(ref);
23687
- const objectEntries = m5.type === "lsp" || m5.type === "mcp" || m5.type === "tool" ? mergeActions.flatMap((a9) => (a9.objectEntries ?? []).filter((e5) => e5.ownerName === m5.name).filter((e5) => addedObjSet === null || addedObjSet.has(`${pathKey(a9.path)}\x00${e5.key}\x00${e5.subKey}\x00${e5.ownerName}`) || updatedObjSet?.has(`${pathKey(a9.path)}\x00${e5.key}\x00${e5.subKey}\x00${e5.ownerName}`) || prevOwnedObj.has(`${pathKey(a9.path)}\x00${e5.key}\x00${e5.subKey}\x00${e5.value}`) || anyPrevOwnedObj.has(`${pathKey(a9.path)}\x00${e5.key}\x00${e5.subKey}\x00${e5.value}`)).map((e5) => ({ ...ownedPath(a9.path), key: e5.key, subKey: e5.subKey, value: e5.value }))) : [];
23688
- const sourceHash = manifestSourceHash(m5.files);
23739
+ const objectEntries = m6.type === "lsp" || m6.type === "mcp" || m6.type === "tool" ? mergeActions.flatMap((a8) => (a8.objectEntries ?? []).filter((e6) => e6.ownerName === m6.name).filter((e6) => addedObjSet === null || addedObjSet.has(`${pathKey(a8.path)}\x00${e6.key}\x00${e6.subKey}\x00${e6.ownerName}`) || updatedObjSet?.has(`${pathKey(a8.path)}\x00${e6.key}\x00${e6.subKey}\x00${e6.ownerName}`) || prevOwnedObj.has(`${pathKey(a8.path)}\x00${e6.key}\x00${e6.subKey}\x00${e6.value}`) || anyPrevOwnedObj.has(`${pathKey(a8.path)}\x00${e6.key}\x00${e6.subKey}\x00${e6.value}`)).map((e6) => ({ ...ownedPath(a8.path), key: e6.key, subKey: e6.subKey, value: e6.value }))) : [];
23740
+ const sourceHash = manifestSourceHash(m6.files);
23689
23741
  out.push({
23690
23742
  ref,
23691
- ...m5.version ? { version: m5.version } : {},
23743
+ ...m6.version ? { version: m6.version } : {},
23692
23744
  registry: item.registryLabel,
23693
23745
  files,
23694
23746
  ...blocks.length ? { blocks } : {},
@@ -23699,14 +23751,14 @@ function buildLockItems(items, plans, lockRef, projectDir, results, prevLock) {
23699
23751
  }
23700
23752
  return out;
23701
23753
  }
23702
- function isWrite(a9) {
23703
- return a9.kind === "write";
23754
+ function isWrite(a8) {
23755
+ return a8.kind === "write";
23704
23756
  }
23705
- function isAppendBlock(a9) {
23706
- return a9.kind === "append-block";
23757
+ function isAppendBlock(a8) {
23758
+ return a8.kind === "append-block";
23707
23759
  }
23708
- function isMergeJson(a9) {
23709
- return a9.kind === "merge-json";
23760
+ function isMergeJson(a8) {
23761
+ return a8.kind === "merge-json";
23710
23762
  }
23711
23763
  function ownsBlockAction(manifest, action) {
23712
23764
  if (action.owners?.some((owner) => owner.type === manifest.type && owner.name === manifest.name)) {
@@ -23764,33 +23816,33 @@ async function lockedAgentsMdRuleManifests(sources, lock, present) {
23764
23816
  const { items } = await sources.resolve(found);
23765
23817
  const out = [];
23766
23818
  for (const it2 of items) {
23767
- const m5 = it2.manifest;
23768
- if (m5.type !== "rule")
23819
+ const m6 = it2.manifest;
23820
+ if (m6.type !== "rule")
23769
23821
  continue;
23770
- if (presentRuleNames.has(m5.name))
23822
+ if (presentRuleNames.has(m6.name))
23771
23823
  continue;
23772
- if (rulePlacement(m5) !== "agents-md")
23824
+ if (rulePlacement(m6) !== "agents-md")
23773
23825
  continue;
23774
- out.push(m5);
23775
- presentRuleNames.add(m5.name);
23826
+ out.push(m6);
23827
+ presentRuleNames.add(m6.name);
23776
23828
  }
23777
23829
  return out;
23778
23830
  }
23779
- function rulePlacement(m5) {
23780
- const raw = m5.config?.rules?.placement;
23831
+ function rulePlacement(m6) {
23832
+ const raw = m6.config?.rules?.placement;
23781
23833
  if (raw === "agents-md" || raw === "instructions")
23782
23834
  return raw;
23783
- return m5.files?.some((f5) => f5.path === "AGENTS.md") ? "agents-md" : "instructions";
23835
+ return m6.files?.some((f5) => f5.path === "AGENTS.md") ? "agents-md" : "instructions";
23784
23836
  }
23785
- function ruleContradicts(m5) {
23786
- const raw = m5.meta?.contradicts;
23837
+ function ruleContradicts(m6) {
23838
+ const raw = m6.meta?.contradicts;
23787
23839
  return Array.isArray(raw) ? raw.filter((x4) => typeof x4 === "string") : [];
23788
23840
  }
23789
23841
  async function warnRuleContradictions(sources, present, lock) {
23790
23842
  const batch = present.filter((i9) => i9.manifest.type === "rule").map((i9) => i9.manifest);
23791
23843
  if (batch.length === 0)
23792
23844
  return;
23793
- const batchNames = new Set(batch.map((m5) => m5.name));
23845
+ const batchNames = new Set(batch.map((m6) => m6.name));
23794
23846
  const lockedRuleRefs = lock.items.map((i9) => i9.ref).filter((ref) => /(?:^|\/)rule:[a-z0-9][a-z0-9-]*$/.test(ref));
23795
23847
  const installed = [];
23796
23848
  if (lockedRuleRefs.length > 0) {
@@ -23798,15 +23850,15 @@ async function warnRuleContradictions(sources, present, lock) {
23798
23850
  if (found.length > 0) {
23799
23851
  const { items } = await sources.resolve(found);
23800
23852
  for (const it2 of items) {
23801
- const m5 = it2.manifest;
23802
- if (m5.type === "rule" && !batchNames.has(m5.name))
23803
- installed.push(m5);
23853
+ const m6 = it2.manifest;
23854
+ if (m6.type === "rule" && !batchNames.has(m6.name))
23855
+ installed.push(m6);
23804
23856
  }
23805
23857
  }
23806
23858
  }
23807
23859
  const byName = new Map;
23808
- for (const m5 of [...installed, ...batch])
23809
- byName.set(m5.name, m5);
23860
+ for (const m6 of [...installed, ...batch])
23861
+ byName.set(m6.name, m6);
23810
23862
  const seenPairs = new Set;
23811
23863
  const warn = (incoming, other, otherInstalled) => {
23812
23864
  const key = [incoming.name, other.name].sort().join("|");
@@ -23831,9 +23883,9 @@ async function warnRuleContradictions(sources, present, lock) {
23831
23883
  async function noteGroupOnlySkills(refs, items, sources) {
23832
23884
  const askedNames = new Set;
23833
23885
  for (const raw of refs) {
23834
- const m5 = /(?:^|\/)(?:skill:)?([a-z0-9][a-z0-9-]*)$/.exec(raw.trim());
23835
- if (m5)
23836
- askedNames.add(m5[1]);
23886
+ const m6 = /(?:^|\/)(?:skill:)?([a-z0-9][a-z0-9-]*)$/.exec(raw.trim());
23887
+ if (m6)
23888
+ askedNames.add(m6[1]);
23837
23889
  }
23838
23890
  const groupOnly = items.filter((it2) => it2.manifest.type === "skill" && it2.manifest.standalone === false && askedNames.has(it2.manifest.name));
23839
23891
  if (groupOnly.length === 0)
@@ -23974,9 +24026,9 @@ function renderPreview(p6) {
23974
24026
  row("AGENTS.md", agentsMdText(p6.agentsMd));
23975
24027
  out.push("");
23976
24028
  head(`agents (${p6.agents.length})`);
23977
- for (const a9 of p6.agents) {
23978
- const effort = a9.reasoningEffort ? pc6.dim(` effort=${a9.reasoningEffort}`) : "";
23979
- out.push(` ${a9.id.padEnd(20)} ${pc6.dim(a9.tier.padEnd(7))} ${a9.model}${effort}`);
24029
+ for (const a8 of p6.agents) {
24030
+ const effort = a8.reasoningEffort ? pc6.dim(` effort=${a8.reasoningEffort}`) : "";
24031
+ out.push(` ${a8.id.padEnd(20)} ${pc6.dim(a8.tier.padEnd(7))} ${a8.model}${effort}`);
23980
24032
  }
23981
24033
  section(out, "skills", p6.skills);
23982
24034
  section(out, "tools", p6.tools);
@@ -23985,12 +24037,12 @@ function renderPreview(p6) {
23985
24037
  if (p6.mcps.length > 0) {
23986
24038
  out.push("");
23987
24039
  head(`MCP servers (${p6.mcps.length})`);
23988
- for (const m5 of p6.mcps)
23989
- out.push(` ${m5.id.padEnd(20)} ${pc6.dim(m5.detail)}`);
24040
+ for (const m6 of p6.mcps)
24041
+ out.push(` ${m6.id.padEnd(20)} ${pc6.dim(m6.detail)}`);
23990
24042
  }
23991
24043
  section(out, "language servers", p6.lsps);
23992
24044
  out.push("");
23993
- const files = Object.entries(p6.fileCounts).map(([t6, n6]) => `${t6}:${n6}`).join(" ");
24045
+ const files = Object.entries(p6.fileCounts).map(([t7, n8]) => `${t7}:${n8}`).join(" ");
23994
24046
  row("file actions", files || "none");
23995
24047
  for (const note2 of p6.notes)
23996
24048
  out.push(pc6.dim(` note: ${note2}`));
@@ -24144,7 +24196,7 @@ async function buildPreview(sources, ctx, state) {
24144
24196
  const items = filterExcluded(resolved, state);
24145
24197
  const config2 = buildConfig(state);
24146
24198
  const packInfo = normalizeModelPack(state.modelPack);
24147
- const lock = await Promise.resolve().then(() => (init_shared(), exports_shared)).then((m5) => m5.loadLock(ctx.projectDir));
24199
+ const lock = await Promise.resolve().then(() => (init_shared(), exports_shared)).then((m6) => m6.loadLock(ctx.projectDir));
24148
24200
  const fallbackModels = await fallbackTierModels(sources, lock);
24149
24201
  const agentsMdBool = agentsModeToBool(state.agentsMd);
24150
24202
  const { setup, plans, notes } = planManifests(items.map((i9) => i9.manifest), {
@@ -24164,40 +24216,40 @@ async function buildPreview(sources, ctx, state) {
24164
24216
  targets: state.targets,
24165
24217
  scope: ctx.scope,
24166
24218
  agentsMd: previewAgentsMd(setup),
24167
- agents: setup.agents.map((a9) => ({
24168
- id: a9.id,
24169
- label: a9.label,
24170
- tier: a9.tier,
24171
- model: setup.modelForAgent(a9, target),
24172
- ...a9.thinking?.reasoningEffort ? { reasoningEffort: a9.thinking.reasoningEffort } : {}
24219
+ agents: setup.agents.map((a8) => ({
24220
+ id: a8.id,
24221
+ label: a8.label,
24222
+ tier: a8.tier,
24223
+ model: setup.modelForAgent(a8, target),
24224
+ ...a8.thinking?.reasoningEffort ? { reasoningEffort: a8.thinking.reasoningEffort } : {}
24173
24225
  })),
24174
24226
  skills: setup.skills.map((s3) => ({ id: s3.id, label: s3.label })),
24175
- tools: setup.tools.map((t6) => ({ id: t6.id, label: t6.label })),
24227
+ tools: setup.tools.map((t7) => ({ id: t7.id, label: t7.label })),
24176
24228
  plugins: (setup.plugins ?? []).map((p6) => ({ id: p6.id, label: p6.label })),
24177
24229
  commands: (setup.commands ?? []).map((c5) => ({ id: c5.id, label: c5.label })),
24178
24230
  rules: previewRules(setup.rules ?? []),
24179
- mcps: setup.mcps.map((m5) => ({ id: m5.id, label: m5.label, detail: mcpDetail(m5) })),
24231
+ mcps: setup.mcps.map((m6) => ({ id: m6.id, label: m6.label, detail: mcpDetail(m6) })),
24180
24232
  lsps: (setup.lsps ?? []).map((l4) => ({ id: l4.id, label: l4.label })),
24181
- fileCounts: Object.fromEntries(plans.map((p6) => [p6.target, p6.actions.filter((a9) => a9.kind !== "remove-block").length])),
24233
+ fileCounts: Object.fromEntries(plans.map((p6) => [p6.target, p6.actions.filter((a8) => a8.kind !== "remove-block").length])),
24182
24234
  notes: packInfo.note ? [packInfo.note, ...notes] : notes
24183
24235
  };
24184
24236
  return { preview, items, setup, plans };
24185
24237
  }
24186
24238
  function previewRules(rules) {
24187
- const names = new Set(rules.map((r7) => r7.name));
24239
+ const names = new Set(rules.map((r8) => r8.name));
24188
24240
  const edges = new Map;
24189
- const link = (a9, b5) => {
24190
- if (a9 === b5 || !names.has(a9) || !names.has(b5))
24241
+ const link = (a8, b5) => {
24242
+ if (a8 === b5 || !names.has(a8) || !names.has(b5))
24191
24243
  return;
24192
- (edges.get(a9) ?? edges.set(a9, new Set).get(a9)).add(b5);
24193
- (edges.get(b5) ?? edges.set(b5, new Set).get(b5)).add(a9);
24244
+ (edges.get(a8) ?? edges.set(a8, new Set).get(a8)).add(b5);
24245
+ (edges.get(b5) ?? edges.set(b5, new Set).get(b5)).add(a8);
24194
24246
  };
24195
- for (const r7 of rules)
24196
- for (const other of r7.contradicts ?? [])
24197
- link(r7.name, other);
24198
- return rules.filter((r7) => r7.placement !== "agents-md").map((r7) => {
24199
- const conflicts = [...edges.get(r7.name) ?? []].sort();
24200
- return { id: r7.name, label: r7.name, ...conflicts.length ? { contradicts: conflicts } : {} };
24247
+ for (const r8 of rules)
24248
+ for (const other of r8.contradicts ?? [])
24249
+ link(r8.name, other);
24250
+ return rules.filter((r8) => r8.placement !== "agents-md").map((r8) => {
24251
+ const conflicts = [...edges.get(r8.name) ?? []].sort();
24252
+ return { id: r8.name, label: r8.name, ...conflicts.length ? { contradicts: conflicts } : {} };
24201
24253
  });
24202
24254
  }
24203
24255
  function previewAgentsMd(setup) {
@@ -24205,8 +24257,8 @@ function previewAgentsMd(setup) {
24205
24257
  return false;
24206
24258
  return setup.flags.agentsMdFull ? "full" : "lean";
24207
24259
  }
24208
- function mcpDetail(m5) {
24209
- const withOpts = applyMcpOptions(m5, undefined);
24260
+ function mcpDetail(m6) {
24261
+ const withOpts = applyMcpOptions(m6, undefined);
24210
24262
  if (withOpts.transport.type === "local")
24211
24263
  return withOpts.transport.command.join(" ");
24212
24264
  return withOpts.transport.url;
@@ -24229,24 +24281,24 @@ function applyTweak(state, tweak) {
24229
24281
  };
24230
24282
  switch (tweak.kind) {
24231
24283
  case "agentModel": {
24232
- const a9 = next.agents[tweak.agentId] ??= {};
24284
+ const a8 = next.agents[tweak.agentId] ??= {};
24233
24285
  if (tweak.model)
24234
- a9.model = tweak.model;
24286
+ a8.model = tweak.model;
24235
24287
  else
24236
- delete a9.model;
24288
+ delete a8.model;
24237
24289
  pruneAgent(next.agents, tweak.agentId);
24238
24290
  return next;
24239
24291
  }
24240
24292
  case "agentEffort": {
24241
- const a9 = next.agents[tweak.agentId] ??= {};
24293
+ const a8 = next.agents[tweak.agentId] ??= {};
24242
24294
  if (tweak.effort)
24243
- a9.thinking = { ...a9.thinking ?? {}, reasoningEffort: tweak.effort };
24244
- else if (a9.thinking) {
24245
- const { reasoningEffort: _drop, ...rest } = a9.thinking;
24295
+ a8.thinking = { ...a8.thinking ?? {}, reasoningEffort: tweak.effort };
24296
+ else if (a8.thinking) {
24297
+ const { reasoningEffort: _drop, ...rest } = a8.thinking;
24246
24298
  if (Object.keys(rest).length)
24247
- a9.thinking = rest;
24299
+ a8.thinking = rest;
24248
24300
  else
24249
- delete a9.thinking;
24301
+ delete a8.thinking;
24250
24302
  }
24251
24303
  pruneAgent(next.agents, tweak.agentId);
24252
24304
  return next;
@@ -24257,7 +24309,7 @@ function applyTweak(state, tweak) {
24257
24309
  if (tweak.excluded && !has)
24258
24310
  list2.push(tweak.name);
24259
24311
  if (!tweak.excluded && has)
24260
- next.excluded[tweak.toggle] = list2.filter((n6) => n6 !== tweak.name);
24312
+ next.excluded[tweak.toggle] = list2.filter((n8) => n8 !== tweak.name);
24261
24313
  return next;
24262
24314
  }
24263
24315
  case "tierEffort": {
@@ -24317,10 +24369,10 @@ async function runWizardPrompts(ctx, detected) {
24317
24369
  p6.intro(pc7.bgCyan(pc7.black(" agentz init ")));
24318
24370
  const targets = await p6.multiselect({
24319
24371
  message: "Install for which frameworks?",
24320
- options: adapters.map((a9) => ({
24321
- value: a9.id,
24322
- label: a9.label,
24323
- ...detected.includes(a9.id) ? { hint: "detected" } : {}
24372
+ options: adapters.map((a8) => ({
24373
+ value: a8.id,
24374
+ label: a8.label,
24375
+ ...detected.includes(a8.id) ? { hint: "detected" } : {}
24324
24376
  })),
24325
24377
  initialValues: detected.length > 0 ? detected : ["opencode"],
24326
24378
  required: true
@@ -24411,7 +24463,7 @@ async function runTweak(p6, action, state, preview, presets, packHints) {
24411
24463
  return state;
24412
24464
  const model = await p6.text({
24413
24465
  message: `Model id for "${agentId}"? (blank = keep default)`,
24414
- placeholder: preview.agents.find((a9) => a9.id === agentId)?.model ?? ""
24466
+ placeholder: preview.agents.find((a8) => a8.id === agentId)?.model ?? ""
24415
24467
  });
24416
24468
  if (p6.isCancel(model))
24417
24469
  return null;
@@ -24430,7 +24482,7 @@ async function runTweak(p6, action, state, preview, presets, packHints) {
24430
24482
  message: `Reasoning effort for "${agentId}"?`,
24431
24483
  options: [
24432
24484
  { value: "", label: "(default)" },
24433
- ...REASONING_EFFORTS.map((e5) => ({ value: e5, label: e5 }))
24485
+ ...REASONING_EFFORTS.map((e6) => ({ value: e6, label: e6 }))
24434
24486
  ],
24435
24487
  initialValue: ""
24436
24488
  });
@@ -24461,7 +24513,7 @@ async function runTweak(p6, action, state, preview, presets, packHints) {
24461
24513
  case "targets": {
24462
24514
  const targets = await p6.multiselect({
24463
24515
  message: "Install for which frameworks?",
24464
- options: adapters.map((a9) => ({ value: a9.id, label: a9.label })),
24516
+ options: adapters.map((a8) => ({ value: a8.id, label: a8.label })),
24465
24517
  initialValues: state.targets,
24466
24518
  required: true
24467
24519
  });
@@ -24518,7 +24570,7 @@ async function pickAgent(p6, preview) {
24518
24570
  return null;
24519
24571
  const id = await p6.select({
24520
24572
  message: "Which agent?",
24521
- options: preview.agents.map((a9) => ({ value: a9.id, label: a9.id, hint: a9.model }))
24573
+ options: preview.agents.map((a8) => ({ value: a8.id, label: a8.id, hint: a8.model }))
24522
24574
  });
24523
24575
  if (p6.isCancel(id))
24524
24576
  return null;
@@ -24542,7 +24594,7 @@ async function toggleItems(p6, state, preview) {
24542
24594
  const group2 = kinds.find((k2) => k2.kind === kind);
24543
24595
  const present = new Set(group2.items.map((i9) => i9.id));
24544
24596
  const conflictLabel = (i9) => {
24545
- const active = (i9.contradicts ?? []).filter((n6) => present.has(n6));
24597
+ const active = (i9.contradicts ?? []).filter((n8) => present.has(n8));
24546
24598
  return active.length ? `${i9.id} (contradicts ${active.join(", ")})` : i9.id;
24547
24599
  };
24548
24600
  const keep = await p6.multiselect({
@@ -24590,7 +24642,7 @@ async function askMcpOptions(p6, sources, state) {
24590
24642
  return out;
24591
24643
  }
24592
24644
  function presetSummaries(index) {
24593
- return index.items.filter((i9) => i9.type === "preset").sort((a9, b5) => a9.name.localeCompare(b5.name));
24645
+ return index.items.filter((i9) => i9.type === "preset").sort((a8, b5) => a8.name.localeCompare(b5.name));
24594
24646
  }
24595
24647
  async function packTierHints(sources) {
24596
24648
  const out = {};
@@ -24674,7 +24726,7 @@ async function runInteractive(opts) {
24674
24726
  if (nonJson.length > 0) {
24675
24727
  throw new Error(`This project uses ${nonJson.map((f5) => `agentz.${f5.format}`).join(", ")}. ` + "init only writes agentz.json \u2014 edit that file by hand and run `agentz update`.");
24676
24728
  }
24677
- const detected = adapters.filter((a9) => a9.detect(ctx)).map((a9) => a9.id);
24729
+ const detected = adapters.filter((a8) => a8.detect(ctx)).map((a8) => a8.id);
24678
24730
  const state = await runWizardPrompts(ctx, detected);
24679
24731
  if (state === null)
24680
24732
  return;
@@ -24733,14 +24785,14 @@ installed ${items.length} item(s); lock written.`));
24733
24785
  });
24734
24786
  }
24735
24787
  function bareName(ref) {
24736
- const t6 = ref.trim();
24737
- const afterNs = t6.includes("/preset:") ? t6.slice(t6.indexOf("/preset:") + 8) : t6;
24788
+ const t7 = ref.trim();
24789
+ const afterNs = t7.includes("/preset:") ? t7.slice(t7.indexOf("/preset:") + 8) : t7;
24738
24790
  return afterNs.startsWith("preset:") ? afterNs.slice("preset:".length) : afterNs;
24739
24791
  }
24740
24792
  function pickTargets(explicit, ctx) {
24741
24793
  if (explicit && explicit.length > 0)
24742
24794
  return explicit;
24743
- const detected = adapters.filter((a9) => a9.detect(ctx)).map((a9) => a9.id);
24795
+ const detected = adapters.filter((a8) => a8.detect(ctx)).map((a8) => a8.id);
24744
24796
  return detected.length > 0 ? detected : ["opencode"];
24745
24797
  }
24746
24798
  function configScope(scope) {
@@ -24777,7 +24829,7 @@ var TARGET_DIR_DEFAULTS = {
24777
24829
  };
24778
24830
  async function prune(opts) {
24779
24831
  const { ctx } = opts;
24780
- const targetIds = opts.targets && opts.targets.length > 0 ? opts.targets : adapters.filter((a9) => a9.detect(ctx)).map((a9) => a9.id);
24832
+ const targetIds = opts.targets && opts.targets.length > 0 ? opts.targets : adapters.filter((a8) => a8.detect(ctx)).map((a8) => a8.id);
24781
24833
  const seenBase = new Set;
24782
24834
  const victims = [];
24783
24835
  for (const id of targetIds) {
@@ -24883,7 +24935,7 @@ function unmirroredEntries(base, singular) {
24883
24935
  const singularEntries = readdirSync2(join15(base, singular));
24884
24936
  const pluralDir = join15(base, `${singular}s`);
24885
24937
  const pluralEntries = new Set(existsSync13(pluralDir) ? readdirSync2(pluralDir) : []);
24886
- return singularEntries.filter((n6) => !pluralEntries.has(n6));
24938
+ return singularEntries.filter((n8) => !pluralEntries.has(n8));
24887
24939
  } catch {
24888
24940
  return [];
24889
24941
  }
@@ -25041,7 +25093,7 @@ function flatten(raw) {
25041
25093
  });
25042
25094
  }
25043
25095
  }
25044
- return out.sort((a9, b5) => a9.id.localeCompare(b5.id));
25096
+ return out.sort((a8, b5) => a8.id.localeCompare(b5.id));
25045
25097
  }
25046
25098
  function readLocalCache() {
25047
25099
  for (const path2 of cacheCandidates()) {
@@ -25100,7 +25152,7 @@ async function getModelsFor(projectDir) {
25100
25152
  const providers = connectedProviders(projectDir);
25101
25153
  if (providers.size === 0)
25102
25154
  return { models: all, connected: false };
25103
- const scoped = all.filter((m5) => providers.has(providerOf(m5.id)));
25155
+ const scoped = all.filter((m6) => providers.has(providerOf(m6.id)));
25104
25156
  if (scoped.length === 0)
25105
25157
  return { models: all, connected: false };
25106
25158
  return { models: scoped, connected: true };
@@ -25159,6 +25211,7 @@ var WEB_LOGO = resolveWebLogo();
25159
25211
  async function buildWeb() {
25160
25212
  const result = await Bun.build({
25161
25213
  entrypoints: [WEB_INDEX],
25214
+ root: dirname7(WEB_INDEX),
25162
25215
  target: "browser",
25163
25216
  minify: true,
25164
25217
  sourcemap: "none"
@@ -25230,8 +25283,8 @@ async function startUiServer(opts) {
25230
25283
  let reqCtx;
25231
25284
  try {
25232
25285
  reqCtx = resolveProject(ctx, url2.searchParams.get("project"));
25233
- } catch (e5) {
25234
- return json2({ error: e5.message }, 400);
25286
+ } catch (e6) {
25287
+ return json2({ error: e6.message }, 400);
25235
25288
  }
25236
25289
  return await api2(path2, req, reqCtx, shutdownToken);
25237
25290
  }
@@ -25400,13 +25453,13 @@ function pickDefaultPreset(presets) {
25400
25453
  return presets.some((p6) => p6.name === RECOMMENDED_PRESET) ? RECOMMENDED_PRESET : presets[0]?.name ?? RECOMMENDED_PRESET;
25401
25454
  }
25402
25455
  async function getCatalog(ctx) {
25403
- const detected = adapters.filter((a9) => a9.detect(ctx)).map((a9) => a9.id);
25456
+ const detected = adapters.filter((a8) => a8.detect(ctx)).map((a8) => a8.id);
25404
25457
  const seedTargets = detected.length > 0 ? detected : ["opencode"];
25405
25458
  const sources = builtinSources(ctx, seedTargets);
25406
25459
  const index = (await sources.defaultIndex()).index;
25407
- const byType = (type) => index.items.filter((i9) => i9.type === type).sort((a9, b5) => a9.name.localeCompare(b5.name));
25460
+ const byType = (type) => index.items.filter((i9) => i9.type === type).sort((a8, b5) => a8.name.localeCompare(b5.name));
25408
25461
  const asItems = (type) => byType(type).map((i9) => ({ name: i9.name, label: i9.title, description: i9.description }));
25409
- const presets = asItems("preset").sort((a9, b5) => a9.name === RECOMMENDED_PRESET ? -1 : b5.name === RECOMMENDED_PRESET ? 1 : 0);
25462
+ const presets = asItems("preset").sort((a8, b5) => a8.name === RECOMMENDED_PRESET ? -1 : b5.name === RECOMMENDED_PRESET ? 1 : 0);
25410
25463
  const mcps = [];
25411
25464
  for (const summary of byType("mcp")) {
25412
25465
  const manifest = await sources.loadManifest("mcp", summary.name);
@@ -25456,14 +25509,14 @@ async function getCatalog(ctx) {
25456
25509
  mcps,
25457
25510
  lsps: asItems("lsp"),
25458
25511
  rules,
25459
- targets: adapters.map((a9) => ({
25460
- id: a9.id,
25461
- label: a9.label,
25462
- detected: detected.includes(a9.id)
25512
+ targets: adapters.map((a8) => ({
25513
+ id: a8.id,
25514
+ label: a8.label,
25515
+ detected: detected.includes(a8.id)
25463
25516
  })),
25464
25517
  reasoningEfforts: [...REASONING_EFFORTS],
25465
25518
  agentsModes: [
25466
- ...AGENTS_MD_MODES.map((m5) => ({ value: m5, label: m5 })),
25519
+ ...AGENTS_MD_MODES.map((m6) => ({ value: m6, label: m6 })),
25467
25520
  { value: "off", label: "off" }
25468
25521
  ],
25469
25522
  defaultPreset: pickDefaultPreset(presets),
@@ -25479,7 +25532,7 @@ var EXTRAS_BUCKET_TYPE = {
25479
25532
  commands: "command"
25480
25533
  };
25481
25534
  async function getGraph(ctx) {
25482
- const detected = adapters.filter((a9) => a9.detect(ctx)).map((a9) => a9.id);
25535
+ const detected = adapters.filter((a8) => a8.detect(ctx)).map((a8) => a8.id);
25483
25536
  const seedTargets = detected.length > 0 ? detected : ["opencode"];
25484
25537
  const sources = builtinSources(ctx, seedTargets);
25485
25538
  const index = (await sources.defaultIndex()).index;
@@ -25573,7 +25626,7 @@ async function getState(ctx) {
25573
25626
  return out;
25574
25627
  }
25575
25628
  async function computeExtras(ctx, lock, presetNames, modelPack, config2) {
25576
- const refs = presetNames.map((n6) => `preset:${n6}`);
25629
+ const refs = presetNames.map((n8) => `preset:${n8}`);
25577
25630
  if (modelPack)
25578
25631
  refs.push(`pack:${modelPack}`);
25579
25632
  const covered = new Set(refs);
@@ -25597,7 +25650,7 @@ async function computeExtras(ctx, lock, presetNames, modelPack, config2) {
25597
25650
  let missingSet;
25598
25651
  try {
25599
25652
  const { missing } = await sources.partitionRefs(candidates);
25600
- missingSet = new Set(missing.map((m5) => m5.ref));
25653
+ missingSet = new Set(missing.map((m6) => m6.ref));
25601
25654
  } catch {
25602
25655
  return { extras: candidates, dropped: [] };
25603
25656
  }
@@ -25627,18 +25680,18 @@ function extractOpencodeFiles(plans) {
25627
25680
  const opencode2 = plans.find((p6) => p6.target === "opencode");
25628
25681
  let opencodeJson = "";
25629
25682
  let agentsMd = null;
25630
- for (const a9 of opencode2?.actions ?? []) {
25631
- const base = a9.path.split(/[\\/]/).pop() ?? a9.path;
25683
+ for (const a8 of opencode2?.actions ?? []) {
25684
+ const base = a8.path.split(/[\\/]/).pop() ?? a8.path;
25632
25685
  if (base === "opencode.json") {
25633
- if (a9.kind === "merge-json")
25634
- opencodeJson = JSON.stringify(a9.value, null, 2);
25635
- else if (a9.kind === "write")
25636
- opencodeJson = a9.content;
25686
+ if (a8.kind === "merge-json")
25687
+ opencodeJson = JSON.stringify(a8.value, null, 2);
25688
+ else if (a8.kind === "write")
25689
+ opencodeJson = a8.content;
25637
25690
  } else if (base === "AGENTS.md") {
25638
- if (a9.kind === "append-block")
25639
- agentsMd = a9.content;
25640
- else if (a9.kind === "write")
25641
- agentsMd = a9.content;
25691
+ if (a8.kind === "append-block")
25692
+ agentsMd = a8.content;
25693
+ else if (a8.kind === "write")
25694
+ agentsMd = a8.content;
25642
25695
  }
25643
25696
  }
25644
25697
  return { opencodeJson, agentsMd };
@@ -25695,7 +25748,7 @@ async function runInstall(sources, state, items, ctx) {
25695
25748
  const stale = computeStaleItems(lock, newRefs);
25696
25749
  const prunedConfig = new Set;
25697
25750
  const removed = stale.length > 0 ? executePrune(stale, ctx.projectDir, newItems, prunedConfig) : new Set;
25698
- const files = results.filter((r7) => r7.status === "created" || r7.status === "updated").map((r7) => ({ path: relative7(ctx.projectDir, r7.action.path), status: r7.status }));
25751
+ const files = results.filter((r8) => r8.status === "created" || r8.status === "updated").map((r8) => ({ path: relative7(ctx.projectDir, r8.action.path), status: r8.status }));
25699
25752
  for (const { ref, path: path2 } of computeStaleDeletions(stale, newItems)) {
25700
25753
  if (!removed.has(ref))
25701
25754
  continue;
@@ -25894,8 +25947,8 @@ function pruneStaleArtifacts(oldLock, newItems, updatedRefs, projectDir) {
25894
25947
  ...oldLock.items.filter((i9) => !updatedRefs.has(i9.ref))
25895
25948
  ];
25896
25949
  const keepBlocks = new Set(surviving.flatMap((i9) => (i9.blocks ?? []).map((b5) => `${lockPathKey(b5)}\x00${b5.marker}`)));
25897
- const keepJson = new Set(surviving.flatMap((i9) => (i9.jsonEntries ?? []).map((e5) => `${lockPathKey(e5)}\x00${e5.key}\x00${e5.value}`)));
25898
- const keepObjects = new Set(surviving.flatMap((i9) => (i9.objectEntries ?? []).map((e5) => `${lockPathKey(e5)}\x00${e5.key}\x00${e5.subKey}`)));
25950
+ const keepJson = new Set(surviving.flatMap((i9) => (i9.jsonEntries ?? []).map((e6) => `${lockPathKey(e6)}\x00${e6.key}\x00${e6.value}`)));
25951
+ const keepObjects = new Set(surviving.flatMap((i9) => (i9.objectEntries ?? []).map((e6) => `${lockPathKey(e6)}\x00${e6.key}\x00${e6.subKey}`)));
25899
25952
  const keepFiles = new Set(surviving.flatMap((i9) => i9.files.map(lockPathKey)));
25900
25953
  const staleBlocks = [];
25901
25954
  const staleAssets = [];
@@ -25913,15 +25966,15 @@ function pruneStaleArtifacts(oldLock, newItems, updatedRefs, projectDir) {
25913
25966
  if (file2.sideAsset && !keepFiles.has(lockPathKey(file2)))
25914
25967
  staleAssets.push(file2);
25915
25968
  }
25916
- for (const e5 of old.jsonEntries ?? []) {
25917
- const key = `${lockPathKey(e5)}\x00${e5.key}\x00${e5.value}`;
25969
+ for (const e6 of old.jsonEntries ?? []) {
25970
+ const key = `${lockPathKey(e6)}\x00${e6.key}\x00${e6.value}`;
25918
25971
  if (!keepJson.has(key))
25919
- staleJson.push(e5);
25972
+ staleJson.push(e6);
25920
25973
  }
25921
- for (const e5 of old.objectEntries ?? []) {
25922
- const key = `${lockPathKey(e5)}\x00${e5.key}\x00${e5.subKey}`;
25974
+ for (const e6 of old.objectEntries ?? []) {
25975
+ const key = `${lockPathKey(e6)}\x00${e6.key}\x00${e6.subKey}`;
25923
25976
  if (!keepObjects.has(key))
25924
- staleObjects.push(e5);
25977
+ staleObjects.push(e6);
25925
25978
  }
25926
25979
  }
25927
25980
  for (const blocks of groupLockBlocks(staleBlocks).values()) {
@@ -26015,7 +26068,7 @@ function lockedTextRefs(lock) {
26015
26068
  return lock.items.filter((i9) => !i9.ref.includes("#")).map((i9) => i9.ref);
26016
26069
  }
26017
26070
  function staleLockFiles(lock, plans, projectDir, updatedRefs) {
26018
- const planned = new Set(plans.flatMap((p6) => p6.actions).filter((a9) => a9.kind === "write").map((a9) => lockPathKey(normalizeLockPath(a9.path, projectDir))));
26071
+ const planned = new Set(plans.flatMap((p6) => p6.actions).filter((a8) => a8.kind === "write").map((a8) => lockPathKey(normalizeLockPath(a8.path, projectDir))));
26019
26072
  const surviving = new Set(lock.items.filter((item) => !updatedRefs.has(item.ref)).flatMap((item) => item.files.map(lockPathKey)));
26020
26073
  const stale = new Map;
26021
26074
  for (const item of lock.items) {
@@ -26067,11 +26120,11 @@ function formatArgv(argv) {
26067
26120
  async function handleMissingRefs(missing, targetRefs, lock, opts) {
26068
26121
  console.log(pc12.yellow(`
26069
26122
  ${missing.length} locked item(s) no longer in their registry:`));
26070
- for (const m5 of missing) {
26071
- console.log(pc12.yellow(` ${m5.ref} \u2014 no longer in registry "${m5.registryLabel}"`));
26123
+ for (const m6 of missing) {
26124
+ console.log(pc12.yellow(` ${m6.ref} \u2014 no longer in registry "${m6.registryLabel}"`));
26072
26125
  }
26073
- const missingRefs = new Set(missing.map((m5) => m5.ref));
26074
- const survivors = targetRefs.filter((r7) => !missingRefs.has(r7));
26126
+ const missingRefs = new Set(missing.map((m6) => m6.ref));
26127
+ const survivors = targetRefs.filter((r8) => !missingRefs.has(r8));
26075
26128
  const prunable = lock.items.filter((i9) => missingRefs.has(i9.ref));
26076
26129
  const remaining = lock.items.filter((i9) => !missingRefs.has(i9.ref));
26077
26130
  if (prunable.length === 0)
@@ -26117,7 +26170,7 @@ init_types();
26117
26170
  // package.json
26118
26171
  var package_default = {
26119
26172
  name: "use-agentz",
26120
- version: "0.1.0",
26173
+ version: "0.1.2",
26121
26174
  description: "AgentZ is a Bun-native AI agent setup builder.",
26122
26175
  type: "module",
26123
26176
  bin: {
@@ -26147,25 +26200,26 @@ var package_default = {
26147
26200
  build: "bun run scripts/build.ts",
26148
26201
  pack: "bun pm pack",
26149
26202
  "verify-pack": "bun run scripts/verify-pack.ts",
26150
- "release:npm": "bash scripts/release-npm.sh"
26203
+ "npm:release": "bash scripts/release-npm.sh",
26204
+ "release:npm": "bun run npm:release"
26151
26205
  },
26152
26206
  devDependencies: {
26153
26207
  "@modelcontextprotocol/sdk": "^1.29.0",
26154
- "@opencode-ai/plugin": "^1.17.0",
26208
+ "@opencode-ai/plugin": "^1.18.4",
26155
26209
  "@types/bun": "^1.3.14",
26156
- "@types/react": "^19.0.0",
26157
- "@types/react-dom": "^19.0.0",
26210
+ "@types/react": "^19.2.17",
26211
+ "@types/react-dom": "^19.2.3",
26158
26212
  "pdf-lib": "^1.17.1",
26159
26213
  pptxgenjs: "^4.0.1",
26160
- typescript: "^5.9.3"
26214
+ typescript: "^7.0.2"
26161
26215
  },
26162
26216
  dependencies: {
26163
26217
  "@base-ui-components/react": "^1.0.0-rc.0",
26164
- "@clack/prompts": "^1.5.1",
26218
+ "@clack/prompts": "^1.7.0",
26165
26219
  confbox: "^0.2.4",
26166
26220
  picocolors: "^1.1.1",
26167
- react: "^19.0.0",
26168
- "react-dom": "^19.0.0",
26221
+ react: "^19.2.8",
26222
+ "react-dom": "^19.2.8",
26169
26223
  zod: "^4.4.3"
26170
26224
  }
26171
26225
  };