create-sammi-next 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.
- package/dist/index.js +1118 -0
- package/index.js +3 -0
- package/package.json +44 -0
- package/template-minimal-js/README.md +15 -0
- package/template-minimal-js/_gitignore +1 -0
- package/template-minimal-js/eslint.config.mjs +76 -0
- package/template-minimal-js/package.json +20 -0
- package/template-minimal-js/sammi.config.js +9 -0
- package/template-minimal-js/src/script.js +5 -0
- package/template-minimal-ts/README.md +15 -0
- package/template-minimal-ts/_gitignore +1 -0
- package/template-minimal-ts/eslint.config.mjs +88 -0
- package/template-minimal-ts/package.json +21 -0
- package/template-minimal-ts/sammi.config.ts +9 -0
- package/template-minimal-ts/src/script.ts +5 -0
- package/template-minimal-ts/tsconfig.json +26 -0
- package/template-sample-js/README.md +15 -0
- package/template-sample-js/_gitignore +1 -0
- package/template-sample-js/eslint.config.mjs +76 -0
- package/template-sample-js/package.json +20 -0
- package/template-sample-js/sammi.config.js +16 -0
- package/template-sample-js/src/external.html +47 -0
- package/template-sample-js/src/over.json +1 -0
- package/template-sample-js/src/script.js +64 -0
- package/template-sample-js/src/utils/utils.js +3 -0
- package/template-sample-ts/README.md +15 -0
- package/template-sample-ts/_gitignore +1 -0
- package/template-sample-ts/eslint.config.mjs +88 -0
- package/template-sample-ts/package.json +21 -0
- package/template-sample-ts/sammi.config.ts +16 -0
- package/template-sample-ts/src/external.html +47 -0
- package/template-sample-ts/src/over.json +1 -0
- package/template-sample-ts/src/script.ts +63 -0
- package/template-sample-ts/src/utils/utils.ts +3 -0
- package/template-sample-ts/tsconfig.json +26 -0
- package/template-vanilla-js/README.md +15 -0
- package/template-vanilla-js/_gitignore +1 -0
- package/template-vanilla-js/eslint.config.mjs +76 -0
- package/template-vanilla-js/package.json +20 -0
- package/template-vanilla-js/sammi.config.js +16 -0
- package/template-vanilla-js/src/external.html +0 -0
- package/template-vanilla-js/src/over.json +1 -0
- package/template-vanilla-js/src/script.js +16 -0
- package/template-vanilla-ts/README.md +15 -0
- package/template-vanilla-ts/_gitignore +1 -0
- package/template-vanilla-ts/eslint.config.mjs +88 -0
- package/template-vanilla-ts/package.json +21 -0
- package/template-vanilla-ts/sammi.config.ts +16 -0
- package/template-vanilla-ts/src/external.html +0 -0
- package/template-vanilla-ts/src/over.json +0 -0
- package/template-vanilla-ts/src/script.ts +16 -0
- package/template-vanilla-ts/tsconfig.json +26 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1118 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { stripVTControlCharacters } from "node:util";
|
|
4
|
+
import y, { stdin, stdout } from "node:process";
|
|
5
|
+
import * as g from "node:readline";
|
|
6
|
+
import O from "node:readline";
|
|
7
|
+
import { Writable } from "node:stream";
|
|
8
|
+
import { fileURLToPath } from "node:url";
|
|
9
|
+
var __create = Object.create;
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
14
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
15
|
+
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
16
|
+
var __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
18
|
+
key = keys[i];
|
|
19
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
20
|
+
get: ((k$2) => from[k$2]).bind(null, key),
|
|
21
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
27
|
+
value: mod,
|
|
28
|
+
enumerable: true
|
|
29
|
+
}) : target, mod));
|
|
30
|
+
var require_lib = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
31
|
+
function toArr(any) {
|
|
32
|
+
return any == null ? [] : Array.isArray(any) ? any : [any];
|
|
33
|
+
}
|
|
34
|
+
function toVal(out, key, val, opts) {
|
|
35
|
+
var x$2, old = out[key], nxt = !!~opts.string.indexOf(key) ? val == null || val === true ? "" : String(val) : typeof val === "boolean" ? val : !!~opts.boolean.indexOf(key) ? val === "false" ? false : val === "true" || (out._.push((x$2 = +val, x$2 * 0 === 0) ? x$2 : val), !!val) : (x$2 = +val, x$2 * 0 === 0) ? x$2 : val;
|
|
36
|
+
out[key] = old == null ? nxt : Array.isArray(old) ? old.concat(nxt) : [old, nxt];
|
|
37
|
+
}
|
|
38
|
+
module.exports = function(args, opts) {
|
|
39
|
+
args = args || [];
|
|
40
|
+
opts = opts || {};
|
|
41
|
+
var k$2, arr, arg, name, val, out = { _: [] };
|
|
42
|
+
var i = 0, j = 0, idx = 0, len = args.length;
|
|
43
|
+
const alibi = opts.alias !== void 0;
|
|
44
|
+
const strict = opts.unknown !== void 0;
|
|
45
|
+
const defaults = opts.default !== void 0;
|
|
46
|
+
opts.alias = opts.alias || {};
|
|
47
|
+
opts.string = toArr(opts.string);
|
|
48
|
+
opts.boolean = toArr(opts.boolean);
|
|
49
|
+
if (alibi) for (k$2 in opts.alias) {
|
|
50
|
+
arr = opts.alias[k$2] = toArr(opts.alias[k$2]);
|
|
51
|
+
for (i = 0; i < arr.length; i++) (opts.alias[arr[i]] = arr.concat(k$2)).splice(i, 1);
|
|
52
|
+
}
|
|
53
|
+
for (i = opts.boolean.length; i-- > 0;) {
|
|
54
|
+
arr = opts.alias[opts.boolean[i]] || [];
|
|
55
|
+
for (j = arr.length; j-- > 0;) opts.boolean.push(arr[j]);
|
|
56
|
+
}
|
|
57
|
+
for (i = opts.string.length; i-- > 0;) {
|
|
58
|
+
arr = opts.alias[opts.string[i]] || [];
|
|
59
|
+
for (j = arr.length; j-- > 0;) opts.string.push(arr[j]);
|
|
60
|
+
}
|
|
61
|
+
if (defaults) for (k$2 in opts.default) {
|
|
62
|
+
name = typeof opts.default[k$2];
|
|
63
|
+
arr = opts.alias[k$2] = opts.alias[k$2] || [];
|
|
64
|
+
if (opts[name] !== void 0) {
|
|
65
|
+
opts[name].push(k$2);
|
|
66
|
+
for (i = 0; i < arr.length; i++) opts[name].push(arr[i]);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const keys = strict ? Object.keys(opts.alias) : [];
|
|
70
|
+
for (i = 0; i < len; i++) {
|
|
71
|
+
arg = args[i];
|
|
72
|
+
if (arg === "--") {
|
|
73
|
+
out._ = out._.concat(args.slice(++i));
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
for (j = 0; j < arg.length; j++) if (arg.charCodeAt(j) !== 45) break;
|
|
77
|
+
if (j === 0) out._.push(arg);
|
|
78
|
+
else if (arg.substring(j, j + 3) === "no-") {
|
|
79
|
+
name = arg.substring(j + 3);
|
|
80
|
+
if (strict && !~keys.indexOf(name)) return opts.unknown(arg);
|
|
81
|
+
out[name] = false;
|
|
82
|
+
} else {
|
|
83
|
+
for (idx = j + 1; idx < arg.length; idx++) if (arg.charCodeAt(idx) === 61) break;
|
|
84
|
+
name = arg.substring(j, idx);
|
|
85
|
+
val = arg.substring(++idx) || i + 1 === len || ("" + args[i + 1]).charCodeAt(0) === 45 || args[++i];
|
|
86
|
+
arr = j === 2 ? [name] : name;
|
|
87
|
+
for (idx = 0; idx < arr.length; idx++) {
|
|
88
|
+
name = arr[idx];
|
|
89
|
+
if (strict && !~keys.indexOf(name)) return opts.unknown("-".repeat(j) + name);
|
|
90
|
+
toVal(out, name, idx + 1 < arr.length || val, opts);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (defaults) {
|
|
95
|
+
for (k$2 in opts.default) if (out[k$2] === void 0) out[k$2] = opts.default[k$2];
|
|
96
|
+
}
|
|
97
|
+
if (alibi) for (k$2 in out) {
|
|
98
|
+
arr = opts.alias[k$2] || [];
|
|
99
|
+
while (arr.length > 0) out[arr.shift()] = out[k$2];
|
|
100
|
+
}
|
|
101
|
+
return out;
|
|
102
|
+
};
|
|
103
|
+
}));
|
|
104
|
+
var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
105
|
+
const ESC = "\x1B";
|
|
106
|
+
const CSI = `${ESC}[`;
|
|
107
|
+
const beep = "\x07";
|
|
108
|
+
const cursor = {
|
|
109
|
+
to(x$2, y$2) {
|
|
110
|
+
if (!y$2) return `${CSI}${x$2 + 1}G`;
|
|
111
|
+
return `${CSI}${y$2 + 1};${x$2 + 1}H`;
|
|
112
|
+
},
|
|
113
|
+
move(x$2, y$2) {
|
|
114
|
+
let ret = "";
|
|
115
|
+
if (x$2 < 0) ret += `${CSI}${-x$2}D`;
|
|
116
|
+
else if (x$2 > 0) ret += `${CSI}${x$2}C`;
|
|
117
|
+
if (y$2 < 0) ret += `${CSI}${-y$2}A`;
|
|
118
|
+
else if (y$2 > 0) ret += `${CSI}${y$2}B`;
|
|
119
|
+
return ret;
|
|
120
|
+
},
|
|
121
|
+
up: (count = 1) => `${CSI}${count}A`,
|
|
122
|
+
down: (count = 1) => `${CSI}${count}B`,
|
|
123
|
+
forward: (count = 1) => `${CSI}${count}C`,
|
|
124
|
+
backward: (count = 1) => `${CSI}${count}D`,
|
|
125
|
+
nextLine: (count = 1) => `${CSI}E`.repeat(count),
|
|
126
|
+
prevLine: (count = 1) => `${CSI}F`.repeat(count),
|
|
127
|
+
left: `${CSI}G`,
|
|
128
|
+
hide: `${CSI}?25l`,
|
|
129
|
+
show: `${CSI}?25h`,
|
|
130
|
+
save: `${ESC}7`,
|
|
131
|
+
restore: `${ESC}8`
|
|
132
|
+
};
|
|
133
|
+
module.exports = {
|
|
134
|
+
cursor,
|
|
135
|
+
scroll: {
|
|
136
|
+
up: (count = 1) => `${CSI}S`.repeat(count),
|
|
137
|
+
down: (count = 1) => `${CSI}T`.repeat(count)
|
|
138
|
+
},
|
|
139
|
+
erase: {
|
|
140
|
+
screen: `${CSI}2J`,
|
|
141
|
+
up: (count = 1) => `${CSI}1J`.repeat(count),
|
|
142
|
+
down: (count = 1) => `${CSI}J`.repeat(count),
|
|
143
|
+
line: `${CSI}2K`,
|
|
144
|
+
lineEnd: `${CSI}K`,
|
|
145
|
+
lineStart: `${CSI}1K`,
|
|
146
|
+
lines(count) {
|
|
147
|
+
let clear = "";
|
|
148
|
+
for (let i = 0; i < count; i++) clear += this.line + (i < count - 1 ? cursor.up() : "");
|
|
149
|
+
if (count) clear += cursor.left;
|
|
150
|
+
return clear;
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
beep
|
|
154
|
+
};
|
|
155
|
+
}));
|
|
156
|
+
var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
157
|
+
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
158
|
+
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
159
|
+
let formatter = (open, close, replace = open) => (input) => {
|
|
160
|
+
let string = "" + input, index = string.indexOf(close, open.length);
|
|
161
|
+
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
162
|
+
};
|
|
163
|
+
let replaceClose = (string, close, replace, index) => {
|
|
164
|
+
let result = "", cursor = 0;
|
|
165
|
+
do {
|
|
166
|
+
result += string.substring(cursor, index) + replace;
|
|
167
|
+
cursor = index + close.length;
|
|
168
|
+
index = string.indexOf(close, cursor);
|
|
169
|
+
} while (~index);
|
|
170
|
+
return result + string.substring(cursor);
|
|
171
|
+
};
|
|
172
|
+
let createColors = (enabled = isColorSupported) => {
|
|
173
|
+
let f = enabled ? formatter : () => String;
|
|
174
|
+
return {
|
|
175
|
+
isColorSupported: enabled,
|
|
176
|
+
reset: f("\x1B[0m", "\x1B[0m"),
|
|
177
|
+
bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
178
|
+
dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
179
|
+
italic: f("\x1B[3m", "\x1B[23m"),
|
|
180
|
+
underline: f("\x1B[4m", "\x1B[24m"),
|
|
181
|
+
inverse: f("\x1B[7m", "\x1B[27m"),
|
|
182
|
+
hidden: f("\x1B[8m", "\x1B[28m"),
|
|
183
|
+
strikethrough: f("\x1B[9m", "\x1B[29m"),
|
|
184
|
+
black: f("\x1B[30m", "\x1B[39m"),
|
|
185
|
+
red: f("\x1B[31m", "\x1B[39m"),
|
|
186
|
+
green: f("\x1B[32m", "\x1B[39m"),
|
|
187
|
+
yellow: f("\x1B[33m", "\x1B[39m"),
|
|
188
|
+
blue: f("\x1B[34m", "\x1B[39m"),
|
|
189
|
+
magenta: f("\x1B[35m", "\x1B[39m"),
|
|
190
|
+
cyan: f("\x1B[36m", "\x1B[39m"),
|
|
191
|
+
white: f("\x1B[37m", "\x1B[39m"),
|
|
192
|
+
gray: f("\x1B[90m", "\x1B[39m"),
|
|
193
|
+
bgBlack: f("\x1B[40m", "\x1B[49m"),
|
|
194
|
+
bgRed: f("\x1B[41m", "\x1B[49m"),
|
|
195
|
+
bgGreen: f("\x1B[42m", "\x1B[49m"),
|
|
196
|
+
bgYellow: f("\x1B[43m", "\x1B[49m"),
|
|
197
|
+
bgBlue: f("\x1B[44m", "\x1B[49m"),
|
|
198
|
+
bgMagenta: f("\x1B[45m", "\x1B[49m"),
|
|
199
|
+
bgCyan: f("\x1B[46m", "\x1B[49m"),
|
|
200
|
+
bgWhite: f("\x1B[47m", "\x1B[49m"),
|
|
201
|
+
blackBright: f("\x1B[90m", "\x1B[39m"),
|
|
202
|
+
redBright: f("\x1B[91m", "\x1B[39m"),
|
|
203
|
+
greenBright: f("\x1B[92m", "\x1B[39m"),
|
|
204
|
+
yellowBright: f("\x1B[93m", "\x1B[39m"),
|
|
205
|
+
blueBright: f("\x1B[94m", "\x1B[39m"),
|
|
206
|
+
magentaBright: f("\x1B[95m", "\x1B[39m"),
|
|
207
|
+
cyanBright: f("\x1B[96m", "\x1B[39m"),
|
|
208
|
+
whiteBright: f("\x1B[97m", "\x1B[39m"),
|
|
209
|
+
bgBlackBright: f("\x1B[100m", "\x1B[49m"),
|
|
210
|
+
bgRedBright: f("\x1B[101m", "\x1B[49m"),
|
|
211
|
+
bgGreenBright: f("\x1B[102m", "\x1B[49m"),
|
|
212
|
+
bgYellowBright: f("\x1B[103m", "\x1B[49m"),
|
|
213
|
+
bgBlueBright: f("\x1B[104m", "\x1B[49m"),
|
|
214
|
+
bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
|
|
215
|
+
bgCyanBright: f("\x1B[106m", "\x1B[49m"),
|
|
216
|
+
bgWhiteBright: f("\x1B[107m", "\x1B[49m")
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
module.exports = createColors();
|
|
220
|
+
module.exports.createColors = createColors;
|
|
221
|
+
}));
|
|
222
|
+
var import_lib = /* @__PURE__ */ __toESM(require_lib(), 1);
|
|
223
|
+
var import_src = require_src();
|
|
224
|
+
var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
225
|
+
function DD({ onlyFirst: e$1 = !1 } = {}) {
|
|
226
|
+
const t = ["[\\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("|");
|
|
227
|
+
return new RegExp(t, e$1 ? void 0 : "g");
|
|
228
|
+
}
|
|
229
|
+
const uD = DD();
|
|
230
|
+
function P$1(e$1) {
|
|
231
|
+
if (typeof e$1 != "string") throw new TypeError(`Expected a \`string\`, got \`${typeof e$1}\``);
|
|
232
|
+
return e$1.replace(uD, "");
|
|
233
|
+
}
|
|
234
|
+
function L$1(e$1) {
|
|
235
|
+
return e$1 && e$1.__esModule && Object.prototype.hasOwnProperty.call(e$1, "default") ? e$1.default : e$1;
|
|
236
|
+
}
|
|
237
|
+
var W$1 = { exports: {} };
|
|
238
|
+
(function(e$1) {
|
|
239
|
+
var u$1 = {};
|
|
240
|
+
e$1.exports = u$1, u$1.eastAsianWidth = function(F$1) {
|
|
241
|
+
var s = F$1.charCodeAt(0), i = F$1.length == 2 ? F$1.charCodeAt(1) : 0, D$1 = s;
|
|
242
|
+
return 55296 <= s && s <= 56319 && 56320 <= i && i <= 57343 && (s &= 1023, i &= 1023, D$1 = s << 10 | i, D$1 += 65536), D$1 == 12288 || 65281 <= D$1 && D$1 <= 65376 || 65504 <= D$1 && D$1 <= 65510 ? "F" : D$1 == 8361 || 65377 <= D$1 && D$1 <= 65470 || 65474 <= D$1 && D$1 <= 65479 || 65482 <= D$1 && D$1 <= 65487 || 65490 <= D$1 && D$1 <= 65495 || 65498 <= D$1 && D$1 <= 65500 || 65512 <= D$1 && D$1 <= 65518 ? "H" : 4352 <= D$1 && D$1 <= 4447 || 4515 <= D$1 && D$1 <= 4519 || 4602 <= D$1 && D$1 <= 4607 || 9001 <= D$1 && D$1 <= 9002 || 11904 <= D$1 && D$1 <= 11929 || 11931 <= D$1 && D$1 <= 12019 || 12032 <= D$1 && D$1 <= 12245 || 12272 <= D$1 && D$1 <= 12283 || 12289 <= D$1 && D$1 <= 12350 || 12353 <= D$1 && D$1 <= 12438 || 12441 <= D$1 && D$1 <= 12543 || 12549 <= D$1 && D$1 <= 12589 || 12593 <= D$1 && D$1 <= 12686 || 12688 <= D$1 && D$1 <= 12730 || 12736 <= D$1 && D$1 <= 12771 || 12784 <= D$1 && D$1 <= 12830 || 12832 <= D$1 && D$1 <= 12871 || 12880 <= D$1 && D$1 <= 13054 || 13056 <= D$1 && D$1 <= 19903 || 19968 <= D$1 && D$1 <= 42124 || 42128 <= D$1 && D$1 <= 42182 || 43360 <= D$1 && D$1 <= 43388 || 44032 <= D$1 && D$1 <= 55203 || 55216 <= D$1 && D$1 <= 55238 || 55243 <= D$1 && D$1 <= 55291 || 63744 <= D$1 && D$1 <= 64255 || 65040 <= D$1 && D$1 <= 65049 || 65072 <= D$1 && D$1 <= 65106 || 65108 <= D$1 && D$1 <= 65126 || 65128 <= D$1 && D$1 <= 65131 || 110592 <= D$1 && D$1 <= 110593 || 127488 <= D$1 && D$1 <= 127490 || 127504 <= D$1 && D$1 <= 127546 || 127552 <= D$1 && D$1 <= 127560 || 127568 <= D$1 && D$1 <= 127569 || 131072 <= D$1 && D$1 <= 194367 || 177984 <= D$1 && D$1 <= 196605 || 196608 <= D$1 && D$1 <= 262141 ? "W" : 32 <= D$1 && D$1 <= 126 || 162 <= D$1 && D$1 <= 163 || 165 <= D$1 && D$1 <= 166 || D$1 == 172 || D$1 == 175 || 10214 <= D$1 && D$1 <= 10221 || 10629 <= D$1 && D$1 <= 10630 ? "Na" : D$1 == 161 || D$1 == 164 || 167 <= D$1 && D$1 <= 168 || D$1 == 170 || 173 <= D$1 && D$1 <= 174 || 176 <= D$1 && D$1 <= 180 || 182 <= D$1 && D$1 <= 186 || 188 <= D$1 && D$1 <= 191 || D$1 == 198 || D$1 == 208 || 215 <= D$1 && D$1 <= 216 || 222 <= D$1 && D$1 <= 225 || D$1 == 230 || 232 <= D$1 && D$1 <= 234 || 236 <= D$1 && D$1 <= 237 || D$1 == 240 || 242 <= D$1 && D$1 <= 243 || 247 <= D$1 && D$1 <= 250 || D$1 == 252 || D$1 == 254 || D$1 == 257 || D$1 == 273 || D$1 == 275 || D$1 == 283 || 294 <= D$1 && D$1 <= 295 || D$1 == 299 || 305 <= D$1 && D$1 <= 307 || D$1 == 312 || 319 <= D$1 && D$1 <= 322 || D$1 == 324 || 328 <= D$1 && D$1 <= 331 || D$1 == 333 || 338 <= D$1 && D$1 <= 339 || 358 <= D$1 && D$1 <= 359 || D$1 == 363 || D$1 == 462 || D$1 == 464 || D$1 == 466 || D$1 == 468 || D$1 == 470 || D$1 == 472 || D$1 == 474 || D$1 == 476 || D$1 == 593 || D$1 == 609 || D$1 == 708 || D$1 == 711 || 713 <= D$1 && D$1 <= 715 || D$1 == 717 || D$1 == 720 || 728 <= D$1 && D$1 <= 731 || D$1 == 733 || D$1 == 735 || 768 <= D$1 && D$1 <= 879 || 913 <= D$1 && D$1 <= 929 || 931 <= D$1 && D$1 <= 937 || 945 <= D$1 && D$1 <= 961 || 963 <= D$1 && D$1 <= 969 || D$1 == 1025 || 1040 <= D$1 && D$1 <= 1103 || D$1 == 1105 || D$1 == 8208 || 8211 <= D$1 && D$1 <= 8214 || 8216 <= D$1 && D$1 <= 8217 || 8220 <= D$1 && D$1 <= 8221 || 8224 <= D$1 && D$1 <= 8226 || 8228 <= D$1 && D$1 <= 8231 || D$1 == 8240 || 8242 <= D$1 && D$1 <= 8243 || D$1 == 8245 || D$1 == 8251 || D$1 == 8254 || D$1 == 8308 || D$1 == 8319 || 8321 <= D$1 && D$1 <= 8324 || D$1 == 8364 || D$1 == 8451 || D$1 == 8453 || D$1 == 8457 || D$1 == 8467 || D$1 == 8470 || 8481 <= D$1 && D$1 <= 8482 || D$1 == 8486 || D$1 == 8491 || 8531 <= D$1 && D$1 <= 8532 || 8539 <= D$1 && D$1 <= 8542 || 8544 <= D$1 && D$1 <= 8555 || 8560 <= D$1 && D$1 <= 8569 || D$1 == 8585 || 8592 <= D$1 && D$1 <= 8601 || 8632 <= D$1 && D$1 <= 8633 || D$1 == 8658 || D$1 == 8660 || D$1 == 8679 || D$1 == 8704 || 8706 <= D$1 && D$1 <= 8707 || 8711 <= D$1 && D$1 <= 8712 || D$1 == 8715 || D$1 == 8719 || D$1 == 8721 || D$1 == 8725 || D$1 == 8730 || 8733 <= D$1 && D$1 <= 8736 || D$1 == 8739 || D$1 == 8741 || 8743 <= D$1 && D$1 <= 8748 || D$1 == 8750 || 8756 <= D$1 && D$1 <= 8759 || 8764 <= D$1 && D$1 <= 8765 || D$1 == 8776 || D$1 == 8780 || D$1 == 8786 || 8800 <= D$1 && D$1 <= 8801 || 8804 <= D$1 && D$1 <= 8807 || 8810 <= D$1 && D$1 <= 8811 || 8814 <= D$1 && D$1 <= 8815 || 8834 <= D$1 && D$1 <= 8835 || 8838 <= D$1 && D$1 <= 8839 || D$1 == 8853 || D$1 == 8857 || D$1 == 8869 || D$1 == 8895 || D$1 == 8978 || 9312 <= D$1 && D$1 <= 9449 || 9451 <= D$1 && D$1 <= 9547 || 9552 <= D$1 && D$1 <= 9587 || 9600 <= D$1 && D$1 <= 9615 || 9618 <= D$1 && D$1 <= 9621 || 9632 <= D$1 && D$1 <= 9633 || 9635 <= D$1 && D$1 <= 9641 || 9650 <= D$1 && D$1 <= 9651 || 9654 <= D$1 && D$1 <= 9655 || 9660 <= D$1 && D$1 <= 9661 || 9664 <= D$1 && D$1 <= 9665 || 9670 <= D$1 && D$1 <= 9672 || D$1 == 9675 || 9678 <= D$1 && D$1 <= 9681 || 9698 <= D$1 && D$1 <= 9701 || D$1 == 9711 || 9733 <= D$1 && D$1 <= 9734 || D$1 == 9737 || 9742 <= D$1 && D$1 <= 9743 || 9748 <= D$1 && D$1 <= 9749 || D$1 == 9756 || D$1 == 9758 || D$1 == 9792 || D$1 == 9794 || 9824 <= D$1 && D$1 <= 9825 || 9827 <= D$1 && D$1 <= 9829 || 9831 <= D$1 && D$1 <= 9834 || 9836 <= D$1 && D$1 <= 9837 || D$1 == 9839 || 9886 <= D$1 && D$1 <= 9887 || 9918 <= D$1 && D$1 <= 9919 || 9924 <= D$1 && D$1 <= 9933 || 9935 <= D$1 && D$1 <= 9953 || D$1 == 9955 || 9960 <= D$1 && D$1 <= 9983 || D$1 == 10045 || D$1 == 10071 || 10102 <= D$1 && D$1 <= 10111 || 11093 <= D$1 && D$1 <= 11097 || 12872 <= D$1 && D$1 <= 12879 || 57344 <= D$1 && D$1 <= 63743 || 65024 <= D$1 && D$1 <= 65039 || D$1 == 65533 || 127232 <= D$1 && D$1 <= 127242 || 127248 <= D$1 && D$1 <= 127277 || 127280 <= D$1 && D$1 <= 127337 || 127344 <= D$1 && D$1 <= 127386 || 917760 <= D$1 && D$1 <= 917999 || 983040 <= D$1 && D$1 <= 1048573 || 1048576 <= D$1 && D$1 <= 1114109 ? "A" : "N";
|
|
243
|
+
}, u$1.characterLength = function(F$1) {
|
|
244
|
+
var s = this.eastAsianWidth(F$1);
|
|
245
|
+
return s == "F" || s == "W" || s == "A" ? 2 : 1;
|
|
246
|
+
};
|
|
247
|
+
function t(F$1) {
|
|
248
|
+
return F$1.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
|
|
249
|
+
}
|
|
250
|
+
u$1.length = function(F$1) {
|
|
251
|
+
for (var s = t(F$1), i = 0, D$1 = 0; D$1 < s.length; D$1++) i = i + this.characterLength(s[D$1]);
|
|
252
|
+
return i;
|
|
253
|
+
}, u$1.slice = function(F$1, s, i) {
|
|
254
|
+
textLen = u$1.length(F$1), s = s || 0, i = i || 1, s < 0 && (s = textLen + s), i < 0 && (i = textLen + i);
|
|
255
|
+
for (var D$1 = "", C$1 = 0, n = t(F$1), E = 0; E < n.length; E++) {
|
|
256
|
+
var a = n[E], o$1 = u$1.length(a);
|
|
257
|
+
if (C$1 >= s - (o$1 == 2 ? 1 : 0)) if (C$1 + o$1 <= i) D$1 += a;
|
|
258
|
+
else break;
|
|
259
|
+
C$1 += o$1;
|
|
260
|
+
}
|
|
261
|
+
return D$1;
|
|
262
|
+
};
|
|
263
|
+
})(W$1);
|
|
264
|
+
var tD = W$1.exports;
|
|
265
|
+
const eD = L$1(tD);
|
|
266
|
+
var FD = function() {
|
|
267
|
+
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;
|
|
268
|
+
};
|
|
269
|
+
const sD = L$1(FD);
|
|
270
|
+
function p(e$1, u$1 = {}) {
|
|
271
|
+
if (typeof e$1 != "string" || e$1.length === 0 || (u$1 = {
|
|
272
|
+
ambiguousIsNarrow: !0,
|
|
273
|
+
...u$1
|
|
274
|
+
}, e$1 = P$1(e$1), e$1.length === 0)) return 0;
|
|
275
|
+
e$1 = e$1.replace(sD(), " ");
|
|
276
|
+
const t = u$1.ambiguousIsNarrow ? 1 : 2;
|
|
277
|
+
let F$1 = 0;
|
|
278
|
+
for (const s of e$1) {
|
|
279
|
+
const i = s.codePointAt(0);
|
|
280
|
+
if (i <= 31 || i >= 127 && i <= 159 || i >= 768 && i <= 879) continue;
|
|
281
|
+
switch (eD.eastAsianWidth(s)) {
|
|
282
|
+
case "F":
|
|
283
|
+
case "W":
|
|
284
|
+
F$1 += 2;
|
|
285
|
+
break;
|
|
286
|
+
case "A":
|
|
287
|
+
F$1 += t;
|
|
288
|
+
break;
|
|
289
|
+
default: F$1 += 1;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
return F$1;
|
|
293
|
+
}
|
|
294
|
+
const w = 10, N = (e$1 = 0) => (u$1) => `\x1B[${u$1 + e$1}m`, I = (e$1 = 0) => (u$1) => `\x1B[${38 + e$1};5;${u$1}m`, R = (e$1 = 0) => (u$1, t, F$1) => `\x1B[${38 + e$1};2;${u$1};${t};${F$1}m`, r = {
|
|
295
|
+
modifier: {
|
|
296
|
+
reset: [0, 0],
|
|
297
|
+
bold: [1, 22],
|
|
298
|
+
dim: [2, 22],
|
|
299
|
+
italic: [3, 23],
|
|
300
|
+
underline: [4, 24],
|
|
301
|
+
overline: [53, 55],
|
|
302
|
+
inverse: [7, 27],
|
|
303
|
+
hidden: [8, 28],
|
|
304
|
+
strikethrough: [9, 29]
|
|
305
|
+
},
|
|
306
|
+
color: {
|
|
307
|
+
black: [30, 39],
|
|
308
|
+
red: [31, 39],
|
|
309
|
+
green: [32, 39],
|
|
310
|
+
yellow: [33, 39],
|
|
311
|
+
blue: [34, 39],
|
|
312
|
+
magenta: [35, 39],
|
|
313
|
+
cyan: [36, 39],
|
|
314
|
+
white: [37, 39],
|
|
315
|
+
blackBright: [90, 39],
|
|
316
|
+
gray: [90, 39],
|
|
317
|
+
grey: [90, 39],
|
|
318
|
+
redBright: [91, 39],
|
|
319
|
+
greenBright: [92, 39],
|
|
320
|
+
yellowBright: [93, 39],
|
|
321
|
+
blueBright: [94, 39],
|
|
322
|
+
magentaBright: [95, 39],
|
|
323
|
+
cyanBright: [96, 39],
|
|
324
|
+
whiteBright: [97, 39]
|
|
325
|
+
},
|
|
326
|
+
bgColor: {
|
|
327
|
+
bgBlack: [40, 49],
|
|
328
|
+
bgRed: [41, 49],
|
|
329
|
+
bgGreen: [42, 49],
|
|
330
|
+
bgYellow: [43, 49],
|
|
331
|
+
bgBlue: [44, 49],
|
|
332
|
+
bgMagenta: [45, 49],
|
|
333
|
+
bgCyan: [46, 49],
|
|
334
|
+
bgWhite: [47, 49],
|
|
335
|
+
bgBlackBright: [100, 49],
|
|
336
|
+
bgGray: [100, 49],
|
|
337
|
+
bgGrey: [100, 49],
|
|
338
|
+
bgRedBright: [101, 49],
|
|
339
|
+
bgGreenBright: [102, 49],
|
|
340
|
+
bgYellowBright: [103, 49],
|
|
341
|
+
bgBlueBright: [104, 49],
|
|
342
|
+
bgMagentaBright: [105, 49],
|
|
343
|
+
bgCyanBright: [106, 49],
|
|
344
|
+
bgWhiteBright: [107, 49]
|
|
345
|
+
}
|
|
346
|
+
};
|
|
347
|
+
Object.keys(r.modifier);
|
|
348
|
+
const iD = Object.keys(r.color), CD = Object.keys(r.bgColor);
|
|
349
|
+
[...iD, ...CD];
|
|
350
|
+
function rD() {
|
|
351
|
+
const e$1 = /* @__PURE__ */ new Map();
|
|
352
|
+
for (const [u$1, t] of Object.entries(r)) {
|
|
353
|
+
for (const [F$1, s] of Object.entries(t)) r[F$1] = {
|
|
354
|
+
open: `\x1B[${s[0]}m`,
|
|
355
|
+
close: `\x1B[${s[1]}m`
|
|
356
|
+
}, t[F$1] = r[F$1], e$1.set(s[0], s[1]);
|
|
357
|
+
Object.defineProperty(r, u$1, {
|
|
358
|
+
value: t,
|
|
359
|
+
enumerable: !1
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
return Object.defineProperty(r, "codes", {
|
|
363
|
+
value: e$1,
|
|
364
|
+
enumerable: !1
|
|
365
|
+
}), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = N(), r.color.ansi256 = I(), r.color.ansi16m = R(), r.bgColor.ansi = N(w), r.bgColor.ansi256 = I(w), r.bgColor.ansi16m = R(w), Object.defineProperties(r, {
|
|
366
|
+
rgbToAnsi256: {
|
|
367
|
+
value: (u$1, t, F$1) => u$1 === t && t === F$1 ? u$1 < 8 ? 16 : u$1 > 248 ? 231 : Math.round((u$1 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u$1 / 255 * 5) + 6 * Math.round(t / 255 * 5) + Math.round(F$1 / 255 * 5),
|
|
368
|
+
enumerable: !1
|
|
369
|
+
},
|
|
370
|
+
hexToRgb: {
|
|
371
|
+
value: (u$1) => {
|
|
372
|
+
const t = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u$1.toString(16));
|
|
373
|
+
if (!t) return [
|
|
374
|
+
0,
|
|
375
|
+
0,
|
|
376
|
+
0
|
|
377
|
+
];
|
|
378
|
+
let [F$1] = t;
|
|
379
|
+
F$1.length === 3 && (F$1 = [...F$1].map((i) => i + i).join(""));
|
|
380
|
+
const s = Number.parseInt(F$1, 16);
|
|
381
|
+
return [
|
|
382
|
+
s >> 16 & 255,
|
|
383
|
+
s >> 8 & 255,
|
|
384
|
+
s & 255
|
|
385
|
+
];
|
|
386
|
+
},
|
|
387
|
+
enumerable: !1
|
|
388
|
+
},
|
|
389
|
+
hexToAnsi256: {
|
|
390
|
+
value: (u$1) => r.rgbToAnsi256(...r.hexToRgb(u$1)),
|
|
391
|
+
enumerable: !1
|
|
392
|
+
},
|
|
393
|
+
ansi256ToAnsi: {
|
|
394
|
+
value: (u$1) => {
|
|
395
|
+
if (u$1 < 8) return 30 + u$1;
|
|
396
|
+
if (u$1 < 16) return 90 + (u$1 - 8);
|
|
397
|
+
let t, F$1, s;
|
|
398
|
+
if (u$1 >= 232) t = ((u$1 - 232) * 10 + 8) / 255, F$1 = t, s = t;
|
|
399
|
+
else {
|
|
400
|
+
u$1 -= 16;
|
|
401
|
+
const C$1 = u$1 % 36;
|
|
402
|
+
t = Math.floor(u$1 / 36) / 5, F$1 = Math.floor(C$1 / 6) / 5, s = C$1 % 6 / 5;
|
|
403
|
+
}
|
|
404
|
+
const i = Math.max(t, F$1, s) * 2;
|
|
405
|
+
if (i === 0) return 30;
|
|
406
|
+
let D$1 = 30 + (Math.round(s) << 2 | Math.round(F$1) << 1 | Math.round(t));
|
|
407
|
+
return i === 2 && (D$1 += 60), D$1;
|
|
408
|
+
},
|
|
409
|
+
enumerable: !1
|
|
410
|
+
},
|
|
411
|
+
rgbToAnsi: {
|
|
412
|
+
value: (u$1, t, F$1) => r.ansi256ToAnsi(r.rgbToAnsi256(u$1, t, F$1)),
|
|
413
|
+
enumerable: !1
|
|
414
|
+
},
|
|
415
|
+
hexToAnsi: {
|
|
416
|
+
value: (u$1) => r.ansi256ToAnsi(r.hexToAnsi256(u$1)),
|
|
417
|
+
enumerable: !1
|
|
418
|
+
}
|
|
419
|
+
}), r;
|
|
420
|
+
}
|
|
421
|
+
const ED = rD(), d$1 = new Set(["\x1B", ""]), oD = 39, y$1 = "\x07", V$1 = "[", nD = "]", G$1 = "m", _$1 = `${nD}8;;`, z = (e$1) => `${d$1.values().next().value}${V$1}${e$1}${G$1}`, K$1 = (e$1) => `${d$1.values().next().value}${_$1}${e$1}${y$1}`, aD = (e$1) => e$1.split(" ").map((u$1) => p(u$1)), k$1 = (e$1, u$1, t) => {
|
|
422
|
+
const F$1 = [...u$1];
|
|
423
|
+
let s = !1, i = !1, D$1 = p(P$1(e$1[e$1.length - 1]));
|
|
424
|
+
for (const [C$1, n] of F$1.entries()) {
|
|
425
|
+
const E = p(n);
|
|
426
|
+
if (D$1 + E <= t ? e$1[e$1.length - 1] += n : (e$1.push(n), D$1 = 0), d$1.has(n) && (s = !0, i = F$1.slice(C$1 + 1).join("").startsWith(_$1)), s) {
|
|
427
|
+
i ? n === y$1 && (s = !1, i = !1) : n === G$1 && (s = !1);
|
|
428
|
+
continue;
|
|
429
|
+
}
|
|
430
|
+
D$1 += E, D$1 === t && C$1 < F$1.length - 1 && (e$1.push(""), D$1 = 0);
|
|
431
|
+
}
|
|
432
|
+
!D$1 && e$1[e$1.length - 1].length > 0 && e$1.length > 1 && (e$1[e$1.length - 2] += e$1.pop());
|
|
433
|
+
}, hD = (e$1) => {
|
|
434
|
+
const u$1 = e$1.split(" ");
|
|
435
|
+
let t = u$1.length;
|
|
436
|
+
for (; t > 0 && !(p(u$1[t - 1]) > 0);) t--;
|
|
437
|
+
return t === u$1.length ? e$1 : u$1.slice(0, t).join(" ") + u$1.slice(t).join("");
|
|
438
|
+
}, lD = (e$1, u$1, t = {}) => {
|
|
439
|
+
if (t.trim !== !1 && e$1.trim() === "") return "";
|
|
440
|
+
let F$1 = "", s, i;
|
|
441
|
+
const D$1 = aD(e$1);
|
|
442
|
+
let C$1 = [""];
|
|
443
|
+
for (const [E, a] of e$1.split(" ").entries()) {
|
|
444
|
+
t.trim !== !1 && (C$1[C$1.length - 1] = C$1[C$1.length - 1].trimStart());
|
|
445
|
+
let o$1 = p(C$1[C$1.length - 1]);
|
|
446
|
+
if (E !== 0 && (o$1 >= u$1 && (t.wordWrap === !1 || t.trim === !1) && (C$1.push(""), o$1 = 0), (o$1 > 0 || t.trim === !1) && (C$1[C$1.length - 1] += " ", o$1++)), t.hard && D$1[E] > u$1) {
|
|
447
|
+
const c = u$1 - o$1, f = 1 + Math.floor((D$1[E] - c - 1) / u$1);
|
|
448
|
+
Math.floor((D$1[E] - 1) / u$1) < f && C$1.push(""), k$1(C$1, a, u$1);
|
|
449
|
+
continue;
|
|
450
|
+
}
|
|
451
|
+
if (o$1 + D$1[E] > u$1 && o$1 > 0 && D$1[E] > 0) {
|
|
452
|
+
if (t.wordWrap === !1 && o$1 < u$1) {
|
|
453
|
+
k$1(C$1, a, u$1);
|
|
454
|
+
continue;
|
|
455
|
+
}
|
|
456
|
+
C$1.push("");
|
|
457
|
+
}
|
|
458
|
+
if (o$1 + D$1[E] > u$1 && t.wordWrap === !1) {
|
|
459
|
+
k$1(C$1, a, u$1);
|
|
460
|
+
continue;
|
|
461
|
+
}
|
|
462
|
+
C$1[C$1.length - 1] += a;
|
|
463
|
+
}
|
|
464
|
+
t.trim !== !1 && (C$1 = C$1.map((E) => hD(E)));
|
|
465
|
+
const n = [...C$1.join(`
|
|
466
|
+
`)];
|
|
467
|
+
for (const [E, a] of n.entries()) {
|
|
468
|
+
if (F$1 += a, d$1.has(a)) {
|
|
469
|
+
const { groups: c } = (/* @__PURE__ */ new RegExp(`(?:\\${V$1}(?<code>\\d+)m|\\${_$1}(?<uri>.*)${y$1})`)).exec(n.slice(E).join("")) || { groups: {} };
|
|
470
|
+
if (c.code !== void 0) {
|
|
471
|
+
const f = Number.parseFloat(c.code);
|
|
472
|
+
s = f === oD ? void 0 : f;
|
|
473
|
+
} else c.uri !== void 0 && (i = c.uri.length === 0 ? void 0 : c.uri);
|
|
474
|
+
}
|
|
475
|
+
const o$1 = ED.codes.get(Number(s));
|
|
476
|
+
n[E + 1] === `
|
|
477
|
+
` ? (i && (F$1 += K$1("")), s && o$1 && (F$1 += z(o$1))) : a === `
|
|
478
|
+
` && (s && o$1 && (F$1 += z(s)), i && (F$1 += K$1(i)));
|
|
479
|
+
}
|
|
480
|
+
return F$1;
|
|
481
|
+
};
|
|
482
|
+
function Y$1(e$1, u$1, t) {
|
|
483
|
+
return String(e$1).normalize().replace(/\r\n/g, `
|
|
484
|
+
`).split(`
|
|
485
|
+
`).map((F$1) => lD(F$1, u$1, t)).join(`
|
|
486
|
+
`);
|
|
487
|
+
}
|
|
488
|
+
const B = {
|
|
489
|
+
actions: new Set([
|
|
490
|
+
"up",
|
|
491
|
+
"down",
|
|
492
|
+
"left",
|
|
493
|
+
"right",
|
|
494
|
+
"space",
|
|
495
|
+
"enter",
|
|
496
|
+
"cancel"
|
|
497
|
+
]),
|
|
498
|
+
aliases: new Map([
|
|
499
|
+
["k", "up"],
|
|
500
|
+
["j", "down"],
|
|
501
|
+
["h", "left"],
|
|
502
|
+
["l", "right"],
|
|
503
|
+
["", "cancel"],
|
|
504
|
+
["escape", "cancel"]
|
|
505
|
+
])
|
|
506
|
+
};
|
|
507
|
+
function $(e$1, u$1) {
|
|
508
|
+
if (typeof e$1 == "string") return B.aliases.get(e$1) === u$1;
|
|
509
|
+
for (const t of e$1) if (t !== void 0 && $(t, u$1)) return !0;
|
|
510
|
+
return !1;
|
|
511
|
+
}
|
|
512
|
+
function BD(e$1, u$1) {
|
|
513
|
+
if (e$1 === u$1) return;
|
|
514
|
+
const t = e$1.split(`
|
|
515
|
+
`), F$1 = u$1.split(`
|
|
516
|
+
`), s = [];
|
|
517
|
+
for (let i = 0; i < Math.max(t.length, F$1.length); i++) t[i] !== F$1[i] && s.push(i);
|
|
518
|
+
return s;
|
|
519
|
+
}
|
|
520
|
+
globalThis.process.platform.startsWith("win");
|
|
521
|
+
const S = Symbol("clack:cancel");
|
|
522
|
+
function pD(e$1) {
|
|
523
|
+
return e$1 === S;
|
|
524
|
+
}
|
|
525
|
+
function m(e$1, u$1) {
|
|
526
|
+
const t = e$1;
|
|
527
|
+
t.isTTY && t.setRawMode(u$1);
|
|
528
|
+
}
|
|
529
|
+
var gD = Object.defineProperty, vD = (e$1, u$1, t) => u$1 in e$1 ? gD(e$1, u$1, {
|
|
530
|
+
enumerable: !0,
|
|
531
|
+
configurable: !0,
|
|
532
|
+
writable: !0,
|
|
533
|
+
value: t
|
|
534
|
+
}) : e$1[u$1] = t, h = (e$1, u$1, t) => (vD(e$1, typeof u$1 != "symbol" ? u$1 + "" : u$1, t), t), x$1 = class {
|
|
535
|
+
constructor(u$1, t = !0) {
|
|
536
|
+
h(this, "input"), h(this, "output"), h(this, "_abortSignal"), h(this, "rl"), h(this, "opts"), h(this, "_render"), h(this, "_track", !1), h(this, "_prevFrame", ""), h(this, "_subscribers", /* @__PURE__ */ new Map()), h(this, "_cursor", 0), h(this, "state", "initial"), h(this, "error", ""), h(this, "value");
|
|
537
|
+
const { input: F$1 = stdin, output: s = stdout, render: i, signal: D$1, ...C$1 } = u$1;
|
|
538
|
+
this.opts = C$1, 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 = t, this._abortSignal = D$1, this.input = F$1, this.output = s;
|
|
539
|
+
}
|
|
540
|
+
unsubscribe() {
|
|
541
|
+
this._subscribers.clear();
|
|
542
|
+
}
|
|
543
|
+
setSubscriber(u$1, t) {
|
|
544
|
+
const F$1 = this._subscribers.get(u$1) ?? [];
|
|
545
|
+
F$1.push(t), this._subscribers.set(u$1, F$1);
|
|
546
|
+
}
|
|
547
|
+
on(u$1, t) {
|
|
548
|
+
this.setSubscriber(u$1, { cb: t });
|
|
549
|
+
}
|
|
550
|
+
once(u$1, t) {
|
|
551
|
+
this.setSubscriber(u$1, {
|
|
552
|
+
cb: t,
|
|
553
|
+
once: !0
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
emit(u$1, ...t) {
|
|
557
|
+
const F$1 = this._subscribers.get(u$1) ?? [], s = [];
|
|
558
|
+
for (const i of F$1) i.cb(...t), i.once && s.push(() => F$1.splice(F$1.indexOf(i), 1));
|
|
559
|
+
for (const i of s) i();
|
|
560
|
+
}
|
|
561
|
+
prompt() {
|
|
562
|
+
return new Promise((u$1, t) => {
|
|
563
|
+
if (this._abortSignal) {
|
|
564
|
+
if (this._abortSignal.aborted) return this.state = "cancel", this.close(), u$1(S);
|
|
565
|
+
this._abortSignal.addEventListener("abort", () => {
|
|
566
|
+
this.state = "cancel", this.close();
|
|
567
|
+
}, { once: !0 });
|
|
568
|
+
}
|
|
569
|
+
const F$1 = new Writable();
|
|
570
|
+
F$1._write = (s, i, D$1) => {
|
|
571
|
+
this._track && (this.value = this.rl?.line.replace(/\t/g, ""), this._cursor = this.rl?.cursor ?? 0, this.emit("value", this.value)), D$1();
|
|
572
|
+
}, this.input.pipe(F$1), this.rl = O.createInterface({
|
|
573
|
+
input: this.input,
|
|
574
|
+
output: F$1,
|
|
575
|
+
tabSize: 2,
|
|
576
|
+
prompt: "",
|
|
577
|
+
escapeCodeTimeout: 50,
|
|
578
|
+
terminal: !0
|
|
579
|
+
}), O.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), m(this.input, !0), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
|
|
580
|
+
this.output.write(import_src.cursor.show), this.output.off("resize", this.render), m(this.input, !1), u$1(this.value);
|
|
581
|
+
}), this.once("cancel", () => {
|
|
582
|
+
this.output.write(import_src.cursor.show), this.output.off("resize", this.render), m(this.input, !1), u$1(S);
|
|
583
|
+
});
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
onKeypress(u$1, t) {
|
|
587
|
+
if (this.state === "error" && (this.state = "active"), t?.name && (!this._track && B.aliases.has(t.name) && this.emit("cursor", B.aliases.get(t.name)), B.actions.has(t.name) && this.emit("cursor", t.name)), u$1 && (u$1.toLowerCase() === "y" || u$1.toLowerCase() === "n") && this.emit("confirm", u$1.toLowerCase() === "y"), u$1 === " " && this.opts.placeholder && (this.value || (this.rl?.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u$1 && this.emit("key", u$1.toLowerCase()), t?.name === "return") {
|
|
588
|
+
if (this.opts.validate) {
|
|
589
|
+
const F$1 = this.opts.validate(this.value);
|
|
590
|
+
F$1 && (this.error = F$1 instanceof Error ? F$1.message : F$1, this.state = "error", this.rl?.write(this.value));
|
|
591
|
+
}
|
|
592
|
+
this.state !== "error" && (this.state = "submit");
|
|
593
|
+
}
|
|
594
|
+
$([
|
|
595
|
+
u$1,
|
|
596
|
+
t?.name,
|
|
597
|
+
t?.sequence
|
|
598
|
+
], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
599
|
+
}
|
|
600
|
+
close() {
|
|
601
|
+
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
602
|
+
`), m(this.input, !1), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
603
|
+
}
|
|
604
|
+
restoreCursor() {
|
|
605
|
+
const u$1 = Y$1(this._prevFrame, process.stdout.columns, { hard: !0 }).split(`
|
|
606
|
+
`).length - 1;
|
|
607
|
+
this.output.write(import_src.cursor.move(-999, u$1 * -1));
|
|
608
|
+
}
|
|
609
|
+
render() {
|
|
610
|
+
const u$1 = Y$1(this._render(this) ?? "", process.stdout.columns, { hard: !0 });
|
|
611
|
+
if (u$1 !== this._prevFrame) {
|
|
612
|
+
if (this.state === "initial") this.output.write(import_src.cursor.hide);
|
|
613
|
+
else {
|
|
614
|
+
const t = BD(this._prevFrame, u$1);
|
|
615
|
+
if (this.restoreCursor(), t && t?.length === 1) {
|
|
616
|
+
const F$1 = t[0];
|
|
617
|
+
this.output.write(import_src.cursor.move(0, F$1)), this.output.write(import_src.erase.lines(1));
|
|
618
|
+
const s = u$1.split(`
|
|
619
|
+
`);
|
|
620
|
+
this.output.write(s[F$1]), this._prevFrame = u$1, this.output.write(import_src.cursor.move(0, s.length - F$1 - 1));
|
|
621
|
+
return;
|
|
622
|
+
}
|
|
623
|
+
if (t && t?.length > 1) {
|
|
624
|
+
const F$1 = t[0];
|
|
625
|
+
this.output.write(import_src.cursor.move(0, F$1)), this.output.write(import_src.erase.down());
|
|
626
|
+
const s = u$1.split(`
|
|
627
|
+
`).slice(F$1);
|
|
628
|
+
this.output.write(s.join(`
|
|
629
|
+
`)), this._prevFrame = u$1;
|
|
630
|
+
return;
|
|
631
|
+
}
|
|
632
|
+
this.output.write(import_src.erase.down());
|
|
633
|
+
}
|
|
634
|
+
this.output.write(u$1), this.state === "initial" && (this.state = "active"), this._prevFrame = u$1;
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
};
|
|
638
|
+
Object.defineProperty;
|
|
639
|
+
Object.defineProperty;
|
|
640
|
+
Object.defineProperty;
|
|
641
|
+
var OD = Object.defineProperty, PD = (e$1, u$1, t) => u$1 in e$1 ? OD(e$1, u$1, {
|
|
642
|
+
enumerable: !0,
|
|
643
|
+
configurable: !0,
|
|
644
|
+
writable: !0,
|
|
645
|
+
value: t
|
|
646
|
+
}) : e$1[u$1] = t, J$1 = (e$1, u$1, t) => (PD(e$1, typeof u$1 != "symbol" ? u$1 + "" : u$1, t), t), LD = class extends x$1 {
|
|
647
|
+
constructor(u$1) {
|
|
648
|
+
super(u$1, !1), J$1(this, "options"), J$1(this, "cursor", 0), this.options = u$1.options, this.cursor = this.options.findIndex(({ value: t }) => t === u$1.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (t) => {
|
|
649
|
+
switch (t) {
|
|
650
|
+
case "left":
|
|
651
|
+
case "up":
|
|
652
|
+
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
653
|
+
break;
|
|
654
|
+
case "down":
|
|
655
|
+
case "right":
|
|
656
|
+
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
657
|
+
break;
|
|
658
|
+
}
|
|
659
|
+
this.changeValue();
|
|
660
|
+
});
|
|
661
|
+
}
|
|
662
|
+
get _value() {
|
|
663
|
+
return this.options[this.cursor];
|
|
664
|
+
}
|
|
665
|
+
changeValue() {
|
|
666
|
+
this.value = this._value.value;
|
|
667
|
+
}
|
|
668
|
+
};
|
|
669
|
+
Object.defineProperty;
|
|
670
|
+
var RD = class extends x$1 {
|
|
671
|
+
get valueWithCursor() {
|
|
672
|
+
if (this.state === "submit") return this.value;
|
|
673
|
+
if (this.cursor >= this.value.length) return `${this.value}\u2588`;
|
|
674
|
+
const u$1 = this.value.slice(0, this.cursor), [t, ...F$1] = this.value.slice(this.cursor);
|
|
675
|
+
return `${u$1}${import_picocolors.default.inverse(t)}${F$1.join("")}`;
|
|
676
|
+
}
|
|
677
|
+
get cursor() {
|
|
678
|
+
return this._cursor;
|
|
679
|
+
}
|
|
680
|
+
constructor(u$1) {
|
|
681
|
+
super(u$1), this.on("finalize", () => {
|
|
682
|
+
this.value || (this.value = u$1.defaultValue);
|
|
683
|
+
});
|
|
684
|
+
}
|
|
685
|
+
};
|
|
686
|
+
function ce() {
|
|
687
|
+
return y.platform !== "win32" ? y.env.TERM !== "linux" : !!y.env.CI || !!y.env.WT_SESSION || !!y.env.TERMINUS_SUBLIME || y.env.ConEmuTask === "{cmd::Cmder}" || y.env.TERM_PROGRAM === "Terminus-Sublime" || y.env.TERM_PROGRAM === "vscode" || y.env.TERM === "xterm-256color" || y.env.TERM === "alacritty" || y.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
688
|
+
}
|
|
689
|
+
const V = ce(), u = (t, n) => V ? t : n, le = u("◆", "*"), L = u("■", "x"), W = u("▲", "x"), C = u("◇", "o");
|
|
690
|
+
u("┌", "T");
|
|
691
|
+
const o = u("│", "|"), d = u("└", "—"), k = u("●", ">"), P = u("○", " ");
|
|
692
|
+
u("◻", "[•]");
|
|
693
|
+
u("◼", "[+]");
|
|
694
|
+
u("◻", "[ ]");
|
|
695
|
+
u("▪", "•");
|
|
696
|
+
u("─", "-");
|
|
697
|
+
u("╮", "+");
|
|
698
|
+
u("├", "+");
|
|
699
|
+
u("╯", "+");
|
|
700
|
+
const q = u("●", "•"), D = u("◆", "*"), U = u("▲", "!"), K = u("■", "x"), b = (t) => {
|
|
701
|
+
switch (t) {
|
|
702
|
+
case "initial":
|
|
703
|
+
case "active": return import_picocolors.default.cyan(le);
|
|
704
|
+
case "cancel": return import_picocolors.default.red(L);
|
|
705
|
+
case "error": return import_picocolors.default.yellow(W);
|
|
706
|
+
case "submit": return import_picocolors.default.green(C);
|
|
707
|
+
}
|
|
708
|
+
}, G = (t) => {
|
|
709
|
+
const { cursor: n, options: r$1, style: i } = t, s = t.maxItems ?? Number.POSITIVE_INFINITY, c = Math.max(process.stdout.rows - 4, 0), a = Math.min(c, Math.max(s, 5));
|
|
710
|
+
let l$1 = 0;
|
|
711
|
+
n >= l$1 + a - 3 ? l$1 = Math.max(Math.min(n - a + 3, r$1.length - a), 0) : n < l$1 + 2 && (l$1 = Math.max(n - 2, 0));
|
|
712
|
+
const $$1 = a < r$1.length && l$1 > 0, g$1 = a < r$1.length && l$1 + a < r$1.length;
|
|
713
|
+
return r$1.slice(l$1, l$1 + a).map((p$1, v$1, f) => {
|
|
714
|
+
const j = v$1 === 0 && $$1, E = v$1 === f.length - 1 && g$1;
|
|
715
|
+
return j || E ? import_picocolors.default.dim("...") : i(p$1, v$1 + l$1 === n);
|
|
716
|
+
});
|
|
717
|
+
}, he = (t) => new RD({
|
|
718
|
+
validate: t.validate,
|
|
719
|
+
placeholder: t.placeholder,
|
|
720
|
+
defaultValue: t.defaultValue,
|
|
721
|
+
initialValue: t.initialValue,
|
|
722
|
+
render() {
|
|
723
|
+
const n = `${import_picocolors.default.gray(o)}
|
|
724
|
+
${b(this.state)} ${t.message}
|
|
725
|
+
`, r$1 = t.placeholder ? import_picocolors.default.inverse(t.placeholder[0]) + import_picocolors.default.dim(t.placeholder.slice(1)) : import_picocolors.default.inverse(import_picocolors.default.hidden("_")), i = this.value ? this.valueWithCursor : r$1;
|
|
726
|
+
switch (this.state) {
|
|
727
|
+
case "error": return `${n.trim()}
|
|
728
|
+
${import_picocolors.default.yellow(o)} ${i}
|
|
729
|
+
${import_picocolors.default.yellow(d)} ${import_picocolors.default.yellow(this.error)}
|
|
730
|
+
`;
|
|
731
|
+
case "submit": return `${n}${import_picocolors.default.gray(o)} ${import_picocolors.default.dim(this.value || t.placeholder)}`;
|
|
732
|
+
case "cancel": return `${n}${import_picocolors.default.gray(o)} ${import_picocolors.default.strikethrough(import_picocolors.default.dim(this.value ?? ""))}${this.value?.trim() ? `
|
|
733
|
+
${import_picocolors.default.gray(o)}` : ""}`;
|
|
734
|
+
default: return `${n}${import_picocolors.default.cyan(o)} ${i}
|
|
735
|
+
${import_picocolors.default.cyan(d)}
|
|
736
|
+
`;
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
}).prompt(), ve = (t) => {
|
|
740
|
+
const n = (r$1, i) => {
|
|
741
|
+
const s = r$1.label ?? String(r$1.value);
|
|
742
|
+
switch (i) {
|
|
743
|
+
case "selected": return `${import_picocolors.default.dim(s)}`;
|
|
744
|
+
case "active": return `${import_picocolors.default.green(k)} ${s} ${r$1.hint ? import_picocolors.default.dim(`(${r$1.hint})`) : ""}`;
|
|
745
|
+
case "cancelled": return `${import_picocolors.default.strikethrough(import_picocolors.default.dim(s))}`;
|
|
746
|
+
default: return `${import_picocolors.default.dim(P)} ${import_picocolors.default.dim(s)}`;
|
|
747
|
+
}
|
|
748
|
+
};
|
|
749
|
+
return new LD({
|
|
750
|
+
options: t.options,
|
|
751
|
+
initialValue: t.initialValue,
|
|
752
|
+
render() {
|
|
753
|
+
const r$1 = `${import_picocolors.default.gray(o)}
|
|
754
|
+
${b(this.state)} ${t.message}
|
|
755
|
+
`;
|
|
756
|
+
switch (this.state) {
|
|
757
|
+
case "submit": return `${r$1}${import_picocolors.default.gray(o)} ${n(this.options[this.cursor], "selected")}`;
|
|
758
|
+
case "cancel": return `${r$1}${import_picocolors.default.gray(o)} ${n(this.options[this.cursor], "cancelled")}
|
|
759
|
+
${import_picocolors.default.gray(o)}`;
|
|
760
|
+
default: return `${r$1}${import_picocolors.default.cyan(o)} ${G({
|
|
761
|
+
cursor: this.cursor,
|
|
762
|
+
options: this.options,
|
|
763
|
+
maxItems: t.maxItems,
|
|
764
|
+
style: (i, s) => n(i, s ? "active" : "inactive")
|
|
765
|
+
}).join(`
|
|
766
|
+
${import_picocolors.default.cyan(o)} `)}
|
|
767
|
+
${import_picocolors.default.cyan(d)}
|
|
768
|
+
`;
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
}).prompt();
|
|
772
|
+
}, xe = (t = "") => {
|
|
773
|
+
process.stdout.write(`${import_picocolors.default.gray(d)} ${import_picocolors.default.red(t)}
|
|
774
|
+
|
|
775
|
+
`);
|
|
776
|
+
}, Se = (t = "") => {
|
|
777
|
+
process.stdout.write(`${import_picocolors.default.gray(o)}
|
|
778
|
+
${import_picocolors.default.gray(d)} ${t}
|
|
779
|
+
|
|
780
|
+
`);
|
|
781
|
+
}, M = {
|
|
782
|
+
message: (t = "", { symbol: n = import_picocolors.default.gray(o) } = {}) => {
|
|
783
|
+
const r$1 = [`${import_picocolors.default.gray(o)}`];
|
|
784
|
+
if (t) {
|
|
785
|
+
const [i, ...s] = t.split(`
|
|
786
|
+
`);
|
|
787
|
+
r$1.push(`${n} ${i}`, ...s.map((c) => `${import_picocolors.default.gray(o)} ${c}`));
|
|
788
|
+
}
|
|
789
|
+
process.stdout.write(`${r$1.join(`
|
|
790
|
+
`)}
|
|
791
|
+
`);
|
|
792
|
+
},
|
|
793
|
+
info: (t) => {
|
|
794
|
+
M.message(t, { symbol: import_picocolors.default.blue(q) });
|
|
795
|
+
},
|
|
796
|
+
success: (t) => {
|
|
797
|
+
M.message(t, { symbol: import_picocolors.default.green(D) });
|
|
798
|
+
},
|
|
799
|
+
step: (t) => {
|
|
800
|
+
M.message(t, { symbol: import_picocolors.default.green(C) });
|
|
801
|
+
},
|
|
802
|
+
warn: (t) => {
|
|
803
|
+
M.message(t, { symbol: import_picocolors.default.yellow(U) });
|
|
804
|
+
},
|
|
805
|
+
warning: (t) => {
|
|
806
|
+
M.warn(t);
|
|
807
|
+
},
|
|
808
|
+
error: (t) => {
|
|
809
|
+
M.message(t, { symbol: import_picocolors.default.red(K) });
|
|
810
|
+
}
|
|
811
|
+
}, J = `${import_picocolors.default.gray(o)} `, x = {
|
|
812
|
+
message: async (t, { symbol: n = import_picocolors.default.gray(o) } = {}) => {
|
|
813
|
+
process.stdout.write(`${import_picocolors.default.gray(o)}
|
|
814
|
+
${n} `);
|
|
815
|
+
let r$1 = 3;
|
|
816
|
+
for await (let i of t) {
|
|
817
|
+
i = i.replace(/\n/g, `
|
|
818
|
+
${J}`), i.includes(`
|
|
819
|
+
`) && (r$1 = 3 + stripVTControlCharacters(i.slice(i.lastIndexOf(`
|
|
820
|
+
`))).length);
|
|
821
|
+
const s = stripVTControlCharacters(i).length;
|
|
822
|
+
r$1 + s < process.stdout.columns ? (r$1 += s, process.stdout.write(i)) : (process.stdout.write(`
|
|
823
|
+
${J}${i.trimStart()}`), r$1 = 3 + stripVTControlCharacters(i.trimStart()).length);
|
|
824
|
+
}
|
|
825
|
+
process.stdout.write(`
|
|
826
|
+
`);
|
|
827
|
+
},
|
|
828
|
+
info: (t) => x.message(t, { symbol: import_picocolors.default.blue(q) }),
|
|
829
|
+
success: (t) => x.message(t, { symbol: import_picocolors.default.green(D) }),
|
|
830
|
+
step: (t) => x.message(t, { symbol: import_picocolors.default.green(C) }),
|
|
831
|
+
warn: (t) => x.message(t, { symbol: import_picocolors.default.yellow(U) }),
|
|
832
|
+
warning: (t) => x.warn(t),
|
|
833
|
+
error: (t) => x.message(t, { symbol: import_picocolors.default.red(K) })
|
|
834
|
+
};
|
|
835
|
+
var version = "0.0.1";
|
|
836
|
+
const { blue, gray, green, magenta, yellow } = import_picocolors.default;
|
|
837
|
+
const argv = (0, import_lib.default)(process.argv.slice(2), {
|
|
838
|
+
boolean: [
|
|
839
|
+
"help",
|
|
840
|
+
"overwrite",
|
|
841
|
+
"interactive"
|
|
842
|
+
],
|
|
843
|
+
alias: {
|
|
844
|
+
h: "help",
|
|
845
|
+
t: "template",
|
|
846
|
+
i: "interactive",
|
|
847
|
+
n: "name"
|
|
848
|
+
},
|
|
849
|
+
string: ["template"]
|
|
850
|
+
});
|
|
851
|
+
const cwd = process.cwd();
|
|
852
|
+
const helpMessage = `\
|
|
853
|
+
Usage create-sammi-next [OPTION]... [EXTENSION_ID]
|
|
854
|
+
|
|
855
|
+
Create a new SAMMI Next extension project in TypeScript or JavaScript.
|
|
856
|
+
When running in TTY, the CLI will start in interactive mode.
|
|
857
|
+
|
|
858
|
+
Options:
|
|
859
|
+
-t, --template NAME use a specific template
|
|
860
|
+
-n, --name EXTENSION_NAME define the extension name
|
|
861
|
+
--interactive, --no-interactive force interactive / non-interactive mode
|
|
862
|
+
|
|
863
|
+
Available templates:
|
|
864
|
+
${green("vanilla-ts vanilla-js")}
|
|
865
|
+
${magenta("sample-ts sample-js")}
|
|
866
|
+
${gray("blank-ts blank-js")}`;
|
|
867
|
+
const TEMPLATES_OPTIONS = [{
|
|
868
|
+
name: "vanilla",
|
|
869
|
+
display: "Vanilla",
|
|
870
|
+
color: magenta,
|
|
871
|
+
variants: [
|
|
872
|
+
{
|
|
873
|
+
name: "vanilla-ts",
|
|
874
|
+
display: "TypeScript",
|
|
875
|
+
color: blue
|
|
876
|
+
},
|
|
877
|
+
{
|
|
878
|
+
name: "vanilla-js",
|
|
879
|
+
display: "JavaScript",
|
|
880
|
+
color: yellow
|
|
881
|
+
},
|
|
882
|
+
{
|
|
883
|
+
name: "sample-ts",
|
|
884
|
+
display: "TypeScript (sample + comments)",
|
|
885
|
+
color: blue
|
|
886
|
+
},
|
|
887
|
+
{
|
|
888
|
+
name: "sample-js",
|
|
889
|
+
display: "JavaScript (sample + comments)",
|
|
890
|
+
color: yellow
|
|
891
|
+
}
|
|
892
|
+
]
|
|
893
|
+
}, {
|
|
894
|
+
name: "minimal",
|
|
895
|
+
display: "Minimal (barebone)",
|
|
896
|
+
color: gray,
|
|
897
|
+
variants: [{
|
|
898
|
+
name: "minimal-ts",
|
|
899
|
+
display: "TypeScript",
|
|
900
|
+
color: blue
|
|
901
|
+
}, {
|
|
902
|
+
name: "minimal-js",
|
|
903
|
+
display: "JavaScript",
|
|
904
|
+
color: yellow
|
|
905
|
+
}]
|
|
906
|
+
}];
|
|
907
|
+
const TEMPLATES = TEMPLATES_OPTIONS.map((f) => f.variants.map((v$1) => v$1.name)).reduce((a, b$2) => a.concat(b$2), []);
|
|
908
|
+
const renameFiles = { _gitignore: ".gitignore" };
|
|
909
|
+
const defaultExtensionName = "My Extension";
|
|
910
|
+
async function init() {
|
|
911
|
+
if (argv.help) {
|
|
912
|
+
console.log(helpMessage);
|
|
913
|
+
return;
|
|
914
|
+
}
|
|
915
|
+
const argExtensionID = argv._[0] ? formatTargetDir(String(argv._[0])) : void 0;
|
|
916
|
+
const argTemplate = argv.template;
|
|
917
|
+
const argName = argv.name;
|
|
918
|
+
const argOverwrite = argv.overwrite;
|
|
919
|
+
const interactive = argv.interactive ?? process.stdin.isTTY;
|
|
920
|
+
const pkgInfo = pkgFromUserAgent(process.env.npm_config_user_agent);
|
|
921
|
+
const cancel = () => xe("Operation cancelled");
|
|
922
|
+
let extensionName = argName;
|
|
923
|
+
if (!extensionName) if (!interactive) extensionName = defaultExtensionName;
|
|
924
|
+
else {
|
|
925
|
+
const projectName = await he({
|
|
926
|
+
message: "Extension name:",
|
|
927
|
+
defaultValue: defaultExtensionName,
|
|
928
|
+
placeholder: defaultExtensionName,
|
|
929
|
+
validate: (value) => {
|
|
930
|
+
if (!value || !isValidExtensionName(value)) return "Invalid extension name";
|
|
931
|
+
}
|
|
932
|
+
});
|
|
933
|
+
if (pD(projectName)) return cancel();
|
|
934
|
+
extensionName = projectName;
|
|
935
|
+
}
|
|
936
|
+
const defaultExtensionID = toValidExtensionID(extensionName);
|
|
937
|
+
let extensionID = argExtensionID;
|
|
938
|
+
if (!extensionID) if (!interactive) extensionID = defaultExtensionID;
|
|
939
|
+
else {
|
|
940
|
+
const projectID = await he({
|
|
941
|
+
message: "Extension ID:",
|
|
942
|
+
defaultValue: defaultExtensionID,
|
|
943
|
+
placeholder: defaultExtensionID,
|
|
944
|
+
validate: (value) => {
|
|
945
|
+
if (!isValidExtensionID(value) && value.length) return "Invalid extension ID";
|
|
946
|
+
}
|
|
947
|
+
});
|
|
948
|
+
if (pD(projectID)) return cancel();
|
|
949
|
+
extensionID = toValidExtensionID(projectID) || defaultExtensionID;
|
|
950
|
+
}
|
|
951
|
+
const targetDir = `./${extensionID}`;
|
|
952
|
+
if (fs.existsSync(targetDir) && !isEmpty(targetDir)) {
|
|
953
|
+
let overwrite = argOverwrite ? "yes" : void 0;
|
|
954
|
+
if (!overwrite) if (!interactive) overwrite = "no";
|
|
955
|
+
else {
|
|
956
|
+
const res = await ve({
|
|
957
|
+
message: `Target directory "${targetDir}" is not empty. Please choose to proceed:`,
|
|
958
|
+
options: [
|
|
959
|
+
{
|
|
960
|
+
label: "Cancel operation",
|
|
961
|
+
value: "no"
|
|
962
|
+
},
|
|
963
|
+
{
|
|
964
|
+
label: "Remove existing files and continue",
|
|
965
|
+
value: "yes"
|
|
966
|
+
},
|
|
967
|
+
{
|
|
968
|
+
label: "Ignore files and continue",
|
|
969
|
+
value: "ignore"
|
|
970
|
+
}
|
|
971
|
+
]
|
|
972
|
+
});
|
|
973
|
+
if (pD(res)) return cancel();
|
|
974
|
+
overwrite = res;
|
|
975
|
+
}
|
|
976
|
+
switch (overwrite) {
|
|
977
|
+
case "yes":
|
|
978
|
+
emptyDir(targetDir);
|
|
979
|
+
break;
|
|
980
|
+
case "no":
|
|
981
|
+
cancel();
|
|
982
|
+
return;
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
let template = argTemplate;
|
|
986
|
+
let hasInvalidArgTemplate = false;
|
|
987
|
+
if (argTemplate && !TEMPLATES.includes(argTemplate)) {
|
|
988
|
+
template = void 0;
|
|
989
|
+
hasInvalidArgTemplate = true;
|
|
990
|
+
}
|
|
991
|
+
if (!template) if (!interactive) template = "vanilla-ts";
|
|
992
|
+
else {
|
|
993
|
+
const res = await ve({
|
|
994
|
+
message: hasInvalidArgTemplate ? `"${argTemplate}" is not a valid template. Please choose from below: ` : "Select a template:",
|
|
995
|
+
options: TEMPLATES_OPTIONS.map((template$1) => {
|
|
996
|
+
const templateColor = template$1.color;
|
|
997
|
+
return {
|
|
998
|
+
label: templateColor(template$1.display || template$1.name),
|
|
999
|
+
value: template$1
|
|
1000
|
+
};
|
|
1001
|
+
})
|
|
1002
|
+
});
|
|
1003
|
+
if (pD(res)) return cancel();
|
|
1004
|
+
const variant = await ve({
|
|
1005
|
+
message: "Select a variant:",
|
|
1006
|
+
options: res.variants.map((variant$1) => {
|
|
1007
|
+
const variantColor = variant$1.color;
|
|
1008
|
+
const command = variant$1.customCommand;
|
|
1009
|
+
return {
|
|
1010
|
+
label: variantColor(variant$1.display || variant$1.name),
|
|
1011
|
+
value: variant$1.name,
|
|
1012
|
+
hint: command
|
|
1013
|
+
};
|
|
1014
|
+
})
|
|
1015
|
+
});
|
|
1016
|
+
if (pD(variant)) return cancel();
|
|
1017
|
+
template = variant;
|
|
1018
|
+
}
|
|
1019
|
+
const pkgManager = (pkgInfo ?? { name: "npm" }).name;
|
|
1020
|
+
const root = path.join(cwd, targetDir);
|
|
1021
|
+
fs.mkdirSync(root, { recursive: true });
|
|
1022
|
+
M.step(`Scaffolding project in ${root}...`);
|
|
1023
|
+
const templateDir = path.resolve(fileURLToPath(import.meta.url), "../..", `template-${template}`);
|
|
1024
|
+
const write = (file, content) => {
|
|
1025
|
+
const targetPath = path.join(root, renameFiles[file] ?? file);
|
|
1026
|
+
if (content) {
|
|
1027
|
+
fs.writeFileSync(targetPath, content);
|
|
1028
|
+
return;
|
|
1029
|
+
}
|
|
1030
|
+
if (file === "external.html" || file === "README.md" || file.startsWith("sammi.config.")) {
|
|
1031
|
+
const templatePath = path.join(templateDir, file);
|
|
1032
|
+
const updatedContent = fs.readFileSync(templatePath, "utf-8").replace(/{{EXTENSION_ID}}/g, extensionID).replace(/{{EXTENSION_NAME}}/g, extensionName).replace(/{{CREATE_VERSION}}/g, version);
|
|
1033
|
+
fs.writeFileSync(targetPath, updatedContent);
|
|
1034
|
+
return;
|
|
1035
|
+
}
|
|
1036
|
+
copy(path.join(templateDir, file), targetPath);
|
|
1037
|
+
};
|
|
1038
|
+
const files = fs.readdirSync(templateDir);
|
|
1039
|
+
for (const file of files.filter((f) => f !== "package.json")) write(file);
|
|
1040
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(templateDir, "package.json"), "utf-8"));
|
|
1041
|
+
pkg.name = extensionID;
|
|
1042
|
+
write("package.json", JSON.stringify(pkg, null, 4) + "\n");
|
|
1043
|
+
let doneMessage = "";
|
|
1044
|
+
const cdProjectName = path.relative(cwd, root);
|
|
1045
|
+
doneMessage += "Done. Now run:\n";
|
|
1046
|
+
if (root !== cwd) doneMessage += `\n cd ${cdProjectName.includes(" ") ? `"${cdProjectName}"` : cdProjectName}`;
|
|
1047
|
+
doneMessage += `\n ${getInstallCommand(pkgManager).join(" ")}`;
|
|
1048
|
+
doneMessage += `\n ${getRunCommand(pkgManager, "dev").join(" ")}`;
|
|
1049
|
+
Se(doneMessage);
|
|
1050
|
+
}
|
|
1051
|
+
function formatTargetDir(targetDir) {
|
|
1052
|
+
return targetDir.trim().replace(/\/+$/g, "");
|
|
1053
|
+
}
|
|
1054
|
+
function copy(src, dest) {
|
|
1055
|
+
if (fs.statSync(src).isDirectory()) {
|
|
1056
|
+
copyDir(src, dest);
|
|
1057
|
+
return;
|
|
1058
|
+
}
|
|
1059
|
+
fs.copyFileSync(src, dest);
|
|
1060
|
+
}
|
|
1061
|
+
function copyDir(srcDir, destDir) {
|
|
1062
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
1063
|
+
for (const file of fs.readdirSync(srcDir)) copy(path.resolve(srcDir, file), path.resolve(destDir, file));
|
|
1064
|
+
}
|
|
1065
|
+
function isEmpty(path$1) {
|
|
1066
|
+
const files = fs.readdirSync(path$1);
|
|
1067
|
+
return !files.length || files.length === 1 && files[0] === ".git";
|
|
1068
|
+
}
|
|
1069
|
+
function emptyDir(dir) {
|
|
1070
|
+
if (!fs.existsSync(dir)) return;
|
|
1071
|
+
for (const file of fs.readdirSync(dir)) {
|
|
1072
|
+
if (file === ".git") continue;
|
|
1073
|
+
fs.rmSync(path.resolve(dir, file), {
|
|
1074
|
+
recursive: true,
|
|
1075
|
+
force: true
|
|
1076
|
+
});
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
function isValidExtensionName(projectName) {
|
|
1080
|
+
return /^[a-zA-Z0-9 -_]+$/.test(projectName);
|
|
1081
|
+
}
|
|
1082
|
+
function isValidExtensionID(projectName) {
|
|
1083
|
+
return /^[a-z0-9-_]+$/.test(projectName);
|
|
1084
|
+
}
|
|
1085
|
+
function toValidExtensionID(projectName) {
|
|
1086
|
+
return projectName.trim().toLowerCase().replace(/\s+/g, "-").replace(/[^a-z\d-]+/g, "-");
|
|
1087
|
+
}
|
|
1088
|
+
function pkgFromUserAgent(userAgent) {
|
|
1089
|
+
if (!userAgent) return;
|
|
1090
|
+
const pkgSpecArr = userAgent.split(" ")[0].split("/");
|
|
1091
|
+
return {
|
|
1092
|
+
name: pkgSpecArr[0],
|
|
1093
|
+
version: pkgSpecArr[1]
|
|
1094
|
+
};
|
|
1095
|
+
}
|
|
1096
|
+
function getInstallCommand(agent) {
|
|
1097
|
+
if (agent === "yarn") return [agent];
|
|
1098
|
+
return [agent, "install"];
|
|
1099
|
+
}
|
|
1100
|
+
function getRunCommand(agent, script) {
|
|
1101
|
+
switch (agent) {
|
|
1102
|
+
case "yarn":
|
|
1103
|
+
case "pnpm":
|
|
1104
|
+
case "bun": return [agent, script];
|
|
1105
|
+
case "deno": return [
|
|
1106
|
+
agent,
|
|
1107
|
+
"task",
|
|
1108
|
+
script
|
|
1109
|
+
];
|
|
1110
|
+
default: return [
|
|
1111
|
+
agent,
|
|
1112
|
+
"run",
|
|
1113
|
+
script
|
|
1114
|
+
];
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
init().catch((e$1) => console.error(e$1));
|
|
1118
|
+
export {};
|