@configjs/cli 1.0.2 → 1.0.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/{check-KGNJBAPL.js → check-OTK3GSIY.js} +6 -3
- package/dist/chunk-5S5KGCVY.js +276 -0
- package/dist/chunk-AMLNK7QR.js +417 -0
- package/dist/{chunk-SCNFVSYD.js → chunk-G5QBS6TL.js} +1 -13
- package/dist/{chunk-7ZLAP62L.js → chunk-GICPMTU2.js} +247 -440
- package/dist/chunk-QGM4M3NI.js +37 -0
- package/dist/cli.js +23 -4
- package/dist/{install-FNUEIZQ2.js → install-LJAWO26W.js} +57 -239
- package/dist/installed-BXP7ZWOU.js +41 -0
- package/dist/{list-CBEUUZUI.js → list-QC4T762H.js} +3 -1
- package/dist/remove-ZZD67W4M.js +1736 -0
- package/package.json +1 -1
|
@@ -0,0 +1,1736 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PluginTracker,
|
|
3
|
+
detectContext
|
|
4
|
+
} from "./chunk-AMLNK7QR.js";
|
|
5
|
+
import {
|
|
6
|
+
logger
|
|
7
|
+
} from "./chunk-5S5KGCVY.js";
|
|
8
|
+
import {
|
|
9
|
+
__commonJS,
|
|
10
|
+
__require,
|
|
11
|
+
__toESM
|
|
12
|
+
} from "./chunk-QGM4M3NI.js";
|
|
13
|
+
|
|
14
|
+
// node_modules/cli-width/index.js
|
|
15
|
+
var require_cli_width = __commonJS({
|
|
16
|
+
"node_modules/cli-width/index.js"(exports, module) {
|
|
17
|
+
"use strict";
|
|
18
|
+
module.exports = cliWidth2;
|
|
19
|
+
function normalizeOpts(options) {
|
|
20
|
+
const defaultOpts = {
|
|
21
|
+
defaultWidth: 0,
|
|
22
|
+
output: process.stdout,
|
|
23
|
+
tty: __require("tty")
|
|
24
|
+
};
|
|
25
|
+
if (!options) {
|
|
26
|
+
return defaultOpts;
|
|
27
|
+
}
|
|
28
|
+
Object.keys(defaultOpts).forEach(function(key) {
|
|
29
|
+
if (!options[key]) {
|
|
30
|
+
options[key] = defaultOpts[key];
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
return options;
|
|
34
|
+
}
|
|
35
|
+
function cliWidth2(options) {
|
|
36
|
+
const opts = normalizeOpts(options);
|
|
37
|
+
if (opts.output.getWindowSize) {
|
|
38
|
+
return opts.output.getWindowSize()[0] || opts.defaultWidth;
|
|
39
|
+
}
|
|
40
|
+
if (opts.tty.getWindowSize) {
|
|
41
|
+
return opts.tty.getWindowSize()[1] || opts.defaultWidth;
|
|
42
|
+
}
|
|
43
|
+
if (opts.output.columns) {
|
|
44
|
+
return opts.output.columns;
|
|
45
|
+
}
|
|
46
|
+
if (process.env.CLI_WIDTH) {
|
|
47
|
+
const width = parseInt(process.env.CLI_WIDTH, 10);
|
|
48
|
+
if (!isNaN(width) && width !== 0) {
|
|
49
|
+
return width;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return opts.defaultWidth;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// node_modules/mute-stream/lib/index.js
|
|
58
|
+
var require_lib = __commonJS({
|
|
59
|
+
"node_modules/mute-stream/lib/index.js"(exports, module) {
|
|
60
|
+
"use strict";
|
|
61
|
+
var Stream = __require("stream");
|
|
62
|
+
var MuteStream2 = class extends Stream {
|
|
63
|
+
#isTTY = null;
|
|
64
|
+
constructor(opts = {}) {
|
|
65
|
+
super(opts);
|
|
66
|
+
this.writable = this.readable = true;
|
|
67
|
+
this.muted = false;
|
|
68
|
+
this.on("pipe", this._onpipe);
|
|
69
|
+
this.replace = opts.replace;
|
|
70
|
+
this._prompt = opts.prompt || null;
|
|
71
|
+
this._hadControl = false;
|
|
72
|
+
}
|
|
73
|
+
#destSrc(key, def) {
|
|
74
|
+
if (this._dest) {
|
|
75
|
+
return this._dest[key];
|
|
76
|
+
}
|
|
77
|
+
if (this._src) {
|
|
78
|
+
return this._src[key];
|
|
79
|
+
}
|
|
80
|
+
return def;
|
|
81
|
+
}
|
|
82
|
+
#proxy(method, ...args) {
|
|
83
|
+
if (typeof this._dest?.[method] === "function") {
|
|
84
|
+
this._dest[method](...args);
|
|
85
|
+
}
|
|
86
|
+
if (typeof this._src?.[method] === "function") {
|
|
87
|
+
this._src[method](...args);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
get isTTY() {
|
|
91
|
+
if (this.#isTTY !== null) {
|
|
92
|
+
return this.#isTTY;
|
|
93
|
+
}
|
|
94
|
+
return this.#destSrc("isTTY", false);
|
|
95
|
+
}
|
|
96
|
+
// basically just get replace the getter/setter with a regular value
|
|
97
|
+
set isTTY(val) {
|
|
98
|
+
this.#isTTY = val;
|
|
99
|
+
}
|
|
100
|
+
get rows() {
|
|
101
|
+
return this.#destSrc("rows");
|
|
102
|
+
}
|
|
103
|
+
get columns() {
|
|
104
|
+
return this.#destSrc("columns");
|
|
105
|
+
}
|
|
106
|
+
mute() {
|
|
107
|
+
this.muted = true;
|
|
108
|
+
}
|
|
109
|
+
unmute() {
|
|
110
|
+
this.muted = false;
|
|
111
|
+
}
|
|
112
|
+
_onpipe(src) {
|
|
113
|
+
this._src = src;
|
|
114
|
+
}
|
|
115
|
+
pipe(dest, options) {
|
|
116
|
+
this._dest = dest;
|
|
117
|
+
return super.pipe(dest, options);
|
|
118
|
+
}
|
|
119
|
+
pause() {
|
|
120
|
+
if (this._src) {
|
|
121
|
+
return this._src.pause();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
resume() {
|
|
125
|
+
if (this._src) {
|
|
126
|
+
return this._src.resume();
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
write(c) {
|
|
130
|
+
if (this.muted) {
|
|
131
|
+
if (!this.replace) {
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
if (c.match(/^\u001b/)) {
|
|
135
|
+
if (c.indexOf(this._prompt) === 0) {
|
|
136
|
+
c = c.slice(this._prompt.length);
|
|
137
|
+
c = c.replace(/./g, this.replace);
|
|
138
|
+
c = this._prompt + c;
|
|
139
|
+
}
|
|
140
|
+
this._hadControl = true;
|
|
141
|
+
return this.emit("data", c);
|
|
142
|
+
} else {
|
|
143
|
+
if (this._prompt && this._hadControl && c.indexOf(this._prompt) === 0) {
|
|
144
|
+
this._hadControl = false;
|
|
145
|
+
this.emit("data", this._prompt);
|
|
146
|
+
c = c.slice(this._prompt.length);
|
|
147
|
+
}
|
|
148
|
+
c = c.toString().replace(/./g, this.replace);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
this.emit("data", c);
|
|
152
|
+
}
|
|
153
|
+
end(c) {
|
|
154
|
+
if (this.muted) {
|
|
155
|
+
if (c && this.replace) {
|
|
156
|
+
c = c.toString().replace(/./g, this.replace);
|
|
157
|
+
} else {
|
|
158
|
+
c = null;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
if (c) {
|
|
162
|
+
this.emit("data", c);
|
|
163
|
+
}
|
|
164
|
+
this.emit("end");
|
|
165
|
+
}
|
|
166
|
+
destroy(...args) {
|
|
167
|
+
return this.#proxy("destroy", ...args);
|
|
168
|
+
}
|
|
169
|
+
destroySoon(...args) {
|
|
170
|
+
return this.#proxy("destroySoon", ...args);
|
|
171
|
+
}
|
|
172
|
+
close(...args) {
|
|
173
|
+
return this.#proxy("close", ...args);
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
module.exports = MuteStream2;
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
// node_modules/@inquirer/core/dist/lib/key.js
|
|
181
|
+
var isTabKey = (key) => key.name === "tab";
|
|
182
|
+
var isEnterKey = (key) => key.name === "enter" || key.name === "return";
|
|
183
|
+
|
|
184
|
+
// node_modules/@inquirer/core/dist/lib/errors.js
|
|
185
|
+
var AbortPromptError = class extends Error {
|
|
186
|
+
name = "AbortPromptError";
|
|
187
|
+
message = "Prompt was aborted";
|
|
188
|
+
constructor(options) {
|
|
189
|
+
super();
|
|
190
|
+
this.cause = options?.cause;
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
var CancelPromptError = class extends Error {
|
|
194
|
+
name = "CancelPromptError";
|
|
195
|
+
message = "Prompt was canceled";
|
|
196
|
+
};
|
|
197
|
+
var ExitPromptError = class extends Error {
|
|
198
|
+
name = "ExitPromptError";
|
|
199
|
+
};
|
|
200
|
+
var HookError = class extends Error {
|
|
201
|
+
name = "HookError";
|
|
202
|
+
};
|
|
203
|
+
var ValidationError = class extends Error {
|
|
204
|
+
name = "ValidationError";
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
// node_modules/@inquirer/core/dist/lib/use-state.js
|
|
208
|
+
import { AsyncResource as AsyncResource2 } from "async_hooks";
|
|
209
|
+
|
|
210
|
+
// node_modules/@inquirer/core/dist/lib/hook-engine.js
|
|
211
|
+
import { AsyncLocalStorage, AsyncResource } from "async_hooks";
|
|
212
|
+
var hookStorage = new AsyncLocalStorage();
|
|
213
|
+
function createStore(rl) {
|
|
214
|
+
const store = {
|
|
215
|
+
rl,
|
|
216
|
+
hooks: [],
|
|
217
|
+
hooksCleanup: [],
|
|
218
|
+
hooksEffect: [],
|
|
219
|
+
index: 0,
|
|
220
|
+
handleChange() {
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
return store;
|
|
224
|
+
}
|
|
225
|
+
function withHooks(rl, cb) {
|
|
226
|
+
const store = createStore(rl);
|
|
227
|
+
return hookStorage.run(store, () => {
|
|
228
|
+
function cycle(render) {
|
|
229
|
+
store.handleChange = () => {
|
|
230
|
+
store.index = 0;
|
|
231
|
+
render();
|
|
232
|
+
};
|
|
233
|
+
store.handleChange();
|
|
234
|
+
}
|
|
235
|
+
return cb(cycle);
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
function getStore() {
|
|
239
|
+
const store = hookStorage.getStore();
|
|
240
|
+
if (!store) {
|
|
241
|
+
throw new HookError("[Inquirer] Hook functions can only be called from within a prompt");
|
|
242
|
+
}
|
|
243
|
+
return store;
|
|
244
|
+
}
|
|
245
|
+
function readline() {
|
|
246
|
+
return getStore().rl;
|
|
247
|
+
}
|
|
248
|
+
function withUpdates(fn) {
|
|
249
|
+
const wrapped = (...args) => {
|
|
250
|
+
const store = getStore();
|
|
251
|
+
let shouldUpdate = false;
|
|
252
|
+
const oldHandleChange = store.handleChange;
|
|
253
|
+
store.handleChange = () => {
|
|
254
|
+
shouldUpdate = true;
|
|
255
|
+
};
|
|
256
|
+
const returnValue = fn(...args);
|
|
257
|
+
if (shouldUpdate) {
|
|
258
|
+
oldHandleChange();
|
|
259
|
+
}
|
|
260
|
+
store.handleChange = oldHandleChange;
|
|
261
|
+
return returnValue;
|
|
262
|
+
};
|
|
263
|
+
return AsyncResource.bind(wrapped);
|
|
264
|
+
}
|
|
265
|
+
function withPointer(cb) {
|
|
266
|
+
const store = getStore();
|
|
267
|
+
const { index } = store;
|
|
268
|
+
const pointer = {
|
|
269
|
+
get() {
|
|
270
|
+
return store.hooks[index];
|
|
271
|
+
},
|
|
272
|
+
set(value) {
|
|
273
|
+
store.hooks[index] = value;
|
|
274
|
+
},
|
|
275
|
+
initialized: index in store.hooks
|
|
276
|
+
};
|
|
277
|
+
const returnValue = cb(pointer);
|
|
278
|
+
store.index++;
|
|
279
|
+
return returnValue;
|
|
280
|
+
}
|
|
281
|
+
function handleChange() {
|
|
282
|
+
getStore().handleChange();
|
|
283
|
+
}
|
|
284
|
+
var effectScheduler = {
|
|
285
|
+
queue(cb) {
|
|
286
|
+
const store = getStore();
|
|
287
|
+
const { index } = store;
|
|
288
|
+
store.hooksEffect.push(() => {
|
|
289
|
+
store.hooksCleanup[index]?.();
|
|
290
|
+
const cleanFn = cb(readline());
|
|
291
|
+
if (cleanFn != null && typeof cleanFn !== "function") {
|
|
292
|
+
throw new ValidationError("useEffect return value must be a cleanup function or nothing.");
|
|
293
|
+
}
|
|
294
|
+
store.hooksCleanup[index] = cleanFn;
|
|
295
|
+
});
|
|
296
|
+
},
|
|
297
|
+
run() {
|
|
298
|
+
const store = getStore();
|
|
299
|
+
withUpdates(() => {
|
|
300
|
+
store.hooksEffect.forEach((effect) => {
|
|
301
|
+
effect();
|
|
302
|
+
});
|
|
303
|
+
store.hooksEffect.length = 0;
|
|
304
|
+
})();
|
|
305
|
+
},
|
|
306
|
+
clearAll() {
|
|
307
|
+
const store = getStore();
|
|
308
|
+
store.hooksCleanup.forEach((cleanFn) => {
|
|
309
|
+
cleanFn?.();
|
|
310
|
+
});
|
|
311
|
+
store.hooksEffect.length = 0;
|
|
312
|
+
store.hooksCleanup.length = 0;
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
// node_modules/@inquirer/core/dist/lib/use-state.js
|
|
317
|
+
function useState(defaultValue) {
|
|
318
|
+
return withPointer((pointer) => {
|
|
319
|
+
const setState = AsyncResource2.bind(function setState2(newValue) {
|
|
320
|
+
if (pointer.get() !== newValue) {
|
|
321
|
+
pointer.set(newValue);
|
|
322
|
+
handleChange();
|
|
323
|
+
}
|
|
324
|
+
});
|
|
325
|
+
if (pointer.initialized) {
|
|
326
|
+
return [pointer.get(), setState];
|
|
327
|
+
}
|
|
328
|
+
const value = typeof defaultValue === "function" ? defaultValue() : defaultValue;
|
|
329
|
+
pointer.set(value);
|
|
330
|
+
return [value, setState];
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
// node_modules/@inquirer/core/dist/lib/use-effect.js
|
|
335
|
+
function useEffect(cb, depArray) {
|
|
336
|
+
withPointer((pointer) => {
|
|
337
|
+
const oldDeps = pointer.get();
|
|
338
|
+
const hasChanged = !Array.isArray(oldDeps) || depArray.some((dep, i) => !Object.is(dep, oldDeps[i]));
|
|
339
|
+
if (hasChanged) {
|
|
340
|
+
effectScheduler.queue(cb);
|
|
341
|
+
}
|
|
342
|
+
pointer.set(depArray);
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
// node_modules/@inquirer/core/dist/lib/theme.js
|
|
347
|
+
import { styleText } from "util";
|
|
348
|
+
|
|
349
|
+
// node_modules/@inquirer/figures/dist/index.js
|
|
350
|
+
import process2 from "process";
|
|
351
|
+
function isUnicodeSupported() {
|
|
352
|
+
if (process2.platform !== "win32") {
|
|
353
|
+
return process2.env["TERM"] !== "linux";
|
|
354
|
+
}
|
|
355
|
+
return Boolean(process2.env["WT_SESSION"]) || // Windows Terminal
|
|
356
|
+
Boolean(process2.env["TERMINUS_SUBLIME"]) || // Terminus (<0.2.27)
|
|
357
|
+
process2.env["ConEmuTask"] === "{cmd::Cmder}" || // ConEmu and cmder
|
|
358
|
+
process2.env["TERM_PROGRAM"] === "Terminus-Sublime" || process2.env["TERM_PROGRAM"] === "vscode" || process2.env["TERM"] === "xterm-256color" || process2.env["TERM"] === "alacritty" || process2.env["TERMINAL_EMULATOR"] === "JetBrains-JediTerm";
|
|
359
|
+
}
|
|
360
|
+
var common = {
|
|
361
|
+
circleQuestionMark: "(?)",
|
|
362
|
+
questionMarkPrefix: "(?)",
|
|
363
|
+
square: "\u2588",
|
|
364
|
+
squareDarkShade: "\u2593",
|
|
365
|
+
squareMediumShade: "\u2592",
|
|
366
|
+
squareLightShade: "\u2591",
|
|
367
|
+
squareTop: "\u2580",
|
|
368
|
+
squareBottom: "\u2584",
|
|
369
|
+
squareLeft: "\u258C",
|
|
370
|
+
squareRight: "\u2590",
|
|
371
|
+
squareCenter: "\u25A0",
|
|
372
|
+
bullet: "\u25CF",
|
|
373
|
+
dot: "\u2024",
|
|
374
|
+
ellipsis: "\u2026",
|
|
375
|
+
pointerSmall: "\u203A",
|
|
376
|
+
triangleUp: "\u25B2",
|
|
377
|
+
triangleUpSmall: "\u25B4",
|
|
378
|
+
triangleDown: "\u25BC",
|
|
379
|
+
triangleDownSmall: "\u25BE",
|
|
380
|
+
triangleLeftSmall: "\u25C2",
|
|
381
|
+
triangleRightSmall: "\u25B8",
|
|
382
|
+
home: "\u2302",
|
|
383
|
+
heart: "\u2665",
|
|
384
|
+
musicNote: "\u266A",
|
|
385
|
+
musicNoteBeamed: "\u266B",
|
|
386
|
+
arrowUp: "\u2191",
|
|
387
|
+
arrowDown: "\u2193",
|
|
388
|
+
arrowLeft: "\u2190",
|
|
389
|
+
arrowRight: "\u2192",
|
|
390
|
+
arrowLeftRight: "\u2194",
|
|
391
|
+
arrowUpDown: "\u2195",
|
|
392
|
+
almostEqual: "\u2248",
|
|
393
|
+
notEqual: "\u2260",
|
|
394
|
+
lessOrEqual: "\u2264",
|
|
395
|
+
greaterOrEqual: "\u2265",
|
|
396
|
+
identical: "\u2261",
|
|
397
|
+
infinity: "\u221E",
|
|
398
|
+
subscriptZero: "\u2080",
|
|
399
|
+
subscriptOne: "\u2081",
|
|
400
|
+
subscriptTwo: "\u2082",
|
|
401
|
+
subscriptThree: "\u2083",
|
|
402
|
+
subscriptFour: "\u2084",
|
|
403
|
+
subscriptFive: "\u2085",
|
|
404
|
+
subscriptSix: "\u2086",
|
|
405
|
+
subscriptSeven: "\u2087",
|
|
406
|
+
subscriptEight: "\u2088",
|
|
407
|
+
subscriptNine: "\u2089",
|
|
408
|
+
oneHalf: "\xBD",
|
|
409
|
+
oneThird: "\u2153",
|
|
410
|
+
oneQuarter: "\xBC",
|
|
411
|
+
oneFifth: "\u2155",
|
|
412
|
+
oneSixth: "\u2159",
|
|
413
|
+
oneEighth: "\u215B",
|
|
414
|
+
twoThirds: "\u2154",
|
|
415
|
+
twoFifths: "\u2156",
|
|
416
|
+
threeQuarters: "\xBE",
|
|
417
|
+
threeFifths: "\u2157",
|
|
418
|
+
threeEighths: "\u215C",
|
|
419
|
+
fourFifths: "\u2158",
|
|
420
|
+
fiveSixths: "\u215A",
|
|
421
|
+
fiveEighths: "\u215D",
|
|
422
|
+
sevenEighths: "\u215E",
|
|
423
|
+
line: "\u2500",
|
|
424
|
+
lineBold: "\u2501",
|
|
425
|
+
lineDouble: "\u2550",
|
|
426
|
+
lineDashed0: "\u2504",
|
|
427
|
+
lineDashed1: "\u2505",
|
|
428
|
+
lineDashed2: "\u2508",
|
|
429
|
+
lineDashed3: "\u2509",
|
|
430
|
+
lineDashed4: "\u254C",
|
|
431
|
+
lineDashed5: "\u254D",
|
|
432
|
+
lineDashed6: "\u2574",
|
|
433
|
+
lineDashed7: "\u2576",
|
|
434
|
+
lineDashed8: "\u2578",
|
|
435
|
+
lineDashed9: "\u257A",
|
|
436
|
+
lineDashed10: "\u257C",
|
|
437
|
+
lineDashed11: "\u257E",
|
|
438
|
+
lineDashed12: "\u2212",
|
|
439
|
+
lineDashed13: "\u2013",
|
|
440
|
+
lineDashed14: "\u2010",
|
|
441
|
+
lineDashed15: "\u2043",
|
|
442
|
+
lineVertical: "\u2502",
|
|
443
|
+
lineVerticalBold: "\u2503",
|
|
444
|
+
lineVerticalDouble: "\u2551",
|
|
445
|
+
lineVerticalDashed0: "\u2506",
|
|
446
|
+
lineVerticalDashed1: "\u2507",
|
|
447
|
+
lineVerticalDashed2: "\u250A",
|
|
448
|
+
lineVerticalDashed3: "\u250B",
|
|
449
|
+
lineVerticalDashed4: "\u254E",
|
|
450
|
+
lineVerticalDashed5: "\u254F",
|
|
451
|
+
lineVerticalDashed6: "\u2575",
|
|
452
|
+
lineVerticalDashed7: "\u2577",
|
|
453
|
+
lineVerticalDashed8: "\u2579",
|
|
454
|
+
lineVerticalDashed9: "\u257B",
|
|
455
|
+
lineVerticalDashed10: "\u257D",
|
|
456
|
+
lineVerticalDashed11: "\u257F",
|
|
457
|
+
lineDownLeft: "\u2510",
|
|
458
|
+
lineDownLeftArc: "\u256E",
|
|
459
|
+
lineDownBoldLeftBold: "\u2513",
|
|
460
|
+
lineDownBoldLeft: "\u2512",
|
|
461
|
+
lineDownLeftBold: "\u2511",
|
|
462
|
+
lineDownDoubleLeftDouble: "\u2557",
|
|
463
|
+
lineDownDoubleLeft: "\u2556",
|
|
464
|
+
lineDownLeftDouble: "\u2555",
|
|
465
|
+
lineDownRight: "\u250C",
|
|
466
|
+
lineDownRightArc: "\u256D",
|
|
467
|
+
lineDownBoldRightBold: "\u250F",
|
|
468
|
+
lineDownBoldRight: "\u250E",
|
|
469
|
+
lineDownRightBold: "\u250D",
|
|
470
|
+
lineDownDoubleRightDouble: "\u2554",
|
|
471
|
+
lineDownDoubleRight: "\u2553",
|
|
472
|
+
lineDownRightDouble: "\u2552",
|
|
473
|
+
lineUpLeft: "\u2518",
|
|
474
|
+
lineUpLeftArc: "\u256F",
|
|
475
|
+
lineUpBoldLeftBold: "\u251B",
|
|
476
|
+
lineUpBoldLeft: "\u251A",
|
|
477
|
+
lineUpLeftBold: "\u2519",
|
|
478
|
+
lineUpDoubleLeftDouble: "\u255D",
|
|
479
|
+
lineUpDoubleLeft: "\u255C",
|
|
480
|
+
lineUpLeftDouble: "\u255B",
|
|
481
|
+
lineUpRight: "\u2514",
|
|
482
|
+
lineUpRightArc: "\u2570",
|
|
483
|
+
lineUpBoldRightBold: "\u2517",
|
|
484
|
+
lineUpBoldRight: "\u2516",
|
|
485
|
+
lineUpRightBold: "\u2515",
|
|
486
|
+
lineUpDoubleRightDouble: "\u255A",
|
|
487
|
+
lineUpDoubleRight: "\u2559",
|
|
488
|
+
lineUpRightDouble: "\u2558",
|
|
489
|
+
lineUpDownLeft: "\u2524",
|
|
490
|
+
lineUpBoldDownBoldLeftBold: "\u252B",
|
|
491
|
+
lineUpBoldDownBoldLeft: "\u2528",
|
|
492
|
+
lineUpDownLeftBold: "\u2525",
|
|
493
|
+
lineUpBoldDownLeftBold: "\u2529",
|
|
494
|
+
lineUpDownBoldLeftBold: "\u252A",
|
|
495
|
+
lineUpDownBoldLeft: "\u2527",
|
|
496
|
+
lineUpBoldDownLeft: "\u2526",
|
|
497
|
+
lineUpDoubleDownDoubleLeftDouble: "\u2563",
|
|
498
|
+
lineUpDoubleDownDoubleLeft: "\u2562",
|
|
499
|
+
lineUpDownLeftDouble: "\u2561",
|
|
500
|
+
lineUpDownRight: "\u251C",
|
|
501
|
+
lineUpBoldDownBoldRightBold: "\u2523",
|
|
502
|
+
lineUpBoldDownBoldRight: "\u2520",
|
|
503
|
+
lineUpDownRightBold: "\u251D",
|
|
504
|
+
lineUpBoldDownRightBold: "\u2521",
|
|
505
|
+
lineUpDownBoldRightBold: "\u2522",
|
|
506
|
+
lineUpDownBoldRight: "\u251F",
|
|
507
|
+
lineUpBoldDownRight: "\u251E",
|
|
508
|
+
lineUpDoubleDownDoubleRightDouble: "\u2560",
|
|
509
|
+
lineUpDoubleDownDoubleRight: "\u255F",
|
|
510
|
+
lineUpDownRightDouble: "\u255E",
|
|
511
|
+
lineDownLeftRight: "\u252C",
|
|
512
|
+
lineDownBoldLeftBoldRightBold: "\u2533",
|
|
513
|
+
lineDownLeftBoldRightBold: "\u252F",
|
|
514
|
+
lineDownBoldLeftRight: "\u2530",
|
|
515
|
+
lineDownBoldLeftBoldRight: "\u2531",
|
|
516
|
+
lineDownBoldLeftRightBold: "\u2532",
|
|
517
|
+
lineDownLeftRightBold: "\u252E",
|
|
518
|
+
lineDownLeftBoldRight: "\u252D",
|
|
519
|
+
lineDownDoubleLeftDoubleRightDouble: "\u2566",
|
|
520
|
+
lineDownDoubleLeftRight: "\u2565",
|
|
521
|
+
lineDownLeftDoubleRightDouble: "\u2564",
|
|
522
|
+
lineUpLeftRight: "\u2534",
|
|
523
|
+
lineUpBoldLeftBoldRightBold: "\u253B",
|
|
524
|
+
lineUpLeftBoldRightBold: "\u2537",
|
|
525
|
+
lineUpBoldLeftRight: "\u2538",
|
|
526
|
+
lineUpBoldLeftBoldRight: "\u2539",
|
|
527
|
+
lineUpBoldLeftRightBold: "\u253A",
|
|
528
|
+
lineUpLeftRightBold: "\u2536",
|
|
529
|
+
lineUpLeftBoldRight: "\u2535",
|
|
530
|
+
lineUpDoubleLeftDoubleRightDouble: "\u2569",
|
|
531
|
+
lineUpDoubleLeftRight: "\u2568",
|
|
532
|
+
lineUpLeftDoubleRightDouble: "\u2567",
|
|
533
|
+
lineUpDownLeftRight: "\u253C",
|
|
534
|
+
lineUpBoldDownBoldLeftBoldRightBold: "\u254B",
|
|
535
|
+
lineUpDownBoldLeftBoldRightBold: "\u2548",
|
|
536
|
+
lineUpBoldDownLeftBoldRightBold: "\u2547",
|
|
537
|
+
lineUpBoldDownBoldLeftRightBold: "\u254A",
|
|
538
|
+
lineUpBoldDownBoldLeftBoldRight: "\u2549",
|
|
539
|
+
lineUpBoldDownLeftRight: "\u2540",
|
|
540
|
+
lineUpDownBoldLeftRight: "\u2541",
|
|
541
|
+
lineUpDownLeftBoldRight: "\u253D",
|
|
542
|
+
lineUpDownLeftRightBold: "\u253E",
|
|
543
|
+
lineUpBoldDownBoldLeftRight: "\u2542",
|
|
544
|
+
lineUpDownLeftBoldRightBold: "\u253F",
|
|
545
|
+
lineUpBoldDownLeftBoldRight: "\u2543",
|
|
546
|
+
lineUpBoldDownLeftRightBold: "\u2544",
|
|
547
|
+
lineUpDownBoldLeftBoldRight: "\u2545",
|
|
548
|
+
lineUpDownBoldLeftRightBold: "\u2546",
|
|
549
|
+
lineUpDoubleDownDoubleLeftDoubleRightDouble: "\u256C",
|
|
550
|
+
lineUpDoubleDownDoubleLeftRight: "\u256B",
|
|
551
|
+
lineUpDownLeftDoubleRightDouble: "\u256A",
|
|
552
|
+
lineCross: "\u2573",
|
|
553
|
+
lineBackslash: "\u2572",
|
|
554
|
+
lineSlash: "\u2571"
|
|
555
|
+
};
|
|
556
|
+
var specialMainSymbols = {
|
|
557
|
+
tick: "\u2714",
|
|
558
|
+
info: "\u2139",
|
|
559
|
+
warning: "\u26A0",
|
|
560
|
+
cross: "\u2718",
|
|
561
|
+
squareSmall: "\u25FB",
|
|
562
|
+
squareSmallFilled: "\u25FC",
|
|
563
|
+
circle: "\u25EF",
|
|
564
|
+
circleFilled: "\u25C9",
|
|
565
|
+
circleDotted: "\u25CC",
|
|
566
|
+
circleDouble: "\u25CE",
|
|
567
|
+
circleCircle: "\u24DE",
|
|
568
|
+
circleCross: "\u24E7",
|
|
569
|
+
circlePipe: "\u24BE",
|
|
570
|
+
radioOn: "\u25C9",
|
|
571
|
+
radioOff: "\u25EF",
|
|
572
|
+
checkboxOn: "\u2612",
|
|
573
|
+
checkboxOff: "\u2610",
|
|
574
|
+
checkboxCircleOn: "\u24E7",
|
|
575
|
+
checkboxCircleOff: "\u24BE",
|
|
576
|
+
pointer: "\u276F",
|
|
577
|
+
triangleUpOutline: "\u25B3",
|
|
578
|
+
triangleLeft: "\u25C0",
|
|
579
|
+
triangleRight: "\u25B6",
|
|
580
|
+
lozenge: "\u25C6",
|
|
581
|
+
lozengeOutline: "\u25C7",
|
|
582
|
+
hamburger: "\u2630",
|
|
583
|
+
smiley: "\u32E1",
|
|
584
|
+
mustache: "\u0DF4",
|
|
585
|
+
star: "\u2605",
|
|
586
|
+
play: "\u25B6",
|
|
587
|
+
nodejs: "\u2B22",
|
|
588
|
+
oneSeventh: "\u2150",
|
|
589
|
+
oneNinth: "\u2151",
|
|
590
|
+
oneTenth: "\u2152"
|
|
591
|
+
};
|
|
592
|
+
var specialFallbackSymbols = {
|
|
593
|
+
tick: "\u221A",
|
|
594
|
+
info: "i",
|
|
595
|
+
warning: "\u203C",
|
|
596
|
+
cross: "\xD7",
|
|
597
|
+
squareSmall: "\u25A1",
|
|
598
|
+
squareSmallFilled: "\u25A0",
|
|
599
|
+
circle: "( )",
|
|
600
|
+
circleFilled: "(*)",
|
|
601
|
+
circleDotted: "( )",
|
|
602
|
+
circleDouble: "( )",
|
|
603
|
+
circleCircle: "(\u25CB)",
|
|
604
|
+
circleCross: "(\xD7)",
|
|
605
|
+
circlePipe: "(\u2502)",
|
|
606
|
+
radioOn: "(*)",
|
|
607
|
+
radioOff: "( )",
|
|
608
|
+
checkboxOn: "[\xD7]",
|
|
609
|
+
checkboxOff: "[ ]",
|
|
610
|
+
checkboxCircleOn: "(\xD7)",
|
|
611
|
+
checkboxCircleOff: "( )",
|
|
612
|
+
pointer: ">",
|
|
613
|
+
triangleUpOutline: "\u2206",
|
|
614
|
+
triangleLeft: "\u25C4",
|
|
615
|
+
triangleRight: "\u25BA",
|
|
616
|
+
lozenge: "\u2666",
|
|
617
|
+
lozengeOutline: "\u25CA",
|
|
618
|
+
hamburger: "\u2261",
|
|
619
|
+
smiley: "\u263A",
|
|
620
|
+
mustache: "\u250C\u2500\u2510",
|
|
621
|
+
star: "\u2736",
|
|
622
|
+
play: "\u25BA",
|
|
623
|
+
nodejs: "\u2666",
|
|
624
|
+
oneSeventh: "1/7",
|
|
625
|
+
oneNinth: "1/9",
|
|
626
|
+
oneTenth: "1/10"
|
|
627
|
+
};
|
|
628
|
+
var mainSymbols = {
|
|
629
|
+
...common,
|
|
630
|
+
...specialMainSymbols
|
|
631
|
+
};
|
|
632
|
+
var fallbackSymbols = {
|
|
633
|
+
...common,
|
|
634
|
+
...specialFallbackSymbols
|
|
635
|
+
};
|
|
636
|
+
var shouldUseMain = isUnicodeSupported();
|
|
637
|
+
var figures = shouldUseMain ? mainSymbols : fallbackSymbols;
|
|
638
|
+
var dist_default = figures;
|
|
639
|
+
var replacements = Object.entries(specialMainSymbols);
|
|
640
|
+
|
|
641
|
+
// node_modules/@inquirer/core/dist/lib/theme.js
|
|
642
|
+
var defaultTheme = {
|
|
643
|
+
prefix: {
|
|
644
|
+
idle: styleText("blue", "?"),
|
|
645
|
+
done: styleText("green", dist_default.tick)
|
|
646
|
+
},
|
|
647
|
+
spinner: {
|
|
648
|
+
interval: 80,
|
|
649
|
+
frames: ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"].map((frame) => styleText("yellow", frame))
|
|
650
|
+
},
|
|
651
|
+
style: {
|
|
652
|
+
answer: (text) => styleText("cyan", text),
|
|
653
|
+
message: (text) => styleText("bold", text),
|
|
654
|
+
error: (text) => styleText("red", `> ${text}`),
|
|
655
|
+
defaultAnswer: (text) => styleText("dim", `(${text})`),
|
|
656
|
+
help: (text) => styleText("dim", text),
|
|
657
|
+
highlight: (text) => styleText("cyan", text),
|
|
658
|
+
key: (text) => styleText("cyan", styleText("bold", `<${text}>`))
|
|
659
|
+
}
|
|
660
|
+
};
|
|
661
|
+
|
|
662
|
+
// node_modules/@inquirer/core/dist/lib/make-theme.js
|
|
663
|
+
function isPlainObject(value) {
|
|
664
|
+
if (typeof value !== "object" || value === null)
|
|
665
|
+
return false;
|
|
666
|
+
let proto = value;
|
|
667
|
+
while (Object.getPrototypeOf(proto) !== null) {
|
|
668
|
+
proto = Object.getPrototypeOf(proto);
|
|
669
|
+
}
|
|
670
|
+
return Object.getPrototypeOf(value) === proto;
|
|
671
|
+
}
|
|
672
|
+
function deepMerge(...objects) {
|
|
673
|
+
const output = {};
|
|
674
|
+
for (const obj of objects) {
|
|
675
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
676
|
+
const prevValue = output[key];
|
|
677
|
+
output[key] = isPlainObject(prevValue) && isPlainObject(value) ? deepMerge(prevValue, value) : value;
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
return output;
|
|
681
|
+
}
|
|
682
|
+
function makeTheme(...themes) {
|
|
683
|
+
const themesToMerge = [
|
|
684
|
+
defaultTheme,
|
|
685
|
+
...themes.filter((theme) => theme != null)
|
|
686
|
+
];
|
|
687
|
+
return deepMerge(...themesToMerge);
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
// node_modules/@inquirer/core/dist/lib/use-prefix.js
|
|
691
|
+
function usePrefix({ status = "idle", theme }) {
|
|
692
|
+
const [showLoader, setShowLoader] = useState(false);
|
|
693
|
+
const [tick, setTick] = useState(0);
|
|
694
|
+
const { prefix, spinner } = makeTheme(theme);
|
|
695
|
+
useEffect(() => {
|
|
696
|
+
if (status === "loading") {
|
|
697
|
+
let tickInterval;
|
|
698
|
+
let inc = -1;
|
|
699
|
+
const delayTimeout = setTimeout(() => {
|
|
700
|
+
setShowLoader(true);
|
|
701
|
+
tickInterval = setInterval(() => {
|
|
702
|
+
inc = inc + 1;
|
|
703
|
+
setTick(inc % spinner.frames.length);
|
|
704
|
+
}, spinner.interval);
|
|
705
|
+
}, 300);
|
|
706
|
+
return () => {
|
|
707
|
+
clearTimeout(delayTimeout);
|
|
708
|
+
clearInterval(tickInterval);
|
|
709
|
+
};
|
|
710
|
+
} else {
|
|
711
|
+
setShowLoader(false);
|
|
712
|
+
}
|
|
713
|
+
}, [status]);
|
|
714
|
+
if (showLoader) {
|
|
715
|
+
return spinner.frames[tick];
|
|
716
|
+
}
|
|
717
|
+
const iconName = status === "loading" ? "idle" : status;
|
|
718
|
+
return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
// node_modules/@inquirer/core/dist/lib/use-ref.js
|
|
722
|
+
function useRef(val) {
|
|
723
|
+
return useState({ current: val })[0];
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
// node_modules/@inquirer/core/dist/lib/use-keypress.js
|
|
727
|
+
function useKeypress(userHandler) {
|
|
728
|
+
const signal = useRef(userHandler);
|
|
729
|
+
signal.current = userHandler;
|
|
730
|
+
useEffect((rl) => {
|
|
731
|
+
let ignore = false;
|
|
732
|
+
const handler = withUpdates((_input, event) => {
|
|
733
|
+
if (ignore)
|
|
734
|
+
return;
|
|
735
|
+
void signal.current(event, rl);
|
|
736
|
+
});
|
|
737
|
+
rl.input.on("keypress", handler);
|
|
738
|
+
return () => {
|
|
739
|
+
ignore = true;
|
|
740
|
+
rl.input.removeListener("keypress", handler);
|
|
741
|
+
};
|
|
742
|
+
}, []);
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
// node_modules/@inquirer/core/dist/lib/utils.js
|
|
746
|
+
var import_cli_width = __toESM(require_cli_width(), 1);
|
|
747
|
+
|
|
748
|
+
// node_modules/ansi-regex/index.js
|
|
749
|
+
function ansiRegex({ onlyFirst = false } = {}) {
|
|
750
|
+
const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
|
|
751
|
+
const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`;
|
|
752
|
+
const csi = "[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";
|
|
753
|
+
const pattern = `${osc}|${csi}`;
|
|
754
|
+
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
// node_modules/strip-ansi/index.js
|
|
758
|
+
var regex = ansiRegex();
|
|
759
|
+
function stripAnsi(string) {
|
|
760
|
+
if (typeof string !== "string") {
|
|
761
|
+
throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
|
762
|
+
}
|
|
763
|
+
return string.replace(regex, "");
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
// node_modules/get-east-asian-width/lookup.js
|
|
767
|
+
function isAmbiguous(x) {
|
|
768
|
+
return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
|
|
769
|
+
}
|
|
770
|
+
function isFullWidth(x) {
|
|
771
|
+
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
772
|
+
}
|
|
773
|
+
function isWide(x) {
|
|
774
|
+
return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9776 && x <= 9783 || x >= 9800 && x <= 9811 || x === 9855 || x >= 9866 && x <= 9871 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12773 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x >= 94192 && x <= 94198 || x >= 94208 && x <= 101589 || x >= 101631 && x <= 101662 || x >= 101760 && x <= 101874 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x >= 119552 && x <= 119638 || x >= 119648 && x <= 119670 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128728 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129674 || x >= 129678 && x <= 129734 || x === 129736 || x >= 129741 && x <= 129756 || x >= 129759 && x <= 129770 || x >= 129775 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
// node_modules/get-east-asian-width/index.js
|
|
778
|
+
function validate(codePoint) {
|
|
779
|
+
if (!Number.isSafeInteger(codePoint)) {
|
|
780
|
+
throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
|
|
784
|
+
validate(codePoint);
|
|
785
|
+
if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) {
|
|
786
|
+
return 2;
|
|
787
|
+
}
|
|
788
|
+
return 1;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
// node_modules/emoji-regex/index.mjs
|
|
792
|
+
var emoji_regex_default = () => {
|
|
793
|
+
return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
|
|
794
|
+
};
|
|
795
|
+
|
|
796
|
+
// node_modules/wrap-ansi/node_modules/string-width/index.js
|
|
797
|
+
var segmenter = new Intl.Segmenter();
|
|
798
|
+
var defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
|
|
799
|
+
function stringWidth(string, options = {}) {
|
|
800
|
+
if (typeof string !== "string" || string.length === 0) {
|
|
801
|
+
return 0;
|
|
802
|
+
}
|
|
803
|
+
const {
|
|
804
|
+
ambiguousIsNarrow = true,
|
|
805
|
+
countAnsiEscapeCodes = false
|
|
806
|
+
} = options;
|
|
807
|
+
if (!countAnsiEscapeCodes) {
|
|
808
|
+
string = stripAnsi(string);
|
|
809
|
+
}
|
|
810
|
+
if (string.length === 0) {
|
|
811
|
+
return 0;
|
|
812
|
+
}
|
|
813
|
+
let width = 0;
|
|
814
|
+
const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
|
|
815
|
+
for (const { segment: character } of segmenter.segment(string)) {
|
|
816
|
+
const codePoint = character.codePointAt(0);
|
|
817
|
+
if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
|
|
818
|
+
continue;
|
|
819
|
+
}
|
|
820
|
+
if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) {
|
|
821
|
+
continue;
|
|
822
|
+
}
|
|
823
|
+
if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) {
|
|
824
|
+
continue;
|
|
825
|
+
}
|
|
826
|
+
if (codePoint >= 55296 && codePoint <= 57343) {
|
|
827
|
+
continue;
|
|
828
|
+
}
|
|
829
|
+
if (codePoint >= 65024 && codePoint <= 65039) {
|
|
830
|
+
continue;
|
|
831
|
+
}
|
|
832
|
+
if (defaultIgnorableCodePointRegex.test(character)) {
|
|
833
|
+
continue;
|
|
834
|
+
}
|
|
835
|
+
if (emoji_regex_default().test(character)) {
|
|
836
|
+
width += 2;
|
|
837
|
+
continue;
|
|
838
|
+
}
|
|
839
|
+
width += eastAsianWidth(codePoint, eastAsianWidthOptions);
|
|
840
|
+
}
|
|
841
|
+
return width;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
// node_modules/ansi-styles/index.js
|
|
845
|
+
var ANSI_BACKGROUND_OFFSET = 10;
|
|
846
|
+
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
847
|
+
var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
848
|
+
var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
|
|
849
|
+
var styles = {
|
|
850
|
+
modifier: {
|
|
851
|
+
reset: [0, 0],
|
|
852
|
+
// 21 isn't widely supported and 22 does the same thing
|
|
853
|
+
bold: [1, 22],
|
|
854
|
+
dim: [2, 22],
|
|
855
|
+
italic: [3, 23],
|
|
856
|
+
underline: [4, 24],
|
|
857
|
+
overline: [53, 55],
|
|
858
|
+
inverse: [7, 27],
|
|
859
|
+
hidden: [8, 28],
|
|
860
|
+
strikethrough: [9, 29]
|
|
861
|
+
},
|
|
862
|
+
color: {
|
|
863
|
+
black: [30, 39],
|
|
864
|
+
red: [31, 39],
|
|
865
|
+
green: [32, 39],
|
|
866
|
+
yellow: [33, 39],
|
|
867
|
+
blue: [34, 39],
|
|
868
|
+
magenta: [35, 39],
|
|
869
|
+
cyan: [36, 39],
|
|
870
|
+
white: [37, 39],
|
|
871
|
+
// Bright color
|
|
872
|
+
blackBright: [90, 39],
|
|
873
|
+
gray: [90, 39],
|
|
874
|
+
// Alias of `blackBright`
|
|
875
|
+
grey: [90, 39],
|
|
876
|
+
// Alias of `blackBright`
|
|
877
|
+
redBright: [91, 39],
|
|
878
|
+
greenBright: [92, 39],
|
|
879
|
+
yellowBright: [93, 39],
|
|
880
|
+
blueBright: [94, 39],
|
|
881
|
+
magentaBright: [95, 39],
|
|
882
|
+
cyanBright: [96, 39],
|
|
883
|
+
whiteBright: [97, 39]
|
|
884
|
+
},
|
|
885
|
+
bgColor: {
|
|
886
|
+
bgBlack: [40, 49],
|
|
887
|
+
bgRed: [41, 49],
|
|
888
|
+
bgGreen: [42, 49],
|
|
889
|
+
bgYellow: [43, 49],
|
|
890
|
+
bgBlue: [44, 49],
|
|
891
|
+
bgMagenta: [45, 49],
|
|
892
|
+
bgCyan: [46, 49],
|
|
893
|
+
bgWhite: [47, 49],
|
|
894
|
+
// Bright color
|
|
895
|
+
bgBlackBright: [100, 49],
|
|
896
|
+
bgGray: [100, 49],
|
|
897
|
+
// Alias of `bgBlackBright`
|
|
898
|
+
bgGrey: [100, 49],
|
|
899
|
+
// Alias of `bgBlackBright`
|
|
900
|
+
bgRedBright: [101, 49],
|
|
901
|
+
bgGreenBright: [102, 49],
|
|
902
|
+
bgYellowBright: [103, 49],
|
|
903
|
+
bgBlueBright: [104, 49],
|
|
904
|
+
bgMagentaBright: [105, 49],
|
|
905
|
+
bgCyanBright: [106, 49],
|
|
906
|
+
bgWhiteBright: [107, 49]
|
|
907
|
+
}
|
|
908
|
+
};
|
|
909
|
+
var modifierNames = Object.keys(styles.modifier);
|
|
910
|
+
var foregroundColorNames = Object.keys(styles.color);
|
|
911
|
+
var backgroundColorNames = Object.keys(styles.bgColor);
|
|
912
|
+
var colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
|
913
|
+
function assembleStyles() {
|
|
914
|
+
const codes = /* @__PURE__ */ new Map();
|
|
915
|
+
for (const [groupName, group] of Object.entries(styles)) {
|
|
916
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
917
|
+
styles[styleName] = {
|
|
918
|
+
open: `\x1B[${style[0]}m`,
|
|
919
|
+
close: `\x1B[${style[1]}m`
|
|
920
|
+
};
|
|
921
|
+
group[styleName] = styles[styleName];
|
|
922
|
+
codes.set(style[0], style[1]);
|
|
923
|
+
}
|
|
924
|
+
Object.defineProperty(styles, groupName, {
|
|
925
|
+
value: group,
|
|
926
|
+
enumerable: false
|
|
927
|
+
});
|
|
928
|
+
}
|
|
929
|
+
Object.defineProperty(styles, "codes", {
|
|
930
|
+
value: codes,
|
|
931
|
+
enumerable: false
|
|
932
|
+
});
|
|
933
|
+
styles.color.close = "\x1B[39m";
|
|
934
|
+
styles.bgColor.close = "\x1B[49m";
|
|
935
|
+
styles.color.ansi = wrapAnsi16();
|
|
936
|
+
styles.color.ansi256 = wrapAnsi256();
|
|
937
|
+
styles.color.ansi16m = wrapAnsi16m();
|
|
938
|
+
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
939
|
+
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
940
|
+
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
941
|
+
Object.defineProperties(styles, {
|
|
942
|
+
rgbToAnsi256: {
|
|
943
|
+
value(red, green, blue) {
|
|
944
|
+
if (red === green && green === blue) {
|
|
945
|
+
if (red < 8) {
|
|
946
|
+
return 16;
|
|
947
|
+
}
|
|
948
|
+
if (red > 248) {
|
|
949
|
+
return 231;
|
|
950
|
+
}
|
|
951
|
+
return Math.round((red - 8) / 247 * 24) + 232;
|
|
952
|
+
}
|
|
953
|
+
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
954
|
+
},
|
|
955
|
+
enumerable: false
|
|
956
|
+
},
|
|
957
|
+
hexToRgb: {
|
|
958
|
+
value(hex) {
|
|
959
|
+
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
960
|
+
if (!matches) {
|
|
961
|
+
return [0, 0, 0];
|
|
962
|
+
}
|
|
963
|
+
let [colorString] = matches;
|
|
964
|
+
if (colorString.length === 3) {
|
|
965
|
+
colorString = [...colorString].map((character) => character + character).join("");
|
|
966
|
+
}
|
|
967
|
+
const integer = Number.parseInt(colorString, 16);
|
|
968
|
+
return [
|
|
969
|
+
/* eslint-disable no-bitwise */
|
|
970
|
+
integer >> 16 & 255,
|
|
971
|
+
integer >> 8 & 255,
|
|
972
|
+
integer & 255
|
|
973
|
+
/* eslint-enable no-bitwise */
|
|
974
|
+
];
|
|
975
|
+
},
|
|
976
|
+
enumerable: false
|
|
977
|
+
},
|
|
978
|
+
hexToAnsi256: {
|
|
979
|
+
value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
|
980
|
+
enumerable: false
|
|
981
|
+
},
|
|
982
|
+
ansi256ToAnsi: {
|
|
983
|
+
value(code) {
|
|
984
|
+
if (code < 8) {
|
|
985
|
+
return 30 + code;
|
|
986
|
+
}
|
|
987
|
+
if (code < 16) {
|
|
988
|
+
return 90 + (code - 8);
|
|
989
|
+
}
|
|
990
|
+
let red;
|
|
991
|
+
let green;
|
|
992
|
+
let blue;
|
|
993
|
+
if (code >= 232) {
|
|
994
|
+
red = ((code - 232) * 10 + 8) / 255;
|
|
995
|
+
green = red;
|
|
996
|
+
blue = red;
|
|
997
|
+
} else {
|
|
998
|
+
code -= 16;
|
|
999
|
+
const remainder = code % 36;
|
|
1000
|
+
red = Math.floor(code / 36) / 5;
|
|
1001
|
+
green = Math.floor(remainder / 6) / 5;
|
|
1002
|
+
blue = remainder % 6 / 5;
|
|
1003
|
+
}
|
|
1004
|
+
const value = Math.max(red, green, blue) * 2;
|
|
1005
|
+
if (value === 0) {
|
|
1006
|
+
return 30;
|
|
1007
|
+
}
|
|
1008
|
+
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
1009
|
+
if (value === 2) {
|
|
1010
|
+
result += 60;
|
|
1011
|
+
}
|
|
1012
|
+
return result;
|
|
1013
|
+
},
|
|
1014
|
+
enumerable: false
|
|
1015
|
+
},
|
|
1016
|
+
rgbToAnsi: {
|
|
1017
|
+
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
|
|
1018
|
+
enumerable: false
|
|
1019
|
+
},
|
|
1020
|
+
hexToAnsi: {
|
|
1021
|
+
value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
|
|
1022
|
+
enumerable: false
|
|
1023
|
+
}
|
|
1024
|
+
});
|
|
1025
|
+
return styles;
|
|
1026
|
+
}
|
|
1027
|
+
var ansiStyles = assembleStyles();
|
|
1028
|
+
var ansi_styles_default = ansiStyles;
|
|
1029
|
+
|
|
1030
|
+
// node_modules/wrap-ansi/index.js
|
|
1031
|
+
var ESCAPES = /* @__PURE__ */ new Set([
|
|
1032
|
+
"\x1B",
|
|
1033
|
+
"\x9B"
|
|
1034
|
+
]);
|
|
1035
|
+
var END_CODE = 39;
|
|
1036
|
+
var ANSI_ESCAPE_BELL = "\x07";
|
|
1037
|
+
var ANSI_CSI = "[";
|
|
1038
|
+
var ANSI_OSC = "]";
|
|
1039
|
+
var ANSI_SGR_TERMINATOR = "m";
|
|
1040
|
+
var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
|
|
1041
|
+
var wrapAnsiCode = (code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
|
|
1042
|
+
var wrapAnsiHyperlink = (url) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
|
|
1043
|
+
var wordLengths = (string) => string.split(" ").map((character) => stringWidth(character));
|
|
1044
|
+
var wrapWord = (rows, word, columns) => {
|
|
1045
|
+
const characters = [...word];
|
|
1046
|
+
let isInsideEscape = false;
|
|
1047
|
+
let isInsideLinkEscape = false;
|
|
1048
|
+
let visible = stringWidth(stripAnsi(rows.at(-1)));
|
|
1049
|
+
for (const [index, character] of characters.entries()) {
|
|
1050
|
+
const characterLength = stringWidth(character);
|
|
1051
|
+
if (visible + characterLength <= columns) {
|
|
1052
|
+
rows[rows.length - 1] += character;
|
|
1053
|
+
} else {
|
|
1054
|
+
rows.push(character);
|
|
1055
|
+
visible = 0;
|
|
1056
|
+
}
|
|
1057
|
+
if (ESCAPES.has(character)) {
|
|
1058
|
+
isInsideEscape = true;
|
|
1059
|
+
const ansiEscapeLinkCandidate = characters.slice(index + 1, index + 1 + ANSI_ESCAPE_LINK.length).join("");
|
|
1060
|
+
isInsideLinkEscape = ansiEscapeLinkCandidate === ANSI_ESCAPE_LINK;
|
|
1061
|
+
}
|
|
1062
|
+
if (isInsideEscape) {
|
|
1063
|
+
if (isInsideLinkEscape) {
|
|
1064
|
+
if (character === ANSI_ESCAPE_BELL) {
|
|
1065
|
+
isInsideEscape = false;
|
|
1066
|
+
isInsideLinkEscape = false;
|
|
1067
|
+
}
|
|
1068
|
+
} else if (character === ANSI_SGR_TERMINATOR) {
|
|
1069
|
+
isInsideEscape = false;
|
|
1070
|
+
}
|
|
1071
|
+
continue;
|
|
1072
|
+
}
|
|
1073
|
+
visible += characterLength;
|
|
1074
|
+
if (visible === columns && index < characters.length - 1) {
|
|
1075
|
+
rows.push("");
|
|
1076
|
+
visible = 0;
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
if (!visible && rows.at(-1).length > 0 && rows.length > 1) {
|
|
1080
|
+
rows[rows.length - 2] += rows.pop();
|
|
1081
|
+
}
|
|
1082
|
+
};
|
|
1083
|
+
var stringVisibleTrimSpacesRight = (string) => {
|
|
1084
|
+
const words = string.split(" ");
|
|
1085
|
+
let last = words.length;
|
|
1086
|
+
while (last > 0) {
|
|
1087
|
+
if (stringWidth(words[last - 1]) > 0) {
|
|
1088
|
+
break;
|
|
1089
|
+
}
|
|
1090
|
+
last--;
|
|
1091
|
+
}
|
|
1092
|
+
if (last === words.length) {
|
|
1093
|
+
return string;
|
|
1094
|
+
}
|
|
1095
|
+
return words.slice(0, last).join(" ") + words.slice(last).join("");
|
|
1096
|
+
};
|
|
1097
|
+
var exec = (string, columns, options = {}) => {
|
|
1098
|
+
if (options.trim !== false && string.trim() === "") {
|
|
1099
|
+
return "";
|
|
1100
|
+
}
|
|
1101
|
+
let returnValue = "";
|
|
1102
|
+
let escapeCode;
|
|
1103
|
+
let escapeUrl;
|
|
1104
|
+
const lengths = wordLengths(string);
|
|
1105
|
+
let rows = [""];
|
|
1106
|
+
for (const [index, word] of string.split(" ").entries()) {
|
|
1107
|
+
if (options.trim !== false) {
|
|
1108
|
+
rows[rows.length - 1] = rows.at(-1).trimStart();
|
|
1109
|
+
}
|
|
1110
|
+
let rowLength = stringWidth(rows.at(-1));
|
|
1111
|
+
if (index !== 0) {
|
|
1112
|
+
if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
|
|
1113
|
+
rows.push("");
|
|
1114
|
+
rowLength = 0;
|
|
1115
|
+
}
|
|
1116
|
+
if (rowLength > 0 || options.trim === false) {
|
|
1117
|
+
rows[rows.length - 1] += " ";
|
|
1118
|
+
rowLength++;
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
if (options.hard && lengths[index] > columns) {
|
|
1122
|
+
const remainingColumns = columns - rowLength;
|
|
1123
|
+
const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
|
|
1124
|
+
const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);
|
|
1125
|
+
if (breaksStartingNextLine < breaksStartingThisLine) {
|
|
1126
|
+
rows.push("");
|
|
1127
|
+
}
|
|
1128
|
+
wrapWord(rows, word, columns);
|
|
1129
|
+
continue;
|
|
1130
|
+
}
|
|
1131
|
+
if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {
|
|
1132
|
+
if (options.wordWrap === false && rowLength < columns) {
|
|
1133
|
+
wrapWord(rows, word, columns);
|
|
1134
|
+
continue;
|
|
1135
|
+
}
|
|
1136
|
+
rows.push("");
|
|
1137
|
+
}
|
|
1138
|
+
if (rowLength + lengths[index] > columns && options.wordWrap === false) {
|
|
1139
|
+
wrapWord(rows, word, columns);
|
|
1140
|
+
continue;
|
|
1141
|
+
}
|
|
1142
|
+
rows[rows.length - 1] += word;
|
|
1143
|
+
}
|
|
1144
|
+
if (options.trim !== false) {
|
|
1145
|
+
rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
|
|
1146
|
+
}
|
|
1147
|
+
const preString = rows.join("\n");
|
|
1148
|
+
const pre = [...preString];
|
|
1149
|
+
let preStringIndex = 0;
|
|
1150
|
+
for (const [index, character] of pre.entries()) {
|
|
1151
|
+
returnValue += character;
|
|
1152
|
+
if (ESCAPES.has(character)) {
|
|
1153
|
+
const { groups } = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(preString.slice(preStringIndex)) || { groups: {} };
|
|
1154
|
+
if (groups.code !== void 0) {
|
|
1155
|
+
const code2 = Number.parseFloat(groups.code);
|
|
1156
|
+
escapeCode = code2 === END_CODE ? void 0 : code2;
|
|
1157
|
+
} else if (groups.uri !== void 0) {
|
|
1158
|
+
escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
const code = ansi_styles_default.codes.get(Number(escapeCode));
|
|
1162
|
+
if (pre[index + 1] === "\n") {
|
|
1163
|
+
if (escapeUrl) {
|
|
1164
|
+
returnValue += wrapAnsiHyperlink("");
|
|
1165
|
+
}
|
|
1166
|
+
if (escapeCode && code) {
|
|
1167
|
+
returnValue += wrapAnsiCode(code);
|
|
1168
|
+
}
|
|
1169
|
+
} else if (character === "\n") {
|
|
1170
|
+
if (escapeCode && code) {
|
|
1171
|
+
returnValue += wrapAnsiCode(escapeCode);
|
|
1172
|
+
}
|
|
1173
|
+
if (escapeUrl) {
|
|
1174
|
+
returnValue += wrapAnsiHyperlink(escapeUrl);
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
preStringIndex += character.length;
|
|
1178
|
+
}
|
|
1179
|
+
return returnValue;
|
|
1180
|
+
};
|
|
1181
|
+
function wrapAnsi(string, columns, options) {
|
|
1182
|
+
return String(string).normalize().replaceAll("\r\n", "\n").split("\n").map((line) => exec(line, columns, options)).join("\n");
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
// node_modules/@inquirer/core/dist/lib/utils.js
|
|
1186
|
+
function breakLines(content, width) {
|
|
1187
|
+
return content.split("\n").flatMap((line) => wrapAnsi(line, width, { trim: false, hard: true }).split("\n").map((str) => str.trimEnd())).join("\n");
|
|
1188
|
+
}
|
|
1189
|
+
function readlineWidth() {
|
|
1190
|
+
return (0, import_cli_width.default)({ defaultWidth: 80, output: readline().output });
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
// node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
1194
|
+
var import_mute_stream = __toESM(require_lib(), 1);
|
|
1195
|
+
import * as readline2 from "readline";
|
|
1196
|
+
import { AsyncResource as AsyncResource3 } from "async_hooks";
|
|
1197
|
+
|
|
1198
|
+
// node_modules/signal-exit/dist/mjs/signals.js
|
|
1199
|
+
var signals = [];
|
|
1200
|
+
signals.push("SIGHUP", "SIGINT", "SIGTERM");
|
|
1201
|
+
if (process.platform !== "win32") {
|
|
1202
|
+
signals.push(
|
|
1203
|
+
"SIGALRM",
|
|
1204
|
+
"SIGABRT",
|
|
1205
|
+
"SIGVTALRM",
|
|
1206
|
+
"SIGXCPU",
|
|
1207
|
+
"SIGXFSZ",
|
|
1208
|
+
"SIGUSR2",
|
|
1209
|
+
"SIGTRAP",
|
|
1210
|
+
"SIGSYS",
|
|
1211
|
+
"SIGQUIT",
|
|
1212
|
+
"SIGIOT"
|
|
1213
|
+
// should detect profiler and enable/disable accordingly.
|
|
1214
|
+
// see #21
|
|
1215
|
+
// 'SIGPROF'
|
|
1216
|
+
);
|
|
1217
|
+
}
|
|
1218
|
+
if (process.platform === "linux") {
|
|
1219
|
+
signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
// node_modules/signal-exit/dist/mjs/index.js
|
|
1223
|
+
var processOk = (process4) => !!process4 && typeof process4 === "object" && typeof process4.removeListener === "function" && typeof process4.emit === "function" && typeof process4.reallyExit === "function" && typeof process4.listeners === "function" && typeof process4.kill === "function" && typeof process4.pid === "number" && typeof process4.on === "function";
|
|
1224
|
+
var kExitEmitter = /* @__PURE__ */ Symbol.for("signal-exit emitter");
|
|
1225
|
+
var global = globalThis;
|
|
1226
|
+
var ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
1227
|
+
var Emitter = class {
|
|
1228
|
+
emitted = {
|
|
1229
|
+
afterExit: false,
|
|
1230
|
+
exit: false
|
|
1231
|
+
};
|
|
1232
|
+
listeners = {
|
|
1233
|
+
afterExit: [],
|
|
1234
|
+
exit: []
|
|
1235
|
+
};
|
|
1236
|
+
count = 0;
|
|
1237
|
+
id = Math.random();
|
|
1238
|
+
constructor() {
|
|
1239
|
+
if (global[kExitEmitter]) {
|
|
1240
|
+
return global[kExitEmitter];
|
|
1241
|
+
}
|
|
1242
|
+
ObjectDefineProperty(global, kExitEmitter, {
|
|
1243
|
+
value: this,
|
|
1244
|
+
writable: false,
|
|
1245
|
+
enumerable: false,
|
|
1246
|
+
configurable: false
|
|
1247
|
+
});
|
|
1248
|
+
}
|
|
1249
|
+
on(ev, fn) {
|
|
1250
|
+
this.listeners[ev].push(fn);
|
|
1251
|
+
}
|
|
1252
|
+
removeListener(ev, fn) {
|
|
1253
|
+
const list = this.listeners[ev];
|
|
1254
|
+
const i = list.indexOf(fn);
|
|
1255
|
+
if (i === -1) {
|
|
1256
|
+
return;
|
|
1257
|
+
}
|
|
1258
|
+
if (i === 0 && list.length === 1) {
|
|
1259
|
+
list.length = 0;
|
|
1260
|
+
} else {
|
|
1261
|
+
list.splice(i, 1);
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
emit(ev, code, signal) {
|
|
1265
|
+
if (this.emitted[ev]) {
|
|
1266
|
+
return false;
|
|
1267
|
+
}
|
|
1268
|
+
this.emitted[ev] = true;
|
|
1269
|
+
let ret = false;
|
|
1270
|
+
for (const fn of this.listeners[ev]) {
|
|
1271
|
+
ret = fn(code, signal) === true || ret;
|
|
1272
|
+
}
|
|
1273
|
+
if (ev === "exit") {
|
|
1274
|
+
ret = this.emit("afterExit", code, signal) || ret;
|
|
1275
|
+
}
|
|
1276
|
+
return ret;
|
|
1277
|
+
}
|
|
1278
|
+
};
|
|
1279
|
+
var SignalExitBase = class {
|
|
1280
|
+
};
|
|
1281
|
+
var signalExitWrap = (handler) => {
|
|
1282
|
+
return {
|
|
1283
|
+
onExit(cb, opts) {
|
|
1284
|
+
return handler.onExit(cb, opts);
|
|
1285
|
+
},
|
|
1286
|
+
load() {
|
|
1287
|
+
return handler.load();
|
|
1288
|
+
},
|
|
1289
|
+
unload() {
|
|
1290
|
+
return handler.unload();
|
|
1291
|
+
}
|
|
1292
|
+
};
|
|
1293
|
+
};
|
|
1294
|
+
var SignalExitFallback = class extends SignalExitBase {
|
|
1295
|
+
onExit() {
|
|
1296
|
+
return () => {
|
|
1297
|
+
};
|
|
1298
|
+
}
|
|
1299
|
+
load() {
|
|
1300
|
+
}
|
|
1301
|
+
unload() {
|
|
1302
|
+
}
|
|
1303
|
+
};
|
|
1304
|
+
var SignalExit = class extends SignalExitBase {
|
|
1305
|
+
// "SIGHUP" throws an `ENOSYS` error on Windows,
|
|
1306
|
+
// so use a supported signal instead
|
|
1307
|
+
/* c8 ignore start */
|
|
1308
|
+
#hupSig = process3.platform === "win32" ? "SIGINT" : "SIGHUP";
|
|
1309
|
+
/* c8 ignore stop */
|
|
1310
|
+
#emitter = new Emitter();
|
|
1311
|
+
#process;
|
|
1312
|
+
#originalProcessEmit;
|
|
1313
|
+
#originalProcessReallyExit;
|
|
1314
|
+
#sigListeners = {};
|
|
1315
|
+
#loaded = false;
|
|
1316
|
+
constructor(process4) {
|
|
1317
|
+
super();
|
|
1318
|
+
this.#process = process4;
|
|
1319
|
+
this.#sigListeners = {};
|
|
1320
|
+
for (const sig of signals) {
|
|
1321
|
+
this.#sigListeners[sig] = () => {
|
|
1322
|
+
const listeners = this.#process.listeners(sig);
|
|
1323
|
+
let { count } = this.#emitter;
|
|
1324
|
+
const p = process4;
|
|
1325
|
+
if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
|
|
1326
|
+
count += p.__signal_exit_emitter__.count;
|
|
1327
|
+
}
|
|
1328
|
+
if (listeners.length === count) {
|
|
1329
|
+
this.unload();
|
|
1330
|
+
const ret = this.#emitter.emit("exit", null, sig);
|
|
1331
|
+
const s = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
1332
|
+
if (!ret)
|
|
1333
|
+
process4.kill(process4.pid, s);
|
|
1334
|
+
}
|
|
1335
|
+
};
|
|
1336
|
+
}
|
|
1337
|
+
this.#originalProcessReallyExit = process4.reallyExit;
|
|
1338
|
+
this.#originalProcessEmit = process4.emit;
|
|
1339
|
+
}
|
|
1340
|
+
onExit(cb, opts) {
|
|
1341
|
+
if (!processOk(this.#process)) {
|
|
1342
|
+
return () => {
|
|
1343
|
+
};
|
|
1344
|
+
}
|
|
1345
|
+
if (this.#loaded === false) {
|
|
1346
|
+
this.load();
|
|
1347
|
+
}
|
|
1348
|
+
const ev = opts?.alwaysLast ? "afterExit" : "exit";
|
|
1349
|
+
this.#emitter.on(ev, cb);
|
|
1350
|
+
return () => {
|
|
1351
|
+
this.#emitter.removeListener(ev, cb);
|
|
1352
|
+
if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) {
|
|
1353
|
+
this.unload();
|
|
1354
|
+
}
|
|
1355
|
+
};
|
|
1356
|
+
}
|
|
1357
|
+
load() {
|
|
1358
|
+
if (this.#loaded) {
|
|
1359
|
+
return;
|
|
1360
|
+
}
|
|
1361
|
+
this.#loaded = true;
|
|
1362
|
+
this.#emitter.count += 1;
|
|
1363
|
+
for (const sig of signals) {
|
|
1364
|
+
try {
|
|
1365
|
+
const fn = this.#sigListeners[sig];
|
|
1366
|
+
if (fn)
|
|
1367
|
+
this.#process.on(sig, fn);
|
|
1368
|
+
} catch (_) {
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
this.#process.emit = (ev, ...a) => {
|
|
1372
|
+
return this.#processEmit(ev, ...a);
|
|
1373
|
+
};
|
|
1374
|
+
this.#process.reallyExit = (code) => {
|
|
1375
|
+
return this.#processReallyExit(code);
|
|
1376
|
+
};
|
|
1377
|
+
}
|
|
1378
|
+
unload() {
|
|
1379
|
+
if (!this.#loaded) {
|
|
1380
|
+
return;
|
|
1381
|
+
}
|
|
1382
|
+
this.#loaded = false;
|
|
1383
|
+
signals.forEach((sig) => {
|
|
1384
|
+
const listener = this.#sigListeners[sig];
|
|
1385
|
+
if (!listener) {
|
|
1386
|
+
throw new Error("Listener not defined for signal: " + sig);
|
|
1387
|
+
}
|
|
1388
|
+
try {
|
|
1389
|
+
this.#process.removeListener(sig, listener);
|
|
1390
|
+
} catch (_) {
|
|
1391
|
+
}
|
|
1392
|
+
});
|
|
1393
|
+
this.#process.emit = this.#originalProcessEmit;
|
|
1394
|
+
this.#process.reallyExit = this.#originalProcessReallyExit;
|
|
1395
|
+
this.#emitter.count -= 1;
|
|
1396
|
+
}
|
|
1397
|
+
#processReallyExit(code) {
|
|
1398
|
+
if (!processOk(this.#process)) {
|
|
1399
|
+
return 0;
|
|
1400
|
+
}
|
|
1401
|
+
this.#process.exitCode = code || 0;
|
|
1402
|
+
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
1403
|
+
return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
|
|
1404
|
+
}
|
|
1405
|
+
#processEmit(ev, ...args) {
|
|
1406
|
+
const og = this.#originalProcessEmit;
|
|
1407
|
+
if (ev === "exit" && processOk(this.#process)) {
|
|
1408
|
+
if (typeof args[0] === "number") {
|
|
1409
|
+
this.#process.exitCode = args[0];
|
|
1410
|
+
}
|
|
1411
|
+
const ret = og.call(this.#process, ev, ...args);
|
|
1412
|
+
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
1413
|
+
return ret;
|
|
1414
|
+
} else {
|
|
1415
|
+
return og.call(this.#process, ev, ...args);
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
};
|
|
1419
|
+
var process3 = globalThis.process;
|
|
1420
|
+
var {
|
|
1421
|
+
/**
|
|
1422
|
+
* Called when the process is exiting, whether via signal, explicit
|
|
1423
|
+
* exit, or running out of stuff to do.
|
|
1424
|
+
*
|
|
1425
|
+
* If the global process object is not suitable for instrumentation,
|
|
1426
|
+
* then this will be a no-op.
|
|
1427
|
+
*
|
|
1428
|
+
* Returns a function that may be used to unload signal-exit.
|
|
1429
|
+
*/
|
|
1430
|
+
onExit,
|
|
1431
|
+
/**
|
|
1432
|
+
* Load the listeners. Likely you never need to call this, unless
|
|
1433
|
+
* doing a rather deep integration with signal-exit functionality.
|
|
1434
|
+
* Mostly exposed for the benefit of testing.
|
|
1435
|
+
*
|
|
1436
|
+
* @internal
|
|
1437
|
+
*/
|
|
1438
|
+
load,
|
|
1439
|
+
/**
|
|
1440
|
+
* Unload the listeners. Likely you never need to call this, unless
|
|
1441
|
+
* doing a rather deep integration with signal-exit functionality.
|
|
1442
|
+
* Mostly exposed for the benefit of testing.
|
|
1443
|
+
*
|
|
1444
|
+
* @internal
|
|
1445
|
+
*/
|
|
1446
|
+
unload
|
|
1447
|
+
} = signalExitWrap(processOk(process3) ? new SignalExit(process3) : new SignalExitFallback());
|
|
1448
|
+
|
|
1449
|
+
// node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
1450
|
+
import { stripVTControlCharacters } from "util";
|
|
1451
|
+
|
|
1452
|
+
// node_modules/@inquirer/ansi/dist/index.js
|
|
1453
|
+
var ESC = "\x1B[";
|
|
1454
|
+
var cursorLeft = ESC + "G";
|
|
1455
|
+
var cursorHide = ESC + "?25l";
|
|
1456
|
+
var cursorShow = ESC + "?25h";
|
|
1457
|
+
var cursorUp = (rows = 1) => rows > 0 ? `${ESC}${rows}A` : "";
|
|
1458
|
+
var cursorDown = (rows = 1) => rows > 0 ? `${ESC}${rows}B` : "";
|
|
1459
|
+
var cursorTo = (x, y) => {
|
|
1460
|
+
if (typeof y === "number" && !Number.isNaN(y)) {
|
|
1461
|
+
return `${ESC}${y + 1};${x + 1}H`;
|
|
1462
|
+
}
|
|
1463
|
+
return `${ESC}${x + 1}G`;
|
|
1464
|
+
};
|
|
1465
|
+
var eraseLine = ESC + "2K";
|
|
1466
|
+
var eraseLines = (lines) => lines > 0 ? (eraseLine + cursorUp(1)).repeat(lines - 1) + eraseLine + cursorLeft : "";
|
|
1467
|
+
|
|
1468
|
+
// node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
1469
|
+
var height = (content) => content.split("\n").length;
|
|
1470
|
+
var lastLine = (content) => content.split("\n").pop() ?? "";
|
|
1471
|
+
var ScreenManager = class {
|
|
1472
|
+
// These variables are keeping information to allow correct prompt re-rendering
|
|
1473
|
+
height = 0;
|
|
1474
|
+
extraLinesUnderPrompt = 0;
|
|
1475
|
+
cursorPos;
|
|
1476
|
+
rl;
|
|
1477
|
+
constructor(rl) {
|
|
1478
|
+
this.rl = rl;
|
|
1479
|
+
this.cursorPos = rl.getCursorPos();
|
|
1480
|
+
}
|
|
1481
|
+
write(content) {
|
|
1482
|
+
this.rl.output.unmute();
|
|
1483
|
+
this.rl.output.write(content);
|
|
1484
|
+
this.rl.output.mute();
|
|
1485
|
+
}
|
|
1486
|
+
render(content, bottomContent = "") {
|
|
1487
|
+
const promptLine = lastLine(content);
|
|
1488
|
+
const rawPromptLine = stripVTControlCharacters(promptLine);
|
|
1489
|
+
let prompt = rawPromptLine;
|
|
1490
|
+
if (this.rl.line.length > 0) {
|
|
1491
|
+
prompt = prompt.slice(0, -this.rl.line.length);
|
|
1492
|
+
}
|
|
1493
|
+
this.rl.setPrompt(prompt);
|
|
1494
|
+
this.cursorPos = this.rl.getCursorPos();
|
|
1495
|
+
const width = readlineWidth();
|
|
1496
|
+
content = breakLines(content, width);
|
|
1497
|
+
bottomContent = breakLines(bottomContent, width);
|
|
1498
|
+
if (rawPromptLine.length % width === 0) {
|
|
1499
|
+
content += "\n";
|
|
1500
|
+
}
|
|
1501
|
+
let output = content + (bottomContent ? "\n" + bottomContent : "");
|
|
1502
|
+
const promptLineUpDiff = Math.floor(rawPromptLine.length / width) - this.cursorPos.rows;
|
|
1503
|
+
const bottomContentHeight = promptLineUpDiff + (bottomContent ? height(bottomContent) : 0);
|
|
1504
|
+
if (bottomContentHeight > 0)
|
|
1505
|
+
output += cursorUp(bottomContentHeight);
|
|
1506
|
+
output += cursorTo(this.cursorPos.cols);
|
|
1507
|
+
this.write(cursorDown(this.extraLinesUnderPrompt) + eraseLines(this.height) + output);
|
|
1508
|
+
this.extraLinesUnderPrompt = bottomContentHeight;
|
|
1509
|
+
this.height = height(output);
|
|
1510
|
+
}
|
|
1511
|
+
checkCursorPos() {
|
|
1512
|
+
const cursorPos = this.rl.getCursorPos();
|
|
1513
|
+
if (cursorPos.cols !== this.cursorPos.cols) {
|
|
1514
|
+
this.write(cursorTo(cursorPos.cols));
|
|
1515
|
+
this.cursorPos = cursorPos;
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
done({ clearContent }) {
|
|
1519
|
+
this.rl.setPrompt("");
|
|
1520
|
+
let output = cursorDown(this.extraLinesUnderPrompt);
|
|
1521
|
+
output += clearContent ? eraseLines(this.height) : "\n";
|
|
1522
|
+
output += cursorShow;
|
|
1523
|
+
this.write(output);
|
|
1524
|
+
this.rl.close();
|
|
1525
|
+
}
|
|
1526
|
+
};
|
|
1527
|
+
|
|
1528
|
+
// node_modules/@inquirer/core/dist/lib/promise-polyfill.js
|
|
1529
|
+
var PromisePolyfill = class extends Promise {
|
|
1530
|
+
// Available starting from Node 22
|
|
1531
|
+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers
|
|
1532
|
+
static withResolver() {
|
|
1533
|
+
let resolve;
|
|
1534
|
+
let reject;
|
|
1535
|
+
const promise = new Promise((res, rej) => {
|
|
1536
|
+
resolve = res;
|
|
1537
|
+
reject = rej;
|
|
1538
|
+
});
|
|
1539
|
+
return { promise, resolve, reject };
|
|
1540
|
+
}
|
|
1541
|
+
};
|
|
1542
|
+
|
|
1543
|
+
// node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
1544
|
+
function getCallSites() {
|
|
1545
|
+
const _prepareStackTrace = Error.prepareStackTrace;
|
|
1546
|
+
let result = [];
|
|
1547
|
+
try {
|
|
1548
|
+
Error.prepareStackTrace = (_, callSites) => {
|
|
1549
|
+
const callSitesWithoutCurrent = callSites.slice(1);
|
|
1550
|
+
result = callSitesWithoutCurrent;
|
|
1551
|
+
return callSitesWithoutCurrent;
|
|
1552
|
+
};
|
|
1553
|
+
new Error().stack;
|
|
1554
|
+
} catch {
|
|
1555
|
+
return result;
|
|
1556
|
+
}
|
|
1557
|
+
Error.prepareStackTrace = _prepareStackTrace;
|
|
1558
|
+
return result;
|
|
1559
|
+
}
|
|
1560
|
+
function createPrompt(view) {
|
|
1561
|
+
const callSites = getCallSites();
|
|
1562
|
+
const prompt = (config, context = {}) => {
|
|
1563
|
+
const { input = process.stdin, signal } = context;
|
|
1564
|
+
const cleanups = /* @__PURE__ */ new Set();
|
|
1565
|
+
const output = new import_mute_stream.default();
|
|
1566
|
+
output.pipe(context.output ?? process.stdout);
|
|
1567
|
+
const rl = readline2.createInterface({
|
|
1568
|
+
terminal: true,
|
|
1569
|
+
input,
|
|
1570
|
+
output
|
|
1571
|
+
});
|
|
1572
|
+
const screen = new ScreenManager(rl);
|
|
1573
|
+
const { promise, resolve, reject } = PromisePolyfill.withResolver();
|
|
1574
|
+
const cancel = () => reject(new CancelPromptError());
|
|
1575
|
+
if (signal) {
|
|
1576
|
+
const abort = () => reject(new AbortPromptError({ cause: signal.reason }));
|
|
1577
|
+
if (signal.aborted) {
|
|
1578
|
+
abort();
|
|
1579
|
+
return Object.assign(promise, { cancel });
|
|
1580
|
+
}
|
|
1581
|
+
signal.addEventListener("abort", abort);
|
|
1582
|
+
cleanups.add(() => signal.removeEventListener("abort", abort));
|
|
1583
|
+
}
|
|
1584
|
+
cleanups.add(onExit((code, signal2) => {
|
|
1585
|
+
reject(new ExitPromptError(`User force closed the prompt with ${code} ${signal2}`));
|
|
1586
|
+
}));
|
|
1587
|
+
const sigint = () => reject(new ExitPromptError(`User force closed the prompt with SIGINT`));
|
|
1588
|
+
rl.on("SIGINT", sigint);
|
|
1589
|
+
cleanups.add(() => rl.removeListener("SIGINT", sigint));
|
|
1590
|
+
const checkCursorPos = () => screen.checkCursorPos();
|
|
1591
|
+
rl.input.on("keypress", checkCursorPos);
|
|
1592
|
+
cleanups.add(() => rl.input.removeListener("keypress", checkCursorPos));
|
|
1593
|
+
return withHooks(rl, (cycle) => {
|
|
1594
|
+
const hooksCleanup = AsyncResource3.bind(() => effectScheduler.clearAll());
|
|
1595
|
+
rl.on("close", hooksCleanup);
|
|
1596
|
+
cleanups.add(() => rl.removeListener("close", hooksCleanup));
|
|
1597
|
+
cycle(() => {
|
|
1598
|
+
try {
|
|
1599
|
+
const nextView = view(config, (value) => {
|
|
1600
|
+
setImmediate(() => resolve(value));
|
|
1601
|
+
});
|
|
1602
|
+
if (nextView === void 0) {
|
|
1603
|
+
const callerFilename = callSites[1]?.getFileName();
|
|
1604
|
+
throw new Error(`Prompt functions must return a string.
|
|
1605
|
+
at ${callerFilename}`);
|
|
1606
|
+
}
|
|
1607
|
+
const [content, bottomContent] = typeof nextView === "string" ? [nextView] : nextView;
|
|
1608
|
+
screen.render(content, bottomContent);
|
|
1609
|
+
effectScheduler.run();
|
|
1610
|
+
} catch (error) {
|
|
1611
|
+
reject(error);
|
|
1612
|
+
}
|
|
1613
|
+
});
|
|
1614
|
+
return Object.assign(promise.then((answer) => {
|
|
1615
|
+
effectScheduler.clearAll();
|
|
1616
|
+
return answer;
|
|
1617
|
+
}, (error) => {
|
|
1618
|
+
effectScheduler.clearAll();
|
|
1619
|
+
throw error;
|
|
1620
|
+
}).finally(() => {
|
|
1621
|
+
cleanups.forEach((cleanup) => cleanup());
|
|
1622
|
+
screen.done({ clearContent: Boolean(context.clearPromptOnDone) });
|
|
1623
|
+
output.end();
|
|
1624
|
+
}).then(() => promise), { cancel });
|
|
1625
|
+
});
|
|
1626
|
+
};
|
|
1627
|
+
return prompt;
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1630
|
+
// node_modules/@inquirer/confirm/dist/index.js
|
|
1631
|
+
function getBooleanValue(value, defaultValue) {
|
|
1632
|
+
let answer = defaultValue !== false;
|
|
1633
|
+
if (/^(y|yes)/i.test(value))
|
|
1634
|
+
answer = true;
|
|
1635
|
+
else if (/^(n|no)/i.test(value))
|
|
1636
|
+
answer = false;
|
|
1637
|
+
return answer;
|
|
1638
|
+
}
|
|
1639
|
+
function boolToString(value) {
|
|
1640
|
+
return value ? "Yes" : "No";
|
|
1641
|
+
}
|
|
1642
|
+
var dist_default2 = createPrompt((config, done) => {
|
|
1643
|
+
const { transformer = boolToString } = config;
|
|
1644
|
+
const [status, setStatus] = useState("idle");
|
|
1645
|
+
const [value, setValue] = useState("");
|
|
1646
|
+
const theme = makeTheme(config.theme);
|
|
1647
|
+
const prefix = usePrefix({ status, theme });
|
|
1648
|
+
useKeypress((key, rl) => {
|
|
1649
|
+
if (status !== "idle")
|
|
1650
|
+
return;
|
|
1651
|
+
if (isEnterKey(key)) {
|
|
1652
|
+
const answer = getBooleanValue(value, config.default);
|
|
1653
|
+
setValue(transformer(answer));
|
|
1654
|
+
setStatus("done");
|
|
1655
|
+
done(answer);
|
|
1656
|
+
} else if (isTabKey(key)) {
|
|
1657
|
+
const answer = boolToString(!getBooleanValue(value, config.default));
|
|
1658
|
+
rl.clearLine(0);
|
|
1659
|
+
rl.write(answer);
|
|
1660
|
+
setValue(answer);
|
|
1661
|
+
} else {
|
|
1662
|
+
setValue(rl.line);
|
|
1663
|
+
}
|
|
1664
|
+
});
|
|
1665
|
+
let formattedValue = value;
|
|
1666
|
+
let defaultValue = "";
|
|
1667
|
+
if (status === "done") {
|
|
1668
|
+
formattedValue = theme.style.answer(value);
|
|
1669
|
+
} else {
|
|
1670
|
+
defaultValue = ` ${theme.style.defaultAnswer(config.default === false ? "y/N" : "Y/n")}`;
|
|
1671
|
+
}
|
|
1672
|
+
const message = theme.style.message(config.message, status);
|
|
1673
|
+
return `${prefix} ${message}${defaultValue} ${formattedValue}`;
|
|
1674
|
+
});
|
|
1675
|
+
|
|
1676
|
+
// src/cli/commands/remove.ts
|
|
1677
|
+
async function removeCommand(pluginName) {
|
|
1678
|
+
try {
|
|
1679
|
+
const ctx = await detectContext(process.cwd());
|
|
1680
|
+
const tracker = new PluginTracker(ctx.projectRoot);
|
|
1681
|
+
await tracker.load();
|
|
1682
|
+
if (!pluginName) {
|
|
1683
|
+
console.log("\n\u274C Please specify a plugin name to remove.\n");
|
|
1684
|
+
console.log("Usage: configjs remove <plugin-name>\n");
|
|
1685
|
+
console.log("Example: configjs remove react-router\n");
|
|
1686
|
+
process.exit(1);
|
|
1687
|
+
}
|
|
1688
|
+
const plugin = tracker.getPlugin(pluginName);
|
|
1689
|
+
if (!plugin) {
|
|
1690
|
+
console.log(`
|
|
1691
|
+
\u274C Plugin '${pluginName}' is not installed.
|
|
1692
|
+
`);
|
|
1693
|
+
console.log("Run `configjs installed` to see installed plugins.\n");
|
|
1694
|
+
process.exit(1);
|
|
1695
|
+
}
|
|
1696
|
+
console.log(`
|
|
1697
|
+
\u26A0\uFE0F You are about to remove: ${plugin.displayName}
|
|
1698
|
+
`);
|
|
1699
|
+
console.log(
|
|
1700
|
+
"\u26A0\uFE0F WARNING: This will only untrack the plugin from the config."
|
|
1701
|
+
);
|
|
1702
|
+
console.log(" You will need to manually:");
|
|
1703
|
+
console.log(" - Remove the packages (npm uninstall ...)");
|
|
1704
|
+
console.log(" - Delete the generated files");
|
|
1705
|
+
console.log(" - Clean up the configuration\n");
|
|
1706
|
+
const confirmed = await dist_default2({
|
|
1707
|
+
message: "Continue?",
|
|
1708
|
+
default: false
|
|
1709
|
+
});
|
|
1710
|
+
if (!confirmed) {
|
|
1711
|
+
console.log("\n\u274C Cancelled.\n");
|
|
1712
|
+
return;
|
|
1713
|
+
}
|
|
1714
|
+
await tracker.removePlugin(pluginName);
|
|
1715
|
+
console.log(`
|
|
1716
|
+
\u2705 ${plugin.displayName} has been removed from tracking.
|
|
1717
|
+
`);
|
|
1718
|
+
console.log("\u{1F4DD} Manual cleanup required:");
|
|
1719
|
+
if (plugin.packages.dependencies && plugin.packages.dependencies.length > 0) {
|
|
1720
|
+
console.log(` npm uninstall ${plugin.packages.dependencies.join(" ")}`);
|
|
1721
|
+
}
|
|
1722
|
+
if (plugin.packages.devDependencies && plugin.packages.devDependencies.length > 0) {
|
|
1723
|
+
console.log(
|
|
1724
|
+
` npm uninstall ${plugin.packages.devDependencies.join(" ")}`
|
|
1725
|
+
);
|
|
1726
|
+
}
|
|
1727
|
+
console.log();
|
|
1728
|
+
} catch (error) {
|
|
1729
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
1730
|
+
logger.error(`Failed to remove plugin: ${errorMessage}`);
|
|
1731
|
+
process.exit(1);
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
export {
|
|
1735
|
+
removeCommand
|
|
1736
|
+
};
|