create-rstack 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +49 -0
  3. package/dist/index.d.ts +20 -0
  4. package/dist/index.js +1577 -0
  5. package/package.json +55 -0
  6. package/template-biome/biome.json +25 -0
  7. package/template-biome/node_modules/.bin/biome +17 -0
  8. package/template-biome/package.json +12 -0
  9. package/template-eslint/react-js/eslint.config.mjs +29 -0
  10. package/template-eslint/react-js/node_modules/.bin/acorn +17 -0
  11. package/template-eslint/react-js/node_modules/.bin/eslint +17 -0
  12. package/template-eslint/react-js/node_modules/.bin/jiti +17 -0
  13. package/template-eslint/react-js/package.json +16 -0
  14. package/template-eslint/react-ts/eslint.config.mjs +31 -0
  15. package/template-eslint/react-ts/node_modules/.bin/acorn +17 -0
  16. package/template-eslint/react-ts/node_modules/.bin/eslint +17 -0
  17. package/template-eslint/react-ts/node_modules/.bin/jiti +17 -0
  18. package/template-eslint/react-ts/node_modules/.bin/tsc +17 -0
  19. package/template-eslint/react-ts/node_modules/.bin/tsserver +17 -0
  20. package/template-eslint/react-ts/package.json +17 -0
  21. package/template-eslint/svelte-js/eslint.config.mjs +20 -0
  22. package/template-eslint/svelte-js/node_modules/.bin/acorn +17 -0
  23. package/template-eslint/svelte-js/node_modules/.bin/eslint +17 -0
  24. package/template-eslint/svelte-js/node_modules/.bin/jiti +17 -0
  25. package/template-eslint/svelte-js/package.json +14 -0
  26. package/template-eslint/svelte-ts/eslint.config.mjs +28 -0
  27. package/template-eslint/svelte-ts/node_modules/.bin/acorn +17 -0
  28. package/template-eslint/svelte-ts/node_modules/.bin/eslint +17 -0
  29. package/template-eslint/svelte-ts/node_modules/.bin/jiti +17 -0
  30. package/template-eslint/svelte-ts/node_modules/.bin/tsc +17 -0
  31. package/template-eslint/svelte-ts/node_modules/.bin/tsserver +17 -0
  32. package/template-eslint/svelte-ts/package.json +16 -0
  33. package/template-eslint/vanilla-js/eslint.config.mjs +8 -0
  34. package/template-eslint/vanilla-js/node_modules/.bin/acorn +17 -0
  35. package/template-eslint/vanilla-js/node_modules/.bin/eslint +17 -0
  36. package/template-eslint/vanilla-js/node_modules/.bin/jiti +17 -0
  37. package/template-eslint/vanilla-js/package.json +13 -0
  38. package/template-eslint/vanilla-ts/eslint.config.mjs +10 -0
  39. package/template-eslint/vanilla-ts/node_modules/.bin/acorn +17 -0
  40. package/template-eslint/vanilla-ts/node_modules/.bin/eslint +17 -0
  41. package/template-eslint/vanilla-ts/node_modules/.bin/jiti +17 -0
  42. package/template-eslint/vanilla-ts/node_modules/.bin/tsc +17 -0
  43. package/template-eslint/vanilla-ts/node_modules/.bin/tsserver +17 -0
  44. package/template-eslint/vanilla-ts/package.json +14 -0
  45. package/template-eslint/vue-js/eslint.config.mjs +10 -0
  46. package/template-eslint/vue-js/node_modules/.bin/acorn +17 -0
  47. package/template-eslint/vue-js/node_modules/.bin/eslint +17 -0
  48. package/template-eslint/vue-js/node_modules/.bin/jiti +17 -0
  49. package/template-eslint/vue-js/package.json +14 -0
  50. package/template-eslint/vue-ts/eslint.config.mjs +12 -0
  51. package/template-eslint/vue-ts/node_modules/.bin/acorn +17 -0
  52. package/template-eslint/vue-ts/node_modules/.bin/eslint +17 -0
  53. package/template-eslint/vue-ts/node_modules/.bin/jiti +17 -0
  54. package/template-eslint/vue-ts/node_modules/.bin/tsc +17 -0
  55. package/template-eslint/vue-ts/node_modules/.bin/tsserver +17 -0
  56. package/template-eslint/vue-ts/package.json +15 -0
  57. package/template-prettier/.prettierignore +4 -0
  58. package/template-prettier/.prettierrc +3 -0
  59. package/template-prettier/node_modules/.bin/prettier +17 -0
  60. package/template-prettier/package.json +11 -0
package/dist/index.js ADDED
@@ -0,0 +1,1577 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __require = /* @__PURE__ */ ((x3) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x3, {
8
+ get: (a3, b3) => (typeof require !== "undefined" ? require : a3)[b3]
9
+ }) : x3)(function(x3) {
10
+ if (typeof require !== "undefined") return require.apply(this, arguments);
11
+ throw Error('Dynamic require of "' + x3 + '" is not supported');
12
+ });
13
+ var __esm = (fn, res) => function __init() {
14
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
15
+ };
16
+ var __commonJS = (cb, mod) => function __require2() {
17
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
18
+ };
19
+ var __copyProps = (to, from, except, desc) => {
20
+ if (from && typeof from === "object" || typeof from === "function") {
21
+ for (let key of __getOwnPropNames(from))
22
+ if (!__hasOwnProp.call(to, key) && key !== except)
23
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
24
+ }
25
+ return to;
26
+ };
27
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
28
+ // If the importer is in node compatibility mode or this is not an ESM
29
+ // file that has been converted to a CommonJS file using a Babel-
30
+ // compatible transform (i.e. "__esModule" has not been set), then set
31
+ // "default" to the CommonJS "module.exports" for node compatibility.
32
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
33
+ mod
34
+ ));
35
+
36
+ // node_modules/.pnpm/tsup@8.2.4_typescript@5.5.4/node_modules/tsup/assets/esm_shims.js
37
+ import { fileURLToPath } from "url";
38
+ import path from "path";
39
+ var getFilename, getDirname, __dirname;
40
+ var init_esm_shims = __esm({
41
+ "node_modules/.pnpm/tsup@8.2.4_typescript@5.5.4/node_modules/tsup/assets/esm_shims.js"() {
42
+ "use strict";
43
+ getFilename = () => fileURLToPath(import.meta.url);
44
+ getDirname = () => path.dirname(getFilename());
45
+ __dirname = /* @__PURE__ */ getDirname();
46
+ }
47
+ });
48
+
49
+ // node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
50
+ var require_src = __commonJS({
51
+ "node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports, module) {
52
+ "use strict";
53
+ init_esm_shims();
54
+ var ESC = "\x1B";
55
+ var CSI = `${ESC}[`;
56
+ var beep = "\x07";
57
+ var cursor = {
58
+ to(x3, y3) {
59
+ if (!y3) return `${CSI}${x3 + 1}G`;
60
+ return `${CSI}${y3 + 1};${x3 + 1}H`;
61
+ },
62
+ move(x3, y3) {
63
+ let ret = "";
64
+ if (x3 < 0) ret += `${CSI}${-x3}D`;
65
+ else if (x3 > 0) ret += `${CSI}${x3}C`;
66
+ if (y3 < 0) ret += `${CSI}${-y3}A`;
67
+ else if (y3 > 0) ret += `${CSI}${y3}B`;
68
+ return ret;
69
+ },
70
+ up: (count = 1) => `${CSI}${count}A`,
71
+ down: (count = 1) => `${CSI}${count}B`,
72
+ forward: (count = 1) => `${CSI}${count}C`,
73
+ backward: (count = 1) => `${CSI}${count}D`,
74
+ nextLine: (count = 1) => `${CSI}E`.repeat(count),
75
+ prevLine: (count = 1) => `${CSI}F`.repeat(count),
76
+ left: `${CSI}G`,
77
+ hide: `${CSI}?25l`,
78
+ show: `${CSI}?25h`,
79
+ save: `${ESC}7`,
80
+ restore: `${ESC}8`
81
+ };
82
+ var scroll = {
83
+ up: (count = 1) => `${CSI}S`.repeat(count),
84
+ down: (count = 1) => `${CSI}T`.repeat(count)
85
+ };
86
+ var erase = {
87
+ screen: `${CSI}2J`,
88
+ up: (count = 1) => `${CSI}1J`.repeat(count),
89
+ down: (count = 1) => `${CSI}J`.repeat(count),
90
+ line: `${CSI}2K`,
91
+ lineEnd: `${CSI}K`,
92
+ lineStart: `${CSI}1K`,
93
+ lines(count) {
94
+ let clear = "";
95
+ for (let i = 0; i < count; i++)
96
+ clear += this.line + (i < count - 1 ? cursor.up() : "");
97
+ if (count)
98
+ clear += cursor.left;
99
+ return clear;
100
+ }
101
+ };
102
+ module.exports = { cursor, scroll, erase, beep };
103
+ }
104
+ });
105
+
106
+ // node_modules/.pnpm/picocolors@1.0.1/node_modules/picocolors/picocolors.js
107
+ var require_picocolors = __commonJS({
108
+ "node_modules/.pnpm/picocolors@1.0.1/node_modules/picocolors/picocolors.js"(exports, module) {
109
+ "use strict";
110
+ init_esm_shims();
111
+ var argv = process.argv || [];
112
+ var env2 = process.env;
113
+ var isColorSupported = !("NO_COLOR" in env2 || argv.includes("--no-color")) && ("FORCE_COLOR" in env2 || argv.includes("--color") || process.platform === "win32" || __require != null && __require("tty").isatty(1) && env2.TERM !== "dumb" || "CI" in env2);
114
+ var formatter2 = (open, close, replace = open) => (input) => {
115
+ let string = "" + input;
116
+ let index = string.indexOf(close, open.length);
117
+ return ~index ? open + replaceClose2(string, close, replace, index) + close : open + string + close;
118
+ };
119
+ var replaceClose2 = (string, close, replace, index) => {
120
+ let result = "";
121
+ let cursor = 0;
122
+ do {
123
+ result += string.substring(cursor, index) + replace;
124
+ cursor = index + close.length;
125
+ index = string.indexOf(close, cursor);
126
+ } while (~index);
127
+ return result + string.substring(cursor);
128
+ };
129
+ var createColors = (enabled = isColorSupported) => {
130
+ let init = enabled ? formatter2 : () => String;
131
+ return {
132
+ isColorSupported: enabled,
133
+ reset: init("\x1B[0m", "\x1B[0m"),
134
+ bold: init("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
135
+ dim: init("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
136
+ italic: init("\x1B[3m", "\x1B[23m"),
137
+ underline: init("\x1B[4m", "\x1B[24m"),
138
+ inverse: init("\x1B[7m", "\x1B[27m"),
139
+ hidden: init("\x1B[8m", "\x1B[28m"),
140
+ strikethrough: init("\x1B[9m", "\x1B[29m"),
141
+ black: init("\x1B[30m", "\x1B[39m"),
142
+ red: init("\x1B[31m", "\x1B[39m"),
143
+ green: init("\x1B[32m", "\x1B[39m"),
144
+ yellow: init("\x1B[33m", "\x1B[39m"),
145
+ blue: init("\x1B[34m", "\x1B[39m"),
146
+ magenta: init("\x1B[35m", "\x1B[39m"),
147
+ cyan: init("\x1B[36m", "\x1B[39m"),
148
+ white: init("\x1B[37m", "\x1B[39m"),
149
+ gray: init("\x1B[90m", "\x1B[39m"),
150
+ bgBlack: init("\x1B[40m", "\x1B[49m"),
151
+ bgRed: init("\x1B[41m", "\x1B[49m"),
152
+ bgGreen: init("\x1B[42m", "\x1B[49m"),
153
+ bgYellow: init("\x1B[43m", "\x1B[49m"),
154
+ bgBlue: init("\x1B[44m", "\x1B[49m"),
155
+ bgMagenta: init("\x1B[45m", "\x1B[49m"),
156
+ bgCyan: init("\x1B[46m", "\x1B[49m"),
157
+ bgWhite: init("\x1B[47m", "\x1B[49m")
158
+ };
159
+ };
160
+ module.exports = createColors();
161
+ module.exports.createColors = createColors;
162
+ }
163
+ });
164
+
165
+ // node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js
166
+ var require_cjs = __commonJS({
167
+ "node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js"(exports, module) {
168
+ "use strict";
169
+ init_esm_shims();
170
+ var isMergeableObject = function isMergeableObject2(value) {
171
+ return isNonNullObject(value) && !isSpecial(value);
172
+ };
173
+ function isNonNullObject(value) {
174
+ return !!value && typeof value === "object";
175
+ }
176
+ function isSpecial(value) {
177
+ var stringValue = Object.prototype.toString.call(value);
178
+ return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
179
+ }
180
+ var canUseSymbol = typeof Symbol === "function" && Symbol.for;
181
+ var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
182
+ function isReactElement(value) {
183
+ return value.$$typeof === REACT_ELEMENT_TYPE;
184
+ }
185
+ function emptyTarget(val) {
186
+ return Array.isArray(val) ? [] : {};
187
+ }
188
+ function cloneUnlessOtherwiseSpecified(value, options) {
189
+ return options.clone !== false && options.isMergeableObject(value) ? deepmerge2(emptyTarget(value), value, options) : value;
190
+ }
191
+ function defaultArrayMerge(target, source, options) {
192
+ return target.concat(source).map(function(element) {
193
+ return cloneUnlessOtherwiseSpecified(element, options);
194
+ });
195
+ }
196
+ function getMergeFunction(key, options) {
197
+ if (!options.customMerge) {
198
+ return deepmerge2;
199
+ }
200
+ var customMerge = options.customMerge(key);
201
+ return typeof customMerge === "function" ? customMerge : deepmerge2;
202
+ }
203
+ function getEnumerableOwnPropertySymbols(target) {
204
+ return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
205
+ return Object.propertyIsEnumerable.call(target, symbol);
206
+ }) : [];
207
+ }
208
+ function getKeys(target) {
209
+ return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
210
+ }
211
+ function propertyIsOnObject(object, property) {
212
+ try {
213
+ return property in object;
214
+ } catch (_3) {
215
+ return false;
216
+ }
217
+ }
218
+ function propertyIsUnsafe(target, key) {
219
+ return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
220
+ }
221
+ function mergeObject(target, source, options) {
222
+ var destination = {};
223
+ if (options.isMergeableObject(target)) {
224
+ getKeys(target).forEach(function(key) {
225
+ destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
226
+ });
227
+ }
228
+ getKeys(source).forEach(function(key) {
229
+ if (propertyIsUnsafe(target, key)) {
230
+ return;
231
+ }
232
+ if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
233
+ destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
234
+ } else {
235
+ destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
236
+ }
237
+ });
238
+ return destination;
239
+ }
240
+ function deepmerge2(target, source, options) {
241
+ options = options || {};
242
+ options.arrayMerge = options.arrayMerge || defaultArrayMerge;
243
+ options.isMergeableObject = options.isMergeableObject || isMergeableObject;
244
+ options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
245
+ var sourceIsArray = Array.isArray(source);
246
+ var targetIsArray = Array.isArray(target);
247
+ var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
248
+ if (!sourceAndTargetTypesMatch) {
249
+ return cloneUnlessOtherwiseSpecified(source, options);
250
+ } else if (sourceIsArray) {
251
+ return options.arrayMerge(target, source, options);
252
+ } else {
253
+ return mergeObject(target, source, options);
254
+ }
255
+ }
256
+ deepmerge2.all = function deepmergeAll(array, options) {
257
+ if (!Array.isArray(array)) {
258
+ throw new Error("first argument should be an array");
259
+ }
260
+ return array.reduce(function(prev, next) {
261
+ return deepmerge2(prev, next, options);
262
+ }, {});
263
+ };
264
+ var deepmerge_1 = deepmerge2;
265
+ module.exports = deepmerge_1;
266
+ }
267
+ });
268
+
269
+ // node_modules/.pnpm/minimist@1.2.8/node_modules/minimist/index.js
270
+ var require_minimist = __commonJS({
271
+ "node_modules/.pnpm/minimist@1.2.8/node_modules/minimist/index.js"(exports, module) {
272
+ "use strict";
273
+ init_esm_shims();
274
+ function hasKey(obj, keys) {
275
+ var o2 = obj;
276
+ keys.slice(0, -1).forEach(function(key2) {
277
+ o2 = o2[key2] || {};
278
+ });
279
+ var key = keys[keys.length - 1];
280
+ return key in o2;
281
+ }
282
+ function isNumber(x3) {
283
+ if (typeof x3 === "number") {
284
+ return true;
285
+ }
286
+ if (/^0x[0-9a-f]+$/i.test(x3)) {
287
+ return true;
288
+ }
289
+ return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x3);
290
+ }
291
+ function isConstructorOrProto(obj, key) {
292
+ return key === "constructor" && typeof obj[key] === "function" || key === "__proto__";
293
+ }
294
+ module.exports = function(args, opts) {
295
+ if (!opts) {
296
+ opts = {};
297
+ }
298
+ var flags = {
299
+ bools: {},
300
+ strings: {},
301
+ unknownFn: null
302
+ };
303
+ if (typeof opts.unknown === "function") {
304
+ flags.unknownFn = opts.unknown;
305
+ }
306
+ if (typeof opts.boolean === "boolean" && opts.boolean) {
307
+ flags.allBools = true;
308
+ } else {
309
+ [].concat(opts.boolean).filter(Boolean).forEach(function(key2) {
310
+ flags.bools[key2] = true;
311
+ });
312
+ }
313
+ var aliases = {};
314
+ function aliasIsBoolean(key2) {
315
+ return aliases[key2].some(function(x3) {
316
+ return flags.bools[x3];
317
+ });
318
+ }
319
+ Object.keys(opts.alias || {}).forEach(function(key2) {
320
+ aliases[key2] = [].concat(opts.alias[key2]);
321
+ aliases[key2].forEach(function(x3) {
322
+ aliases[x3] = [key2].concat(aliases[key2].filter(function(y3) {
323
+ return x3 !== y3;
324
+ }));
325
+ });
326
+ });
327
+ [].concat(opts.string).filter(Boolean).forEach(function(key2) {
328
+ flags.strings[key2] = true;
329
+ if (aliases[key2]) {
330
+ [].concat(aliases[key2]).forEach(function(k2) {
331
+ flags.strings[k2] = true;
332
+ });
333
+ }
334
+ });
335
+ var defaults = opts.default || {};
336
+ var argv = { _: [] };
337
+ function argDefined(key2, arg2) {
338
+ return flags.allBools && /^--[^=]+$/.test(arg2) || flags.strings[key2] || flags.bools[key2] || aliases[key2];
339
+ }
340
+ function setKey(obj, keys, value2) {
341
+ var o2 = obj;
342
+ for (var i2 = 0; i2 < keys.length - 1; i2++) {
343
+ var key2 = keys[i2];
344
+ if (isConstructorOrProto(o2, key2)) {
345
+ return;
346
+ }
347
+ if (o2[key2] === void 0) {
348
+ o2[key2] = {};
349
+ }
350
+ if (o2[key2] === Object.prototype || o2[key2] === Number.prototype || o2[key2] === String.prototype) {
351
+ o2[key2] = {};
352
+ }
353
+ if (o2[key2] === Array.prototype) {
354
+ o2[key2] = [];
355
+ }
356
+ o2 = o2[key2];
357
+ }
358
+ var lastKey = keys[keys.length - 1];
359
+ if (isConstructorOrProto(o2, lastKey)) {
360
+ return;
361
+ }
362
+ if (o2 === Object.prototype || o2 === Number.prototype || o2 === String.prototype) {
363
+ o2 = {};
364
+ }
365
+ if (o2 === Array.prototype) {
366
+ o2 = [];
367
+ }
368
+ if (o2[lastKey] === void 0 || flags.bools[lastKey] || typeof o2[lastKey] === "boolean") {
369
+ o2[lastKey] = value2;
370
+ } else if (Array.isArray(o2[lastKey])) {
371
+ o2[lastKey].push(value2);
372
+ } else {
373
+ o2[lastKey] = [o2[lastKey], value2];
374
+ }
375
+ }
376
+ function setArg(key2, val, arg2) {
377
+ if (arg2 && flags.unknownFn && !argDefined(key2, arg2)) {
378
+ if (flags.unknownFn(arg2) === false) {
379
+ return;
380
+ }
381
+ }
382
+ var value2 = !flags.strings[key2] && isNumber(val) ? Number(val) : val;
383
+ setKey(argv, key2.split("."), value2);
384
+ (aliases[key2] || []).forEach(function(x3) {
385
+ setKey(argv, x3.split("."), value2);
386
+ });
387
+ }
388
+ Object.keys(flags.bools).forEach(function(key2) {
389
+ setArg(key2, defaults[key2] === void 0 ? false : defaults[key2]);
390
+ });
391
+ var notFlags = [];
392
+ if (args.indexOf("--") !== -1) {
393
+ notFlags = args.slice(args.indexOf("--") + 1);
394
+ args = args.slice(0, args.indexOf("--"));
395
+ }
396
+ for (var i = 0; i < args.length; i++) {
397
+ var arg = args[i];
398
+ var key;
399
+ var next;
400
+ if (/^--.+=/.test(arg)) {
401
+ var m2 = arg.match(/^--([^=]+)=([\s\S]*)$/);
402
+ key = m2[1];
403
+ var value = m2[2];
404
+ if (flags.bools[key]) {
405
+ value = value !== "false";
406
+ }
407
+ setArg(key, value, arg);
408
+ } else if (/^--no-.+/.test(arg)) {
409
+ key = arg.match(/^--no-(.+)/)[1];
410
+ setArg(key, false, arg);
411
+ } else if (/^--.+/.test(arg)) {
412
+ key = arg.match(/^--(.+)/)[1];
413
+ next = args[i + 1];
414
+ if (next !== void 0 && !/^(-|--)[^-]/.test(next) && !flags.bools[key] && !flags.allBools && (aliases[key] ? !aliasIsBoolean(key) : true)) {
415
+ setArg(key, next, arg);
416
+ i += 1;
417
+ } else if (/^(true|false)$/.test(next)) {
418
+ setArg(key, next === "true", arg);
419
+ i += 1;
420
+ } else {
421
+ setArg(key, flags.strings[key] ? "" : true, arg);
422
+ }
423
+ } else if (/^-[^-]+/.test(arg)) {
424
+ var letters = arg.slice(1, -1).split("");
425
+ var broken = false;
426
+ for (var j2 = 0; j2 < letters.length; j2++) {
427
+ next = arg.slice(j2 + 2);
428
+ if (next === "-") {
429
+ setArg(letters[j2], next, arg);
430
+ continue;
431
+ }
432
+ if (/[A-Za-z]/.test(letters[j2]) && next[0] === "=") {
433
+ setArg(letters[j2], next.slice(1), arg);
434
+ broken = true;
435
+ break;
436
+ }
437
+ if (/[A-Za-z]/.test(letters[j2]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
438
+ setArg(letters[j2], next, arg);
439
+ broken = true;
440
+ break;
441
+ }
442
+ if (letters[j2 + 1] && letters[j2 + 1].match(/\W/)) {
443
+ setArg(letters[j2], arg.slice(j2 + 2), arg);
444
+ broken = true;
445
+ break;
446
+ } else {
447
+ setArg(letters[j2], flags.strings[letters[j2]] ? "" : true, arg);
448
+ }
449
+ }
450
+ key = arg.slice(-1)[0];
451
+ if (!broken && key !== "-") {
452
+ if (args[i + 1] && !/^(-|--)[^-]/.test(args[i + 1]) && !flags.bools[key] && (aliases[key] ? !aliasIsBoolean(key) : true)) {
453
+ setArg(key, args[i + 1], arg);
454
+ i += 1;
455
+ } else if (args[i + 1] && /^(true|false)$/.test(args[i + 1])) {
456
+ setArg(key, args[i + 1] === "true", arg);
457
+ i += 1;
458
+ } else {
459
+ setArg(key, flags.strings[key] ? "" : true, arg);
460
+ }
461
+ }
462
+ } else {
463
+ if (!flags.unknownFn || flags.unknownFn(arg) !== false) {
464
+ argv._.push(flags.strings._ || !isNumber(arg) ? arg : Number(arg));
465
+ }
466
+ if (opts.stopEarly) {
467
+ argv._.push.apply(argv._, args.slice(i + 1));
468
+ break;
469
+ }
470
+ }
471
+ }
472
+ Object.keys(defaults).forEach(function(k2) {
473
+ if (!hasKey(argv, k2.split("."))) {
474
+ setKey(argv, k2.split("."), defaults[k2]);
475
+ (aliases[k2] || []).forEach(function(x3) {
476
+ setKey(argv, x3.split("."), defaults[k2]);
477
+ });
478
+ }
479
+ });
480
+ if (opts["--"]) {
481
+ argv["--"] = notFlags.slice();
482
+ } else {
483
+ notFlags.forEach(function(k2) {
484
+ argv._.push(k2);
485
+ });
486
+ }
487
+ return argv;
488
+ };
489
+ }
490
+ });
491
+
492
+ // src/index.ts
493
+ init_esm_shims();
494
+ import fs from "node:fs";
495
+ import path2 from "node:path";
496
+
497
+ // node_modules/.pnpm/@clack+prompts@0.7.0/node_modules/@clack/prompts/dist/index.mjs
498
+ init_esm_shims();
499
+
500
+ // node_modules/.pnpm/@clack+core@0.3.4/node_modules/@clack/core/dist/index.mjs
501
+ init_esm_shims();
502
+ var import_sisteransi = __toESM(require_src(), 1);
503
+ import { stdin as $, stdout as k } from "node:process";
504
+ var import_picocolors = __toESM(require_picocolors(), 1);
505
+ import _ from "node:readline";
506
+ import { WriteStream as U } from "node:tty";
507
+ function q({ onlyFirst: t = false } = {}) {
508
+ const u = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");
509
+ return new RegExp(u, t ? void 0 : "g");
510
+ }
511
+ function S(t) {
512
+ if (typeof t != "string") throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);
513
+ return t.replace(q(), "");
514
+ }
515
+ function j(t) {
516
+ return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
517
+ }
518
+ var M = { exports: {} };
519
+ (function(t) {
520
+ var u = {};
521
+ t.exports = u, u.eastAsianWidth = function(e2) {
522
+ var s = e2.charCodeAt(0), C2 = e2.length == 2 ? e2.charCodeAt(1) : 0, D = s;
523
+ return 55296 <= s && s <= 56319 && 56320 <= C2 && C2 <= 57343 && (s &= 1023, C2 &= 1023, D = s << 10 | C2, 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";
524
+ }, u.characterLength = function(e2) {
525
+ var s = this.eastAsianWidth(e2);
526
+ return s == "F" || s == "W" || s == "A" ? 2 : 1;
527
+ };
528
+ function F(e2) {
529
+ return e2.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
530
+ }
531
+ u.length = function(e2) {
532
+ for (var s = F(e2), C2 = 0, D = 0; D < s.length; D++) C2 = C2 + this.characterLength(s[D]);
533
+ return C2;
534
+ }, u.slice = function(e2, s, C2) {
535
+ textLen = u.length(e2), s = s || 0, C2 = C2 || 1, s < 0 && (s = textLen + s), C2 < 0 && (C2 = textLen + C2);
536
+ for (var D = "", i = 0, n = F(e2), E2 = 0; E2 < n.length; E2++) {
537
+ var h2 = n[E2], o2 = u.length(h2);
538
+ if (i >= s - (o2 == 2 ? 1 : 0)) if (i + o2 <= C2) D += h2;
539
+ else break;
540
+ i += o2;
541
+ }
542
+ return D;
543
+ };
544
+ })(M);
545
+ var J = M.exports;
546
+ var Q = j(J);
547
+ var X = function() {
548
+ 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;
549
+ };
550
+ var DD = j(X);
551
+ function A(t, u = {}) {
552
+ if (typeof t != "string" || t.length === 0 || (u = { ambiguousIsNarrow: true, ...u }, t = S(t), t.length === 0)) return 0;
553
+ t = t.replace(DD(), " ");
554
+ const F = u.ambiguousIsNarrow ? 1 : 2;
555
+ let e2 = 0;
556
+ for (const s of t) {
557
+ const C2 = s.codePointAt(0);
558
+ if (C2 <= 31 || C2 >= 127 && C2 <= 159 || C2 >= 768 && C2 <= 879) continue;
559
+ switch (Q.eastAsianWidth(s)) {
560
+ case "F":
561
+ case "W":
562
+ e2 += 2;
563
+ break;
564
+ case "A":
565
+ e2 += F;
566
+ break;
567
+ default:
568
+ e2 += 1;
569
+ }
570
+ }
571
+ return e2;
572
+ }
573
+ var m = 10;
574
+ var T = (t = 0) => (u) => `\x1B[${u + t}m`;
575
+ var P = (t = 0) => (u) => `\x1B[${38 + t};5;${u}m`;
576
+ var W = (t = 0) => (u, F, e2) => `\x1B[${38 + t};2;${u};${F};${e2}m`;
577
+ var 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] } };
578
+ Object.keys(r.modifier);
579
+ var uD = Object.keys(r.color);
580
+ var FD = Object.keys(r.bgColor);
581
+ [...uD, ...FD];
582
+ function tD() {
583
+ const t = /* @__PURE__ */ new Map();
584
+ for (const [u, F] of Object.entries(r)) {
585
+ for (const [e2, s] of Object.entries(F)) r[e2] = { open: `\x1B[${s[0]}m`, close: `\x1B[${s[1]}m` }, F[e2] = r[e2], t.set(s[0], s[1]);
586
+ Object.defineProperty(r, u, { value: F, enumerable: false });
587
+ }
588
+ return Object.defineProperty(r, "codes", { value: t, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = T(), r.color.ansi256 = P(), r.color.ansi16m = W(), r.bgColor.ansi = T(m), r.bgColor.ansi256 = P(m), r.bgColor.ansi16m = W(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) => {
589
+ const F = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));
590
+ if (!F) return [0, 0, 0];
591
+ let [e2] = F;
592
+ e2.length === 3 && (e2 = [...e2].map((C2) => C2 + C2).join(""));
593
+ const s = Number.parseInt(e2, 16);
594
+ return [s >> 16 & 255, s >> 8 & 255, s & 255];
595
+ }, enumerable: false }, hexToAnsi256: { value: (u) => r.rgbToAnsi256(...r.hexToRgb(u)), enumerable: false }, ansi256ToAnsi: { value: (u) => {
596
+ if (u < 8) return 30 + u;
597
+ if (u < 16) return 90 + (u - 8);
598
+ let F, e2, s;
599
+ if (u >= 232) F = ((u - 232) * 10 + 8) / 255, e2 = F, s = F;
600
+ else {
601
+ u -= 16;
602
+ const i = u % 36;
603
+ F = Math.floor(u / 36) / 5, e2 = Math.floor(i / 6) / 5, s = i % 6 / 5;
604
+ }
605
+ const C2 = Math.max(F, e2, s) * 2;
606
+ if (C2 === 0) return 30;
607
+ let D = 30 + (Math.round(s) << 2 | Math.round(e2) << 1 | Math.round(F));
608
+ return C2 === 2 && (D += 60), D;
609
+ }, 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;
610
+ }
611
+ var eD = tD();
612
+ var g = /* @__PURE__ */ new Set(["\x1B", "\x9B"]);
613
+ var sD = 39;
614
+ var b = "\x07";
615
+ var O = "[";
616
+ var CD = "]";
617
+ var I = "m";
618
+ var w = `${CD}8;;`;
619
+ var N = (t) => `${g.values().next().value}${O}${t}${I}`;
620
+ var L = (t) => `${g.values().next().value}${w}${t}${b}`;
621
+ var iD = (t) => t.split(" ").map((u) => A(u));
622
+ var y = (t, u, F) => {
623
+ const e2 = [...u];
624
+ let s = false, C2 = false, D = A(S(t[t.length - 1]));
625
+ for (const [i, n] of e2.entries()) {
626
+ const E2 = A(n);
627
+ if (D + E2 <= F ? t[t.length - 1] += n : (t.push(n), D = 0), g.has(n) && (s = true, C2 = e2.slice(i + 1).join("").startsWith(w)), s) {
628
+ C2 ? n === b && (s = false, C2 = false) : n === I && (s = false);
629
+ continue;
630
+ }
631
+ D += E2, D === F && i < e2.length - 1 && (t.push(""), D = 0);
632
+ }
633
+ !D && t[t.length - 1].length > 0 && t.length > 1 && (t[t.length - 2] += t.pop());
634
+ };
635
+ var rD = (t) => {
636
+ const u = t.split(" ");
637
+ let F = u.length;
638
+ for (; F > 0 && !(A(u[F - 1]) > 0); ) F--;
639
+ return F === u.length ? t : u.slice(0, F).join(" ") + u.slice(F).join("");
640
+ };
641
+ var ED = (t, u, F = {}) => {
642
+ if (F.trim !== false && t.trim() === "") return "";
643
+ let e2 = "", s, C2;
644
+ const D = iD(t);
645
+ let i = [""];
646
+ for (const [E2, h2] of t.split(" ").entries()) {
647
+ F.trim !== false && (i[i.length - 1] = i[i.length - 1].trimStart());
648
+ let o2 = A(i[i.length - 1]);
649
+ if (E2 !== 0 && (o2 >= u && (F.wordWrap === false || F.trim === false) && (i.push(""), o2 = 0), (o2 > 0 || F.trim === false) && (i[i.length - 1] += " ", o2++)), F.hard && D[E2] > u) {
650
+ const B2 = u - o2, p = 1 + Math.floor((D[E2] - B2 - 1) / u);
651
+ Math.floor((D[E2] - 1) / u) < p && i.push(""), y(i, h2, u);
652
+ continue;
653
+ }
654
+ if (o2 + D[E2] > u && o2 > 0 && D[E2] > 0) {
655
+ if (F.wordWrap === false && o2 < u) {
656
+ y(i, h2, u);
657
+ continue;
658
+ }
659
+ i.push("");
660
+ }
661
+ if (o2 + D[E2] > u && F.wordWrap === false) {
662
+ y(i, h2, u);
663
+ continue;
664
+ }
665
+ i[i.length - 1] += h2;
666
+ }
667
+ F.trim !== false && (i = i.map((E2) => rD(E2)));
668
+ const n = [...i.join(`
669
+ `)];
670
+ for (const [E2, h2] of n.entries()) {
671
+ if (e2 += h2, g.has(h2)) {
672
+ const { groups: B2 } = new RegExp(`(?:\\${O}(?<code>\\d+)m|\\${w}(?<uri>.*)${b})`).exec(n.slice(E2).join("")) || { groups: {} };
673
+ if (B2.code !== void 0) {
674
+ const p = Number.parseFloat(B2.code);
675
+ s = p === sD ? void 0 : p;
676
+ } else B2.uri !== void 0 && (C2 = B2.uri.length === 0 ? void 0 : B2.uri);
677
+ }
678
+ const o2 = eD.codes.get(Number(s));
679
+ n[E2 + 1] === `
680
+ ` ? (C2 && (e2 += L("")), s && o2 && (e2 += N(o2))) : h2 === `
681
+ ` && (s && o2 && (e2 += N(s)), C2 && (e2 += L(C2)));
682
+ }
683
+ return e2;
684
+ };
685
+ function R(t, u, F) {
686
+ return String(t).normalize().replace(/\r\n/g, `
687
+ `).split(`
688
+ `).map((e2) => ED(e2, u, F)).join(`
689
+ `);
690
+ }
691
+ var oD = Object.defineProperty;
692
+ var nD = (t, u, F) => u in t ? oD(t, u, { enumerable: true, configurable: true, writable: true, value: F }) : t[u] = F;
693
+ var a = (t, u, F) => (nD(t, typeof u != "symbol" ? u + "" : u, F), F);
694
+ function aD(t, u) {
695
+ if (t === u) return;
696
+ const F = t.split(`
697
+ `), e2 = u.split(`
698
+ `), s = [];
699
+ for (let C2 = 0; C2 < Math.max(F.length, e2.length); C2++) F[C2] !== e2[C2] && s.push(C2);
700
+ return s;
701
+ }
702
+ var V = Symbol("clack:cancel");
703
+ function hD(t) {
704
+ return t === V;
705
+ }
706
+ function v(t, u) {
707
+ t.isTTY && t.setRawMode(u);
708
+ }
709
+ var z = /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"]]);
710
+ var lD = /* @__PURE__ */ new Set(["up", "down", "left", "right", "space", "enter"]);
711
+ var x = class {
712
+ constructor({ render: u, input: F = $, output: e2 = k, ...s }, C2 = true) {
713
+ a(this, "input"), a(this, "output"), a(this, "rl"), a(this, "opts"), a(this, "_track", false), a(this, "_render"), a(this, "_cursor", 0), a(this, "state", "initial"), a(this, "value"), a(this, "error", ""), a(this, "subscribers", /* @__PURE__ */ new Map()), a(this, "_prevFrame", ""), this.opts = s, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = u.bind(this), this._track = C2, this.input = F, this.output = e2;
714
+ }
715
+ prompt() {
716
+ const u = new U(0);
717
+ return u._write = (F, e2, s) => {
718
+ this._track && (this.value = this.rl.line.replace(/\t/g, ""), this._cursor = this.rl.cursor, this.emit("value", this.value)), s();
719
+ }, this.input.pipe(u), this.rl = _.createInterface({ input: this.input, output: u, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), _.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), v(this.input, true), this.output.on("resize", this.render), this.render(), new Promise((F, e2) => {
720
+ this.once("submit", () => {
721
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), v(this.input, false), F(this.value);
722
+ }), this.once("cancel", () => {
723
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), v(this.input, false), F(V);
724
+ });
725
+ });
726
+ }
727
+ on(u, F) {
728
+ const e2 = this.subscribers.get(u) ?? [];
729
+ e2.push({ cb: F }), this.subscribers.set(u, e2);
730
+ }
731
+ once(u, F) {
732
+ const e2 = this.subscribers.get(u) ?? [];
733
+ e2.push({ cb: F, once: true }), this.subscribers.set(u, e2);
734
+ }
735
+ emit(u, ...F) {
736
+ const e2 = this.subscribers.get(u) ?? [], s = [];
737
+ for (const C2 of e2) C2.cb(...F), C2.once && s.push(() => e2.splice(e2.indexOf(C2), 1));
738
+ for (const C2 of s) C2();
739
+ }
740
+ unsubscribe() {
741
+ this.subscribers.clear();
742
+ }
743
+ onKeypress(u, F) {
744
+ if (this.state === "error" && (this.state = "active"), F?.name && !this._track && z.has(F.name) && this.emit("cursor", z.get(F.name)), F?.name && lD.has(F.name) && this.emit("cursor", F.name), u && (u.toLowerCase() === "y" || u.toLowerCase() === "n") && this.emit("confirm", u.toLowerCase() === "y"), u === " " && 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") {
745
+ if (this.opts.validate) {
746
+ const e2 = this.opts.validate(this.value);
747
+ e2 && (this.error = e2, this.state = "error", this.rl.write(this.value));
748
+ }
749
+ this.state !== "error" && (this.state = "submit");
750
+ }
751
+ u === "" && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
752
+ }
753
+ close() {
754
+ this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
755
+ `), v(this.input, false), this.rl.close(), this.emit(`${this.state}`, this.value), this.unsubscribe();
756
+ }
757
+ restoreCursor() {
758
+ const u = R(this._prevFrame, process.stdout.columns, { hard: true }).split(`
759
+ `).length - 1;
760
+ this.output.write(import_sisteransi.cursor.move(-999, u * -1));
761
+ }
762
+ render() {
763
+ const u = R(this._render(this) ?? "", process.stdout.columns, { hard: true });
764
+ if (u !== this._prevFrame) {
765
+ if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
766
+ else {
767
+ const F = aD(this._prevFrame, u);
768
+ if (this.restoreCursor(), F && F?.length === 1) {
769
+ const e2 = F[0];
770
+ this.output.write(import_sisteransi.cursor.move(0, e2)), this.output.write(import_sisteransi.erase.lines(1));
771
+ const s = u.split(`
772
+ `);
773
+ this.output.write(s[e2]), this._prevFrame = u, this.output.write(import_sisteransi.cursor.move(0, s.length - e2 - 1));
774
+ return;
775
+ } else if (F && F?.length > 1) {
776
+ const e2 = F[0];
777
+ this.output.write(import_sisteransi.cursor.move(0, e2)), this.output.write(import_sisteransi.erase.down());
778
+ const s = u.split(`
779
+ `).slice(e2);
780
+ this.output.write(s.join(`
781
+ `)), this._prevFrame = u;
782
+ return;
783
+ }
784
+ this.output.write(import_sisteransi.erase.down());
785
+ }
786
+ this.output.write(u), this.state === "initial" && (this.state = "active"), this._prevFrame = u;
787
+ }
788
+ }
789
+ };
790
+ var pD = Object.defineProperty;
791
+ var fD = (t, u, F) => u in t ? pD(t, u, { enumerable: true, configurable: true, writable: true, value: F }) : t[u] = F;
792
+ var K = (t, u, F) => (fD(t, typeof u != "symbol" ? u + "" : u, F), F);
793
+ var gD = class extends x {
794
+ constructor(u) {
795
+ super(u, false), K(this, "options"), K(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) => {
796
+ F === "a" && this.toggleAll();
797
+ }), this.on("cursor", (F) => {
798
+ switch (F) {
799
+ case "left":
800
+ case "up":
801
+ this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
802
+ break;
803
+ case "down":
804
+ case "right":
805
+ this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
806
+ break;
807
+ case "space":
808
+ this.toggleValue();
809
+ break;
810
+ }
811
+ });
812
+ }
813
+ get _value() {
814
+ return this.options[this.cursor].value;
815
+ }
816
+ toggleAll() {
817
+ const u = this.value.length === this.options.length;
818
+ this.value = u ? [] : this.options.map((F) => F.value);
819
+ }
820
+ toggleValue() {
821
+ const u = this.value.includes(this._value);
822
+ this.value = u ? this.value.filter((F) => F !== this._value) : [...this.value, this._value];
823
+ }
824
+ };
825
+ var bD = Object.defineProperty;
826
+ var wD = (t, u, F) => u in t ? bD(t, u, { enumerable: true, configurable: true, writable: true, value: F }) : t[u] = F;
827
+ var Z = (t, u, F) => (wD(t, typeof u != "symbol" ? u + "" : u, F), F);
828
+ var yD = class extends x {
829
+ constructor(u) {
830
+ super(u, false), Z(this, "options"), Z(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) => {
831
+ switch (F) {
832
+ case "left":
833
+ case "up":
834
+ this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
835
+ break;
836
+ case "down":
837
+ case "right":
838
+ this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
839
+ break;
840
+ }
841
+ this.changeValue();
842
+ });
843
+ }
844
+ get _value() {
845
+ return this.options[this.cursor];
846
+ }
847
+ changeValue() {
848
+ this.value = this._value.value;
849
+ }
850
+ };
851
+ var SD = Object.defineProperty;
852
+ var jD = (t, u, F) => u in t ? SD(t, u, { enumerable: true, configurable: true, writable: true, value: F }) : t[u] = F;
853
+ var MD = (t, u, F) => (jD(t, typeof u != "symbol" ? u + "" : u, F), F);
854
+ var TD = class extends x {
855
+ constructor(u) {
856
+ super(u), MD(this, "valueWithCursor", ""), this.on("finalize", () => {
857
+ this.value || (this.value = u.defaultValue), this.valueWithCursor = this.value;
858
+ }), this.on("value", () => {
859
+ if (this.cursor >= this.value.length) this.valueWithCursor = `${this.value}${import_picocolors.default.inverse(import_picocolors.default.hidden("_"))}`;
860
+ else {
861
+ const F = this.value.slice(0, this.cursor), e2 = this.value.slice(this.cursor);
862
+ this.valueWithCursor = `${F}${import_picocolors.default.inverse(e2[0])}${e2.slice(1)}`;
863
+ }
864
+ });
865
+ }
866
+ get cursor() {
867
+ return this._cursor;
868
+ }
869
+ };
870
+ var PD = globalThis.process.platform.startsWith("win");
871
+
872
+ // node_modules/.pnpm/@clack+prompts@0.7.0/node_modules/@clack/prompts/dist/index.mjs
873
+ var import_picocolors2 = __toESM(require_picocolors(), 1);
874
+ var import_sisteransi2 = __toESM(require_src(), 1);
875
+ import h from "node:process";
876
+ function q2() {
877
+ return h.platform !== "win32" ? h.env.TERM !== "linux" : Boolean(h.env.CI) || Boolean(h.env.WT_SESSION) || Boolean(h.env.TERMINUS_SUBLIME) || h.env.ConEmuTask === "{cmd::Cmder}" || h.env.TERM_PROGRAM === "Terminus-Sublime" || h.env.TERM_PROGRAM === "vscode" || h.env.TERM === "xterm-256color" || h.env.TERM === "alacritty" || h.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
878
+ }
879
+ var _2 = q2();
880
+ var o = (r2, n) => _2 ? r2 : n;
881
+ var H = o("\u25C6", "*");
882
+ var I2 = o("\u25A0", "x");
883
+ var x2 = o("\u25B2", "x");
884
+ var S2 = o("\u25C7", "o");
885
+ var K2 = o("\u250C", "T");
886
+ var a2 = o("\u2502", "|");
887
+ var d2 = o("\u2514", "\u2014");
888
+ var b2 = o("\u25CF", ">");
889
+ var E = o("\u25CB", " ");
890
+ var C = o("\u25FB", "[\u2022]");
891
+ var w2 = o("\u25FC", "[+]");
892
+ var M2 = o("\u25FB", "[ ]");
893
+ var U2 = o("\u25AA", "\u2022");
894
+ var B = o("\u2500", "-");
895
+ var Z2 = o("\u256E", "+");
896
+ var z2 = o("\u251C", "+");
897
+ var X2 = o("\u256F", "+");
898
+ var J2 = o("\u25CF", "\u2022");
899
+ var Y = o("\u25C6", "*");
900
+ var Q2 = o("\u25B2", "!");
901
+ var ee = o("\u25A0", "x");
902
+ var y2 = (r2) => {
903
+ switch (r2) {
904
+ case "initial":
905
+ case "active":
906
+ return import_picocolors2.default.cyan(H);
907
+ case "cancel":
908
+ return import_picocolors2.default.red(I2);
909
+ case "error":
910
+ return import_picocolors2.default.yellow(x2);
911
+ case "submit":
912
+ return import_picocolors2.default.green(S2);
913
+ }
914
+ };
915
+ var te = (r2) => new TD({ validate: r2.validate, placeholder: r2.placeholder, defaultValue: r2.defaultValue, initialValue: r2.initialValue, render() {
916
+ const n = `${import_picocolors2.default.gray(a2)}
917
+ ${y2(this.state)} ${r2.message}
918
+ `, i = r2.placeholder ? import_picocolors2.default.inverse(r2.placeholder[0]) + import_picocolors2.default.dim(r2.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")), t = this.value ? this.valueWithCursor : i;
919
+ switch (this.state) {
920
+ case "error":
921
+ return `${n.trim()}
922
+ ${import_picocolors2.default.yellow(a2)} ${t}
923
+ ${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(this.error)}
924
+ `;
925
+ case "submit":
926
+ return `${n}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.dim(this.value || r2.placeholder)}`;
927
+ case "cancel":
928
+ return `${n}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(this.value ?? ""))}${this.value?.trim() ? `
929
+ ` + import_picocolors2.default.gray(a2) : ""}`;
930
+ default:
931
+ return `${n}${import_picocolors2.default.cyan(a2)} ${t}
932
+ ${import_picocolors2.default.cyan(d2)}
933
+ `;
934
+ }
935
+ } }).prompt();
936
+ var ie = (r2) => {
937
+ const n = (t, s) => {
938
+ const c2 = t.label ?? String(t.value);
939
+ return s === "active" ? `${import_picocolors2.default.green(b2)} ${c2} ${t.hint ? import_picocolors2.default.dim(`(${t.hint})`) : ""}` : s === "selected" ? `${import_picocolors2.default.dim(c2)}` : s === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(c2))}` : `${import_picocolors2.default.dim(E)} ${import_picocolors2.default.dim(c2)}`;
940
+ };
941
+ let i = 0;
942
+ return new yD({ options: r2.options, initialValue: r2.initialValue, render() {
943
+ const t = `${import_picocolors2.default.gray(a2)}
944
+ ${y2(this.state)} ${r2.message}
945
+ `;
946
+ switch (this.state) {
947
+ case "submit":
948
+ return `${t}${import_picocolors2.default.gray(a2)} ${n(this.options[this.cursor], "selected")}`;
949
+ case "cancel":
950
+ return `${t}${import_picocolors2.default.gray(a2)} ${n(this.options[this.cursor], "cancelled")}
951
+ ${import_picocolors2.default.gray(a2)}`;
952
+ default: {
953
+ const s = r2.maxItems === void 0 ? 1 / 0 : Math.max(r2.maxItems, 5);
954
+ this.cursor >= i + s - 3 ? i = Math.max(Math.min(this.cursor - s + 3, this.options.length - s), 0) : this.cursor < i + 2 && (i = Math.max(this.cursor - 2, 0));
955
+ const c2 = s < this.options.length && i > 0, l2 = s < this.options.length && i + s < this.options.length;
956
+ return `${t}${import_picocolors2.default.cyan(a2)} ${this.options.slice(i, i + s).map((u, m2, $2) => m2 === 0 && c2 ? import_picocolors2.default.dim("...") : m2 === $2.length - 1 && l2 ? import_picocolors2.default.dim("...") : n(u, m2 + i === this.cursor ? "active" : "inactive")).join(`
957
+ ${import_picocolors2.default.cyan(a2)} `)}
958
+ ${import_picocolors2.default.cyan(d2)}
959
+ `;
960
+ }
961
+ }
962
+ } }).prompt();
963
+ };
964
+ var ae = (r2) => {
965
+ const n = (i, t) => {
966
+ const s = i.label ?? String(i.value);
967
+ return t === "active" ? `${import_picocolors2.default.cyan(C)} ${s} ${i.hint ? import_picocolors2.default.dim(`(${i.hint})`) : ""}` : t === "selected" ? `${import_picocolors2.default.green(w2)} ${import_picocolors2.default.dim(s)}` : t === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}` : t === "active-selected" ? `${import_picocolors2.default.green(w2)} ${s} ${i.hint ? import_picocolors2.default.dim(`(${i.hint})`) : ""}` : t === "submitted" ? `${import_picocolors2.default.dim(s)}` : `${import_picocolors2.default.dim(M2)} ${import_picocolors2.default.dim(s)}`;
968
+ };
969
+ return new gD({ options: r2.options, initialValues: r2.initialValues, required: r2.required ?? true, cursorAt: r2.cursorAt, validate(i) {
970
+ if (this.required && i.length === 0) return `Please select at least one option.
971
+ ${import_picocolors2.default.reset(import_picocolors2.default.dim(`Press ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" space ")))} to select, ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" enter ")))} to submit`))}`;
972
+ }, render() {
973
+ let i = `${import_picocolors2.default.gray(a2)}
974
+ ${y2(this.state)} ${r2.message}
975
+ `;
976
+ switch (this.state) {
977
+ case "submit":
978
+ return `${i}${import_picocolors2.default.gray(a2)} ${this.options.filter(({ value: t }) => this.value.includes(t)).map((t) => n(t, "submitted")).join(import_picocolors2.default.dim(", ")) || import_picocolors2.default.dim("none")}`;
979
+ case "cancel": {
980
+ const t = this.options.filter(({ value: s }) => this.value.includes(s)).map((s) => n(s, "cancelled")).join(import_picocolors2.default.dim(", "));
981
+ return `${i}${import_picocolors2.default.gray(a2)} ${t.trim() ? `${t}
982
+ ${import_picocolors2.default.gray(a2)}` : ""}`;
983
+ }
984
+ case "error": {
985
+ const t = this.error.split(`
986
+ `).map((s, c2) => c2 === 0 ? `${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(s)}` : ` ${s}`).join(`
987
+ `);
988
+ return i + import_picocolors2.default.yellow(a2) + " " + this.options.map((s, c2) => {
989
+ const l2 = this.value.includes(s.value), u = c2 === this.cursor;
990
+ return u && l2 ? n(s, "active-selected") : l2 ? n(s, "selected") : n(s, u ? "active" : "inactive");
991
+ }).join(`
992
+ ${import_picocolors2.default.yellow(a2)} `) + `
993
+ ` + t + `
994
+ `;
995
+ }
996
+ default:
997
+ return `${i}${import_picocolors2.default.cyan(a2)} ${this.options.map((t, s) => {
998
+ const c2 = this.value.includes(t.value), l2 = s === this.cursor;
999
+ return l2 && c2 ? n(t, "active-selected") : c2 ? n(t, "selected") : n(t, l2 ? "active" : "inactive");
1000
+ }).join(`
1001
+ ${import_picocolors2.default.cyan(a2)} `)}
1002
+ ${import_picocolors2.default.cyan(d2)}
1003
+ `;
1004
+ }
1005
+ } }).prompt();
1006
+ };
1007
+ var R2 = (r2) => r2.replace(me(), "");
1008
+ var le = (r2 = "", n = "") => {
1009
+ const i = `
1010
+ ${r2}
1011
+ `.split(`
1012
+ `), t = R2(n).length, s = Math.max(i.reduce((l2, u) => (u = R2(u), u.length > l2 ? u.length : l2), 0), t) + 2, c2 = i.map((l2) => `${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.dim(l2)}${" ".repeat(s - R2(l2).length)}${import_picocolors2.default.gray(a2)}`).join(`
1013
+ `);
1014
+ process.stdout.write(`${import_picocolors2.default.gray(a2)}
1015
+ ${import_picocolors2.default.green(S2)} ${import_picocolors2.default.reset(n)} ${import_picocolors2.default.gray(B.repeat(Math.max(s - t - 1, 1)) + Z2)}
1016
+ ${c2}
1017
+ ${import_picocolors2.default.gray(z2 + B.repeat(s + 2) + X2)}
1018
+ `);
1019
+ };
1020
+ var ue = (r2 = "") => {
1021
+ process.stdout.write(`${import_picocolors2.default.gray(d2)} ${import_picocolors2.default.red(r2)}
1022
+
1023
+ `);
1024
+ };
1025
+ var $e = (r2 = "") => {
1026
+ process.stdout.write(`${import_picocolors2.default.gray(a2)}
1027
+ ${import_picocolors2.default.gray(d2)} ${r2}
1028
+
1029
+ `);
1030
+ };
1031
+ function me() {
1032
+ const r2 = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
1033
+ return new RegExp(r2, "g");
1034
+ }
1035
+
1036
+ // src/index.ts
1037
+ var import_deepmerge = __toESM(require_cjs(), 1);
1038
+ var import_minimist = __toESM(require_minimist(), 1);
1039
+
1040
+ // node_modules/.pnpm/rslog@1.2.2/node_modules/rslog/dist/index.mjs
1041
+ init_esm_shims();
1042
+ import process2 from "process";
1043
+ import os from "os";
1044
+ import tty from "tty";
1045
+ function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
1046
+ const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
1047
+ const position = argv.indexOf(prefix + flag);
1048
+ const terminatorPosition = argv.indexOf("--");
1049
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
1050
+ }
1051
+ var { env } = process2;
1052
+ var flagForceColor;
1053
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
1054
+ flagForceColor = 0;
1055
+ } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
1056
+ flagForceColor = 1;
1057
+ }
1058
+ function envForceColor() {
1059
+ if ("FORCE_COLOR" in env) {
1060
+ if (env.FORCE_COLOR === "true") {
1061
+ return 1;
1062
+ }
1063
+ if (env.FORCE_COLOR === "false") {
1064
+ return 0;
1065
+ }
1066
+ return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
1067
+ }
1068
+ }
1069
+ function translateLevel(level) {
1070
+ if (level === 0) {
1071
+ return false;
1072
+ }
1073
+ return {
1074
+ level,
1075
+ hasBasic: true,
1076
+ has256: level >= 2,
1077
+ has16m: level >= 3
1078
+ };
1079
+ }
1080
+ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
1081
+ const noFlagForceColor = envForceColor();
1082
+ if (noFlagForceColor !== void 0) {
1083
+ flagForceColor = noFlagForceColor;
1084
+ }
1085
+ const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
1086
+ if (forceColor === 0) {
1087
+ return 0;
1088
+ }
1089
+ if (sniffFlags) {
1090
+ if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
1091
+ return 3;
1092
+ }
1093
+ if (hasFlag("color=256")) {
1094
+ return 2;
1095
+ }
1096
+ }
1097
+ if ("TF_BUILD" in env && "AGENT_NAME" in env) {
1098
+ return 1;
1099
+ }
1100
+ if (haveStream && !streamIsTTY && forceColor === void 0) {
1101
+ return 0;
1102
+ }
1103
+ const min = forceColor || 0;
1104
+ if (env.TERM === "dumb") {
1105
+ return min;
1106
+ }
1107
+ if (process2.platform === "win32") {
1108
+ const osRelease = os.release().split(".");
1109
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
1110
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
1111
+ }
1112
+ return 1;
1113
+ }
1114
+ if ("CI" in env) {
1115
+ if ("GITHUB_ACTIONS" in env || "GITEA_ACTIONS" in env) {
1116
+ return 3;
1117
+ }
1118
+ if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
1119
+ return 1;
1120
+ }
1121
+ return min;
1122
+ }
1123
+ if ("TEAMCITY_VERSION" in env) {
1124
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
1125
+ }
1126
+ if (env.COLORTERM === "truecolor") {
1127
+ return 3;
1128
+ }
1129
+ if (env.TERM === "xterm-kitty") {
1130
+ return 3;
1131
+ }
1132
+ if ("TERM_PROGRAM" in env) {
1133
+ const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
1134
+ switch (env.TERM_PROGRAM) {
1135
+ case "iTerm.app": {
1136
+ return version >= 3 ? 3 : 2;
1137
+ }
1138
+ case "Apple_Terminal": {
1139
+ return 2;
1140
+ }
1141
+ }
1142
+ }
1143
+ if (/-256(color)?$/i.test(env.TERM)) {
1144
+ return 2;
1145
+ }
1146
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
1147
+ return 1;
1148
+ }
1149
+ if ("COLORTERM" in env) {
1150
+ return 1;
1151
+ }
1152
+ return min;
1153
+ }
1154
+ function createSupportsColor(stream, options = {}) {
1155
+ const level = _supportsColor(stream, {
1156
+ streamIsTTY: stream && stream.isTTY,
1157
+ ...options
1158
+ });
1159
+ return translateLevel(level);
1160
+ }
1161
+ var supportsColor = {
1162
+ stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
1163
+ stderr: createSupportsColor({ isTTY: tty.isatty(2) })
1164
+ };
1165
+ var supports_color_default = supportsColor;
1166
+ var colorLevel = supports_color_default.stdout ? supports_color_default.stdout.level : 0;
1167
+ var errorStackRegExp = /at\s.*:\d+:\d+[\s\)]*$/;
1168
+ var anonymousErrorStackRegExp = /^\s*at\s.*\(<anonymous>\)$/;
1169
+ var isErrorStackMessage = (message) => errorStackRegExp.test(message) || anonymousErrorStackRegExp.test(message);
1170
+ var formatter = (open, close, replace = open) => colorLevel >= 2 ? (input) => {
1171
+ let string = "" + input;
1172
+ let index = string.indexOf(close, open.length);
1173
+ return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
1174
+ } : String;
1175
+ var replaceClose = (string, close, replace, index) => {
1176
+ let start = string.substring(0, index) + replace;
1177
+ let end = string.substring(index + close.length);
1178
+ let nextIndex = end.indexOf(close);
1179
+ return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end;
1180
+ };
1181
+ var bold = formatter("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m");
1182
+ var red = formatter("\x1B[31m", "\x1B[39m");
1183
+ var green = formatter("\x1B[32m", "\x1B[39m");
1184
+ var yellow = formatter("\x1B[33m", "\x1B[39m");
1185
+ var magenta = formatter("\x1B[35m", "\x1B[39m");
1186
+ var cyan = formatter("\x1B[36m", "\x1B[39m");
1187
+ var gray = formatter("\x1B[90m", "\x1B[39m");
1188
+ var startColor = [189, 255, 243];
1189
+ var endColor = [74, 194, 154];
1190
+ var isWord = (char) => !/[\s\n]/.test(char);
1191
+ var gradient = (message) => {
1192
+ if (colorLevel < 3) {
1193
+ return colorLevel === 2 ? bold(cyan(message)) : message;
1194
+ }
1195
+ let chars = [...message];
1196
+ let steps = chars.filter(isWord).length;
1197
+ let r2 = startColor[0];
1198
+ let g2 = startColor[1];
1199
+ let b3 = startColor[2];
1200
+ let rStep = (endColor[0] - r2) / steps;
1201
+ let gStep = (endColor[1] - g2) / steps;
1202
+ let bStep = (endColor[2] - b3) / steps;
1203
+ let output = "";
1204
+ for (let char of chars) {
1205
+ if (isWord(char)) {
1206
+ r2 += rStep;
1207
+ g2 += gStep;
1208
+ b3 += bStep;
1209
+ }
1210
+ output += `\x1B[38;2;${Math.round(r2)};${Math.round(g2)};${Math.round(
1211
+ b3
1212
+ )}m${char}\x1B[39m`;
1213
+ }
1214
+ return bold(output);
1215
+ };
1216
+ var LOG_LEVEL = {
1217
+ error: 0,
1218
+ warn: 1,
1219
+ info: 2,
1220
+ log: 3,
1221
+ verbose: 4
1222
+ };
1223
+ var LOG_TYPES = {
1224
+ // Level error
1225
+ error: {
1226
+ label: "error",
1227
+ level: "error",
1228
+ color: red
1229
+ },
1230
+ // Level warn
1231
+ warn: {
1232
+ label: "warn",
1233
+ level: "warn",
1234
+ color: yellow
1235
+ },
1236
+ // Level info
1237
+ info: {
1238
+ label: "info",
1239
+ level: "info",
1240
+ color: cyan
1241
+ },
1242
+ start: {
1243
+ label: "start",
1244
+ level: "info",
1245
+ color: cyan
1246
+ },
1247
+ ready: {
1248
+ label: "ready",
1249
+ level: "info",
1250
+ color: green
1251
+ },
1252
+ success: {
1253
+ label: "success",
1254
+ level: "info",
1255
+ color: green
1256
+ },
1257
+ // Level log
1258
+ log: {
1259
+ level: "log"
1260
+ },
1261
+ // Level debug
1262
+ debug: {
1263
+ label: "debug",
1264
+ level: "verbose",
1265
+ color: magenta
1266
+ }
1267
+ };
1268
+ var createLogger = (options = {}) => {
1269
+ let maxLevel = options.level || "log";
1270
+ let log = (type, message, ...args) => {
1271
+ if (LOG_LEVEL[LOG_TYPES[type].level] > LOG_LEVEL[maxLevel]) {
1272
+ return;
1273
+ }
1274
+ if (message === void 0 || message === null) {
1275
+ return console.log();
1276
+ }
1277
+ let logType = LOG_TYPES[type];
1278
+ let label = "";
1279
+ let text = "";
1280
+ if ("label" in logType) {
1281
+ label = (logType.label || "").padEnd(7);
1282
+ label = bold(logType.color ? logType.color(label) : label);
1283
+ }
1284
+ if (message instanceof Error) {
1285
+ if (message.stack) {
1286
+ let [name, ...rest] = message.stack.split("\n");
1287
+ if (name.startsWith("Error: ")) {
1288
+ name = name.slice(7);
1289
+ }
1290
+ text = `${name}
1291
+ ${gray(rest.join("\n"))}`;
1292
+ } else {
1293
+ text = message.message;
1294
+ }
1295
+ } else if (logType.level === "error" && typeof message === "string") {
1296
+ let lines = message.split("\n");
1297
+ text = lines.map((line) => isErrorStackMessage(line) ? gray(line) : line).join("\n");
1298
+ } else {
1299
+ text = `${message}`;
1300
+ }
1301
+ console.log(label.length ? `${label} ${text}` : text, ...args);
1302
+ };
1303
+ let logger2 = {
1304
+ greet: (message) => log("log", gradient(message))
1305
+ };
1306
+ Object.keys(LOG_TYPES).forEach((key) => {
1307
+ logger2[key] = (...args) => log(key, ...args);
1308
+ });
1309
+ Object.defineProperty(logger2, "level", {
1310
+ get: () => maxLevel,
1311
+ set(val) {
1312
+ maxLevel = val;
1313
+ }
1314
+ });
1315
+ logger2.override = (customLogger) => {
1316
+ Object.assign(logger2, customLogger);
1317
+ };
1318
+ return logger2;
1319
+ };
1320
+ var logger = createLogger();
1321
+
1322
+ // src/index.ts
1323
+ function cancelAndExit() {
1324
+ ue("Operation cancelled.");
1325
+ process.exit(0);
1326
+ }
1327
+ function checkCancel(value) {
1328
+ if (hD(value)) {
1329
+ cancelAndExit();
1330
+ }
1331
+ return value;
1332
+ }
1333
+ function formatProjectName(input) {
1334
+ const formatted = input.trim().replace(/\/+$/g, "");
1335
+ return {
1336
+ packageName: formatted.startsWith("@") ? formatted : path2.basename(formatted),
1337
+ targetDir: formatted
1338
+ };
1339
+ }
1340
+ function pkgFromUserAgent(userAgent) {
1341
+ if (!userAgent) return void 0;
1342
+ const pkgSpec = userAgent.split(" ")[0];
1343
+ const pkgSpecArr = pkgSpec.split("/");
1344
+ return {
1345
+ name: pkgSpecArr[0],
1346
+ version: pkgSpecArr[1]
1347
+ };
1348
+ }
1349
+ function isEmptyDir(path3) {
1350
+ const files = fs.readdirSync(path3);
1351
+ return files.length === 0 || files.length === 1 && files[0] === ".git";
1352
+ }
1353
+ function logHelpMessage(name, templates) {
1354
+ logger.log(`
1355
+ Usage: create-${name} [options]
1356
+
1357
+ Options:
1358
+
1359
+ -h, --help display help for command
1360
+ -d, --dir create project in specified directory
1361
+ -t, --template specify the template to use
1362
+ --tools select additional tools (biome, eslint, prettier)
1363
+ --override override files in target directory
1364
+
1365
+ Templates:
1366
+
1367
+ ${templates.join(", ")}
1368
+ `);
1369
+ }
1370
+ async function getTools({ tools, dir, template }) {
1371
+ if (tools) {
1372
+ return Array.isArray(tools) ? tools : [tools];
1373
+ }
1374
+ if (dir && template) {
1375
+ return [];
1376
+ }
1377
+ return checkCancel(
1378
+ await ae({
1379
+ message: "Select additional tools (Use <space> to select, <enter> to continue)",
1380
+ options: [
1381
+ { value: "biome", label: "Add Biome for code linting and formatting" },
1382
+ { value: "eslint", label: "Add ESLint for code linting" },
1383
+ { value: "prettier", label: "Add Prettier for code formatting" }
1384
+ ],
1385
+ required: false
1386
+ })
1387
+ );
1388
+ }
1389
+ function upperFirst(str) {
1390
+ return str.charAt(0).toUpperCase() + str.slice(1);
1391
+ }
1392
+ async function create({
1393
+ name,
1394
+ root,
1395
+ templates,
1396
+ getTemplateName,
1397
+ mapESLintTemplate
1398
+ }) {
1399
+ const argv = (0, import_minimist.default)(process.argv.slice(2), {
1400
+ alias: { h: "help", d: "dir", t: "template" }
1401
+ });
1402
+ console.log("");
1403
+ logger.greet(`\u25C6 Create ${upperFirst(name)} Project`);
1404
+ if (argv.help) {
1405
+ logHelpMessage(name, templates);
1406
+ return;
1407
+ }
1408
+ const cwd = process.cwd();
1409
+ const pkgInfo = pkgFromUserAgent(process.env.npm_config_user_agent);
1410
+ const pkgManager = pkgInfo ? pkgInfo.name : "npm";
1411
+ const packageJsonPath = path2.join(root, "package.json");
1412
+ const { version } = __require(packageJsonPath);
1413
+ const projectName = argv.dir ?? checkCancel(
1414
+ await te({
1415
+ message: "Project name or path",
1416
+ placeholder: `${name}-project`,
1417
+ defaultValue: `${name}-project`,
1418
+ validate(value) {
1419
+ if (value.length === 0) {
1420
+ return "Project name is required";
1421
+ }
1422
+ }
1423
+ })
1424
+ );
1425
+ const { targetDir, packageName } = formatProjectName(projectName);
1426
+ const distFolder = path2.isAbsolute(targetDir) ? targetDir : path2.join(cwd, targetDir);
1427
+ if (!argv.override && fs.existsSync(distFolder) && !isEmptyDir(distFolder)) {
1428
+ const option = checkCancel(
1429
+ await ie({
1430
+ message: `"${targetDir}" is not empty, please choose:`,
1431
+ options: [
1432
+ { value: "yes", label: "Continue and override files" },
1433
+ { value: "no", label: "Cancel operation" }
1434
+ ]
1435
+ })
1436
+ );
1437
+ if (option === "no") {
1438
+ cancelAndExit();
1439
+ }
1440
+ }
1441
+ const templateName = await getTemplateName(argv);
1442
+ const tools = await getTools(argv);
1443
+ const srcFolder = path2.join(root, `template-${templateName}`);
1444
+ const commonFolder = path2.join(root, "template-common");
1445
+ if (!fs.existsSync(srcFolder)) {
1446
+ throw new Error(`Invalid input: template "${templateName}" not found.`);
1447
+ }
1448
+ copyFolder({
1449
+ from: commonFolder,
1450
+ to: distFolder,
1451
+ version
1452
+ });
1453
+ copyFolder({
1454
+ from: srcFolder,
1455
+ to: distFolder,
1456
+ version,
1457
+ packageName
1458
+ });
1459
+ const packageRoot = path2.resolve(__dirname, "..");
1460
+ for (const tool of tools) {
1461
+ const toolFolder = path2.join(packageRoot, `template-${tool}`);
1462
+ if (tool === "eslint") {
1463
+ const eslintTemplateName = mapESLintTemplate(templateName);
1464
+ if (!eslintTemplateName) {
1465
+ continue;
1466
+ }
1467
+ let subFolder = path2.join(toolFolder, eslintTemplateName);
1468
+ copyFolder({
1469
+ from: subFolder,
1470
+ to: distFolder,
1471
+ version,
1472
+ isMergePackageJson: true
1473
+ });
1474
+ } else {
1475
+ copyFolder({
1476
+ from: toolFolder,
1477
+ to: distFolder,
1478
+ version,
1479
+ isMergePackageJson: true
1480
+ });
1481
+ }
1482
+ }
1483
+ const nextSteps = [
1484
+ `cd ${targetDir}`,
1485
+ `${pkgManager} i`,
1486
+ `${pkgManager} run dev`
1487
+ ];
1488
+ le(nextSteps.join("\n"), "Next steps");
1489
+ $e("Done.");
1490
+ }
1491
+ function sortObjectKeys(obj) {
1492
+ const sortedKeys = Object.keys(obj).sort();
1493
+ const sortedObj = {};
1494
+ for (const key of sortedKeys) {
1495
+ sortedObj[key] = obj[key];
1496
+ }
1497
+ return sortedObj;
1498
+ }
1499
+ function mergePackageJson(targetPackage, extraPackage) {
1500
+ if (!fs.existsSync(targetPackage)) {
1501
+ return;
1502
+ }
1503
+ const targetJson = JSON.parse(fs.readFileSync(targetPackage, "utf-8"));
1504
+ const extraJson = JSON.parse(fs.readFileSync(extraPackage, "utf-8"));
1505
+ const mergedJson = (0, import_deepmerge.default)(targetJson, extraJson);
1506
+ mergedJson.name = targetJson.name || extraJson.name;
1507
+ for (const key of ["scripts", "dependencies", "devDependencies"]) {
1508
+ if (!(key in mergedJson)) {
1509
+ continue;
1510
+ }
1511
+ mergedJson[key] = sortObjectKeys(
1512
+ mergedJson[key]
1513
+ );
1514
+ }
1515
+ fs.writeFileSync(targetPackage, `${JSON.stringify(mergedJson, null, 2)}
1516
+ `);
1517
+ }
1518
+ function copyFolder({
1519
+ from,
1520
+ to,
1521
+ version,
1522
+ packageName,
1523
+ isMergePackageJson
1524
+ }) {
1525
+ const renameFiles = {
1526
+ gitignore: ".gitignore"
1527
+ };
1528
+ const skipFiles = ["node_modules", "dist"];
1529
+ fs.mkdirSync(to, { recursive: true });
1530
+ for (const file of fs.readdirSync(from)) {
1531
+ if (skipFiles.includes(file)) {
1532
+ continue;
1533
+ }
1534
+ const srcFile = path2.resolve(from, file);
1535
+ const distFile = renameFiles[file] ? path2.resolve(to, renameFiles[file]) : path2.resolve(to, file);
1536
+ const stat = fs.statSync(srcFile);
1537
+ if (stat.isDirectory()) {
1538
+ copyFolder({
1539
+ from: srcFile,
1540
+ to: distFile,
1541
+ version
1542
+ });
1543
+ } else if (file === "package.json") {
1544
+ const targetPackage = path2.resolve(to, "package.json");
1545
+ if (isMergePackageJson && fs.existsSync(targetPackage)) {
1546
+ mergePackageJson(targetPackage, srcFile);
1547
+ } else {
1548
+ fs.copyFileSync(srcFile, distFile);
1549
+ updatePackageJson(distFile, version, packageName);
1550
+ }
1551
+ } else {
1552
+ fs.copyFileSync(srcFile, distFile);
1553
+ }
1554
+ }
1555
+ }
1556
+ var isStableVersion = (version) => {
1557
+ return ["alpha", "beta", "rc", "canary", "nightly"].every(
1558
+ (tag) => !version.includes(tag)
1559
+ );
1560
+ };
1561
+ var updatePackageJson = (pkgJsonPath, version, name) => {
1562
+ let content = fs.readFileSync(pkgJsonPath, "utf-8");
1563
+ const targetVersion = isStableVersion(version) ? `^${version}` : version;
1564
+ content = content.replace(/workspace:\*/g, targetVersion);
1565
+ const pkg = JSON.parse(content);
1566
+ if (name && name !== ".") {
1567
+ pkg.name = name;
1568
+ }
1569
+ fs.writeFileSync(pkgJsonPath, JSON.stringify(pkg, null, 2));
1570
+ };
1571
+ export {
1572
+ checkCancel,
1573
+ create,
1574
+ ae as multiselect,
1575
+ ie as select,
1576
+ te as text
1577
+ };