@openpolicy/cli 0.0.5 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -1,2243 +1,56 @@
1
- #!/usr/bin/env bun
2
- // @bun
3
-
4
- #!/usr/bin/env bun
1
+ #!/usr/bin/env node
2
+ import { defineCommand, runMain } from "citty";
3
+ import { join, resolve } from "node:path";
4
+ import consola from "consola";
5
+ import { compilePolicy, validatePrivacyPolicy, validateTermsOfService } from "@openpolicy/core";
6
+ import { existsSync } from "node:fs";
7
+ //#region \0rolldown/runtime.js
5
8
  var __defProp = Object.defineProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true,
11
- configurable: true,
12
- set: (newValue) => all[name] = () => newValue
13
- });
9
+ var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
10
+ var __exportAll = (all, no_symbols) => {
11
+ let target = {};
12
+ for (var name in all) __defProp(target, name, {
13
+ get: all[name],
14
+ enumerable: true
15
+ });
16
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
17
+ return target;
14
18
  };
15
- var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
16
-
17
- // ../../node_modules/consola/dist/core.mjs
18
- function isPlainObject$1(value) {
19
- if (value === null || typeof value !== "object") {
20
- return false;
21
- }
22
- const prototype = Object.getPrototypeOf(value);
23
- if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
24
- return false;
25
- }
26
- if (Symbol.iterator in value) {
27
- return false;
28
- }
29
- if (Symbol.toStringTag in value) {
30
- return Object.prototype.toString.call(value) === "[object Module]";
31
- }
32
- return true;
33
- }
34
- function _defu(baseObject, defaults, namespace = ".", merger) {
35
- if (!isPlainObject$1(defaults)) {
36
- return _defu(baseObject, {}, namespace, merger);
37
- }
38
- const object = Object.assign({}, defaults);
39
- for (const key in baseObject) {
40
- if (key === "__proto__" || key === "constructor") {
41
- continue;
42
- }
43
- const value = baseObject[key];
44
- if (value === null || value === undefined) {
45
- continue;
46
- }
47
- if (merger && merger(object, key, value, namespace)) {
48
- continue;
49
- }
50
- if (Array.isArray(value) && Array.isArray(object[key])) {
51
- object[key] = [...value, ...object[key]];
52
- } else if (isPlainObject$1(value) && isPlainObject$1(object[key])) {
53
- object[key] = _defu(value, object[key], (namespace ? `${namespace}.` : "") + key.toString(), merger);
54
- } else {
55
- object[key] = value;
56
- }
57
- }
58
- return object;
59
- }
60
- function createDefu(merger) {
61
- return (...arguments_) => arguments_.reduce((p, c) => _defu(p, c, "", merger), {});
62
- }
63
- function isPlainObject(obj) {
64
- return Object.prototype.toString.call(obj) === "[object Object]";
65
- }
66
- function isLogObj(arg) {
67
- if (!isPlainObject(arg)) {
68
- return false;
69
- }
70
- if (!arg.message && !arg.args) {
71
- return false;
72
- }
73
- if (arg.stack) {
74
- return false;
75
- }
76
- return true;
77
- }
78
-
79
- class Consola {
80
- options;
81
- _lastLog;
82
- _mockFn;
83
- constructor(options = {}) {
84
- const types = options.types || LogTypes;
85
- this.options = defu({
86
- ...options,
87
- defaults: { ...options.defaults },
88
- level: _normalizeLogLevel(options.level, types),
89
- reporters: [...options.reporters || []]
90
- }, {
91
- types: LogTypes,
92
- throttle: 1000,
93
- throttleMin: 5,
94
- formatOptions: {
95
- date: true,
96
- colors: false,
97
- compact: true
98
- }
99
- });
100
- for (const type in types) {
101
- const defaults = {
102
- type,
103
- ...this.options.defaults,
104
- ...types[type]
105
- };
106
- this[type] = this._wrapLogFn(defaults);
107
- this[type].raw = this._wrapLogFn(defaults, true);
108
- }
109
- if (this.options.mockFn) {
110
- this.mockTypes();
111
- }
112
- this._lastLog = {};
113
- }
114
- get level() {
115
- return this.options.level;
116
- }
117
- set level(level) {
118
- this.options.level = _normalizeLogLevel(level, this.options.types, this.options.level);
119
- }
120
- prompt(message, opts) {
121
- if (!this.options.prompt) {
122
- throw new Error("prompt is not supported!");
123
- }
124
- return this.options.prompt(message, opts);
125
- }
126
- create(options) {
127
- const instance = new Consola({
128
- ...this.options,
129
- ...options
130
- });
131
- if (this._mockFn) {
132
- instance.mockTypes(this._mockFn);
133
- }
134
- return instance;
135
- }
136
- withDefaults(defaults) {
137
- return this.create({
138
- ...this.options,
139
- defaults: {
140
- ...this.options.defaults,
141
- ...defaults
142
- }
143
- });
144
- }
145
- withTag(tag) {
146
- return this.withDefaults({
147
- tag: this.options.defaults.tag ? this.options.defaults.tag + ":" + tag : tag
148
- });
149
- }
150
- addReporter(reporter) {
151
- this.options.reporters.push(reporter);
152
- return this;
153
- }
154
- removeReporter(reporter) {
155
- if (reporter) {
156
- const i = this.options.reporters.indexOf(reporter);
157
- if (i !== -1) {
158
- return this.options.reporters.splice(i, 1);
159
- }
160
- } else {
161
- this.options.reporters.splice(0);
162
- }
163
- return this;
164
- }
165
- setReporters(reporters) {
166
- this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];
167
- return this;
168
- }
169
- wrapAll() {
170
- this.wrapConsole();
171
- this.wrapStd();
172
- }
173
- restoreAll() {
174
- this.restoreConsole();
175
- this.restoreStd();
176
- }
177
- wrapConsole() {
178
- for (const type in this.options.types) {
179
- if (!console["__" + type]) {
180
- console["__" + type] = console[type];
181
- }
182
- console[type] = this[type].raw;
183
- }
184
- }
185
- restoreConsole() {
186
- for (const type in this.options.types) {
187
- if (console["__" + type]) {
188
- console[type] = console["__" + type];
189
- delete console["__" + type];
190
- }
191
- }
192
- }
193
- wrapStd() {
194
- this._wrapStream(this.options.stdout, "log");
195
- this._wrapStream(this.options.stderr, "log");
196
- }
197
- _wrapStream(stream, type) {
198
- if (!stream) {
199
- return;
200
- }
201
- if (!stream.__write) {
202
- stream.__write = stream.write;
203
- }
204
- stream.write = (data) => {
205
- this[type].raw(String(data).trim());
206
- };
207
- }
208
- restoreStd() {
209
- this._restoreStream(this.options.stdout);
210
- this._restoreStream(this.options.stderr);
211
- }
212
- _restoreStream(stream) {
213
- if (!stream) {
214
- return;
215
- }
216
- if (stream.__write) {
217
- stream.write = stream.__write;
218
- delete stream.__write;
219
- }
220
- }
221
- pauseLogs() {
222
- paused = true;
223
- }
224
- resumeLogs() {
225
- paused = false;
226
- const _queue = queue.splice(0);
227
- for (const item of _queue) {
228
- item[0]._logFn(item[1], item[2]);
229
- }
230
- }
231
- mockTypes(mockFn) {
232
- const _mockFn = mockFn || this.options.mockFn;
233
- this._mockFn = _mockFn;
234
- if (typeof _mockFn !== "function") {
235
- return;
236
- }
237
- for (const type in this.options.types) {
238
- this[type] = _mockFn(type, this.options.types[type]) || this[type];
239
- this[type].raw = this[type];
240
- }
241
- }
242
- _wrapLogFn(defaults, isRaw) {
243
- return (...args) => {
244
- if (paused) {
245
- queue.push([this, defaults, args, isRaw]);
246
- return;
247
- }
248
- return this._logFn(defaults, args, isRaw);
249
- };
250
- }
251
- _logFn(defaults, args, isRaw) {
252
- if ((defaults.level || 0) > this.level) {
253
- return false;
254
- }
255
- const logObj = {
256
- date: /* @__PURE__ */ new Date,
257
- args: [],
258
- ...defaults,
259
- level: _normalizeLogLevel(defaults.level, this.options.types)
260
- };
261
- if (!isRaw && args.length === 1 && isLogObj(args[0])) {
262
- Object.assign(logObj, args[0]);
263
- } else {
264
- logObj.args = [...args];
265
- }
266
- if (logObj.message) {
267
- logObj.args.unshift(logObj.message);
268
- delete logObj.message;
269
- }
270
- if (logObj.additional) {
271
- if (!Array.isArray(logObj.additional)) {
272
- logObj.additional = logObj.additional.split(`
273
- `);
274
- }
275
- logObj.args.push(`
276
- ` + logObj.additional.join(`
277
- `));
278
- delete logObj.additional;
279
- }
280
- logObj.type = typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log";
281
- logObj.tag = typeof logObj.tag === "string" ? logObj.tag : "";
282
- const resolveLog = (newLog = false) => {
283
- const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
284
- if (this._lastLog.object && repeated > 0) {
285
- const args2 = [...this._lastLog.object.args];
286
- if (repeated > 1) {
287
- args2.push(`(repeated ${repeated} times)`);
288
- }
289
- this._log({ ...this._lastLog.object, args: args2 });
290
- this._lastLog.count = 1;
291
- }
292
- if (newLog) {
293
- this._lastLog.object = logObj;
294
- this._log(logObj);
295
- }
296
- };
297
- clearTimeout(this._lastLog.timeout);
298
- const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;
299
- this._lastLog.time = logObj.date;
300
- if (diffTime < this.options.throttle) {
301
- try {
302
- const serializedLog = JSON.stringify([
303
- logObj.type,
304
- logObj.tag,
305
- logObj.args
306
- ]);
307
- const isSameLog = this._lastLog.serialized === serializedLog;
308
- this._lastLog.serialized = serializedLog;
309
- if (isSameLog) {
310
- this._lastLog.count = (this._lastLog.count || 0) + 1;
311
- if (this._lastLog.count > this.options.throttleMin) {
312
- this._lastLog.timeout = setTimeout(resolveLog, this.options.throttle);
313
- return;
314
- }
315
- }
316
- } catch {}
317
- }
318
- resolveLog(true);
319
- }
320
- _log(logObj) {
321
- for (const reporter of this.options.reporters) {
322
- reporter.log(logObj, {
323
- options: this.options
324
- });
325
- }
326
- }
327
- }
328
- function _normalizeLogLevel(input, types = {}, defaultLevel = 3) {
329
- if (input === undefined) {
330
- return defaultLevel;
331
- }
332
- if (typeof input === "number") {
333
- return input;
334
- }
335
- if (types[input] && types[input].level !== undefined) {
336
- return types[input].level;
337
- }
338
- return defaultLevel;
339
- }
340
- function createConsola(options = {}) {
341
- return new Consola(options);
342
- }
343
- var LogLevels, LogTypes, defu, paused = false, queue;
344
- var init_core = __esm(() => {
345
- LogLevels = {
346
- silent: Number.NEGATIVE_INFINITY,
347
- fatal: 0,
348
- error: 0,
349
- warn: 1,
350
- log: 2,
351
- info: 3,
352
- success: 3,
353
- fail: 3,
354
- ready: 3,
355
- start: 3,
356
- box: 3,
357
- debug: 4,
358
- trace: 5,
359
- verbose: Number.POSITIVE_INFINITY
360
- };
361
- LogTypes = {
362
- silent: {
363
- level: -1
364
- },
365
- fatal: {
366
- level: LogLevels.fatal
367
- },
368
- error: {
369
- level: LogLevels.error
370
- },
371
- warn: {
372
- level: LogLevels.warn
373
- },
374
- log: {
375
- level: LogLevels.log
376
- },
377
- info: {
378
- level: LogLevels.info
379
- },
380
- success: {
381
- level: LogLevels.success
382
- },
383
- fail: {
384
- level: LogLevels.fail
385
- },
386
- ready: {
387
- level: LogLevels.info
388
- },
389
- start: {
390
- level: LogLevels.info
391
- },
392
- box: {
393
- level: LogLevels.info
394
- },
395
- debug: {
396
- level: LogLevels.debug
397
- },
398
- trace: {
399
- level: LogLevels.trace
400
- },
401
- verbose: {
402
- level: LogLevels.verbose
403
- }
404
- };
405
- defu = createDefu();
406
- queue = [];
407
- Consola.prototype.add = Consola.prototype.addReporter;
408
- Consola.prototype.remove = Consola.prototype.removeReporter;
409
- Consola.prototype.clear = Consola.prototype.removeReporter;
410
- Consola.prototype.withScope = Consola.prototype.withTag;
411
- Consola.prototype.mock = Consola.prototype.mockTypes;
412
- Consola.prototype.pause = Consola.prototype.pauseLogs;
413
- Consola.prototype.resume = Consola.prototype.resumeLogs;
414
- });
415
-
416
- // ../../node_modules/consola/dist/shared/consola.DRwqZj3T.mjs
417
- import { formatWithOptions } from "util";
418
- import { sep } from "path";
419
- function parseStack(stack, message) {
420
- const cwd = process.cwd() + sep;
421
- const lines = stack.split(`
422
- `).splice(message.split(`
423
- `).length).map((l) => l.trim().replace("file://", "").replace(cwd, ""));
424
- return lines;
425
- }
426
- function writeStream(data, stream) {
427
- const write = stream.__write || stream.write;
428
- return write.call(stream, data);
429
- }
430
-
431
- class BasicReporter {
432
- formatStack(stack, message, opts) {
433
- const indent = " ".repeat((opts?.errorLevel || 0) + 1);
434
- return indent + parseStack(stack, message).join(`
435
- ${indent}`);
436
- }
437
- formatError(err, opts) {
438
- const message = err.message ?? formatWithOptions(opts, err);
439
- const stack = err.stack ? this.formatStack(err.stack, message, opts) : "";
440
- const level = opts?.errorLevel || 0;
441
- const causedPrefix = level > 0 ? `${" ".repeat(level)}[cause]: ` : "";
442
- const causedError = err.cause ? `
443
-
444
- ` + this.formatError(err.cause, { ...opts, errorLevel: level + 1 }) : "";
445
- return causedPrefix + message + `
446
- ` + stack + causedError;
447
- }
448
- formatArgs(args, opts) {
449
- const _args = args.map((arg) => {
450
- if (arg && typeof arg.stack === "string") {
451
- return this.formatError(arg, opts);
452
- }
453
- return arg;
454
- });
455
- return formatWithOptions(opts, ..._args);
456
- }
457
- formatDate(date, opts) {
458
- return opts.date ? date.toLocaleTimeString() : "";
459
- }
460
- filterAndJoin(arr) {
461
- return arr.filter(Boolean).join(" ");
462
- }
463
- formatLogObj(logObj, opts) {
464
- const message = this.formatArgs(logObj.args, opts);
465
- if (logObj.type === "box") {
466
- return `
467
- ` + [
468
- bracket(logObj.tag),
469
- logObj.title && logObj.title,
470
- ...message.split(`
471
- `)
472
- ].filter(Boolean).map((l) => " > " + l).join(`
473
- `) + `
474
- `;
475
- }
476
- return this.filterAndJoin([
477
- bracket(logObj.type),
478
- bracket(logObj.tag),
479
- message
480
- ]);
481
- }
482
- log(logObj, ctx) {
483
- const line = this.formatLogObj(logObj, {
484
- columns: ctx.options.stdout.columns || 0,
485
- ...ctx.options.formatOptions
486
- });
487
- return writeStream(line + `
488
- `, logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout);
489
- }
490
- }
491
- var bracket = (x) => x ? `[${x}]` : "";
492
- var init_consola_DRwqZj3T = () => {};
493
-
494
- // ../../node_modules/consola/dist/shared/consola.DXBYu-KD.mjs
495
- import * as tty from "tty";
496
- 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)) {
497
- return head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
498
- }
499
- function clearBleed(index, string, open, close, replace) {
500
- return index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
501
- }
502
- function filterEmpty(open, close, replace = open, at = open.length + 1) {
503
- return (string) => string || !(string === "" || string === undefined) ? clearBleed(("" + string).indexOf(close, at), string, open, close, replace) : "";
504
- }
505
- function init(open, close, replace) {
506
- return filterEmpty(`\x1B[${open}m`, `\x1B[${close}m`, replace);
507
- }
508
- function createColors(useColor = isColorSupported) {
509
- return useColor ? colorDefs : Object.fromEntries(Object.keys(colorDefs).map((key) => [key, String]));
510
- }
511
- function getColor(color, fallback = "reset") {
512
- return colors[color] || colors[fallback];
513
- }
514
- function stripAnsi(text) {
515
- return text.replace(new RegExp(ansiRegex, "g"), "");
516
- }
517
- function box(text, _opts = {}) {
518
- const opts = {
519
- ..._opts,
520
- style: {
521
- ...defaultStyle,
522
- ..._opts.style
523
- }
524
- };
525
- const textLines = text.split(`
526
- `);
527
- const boxLines = [];
528
- const _color = getColor(opts.style.borderColor);
529
- const borderStyle = {
530
- ...typeof opts.style.borderStyle === "string" ? boxStylePresets[opts.style.borderStyle] || boxStylePresets.solid : opts.style.borderStyle
531
- };
532
- if (_color) {
533
- for (const key in borderStyle) {
534
- borderStyle[key] = _color(borderStyle[key]);
535
- }
536
- }
537
- const paddingOffset = opts.style.padding % 2 === 0 ? opts.style.padding : opts.style.padding + 1;
538
- const height = textLines.length + paddingOffset;
539
- const width = Math.max(...textLines.map((line) => stripAnsi(line).length), opts.title ? stripAnsi(opts.title).length : 0) + paddingOffset;
540
- const widthOffset = width + paddingOffset;
541
- const leftSpace = opts.style.marginLeft > 0 ? " ".repeat(opts.style.marginLeft) : "";
542
- if (opts.style.marginTop > 0) {
543
- boxLines.push("".repeat(opts.style.marginTop));
544
- }
545
- if (opts.title) {
546
- const title = _color ? _color(opts.title) : opts.title;
547
- const left = borderStyle.h.repeat(Math.floor((width - stripAnsi(opts.title).length) / 2));
548
- const right = borderStyle.h.repeat(width - stripAnsi(opts.title).length - stripAnsi(left).length + paddingOffset);
549
- boxLines.push(`${leftSpace}${borderStyle.tl}${left}${title}${right}${borderStyle.tr}`);
550
- } else {
551
- boxLines.push(`${leftSpace}${borderStyle.tl}${borderStyle.h.repeat(widthOffset)}${borderStyle.tr}`);
552
- }
553
- const valignOffset = opts.style.valign === "center" ? Math.floor((height - textLines.length) / 2) : opts.style.valign === "top" ? height - textLines.length - paddingOffset : height - textLines.length;
554
- for (let i = 0;i < height; i++) {
555
- if (i < valignOffset || i >= valignOffset + textLines.length) {
556
- boxLines.push(`${leftSpace}${borderStyle.v}${" ".repeat(widthOffset)}${borderStyle.v}`);
557
- } else {
558
- const line = textLines[i - valignOffset];
559
- const left = " ".repeat(paddingOffset);
560
- const right = " ".repeat(width - stripAnsi(line).length);
561
- boxLines.push(`${leftSpace}${borderStyle.v}${left}${line}${right}${borderStyle.v}`);
562
- }
563
- }
564
- boxLines.push(`${leftSpace}${borderStyle.bl}${borderStyle.h.repeat(widthOffset)}${borderStyle.br}`);
565
- if (opts.style.marginBottom > 0) {
566
- boxLines.push("".repeat(opts.style.marginBottom));
567
- }
568
- return boxLines.join(`
569
- `);
570
- }
571
- var env, argv, platform, isDisabled, isForced, isWindows, isDumbTerminal, isCompatibleTerminal, isCI, isColorSupported, colorDefs, colors, ansiRegex, boxStylePresets, defaultStyle;
572
- var init_consola_DXBYu_KD = __esm(() => {
573
- ({
574
- env = {},
575
- argv = [],
576
- platform = ""
577
- } = typeof process === "undefined" ? {} : process);
578
- isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
579
- isForced = "FORCE_COLOR" in env || argv.includes("--color");
580
- isWindows = platform === "win32";
581
- isDumbTerminal = env.TERM === "dumb";
582
- isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env.TERM && !isDumbTerminal;
583
- isCI = "CI" in env && (("GITHUB_ACTIONS" in env) || ("GITLAB_CI" in env) || ("CIRCLECI" in env));
584
- isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
585
- colorDefs = {
586
- reset: init(0, 0),
587
- bold: init(1, 22, "\x1B[22m\x1B[1m"),
588
- dim: init(2, 22, "\x1B[22m\x1B[2m"),
589
- italic: init(3, 23),
590
- underline: init(4, 24),
591
- inverse: init(7, 27),
592
- hidden: init(8, 28),
593
- strikethrough: init(9, 29),
594
- black: init(30, 39),
595
- red: init(31, 39),
596
- green: init(32, 39),
597
- yellow: init(33, 39),
598
- blue: init(34, 39),
599
- magenta: init(35, 39),
600
- cyan: init(36, 39),
601
- white: init(37, 39),
602
- gray: init(90, 39),
603
- bgBlack: init(40, 49),
604
- bgRed: init(41, 49),
605
- bgGreen: init(42, 49),
606
- bgYellow: init(43, 49),
607
- bgBlue: init(44, 49),
608
- bgMagenta: init(45, 49),
609
- bgCyan: init(46, 49),
610
- bgWhite: init(47, 49),
611
- blackBright: init(90, 39),
612
- redBright: init(91, 39),
613
- greenBright: init(92, 39),
614
- yellowBright: init(93, 39),
615
- blueBright: init(94, 39),
616
- magentaBright: init(95, 39),
617
- cyanBright: init(96, 39),
618
- whiteBright: init(97, 39),
619
- bgBlackBright: init(100, 49),
620
- bgRedBright: init(101, 49),
621
- bgGreenBright: init(102, 49),
622
- bgYellowBright: init(103, 49),
623
- bgBlueBright: init(104, 49),
624
- bgMagentaBright: init(105, 49),
625
- bgCyanBright: init(106, 49),
626
- bgWhiteBright: init(107, 49)
627
- };
628
- colors = createColors();
629
- ansiRegex = [
630
- String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`,
631
- String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`
632
- ].join("|");
633
- boxStylePresets = {
634
- solid: {
635
- tl: "\u250C",
636
- tr: "\u2510",
637
- bl: "\u2514",
638
- br: "\u2518",
639
- h: "\u2500",
640
- v: "\u2502"
641
- },
642
- double: {
643
- tl: "\u2554",
644
- tr: "\u2557",
645
- bl: "\u255A",
646
- br: "\u255D",
647
- h: "\u2550",
648
- v: "\u2551"
649
- },
650
- doubleSingle: {
651
- tl: "\u2553",
652
- tr: "\u2556",
653
- bl: "\u2559",
654
- br: "\u255C",
655
- h: "\u2500",
656
- v: "\u2551"
657
- },
658
- doubleSingleRounded: {
659
- tl: "\u256D",
660
- tr: "\u256E",
661
- bl: "\u2570",
662
- br: "\u256F",
663
- h: "\u2500",
664
- v: "\u2551"
665
- },
666
- singleThick: {
667
- tl: "\u250F",
668
- tr: "\u2513",
669
- bl: "\u2517",
670
- br: "\u251B",
671
- h: "\u2501",
672
- v: "\u2503"
673
- },
674
- singleDouble: {
675
- tl: "\u2552",
676
- tr: "\u2555",
677
- bl: "\u2558",
678
- br: "\u255B",
679
- h: "\u2550",
680
- v: "\u2502"
681
- },
682
- singleDoubleRounded: {
683
- tl: "\u256D",
684
- tr: "\u256E",
685
- bl: "\u2570",
686
- br: "\u256F",
687
- h: "\u2550",
688
- v: "\u2502"
689
- },
690
- rounded: {
691
- tl: "\u256D",
692
- tr: "\u256E",
693
- bl: "\u2570",
694
- br: "\u256F",
695
- h: "\u2500",
696
- v: "\u2502"
697
- }
698
- };
699
- defaultStyle = {
700
- borderColor: "white",
701
- borderStyle: "rounded",
702
- valign: "center",
703
- padding: 2,
704
- marginLeft: 1,
705
- marginTop: 1,
706
- marginBottom: 1
707
- };
708
- });
709
-
710
- // ../../node_modules/consola/dist/chunks/prompt.mjs
711
- var exports_prompt = {};
712
- __export(exports_prompt, {
713
- prompt: () => prompt,
714
- kCancel: () => kCancel
715
- });
716
- import g, { stdin, stdout } from "process";
717
- import f from "readline";
718
- import { WriteStream } from "tty";
719
- function getDefaultExportFromCjs(x) {
720
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
721
- }
722
- function requireSrc() {
723
- if (hasRequiredSrc)
724
- return src;
725
- hasRequiredSrc = 1;
726
- const ESC = "\x1B";
727
- const CSI = `${ESC}[`;
728
- const beep = "\x07";
729
- const cursor = {
730
- to(x, y) {
731
- if (!y)
732
- return `${CSI}${x + 1}G`;
733
- return `${CSI}${y + 1};${x + 1}H`;
734
- },
735
- move(x, y) {
736
- let ret = "";
737
- if (x < 0)
738
- ret += `${CSI}${-x}D`;
739
- else if (x > 0)
740
- ret += `${CSI}${x}C`;
741
- if (y < 0)
742
- ret += `${CSI}${-y}A`;
743
- else if (y > 0)
744
- ret += `${CSI}${y}B`;
745
- return ret;
746
- },
747
- up: (count = 1) => `${CSI}${count}A`,
748
- down: (count = 1) => `${CSI}${count}B`,
749
- forward: (count = 1) => `${CSI}${count}C`,
750
- backward: (count = 1) => `${CSI}${count}D`,
751
- nextLine: (count = 1) => `${CSI}E`.repeat(count),
752
- prevLine: (count = 1) => `${CSI}F`.repeat(count),
753
- left: `${CSI}G`,
754
- hide: `${CSI}?25l`,
755
- show: `${CSI}?25h`,
756
- save: `${ESC}7`,
757
- restore: `${ESC}8`
758
- };
759
- const scroll = {
760
- up: (count = 1) => `${CSI}S`.repeat(count),
761
- down: (count = 1) => `${CSI}T`.repeat(count)
762
- };
763
- const erase = {
764
- screen: `${CSI}2J`,
765
- up: (count = 1) => `${CSI}1J`.repeat(count),
766
- down: (count = 1) => `${CSI}J`.repeat(count),
767
- line: `${CSI}2K`,
768
- lineEnd: `${CSI}K`,
769
- lineStart: `${CSI}1K`,
770
- lines(count) {
771
- let clear = "";
772
- for (let i = 0;i < count; i++)
773
- clear += this.line + (i < count - 1 ? cursor.up() : "");
774
- if (count)
775
- clear += cursor.left;
776
- return clear;
777
- }
778
- };
779
- src = { cursor, scroll, erase, beep };
780
- return src;
781
- }
782
- function requirePicocolors() {
783
- if (hasRequiredPicocolors)
784
- return picocolors.exports;
785
- hasRequiredPicocolors = 1;
786
- let p = process || {}, argv2 = p.argv || [], env2 = p.env || {};
787
- 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);
788
- let formatter = (open, close, replace = open) => (input) => {
789
- let string = "" + input, index = string.indexOf(close, open.length);
790
- return ~index ? open + replaceClose2(string, close, replace, index) + close : open + string + close;
791
- };
792
- let replaceClose2 = (string, close, replace, index) => {
793
- let result = "", cursor = 0;
794
- do {
795
- result += string.substring(cursor, index) + replace;
796
- cursor = index + close.length;
797
- index = string.indexOf(close, cursor);
798
- } while (~index);
799
- return result + string.substring(cursor);
800
- };
801
- let createColors2 = (enabled = isColorSupported2) => {
802
- let f2 = enabled ? formatter : () => String;
803
- return {
804
- isColorSupported: enabled,
805
- reset: f2("\x1B[0m", "\x1B[0m"),
806
- bold: f2("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
807
- dim: f2("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
808
- italic: f2("\x1B[3m", "\x1B[23m"),
809
- underline: f2("\x1B[4m", "\x1B[24m"),
810
- inverse: f2("\x1B[7m", "\x1B[27m"),
811
- hidden: f2("\x1B[8m", "\x1B[28m"),
812
- strikethrough: f2("\x1B[9m", "\x1B[29m"),
813
- black: f2("\x1B[30m", "\x1B[39m"),
814
- red: f2("\x1B[31m", "\x1B[39m"),
815
- green: f2("\x1B[32m", "\x1B[39m"),
816
- yellow: f2("\x1B[33m", "\x1B[39m"),
817
- blue: f2("\x1B[34m", "\x1B[39m"),
818
- magenta: f2("\x1B[35m", "\x1B[39m"),
819
- cyan: f2("\x1B[36m", "\x1B[39m"),
820
- white: f2("\x1B[37m", "\x1B[39m"),
821
- gray: f2("\x1B[90m", "\x1B[39m"),
822
- bgBlack: f2("\x1B[40m", "\x1B[49m"),
823
- bgRed: f2("\x1B[41m", "\x1B[49m"),
824
- bgGreen: f2("\x1B[42m", "\x1B[49m"),
825
- bgYellow: f2("\x1B[43m", "\x1B[49m"),
826
- bgBlue: f2("\x1B[44m", "\x1B[49m"),
827
- bgMagenta: f2("\x1B[45m", "\x1B[49m"),
828
- bgCyan: f2("\x1B[46m", "\x1B[49m"),
829
- bgWhite: f2("\x1B[47m", "\x1B[49m"),
830
- blackBright: f2("\x1B[90m", "\x1B[39m"),
831
- redBright: f2("\x1B[91m", "\x1B[39m"),
832
- greenBright: f2("\x1B[92m", "\x1B[39m"),
833
- yellowBright: f2("\x1B[93m", "\x1B[39m"),
834
- blueBright: f2("\x1B[94m", "\x1B[39m"),
835
- magentaBright: f2("\x1B[95m", "\x1B[39m"),
836
- cyanBright: f2("\x1B[96m", "\x1B[39m"),
837
- whiteBright: f2("\x1B[97m", "\x1B[39m"),
838
- bgBlackBright: f2("\x1B[100m", "\x1B[49m"),
839
- bgRedBright: f2("\x1B[101m", "\x1B[49m"),
840
- bgGreenBright: f2("\x1B[102m", "\x1B[49m"),
841
- bgYellowBright: f2("\x1B[103m", "\x1B[49m"),
842
- bgBlueBright: f2("\x1B[104m", "\x1B[49m"),
843
- bgMagentaBright: f2("\x1B[105m", "\x1B[49m"),
844
- bgCyanBright: f2("\x1B[106m", "\x1B[49m"),
845
- bgWhiteBright: f2("\x1B[107m", "\x1B[49m")
846
- };
847
- };
848
- picocolors.exports = createColors2();
849
- picocolors.exports.createColors = createColors2;
850
- return picocolors.exports;
851
- }
852
- function J({ onlyFirst: t = false } = {}) {
853
- const F = ["[\\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("|");
854
- return new RegExp(F, t ? undefined : "g");
855
- }
856
- function T$1(t) {
857
- if (typeof t != "string")
858
- throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);
859
- return t.replace(Q, "");
860
- }
861
- function O(t) {
862
- return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
863
- }
864
- function A$1(t, u = {}) {
865
- if (typeof t != "string" || t.length === 0 || (u = { ambiguousIsNarrow: true, ...u }, t = T$1(t), t.length === 0))
866
- return 0;
867
- t = t.replace(FD(), " ");
868
- const F = u.ambiguousIsNarrow ? 1 : 2;
869
- let e2 = 0;
870
- for (const s of t) {
871
- const i = s.codePointAt(0);
872
- if (i <= 31 || i >= 127 && i <= 159 || i >= 768 && i <= 879)
873
- continue;
874
- switch (DD.eastAsianWidth(s)) {
875
- case "F":
876
- case "W":
877
- e2 += 2;
878
- break;
879
- case "A":
880
- e2 += F;
881
- break;
882
- default:
883
- e2 += 1;
884
- }
885
- }
886
- return e2;
887
- }
888
- function sD() {
889
- const t = new Map;
890
- for (const [u, F] of Object.entries(r)) {
891
- for (const [e2, s] of Object.entries(F))
892
- r[e2] = { open: `\x1B[${s[0]}m`, close: `\x1B[${s[1]}m` }, F[e2] = r[e2], t.set(s[0], s[1]);
893
- Object.defineProperty(r, u, { value: F, enumerable: false });
894
- }
895
- return Object.defineProperty(r, "codes", { value: t, 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: (u, F, e2) => u === F && F === e2 ? u < 8 ? 16 : u > 248 ? 231 : Math.round((u - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u / 255 * 5) + 6 * Math.round(F / 255 * 5) + Math.round(e2 / 255 * 5), enumerable: false }, hexToRgb: { value: (u) => {
896
- const F = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));
897
- if (!F)
898
- return [0, 0, 0];
899
- let [e2] = F;
900
- e2.length === 3 && (e2 = [...e2].map((i) => i + i).join(""));
901
- const s = Number.parseInt(e2, 16);
902
- return [s >> 16 & 255, s >> 8 & 255, s & 255];
903
- }, enumerable: false }, hexToAnsi256: { value: (u) => r.rgbToAnsi256(...r.hexToRgb(u)), enumerable: false }, ansi256ToAnsi: { value: (u) => {
904
- if (u < 8)
905
- return 30 + u;
906
- if (u < 16)
907
- return 90 + (u - 8);
908
- let F, e2, s;
909
- if (u >= 232)
910
- F = ((u - 232) * 10 + 8) / 255, e2 = F, s = F;
911
- else {
912
- u -= 16;
913
- const C = u % 36;
914
- F = Math.floor(u / 36) / 5, e2 = Math.floor(C / 6) / 5, s = C % 6 / 5;
915
- }
916
- const i = Math.max(F, e2, s) * 2;
917
- if (i === 0)
918
- return 30;
919
- let D = 30 + (Math.round(s) << 2 | Math.round(e2) << 1 | Math.round(F));
920
- return i === 2 && (D += 60), D;
921
- }, enumerable: false }, rgbToAnsi: { value: (u, F, e2) => r.ansi256ToAnsi(r.rgbToAnsi256(u, F, e2)), enumerable: false }, hexToAnsi: { value: (u) => r.ansi256ToAnsi(r.hexToAnsi256(u)), enumerable: false } }), r;
922
- }
923
- function G(t, u, F) {
924
- return String(t).normalize().replace(/\r\n/g, `
925
- `).split(`
926
- `).map((e2) => oD(e2, u, F)).join(`
927
- `);
928
- }
929
- function k$1(t, u) {
930
- if (typeof t == "string")
931
- return c.aliases.get(t) === u;
932
- for (const F of t)
933
- if (F !== undefined && k$1(F, u))
934
- return true;
935
- return false;
936
- }
937
- function lD(t, u) {
938
- if (t === u)
939
- return;
940
- const F = t.split(`
941
- `), e2 = u.split(`
942
- `), s = [];
943
- for (let i = 0;i < Math.max(F.length, e2.length); i++)
944
- F[i] !== e2[i] && s.push(i);
945
- return s;
946
- }
947
- function d$1(t, u) {
948
- const F = t;
949
- F.isTTY && F.setRawMode(u);
950
- }
951
-
952
- class x {
953
- constructor(u, F = true) {
954
- 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", new Map), h(this, "_cursor", 0), h(this, "state", "initial"), h(this, "error", ""), h(this, "value");
955
- const { input: e2 = stdin, output: s = stdout, render: i, signal: D, ...C } = u;
956
- this.opts = C, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = i.bind(this), this._track = F, this._abortSignal = D, this.input = e2, this.output = s;
957
- }
958
- unsubscribe() {
959
- this._subscribers.clear();
960
- }
961
- setSubscriber(u, F) {
962
- const e2 = this._subscribers.get(u) ?? [];
963
- e2.push(F), this._subscribers.set(u, e2);
964
- }
965
- on(u, F) {
966
- this.setSubscriber(u, { cb: F });
967
- }
968
- once(u, F) {
969
- this.setSubscriber(u, { cb: F, once: true });
970
- }
971
- emit(u, ...F) {
972
- const e2 = this._subscribers.get(u) ?? [], s = [];
973
- for (const i of e2)
974
- i.cb(...F), i.once && s.push(() => e2.splice(e2.indexOf(i), 1));
975
- for (const i of s)
976
- i();
977
- }
978
- prompt() {
979
- return new Promise((u, F) => {
980
- if (this._abortSignal) {
981
- if (this._abortSignal.aborted)
982
- return this.state = "cancel", this.close(), u(S);
983
- this._abortSignal.addEventListener("abort", () => {
984
- this.state = "cancel", this.close();
985
- }, { once: true });
986
- }
987
- const e2 = new WriteStream(0);
988
- e2._write = (s, i, D) => {
989
- this._track && (this.value = this.rl?.line.replace(/\t/g, ""), this._cursor = this.rl?.cursor ?? 0, this.emit("value", this.value)), D();
990
- }, 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 !== undefined && 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", () => {
991
- this.output.write(srcExports.cursor.show), this.output.off("resize", this.render), d$1(this.input, false), u(this.value);
992
- }), this.once("cancel", () => {
993
- this.output.write(srcExports.cursor.show), this.output.off("resize", this.render), d$1(this.input, false), u(S);
994
- });
995
- });
996
- }
997
- onKeypress(u, F) {
998
- if (this.state === "error" && (this.state = "active"), F?.name && (!this._track && c.aliases.has(F.name) && this.emit("cursor", c.aliases.get(F.name)), c.actions.has(F.name) && this.emit("cursor", F.name)), u && (u.toLowerCase() === "y" || u.toLowerCase() === "n") && this.emit("confirm", u.toLowerCase() === "y"), u === "\t" && this.opts.placeholder && (this.value || (this.rl?.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u && this.emit("key", u.toLowerCase()), F?.name === "return") {
999
- if (this.opts.validate) {
1000
- const e2 = this.opts.validate(this.value);
1001
- e2 && (this.error = e2 instanceof Error ? e2.message : e2, this.state = "error", this.rl?.write(this.value));
1002
- }
1003
- this.state !== "error" && (this.state = "submit");
1004
- }
1005
- k$1([u, F?.name, F?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
1006
- }
1007
- close() {
1008
- this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
1009
- `), d$1(this.input, false), this.rl?.close(), this.rl = undefined, this.emit(`${this.state}`, this.value), this.unsubscribe();
1010
- }
1011
- restoreCursor() {
1012
- const u = G(this._prevFrame, process.stdout.columns, { hard: true }).split(`
1013
- `).length - 1;
1014
- this.output.write(srcExports.cursor.move(-999, u * -1));
1015
- }
1016
- render() {
1017
- const u = G(this._render(this) ?? "", process.stdout.columns, { hard: true });
1018
- if (u !== this._prevFrame) {
1019
- if (this.state === "initial")
1020
- this.output.write(srcExports.cursor.hide);
1021
- else {
1022
- const F = lD(this._prevFrame, u);
1023
- if (this.restoreCursor(), F && F?.length === 1) {
1024
- const e2 = F[0];
1025
- this.output.write(srcExports.cursor.move(0, e2)), this.output.write(srcExports.erase.lines(1));
1026
- const s = u.split(`
1027
- `);
1028
- this.output.write(s[e2]), this._prevFrame = u, this.output.write(srcExports.cursor.move(0, s.length - e2 - 1));
1029
- return;
1030
- }
1031
- if (F && F?.length > 1) {
1032
- const e2 = F[0];
1033
- this.output.write(srcExports.cursor.move(0, e2)), this.output.write(srcExports.erase.down());
1034
- const s = u.split(`
1035
- `).slice(e2);
1036
- this.output.write(s.join(`
1037
- `)), this._prevFrame = u;
1038
- return;
1039
- }
1040
- this.output.write(srcExports.erase.down());
1041
- }
1042
- this.output.write(u), this.state === "initial" && (this.state = "active"), this._prevFrame = u;
1043
- }
1044
- }
1045
- }
1046
- function ce() {
1047
- 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";
1048
- }
1049
- async function prompt(message, opts = {}) {
1050
- const handleCancel = (value) => {
1051
- if (typeof value !== "symbol" || value.toString() !== "Symbol(clack:cancel)") {
1052
- return value;
1053
- }
1054
- switch (opts.cancel) {
1055
- case "reject": {
1056
- const error = new Error("Prompt cancelled.");
1057
- error.name = "ConsolaPromptCancelledError";
1058
- if (Error.captureStackTrace) {
1059
- Error.captureStackTrace(error, prompt);
1060
- }
1061
- throw error;
1062
- }
1063
- case "undefined": {
1064
- return;
1065
- }
1066
- case "null": {
1067
- return null;
1068
- }
1069
- case "symbol": {
1070
- return kCancel;
1071
- }
1072
- default:
1073
- case "default": {
1074
- return opts.default ?? opts.initial;
1075
- }
1076
- }
1077
- };
1078
- if (!opts.type || opts.type === "text") {
1079
- return await he({
1080
- message,
1081
- defaultValue: opts.default,
1082
- placeholder: opts.placeholder,
1083
- initialValue: opts.initial
1084
- }).then(handleCancel);
1085
- }
1086
- if (opts.type === "confirm") {
1087
- return await ye({
1088
- message,
1089
- initialValue: opts.initial
1090
- }).then(handleCancel);
1091
- }
1092
- if (opts.type === "select") {
1093
- return await ve({
1094
- message,
1095
- options: opts.options.map((o2) => typeof o2 === "string" ? { value: o2, label: o2 } : o2),
1096
- initialValue: opts.initial
1097
- }).then(handleCancel);
1098
- }
1099
- if (opts.type === "multiselect") {
1100
- return await fe({
1101
- message,
1102
- options: opts.options.map((o2) => typeof o2 === "string" ? { value: o2, label: o2 } : o2),
1103
- required: opts.required,
1104
- initialValues: opts.initial
1105
- }).then(handleCancel);
1106
- }
1107
- throw new Error(`Unknown prompt type: ${opts.type}`);
1108
- }
1109
- var src, hasRequiredSrc, srcExports, picocolors, hasRequiredPicocolors, picocolorsExports, e, Q, P$1, X, DD, uD = function() {
1110
- 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;
1111
- }, FD, m = 10, L$1 = (t = 0) => (u) => `\x1B[${u + t}m`, N = (t = 0) => (u) => `\x1B[${38 + t};5;${u}m`, I = (t = 0) => (u, F, e2) => `\x1B[${38 + t};2;${u};${F};${e2}m`, r, tD, eD, iD, v, CD = 39, w$1 = "\x07", W$1 = "[", rD = "]", R = "m", y, V$1 = (t) => `${v.values().next().value}${W$1}${t}${R}`, z = (t) => `${v.values().next().value}${y}${t}${w$1}`, ED = (t) => t.split(" ").map((u) => A$1(u)), _ = (t, u, F) => {
1112
- const e2 = [...u];
1113
- let s = false, i = false, D = A$1(T$1(t[t.length - 1]));
1114
- for (const [C, o] of e2.entries()) {
1115
- const E = A$1(o);
1116
- if (D + E <= F ? t[t.length - 1] += o : (t.push(o), D = 0), v.has(o) && (s = true, i = e2.slice(C + 1).join("").startsWith(y)), s) {
1117
- i ? o === w$1 && (s = false, i = false) : o === R && (s = false);
1118
- continue;
1119
- }
1120
- D += E, D === F && C < e2.length - 1 && (t.push(""), D = 0);
1121
- }
1122
- !D && t[t.length - 1].length > 0 && t.length > 1 && (t[t.length - 2] += t.pop());
1123
- }, nD = (t) => {
1124
- const u = t.split(" ");
1125
- let F = u.length;
1126
- for (;F > 0 && !(A$1(u[F - 1]) > 0); )
1127
- F--;
1128
- return F === u.length ? t : u.slice(0, F).join(" ") + u.slice(F).join("");
1129
- }, oD = (t, u, F = {}) => {
1130
- if (F.trim !== false && t.trim() === "")
1131
- return "";
1132
- let e2 = "", s, i;
1133
- const D = ED(t);
1134
- let C = [""];
1135
- for (const [E, a] of t.split(" ").entries()) {
1136
- F.trim !== false && (C[C.length - 1] = C[C.length - 1].trimStart());
1137
- let n = A$1(C[C.length - 1]);
1138
- if (E !== 0 && (n >= u && (F.wordWrap === false || F.trim === false) && (C.push(""), n = 0), (n > 0 || F.trim === false) && (C[C.length - 1] += " ", n++)), F.hard && D[E] > u) {
1139
- const B = u - n, p = 1 + Math.floor((D[E] - B - 1) / u);
1140
- Math.floor((D[E] - 1) / u) < p && C.push(""), _(C, a, u);
1141
- continue;
1142
- }
1143
- if (n + D[E] > u && n > 0 && D[E] > 0) {
1144
- if (F.wordWrap === false && n < u) {
1145
- _(C, a, u);
1146
- continue;
1147
- }
1148
- C.push("");
1149
- }
1150
- if (n + D[E] > u && F.wordWrap === false) {
1151
- _(C, a, u);
1152
- continue;
1153
- }
1154
- C[C.length - 1] += a;
1155
- }
1156
- F.trim !== false && (C = C.map((E) => nD(E)));
1157
- const o = [...C.join(`
1158
- `)];
1159
- for (const [E, a] of o.entries()) {
1160
- if (e2 += a, v.has(a)) {
1161
- const { groups: B } = new RegExp(`(?:\\${W$1}(?<code>\\d+)m|\\${y}(?<uri>.*)${w$1})`).exec(o.slice(E).join("")) || { groups: {} };
1162
- if (B.code !== undefined) {
1163
- const p = Number.parseFloat(B.code);
1164
- s = p === CD ? undefined : p;
1165
- } else
1166
- B.uri !== undefined && (i = B.uri.length === 0 ? undefined : B.uri);
1167
- }
1168
- const n = iD.codes.get(Number(s));
1169
- o[E + 1] === `
1170
- ` ? (i && (e2 += z("")), s && n && (e2 += V$1(n))) : a === `
1171
- ` && (s && n && (e2 += V$1(s)), i && (e2 += z(i)));
1172
- }
1173
- return e2;
1174
- }, aD, c, S, AD, pD = (t, u, F) => (u in t) ? AD(t, u, { enumerable: true, configurable: true, writable: true, value: F }) : t[u] = F, h = (t, u, F) => (pD(t, typeof u != "symbol" ? u + "" : u, F), F), fD, bD, mD = (t, u, F) => (u in t) ? bD(t, u, { enumerable: true, configurable: true, writable: true, value: F }) : t[u] = F, Y = (t, u, F) => (mD(t, typeof u != "symbol" ? u + "" : u, F), F), wD, SD, $D = (t, u, F) => (u in t) ? SD(t, u, { enumerable: true, configurable: true, writable: true, value: F }) : t[u] = F, q = (t, u, F) => ($D(t, typeof u != "symbol" ? u + "" : u, F), F), jD, PD, V, u = (t, n) => V ? t : n, le, L, W, C, o, d, k, P, A, T, F, w = (t) => {
1175
- switch (t) {
1176
- case "initial":
1177
- case "active":
1178
- return e.cyan(le);
1179
- case "cancel":
1180
- return e.red(L);
1181
- case "error":
1182
- return e.yellow(W);
1183
- case "submit":
1184
- return e.green(C);
1185
- }
1186
- }, B = (t) => {
1187
- const { cursor: n, options: s, style: r2 } = t, i = t.maxItems ?? Number.POSITIVE_INFINITY, a = Math.max(process.stdout.rows - 4, 0), c2 = Math.min(a, Math.max(i, 5));
1188
- let l = 0;
1189
- n >= l + c2 - 3 ? l = Math.max(Math.min(n - c2 + 3, s.length - c2), 0) : n < l + 2 && (l = Math.max(n - 2, 0));
1190
- const $ = c2 < s.length && l > 0, p = c2 < s.length && l + c2 < s.length;
1191
- return s.slice(l, l + c2).map((M, v2, x2) => {
1192
- const j = v2 === 0 && $, E = v2 === x2.length - 1 && p;
1193
- return j || E ? e.dim("...") : r2(M, v2 + l === n);
1194
- });
1195
- }, he = (t) => new PD({ validate: t.validate, placeholder: t.placeholder, defaultValue: t.defaultValue, initialValue: t.initialValue, render() {
1196
- const n = `${e.gray(o)}
1197
- ${w(this.state)} ${t.message}
1198
- `, s = t.placeholder ? e.inverse(t.placeholder[0]) + e.dim(t.placeholder.slice(1)) : e.inverse(e.hidden("_")), r2 = this.value ? this.valueWithCursor : s;
1199
- switch (this.state) {
1200
- case "error":
1201
- return `${n.trim()}
1202
- ${e.yellow(o)} ${r2}
1203
- ${e.yellow(d)} ${e.yellow(this.error)}
1204
- `;
1205
- case "submit":
1206
- return `${n}${e.gray(o)} ${e.dim(this.value || t.placeholder)}`;
1207
- case "cancel":
1208
- return `${n}${e.gray(o)} ${e.strikethrough(e.dim(this.value ?? ""))}${this.value?.trim() ? `
1209
- ${e.gray(o)}` : ""}`;
1210
- default:
1211
- return `${n}${e.cyan(o)} ${r2}
1212
- ${e.cyan(d)}
1213
- `;
1214
- }
1215
- } }).prompt(), ye = (t) => {
1216
- const n = t.active ?? "Yes", s = t.inactive ?? "No";
1217
- return new fD({ active: n, inactive: s, initialValue: t.initialValue ?? true, render() {
1218
- const r2 = `${e.gray(o)}
1219
- ${w(this.state)} ${t.message}
1220
- `, i = this.value ? n : s;
1221
- switch (this.state) {
1222
- case "submit":
1223
- return `${r2}${e.gray(o)} ${e.dim(i)}`;
1224
- case "cancel":
1225
- return `${r2}${e.gray(o)} ${e.strikethrough(e.dim(i))}
1226
- ${e.gray(o)}`;
1227
- default:
1228
- return `${r2}${e.cyan(o)} ${this.value ? `${e.green(k)} ${n}` : `${e.dim(P)} ${e.dim(n)}`} ${e.dim("/")} ${this.value ? `${e.dim(P)} ${e.dim(s)}` : `${e.green(k)} ${s}`}
1229
- ${e.cyan(d)}
1230
- `;
1231
- }
1232
- } }).prompt();
1233
- }, ve = (t) => {
1234
- const n = (s, r2) => {
1235
- const i = s.label ?? String(s.value);
1236
- switch (r2) {
1237
- case "selected":
1238
- return `${e.dim(i)}`;
1239
- case "active":
1240
- return `${e.green(k)} ${i} ${s.hint ? e.dim(`(${s.hint})`) : ""}`;
1241
- case "cancelled":
1242
- return `${e.strikethrough(e.dim(i))}`;
1243
- default:
1244
- return `${e.dim(P)} ${e.dim(i)}`;
1245
- }
1246
- };
1247
- return new jD({ options: t.options, initialValue: t.initialValue, render() {
1248
- const s = `${e.gray(o)}
1249
- ${w(this.state)} ${t.message}
1250
- `;
1251
- switch (this.state) {
1252
- case "submit":
1253
- return `${s}${e.gray(o)} ${n(this.options[this.cursor], "selected")}`;
1254
- case "cancel":
1255
- return `${s}${e.gray(o)} ${n(this.options[this.cursor], "cancelled")}
1256
- ${e.gray(o)}`;
1257
- default:
1258
- return `${s}${e.cyan(o)} ${B({ cursor: this.cursor, options: this.options, maxItems: t.maxItems, style: (r2, i) => n(r2, i ? "active" : "inactive") }).join(`
1259
- ${e.cyan(o)} `)}
1260
- ${e.cyan(d)}
1261
- `;
1262
- }
1263
- } }).prompt();
1264
- }, fe = (t) => {
1265
- const n = (s, r2) => {
1266
- const i = s.label ?? String(s.value);
1267
- return r2 === "active" ? `${e.cyan(A)} ${i} ${s.hint ? e.dim(`(${s.hint})`) : ""}` : r2 === "selected" ? `${e.green(T)} ${e.dim(i)}` : r2 === "cancelled" ? `${e.strikethrough(e.dim(i))}` : r2 === "active-selected" ? `${e.green(T)} ${i} ${s.hint ? e.dim(`(${s.hint})`) : ""}` : r2 === "submitted" ? `${e.dim(i)}` : `${e.dim(F)} ${e.dim(i)}`;
1268
- };
1269
- return new wD({ options: t.options, initialValues: t.initialValues, required: t.required ?? true, cursorAt: t.cursorAt, validate(s) {
1270
- if (this.required && s.length === 0)
1271
- return `Please select at least one option.
1272
- ${e.reset(e.dim(`Press ${e.gray(e.bgWhite(e.inverse(" space ")))} to select, ${e.gray(e.bgWhite(e.inverse(" enter ")))} to submit`))}`;
1273
- }, render() {
1274
- const s = `${e.gray(o)}
1275
- ${w(this.state)} ${t.message}
1276
- `, r2 = (i, a) => {
1277
- const c2 = this.value.includes(i.value);
1278
- return a && c2 ? n(i, "active-selected") : c2 ? n(i, "selected") : n(i, a ? "active" : "inactive");
1279
- };
1280
- switch (this.state) {
1281
- case "submit":
1282
- return `${s}${e.gray(o)} ${this.options.filter(({ value: i }) => this.value.includes(i)).map((i) => n(i, "submitted")).join(e.dim(", ")) || e.dim("none")}`;
1283
- case "cancel": {
1284
- const i = this.options.filter(({ value: a }) => this.value.includes(a)).map((a) => n(a, "cancelled")).join(e.dim(", "));
1285
- return `${s}${e.gray(o)} ${i.trim() ? `${i}
1286
- ${e.gray(o)}` : ""}`;
1287
- }
1288
- case "error": {
1289
- const i = this.error.split(`
1290
- `).map((a, c2) => c2 === 0 ? `${e.yellow(d)} ${e.yellow(a)}` : ` ${a}`).join(`
1291
- `);
1292
- return `${s + e.yellow(o)} ${B({ options: this.options, cursor: this.cursor, maxItems: t.maxItems, style: r2 }).join(`
1293
- ${e.yellow(o)} `)}
1294
- ${i}
1295
- `;
1296
- }
1297
- default:
1298
- return `${s}${e.cyan(o)} ${B({ options: this.options, cursor: this.cursor, maxItems: t.maxItems, style: r2 }).join(`
1299
- ${e.cyan(o)} `)}
1300
- ${e.cyan(d)}
1301
- `;
1302
- }
1303
- } }).prompt();
1304
- }, kCancel;
1305
- var init_prompt = __esm(() => {
1306
- srcExports = requireSrc();
1307
- picocolors = { exports: {} };
1308
- picocolorsExports = /* @__PURE__ */ requirePicocolors();
1309
- e = /* @__PURE__ */ getDefaultExportFromCjs(picocolorsExports);
1310
- Q = J();
1311
- P$1 = { exports: {} };
1312
- (function(t) {
1313
- var u = {};
1314
- t.exports = u, u.eastAsianWidth = function(e2) {
1315
- var s = e2.charCodeAt(0), i = e2.length == 2 ? e2.charCodeAt(1) : 0, D = s;
1316
- return 55296 <= s && s <= 56319 && 56320 <= i && i <= 57343 && (s &= 1023, i &= 1023, D = s << 10 | i, D += 65536), D == 12288 || 65281 <= D && D <= 65376 || 65504 <= D && D <= 65510 ? "F" : D == 8361 || 65377 <= D && D <= 65470 || 65474 <= D && D <= 65479 || 65482 <= D && D <= 65487 || 65490 <= D && D <= 65495 || 65498 <= D && D <= 65500 || 65512 <= D && D <= 65518 ? "H" : 4352 <= D && D <= 4447 || 4515 <= D && D <= 4519 || 4602 <= D && D <= 4607 || 9001 <= D && D <= 9002 || 11904 <= D && D <= 11929 || 11931 <= D && D <= 12019 || 12032 <= D && D <= 12245 || 12272 <= D && D <= 12283 || 12289 <= D && D <= 12350 || 12353 <= D && D <= 12438 || 12441 <= D && D <= 12543 || 12549 <= D && D <= 12589 || 12593 <= D && D <= 12686 || 12688 <= D && D <= 12730 || 12736 <= D && D <= 12771 || 12784 <= D && D <= 12830 || 12832 <= D && D <= 12871 || 12880 <= D && D <= 13054 || 13056 <= D && D <= 19903 || 19968 <= D && D <= 42124 || 42128 <= D && D <= 42182 || 43360 <= D && D <= 43388 || 44032 <= D && D <= 55203 || 55216 <= D && D <= 55238 || 55243 <= D && D <= 55291 || 63744 <= D && D <= 64255 || 65040 <= D && D <= 65049 || 65072 <= D && D <= 65106 || 65108 <= D && D <= 65126 || 65128 <= D && D <= 65131 || 110592 <= D && D <= 110593 || 127488 <= D && D <= 127490 || 127504 <= D && D <= 127546 || 127552 <= D && D <= 127560 || 127568 <= D && D <= 127569 || 131072 <= D && D <= 194367 || 177984 <= D && D <= 196605 || 196608 <= D && D <= 262141 ? "W" : 32 <= D && D <= 126 || 162 <= D && D <= 163 || 165 <= D && D <= 166 || D == 172 || D == 175 || 10214 <= D && D <= 10221 || 10629 <= D && D <= 10630 ? "Na" : D == 161 || D == 164 || 167 <= D && D <= 168 || D == 170 || 173 <= D && D <= 174 || 176 <= D && D <= 180 || 182 <= D && D <= 186 || 188 <= D && D <= 191 || D == 198 || D == 208 || 215 <= D && D <= 216 || 222 <= D && D <= 225 || D == 230 || 232 <= D && D <= 234 || 236 <= D && D <= 237 || D == 240 || 242 <= D && D <= 243 || 247 <= D && D <= 250 || D == 252 || D == 254 || D == 257 || D == 273 || D == 275 || D == 283 || 294 <= D && D <= 295 || D == 299 || 305 <= D && D <= 307 || D == 312 || 319 <= D && D <= 322 || D == 324 || 328 <= D && D <= 331 || D == 333 || 338 <= D && D <= 339 || 358 <= D && D <= 359 || D == 363 || D == 462 || D == 464 || D == 466 || D == 468 || D == 470 || D == 472 || D == 474 || D == 476 || D == 593 || D == 609 || D == 708 || D == 711 || 713 <= D && D <= 715 || D == 717 || D == 720 || 728 <= D && D <= 731 || D == 733 || D == 735 || 768 <= D && D <= 879 || 913 <= D && D <= 929 || 931 <= D && D <= 937 || 945 <= D && D <= 961 || 963 <= D && D <= 969 || D == 1025 || 1040 <= D && D <= 1103 || D == 1105 || D == 8208 || 8211 <= D && D <= 8214 || 8216 <= D && D <= 8217 || 8220 <= D && D <= 8221 || 8224 <= D && D <= 8226 || 8228 <= D && D <= 8231 || D == 8240 || 8242 <= D && D <= 8243 || D == 8245 || D == 8251 || D == 8254 || D == 8308 || D == 8319 || 8321 <= D && D <= 8324 || D == 8364 || D == 8451 || D == 8453 || D == 8457 || D == 8467 || D == 8470 || 8481 <= D && D <= 8482 || D == 8486 || D == 8491 || 8531 <= D && D <= 8532 || 8539 <= D && D <= 8542 || 8544 <= D && D <= 8555 || 8560 <= D && D <= 8569 || D == 8585 || 8592 <= D && D <= 8601 || 8632 <= D && D <= 8633 || D == 8658 || D == 8660 || D == 8679 || D == 8704 || 8706 <= D && D <= 8707 || 8711 <= D && D <= 8712 || D == 8715 || D == 8719 || D == 8721 || D == 8725 || D == 8730 || 8733 <= D && D <= 8736 || D == 8739 || D == 8741 || 8743 <= D && D <= 8748 || D == 8750 || 8756 <= D && D <= 8759 || 8764 <= D && D <= 8765 || D == 8776 || D == 8780 || D == 8786 || 8800 <= D && D <= 8801 || 8804 <= D && D <= 8807 || 8810 <= D && D <= 8811 || 8814 <= D && D <= 8815 || 8834 <= D && D <= 8835 || 8838 <= D && D <= 8839 || D == 8853 || D == 8857 || D == 8869 || D == 8895 || D == 8978 || 9312 <= D && D <= 9449 || 9451 <= D && D <= 9547 || 9552 <= D && D <= 9587 || 9600 <= D && D <= 9615 || 9618 <= D && D <= 9621 || 9632 <= D && D <= 9633 || 9635 <= D && D <= 9641 || 9650 <= D && D <= 9651 || 9654 <= D && D <= 9655 || 9660 <= D && D <= 9661 || 9664 <= D && D <= 9665 || 9670 <= D && D <= 9672 || D == 9675 || 9678 <= D && D <= 9681 || 9698 <= D && D <= 9701 || D == 9711 || 9733 <= D && D <= 9734 || D == 9737 || 9742 <= D && D <= 9743 || 9748 <= D && D <= 9749 || D == 9756 || D == 9758 || D == 9792 || D == 9794 || 9824 <= D && D <= 9825 || 9827 <= D && D <= 9829 || 9831 <= D && D <= 9834 || 9836 <= D && D <= 9837 || D == 9839 || 9886 <= D && D <= 9887 || 9918 <= D && D <= 9919 || 9924 <= D && D <= 9933 || 9935 <= D && D <= 9953 || D == 9955 || 9960 <= D && D <= 9983 || D == 10045 || D == 10071 || 10102 <= D && D <= 10111 || 11093 <= D && D <= 11097 || 12872 <= D && D <= 12879 || 57344 <= D && D <= 63743 || 65024 <= D && D <= 65039 || D == 65533 || 127232 <= D && D <= 127242 || 127248 <= D && D <= 127277 || 127280 <= D && D <= 127337 || 127344 <= D && D <= 127386 || 917760 <= D && D <= 917999 || 983040 <= D && D <= 1048573 || 1048576 <= D && D <= 1114109 ? "A" : "N";
1317
- }, u.characterLength = function(e2) {
1318
- var s = this.eastAsianWidth(e2);
1319
- return s == "F" || s == "W" || s == "A" ? 2 : 1;
1320
- };
1321
- function F(e2) {
1322
- return e2.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
1323
- }
1324
- u.length = function(e2) {
1325
- for (var s = F(e2), i = 0, D = 0;D < s.length; D++)
1326
- i = i + this.characterLength(s[D]);
1327
- return i;
1328
- }, u.slice = function(e2, s, i) {
1329
- textLen = u.length(e2), s = s || 0, i = i || 1, s < 0 && (s = textLen + s), i < 0 && (i = textLen + i);
1330
- for (var D = "", C = 0, o = F(e2), E = 0;E < o.length; E++) {
1331
- var a = o[E], n = u.length(a);
1332
- if (C >= s - (n == 2 ? 1 : 0))
1333
- if (C + n <= i)
1334
- D += a;
1335
- else
1336
- break;
1337
- C += n;
1338
- }
1339
- return D;
1340
- };
1341
- })(P$1);
1342
- X = P$1.exports;
1343
- DD = O(X);
1344
- FD = O(uD);
1345
- 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] } };
1346
- Object.keys(r.modifier);
1347
- tD = Object.keys(r.color);
1348
- eD = Object.keys(r.bgColor);
1349
- [...tD];
1350
- iD = sD();
1351
- v = new Set(["\x1B", "\x9B"]);
1352
- y = `${rD}8;;`;
1353
- aD = ["up", "down", "left", "right", "space", "enter", "cancel"];
1354
- c = { actions: new Set(aD), aliases: new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["\x03", "cancel"], ["escape", "cancel"]]) };
1355
- globalThis.process.platform.startsWith("win");
1356
- S = Symbol("clack:cancel");
1357
- AD = Object.defineProperty;
1358
- fD = class fD extends x {
1359
- get cursor() {
1360
- return this.value ? 0 : 1;
1361
- }
1362
- get _value() {
1363
- return this.cursor === 0;
1364
- }
1365
- constructor(u) {
1366
- super(u, false), this.value = !!u.initialValue, this.on("value", () => {
1367
- this.value = this._value;
1368
- }), this.on("confirm", (F) => {
1369
- this.output.write(srcExports.cursor.move(0, -1)), this.value = F, this.state = "submit", this.close();
1370
- }), this.on("cursor", () => {
1371
- this.value = !this.value;
1372
- });
1373
- }
1374
- };
1375
- bD = Object.defineProperty;
1376
- wD = class extends x {
1377
- constructor(u) {
1378
- super(u, false), Y(this, "options"), Y(this, "cursor", 0), this.options = u.options, this.value = [...u.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: F }) => F === u.cursorAt), 0), this.on("key", (F) => {
1379
- F === "a" && this.toggleAll();
1380
- }), this.on("cursor", (F) => {
1381
- switch (F) {
1382
- case "left":
1383
- case "up":
1384
- this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
1385
- break;
1386
- case "down":
1387
- case "right":
1388
- this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
1389
- break;
1390
- case "space":
1391
- this.toggleValue();
1392
- break;
1393
- }
1394
- });
1395
- }
1396
- get _value() {
1397
- return this.options[this.cursor].value;
1398
- }
1399
- toggleAll() {
1400
- const u = this.value.length === this.options.length;
1401
- this.value = u ? [] : this.options.map((F) => F.value);
1402
- }
1403
- toggleValue() {
1404
- const u = this.value.includes(this._value);
1405
- this.value = u ? this.value.filter((F) => F !== this._value) : [...this.value, this._value];
1406
- }
1407
- };
1408
- SD = Object.defineProperty;
1409
- jD = class jD extends x {
1410
- constructor(u) {
1411
- super(u, false), q(this, "options"), q(this, "cursor", 0), this.options = u.options, this.cursor = this.options.findIndex(({ value: F }) => F === u.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (F) => {
1412
- switch (F) {
1413
- case "left":
1414
- case "up":
1415
- this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
1416
- break;
1417
- case "down":
1418
- case "right":
1419
- this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
1420
- break;
1421
- }
1422
- this.changeValue();
1423
- });
1424
- }
1425
- get _value() {
1426
- return this.options[this.cursor];
1427
- }
1428
- changeValue() {
1429
- this.value = this._value.value;
1430
- }
1431
- };
1432
- PD = class PD extends x {
1433
- get valueWithCursor() {
1434
- if (this.state === "submit")
1435
- return this.value;
1436
- if (this.cursor >= this.value.length)
1437
- return `${this.value}\u2588`;
1438
- const u = this.value.slice(0, this.cursor), [F, ...e$1] = this.value.slice(this.cursor);
1439
- return `${u}${e.inverse(F)}${e$1.join("")}`;
1440
- }
1441
- get cursor() {
1442
- return this._cursor;
1443
- }
1444
- constructor(u) {
1445
- super(u), this.on("finalize", () => {
1446
- this.value || (this.value = u.defaultValue);
1447
- });
1448
- }
1449
- };
1450
- V = ce();
1451
- le = u("\u276F", ">");
1452
- L = u("\u25A0", "x");
1453
- W = u("\u25B2", "x");
1454
- C = u("\u2714", "\u221A");
1455
- o = u("");
1456
- d = u("");
1457
- k = u("\u25CF", ">");
1458
- P = u("\u25CB", " ");
1459
- A = u("\u25FB", "[\u2022]");
1460
- T = u("\u25FC", "[+]");
1461
- F = u("\u25FB", "[ ]");
1462
- `${e.gray(o)} `;
1463
- kCancel = Symbol.for("cancel");
1464
- });
1465
-
1466
- // ../../node_modules/consola/dist/index.mjs
1467
- import g$1 from "process";
1468
- function b() {
1469
- if (globalThis.process?.env)
1470
- for (const e2 of f2) {
1471
- const s = e2[1] || e2[0];
1472
- if (globalThis.process?.env[s])
1473
- return { name: e2[0].toLowerCase(), ...e2[2] };
1474
- }
1475
- return globalThis.process?.env?.SHELL === "/bin/jsh" && globalThis.process?.versions?.webcontainer ? { name: "stackblitz", ci: false } : { name: "", ci: false };
1476
- }
1477
- function n(e2) {
1478
- return e2 ? e2 !== "false" : false;
1479
- }
1480
- function G2() {
1481
- const e2 = F2.find((s) => s[0]);
1482
- if (e2)
1483
- return { name: e2[1] };
1484
- }
1485
- function ansiRegex2({ onlyFirst = false } = {}) {
1486
- const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
1487
- const pattern = [
1488
- `[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?${ST})`,
1489
- "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"
1490
- ].join("|");
1491
- return new RegExp(pattern, onlyFirst ? undefined : "g");
1492
- }
1493
- function stripAnsi2(string) {
1494
- if (typeof string !== "string") {
1495
- throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
1496
- }
1497
- return string.replace(regex, "");
1498
- }
1499
- function isAmbiguous(x2) {
1500
- 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;
1501
- }
1502
- function isFullWidth(x2) {
1503
- return x2 === 12288 || x2 >= 65281 && x2 <= 65376 || x2 >= 65504 && x2 <= 65510;
1504
- }
1505
- function isWide(x2) {
1506
- 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;
1507
- }
1508
- function validate(codePoint) {
1509
- if (!Number.isSafeInteger(codePoint)) {
1510
- throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
1511
- }
1512
- }
1513
- function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
1514
- validate(codePoint);
1515
- if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) {
1516
- return 2;
1517
- }
1518
- return 1;
1519
- }
1520
- function stringWidth$1(string, options = {}) {
1521
- if (typeof string !== "string" || string.length === 0) {
1522
- return 0;
1523
- }
1524
- const {
1525
- ambiguousIsNarrow = true,
1526
- countAnsiEscapeCodes = false
1527
- } = options;
1528
- if (!countAnsiEscapeCodes) {
1529
- string = stripAnsi2(string);
1530
- }
1531
- if (string.length === 0) {
1532
- return 0;
1533
- }
1534
- let width = 0;
1535
- const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
1536
- for (const { segment: character } of segmenter.segment(string)) {
1537
- const codePoint = character.codePointAt(0);
1538
- if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
1539
- continue;
1540
- }
1541
- if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) {
1542
- continue;
1543
- }
1544
- if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) {
1545
- continue;
1546
- }
1547
- if (codePoint >= 55296 && codePoint <= 57343) {
1548
- continue;
1549
- }
1550
- if (codePoint >= 65024 && codePoint <= 65039) {
1551
- continue;
1552
- }
1553
- if (defaultIgnorableCodePointRegex.test(character)) {
1554
- continue;
1555
- }
1556
- if (emojiRegex().test(character)) {
1557
- width += 2;
1558
- continue;
1559
- }
1560
- width += eastAsianWidth(codePoint, eastAsianWidthOptions);
1561
- }
1562
- return width;
1563
- }
1564
- function isUnicodeSupported() {
1565
- const { env: env2 } = g$1;
1566
- const { TERM, TERM_PROGRAM } = env2;
1567
- if (g$1.platform !== "win32") {
1568
- return TERM !== "linux";
1569
- }
1570
- 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";
1571
- }
1572
- function stringWidth(str) {
1573
- const hasICU = typeof Intl === "object";
1574
- if (!hasICU || !Intl.Segmenter) {
1575
- return stripAnsi(str).length;
1576
- }
1577
- return stringWidth$1(str);
1578
- }
1579
- function characterFormat(str) {
1580
- return str.replace(/`([^`]+)`/gm, (_3, m2) => colors.cyan(m2)).replace(/\s+_([^_]+)_\s+/gm, (_3, m2) => ` ${colors.underline(m2)} `);
1581
- }
1582
- function getColor2(color = "white") {
1583
- return colors[color] || colors.white;
1584
- }
1585
- function getBgColor(color = "bgWhite") {
1586
- return colors[`bg${color[0].toUpperCase()}${color.slice(1)}`] || colors.bgWhite;
1587
- }
1588
- function createConsola2(options = {}) {
1589
- let level = _getDefaultLogLevel();
1590
- if (process.env.CONSOLA_LEVEL) {
1591
- level = Number.parseInt(process.env.CONSOLA_LEVEL) ?? level;
1592
- }
1593
- const consola2 = createConsola({
1594
- level,
1595
- defaults: { level },
1596
- stdout: process.stdout,
1597
- stderr: process.stderr,
1598
- prompt: (...args) => Promise.resolve().then(() => (init_prompt(), exports_prompt)).then((m2) => m2.prompt(...args)),
1599
- reporters: options.reporters || [
1600
- options.fancy ?? !(T2 || R2) ? new FancyReporter : new BasicReporter
1601
- ],
1602
- ...options
1603
- });
1604
- return consola2;
1605
- }
1606
- function _getDefaultLogLevel() {
1607
- if (g2) {
1608
- return LogLevels.debug;
1609
- }
1610
- if (R2) {
1611
- return LogLevels.warn;
1612
- }
1613
- return LogLevels.info;
1614
- }
1615
- var r2, i = (e2) => globalThis.process?.env || import.meta.env || globalThis.Deno?.env.toObject() || globalThis.__env__ || (e2 ? r2 : globalThis), o2, t, f2, l, I2, T2, a, g2, R2, A2, C2, y2, _2, c2, O2, D, L2, S2, u2, N2, F2, P2, regex, emojiRegex = () => {
1616
- 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;
1617
- }, segmenter, defaultIgnorableCodePointRegex, TYPE_COLOR_MAP, LEVEL_COLOR_MAP, unicode, s = (c3, fallback) => unicode ? c3 : fallback, TYPE_ICONS, FancyReporter, consola;
1618
- var init_dist = __esm(() => {
1619
- init_core();
1620
- init_core();
1621
- init_consola_DRwqZj3T();
1622
- init_consola_DXBYu_KD();
1623
- r2 = Object.create(null);
1624
- o2 = new Proxy(r2, { get(e2, s) {
1625
- return i()[s] ?? r2[s];
1626
- }, has(e2, s) {
1627
- const E = i();
1628
- return s in E || s in r2;
1629
- }, set(e2, s, E) {
1630
- const B2 = i(true);
1631
- return B2[s] = E, true;
1632
- }, deleteProperty(e2, s) {
1633
- if (!s)
1634
- return false;
1635
- const E = i(true);
1636
- return delete E[s], true;
1637
- }, ownKeys() {
1638
- const e2 = i(true);
1639
- return Object.keys(e2);
1640
- } });
1641
- t = typeof process < "u" && process.env && "development" || "";
1642
- 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 }]];
1643
- l = b();
1644
- l.name;
1645
- I2 = globalThis.process?.platform || "";
1646
- T2 = n(o2.CI) || l.ci !== false;
1647
- a = n(globalThis.process?.stdout && globalThis.process?.stdout.isTTY);
1648
- g2 = n(o2.DEBUG);
1649
- R2 = t === "test" || n(o2.TEST);
1650
- n(o2.MINIMAL);
1651
- A2 = /^win/i.test(I2);
1652
- !n(o2.NO_COLOR) && (n(o2.FORCE_COLOR) || (a || A2) && o2.TERM);
1653
- C2 = (globalThis.process?.versions?.node || "").replace(/^v/, "") || null;
1654
- Number(C2?.split(".")[0]);
1655
- y2 = globalThis.process || Object.create(null);
1656
- _2 = { versions: {} };
1657
- new Proxy(y2, { get(e2, s) {
1658
- if (s === "env")
1659
- return o2;
1660
- if (s in e2)
1661
- return e2[s];
1662
- if (s in _2)
1663
- return _2[s];
1664
- } });
1665
- c2 = globalThis.process?.release?.name === "node";
1666
- O2 = !!globalThis.Bun || !!globalThis.process?.versions?.bun;
1667
- D = !!globalThis.Deno;
1668
- L2 = !!globalThis.fastly;
1669
- S2 = !!globalThis.Netlify;
1670
- u2 = !!globalThis.EdgeRuntime;
1671
- N2 = globalThis.navigator?.userAgent === "Cloudflare-Workers";
1672
- F2 = [[S2, "netlify"], [u2, "edge-light"], [N2, "workerd"], [L2, "fastly"], [D, "deno"], [O2, "bun"], [c2, "node"]];
1673
- P2 = G2();
1674
- P2?.name;
1675
- regex = ansiRegex2();
1676
- segmenter = globalThis.Intl?.Segmenter ? new Intl.Segmenter : { segment: (str) => str.split("") };
1677
- defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
1678
- TYPE_COLOR_MAP = {
1679
- info: "cyan",
1680
- fail: "red",
1681
- success: "green",
1682
- ready: "green",
1683
- start: "magenta"
1684
- };
1685
- LEVEL_COLOR_MAP = {
1686
- 0: "red",
1687
- 1: "yellow"
1688
- };
1689
- unicode = isUnicodeSupported();
1690
- TYPE_ICONS = {
1691
- error: s("\u2716", "\xD7"),
1692
- fatal: s("\u2716", "\xD7"),
1693
- ready: s("\u2714", "\u221A"),
1694
- warn: s("\u26A0", "\u203C"),
1695
- info: s("\u2139", "i"),
1696
- success: s("\u2714", "\u221A"),
1697
- debug: s("\u2699", "D"),
1698
- trace: s("\u2192", "\u2192"),
1699
- fail: s("\u2716", "\xD7"),
1700
- start: s("\u25D0", "o"),
1701
- log: ""
1702
- };
1703
- FancyReporter = class FancyReporter extends BasicReporter {
1704
- formatStack(stack, message, opts) {
1705
- const indent = " ".repeat((opts?.errorLevel || 0) + 1);
1706
- return `
1707
- ${indent}` + parseStack(stack, message).map((line) => " " + line.replace(/^at +/, (m2) => colors.gray(m2)).replace(/\((.+)\)/, (_3, m2) => `(${colors.cyan(m2)})`)).join(`
1708
- ${indent}`);
1709
- }
1710
- formatType(logObj, isBadge, opts) {
1711
- const typeColor = TYPE_COLOR_MAP[logObj.type] || LEVEL_COLOR_MAP[logObj.level] || "gray";
1712
- if (isBadge) {
1713
- return getBgColor(typeColor)(colors.black(` ${logObj.type.toUpperCase()} `));
1714
- }
1715
- const _type = typeof TYPE_ICONS[logObj.type] === "string" ? TYPE_ICONS[logObj.type] : logObj.icon || logObj.type;
1716
- return _type ? getColor2(typeColor)(_type) : "";
1717
- }
1718
- formatLogObj(logObj, opts) {
1719
- const [message, ...additional] = this.formatArgs(logObj.args, opts).split(`
1720
- `);
1721
- if (logObj.type === "box") {
1722
- return box(characterFormat(message + (additional.length > 0 ? `
1723
- ` + additional.join(`
1724
- `) : "")), {
1725
- title: logObj.title ? characterFormat(logObj.title) : undefined,
1726
- style: logObj.style
1727
- });
1728
- }
1729
- const date = this.formatDate(logObj.date, opts);
1730
- const coloredDate = date && colors.gray(date);
1731
- const isBadge = logObj.badge ?? logObj.level < 2;
1732
- const type = this.formatType(logObj, isBadge, opts);
1733
- const tag = logObj.tag ? colors.gray(logObj.tag) : "";
1734
- let line;
1735
- const left = this.filterAndJoin([type, characterFormat(message)]);
1736
- const right = this.filterAndJoin(opts.columns ? [tag, coloredDate] : [tag]);
1737
- const space = (opts.columns || 0) - stringWidth(left) - stringWidth(right) - 2;
1738
- line = space > 0 && (opts.columns || 0) >= 80 ? left + " ".repeat(space) + right : (right ? `${colors.gray(`[${right}]`)} ` : "") + left;
1739
- line += characterFormat(additional.length > 0 ? `
1740
- ` + additional.join(`
1741
- `) : "");
1742
- if (logObj.type === "trace") {
1743
- const _err = new Error("Trace: " + logObj.message);
1744
- line += this.formatStack(_err.stack || "", _err.message);
1745
- }
1746
- return isBadge ? `
1747
- ` + line + `
1748
- ` : line;
1749
- }
1750
- };
1751
- consola = createConsola2();
1752
- });
1753
-
1754
- // ../../node_modules/consola/dist/utils.mjs
1755
- var init_utils = __esm(() => {
1756
- init_consola_DXBYu_KD();
1757
- init_consola_DXBYu_KD();
1758
- });
1759
-
1760
- // ../../node_modules/citty/dist/index.mjs
1761
- function toArray(val) {
1762
- if (Array.isArray(val)) {
1763
- return val;
1764
- }
1765
- return val === undefined ? [] : [val];
1766
- }
1767
- function formatLineColumns(lines, linePrefix = "") {
1768
- const maxLengh = [];
1769
- for (const line of lines) {
1770
- for (const [i2, element] of line.entries()) {
1771
- maxLengh[i2] = Math.max(maxLengh[i2] || 0, element.length);
1772
- }
1773
- }
1774
- return lines.map((l2) => l2.map((c3, i2) => linePrefix + c3[i2 === 0 ? "padStart" : "padEnd"](maxLengh[i2])).join(" ")).join(`
1775
- `);
1776
- }
1777
- function resolveValue(input) {
1778
- return typeof input === "function" ? input() : input;
1779
- }
1780
- function isUppercase(char = "") {
1781
- if (NUMBER_CHAR_RE.test(char)) {
1782
- return;
1783
- }
1784
- return char !== char.toLowerCase();
1785
- }
1786
- function splitByCase(str, separators) {
1787
- const splitters = separators ?? STR_SPLITTERS;
1788
- const parts = [];
1789
- if (!str || typeof str !== "string") {
1790
- return parts;
1791
- }
1792
- let buff = "";
1793
- let previousUpper;
1794
- let previousSplitter;
1795
- for (const char of str) {
1796
- const isSplitter = splitters.includes(char);
1797
- if (isSplitter === true) {
1798
- parts.push(buff);
1799
- buff = "";
1800
- previousUpper = undefined;
1801
- continue;
1802
- }
1803
- const isUpper = isUppercase(char);
1804
- if (previousSplitter === false) {
1805
- if (previousUpper === false && isUpper === true) {
1806
- parts.push(buff);
1807
- buff = char;
1808
- previousUpper = isUpper;
1809
- continue;
1810
- }
1811
- if (previousUpper === true && isUpper === false && buff.length > 1) {
1812
- const lastChar = buff.at(-1);
1813
- parts.push(buff.slice(0, Math.max(0, buff.length - 1)));
1814
- buff = lastChar + char;
1815
- previousUpper = isUpper;
1816
- continue;
1817
- }
1818
- }
1819
- buff += char;
1820
- previousUpper = isUpper;
1821
- previousSplitter = isSplitter;
1822
- }
1823
- parts.push(buff);
1824
- return parts;
1825
- }
1826
- function upperFirst(str) {
1827
- return str ? str[0].toUpperCase() + str.slice(1) : "";
1828
- }
1829
- function lowerFirst(str) {
1830
- return str ? str[0].toLowerCase() + str.slice(1) : "";
1831
- }
1832
- function pascalCase(str, opts) {
1833
- return str ? (Array.isArray(str) ? str : splitByCase(str)).map((p) => upperFirst(opts?.normalize ? p.toLowerCase() : p)).join("") : "";
1834
- }
1835
- function camelCase(str, opts) {
1836
- return lowerFirst(pascalCase(str || "", opts));
1837
- }
1838
- function kebabCase(str, joiner) {
1839
- return str ? (Array.isArray(str) ? str : splitByCase(str)).map((p) => p.toLowerCase()).join(joiner ?? "-") : "";
1840
- }
1841
- function toArr(any) {
1842
- return any == undefined ? [] : Array.isArray(any) ? any : [any];
1843
- }
1844
- function toVal(out, key, val, opts) {
1845
- let x2;
1846
- const old = out[key];
1847
- const nxt = ~opts.string.indexOf(key) ? val == undefined || 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;
1848
- out[key] = old == undefined ? nxt : Array.isArray(old) ? old.concat(nxt) : [old, nxt];
1849
- }
1850
- function parseRawArgs(args = [], opts = {}) {
1851
- let k2;
1852
- let arr;
1853
- let arg;
1854
- let name;
1855
- let val;
1856
- const out = { _: [] };
1857
- let i2 = 0;
1858
- let j = 0;
1859
- let idx = 0;
1860
- const len = args.length;
1861
- const alibi = opts.alias !== undefined;
1862
- const strict = opts.unknown !== undefined;
1863
- const defaults = opts.default !== undefined;
1864
- opts.alias = opts.alias || {};
1865
- opts.string = toArr(opts.string);
1866
- opts.boolean = toArr(opts.boolean);
1867
- if (alibi) {
1868
- for (k2 in opts.alias) {
1869
- arr = opts.alias[k2] = toArr(opts.alias[k2]);
1870
- for (i2 = 0;i2 < arr.length; i2++) {
1871
- (opts.alias[arr[i2]] = arr.concat(k2)).splice(i2, 1);
1872
- }
1873
- }
1874
- }
1875
- for (i2 = opts.boolean.length;i2-- > 0; ) {
1876
- arr = opts.alias[opts.boolean[i2]] || [];
1877
- for (j = arr.length;j-- > 0; ) {
1878
- opts.boolean.push(arr[j]);
1879
- }
1880
- }
1881
- for (i2 = opts.string.length;i2-- > 0; ) {
1882
- arr = opts.alias[opts.string[i2]] || [];
1883
- for (j = arr.length;j-- > 0; ) {
1884
- opts.string.push(arr[j]);
1885
- }
1886
- }
1887
- if (defaults) {
1888
- for (k2 in opts.default) {
1889
- name = typeof opts.default[k2];
1890
- arr = opts.alias[k2] = opts.alias[k2] || [];
1891
- if (opts[name] !== undefined) {
1892
- opts[name].push(k2);
1893
- for (i2 = 0;i2 < arr.length; i2++) {
1894
- opts[name].push(arr[i2]);
1895
- }
1896
- }
1897
- }
1898
- }
1899
- const keys = strict ? Object.keys(opts.alias) : [];
1900
- for (i2 = 0;i2 < len; i2++) {
1901
- arg = args[i2];
1902
- if (arg === "--") {
1903
- out._ = out._.concat(args.slice(++i2));
1904
- break;
1905
- }
1906
- for (j = 0;j < arg.length; j++) {
1907
- if (arg.charCodeAt(j) !== 45) {
1908
- break;
1909
- }
1910
- }
1911
- if (j === 0) {
1912
- out._.push(arg);
1913
- } else if (arg.substring(j, j + 3) === "no-") {
1914
- name = arg.slice(Math.max(0, j + 3));
1915
- if (strict && !~keys.indexOf(name)) {
1916
- return opts.unknown(arg);
1917
- }
1918
- out[name] = false;
1919
- } else {
1920
- for (idx = j + 1;idx < arg.length; idx++) {
1921
- if (arg.charCodeAt(idx) === 61) {
1922
- break;
1923
- }
1924
- }
1925
- name = arg.substring(j, idx);
1926
- val = arg.slice(Math.max(0, ++idx)) || i2 + 1 === len || ("" + args[i2 + 1]).charCodeAt(0) === 45 || args[++i2];
1927
- arr = j === 2 ? [name] : name;
1928
- for (idx = 0;idx < arr.length; idx++) {
1929
- name = arr[idx];
1930
- if (strict && !~keys.indexOf(name)) {
1931
- return opts.unknown("-".repeat(j) + name);
1932
- }
1933
- toVal(out, name, idx + 1 < arr.length || val, opts);
1934
- }
1935
- }
1936
- }
1937
- if (defaults) {
1938
- for (k2 in opts.default) {
1939
- if (out[k2] === undefined) {
1940
- out[k2] = opts.default[k2];
1941
- }
1942
- }
1943
- }
1944
- if (alibi) {
1945
- for (k2 in out) {
1946
- arr = opts.alias[k2] || [];
1947
- while (arr.length > 0) {
1948
- out[arr.shift()] = out[k2];
1949
- }
1950
- }
1951
- }
1952
- return out;
1953
- }
1954
- function parseArgs(rawArgs, argsDef) {
1955
- const parseOptions = {
1956
- boolean: [],
1957
- string: [],
1958
- mixed: [],
1959
- alias: {},
1960
- default: {}
1961
- };
1962
- const args = resolveArgs(argsDef);
1963
- for (const arg of args) {
1964
- if (arg.type === "positional") {
1965
- continue;
1966
- }
1967
- if (arg.type === "string") {
1968
- parseOptions.string.push(arg.name);
1969
- } else if (arg.type === "boolean") {
1970
- parseOptions.boolean.push(arg.name);
1971
- }
1972
- if (arg.default !== undefined) {
1973
- parseOptions.default[arg.name] = arg.default;
1974
- }
1975
- if (arg.alias) {
1976
- parseOptions.alias[arg.name] = arg.alias;
1977
- }
1978
- }
1979
- const parsed = parseRawArgs(rawArgs, parseOptions);
1980
- const [...positionalArguments] = parsed._;
1981
- const parsedArgsProxy = new Proxy(parsed, {
1982
- get(target, prop) {
1983
- return target[prop] ?? target[camelCase(prop)] ?? target[kebabCase(prop)];
1984
- }
1985
- });
1986
- for (const [, arg] of args.entries()) {
1987
- if (arg.type === "positional") {
1988
- const nextPositionalArgument = positionalArguments.shift();
1989
- if (nextPositionalArgument !== undefined) {
1990
- parsedArgsProxy[arg.name] = nextPositionalArgument;
1991
- } else if (arg.default === undefined && arg.required !== false) {
1992
- throw new CLIError(`Missing required positional argument: ${arg.name.toUpperCase()}`, "EARG");
1993
- } else {
1994
- parsedArgsProxy[arg.name] = arg.default;
1995
- }
1996
- } else if (arg.required && parsedArgsProxy[arg.name] === undefined) {
1997
- throw new CLIError(`Missing required argument: --${arg.name}`, "EARG");
1998
- }
1999
- }
2000
- return parsedArgsProxy;
2001
- }
2002
- function resolveArgs(argsDef) {
2003
- const args = [];
2004
- for (const [name, argDef] of Object.entries(argsDef || {})) {
2005
- args.push({
2006
- ...argDef,
2007
- name,
2008
- alias: toArray(argDef.alias)
2009
- });
2010
- }
2011
- return args;
2012
- }
2013
- function defineCommand(def) {
2014
- return def;
2015
- }
2016
- async function runCommand(cmd, opts) {
2017
- const cmdArgs = await resolveValue(cmd.args || {});
2018
- const parsedArgs = parseArgs(opts.rawArgs, cmdArgs);
2019
- const context = {
2020
- rawArgs: opts.rawArgs,
2021
- args: parsedArgs,
2022
- data: opts.data,
2023
- cmd
2024
- };
2025
- if (typeof cmd.setup === "function") {
2026
- await cmd.setup(context);
2027
- }
2028
- let result;
2029
- try {
2030
- const subCommands = await resolveValue(cmd.subCommands);
2031
- if (subCommands && Object.keys(subCommands).length > 0) {
2032
- const subCommandArgIndex = opts.rawArgs.findIndex((arg) => !arg.startsWith("-"));
2033
- const subCommandName = opts.rawArgs[subCommandArgIndex];
2034
- if (subCommandName) {
2035
- if (!subCommands[subCommandName]) {
2036
- throw new CLIError(`Unknown command \`${subCommandName}\``, "E_UNKNOWN_COMMAND");
2037
- }
2038
- const subCommand = await resolveValue(subCommands[subCommandName]);
2039
- if (subCommand) {
2040
- await runCommand(subCommand, {
2041
- rawArgs: opts.rawArgs.slice(subCommandArgIndex + 1)
2042
- });
2043
- }
2044
- } else if (!cmd.run) {
2045
- throw new CLIError(`No command specified.`, "E_NO_COMMAND");
2046
- }
2047
- }
2048
- if (typeof cmd.run === "function") {
2049
- result = await cmd.run(context);
2050
- }
2051
- } finally {
2052
- if (typeof cmd.cleanup === "function") {
2053
- await cmd.cleanup(context);
2054
- }
2055
- }
2056
- return { result };
2057
- }
2058
- async function resolveSubCommand(cmd, rawArgs, parent) {
2059
- const subCommands = await resolveValue(cmd.subCommands);
2060
- if (subCommands && Object.keys(subCommands).length > 0) {
2061
- const subCommandArgIndex = rawArgs.findIndex((arg) => !arg.startsWith("-"));
2062
- const subCommandName = rawArgs[subCommandArgIndex];
2063
- const subCommand = await resolveValue(subCommands[subCommandName]);
2064
- if (subCommand) {
2065
- return resolveSubCommand(subCommand, rawArgs.slice(subCommandArgIndex + 1), cmd);
2066
- }
2067
- }
2068
- return [cmd, parent];
2069
- }
2070
- async function showUsage(cmd, parent) {
2071
- try {
2072
- consola.log(await renderUsage(cmd, parent) + `
2073
- `);
2074
- } catch (error) {
2075
- consola.error(error);
2076
- }
2077
- }
2078
- async function renderUsage(cmd, parent) {
2079
- const cmdMeta = await resolveValue(cmd.meta || {});
2080
- const cmdArgs = resolveArgs(await resolveValue(cmd.args || {}));
2081
- const parentMeta = await resolveValue(parent?.meta || {});
2082
- const commandName = `${parentMeta.name ? `${parentMeta.name} ` : ""}` + (cmdMeta.name || process.argv[1]);
2083
- const argLines = [];
2084
- const posLines = [];
2085
- const commandsLines = [];
2086
- const usageLine = [];
2087
- for (const arg of cmdArgs) {
2088
- if (arg.type === "positional") {
2089
- const name = arg.name.toUpperCase();
2090
- const isRequired = arg.required !== false && arg.default === undefined;
2091
- const defaultHint = arg.default ? `="${arg.default}"` : "";
2092
- posLines.push([
2093
- "`" + name + defaultHint + "`",
2094
- arg.description || "",
2095
- arg.valueHint ? `<${arg.valueHint}>` : ""
2096
- ]);
2097
- usageLine.push(isRequired ? `<${name}>` : `[${name}]`);
2098
- } else {
2099
- const isRequired = arg.required === true && arg.default === undefined;
2100
- const argStr = (arg.type === "boolean" && arg.default === true ? [
2101
- ...(arg.alias || []).map((a2) => `--no-${a2}`),
2102
- `--no-${arg.name}`
2103
- ].join(", ") : [...(arg.alias || []).map((a2) => `-${a2}`), `--${arg.name}`].join(", ")) + (arg.type === "string" && (arg.valueHint || arg.default) ? `=${arg.valueHint ? `<${arg.valueHint}>` : `"${arg.default || ""}"`}` : "");
2104
- argLines.push([
2105
- "`" + argStr + (isRequired ? " (required)" : "") + "`",
2106
- arg.description || ""
2107
- ]);
2108
- if (isRequired) {
2109
- usageLine.push(argStr);
2110
- }
2111
- }
2112
- }
2113
- if (cmd.subCommands) {
2114
- const commandNames = [];
2115
- const subCommands = await resolveValue(cmd.subCommands);
2116
- for (const [name, sub] of Object.entries(subCommands)) {
2117
- const subCmd = await resolveValue(sub);
2118
- const meta = await resolveValue(subCmd?.meta);
2119
- commandsLines.push([`\`${name}\``, meta?.description || ""]);
2120
- commandNames.push(name);
2121
- }
2122
- usageLine.push(commandNames.join("|"));
2123
- }
2124
- const usageLines = [];
2125
- const version = cmdMeta.version || parentMeta.version;
2126
- usageLines.push(colors.gray(`${cmdMeta.description} (${commandName + (version ? ` v${version}` : "")})`), "");
2127
- const hasOptions = argLines.length > 0 || posLines.length > 0;
2128
- usageLines.push(`${colors.underline(colors.bold("USAGE"))} \`${commandName}${hasOptions ? " [OPTIONS]" : ""} ${usageLine.join(" ")}\``, "");
2129
- if (posLines.length > 0) {
2130
- usageLines.push(colors.underline(colors.bold("ARGUMENTS")), "");
2131
- usageLines.push(formatLineColumns(posLines, " "));
2132
- usageLines.push("");
2133
- }
2134
- if (argLines.length > 0) {
2135
- usageLines.push(colors.underline(colors.bold("OPTIONS")), "");
2136
- usageLines.push(formatLineColumns(argLines, " "));
2137
- usageLines.push("");
2138
- }
2139
- if (commandsLines.length > 0) {
2140
- usageLines.push(colors.underline(colors.bold("COMMANDS")), "");
2141
- usageLines.push(formatLineColumns(commandsLines, " "));
2142
- usageLines.push("", `Use \`${commandName} <command> --help\` for more information about a command.`);
2143
- }
2144
- return usageLines.filter((l2) => typeof l2 === "string").join(`
2145
- `);
2146
- }
2147
- async function runMain(cmd, opts = {}) {
2148
- const rawArgs = opts.rawArgs || process.argv.slice(2);
2149
- const showUsage$1 = opts.showUsage || showUsage;
2150
- try {
2151
- if (rawArgs.includes("--help") || rawArgs.includes("-h")) {
2152
- await showUsage$1(...await resolveSubCommand(cmd, rawArgs));
2153
- process.exit(0);
2154
- } else if (rawArgs.length === 1 && rawArgs[0] === "--version") {
2155
- const meta = typeof cmd.meta === "function" ? await cmd.meta() : await cmd.meta;
2156
- if (!meta?.version) {
2157
- throw new CLIError("No version specified", "E_NO_VERSION");
2158
- }
2159
- consola.log(meta.version);
2160
- } else {
2161
- await runCommand(cmd, { rawArgs });
2162
- }
2163
- } catch (error) {
2164
- const isCLIError = error instanceof CLIError;
2165
- if (!isCLIError) {
2166
- consola.error(error, `
2167
- `);
2168
- }
2169
- if (isCLIError) {
2170
- await showUsage$1(...await resolveSubCommand(cmd, rawArgs));
2171
- }
2172
- consola.error(error.message);
2173
- process.exit(1);
2174
- }
2175
- }
2176
- var CLIError, NUMBER_CHAR_RE, STR_SPLITTERS;
2177
- var init_dist2 = __esm(() => {
2178
- init_dist();
2179
- init_utils();
2180
- CLIError = class CLIError extends Error {
2181
- constructor(message, code) {
2182
- super(message);
2183
- this.code = code;
2184
- this.name = "CLIError";
2185
- }
2186
- };
2187
- NUMBER_CHAR_RE = /\d/;
2188
- STR_SPLITTERS = ["-", "_", "/", "."];
2189
- });
2190
-
2191
- // src/commands/init.ts
2192
- var exports_init = {};
2193
- __export(exports_init, {
2194
- initCommand: () => initCommand
2195
- });
2196
- import { resolve } from "path";
19
+ //#endregion
20
+ //#region src/commands/init.ts
21
+ var init_exports = /* @__PURE__ */ __exportAll({ initCommand: () => initCommand });
2197
22
  function toJurisdictions(choice) {
2198
- if (choice === "gdpr")
2199
- return ["eu"];
2200
- if (choice === "ccpa")
2201
- return ["ca"];
2202
- if (choice === "both")
2203
- return ["eu", "ca"];
2204
- return ["us"];
23
+ if (choice === "gdpr") return ["eu"];
24
+ if (choice === "ccpa") return ["ca"];
25
+ if (choice === "both") return ["eu", "ca"];
26
+ return ["us"];
2205
27
  }
2206
28
  function toDataCollected(categories) {
2207
- const groups = {};
2208
- for (const cat of categories) {
2209
- const mapping = DATA_CATEGORY_MAP[cat];
2210
- if (!mapping)
2211
- continue;
2212
- groups[mapping.group] = [...groups[mapping.group] ?? [], mapping.label];
2213
- }
2214
- return Object.keys(groups).length > 0 ? groups : { "Personal Information": ["Email address"] };
29
+ const groups = {};
30
+ for (const cat of categories) {
31
+ const mapping = DATA_CATEGORY_MAP[cat];
32
+ if (!mapping) continue;
33
+ groups[mapping.group] = [...groups[mapping.group] ?? [], mapping.label];
34
+ }
35
+ return Object.keys(groups).length > 0 ? groups : { "Personal Information": ["Email address"] };
2215
36
  }
2216
37
  function toUserRights(jurisdictions) {
2217
- const rights = new Set(["access", "erasure"]);
2218
- if (jurisdictions.includes("eu")) {
2219
- for (const r3 of [
2220
- "rectification",
2221
- "portability",
2222
- "restriction",
2223
- "objection"
2224
- ])
2225
- rights.add(r3);
2226
- }
2227
- if (jurisdictions.includes("ca")) {
2228
- for (const r3 of ["opt_out_sale", "non_discrimination"])
2229
- rights.add(r3);
2230
- }
2231
- return Array.from(rights);
2232
- }
2233
- function renderConfig(values) {
2234
- const dataLines = Object.entries(values.dataCollected).map(([k2, v2]) => ` ${JSON.stringify(k2)}: ${JSON.stringify(v2)},`).join(`
2235
- `);
2236
- const today = new Date().toISOString().slice(0, 10);
2237
- return `import { definePrivacyPolicy } from "@openpolicy/sdk";
38
+ const rights = new Set(["access", "erasure"]);
39
+ if (jurisdictions.includes("eu")) for (const r of [
40
+ "rectification",
41
+ "portability",
42
+ "restriction",
43
+ "objection"
44
+ ]) rights.add(r);
45
+ if (jurisdictions.includes("ca")) for (const r of ["opt_out_sale", "non_discrimination"]) rights.add(r);
46
+ return Array.from(rights);
47
+ }
48
+ function renderPrivacyConfig(values) {
49
+ const dataLines = Object.entries(values.dataCollected).map(([k, v]) => ` ${JSON.stringify(k)}: ${JSON.stringify(v)},`).join("\n");
50
+ return `import { definePrivacyPolicy } from "@openpolicy/sdk";
2238
51
 
2239
52
  export default definePrivacyPolicy({
2240
- effectiveDate: "${today}",
53
+ effectiveDate: "${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}",
2241
54
  company: {
2242
55
  name: ${JSON.stringify(values.companyName)},
2243
56
  legalName: ${JSON.stringify(values.legalName)},
@@ -2262,537 +75,346 @@ ${dataLines}
2262
75
  });
2263
76
  `;
2264
77
  }
2265
- var DATA_CATEGORY_MAP, initCommand;
2266
- var init_init = __esm(() => {
2267
- init_dist2();
2268
- init_dist();
2269
- DATA_CATEGORY_MAP = {
2270
- name: { group: "Personal Information", label: "Full name" },
2271
- email: { group: "Personal Information", label: "Email address" },
2272
- ip_address: { group: "Technical Data", label: "IP address" },
2273
- device_info: { group: "Technical Data", label: "Device type and browser" },
2274
- location: { group: "Location Data", label: "Approximate location" },
2275
- payment_info: { group: "Financial Data", label: "Payment card details" },
2276
- usage_data: { group: "Usage Data", label: "Pages visited and features used" }
2277
- };
2278
- initCommand = defineCommand({
2279
- meta: {
2280
- name: "init",
2281
- description: "Interactively create a policy config file"
2282
- },
2283
- args: {
2284
- out: {
2285
- type: "string",
2286
- description: "Output path for generated config",
2287
- default: "./policy.config.ts"
2288
- },
2289
- yes: {
2290
- type: "boolean",
2291
- description: "Skip prompts and use defaults (CI mode)",
2292
- default: false
2293
- }
2294
- },
2295
- async run({ args }) {
2296
- consola.start("OpenPolicy init wizard");
2297
- const companyName = String(await consola.prompt("Company name?", { type: "text", cancel: "reject" }));
2298
- const legalName = String(await consola.prompt("Legal entity name?", {
2299
- type: "text",
2300
- cancel: "reject",
2301
- initial: companyName
2302
- }));
2303
- const address = String(await consola.prompt("Company address?", {
2304
- type: "text",
2305
- cancel: "reject"
2306
- }));
2307
- const contact = String(await consola.prompt("Privacy contact email?", {
2308
- type: "text",
2309
- cancel: "reject"
2310
- }));
2311
- const jurisdictionChoice = String(await consola.prompt("Jurisdiction?", {
2312
- type: "select",
2313
- cancel: "reject",
2314
- options: ["gdpr", "ccpa", "both"]
2315
- }));
2316
- const dataCategories = await consola.prompt("Data categories collected?", {
2317
- type: "multiselect",
2318
- cancel: "reject",
2319
- options: [
2320
- "name",
2321
- "email",
2322
- "ip_address",
2323
- "device_info",
2324
- "location",
2325
- "payment_info",
2326
- "usage_data"
2327
- ]
2328
- });
2329
- const hasCookies = Boolean(await consola.prompt("Does your app use cookies?", {
2330
- type: "confirm",
2331
- cancel: "reject",
2332
- initial: true
2333
- }));
2334
- const jurisdictions = toJurisdictions(jurisdictionChoice);
2335
- const dataCollected = toDataCollected(dataCategories);
2336
- const userRights = toUserRights(jurisdictions);
2337
- const legalBasis = jurisdictions.includes("eu") ? "Legitimate interests and consent" : "";
2338
- const source = renderConfig({
2339
- companyName,
2340
- legalName,
2341
- address,
2342
- contact,
2343
- jurisdictions,
2344
- dataCollected,
2345
- legalBasis,
2346
- hasCookies,
2347
- userRights
2348
- });
2349
- const outPath = resolve(args.out ?? "./policy.config.ts");
2350
- await Bun.write(outPath, source);
2351
- consola.success(`Config written to ${outPath}`);
2352
- }
2353
- });
2354
- });
2355
-
2356
- // ../core/src/renderers/markdown.ts
2357
- function renderMarkdown(sections) {
2358
- return sections.map((section) => `## ${section.title}
2359
-
2360
- ${section.body}`).join(`
2361
-
2362
- ---
2363
-
2364
- `);
2365
- }
2366
-
2367
- // ../core/src/templates/privacy/ccpa-supplement.ts
2368
- function buildCcpaSupplement(config) {
2369
- if (!config.jurisdictions.includes("ca"))
2370
- return null;
2371
- return {
2372
- id: "ccpa-supplement",
2373
- title: "California Privacy Rights (CCPA)",
2374
- body: `This section applies to California residents under the California Consumer Privacy Act (CCPA) and the California Privacy Rights Act (CPRA).
2375
-
2376
- **Categories of Personal Information Collected:** We collect the categories of personal information described in the "Information We Collect" section above.
2377
-
2378
- **Your California Rights:**
2379
- - **Right to Know:** You may request information about the personal information we have collected about you, including the categories of sources, the business purpose for collection, and the categories of third parties with whom we share information.
2380
- - **Right to Delete:** You may request deletion of personal information we have collected from you, subject to certain exceptions.
2381
- - **Right to Opt-Out:** You may opt out of the sale or sharing of your personal information.
2382
- - **Right to Non-Discrimination:** We will not discriminate against you for exercising your California privacy rights.
2383
-
2384
- To exercise your rights, contact us at ${config.company.contact}.`
2385
- };
2386
- }
2387
-
2388
- // ../core/src/templates/privacy/contact.ts
2389
- function buildContact(config) {
2390
- return {
2391
- id: "contact",
2392
- title: "Contact Us",
2393
- body: `If you have questions or concerns about this Privacy Policy or our data practices, please contact us:
2394
-
2395
- **${config.company.legalName}**
2396
- ${config.company.address}
2397
-
2398
- Email: ${config.company.contact}`
2399
- };
2400
- }
2401
-
2402
- // ../core/src/templates/privacy/cookies.ts
2403
- function buildCookies(config) {
2404
- const enabled = [];
2405
- if (config.cookies.essential)
2406
- enabled.push("**Essential cookies** \u2014 required for the service to function");
2407
- if (config.cookies.analytics)
2408
- enabled.push("**Analytics cookies** \u2014 help us understand how visitors interact with our service");
2409
- if (config.cookies.marketing)
2410
- enabled.push("**Marketing cookies** \u2014 used to deliver relevant advertisements");
2411
- const body = enabled.length > 0 ? `We use the following types of cookies and tracking technologies:
2412
-
2413
- ${enabled.map((e2) => `- ${e2}`).join(`
2414
- `)}` : "We do not use cookies or tracking technologies on our service.";
2415
- return {
2416
- id: "cookies",
2417
- title: "Cookies and Tracking",
2418
- body
2419
- };
2420
- }
2421
-
2422
- // ../core/src/templates/privacy/data-collected.ts
2423
- function buildDataCollected(config) {
2424
- const entries = Object.entries(config.dataCollected);
2425
- const lines = entries.map(([category, items]) => {
2426
- const itemList = items.map((item) => ` - ${item}`).join(`
2427
- `);
2428
- return `**${category}:**
2429
- ${itemList}`;
2430
- });
2431
- return {
2432
- id: "data-collected",
2433
- title: "Information We Collect",
2434
- body: `We collect the following categories of information:
2435
-
2436
- ${lines.join(`
2437
-
2438
- `)}`
2439
- };
2440
- }
2441
-
2442
- // ../core/src/templates/privacy/data-retention.ts
2443
- function buildDataRetention(config) {
2444
- const entries = Object.entries(config.retention);
2445
- const lines = entries.map(([category, period]) => `- **${category}:** ${period}`);
2446
- return {
2447
- id: "data-retention",
2448
- title: "Data Retention",
2449
- body: `We retain your information for the following periods:
2450
-
2451
- ${lines.join(`
2452
- `)}`
2453
- };
2454
- }
2455
-
2456
- // ../core/src/templates/privacy/gdpr-supplement.ts
2457
- function buildGdprSupplement(config) {
2458
- if (!config.jurisdictions.includes("eu"))
2459
- return null;
2460
- return {
2461
- id: "gdpr-supplement",
2462
- title: "GDPR Supplemental Disclosures",
2463
- body: `This section applies to individuals in the European Economic Area (EEA) under the General Data Protection Regulation (GDPR).
2464
-
2465
- **Data Controller:** ${config.company.legalName}, ${config.company.address}
2466
-
2467
- **Your GDPR Rights:** In addition to the rights listed above, you have the right to lodge a complaint with your local data protection authority if you believe we have not handled your data in accordance with applicable law.
2468
-
2469
- **International Transfers:** If we transfer your personal data outside the EEA, we ensure adequate safeguards are in place in accordance with GDPR requirements.`
2470
- };
2471
- }
2472
-
2473
- // ../core/src/templates/privacy/introduction.ts
2474
- function buildIntroduction(config) {
2475
- return {
2476
- id: "introduction",
2477
- title: "Introduction",
2478
- body: `This Privacy Policy describes how ${config.company.name} ("we", "us", or "our") collects, uses, and shares information about you when you use our services.
2479
-
2480
- **Effective Date:** ${config.effectiveDate}
2481
-
2482
- If you have questions about this policy, please contact us at ${config.company.contact}.`
2483
- };
2484
- }
78
+ function renderTermsConfig(values) {
79
+ return `import { defineTermsOfService } from "@openpolicy/sdk";
2485
80
 
2486
- // ../core/src/templates/privacy/legal-basis.ts
2487
- function buildLegalBasis(config) {
2488
- if (!config.jurisdictions.includes("eu"))
2489
- return null;
2490
- return {
2491
- id: "legal-basis",
2492
- title: "Legal Basis for Processing",
2493
- body: `We process your personal data under the following legal basis:
2494
-
2495
- ${config.legalBasis}`
2496
- };
2497
- }
2498
-
2499
- // ../core/src/templates/privacy/third-parties.ts
2500
- function buildThirdParties(config) {
2501
- const lines = config.thirdParties.map((tp) => `- **${tp.name}** \u2014 ${tp.purpose}`);
2502
- const body = lines.length > 0 ? `We share data with the following third-party services:
2503
-
2504
- ${lines.join(`
2505
- `)}` : "We do not share your data with third-party services.";
2506
- return {
2507
- id: "third-parties",
2508
- title: "Third-Party Services",
2509
- body
2510
- };
2511
- }
2512
-
2513
- // ../core/src/templates/privacy/user-rights.ts
2514
- function buildUserRights(config) {
2515
- const lines = config.userRights.map((right) => {
2516
- const label = RIGHTS_LABELS[right] ?? right;
2517
- return `- ${label}`;
2518
- });
2519
- return {
2520
- id: "user-rights",
2521
- title: "Your Rights",
2522
- body: `You have the following rights regarding your personal data:
2523
-
2524
- ${lines.join(`
2525
- `)}`
2526
- };
2527
- }
2528
- var RIGHTS_LABELS;
2529
- var init_user_rights = __esm(() => {
2530
- RIGHTS_LABELS = {
2531
- access: "Right to access your personal data",
2532
- rectification: "Right to correct inaccurate data",
2533
- erasure: "Right to request deletion of your data",
2534
- portability: "Right to receive your data in a portable format",
2535
- restriction: "Right to restrict how we process your data",
2536
- objection: "Right to object to processing",
2537
- opt_out_sale: "Right to opt out of the sale of your personal information",
2538
- non_discrimination: "Right to non-discriminatory treatment for exercising your rights"
2539
- };
2540
- });
2541
-
2542
- // ../core/src/privacy.ts
2543
- function compilePrivacyPolicy(config, options = { formats: ["markdown"] }) {
2544
- const sections = SECTION_BUILDERS.map((builder) => builder(config)).filter((s2) => s2 !== null);
2545
- return options.formats.map((format) => {
2546
- switch (format) {
2547
- case "markdown":
2548
- return { format, content: renderMarkdown(sections), sections };
2549
- case "pdf":
2550
- throw new Error("pdf format is not yet implemented");
2551
- case "jsx":
2552
- throw new Error("jsx format is not yet implemented");
2553
- default:
2554
- throw new Error(`Unsupported format: ${format}`);
2555
- }
2556
- });
2557
- }
2558
- var SECTION_BUILDERS;
2559
- var init_privacy = __esm(() => {
2560
- init_user_rights();
2561
- SECTION_BUILDERS = [
2562
- buildIntroduction,
2563
- buildDataCollected,
2564
- buildLegalBasis,
2565
- buildDataRetention,
2566
- buildCookies,
2567
- buildThirdParties,
2568
- buildUserRights,
2569
- buildGdprSupplement,
2570
- buildCcpaSupplement,
2571
- buildContact
2572
- ];
81
+ export default defineTermsOfService({
82
+ effectiveDate: "${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}",
83
+ company: {
84
+ name: ${JSON.stringify(values.companyName)},
85
+ legalName: ${JSON.stringify(values.legalName)},
86
+ address: ${JSON.stringify(values.address)},
87
+ contact: ${JSON.stringify(values.contact)},
88
+ },
89
+ acceptance: {
90
+ methods: ["using the service", "creating an account"],
91
+ },
92
+ eligibility: {
93
+ minimumAge: 13,
94
+ },
95
+ accounts: {
96
+ registrationRequired: false,
97
+ userResponsibleForCredentials: true,
98
+ companyCanTerminate: true,
99
+ },
100
+ prohibitedUses: [
101
+ "Violating any applicable laws or regulations",
102
+ "Infringing on intellectual property rights",
103
+ "Transmitting harmful or malicious content",
104
+ ],
105
+ intellectualProperty: {
106
+ companyOwnsService: true,
107
+ usersMayNotCopy: true,
108
+ },
109
+ termination: {
110
+ companyCanTerminate: true,
111
+ userCanTerminate: true,
112
+ },
113
+ disclaimers: {
114
+ serviceProvidedAsIs: true,
115
+ noWarranties: true,
116
+ },
117
+ limitationOfLiability: {
118
+ excludesIndirectDamages: true,
119
+ },
120
+ governingLaw: {
121
+ jurisdiction: ${JSON.stringify(values.jurisdiction)},
122
+ },
123
+ changesPolicy: {
124
+ noticeMethod: "email or prominent notice on our website",
125
+ noticePeriodDays: 30,
126
+ },
2573
127
  });
2574
-
2575
- // ../core/src/validate.ts
2576
- function validatePrivacyPolicy(config) {
2577
- const issues = [];
2578
- if (!config.effectiveDate)
2579
- issues.push({ level: "error", message: "effectiveDate is required" });
2580
- if (!config.company.name)
2581
- issues.push({ level: "error", message: "company.name is required" });
2582
- if (!config.company.legalName)
2583
- issues.push({ level: "error", message: "company.legalName is required" });
2584
- if (!config.company.address)
2585
- issues.push({ level: "error", message: "company.address is required" });
2586
- if (!config.company.contact)
2587
- issues.push({ level: "error", message: "company.contact is required" });
2588
- if (Object.keys(config.dataCollected).length === 0)
2589
- issues.push({
2590
- level: "error",
2591
- message: "dataCollected must have at least one entry"
2592
- });
2593
- if (config.userRights.length === 0)
2594
- issues.push({
2595
- level: "warning",
2596
- message: "userRights is empty \u2014 consider listing applicable rights"
2597
- });
2598
- if (config.jurisdictions.includes("eu")) {
2599
- if (!config.legalBasis)
2600
- issues.push({ level: "error", message: "GDPR requires a legalBasis" });
2601
- for (const right of [
2602
- "access",
2603
- "rectification",
2604
- "erasure",
2605
- "portability",
2606
- "restriction",
2607
- "objection"
2608
- ]) {
2609
- if (!config.userRights.includes(right))
2610
- issues.push({
2611
- level: "warning",
2612
- message: `GDPR recommends including the "${right}" right`
2613
- });
2614
- }
2615
- }
2616
- if (config.jurisdictions.includes("ca")) {
2617
- for (const right of [
2618
- "access",
2619
- "erasure",
2620
- "opt_out_sale",
2621
- "non_discrimination"
2622
- ]) {
2623
- if (!config.userRights.includes(right))
2624
- issues.push({
2625
- level: "warning",
2626
- message: `CCPA recommends including the "${right}" right`
2627
- });
2628
- }
2629
- }
2630
- return issues;
2631
- }
2632
-
2633
- // ../core/src/index.ts
2634
- function compilePolicy(input, options) {
2635
- switch (input.type) {
2636
- case "privacy": {
2637
- const { type: _3, ...config } = input;
2638
- return compilePrivacyPolicy(config, options);
2639
- }
2640
- }
128
+ `;
2641
129
  }
2642
- var init_src = __esm(() => {
2643
- init_privacy();
2644
- init_privacy();
2645
- });
2646
-
2647
- // src/utils/load-config.ts
2648
- import { resolve as resolve2 } from "path";
130
+ var DATA_CATEGORY_MAP, initCommand;
131
+ var init_init = __esmMin((() => {
132
+ DATA_CATEGORY_MAP = {
133
+ name: {
134
+ group: "Personal Information",
135
+ label: "Full name"
136
+ },
137
+ email: {
138
+ group: "Personal Information",
139
+ label: "Email address"
140
+ },
141
+ ip_address: {
142
+ group: "Technical Data",
143
+ label: "IP address"
144
+ },
145
+ device_info: {
146
+ group: "Technical Data",
147
+ label: "Device type and browser"
148
+ },
149
+ location: {
150
+ group: "Location Data",
151
+ label: "Approximate location"
152
+ },
153
+ payment_info: {
154
+ group: "Financial Data",
155
+ label: "Payment card details"
156
+ },
157
+ usage_data: {
158
+ group: "Usage Data",
159
+ label: "Pages visited and features used"
160
+ }
161
+ };
162
+ initCommand = defineCommand({
163
+ meta: {
164
+ name: "init",
165
+ description: "Interactively create a policy config file"
166
+ },
167
+ args: {
168
+ out: {
169
+ type: "string",
170
+ description: "Output path for generated config",
171
+ default: ""
172
+ },
173
+ yes: {
174
+ type: "boolean",
175
+ description: "Skip prompts and use defaults (CI mode)",
176
+ default: false
177
+ },
178
+ type: {
179
+ type: "string",
180
+ description: "Policy type: \"privacy\" or \"terms\"",
181
+ default: "privacy"
182
+ }
183
+ },
184
+ async run({ args }) {
185
+ const policyType = args.type === "terms" ? "terms" : "privacy";
186
+ const defaultOut = policyType === "terms" ? "./terms.config.ts" : "./privacy.config.ts";
187
+ consola.start(`OpenPolicy init wizard (${policyType})`);
188
+ const companyName = String(await consola.prompt("Company name?", {
189
+ type: "text",
190
+ cancel: "reject"
191
+ }));
192
+ const legalName = String(await consola.prompt("Legal entity name?", {
193
+ type: "text",
194
+ cancel: "reject",
195
+ initial: companyName
196
+ }));
197
+ const address = String(await consola.prompt("Company address?", {
198
+ type: "text",
199
+ cancel: "reject"
200
+ }));
201
+ const contact = String(await consola.prompt(policyType === "terms" ? "Legal contact email?" : "Privacy contact email?", {
202
+ type: "text",
203
+ cancel: "reject"
204
+ }));
205
+ let source;
206
+ if (policyType === "terms") source = renderTermsConfig({
207
+ companyName,
208
+ legalName,
209
+ address,
210
+ contact,
211
+ jurisdiction: String(await consola.prompt("Governing law jurisdiction? (e.g. Delaware, USA)", {
212
+ type: "text",
213
+ cancel: "reject",
214
+ initial: "Delaware, USA"
215
+ }))
216
+ });
217
+ else {
218
+ const jurisdictionChoice = String(await consola.prompt("Jurisdiction?", {
219
+ type: "select",
220
+ cancel: "reject",
221
+ options: [
222
+ "gdpr",
223
+ "ccpa",
224
+ "both"
225
+ ]
226
+ }));
227
+ const dataCategories = await consola.prompt("Data categories collected?", {
228
+ type: "multiselect",
229
+ cancel: "reject",
230
+ options: [
231
+ "name",
232
+ "email",
233
+ "ip_address",
234
+ "device_info",
235
+ "location",
236
+ "payment_info",
237
+ "usage_data"
238
+ ]
239
+ });
240
+ const hasCookies = Boolean(await consola.prompt("Does your app use cookies?", {
241
+ type: "confirm",
242
+ cancel: "reject",
243
+ initial: true
244
+ }));
245
+ const jurisdictions = toJurisdictions(jurisdictionChoice);
246
+ const dataCollected = toDataCollected(dataCategories);
247
+ const userRights = toUserRights(jurisdictions);
248
+ source = renderPrivacyConfig({
249
+ companyName,
250
+ legalName,
251
+ address,
252
+ contact,
253
+ jurisdictions,
254
+ dataCollected,
255
+ legalBasis: jurisdictions.includes("eu") ? "Legitimate interests and consent" : "",
256
+ hasCookies,
257
+ userRights
258
+ });
259
+ }
260
+ const outPath = resolve(args.out || defaultOut);
261
+ await Bun.write(outPath, source);
262
+ consola.success(`Config written to ${outPath}`);
263
+ }
264
+ });
265
+ }));
266
+ //#endregion
267
+ //#region src/utils/detect-type.ts
268
+ function detectType(explicitType, configPath) {
269
+ if (explicitType === "privacy" || explicitType === "terms") return explicitType;
270
+ return configPath.toLowerCase().includes("terms") ? "terms" : "privacy";
271
+ }
272
+ var init_detect_type = __esmMin((() => {}));
273
+ //#endregion
274
+ //#region src/utils/load-config.ts
2649
275
  async function loadConfig(configPath) {
2650
- const absPath = resolve2(configPath);
2651
- if (!await Bun.file(absPath).exists()) {
2652
- consola.error(`Config file not found: ${absPath}`);
2653
- process.exit(1);
2654
- }
2655
- let mod;
2656
- try {
2657
- mod = await import(absPath);
2658
- } catch (err) {
2659
- consola.error(`Failed to load config: ${absPath}`);
2660
- consola.error(err);
2661
- process.exit(1);
2662
- }
2663
- const config = mod["default"] ?? mod["module.exports"] ?? mod;
2664
- if (config === null || config === undefined || typeof config !== "object") {
2665
- consola.error(`Config must export a non-null object: ${absPath}`);
2666
- process.exit(1);
2667
- }
2668
- return config;
2669
- }
2670
- var init_load_config = __esm(() => {
2671
- init_dist();
2672
- });
2673
-
2674
- // src/commands/generate.ts
2675
- var exports_generate = {};
2676
- __export(exports_generate, {
2677
- generateCommand: () => generateCommand
2678
- });
2679
- import { join } from "path";
276
+ const absPath = resolve(configPath);
277
+ if (!existsSync(absPath)) {
278
+ consola.error(`Config file not found: ${absPath}`);
279
+ process.exit(1);
280
+ }
281
+ let mod;
282
+ try {
283
+ mod = await import(absPath);
284
+ } catch (err) {
285
+ consola.error(`Failed to load config: ${absPath}`);
286
+ consola.error(err);
287
+ process.exit(1);
288
+ }
289
+ const config = mod["default"] ?? mod["module.exports"] ?? mod;
290
+ if (config === null || config === void 0 || typeof config !== "object") {
291
+ consola.error(`Config must export a non-null object: ${absPath}`);
292
+ process.exit(1);
293
+ }
294
+ return config;
295
+ }
296
+ var init_load_config = __esmMin((() => {}));
297
+ //#endregion
298
+ //#region src/commands/generate.ts
299
+ var generate_exports = /* @__PURE__ */ __exportAll({ generateCommand: () => generateCommand });
2680
300
  var generateCommand;
2681
- var init_generate = __esm(() => {
2682
- init_src();
2683
- init_dist2();
2684
- init_dist();
2685
- init_load_config();
2686
- generateCommand = defineCommand({
2687
- meta: {
2688
- name: "generate",
2689
- description: "Compile a policy config to one or more output formats"
2690
- },
2691
- args: {
2692
- config: {
2693
- type: "positional",
2694
- description: "Path to policy config file",
2695
- default: "./policy.config.ts"
2696
- },
2697
- format: {
2698
- type: "string",
2699
- description: "Comma-separated output formats: markdown,pdf,jsx",
2700
- default: "markdown"
2701
- },
2702
- out: {
2703
- type: "string",
2704
- description: "Output directory",
2705
- default: "./output"
2706
- }
2707
- },
2708
- async run({ args }) {
2709
- const formats = (args.format ?? "markdown").split(",").map((f3) => f3.trim()).filter(Boolean);
2710
- const outDir = args.out ?? "./output";
2711
- consola.start(`Generating policy from ${args.config} \u2192 formats: ${formats.join(", ")}`);
2712
- const config = await loadConfig(args.config ?? "./policy.config.ts");
2713
- const results = compilePolicy({ type: "privacy", ...config }, { formats });
2714
- for (const result of results) {
2715
- const ext = result.format === "markdown" ? "md" : result.format;
2716
- const outPath = join(outDir, `privacy-policy.${ext}`);
2717
- await Bun.write(outPath, result.content);
2718
- consola.success(`Written: ${outPath}`);
2719
- }
2720
- consola.success(`Policy generation complete \u2192 ${outDir}`);
2721
- }
2722
- });
2723
- });
2724
-
2725
- // src/commands/validate.ts
2726
- var exports_validate = {};
2727
- __export(exports_validate, {
2728
- validateCommand: () => validateCommand
2729
- });
301
+ var init_generate = __esmMin((() => {
302
+ init_detect_type();
303
+ init_load_config();
304
+ generateCommand = defineCommand({
305
+ meta: {
306
+ name: "generate",
307
+ description: "Compile a policy config to one or more output formats"
308
+ },
309
+ args: {
310
+ config: {
311
+ type: "positional",
312
+ description: "Path to policy config file",
313
+ default: "./policy.config.ts"
314
+ },
315
+ format: {
316
+ type: "string",
317
+ description: "Comma-separated output formats: markdown,pdf,jsx",
318
+ default: "markdown"
319
+ },
320
+ out: {
321
+ type: "string",
322
+ description: "Output directory",
323
+ default: "./output"
324
+ },
325
+ type: {
326
+ type: "string",
327
+ description: "Policy type: \"privacy\" or \"terms\" (auto-detected from filename if omitted)",
328
+ default: ""
329
+ }
330
+ },
331
+ async run({ args }) {
332
+ const formats = (args.format ?? "markdown").split(",").map((f) => f.trim()).filter(Boolean);
333
+ const outDir = args.out ?? "./output";
334
+ const configPath = args.config ?? "./policy.config.ts";
335
+ const policyType = detectType(args.type || void 0, configPath);
336
+ consola.start(`Generating ${policyType} policy from ${configPath} → formats: ${formats.join(", ")}`);
337
+ const config = await loadConfig(configPath);
338
+ const outputFilename = policyType === "terms" ? "terms-of-service" : "privacy-policy";
339
+ const results = compilePolicy(policyType === "terms" ? {
340
+ type: "terms",
341
+ ...config
342
+ } : {
343
+ type: "privacy",
344
+ ...config
345
+ }, { formats });
346
+ for (const result of results) {
347
+ const outPath = join(outDir, `${outputFilename}.${result.format === "markdown" ? "md" : result.format}`);
348
+ await Bun.write(outPath, result.content);
349
+ consola.success(`Written: ${outPath}`);
350
+ }
351
+ consola.success(`Policy generation complete → ${outDir}`);
352
+ }
353
+ });
354
+ }));
355
+ //#endregion
356
+ //#region src/commands/validate.ts
357
+ var validate_exports = /* @__PURE__ */ __exportAll({ validateCommand: () => validateCommand });
2730
358
  var validateCommand;
2731
- var init_validate = __esm(() => {
2732
- init_src();
2733
- init_dist2();
2734
- init_dist();
2735
- init_load_config();
2736
- validateCommand = defineCommand({
2737
- meta: {
2738
- name: "validate",
2739
- description: "Validate a policy config for compliance"
2740
- },
2741
- args: {
2742
- config: {
2743
- type: "positional",
2744
- description: "Path to policy config file",
2745
- default: "./policy.config.ts"
2746
- },
2747
- jurisdiction: {
2748
- type: "string",
2749
- description: "Jurisdiction to validate against: gdpr, ccpa, or all",
2750
- default: "all"
2751
- }
2752
- },
2753
- async run({ args }) {
2754
- const configPath = args.config ?? "./policy.config.ts";
2755
- consola.start(`Validating ${configPath}`);
2756
- const config = await loadConfig(configPath);
2757
- const issues = validatePrivacyPolicy(config);
2758
- if (issues.length === 0) {
2759
- consola.success("Config is valid \u2014 no issues found.");
2760
- return;
2761
- }
2762
- for (const issue of issues) {
2763
- if (issue.level === "error") {
2764
- consola.error(issue.message);
2765
- } else {
2766
- consola.warn(issue.message);
2767
- }
2768
- }
2769
- const errors = issues.filter((i2) => i2.level === "error");
2770
- if (errors.length > 0) {
2771
- consola.fail(`Validation failed with ${errors.length} error(s).`);
2772
- process.exit(1);
2773
- }
2774
- consola.success("Validation passed with warnings.");
2775
- }
2776
- });
2777
- });
2778
-
2779
- // src/cli.ts
2780
- init_dist2();
2781
-
2782
- // src/index.ts
2783
- init_dist2();
2784
- var mainCommand = defineCommand({
2785
- meta: {
2786
- name: "openpolicy",
2787
- version: "0.0.1",
2788
- description: "Generate and validate privacy policy documents"
2789
- },
2790
- subCommands: {
2791
- init: () => Promise.resolve().then(() => (init_init(), exports_init)).then((m2) => m2.initCommand),
2792
- generate: () => Promise.resolve().then(() => (init_generate(), exports_generate)).then((m2) => m2.generateCommand),
2793
- validate: () => Promise.resolve().then(() => (init_validate(), exports_validate)).then((m2) => m2.validateCommand)
2794
- }
2795
- });
2796
-
2797
- // src/cli.ts
2798
- runMain(mainCommand);
359
+ var init_validate = __esmMin((() => {
360
+ init_detect_type();
361
+ init_load_config();
362
+ validateCommand = defineCommand({
363
+ meta: {
364
+ name: "validate",
365
+ description: "Validate a policy config for compliance"
366
+ },
367
+ args: {
368
+ config: {
369
+ type: "positional",
370
+ description: "Path to policy config file",
371
+ default: "./policy.config.ts"
372
+ },
373
+ jurisdiction: {
374
+ type: "string",
375
+ description: "Jurisdiction to validate against: gdpr, ccpa, or all",
376
+ default: "all"
377
+ },
378
+ type: {
379
+ type: "string",
380
+ description: "Policy type: \"privacy\" or \"terms\" (auto-detected from filename if omitted)",
381
+ default: ""
382
+ }
383
+ },
384
+ async run({ args }) {
385
+ const configPath = args.config ?? "./policy.config.ts";
386
+ const policyType = detectType(args.type || void 0, configPath);
387
+ consola.start(`Validating ${policyType} policy: ${configPath}`);
388
+ const config = await loadConfig(configPath);
389
+ const issues = policyType === "terms" ? validateTermsOfService(config) : validatePrivacyPolicy(config);
390
+ if (issues.length === 0) {
391
+ consola.success("Config is valid — no issues found.");
392
+ return;
393
+ }
394
+ for (const issue of issues) if (issue.level === "error") consola.error(issue.message);
395
+ else consola.warn(issue.message);
396
+ const errors = issues.filter((i) => i.level === "error");
397
+ if (errors.length > 0) {
398
+ consola.fail(`Validation failed with ${errors.length} error(s).`);
399
+ process.exit(1);
400
+ }
401
+ consola.success("Validation passed with warnings.");
402
+ }
403
+ });
404
+ }));
405
+ //#endregion
406
+ //#region src/cli.ts
407
+ runMain(defineCommand({
408
+ meta: {
409
+ name: "openpolicy",
410
+ version: "0.0.1",
411
+ description: "Generate and validate privacy policy documents"
412
+ },
413
+ subCommands: {
414
+ init: () => Promise.resolve().then(() => (init_init(), init_exports)).then((m) => m.initCommand),
415
+ generate: () => Promise.resolve().then(() => (init_generate(), generate_exports)).then((m) => m.generateCommand),
416
+ validate: () => Promise.resolve().then(() => (init_validate(), validate_exports)).then((m) => m.validateCommand)
417
+ }
418
+ }));
419
+ //#endregion
420
+ export {};