@webhouse/cms-cli 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,3028 @@
1
+ #!/usr/bin/env node
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __esm = (fn, res) => function __init() {
9
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
10
+ };
11
+ var __commonJS = (cb, mod) => function __require() {
12
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
13
+ };
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
27
+ // If the importer is in node compatibility mode or this is not an ESM
28
+ // file that has been converted to a CommonJS file using a Babel-
29
+ // compatible transform (i.e. "__esModule" has not been set), then set
30
+ // "default" to the CommonJS "module.exports" for node compatibility.
31
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
32
+ mod
33
+ ));
34
+
35
+ // ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/chunks/prompt.mjs
36
+ var prompt_exports = {};
37
+ __export(prompt_exports, {
38
+ kCancel: () => kCancel,
39
+ prompt: () => prompt
40
+ });
41
+ import "util";
42
+ import g, { stdin, stdout } from "process";
43
+ import f from "readline";
44
+ import { WriteStream } from "tty";
45
+ function getDefaultExportFromCjs(x2) {
46
+ return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
47
+ }
48
+ function requireSrc() {
49
+ if (hasRequiredSrc) return src;
50
+ hasRequiredSrc = 1;
51
+ const ESC = "\x1B";
52
+ const CSI = `${ESC}[`;
53
+ const beep = "\x07";
54
+ const cursor = {
55
+ to(x2, y3) {
56
+ if (!y3) return `${CSI}${x2 + 1}G`;
57
+ return `${CSI}${y3 + 1};${x2 + 1}H`;
58
+ },
59
+ move(x2, y3) {
60
+ let ret = "";
61
+ if (x2 < 0) ret += `${CSI}${-x2}D`;
62
+ else if (x2 > 0) ret += `${CSI}${x2}C`;
63
+ if (y3 < 0) ret += `${CSI}${-y3}A`;
64
+ else if (y3 > 0) ret += `${CSI}${y3}B`;
65
+ return ret;
66
+ },
67
+ up: (count = 1) => `${CSI}${count}A`,
68
+ down: (count = 1) => `${CSI}${count}B`,
69
+ forward: (count = 1) => `${CSI}${count}C`,
70
+ backward: (count = 1) => `${CSI}${count}D`,
71
+ nextLine: (count = 1) => `${CSI}E`.repeat(count),
72
+ prevLine: (count = 1) => `${CSI}F`.repeat(count),
73
+ left: `${CSI}G`,
74
+ hide: `${CSI}?25l`,
75
+ show: `${CSI}?25h`,
76
+ save: `${ESC}7`,
77
+ restore: `${ESC}8`
78
+ };
79
+ const scroll = {
80
+ up: (count = 1) => `${CSI}S`.repeat(count),
81
+ down: (count = 1) => `${CSI}T`.repeat(count)
82
+ };
83
+ const erase = {
84
+ screen: `${CSI}2J`,
85
+ up: (count = 1) => `${CSI}1J`.repeat(count),
86
+ down: (count = 1) => `${CSI}J`.repeat(count),
87
+ line: `${CSI}2K`,
88
+ lineEnd: `${CSI}K`,
89
+ lineStart: `${CSI}1K`,
90
+ lines(count) {
91
+ let clear = "";
92
+ for (let i2 = 0; i2 < count; i2++)
93
+ clear += this.line + (i2 < count - 1 ? cursor.up() : "");
94
+ if (count)
95
+ clear += cursor.left;
96
+ return clear;
97
+ }
98
+ };
99
+ src = { cursor, scroll, erase, beep };
100
+ return src;
101
+ }
102
+ function requirePicocolors() {
103
+ if (hasRequiredPicocolors) return picocolors.exports;
104
+ hasRequiredPicocolors = 1;
105
+ let p = process || {}, argv2 = p.argv || [], env2 = p.env || {};
106
+ let isColorSupported2 = !(!!env2.NO_COLOR || argv2.includes("--no-color")) && (!!env2.FORCE_COLOR || argv2.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env2.TERM !== "dumb" || !!env2.CI);
107
+ let formatter = (open, close, replace = open) => (input) => {
108
+ let string = "" + input, index = string.indexOf(close, open.length);
109
+ return ~index ? open + replaceClose2(string, close, replace, index) + close : open + string + close;
110
+ };
111
+ let replaceClose2 = (string, close, replace, index) => {
112
+ let result = "", cursor = 0;
113
+ do {
114
+ result += string.substring(cursor, index) + replace;
115
+ cursor = index + close.length;
116
+ index = string.indexOf(close, cursor);
117
+ } while (~index);
118
+ return result + string.substring(cursor);
119
+ };
120
+ let createColors2 = (enabled = isColorSupported2) => {
121
+ let f3 = enabled ? formatter : () => String;
122
+ return {
123
+ isColorSupported: enabled,
124
+ reset: f3("\x1B[0m", "\x1B[0m"),
125
+ bold: f3("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
126
+ dim: f3("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
127
+ italic: f3("\x1B[3m", "\x1B[23m"),
128
+ underline: f3("\x1B[4m", "\x1B[24m"),
129
+ inverse: f3("\x1B[7m", "\x1B[27m"),
130
+ hidden: f3("\x1B[8m", "\x1B[28m"),
131
+ strikethrough: f3("\x1B[9m", "\x1B[29m"),
132
+ black: f3("\x1B[30m", "\x1B[39m"),
133
+ red: f3("\x1B[31m", "\x1B[39m"),
134
+ green: f3("\x1B[32m", "\x1B[39m"),
135
+ yellow: f3("\x1B[33m", "\x1B[39m"),
136
+ blue: f3("\x1B[34m", "\x1B[39m"),
137
+ magenta: f3("\x1B[35m", "\x1B[39m"),
138
+ cyan: f3("\x1B[36m", "\x1B[39m"),
139
+ white: f3("\x1B[37m", "\x1B[39m"),
140
+ gray: f3("\x1B[90m", "\x1B[39m"),
141
+ bgBlack: f3("\x1B[40m", "\x1B[49m"),
142
+ bgRed: f3("\x1B[41m", "\x1B[49m"),
143
+ bgGreen: f3("\x1B[42m", "\x1B[49m"),
144
+ bgYellow: f3("\x1B[43m", "\x1B[49m"),
145
+ bgBlue: f3("\x1B[44m", "\x1B[49m"),
146
+ bgMagenta: f3("\x1B[45m", "\x1B[49m"),
147
+ bgCyan: f3("\x1B[46m", "\x1B[49m"),
148
+ bgWhite: f3("\x1B[47m", "\x1B[49m"),
149
+ blackBright: f3("\x1B[90m", "\x1B[39m"),
150
+ redBright: f3("\x1B[91m", "\x1B[39m"),
151
+ greenBright: f3("\x1B[92m", "\x1B[39m"),
152
+ yellowBright: f3("\x1B[93m", "\x1B[39m"),
153
+ blueBright: f3("\x1B[94m", "\x1B[39m"),
154
+ magentaBright: f3("\x1B[95m", "\x1B[39m"),
155
+ cyanBright: f3("\x1B[96m", "\x1B[39m"),
156
+ whiteBright: f3("\x1B[97m", "\x1B[39m"),
157
+ bgBlackBright: f3("\x1B[100m", "\x1B[49m"),
158
+ bgRedBright: f3("\x1B[101m", "\x1B[49m"),
159
+ bgGreenBright: f3("\x1B[102m", "\x1B[49m"),
160
+ bgYellowBright: f3("\x1B[103m", "\x1B[49m"),
161
+ bgBlueBright: f3("\x1B[104m", "\x1B[49m"),
162
+ bgMagentaBright: f3("\x1B[105m", "\x1B[49m"),
163
+ bgCyanBright: f3("\x1B[106m", "\x1B[49m"),
164
+ bgWhiteBright: f3("\x1B[107m", "\x1B[49m")
165
+ };
166
+ };
167
+ picocolors.exports = createColors2();
168
+ picocolors.exports.createColors = createColors2;
169
+ return picocolors.exports;
170
+ }
171
+ function J({ onlyFirst: t2 = false } = {}) {
172
+ const F3 = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
173
+ return new RegExp(F3, t2 ? void 0 : "g");
174
+ }
175
+ function T$1(t2) {
176
+ if (typeof t2 != "string") throw new TypeError(`Expected a \`string\`, got \`${typeof t2}\``);
177
+ return t2.replace(Q, "");
178
+ }
179
+ function O(t2) {
180
+ return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
181
+ }
182
+ function A$1(t2, u3 = {}) {
183
+ if (typeof t2 != "string" || t2.length === 0 || (u3 = { ambiguousIsNarrow: true, ...u3 }, t2 = T$1(t2), t2.length === 0)) return 0;
184
+ t2 = t2.replace(FD(), " ");
185
+ const F3 = u3.ambiguousIsNarrow ? 1 : 2;
186
+ let e2 = 0;
187
+ for (const s2 of t2) {
188
+ const i2 = s2.codePointAt(0);
189
+ if (i2 <= 31 || i2 >= 127 && i2 <= 159 || i2 >= 768 && i2 <= 879) continue;
190
+ switch (DD.eastAsianWidth(s2)) {
191
+ case "F":
192
+ case "W":
193
+ e2 += 2;
194
+ break;
195
+ case "A":
196
+ e2 += F3;
197
+ break;
198
+ default:
199
+ e2 += 1;
200
+ }
201
+ }
202
+ return e2;
203
+ }
204
+ function sD() {
205
+ const t2 = /* @__PURE__ */ new Map();
206
+ for (const [u3, F3] of Object.entries(r)) {
207
+ for (const [e2, s2] of Object.entries(F3)) r[e2] = { open: `\x1B[${s2[0]}m`, close: `\x1B[${s2[1]}m` }, F3[e2] = r[e2], t2.set(s2[0], s2[1]);
208
+ Object.defineProperty(r, u3, { value: F3, enumerable: false });
209
+ }
210
+ return Object.defineProperty(r, "codes", { value: t2, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = L$1(), r.color.ansi256 = N(), r.color.ansi16m = I(), r.bgColor.ansi = L$1(m), r.bgColor.ansi256 = N(m), r.bgColor.ansi16m = I(m), Object.defineProperties(r, { rgbToAnsi256: { value: (u3, F3, e2) => u3 === F3 && F3 === e2 ? u3 < 8 ? 16 : u3 > 248 ? 231 : Math.round((u3 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u3 / 255 * 5) + 6 * Math.round(F3 / 255 * 5) + Math.round(e2 / 255 * 5), enumerable: false }, hexToRgb: { value: (u3) => {
211
+ const F3 = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u3.toString(16));
212
+ if (!F3) return [0, 0, 0];
213
+ let [e2] = F3;
214
+ e2.length === 3 && (e2 = [...e2].map((i2) => i2 + i2).join(""));
215
+ const s2 = Number.parseInt(e2, 16);
216
+ return [s2 >> 16 & 255, s2 >> 8 & 255, s2 & 255];
217
+ }, enumerable: false }, hexToAnsi256: { value: (u3) => r.rgbToAnsi256(...r.hexToRgb(u3)), enumerable: false }, ansi256ToAnsi: { value: (u3) => {
218
+ if (u3 < 8) return 30 + u3;
219
+ if (u3 < 16) return 90 + (u3 - 8);
220
+ let F3, e2, s2;
221
+ if (u3 >= 232) F3 = ((u3 - 232) * 10 + 8) / 255, e2 = F3, s2 = F3;
222
+ else {
223
+ u3 -= 16;
224
+ const C3 = u3 % 36;
225
+ F3 = Math.floor(u3 / 36) / 5, e2 = Math.floor(C3 / 6) / 5, s2 = C3 % 6 / 5;
226
+ }
227
+ const i2 = Math.max(F3, e2, s2) * 2;
228
+ if (i2 === 0) return 30;
229
+ let D2 = 30 + (Math.round(s2) << 2 | Math.round(e2) << 1 | Math.round(F3));
230
+ return i2 === 2 && (D2 += 60), D2;
231
+ }, enumerable: false }, rgbToAnsi: { value: (u3, F3, e2) => r.ansi256ToAnsi(r.rgbToAnsi256(u3, F3, e2)), enumerable: false }, hexToAnsi: { value: (u3) => r.ansi256ToAnsi(r.hexToAnsi256(u3)), enumerable: false } }), r;
232
+ }
233
+ function G(t2, u3, F3) {
234
+ return String(t2).normalize().replace(/\r\n/g, `
235
+ `).split(`
236
+ `).map((e2) => oD(e2, u3, F3)).join(`
237
+ `);
238
+ }
239
+ function k$1(t2, u3) {
240
+ if (typeof t2 == "string") return c.aliases.get(t2) === u3;
241
+ for (const F3 of t2) if (F3 !== void 0 && k$1(F3, u3)) return true;
242
+ return false;
243
+ }
244
+ function lD(t2, u3) {
245
+ if (t2 === u3) return;
246
+ const F3 = t2.split(`
247
+ `), e2 = u3.split(`
248
+ `), s2 = [];
249
+ for (let i2 = 0; i2 < Math.max(F3.length, e2.length); i2++) F3[i2] !== e2[i2] && s2.push(i2);
250
+ return s2;
251
+ }
252
+ function d$1(t2, u3) {
253
+ const F3 = t2;
254
+ F3.isTTY && F3.setRawMode(u3);
255
+ }
256
+ function ce() {
257
+ return g.platform !== "win32" ? g.env.TERM !== "linux" : !!g.env.CI || !!g.env.WT_SESSION || !!g.env.TERMINUS_SUBLIME || g.env.ConEmuTask === "{cmd::Cmder}" || g.env.TERM_PROGRAM === "Terminus-Sublime" || g.env.TERM_PROGRAM === "vscode" || g.env.TERM === "xterm-256color" || g.env.TERM === "alacritty" || g.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
258
+ }
259
+ async function prompt(message, opts = {}) {
260
+ const handleCancel = (value) => {
261
+ if (typeof value !== "symbol" || value.toString() !== "Symbol(clack:cancel)") {
262
+ return value;
263
+ }
264
+ switch (opts.cancel) {
265
+ case "reject": {
266
+ const error = new Error("Prompt cancelled.");
267
+ error.name = "ConsolaPromptCancelledError";
268
+ if (Error.captureStackTrace) {
269
+ Error.captureStackTrace(error, prompt);
270
+ }
271
+ throw error;
272
+ }
273
+ case "undefined": {
274
+ return void 0;
275
+ }
276
+ case "null": {
277
+ return null;
278
+ }
279
+ case "symbol": {
280
+ return kCancel;
281
+ }
282
+ default:
283
+ case "default": {
284
+ return opts.default ?? opts.initial;
285
+ }
286
+ }
287
+ };
288
+ if (!opts.type || opts.type === "text") {
289
+ return await he({
290
+ message,
291
+ defaultValue: opts.default,
292
+ placeholder: opts.placeholder,
293
+ initialValue: opts.initial
294
+ }).then(handleCancel);
295
+ }
296
+ if (opts.type === "confirm") {
297
+ return await ye({
298
+ message,
299
+ initialValue: opts.initial
300
+ }).then(handleCancel);
301
+ }
302
+ if (opts.type === "select") {
303
+ return await ve({
304
+ message,
305
+ options: opts.options.map(
306
+ (o3) => typeof o3 === "string" ? { value: o3, label: o3 } : o3
307
+ ),
308
+ initialValue: opts.initial
309
+ }).then(handleCancel);
310
+ }
311
+ if (opts.type === "multiselect") {
312
+ return await fe({
313
+ message,
314
+ options: opts.options.map(
315
+ (o3) => typeof o3 === "string" ? { value: o3, label: o3 } : o3
316
+ ),
317
+ required: opts.required,
318
+ initialValues: opts.initial
319
+ }).then(handleCancel);
320
+ }
321
+ throw new Error(`Unknown prompt type: ${opts.type}`);
322
+ }
323
+ var src, hasRequiredSrc, srcExports, picocolors, hasRequiredPicocolors, picocolorsExports, e, Q, P$1, X, DD, uD, FD, m, L$1, N, I, r, tD, eD, iD, v, CD, w$1, W$1, rD, R, y, V$1, z, ED, _, nD, oD, aD, c, S, AD, pD, h, x, fD, bD, mD, Y, wD, SD, $D, q, jD, PD, V, u, le, L, W, C, o, d, k, P, A, T, F, w, B, he, ye, ve, fe, kCancel;
324
+ var init_prompt = __esm({
325
+ "../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/chunks/prompt.mjs"() {
326
+ "use strict";
327
+ srcExports = requireSrc();
328
+ picocolors = { exports: {} };
329
+ picocolorsExports = /* @__PURE__ */ requirePicocolors();
330
+ e = /* @__PURE__ */ getDefaultExportFromCjs(picocolorsExports);
331
+ Q = J();
332
+ P$1 = { exports: {} };
333
+ (function(t2) {
334
+ var u3 = {};
335
+ t2.exports = u3, u3.eastAsianWidth = function(e2) {
336
+ var s2 = e2.charCodeAt(0), i2 = e2.length == 2 ? e2.charCodeAt(1) : 0, D2 = s2;
337
+ return 55296 <= s2 && s2 <= 56319 && 56320 <= i2 && i2 <= 57343 && (s2 &= 1023, i2 &= 1023, D2 = s2 << 10 | i2, D2 += 65536), D2 == 12288 || 65281 <= D2 && D2 <= 65376 || 65504 <= D2 && D2 <= 65510 ? "F" : D2 == 8361 || 65377 <= D2 && D2 <= 65470 || 65474 <= D2 && D2 <= 65479 || 65482 <= D2 && D2 <= 65487 || 65490 <= D2 && D2 <= 65495 || 65498 <= D2 && D2 <= 65500 || 65512 <= D2 && D2 <= 65518 ? "H" : 4352 <= D2 && D2 <= 4447 || 4515 <= D2 && D2 <= 4519 || 4602 <= D2 && D2 <= 4607 || 9001 <= D2 && D2 <= 9002 || 11904 <= D2 && D2 <= 11929 || 11931 <= D2 && D2 <= 12019 || 12032 <= D2 && D2 <= 12245 || 12272 <= D2 && D2 <= 12283 || 12289 <= D2 && D2 <= 12350 || 12353 <= D2 && D2 <= 12438 || 12441 <= D2 && D2 <= 12543 || 12549 <= D2 && D2 <= 12589 || 12593 <= D2 && D2 <= 12686 || 12688 <= D2 && D2 <= 12730 || 12736 <= D2 && D2 <= 12771 || 12784 <= D2 && D2 <= 12830 || 12832 <= D2 && D2 <= 12871 || 12880 <= D2 && D2 <= 13054 || 13056 <= D2 && D2 <= 19903 || 19968 <= D2 && D2 <= 42124 || 42128 <= D2 && D2 <= 42182 || 43360 <= D2 && D2 <= 43388 || 44032 <= D2 && D2 <= 55203 || 55216 <= D2 && D2 <= 55238 || 55243 <= D2 && D2 <= 55291 || 63744 <= D2 && D2 <= 64255 || 65040 <= D2 && D2 <= 65049 || 65072 <= D2 && D2 <= 65106 || 65108 <= D2 && D2 <= 65126 || 65128 <= D2 && D2 <= 65131 || 110592 <= D2 && D2 <= 110593 || 127488 <= D2 && D2 <= 127490 || 127504 <= D2 && D2 <= 127546 || 127552 <= D2 && D2 <= 127560 || 127568 <= D2 && D2 <= 127569 || 131072 <= D2 && D2 <= 194367 || 177984 <= D2 && D2 <= 196605 || 196608 <= D2 && D2 <= 262141 ? "W" : 32 <= D2 && D2 <= 126 || 162 <= D2 && D2 <= 163 || 165 <= D2 && D2 <= 166 || D2 == 172 || D2 == 175 || 10214 <= D2 && D2 <= 10221 || 10629 <= D2 && D2 <= 10630 ? "Na" : D2 == 161 || D2 == 164 || 167 <= D2 && D2 <= 168 || D2 == 170 || 173 <= D2 && D2 <= 174 || 176 <= D2 && D2 <= 180 || 182 <= D2 && D2 <= 186 || 188 <= D2 && D2 <= 191 || D2 == 198 || D2 == 208 || 215 <= D2 && D2 <= 216 || 222 <= D2 && D2 <= 225 || D2 == 230 || 232 <= D2 && D2 <= 234 || 236 <= D2 && D2 <= 237 || D2 == 240 || 242 <= D2 && D2 <= 243 || 247 <= D2 && D2 <= 250 || D2 == 252 || D2 == 254 || D2 == 257 || D2 == 273 || D2 == 275 || D2 == 283 || 294 <= D2 && D2 <= 295 || D2 == 299 || 305 <= D2 && D2 <= 307 || D2 == 312 || 319 <= D2 && D2 <= 322 || D2 == 324 || 328 <= D2 && D2 <= 331 || D2 == 333 || 338 <= D2 && D2 <= 339 || 358 <= D2 && D2 <= 359 || D2 == 363 || D2 == 462 || D2 == 464 || D2 == 466 || D2 == 468 || D2 == 470 || D2 == 472 || D2 == 474 || D2 == 476 || D2 == 593 || D2 == 609 || D2 == 708 || D2 == 711 || 713 <= D2 && D2 <= 715 || D2 == 717 || D2 == 720 || 728 <= D2 && D2 <= 731 || D2 == 733 || D2 == 735 || 768 <= D2 && D2 <= 879 || 913 <= D2 && D2 <= 929 || 931 <= D2 && D2 <= 937 || 945 <= D2 && D2 <= 961 || 963 <= D2 && D2 <= 969 || D2 == 1025 || 1040 <= D2 && D2 <= 1103 || D2 == 1105 || D2 == 8208 || 8211 <= D2 && D2 <= 8214 || 8216 <= D2 && D2 <= 8217 || 8220 <= D2 && D2 <= 8221 || 8224 <= D2 && D2 <= 8226 || 8228 <= D2 && D2 <= 8231 || D2 == 8240 || 8242 <= D2 && D2 <= 8243 || D2 == 8245 || D2 == 8251 || D2 == 8254 || D2 == 8308 || D2 == 8319 || 8321 <= D2 && D2 <= 8324 || D2 == 8364 || D2 == 8451 || D2 == 8453 || D2 == 8457 || D2 == 8467 || D2 == 8470 || 8481 <= D2 && D2 <= 8482 || D2 == 8486 || D2 == 8491 || 8531 <= D2 && D2 <= 8532 || 8539 <= D2 && D2 <= 8542 || 8544 <= D2 && D2 <= 8555 || 8560 <= D2 && D2 <= 8569 || D2 == 8585 || 8592 <= D2 && D2 <= 8601 || 8632 <= D2 && D2 <= 8633 || D2 == 8658 || D2 == 8660 || D2 == 8679 || D2 == 8704 || 8706 <= D2 && D2 <= 8707 || 8711 <= D2 && D2 <= 8712 || D2 == 8715 || D2 == 8719 || D2 == 8721 || D2 == 8725 || D2 == 8730 || 8733 <= D2 && D2 <= 8736 || D2 == 8739 || D2 == 8741 || 8743 <= D2 && D2 <= 8748 || D2 == 8750 || 8756 <= D2 && D2 <= 8759 || 8764 <= D2 && D2 <= 8765 || D2 == 8776 || D2 == 8780 || D2 == 8786 || 8800 <= D2 && D2 <= 8801 || 8804 <= D2 && D2 <= 8807 || 8810 <= D2 && D2 <= 8811 || 8814 <= D2 && D2 <= 8815 || 8834 <= D2 && D2 <= 8835 || 8838 <= D2 && D2 <= 8839 || D2 == 8853 || D2 == 8857 || D2 == 8869 || D2 == 8895 || D2 == 8978 || 9312 <= D2 && D2 <= 9449 || 9451 <= D2 && D2 <= 9547 || 9552 <= D2 && D2 <= 9587 || 9600 <= D2 && D2 <= 9615 || 9618 <= D2 && D2 <= 9621 || 9632 <= D2 && D2 <= 9633 || 9635 <= D2 && D2 <= 9641 || 9650 <= D2 && D2 <= 9651 || 9654 <= D2 && D2 <= 9655 || 9660 <= D2 && D2 <= 9661 || 9664 <= D2 && D2 <= 9665 || 9670 <= D2 && D2 <= 9672 || D2 == 9675 || 9678 <= D2 && D2 <= 9681 || 9698 <= D2 && D2 <= 9701 || D2 == 9711 || 9733 <= D2 && D2 <= 9734 || D2 == 9737 || 9742 <= D2 && D2 <= 9743 || 9748 <= D2 && D2 <= 9749 || D2 == 9756 || D2 == 9758 || D2 == 9792 || D2 == 9794 || 9824 <= D2 && D2 <= 9825 || 9827 <= D2 && D2 <= 9829 || 9831 <= D2 && D2 <= 9834 || 9836 <= D2 && D2 <= 9837 || D2 == 9839 || 9886 <= D2 && D2 <= 9887 || 9918 <= D2 && D2 <= 9919 || 9924 <= D2 && D2 <= 9933 || 9935 <= D2 && D2 <= 9953 || D2 == 9955 || 9960 <= D2 && D2 <= 9983 || D2 == 10045 || D2 == 10071 || 10102 <= D2 && D2 <= 10111 || 11093 <= D2 && D2 <= 11097 || 12872 <= D2 && D2 <= 12879 || 57344 <= D2 && D2 <= 63743 || 65024 <= D2 && D2 <= 65039 || D2 == 65533 || 127232 <= D2 && D2 <= 127242 || 127248 <= D2 && D2 <= 127277 || 127280 <= D2 && D2 <= 127337 || 127344 <= D2 && D2 <= 127386 || 917760 <= D2 && D2 <= 917999 || 983040 <= D2 && D2 <= 1048573 || 1048576 <= D2 && D2 <= 1114109 ? "A" : "N";
338
+ }, u3.characterLength = function(e2) {
339
+ var s2 = this.eastAsianWidth(e2);
340
+ return s2 == "F" || s2 == "W" || s2 == "A" ? 2 : 1;
341
+ };
342
+ function F3(e2) {
343
+ return e2.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
344
+ }
345
+ u3.length = function(e2) {
346
+ for (var s2 = F3(e2), i2 = 0, D2 = 0; D2 < s2.length; D2++) i2 = i2 + this.characterLength(s2[D2]);
347
+ return i2;
348
+ }, u3.slice = function(e2, s2, i2) {
349
+ textLen = u3.length(e2), s2 = s2 || 0, i2 = i2 || 1, s2 < 0 && (s2 = textLen + s2), i2 < 0 && (i2 = textLen + i2);
350
+ for (var D2 = "", C3 = 0, o3 = F3(e2), E = 0; E < o3.length; E++) {
351
+ var a2 = o3[E], n2 = u3.length(a2);
352
+ if (C3 >= s2 - (n2 == 2 ? 1 : 0)) if (C3 + n2 <= i2) D2 += a2;
353
+ else break;
354
+ C3 += n2;
355
+ }
356
+ return D2;
357
+ };
358
+ })(P$1);
359
+ X = P$1.exports;
360
+ DD = O(X);
361
+ uD = function() {
362
+ return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\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|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\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]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\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-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
363
+ };
364
+ FD = O(uD);
365
+ m = 10;
366
+ L$1 = (t2 = 0) => (u3) => `\x1B[${u3 + t2}m`;
367
+ N = (t2 = 0) => (u3) => `\x1B[${38 + t2};5;${u3}m`;
368
+ I = (t2 = 0) => (u3, F3, e2) => `\x1B[${38 + t2};2;${u3};${F3};${e2}m`;
369
+ r = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], blackBright: [90, 39], gray: [90, 39], grey: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgBlackBright: [100, 49], bgGray: [100, 49], bgGrey: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } };
370
+ Object.keys(r.modifier);
371
+ tD = Object.keys(r.color);
372
+ eD = Object.keys(r.bgColor);
373
+ [...tD, ...eD];
374
+ iD = sD();
375
+ v = /* @__PURE__ */ new Set(["\x1B", "\x9B"]);
376
+ CD = 39;
377
+ w$1 = "\x07";
378
+ W$1 = "[";
379
+ rD = "]";
380
+ R = "m";
381
+ y = `${rD}8;;`;
382
+ V$1 = (t2) => `${v.values().next().value}${W$1}${t2}${R}`;
383
+ z = (t2) => `${v.values().next().value}${y}${t2}${w$1}`;
384
+ ED = (t2) => t2.split(" ").map((u3) => A$1(u3));
385
+ _ = (t2, u3, F3) => {
386
+ const e2 = [...u3];
387
+ let s2 = false, i2 = false, D2 = A$1(T$1(t2[t2.length - 1]));
388
+ for (const [C3, o3] of e2.entries()) {
389
+ const E = A$1(o3);
390
+ if (D2 + E <= F3 ? t2[t2.length - 1] += o3 : (t2.push(o3), D2 = 0), v.has(o3) && (s2 = true, i2 = e2.slice(C3 + 1).join("").startsWith(y)), s2) {
391
+ i2 ? o3 === w$1 && (s2 = false, i2 = false) : o3 === R && (s2 = false);
392
+ continue;
393
+ }
394
+ D2 += E, D2 === F3 && C3 < e2.length - 1 && (t2.push(""), D2 = 0);
395
+ }
396
+ !D2 && t2[t2.length - 1].length > 0 && t2.length > 1 && (t2[t2.length - 2] += t2.pop());
397
+ };
398
+ nD = (t2) => {
399
+ const u3 = t2.split(" ");
400
+ let F3 = u3.length;
401
+ for (; F3 > 0 && !(A$1(u3[F3 - 1]) > 0); ) F3--;
402
+ return F3 === u3.length ? t2 : u3.slice(0, F3).join(" ") + u3.slice(F3).join("");
403
+ };
404
+ oD = (t2, u3, F3 = {}) => {
405
+ if (F3.trim !== false && t2.trim() === "") return "";
406
+ let e2 = "", s2, i2;
407
+ const D2 = ED(t2);
408
+ let C3 = [""];
409
+ for (const [E, a2] of t2.split(" ").entries()) {
410
+ F3.trim !== false && (C3[C3.length - 1] = C3[C3.length - 1].trimStart());
411
+ let n2 = A$1(C3[C3.length - 1]);
412
+ if (E !== 0 && (n2 >= u3 && (F3.wordWrap === false || F3.trim === false) && (C3.push(""), n2 = 0), (n2 > 0 || F3.trim === false) && (C3[C3.length - 1] += " ", n2++)), F3.hard && D2[E] > u3) {
413
+ const B2 = u3 - n2, p = 1 + Math.floor((D2[E] - B2 - 1) / u3);
414
+ Math.floor((D2[E] - 1) / u3) < p && C3.push(""), _(C3, a2, u3);
415
+ continue;
416
+ }
417
+ if (n2 + D2[E] > u3 && n2 > 0 && D2[E] > 0) {
418
+ if (F3.wordWrap === false && n2 < u3) {
419
+ _(C3, a2, u3);
420
+ continue;
421
+ }
422
+ C3.push("");
423
+ }
424
+ if (n2 + D2[E] > u3 && F3.wordWrap === false) {
425
+ _(C3, a2, u3);
426
+ continue;
427
+ }
428
+ C3[C3.length - 1] += a2;
429
+ }
430
+ F3.trim !== false && (C3 = C3.map((E) => nD(E)));
431
+ const o3 = [...C3.join(`
432
+ `)];
433
+ for (const [E, a2] of o3.entries()) {
434
+ if (e2 += a2, v.has(a2)) {
435
+ const { groups: B2 } = new RegExp(`(?:\\${W$1}(?<code>\\d+)m|\\${y}(?<uri>.*)${w$1})`).exec(o3.slice(E).join("")) || { groups: {} };
436
+ if (B2.code !== void 0) {
437
+ const p = Number.parseFloat(B2.code);
438
+ s2 = p === CD ? void 0 : p;
439
+ } else B2.uri !== void 0 && (i2 = B2.uri.length === 0 ? void 0 : B2.uri);
440
+ }
441
+ const n2 = iD.codes.get(Number(s2));
442
+ o3[E + 1] === `
443
+ ` ? (i2 && (e2 += z("")), s2 && n2 && (e2 += V$1(n2))) : a2 === `
444
+ ` && (s2 && n2 && (e2 += V$1(s2)), i2 && (e2 += z(i2)));
445
+ }
446
+ return e2;
447
+ };
448
+ aD = ["up", "down", "left", "right", "space", "enter", "cancel"];
449
+ c = { actions: new Set(aD), aliases: /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["", "cancel"], ["escape", "cancel"]]) };
450
+ globalThis.process.platform.startsWith("win");
451
+ S = /* @__PURE__ */ Symbol("clack:cancel");
452
+ AD = Object.defineProperty;
453
+ pD = (t2, u3, F3) => u3 in t2 ? AD(t2, u3, { enumerable: true, configurable: true, writable: true, value: F3 }) : t2[u3] = F3;
454
+ h = (t2, u3, F3) => (pD(t2, typeof u3 != "symbol" ? u3 + "" : u3, F3), F3);
455
+ x = class {
456
+ constructor(u3, F3 = true) {
457
+ h(this, "input"), h(this, "output"), h(this, "_abortSignal"), h(this, "rl"), h(this, "opts"), h(this, "_render"), h(this, "_track", false), h(this, "_prevFrame", ""), h(this, "_subscribers", /* @__PURE__ */ new Map()), h(this, "_cursor", 0), h(this, "state", "initial"), h(this, "error", ""), h(this, "value");
458
+ const { input: e2 = stdin, output: s2 = stdout, render: i2, signal: D2, ...C3 } = u3;
459
+ this.opts = C3, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = i2.bind(this), this._track = F3, this._abortSignal = D2, this.input = e2, this.output = s2;
460
+ }
461
+ unsubscribe() {
462
+ this._subscribers.clear();
463
+ }
464
+ setSubscriber(u3, F3) {
465
+ const e2 = this._subscribers.get(u3) ?? [];
466
+ e2.push(F3), this._subscribers.set(u3, e2);
467
+ }
468
+ on(u3, F3) {
469
+ this.setSubscriber(u3, { cb: F3 });
470
+ }
471
+ once(u3, F3) {
472
+ this.setSubscriber(u3, { cb: F3, once: true });
473
+ }
474
+ emit(u3, ...F3) {
475
+ const e2 = this._subscribers.get(u3) ?? [], s2 = [];
476
+ for (const i2 of e2) i2.cb(...F3), i2.once && s2.push(() => e2.splice(e2.indexOf(i2), 1));
477
+ for (const i2 of s2) i2();
478
+ }
479
+ prompt() {
480
+ return new Promise((u3, F3) => {
481
+ if (this._abortSignal) {
482
+ if (this._abortSignal.aborted) return this.state = "cancel", this.close(), u3(S);
483
+ this._abortSignal.addEventListener("abort", () => {
484
+ this.state = "cancel", this.close();
485
+ }, { once: true });
486
+ }
487
+ const e2 = new WriteStream(0);
488
+ e2._write = (s2, i2, D2) => {
489
+ this._track && (this.value = this.rl?.line.replace(/\t/g, ""), this._cursor = this.rl?.cursor ?? 0, this.emit("value", this.value)), D2();
490
+ }, this.input.pipe(e2), this.rl = f.createInterface({ input: this.input, output: e2, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), f.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), d$1(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
491
+ this.output.write(srcExports.cursor.show), this.output.off("resize", this.render), d$1(this.input, false), u3(this.value);
492
+ }), this.once("cancel", () => {
493
+ this.output.write(srcExports.cursor.show), this.output.off("resize", this.render), d$1(this.input, false), u3(S);
494
+ });
495
+ });
496
+ }
497
+ onKeypress(u3, F3) {
498
+ if (this.state === "error" && (this.state = "active"), F3?.name && (!this._track && c.aliases.has(F3.name) && this.emit("cursor", c.aliases.get(F3.name)), c.actions.has(F3.name) && this.emit("cursor", F3.name)), u3 && (u3.toLowerCase() === "y" || u3.toLowerCase() === "n") && this.emit("confirm", u3.toLowerCase() === "y"), u3 === " " && this.opts.placeholder && (this.value || (this.rl?.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u3 && this.emit("key", u3.toLowerCase()), F3?.name === "return") {
499
+ if (this.opts.validate) {
500
+ const e2 = this.opts.validate(this.value);
501
+ e2 && (this.error = e2 instanceof Error ? e2.message : e2, this.state = "error", this.rl?.write(this.value));
502
+ }
503
+ this.state !== "error" && (this.state = "submit");
504
+ }
505
+ k$1([u3, F3?.name, F3?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
506
+ }
507
+ close() {
508
+ this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
509
+ `), d$1(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
510
+ }
511
+ restoreCursor() {
512
+ const u3 = G(this._prevFrame, process.stdout.columns, { hard: true }).split(`
513
+ `).length - 1;
514
+ this.output.write(srcExports.cursor.move(-999, u3 * -1));
515
+ }
516
+ render() {
517
+ const u3 = G(this._render(this) ?? "", process.stdout.columns, { hard: true });
518
+ if (u3 !== this._prevFrame) {
519
+ if (this.state === "initial") this.output.write(srcExports.cursor.hide);
520
+ else {
521
+ const F3 = lD(this._prevFrame, u3);
522
+ if (this.restoreCursor(), F3 && F3?.length === 1) {
523
+ const e2 = F3[0];
524
+ this.output.write(srcExports.cursor.move(0, e2)), this.output.write(srcExports.erase.lines(1));
525
+ const s2 = u3.split(`
526
+ `);
527
+ this.output.write(s2[e2]), this._prevFrame = u3, this.output.write(srcExports.cursor.move(0, s2.length - e2 - 1));
528
+ return;
529
+ }
530
+ if (F3 && F3?.length > 1) {
531
+ const e2 = F3[0];
532
+ this.output.write(srcExports.cursor.move(0, e2)), this.output.write(srcExports.erase.down());
533
+ const s2 = u3.split(`
534
+ `).slice(e2);
535
+ this.output.write(s2.join(`
536
+ `)), this._prevFrame = u3;
537
+ return;
538
+ }
539
+ this.output.write(srcExports.erase.down());
540
+ }
541
+ this.output.write(u3), this.state === "initial" && (this.state = "active"), this._prevFrame = u3;
542
+ }
543
+ }
544
+ };
545
+ fD = class extends x {
546
+ get cursor() {
547
+ return this.value ? 0 : 1;
548
+ }
549
+ get _value() {
550
+ return this.cursor === 0;
551
+ }
552
+ constructor(u3) {
553
+ super(u3, false), this.value = !!u3.initialValue, this.on("value", () => {
554
+ this.value = this._value;
555
+ }), this.on("confirm", (F3) => {
556
+ this.output.write(srcExports.cursor.move(0, -1)), this.value = F3, this.state = "submit", this.close();
557
+ }), this.on("cursor", () => {
558
+ this.value = !this.value;
559
+ });
560
+ }
561
+ };
562
+ bD = Object.defineProperty;
563
+ mD = (t2, u3, F3) => u3 in t2 ? bD(t2, u3, { enumerable: true, configurable: true, writable: true, value: F3 }) : t2[u3] = F3;
564
+ Y = (t2, u3, F3) => (mD(t2, typeof u3 != "symbol" ? u3 + "" : u3, F3), F3);
565
+ wD = class extends x {
566
+ constructor(u3) {
567
+ super(u3, false), Y(this, "options"), Y(this, "cursor", 0), this.options = u3.options, this.value = [...u3.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: F3 }) => F3 === u3.cursorAt), 0), this.on("key", (F3) => {
568
+ F3 === "a" && this.toggleAll();
569
+ }), this.on("cursor", (F3) => {
570
+ switch (F3) {
571
+ case "left":
572
+ case "up":
573
+ this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
574
+ break;
575
+ case "down":
576
+ case "right":
577
+ this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
578
+ break;
579
+ case "space":
580
+ this.toggleValue();
581
+ break;
582
+ }
583
+ });
584
+ }
585
+ get _value() {
586
+ return this.options[this.cursor].value;
587
+ }
588
+ toggleAll() {
589
+ const u3 = this.value.length === this.options.length;
590
+ this.value = u3 ? [] : this.options.map((F3) => F3.value);
591
+ }
592
+ toggleValue() {
593
+ const u3 = this.value.includes(this._value);
594
+ this.value = u3 ? this.value.filter((F3) => F3 !== this._value) : [...this.value, this._value];
595
+ }
596
+ };
597
+ SD = Object.defineProperty;
598
+ $D = (t2, u3, F3) => u3 in t2 ? SD(t2, u3, { enumerable: true, configurable: true, writable: true, value: F3 }) : t2[u3] = F3;
599
+ q = (t2, u3, F3) => ($D(t2, typeof u3 != "symbol" ? u3 + "" : u3, F3), F3);
600
+ jD = class extends x {
601
+ constructor(u3) {
602
+ super(u3, false), q(this, "options"), q(this, "cursor", 0), this.options = u3.options, this.cursor = this.options.findIndex(({ value: F3 }) => F3 === u3.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (F3) => {
603
+ switch (F3) {
604
+ case "left":
605
+ case "up":
606
+ this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
607
+ break;
608
+ case "down":
609
+ case "right":
610
+ this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
611
+ break;
612
+ }
613
+ this.changeValue();
614
+ });
615
+ }
616
+ get _value() {
617
+ return this.options[this.cursor];
618
+ }
619
+ changeValue() {
620
+ this.value = this._value.value;
621
+ }
622
+ };
623
+ PD = class extends x {
624
+ get valueWithCursor() {
625
+ if (this.state === "submit") return this.value;
626
+ if (this.cursor >= this.value.length) return `${this.value}\u2588`;
627
+ const u3 = this.value.slice(0, this.cursor), [F3, ...e$1] = this.value.slice(this.cursor);
628
+ return `${u3}${e.inverse(F3)}${e$1.join("")}`;
629
+ }
630
+ get cursor() {
631
+ return this._cursor;
632
+ }
633
+ constructor(u3) {
634
+ super(u3), this.on("finalize", () => {
635
+ this.value || (this.value = u3.defaultValue);
636
+ });
637
+ }
638
+ };
639
+ V = ce();
640
+ u = (t2, n2) => V ? t2 : n2;
641
+ le = u("\u276F", ">");
642
+ L = u("\u25A0", "x");
643
+ W = u("\u25B2", "x");
644
+ C = u("\u2714", "\u221A");
645
+ o = u("");
646
+ d = u("");
647
+ k = u("\u25CF", ">");
648
+ P = u("\u25CB", " ");
649
+ A = u("\u25FB", "[\u2022]");
650
+ T = u("\u25FC", "[+]");
651
+ F = u("\u25FB", "[ ]");
652
+ w = (t2) => {
653
+ switch (t2) {
654
+ case "initial":
655
+ case "active":
656
+ return e.cyan(le);
657
+ case "cancel":
658
+ return e.red(L);
659
+ case "error":
660
+ return e.yellow(W);
661
+ case "submit":
662
+ return e.green(C);
663
+ }
664
+ };
665
+ B = (t2) => {
666
+ const { cursor: n2, options: s2, style: r3 } = t2, i2 = t2.maxItems ?? Number.POSITIVE_INFINITY, a2 = Math.max(process.stdout.rows - 4, 0), c3 = Math.min(a2, Math.max(i2, 5));
667
+ let l2 = 0;
668
+ n2 >= l2 + c3 - 3 ? l2 = Math.max(Math.min(n2 - c3 + 3, s2.length - c3), 0) : n2 < l2 + 2 && (l2 = Math.max(n2 - 2, 0));
669
+ const $ = c3 < s2.length && l2 > 0, p = c3 < s2.length && l2 + c3 < s2.length;
670
+ return s2.slice(l2, l2 + c3).map((M, v2, x2) => {
671
+ const j = v2 === 0 && $, E = v2 === x2.length - 1 && p;
672
+ return j || E ? e.dim("...") : r3(M, v2 + l2 === n2);
673
+ });
674
+ };
675
+ he = (t2) => new PD({ validate: t2.validate, placeholder: t2.placeholder, defaultValue: t2.defaultValue, initialValue: t2.initialValue, render() {
676
+ const n2 = `${e.gray(o)}
677
+ ${w(this.state)} ${t2.message}
678
+ `, s2 = t2.placeholder ? e.inverse(t2.placeholder[0]) + e.dim(t2.placeholder.slice(1)) : e.inverse(e.hidden("_")), r3 = this.value ? this.valueWithCursor : s2;
679
+ switch (this.state) {
680
+ case "error":
681
+ return `${n2.trim()}
682
+ ${e.yellow(o)} ${r3}
683
+ ${e.yellow(d)} ${e.yellow(this.error)}
684
+ `;
685
+ case "submit":
686
+ return `${n2}${e.gray(o)} ${e.dim(this.value || t2.placeholder)}`;
687
+ case "cancel":
688
+ return `${n2}${e.gray(o)} ${e.strikethrough(e.dim(this.value ?? ""))}${this.value?.trim() ? `
689
+ ${e.gray(o)}` : ""}`;
690
+ default:
691
+ return `${n2}${e.cyan(o)} ${r3}
692
+ ${e.cyan(d)}
693
+ `;
694
+ }
695
+ } }).prompt();
696
+ ye = (t2) => {
697
+ const n2 = t2.active ?? "Yes", s2 = t2.inactive ?? "No";
698
+ return new fD({ active: n2, inactive: s2, initialValue: t2.initialValue ?? true, render() {
699
+ const r3 = `${e.gray(o)}
700
+ ${w(this.state)} ${t2.message}
701
+ `, i2 = this.value ? n2 : s2;
702
+ switch (this.state) {
703
+ case "submit":
704
+ return `${r3}${e.gray(o)} ${e.dim(i2)}`;
705
+ case "cancel":
706
+ return `${r3}${e.gray(o)} ${e.strikethrough(e.dim(i2))}
707
+ ${e.gray(o)}`;
708
+ default:
709
+ return `${r3}${e.cyan(o)} ${this.value ? `${e.green(k)} ${n2}` : `${e.dim(P)} ${e.dim(n2)}`} ${e.dim("/")} ${this.value ? `${e.dim(P)} ${e.dim(s2)}` : `${e.green(k)} ${s2}`}
710
+ ${e.cyan(d)}
711
+ `;
712
+ }
713
+ } }).prompt();
714
+ };
715
+ ve = (t2) => {
716
+ const n2 = (s2, r3) => {
717
+ const i2 = s2.label ?? String(s2.value);
718
+ switch (r3) {
719
+ case "selected":
720
+ return `${e.dim(i2)}`;
721
+ case "active":
722
+ return `${e.green(k)} ${i2} ${s2.hint ? e.dim(`(${s2.hint})`) : ""}`;
723
+ case "cancelled":
724
+ return `${e.strikethrough(e.dim(i2))}`;
725
+ default:
726
+ return `${e.dim(P)} ${e.dim(i2)}`;
727
+ }
728
+ };
729
+ return new jD({ options: t2.options, initialValue: t2.initialValue, render() {
730
+ const s2 = `${e.gray(o)}
731
+ ${w(this.state)} ${t2.message}
732
+ `;
733
+ switch (this.state) {
734
+ case "submit":
735
+ return `${s2}${e.gray(o)} ${n2(this.options[this.cursor], "selected")}`;
736
+ case "cancel":
737
+ return `${s2}${e.gray(o)} ${n2(this.options[this.cursor], "cancelled")}
738
+ ${e.gray(o)}`;
739
+ default:
740
+ return `${s2}${e.cyan(o)} ${B({ cursor: this.cursor, options: this.options, maxItems: t2.maxItems, style: (r3, i2) => n2(r3, i2 ? "active" : "inactive") }).join(`
741
+ ${e.cyan(o)} `)}
742
+ ${e.cyan(d)}
743
+ `;
744
+ }
745
+ } }).prompt();
746
+ };
747
+ fe = (t2) => {
748
+ const n2 = (s2, r3) => {
749
+ const i2 = s2.label ?? String(s2.value);
750
+ return r3 === "active" ? `${e.cyan(A)} ${i2} ${s2.hint ? e.dim(`(${s2.hint})`) : ""}` : r3 === "selected" ? `${e.green(T)} ${e.dim(i2)}` : r3 === "cancelled" ? `${e.strikethrough(e.dim(i2))}` : r3 === "active-selected" ? `${e.green(T)} ${i2} ${s2.hint ? e.dim(`(${s2.hint})`) : ""}` : r3 === "submitted" ? `${e.dim(i2)}` : `${e.dim(F)} ${e.dim(i2)}`;
751
+ };
752
+ return new wD({ options: t2.options, initialValues: t2.initialValues, required: t2.required ?? true, cursorAt: t2.cursorAt, validate(s2) {
753
+ if (this.required && s2.length === 0) return `Please select at least one option.
754
+ ${e.reset(e.dim(`Press ${e.gray(e.bgWhite(e.inverse(" space ")))} to select, ${e.gray(e.bgWhite(e.inverse(" enter ")))} to submit`))}`;
755
+ }, render() {
756
+ const s2 = `${e.gray(o)}
757
+ ${w(this.state)} ${t2.message}
758
+ `, r3 = (i2, a2) => {
759
+ const c3 = this.value.includes(i2.value);
760
+ return a2 && c3 ? n2(i2, "active-selected") : c3 ? n2(i2, "selected") : n2(i2, a2 ? "active" : "inactive");
761
+ };
762
+ switch (this.state) {
763
+ case "submit":
764
+ return `${s2}${e.gray(o)} ${this.options.filter(({ value: i2 }) => this.value.includes(i2)).map((i2) => n2(i2, "submitted")).join(e.dim(", ")) || e.dim("none")}`;
765
+ case "cancel": {
766
+ const i2 = this.options.filter(({ value: a2 }) => this.value.includes(a2)).map((a2) => n2(a2, "cancelled")).join(e.dim(", "));
767
+ return `${s2}${e.gray(o)} ${i2.trim() ? `${i2}
768
+ ${e.gray(o)}` : ""}`;
769
+ }
770
+ case "error": {
771
+ const i2 = this.error.split(`
772
+ `).map((a2, c3) => c3 === 0 ? `${e.yellow(d)} ${e.yellow(a2)}` : ` ${a2}`).join(`
773
+ `);
774
+ return `${s2 + e.yellow(o)} ${B({ options: this.options, cursor: this.cursor, maxItems: t2.maxItems, style: r3 }).join(`
775
+ ${e.yellow(o)} `)}
776
+ ${i2}
777
+ `;
778
+ }
779
+ default:
780
+ return `${s2}${e.cyan(o)} ${B({ options: this.options, cursor: this.cursor, maxItems: t2.maxItems, style: r3 }).join(`
781
+ ${e.cyan(o)} `)}
782
+ ${e.cyan(d)}
783
+ `;
784
+ }
785
+ } }).prompt();
786
+ };
787
+ `${e.gray(o)} `;
788
+ kCancel = /* @__PURE__ */ Symbol.for("cancel");
789
+ }
790
+ });
791
+
792
+ // ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
793
+ var require_picocolors = __commonJS({
794
+ "../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports, module) {
795
+ "use strict";
796
+ var p = process || {};
797
+ var argv2 = p.argv || [];
798
+ var env2 = p.env || {};
799
+ var isColorSupported2 = !(!!env2.NO_COLOR || argv2.includes("--no-color")) && (!!env2.FORCE_COLOR || argv2.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env2.TERM !== "dumb" || !!env2.CI);
800
+ var formatter = (open, close, replace = open) => (input) => {
801
+ let string = "" + input, index = string.indexOf(close, open.length);
802
+ return ~index ? open + replaceClose2(string, close, replace, index) + close : open + string + close;
803
+ };
804
+ var replaceClose2 = (string, close, replace, index) => {
805
+ let result = "", cursor = 0;
806
+ do {
807
+ result += string.substring(cursor, index) + replace;
808
+ cursor = index + close.length;
809
+ index = string.indexOf(close, cursor);
810
+ } while (~index);
811
+ return result + string.substring(cursor);
812
+ };
813
+ var createColors2 = (enabled = isColorSupported2) => {
814
+ let f3 = enabled ? formatter : () => String;
815
+ return {
816
+ isColorSupported: enabled,
817
+ reset: f3("\x1B[0m", "\x1B[0m"),
818
+ bold: f3("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
819
+ dim: f3("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
820
+ italic: f3("\x1B[3m", "\x1B[23m"),
821
+ underline: f3("\x1B[4m", "\x1B[24m"),
822
+ inverse: f3("\x1B[7m", "\x1B[27m"),
823
+ hidden: f3("\x1B[8m", "\x1B[28m"),
824
+ strikethrough: f3("\x1B[9m", "\x1B[29m"),
825
+ black: f3("\x1B[30m", "\x1B[39m"),
826
+ red: f3("\x1B[31m", "\x1B[39m"),
827
+ green: f3("\x1B[32m", "\x1B[39m"),
828
+ yellow: f3("\x1B[33m", "\x1B[39m"),
829
+ blue: f3("\x1B[34m", "\x1B[39m"),
830
+ magenta: f3("\x1B[35m", "\x1B[39m"),
831
+ cyan: f3("\x1B[36m", "\x1B[39m"),
832
+ white: f3("\x1B[37m", "\x1B[39m"),
833
+ gray: f3("\x1B[90m", "\x1B[39m"),
834
+ bgBlack: f3("\x1B[40m", "\x1B[49m"),
835
+ bgRed: f3("\x1B[41m", "\x1B[49m"),
836
+ bgGreen: f3("\x1B[42m", "\x1B[49m"),
837
+ bgYellow: f3("\x1B[43m", "\x1B[49m"),
838
+ bgBlue: f3("\x1B[44m", "\x1B[49m"),
839
+ bgMagenta: f3("\x1B[45m", "\x1B[49m"),
840
+ bgCyan: f3("\x1B[46m", "\x1B[49m"),
841
+ bgWhite: f3("\x1B[47m", "\x1B[49m"),
842
+ blackBright: f3("\x1B[90m", "\x1B[39m"),
843
+ redBright: f3("\x1B[91m", "\x1B[39m"),
844
+ greenBright: f3("\x1B[92m", "\x1B[39m"),
845
+ yellowBright: f3("\x1B[93m", "\x1B[39m"),
846
+ blueBright: f3("\x1B[94m", "\x1B[39m"),
847
+ magentaBright: f3("\x1B[95m", "\x1B[39m"),
848
+ cyanBright: f3("\x1B[96m", "\x1B[39m"),
849
+ whiteBright: f3("\x1B[97m", "\x1B[39m"),
850
+ bgBlackBright: f3("\x1B[100m", "\x1B[49m"),
851
+ bgRedBright: f3("\x1B[101m", "\x1B[49m"),
852
+ bgGreenBright: f3("\x1B[102m", "\x1B[49m"),
853
+ bgYellowBright: f3("\x1B[103m", "\x1B[49m"),
854
+ bgBlueBright: f3("\x1B[104m", "\x1B[49m"),
855
+ bgMagentaBright: f3("\x1B[105m", "\x1B[49m"),
856
+ bgCyanBright: f3("\x1B[106m", "\x1B[49m"),
857
+ bgWhiteBright: f3("\x1B[107m", "\x1B[49m")
858
+ };
859
+ };
860
+ module.exports = createColors2();
861
+ module.exports.createColors = createColors2;
862
+ }
863
+ });
864
+
865
+ // ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/core.mjs
866
+ var LogLevels = {
867
+ silent: Number.NEGATIVE_INFINITY,
868
+ fatal: 0,
869
+ error: 0,
870
+ warn: 1,
871
+ log: 2,
872
+ info: 3,
873
+ success: 3,
874
+ fail: 3,
875
+ ready: 3,
876
+ start: 3,
877
+ box: 3,
878
+ debug: 4,
879
+ trace: 5,
880
+ verbose: Number.POSITIVE_INFINITY
881
+ };
882
+ var LogTypes = {
883
+ // Silent
884
+ silent: {
885
+ level: -1
886
+ },
887
+ // Level 0
888
+ fatal: {
889
+ level: LogLevels.fatal
890
+ },
891
+ error: {
892
+ level: LogLevels.error
893
+ },
894
+ // Level 1
895
+ warn: {
896
+ level: LogLevels.warn
897
+ },
898
+ // Level 2
899
+ log: {
900
+ level: LogLevels.log
901
+ },
902
+ // Level 3
903
+ info: {
904
+ level: LogLevels.info
905
+ },
906
+ success: {
907
+ level: LogLevels.success
908
+ },
909
+ fail: {
910
+ level: LogLevels.fail
911
+ },
912
+ ready: {
913
+ level: LogLevels.info
914
+ },
915
+ start: {
916
+ level: LogLevels.info
917
+ },
918
+ box: {
919
+ level: LogLevels.info
920
+ },
921
+ // Level 4
922
+ debug: {
923
+ level: LogLevels.debug
924
+ },
925
+ // Level 5
926
+ trace: {
927
+ level: LogLevels.trace
928
+ },
929
+ // Verbose
930
+ verbose: {
931
+ level: LogLevels.verbose
932
+ }
933
+ };
934
+ function isPlainObject$1(value) {
935
+ if (value === null || typeof value !== "object") {
936
+ return false;
937
+ }
938
+ const prototype = Object.getPrototypeOf(value);
939
+ if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
940
+ return false;
941
+ }
942
+ if (Symbol.iterator in value) {
943
+ return false;
944
+ }
945
+ if (Symbol.toStringTag in value) {
946
+ return Object.prototype.toString.call(value) === "[object Module]";
947
+ }
948
+ return true;
949
+ }
950
+ function _defu(baseObject, defaults, namespace = ".", merger) {
951
+ if (!isPlainObject$1(defaults)) {
952
+ return _defu(baseObject, {}, namespace, merger);
953
+ }
954
+ const object = Object.assign({}, defaults);
955
+ for (const key in baseObject) {
956
+ if (key === "__proto__" || key === "constructor") {
957
+ continue;
958
+ }
959
+ const value = baseObject[key];
960
+ if (value === null || value === void 0) {
961
+ continue;
962
+ }
963
+ if (merger && merger(object, key, value, namespace)) {
964
+ continue;
965
+ }
966
+ if (Array.isArray(value) && Array.isArray(object[key])) {
967
+ object[key] = [...value, ...object[key]];
968
+ } else if (isPlainObject$1(value) && isPlainObject$1(object[key])) {
969
+ object[key] = _defu(
970
+ value,
971
+ object[key],
972
+ (namespace ? `${namespace}.` : "") + key.toString(),
973
+ merger
974
+ );
975
+ } else {
976
+ object[key] = value;
977
+ }
978
+ }
979
+ return object;
980
+ }
981
+ function createDefu(merger) {
982
+ return (...arguments_) => (
983
+ // eslint-disable-next-line unicorn/no-array-reduce
984
+ arguments_.reduce((p, c3) => _defu(p, c3, "", merger), {})
985
+ );
986
+ }
987
+ var defu = createDefu();
988
+ function isPlainObject(obj) {
989
+ return Object.prototype.toString.call(obj) === "[object Object]";
990
+ }
991
+ function isLogObj(arg) {
992
+ if (!isPlainObject(arg)) {
993
+ return false;
994
+ }
995
+ if (!arg.message && !arg.args) {
996
+ return false;
997
+ }
998
+ if (arg.stack) {
999
+ return false;
1000
+ }
1001
+ return true;
1002
+ }
1003
+ var paused = false;
1004
+ var queue = [];
1005
+ var Consola = class _Consola {
1006
+ options;
1007
+ _lastLog;
1008
+ _mockFn;
1009
+ /**
1010
+ * Creates an instance of Consola with specified options or defaults.
1011
+ *
1012
+ * @param {Partial<ConsolaOptions>} [options={}] - Configuration options for the Consola instance.
1013
+ */
1014
+ constructor(options = {}) {
1015
+ const types = options.types || LogTypes;
1016
+ this.options = defu(
1017
+ {
1018
+ ...options,
1019
+ defaults: { ...options.defaults },
1020
+ level: _normalizeLogLevel(options.level, types),
1021
+ reporters: [...options.reporters || []]
1022
+ },
1023
+ {
1024
+ types: LogTypes,
1025
+ throttle: 1e3,
1026
+ throttleMin: 5,
1027
+ formatOptions: {
1028
+ date: true,
1029
+ colors: false,
1030
+ compact: true
1031
+ }
1032
+ }
1033
+ );
1034
+ for (const type in types) {
1035
+ const defaults = {
1036
+ type,
1037
+ ...this.options.defaults,
1038
+ ...types[type]
1039
+ };
1040
+ this[type] = this._wrapLogFn(defaults);
1041
+ this[type].raw = this._wrapLogFn(
1042
+ defaults,
1043
+ true
1044
+ );
1045
+ }
1046
+ if (this.options.mockFn) {
1047
+ this.mockTypes();
1048
+ }
1049
+ this._lastLog = {};
1050
+ }
1051
+ /**
1052
+ * Gets the current log level of the Consola instance.
1053
+ *
1054
+ * @returns {number} The current log level.
1055
+ */
1056
+ get level() {
1057
+ return this.options.level;
1058
+ }
1059
+ /**
1060
+ * Sets the minimum log level that will be output by the instance.
1061
+ *
1062
+ * @param {number} level - The new log level to set.
1063
+ */
1064
+ set level(level) {
1065
+ this.options.level = _normalizeLogLevel(
1066
+ level,
1067
+ this.options.types,
1068
+ this.options.level
1069
+ );
1070
+ }
1071
+ /**
1072
+ * Displays a prompt to the user and returns the response.
1073
+ * Throw an error if `prompt` is not supported by the current configuration.
1074
+ *
1075
+ * @template T
1076
+ * @param {string} message - The message to display in the prompt.
1077
+ * @param {T} [opts] - Optional options for the prompt. See {@link PromptOptions}.
1078
+ * @returns {promise<T>} A promise that infer with the prompt options. See {@link PromptOptions}.
1079
+ */
1080
+ prompt(message, opts) {
1081
+ if (!this.options.prompt) {
1082
+ throw new Error("prompt is not supported!");
1083
+ }
1084
+ return this.options.prompt(message, opts);
1085
+ }
1086
+ /**
1087
+ * Creates a new instance of Consola, inheriting options from the current instance, with possible overrides.
1088
+ *
1089
+ * @param {Partial<ConsolaOptions>} options - Optional overrides for the new instance. See {@link ConsolaOptions}.
1090
+ * @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
1091
+ */
1092
+ create(options) {
1093
+ const instance = new _Consola({
1094
+ ...this.options,
1095
+ ...options
1096
+ });
1097
+ if (this._mockFn) {
1098
+ instance.mockTypes(this._mockFn);
1099
+ }
1100
+ return instance;
1101
+ }
1102
+ /**
1103
+ * Creates a new Consola instance with the specified default log object properties.
1104
+ *
1105
+ * @param {InputLogObject} defaults - Default properties to include in any log from the new instance. See {@link InputLogObject}.
1106
+ * @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
1107
+ */
1108
+ withDefaults(defaults) {
1109
+ return this.create({
1110
+ ...this.options,
1111
+ defaults: {
1112
+ ...this.options.defaults,
1113
+ ...defaults
1114
+ }
1115
+ });
1116
+ }
1117
+ /**
1118
+ * Creates a new Consola instance with a specified tag, which will be included in every log.
1119
+ *
1120
+ * @param {string} tag - The tag to include in each log of the new instance.
1121
+ * @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
1122
+ */
1123
+ withTag(tag) {
1124
+ return this.withDefaults({
1125
+ tag: this.options.defaults.tag ? this.options.defaults.tag + ":" + tag : tag
1126
+ });
1127
+ }
1128
+ /**
1129
+ * Adds a custom reporter to the Consola instance.
1130
+ * Reporters will be called for each log message, depending on their implementation and log level.
1131
+ *
1132
+ * @param {ConsolaReporter} reporter - The reporter to add. See {@link ConsolaReporter}.
1133
+ * @returns {Consola} The current Consola instance.
1134
+ */
1135
+ addReporter(reporter) {
1136
+ this.options.reporters.push(reporter);
1137
+ return this;
1138
+ }
1139
+ /**
1140
+ * Removes a custom reporter from the Consola instance.
1141
+ * If no reporter is specified, all reporters will be removed.
1142
+ *
1143
+ * @param {ConsolaReporter} reporter - The reporter to remove. See {@link ConsolaReporter}.
1144
+ * @returns {Consola} The current Consola instance.
1145
+ */
1146
+ removeReporter(reporter) {
1147
+ if (reporter) {
1148
+ const i2 = this.options.reporters.indexOf(reporter);
1149
+ if (i2 !== -1) {
1150
+ return this.options.reporters.splice(i2, 1);
1151
+ }
1152
+ } else {
1153
+ this.options.reporters.splice(0);
1154
+ }
1155
+ return this;
1156
+ }
1157
+ /**
1158
+ * Replaces all reporters of the Consola instance with the specified array of reporters.
1159
+ *
1160
+ * @param {ConsolaReporter[]} reporters - The new reporters to set. See {@link ConsolaReporter}.
1161
+ * @returns {Consola} The current Consola instance.
1162
+ */
1163
+ setReporters(reporters) {
1164
+ this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];
1165
+ return this;
1166
+ }
1167
+ wrapAll() {
1168
+ this.wrapConsole();
1169
+ this.wrapStd();
1170
+ }
1171
+ restoreAll() {
1172
+ this.restoreConsole();
1173
+ this.restoreStd();
1174
+ }
1175
+ /**
1176
+ * Overrides console methods with Consola logging methods for consistent logging.
1177
+ */
1178
+ wrapConsole() {
1179
+ for (const type in this.options.types) {
1180
+ if (!console["__" + type]) {
1181
+ console["__" + type] = console[type];
1182
+ }
1183
+ console[type] = this[type].raw;
1184
+ }
1185
+ }
1186
+ /**
1187
+ * Restores the original console methods, removing Consola overrides.
1188
+ */
1189
+ restoreConsole() {
1190
+ for (const type in this.options.types) {
1191
+ if (console["__" + type]) {
1192
+ console[type] = console["__" + type];
1193
+ delete console["__" + type];
1194
+ }
1195
+ }
1196
+ }
1197
+ /**
1198
+ * Overrides standard output and error streams to redirect them through Consola.
1199
+ */
1200
+ wrapStd() {
1201
+ this._wrapStream(this.options.stdout, "log");
1202
+ this._wrapStream(this.options.stderr, "log");
1203
+ }
1204
+ _wrapStream(stream, type) {
1205
+ if (!stream) {
1206
+ return;
1207
+ }
1208
+ if (!stream.__write) {
1209
+ stream.__write = stream.write;
1210
+ }
1211
+ stream.write = (data) => {
1212
+ this[type].raw(String(data).trim());
1213
+ };
1214
+ }
1215
+ /**
1216
+ * Restores the original standard output and error streams, removing the Consola redirection.
1217
+ */
1218
+ restoreStd() {
1219
+ this._restoreStream(this.options.stdout);
1220
+ this._restoreStream(this.options.stderr);
1221
+ }
1222
+ _restoreStream(stream) {
1223
+ if (!stream) {
1224
+ return;
1225
+ }
1226
+ if (stream.__write) {
1227
+ stream.write = stream.__write;
1228
+ delete stream.__write;
1229
+ }
1230
+ }
1231
+ /**
1232
+ * Pauses logging, queues incoming logs until resumed.
1233
+ */
1234
+ pauseLogs() {
1235
+ paused = true;
1236
+ }
1237
+ /**
1238
+ * Resumes logging, processing any queued logs.
1239
+ */
1240
+ resumeLogs() {
1241
+ paused = false;
1242
+ const _queue = queue.splice(0);
1243
+ for (const item of _queue) {
1244
+ item[0]._logFn(item[1], item[2]);
1245
+ }
1246
+ }
1247
+ /**
1248
+ * Replaces logging methods with mocks if a mock function is provided.
1249
+ *
1250
+ * @param {ConsolaOptions["mockFn"]} mockFn - The function to use for mocking logging methods. See {@link ConsolaOptions["mockFn"]}.
1251
+ */
1252
+ mockTypes(mockFn) {
1253
+ const _mockFn = mockFn || this.options.mockFn;
1254
+ this._mockFn = _mockFn;
1255
+ if (typeof _mockFn !== "function") {
1256
+ return;
1257
+ }
1258
+ for (const type in this.options.types) {
1259
+ this[type] = _mockFn(type, this.options.types[type]) || this[type];
1260
+ this[type].raw = this[type];
1261
+ }
1262
+ }
1263
+ _wrapLogFn(defaults, isRaw) {
1264
+ return (...args) => {
1265
+ if (paused) {
1266
+ queue.push([this, defaults, args, isRaw]);
1267
+ return;
1268
+ }
1269
+ return this._logFn(defaults, args, isRaw);
1270
+ };
1271
+ }
1272
+ _logFn(defaults, args, isRaw) {
1273
+ if ((defaults.level || 0) > this.level) {
1274
+ return false;
1275
+ }
1276
+ const logObj = {
1277
+ date: /* @__PURE__ */ new Date(),
1278
+ args: [],
1279
+ ...defaults,
1280
+ level: _normalizeLogLevel(defaults.level, this.options.types)
1281
+ };
1282
+ if (!isRaw && args.length === 1 && isLogObj(args[0])) {
1283
+ Object.assign(logObj, args[0]);
1284
+ } else {
1285
+ logObj.args = [...args];
1286
+ }
1287
+ if (logObj.message) {
1288
+ logObj.args.unshift(logObj.message);
1289
+ delete logObj.message;
1290
+ }
1291
+ if (logObj.additional) {
1292
+ if (!Array.isArray(logObj.additional)) {
1293
+ logObj.additional = logObj.additional.split("\n");
1294
+ }
1295
+ logObj.args.push("\n" + logObj.additional.join("\n"));
1296
+ delete logObj.additional;
1297
+ }
1298
+ logObj.type = typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log";
1299
+ logObj.tag = typeof logObj.tag === "string" ? logObj.tag : "";
1300
+ const resolveLog = (newLog = false) => {
1301
+ const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
1302
+ if (this._lastLog.object && repeated > 0) {
1303
+ const args2 = [...this._lastLog.object.args];
1304
+ if (repeated > 1) {
1305
+ args2.push(`(repeated ${repeated} times)`);
1306
+ }
1307
+ this._log({ ...this._lastLog.object, args: args2 });
1308
+ this._lastLog.count = 1;
1309
+ }
1310
+ if (newLog) {
1311
+ this._lastLog.object = logObj;
1312
+ this._log(logObj);
1313
+ }
1314
+ };
1315
+ clearTimeout(this._lastLog.timeout);
1316
+ const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;
1317
+ this._lastLog.time = logObj.date;
1318
+ if (diffTime < this.options.throttle) {
1319
+ try {
1320
+ const serializedLog = JSON.stringify([
1321
+ logObj.type,
1322
+ logObj.tag,
1323
+ logObj.args
1324
+ ]);
1325
+ const isSameLog = this._lastLog.serialized === serializedLog;
1326
+ this._lastLog.serialized = serializedLog;
1327
+ if (isSameLog) {
1328
+ this._lastLog.count = (this._lastLog.count || 0) + 1;
1329
+ if (this._lastLog.count > this.options.throttleMin) {
1330
+ this._lastLog.timeout = setTimeout(
1331
+ resolveLog,
1332
+ this.options.throttle
1333
+ );
1334
+ return;
1335
+ }
1336
+ }
1337
+ } catch {
1338
+ }
1339
+ }
1340
+ resolveLog(true);
1341
+ }
1342
+ _log(logObj) {
1343
+ for (const reporter of this.options.reporters) {
1344
+ reporter.log(logObj, {
1345
+ options: this.options
1346
+ });
1347
+ }
1348
+ }
1349
+ };
1350
+ function _normalizeLogLevel(input, types = {}, defaultLevel = 3) {
1351
+ if (input === void 0) {
1352
+ return defaultLevel;
1353
+ }
1354
+ if (typeof input === "number") {
1355
+ return input;
1356
+ }
1357
+ if (types[input] && types[input].level !== void 0) {
1358
+ return types[input].level;
1359
+ }
1360
+ return defaultLevel;
1361
+ }
1362
+ Consola.prototype.add = Consola.prototype.addReporter;
1363
+ Consola.prototype.remove = Consola.prototype.removeReporter;
1364
+ Consola.prototype.clear = Consola.prototype.removeReporter;
1365
+ Consola.prototype.withScope = Consola.prototype.withTag;
1366
+ Consola.prototype.mock = Consola.prototype.mockTypes;
1367
+ Consola.prototype.pause = Consola.prototype.pauseLogs;
1368
+ Consola.prototype.resume = Consola.prototype.resumeLogs;
1369
+ function createConsola(options = {}) {
1370
+ return new Consola(options);
1371
+ }
1372
+
1373
+ // ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs
1374
+ import { formatWithOptions } from "util";
1375
+ import { sep } from "path";
1376
+ function parseStack(stack, message) {
1377
+ const cwd = process.cwd() + sep;
1378
+ const lines = stack.split("\n").splice(message.split("\n").length).map((l2) => l2.trim().replace("file://", "").replace(cwd, ""));
1379
+ return lines;
1380
+ }
1381
+ function writeStream(data, stream) {
1382
+ const write = stream.__write || stream.write;
1383
+ return write.call(stream, data);
1384
+ }
1385
+ var bracket = (x2) => x2 ? `[${x2}]` : "";
1386
+ var BasicReporter = class {
1387
+ formatStack(stack, message, opts) {
1388
+ const indent = " ".repeat((opts?.errorLevel || 0) + 1);
1389
+ return indent + parseStack(stack, message).join(`
1390
+ ${indent}`);
1391
+ }
1392
+ formatError(err, opts) {
1393
+ const message = err.message ?? formatWithOptions(opts, err);
1394
+ const stack = err.stack ? this.formatStack(err.stack, message, opts) : "";
1395
+ const level = opts?.errorLevel || 0;
1396
+ const causedPrefix = level > 0 ? `${" ".repeat(level)}[cause]: ` : "";
1397
+ const causedError = err.cause ? "\n\n" + this.formatError(err.cause, { ...opts, errorLevel: level + 1 }) : "";
1398
+ return causedPrefix + message + "\n" + stack + causedError;
1399
+ }
1400
+ formatArgs(args, opts) {
1401
+ const _args = args.map((arg) => {
1402
+ if (arg && typeof arg.stack === "string") {
1403
+ return this.formatError(arg, opts);
1404
+ }
1405
+ return arg;
1406
+ });
1407
+ return formatWithOptions(opts, ..._args);
1408
+ }
1409
+ formatDate(date, opts) {
1410
+ return opts.date ? date.toLocaleTimeString() : "";
1411
+ }
1412
+ filterAndJoin(arr) {
1413
+ return arr.filter(Boolean).join(" ");
1414
+ }
1415
+ formatLogObj(logObj, opts) {
1416
+ const message = this.formatArgs(logObj.args, opts);
1417
+ if (logObj.type === "box") {
1418
+ return "\n" + [
1419
+ bracket(logObj.tag),
1420
+ logObj.title && logObj.title,
1421
+ ...message.split("\n")
1422
+ ].filter(Boolean).map((l2) => " > " + l2).join("\n") + "\n";
1423
+ }
1424
+ return this.filterAndJoin([
1425
+ bracket(logObj.type),
1426
+ bracket(logObj.tag),
1427
+ message
1428
+ ]);
1429
+ }
1430
+ log(logObj, ctx) {
1431
+ const line = this.formatLogObj(logObj, {
1432
+ columns: ctx.options.stdout.columns || 0,
1433
+ ...ctx.options.formatOptions
1434
+ });
1435
+ return writeStream(
1436
+ line + "\n",
1437
+ logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout
1438
+ );
1439
+ }
1440
+ };
1441
+
1442
+ // ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/index.mjs
1443
+ import g$1 from "process";
1444
+
1445
+ // ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs
1446
+ import * as tty from "tty";
1447
+ var {
1448
+ env = {},
1449
+ argv = [],
1450
+ platform = ""
1451
+ } = typeof process === "undefined" ? {} : process;
1452
+ var isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
1453
+ var isForced = "FORCE_COLOR" in env || argv.includes("--color");
1454
+ var isWindows = platform === "win32";
1455
+ var isDumbTerminal = env.TERM === "dumb";
1456
+ var isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env.TERM && !isDumbTerminal;
1457
+ var isCI = "CI" in env && ("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "CIRCLECI" in env);
1458
+ var isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
1459
+ function replaceClose(index, string, close, replace, head = string.slice(0, Math.max(0, index)) + replace, tail = string.slice(Math.max(0, index + close.length)), next = tail.indexOf(close)) {
1460
+ return head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
1461
+ }
1462
+ function clearBleed(index, string, open, close, replace) {
1463
+ return index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
1464
+ }
1465
+ function filterEmpty(open, close, replace = open, at = open.length + 1) {
1466
+ return (string) => string || !(string === "" || string === void 0) ? clearBleed(
1467
+ ("" + string).indexOf(close, at),
1468
+ string,
1469
+ open,
1470
+ close,
1471
+ replace
1472
+ ) : "";
1473
+ }
1474
+ function init(open, close, replace) {
1475
+ return filterEmpty(`\x1B[${open}m`, `\x1B[${close}m`, replace);
1476
+ }
1477
+ var colorDefs = {
1478
+ reset: init(0, 0),
1479
+ bold: init(1, 22, "\x1B[22m\x1B[1m"),
1480
+ dim: init(2, 22, "\x1B[22m\x1B[2m"),
1481
+ italic: init(3, 23),
1482
+ underline: init(4, 24),
1483
+ inverse: init(7, 27),
1484
+ hidden: init(8, 28),
1485
+ strikethrough: init(9, 29),
1486
+ black: init(30, 39),
1487
+ red: init(31, 39),
1488
+ green: init(32, 39),
1489
+ yellow: init(33, 39),
1490
+ blue: init(34, 39),
1491
+ magenta: init(35, 39),
1492
+ cyan: init(36, 39),
1493
+ white: init(37, 39),
1494
+ gray: init(90, 39),
1495
+ bgBlack: init(40, 49),
1496
+ bgRed: init(41, 49),
1497
+ bgGreen: init(42, 49),
1498
+ bgYellow: init(43, 49),
1499
+ bgBlue: init(44, 49),
1500
+ bgMagenta: init(45, 49),
1501
+ bgCyan: init(46, 49),
1502
+ bgWhite: init(47, 49),
1503
+ blackBright: init(90, 39),
1504
+ redBright: init(91, 39),
1505
+ greenBright: init(92, 39),
1506
+ yellowBright: init(93, 39),
1507
+ blueBright: init(94, 39),
1508
+ magentaBright: init(95, 39),
1509
+ cyanBright: init(96, 39),
1510
+ whiteBright: init(97, 39),
1511
+ bgBlackBright: init(100, 49),
1512
+ bgRedBright: init(101, 49),
1513
+ bgGreenBright: init(102, 49),
1514
+ bgYellowBright: init(103, 49),
1515
+ bgBlueBright: init(104, 49),
1516
+ bgMagentaBright: init(105, 49),
1517
+ bgCyanBright: init(106, 49),
1518
+ bgWhiteBright: init(107, 49)
1519
+ };
1520
+ function createColors(useColor = isColorSupported) {
1521
+ return useColor ? colorDefs : Object.fromEntries(Object.keys(colorDefs).map((key) => [key, String]));
1522
+ }
1523
+ var colors = createColors();
1524
+ function getColor(color, fallback = "reset") {
1525
+ return colors[color] || colors[fallback];
1526
+ }
1527
+ var ansiRegex = [
1528
+ String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`,
1529
+ String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`
1530
+ ].join("|");
1531
+ function stripAnsi(text) {
1532
+ return text.replace(new RegExp(ansiRegex, "g"), "");
1533
+ }
1534
+ var boxStylePresets = {
1535
+ solid: {
1536
+ tl: "\u250C",
1537
+ tr: "\u2510",
1538
+ bl: "\u2514",
1539
+ br: "\u2518",
1540
+ h: "\u2500",
1541
+ v: "\u2502"
1542
+ },
1543
+ double: {
1544
+ tl: "\u2554",
1545
+ tr: "\u2557",
1546
+ bl: "\u255A",
1547
+ br: "\u255D",
1548
+ h: "\u2550",
1549
+ v: "\u2551"
1550
+ },
1551
+ doubleSingle: {
1552
+ tl: "\u2553",
1553
+ tr: "\u2556",
1554
+ bl: "\u2559",
1555
+ br: "\u255C",
1556
+ h: "\u2500",
1557
+ v: "\u2551"
1558
+ },
1559
+ doubleSingleRounded: {
1560
+ tl: "\u256D",
1561
+ tr: "\u256E",
1562
+ bl: "\u2570",
1563
+ br: "\u256F",
1564
+ h: "\u2500",
1565
+ v: "\u2551"
1566
+ },
1567
+ singleThick: {
1568
+ tl: "\u250F",
1569
+ tr: "\u2513",
1570
+ bl: "\u2517",
1571
+ br: "\u251B",
1572
+ h: "\u2501",
1573
+ v: "\u2503"
1574
+ },
1575
+ singleDouble: {
1576
+ tl: "\u2552",
1577
+ tr: "\u2555",
1578
+ bl: "\u2558",
1579
+ br: "\u255B",
1580
+ h: "\u2550",
1581
+ v: "\u2502"
1582
+ },
1583
+ singleDoubleRounded: {
1584
+ tl: "\u256D",
1585
+ tr: "\u256E",
1586
+ bl: "\u2570",
1587
+ br: "\u256F",
1588
+ h: "\u2550",
1589
+ v: "\u2502"
1590
+ },
1591
+ rounded: {
1592
+ tl: "\u256D",
1593
+ tr: "\u256E",
1594
+ bl: "\u2570",
1595
+ br: "\u256F",
1596
+ h: "\u2500",
1597
+ v: "\u2502"
1598
+ }
1599
+ };
1600
+ var defaultStyle = {
1601
+ borderColor: "white",
1602
+ borderStyle: "rounded",
1603
+ valign: "center",
1604
+ padding: 2,
1605
+ marginLeft: 1,
1606
+ marginTop: 1,
1607
+ marginBottom: 1
1608
+ };
1609
+ function box(text, _opts = {}) {
1610
+ const opts = {
1611
+ ..._opts,
1612
+ style: {
1613
+ ...defaultStyle,
1614
+ ..._opts.style
1615
+ }
1616
+ };
1617
+ const textLines = text.split("\n");
1618
+ const boxLines = [];
1619
+ const _color = getColor(opts.style.borderColor);
1620
+ const borderStyle = {
1621
+ ...typeof opts.style.borderStyle === "string" ? boxStylePresets[opts.style.borderStyle] || boxStylePresets.solid : opts.style.borderStyle
1622
+ };
1623
+ if (_color) {
1624
+ for (const key in borderStyle) {
1625
+ borderStyle[key] = _color(
1626
+ borderStyle[key]
1627
+ );
1628
+ }
1629
+ }
1630
+ const paddingOffset = opts.style.padding % 2 === 0 ? opts.style.padding : opts.style.padding + 1;
1631
+ const height = textLines.length + paddingOffset;
1632
+ const width = Math.max(
1633
+ ...textLines.map((line) => stripAnsi(line).length),
1634
+ opts.title ? stripAnsi(opts.title).length : 0
1635
+ ) + paddingOffset;
1636
+ const widthOffset = width + paddingOffset;
1637
+ const leftSpace = opts.style.marginLeft > 0 ? " ".repeat(opts.style.marginLeft) : "";
1638
+ if (opts.style.marginTop > 0) {
1639
+ boxLines.push("".repeat(opts.style.marginTop));
1640
+ }
1641
+ if (opts.title) {
1642
+ const title = _color ? _color(opts.title) : opts.title;
1643
+ const left = borderStyle.h.repeat(
1644
+ Math.floor((width - stripAnsi(opts.title).length) / 2)
1645
+ );
1646
+ const right = borderStyle.h.repeat(
1647
+ width - stripAnsi(opts.title).length - stripAnsi(left).length + paddingOffset
1648
+ );
1649
+ boxLines.push(
1650
+ `${leftSpace}${borderStyle.tl}${left}${title}${right}${borderStyle.tr}`
1651
+ );
1652
+ } else {
1653
+ boxLines.push(
1654
+ `${leftSpace}${borderStyle.tl}${borderStyle.h.repeat(widthOffset)}${borderStyle.tr}`
1655
+ );
1656
+ }
1657
+ const valignOffset = opts.style.valign === "center" ? Math.floor((height - textLines.length) / 2) : opts.style.valign === "top" ? height - textLines.length - paddingOffset : height - textLines.length;
1658
+ for (let i2 = 0; i2 < height; i2++) {
1659
+ if (i2 < valignOffset || i2 >= valignOffset + textLines.length) {
1660
+ boxLines.push(
1661
+ `${leftSpace}${borderStyle.v}${" ".repeat(widthOffset)}${borderStyle.v}`
1662
+ );
1663
+ } else {
1664
+ const line = textLines[i2 - valignOffset];
1665
+ const left = " ".repeat(paddingOffset);
1666
+ const right = " ".repeat(width - stripAnsi(line).length);
1667
+ boxLines.push(
1668
+ `${leftSpace}${borderStyle.v}${left}${line}${right}${borderStyle.v}`
1669
+ );
1670
+ }
1671
+ }
1672
+ boxLines.push(
1673
+ `${leftSpace}${borderStyle.bl}${borderStyle.h.repeat(widthOffset)}${borderStyle.br}`
1674
+ );
1675
+ if (opts.style.marginBottom > 0) {
1676
+ boxLines.push("".repeat(opts.style.marginBottom));
1677
+ }
1678
+ return boxLines.join("\n");
1679
+ }
1680
+
1681
+ // ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/index.mjs
1682
+ import "util";
1683
+ import "path";
1684
+ import "tty";
1685
+ var r2 = /* @__PURE__ */ Object.create(null);
1686
+ var i = (e2) => globalThis.process?.env || import.meta.env || globalThis.Deno?.env.toObject() || globalThis.__env__ || (e2 ? r2 : globalThis);
1687
+ var o2 = new Proxy(r2, { get(e2, s2) {
1688
+ return i()[s2] ?? r2[s2];
1689
+ }, has(e2, s2) {
1690
+ const E = i();
1691
+ return s2 in E || s2 in r2;
1692
+ }, set(e2, s2, E) {
1693
+ const B2 = i(true);
1694
+ return B2[s2] = E, true;
1695
+ }, deleteProperty(e2, s2) {
1696
+ if (!s2) return false;
1697
+ const E = i(true);
1698
+ return delete E[s2], true;
1699
+ }, ownKeys() {
1700
+ const e2 = i(true);
1701
+ return Object.keys(e2);
1702
+ } });
1703
+ var t = typeof process < "u" && process.env && process.env.NODE_ENV || "";
1704
+ var f2 = [["APPVEYOR"], ["AWS_AMPLIFY", "AWS_APP_ID", { ci: true }], ["AZURE_PIPELINES", "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"], ["AZURE_STATIC", "INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"], ["APPCIRCLE", "AC_APPCIRCLE"], ["BAMBOO", "bamboo_planKey"], ["BITBUCKET", "BITBUCKET_COMMIT"], ["BITRISE", "BITRISE_IO"], ["BUDDY", "BUDDY_WORKSPACE_ID"], ["BUILDKITE"], ["CIRCLE", "CIRCLECI"], ["CIRRUS", "CIRRUS_CI"], ["CLOUDFLARE_PAGES", "CF_PAGES", { ci: true }], ["CODEBUILD", "CODEBUILD_BUILD_ARN"], ["CODEFRESH", "CF_BUILD_ID"], ["DRONE"], ["DRONE", "DRONE_BUILD_EVENT"], ["DSARI"], ["GITHUB_ACTIONS"], ["GITLAB", "GITLAB_CI"], ["GITLAB", "CI_MERGE_REQUEST_ID"], ["GOCD", "GO_PIPELINE_LABEL"], ["LAYERCI"], ["HUDSON", "HUDSON_URL"], ["JENKINS", "JENKINS_URL"], ["MAGNUM"], ["NETLIFY"], ["NETLIFY", "NETLIFY_LOCAL", { ci: false }], ["NEVERCODE"], ["RENDER"], ["SAIL", "SAILCI"], ["SEMAPHORE"], ["SCREWDRIVER"], ["SHIPPABLE"], ["SOLANO", "TDDIUM"], ["STRIDER"], ["TEAMCITY", "TEAMCITY_VERSION"], ["TRAVIS"], ["VERCEL", "NOW_BUILDER"], ["VERCEL", "VERCEL", { ci: false }], ["VERCEL", "VERCEL_ENV", { ci: false }], ["APPCENTER", "APPCENTER_BUILD_ID"], ["CODESANDBOX", "CODESANDBOX_SSE", { ci: false }], ["CODESANDBOX", "CODESANDBOX_HOST", { ci: false }], ["STACKBLITZ"], ["STORMKIT"], ["CLEAVR"], ["ZEABUR"], ["CODESPHERE", "CODESPHERE_APP_ID", { ci: true }], ["RAILWAY", "RAILWAY_PROJECT_ID"], ["RAILWAY", "RAILWAY_SERVICE_ID"], ["DENO-DEPLOY", "DENO_DEPLOYMENT_ID"], ["FIREBASE_APP_HOSTING", "FIREBASE_APP_HOSTING", { ci: true }]];
1705
+ function b() {
1706
+ if (globalThis.process?.env) for (const e2 of f2) {
1707
+ const s2 = e2[1] || e2[0];
1708
+ if (globalThis.process?.env[s2]) return { name: e2[0].toLowerCase(), ...e2[2] };
1709
+ }
1710
+ return globalThis.process?.env?.SHELL === "/bin/jsh" && globalThis.process?.versions?.webcontainer ? { name: "stackblitz", ci: false } : { name: "", ci: false };
1711
+ }
1712
+ var l = b();
1713
+ l.name;
1714
+ function n(e2) {
1715
+ return e2 ? e2 !== "false" : false;
1716
+ }
1717
+ var I2 = globalThis.process?.platform || "";
1718
+ var T2 = n(o2.CI) || l.ci !== false;
1719
+ var a = n(globalThis.process?.stdout && globalThis.process?.stdout.isTTY);
1720
+ var g2 = n(o2.DEBUG);
1721
+ var R2 = t === "test" || n(o2.TEST);
1722
+ n(o2.MINIMAL) || T2 || R2 || !a;
1723
+ var A2 = /^win/i.test(I2);
1724
+ !n(o2.NO_COLOR) && (n(o2.FORCE_COLOR) || (a || A2) && o2.TERM !== "dumb" || T2);
1725
+ var C2 = (globalThis.process?.versions?.node || "").replace(/^v/, "") || null;
1726
+ Number(C2?.split(".")[0]) || null;
1727
+ var y2 = globalThis.process || /* @__PURE__ */ Object.create(null);
1728
+ var _2 = { versions: {} };
1729
+ new Proxy(y2, { get(e2, s2) {
1730
+ if (s2 === "env") return o2;
1731
+ if (s2 in e2) return e2[s2];
1732
+ if (s2 in _2) return _2[s2];
1733
+ } });
1734
+ var c2 = globalThis.process?.release?.name === "node";
1735
+ var O2 = !!globalThis.Bun || !!globalThis.process?.versions?.bun;
1736
+ var D = !!globalThis.Deno;
1737
+ var L2 = !!globalThis.fastly;
1738
+ var S2 = !!globalThis.Netlify;
1739
+ var u2 = !!globalThis.EdgeRuntime;
1740
+ var N2 = globalThis.navigator?.userAgent === "Cloudflare-Workers";
1741
+ var F2 = [[S2, "netlify"], [u2, "edge-light"], [N2, "workerd"], [L2, "fastly"], [D, "deno"], [O2, "bun"], [c2, "node"]];
1742
+ function G2() {
1743
+ const e2 = F2.find((s2) => s2[0]);
1744
+ if (e2) return { name: e2[1] };
1745
+ }
1746
+ var P2 = G2();
1747
+ P2?.name || "";
1748
+ function ansiRegex2({ onlyFirst = false } = {}) {
1749
+ const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
1750
+ const pattern = [
1751
+ `[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?${ST})`,
1752
+ "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"
1753
+ ].join("|");
1754
+ return new RegExp(pattern, onlyFirst ? void 0 : "g");
1755
+ }
1756
+ var regex = ansiRegex2();
1757
+ function stripAnsi2(string) {
1758
+ if (typeof string !== "string") {
1759
+ throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
1760
+ }
1761
+ return string.replace(regex, "");
1762
+ }
1763
+ function isAmbiguous(x2) {
1764
+ return x2 === 161 || x2 === 164 || x2 === 167 || x2 === 168 || x2 === 170 || x2 === 173 || x2 === 174 || x2 >= 176 && x2 <= 180 || x2 >= 182 && x2 <= 186 || x2 >= 188 && x2 <= 191 || x2 === 198 || x2 === 208 || x2 === 215 || x2 === 216 || x2 >= 222 && x2 <= 225 || x2 === 230 || x2 >= 232 && x2 <= 234 || x2 === 236 || x2 === 237 || x2 === 240 || x2 === 242 || x2 === 243 || x2 >= 247 && x2 <= 250 || x2 === 252 || x2 === 254 || x2 === 257 || x2 === 273 || x2 === 275 || x2 === 283 || x2 === 294 || x2 === 295 || x2 === 299 || x2 >= 305 && x2 <= 307 || x2 === 312 || x2 >= 319 && x2 <= 322 || x2 === 324 || x2 >= 328 && x2 <= 331 || x2 === 333 || x2 === 338 || x2 === 339 || x2 === 358 || x2 === 359 || x2 === 363 || x2 === 462 || x2 === 464 || x2 === 466 || x2 === 468 || x2 === 470 || x2 === 472 || x2 === 474 || x2 === 476 || x2 === 593 || x2 === 609 || x2 === 708 || x2 === 711 || x2 >= 713 && x2 <= 715 || x2 === 717 || x2 === 720 || x2 >= 728 && x2 <= 731 || x2 === 733 || x2 === 735 || x2 >= 768 && x2 <= 879 || x2 >= 913 && x2 <= 929 || x2 >= 931 && x2 <= 937 || x2 >= 945 && x2 <= 961 || x2 >= 963 && x2 <= 969 || x2 === 1025 || x2 >= 1040 && x2 <= 1103 || x2 === 1105 || x2 === 8208 || x2 >= 8211 && x2 <= 8214 || x2 === 8216 || x2 === 8217 || x2 === 8220 || x2 === 8221 || x2 >= 8224 && x2 <= 8226 || x2 >= 8228 && x2 <= 8231 || x2 === 8240 || x2 === 8242 || x2 === 8243 || x2 === 8245 || x2 === 8251 || x2 === 8254 || x2 === 8308 || x2 === 8319 || x2 >= 8321 && x2 <= 8324 || x2 === 8364 || x2 === 8451 || x2 === 8453 || x2 === 8457 || x2 === 8467 || x2 === 8470 || x2 === 8481 || x2 === 8482 || x2 === 8486 || x2 === 8491 || x2 === 8531 || x2 === 8532 || x2 >= 8539 && x2 <= 8542 || x2 >= 8544 && x2 <= 8555 || x2 >= 8560 && x2 <= 8569 || x2 === 8585 || x2 >= 8592 && x2 <= 8601 || x2 === 8632 || x2 === 8633 || x2 === 8658 || x2 === 8660 || x2 === 8679 || x2 === 8704 || x2 === 8706 || x2 === 8707 || x2 === 8711 || x2 === 8712 || x2 === 8715 || x2 === 8719 || x2 === 8721 || x2 === 8725 || x2 === 8730 || x2 >= 8733 && x2 <= 8736 || x2 === 8739 || x2 === 8741 || x2 >= 8743 && x2 <= 8748 || x2 === 8750 || x2 >= 8756 && x2 <= 8759 || x2 === 8764 || x2 === 8765 || x2 === 8776 || x2 === 8780 || x2 === 8786 || x2 === 8800 || x2 === 8801 || x2 >= 8804 && x2 <= 8807 || x2 === 8810 || x2 === 8811 || x2 === 8814 || x2 === 8815 || x2 === 8834 || x2 === 8835 || x2 === 8838 || x2 === 8839 || x2 === 8853 || x2 === 8857 || x2 === 8869 || x2 === 8895 || x2 === 8978 || x2 >= 9312 && x2 <= 9449 || x2 >= 9451 && x2 <= 9547 || x2 >= 9552 && x2 <= 9587 || x2 >= 9600 && x2 <= 9615 || x2 >= 9618 && x2 <= 9621 || x2 === 9632 || x2 === 9633 || x2 >= 9635 && x2 <= 9641 || x2 === 9650 || x2 === 9651 || x2 === 9654 || x2 === 9655 || x2 === 9660 || x2 === 9661 || x2 === 9664 || x2 === 9665 || x2 >= 9670 && x2 <= 9672 || x2 === 9675 || x2 >= 9678 && x2 <= 9681 || x2 >= 9698 && x2 <= 9701 || x2 === 9711 || x2 === 9733 || x2 === 9734 || x2 === 9737 || x2 === 9742 || x2 === 9743 || x2 === 9756 || x2 === 9758 || x2 === 9792 || x2 === 9794 || x2 === 9824 || x2 === 9825 || x2 >= 9827 && x2 <= 9829 || x2 >= 9831 && x2 <= 9834 || x2 === 9836 || x2 === 9837 || x2 === 9839 || x2 === 9886 || x2 === 9887 || x2 === 9919 || x2 >= 9926 && x2 <= 9933 || x2 >= 9935 && x2 <= 9939 || x2 >= 9941 && x2 <= 9953 || x2 === 9955 || x2 === 9960 || x2 === 9961 || x2 >= 9963 && x2 <= 9969 || x2 === 9972 || x2 >= 9974 && x2 <= 9977 || x2 === 9979 || x2 === 9980 || x2 === 9982 || x2 === 9983 || x2 === 10045 || x2 >= 10102 && x2 <= 10111 || x2 >= 11094 && x2 <= 11097 || x2 >= 12872 && x2 <= 12879 || x2 >= 57344 && x2 <= 63743 || x2 >= 65024 && x2 <= 65039 || x2 === 65533 || x2 >= 127232 && x2 <= 127242 || x2 >= 127248 && x2 <= 127277 || x2 >= 127280 && x2 <= 127337 || x2 >= 127344 && x2 <= 127373 || x2 === 127375 || x2 === 127376 || x2 >= 127387 && x2 <= 127404 || x2 >= 917760 && x2 <= 917999 || x2 >= 983040 && x2 <= 1048573 || x2 >= 1048576 && x2 <= 1114109;
1765
+ }
1766
+ function isFullWidth(x2) {
1767
+ return x2 === 12288 || x2 >= 65281 && x2 <= 65376 || x2 >= 65504 && x2 <= 65510;
1768
+ }
1769
+ function isWide(x2) {
1770
+ return x2 >= 4352 && x2 <= 4447 || x2 === 8986 || x2 === 8987 || x2 === 9001 || x2 === 9002 || x2 >= 9193 && x2 <= 9196 || x2 === 9200 || x2 === 9203 || x2 === 9725 || x2 === 9726 || x2 === 9748 || x2 === 9749 || x2 >= 9776 && x2 <= 9783 || x2 >= 9800 && x2 <= 9811 || x2 === 9855 || x2 >= 9866 && x2 <= 9871 || x2 === 9875 || x2 === 9889 || x2 === 9898 || x2 === 9899 || x2 === 9917 || x2 === 9918 || x2 === 9924 || x2 === 9925 || x2 === 9934 || x2 === 9940 || x2 === 9962 || x2 === 9970 || x2 === 9971 || x2 === 9973 || x2 === 9978 || x2 === 9981 || x2 === 9989 || x2 === 9994 || x2 === 9995 || x2 === 10024 || x2 === 10060 || x2 === 10062 || x2 >= 10067 && x2 <= 10069 || x2 === 10071 || x2 >= 10133 && x2 <= 10135 || x2 === 10160 || x2 === 10175 || x2 === 11035 || x2 === 11036 || x2 === 11088 || x2 === 11093 || x2 >= 11904 && x2 <= 11929 || x2 >= 11931 && x2 <= 12019 || x2 >= 12032 && x2 <= 12245 || x2 >= 12272 && x2 <= 12287 || x2 >= 12289 && x2 <= 12350 || x2 >= 12353 && x2 <= 12438 || x2 >= 12441 && x2 <= 12543 || x2 >= 12549 && x2 <= 12591 || x2 >= 12593 && x2 <= 12686 || x2 >= 12688 && x2 <= 12773 || x2 >= 12783 && x2 <= 12830 || x2 >= 12832 && x2 <= 12871 || x2 >= 12880 && x2 <= 42124 || x2 >= 42128 && x2 <= 42182 || x2 >= 43360 && x2 <= 43388 || x2 >= 44032 && x2 <= 55203 || x2 >= 63744 && x2 <= 64255 || x2 >= 65040 && x2 <= 65049 || x2 >= 65072 && x2 <= 65106 || x2 >= 65108 && x2 <= 65126 || x2 >= 65128 && x2 <= 65131 || x2 >= 94176 && x2 <= 94180 || x2 === 94192 || x2 === 94193 || x2 >= 94208 && x2 <= 100343 || x2 >= 100352 && x2 <= 101589 || x2 >= 101631 && x2 <= 101640 || x2 >= 110576 && x2 <= 110579 || x2 >= 110581 && x2 <= 110587 || x2 === 110589 || x2 === 110590 || x2 >= 110592 && x2 <= 110882 || x2 === 110898 || x2 >= 110928 && x2 <= 110930 || x2 === 110933 || x2 >= 110948 && x2 <= 110951 || x2 >= 110960 && x2 <= 111355 || x2 >= 119552 && x2 <= 119638 || x2 >= 119648 && x2 <= 119670 || x2 === 126980 || x2 === 127183 || x2 === 127374 || x2 >= 127377 && x2 <= 127386 || x2 >= 127488 && x2 <= 127490 || x2 >= 127504 && x2 <= 127547 || x2 >= 127552 && x2 <= 127560 || x2 === 127568 || x2 === 127569 || x2 >= 127584 && x2 <= 127589 || x2 >= 127744 && x2 <= 127776 || x2 >= 127789 && x2 <= 127797 || x2 >= 127799 && x2 <= 127868 || x2 >= 127870 && x2 <= 127891 || x2 >= 127904 && x2 <= 127946 || x2 >= 127951 && x2 <= 127955 || x2 >= 127968 && x2 <= 127984 || x2 === 127988 || x2 >= 127992 && x2 <= 128062 || x2 === 128064 || x2 >= 128066 && x2 <= 128252 || x2 >= 128255 && x2 <= 128317 || x2 >= 128331 && x2 <= 128334 || x2 >= 128336 && x2 <= 128359 || x2 === 128378 || x2 === 128405 || x2 === 128406 || x2 === 128420 || x2 >= 128507 && x2 <= 128591 || x2 >= 128640 && x2 <= 128709 || x2 === 128716 || x2 >= 128720 && x2 <= 128722 || x2 >= 128725 && x2 <= 128727 || x2 >= 128732 && x2 <= 128735 || x2 === 128747 || x2 === 128748 || x2 >= 128756 && x2 <= 128764 || x2 >= 128992 && x2 <= 129003 || x2 === 129008 || x2 >= 129292 && x2 <= 129338 || x2 >= 129340 && x2 <= 129349 || x2 >= 129351 && x2 <= 129535 || x2 >= 129648 && x2 <= 129660 || x2 >= 129664 && x2 <= 129673 || x2 >= 129679 && x2 <= 129734 || x2 >= 129742 && x2 <= 129756 || x2 >= 129759 && x2 <= 129769 || x2 >= 129776 && x2 <= 129784 || x2 >= 131072 && x2 <= 196605 || x2 >= 196608 && x2 <= 262141;
1771
+ }
1772
+ function validate(codePoint) {
1773
+ if (!Number.isSafeInteger(codePoint)) {
1774
+ throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
1775
+ }
1776
+ }
1777
+ function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
1778
+ validate(codePoint);
1779
+ if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) {
1780
+ return 2;
1781
+ }
1782
+ return 1;
1783
+ }
1784
+ var emojiRegex = () => {
1785
+ 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\uDC70\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-\uDED7\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\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\uDD3D\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-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\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]|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\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;
1786
+ };
1787
+ var segmenter = globalThis.Intl?.Segmenter ? new Intl.Segmenter() : { segment: (str) => str.split("") };
1788
+ var defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
1789
+ function stringWidth$1(string, options = {}) {
1790
+ if (typeof string !== "string" || string.length === 0) {
1791
+ return 0;
1792
+ }
1793
+ const {
1794
+ ambiguousIsNarrow = true,
1795
+ countAnsiEscapeCodes = false
1796
+ } = options;
1797
+ if (!countAnsiEscapeCodes) {
1798
+ string = stripAnsi2(string);
1799
+ }
1800
+ if (string.length === 0) {
1801
+ return 0;
1802
+ }
1803
+ let width = 0;
1804
+ const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
1805
+ for (const { segment: character } of segmenter.segment(string)) {
1806
+ const codePoint = character.codePointAt(0);
1807
+ if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
1808
+ continue;
1809
+ }
1810
+ if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) {
1811
+ continue;
1812
+ }
1813
+ if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) {
1814
+ continue;
1815
+ }
1816
+ if (codePoint >= 55296 && codePoint <= 57343) {
1817
+ continue;
1818
+ }
1819
+ if (codePoint >= 65024 && codePoint <= 65039) {
1820
+ continue;
1821
+ }
1822
+ if (defaultIgnorableCodePointRegex.test(character)) {
1823
+ continue;
1824
+ }
1825
+ if (emojiRegex().test(character)) {
1826
+ width += 2;
1827
+ continue;
1828
+ }
1829
+ width += eastAsianWidth(codePoint, eastAsianWidthOptions);
1830
+ }
1831
+ return width;
1832
+ }
1833
+ function isUnicodeSupported() {
1834
+ const { env: env2 } = g$1;
1835
+ const { TERM, TERM_PROGRAM } = env2;
1836
+ if (g$1.platform !== "win32") {
1837
+ return TERM !== "linux";
1838
+ }
1839
+ return Boolean(env2.WT_SESSION) || Boolean(env2.TERMINUS_SUBLIME) || env2.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env2.TERMINAL_EMULATOR === "JetBrains-JediTerm";
1840
+ }
1841
+ var TYPE_COLOR_MAP = {
1842
+ info: "cyan",
1843
+ fail: "red",
1844
+ success: "green",
1845
+ ready: "green",
1846
+ start: "magenta"
1847
+ };
1848
+ var LEVEL_COLOR_MAP = {
1849
+ 0: "red",
1850
+ 1: "yellow"
1851
+ };
1852
+ var unicode = isUnicodeSupported();
1853
+ var s = (c3, fallback) => unicode ? c3 : fallback;
1854
+ var TYPE_ICONS = {
1855
+ error: s("\u2716", "\xD7"),
1856
+ fatal: s("\u2716", "\xD7"),
1857
+ ready: s("\u2714", "\u221A"),
1858
+ warn: s("\u26A0", "\u203C"),
1859
+ info: s("\u2139", "i"),
1860
+ success: s("\u2714", "\u221A"),
1861
+ debug: s("\u2699", "D"),
1862
+ trace: s("\u2192", "\u2192"),
1863
+ fail: s("\u2716", "\xD7"),
1864
+ start: s("\u25D0", "o"),
1865
+ log: ""
1866
+ };
1867
+ function stringWidth(str) {
1868
+ const hasICU = typeof Intl === "object";
1869
+ if (!hasICU || !Intl.Segmenter) {
1870
+ return stripAnsi(str).length;
1871
+ }
1872
+ return stringWidth$1(str);
1873
+ }
1874
+ var FancyReporter = class extends BasicReporter {
1875
+ formatStack(stack, message, opts) {
1876
+ const indent = " ".repeat((opts?.errorLevel || 0) + 1);
1877
+ return `
1878
+ ${indent}` + parseStack(stack, message).map(
1879
+ (line) => " " + line.replace(/^at +/, (m2) => colors.gray(m2)).replace(/\((.+)\)/, (_3, m2) => `(${colors.cyan(m2)})`)
1880
+ ).join(`
1881
+ ${indent}`);
1882
+ }
1883
+ formatType(logObj, isBadge, opts) {
1884
+ const typeColor = TYPE_COLOR_MAP[logObj.type] || LEVEL_COLOR_MAP[logObj.level] || "gray";
1885
+ if (isBadge) {
1886
+ return getBgColor(typeColor)(
1887
+ colors.black(` ${logObj.type.toUpperCase()} `)
1888
+ );
1889
+ }
1890
+ const _type = typeof TYPE_ICONS[logObj.type] === "string" ? TYPE_ICONS[logObj.type] : logObj.icon || logObj.type;
1891
+ return _type ? getColor2(typeColor)(_type) : "";
1892
+ }
1893
+ formatLogObj(logObj, opts) {
1894
+ const [message, ...additional] = this.formatArgs(logObj.args, opts).split(
1895
+ "\n"
1896
+ );
1897
+ if (logObj.type === "box") {
1898
+ return box(
1899
+ characterFormat(
1900
+ message + (additional.length > 0 ? "\n" + additional.join("\n") : "")
1901
+ ),
1902
+ {
1903
+ title: logObj.title ? characterFormat(logObj.title) : void 0,
1904
+ style: logObj.style
1905
+ }
1906
+ );
1907
+ }
1908
+ const date = this.formatDate(logObj.date, opts);
1909
+ const coloredDate = date && colors.gray(date);
1910
+ const isBadge = logObj.badge ?? logObj.level < 2;
1911
+ const type = this.formatType(logObj, isBadge, opts);
1912
+ const tag = logObj.tag ? colors.gray(logObj.tag) : "";
1913
+ let line;
1914
+ const left = this.filterAndJoin([type, characterFormat(message)]);
1915
+ const right = this.filterAndJoin(opts.columns ? [tag, coloredDate] : [tag]);
1916
+ const space = (opts.columns || 0) - stringWidth(left) - stringWidth(right) - 2;
1917
+ line = space > 0 && (opts.columns || 0) >= 80 ? left + " ".repeat(space) + right : (right ? `${colors.gray(`[${right}]`)} ` : "") + left;
1918
+ line += characterFormat(
1919
+ additional.length > 0 ? "\n" + additional.join("\n") : ""
1920
+ );
1921
+ if (logObj.type === "trace") {
1922
+ const _err = new Error("Trace: " + logObj.message);
1923
+ line += this.formatStack(_err.stack || "", _err.message);
1924
+ }
1925
+ return isBadge ? "\n" + line + "\n" : line;
1926
+ }
1927
+ };
1928
+ function characterFormat(str) {
1929
+ return str.replace(/`([^`]+)`/gm, (_3, m2) => colors.cyan(m2)).replace(/\s+_([^_]+)_\s+/gm, (_3, m2) => ` ${colors.underline(m2)} `);
1930
+ }
1931
+ function getColor2(color = "white") {
1932
+ return colors[color] || colors.white;
1933
+ }
1934
+ function getBgColor(color = "bgWhite") {
1935
+ return colors[`bg${color[0].toUpperCase()}${color.slice(1)}`] || colors.bgWhite;
1936
+ }
1937
+ function createConsola2(options = {}) {
1938
+ let level = _getDefaultLogLevel();
1939
+ if (process.env.CONSOLA_LEVEL) {
1940
+ level = Number.parseInt(process.env.CONSOLA_LEVEL) ?? level;
1941
+ }
1942
+ const consola2 = createConsola({
1943
+ level,
1944
+ defaults: { level },
1945
+ stdout: process.stdout,
1946
+ stderr: process.stderr,
1947
+ prompt: (...args) => Promise.resolve().then(() => (init_prompt(), prompt_exports)).then((m2) => m2.prompt(...args)),
1948
+ reporters: options.reporters || [
1949
+ options.fancy ?? !(T2 || R2) ? new FancyReporter() : new BasicReporter()
1950
+ ],
1951
+ ...options
1952
+ });
1953
+ return consola2;
1954
+ }
1955
+ function _getDefaultLogLevel() {
1956
+ if (g2) {
1957
+ return LogLevels.debug;
1958
+ }
1959
+ if (R2) {
1960
+ return LogLevels.warn;
1961
+ }
1962
+ return LogLevels.info;
1963
+ }
1964
+ var consola = createConsola2();
1965
+
1966
+ // ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/utils.mjs
1967
+ import "tty";
1968
+
1969
+ // ../../node_modules/.pnpm/citty@0.1.6/node_modules/citty/dist/index.mjs
1970
+ function toArray(val) {
1971
+ if (Array.isArray(val)) {
1972
+ return val;
1973
+ }
1974
+ return val === void 0 ? [] : [val];
1975
+ }
1976
+ function formatLineColumns(lines, linePrefix = "") {
1977
+ const maxLengh = [];
1978
+ for (const line of lines) {
1979
+ for (const [i2, element] of line.entries()) {
1980
+ maxLengh[i2] = Math.max(maxLengh[i2] || 0, element.length);
1981
+ }
1982
+ }
1983
+ return lines.map(
1984
+ (l2) => l2.map(
1985
+ (c3, i2) => linePrefix + c3[i2 === 0 ? "padStart" : "padEnd"](maxLengh[i2])
1986
+ ).join(" ")
1987
+ ).join("\n");
1988
+ }
1989
+ function resolveValue(input) {
1990
+ return typeof input === "function" ? input() : input;
1991
+ }
1992
+ var CLIError = class extends Error {
1993
+ constructor(message, code) {
1994
+ super(message);
1995
+ this.code = code;
1996
+ this.name = "CLIError";
1997
+ }
1998
+ };
1999
+ var NUMBER_CHAR_RE = /\d/;
2000
+ var STR_SPLITTERS = ["-", "_", "/", "."];
2001
+ function isUppercase(char = "") {
2002
+ if (NUMBER_CHAR_RE.test(char)) {
2003
+ return void 0;
2004
+ }
2005
+ return char !== char.toLowerCase();
2006
+ }
2007
+ function splitByCase(str, separators) {
2008
+ const splitters = separators ?? STR_SPLITTERS;
2009
+ const parts = [];
2010
+ if (!str || typeof str !== "string") {
2011
+ return parts;
2012
+ }
2013
+ let buff = "";
2014
+ let previousUpper;
2015
+ let previousSplitter;
2016
+ for (const char of str) {
2017
+ const isSplitter = splitters.includes(char);
2018
+ if (isSplitter === true) {
2019
+ parts.push(buff);
2020
+ buff = "";
2021
+ previousUpper = void 0;
2022
+ continue;
2023
+ }
2024
+ const isUpper = isUppercase(char);
2025
+ if (previousSplitter === false) {
2026
+ if (previousUpper === false && isUpper === true) {
2027
+ parts.push(buff);
2028
+ buff = char;
2029
+ previousUpper = isUpper;
2030
+ continue;
2031
+ }
2032
+ if (previousUpper === true && isUpper === false && buff.length > 1) {
2033
+ const lastChar = buff.at(-1);
2034
+ parts.push(buff.slice(0, Math.max(0, buff.length - 1)));
2035
+ buff = lastChar + char;
2036
+ previousUpper = isUpper;
2037
+ continue;
2038
+ }
2039
+ }
2040
+ buff += char;
2041
+ previousUpper = isUpper;
2042
+ previousSplitter = isSplitter;
2043
+ }
2044
+ parts.push(buff);
2045
+ return parts;
2046
+ }
2047
+ function upperFirst(str) {
2048
+ return str ? str[0].toUpperCase() + str.slice(1) : "";
2049
+ }
2050
+ function lowerFirst(str) {
2051
+ return str ? str[0].toLowerCase() + str.slice(1) : "";
2052
+ }
2053
+ function pascalCase(str, opts) {
2054
+ return str ? (Array.isArray(str) ? str : splitByCase(str)).map((p) => upperFirst(opts?.normalize ? p.toLowerCase() : p)).join("") : "";
2055
+ }
2056
+ function camelCase(str, opts) {
2057
+ return lowerFirst(pascalCase(str || "", opts));
2058
+ }
2059
+ function kebabCase(str, joiner) {
2060
+ return str ? (Array.isArray(str) ? str : splitByCase(str)).map((p) => p.toLowerCase()).join(joiner ?? "-") : "";
2061
+ }
2062
+ function toArr(any) {
2063
+ return any == void 0 ? [] : Array.isArray(any) ? any : [any];
2064
+ }
2065
+ function toVal(out, key, val, opts) {
2066
+ let x2;
2067
+ const old = out[key];
2068
+ const nxt = ~opts.string.indexOf(key) ? val == void 0 || val === true ? "" : String(val) : typeof val === "boolean" ? val : ~opts.boolean.indexOf(key) ? val === "false" ? false : val === "true" || (out._.push((x2 = +val, x2 * 0 === 0) ? x2 : val), !!val) : (x2 = +val, x2 * 0 === 0) ? x2 : val;
2069
+ out[key] = old == void 0 ? nxt : Array.isArray(old) ? old.concat(nxt) : [old, nxt];
2070
+ }
2071
+ function parseRawArgs(args = [], opts = {}) {
2072
+ let k2;
2073
+ let arr;
2074
+ let arg;
2075
+ let name;
2076
+ let val;
2077
+ const out = { _: [] };
2078
+ let i2 = 0;
2079
+ let j = 0;
2080
+ let idx = 0;
2081
+ const len = args.length;
2082
+ const alibi = opts.alias !== void 0;
2083
+ const strict = opts.unknown !== void 0;
2084
+ const defaults = opts.default !== void 0;
2085
+ opts.alias = opts.alias || {};
2086
+ opts.string = toArr(opts.string);
2087
+ opts.boolean = toArr(opts.boolean);
2088
+ if (alibi) {
2089
+ for (k2 in opts.alias) {
2090
+ arr = opts.alias[k2] = toArr(opts.alias[k2]);
2091
+ for (i2 = 0; i2 < arr.length; i2++) {
2092
+ (opts.alias[arr[i2]] = arr.concat(k2)).splice(i2, 1);
2093
+ }
2094
+ }
2095
+ }
2096
+ for (i2 = opts.boolean.length; i2-- > 0; ) {
2097
+ arr = opts.alias[opts.boolean[i2]] || [];
2098
+ for (j = arr.length; j-- > 0; ) {
2099
+ opts.boolean.push(arr[j]);
2100
+ }
2101
+ }
2102
+ for (i2 = opts.string.length; i2-- > 0; ) {
2103
+ arr = opts.alias[opts.string[i2]] || [];
2104
+ for (j = arr.length; j-- > 0; ) {
2105
+ opts.string.push(arr[j]);
2106
+ }
2107
+ }
2108
+ if (defaults) {
2109
+ for (k2 in opts.default) {
2110
+ name = typeof opts.default[k2];
2111
+ arr = opts.alias[k2] = opts.alias[k2] || [];
2112
+ if (opts[name] !== void 0) {
2113
+ opts[name].push(k2);
2114
+ for (i2 = 0; i2 < arr.length; i2++) {
2115
+ opts[name].push(arr[i2]);
2116
+ }
2117
+ }
2118
+ }
2119
+ }
2120
+ const keys = strict ? Object.keys(opts.alias) : [];
2121
+ for (i2 = 0; i2 < len; i2++) {
2122
+ arg = args[i2];
2123
+ if (arg === "--") {
2124
+ out._ = out._.concat(args.slice(++i2));
2125
+ break;
2126
+ }
2127
+ for (j = 0; j < arg.length; j++) {
2128
+ if (arg.charCodeAt(j) !== 45) {
2129
+ break;
2130
+ }
2131
+ }
2132
+ if (j === 0) {
2133
+ out._.push(arg);
2134
+ } else if (arg.substring(j, j + 3) === "no-") {
2135
+ name = arg.slice(Math.max(0, j + 3));
2136
+ if (strict && !~keys.indexOf(name)) {
2137
+ return opts.unknown(arg);
2138
+ }
2139
+ out[name] = false;
2140
+ } else {
2141
+ for (idx = j + 1; idx < arg.length; idx++) {
2142
+ if (arg.charCodeAt(idx) === 61) {
2143
+ break;
2144
+ }
2145
+ }
2146
+ name = arg.substring(j, idx);
2147
+ val = arg.slice(Math.max(0, ++idx)) || i2 + 1 === len || ("" + args[i2 + 1]).charCodeAt(0) === 45 || args[++i2];
2148
+ arr = j === 2 ? [name] : name;
2149
+ for (idx = 0; idx < arr.length; idx++) {
2150
+ name = arr[idx];
2151
+ if (strict && !~keys.indexOf(name)) {
2152
+ return opts.unknown("-".repeat(j) + name);
2153
+ }
2154
+ toVal(out, name, idx + 1 < arr.length || val, opts);
2155
+ }
2156
+ }
2157
+ }
2158
+ if (defaults) {
2159
+ for (k2 in opts.default) {
2160
+ if (out[k2] === void 0) {
2161
+ out[k2] = opts.default[k2];
2162
+ }
2163
+ }
2164
+ }
2165
+ if (alibi) {
2166
+ for (k2 in out) {
2167
+ arr = opts.alias[k2] || [];
2168
+ while (arr.length > 0) {
2169
+ out[arr.shift()] = out[k2];
2170
+ }
2171
+ }
2172
+ }
2173
+ return out;
2174
+ }
2175
+ function parseArgs(rawArgs, argsDef) {
2176
+ const parseOptions = {
2177
+ boolean: [],
2178
+ string: [],
2179
+ mixed: [],
2180
+ alias: {},
2181
+ default: {}
2182
+ };
2183
+ const args = resolveArgs(argsDef);
2184
+ for (const arg of args) {
2185
+ if (arg.type === "positional") {
2186
+ continue;
2187
+ }
2188
+ if (arg.type === "string") {
2189
+ parseOptions.string.push(arg.name);
2190
+ } else if (arg.type === "boolean") {
2191
+ parseOptions.boolean.push(arg.name);
2192
+ }
2193
+ if (arg.default !== void 0) {
2194
+ parseOptions.default[arg.name] = arg.default;
2195
+ }
2196
+ if (arg.alias) {
2197
+ parseOptions.alias[arg.name] = arg.alias;
2198
+ }
2199
+ }
2200
+ const parsed = parseRawArgs(rawArgs, parseOptions);
2201
+ const [...positionalArguments] = parsed._;
2202
+ const parsedArgsProxy = new Proxy(parsed, {
2203
+ get(target, prop) {
2204
+ return target[prop] ?? target[camelCase(prop)] ?? target[kebabCase(prop)];
2205
+ }
2206
+ });
2207
+ for (const [, arg] of args.entries()) {
2208
+ if (arg.type === "positional") {
2209
+ const nextPositionalArgument = positionalArguments.shift();
2210
+ if (nextPositionalArgument !== void 0) {
2211
+ parsedArgsProxy[arg.name] = nextPositionalArgument;
2212
+ } else if (arg.default === void 0 && arg.required !== false) {
2213
+ throw new CLIError(
2214
+ `Missing required positional argument: ${arg.name.toUpperCase()}`,
2215
+ "EARG"
2216
+ );
2217
+ } else {
2218
+ parsedArgsProxy[arg.name] = arg.default;
2219
+ }
2220
+ } else if (arg.required && parsedArgsProxy[arg.name] === void 0) {
2221
+ throw new CLIError(`Missing required argument: --${arg.name}`, "EARG");
2222
+ }
2223
+ }
2224
+ return parsedArgsProxy;
2225
+ }
2226
+ function resolveArgs(argsDef) {
2227
+ const args = [];
2228
+ for (const [name, argDef] of Object.entries(argsDef || {})) {
2229
+ args.push({
2230
+ ...argDef,
2231
+ name,
2232
+ alias: toArray(argDef.alias)
2233
+ });
2234
+ }
2235
+ return args;
2236
+ }
2237
+ function defineCommand(def) {
2238
+ return def;
2239
+ }
2240
+ async function runCommand(cmd, opts) {
2241
+ const cmdArgs = await resolveValue(cmd.args || {});
2242
+ const parsedArgs = parseArgs(opts.rawArgs, cmdArgs);
2243
+ const context = {
2244
+ rawArgs: opts.rawArgs,
2245
+ args: parsedArgs,
2246
+ data: opts.data,
2247
+ cmd
2248
+ };
2249
+ if (typeof cmd.setup === "function") {
2250
+ await cmd.setup(context);
2251
+ }
2252
+ let result;
2253
+ try {
2254
+ const subCommands = await resolveValue(cmd.subCommands);
2255
+ if (subCommands && Object.keys(subCommands).length > 0) {
2256
+ const subCommandArgIndex = opts.rawArgs.findIndex(
2257
+ (arg) => !arg.startsWith("-")
2258
+ );
2259
+ const subCommandName = opts.rawArgs[subCommandArgIndex];
2260
+ if (subCommandName) {
2261
+ if (!subCommands[subCommandName]) {
2262
+ throw new CLIError(
2263
+ `Unknown command \`${subCommandName}\``,
2264
+ "E_UNKNOWN_COMMAND"
2265
+ );
2266
+ }
2267
+ const subCommand = await resolveValue(subCommands[subCommandName]);
2268
+ if (subCommand) {
2269
+ await runCommand(subCommand, {
2270
+ rawArgs: opts.rawArgs.slice(subCommandArgIndex + 1)
2271
+ });
2272
+ }
2273
+ } else if (!cmd.run) {
2274
+ throw new CLIError(`No command specified.`, "E_NO_COMMAND");
2275
+ }
2276
+ }
2277
+ if (typeof cmd.run === "function") {
2278
+ result = await cmd.run(context);
2279
+ }
2280
+ } finally {
2281
+ if (typeof cmd.cleanup === "function") {
2282
+ await cmd.cleanup(context);
2283
+ }
2284
+ }
2285
+ return { result };
2286
+ }
2287
+ async function resolveSubCommand(cmd, rawArgs, parent) {
2288
+ const subCommands = await resolveValue(cmd.subCommands);
2289
+ if (subCommands && Object.keys(subCommands).length > 0) {
2290
+ const subCommandArgIndex = rawArgs.findIndex((arg) => !arg.startsWith("-"));
2291
+ const subCommandName = rawArgs[subCommandArgIndex];
2292
+ const subCommand = await resolveValue(subCommands[subCommandName]);
2293
+ if (subCommand) {
2294
+ return resolveSubCommand(
2295
+ subCommand,
2296
+ rawArgs.slice(subCommandArgIndex + 1),
2297
+ cmd
2298
+ );
2299
+ }
2300
+ }
2301
+ return [cmd, parent];
2302
+ }
2303
+ async function showUsage(cmd, parent) {
2304
+ try {
2305
+ consola.log(await renderUsage(cmd, parent) + "\n");
2306
+ } catch (error) {
2307
+ consola.error(error);
2308
+ }
2309
+ }
2310
+ async function renderUsage(cmd, parent) {
2311
+ const cmdMeta = await resolveValue(cmd.meta || {});
2312
+ const cmdArgs = resolveArgs(await resolveValue(cmd.args || {}));
2313
+ const parentMeta = await resolveValue(parent?.meta || {});
2314
+ const commandName = `${parentMeta.name ? `${parentMeta.name} ` : ""}` + (cmdMeta.name || process.argv[1]);
2315
+ const argLines = [];
2316
+ const posLines = [];
2317
+ const commandsLines = [];
2318
+ const usageLine = [];
2319
+ for (const arg of cmdArgs) {
2320
+ if (arg.type === "positional") {
2321
+ const name = arg.name.toUpperCase();
2322
+ const isRequired = arg.required !== false && arg.default === void 0;
2323
+ const defaultHint = arg.default ? `="${arg.default}"` : "";
2324
+ posLines.push([
2325
+ "`" + name + defaultHint + "`",
2326
+ arg.description || "",
2327
+ arg.valueHint ? `<${arg.valueHint}>` : ""
2328
+ ]);
2329
+ usageLine.push(isRequired ? `<${name}>` : `[${name}]`);
2330
+ } else {
2331
+ const isRequired = arg.required === true && arg.default === void 0;
2332
+ const argStr = (arg.type === "boolean" && arg.default === true ? [
2333
+ ...(arg.alias || []).map((a2) => `--no-${a2}`),
2334
+ `--no-${arg.name}`
2335
+ ].join(", ") : [...(arg.alias || []).map((a2) => `-${a2}`), `--${arg.name}`].join(
2336
+ ", "
2337
+ )) + (arg.type === "string" && (arg.valueHint || arg.default) ? `=${arg.valueHint ? `<${arg.valueHint}>` : `"${arg.default || ""}"`}` : "");
2338
+ argLines.push([
2339
+ "`" + argStr + (isRequired ? " (required)" : "") + "`",
2340
+ arg.description || ""
2341
+ ]);
2342
+ if (isRequired) {
2343
+ usageLine.push(argStr);
2344
+ }
2345
+ }
2346
+ }
2347
+ if (cmd.subCommands) {
2348
+ const commandNames = [];
2349
+ const subCommands = await resolveValue(cmd.subCommands);
2350
+ for (const [name, sub] of Object.entries(subCommands)) {
2351
+ const subCmd = await resolveValue(sub);
2352
+ const meta = await resolveValue(subCmd?.meta);
2353
+ commandsLines.push([`\`${name}\``, meta?.description || ""]);
2354
+ commandNames.push(name);
2355
+ }
2356
+ usageLine.push(commandNames.join("|"));
2357
+ }
2358
+ const usageLines = [];
2359
+ const version = cmdMeta.version || parentMeta.version;
2360
+ usageLines.push(
2361
+ colors.gray(
2362
+ `${cmdMeta.description} (${commandName + (version ? ` v${version}` : "")})`
2363
+ ),
2364
+ ""
2365
+ );
2366
+ const hasOptions = argLines.length > 0 || posLines.length > 0;
2367
+ usageLines.push(
2368
+ `${colors.underline(colors.bold("USAGE"))} \`${commandName}${hasOptions ? " [OPTIONS]" : ""} ${usageLine.join(" ")}\``,
2369
+ ""
2370
+ );
2371
+ if (posLines.length > 0) {
2372
+ usageLines.push(colors.underline(colors.bold("ARGUMENTS")), "");
2373
+ usageLines.push(formatLineColumns(posLines, " "));
2374
+ usageLines.push("");
2375
+ }
2376
+ if (argLines.length > 0) {
2377
+ usageLines.push(colors.underline(colors.bold("OPTIONS")), "");
2378
+ usageLines.push(formatLineColumns(argLines, " "));
2379
+ usageLines.push("");
2380
+ }
2381
+ if (commandsLines.length > 0) {
2382
+ usageLines.push(colors.underline(colors.bold("COMMANDS")), "");
2383
+ usageLines.push(formatLineColumns(commandsLines, " "));
2384
+ usageLines.push(
2385
+ "",
2386
+ `Use \`${commandName} <command> --help\` for more information about a command.`
2387
+ );
2388
+ }
2389
+ return usageLines.filter((l2) => typeof l2 === "string").join("\n");
2390
+ }
2391
+ async function runMain(cmd, opts = {}) {
2392
+ const rawArgs = opts.rawArgs || process.argv.slice(2);
2393
+ const showUsage$1 = opts.showUsage || showUsage;
2394
+ try {
2395
+ if (rawArgs.includes("--help") || rawArgs.includes("-h")) {
2396
+ await showUsage$1(...await resolveSubCommand(cmd, rawArgs));
2397
+ process.exit(0);
2398
+ } else if (rawArgs.length === 1 && rawArgs[0] === "--version") {
2399
+ const meta = typeof cmd.meta === "function" ? await cmd.meta() : await cmd.meta;
2400
+ if (!meta?.version) {
2401
+ throw new CLIError("No version specified", "E_NO_VERSION");
2402
+ }
2403
+ consola.log(meta.version);
2404
+ } else {
2405
+ await runCommand(cmd, { rawArgs });
2406
+ }
2407
+ } catch (error) {
2408
+ const isCLIError = error instanceof CLIError;
2409
+ if (!isCLIError) {
2410
+ consola.error(error, "\n");
2411
+ }
2412
+ if (isCLIError) {
2413
+ await showUsage$1(...await resolveSubCommand(cmd, rawArgs));
2414
+ }
2415
+ consola.error(error.message);
2416
+ process.exit(1);
2417
+ }
2418
+ }
2419
+
2420
+ // src/commands/init.ts
2421
+ import { existsSync, mkdirSync, writeFileSync } from "fs";
2422
+ import { join, resolve } from "path";
2423
+
2424
+ // src/utils/logger.ts
2425
+ var import_picocolors = __toESM(require_picocolors(), 1);
2426
+ var logger = {
2427
+ info: (msg) => console.log(import_picocolors.default.blue("i"), msg),
2428
+ success: (msg) => console.log(import_picocolors.default.green("\u2713"), msg),
2429
+ warn: (msg) => console.log(import_picocolors.default.yellow("!"), msg),
2430
+ error: (msg) => console.error(import_picocolors.default.red("x"), msg),
2431
+ log: (msg) => console.log(msg)
2432
+ };
2433
+
2434
+ // src/commands/init.ts
2435
+ var CMS_CONFIG_TEMPLATE = `import { defineConfig, defineCollection } from '@webhouse/cms';
2436
+
2437
+ export default defineConfig({
2438
+ collections: [
2439
+ defineCollection({
2440
+ name: 'posts',
2441
+ label: 'Blog Posts',
2442
+ fields: [
2443
+ { name: 'title', type: 'text', label: 'Title', required: true },
2444
+ { name: 'excerpt', type: 'textarea', label: 'Excerpt' },
2445
+ { name: 'content', type: 'richtext', label: 'Content' },
2446
+ { name: 'date', type: 'date', label: 'Publish Date' },
2447
+ ],
2448
+ }),
2449
+ ],
2450
+ storage: {
2451
+ adapter: 'filesystem',
2452
+ filesystem: {
2453
+ contentDir: 'content',
2454
+ },
2455
+ },
2456
+ build: {
2457
+ outDir: 'dist',
2458
+ },
2459
+ api: {
2460
+ port: 3000,
2461
+ },
2462
+ });
2463
+ `;
2464
+ var EXAMPLE_POST = {
2465
+ id: "example-post-001",
2466
+ slug: "hello-world",
2467
+ collection: "posts",
2468
+ status: "published",
2469
+ data: {
2470
+ title: "Hello, World!",
2471
+ excerpt: "My first post using @webhouse/cms.",
2472
+ content: `# Hello, World!
2473
+
2474
+ Welcome to your new CMS-powered blog. This post was created automatically when you ran \`cms init\`.
2475
+
2476
+ ## Getting Started
2477
+
2478
+ Edit this post, create new ones, or run the build:
2479
+
2480
+ \`\`\`bash
2481
+ # Start the dev server
2482
+ npx cms dev
2483
+
2484
+ # Build the static site
2485
+ npx cms build
2486
+ \`\`\`
2487
+
2488
+ ## Writing Content
2489
+
2490
+ Content is written in **Markdown**. You can use:
2491
+
2492
+ - **Bold** and *italic* text
2493
+ - Lists like this one
2494
+ - \`inline code\`
2495
+ - Code blocks
2496
+ - And much more!
2497
+
2498
+ Happy writing!
2499
+ `,
2500
+ date: (/* @__PURE__ */ new Date()).toISOString()
2501
+ },
2502
+ createdAt: (/* @__PURE__ */ new Date()).toISOString(),
2503
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
2504
+ };
2505
+ var PACKAGE_JSON_TEMPLATE = (name) => JSON.stringify({
2506
+ name,
2507
+ version: "0.1.0",
2508
+ private: true,
2509
+ type: "module",
2510
+ scripts: {
2511
+ dev: "cms dev",
2512
+ build: "cms build"
2513
+ },
2514
+ dependencies: {
2515
+ "@webhouse/cms": "^0.1.0",
2516
+ "@webhouse/cms-cli": "^0.1.0"
2517
+ }
2518
+ }, null, 2);
2519
+ async function initCommand(args) {
2520
+ const projectName = args.name ?? "my-cms-site";
2521
+ const projectDir = args.dir ? resolve(args.dir) : resolve(process.cwd(), projectName);
2522
+ logger.log("");
2523
+ logger.info(`Creating new CMS project: ${projectName}`);
2524
+ logger.log("");
2525
+ if (existsSync(projectDir)) {
2526
+ logger.error(`Directory already exists: ${projectDir}`);
2527
+ process.exit(1);
2528
+ }
2529
+ mkdirSync(projectDir, { recursive: true });
2530
+ mkdirSync(join(projectDir, "content", "posts"), { recursive: true });
2531
+ writeFileSync(join(projectDir, "cms.config.ts"), CMS_CONFIG_TEMPLATE, "utf-8");
2532
+ writeFileSync(join(projectDir, "package.json"), PACKAGE_JSON_TEMPLATE(projectName), "utf-8");
2533
+ writeFileSync(
2534
+ join(projectDir, "content", "posts", "hello-world.json"),
2535
+ JSON.stringify(EXAMPLE_POST, null, 2),
2536
+ "utf-8"
2537
+ );
2538
+ logger.success(`Project created at ${projectDir}`);
2539
+ logger.log("");
2540
+ logger.log("Next steps:");
2541
+ logger.log(` cd ${projectName}`);
2542
+ logger.log(" pnpm install");
2543
+ logger.log(" pnpm dev # Start dev server");
2544
+ logger.log(" pnpm build # Build static site");
2545
+ logger.log("");
2546
+ }
2547
+
2548
+ // src/utils/config-loader.ts
2549
+ import { existsSync as existsSync2 } from "fs";
2550
+ import { resolve as resolve2 } from "path";
2551
+ async function loadConfig(cwd = process.cwd()) {
2552
+ const configPaths = [
2553
+ resolve2(cwd, "cms.config.ts"),
2554
+ resolve2(cwd, "cms.config.js"),
2555
+ resolve2(cwd, "cms.config.mjs")
2556
+ ];
2557
+ const configPath = configPaths.find((p) => existsSync2(p));
2558
+ if (!configPath) {
2559
+ throw new Error(
2560
+ 'No cms.config.ts found. Run "cms init" to create one, or create cms.config.ts manually.'
2561
+ );
2562
+ }
2563
+ const { createJiti } = await import("jiti");
2564
+ const jiti = createJiti(cwd, { debug: false });
2565
+ const mod = await jiti.import(configPath);
2566
+ const config = "default" in mod ? mod.default : mod;
2567
+ if (!config || typeof config !== "object") {
2568
+ throw new Error(`Invalid config at ${configPath}: must export a default CmsConfig object`);
2569
+ }
2570
+ return config;
2571
+ }
2572
+
2573
+ // src/commands/dev.ts
2574
+ async function devCommand(args) {
2575
+ const cwd = args.cwd ?? process.cwd();
2576
+ const config = await loadConfig(cwd);
2577
+ const port = args.port ?? config.api?.port ?? 3e3;
2578
+ const { createCms } = await import("@webhouse/cms");
2579
+ const { serve: serve2 } = await import("@hono/node-server");
2580
+ const cms = await createCms(config);
2581
+ logger.info(`Starting dev server on http://localhost:${port}`);
2582
+ logger.log("");
2583
+ try {
2584
+ const chokidar = await import("chokidar");
2585
+ const watcher = chokidar.watch(["cms.config.ts", "content/**/*.json"], {
2586
+ cwd,
2587
+ ignoreInitial: true
2588
+ });
2589
+ watcher.on("all", (event, filePath) => {
2590
+ logger.info(`File changed: ${filePath} (${event})`);
2591
+ });
2592
+ } catch {
2593
+ }
2594
+ serve2({
2595
+ fetch: cms.api.fetch,
2596
+ port
2597
+ }, (info) => {
2598
+ logger.success(`API running at http://localhost:${info.port}`);
2599
+ logger.log("");
2600
+ logger.log("Endpoints:");
2601
+ logger.log(` GET http://localhost:${info.port}/api/manifest`);
2602
+ logger.log(` GET http://localhost:${info.port}/api/schema`);
2603
+ for (const col of config.collections) {
2604
+ logger.log(` GET http://localhost:${info.port}/api/content/${col.name}`);
2605
+ }
2606
+ });
2607
+ }
2608
+
2609
+ // src/commands/build.ts
2610
+ async function buildCommand(args) {
2611
+ const cwd = args.cwd ?? process.cwd();
2612
+ logger.info("Loading config...");
2613
+ const config = await loadConfig(cwd);
2614
+ const { createCms } = await import("@webhouse/cms");
2615
+ const cms = await createCms(config);
2616
+ logger.info("Building site...");
2617
+ const result = await cms.build({ outDir: args.outDir });
2618
+ logger.success(`Build complete in ${result.duration}ms`);
2619
+ logger.log(` Pages: ${result.pages}`);
2620
+ logger.log(` Output: ${result.outDir}/`);
2621
+ await cms.storage.close();
2622
+ }
2623
+
2624
+ // src/commands/serve.ts
2625
+ import { createServer } from "http";
2626
+ import { createReadStream, existsSync as existsSync3, statSync } from "fs";
2627
+ import { join as join2, extname } from "path";
2628
+ var MIME = {
2629
+ ".html": "text/html; charset=utf-8",
2630
+ ".css": "text/css",
2631
+ ".js": "text/javascript",
2632
+ ".json": "application/json",
2633
+ ".png": "image/png",
2634
+ ".jpg": "image/jpeg",
2635
+ ".svg": "image/svg+xml",
2636
+ ".ico": "image/x-icon"
2637
+ };
2638
+ async function serveCommand(args) {
2639
+ const dir = args.dir ?? "dist";
2640
+ const port = args.port ?? 5e3;
2641
+ if (!existsSync3(dir)) {
2642
+ logger.error(`Directory "${dir}" not found \u2014 run "cms build" first`);
2643
+ process.exit(1);
2644
+ }
2645
+ const server = createServer((req, res) => {
2646
+ let urlPath = req.url ?? "/";
2647
+ urlPath = urlPath.split("?")[0] ?? "/";
2648
+ let filePath = join2(dir, urlPath);
2649
+ if (!extname(filePath)) {
2650
+ filePath = join2(filePath, "index.html");
2651
+ }
2652
+ if (!existsSync3(filePath) || statSync(filePath).isDirectory()) {
2653
+ filePath = join2(dir, "404.html");
2654
+ if (!existsSync3(filePath)) {
2655
+ res.writeHead(404, { "Content-Type": "text/plain" });
2656
+ res.end("404 Not Found");
2657
+ return;
2658
+ }
2659
+ }
2660
+ const ext = extname(filePath);
2661
+ const mime = MIME[ext] ?? "application/octet-stream";
2662
+ res.writeHead(200, { "Content-Type": mime });
2663
+ createReadStream(filePath).pipe(res);
2664
+ });
2665
+ server.listen(port, () => {
2666
+ logger.success(`Serving ${dir}/ at http://localhost:${port}`);
2667
+ logger.log("");
2668
+ logger.log(" Press Ctrl+C to stop");
2669
+ });
2670
+ }
2671
+
2672
+ // src/commands/ai.ts
2673
+ async function aiGenerateCommand(args) {
2674
+ const cwd = args.cwd ?? process.cwd();
2675
+ const config = await loadConfig(cwd);
2676
+ const col = config.collections.find((c3) => c3.name === args.collection);
2677
+ if (!col) {
2678
+ logger.error(`Collection "${args.collection}" not found in cms.config.ts`);
2679
+ process.exit(1);
2680
+ }
2681
+ logger.info(`Generating content for "${args.collection}" with AI...`);
2682
+ const { createAi } = await import("@webhouse/cms-ai");
2683
+ const { createCms } = await import("@webhouse/cms");
2684
+ const ai2 = await createAi();
2685
+ const cms = await createCms(config);
2686
+ const result = await ai2.content.generate(args.prompt, { collection: col });
2687
+ logger.info(`Creating document...`);
2688
+ const doc = await cms.content.create(args.collection, {
2689
+ slug: result.slug,
2690
+ status: args.status ?? "draft",
2691
+ data: result.fields
2692
+ }, { actor: "ai", aiModel: "claude-sonnet-4-6" });
2693
+ logger.success(`Created: ${doc.slug}`);
2694
+ logger.log(` Status: ${doc.status}`);
2695
+ logger.log(` Cost: $${result.usage.estimatedCostUsd.toFixed(4)}`);
2696
+ logger.log(` Tokens: ${result.usage.inputTokens} in / ${result.usage.outputTokens} out`);
2697
+ await cms.storage.close();
2698
+ }
2699
+ async function aiRewriteCommand(args) {
2700
+ const cwd = args.cwd ?? process.cwd();
2701
+ const config = await loadConfig(cwd);
2702
+ const col = config.collections.find((c3) => c3.name === args.collection);
2703
+ if (!col) {
2704
+ logger.error(`Collection "${args.collection}" not found`);
2705
+ process.exit(1);
2706
+ }
2707
+ const { createAi } = await import("@webhouse/cms-ai");
2708
+ const { createCms } = await import("@webhouse/cms");
2709
+ const cms = await createCms(config);
2710
+ const doc = await cms.content.findBySlug(args.collection, args.slug);
2711
+ if (!doc) {
2712
+ logger.error(`Document "${args.slug}" not found in "${args.collection}"`);
2713
+ process.exit(1);
2714
+ }
2715
+ logger.info(`Rewriting "${args.slug}"...`);
2716
+ const ai2 = await createAi();
2717
+ const result = await ai2.content.rewrite(doc.data, {
2718
+ instruction: args.instruction,
2719
+ collection: col
2720
+ });
2721
+ const aiContext = { actor: "ai", aiModel: "claude-sonnet-4-6" };
2722
+ const { document: updated, skippedFields } = await cms.content.updateWithContext(
2723
+ args.collection,
2724
+ doc.id,
2725
+ { data: result.fields },
2726
+ aiContext
2727
+ );
2728
+ logger.success(`Updated: ${updated.slug}`);
2729
+ logger.log(` Cost: $${result.usage.estimatedCostUsd.toFixed(4)}`);
2730
+ if (skippedFields.length > 0) {
2731
+ logger.warn(` Skipped (locked by user): ${skippedFields.join(", ")}`);
2732
+ }
2733
+ await cms.storage.close();
2734
+ }
2735
+ async function aiSeoCommand(args) {
2736
+ const cwd = args.cwd ?? process.cwd();
2737
+ const config = await loadConfig(cwd);
2738
+ const baseUrl = config.build?.baseUrl ?? "https://example.com";
2739
+ const siteTitle = config.build?.["siteTitle"] ?? "My Site";
2740
+ const { createAi } = await import("@webhouse/cms-ai");
2741
+ const { createCms } = await import("@webhouse/cms");
2742
+ const cms = await createCms(config);
2743
+ const ai2 = await createAi();
2744
+ const aiContext = { actor: "ai", aiModel: "claude-sonnet-4-6" };
2745
+ let totalCost = 0;
2746
+ let totalDocs = 0;
2747
+ let totalSkipped = 0;
2748
+ for (const col of config.collections) {
2749
+ const { documents } = await cms.content.findMany(col.name, {
2750
+ status: args.status ?? "published"
2751
+ });
2752
+ for (const doc of documents) {
2753
+ logger.info(`SEO: ${col.name}/${doc.slug}`);
2754
+ try {
2755
+ const seoResult = await ai2.seo.optimize(doc, siteTitle, baseUrl);
2756
+ const { document: updated, skippedFields } = await cms.content.updateWithContext(
2757
+ col.name,
2758
+ doc.id,
2759
+ {
2760
+ data: {
2761
+ ...doc.data,
2762
+ _seo: {
2763
+ metaTitle: seoResult.metaTitle,
2764
+ metaDescription: seoResult.metaDescription,
2765
+ jsonLd: seoResult.jsonLd
2766
+ }
2767
+ }
2768
+ },
2769
+ aiContext
2770
+ );
2771
+ totalCost += seoResult.usage.estimatedCostUsd;
2772
+ totalDocs++;
2773
+ if (skippedFields.length > 0) {
2774
+ logger.warn(` Skipped (locked): ${skippedFields.join(", ")}`);
2775
+ totalSkipped += skippedFields.length;
2776
+ }
2777
+ void updated;
2778
+ } catch (e2) {
2779
+ logger.warn(` Failed: ${String(e2)}`);
2780
+ }
2781
+ }
2782
+ }
2783
+ logger.success(`SEO optimization complete`);
2784
+ logger.log(` Documents: ${totalDocs}`);
2785
+ logger.log(` Total cost: $${totalCost.toFixed(4)}`);
2786
+ if (totalSkipped > 0) {
2787
+ logger.log(` Fields skipped (locked): ${totalSkipped}`);
2788
+ }
2789
+ await cms.storage.close();
2790
+ }
2791
+
2792
+ // src/commands/mcp.ts
2793
+ import { randomBytes } from "crypto";
2794
+ async function mcpKeygenCommand(args) {
2795
+ const key = randomBytes(32).toString("hex");
2796
+ const label = args.label ?? "My key";
2797
+ const scopes = args.scopes ?? "read,write,publish,deploy,ai";
2798
+ logger.success("Generated MCP API key:");
2799
+ logger.log("");
2800
+ logger.log(` Key: ${key}`);
2801
+ logger.log(` Label: ${label}`);
2802
+ logger.log(` Scopes: ${scopes}`);
2803
+ logger.log("");
2804
+ logger.log("Add to your environment:");
2805
+ logger.log(` MCP_API_KEY=${key}`);
2806
+ logger.log("");
2807
+ logger.log("Or for named keys (supports up to 5):");
2808
+ logger.log(` MCP_API_KEY_1=${key}`);
2809
+ logger.log(` MCP_API_KEY_1_LABEL=${label}`);
2810
+ logger.log(` MCP_API_KEY_1_SCOPES=${scopes}`);
2811
+ }
2812
+ async function mcpTestCommand(args) {
2813
+ const cwd = args.cwd ?? process.cwd();
2814
+ const config = await loadConfig(cwd);
2815
+ logger.info("Testing public MCP server (get_site_summary)...");
2816
+ logger.log("");
2817
+ const endpoint = args.endpoint ?? `http://localhost:${config.api?.port ?? 3e3}/api/mcp`;
2818
+ try {
2819
+ const sseRes = await fetch(endpoint, {
2820
+ headers: { Accept: "text/event-stream" },
2821
+ signal: AbortSignal.timeout(5e3)
2822
+ });
2823
+ if (!sseRes.ok) {
2824
+ logger.error(`SSE connection failed: HTTP ${sseRes.status}`);
2825
+ return;
2826
+ }
2827
+ const sessionId = sseRes.headers.get("x-mcp-session-id");
2828
+ if (!sessionId) {
2829
+ logger.error("No X-MCP-Session-Id in response headers");
2830
+ return;
2831
+ }
2832
+ logger.success(`Connected \u2014 session: ${sessionId}`);
2833
+ const msgUrl = new URL(endpoint.replace(/\/mcp$/, "/mcp/message"));
2834
+ msgUrl.searchParams.set("sessionId", sessionId);
2835
+ const initMsg = {
2836
+ jsonrpc: "2.0",
2837
+ id: 1,
2838
+ method: "initialize",
2839
+ params: {
2840
+ protocolVersion: "2024-11-05",
2841
+ capabilities: { tools: {} },
2842
+ clientInfo: { name: "cms-cli-test", version: "1.0.0" }
2843
+ }
2844
+ };
2845
+ await fetch(msgUrl.toString(), {
2846
+ method: "POST",
2847
+ headers: { "Content-Type": "application/json" },
2848
+ body: JSON.stringify(initMsg),
2849
+ signal: AbortSignal.timeout(3e3)
2850
+ });
2851
+ logger.log(" MCP initialize sent");
2852
+ logger.success("MCP server is reachable and accepting connections");
2853
+ } catch (err) {
2854
+ logger.error(`Connection failed: ${err.message}`);
2855
+ logger.log("");
2856
+ logger.log("Make sure the CMS admin server is running.");
2857
+ }
2858
+ }
2859
+ async function mcpStatusCommand(args) {
2860
+ const endpoint = args.endpoint ?? "http://localhost:3001";
2861
+ logger.info("Checking MCP server status...");
2862
+ logger.log("");
2863
+ try {
2864
+ const infoRes = await fetch(`${endpoint}/api/mcp/info`, {
2865
+ signal: AbortSignal.timeout(5e3)
2866
+ });
2867
+ if (infoRes.ok) {
2868
+ const info = await infoRes.json();
2869
+ logger.success(`Public MCP server: online`);
2870
+ logger.log(` Endpoint: ${info["endpoint"]}`);
2871
+ logger.log(` Auth: ${info["auth"]}`);
2872
+ logger.log(` Rate limit: ${info["rateLimit"]}`);
2873
+ const tools = info["tools"];
2874
+ logger.log(` Tools: ${tools?.length ?? 0}`);
2875
+ const collections = info["collections"];
2876
+ logger.log(` Collections: ${collections?.map((c3) => c3.name).join(", ") ?? "none"}`);
2877
+ } else {
2878
+ logger.warn(`Public MCP server: HTTP ${infoRes.status}`);
2879
+ }
2880
+ } catch {
2881
+ logger.warn("Public MCP server: not reachable");
2882
+ }
2883
+ logger.log("");
2884
+ const apiKey = process.env.MCP_API_KEY;
2885
+ if (!apiKey) {
2886
+ logger.log("Admin MCP server: not configured (set MCP_API_KEY to check)");
2887
+ return;
2888
+ }
2889
+ try {
2890
+ const adminRes = await fetch(`${endpoint}/api/mcp/admin`, {
2891
+ headers: { Authorization: `Bearer ${apiKey}` },
2892
+ signal: AbortSignal.timeout(5e3)
2893
+ });
2894
+ if (adminRes.status === 200 || adminRes.headers.get("content-type")?.includes("text/event-stream")) {
2895
+ logger.success("Admin MCP server: online (authenticated)");
2896
+ } else if (adminRes.status === 401) {
2897
+ logger.warn("Admin MCP server: online but invalid key");
2898
+ } else {
2899
+ logger.warn(`Admin MCP server: HTTP ${adminRes.status}`);
2900
+ }
2901
+ } catch {
2902
+ logger.warn("Admin MCP server: not reachable");
2903
+ }
2904
+ }
2905
+
2906
+ // src/index.ts
2907
+ var init2 = defineCommand({
2908
+ meta: { name: "init", description: "Initialize a new CMS project" },
2909
+ args: {
2910
+ name: { type: "positional", description: "Project name", required: false, default: "my-cms-site" }
2911
+ },
2912
+ async run({ args }) {
2913
+ await initCommand({ name: args.name });
2914
+ }
2915
+ });
2916
+ var dev = defineCommand({
2917
+ meta: { name: "dev", description: "Start the dev server" },
2918
+ args: {
2919
+ port: { type: "string", description: "Port number", default: "3000" }
2920
+ },
2921
+ async run({ args }) {
2922
+ await devCommand({ port: Number(args.port) });
2923
+ }
2924
+ });
2925
+ var build = defineCommand({
2926
+ meta: { name: "build", description: "Build the static site" },
2927
+ args: {
2928
+ outDir: { type: "string", description: "Output directory", default: "dist" }
2929
+ },
2930
+ async run({ args }) {
2931
+ await buildCommand({ outDir: args.outDir });
2932
+ }
2933
+ });
2934
+ var serve = defineCommand({
2935
+ meta: { name: "serve", description: "Serve the built static site" },
2936
+ args: {
2937
+ port: { type: "string", description: "Port number", default: "5000" },
2938
+ dir: { type: "string", description: "Directory to serve", default: "dist" }
2939
+ },
2940
+ async run({ args }) {
2941
+ await serveCommand({ port: Number(args.port), dir: args.dir });
2942
+ }
2943
+ });
2944
+ var aiGenerate = defineCommand({
2945
+ meta: { name: "generate", description: "Generate content with AI" },
2946
+ args: {
2947
+ collection: { type: "positional", description: "Collection name" },
2948
+ prompt: { type: "positional", description: "What to generate" },
2949
+ status: { type: "string", description: "Document status (draft|published)", default: "draft" }
2950
+ },
2951
+ async run({ args }) {
2952
+ await aiGenerateCommand({
2953
+ collection: args.collection,
2954
+ prompt: args.prompt,
2955
+ status: args.status
2956
+ });
2957
+ }
2958
+ });
2959
+ var aiRewrite = defineCommand({
2960
+ meta: { name: "rewrite", description: "Rewrite existing content with AI" },
2961
+ args: {
2962
+ ref: { type: "positional", description: "collection/slug" },
2963
+ instruction: { type: "positional", description: "Rewrite instruction" }
2964
+ },
2965
+ async run({ args }) {
2966
+ const [collection, slug] = args.ref.split("/");
2967
+ if (!collection || !slug) {
2968
+ console.error('Format: cms ai rewrite <collection>/<slug> "<instruction>"');
2969
+ process.exit(1);
2970
+ }
2971
+ await aiRewriteCommand({ collection, slug, instruction: args.instruction });
2972
+ }
2973
+ });
2974
+ var aiSeo = defineCommand({
2975
+ meta: { name: "seo", description: "Run SEO agent on all published documents" },
2976
+ args: {
2977
+ status: { type: "string", description: "Document status filter", default: "published" }
2978
+ },
2979
+ async run({ args }) {
2980
+ await aiSeoCommand({ status: args.status });
2981
+ }
2982
+ });
2983
+ var ai = defineCommand({
2984
+ meta: { name: "ai", description: "AI-powered content operations" },
2985
+ subCommands: { generate: aiGenerate, rewrite: aiRewrite, seo: aiSeo }
2986
+ });
2987
+ var mcpKeygen = defineCommand({
2988
+ meta: { name: "keygen", description: "Generate a new MCP API key" },
2989
+ args: {
2990
+ label: { type: "string", description: 'Key label (e.g. "Claude iOS")', default: "My key" },
2991
+ scopes: { type: "string", description: "Comma-separated scopes", default: "read,write,publish,deploy,ai" }
2992
+ },
2993
+ async run({ args }) {
2994
+ await mcpKeygenCommand({ label: args.label, scopes: args.scopes });
2995
+ }
2996
+ });
2997
+ var mcpTest = defineCommand({
2998
+ meta: { name: "test", description: "Test the local MCP server" },
2999
+ args: {
3000
+ endpoint: { type: "string", description: "MCP endpoint URL", default: "http://localhost:3001/api/mcp" }
3001
+ },
3002
+ async run({ args }) {
3003
+ await mcpTestCommand({ endpoint: args.endpoint });
3004
+ }
3005
+ });
3006
+ var mcpStatus = defineCommand({
3007
+ meta: { name: "status", description: "Check MCP server status" },
3008
+ args: {
3009
+ endpoint: { type: "string", description: "Admin server base URL", default: "http://localhost:3001" }
3010
+ },
3011
+ async run({ args }) {
3012
+ await mcpStatusCommand({ endpoint: args.endpoint });
3013
+ }
3014
+ });
3015
+ var mcp = defineCommand({
3016
+ meta: { name: "mcp", description: "MCP server management" },
3017
+ subCommands: { keygen: mcpKeygen, test: mcpTest, status: mcpStatus }
3018
+ });
3019
+ var main = defineCommand({
3020
+ meta: {
3021
+ name: "cms",
3022
+ description: "@webhouse/cms \u2014 AI-native CMS engine",
3023
+ version: "0.1.0"
3024
+ },
3025
+ subCommands: { init: init2, dev, build, serve, ai, mcp }
3026
+ });
3027
+ runMain(main);
3028
+ //# sourceMappingURL=index.js.map