storybook 10.1.0-beta.2 → 10.1.0-beta.4
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/_browser-chunks/{chunk-L4RMQ7D7.js → chunk-BRX2HXH7.js} +75 -5
- package/dist/_node-chunks/{builder-manager-DE5CZGPU.js → builder-manager-T3A7QLUO.js} +26 -593
- package/dist/_node-chunks/{camelcase-3GPWEIYB.js → camelcase-WMMYRUH4.js} +7 -7
- package/dist/_node-chunks/{chunk-ZH4F5JWQ.js → chunk-3MVB5IZX.js} +28 -24
- package/dist/_node-chunks/{chunk-RZEXP6OF.js → chunk-5DEFF2GB.js} +7 -7
- package/dist/_node-chunks/{chunk-3GUEJ3O3.js → chunk-67VVNDJJ.js} +6 -6
- package/dist/_node-chunks/{chunk-RSFKUYLE.js → chunk-C6RLDV2P.js} +8 -8
- package/dist/_node-chunks/{chunk-77QRXLGA.js → chunk-CM44JL5Z.js} +6 -6
- package/dist/_node-chunks/{chunk-HGDN3STX.js → chunk-CSFSQ2I4.js} +7 -7
- package/dist/_node-chunks/{chunk-45XWOXXM.js → chunk-EFN4RLWH.js} +7 -7
- package/dist/_node-chunks/{chunk-D2CQN4LQ.js → chunk-EFTR6VSG.js} +9 -9
- package/dist/_node-chunks/{chunk-UWKUW2OJ.js → chunk-EJPOXNSG.js} +15 -15
- package/dist/_node-chunks/{chunk-6T6VTXDE.js → chunk-HDMHX5QM.js} +7 -7
- package/dist/_node-chunks/{chunk-EXJNST6P.js → chunk-HT32VUX7.js} +7 -7
- package/dist/_node-chunks/chunk-IQFN7VY4.js +23 -0
- package/dist/_node-chunks/{chunk-YZEOU7D5.js → chunk-JYAXWHGH.js} +9 -9
- package/dist/_node-chunks/chunk-K7U3BSTR.js +61 -0
- package/dist/_node-chunks/{chunk-NOLZUVQN.js → chunk-KAVR7KJP.js} +287 -281
- package/dist/_node-chunks/{chunk-HFPMBHAF.js → chunk-KI6KY2ZN.js} +13 -13
- package/dist/_node-chunks/{chunk-Z7F5CZXW.js → chunk-NORFPLB6.js} +7 -7
- package/dist/_node-chunks/{chunk-ODJGHT54.js → chunk-PMZEJJNX.js} +7 -7
- package/dist/_node-chunks/{chunk-F4HHDWJV.js → chunk-RSJK2D7X.js} +6 -6
- package/dist/_node-chunks/{chunk-PQF6TGKN.js → chunk-TBYOSPAV.js} +6 -6
- package/dist/_node-chunks/{chunk-KIW5GZKQ.js → chunk-TC7X5DN2.js} +10 -10
- package/dist/_node-chunks/{chunk-43AQPYQJ.js → chunk-TCLOOFNE.js} +7 -7
- package/dist/_node-chunks/{chunk-QAX2QIAO.js → chunk-VN7SAKM4.js} +6 -6
- package/dist/_node-chunks/{chunk-3FVKDIQ7.js → chunk-VW25O2YM.js} +6 -6
- package/dist/_node-chunks/{chunk-4CHMPSHM.js → chunk-WGBDDI6W.js} +642 -639
- package/dist/_node-chunks/chunk-YN3C74EA.js +18 -0
- package/dist/_node-chunks/{chunk-INMOMYVB.js → chunk-YTTOTUWC.js} +6 -6
- package/dist/_node-chunks/{chunk-PJAOEV2K.js → chunk-YZ3XRP4N.js} +6 -6
- package/dist/_node-chunks/{dist-RFQRGJD5.js → dist-L6XLFQOU.js} +9 -9
- package/dist/_node-chunks/{globby-WIMKMN5Q.js → globby-7IXLXFEA.js} +9 -9
- package/dist/_node-chunks/{lib-OBEY3MUM.js → lib-T5L2ZSAG.js} +7 -7
- package/dist/_node-chunks/{mdx-N42X6CFJ-7XA7LOVG.js → mdx-N42X6CFJ-GOOKUTSA.js} +8 -8
- package/dist/_node-chunks/{p-limit-VII3MYEU.js → p-limit-7GKATDEW.js} +7 -7
- package/dist/babel/index.js +10 -10
- package/dist/bin/core.js +12 -12
- package/dist/bin/dispatcher.js +11 -11
- package/dist/bin/loader.js +9 -9
- package/dist/cli/index.d.ts +1 -2
- package/dist/cli/index.js +18 -18
- package/dist/common/index.d.ts +553 -560
- package/dist/common/index.js +19 -21
- package/dist/components/index.js +35 -29
- package/dist/core-server/index.js +33 -33
- package/dist/core-server/presets/common-manager.js +74 -108
- package/dist/core-server/presets/common-override-preset.js +9 -9
- package/dist/core-server/presets/common-preset.js +25 -25
- package/dist/csf-tools/index.js +9 -9
- package/dist/manager/globals-runtime.js +142 -65
- package/dist/manager/runtime.js +139 -115
- package/dist/manager-api/index.js +1 -1
- package/dist/mocking-utils/index.js +8 -8
- package/dist/node-logger/index.d.ts +3 -1
- package/dist/node-logger/index.js +9 -9
- package/dist/preview-api/index.d.ts +68 -67
- package/dist/server-errors.js +11 -11
- package/dist/telemetry/index.js +23 -23
- package/dist/theming/create.d.ts +1 -1
- package/dist/theming/create.js +1 -1
- package/dist/theming/index.d.ts +65 -2
- package/dist/theming/index.js +6 -3
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -3
- package/dist/_node-chunks/chunk-CEFT3TLW.js +0 -18
- package/dist/_node-chunks/chunk-HG5BSY5V.js +0 -23
- package/dist/_node-chunks/chunk-Y35QWPHB.js +0 -61
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_a6gceaz3qeh from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_a6gceaz3qeh from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_a6gceaz3qeh from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_a6gceaz3qeh.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_a6gceaz3qeh.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_a6gceaz3qeh.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
require_picocolors
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-TCLOOFNE.js";
|
|
15
15
|
import {
|
|
16
16
|
__commonJS,
|
|
17
17
|
__export,
|
|
18
18
|
__require,
|
|
19
19
|
__toESM
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-VW25O2YM.js";
|
|
21
21
|
|
|
22
22
|
// ../node_modules/are-we-there-yet/lib/tracker-base.js
|
|
23
23
|
var require_tracker_base = __commonJS({
|
|
@@ -205,8 +205,8 @@ var require_console_control_strings = __commonJS({
|
|
|
205
205
|
exports.eraseLine = function() {
|
|
206
206
|
return prefix + "K";
|
|
207
207
|
};
|
|
208
|
-
exports.goto = function(
|
|
209
|
-
return prefix + y2 + ";" +
|
|
208
|
+
exports.goto = function(x3, y2) {
|
|
209
|
+
return prefix + y2 + ";" + x3 + "H";
|
|
210
210
|
};
|
|
211
211
|
exports.gotoSOL = function() {
|
|
212
212
|
return "\r";
|
|
@@ -406,14 +406,14 @@ var require_aproba = __commonJS({
|
|
|
406
406
|
}
|
|
407
407
|
var types = {
|
|
408
408
|
"*": { label: "any", check: () => !0 },
|
|
409
|
-
A: { label: "array", check: (
|
|
410
|
-
S: { label: "string", check: (
|
|
411
|
-
N: { label: "number", check: (
|
|
412
|
-
F: { label: "function", check: (
|
|
413
|
-
O: { label: "object", check: (
|
|
414
|
-
B: { label: "boolean", check: (
|
|
415
|
-
E: { label: "error", check: (
|
|
416
|
-
Z: { label: "null", check: (
|
|
409
|
+
A: { label: "array", check: (_2) => Array.isArray(_2) || isArguments(_2) },
|
|
410
|
+
S: { label: "string", check: (_2) => typeof _2 == "string" },
|
|
411
|
+
N: { label: "number", check: (_2) => typeof _2 == "number" },
|
|
412
|
+
F: { label: "function", check: (_2) => typeof _2 == "function" },
|
|
413
|
+
O: { label: "object", check: (_2) => typeof _2 == "object" && _2 != null && !types.A.check(_2) && !types.E.check(_2) },
|
|
414
|
+
B: { label: "boolean", check: (_2) => typeof _2 == "boolean" },
|
|
415
|
+
E: { label: "error", check: (_2) => _2 instanceof Error },
|
|
416
|
+
Z: { label: "null", check: (_2) => _2 == null }
|
|
417
417
|
};
|
|
418
418
|
function addSchema(schema, arity) {
|
|
419
419
|
let group = arity[schema.length] = arity[schema.length] || [];
|
|
@@ -443,7 +443,7 @@ var require_aproba = __commonJS({
|
|
|
443
443
|
return typeCheck(args[ii]);
|
|
444
444
|
});
|
|
445
445
|
if (!newMatching.length) {
|
|
446
|
-
let labels = matching.map((
|
|
446
|
+
let labels = matching.map((_2) => types[_2[ii]].label).filter((_2) => _2 != null);
|
|
447
447
|
throw invalidType(ii, labels, args[ii]);
|
|
448
448
|
}
|
|
449
449
|
matching = newMatching;
|
|
@@ -829,7 +829,7 @@ var require_cjs = __commonJS({
|
|
|
829
829
|
Object.defineProperty(exports, "signals", { enumerable: !0, get: function() {
|
|
830
830
|
return signals_js_1.signals;
|
|
831
831
|
} });
|
|
832
|
-
var processOk = (process3) => !!process3 && typeof process3 == "object" && typeof process3.removeListener == "function" && typeof process3.emit == "function" && typeof process3.reallyExit == "function" && typeof process3.listeners == "function" && typeof process3.kill == "function" && typeof process3.pid == "number" && typeof process3.on == "function", kExitEmitter = Symbol.for("signal-exit emitter"),
|
|
832
|
+
var processOk = (process3) => !!process3 && typeof process3 == "object" && typeof process3.removeListener == "function" && typeof process3.emit == "function" && typeof process3.reallyExit == "function" && typeof process3.listeners == "function" && typeof process3.kill == "function" && typeof process3.pid == "number" && typeof process3.on == "function", kExitEmitter = Symbol.for("signal-exit emitter"), global = globalThis, ObjectDefineProperty = Object.defineProperty.bind(Object), Emitter = class {
|
|
833
833
|
emitted = {
|
|
834
834
|
afterExit: !1,
|
|
835
835
|
exit: !1
|
|
@@ -841,9 +841,9 @@ var require_cjs = __commonJS({
|
|
|
841
841
|
count = 0;
|
|
842
842
|
id = Math.random();
|
|
843
843
|
constructor() {
|
|
844
|
-
if (
|
|
845
|
-
return
|
|
846
|
-
ObjectDefineProperty(
|
|
844
|
+
if (global[kExitEmitter])
|
|
845
|
+
return global[kExitEmitter];
|
|
846
|
+
ObjectDefineProperty(global, kExitEmitter, {
|
|
847
847
|
value: this,
|
|
848
848
|
writable: !1,
|
|
849
849
|
enumerable: !1,
|
|
@@ -1434,8 +1434,8 @@ var require_log = __commonJS({
|
|
|
1434
1434
|
log2.resume = function() {
|
|
1435
1435
|
if (this._paused) {
|
|
1436
1436
|
this._paused = !1;
|
|
1437
|
-
var
|
|
1438
|
-
this._buffer = [],
|
|
1437
|
+
var b = this._buffer;
|
|
1438
|
+
this._buffer = [], b.forEach(function(m) {
|
|
1439
1439
|
this.emitLog(m);
|
|
1440
1440
|
}, this), this.progressEnabled && this.gauge.enable();
|
|
1441
1441
|
}
|
|
@@ -1557,12 +1557,12 @@ var require_src = __commonJS({
|
|
|
1557
1557
|
"../node_modules/sisteransi/src/index.js"(exports, module) {
|
|
1558
1558
|
"use strict";
|
|
1559
1559
|
var cursor = {
|
|
1560
|
-
to(
|
|
1561
|
-
return y2 ? `\x1B[${y2 + 1};${
|
|
1560
|
+
to(x3, y2) {
|
|
1561
|
+
return y2 ? `\x1B[${y2 + 1};${x3 + 1}H` : `\x1B[${x3 + 1}G`;
|
|
1562
1562
|
},
|
|
1563
|
-
move(
|
|
1563
|
+
move(x3, y2) {
|
|
1564
1564
|
let ret = "";
|
|
1565
|
-
return
|
|
1565
|
+
return x3 < 0 ? ret += `\x1B[${-x3}D` : x3 > 0 && (ret += `\x1B[${x3}C`), y2 < 0 ? ret += `\x1B[${-y2}A` : y2 > 0 && (ret += `\x1B[${y2}B`), ret;
|
|
1566
1566
|
},
|
|
1567
1567
|
up: (count = 1) => `\x1B[${count}A`,
|
|
1568
1568
|
down: (count = 1) => `\x1B[${count}B`,
|
|
@@ -1602,8 +1602,8 @@ var require_eastasianwidth = __commonJS({
|
|
|
1602
1602
|
var eaw = {};
|
|
1603
1603
|
typeof module > "u" ? window.eastasianwidth = eaw : module.exports = eaw;
|
|
1604
1604
|
eaw.eastAsianWidth = function(character) {
|
|
1605
|
-
var
|
|
1606
|
-
return 55296 <=
|
|
1605
|
+
var x3 = character.charCodeAt(0), y2 = character.length == 2 ? character.charCodeAt(1) : 0, codePoint = x3;
|
|
1606
|
+
return 55296 <= x3 && x3 <= 56319 && 56320 <= y2 && y2 <= 57343 && (x3 &= 1023, y2 &= 1023, codePoint = x3 << 10 | y2, codePoint += 65536), codePoint == 12288 || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 ? "F" : codePoint == 8361 || 65377 <= codePoint && codePoint <= 65470 || 65474 <= codePoint && codePoint <= 65479 || 65482 <= codePoint && codePoint <= 65487 || 65490 <= codePoint && codePoint <= 65495 || 65498 <= codePoint && codePoint <= 65500 || 65512 <= codePoint && codePoint <= 65518 ? "H" : 4352 <= codePoint && codePoint <= 4447 || 4515 <= codePoint && codePoint <= 4519 || 4602 <= codePoint && codePoint <= 4607 || 9001 <= codePoint && codePoint <= 9002 || 11904 <= codePoint && codePoint <= 11929 || 11931 <= codePoint && codePoint <= 12019 || 12032 <= codePoint && codePoint <= 12245 || 12272 <= codePoint && codePoint <= 12283 || 12289 <= codePoint && codePoint <= 12350 || 12353 <= codePoint && codePoint <= 12438 || 12441 <= codePoint && codePoint <= 12543 || 12549 <= codePoint && codePoint <= 12589 || 12593 <= codePoint && codePoint <= 12686 || 12688 <= codePoint && codePoint <= 12730 || 12736 <= codePoint && codePoint <= 12771 || 12784 <= codePoint && codePoint <= 12830 || 12832 <= codePoint && codePoint <= 12871 || 12880 <= codePoint && codePoint <= 13054 || 13056 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42124 || 42128 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 55216 <= codePoint && codePoint <= 55238 || 55243 <= codePoint && codePoint <= 55291 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65106 || 65108 <= codePoint && codePoint <= 65126 || 65128 <= codePoint && codePoint <= 65131 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127490 || 127504 <= codePoint && codePoint <= 127546 || 127552 <= codePoint && codePoint <= 127560 || 127568 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 194367 || 177984 <= codePoint && codePoint <= 196605 || 196608 <= codePoint && codePoint <= 262141 ? "W" : 32 <= codePoint && codePoint <= 126 || 162 <= codePoint && codePoint <= 163 || 165 <= codePoint && codePoint <= 166 || codePoint == 172 || codePoint == 175 || 10214 <= codePoint && codePoint <= 10221 || 10629 <= codePoint && codePoint <= 10630 ? "Na" : codePoint == 161 || codePoint == 164 || 167 <= codePoint && codePoint <= 168 || codePoint == 170 || 173 <= codePoint && codePoint <= 174 || 176 <= codePoint && codePoint <= 180 || 182 <= codePoint && codePoint <= 186 || 188 <= codePoint && codePoint <= 191 || codePoint == 198 || codePoint == 208 || 215 <= codePoint && codePoint <= 216 || 222 <= codePoint && codePoint <= 225 || codePoint == 230 || 232 <= codePoint && codePoint <= 234 || 236 <= codePoint && codePoint <= 237 || codePoint == 240 || 242 <= codePoint && codePoint <= 243 || 247 <= codePoint && codePoint <= 250 || codePoint == 252 || codePoint == 254 || codePoint == 257 || codePoint == 273 || codePoint == 275 || codePoint == 283 || 294 <= codePoint && codePoint <= 295 || codePoint == 299 || 305 <= codePoint && codePoint <= 307 || codePoint == 312 || 319 <= codePoint && codePoint <= 322 || codePoint == 324 || 328 <= codePoint && codePoint <= 331 || codePoint == 333 || 338 <= codePoint && codePoint <= 339 || 358 <= codePoint && codePoint <= 359 || codePoint == 363 || codePoint == 462 || codePoint == 464 || codePoint == 466 || codePoint == 468 || codePoint == 470 || codePoint == 472 || codePoint == 474 || codePoint == 476 || codePoint == 593 || codePoint == 609 || codePoint == 708 || codePoint == 711 || 713 <= codePoint && codePoint <= 715 || codePoint == 717 || codePoint == 720 || 728 <= codePoint && codePoint <= 731 || codePoint == 733 || codePoint == 735 || 768 <= codePoint && codePoint <= 879 || 913 <= codePoint && codePoint <= 929 || 931 <= codePoint && codePoint <= 937 || 945 <= codePoint && codePoint <= 961 || 963 <= codePoint && codePoint <= 969 || codePoint == 1025 || 1040 <= codePoint && codePoint <= 1103 || codePoint == 1105 || codePoint == 8208 || 8211 <= codePoint && codePoint <= 8214 || 8216 <= codePoint && codePoint <= 8217 || 8220 <= codePoint && codePoint <= 8221 || 8224 <= codePoint && codePoint <= 8226 || 8228 <= codePoint && codePoint <= 8231 || codePoint == 8240 || 8242 <= codePoint && codePoint <= 8243 || codePoint == 8245 || codePoint == 8251 || codePoint == 8254 || codePoint == 8308 || codePoint == 8319 || 8321 <= codePoint && codePoint <= 8324 || codePoint == 8364 || codePoint == 8451 || codePoint == 8453 || codePoint == 8457 || codePoint == 8467 || codePoint == 8470 || 8481 <= codePoint && codePoint <= 8482 || codePoint == 8486 || codePoint == 8491 || 8531 <= codePoint && codePoint <= 8532 || 8539 <= codePoint && codePoint <= 8542 || 8544 <= codePoint && codePoint <= 8555 || 8560 <= codePoint && codePoint <= 8569 || codePoint == 8585 || 8592 <= codePoint && codePoint <= 8601 || 8632 <= codePoint && codePoint <= 8633 || codePoint == 8658 || codePoint == 8660 || codePoint == 8679 || codePoint == 8704 || 8706 <= codePoint && codePoint <= 8707 || 8711 <= codePoint && codePoint <= 8712 || codePoint == 8715 || codePoint == 8719 || codePoint == 8721 || codePoint == 8725 || codePoint == 8730 || 8733 <= codePoint && codePoint <= 8736 || codePoint == 8739 || codePoint == 8741 || 8743 <= codePoint && codePoint <= 8748 || codePoint == 8750 || 8756 <= codePoint && codePoint <= 8759 || 8764 <= codePoint && codePoint <= 8765 || codePoint == 8776 || codePoint == 8780 || codePoint == 8786 || 8800 <= codePoint && codePoint <= 8801 || 8804 <= codePoint && codePoint <= 8807 || 8810 <= codePoint && codePoint <= 8811 || 8814 <= codePoint && codePoint <= 8815 || 8834 <= codePoint && codePoint <= 8835 || 8838 <= codePoint && codePoint <= 8839 || codePoint == 8853 || codePoint == 8857 || codePoint == 8869 || codePoint == 8895 || codePoint == 8978 || 9312 <= codePoint && codePoint <= 9449 || 9451 <= codePoint && codePoint <= 9547 || 9552 <= codePoint && codePoint <= 9587 || 9600 <= codePoint && codePoint <= 9615 || 9618 <= codePoint && codePoint <= 9621 || 9632 <= codePoint && codePoint <= 9633 || 9635 <= codePoint && codePoint <= 9641 || 9650 <= codePoint && codePoint <= 9651 || 9654 <= codePoint && codePoint <= 9655 || 9660 <= codePoint && codePoint <= 9661 || 9664 <= codePoint && codePoint <= 9665 || 9670 <= codePoint && codePoint <= 9672 || codePoint == 9675 || 9678 <= codePoint && codePoint <= 9681 || 9698 <= codePoint && codePoint <= 9701 || codePoint == 9711 || 9733 <= codePoint && codePoint <= 9734 || codePoint == 9737 || 9742 <= codePoint && codePoint <= 9743 || 9748 <= codePoint && codePoint <= 9749 || codePoint == 9756 || codePoint == 9758 || codePoint == 9792 || codePoint == 9794 || 9824 <= codePoint && codePoint <= 9825 || 9827 <= codePoint && codePoint <= 9829 || 9831 <= codePoint && codePoint <= 9834 || 9836 <= codePoint && codePoint <= 9837 || codePoint == 9839 || 9886 <= codePoint && codePoint <= 9887 || 9918 <= codePoint && codePoint <= 9919 || 9924 <= codePoint && codePoint <= 9933 || 9935 <= codePoint && codePoint <= 9953 || codePoint == 9955 || 9960 <= codePoint && codePoint <= 9983 || codePoint == 10045 || codePoint == 10071 || 10102 <= codePoint && codePoint <= 10111 || 11093 <= codePoint && codePoint <= 11097 || 12872 <= codePoint && codePoint <= 12879 || 57344 <= codePoint && codePoint <= 63743 || 65024 <= codePoint && codePoint <= 65039 || codePoint == 65533 || 127232 <= codePoint && codePoint <= 127242 || 127248 <= codePoint && codePoint <= 127277 || 127280 <= codePoint && codePoint <= 127337 || 127344 <= codePoint && codePoint <= 127386 || 917760 <= codePoint && codePoint <= 917999 || 983040 <= codePoint && codePoint <= 1048573 || 1048576 <= codePoint && codePoint <= 1114109 ? "A" : "N";
|
|
1607
1607
|
};
|
|
1608
1608
|
eaw.characterLength = function(character) {
|
|
1609
1609
|
var code = this.eastAsianWidth(character);
|
|
@@ -1667,71 +1667,71 @@ __export(logger_exports, {
|
|
|
1667
1667
|
|
|
1668
1668
|
// ../node_modules/@clack/core/dist/index.mjs
|
|
1669
1669
|
var import_picocolors = __toESM(require_picocolors(), 1), import_sisteransi = __toESM(require_src(), 1);
|
|
1670
|
-
import { stdout as
|
|
1670
|
+
import { stdout as R, stdin as q } from "node:process";
|
|
1671
1671
|
import * as k from "node:readline";
|
|
1672
|
-
import
|
|
1673
|
-
import { ReadStream as
|
|
1674
|
-
var
|
|
1675
|
-
let i =
|
|
1672
|
+
import ot from "node:readline";
|
|
1673
|
+
import { ReadStream as J } from "node:tty";
|
|
1674
|
+
var at = (t2) => t2 === 161 || t2 === 164 || t2 === 167 || t2 === 168 || t2 === 170 || t2 === 173 || t2 === 174 || t2 >= 176 && t2 <= 180 || t2 >= 182 && t2 <= 186 || t2 >= 188 && t2 <= 191 || t2 === 198 || t2 === 208 || t2 === 215 || t2 === 216 || t2 >= 222 && t2 <= 225 || t2 === 230 || t2 >= 232 && t2 <= 234 || t2 === 236 || t2 === 237 || t2 === 240 || t2 === 242 || t2 === 243 || t2 >= 247 && t2 <= 250 || t2 === 252 || t2 === 254 || t2 === 257 || t2 === 273 || t2 === 275 || t2 === 283 || t2 === 294 || t2 === 295 || t2 === 299 || t2 >= 305 && t2 <= 307 || t2 === 312 || t2 >= 319 && t2 <= 322 || t2 === 324 || t2 >= 328 && t2 <= 331 || t2 === 333 || t2 === 338 || t2 === 339 || t2 === 358 || t2 === 359 || t2 === 363 || t2 === 462 || t2 === 464 || t2 === 466 || t2 === 468 || t2 === 470 || t2 === 472 || t2 === 474 || t2 === 476 || t2 === 593 || t2 === 609 || t2 === 708 || t2 === 711 || t2 >= 713 && t2 <= 715 || t2 === 717 || t2 === 720 || t2 >= 728 && t2 <= 731 || t2 === 733 || t2 === 735 || t2 >= 768 && t2 <= 879 || t2 >= 913 && t2 <= 929 || t2 >= 931 && t2 <= 937 || t2 >= 945 && t2 <= 961 || t2 >= 963 && t2 <= 969 || t2 === 1025 || t2 >= 1040 && t2 <= 1103 || t2 === 1105 || t2 === 8208 || t2 >= 8211 && t2 <= 8214 || t2 === 8216 || t2 === 8217 || t2 === 8220 || t2 === 8221 || t2 >= 8224 && t2 <= 8226 || t2 >= 8228 && t2 <= 8231 || t2 === 8240 || t2 === 8242 || t2 === 8243 || t2 === 8245 || t2 === 8251 || t2 === 8254 || t2 === 8308 || t2 === 8319 || t2 >= 8321 && t2 <= 8324 || t2 === 8364 || t2 === 8451 || t2 === 8453 || t2 === 8457 || t2 === 8467 || t2 === 8470 || t2 === 8481 || t2 === 8482 || t2 === 8486 || t2 === 8491 || t2 === 8531 || t2 === 8532 || t2 >= 8539 && t2 <= 8542 || t2 >= 8544 && t2 <= 8555 || t2 >= 8560 && t2 <= 8569 || t2 === 8585 || t2 >= 8592 && t2 <= 8601 || t2 === 8632 || t2 === 8633 || t2 === 8658 || t2 === 8660 || t2 === 8679 || t2 === 8704 || t2 === 8706 || t2 === 8707 || t2 === 8711 || t2 === 8712 || t2 === 8715 || t2 === 8719 || t2 === 8721 || t2 === 8725 || t2 === 8730 || t2 >= 8733 && t2 <= 8736 || t2 === 8739 || t2 === 8741 || t2 >= 8743 && t2 <= 8748 || t2 === 8750 || t2 >= 8756 && t2 <= 8759 || t2 === 8764 || t2 === 8765 || t2 === 8776 || t2 === 8780 || t2 === 8786 || t2 === 8800 || t2 === 8801 || t2 >= 8804 && t2 <= 8807 || t2 === 8810 || t2 === 8811 || t2 === 8814 || t2 === 8815 || t2 === 8834 || t2 === 8835 || t2 === 8838 || t2 === 8839 || t2 === 8853 || t2 === 8857 || t2 === 8869 || t2 === 8895 || t2 === 8978 || t2 >= 9312 && t2 <= 9449 || t2 >= 9451 && t2 <= 9547 || t2 >= 9552 && t2 <= 9587 || t2 >= 9600 && t2 <= 9615 || t2 >= 9618 && t2 <= 9621 || t2 === 9632 || t2 === 9633 || t2 >= 9635 && t2 <= 9641 || t2 === 9650 || t2 === 9651 || t2 === 9654 || t2 === 9655 || t2 === 9660 || t2 === 9661 || t2 === 9664 || t2 === 9665 || t2 >= 9670 && t2 <= 9672 || t2 === 9675 || t2 >= 9678 && t2 <= 9681 || t2 >= 9698 && t2 <= 9701 || t2 === 9711 || t2 === 9733 || t2 === 9734 || t2 === 9737 || t2 === 9742 || t2 === 9743 || t2 === 9756 || t2 === 9758 || t2 === 9792 || t2 === 9794 || t2 === 9824 || t2 === 9825 || t2 >= 9827 && t2 <= 9829 || t2 >= 9831 && t2 <= 9834 || t2 === 9836 || t2 === 9837 || t2 === 9839 || t2 === 9886 || t2 === 9887 || t2 === 9919 || t2 >= 9926 && t2 <= 9933 || t2 >= 9935 && t2 <= 9939 || t2 >= 9941 && t2 <= 9953 || t2 === 9955 || t2 === 9960 || t2 === 9961 || t2 >= 9963 && t2 <= 9969 || t2 === 9972 || t2 >= 9974 && t2 <= 9977 || t2 === 9979 || t2 === 9980 || t2 === 9982 || t2 === 9983 || t2 === 10045 || t2 >= 10102 && t2 <= 10111 || t2 >= 11094 && t2 <= 11097 || t2 >= 12872 && t2 <= 12879 || t2 >= 57344 && t2 <= 63743 || t2 >= 65024 && t2 <= 65039 || t2 === 65533 || t2 >= 127232 && t2 <= 127242 || t2 >= 127248 && t2 <= 127277 || t2 >= 127280 && t2 <= 127337 || t2 >= 127344 && t2 <= 127373 || t2 === 127375 || t2 === 127376 || t2 >= 127387 && t2 <= 127404 || t2 >= 917760 && t2 <= 917999 || t2 >= 983040 && t2 <= 1048573 || t2 >= 1048576 && t2 <= 1114109, lt = (t2) => t2 === 12288 || t2 >= 65281 && t2 <= 65376 || t2 >= 65504 && t2 <= 65510, ht = (t2) => t2 >= 4352 && t2 <= 4447 || t2 === 8986 || t2 === 8987 || t2 === 9001 || t2 === 9002 || t2 >= 9193 && t2 <= 9196 || t2 === 9200 || t2 === 9203 || t2 === 9725 || t2 === 9726 || t2 === 9748 || t2 === 9749 || t2 >= 9800 && t2 <= 9811 || t2 === 9855 || t2 === 9875 || t2 === 9889 || t2 === 9898 || t2 === 9899 || t2 === 9917 || t2 === 9918 || t2 === 9924 || t2 === 9925 || t2 === 9934 || t2 === 9940 || t2 === 9962 || t2 === 9970 || t2 === 9971 || t2 === 9973 || t2 === 9978 || t2 === 9981 || t2 === 9989 || t2 === 9994 || t2 === 9995 || t2 === 10024 || t2 === 10060 || t2 === 10062 || t2 >= 10067 && t2 <= 10069 || t2 === 10071 || t2 >= 10133 && t2 <= 10135 || t2 === 10160 || t2 === 10175 || t2 === 11035 || t2 === 11036 || t2 === 11088 || t2 === 11093 || t2 >= 11904 && t2 <= 11929 || t2 >= 11931 && t2 <= 12019 || t2 >= 12032 && t2 <= 12245 || t2 >= 12272 && t2 <= 12287 || t2 >= 12289 && t2 <= 12350 || t2 >= 12353 && t2 <= 12438 || t2 >= 12441 && t2 <= 12543 || t2 >= 12549 && t2 <= 12591 || t2 >= 12593 && t2 <= 12686 || t2 >= 12688 && t2 <= 12771 || t2 >= 12783 && t2 <= 12830 || t2 >= 12832 && t2 <= 12871 || t2 >= 12880 && t2 <= 19903 || t2 >= 19968 && t2 <= 42124 || t2 >= 42128 && t2 <= 42182 || t2 >= 43360 && t2 <= 43388 || t2 >= 44032 && t2 <= 55203 || t2 >= 63744 && t2 <= 64255 || t2 >= 65040 && t2 <= 65049 || t2 >= 65072 && t2 <= 65106 || t2 >= 65108 && t2 <= 65126 || t2 >= 65128 && t2 <= 65131 || t2 >= 94176 && t2 <= 94180 || t2 === 94192 || t2 === 94193 || t2 >= 94208 && t2 <= 100343 || t2 >= 100352 && t2 <= 101589 || t2 >= 101632 && t2 <= 101640 || t2 >= 110576 && t2 <= 110579 || t2 >= 110581 && t2 <= 110587 || t2 === 110589 || t2 === 110590 || t2 >= 110592 && t2 <= 110882 || t2 === 110898 || t2 >= 110928 && t2 <= 110930 || t2 === 110933 || t2 >= 110948 && t2 <= 110951 || t2 >= 110960 && t2 <= 111355 || t2 === 126980 || t2 === 127183 || t2 === 127374 || t2 >= 127377 && t2 <= 127386 || t2 >= 127488 && t2 <= 127490 || t2 >= 127504 && t2 <= 127547 || t2 >= 127552 && t2 <= 127560 || t2 === 127568 || t2 === 127569 || t2 >= 127584 && t2 <= 127589 || t2 >= 127744 && t2 <= 127776 || t2 >= 127789 && t2 <= 127797 || t2 >= 127799 && t2 <= 127868 || t2 >= 127870 && t2 <= 127891 || t2 >= 127904 && t2 <= 127946 || t2 >= 127951 && t2 <= 127955 || t2 >= 127968 && t2 <= 127984 || t2 === 127988 || t2 >= 127992 && t2 <= 128062 || t2 === 128064 || t2 >= 128066 && t2 <= 128252 || t2 >= 128255 && t2 <= 128317 || t2 >= 128331 && t2 <= 128334 || t2 >= 128336 && t2 <= 128359 || t2 === 128378 || t2 === 128405 || t2 === 128406 || t2 === 128420 || t2 >= 128507 && t2 <= 128591 || t2 >= 128640 && t2 <= 128709 || t2 === 128716 || t2 >= 128720 && t2 <= 128722 || t2 >= 128725 && t2 <= 128727 || t2 >= 128732 && t2 <= 128735 || t2 === 128747 || t2 === 128748 || t2 >= 128756 && t2 <= 128764 || t2 >= 128992 && t2 <= 129003 || t2 === 129008 || t2 >= 129292 && t2 <= 129338 || t2 >= 129340 && t2 <= 129349 || t2 >= 129351 && t2 <= 129535 || t2 >= 129648 && t2 <= 129660 || t2 >= 129664 && t2 <= 129672 || t2 >= 129680 && t2 <= 129725 || t2 >= 129727 && t2 <= 129733 || t2 >= 129742 && t2 <= 129755 || t2 >= 129760 && t2 <= 129768 || t2 >= 129776 && t2 <= 129784 || t2 >= 131072 && t2 <= 196605 || t2 >= 196608 && t2 <= 262141, O = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y, y = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y, M = /\t{1,1000}/y, P = new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*", "yu"), L = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y, ct = new RegExp("\\p{M}+", "gu"), Ft = { limit: 1 / 0, ellipsis: "" }, X = (t2, e = {}, s = {}) => {
|
|
1675
|
+
let i = e.limit ?? 1 / 0, r = e.ellipsis ?? "", n = e?.ellipsisWidth ?? (r ? X(r, Ft, s).width : 0), o = s.ansiWidth ?? 0, a = s.controlWidth ?? 0, l = s.tabWidth ?? 8, E = s.ambiguousWidth ?? 1, g = s.emojiWidth ?? 2, m = s.fullWidthWidth ?? 2, A = s.regularWidth ?? 1, V2 = s.wideWidth ?? 2, h = 0, u = 0, f = t2.length, v = 0, p = !1, d2 = f, b = Math.max(0, i - n), C = 0, B = 0, c = 0, F = 0;
|
|
1676
1676
|
t: for (; ; ) {
|
|
1677
|
-
if (
|
|
1678
|
-
let
|
|
1679
|
-
|
|
1680
|
-
for (let
|
|
1681
|
-
let
|
|
1682
|
-
if (
|
|
1683
|
-
|
|
1677
|
+
if (B > C || u >= f && u > h) {
|
|
1678
|
+
let ut = t2.slice(C, B) || t2.slice(h, u);
|
|
1679
|
+
v = 0;
|
|
1680
|
+
for (let Y2 of ut.replaceAll(ct, "")) {
|
|
1681
|
+
let $ = Y2.codePointAt(0) || 0;
|
|
1682
|
+
if (lt($) ? F = m : ht($) ? F = V2 : E !== A && at($) ? F = E : F = A, c + F > b && (d2 = Math.min(d2, Math.max(C, h) + v)), c + F > i) {
|
|
1683
|
+
p = !0;
|
|
1684
1684
|
break t;
|
|
1685
1685
|
}
|
|
1686
|
-
|
|
1686
|
+
v += Y2.length, c += F;
|
|
1687
1687
|
}
|
|
1688
|
-
C =
|
|
1688
|
+
C = B = 0;
|
|
1689
1689
|
}
|
|
1690
|
-
if (u >=
|
|
1690
|
+
if (u >= f) break;
|
|
1691
1691
|
if (L.lastIndex = u, L.test(t2)) {
|
|
1692
|
-
if (
|
|
1693
|
-
|
|
1692
|
+
if (v = L.lastIndex - u, F = v * A, c + F > b && (d2 = Math.min(d2, u + Math.floor((b - c) / A))), c + F > i) {
|
|
1693
|
+
p = !0;
|
|
1694
1694
|
break;
|
|
1695
1695
|
}
|
|
1696
|
-
|
|
1696
|
+
c += F, C = h, B = u, u = h = L.lastIndex;
|
|
1697
1697
|
continue;
|
|
1698
1698
|
}
|
|
1699
|
-
if (
|
|
1700
|
-
if (
|
|
1701
|
-
|
|
1699
|
+
if (O.lastIndex = u, O.test(t2)) {
|
|
1700
|
+
if (c + o > b && (d2 = Math.min(d2, u)), c + o > i) {
|
|
1701
|
+
p = !0;
|
|
1702
1702
|
break;
|
|
1703
1703
|
}
|
|
1704
|
-
|
|
1704
|
+
c += o, C = h, B = u, u = h = O.lastIndex;
|
|
1705
1705
|
continue;
|
|
1706
1706
|
}
|
|
1707
1707
|
if (y.lastIndex = u, y.test(t2)) {
|
|
1708
|
-
if (
|
|
1709
|
-
|
|
1708
|
+
if (v = y.lastIndex - u, F = v * a, c + F > b && (d2 = Math.min(d2, u + Math.floor((b - c) / a))), c + F > i) {
|
|
1709
|
+
p = !0;
|
|
1710
1710
|
break;
|
|
1711
1711
|
}
|
|
1712
|
-
|
|
1712
|
+
c += F, C = h, B = u, u = h = y.lastIndex;
|
|
1713
1713
|
continue;
|
|
1714
1714
|
}
|
|
1715
1715
|
if (M.lastIndex = u, M.test(t2)) {
|
|
1716
|
-
if (
|
|
1717
|
-
|
|
1716
|
+
if (v = M.lastIndex - u, F = v * l, c + F > b && (d2 = Math.min(d2, u + Math.floor((b - c) / l))), c + F > i) {
|
|
1717
|
+
p = !0;
|
|
1718
1718
|
break;
|
|
1719
1719
|
}
|
|
1720
|
-
|
|
1720
|
+
c += F, C = h, B = u, u = h = M.lastIndex;
|
|
1721
1721
|
continue;
|
|
1722
1722
|
}
|
|
1723
|
-
if (
|
|
1724
|
-
if (
|
|
1725
|
-
|
|
1723
|
+
if (P.lastIndex = u, P.test(t2)) {
|
|
1724
|
+
if (c + g > b && (d2 = Math.min(d2, u)), c + g > i) {
|
|
1725
|
+
p = !0;
|
|
1726
1726
|
break;
|
|
1727
1727
|
}
|
|
1728
|
-
|
|
1728
|
+
c += g, C = h, B = u, u = h = P.lastIndex;
|
|
1729
1729
|
continue;
|
|
1730
1730
|
}
|
|
1731
1731
|
u += 1;
|
|
1732
1732
|
}
|
|
1733
|
-
return { width:
|
|
1734
|
-
},
|
|
1733
|
+
return { width: p ? b : c, index: p ? d2 : f, truncated: p, ellipsed: p && i >= n };
|
|
1734
|
+
}, ft = { limit: 1 / 0, ellipsis: "", ellipsisWidth: 0 }, S = (t2, e = {}) => X(t2, ft, e).width, W = "\x1B", Z = "\x9B", pt = 39, j = "\x07", Q = "[", dt = "]", tt = "m", U = `${dt}8;;`, et = new RegExp(`(?:\\${Q}(?<code>\\d+)m|\\${U}(?<uri>.*)${j})`, "y"), mt = (t2) => {
|
|
1735
1735
|
if (t2 >= 30 && t2 <= 37 || t2 >= 90 && t2 <= 97) return 39;
|
|
1736
1736
|
if (t2 >= 40 && t2 <= 47 || t2 >= 100 && t2 <= 107) return 49;
|
|
1737
1737
|
if (t2 === 1 || t2 === 2) return 22;
|
|
@@ -1741,111 +1741,118 @@ var ut = (t2) => t2 === 161 || t2 === 164 || t2 === 167 || t2 === 168 || t2 ===
|
|
|
1741
1741
|
if (t2 === 8) return 28;
|
|
1742
1742
|
if (t2 === 9) return 29;
|
|
1743
1743
|
if (t2 === 0) return 0;
|
|
1744
|
-
}, st = (t2) => `${W}${
|
|
1745
|
-
let i =
|
|
1746
|
-
for (; !
|
|
1747
|
-
let m =
|
|
1748
|
-
|
|
1749
|
-
}
|
|
1750
|
-
|
|
1751
|
-
},
|
|
1752
|
-
let
|
|
1753
|
-
for (;
|
|
1754
|
-
return
|
|
1755
|
-
},
|
|
1756
|
-
if (
|
|
1757
|
-
let i = "", r, n,
|
|
1758
|
-
for (let [
|
|
1759
|
-
|
|
1760
|
-
let
|
|
1761
|
-
if (
|
|
1762
|
-
let
|
|
1763
|
-
Math.floor((
|
|
1744
|
+
}, st = (t2) => `${W}${Q}${t2}${tt}`, it = (t2) => `${W}${U}${t2}${j}`, gt = (t2) => t2.map((e) => S(e)), G = (t2, e, s) => {
|
|
1745
|
+
let i = e[Symbol.iterator](), r = !1, n = !1, o = t2.at(-1), a = o === void 0 ? 0 : S(o), l = i.next(), E = i.next(), g = 0;
|
|
1746
|
+
for (; !l.done; ) {
|
|
1747
|
+
let m = l.value, A = S(m);
|
|
1748
|
+
a + A <= s ? t2[t2.length - 1] += m : (t2.push(m), a = 0), (m === W || m === Z) && (r = !0, n = e.startsWith(U, g + 1)), r ? n ? m === j && (r = !1, n = !1) : m === tt && (r = !1) : (a += A, a === s && !E.done && (t2.push(""), a = 0)), l = E, E = i.next(), g += m.length;
|
|
1749
|
+
}
|
|
1750
|
+
o = t2.at(-1), !a && o !== void 0 && o.length > 0 && t2.length > 1 && (t2[t2.length - 2] += t2.pop());
|
|
1751
|
+
}, vt = (t2) => {
|
|
1752
|
+
let e = t2.split(" "), s = e.length;
|
|
1753
|
+
for (; s > 0 && !(S(e[s - 1]) > 0); ) s--;
|
|
1754
|
+
return s === e.length ? t2 : e.slice(0, s).join(" ") + e.slice(s).join("");
|
|
1755
|
+
}, Et = (t2, e, s = {}) => {
|
|
1756
|
+
if (s.trim !== !1 && t2.trim() === "") return "";
|
|
1757
|
+
let i = "", r, n, o = t2.split(" "), a = gt(o), l = [""];
|
|
1758
|
+
for (let [h, u] of o.entries()) {
|
|
1759
|
+
s.trim !== !1 && (l[l.length - 1] = (l.at(-1) ?? "").trimStart());
|
|
1760
|
+
let f = S(l.at(-1) ?? "");
|
|
1761
|
+
if (h !== 0 && (f >= e && (s.wordWrap === !1 || s.trim === !1) && (l.push(""), f = 0), (f > 0 || s.trim === !1) && (l[l.length - 1] += " ", f++)), s.hard && a[h] > e) {
|
|
1762
|
+
let v = e - f, p = 1 + Math.floor((a[h] - v - 1) / e);
|
|
1763
|
+
Math.floor((a[h] - 1) / e) < p && l.push(""), G(l, u, e);
|
|
1764
1764
|
continue;
|
|
1765
1765
|
}
|
|
1766
|
-
if (
|
|
1767
|
-
if (
|
|
1768
|
-
|
|
1766
|
+
if (f + a[h] > e && f > 0 && a[h] > 0) {
|
|
1767
|
+
if (s.wordWrap === !1 && f < e) {
|
|
1768
|
+
G(l, u, e);
|
|
1769
1769
|
continue;
|
|
1770
1770
|
}
|
|
1771
|
-
|
|
1771
|
+
l.push("");
|
|
1772
1772
|
}
|
|
1773
|
-
if (
|
|
1774
|
-
|
|
1773
|
+
if (f + a[h] > e && s.wordWrap === !1) {
|
|
1774
|
+
G(l, u, e);
|
|
1775
1775
|
continue;
|
|
1776
1776
|
}
|
|
1777
|
-
|
|
1777
|
+
l[l.length - 1] += u;
|
|
1778
1778
|
}
|
|
1779
|
-
|
|
1780
|
-
let
|
|
1781
|
-
`), g =
|
|
1779
|
+
s.trim !== !1 && (l = l.map((h) => vt(h)));
|
|
1780
|
+
let E = l.join(`
|
|
1781
|
+
`), g = E[Symbol.iterator](), m = g.next(), A = g.next(), V2 = 0;
|
|
1782
1782
|
for (; !m.done; ) {
|
|
1783
|
-
let
|
|
1784
|
-
if (i +=
|
|
1785
|
-
|
|
1786
|
-
let
|
|
1787
|
-
if (
|
|
1788
|
-
let d2 = Number.parseFloat(
|
|
1789
|
-
r = d2 ===
|
|
1790
|
-
} else
|
|
1791
|
-
}
|
|
1792
|
-
let
|
|
1783
|
+
let h = m.value, u = A.value;
|
|
1784
|
+
if (i += h, h === W || h === Z) {
|
|
1785
|
+
et.lastIndex = V2 + 1;
|
|
1786
|
+
let p = et.exec(E)?.groups;
|
|
1787
|
+
if (p?.code !== void 0) {
|
|
1788
|
+
let d2 = Number.parseFloat(p.code);
|
|
1789
|
+
r = d2 === pt ? void 0 : d2;
|
|
1790
|
+
} else p?.uri !== void 0 && (n = p.uri.length === 0 ? void 0 : p.uri);
|
|
1791
|
+
}
|
|
1792
|
+
let f = r ? mt(r) : void 0;
|
|
1793
1793
|
u === `
|
|
1794
|
-
` ? (n && (i +=
|
|
1795
|
-
` && (r &&
|
|
1794
|
+
` ? (n && (i += it("")), r && f && (i += st(f))) : h === `
|
|
1795
|
+
` && (r && f && (i += st(r)), n && (i += it(n))), V2 += h.length, m = A, A = g.next();
|
|
1796
1796
|
}
|
|
1797
1797
|
return i;
|
|
1798
1798
|
};
|
|
1799
|
-
function
|
|
1799
|
+
function K(t2, e, s) {
|
|
1800
1800
|
return String(t2).normalize().replaceAll(`\r
|
|
1801
1801
|
`, `
|
|
1802
1802
|
`).split(`
|
|
1803
|
-
`).map((i) =>
|
|
1803
|
+
`).map((i) => Et(i, e, s)).join(`
|
|
1804
1804
|
`);
|
|
1805
1805
|
}
|
|
1806
|
-
var
|
|
1807
|
-
function
|
|
1808
|
-
if (typeof t2 == "string") return
|
|
1809
|
-
for (let
|
|
1806
|
+
var At = ["up", "down", "left", "right", "space", "enter", "cancel"], _ = { actions: new Set(At), aliases: /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["", "cancel"], ["escape", "cancel"]]), messages: { cancel: "Canceled", error: "Something went wrong" }, withGuide: !0 };
|
|
1807
|
+
function H(t2, e) {
|
|
1808
|
+
if (typeof t2 == "string") return _.aliases.get(t2) === e;
|
|
1809
|
+
for (let s of t2) if (s !== void 0 && H(s, e)) return !0;
|
|
1810
1810
|
return !1;
|
|
1811
1811
|
}
|
|
1812
|
-
function
|
|
1813
|
-
if (t2 ===
|
|
1814
|
-
let
|
|
1815
|
-
`), i =
|
|
1816
|
-
`), r = [];
|
|
1817
|
-
for (let
|
|
1818
|
-
return r;
|
|
1812
|
+
function _t(t2, e) {
|
|
1813
|
+
if (t2 === e) return;
|
|
1814
|
+
let s = t2.split(`
|
|
1815
|
+
`), i = e.split(`
|
|
1816
|
+
`), r = Math.max(s.length, i.length), n = [];
|
|
1817
|
+
for (let o = 0; o < r; o++) s[o] !== i[o] && n.push(o);
|
|
1818
|
+
return { lines: n, numLinesBefore: s.length, numLinesAfter: i.length, numLines: r };
|
|
1819
1819
|
}
|
|
1820
|
-
var
|
|
1821
|
-
function
|
|
1822
|
-
return t2 ===
|
|
1820
|
+
var bt = globalThis.process.platform.startsWith("win"), z = Symbol("clack:cancel");
|
|
1821
|
+
function Ct(t2) {
|
|
1822
|
+
return t2 === z;
|
|
1823
1823
|
}
|
|
1824
|
-
function T(t2,
|
|
1825
|
-
let
|
|
1826
|
-
|
|
1824
|
+
function T(t2, e) {
|
|
1825
|
+
let s = t2;
|
|
1826
|
+
s.isTTY && s.setRawMode(e);
|
|
1827
1827
|
}
|
|
1828
|
-
function
|
|
1829
|
-
let r = k.createInterface({ input: t2, output:
|
|
1830
|
-
k.emitKeypressEvents(t2, r), t2 instanceof
|
|
1831
|
-
let n = (
|
|
1832
|
-
let
|
|
1833
|
-
if (
|
|
1834
|
-
i &&
|
|
1828
|
+
function xt({ input: t2 = q, output: e = R, overwrite: s = !0, hideCursor: i = !0 } = {}) {
|
|
1829
|
+
let r = k.createInterface({ input: t2, output: e, prompt: "", tabSize: 1 });
|
|
1830
|
+
k.emitKeypressEvents(t2, r), t2 instanceof J && t2.isTTY && t2.setRawMode(!0);
|
|
1831
|
+
let n = (o, { name: a, sequence: l }) => {
|
|
1832
|
+
let E = String(o);
|
|
1833
|
+
if (H([E, a, l], "cancel")) {
|
|
1834
|
+
i && e.write(import_sisteransi.cursor.show), process.exit(0);
|
|
1835
1835
|
return;
|
|
1836
1836
|
}
|
|
1837
|
-
if (!
|
|
1838
|
-
k.moveCursor(
|
|
1839
|
-
k.clearLine(
|
|
1837
|
+
if (!s) return;
|
|
1838
|
+
k.moveCursor(e, a === "return" ? 0 : -1, a === "return" ? -1 : 0, () => {
|
|
1839
|
+
k.clearLine(e, 1, () => {
|
|
1840
1840
|
t2.once("keypress", n);
|
|
1841
1841
|
});
|
|
1842
1842
|
});
|
|
1843
1843
|
};
|
|
1844
|
-
return i &&
|
|
1845
|
-
t2.off("keypress", n), i &&
|
|
1844
|
+
return i && e.write(import_sisteransi.cursor.hide), t2.once("keypress", n), () => {
|
|
1845
|
+
t2.off("keypress", n), i && e.write(import_sisteransi.cursor.show), t2 instanceof J && t2.isTTY && !bt && t2.setRawMode(!1), r.terminal = !1, r.close();
|
|
1846
1846
|
};
|
|
1847
1847
|
}
|
|
1848
|
-
var
|
|
1848
|
+
var rt = (t2) => "columns" in t2 && typeof t2.columns == "number" ? t2.columns : 80, nt = (t2) => "rows" in t2 && typeof t2.rows == "number" ? t2.rows : 20;
|
|
1849
|
+
function Bt(t2, e, s, i = s) {
|
|
1850
|
+
let r = rt(t2 ?? R);
|
|
1851
|
+
return K(e, r - s.length, { hard: !0, trim: !1 }).split(`
|
|
1852
|
+
`).map((n, o) => `${o === 0 ? i : s}${n}`).join(`
|
|
1853
|
+
`);
|
|
1854
|
+
}
|
|
1855
|
+
var x = class {
|
|
1849
1856
|
input;
|
|
1850
1857
|
output;
|
|
1851
1858
|
_abortSignal;
|
|
@@ -1860,162 +1867,171 @@ var Ct = (t2) => "columns" in t2 && typeof t2.columns == "number" ? t2.columns :
|
|
|
1860
1867
|
error = "";
|
|
1861
1868
|
value;
|
|
1862
1869
|
userInput = "";
|
|
1863
|
-
constructor(
|
|
1864
|
-
let { input: i =
|
|
1865
|
-
this.opts =
|
|
1870
|
+
constructor(e, s = !0) {
|
|
1871
|
+
let { input: i = q, output: r = R, render: n, signal: o, ...a } = e;
|
|
1872
|
+
this.opts = a, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = n.bind(this), this._track = s, this._abortSignal = o, this.input = i, this.output = r;
|
|
1866
1873
|
}
|
|
1867
1874
|
unsubscribe() {
|
|
1868
1875
|
this._subscribers.clear();
|
|
1869
1876
|
}
|
|
1870
|
-
setSubscriber(
|
|
1871
|
-
let i = this._subscribers.get(
|
|
1872
|
-
i.push(
|
|
1877
|
+
setSubscriber(e, s) {
|
|
1878
|
+
let i = this._subscribers.get(e) ?? [];
|
|
1879
|
+
i.push(s), this._subscribers.set(e, i);
|
|
1873
1880
|
}
|
|
1874
|
-
on(
|
|
1875
|
-
this.setSubscriber(
|
|
1881
|
+
on(e, s) {
|
|
1882
|
+
this.setSubscriber(e, { cb: s });
|
|
1876
1883
|
}
|
|
1877
|
-
once(
|
|
1878
|
-
this.setSubscriber(
|
|
1884
|
+
once(e, s) {
|
|
1885
|
+
this.setSubscriber(e, { cb: s, once: !0 });
|
|
1879
1886
|
}
|
|
1880
|
-
emit(
|
|
1881
|
-
let i = this._subscribers.get(
|
|
1882
|
-
for (let n of i) n.cb(...
|
|
1887
|
+
emit(e, ...s) {
|
|
1888
|
+
let i = this._subscribers.get(e) ?? [], r = [];
|
|
1889
|
+
for (let n of i) n.cb(...s), n.once && r.push(() => i.splice(i.indexOf(n), 1));
|
|
1883
1890
|
for (let n of r) n();
|
|
1884
1891
|
}
|
|
1885
1892
|
prompt() {
|
|
1886
|
-
return new Promise((
|
|
1893
|
+
return new Promise((e) => {
|
|
1887
1894
|
if (this._abortSignal) {
|
|
1888
|
-
if (this._abortSignal.aborted) return this.state = "cancel", this.close(),
|
|
1895
|
+
if (this._abortSignal.aborted) return this.state = "cancel", this.close(), e(z);
|
|
1889
1896
|
this._abortSignal.addEventListener("abort", () => {
|
|
1890
1897
|
this.state = "cancel", this.close();
|
|
1891
1898
|
}, { once: !0 });
|
|
1892
1899
|
}
|
|
1893
|
-
this.rl =
|
|
1894
|
-
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), T(this.input, !1),
|
|
1900
|
+
this.rl = ot.createInterface({ input: this.input, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: !0 }), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, !0), this.input.on("keypress", this.onKeypress), T(this.input, !0), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
|
|
1901
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), T(this.input, !1), e(this.value);
|
|
1895
1902
|
}), this.once("cancel", () => {
|
|
1896
|
-
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), T(this.input, !1),
|
|
1903
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), T(this.input, !1), e(z);
|
|
1897
1904
|
});
|
|
1898
1905
|
});
|
|
1899
1906
|
}
|
|
1900
|
-
_isActionKey(
|
|
1901
|
-
return
|
|
1907
|
+
_isActionKey(e, s) {
|
|
1908
|
+
return e === " ";
|
|
1902
1909
|
}
|
|
1903
|
-
_setValue(
|
|
1904
|
-
this.value =
|
|
1910
|
+
_setValue(e) {
|
|
1911
|
+
this.value = e, this.emit("value", this.value);
|
|
1905
1912
|
}
|
|
1906
|
-
_setUserInput(
|
|
1907
|
-
this.userInput =
|
|
1913
|
+
_setUserInput(e, s) {
|
|
1914
|
+
this.userInput = e ?? "", this.emit("userInput", this.userInput), s && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
|
|
1908
1915
|
}
|
|
1909
1916
|
_clearUserInput() {
|
|
1910
1917
|
this.rl?.write(null, { ctrl: !0, name: "u" }), this._setUserInput("");
|
|
1911
1918
|
}
|
|
1912
|
-
onKeypress(
|
|
1913
|
-
if (this._track &&
|
|
1919
|
+
onKeypress(e, s) {
|
|
1920
|
+
if (this._track && s.name !== "return" && (s.name && this._isActionKey(e, s) && this.rl?.write(null, { ctrl: !0, name: "h" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), s?.name && (!this._track && _.aliases.has(s.name) && this.emit("cursor", _.aliases.get(s.name)), _.actions.has(s.name) && this.emit("cursor", s.name)), e && (e.toLowerCase() === "y" || e.toLowerCase() === "n") && this.emit("confirm", e.toLowerCase() === "y"), this.emit("key", e?.toLowerCase(), s), s?.name === "return") {
|
|
1914
1921
|
if (this.opts.validate) {
|
|
1915
1922
|
let i = this.opts.validate(this.value);
|
|
1916
1923
|
i && (this.error = i instanceof Error ? i.message : i, this.state = "error", this.rl?.write(this.userInput));
|
|
1917
1924
|
}
|
|
1918
1925
|
this.state !== "error" && (this.state = "submit");
|
|
1919
1926
|
}
|
|
1920
|
-
|
|
1927
|
+
H([e, s?.name, s?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
1921
1928
|
}
|
|
1922
1929
|
close() {
|
|
1923
1930
|
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
1924
1931
|
`), T(this.input, !1), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
1925
1932
|
}
|
|
1926
1933
|
restoreCursor() {
|
|
1927
|
-
let
|
|
1934
|
+
let e = K(this._prevFrame, process.stdout.columns, { hard: !0, trim: !1 }).split(`
|
|
1928
1935
|
`).length - 1;
|
|
1929
|
-
this.output.write(import_sisteransi.cursor.move(-999,
|
|
1936
|
+
this.output.write(import_sisteransi.cursor.move(-999, e * -1));
|
|
1930
1937
|
}
|
|
1931
1938
|
render() {
|
|
1932
|
-
let
|
|
1933
|
-
if (
|
|
1939
|
+
let e = K(this._render(this) ?? "", process.stdout.columns, { hard: !0, trim: !1 });
|
|
1940
|
+
if (e !== this._prevFrame) {
|
|
1934
1941
|
if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
|
|
1935
1942
|
else {
|
|
1936
|
-
let
|
|
1937
|
-
if (this.restoreCursor(),
|
|
1938
|
-
let i =
|
|
1939
|
-
|
|
1940
|
-
|
|
1943
|
+
let s = _t(this._prevFrame, e), i = nt(this.output);
|
|
1944
|
+
if (this.restoreCursor(), s) {
|
|
1945
|
+
let r = Math.max(0, s.numLinesAfter - i), n = Math.max(0, s.numLinesBefore - i), o = s.lines.find((a) => a >= r);
|
|
1946
|
+
if (o === void 0) {
|
|
1947
|
+
this._prevFrame = e;
|
|
1948
|
+
return;
|
|
1949
|
+
}
|
|
1950
|
+
if (s.lines.length === 1) {
|
|
1951
|
+
this.output.write(import_sisteransi.cursor.move(0, o - n)), this.output.write(import_sisteransi.erase.lines(1));
|
|
1952
|
+
let a = e.split(`
|
|
1941
1953
|
`);
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1954
|
+
this.output.write(a[o]), this._prevFrame = e, this.output.write(import_sisteransi.cursor.move(0, a.length - o - 1));
|
|
1955
|
+
return;
|
|
1956
|
+
} else if (s.lines.length > 1) {
|
|
1957
|
+
if (r < n) o = r;
|
|
1958
|
+
else {
|
|
1959
|
+
let l = o - n;
|
|
1960
|
+
l > 0 && this.output.write(import_sisteransi.cursor.move(0, l));
|
|
1961
|
+
}
|
|
1962
|
+
this.output.write(import_sisteransi.erase.down());
|
|
1963
|
+
let a = e.split(`
|
|
1964
|
+
`).slice(o);
|
|
1965
|
+
this.output.write(a.join(`
|
|
1966
|
+
`)), this._prevFrame = e;
|
|
1967
|
+
return;
|
|
1968
|
+
}
|
|
1953
1969
|
}
|
|
1954
1970
|
this.output.write(import_sisteransi.erase.down());
|
|
1955
1971
|
}
|
|
1956
|
-
this.output.write(
|
|
1972
|
+
this.output.write(e), this.state === "initial" && (this.state = "active"), this._prevFrame = e;
|
|
1957
1973
|
}
|
|
1958
1974
|
}
|
|
1959
1975
|
};
|
|
1960
|
-
var
|
|
1976
|
+
var kt = class extends x {
|
|
1961
1977
|
get cursor() {
|
|
1962
1978
|
return this.value ? 0 : 1;
|
|
1963
1979
|
}
|
|
1964
1980
|
get _value() {
|
|
1965
1981
|
return this.cursor === 0;
|
|
1966
1982
|
}
|
|
1967
|
-
constructor(
|
|
1968
|
-
super(
|
|
1983
|
+
constructor(e) {
|
|
1984
|
+
super(e, !1), this.value = !!e.initialValue, this.on("userInput", () => {
|
|
1969
1985
|
this.value = this._value;
|
|
1970
|
-
}), this.on("confirm", (
|
|
1971
|
-
this.output.write(import_sisteransi.cursor.move(0, -1)), this.value =
|
|
1986
|
+
}), this.on("confirm", (s) => {
|
|
1987
|
+
this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = s, this.state = "submit", this.close();
|
|
1972
1988
|
}), this.on("cursor", () => {
|
|
1973
1989
|
this.value = !this.value;
|
|
1974
1990
|
});
|
|
1975
1991
|
}
|
|
1976
1992
|
};
|
|
1977
|
-
function
|
|
1978
|
-
let i = t2 +
|
|
1979
|
-
return
|
|
1993
|
+
function D(t2, e, s) {
|
|
1994
|
+
let i = t2 + e, r = Math.max(s.length - 1, 0), n = i < 0 ? r : i > r ? 0 : i;
|
|
1995
|
+
return s[n].disabled ? D(n, e < 0 ? -1 : 1, s) : n;
|
|
1980
1996
|
}
|
|
1981
|
-
var
|
|
1997
|
+
var Mt = class extends x {
|
|
1982
1998
|
options;
|
|
1983
1999
|
cursor = 0;
|
|
1984
2000
|
get _value() {
|
|
1985
2001
|
return this.options[this.cursor].value;
|
|
1986
2002
|
}
|
|
1987
2003
|
get _enabledOptions() {
|
|
1988
|
-
return this.options.filter((
|
|
2004
|
+
return this.options.filter((e) => e.disabled !== !0);
|
|
1989
2005
|
}
|
|
1990
2006
|
toggleAll() {
|
|
1991
|
-
let
|
|
1992
|
-
this.value =
|
|
2007
|
+
let e = this._enabledOptions, s = this.value !== void 0 && this.value.length === e.length;
|
|
2008
|
+
this.value = s ? [] : e.map((i) => i.value);
|
|
1993
2009
|
}
|
|
1994
2010
|
toggleInvert() {
|
|
1995
|
-
let
|
|
1996
|
-
if (!
|
|
1997
|
-
let
|
|
1998
|
-
this.value =
|
|
2011
|
+
let e = this.value;
|
|
2012
|
+
if (!e) return;
|
|
2013
|
+
let s = this._enabledOptions.filter((i) => !e.includes(i.value));
|
|
2014
|
+
this.value = s.map((i) => i.value);
|
|
1999
2015
|
}
|
|
2000
2016
|
toggleValue() {
|
|
2001
2017
|
this.value === void 0 && (this.value = []);
|
|
2002
|
-
let
|
|
2003
|
-
this.value =
|
|
2018
|
+
let e = this.value.includes(this._value);
|
|
2019
|
+
this.value = e ? this.value.filter((s) => s !== this._value) : [...this.value, this._value];
|
|
2004
2020
|
}
|
|
2005
|
-
constructor(
|
|
2006
|
-
super(
|
|
2007
|
-
let
|
|
2008
|
-
this.cursor = this.options[
|
|
2021
|
+
constructor(e) {
|
|
2022
|
+
super(e, !1), this.options = e.options, this.value = [...e.initialValues ?? []];
|
|
2023
|
+
let s = Math.max(this.options.findIndex(({ value: i }) => i === e.cursorAt), 0);
|
|
2024
|
+
this.cursor = this.options[s].disabled ? D(s, 1, this.options) : s, this.on("key", (i) => {
|
|
2009
2025
|
i === "a" && this.toggleAll(), i === "i" && this.toggleInvert();
|
|
2010
2026
|
}), this.on("cursor", (i) => {
|
|
2011
2027
|
switch (i) {
|
|
2012
2028
|
case "left":
|
|
2013
2029
|
case "up":
|
|
2014
|
-
this.cursor =
|
|
2030
|
+
this.cursor = D(this.cursor, -1, this.options);
|
|
2015
2031
|
break;
|
|
2016
2032
|
case "down":
|
|
2017
2033
|
case "right":
|
|
2018
|
-
this.cursor =
|
|
2034
|
+
this.cursor = D(this.cursor, 1, this.options);
|
|
2019
2035
|
break;
|
|
2020
2036
|
case "space":
|
|
2021
2037
|
this.toggleValue();
|
|
@@ -2024,7 +2040,7 @@ var yt = class extends B {
|
|
|
2024
2040
|
});
|
|
2025
2041
|
}
|
|
2026
2042
|
};
|
|
2027
|
-
var
|
|
2043
|
+
var Wt = class extends x {
|
|
2028
2044
|
options;
|
|
2029
2045
|
cursor = 0;
|
|
2030
2046
|
get _selectedValue() {
|
|
@@ -2033,40 +2049,40 @@ var Lt = class extends B {
|
|
|
2033
2049
|
changeValue() {
|
|
2034
2050
|
this.value = this._selectedValue.value;
|
|
2035
2051
|
}
|
|
2036
|
-
constructor(
|
|
2037
|
-
super(
|
|
2038
|
-
let
|
|
2039
|
-
this.cursor = this.options[i].disabled ?
|
|
2052
|
+
constructor(e) {
|
|
2053
|
+
super(e, !1), this.options = e.options;
|
|
2054
|
+
let s = this.options.findIndex(({ value: r }) => r === e.initialValue), i = s === -1 ? 0 : s;
|
|
2055
|
+
this.cursor = this.options[i].disabled ? D(i, 1, this.options) : i, this.changeValue(), this.on("cursor", (r) => {
|
|
2040
2056
|
switch (r) {
|
|
2041
2057
|
case "left":
|
|
2042
2058
|
case "up":
|
|
2043
|
-
this.cursor =
|
|
2059
|
+
this.cursor = D(this.cursor, -1, this.options);
|
|
2044
2060
|
break;
|
|
2045
2061
|
case "down":
|
|
2046
2062
|
case "right":
|
|
2047
|
-
this.cursor =
|
|
2063
|
+
this.cursor = D(this.cursor, 1, this.options);
|
|
2048
2064
|
break;
|
|
2049
2065
|
}
|
|
2050
2066
|
this.changeValue();
|
|
2051
2067
|
});
|
|
2052
2068
|
}
|
|
2053
2069
|
};
|
|
2054
|
-
var
|
|
2070
|
+
var $t = class extends x {
|
|
2055
2071
|
get userInputWithCursor() {
|
|
2056
2072
|
if (this.state === "submit") return this.userInput;
|
|
2057
|
-
let
|
|
2058
|
-
if (this.cursor >=
|
|
2059
|
-
let
|
|
2060
|
-
return `${
|
|
2073
|
+
let e = this.userInput;
|
|
2074
|
+
if (this.cursor >= e.length) return `${this.userInput}\u2588`;
|
|
2075
|
+
let s = e.slice(0, this.cursor), [i, ...r] = e.slice(this.cursor);
|
|
2076
|
+
return `${s}${import_picocolors.default.inverse(i)}${r.join("")}`;
|
|
2061
2077
|
}
|
|
2062
2078
|
get cursor() {
|
|
2063
2079
|
return this._cursor;
|
|
2064
2080
|
}
|
|
2065
|
-
constructor(
|
|
2066
|
-
super({ ...
|
|
2067
|
-
this._setValue(
|
|
2081
|
+
constructor(e) {
|
|
2082
|
+
super({ ...e, initialUserInput: e.initialUserInput ?? e.initialValue }), this.on("userInput", (s) => {
|
|
2083
|
+
this._setValue(s);
|
|
2068
2084
|
}), this.on("finalize", () => {
|
|
2069
|
-
this.value || (this.value =
|
|
2085
|
+
this.value || (this.value = e.defaultValue), this.value === void 0 && (this.value = "");
|
|
2070
2086
|
});
|
|
2071
2087
|
}
|
|
2072
2088
|
};
|
|
@@ -2075,82 +2091,94 @@ var Tt = class extends B {
|
|
|
2075
2091
|
var import_picocolors2 = __toESM(require_picocolors(), 1);
|
|
2076
2092
|
import N2 from "node:process";
|
|
2077
2093
|
var import_sisteransi2 = __toESM(require_src(), 1);
|
|
2078
|
-
function
|
|
2094
|
+
function ht2() {
|
|
2079
2095
|
return N2.platform !== "win32" ? N2.env.TERM !== "linux" : !!N2.env.CI || !!N2.env.WT_SESSION || !!N2.env.TERMINUS_SUBLIME || N2.env.ConEmuTask === "{cmd::Cmder}" || N2.env.TERM_PROGRAM === "Terminus-Sublime" || N2.env.TERM_PROGRAM === "vscode" || N2.env.TERM === "xterm-256color" || N2.env.TERM === "alacritty" || N2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
2080
2096
|
}
|
|
2081
|
-
var
|
|
2097
|
+
var ee = ht2(), ue = () => process.env.CI === "true", Te = (e) => e.isTTY === !0, I2 = (e, r) => ee ? e : r, Me = I2("\u25C6", "*"), ce = I2("\u25A0", "x"), de = I2("\u25B2", "x"), j2 = I2("\u25C7", "o"), $e = I2("\u250C", "T"), d = I2("\u2502", "|"), x2 = I2("\u2514", "\u2014"), Re = I2("\u2510", "T"), Oe = I2("\u2518", "\u2014"), Y = I2("\u25CF", ">"), K2 = I2("\u25CB", " "), te = I2("\u25FB", "[\u2022]"), V = I2("\u25FC", "[+]"), z2 = I2("\u25FB", "[ ]"), Ne = I2("\u25AA", "\u2022"), se = I2("\u2500", "-"), he = I2("\u256E", "+"), Pe = I2("\u251C", "+"), me = I2("\u256F", "+"), pe = I2("\u2570", "+"), We = I2("\u256D", "+"), ge = I2("\u25CF", "\u2022"), fe = I2("\u25C6", "*"), Fe = I2("\u25B2", "!"), ye = I2("\u25A0", "x"), W2 = (e) => {
|
|
2082
2098
|
switch (e) {
|
|
2083
2099
|
case "initial":
|
|
2084
2100
|
case "active":
|
|
2085
|
-
return import_picocolors2.default.cyan(
|
|
2101
|
+
return import_picocolors2.default.cyan(Me);
|
|
2086
2102
|
case "cancel":
|
|
2087
|
-
return import_picocolors2.default.red(
|
|
2103
|
+
return import_picocolors2.default.red(ce);
|
|
2088
2104
|
case "error":
|
|
2089
|
-
return import_picocolors2.default.yellow(
|
|
2105
|
+
return import_picocolors2.default.yellow(de);
|
|
2090
2106
|
case "submit":
|
|
2091
|
-
return import_picocolors2.default.green(
|
|
2107
|
+
return import_picocolors2.default.green(j2);
|
|
2092
2108
|
}
|
|
2093
|
-
},
|
|
2094
|
-
|
|
2109
|
+
}, Ee = (e) => {
|
|
2110
|
+
switch (e) {
|
|
2111
|
+
case "initial":
|
|
2112
|
+
case "active":
|
|
2113
|
+
return import_picocolors2.default.cyan(d);
|
|
2114
|
+
case "cancel":
|
|
2115
|
+
return import_picocolors2.default.red(d);
|
|
2116
|
+
case "error":
|
|
2117
|
+
return import_picocolors2.default.yellow(d);
|
|
2118
|
+
case "submit":
|
|
2119
|
+
return import_picocolors2.default.green(d);
|
|
2120
|
+
}
|
|
2121
|
+
}, mt2 = (e) => e === 161 || e === 164 || e === 167 || e === 168 || e === 170 || e === 173 || e === 174 || e >= 176 && e <= 180 || e >= 182 && e <= 186 || e >= 188 && e <= 191 || e === 198 || e === 208 || e === 215 || e === 216 || e >= 222 && e <= 225 || e === 230 || e >= 232 && e <= 234 || e === 236 || e === 237 || e === 240 || e === 242 || e === 243 || e >= 247 && e <= 250 || e === 252 || e === 254 || e === 257 || e === 273 || e === 275 || e === 283 || e === 294 || e === 295 || e === 299 || e >= 305 && e <= 307 || e === 312 || e >= 319 && e <= 322 || e === 324 || e >= 328 && e <= 331 || e === 333 || e === 338 || e === 339 || e === 358 || e === 359 || e === 363 || e === 462 || e === 464 || e === 466 || e === 468 || e === 470 || e === 472 || e === 474 || e === 476 || e === 593 || e === 609 || e === 708 || e === 711 || e >= 713 && e <= 715 || e === 717 || e === 720 || e >= 728 && e <= 731 || e === 733 || e === 735 || e >= 768 && e <= 879 || e >= 913 && e <= 929 || e >= 931 && e <= 937 || e >= 945 && e <= 961 || e >= 963 && e <= 969 || e === 1025 || e >= 1040 && e <= 1103 || e === 1105 || e === 8208 || e >= 8211 && e <= 8214 || e === 8216 || e === 8217 || e === 8220 || e === 8221 || e >= 8224 && e <= 8226 || e >= 8228 && e <= 8231 || e === 8240 || e === 8242 || e === 8243 || e === 8245 || e === 8251 || e === 8254 || e === 8308 || e === 8319 || e >= 8321 && e <= 8324 || e === 8364 || e === 8451 || e === 8453 || e === 8457 || e === 8467 || e === 8470 || e === 8481 || e === 8482 || e === 8486 || e === 8491 || e === 8531 || e === 8532 || e >= 8539 && e <= 8542 || e >= 8544 && e <= 8555 || e >= 8560 && e <= 8569 || e === 8585 || e >= 8592 && e <= 8601 || e === 8632 || e === 8633 || e === 8658 || e === 8660 || e === 8679 || e === 8704 || e === 8706 || e === 8707 || e === 8711 || e === 8712 || e === 8715 || e === 8719 || e === 8721 || e === 8725 || e === 8730 || e >= 8733 && e <= 8736 || e === 8739 || e === 8741 || e >= 8743 && e <= 8748 || e === 8750 || e >= 8756 && e <= 8759 || e === 8764 || e === 8765 || e === 8776 || e === 8780 || e === 8786 || e === 8800 || e === 8801 || e >= 8804 && e <= 8807 || e === 8810 || e === 8811 || e === 8814 || e === 8815 || e === 8834 || e === 8835 || e === 8838 || e === 8839 || e === 8853 || e === 8857 || e === 8869 || e === 8895 || e === 8978 || e >= 9312 && e <= 9449 || e >= 9451 && e <= 9547 || e >= 9552 && e <= 9587 || e >= 9600 && e <= 9615 || e >= 9618 && e <= 9621 || e === 9632 || e === 9633 || e >= 9635 && e <= 9641 || e === 9650 || e === 9651 || e === 9654 || e === 9655 || e === 9660 || e === 9661 || e === 9664 || e === 9665 || e >= 9670 && e <= 9672 || e === 9675 || e >= 9678 && e <= 9681 || e >= 9698 && e <= 9701 || e === 9711 || e === 9733 || e === 9734 || e === 9737 || e === 9742 || e === 9743 || e === 9756 || e === 9758 || e === 9792 || e === 9794 || e === 9824 || e === 9825 || e >= 9827 && e <= 9829 || e >= 9831 && e <= 9834 || e === 9836 || e === 9837 || e === 9839 || e === 9886 || e === 9887 || e === 9919 || e >= 9926 && e <= 9933 || e >= 9935 && e <= 9939 || e >= 9941 && e <= 9953 || e === 9955 || e === 9960 || e === 9961 || e >= 9963 && e <= 9969 || e === 9972 || e >= 9974 && e <= 9977 || e === 9979 || e === 9980 || e === 9982 || e === 9983 || e === 10045 || e >= 10102 && e <= 10111 || e >= 11094 && e <= 11097 || e >= 12872 && e <= 12879 || e >= 57344 && e <= 63743 || e >= 65024 && e <= 65039 || e === 65533 || e >= 127232 && e <= 127242 || e >= 127248 && e <= 127277 || e >= 127280 && e <= 127337 || e >= 127344 && e <= 127373 || e === 127375 || e === 127376 || e >= 127387 && e <= 127404 || e >= 917760 && e <= 917999 || e >= 983040 && e <= 1048573 || e >= 1048576 && e <= 1114109, pt2 = (e) => e === 12288 || e >= 65281 && e <= 65376 || e >= 65504 && e <= 65510, gt2 = (e) => e >= 4352 && e <= 4447 || e === 8986 || e === 8987 || e === 9001 || e === 9002 || e >= 9193 && e <= 9196 || e === 9200 || e === 9203 || e === 9725 || e === 9726 || e === 9748 || e === 9749 || e >= 9800 && e <= 9811 || e === 9855 || e === 9875 || e === 9889 || e === 9898 || e === 9899 || e === 9917 || e === 9918 || e === 9924 || e === 9925 || e === 9934 || e === 9940 || e === 9962 || e === 9970 || e === 9971 || e === 9973 || e === 9978 || e === 9981 || e === 9989 || e === 9994 || e === 9995 || e === 10024 || e === 10060 || e === 10062 || e >= 10067 && e <= 10069 || e === 10071 || e >= 10133 && e <= 10135 || e === 10160 || e === 10175 || e === 11035 || e === 11036 || e === 11088 || e === 11093 || e >= 11904 && e <= 11929 || e >= 11931 && e <= 12019 || e >= 12032 && e <= 12245 || e >= 12272 && e <= 12287 || e >= 12289 && e <= 12350 || e >= 12353 && e <= 12438 || e >= 12441 && e <= 12543 || e >= 12549 && e <= 12591 || e >= 12593 && e <= 12686 || e >= 12688 && e <= 12771 || e >= 12783 && e <= 12830 || e >= 12832 && e <= 12871 || e >= 12880 && e <= 19903 || e >= 19968 && e <= 42124 || e >= 42128 && e <= 42182 || e >= 43360 && e <= 43388 || e >= 44032 && e <= 55203 || e >= 63744 && e <= 64255 || e >= 65040 && e <= 65049 || e >= 65072 && e <= 65106 || e >= 65108 && e <= 65126 || e >= 65128 && e <= 65131 || e >= 94176 && e <= 94180 || e === 94192 || e === 94193 || e >= 94208 && e <= 100343 || e >= 100352 && e <= 101589 || e >= 101632 && e <= 101640 || e >= 110576 && e <= 110579 || e >= 110581 && e <= 110587 || e === 110589 || e === 110590 || e >= 110592 && e <= 110882 || e === 110898 || e >= 110928 && e <= 110930 || e === 110933 || e >= 110948 && e <= 110951 || e >= 110960 && e <= 111355 || e === 126980 || e === 127183 || e === 127374 || e >= 127377 && e <= 127386 || e >= 127488 && e <= 127490 || e >= 127504 && e <= 127547 || e >= 127552 && e <= 127560 || e === 127568 || e === 127569 || e >= 127584 && e <= 127589 || e >= 127744 && e <= 127776 || e >= 127789 && e <= 127797 || e >= 127799 && e <= 127868 || e >= 127870 && e <= 127891 || e >= 127904 && e <= 127946 || e >= 127951 && e <= 127955 || e >= 127968 && e <= 127984 || e === 127988 || e >= 127992 && e <= 128062 || e === 128064 || e >= 128066 && e <= 128252 || e >= 128255 && e <= 128317 || e >= 128331 && e <= 128334 || e >= 128336 && e <= 128359 || e === 128378 || e === 128405 || e === 128406 || e === 128420 || e >= 128507 && e <= 128591 || e >= 128640 && e <= 128709 || e === 128716 || e >= 128720 && e <= 128722 || e >= 128725 && e <= 128727 || e >= 128732 && e <= 128735 || e === 128747 || e === 128748 || e >= 128756 && e <= 128764 || e >= 128992 && e <= 129003 || e === 129008 || e >= 129292 && e <= 129338 || e >= 129340 && e <= 129349 || e >= 129351 && e <= 129535 || e >= 129648 && e <= 129660 || e >= 129664 && e <= 129672 || e >= 129680 && e <= 129725 || e >= 129727 && e <= 129733 || e >= 129742 && e <= 129755 || e >= 129760 && e <= 129768 || e >= 129776 && e <= 129784 || e >= 131072 && e <= 196605 || e >= 196608 && e <= 262141, ve = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y, re = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y, ie = /\t{1,1000}/y, Ae = new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*", "yu"), ne = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y, ft2 = new RegExp("\\p{M}+", "gu"), Ft2 = { limit: 1 / 0, ellipsis: "" }, Le = (e, r = {}, s = {}) => {
|
|
2122
|
+
let i = r.limit ?? 1 / 0, n = r.ellipsis ?? "", l = r?.ellipsisWidth ?? (n ? Le(n, Ft2, s).width : 0), u = s.ansiWidth ?? 0, a = s.controlWidth ?? 0, o = s.tabWidth ?? 8, $ = s.ambiguousWidth ?? 1, y2 = s.emojiWidth ?? 2, E = s.fullWidthWidth ?? 2, p = s.regularWidth ?? 1, f = s.wideWidth ?? 2, c = 0, m = 0, h = e.length, g = 0, F = !1, v = h, S2 = Math.max(0, i - l), B = 0, b = 0, A = 0, C = 0;
|
|
2095
2123
|
e: for (; ; ) {
|
|
2096
|
-
if (
|
|
2097
|
-
let
|
|
2098
|
-
|
|
2099
|
-
for (let D2 of
|
|
2124
|
+
if (b > B || m >= h && m > c) {
|
|
2125
|
+
let _2 = e.slice(B, b) || e.slice(c, m);
|
|
2126
|
+
g = 0;
|
|
2127
|
+
for (let D2 of _2.replaceAll(ft2, "")) {
|
|
2100
2128
|
let T2 = D2.codePointAt(0) || 0;
|
|
2101
|
-
if (
|
|
2102
|
-
|
|
2129
|
+
if (pt2(T2) ? C = E : gt2(T2) ? C = f : $ !== p && mt2(T2) ? C = $ : C = p, A + C > S2 && (v = Math.min(v, Math.max(B, c) + g)), A + C > i) {
|
|
2130
|
+
F = !0;
|
|
2103
2131
|
break e;
|
|
2104
2132
|
}
|
|
2105
|
-
|
|
2133
|
+
g += D2.length, A += C;
|
|
2106
2134
|
}
|
|
2107
|
-
|
|
2135
|
+
B = b = 0;
|
|
2108
2136
|
}
|
|
2109
|
-
if (m >=
|
|
2110
|
-
if (
|
|
2111
|
-
if (
|
|
2112
|
-
|
|
2137
|
+
if (m >= h) break;
|
|
2138
|
+
if (ne.lastIndex = m, ne.test(e)) {
|
|
2139
|
+
if (g = ne.lastIndex - m, C = g * p, A + C > S2 && (v = Math.min(v, m + Math.floor((S2 - A) / p))), A + C > i) {
|
|
2140
|
+
F = !0;
|
|
2113
2141
|
break;
|
|
2114
2142
|
}
|
|
2115
|
-
A += C,
|
|
2143
|
+
A += C, B = c, b = m, m = c = ne.lastIndex;
|
|
2116
2144
|
continue;
|
|
2117
2145
|
}
|
|
2118
|
-
if (
|
|
2119
|
-
if (A +
|
|
2120
|
-
|
|
2146
|
+
if (ve.lastIndex = m, ve.test(e)) {
|
|
2147
|
+
if (A + u > S2 && (v = Math.min(v, m)), A + u > i) {
|
|
2148
|
+
F = !0;
|
|
2121
2149
|
break;
|
|
2122
2150
|
}
|
|
2123
|
-
A +=
|
|
2151
|
+
A += u, B = c, b = m, m = c = ve.lastIndex;
|
|
2124
2152
|
continue;
|
|
2125
2153
|
}
|
|
2126
|
-
if (
|
|
2127
|
-
if (
|
|
2128
|
-
|
|
2154
|
+
if (re.lastIndex = m, re.test(e)) {
|
|
2155
|
+
if (g = re.lastIndex - m, C = g * a, A + C > S2 && (v = Math.min(v, m + Math.floor((S2 - A) / a))), A + C > i) {
|
|
2156
|
+
F = !0;
|
|
2129
2157
|
break;
|
|
2130
2158
|
}
|
|
2131
|
-
A += C,
|
|
2159
|
+
A += C, B = c, b = m, m = c = re.lastIndex;
|
|
2132
2160
|
continue;
|
|
2133
2161
|
}
|
|
2134
|
-
if (
|
|
2135
|
-
if (
|
|
2136
|
-
|
|
2162
|
+
if (ie.lastIndex = m, ie.test(e)) {
|
|
2163
|
+
if (g = ie.lastIndex - m, C = g * o, A + C > S2 && (v = Math.min(v, m + Math.floor((S2 - A) / o))), A + C > i) {
|
|
2164
|
+
F = !0;
|
|
2137
2165
|
break;
|
|
2138
2166
|
}
|
|
2139
|
-
A += C,
|
|
2167
|
+
A += C, B = c, b = m, m = c = ie.lastIndex;
|
|
2140
2168
|
continue;
|
|
2141
2169
|
}
|
|
2142
|
-
if (
|
|
2143
|
-
if (A + y2 > S2 && (v = Math.min(v, m)), A + y2 >
|
|
2144
|
-
|
|
2170
|
+
if (Ae.lastIndex = m, Ae.test(e)) {
|
|
2171
|
+
if (A + y2 > S2 && (v = Math.min(v, m)), A + y2 > i) {
|
|
2172
|
+
F = !0;
|
|
2145
2173
|
break;
|
|
2146
2174
|
}
|
|
2147
|
-
A += y2,
|
|
2175
|
+
A += y2, B = c, b = m, m = c = Ae.lastIndex;
|
|
2148
2176
|
continue;
|
|
2149
2177
|
}
|
|
2150
2178
|
m += 1;
|
|
2151
2179
|
}
|
|
2152
|
-
return { width:
|
|
2153
|
-
},
|
|
2180
|
+
return { width: F ? S2 : A, index: F ? v : h, truncated: F, ellipsed: F && i >= l };
|
|
2181
|
+
}, yt2 = { limit: 1 / 0, ellipsis: "", ellipsisWidth: 0 }, M2 = (e, r = {}) => Le(e, yt2, r).width, ae = "\x1B", je = "\x9B", Et2 = 39, Ce = "\x07", Ve = "[", vt2 = "]", ke = "m", Ie = `${vt2}8;;`, Ge = new RegExp(`(?:\\${Ve}(?<code>\\d+)m|\\${Ie}(?<uri>.*)${Ce})`, "y"), At2 = (e) => {
|
|
2154
2182
|
if (e >= 30 && e <= 37 || e >= 90 && e <= 97) return 39;
|
|
2155
2183
|
if (e >= 40 && e <= 47 || e >= 100 && e <= 107) return 49;
|
|
2156
2184
|
if (e === 1 || e === 2) return 22;
|
|
@@ -2160,403 +2188,418 @@ var z2 = ut2(), ne = () => process.env.CI === "true", Be = (e) => e.isTTY === !0
|
|
|
2160
2188
|
if (e === 8) return 28;
|
|
2161
2189
|
if (e === 9) return 29;
|
|
2162
2190
|
if (e === 0) return 0;
|
|
2163
|
-
},
|
|
2164
|
-
let
|
|
2165
|
-
for (; !
|
|
2166
|
-
let E =
|
|
2167
|
-
|
|
2168
|
-
}
|
|
2169
|
-
|
|
2170
|
-
},
|
|
2171
|
-
let
|
|
2172
|
-
for (; s > 0 && !(M2(
|
|
2173
|
-
return s ===
|
|
2174
|
-
},
|
|
2191
|
+
}, He = (e) => `${ae}${Ve}${e}${ke}`, Ue = (e) => `${ae}${Ie}${e}${Ce}`, Ct2 = (e) => e.map((r) => M2(r)), Se = (e, r, s) => {
|
|
2192
|
+
let i = r[Symbol.iterator](), n = !1, l = !1, u = e.at(-1), a = u === void 0 ? 0 : M2(u), o = i.next(), $ = i.next(), y2 = 0;
|
|
2193
|
+
for (; !o.done; ) {
|
|
2194
|
+
let E = o.value, p = M2(E);
|
|
2195
|
+
a + p <= s ? e[e.length - 1] += E : (e.push(E), a = 0), (E === ae || E === je) && (n = !0, l = r.startsWith(Ie, y2 + 1)), n ? l ? E === Ce && (n = !1, l = !1) : E === ke && (n = !1) : (a += p, a === s && !$.done && (e.push(""), a = 0)), o = $, $ = i.next(), y2 += E.length;
|
|
2196
|
+
}
|
|
2197
|
+
u = e.at(-1), !a && u !== void 0 && u.length > 0 && e.length > 1 && (e[e.length - 2] += e.pop());
|
|
2198
|
+
}, It2 = (e) => {
|
|
2199
|
+
let r = e.split(" "), s = r.length;
|
|
2200
|
+
for (; s > 0 && !(M2(r[s - 1]) > 0); ) s--;
|
|
2201
|
+
return s === r.length ? e : r.slice(0, s).join(" ") + r.slice(s).join("");
|
|
2202
|
+
}, St = (e, r, s = {}) => {
|
|
2175
2203
|
if (s.trim !== !1 && e.trim() === "") return "";
|
|
2176
|
-
let
|
|
2177
|
-
for (let [c, m] of
|
|
2178
|
-
s.trim !== !1 && (
|
|
2179
|
-
let
|
|
2180
|
-
if (c !== 0 && (
|
|
2181
|
-
let
|
|
2182
|
-
Math.floor((
|
|
2204
|
+
let i = "", n, l, u = e.split(" "), a = Ct2(u), o = [""];
|
|
2205
|
+
for (let [c, m] of u.entries()) {
|
|
2206
|
+
s.trim !== !1 && (o[o.length - 1] = (o.at(-1) ?? "").trimStart());
|
|
2207
|
+
let h = M2(o.at(-1) ?? "");
|
|
2208
|
+
if (c !== 0 && (h >= r && (s.wordWrap === !1 || s.trim === !1) && (o.push(""), h = 0), (h > 0 || s.trim === !1) && (o[o.length - 1] += " ", h++)), s.hard && a[c] > r) {
|
|
2209
|
+
let g = r - h, F = 1 + Math.floor((a[c] - g - 1) / r);
|
|
2210
|
+
Math.floor((a[c] - 1) / r) < F && o.push(""), Se(o, m, r);
|
|
2183
2211
|
continue;
|
|
2184
2212
|
}
|
|
2185
|
-
if (
|
|
2186
|
-
if (s.wordWrap === !1 &&
|
|
2187
|
-
|
|
2213
|
+
if (h + a[c] > r && h > 0 && a[c] > 0) {
|
|
2214
|
+
if (s.wordWrap === !1 && h < r) {
|
|
2215
|
+
Se(o, m, r);
|
|
2188
2216
|
continue;
|
|
2189
2217
|
}
|
|
2190
|
-
|
|
2218
|
+
o.push("");
|
|
2191
2219
|
}
|
|
2192
|
-
if (
|
|
2193
|
-
|
|
2220
|
+
if (h + a[c] > r && s.wordWrap === !1) {
|
|
2221
|
+
Se(o, m, r);
|
|
2194
2222
|
continue;
|
|
2195
2223
|
}
|
|
2196
|
-
|
|
2224
|
+
o[o.length - 1] += m;
|
|
2197
2225
|
}
|
|
2198
|
-
s.trim !== !1 && (
|
|
2199
|
-
let
|
|
2200
|
-
`), y2 =
|
|
2226
|
+
s.trim !== !1 && (o = o.map((c) => It2(c)));
|
|
2227
|
+
let $ = o.join(`
|
|
2228
|
+
`), y2 = $[Symbol.iterator](), E = y2.next(), p = y2.next(), f = 0;
|
|
2201
2229
|
for (; !E.done; ) {
|
|
2202
|
-
let c = E.value, m =
|
|
2203
|
-
if (
|
|
2204
|
-
|
|
2205
|
-
let
|
|
2206
|
-
if (
|
|
2207
|
-
let v = Number.parseFloat(
|
|
2208
|
-
n = v ===
|
|
2209
|
-
} else
|
|
2210
|
-
}
|
|
2211
|
-
let
|
|
2230
|
+
let c = E.value, m = p.value;
|
|
2231
|
+
if (i += c, c === ae || c === je) {
|
|
2232
|
+
Ge.lastIndex = f + 1;
|
|
2233
|
+
let F = Ge.exec($)?.groups;
|
|
2234
|
+
if (F?.code !== void 0) {
|
|
2235
|
+
let v = Number.parseFloat(F.code);
|
|
2236
|
+
n = v === Et2 ? void 0 : v;
|
|
2237
|
+
} else F?.uri !== void 0 && (l = F.uri.length === 0 ? void 0 : F.uri);
|
|
2238
|
+
}
|
|
2239
|
+
let h = n ? At2(n) : void 0;
|
|
2212
2240
|
m === `
|
|
2213
|
-
` ? (
|
|
2214
|
-
` && (n &&
|
|
2241
|
+
` ? (l && (i += Ue("")), n && h && (i += He(h))) : c === `
|
|
2242
|
+
` && (n && h && (i += He(n)), l && (i += Ue(l))), f += c.length, E = p, p = y2.next();
|
|
2215
2243
|
}
|
|
2216
|
-
return
|
|
2244
|
+
return i;
|
|
2217
2245
|
};
|
|
2218
|
-
function
|
|
2246
|
+
function q2(e, r, s) {
|
|
2219
2247
|
return String(e).normalize().replaceAll(`\r
|
|
2220
2248
|
`, `
|
|
2221
2249
|
`).split(`
|
|
2222
|
-
`).map((
|
|
2250
|
+
`).map((i) => St(i, r, s)).join(`
|
|
2223
2251
|
`);
|
|
2224
2252
|
}
|
|
2225
|
-
var
|
|
2226
|
-
let
|
|
2227
|
-
for (let
|
|
2228
|
-
let
|
|
2229
|
-
if (
|
|
2230
|
-
}
|
|
2231
|
-
return { lineCount:
|
|
2232
|
-
},
|
|
2233
|
-
let { cursor:
|
|
2234
|
-
|
|
2235
|
-
let m =
|
|
2236
|
-
m && v++,
|
|
2237
|
-
let S2 = c + (m ? 1 : 0),
|
|
2238
|
-
for (let A = S2; A <
|
|
2239
|
-
let C =
|
|
2253
|
+
var wt = (e, r, s, i, n) => {
|
|
2254
|
+
let l = r, u = 0;
|
|
2255
|
+
for (let a = s; a < i; a++) {
|
|
2256
|
+
let o = e[a];
|
|
2257
|
+
if (l = l - o.length, u++, l <= n) break;
|
|
2258
|
+
}
|
|
2259
|
+
return { lineCount: l, removals: u };
|
|
2260
|
+
}, J2 = (e) => {
|
|
2261
|
+
let { cursor: r, options: s, style: i } = e, n = e.output ?? process.stdout, l = rt(n), u = e.columnPadding ?? 0, a = e.rowPadding ?? 4, o = l - u, $ = nt(n), y2 = import_picocolors2.default.dim("..."), E = e.maxItems ?? Number.POSITIVE_INFINITY, p = Math.max($ - a, 0), f = Math.max(Math.min(E, p), 5), c = 0;
|
|
2262
|
+
r >= f - 3 && (c = Math.max(Math.min(r - f + 3, s.length - f), 0));
|
|
2263
|
+
let m = f < s.length && c > 0, h = f < s.length && c + f < s.length, g = Math.min(c + f, s.length), F = [], v = 0;
|
|
2264
|
+
m && v++, h && v++;
|
|
2265
|
+
let S2 = c + (m ? 1 : 0), B = g - (h ? 1 : 0);
|
|
2266
|
+
for (let A = S2; A < B; A++) {
|
|
2267
|
+
let C = q2(i(s[A], A === r), o, { hard: !0, trim: !1 }).split(`
|
|
2240
2268
|
`);
|
|
2241
|
-
|
|
2269
|
+
F.push(C), v += C.length;
|
|
2242
2270
|
}
|
|
2243
|
-
if (v >
|
|
2244
|
-
let A = 0, C = 0,
|
|
2245
|
-
m ? ({ lineCount:
|
|
2271
|
+
if (v > p) {
|
|
2272
|
+
let A = 0, C = 0, _2 = v, D2 = r - S2, T2 = (L2, w2) => wt(F, _2, L2, w2, p);
|
|
2273
|
+
m ? ({ lineCount: _2, removals: A } = T2(0, D2), _2 > p && ({ lineCount: _2, removals: C } = T2(D2 + 1, F.length))) : ({ lineCount: _2, removals: C } = T2(D2 + 1, F.length), _2 > p && ({ lineCount: _2, removals: A } = T2(0, D2))), A > 0 && (m = !0, F.splice(0, A)), C > 0 && (h = !0, F.splice(F.length - C, C));
|
|
2246
2274
|
}
|
|
2247
|
-
let
|
|
2248
|
-
m &&
|
|
2249
|
-
for (let A of
|
|
2250
|
-
return
|
|
2275
|
+
let b = [];
|
|
2276
|
+
m && b.push(y2);
|
|
2277
|
+
for (let A of F) for (let C of A) b.push(C);
|
|
2278
|
+
return h && b.push(y2), b;
|
|
2251
2279
|
};
|
|
2252
|
-
var
|
|
2253
|
-
function
|
|
2254
|
-
let n = s,
|
|
2255
|
-
return
|
|
2280
|
+
var xt2 = [We, he, pe, me], _t2 = [$e, Re, x2, Oe];
|
|
2281
|
+
function Xe(e, r, s, i) {
|
|
2282
|
+
let n = s, l = s;
|
|
2283
|
+
return i === "center" ? n = Math.floor((r - e) / 2) : i === "right" && (n = r - e - s), l = r - n - e, [n, l];
|
|
2256
2284
|
}
|
|
2257
|
-
var
|
|
2258
|
-
let
|
|
2285
|
+
var Dt = (e) => e, Tt2 = (e = "", r = "", s) => {
|
|
2286
|
+
let i = s?.output ?? process.stdout, n = rt(i), l = 2, u = s?.titlePadding ?? 1, a = s?.contentPadding ?? 2, o = s?.width === void 0 || s.width === "auto" ? 1 : Math.min(1, s.width), $ = (s?.withGuide ?? _.withGuide) !== !1 ? `${d} ` : "", y2 = s?.formatBorder ?? Dt, E = (s?.rounded ? xt2 : _t2).map(y2), p = y2(se), f = y2(d), c = M2($), m = M2(r), h = n - c, g = Math.floor(n * o) - c;
|
|
2259
2287
|
if (s?.width === "auto") {
|
|
2260
|
-
let
|
|
2261
|
-
`), D2 = m +
|
|
2262
|
-
for (let
|
|
2263
|
-
let
|
|
2264
|
-
|
|
2265
|
-
}
|
|
2266
|
-
let T2 = D2 +
|
|
2267
|
-
T2 <
|
|
2268
|
-
}
|
|
2269
|
-
|
|
2270
|
-
let
|
|
2271
|
-
|
|
2288
|
+
let _2 = e.split(`
|
|
2289
|
+
`), D2 = m + u * 2;
|
|
2290
|
+
for (let L2 of _2) {
|
|
2291
|
+
let w2 = M2(L2) + a * 2;
|
|
2292
|
+
w2 > D2 && (D2 = w2);
|
|
2293
|
+
}
|
|
2294
|
+
let T2 = D2 + l;
|
|
2295
|
+
T2 < g && (g = T2);
|
|
2296
|
+
}
|
|
2297
|
+
g % 2 !== 0 && (g < h ? g++ : g--);
|
|
2298
|
+
let F = g - l, v = F - u * 2, S2 = m > v ? `${r.slice(0, v - 3)}...` : r, [B, b] = Xe(M2(S2), F, u, s?.titleAlign), A = q2(e, F - a * 2, { hard: !0, trim: !1 });
|
|
2299
|
+
i.write(`${$}${E[0]}${p.repeat(B)}${S2}${p.repeat(b)}${E[1]}
|
|
2272
2300
|
`);
|
|
2273
2301
|
let C = A.split(`
|
|
2274
2302
|
`);
|
|
2275
|
-
for (let
|
|
2276
|
-
let [D2, T2] =
|
|
2277
|
-
|
|
2303
|
+
for (let _2 of C) {
|
|
2304
|
+
let [D2, T2] = Xe(M2(_2), F, a, s?.contentAlign);
|
|
2305
|
+
i.write(`${$}${f}${" ".repeat(D2)}${_2}${" ".repeat(T2)}${f}
|
|
2278
2306
|
`);
|
|
2279
2307
|
}
|
|
2280
|
-
|
|
2308
|
+
i.write(`${$}${E[2]}${p.repeat(F)}${E[3]}
|
|
2281
2309
|
`);
|
|
2282
|
-
},
|
|
2283
|
-
let
|
|
2284
|
-
return new
|
|
2285
|
-
let
|
|
2286
|
-
${
|
|
2287
|
-
`, n = this.value ?
|
|
2310
|
+
}, Mt2 = (e) => {
|
|
2311
|
+
let r = e.active ?? "Yes", s = e.inactive ?? "No";
|
|
2312
|
+
return new kt({ active: r, inactive: s, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue ?? !0, render() {
|
|
2313
|
+
let i = `${import_picocolors2.default.gray(d)}
|
|
2314
|
+
${W2(this.state)} ${e.message}
|
|
2315
|
+
`, n = this.value ? r : s;
|
|
2288
2316
|
switch (this.state) {
|
|
2289
2317
|
case "submit":
|
|
2290
|
-
return `${
|
|
2318
|
+
return `${i}${import_picocolors2.default.gray(d)} ${import_picocolors2.default.dim(n)}`;
|
|
2291
2319
|
case "cancel":
|
|
2292
|
-
return `${
|
|
2320
|
+
return `${i}${import_picocolors2.default.gray(d)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(n))}
|
|
2293
2321
|
${import_picocolors2.default.gray(d)}`;
|
|
2294
2322
|
default:
|
|
2295
|
-
return `${
|
|
2296
|
-
${import_picocolors2.default.cyan(
|
|
2323
|
+
return `${i}${import_picocolors2.default.cyan(d)} ${this.value ? `${import_picocolors2.default.green(Y)} ${r}` : `${import_picocolors2.default.dim(K2)} ${import_picocolors2.default.dim(r)}`} ${import_picocolors2.default.dim("/")} ${this.value ? `${import_picocolors2.default.dim(K2)} ${import_picocolors2.default.dim(s)}` : `${import_picocolors2.default.green(Y)} ${s}`}
|
|
2324
|
+
${import_picocolors2.default.cyan(x2)}
|
|
2297
2325
|
`;
|
|
2298
2326
|
}
|
|
2299
2327
|
} }).prompt();
|
|
2300
2328
|
};
|
|
2301
|
-
var
|
|
2302
|
-
let
|
|
2303
|
-
for (let
|
|
2304
|
-
let
|
|
2329
|
+
var R2 = { message: (e = [], { symbol: r = import_picocolors2.default.gray(d), secondarySymbol: s = import_picocolors2.default.gray(d), output: i = process.stdout, spacing: n = 1, withGuide: l } = {}) => {
|
|
2330
|
+
let u = [], a = (l ?? _.withGuide) !== !1, o = a ? s : "", $ = a ? `${r} ` : "", y2 = a ? `${s} ` : "";
|
|
2331
|
+
for (let p = 0; p < n; p++) u.push(o);
|
|
2332
|
+
let E = Array.isArray(e) ? e : e.split(`
|
|
2305
2333
|
`);
|
|
2306
|
-
if (
|
|
2307
|
-
let [
|
|
2308
|
-
|
|
2309
|
-
for (let
|
|
2334
|
+
if (E.length > 0) {
|
|
2335
|
+
let [p, ...f] = E;
|
|
2336
|
+
p.length > 0 ? u.push(`${$}${p}`) : u.push(a ? "" : r);
|
|
2337
|
+
for (let c of f) c.length > 0 ? u.push(`${y2}${c}`) : u.push(a ? "" : s);
|
|
2310
2338
|
}
|
|
2311
|
-
|
|
2339
|
+
i.write(`${u.join(`
|
|
2312
2340
|
`)}
|
|
2313
2341
|
`);
|
|
2314
|
-
}, info: (e,
|
|
2315
|
-
|
|
2316
|
-
}, success: (e,
|
|
2317
|
-
|
|
2318
|
-
}, step: (e,
|
|
2319
|
-
|
|
2320
|
-
}, warn: (e,
|
|
2321
|
-
|
|
2322
|
-
}, warning: (e,
|
|
2323
|
-
|
|
2324
|
-
}, error: (e,
|
|
2325
|
-
|
|
2326
|
-
} },
|
|
2327
|
-
(
|
|
2342
|
+
}, info: (e, r) => {
|
|
2343
|
+
R2.message(e, { ...r, symbol: import_picocolors2.default.blue(ge) });
|
|
2344
|
+
}, success: (e, r) => {
|
|
2345
|
+
R2.message(e, { ...r, symbol: import_picocolors2.default.green(fe) });
|
|
2346
|
+
}, step: (e, r) => {
|
|
2347
|
+
R2.message(e, { ...r, symbol: import_picocolors2.default.green(j2) });
|
|
2348
|
+
}, warn: (e, r) => {
|
|
2349
|
+
R2.message(e, { ...r, symbol: import_picocolors2.default.yellow(Fe) });
|
|
2350
|
+
}, warning: (e, r) => {
|
|
2351
|
+
R2.warn(e, r);
|
|
2352
|
+
}, error: (e, r) => {
|
|
2353
|
+
R2.message(e, { ...r, symbol: import_picocolors2.default.red(ye) });
|
|
2354
|
+
} }, Nt = (e = "", r) => {
|
|
2355
|
+
(r?.output ?? process.stdout).write(`${import_picocolors2.default.gray(x2)} ${import_picocolors2.default.red(e)}
|
|
2328
2356
|
|
|
2329
2357
|
`);
|
|
2330
|
-
},
|
|
2331
|
-
(
|
|
2358
|
+
}, Pt = (e = "", r) => {
|
|
2359
|
+
(r?.output ?? process.stdout).write(`${import_picocolors2.default.gray($e)} ${e}
|
|
2332
2360
|
`);
|
|
2333
|
-
},
|
|
2334
|
-
(
|
|
2335
|
-
${import_picocolors2.default.gray(
|
|
2361
|
+
}, Wt2 = (e = "", r) => {
|
|
2362
|
+
(r?.output ?? process.stdout).write(`${import_picocolors2.default.gray(d)}
|
|
2363
|
+
${import_picocolors2.default.gray(x2)} ${e}
|
|
2336
2364
|
|
|
2337
2365
|
`);
|
|
2338
|
-
},
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2366
|
+
}, Q2 = (e, r) => e.split(`
|
|
2367
|
+
`).map((s) => r(s)).join(`
|
|
2368
|
+
`), Lt2 = (e) => {
|
|
2369
|
+
let r = (i, n) => {
|
|
2370
|
+
let l = i.label ?? String(i.value);
|
|
2371
|
+
return n === "disabled" ? `${import_picocolors2.default.gray(z2)} ${Q2(l, import_picocolors2.default.gray)}${i.hint ? ` ${import_picocolors2.default.dim(`(${i.hint ?? "disabled"})`)}` : ""}` : n === "active" ? `${import_picocolors2.default.cyan(te)} ${l}${i.hint ? ` ${import_picocolors2.default.dim(`(${i.hint})`)}` : ""}` : n === "selected" ? `${import_picocolors2.default.green(V)} ${Q2(l, import_picocolors2.default.dim)}${i.hint ? ` ${import_picocolors2.default.dim(`(${i.hint})`)}` : ""}` : n === "cancelled" ? `${Q2(l, (u) => import_picocolors2.default.strikethrough(import_picocolors2.default.dim(u)))}` : n === "active-selected" ? `${import_picocolors2.default.green(V)} ${l}${i.hint ? ` ${import_picocolors2.default.dim(`(${i.hint})`)}` : ""}` : n === "submitted" ? `${Q2(l, import_picocolors2.default.dim)}` : `${import_picocolors2.default.dim(z2)} ${Q2(l, import_picocolors2.default.dim)}`;
|
|
2342
2372
|
}, s = e.required ?? !0;
|
|
2343
|
-
return new
|
|
2344
|
-
if (s && (
|
|
2373
|
+
return new Mt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValues: e.initialValues, required: s, cursorAt: e.cursorAt, validate(i) {
|
|
2374
|
+
if (s && (i === void 0 || i.length === 0)) return `Please select at least one option.
|
|
2345
2375
|
${import_picocolors2.default.reset(import_picocolors2.default.dim(`Press ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" space ")))} to select, ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" enter ")))} to submit`))}`;
|
|
2346
2376
|
}, render() {
|
|
2347
|
-
let
|
|
2348
|
-
${
|
|
2349
|
-
`,
|
|
2350
|
-
if (
|
|
2351
|
-
let
|
|
2352
|
-
return
|
|
2377
|
+
let i = Bt(e.output, e.message, `${Ee(this.state)} `, `${W2(this.state)} `), n = `${import_picocolors2.default.gray(d)}
|
|
2378
|
+
${i}
|
|
2379
|
+
`, l = this.value ?? [], u = (a, o) => {
|
|
2380
|
+
if (a.disabled) return r(a, "disabled");
|
|
2381
|
+
let $ = l.includes(a.value);
|
|
2382
|
+
return o && $ ? r(a, "active-selected") : $ ? r(a, "selected") : r(a, o ? "active" : "inactive");
|
|
2353
2383
|
};
|
|
2354
2384
|
switch (this.state) {
|
|
2355
|
-
case "submit":
|
|
2356
|
-
|
|
2385
|
+
case "submit": {
|
|
2386
|
+
let a = this.options.filter(({ value: $ }) => l.includes($)).map(($) => r($, "submitted")).join(import_picocolors2.default.dim(", ")) || import_picocolors2.default.dim("none"), o = Bt(e.output, a, `${import_picocolors2.default.gray(d)} `);
|
|
2387
|
+
return `${n}${o}`;
|
|
2388
|
+
}
|
|
2357
2389
|
case "cancel": {
|
|
2358
|
-
let
|
|
2359
|
-
return `${
|
|
2360
|
-
|
|
2390
|
+
let a = this.options.filter(({ value: $ }) => l.includes($)).map(($) => r($, "cancelled")).join(import_picocolors2.default.dim(", "));
|
|
2391
|
+
if (a.trim() === "") return `${n}${import_picocolors2.default.gray(d)}`;
|
|
2392
|
+
let o = Bt(e.output, a, `${import_picocolors2.default.gray(d)} `);
|
|
2393
|
+
return `${n}${o}
|
|
2394
|
+
${import_picocolors2.default.gray(d)}`;
|
|
2361
2395
|
}
|
|
2362
2396
|
case "error": {
|
|
2363
|
-
let
|
|
2364
|
-
`).map((
|
|
2397
|
+
let a = `${import_picocolors2.default.yellow(d)} `, o = this.error.split(`
|
|
2398
|
+
`).map(($, y2) => y2 === 0 ? `${import_picocolors2.default.yellow(x2)} ${import_picocolors2.default.yellow($)}` : ` ${$}`).join(`
|
|
2365
2399
|
`);
|
|
2366
|
-
return `${
|
|
2367
|
-
${
|
|
2368
|
-
${
|
|
2400
|
+
return `${n}${a}${J2({ output: e.output, options: this.options, cursor: this.cursor, maxItems: e.maxItems, columnPadding: a.length, style: u }).join(`
|
|
2401
|
+
${a}`)}
|
|
2402
|
+
${o}
|
|
2369
2403
|
`;
|
|
2370
2404
|
}
|
|
2371
2405
|
default: {
|
|
2372
|
-
let
|
|
2373
|
-
return `${
|
|
2374
|
-
${
|
|
2375
|
-
${import_picocolors2.default.cyan(
|
|
2406
|
+
let a = `${import_picocolors2.default.cyan(d)} `;
|
|
2407
|
+
return `${n}${a}${J2({ output: e.output, options: this.options, cursor: this.cursor, maxItems: e.maxItems, columnPadding: a.length, style: u }).join(`
|
|
2408
|
+
${a}`)}
|
|
2409
|
+
${import_picocolors2.default.cyan(x2)}
|
|
2376
2410
|
`;
|
|
2377
2411
|
}
|
|
2378
2412
|
}
|
|
2379
2413
|
} }).prompt();
|
|
2380
2414
|
};
|
|
2381
|
-
var
|
|
2382
|
-
let
|
|
2383
|
-
let O2 =
|
|
2384
|
-
|
|
2385
|
-
}, S2 = () => v(2),
|
|
2386
|
-
process.on("uncaughtExceptionMonitor", S2), process.on("unhandledRejection", S2), process.on("SIGINT",
|
|
2415
|
+
var Ut = import_picocolors2.default.magenta, we = ({ indicator: e = "dots", onCancel: r, output: s = process.stdout, cancelMessage: i, errorMessage: n, frames: l = ee ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], delay: u = ee ? 80 : 120, signal: a, ...o } = {}) => {
|
|
2416
|
+
let $ = ue(), y2, E, p = !1, f = !1, c = "", m, h = performance.now(), g = rt(s), F = o?.styleFrame ?? Ut, v = (w2) => {
|
|
2417
|
+
let O2 = w2 > 1 ? n ?? _.messages.error : i ?? _.messages.cancel;
|
|
2418
|
+
f = w2 === 1, p && (L2(O2, w2), f && typeof r == "function" && r());
|
|
2419
|
+
}, S2 = () => v(2), B = () => v(1), b = () => {
|
|
2420
|
+
process.on("uncaughtExceptionMonitor", S2), process.on("unhandledRejection", S2), process.on("SIGINT", B), process.on("SIGTERM", B), process.on("exit", v), a && a.addEventListener("abort", B);
|
|
2387
2421
|
}, A = () => {
|
|
2388
|
-
process.removeListener("uncaughtExceptionMonitor", S2), process.removeListener("unhandledRejection", S2), process.removeListener("SIGINT",
|
|
2422
|
+
process.removeListener("uncaughtExceptionMonitor", S2), process.removeListener("unhandledRejection", S2), process.removeListener("SIGINT", B), process.removeListener("SIGTERM", B), process.removeListener("exit", v), a && a.removeEventListener("abort", B);
|
|
2389
2423
|
}, C = () => {
|
|
2390
2424
|
if (m === void 0) return;
|
|
2391
|
-
|
|
2425
|
+
$ && s.write(`
|
|
2392
2426
|
`);
|
|
2393
|
-
let
|
|
2427
|
+
let w2 = q2(m, g, { hard: !0, trim: !1 }).split(`
|
|
2394
2428
|
`);
|
|
2395
|
-
|
|
2396
|
-
},
|
|
2397
|
-
let O2 = (performance.now() -
|
|
2429
|
+
w2.length > 1 && s.write(import_sisteransi2.cursor.up(w2.length - 1)), s.write(import_sisteransi2.cursor.to(0)), s.write(import_sisteransi2.erase.down());
|
|
2430
|
+
}, _2 = (w2) => w2.replace(/\.+$/, ""), D2 = (w2) => {
|
|
2431
|
+
let O2 = (performance.now() - w2) / 1e3, P2 = Math.floor(O2 / 60), G2 = Math.floor(O2 % 60);
|
|
2398
2432
|
return P2 > 0 ? `[${P2}m ${G2}s]` : `[${G2}s]`;
|
|
2399
|
-
}, T2 = (
|
|
2400
|
-
|
|
2433
|
+
}, T2 = (w2 = "") => {
|
|
2434
|
+
p = !0, y2 = xt({ output: s }), c = _2(w2), h = performance.now(), s.write(`${import_picocolors2.default.gray(d)}
|
|
2401
2435
|
`);
|
|
2402
2436
|
let O2 = 0, P2 = 0;
|
|
2403
|
-
|
|
2404
|
-
if (
|
|
2437
|
+
b(), E = setInterval(() => {
|
|
2438
|
+
if ($ && c === m) return;
|
|
2405
2439
|
C(), m = c;
|
|
2406
|
-
let G2 =
|
|
2407
|
-
if (
|
|
2408
|
-
else if (e === "timer")
|
|
2440
|
+
let G2 = F(l[O2]), Z2;
|
|
2441
|
+
if ($) Z2 = `${G2} ${c}...`;
|
|
2442
|
+
else if (e === "timer") Z2 = `${G2} ${c} ${D2(h)}`;
|
|
2409
2443
|
else {
|
|
2410
|
-
let
|
|
2411
|
-
|
|
2412
|
-
}
|
|
2413
|
-
let
|
|
2414
|
-
s.write(
|
|
2415
|
-
},
|
|
2416
|
-
},
|
|
2417
|
-
if (!
|
|
2418
|
-
|
|
2419
|
-
let P2 = O2 === 0 ? import_picocolors2.default.green(
|
|
2420
|
-
c =
|
|
2444
|
+
let Ze = ".".repeat(Math.floor(P2)).slice(0, 3);
|
|
2445
|
+
Z2 = `${G2} ${c}${Ze}`;
|
|
2446
|
+
}
|
|
2447
|
+
let Qe = q2(Z2, g, { hard: !0, trim: !1 });
|
|
2448
|
+
s.write(Qe), O2 = O2 + 1 < l.length ? O2 + 1 : 0, P2 = P2 < 4 ? P2 + 0.125 : 0;
|
|
2449
|
+
}, u);
|
|
2450
|
+
}, L2 = (w2 = "", O2 = 0) => {
|
|
2451
|
+
if (!p) return;
|
|
2452
|
+
p = !1, clearInterval(E), C();
|
|
2453
|
+
let P2 = O2 === 0 ? import_picocolors2.default.green(j2) : O2 === 1 ? import_picocolors2.default.red(ce) : import_picocolors2.default.red(de);
|
|
2454
|
+
c = w2 ?? c, e === "timer" ? s.write(`${P2} ${c} ${D2(h)}
|
|
2421
2455
|
`) : s.write(`${P2} ${c}
|
|
2422
2456
|
`), A(), y2();
|
|
2423
2457
|
};
|
|
2424
|
-
return { start: T2, stop:
|
|
2425
|
-
c =
|
|
2426
|
-
}, get isCancelled() {
|
|
2427
|
-
return
|
|
2458
|
+
return { start: T2, stop: (w2 = "") => L2(w2, 0), message: (w2 = "") => {
|
|
2459
|
+
c = _2(w2 ?? c);
|
|
2460
|
+
}, cancel: (w2 = "") => L2(w2, 1), error: (w2 = "") => L2(w2, 2), get isCancelled() {
|
|
2461
|
+
return f;
|
|
2428
2462
|
} };
|
|
2429
|
-
},
|
|
2430
|
-
var
|
|
2431
|
-
|
|
2463
|
+
}, Ye = { light: I2("\u2500", "-"), heavy: I2("\u2501", "="), block: I2("\u2588", "#") };
|
|
2464
|
+
var oe = (e, r) => e.includes(`
|
|
2465
|
+
`) ? e.split(`
|
|
2466
|
+
`).map((s) => r(s)).join(`
|
|
2467
|
+
`) : r(e), qt = (e) => {
|
|
2468
|
+
let r = (s, i) => {
|
|
2432
2469
|
let n = s.label ?? String(s.value);
|
|
2433
|
-
switch (
|
|
2470
|
+
switch (i) {
|
|
2434
2471
|
case "disabled":
|
|
2435
|
-
return `${import_picocolors2.default.gray(
|
|
2472
|
+
return `${import_picocolors2.default.gray(K2)} ${oe(n, import_picocolors2.default.gray)}${s.hint ? ` ${import_picocolors2.default.dim(`(${s.hint ?? "disabled"})`)}` : ""}`;
|
|
2436
2473
|
case "selected":
|
|
2437
|
-
return `${import_picocolors2.default.dim
|
|
2474
|
+
return `${oe(n, import_picocolors2.default.dim)}`;
|
|
2438
2475
|
case "active":
|
|
2439
|
-
return `${import_picocolors2.default.green(
|
|
2476
|
+
return `${import_picocolors2.default.green(Y)} ${n}${s.hint ? ` ${import_picocolors2.default.dim(`(${s.hint})`)}` : ""}`;
|
|
2440
2477
|
case "cancelled":
|
|
2441
|
-
return `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(
|
|
2478
|
+
return `${oe(n, (l) => import_picocolors2.default.strikethrough(import_picocolors2.default.dim(l)))}`;
|
|
2442
2479
|
default:
|
|
2443
|
-
return `${import_picocolors2.default.dim(
|
|
2480
|
+
return `${import_picocolors2.default.dim(K2)} ${oe(n, import_picocolors2.default.dim)}`;
|
|
2444
2481
|
}
|
|
2445
2482
|
};
|
|
2446
|
-
return new
|
|
2447
|
-
let s = `${import_picocolors2.default.gray(d)}
|
|
2448
|
-
${
|
|
2483
|
+
return new Wt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue, render() {
|
|
2484
|
+
let s = `${W2(this.state)} `, i = `${Ee(this.state)} `, n = Bt(e.output, e.message, i, s), l = `${import_picocolors2.default.gray(d)}
|
|
2485
|
+
${n}
|
|
2449
2486
|
`;
|
|
2450
2487
|
switch (this.state) {
|
|
2451
|
-
case "submit":
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2488
|
+
case "submit": {
|
|
2489
|
+
let u = `${import_picocolors2.default.gray(d)} `, a = Bt(e.output, r(this.options[this.cursor], "selected"), u);
|
|
2490
|
+
return `${l}${a}`;
|
|
2491
|
+
}
|
|
2492
|
+
case "cancel": {
|
|
2493
|
+
let u = `${import_picocolors2.default.gray(d)} `, a = Bt(e.output, r(this.options[this.cursor], "cancelled"), u);
|
|
2494
|
+
return `${l}${a}
|
|
2455
2495
|
${import_picocolors2.default.gray(d)}`;
|
|
2496
|
+
}
|
|
2456
2497
|
default: {
|
|
2457
|
-
let
|
|
2458
|
-
return `${
|
|
2459
|
-
${
|
|
2460
|
-
${import_picocolors2.default.cyan(
|
|
2498
|
+
let u = `${import_picocolors2.default.cyan(d)} `;
|
|
2499
|
+
return `${l}${u}${J2({ output: e.output, cursor: this.cursor, options: this.options, maxItems: e.maxItems, columnPadding: u.length, style: (a, o) => r(a, a.disabled ? "disabled" : o ? "active" : "inactive") }).join(`
|
|
2500
|
+
${u}`)}
|
|
2501
|
+
${import_picocolors2.default.cyan(x2)}
|
|
2461
2502
|
`;
|
|
2462
2503
|
}
|
|
2463
2504
|
}
|
|
2464
2505
|
} }).prompt();
|
|
2465
2506
|
};
|
|
2466
|
-
var
|
|
2467
|
-
var
|
|
2468
|
-
let
|
|
2469
|
-
|
|
2470
|
-
`),
|
|
2507
|
+
var ze = `${import_picocolors2.default.gray(d)} `;
|
|
2508
|
+
var Yt = (e) => e.replace(/\x1b\[(?:\d+;)*\d*[ABCDEFGHfJKSTsu]|\x1b\[(s|u)/g, ""), zt = (e) => {
|
|
2509
|
+
let r = e.output ?? process.stdout, s = rt(r), i = import_picocolors2.default.gray(d), n = e.spacing ?? 1, l = 3, u = e.retainLog === !0, a = !ue() && Te(r);
|
|
2510
|
+
r.write(`${i}
|
|
2511
|
+
`), r.write(`${import_picocolors2.default.green(j2)} ${e.title}
|
|
2471
2512
|
`);
|
|
2472
|
-
for (let
|
|
2513
|
+
for (let h = 0; h < n; h++) r.write(`${i}
|
|
2473
2514
|
`);
|
|
2474
|
-
let
|
|
2475
|
-
if (
|
|
2476
|
-
let
|
|
2477
|
-
|
|
2478
|
-
for (let
|
|
2479
|
-
let { value: v, result: S2 } =
|
|
2480
|
-
if (
|
|
2481
|
-
S2 === void 0 &&
|
|
2482
|
-
${
|
|
2483
|
-
let
|
|
2484
|
-
`).reduce((A, C) => C === "" ? A + 1 : A + Math.ceil((C.length +
|
|
2485
|
-
|
|
2486
|
-
}
|
|
2487
|
-
|
|
2488
|
-
}, E = (
|
|
2489
|
-
let v =
|
|
2490
|
-
${
|
|
2491
|
-
|
|
2492
|
-
`).map(import_picocolors2.default.bold), { output:
|
|
2493
|
-
`).map(import_picocolors2.default.dim), { output:
|
|
2494
|
-
},
|
|
2495
|
-
for (let
|
|
2496
|
-
let { header:
|
|
2497
|
-
(
|
|
2498
|
-
}
|
|
2499
|
-
},
|
|
2500
|
-
if (y2(!1), (
|
|
2501
|
-
`),
|
|
2502
|
-
let v =
|
|
2515
|
+
let o = [{ value: "", full: "" }], $ = !1, y2 = (h) => {
|
|
2516
|
+
if (o.length === 0) return;
|
|
2517
|
+
let g = 0;
|
|
2518
|
+
h && (g += n + 2);
|
|
2519
|
+
for (let F of o) {
|
|
2520
|
+
let { value: v, result: S2 } = F, B = S2?.message ?? v;
|
|
2521
|
+
if (B.length === 0) continue;
|
|
2522
|
+
S2 === void 0 && F.header !== void 0 && F.header !== "" && (B += `
|
|
2523
|
+
${F.header}`);
|
|
2524
|
+
let b = B.split(`
|
|
2525
|
+
`).reduce((A, C) => C === "" ? A + 1 : A + Math.ceil((C.length + l) / s), 0);
|
|
2526
|
+
g += b;
|
|
2527
|
+
}
|
|
2528
|
+
g > 0 && (g += 1, r.write(import_sisteransi2.erase.lines(g)));
|
|
2529
|
+
}, E = (h, g, F) => {
|
|
2530
|
+
let v = F ? `${h.full}
|
|
2531
|
+
${h.value}` : h.value;
|
|
2532
|
+
h.header !== void 0 && h.header !== "" && R2.message(h.header.split(`
|
|
2533
|
+
`).map(import_picocolors2.default.bold), { output: r, secondarySymbol: i, symbol: i, spacing: 0 }), R2.message(v.split(`
|
|
2534
|
+
`).map(import_picocolors2.default.dim), { output: r, secondarySymbol: i, symbol: i, spacing: g ?? n });
|
|
2535
|
+
}, p = () => {
|
|
2536
|
+
for (let h of o) {
|
|
2537
|
+
let { header: g, value: F, full: v } = h;
|
|
2538
|
+
(g === void 0 || g.length === 0) && F.length === 0 || E(h, void 0, u === !0 && v.length > 0);
|
|
2539
|
+
}
|
|
2540
|
+
}, f = (h, g, F) => {
|
|
2541
|
+
if (y2(!1), (F?.raw !== !0 || !$) && h.value !== "" && (h.value += `
|
|
2542
|
+
`), h.value += Yt(g), $ = F?.raw === !0, e.limit !== void 0) {
|
|
2543
|
+
let v = h.value.split(`
|
|
2503
2544
|
`), S2 = v.length - e.limit;
|
|
2504
2545
|
if (S2 > 0) {
|
|
2505
|
-
let
|
|
2506
|
-
|
|
2507
|
-
`) +
|
|
2546
|
+
let B = v.splice(0, S2);
|
|
2547
|
+
u && (h.full += (h.full === "" ? "" : `
|
|
2548
|
+
`) + B.join(`
|
|
2508
2549
|
`));
|
|
2509
2550
|
}
|
|
2510
|
-
|
|
2551
|
+
h.value = v.join(`
|
|
2511
2552
|
`);
|
|
2512
2553
|
}
|
|
2513
|
-
|
|
2554
|
+
a && c();
|
|
2514
2555
|
}, c = () => {
|
|
2515
|
-
for (let
|
|
2516
|
-
}, m = (
|
|
2517
|
-
y2(!1),
|
|
2556
|
+
for (let h of o) h.result ? h.result.status === "error" ? R2.error(h.result.message, { output: r, secondarySymbol: i, spacing: 0 }) : R2.success(h.result.message, { output: r, secondarySymbol: i, spacing: 0 }) : h.value !== "" && E(h, 0);
|
|
2557
|
+
}, m = (h, g) => {
|
|
2558
|
+
y2(!1), h.result = g, a && c();
|
|
2518
2559
|
};
|
|
2519
|
-
return { message(
|
|
2520
|
-
|
|
2521
|
-
}, group(
|
|
2522
|
-
let
|
|
2523
|
-
return
|
|
2524
|
-
|
|
2525
|
-
}, error(
|
|
2526
|
-
m(
|
|
2527
|
-
}, success(
|
|
2528
|
-
m(
|
|
2560
|
+
return { message(h, g) {
|
|
2561
|
+
f(o[0], h, g);
|
|
2562
|
+
}, group(h) {
|
|
2563
|
+
let g = { header: h, value: "", full: "" };
|
|
2564
|
+
return o.push(g), { message(F, v) {
|
|
2565
|
+
f(g, F, v);
|
|
2566
|
+
}, error(F) {
|
|
2567
|
+
m(g, { status: "error", message: F });
|
|
2568
|
+
}, success(F) {
|
|
2569
|
+
m(g, { status: "success", message: F });
|
|
2529
2570
|
} };
|
|
2530
|
-
}, error(
|
|
2531
|
-
y2(!0),
|
|
2532
|
-
}, success(
|
|
2533
|
-
y2(!0),
|
|
2571
|
+
}, error(h, g) {
|
|
2572
|
+
y2(!0), R2.error(h, { output: r, secondarySymbol: i, spacing: 1 }), g?.showLog !== !1 && p(), o.splice(1, o.length - 1), o[0].value = "", o[0].full = "";
|
|
2573
|
+
}, success(h, g) {
|
|
2574
|
+
y2(!0), R2.success(h, { output: r, secondarySymbol: i, spacing: 1 }), g?.showLog === !0 && p(), o.splice(1, o.length - 1), o[0].value = "", o[0].full = "";
|
|
2534
2575
|
} };
|
|
2535
|
-
},
|
|
2536
|
-
let
|
|
2537
|
-
${
|
|
2538
|
-
`,
|
|
2576
|
+
}, Qt = (e) => new $t({ validate: e.validate, placeholder: e.placeholder, defaultValue: e.defaultValue, initialValue: e.initialValue, output: e.output, signal: e.signal, input: e.input, render() {
|
|
2577
|
+
let r = (e?.withGuide ?? _.withGuide) !== !1, s = `${`${r ? `${import_picocolors2.default.gray(d)}
|
|
2578
|
+
` : ""}${W2(this.state)} `}${e.message}
|
|
2579
|
+
`, i = e.placeholder ? import_picocolors2.default.inverse(e.placeholder[0]) + import_picocolors2.default.dim(e.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")), n = this.userInput ? this.userInputWithCursor : i, l = this.value ?? "";
|
|
2539
2580
|
switch (this.state) {
|
|
2540
2581
|
case "error": {
|
|
2541
|
-
let
|
|
2542
|
-
return `${
|
|
2543
|
-
${
|
|
2544
|
-
${
|
|
2582
|
+
let u = this.error ? ` ${import_picocolors2.default.yellow(this.error)}` : "", a = r ? `${import_picocolors2.default.yellow(d)} ` : "", o = r ? import_picocolors2.default.yellow(x2) : "";
|
|
2583
|
+
return `${s.trim()}
|
|
2584
|
+
${a}${n}
|
|
2585
|
+
${o}${u}
|
|
2545
2586
|
`;
|
|
2546
2587
|
}
|
|
2547
2588
|
case "submit": {
|
|
2548
|
-
let
|
|
2549
|
-
return `${
|
|
2589
|
+
let u = l ? ` ${import_picocolors2.default.dim(l)}` : "", a = r ? import_picocolors2.default.gray(d) : "";
|
|
2590
|
+
return `${s}${a}${u}`;
|
|
2550
2591
|
}
|
|
2551
2592
|
case "cancel": {
|
|
2552
|
-
let
|
|
2553
|
-
return `${
|
|
2554
|
-
${
|
|
2555
|
-
}
|
|
2556
|
-
default:
|
|
2557
|
-
|
|
2558
|
-
${
|
|
2593
|
+
let u = l ? ` ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(l))}` : "", a = r ? import_picocolors2.default.gray(d) : "";
|
|
2594
|
+
return `${s}${a}${u}${l.trim() ? `
|
|
2595
|
+
${a}` : ""}`;
|
|
2596
|
+
}
|
|
2597
|
+
default: {
|
|
2598
|
+
let u = r ? `${import_picocolors2.default.cyan(d)} ` : "", a = r ? import_picocolors2.default.cyan(x2) : "";
|
|
2599
|
+
return `${s}${u}${n}
|
|
2600
|
+
${a}
|
|
2559
2601
|
`;
|
|
2602
|
+
}
|
|
2560
2603
|
}
|
|
2561
2604
|
} }).prompt();
|
|
2562
2605
|
|
|
@@ -3031,35 +3074,35 @@ var getCurrentTaskLog = () => globalThis.STORYBOOK_CURRENT_TASK_LOG ? globalThis
|
|
|
3031
3074
|
globalThis.STORYBOOK_CURRENT_TASK_LOG && globalThis.STORYBOOK_CURRENT_TASK_LOG.pop();
|
|
3032
3075
|
}, ClackPromptProvider = class extends PromptProvider {
|
|
3033
3076
|
handleCancel(result, promptOptions) {
|
|
3034
|
-
|
|
3077
|
+
Ct(result) && (promptOptions?.onCancel ? promptOptions.onCancel() : (Nt("Operation canceled."), process.exit(0)));
|
|
3035
3078
|
}
|
|
3036
3079
|
async text(options, promptOptions) {
|
|
3037
|
-
let result = await
|
|
3080
|
+
let result = await Qt(options);
|
|
3038
3081
|
return this.handleCancel(result, promptOptions), logTracker.addLog("prompt", options.message, { choice: result }), result.toString();
|
|
3039
3082
|
}
|
|
3040
3083
|
async confirm(options, promptOptions) {
|
|
3041
|
-
let result = await
|
|
3084
|
+
let result = await Mt2({
|
|
3042
3085
|
...options,
|
|
3043
3086
|
message: wrapTextForClackHint(options.message, void 0, void 0, 2)
|
|
3044
3087
|
});
|
|
3045
3088
|
return this.handleCancel(result, promptOptions), logTracker.addLog("prompt", options.message, { choice: result }), !!result;
|
|
3046
3089
|
}
|
|
3047
3090
|
async select(options, promptOptions) {
|
|
3048
|
-
let result = await
|
|
3091
|
+
let result = await qt({
|
|
3049
3092
|
...options,
|
|
3050
3093
|
message: wrapTextForClackHint(options.message, void 0, void 0, 2)
|
|
3051
3094
|
});
|
|
3052
3095
|
return this.handleCancel(result, promptOptions), logTracker.addLog("prompt", options.message, { choice: result }), result;
|
|
3053
3096
|
}
|
|
3054
3097
|
async multiselect(options, promptOptions) {
|
|
3055
|
-
let result = await
|
|
3098
|
+
let result = await Lt2({
|
|
3056
3099
|
...options,
|
|
3057
3100
|
required: options.required
|
|
3058
3101
|
});
|
|
3059
3102
|
return this.handleCancel(result, promptOptions), logTracker.addLog("prompt", options.message, { choice: result }), result;
|
|
3060
3103
|
}
|
|
3061
3104
|
spinner(options) {
|
|
3062
|
-
let task =
|
|
3105
|
+
let task = we(), spinnerId = `${options.id}-spinner`;
|
|
3063
3106
|
return {
|
|
3064
3107
|
start: (message) => {
|
|
3065
3108
|
logTracker.addLog("info", `${spinnerId}-start: ${message}`), task.start(message);
|
|
@@ -3069,11 +3112,17 @@ var getCurrentTaskLog = () => globalThis.STORYBOOK_CURRENT_TASK_LOG ? globalThis
|
|
|
3069
3112
|
},
|
|
3070
3113
|
stop: (message) => {
|
|
3071
3114
|
logTracker.addLog("info", `${spinnerId}-stop: ${message}`), task.stop(message);
|
|
3115
|
+
},
|
|
3116
|
+
cancel: (message) => {
|
|
3117
|
+
logTracker.addLog("info", `${spinnerId}-cancel: ${message}`), task.cancel(message);
|
|
3118
|
+
},
|
|
3119
|
+
error: (message) => {
|
|
3120
|
+
logTracker.addLog("error", `${spinnerId}-error: ${message}`), task.error(message);
|
|
3072
3121
|
}
|
|
3073
3122
|
};
|
|
3074
3123
|
}
|
|
3075
3124
|
taskLog(options) {
|
|
3076
|
-
let isCurrentTaskActive = !!getCurrentTaskLog(), task = getCurrentTaskLog() ||
|
|
3125
|
+
let isCurrentTaskActive = !!getCurrentTaskLog(), task = getCurrentTaskLog() || zt(options), taskId = `${options.id}-task`;
|
|
3077
3126
|
return logTracker.addLog("info", `${taskId}-start: ${options.title}`), isCurrentTaskActive || setCurrentTaskLog(task), {
|
|
3078
3127
|
message: (message) => {
|
|
3079
3128
|
logTracker.addLog("info", `${taskId}: ${message}`), task.message(message);
|
|
@@ -3130,13 +3179,13 @@ var createLogFunction = (clackFn, consoleFn, cliColors) => () => isClackEnabled(
|
|
|
3130
3179
|
cliColors && typeof message == "string" ? cliColors(message) : message
|
|
3131
3180
|
) : typeof message == "string" ? clackFn(wrapTextForClack(message), ...rest) : clackFn(message, ...rest);
|
|
3132
3181
|
} : consoleFn, LOG_FUNCTIONS = {
|
|
3133
|
-
log: createLogFunction(
|
|
3134
|
-
info: createLogFunction(
|
|
3135
|
-
warn: createLogFunction(
|
|
3136
|
-
error: createLogFunction(
|
|
3137
|
-
intro: createLogFunction(
|
|
3138
|
-
outro: createLogFunction(
|
|
3139
|
-
step: createLogFunction(
|
|
3182
|
+
log: createLogFunction(R2.message, console.log),
|
|
3183
|
+
info: createLogFunction(R2.info, console.log),
|
|
3184
|
+
warn: createLogFunction(R2.warn, console.warn, CLI_COLORS.warning),
|
|
3185
|
+
error: createLogFunction(R2.error, console.error, CLI_COLORS.error),
|
|
3186
|
+
intro: createLogFunction(Pt, console.log),
|
|
3187
|
+
outro: createLogFunction(Wt2, console.log),
|
|
3188
|
+
step: createLogFunction(R2.step, console.log)
|
|
3140
3189
|
}, LOG_LEVELS = {
|
|
3141
3190
|
trace: 1,
|
|
3142
3191
|
debug: 2,
|
|
@@ -3188,7 +3237,7 @@ var debug = createLogger(
|
|
|
3188
3237
|
"error",
|
|
3189
3238
|
(...args) => LOG_FUNCTIONS.error()(...args)
|
|
3190
3239
|
), logBox = (message, { title, ...options } = {}) => {
|
|
3191
|
-
shouldLog("info") && (logTracker.addLog("info", message), isClackEnabled() ?
|
|
3240
|
+
shouldLog("info") && (logTracker.addLog("info", message), isClackEnabled() ? Tt2(message, title, {
|
|
3192
3241
|
...options,
|
|
3193
3242
|
width: options.width ?? "auto"
|
|
3194
3243
|
}) : console.log(message));
|
|
@@ -3464,64 +3513,6 @@ __export(prompt_functions_exports, {
|
|
|
3464
3513
|
taskLog: () => taskLog,
|
|
3465
3514
|
text: () => text
|
|
3466
3515
|
});
|
|
3467
|
-
|
|
3468
|
-
// src/client-logger/index.ts
|
|
3469
|
-
import { global } from "@storybook/global";
|
|
3470
|
-
var { LOGLEVEL } = global, levels = {
|
|
3471
|
-
trace: 1,
|
|
3472
|
-
debug: 2,
|
|
3473
|
-
info: 3,
|
|
3474
|
-
warn: 4,
|
|
3475
|
-
error: 5,
|
|
3476
|
-
silent: 10
|
|
3477
|
-
}, currentLogLevelString = LOGLEVEL, currentLogLevelNumber = levels[currentLogLevelString] || levels.info, logger = {
|
|
3478
|
-
trace: (message, ...rest) => {
|
|
3479
|
-
currentLogLevelNumber <= levels.trace && console.trace(message, ...rest);
|
|
3480
|
-
},
|
|
3481
|
-
debug: (message, ...rest) => {
|
|
3482
|
-
currentLogLevelNumber <= levels.debug && console.debug(message, ...rest);
|
|
3483
|
-
},
|
|
3484
|
-
info: (message, ...rest) => {
|
|
3485
|
-
currentLogLevelNumber <= levels.info && console.info(message, ...rest);
|
|
3486
|
-
},
|
|
3487
|
-
warn: (message, ...rest) => {
|
|
3488
|
-
currentLogLevelNumber <= levels.warn && console.warn(message, ...rest);
|
|
3489
|
-
},
|
|
3490
|
-
error: (message, ...rest) => {
|
|
3491
|
-
currentLogLevelNumber <= levels.error && console.error(message, ...rest);
|
|
3492
|
-
},
|
|
3493
|
-
log: (message, ...rest) => {
|
|
3494
|
-
currentLogLevelNumber < levels.silent && console.log(message, ...rest);
|
|
3495
|
-
}
|
|
3496
|
-
}, logged = /* @__PURE__ */ new Set(), once = (type) => (message, ...rest) => {
|
|
3497
|
-
if (!logged.has(message))
|
|
3498
|
-
return logged.add(message), logger[type](message, ...rest);
|
|
3499
|
-
};
|
|
3500
|
-
once.clear = () => logged.clear();
|
|
3501
|
-
once.trace = once("trace");
|
|
3502
|
-
once.debug = once("debug");
|
|
3503
|
-
once.info = once("info");
|
|
3504
|
-
once.warn = once("warn");
|
|
3505
|
-
once.error = once("error");
|
|
3506
|
-
once.log = once("log");
|
|
3507
|
-
var deprecate = once("warn"), pretty = (type) => (...args) => {
|
|
3508
|
-
let argArray = [];
|
|
3509
|
-
if (args.length) {
|
|
3510
|
-
let startTagRe = /<span\s+style=(['"])([^'"]*)\1\s*>/gi, endTagRe = /<\/span>/gi, reResultArray;
|
|
3511
|
-
for (argArray.push(args[0].replace(startTagRe, "%c").replace(endTagRe, "%c")); reResultArray = startTagRe.exec(args[0]); )
|
|
3512
|
-
argArray.push(reResultArray[2]), argArray.push("");
|
|
3513
|
-
for (let j3 = 1; j3 < args.length; j3++)
|
|
3514
|
-
argArray.push(args[j3]);
|
|
3515
|
-
}
|
|
3516
|
-
logger[type].apply(logger, argArray);
|
|
3517
|
-
};
|
|
3518
|
-
pretty.trace = pretty("trace");
|
|
3519
|
-
pretty.debug = pretty("debug");
|
|
3520
|
-
pretty.info = pretty("info");
|
|
3521
|
-
pretty.warn = pretty("warn");
|
|
3522
|
-
pretty.error = pretty("error");
|
|
3523
|
-
|
|
3524
|
-
// src/node-logger/prompts/prompt-functions.ts
|
|
3525
3516
|
var activeSpinner = null, activeTaskLog = null, originalConsoleLog = null, isInteractiveTerminal = () => process.stdout.isTTY && process.stdin.isTTY && !process.env.CI, patchConsoleLog = () => {
|
|
3526
3517
|
originalConsoleLog || (originalConsoleLog = console.log, console.log = (...args) => {
|
|
3527
3518
|
let message = args.map((arg) => typeof arg == "string" ? arg : JSON.stringify(arg)).join(" ");
|
|
@@ -3547,13 +3538,19 @@ var activeSpinner = null, activeTaskLog = null, originalConsoleLog = null, isInt
|
|
|
3547
3538
|
stop: (message) => {
|
|
3548
3539
|
activeSpinner = null, restoreConsoleLog(), shouldLog("info") && spinnerInstance.stop(message);
|
|
3549
3540
|
},
|
|
3541
|
+
cancel: (message) => {
|
|
3542
|
+
activeSpinner = null, restoreConsoleLog(), shouldLog("info") && spinnerInstance.cancel(message);
|
|
3543
|
+
},
|
|
3544
|
+
error: (message) => {
|
|
3545
|
+
activeSpinner = null, restoreConsoleLog(), shouldLog("error") && spinnerInstance.error(message);
|
|
3546
|
+
},
|
|
3550
3547
|
message: (text2) => {
|
|
3551
3548
|
shouldLog("info") && spinnerInstance.message(text2);
|
|
3552
3549
|
}
|
|
3553
3550
|
};
|
|
3554
3551
|
return wrappedSpinner;
|
|
3555
3552
|
} else {
|
|
3556
|
-
let maybeLog = shouldLog("info") ?
|
|
3553
|
+
let maybeLog = shouldLog("info") ? log : (_2) => {
|
|
3557
3554
|
};
|
|
3558
3555
|
return {
|
|
3559
3556
|
start: (message) => {
|
|
@@ -3562,6 +3559,12 @@ var activeSpinner = null, activeTaskLog = null, originalConsoleLog = null, isInt
|
|
|
3562
3559
|
stop: (message) => {
|
|
3563
3560
|
message && maybeLog(message);
|
|
3564
3561
|
},
|
|
3562
|
+
cancel: (message) => {
|
|
3563
|
+
message && maybeLog(message);
|
|
3564
|
+
},
|
|
3565
|
+
error: (message) => {
|
|
3566
|
+
message && shouldLog("error") && error(message);
|
|
3567
|
+
},
|
|
3565
3568
|
message: (message) => {
|
|
3566
3569
|
maybeLog(message);
|
|
3567
3570
|
}
|
|
@@ -3597,7 +3600,7 @@ ${title}
|
|
|
3597
3600
|
};
|
|
3598
3601
|
return activeTaskLog = wrappedTaskLog, patchConsoleLog(), wrappedTaskLog;
|
|
3599
3602
|
} else {
|
|
3600
|
-
let maybeLog = shouldLog("info") ?
|
|
3603
|
+
let maybeLog = shouldLog("info") ? log : (_2) => {
|
|
3601
3604
|
};
|
|
3602
3605
|
return {
|
|
3603
3606
|
message: (message) => {
|
|
@@ -3701,11 +3704,11 @@ var executeTask = async (childProcessFactories, {
|
|
|
3701
3704
|
logTracker.addLog("info", success), task.stop(success);
|
|
3702
3705
|
} catch (err) {
|
|
3703
3706
|
if (abortController?.signal.aborted || err.message?.includes("Command was killed with SIGINT") || err.message?.includes("The operation was aborted")) {
|
|
3704
|
-
logTracker.addLog("info", `${intro2} aborted`), task.
|
|
3707
|
+
logTracker.addLog("info", `${intro2} aborted`), task.cancel(CLI_COLORS.warning(`${intro2} aborted`));
|
|
3705
3708
|
return;
|
|
3706
3709
|
}
|
|
3707
3710
|
let errorMessage = err instanceof Error ? err.stack ?? err.message : String(err);
|
|
3708
|
-
throw logTracker.addLog("error", error2, { error: errorMessage }), task.
|
|
3711
|
+
throw logTracker.addLog("error", error2, { error: errorMessage }), task.error(CLI_COLORS.error(error2)), err;
|
|
3709
3712
|
} finally {
|
|
3710
3713
|
cleanup?.();
|
|
3711
3714
|
}
|
|
@@ -3725,8 +3728,8 @@ function hex(hexColor) {
|
|
|
3725
3728
|
if (!/^#?[0-9A-Fa-f]{6}$/.test(hexColor))
|
|
3726
3729
|
throw new Error("Invalid hex color. It must be a 6-character hex code.");
|
|
3727
3730
|
hexColor.startsWith("#") && (hexColor = hexColor.slice(1));
|
|
3728
|
-
let r = parseInt(hexColor.slice(0, 2), 16), g = parseInt(hexColor.slice(2, 4), 16),
|
|
3729
|
-
return (text2) => `\x1B[38;2;${r};${g};${
|
|
3731
|
+
let r = parseInt(hexColor.slice(0, 2), 16), g = parseInt(hexColor.slice(2, 4), 16), b = parseInt(hexColor.slice(4, 6), 16);
|
|
3732
|
+
return (text2) => `\x1B[38;2;${r};${g};${b}m${text2}\x1B[39m`;
|
|
3730
3733
|
}
|
|
3731
3734
|
var colors = {
|
|
3732
3735
|
pink: hex("#F1618C"),
|
|
@@ -3736,7 +3739,7 @@ var colors = {
|
|
|
3736
3739
|
blue: hex("#6DABF5"),
|
|
3737
3740
|
red: hex("#F16161"),
|
|
3738
3741
|
gray: hex("#B8C2CC")
|
|
3739
|
-
},
|
|
3742
|
+
}, logger = {
|
|
3740
3743
|
...logger_exports,
|
|
3741
3744
|
verbose: (message) => debug(message),
|
|
3742
3745
|
line: (count = 1) => log(`${Array(count - 1).fill(`
|
|
@@ -3752,16 +3755,16 @@ var colors = {
|
|
|
3752
3755
|
message instanceof Error && message.stack ? msg = message.stack.toString().replace(message.toString(), colors.red(message.toString())) : typeof message == "string" ? msg = message.toString() : msg = String(message), error(msg.replaceAll(process.cwd(), "."));
|
|
3753
3756
|
}
|
|
3754
3757
|
};
|
|
3755
|
-
var
|
|
3756
|
-
if (!
|
|
3757
|
-
return
|
|
3758
|
+
var logged = /* @__PURE__ */ new Set(), once = (type) => (message) => {
|
|
3759
|
+
if (!logged.has(message))
|
|
3760
|
+
return logged.add(message), logger[type](message);
|
|
3758
3761
|
};
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
var
|
|
3762
|
+
once.clear = () => logged.clear();
|
|
3763
|
+
once.verbose = once("verbose");
|
|
3764
|
+
once.info = once("info");
|
|
3765
|
+
once.warn = once("warn");
|
|
3766
|
+
once.error = once("error");
|
|
3767
|
+
var deprecate = once("warn");
|
|
3765
3768
|
|
|
3766
3769
|
export {
|
|
3767
3770
|
require_pretty_hrtime,
|
|
@@ -3774,7 +3777,7 @@ export {
|
|
|
3774
3777
|
prompt,
|
|
3775
3778
|
import_npmlog,
|
|
3776
3779
|
colors,
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
+
logger,
|
|
3781
|
+
once,
|
|
3782
|
+
deprecate
|
|
3780
3783
|
};
|