playcademy 0.14.28 → 0.14.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.d.ts +25 -0
- package/dist/cli.js +3637 -0
- package/dist/constants.d.ts +41 -5
- package/dist/constants.js +24 -3
- package/dist/db.js +1 -1997
- package/dist/index.d.ts +80 -1
- package/dist/index.js +2219 -3755
- package/dist/templates/auth/auth.ts.template +4 -4
- package/dist/templates/config/playcademy.config.js.template +1 -1
- package/dist/templates/config/playcademy.config.json.template +1 -1
- package/dist/templates/database/package.json.template +1 -1
- package/dist/utils.js +398 -2020
- package/dist/version.js +8 -1
- package/package.json +8 -1
package/dist/db.js
CHANGED
|
@@ -1,37 +1,7 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
1
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
9
|
-
}) : x)(function(x) {
|
|
10
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
11
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
12
|
-
});
|
|
13
2
|
var __esm = (fn, res) => function __init() {
|
|
14
3
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
15
4
|
};
|
|
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
5
|
|
|
36
6
|
// ../utils/src/package-json.ts
|
|
37
7
|
var init_package_json = __esm({
|
|
@@ -40,1386 +10,6 @@ var init_package_json = __esm({
|
|
|
40
10
|
}
|
|
41
11
|
});
|
|
42
12
|
|
|
43
|
-
// ../../node_modules/cli-width/index.js
|
|
44
|
-
var require_cli_width = __commonJS({
|
|
45
|
-
"../../node_modules/cli-width/index.js"(exports, module) {
|
|
46
|
-
"use strict";
|
|
47
|
-
module.exports = cliWidth2;
|
|
48
|
-
function normalizeOpts(options) {
|
|
49
|
-
const defaultOpts = {
|
|
50
|
-
defaultWidth: 0,
|
|
51
|
-
output: process.stdout,
|
|
52
|
-
tty: __require("tty")
|
|
53
|
-
};
|
|
54
|
-
if (!options) {
|
|
55
|
-
return defaultOpts;
|
|
56
|
-
}
|
|
57
|
-
Object.keys(defaultOpts).forEach(function(key) {
|
|
58
|
-
if (!options[key]) {
|
|
59
|
-
options[key] = defaultOpts[key];
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
return options;
|
|
63
|
-
}
|
|
64
|
-
function cliWidth2(options) {
|
|
65
|
-
const opts = normalizeOpts(options);
|
|
66
|
-
if (opts.output.getWindowSize) {
|
|
67
|
-
return opts.output.getWindowSize()[0] || opts.defaultWidth;
|
|
68
|
-
}
|
|
69
|
-
if (opts.tty.getWindowSize) {
|
|
70
|
-
return opts.tty.getWindowSize()[1] || opts.defaultWidth;
|
|
71
|
-
}
|
|
72
|
-
if (opts.output.columns) {
|
|
73
|
-
return opts.output.columns;
|
|
74
|
-
}
|
|
75
|
-
if (process.env.CLI_WIDTH) {
|
|
76
|
-
const width = parseInt(process.env.CLI_WIDTH, 10);
|
|
77
|
-
if (!isNaN(width) && width !== 0) {
|
|
78
|
-
return width;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
return opts.defaultWidth;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
// ../../node_modules/@inquirer/core/node_modules/wrap-ansi/node_modules/strip-ansi/node_modules/ansi-regex/index.js
|
|
87
|
-
var require_ansi_regex = __commonJS({
|
|
88
|
-
"../../node_modules/@inquirer/core/node_modules/wrap-ansi/node_modules/strip-ansi/node_modules/ansi-regex/index.js"(exports, module) {
|
|
89
|
-
"use strict";
|
|
90
|
-
module.exports = ({ onlyFirst = false } = {}) => {
|
|
91
|
-
const pattern = [
|
|
92
|
-
"[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
|
|
93
|
-
"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
|
|
94
|
-
].join("|");
|
|
95
|
-
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
// ../../node_modules/@inquirer/core/node_modules/wrap-ansi/node_modules/strip-ansi/index.js
|
|
101
|
-
var require_strip_ansi = __commonJS({
|
|
102
|
-
"../../node_modules/@inquirer/core/node_modules/wrap-ansi/node_modules/strip-ansi/index.js"(exports, module) {
|
|
103
|
-
"use strict";
|
|
104
|
-
var ansiRegex = require_ansi_regex();
|
|
105
|
-
module.exports = (string) => typeof string === "string" ? string.replace(ansiRegex(), "") : string;
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
// ../../node_modules/@inquirer/core/node_modules/wrap-ansi/node_modules/string-width/node_modules/is-fullwidth-code-point/index.js
|
|
110
|
-
var require_is_fullwidth_code_point = __commonJS({
|
|
111
|
-
"../../node_modules/@inquirer/core/node_modules/wrap-ansi/node_modules/string-width/node_modules/is-fullwidth-code-point/index.js"(exports, module) {
|
|
112
|
-
"use strict";
|
|
113
|
-
var isFullwidthCodePoint = (codePoint) => {
|
|
114
|
-
if (Number.isNaN(codePoint)) {
|
|
115
|
-
return false;
|
|
116
|
-
}
|
|
117
|
-
if (codePoint >= 4352 && (codePoint <= 4447 || // Hangul Jamo
|
|
118
|
-
codePoint === 9001 || // LEFT-POINTING ANGLE BRACKET
|
|
119
|
-
codePoint === 9002 || // RIGHT-POINTING ANGLE BRACKET
|
|
120
|
-
// CJK Radicals Supplement .. Enclosed CJK Letters and Months
|
|
121
|
-
11904 <= codePoint && codePoint <= 12871 && codePoint !== 12351 || // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
|
|
122
|
-
12880 <= codePoint && codePoint <= 19903 || // CJK Unified Ideographs .. Yi Radicals
|
|
123
|
-
19968 <= codePoint && codePoint <= 42182 || // Hangul Jamo Extended-A
|
|
124
|
-
43360 <= codePoint && codePoint <= 43388 || // Hangul Syllables
|
|
125
|
-
44032 <= codePoint && codePoint <= 55203 || // CJK Compatibility Ideographs
|
|
126
|
-
63744 <= codePoint && codePoint <= 64255 || // Vertical Forms
|
|
127
|
-
65040 <= codePoint && codePoint <= 65049 || // CJK Compatibility Forms .. Small Form Variants
|
|
128
|
-
65072 <= codePoint && codePoint <= 65131 || // Halfwidth and Fullwidth Forms
|
|
129
|
-
65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 || // Kana Supplement
|
|
130
|
-
110592 <= codePoint && codePoint <= 110593 || // Enclosed Ideographic Supplement
|
|
131
|
-
127488 <= codePoint && codePoint <= 127569 || // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
|
|
132
|
-
131072 <= codePoint && codePoint <= 262141)) {
|
|
133
|
-
return true;
|
|
134
|
-
}
|
|
135
|
-
return false;
|
|
136
|
-
};
|
|
137
|
-
module.exports = isFullwidthCodePoint;
|
|
138
|
-
module.exports.default = isFullwidthCodePoint;
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
// ../../node_modules/@inquirer/core/node_modules/wrap-ansi/node_modules/string-width/node_modules/emoji-regex/index.js
|
|
143
|
-
var require_emoji_regex = __commonJS({
|
|
144
|
-
"../../node_modules/@inquirer/core/node_modules/wrap-ansi/node_modules/string-width/node_modules/emoji-regex/index.js"(exports, module) {
|
|
145
|
-
"use strict";
|
|
146
|
-
module.exports = function() {
|
|
147
|
-
return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\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\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])|\uD83C[\uDF3E\uDF73\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])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\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])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\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\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*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\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\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\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[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
// ../../node_modules/@inquirer/core/node_modules/wrap-ansi/node_modules/string-width/index.js
|
|
153
|
-
var require_string_width = __commonJS({
|
|
154
|
-
"../../node_modules/@inquirer/core/node_modules/wrap-ansi/node_modules/string-width/index.js"(exports, module) {
|
|
155
|
-
"use strict";
|
|
156
|
-
var stripAnsi2 = require_strip_ansi();
|
|
157
|
-
var isFullwidthCodePoint = require_is_fullwidth_code_point();
|
|
158
|
-
var emojiRegex = require_emoji_regex();
|
|
159
|
-
var stringWidth = (string) => {
|
|
160
|
-
if (typeof string !== "string" || string.length === 0) {
|
|
161
|
-
return 0;
|
|
162
|
-
}
|
|
163
|
-
string = stripAnsi2(string);
|
|
164
|
-
if (string.length === 0) {
|
|
165
|
-
return 0;
|
|
166
|
-
}
|
|
167
|
-
string = string.replace(emojiRegex(), " ");
|
|
168
|
-
let width = 0;
|
|
169
|
-
for (let i = 0; i < string.length; i++) {
|
|
170
|
-
const code = string.codePointAt(i);
|
|
171
|
-
if (code <= 31 || code >= 127 && code <= 159) {
|
|
172
|
-
continue;
|
|
173
|
-
}
|
|
174
|
-
if (code >= 768 && code <= 879) {
|
|
175
|
-
continue;
|
|
176
|
-
}
|
|
177
|
-
if (code > 65535) {
|
|
178
|
-
i++;
|
|
179
|
-
}
|
|
180
|
-
width += isFullwidthCodePoint(code) ? 2 : 1;
|
|
181
|
-
}
|
|
182
|
-
return width;
|
|
183
|
-
};
|
|
184
|
-
module.exports = stringWidth;
|
|
185
|
-
module.exports.default = stringWidth;
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
// ../../node_modules/color-name/index.js
|
|
190
|
-
var require_color_name = __commonJS({
|
|
191
|
-
"../../node_modules/color-name/index.js"(exports, module) {
|
|
192
|
-
"use strict";
|
|
193
|
-
module.exports = {
|
|
194
|
-
"aliceblue": [240, 248, 255],
|
|
195
|
-
"antiquewhite": [250, 235, 215],
|
|
196
|
-
"aqua": [0, 255, 255],
|
|
197
|
-
"aquamarine": [127, 255, 212],
|
|
198
|
-
"azure": [240, 255, 255],
|
|
199
|
-
"beige": [245, 245, 220],
|
|
200
|
-
"bisque": [255, 228, 196],
|
|
201
|
-
"black": [0, 0, 0],
|
|
202
|
-
"blanchedalmond": [255, 235, 205],
|
|
203
|
-
"blue": [0, 0, 255],
|
|
204
|
-
"blueviolet": [138, 43, 226],
|
|
205
|
-
"brown": [165, 42, 42],
|
|
206
|
-
"burlywood": [222, 184, 135],
|
|
207
|
-
"cadetblue": [95, 158, 160],
|
|
208
|
-
"chartreuse": [127, 255, 0],
|
|
209
|
-
"chocolate": [210, 105, 30],
|
|
210
|
-
"coral": [255, 127, 80],
|
|
211
|
-
"cornflowerblue": [100, 149, 237],
|
|
212
|
-
"cornsilk": [255, 248, 220],
|
|
213
|
-
"crimson": [220, 20, 60],
|
|
214
|
-
"cyan": [0, 255, 255],
|
|
215
|
-
"darkblue": [0, 0, 139],
|
|
216
|
-
"darkcyan": [0, 139, 139],
|
|
217
|
-
"darkgoldenrod": [184, 134, 11],
|
|
218
|
-
"darkgray": [169, 169, 169],
|
|
219
|
-
"darkgreen": [0, 100, 0],
|
|
220
|
-
"darkgrey": [169, 169, 169],
|
|
221
|
-
"darkkhaki": [189, 183, 107],
|
|
222
|
-
"darkmagenta": [139, 0, 139],
|
|
223
|
-
"darkolivegreen": [85, 107, 47],
|
|
224
|
-
"darkorange": [255, 140, 0],
|
|
225
|
-
"darkorchid": [153, 50, 204],
|
|
226
|
-
"darkred": [139, 0, 0],
|
|
227
|
-
"darksalmon": [233, 150, 122],
|
|
228
|
-
"darkseagreen": [143, 188, 143],
|
|
229
|
-
"darkslateblue": [72, 61, 139],
|
|
230
|
-
"darkslategray": [47, 79, 79],
|
|
231
|
-
"darkslategrey": [47, 79, 79],
|
|
232
|
-
"darkturquoise": [0, 206, 209],
|
|
233
|
-
"darkviolet": [148, 0, 211],
|
|
234
|
-
"deeppink": [255, 20, 147],
|
|
235
|
-
"deepskyblue": [0, 191, 255],
|
|
236
|
-
"dimgray": [105, 105, 105],
|
|
237
|
-
"dimgrey": [105, 105, 105],
|
|
238
|
-
"dodgerblue": [30, 144, 255],
|
|
239
|
-
"firebrick": [178, 34, 34],
|
|
240
|
-
"floralwhite": [255, 250, 240],
|
|
241
|
-
"forestgreen": [34, 139, 34],
|
|
242
|
-
"fuchsia": [255, 0, 255],
|
|
243
|
-
"gainsboro": [220, 220, 220],
|
|
244
|
-
"ghostwhite": [248, 248, 255],
|
|
245
|
-
"gold": [255, 215, 0],
|
|
246
|
-
"goldenrod": [218, 165, 32],
|
|
247
|
-
"gray": [128, 128, 128],
|
|
248
|
-
"green": [0, 128, 0],
|
|
249
|
-
"greenyellow": [173, 255, 47],
|
|
250
|
-
"grey": [128, 128, 128],
|
|
251
|
-
"honeydew": [240, 255, 240],
|
|
252
|
-
"hotpink": [255, 105, 180],
|
|
253
|
-
"indianred": [205, 92, 92],
|
|
254
|
-
"indigo": [75, 0, 130],
|
|
255
|
-
"ivory": [255, 255, 240],
|
|
256
|
-
"khaki": [240, 230, 140],
|
|
257
|
-
"lavender": [230, 230, 250],
|
|
258
|
-
"lavenderblush": [255, 240, 245],
|
|
259
|
-
"lawngreen": [124, 252, 0],
|
|
260
|
-
"lemonchiffon": [255, 250, 205],
|
|
261
|
-
"lightblue": [173, 216, 230],
|
|
262
|
-
"lightcoral": [240, 128, 128],
|
|
263
|
-
"lightcyan": [224, 255, 255],
|
|
264
|
-
"lightgoldenrodyellow": [250, 250, 210],
|
|
265
|
-
"lightgray": [211, 211, 211],
|
|
266
|
-
"lightgreen": [144, 238, 144],
|
|
267
|
-
"lightgrey": [211, 211, 211],
|
|
268
|
-
"lightpink": [255, 182, 193],
|
|
269
|
-
"lightsalmon": [255, 160, 122],
|
|
270
|
-
"lightseagreen": [32, 178, 170],
|
|
271
|
-
"lightskyblue": [135, 206, 250],
|
|
272
|
-
"lightslategray": [119, 136, 153],
|
|
273
|
-
"lightslategrey": [119, 136, 153],
|
|
274
|
-
"lightsteelblue": [176, 196, 222],
|
|
275
|
-
"lightyellow": [255, 255, 224],
|
|
276
|
-
"lime": [0, 255, 0],
|
|
277
|
-
"limegreen": [50, 205, 50],
|
|
278
|
-
"linen": [250, 240, 230],
|
|
279
|
-
"magenta": [255, 0, 255],
|
|
280
|
-
"maroon": [128, 0, 0],
|
|
281
|
-
"mediumaquamarine": [102, 205, 170],
|
|
282
|
-
"mediumblue": [0, 0, 205],
|
|
283
|
-
"mediumorchid": [186, 85, 211],
|
|
284
|
-
"mediumpurple": [147, 112, 219],
|
|
285
|
-
"mediumseagreen": [60, 179, 113],
|
|
286
|
-
"mediumslateblue": [123, 104, 238],
|
|
287
|
-
"mediumspringgreen": [0, 250, 154],
|
|
288
|
-
"mediumturquoise": [72, 209, 204],
|
|
289
|
-
"mediumvioletred": [199, 21, 133],
|
|
290
|
-
"midnightblue": [25, 25, 112],
|
|
291
|
-
"mintcream": [245, 255, 250],
|
|
292
|
-
"mistyrose": [255, 228, 225],
|
|
293
|
-
"moccasin": [255, 228, 181],
|
|
294
|
-
"navajowhite": [255, 222, 173],
|
|
295
|
-
"navy": [0, 0, 128],
|
|
296
|
-
"oldlace": [253, 245, 230],
|
|
297
|
-
"olive": [128, 128, 0],
|
|
298
|
-
"olivedrab": [107, 142, 35],
|
|
299
|
-
"orange": [255, 165, 0],
|
|
300
|
-
"orangered": [255, 69, 0],
|
|
301
|
-
"orchid": [218, 112, 214],
|
|
302
|
-
"palegoldenrod": [238, 232, 170],
|
|
303
|
-
"palegreen": [152, 251, 152],
|
|
304
|
-
"paleturquoise": [175, 238, 238],
|
|
305
|
-
"palevioletred": [219, 112, 147],
|
|
306
|
-
"papayawhip": [255, 239, 213],
|
|
307
|
-
"peachpuff": [255, 218, 185],
|
|
308
|
-
"peru": [205, 133, 63],
|
|
309
|
-
"pink": [255, 192, 203],
|
|
310
|
-
"plum": [221, 160, 221],
|
|
311
|
-
"powderblue": [176, 224, 230],
|
|
312
|
-
"purple": [128, 0, 128],
|
|
313
|
-
"rebeccapurple": [102, 51, 153],
|
|
314
|
-
"red": [255, 0, 0],
|
|
315
|
-
"rosybrown": [188, 143, 143],
|
|
316
|
-
"royalblue": [65, 105, 225],
|
|
317
|
-
"saddlebrown": [139, 69, 19],
|
|
318
|
-
"salmon": [250, 128, 114],
|
|
319
|
-
"sandybrown": [244, 164, 96],
|
|
320
|
-
"seagreen": [46, 139, 87],
|
|
321
|
-
"seashell": [255, 245, 238],
|
|
322
|
-
"sienna": [160, 82, 45],
|
|
323
|
-
"silver": [192, 192, 192],
|
|
324
|
-
"skyblue": [135, 206, 235],
|
|
325
|
-
"slateblue": [106, 90, 205],
|
|
326
|
-
"slategray": [112, 128, 144],
|
|
327
|
-
"slategrey": [112, 128, 144],
|
|
328
|
-
"snow": [255, 250, 250],
|
|
329
|
-
"springgreen": [0, 255, 127],
|
|
330
|
-
"steelblue": [70, 130, 180],
|
|
331
|
-
"tan": [210, 180, 140],
|
|
332
|
-
"teal": [0, 128, 128],
|
|
333
|
-
"thistle": [216, 191, 216],
|
|
334
|
-
"tomato": [255, 99, 71],
|
|
335
|
-
"turquoise": [64, 224, 208],
|
|
336
|
-
"violet": [238, 130, 238],
|
|
337
|
-
"wheat": [245, 222, 179],
|
|
338
|
-
"white": [255, 255, 255],
|
|
339
|
-
"whitesmoke": [245, 245, 245],
|
|
340
|
-
"yellow": [255, 255, 0],
|
|
341
|
-
"yellowgreen": [154, 205, 50]
|
|
342
|
-
};
|
|
343
|
-
}
|
|
344
|
-
});
|
|
345
|
-
|
|
346
|
-
// ../../node_modules/color-convert/conversions.js
|
|
347
|
-
var require_conversions = __commonJS({
|
|
348
|
-
"../../node_modules/color-convert/conversions.js"(exports, module) {
|
|
349
|
-
var cssKeywords = require_color_name();
|
|
350
|
-
var reverseKeywords = {};
|
|
351
|
-
for (const key of Object.keys(cssKeywords)) {
|
|
352
|
-
reverseKeywords[cssKeywords[key]] = key;
|
|
353
|
-
}
|
|
354
|
-
var convert = {
|
|
355
|
-
rgb: { channels: 3, labels: "rgb" },
|
|
356
|
-
hsl: { channels: 3, labels: "hsl" },
|
|
357
|
-
hsv: { channels: 3, labels: "hsv" },
|
|
358
|
-
hwb: { channels: 3, labels: "hwb" },
|
|
359
|
-
cmyk: { channels: 4, labels: "cmyk" },
|
|
360
|
-
xyz: { channels: 3, labels: "xyz" },
|
|
361
|
-
lab: { channels: 3, labels: "lab" },
|
|
362
|
-
lch: { channels: 3, labels: "lch" },
|
|
363
|
-
hex: { channels: 1, labels: ["hex"] },
|
|
364
|
-
keyword: { channels: 1, labels: ["keyword"] },
|
|
365
|
-
ansi16: { channels: 1, labels: ["ansi16"] },
|
|
366
|
-
ansi256: { channels: 1, labels: ["ansi256"] },
|
|
367
|
-
hcg: { channels: 3, labels: ["h", "c", "g"] },
|
|
368
|
-
apple: { channels: 3, labels: ["r16", "g16", "b16"] },
|
|
369
|
-
gray: { channels: 1, labels: ["gray"] }
|
|
370
|
-
};
|
|
371
|
-
module.exports = convert;
|
|
372
|
-
for (const model of Object.keys(convert)) {
|
|
373
|
-
if (!("channels" in convert[model])) {
|
|
374
|
-
throw new Error("missing channels property: " + model);
|
|
375
|
-
}
|
|
376
|
-
if (!("labels" in convert[model])) {
|
|
377
|
-
throw new Error("missing channel labels property: " + model);
|
|
378
|
-
}
|
|
379
|
-
if (convert[model].labels.length !== convert[model].channels) {
|
|
380
|
-
throw new Error("channel and label counts mismatch: " + model);
|
|
381
|
-
}
|
|
382
|
-
const { channels, labels } = convert[model];
|
|
383
|
-
delete convert[model].channels;
|
|
384
|
-
delete convert[model].labels;
|
|
385
|
-
Object.defineProperty(convert[model], "channels", { value: channels });
|
|
386
|
-
Object.defineProperty(convert[model], "labels", { value: labels });
|
|
387
|
-
}
|
|
388
|
-
convert.rgb.hsl = function(rgb) {
|
|
389
|
-
const r = rgb[0] / 255;
|
|
390
|
-
const g = rgb[1] / 255;
|
|
391
|
-
const b = rgb[2] / 255;
|
|
392
|
-
const min = Math.min(r, g, b);
|
|
393
|
-
const max = Math.max(r, g, b);
|
|
394
|
-
const delta = max - min;
|
|
395
|
-
let h;
|
|
396
|
-
let s;
|
|
397
|
-
if (max === min) {
|
|
398
|
-
h = 0;
|
|
399
|
-
} else if (r === max) {
|
|
400
|
-
h = (g - b) / delta;
|
|
401
|
-
} else if (g === max) {
|
|
402
|
-
h = 2 + (b - r) / delta;
|
|
403
|
-
} else if (b === max) {
|
|
404
|
-
h = 4 + (r - g) / delta;
|
|
405
|
-
}
|
|
406
|
-
h = Math.min(h * 60, 360);
|
|
407
|
-
if (h < 0) {
|
|
408
|
-
h += 360;
|
|
409
|
-
}
|
|
410
|
-
const l = (min + max) / 2;
|
|
411
|
-
if (max === min) {
|
|
412
|
-
s = 0;
|
|
413
|
-
} else if (l <= 0.5) {
|
|
414
|
-
s = delta / (max + min);
|
|
415
|
-
} else {
|
|
416
|
-
s = delta / (2 - max - min);
|
|
417
|
-
}
|
|
418
|
-
return [h, s * 100, l * 100];
|
|
419
|
-
};
|
|
420
|
-
convert.rgb.hsv = function(rgb) {
|
|
421
|
-
let rdif;
|
|
422
|
-
let gdif;
|
|
423
|
-
let bdif;
|
|
424
|
-
let h;
|
|
425
|
-
let s;
|
|
426
|
-
const r = rgb[0] / 255;
|
|
427
|
-
const g = rgb[1] / 255;
|
|
428
|
-
const b = rgb[2] / 255;
|
|
429
|
-
const v = Math.max(r, g, b);
|
|
430
|
-
const diff = v - Math.min(r, g, b);
|
|
431
|
-
const diffc = function(c) {
|
|
432
|
-
return (v - c) / 6 / diff + 1 / 2;
|
|
433
|
-
};
|
|
434
|
-
if (diff === 0) {
|
|
435
|
-
h = 0;
|
|
436
|
-
s = 0;
|
|
437
|
-
} else {
|
|
438
|
-
s = diff / v;
|
|
439
|
-
rdif = diffc(r);
|
|
440
|
-
gdif = diffc(g);
|
|
441
|
-
bdif = diffc(b);
|
|
442
|
-
if (r === v) {
|
|
443
|
-
h = bdif - gdif;
|
|
444
|
-
} else if (g === v) {
|
|
445
|
-
h = 1 / 3 + rdif - bdif;
|
|
446
|
-
} else if (b === v) {
|
|
447
|
-
h = 2 / 3 + gdif - rdif;
|
|
448
|
-
}
|
|
449
|
-
if (h < 0) {
|
|
450
|
-
h += 1;
|
|
451
|
-
} else if (h > 1) {
|
|
452
|
-
h -= 1;
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
return [
|
|
456
|
-
h * 360,
|
|
457
|
-
s * 100,
|
|
458
|
-
v * 100
|
|
459
|
-
];
|
|
460
|
-
};
|
|
461
|
-
convert.rgb.hwb = function(rgb) {
|
|
462
|
-
const r = rgb[0];
|
|
463
|
-
const g = rgb[1];
|
|
464
|
-
let b = rgb[2];
|
|
465
|
-
const h = convert.rgb.hsl(rgb)[0];
|
|
466
|
-
const w = 1 / 255 * Math.min(r, Math.min(g, b));
|
|
467
|
-
b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
|
|
468
|
-
return [h, w * 100, b * 100];
|
|
469
|
-
};
|
|
470
|
-
convert.rgb.cmyk = function(rgb) {
|
|
471
|
-
const r = rgb[0] / 255;
|
|
472
|
-
const g = rgb[1] / 255;
|
|
473
|
-
const b = rgb[2] / 255;
|
|
474
|
-
const k = Math.min(1 - r, 1 - g, 1 - b);
|
|
475
|
-
const c = (1 - r - k) / (1 - k) || 0;
|
|
476
|
-
const m = (1 - g - k) / (1 - k) || 0;
|
|
477
|
-
const y = (1 - b - k) / (1 - k) || 0;
|
|
478
|
-
return [c * 100, m * 100, y * 100, k * 100];
|
|
479
|
-
};
|
|
480
|
-
function comparativeDistance(x, y) {
|
|
481
|
-
return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
|
|
482
|
-
}
|
|
483
|
-
convert.rgb.keyword = function(rgb) {
|
|
484
|
-
const reversed = reverseKeywords[rgb];
|
|
485
|
-
if (reversed) {
|
|
486
|
-
return reversed;
|
|
487
|
-
}
|
|
488
|
-
let currentClosestDistance = Infinity;
|
|
489
|
-
let currentClosestKeyword;
|
|
490
|
-
for (const keyword of Object.keys(cssKeywords)) {
|
|
491
|
-
const value = cssKeywords[keyword];
|
|
492
|
-
const distance = comparativeDistance(rgb, value);
|
|
493
|
-
if (distance < currentClosestDistance) {
|
|
494
|
-
currentClosestDistance = distance;
|
|
495
|
-
currentClosestKeyword = keyword;
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
return currentClosestKeyword;
|
|
499
|
-
};
|
|
500
|
-
convert.keyword.rgb = function(keyword) {
|
|
501
|
-
return cssKeywords[keyword];
|
|
502
|
-
};
|
|
503
|
-
convert.rgb.xyz = function(rgb) {
|
|
504
|
-
let r = rgb[0] / 255;
|
|
505
|
-
let g = rgb[1] / 255;
|
|
506
|
-
let b = rgb[2] / 255;
|
|
507
|
-
r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
|
|
508
|
-
g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
|
|
509
|
-
b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
|
|
510
|
-
const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
|
|
511
|
-
const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
|
|
512
|
-
const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
|
|
513
|
-
return [x * 100, y * 100, z * 100];
|
|
514
|
-
};
|
|
515
|
-
convert.rgb.lab = function(rgb) {
|
|
516
|
-
const xyz = convert.rgb.xyz(rgb);
|
|
517
|
-
let x = xyz[0];
|
|
518
|
-
let y = xyz[1];
|
|
519
|
-
let z = xyz[2];
|
|
520
|
-
x /= 95.047;
|
|
521
|
-
y /= 100;
|
|
522
|
-
z /= 108.883;
|
|
523
|
-
x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
524
|
-
y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
525
|
-
z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
526
|
-
const l = 116 * y - 16;
|
|
527
|
-
const a = 500 * (x - y);
|
|
528
|
-
const b = 200 * (y - z);
|
|
529
|
-
return [l, a, b];
|
|
530
|
-
};
|
|
531
|
-
convert.hsl.rgb = function(hsl) {
|
|
532
|
-
const h = hsl[0] / 360;
|
|
533
|
-
const s = hsl[1] / 100;
|
|
534
|
-
const l = hsl[2] / 100;
|
|
535
|
-
let t2;
|
|
536
|
-
let t3;
|
|
537
|
-
let val;
|
|
538
|
-
if (s === 0) {
|
|
539
|
-
val = l * 255;
|
|
540
|
-
return [val, val, val];
|
|
541
|
-
}
|
|
542
|
-
if (l < 0.5) {
|
|
543
|
-
t2 = l * (1 + s);
|
|
544
|
-
} else {
|
|
545
|
-
t2 = l + s - l * s;
|
|
546
|
-
}
|
|
547
|
-
const t1 = 2 * l - t2;
|
|
548
|
-
const rgb = [0, 0, 0];
|
|
549
|
-
for (let i = 0; i < 3; i++) {
|
|
550
|
-
t3 = h + 1 / 3 * -(i - 1);
|
|
551
|
-
if (t3 < 0) {
|
|
552
|
-
t3++;
|
|
553
|
-
}
|
|
554
|
-
if (t3 > 1) {
|
|
555
|
-
t3--;
|
|
556
|
-
}
|
|
557
|
-
if (6 * t3 < 1) {
|
|
558
|
-
val = t1 + (t2 - t1) * 6 * t3;
|
|
559
|
-
} else if (2 * t3 < 1) {
|
|
560
|
-
val = t2;
|
|
561
|
-
} else if (3 * t3 < 2) {
|
|
562
|
-
val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
|
563
|
-
} else {
|
|
564
|
-
val = t1;
|
|
565
|
-
}
|
|
566
|
-
rgb[i] = val * 255;
|
|
567
|
-
}
|
|
568
|
-
return rgb;
|
|
569
|
-
};
|
|
570
|
-
convert.hsl.hsv = function(hsl) {
|
|
571
|
-
const h = hsl[0];
|
|
572
|
-
let s = hsl[1] / 100;
|
|
573
|
-
let l = hsl[2] / 100;
|
|
574
|
-
let smin = s;
|
|
575
|
-
const lmin = Math.max(l, 0.01);
|
|
576
|
-
l *= 2;
|
|
577
|
-
s *= l <= 1 ? l : 2 - l;
|
|
578
|
-
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
579
|
-
const v = (l + s) / 2;
|
|
580
|
-
const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
|
|
581
|
-
return [h, sv * 100, v * 100];
|
|
582
|
-
};
|
|
583
|
-
convert.hsv.rgb = function(hsv) {
|
|
584
|
-
const h = hsv[0] / 60;
|
|
585
|
-
const s = hsv[1] / 100;
|
|
586
|
-
let v = hsv[2] / 100;
|
|
587
|
-
const hi = Math.floor(h) % 6;
|
|
588
|
-
const f = h - Math.floor(h);
|
|
589
|
-
const p = 255 * v * (1 - s);
|
|
590
|
-
const q = 255 * v * (1 - s * f);
|
|
591
|
-
const t = 255 * v * (1 - s * (1 - f));
|
|
592
|
-
v *= 255;
|
|
593
|
-
switch (hi) {
|
|
594
|
-
case 0:
|
|
595
|
-
return [v, t, p];
|
|
596
|
-
case 1:
|
|
597
|
-
return [q, v, p];
|
|
598
|
-
case 2:
|
|
599
|
-
return [p, v, t];
|
|
600
|
-
case 3:
|
|
601
|
-
return [p, q, v];
|
|
602
|
-
case 4:
|
|
603
|
-
return [t, p, v];
|
|
604
|
-
case 5:
|
|
605
|
-
return [v, p, q];
|
|
606
|
-
}
|
|
607
|
-
};
|
|
608
|
-
convert.hsv.hsl = function(hsv) {
|
|
609
|
-
const h = hsv[0];
|
|
610
|
-
const s = hsv[1] / 100;
|
|
611
|
-
const v = hsv[2] / 100;
|
|
612
|
-
const vmin = Math.max(v, 0.01);
|
|
613
|
-
let sl;
|
|
614
|
-
let l;
|
|
615
|
-
l = (2 - s) * v;
|
|
616
|
-
const lmin = (2 - s) * vmin;
|
|
617
|
-
sl = s * vmin;
|
|
618
|
-
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
619
|
-
sl = sl || 0;
|
|
620
|
-
l /= 2;
|
|
621
|
-
return [h, sl * 100, l * 100];
|
|
622
|
-
};
|
|
623
|
-
convert.hwb.rgb = function(hwb) {
|
|
624
|
-
const h = hwb[0] / 360;
|
|
625
|
-
let wh = hwb[1] / 100;
|
|
626
|
-
let bl = hwb[2] / 100;
|
|
627
|
-
const ratio = wh + bl;
|
|
628
|
-
let f;
|
|
629
|
-
if (ratio > 1) {
|
|
630
|
-
wh /= ratio;
|
|
631
|
-
bl /= ratio;
|
|
632
|
-
}
|
|
633
|
-
const i = Math.floor(6 * h);
|
|
634
|
-
const v = 1 - bl;
|
|
635
|
-
f = 6 * h - i;
|
|
636
|
-
if ((i & 1) !== 0) {
|
|
637
|
-
f = 1 - f;
|
|
638
|
-
}
|
|
639
|
-
const n = wh + f * (v - wh);
|
|
640
|
-
let r;
|
|
641
|
-
let g;
|
|
642
|
-
let b;
|
|
643
|
-
switch (i) {
|
|
644
|
-
default:
|
|
645
|
-
case 6:
|
|
646
|
-
case 0:
|
|
647
|
-
r = v;
|
|
648
|
-
g = n;
|
|
649
|
-
b = wh;
|
|
650
|
-
break;
|
|
651
|
-
case 1:
|
|
652
|
-
r = n;
|
|
653
|
-
g = v;
|
|
654
|
-
b = wh;
|
|
655
|
-
break;
|
|
656
|
-
case 2:
|
|
657
|
-
r = wh;
|
|
658
|
-
g = v;
|
|
659
|
-
b = n;
|
|
660
|
-
break;
|
|
661
|
-
case 3:
|
|
662
|
-
r = wh;
|
|
663
|
-
g = n;
|
|
664
|
-
b = v;
|
|
665
|
-
break;
|
|
666
|
-
case 4:
|
|
667
|
-
r = n;
|
|
668
|
-
g = wh;
|
|
669
|
-
b = v;
|
|
670
|
-
break;
|
|
671
|
-
case 5:
|
|
672
|
-
r = v;
|
|
673
|
-
g = wh;
|
|
674
|
-
b = n;
|
|
675
|
-
break;
|
|
676
|
-
}
|
|
677
|
-
return [r * 255, g * 255, b * 255];
|
|
678
|
-
};
|
|
679
|
-
convert.cmyk.rgb = function(cmyk) {
|
|
680
|
-
const c = cmyk[0] / 100;
|
|
681
|
-
const m = cmyk[1] / 100;
|
|
682
|
-
const y = cmyk[2] / 100;
|
|
683
|
-
const k = cmyk[3] / 100;
|
|
684
|
-
const r = 1 - Math.min(1, c * (1 - k) + k);
|
|
685
|
-
const g = 1 - Math.min(1, m * (1 - k) + k);
|
|
686
|
-
const b = 1 - Math.min(1, y * (1 - k) + k);
|
|
687
|
-
return [r * 255, g * 255, b * 255];
|
|
688
|
-
};
|
|
689
|
-
convert.xyz.rgb = function(xyz) {
|
|
690
|
-
const x = xyz[0] / 100;
|
|
691
|
-
const y = xyz[1] / 100;
|
|
692
|
-
const z = xyz[2] / 100;
|
|
693
|
-
let r;
|
|
694
|
-
let g;
|
|
695
|
-
let b;
|
|
696
|
-
r = x * 3.2406 + y * -1.5372 + z * -0.4986;
|
|
697
|
-
g = x * -0.9689 + y * 1.8758 + z * 0.0415;
|
|
698
|
-
b = x * 0.0557 + y * -0.204 + z * 1.057;
|
|
699
|
-
r = r > 31308e-7 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92;
|
|
700
|
-
g = g > 31308e-7 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92;
|
|
701
|
-
b = b > 31308e-7 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92;
|
|
702
|
-
r = Math.min(Math.max(0, r), 1);
|
|
703
|
-
g = Math.min(Math.max(0, g), 1);
|
|
704
|
-
b = Math.min(Math.max(0, b), 1);
|
|
705
|
-
return [r * 255, g * 255, b * 255];
|
|
706
|
-
};
|
|
707
|
-
convert.xyz.lab = function(xyz) {
|
|
708
|
-
let x = xyz[0];
|
|
709
|
-
let y = xyz[1];
|
|
710
|
-
let z = xyz[2];
|
|
711
|
-
x /= 95.047;
|
|
712
|
-
y /= 100;
|
|
713
|
-
z /= 108.883;
|
|
714
|
-
x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
715
|
-
y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
716
|
-
z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
717
|
-
const l = 116 * y - 16;
|
|
718
|
-
const a = 500 * (x - y);
|
|
719
|
-
const b = 200 * (y - z);
|
|
720
|
-
return [l, a, b];
|
|
721
|
-
};
|
|
722
|
-
convert.lab.xyz = function(lab) {
|
|
723
|
-
const l = lab[0];
|
|
724
|
-
const a = lab[1];
|
|
725
|
-
const b = lab[2];
|
|
726
|
-
let x;
|
|
727
|
-
let y;
|
|
728
|
-
let z;
|
|
729
|
-
y = (l + 16) / 116;
|
|
730
|
-
x = a / 500 + y;
|
|
731
|
-
z = y - b / 200;
|
|
732
|
-
const y2 = y ** 3;
|
|
733
|
-
const x2 = x ** 3;
|
|
734
|
-
const z2 = z ** 3;
|
|
735
|
-
y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787;
|
|
736
|
-
x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787;
|
|
737
|
-
z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787;
|
|
738
|
-
x *= 95.047;
|
|
739
|
-
y *= 100;
|
|
740
|
-
z *= 108.883;
|
|
741
|
-
return [x, y, z];
|
|
742
|
-
};
|
|
743
|
-
convert.lab.lch = function(lab) {
|
|
744
|
-
const l = lab[0];
|
|
745
|
-
const a = lab[1];
|
|
746
|
-
const b = lab[2];
|
|
747
|
-
let h;
|
|
748
|
-
const hr = Math.atan2(b, a);
|
|
749
|
-
h = hr * 360 / 2 / Math.PI;
|
|
750
|
-
if (h < 0) {
|
|
751
|
-
h += 360;
|
|
752
|
-
}
|
|
753
|
-
const c = Math.sqrt(a * a + b * b);
|
|
754
|
-
return [l, c, h];
|
|
755
|
-
};
|
|
756
|
-
convert.lch.lab = function(lch) {
|
|
757
|
-
const l = lch[0];
|
|
758
|
-
const c = lch[1];
|
|
759
|
-
const h = lch[2];
|
|
760
|
-
const hr = h / 360 * 2 * Math.PI;
|
|
761
|
-
const a = c * Math.cos(hr);
|
|
762
|
-
const b = c * Math.sin(hr);
|
|
763
|
-
return [l, a, b];
|
|
764
|
-
};
|
|
765
|
-
convert.rgb.ansi16 = function(args, saturation = null) {
|
|
766
|
-
const [r, g, b] = args;
|
|
767
|
-
let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
|
|
768
|
-
value = Math.round(value / 50);
|
|
769
|
-
if (value === 0) {
|
|
770
|
-
return 30;
|
|
771
|
-
}
|
|
772
|
-
let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
|
|
773
|
-
if (value === 2) {
|
|
774
|
-
ansi += 60;
|
|
775
|
-
}
|
|
776
|
-
return ansi;
|
|
777
|
-
};
|
|
778
|
-
convert.hsv.ansi16 = function(args) {
|
|
779
|
-
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
|
780
|
-
};
|
|
781
|
-
convert.rgb.ansi256 = function(args) {
|
|
782
|
-
const r = args[0];
|
|
783
|
-
const g = args[1];
|
|
784
|
-
const b = args[2];
|
|
785
|
-
if (r === g && g === b) {
|
|
786
|
-
if (r < 8) {
|
|
787
|
-
return 16;
|
|
788
|
-
}
|
|
789
|
-
if (r > 248) {
|
|
790
|
-
return 231;
|
|
791
|
-
}
|
|
792
|
-
return Math.round((r - 8) / 247 * 24) + 232;
|
|
793
|
-
}
|
|
794
|
-
const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
|
|
795
|
-
return ansi;
|
|
796
|
-
};
|
|
797
|
-
convert.ansi16.rgb = function(args) {
|
|
798
|
-
let color2 = args % 10;
|
|
799
|
-
if (color2 === 0 || color2 === 7) {
|
|
800
|
-
if (args > 50) {
|
|
801
|
-
color2 += 3.5;
|
|
802
|
-
}
|
|
803
|
-
color2 = color2 / 10.5 * 255;
|
|
804
|
-
return [color2, color2, color2];
|
|
805
|
-
}
|
|
806
|
-
const mult = (~~(args > 50) + 1) * 0.5;
|
|
807
|
-
const r = (color2 & 1) * mult * 255;
|
|
808
|
-
const g = (color2 >> 1 & 1) * mult * 255;
|
|
809
|
-
const b = (color2 >> 2 & 1) * mult * 255;
|
|
810
|
-
return [r, g, b];
|
|
811
|
-
};
|
|
812
|
-
convert.ansi256.rgb = function(args) {
|
|
813
|
-
if (args >= 232) {
|
|
814
|
-
const c = (args - 232) * 10 + 8;
|
|
815
|
-
return [c, c, c];
|
|
816
|
-
}
|
|
817
|
-
args -= 16;
|
|
818
|
-
let rem;
|
|
819
|
-
const r = Math.floor(args / 36) / 5 * 255;
|
|
820
|
-
const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
|
|
821
|
-
const b = rem % 6 / 5 * 255;
|
|
822
|
-
return [r, g, b];
|
|
823
|
-
};
|
|
824
|
-
convert.rgb.hex = function(args) {
|
|
825
|
-
const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
|
|
826
|
-
const string = integer.toString(16).toUpperCase();
|
|
827
|
-
return "000000".substring(string.length) + string;
|
|
828
|
-
};
|
|
829
|
-
convert.hex.rgb = function(args) {
|
|
830
|
-
const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
831
|
-
if (!match) {
|
|
832
|
-
return [0, 0, 0];
|
|
833
|
-
}
|
|
834
|
-
let colorString = match[0];
|
|
835
|
-
if (match[0].length === 3) {
|
|
836
|
-
colorString = colorString.split("").map((char) => {
|
|
837
|
-
return char + char;
|
|
838
|
-
}).join("");
|
|
839
|
-
}
|
|
840
|
-
const integer = parseInt(colorString, 16);
|
|
841
|
-
const r = integer >> 16 & 255;
|
|
842
|
-
const g = integer >> 8 & 255;
|
|
843
|
-
const b = integer & 255;
|
|
844
|
-
return [r, g, b];
|
|
845
|
-
};
|
|
846
|
-
convert.rgb.hcg = function(rgb) {
|
|
847
|
-
const r = rgb[0] / 255;
|
|
848
|
-
const g = rgb[1] / 255;
|
|
849
|
-
const b = rgb[2] / 255;
|
|
850
|
-
const max = Math.max(Math.max(r, g), b);
|
|
851
|
-
const min = Math.min(Math.min(r, g), b);
|
|
852
|
-
const chroma = max - min;
|
|
853
|
-
let grayscale;
|
|
854
|
-
let hue;
|
|
855
|
-
if (chroma < 1) {
|
|
856
|
-
grayscale = min / (1 - chroma);
|
|
857
|
-
} else {
|
|
858
|
-
grayscale = 0;
|
|
859
|
-
}
|
|
860
|
-
if (chroma <= 0) {
|
|
861
|
-
hue = 0;
|
|
862
|
-
} else if (max === r) {
|
|
863
|
-
hue = (g - b) / chroma % 6;
|
|
864
|
-
} else if (max === g) {
|
|
865
|
-
hue = 2 + (b - r) / chroma;
|
|
866
|
-
} else {
|
|
867
|
-
hue = 4 + (r - g) / chroma;
|
|
868
|
-
}
|
|
869
|
-
hue /= 6;
|
|
870
|
-
hue %= 1;
|
|
871
|
-
return [hue * 360, chroma * 100, grayscale * 100];
|
|
872
|
-
};
|
|
873
|
-
convert.hsl.hcg = function(hsl) {
|
|
874
|
-
const s = hsl[1] / 100;
|
|
875
|
-
const l = hsl[2] / 100;
|
|
876
|
-
const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l);
|
|
877
|
-
let f = 0;
|
|
878
|
-
if (c < 1) {
|
|
879
|
-
f = (l - 0.5 * c) / (1 - c);
|
|
880
|
-
}
|
|
881
|
-
return [hsl[0], c * 100, f * 100];
|
|
882
|
-
};
|
|
883
|
-
convert.hsv.hcg = function(hsv) {
|
|
884
|
-
const s = hsv[1] / 100;
|
|
885
|
-
const v = hsv[2] / 100;
|
|
886
|
-
const c = s * v;
|
|
887
|
-
let f = 0;
|
|
888
|
-
if (c < 1) {
|
|
889
|
-
f = (v - c) / (1 - c);
|
|
890
|
-
}
|
|
891
|
-
return [hsv[0], c * 100, f * 100];
|
|
892
|
-
};
|
|
893
|
-
convert.hcg.rgb = function(hcg) {
|
|
894
|
-
const h = hcg[0] / 360;
|
|
895
|
-
const c = hcg[1] / 100;
|
|
896
|
-
const g = hcg[2] / 100;
|
|
897
|
-
if (c === 0) {
|
|
898
|
-
return [g * 255, g * 255, g * 255];
|
|
899
|
-
}
|
|
900
|
-
const pure = [0, 0, 0];
|
|
901
|
-
const hi = h % 1 * 6;
|
|
902
|
-
const v = hi % 1;
|
|
903
|
-
const w = 1 - v;
|
|
904
|
-
let mg = 0;
|
|
905
|
-
switch (Math.floor(hi)) {
|
|
906
|
-
case 0:
|
|
907
|
-
pure[0] = 1;
|
|
908
|
-
pure[1] = v;
|
|
909
|
-
pure[2] = 0;
|
|
910
|
-
break;
|
|
911
|
-
case 1:
|
|
912
|
-
pure[0] = w;
|
|
913
|
-
pure[1] = 1;
|
|
914
|
-
pure[2] = 0;
|
|
915
|
-
break;
|
|
916
|
-
case 2:
|
|
917
|
-
pure[0] = 0;
|
|
918
|
-
pure[1] = 1;
|
|
919
|
-
pure[2] = v;
|
|
920
|
-
break;
|
|
921
|
-
case 3:
|
|
922
|
-
pure[0] = 0;
|
|
923
|
-
pure[1] = w;
|
|
924
|
-
pure[2] = 1;
|
|
925
|
-
break;
|
|
926
|
-
case 4:
|
|
927
|
-
pure[0] = v;
|
|
928
|
-
pure[1] = 0;
|
|
929
|
-
pure[2] = 1;
|
|
930
|
-
break;
|
|
931
|
-
default:
|
|
932
|
-
pure[0] = 1;
|
|
933
|
-
pure[1] = 0;
|
|
934
|
-
pure[2] = w;
|
|
935
|
-
}
|
|
936
|
-
mg = (1 - c) * g;
|
|
937
|
-
return [
|
|
938
|
-
(c * pure[0] + mg) * 255,
|
|
939
|
-
(c * pure[1] + mg) * 255,
|
|
940
|
-
(c * pure[2] + mg) * 255
|
|
941
|
-
];
|
|
942
|
-
};
|
|
943
|
-
convert.hcg.hsv = function(hcg) {
|
|
944
|
-
const c = hcg[1] / 100;
|
|
945
|
-
const g = hcg[2] / 100;
|
|
946
|
-
const v = c + g * (1 - c);
|
|
947
|
-
let f = 0;
|
|
948
|
-
if (v > 0) {
|
|
949
|
-
f = c / v;
|
|
950
|
-
}
|
|
951
|
-
return [hcg[0], f * 100, v * 100];
|
|
952
|
-
};
|
|
953
|
-
convert.hcg.hsl = function(hcg) {
|
|
954
|
-
const c = hcg[1] / 100;
|
|
955
|
-
const g = hcg[2] / 100;
|
|
956
|
-
const l = g * (1 - c) + 0.5 * c;
|
|
957
|
-
let s = 0;
|
|
958
|
-
if (l > 0 && l < 0.5) {
|
|
959
|
-
s = c / (2 * l);
|
|
960
|
-
} else if (l >= 0.5 && l < 1) {
|
|
961
|
-
s = c / (2 * (1 - l));
|
|
962
|
-
}
|
|
963
|
-
return [hcg[0], s * 100, l * 100];
|
|
964
|
-
};
|
|
965
|
-
convert.hcg.hwb = function(hcg) {
|
|
966
|
-
const c = hcg[1] / 100;
|
|
967
|
-
const g = hcg[2] / 100;
|
|
968
|
-
const v = c + g * (1 - c);
|
|
969
|
-
return [hcg[0], (v - c) * 100, (1 - v) * 100];
|
|
970
|
-
};
|
|
971
|
-
convert.hwb.hcg = function(hwb) {
|
|
972
|
-
const w = hwb[1] / 100;
|
|
973
|
-
const b = hwb[2] / 100;
|
|
974
|
-
const v = 1 - b;
|
|
975
|
-
const c = v - w;
|
|
976
|
-
let g = 0;
|
|
977
|
-
if (c < 1) {
|
|
978
|
-
g = (v - c) / (1 - c);
|
|
979
|
-
}
|
|
980
|
-
return [hwb[0], c * 100, g * 100];
|
|
981
|
-
};
|
|
982
|
-
convert.apple.rgb = function(apple) {
|
|
983
|
-
return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
|
|
984
|
-
};
|
|
985
|
-
convert.rgb.apple = function(rgb) {
|
|
986
|
-
return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
|
|
987
|
-
};
|
|
988
|
-
convert.gray.rgb = function(args) {
|
|
989
|
-
return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
|
|
990
|
-
};
|
|
991
|
-
convert.gray.hsl = function(args) {
|
|
992
|
-
return [0, 0, args[0]];
|
|
993
|
-
};
|
|
994
|
-
convert.gray.hsv = convert.gray.hsl;
|
|
995
|
-
convert.gray.hwb = function(gray2) {
|
|
996
|
-
return [0, 100, gray2[0]];
|
|
997
|
-
};
|
|
998
|
-
convert.gray.cmyk = function(gray2) {
|
|
999
|
-
return [0, 0, 0, gray2[0]];
|
|
1000
|
-
};
|
|
1001
|
-
convert.gray.lab = function(gray2) {
|
|
1002
|
-
return [gray2[0], 0, 0];
|
|
1003
|
-
};
|
|
1004
|
-
convert.gray.hex = function(gray2) {
|
|
1005
|
-
const val = Math.round(gray2[0] / 100 * 255) & 255;
|
|
1006
|
-
const integer = (val << 16) + (val << 8) + val;
|
|
1007
|
-
const string = integer.toString(16).toUpperCase();
|
|
1008
|
-
return "000000".substring(string.length) + string;
|
|
1009
|
-
};
|
|
1010
|
-
convert.rgb.gray = function(rgb) {
|
|
1011
|
-
const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
1012
|
-
return [val / 255 * 100];
|
|
1013
|
-
};
|
|
1014
|
-
}
|
|
1015
|
-
});
|
|
1016
|
-
|
|
1017
|
-
// ../../node_modules/color-convert/route.js
|
|
1018
|
-
var require_route = __commonJS({
|
|
1019
|
-
"../../node_modules/color-convert/route.js"(exports, module) {
|
|
1020
|
-
var conversions = require_conversions();
|
|
1021
|
-
function buildGraph() {
|
|
1022
|
-
const graph = {};
|
|
1023
|
-
const models = Object.keys(conversions);
|
|
1024
|
-
for (let len = models.length, i = 0; i < len; i++) {
|
|
1025
|
-
graph[models[i]] = {
|
|
1026
|
-
// http://jsperf.com/1-vs-infinity
|
|
1027
|
-
// micro-opt, but this is simple.
|
|
1028
|
-
distance: -1,
|
|
1029
|
-
parent: null
|
|
1030
|
-
};
|
|
1031
|
-
}
|
|
1032
|
-
return graph;
|
|
1033
|
-
}
|
|
1034
|
-
function deriveBFS(fromModel) {
|
|
1035
|
-
const graph = buildGraph();
|
|
1036
|
-
const queue = [fromModel];
|
|
1037
|
-
graph[fromModel].distance = 0;
|
|
1038
|
-
while (queue.length) {
|
|
1039
|
-
const current = queue.pop();
|
|
1040
|
-
const adjacents = Object.keys(conversions[current]);
|
|
1041
|
-
for (let len = adjacents.length, i = 0; i < len; i++) {
|
|
1042
|
-
const adjacent = adjacents[i];
|
|
1043
|
-
const node = graph[adjacent];
|
|
1044
|
-
if (node.distance === -1) {
|
|
1045
|
-
node.distance = graph[current].distance + 1;
|
|
1046
|
-
node.parent = current;
|
|
1047
|
-
queue.unshift(adjacent);
|
|
1048
|
-
}
|
|
1049
|
-
}
|
|
1050
|
-
}
|
|
1051
|
-
return graph;
|
|
1052
|
-
}
|
|
1053
|
-
function link(from, to) {
|
|
1054
|
-
return function(args) {
|
|
1055
|
-
return to(from(args));
|
|
1056
|
-
};
|
|
1057
|
-
}
|
|
1058
|
-
function wrapConversion(toModel, graph) {
|
|
1059
|
-
const path = [graph[toModel].parent, toModel];
|
|
1060
|
-
let fn = conversions[graph[toModel].parent][toModel];
|
|
1061
|
-
let cur = graph[toModel].parent;
|
|
1062
|
-
while (graph[cur].parent) {
|
|
1063
|
-
path.unshift(graph[cur].parent);
|
|
1064
|
-
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
1065
|
-
cur = graph[cur].parent;
|
|
1066
|
-
}
|
|
1067
|
-
fn.conversion = path;
|
|
1068
|
-
return fn;
|
|
1069
|
-
}
|
|
1070
|
-
module.exports = function(fromModel) {
|
|
1071
|
-
const graph = deriveBFS(fromModel);
|
|
1072
|
-
const conversion = {};
|
|
1073
|
-
const models = Object.keys(graph);
|
|
1074
|
-
for (let len = models.length, i = 0; i < len; i++) {
|
|
1075
|
-
const toModel = models[i];
|
|
1076
|
-
const node = graph[toModel];
|
|
1077
|
-
if (node.parent === null) {
|
|
1078
|
-
continue;
|
|
1079
|
-
}
|
|
1080
|
-
conversion[toModel] = wrapConversion(toModel, graph);
|
|
1081
|
-
}
|
|
1082
|
-
return conversion;
|
|
1083
|
-
};
|
|
1084
|
-
}
|
|
1085
|
-
});
|
|
1086
|
-
|
|
1087
|
-
// ../../node_modules/color-convert/index.js
|
|
1088
|
-
var require_color_convert = __commonJS({
|
|
1089
|
-
"../../node_modules/color-convert/index.js"(exports, module) {
|
|
1090
|
-
var conversions = require_conversions();
|
|
1091
|
-
var route = require_route();
|
|
1092
|
-
var convert = {};
|
|
1093
|
-
var models = Object.keys(conversions);
|
|
1094
|
-
function wrapRaw(fn) {
|
|
1095
|
-
const wrappedFn = function(...args) {
|
|
1096
|
-
const arg0 = args[0];
|
|
1097
|
-
if (arg0 === void 0 || arg0 === null) {
|
|
1098
|
-
return arg0;
|
|
1099
|
-
}
|
|
1100
|
-
if (arg0.length > 1) {
|
|
1101
|
-
args = arg0;
|
|
1102
|
-
}
|
|
1103
|
-
return fn(args);
|
|
1104
|
-
};
|
|
1105
|
-
if ("conversion" in fn) {
|
|
1106
|
-
wrappedFn.conversion = fn.conversion;
|
|
1107
|
-
}
|
|
1108
|
-
return wrappedFn;
|
|
1109
|
-
}
|
|
1110
|
-
function wrapRounded(fn) {
|
|
1111
|
-
const wrappedFn = function(...args) {
|
|
1112
|
-
const arg0 = args[0];
|
|
1113
|
-
if (arg0 === void 0 || arg0 === null) {
|
|
1114
|
-
return arg0;
|
|
1115
|
-
}
|
|
1116
|
-
if (arg0.length > 1) {
|
|
1117
|
-
args = arg0;
|
|
1118
|
-
}
|
|
1119
|
-
const result = fn(args);
|
|
1120
|
-
if (typeof result === "object") {
|
|
1121
|
-
for (let len = result.length, i = 0; i < len; i++) {
|
|
1122
|
-
result[i] = Math.round(result[i]);
|
|
1123
|
-
}
|
|
1124
|
-
}
|
|
1125
|
-
return result;
|
|
1126
|
-
};
|
|
1127
|
-
if ("conversion" in fn) {
|
|
1128
|
-
wrappedFn.conversion = fn.conversion;
|
|
1129
|
-
}
|
|
1130
|
-
return wrappedFn;
|
|
1131
|
-
}
|
|
1132
|
-
models.forEach((fromModel) => {
|
|
1133
|
-
convert[fromModel] = {};
|
|
1134
|
-
Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels });
|
|
1135
|
-
Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels });
|
|
1136
|
-
const routes = route(fromModel);
|
|
1137
|
-
const routeModels = Object.keys(routes);
|
|
1138
|
-
routeModels.forEach((toModel) => {
|
|
1139
|
-
const fn = routes[toModel];
|
|
1140
|
-
convert[fromModel][toModel] = wrapRounded(fn);
|
|
1141
|
-
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
1142
|
-
});
|
|
1143
|
-
});
|
|
1144
|
-
module.exports = convert;
|
|
1145
|
-
}
|
|
1146
|
-
});
|
|
1147
|
-
|
|
1148
|
-
// ../../node_modules/ansi-styles/index.js
|
|
1149
|
-
var require_ansi_styles = __commonJS({
|
|
1150
|
-
"../../node_modules/ansi-styles/index.js"(exports, module) {
|
|
1151
|
-
"use strict";
|
|
1152
|
-
var wrapAnsi16 = (fn, offset) => (...args) => {
|
|
1153
|
-
const code = fn(...args);
|
|
1154
|
-
return `\x1B[${code + offset}m`;
|
|
1155
|
-
};
|
|
1156
|
-
var wrapAnsi256 = (fn, offset) => (...args) => {
|
|
1157
|
-
const code = fn(...args);
|
|
1158
|
-
return `\x1B[${38 + offset};5;${code}m`;
|
|
1159
|
-
};
|
|
1160
|
-
var wrapAnsi16m = (fn, offset) => (...args) => {
|
|
1161
|
-
const rgb = fn(...args);
|
|
1162
|
-
return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
|
1163
|
-
};
|
|
1164
|
-
var ansi2ansi = (n) => n;
|
|
1165
|
-
var rgb2rgb = (r, g, b) => [r, g, b];
|
|
1166
|
-
var setLazyProperty = (object, property, get) => {
|
|
1167
|
-
Object.defineProperty(object, property, {
|
|
1168
|
-
get: () => {
|
|
1169
|
-
const value = get();
|
|
1170
|
-
Object.defineProperty(object, property, {
|
|
1171
|
-
value,
|
|
1172
|
-
enumerable: true,
|
|
1173
|
-
configurable: true
|
|
1174
|
-
});
|
|
1175
|
-
return value;
|
|
1176
|
-
},
|
|
1177
|
-
enumerable: true,
|
|
1178
|
-
configurable: true
|
|
1179
|
-
});
|
|
1180
|
-
};
|
|
1181
|
-
var colorConvert;
|
|
1182
|
-
var makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
|
|
1183
|
-
if (colorConvert === void 0) {
|
|
1184
|
-
colorConvert = require_color_convert();
|
|
1185
|
-
}
|
|
1186
|
-
const offset = isBackground ? 10 : 0;
|
|
1187
|
-
const styles2 = {};
|
|
1188
|
-
for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
|
|
1189
|
-
const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
|
|
1190
|
-
if (sourceSpace === targetSpace) {
|
|
1191
|
-
styles2[name] = wrap(identity, offset);
|
|
1192
|
-
} else if (typeof suite === "object") {
|
|
1193
|
-
styles2[name] = wrap(suite[targetSpace], offset);
|
|
1194
|
-
}
|
|
1195
|
-
}
|
|
1196
|
-
return styles2;
|
|
1197
|
-
};
|
|
1198
|
-
function assembleStyles() {
|
|
1199
|
-
const codes = /* @__PURE__ */ new Map();
|
|
1200
|
-
const styles2 = {
|
|
1201
|
-
modifier: {
|
|
1202
|
-
reset: [0, 0],
|
|
1203
|
-
// 21 isn't widely supported and 22 does the same thing
|
|
1204
|
-
bold: [1, 22],
|
|
1205
|
-
dim: [2, 22],
|
|
1206
|
-
italic: [3, 23],
|
|
1207
|
-
underline: [4, 24],
|
|
1208
|
-
inverse: [7, 27],
|
|
1209
|
-
hidden: [8, 28],
|
|
1210
|
-
strikethrough: [9, 29]
|
|
1211
|
-
},
|
|
1212
|
-
color: {
|
|
1213
|
-
black: [30, 39],
|
|
1214
|
-
red: [31, 39],
|
|
1215
|
-
green: [32, 39],
|
|
1216
|
-
yellow: [33, 39],
|
|
1217
|
-
blue: [34, 39],
|
|
1218
|
-
magenta: [35, 39],
|
|
1219
|
-
cyan: [36, 39],
|
|
1220
|
-
white: [37, 39],
|
|
1221
|
-
// Bright color
|
|
1222
|
-
blackBright: [90, 39],
|
|
1223
|
-
redBright: [91, 39],
|
|
1224
|
-
greenBright: [92, 39],
|
|
1225
|
-
yellowBright: [93, 39],
|
|
1226
|
-
blueBright: [94, 39],
|
|
1227
|
-
magentaBright: [95, 39],
|
|
1228
|
-
cyanBright: [96, 39],
|
|
1229
|
-
whiteBright: [97, 39]
|
|
1230
|
-
},
|
|
1231
|
-
bgColor: {
|
|
1232
|
-
bgBlack: [40, 49],
|
|
1233
|
-
bgRed: [41, 49],
|
|
1234
|
-
bgGreen: [42, 49],
|
|
1235
|
-
bgYellow: [43, 49],
|
|
1236
|
-
bgBlue: [44, 49],
|
|
1237
|
-
bgMagenta: [45, 49],
|
|
1238
|
-
bgCyan: [46, 49],
|
|
1239
|
-
bgWhite: [47, 49],
|
|
1240
|
-
// Bright color
|
|
1241
|
-
bgBlackBright: [100, 49],
|
|
1242
|
-
bgRedBright: [101, 49],
|
|
1243
|
-
bgGreenBright: [102, 49],
|
|
1244
|
-
bgYellowBright: [103, 49],
|
|
1245
|
-
bgBlueBright: [104, 49],
|
|
1246
|
-
bgMagentaBright: [105, 49],
|
|
1247
|
-
bgCyanBright: [106, 49],
|
|
1248
|
-
bgWhiteBright: [107, 49]
|
|
1249
|
-
}
|
|
1250
|
-
};
|
|
1251
|
-
styles2.color.gray = styles2.color.blackBright;
|
|
1252
|
-
styles2.bgColor.bgGray = styles2.bgColor.bgBlackBright;
|
|
1253
|
-
styles2.color.grey = styles2.color.blackBright;
|
|
1254
|
-
styles2.bgColor.bgGrey = styles2.bgColor.bgBlackBright;
|
|
1255
|
-
for (const [groupName, group] of Object.entries(styles2)) {
|
|
1256
|
-
for (const [styleName, style] of Object.entries(group)) {
|
|
1257
|
-
styles2[styleName] = {
|
|
1258
|
-
open: `\x1B[${style[0]}m`,
|
|
1259
|
-
close: `\x1B[${style[1]}m`
|
|
1260
|
-
};
|
|
1261
|
-
group[styleName] = styles2[styleName];
|
|
1262
|
-
codes.set(style[0], style[1]);
|
|
1263
|
-
}
|
|
1264
|
-
Object.defineProperty(styles2, groupName, {
|
|
1265
|
-
value: group,
|
|
1266
|
-
enumerable: false
|
|
1267
|
-
});
|
|
1268
|
-
}
|
|
1269
|
-
Object.defineProperty(styles2, "codes", {
|
|
1270
|
-
value: codes,
|
|
1271
|
-
enumerable: false
|
|
1272
|
-
});
|
|
1273
|
-
styles2.color.close = "\x1B[39m";
|
|
1274
|
-
styles2.bgColor.close = "\x1B[49m";
|
|
1275
|
-
setLazyProperty(styles2.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
|
|
1276
|
-
setLazyProperty(styles2.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
|
|
1277
|
-
setLazyProperty(styles2.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
|
|
1278
|
-
setLazyProperty(styles2.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
|
|
1279
|
-
setLazyProperty(styles2.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
|
|
1280
|
-
setLazyProperty(styles2.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
|
|
1281
|
-
return styles2;
|
|
1282
|
-
}
|
|
1283
|
-
Object.defineProperty(module, "exports", {
|
|
1284
|
-
enumerable: true,
|
|
1285
|
-
get: assembleStyles
|
|
1286
|
-
});
|
|
1287
|
-
}
|
|
1288
|
-
});
|
|
1289
|
-
|
|
1290
|
-
// ../../node_modules/@inquirer/core/node_modules/wrap-ansi/index.js
|
|
1291
|
-
var require_wrap_ansi = __commonJS({
|
|
1292
|
-
"../../node_modules/@inquirer/core/node_modules/wrap-ansi/index.js"(exports, module) {
|
|
1293
|
-
"use strict";
|
|
1294
|
-
var stringWidth = require_string_width();
|
|
1295
|
-
var stripAnsi2 = require_strip_ansi();
|
|
1296
|
-
var ansiStyles = require_ansi_styles();
|
|
1297
|
-
var ESCAPES = /* @__PURE__ */ new Set([
|
|
1298
|
-
"\x1B",
|
|
1299
|
-
"\x9B"
|
|
1300
|
-
]);
|
|
1301
|
-
var END_CODE = 39;
|
|
1302
|
-
var wrapAnsi2 = (code) => `${ESCAPES.values().next().value}[${code}m`;
|
|
1303
|
-
var wordLengths = (string) => string.split(" ").map((character) => stringWidth(character));
|
|
1304
|
-
var wrapWord = (rows, word, columns) => {
|
|
1305
|
-
const characters = [...word];
|
|
1306
|
-
let isInsideEscape = false;
|
|
1307
|
-
let visible = stringWidth(stripAnsi2(rows[rows.length - 1]));
|
|
1308
|
-
for (const [index, character] of characters.entries()) {
|
|
1309
|
-
const characterLength = stringWidth(character);
|
|
1310
|
-
if (visible + characterLength <= columns) {
|
|
1311
|
-
rows[rows.length - 1] += character;
|
|
1312
|
-
} else {
|
|
1313
|
-
rows.push(character);
|
|
1314
|
-
visible = 0;
|
|
1315
|
-
}
|
|
1316
|
-
if (ESCAPES.has(character)) {
|
|
1317
|
-
isInsideEscape = true;
|
|
1318
|
-
} else if (isInsideEscape && character === "m") {
|
|
1319
|
-
isInsideEscape = false;
|
|
1320
|
-
continue;
|
|
1321
|
-
}
|
|
1322
|
-
if (isInsideEscape) {
|
|
1323
|
-
continue;
|
|
1324
|
-
}
|
|
1325
|
-
visible += characterLength;
|
|
1326
|
-
if (visible === columns && index < characters.length - 1) {
|
|
1327
|
-
rows.push("");
|
|
1328
|
-
visible = 0;
|
|
1329
|
-
}
|
|
1330
|
-
}
|
|
1331
|
-
if (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) {
|
|
1332
|
-
rows[rows.length - 2] += rows.pop();
|
|
1333
|
-
}
|
|
1334
|
-
};
|
|
1335
|
-
var stringVisibleTrimSpacesRight = (str) => {
|
|
1336
|
-
const words = str.split(" ");
|
|
1337
|
-
let last = words.length;
|
|
1338
|
-
while (last > 0) {
|
|
1339
|
-
if (stringWidth(words[last - 1]) > 0) {
|
|
1340
|
-
break;
|
|
1341
|
-
}
|
|
1342
|
-
last--;
|
|
1343
|
-
}
|
|
1344
|
-
if (last === words.length) {
|
|
1345
|
-
return str;
|
|
1346
|
-
}
|
|
1347
|
-
return words.slice(0, last).join(" ") + words.slice(last).join("");
|
|
1348
|
-
};
|
|
1349
|
-
var exec = (string, columns, options = {}) => {
|
|
1350
|
-
if (options.trim !== false && string.trim() === "") {
|
|
1351
|
-
return "";
|
|
1352
|
-
}
|
|
1353
|
-
let pre = "";
|
|
1354
|
-
let ret = "";
|
|
1355
|
-
let escapeCode;
|
|
1356
|
-
const lengths = wordLengths(string);
|
|
1357
|
-
let rows = [""];
|
|
1358
|
-
for (const [index, word] of string.split(" ").entries()) {
|
|
1359
|
-
if (options.trim !== false) {
|
|
1360
|
-
rows[rows.length - 1] = rows[rows.length - 1].trimLeft();
|
|
1361
|
-
}
|
|
1362
|
-
let rowLength = stringWidth(rows[rows.length - 1]);
|
|
1363
|
-
if (index !== 0) {
|
|
1364
|
-
if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
|
|
1365
|
-
rows.push("");
|
|
1366
|
-
rowLength = 0;
|
|
1367
|
-
}
|
|
1368
|
-
if (rowLength > 0 || options.trim === false) {
|
|
1369
|
-
rows[rows.length - 1] += " ";
|
|
1370
|
-
rowLength++;
|
|
1371
|
-
}
|
|
1372
|
-
}
|
|
1373
|
-
if (options.hard && lengths[index] > columns) {
|
|
1374
|
-
const remainingColumns = columns - rowLength;
|
|
1375
|
-
const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
|
|
1376
|
-
const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);
|
|
1377
|
-
if (breaksStartingNextLine < breaksStartingThisLine) {
|
|
1378
|
-
rows.push("");
|
|
1379
|
-
}
|
|
1380
|
-
wrapWord(rows, word, columns);
|
|
1381
|
-
continue;
|
|
1382
|
-
}
|
|
1383
|
-
if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {
|
|
1384
|
-
if (options.wordWrap === false && rowLength < columns) {
|
|
1385
|
-
wrapWord(rows, word, columns);
|
|
1386
|
-
continue;
|
|
1387
|
-
}
|
|
1388
|
-
rows.push("");
|
|
1389
|
-
}
|
|
1390
|
-
if (rowLength + lengths[index] > columns && options.wordWrap === false) {
|
|
1391
|
-
wrapWord(rows, word, columns);
|
|
1392
|
-
continue;
|
|
1393
|
-
}
|
|
1394
|
-
rows[rows.length - 1] += word;
|
|
1395
|
-
}
|
|
1396
|
-
if (options.trim !== false) {
|
|
1397
|
-
rows = rows.map(stringVisibleTrimSpacesRight);
|
|
1398
|
-
}
|
|
1399
|
-
pre = rows.join("\n");
|
|
1400
|
-
for (const [index, character] of [...pre].entries()) {
|
|
1401
|
-
ret += character;
|
|
1402
|
-
if (ESCAPES.has(character)) {
|
|
1403
|
-
const code2 = parseFloat(/\d[^m]*/.exec(pre.slice(index, index + 4)));
|
|
1404
|
-
escapeCode = code2 === END_CODE ? null : code2;
|
|
1405
|
-
}
|
|
1406
|
-
const code = ansiStyles.codes.get(Number(escapeCode));
|
|
1407
|
-
if (escapeCode && code) {
|
|
1408
|
-
if (pre[index + 1] === "\n") {
|
|
1409
|
-
ret += wrapAnsi2(code);
|
|
1410
|
-
} else if (character === "\n") {
|
|
1411
|
-
ret += wrapAnsi2(escapeCode);
|
|
1412
|
-
}
|
|
1413
|
-
}
|
|
1414
|
-
}
|
|
1415
|
-
return ret;
|
|
1416
|
-
};
|
|
1417
|
-
module.exports = (string, columns, options) => {
|
|
1418
|
-
return String(string).normalize().replace(/\r\n/g, "\n").split("\n").map((line) => exec(line, columns, options)).join("\n");
|
|
1419
|
-
};
|
|
1420
|
-
}
|
|
1421
|
-
});
|
|
1422
|
-
|
|
1423
13
|
// ../utils/src/file-loader.ts
|
|
1424
14
|
var init_file_loader = __esm({
|
|
1425
15
|
"../utils/src/file-loader.ts"() {
|
|
@@ -2055,592 +645,6 @@ import {
|
|
|
2055
645
|
} from "colorette";
|
|
2056
646
|
import { colorize } from "json-colorizer";
|
|
2057
647
|
|
|
2058
|
-
// ../../node_modules/@inquirer/core/dist/esm/lib/hook-engine.js
|
|
2059
|
-
import { AsyncLocalStorage, AsyncResource } from "node:async_hooks";
|
|
2060
|
-
var hookStorage = new AsyncLocalStorage();
|
|
2061
|
-
|
|
2062
|
-
// ../../node_modules/@inquirer/core/dist/esm/lib/theme.js
|
|
2063
|
-
import colors2 from "yoctocolors-cjs";
|
|
2064
|
-
|
|
2065
|
-
// ../../node_modules/@inquirer/figures/dist/esm/index.js
|
|
2066
|
-
import process2 from "node:process";
|
|
2067
|
-
function isUnicodeSupported() {
|
|
2068
|
-
if (process2.platform !== "win32") {
|
|
2069
|
-
return process2.env["TERM"] !== "linux";
|
|
2070
|
-
}
|
|
2071
|
-
return Boolean(process2.env["WT_SESSION"]) || // Windows Terminal
|
|
2072
|
-
Boolean(process2.env["TERMINUS_SUBLIME"]) || // Terminus (<0.2.27)
|
|
2073
|
-
process2.env["ConEmuTask"] === "{cmd::Cmder}" || // ConEmu and cmder
|
|
2074
|
-
process2.env["TERM_PROGRAM"] === "Terminus-Sublime" || process2.env["TERM_PROGRAM"] === "vscode" || process2.env["TERM"] === "xterm-256color" || process2.env["TERM"] === "alacritty" || process2.env["TERMINAL_EMULATOR"] === "JetBrains-JediTerm";
|
|
2075
|
-
}
|
|
2076
|
-
var common = {
|
|
2077
|
-
circleQuestionMark: "(?)",
|
|
2078
|
-
questionMarkPrefix: "(?)",
|
|
2079
|
-
square: "\u2588",
|
|
2080
|
-
squareDarkShade: "\u2593",
|
|
2081
|
-
squareMediumShade: "\u2592",
|
|
2082
|
-
squareLightShade: "\u2591",
|
|
2083
|
-
squareTop: "\u2580",
|
|
2084
|
-
squareBottom: "\u2584",
|
|
2085
|
-
squareLeft: "\u258C",
|
|
2086
|
-
squareRight: "\u2590",
|
|
2087
|
-
squareCenter: "\u25A0",
|
|
2088
|
-
bullet: "\u25CF",
|
|
2089
|
-
dot: "\u2024",
|
|
2090
|
-
ellipsis: "\u2026",
|
|
2091
|
-
pointerSmall: "\u203A",
|
|
2092
|
-
triangleUp: "\u25B2",
|
|
2093
|
-
triangleUpSmall: "\u25B4",
|
|
2094
|
-
triangleDown: "\u25BC",
|
|
2095
|
-
triangleDownSmall: "\u25BE",
|
|
2096
|
-
triangleLeftSmall: "\u25C2",
|
|
2097
|
-
triangleRightSmall: "\u25B8",
|
|
2098
|
-
home: "\u2302",
|
|
2099
|
-
heart: "\u2665",
|
|
2100
|
-
musicNote: "\u266A",
|
|
2101
|
-
musicNoteBeamed: "\u266B",
|
|
2102
|
-
arrowUp: "\u2191",
|
|
2103
|
-
arrowDown: "\u2193",
|
|
2104
|
-
arrowLeft: "\u2190",
|
|
2105
|
-
arrowRight: "\u2192",
|
|
2106
|
-
arrowLeftRight: "\u2194",
|
|
2107
|
-
arrowUpDown: "\u2195",
|
|
2108
|
-
almostEqual: "\u2248",
|
|
2109
|
-
notEqual: "\u2260",
|
|
2110
|
-
lessOrEqual: "\u2264",
|
|
2111
|
-
greaterOrEqual: "\u2265",
|
|
2112
|
-
identical: "\u2261",
|
|
2113
|
-
infinity: "\u221E",
|
|
2114
|
-
subscriptZero: "\u2080",
|
|
2115
|
-
subscriptOne: "\u2081",
|
|
2116
|
-
subscriptTwo: "\u2082",
|
|
2117
|
-
subscriptThree: "\u2083",
|
|
2118
|
-
subscriptFour: "\u2084",
|
|
2119
|
-
subscriptFive: "\u2085",
|
|
2120
|
-
subscriptSix: "\u2086",
|
|
2121
|
-
subscriptSeven: "\u2087",
|
|
2122
|
-
subscriptEight: "\u2088",
|
|
2123
|
-
subscriptNine: "\u2089",
|
|
2124
|
-
oneHalf: "\xBD",
|
|
2125
|
-
oneThird: "\u2153",
|
|
2126
|
-
oneQuarter: "\xBC",
|
|
2127
|
-
oneFifth: "\u2155",
|
|
2128
|
-
oneSixth: "\u2159",
|
|
2129
|
-
oneEighth: "\u215B",
|
|
2130
|
-
twoThirds: "\u2154",
|
|
2131
|
-
twoFifths: "\u2156",
|
|
2132
|
-
threeQuarters: "\xBE",
|
|
2133
|
-
threeFifths: "\u2157",
|
|
2134
|
-
threeEighths: "\u215C",
|
|
2135
|
-
fourFifths: "\u2158",
|
|
2136
|
-
fiveSixths: "\u215A",
|
|
2137
|
-
fiveEighths: "\u215D",
|
|
2138
|
-
sevenEighths: "\u215E",
|
|
2139
|
-
line: "\u2500",
|
|
2140
|
-
lineBold: "\u2501",
|
|
2141
|
-
lineDouble: "\u2550",
|
|
2142
|
-
lineDashed0: "\u2504",
|
|
2143
|
-
lineDashed1: "\u2505",
|
|
2144
|
-
lineDashed2: "\u2508",
|
|
2145
|
-
lineDashed3: "\u2509",
|
|
2146
|
-
lineDashed4: "\u254C",
|
|
2147
|
-
lineDashed5: "\u254D",
|
|
2148
|
-
lineDashed6: "\u2574",
|
|
2149
|
-
lineDashed7: "\u2576",
|
|
2150
|
-
lineDashed8: "\u2578",
|
|
2151
|
-
lineDashed9: "\u257A",
|
|
2152
|
-
lineDashed10: "\u257C",
|
|
2153
|
-
lineDashed11: "\u257E",
|
|
2154
|
-
lineDashed12: "\u2212",
|
|
2155
|
-
lineDashed13: "\u2013",
|
|
2156
|
-
lineDashed14: "\u2010",
|
|
2157
|
-
lineDashed15: "\u2043",
|
|
2158
|
-
lineVertical: "\u2502",
|
|
2159
|
-
lineVerticalBold: "\u2503",
|
|
2160
|
-
lineVerticalDouble: "\u2551",
|
|
2161
|
-
lineVerticalDashed0: "\u2506",
|
|
2162
|
-
lineVerticalDashed1: "\u2507",
|
|
2163
|
-
lineVerticalDashed2: "\u250A",
|
|
2164
|
-
lineVerticalDashed3: "\u250B",
|
|
2165
|
-
lineVerticalDashed4: "\u254E",
|
|
2166
|
-
lineVerticalDashed5: "\u254F",
|
|
2167
|
-
lineVerticalDashed6: "\u2575",
|
|
2168
|
-
lineVerticalDashed7: "\u2577",
|
|
2169
|
-
lineVerticalDashed8: "\u2579",
|
|
2170
|
-
lineVerticalDashed9: "\u257B",
|
|
2171
|
-
lineVerticalDashed10: "\u257D",
|
|
2172
|
-
lineVerticalDashed11: "\u257F",
|
|
2173
|
-
lineDownLeft: "\u2510",
|
|
2174
|
-
lineDownLeftArc: "\u256E",
|
|
2175
|
-
lineDownBoldLeftBold: "\u2513",
|
|
2176
|
-
lineDownBoldLeft: "\u2512",
|
|
2177
|
-
lineDownLeftBold: "\u2511",
|
|
2178
|
-
lineDownDoubleLeftDouble: "\u2557",
|
|
2179
|
-
lineDownDoubleLeft: "\u2556",
|
|
2180
|
-
lineDownLeftDouble: "\u2555",
|
|
2181
|
-
lineDownRight: "\u250C",
|
|
2182
|
-
lineDownRightArc: "\u256D",
|
|
2183
|
-
lineDownBoldRightBold: "\u250F",
|
|
2184
|
-
lineDownBoldRight: "\u250E",
|
|
2185
|
-
lineDownRightBold: "\u250D",
|
|
2186
|
-
lineDownDoubleRightDouble: "\u2554",
|
|
2187
|
-
lineDownDoubleRight: "\u2553",
|
|
2188
|
-
lineDownRightDouble: "\u2552",
|
|
2189
|
-
lineUpLeft: "\u2518",
|
|
2190
|
-
lineUpLeftArc: "\u256F",
|
|
2191
|
-
lineUpBoldLeftBold: "\u251B",
|
|
2192
|
-
lineUpBoldLeft: "\u251A",
|
|
2193
|
-
lineUpLeftBold: "\u2519",
|
|
2194
|
-
lineUpDoubleLeftDouble: "\u255D",
|
|
2195
|
-
lineUpDoubleLeft: "\u255C",
|
|
2196
|
-
lineUpLeftDouble: "\u255B",
|
|
2197
|
-
lineUpRight: "\u2514",
|
|
2198
|
-
lineUpRightArc: "\u2570",
|
|
2199
|
-
lineUpBoldRightBold: "\u2517",
|
|
2200
|
-
lineUpBoldRight: "\u2516",
|
|
2201
|
-
lineUpRightBold: "\u2515",
|
|
2202
|
-
lineUpDoubleRightDouble: "\u255A",
|
|
2203
|
-
lineUpDoubleRight: "\u2559",
|
|
2204
|
-
lineUpRightDouble: "\u2558",
|
|
2205
|
-
lineUpDownLeft: "\u2524",
|
|
2206
|
-
lineUpBoldDownBoldLeftBold: "\u252B",
|
|
2207
|
-
lineUpBoldDownBoldLeft: "\u2528",
|
|
2208
|
-
lineUpDownLeftBold: "\u2525",
|
|
2209
|
-
lineUpBoldDownLeftBold: "\u2529",
|
|
2210
|
-
lineUpDownBoldLeftBold: "\u252A",
|
|
2211
|
-
lineUpDownBoldLeft: "\u2527",
|
|
2212
|
-
lineUpBoldDownLeft: "\u2526",
|
|
2213
|
-
lineUpDoubleDownDoubleLeftDouble: "\u2563",
|
|
2214
|
-
lineUpDoubleDownDoubleLeft: "\u2562",
|
|
2215
|
-
lineUpDownLeftDouble: "\u2561",
|
|
2216
|
-
lineUpDownRight: "\u251C",
|
|
2217
|
-
lineUpBoldDownBoldRightBold: "\u2523",
|
|
2218
|
-
lineUpBoldDownBoldRight: "\u2520",
|
|
2219
|
-
lineUpDownRightBold: "\u251D",
|
|
2220
|
-
lineUpBoldDownRightBold: "\u2521",
|
|
2221
|
-
lineUpDownBoldRightBold: "\u2522",
|
|
2222
|
-
lineUpDownBoldRight: "\u251F",
|
|
2223
|
-
lineUpBoldDownRight: "\u251E",
|
|
2224
|
-
lineUpDoubleDownDoubleRightDouble: "\u2560",
|
|
2225
|
-
lineUpDoubleDownDoubleRight: "\u255F",
|
|
2226
|
-
lineUpDownRightDouble: "\u255E",
|
|
2227
|
-
lineDownLeftRight: "\u252C",
|
|
2228
|
-
lineDownBoldLeftBoldRightBold: "\u2533",
|
|
2229
|
-
lineDownLeftBoldRightBold: "\u252F",
|
|
2230
|
-
lineDownBoldLeftRight: "\u2530",
|
|
2231
|
-
lineDownBoldLeftBoldRight: "\u2531",
|
|
2232
|
-
lineDownBoldLeftRightBold: "\u2532",
|
|
2233
|
-
lineDownLeftRightBold: "\u252E",
|
|
2234
|
-
lineDownLeftBoldRight: "\u252D",
|
|
2235
|
-
lineDownDoubleLeftDoubleRightDouble: "\u2566",
|
|
2236
|
-
lineDownDoubleLeftRight: "\u2565",
|
|
2237
|
-
lineDownLeftDoubleRightDouble: "\u2564",
|
|
2238
|
-
lineUpLeftRight: "\u2534",
|
|
2239
|
-
lineUpBoldLeftBoldRightBold: "\u253B",
|
|
2240
|
-
lineUpLeftBoldRightBold: "\u2537",
|
|
2241
|
-
lineUpBoldLeftRight: "\u2538",
|
|
2242
|
-
lineUpBoldLeftBoldRight: "\u2539",
|
|
2243
|
-
lineUpBoldLeftRightBold: "\u253A",
|
|
2244
|
-
lineUpLeftRightBold: "\u2536",
|
|
2245
|
-
lineUpLeftBoldRight: "\u2535",
|
|
2246
|
-
lineUpDoubleLeftDoubleRightDouble: "\u2569",
|
|
2247
|
-
lineUpDoubleLeftRight: "\u2568",
|
|
2248
|
-
lineUpLeftDoubleRightDouble: "\u2567",
|
|
2249
|
-
lineUpDownLeftRight: "\u253C",
|
|
2250
|
-
lineUpBoldDownBoldLeftBoldRightBold: "\u254B",
|
|
2251
|
-
lineUpDownBoldLeftBoldRightBold: "\u2548",
|
|
2252
|
-
lineUpBoldDownLeftBoldRightBold: "\u2547",
|
|
2253
|
-
lineUpBoldDownBoldLeftRightBold: "\u254A",
|
|
2254
|
-
lineUpBoldDownBoldLeftBoldRight: "\u2549",
|
|
2255
|
-
lineUpBoldDownLeftRight: "\u2540",
|
|
2256
|
-
lineUpDownBoldLeftRight: "\u2541",
|
|
2257
|
-
lineUpDownLeftBoldRight: "\u253D",
|
|
2258
|
-
lineUpDownLeftRightBold: "\u253E",
|
|
2259
|
-
lineUpBoldDownBoldLeftRight: "\u2542",
|
|
2260
|
-
lineUpDownLeftBoldRightBold: "\u253F",
|
|
2261
|
-
lineUpBoldDownLeftBoldRight: "\u2543",
|
|
2262
|
-
lineUpBoldDownLeftRightBold: "\u2544",
|
|
2263
|
-
lineUpDownBoldLeftBoldRight: "\u2545",
|
|
2264
|
-
lineUpDownBoldLeftRightBold: "\u2546",
|
|
2265
|
-
lineUpDoubleDownDoubleLeftDoubleRightDouble: "\u256C",
|
|
2266
|
-
lineUpDoubleDownDoubleLeftRight: "\u256B",
|
|
2267
|
-
lineUpDownLeftDoubleRightDouble: "\u256A",
|
|
2268
|
-
lineCross: "\u2573",
|
|
2269
|
-
lineBackslash: "\u2572",
|
|
2270
|
-
lineSlash: "\u2571"
|
|
2271
|
-
};
|
|
2272
|
-
var specialMainSymbols = {
|
|
2273
|
-
tick: "\u2714",
|
|
2274
|
-
info: "\u2139",
|
|
2275
|
-
warning: "\u26A0",
|
|
2276
|
-
cross: "\u2718",
|
|
2277
|
-
squareSmall: "\u25FB",
|
|
2278
|
-
squareSmallFilled: "\u25FC",
|
|
2279
|
-
circle: "\u25EF",
|
|
2280
|
-
circleFilled: "\u25C9",
|
|
2281
|
-
circleDotted: "\u25CC",
|
|
2282
|
-
circleDouble: "\u25CE",
|
|
2283
|
-
circleCircle: "\u24DE",
|
|
2284
|
-
circleCross: "\u24E7",
|
|
2285
|
-
circlePipe: "\u24BE",
|
|
2286
|
-
radioOn: "\u25C9",
|
|
2287
|
-
radioOff: "\u25EF",
|
|
2288
|
-
checkboxOn: "\u2612",
|
|
2289
|
-
checkboxOff: "\u2610",
|
|
2290
|
-
checkboxCircleOn: "\u24E7",
|
|
2291
|
-
checkboxCircleOff: "\u24BE",
|
|
2292
|
-
pointer: "\u276F",
|
|
2293
|
-
triangleUpOutline: "\u25B3",
|
|
2294
|
-
triangleLeft: "\u25C0",
|
|
2295
|
-
triangleRight: "\u25B6",
|
|
2296
|
-
lozenge: "\u25C6",
|
|
2297
|
-
lozengeOutline: "\u25C7",
|
|
2298
|
-
hamburger: "\u2630",
|
|
2299
|
-
smiley: "\u32E1",
|
|
2300
|
-
mustache: "\u0DF4",
|
|
2301
|
-
star: "\u2605",
|
|
2302
|
-
play: "\u25B6",
|
|
2303
|
-
nodejs: "\u2B22",
|
|
2304
|
-
oneSeventh: "\u2150",
|
|
2305
|
-
oneNinth: "\u2151",
|
|
2306
|
-
oneTenth: "\u2152"
|
|
2307
|
-
};
|
|
2308
|
-
var specialFallbackSymbols = {
|
|
2309
|
-
tick: "\u221A",
|
|
2310
|
-
info: "i",
|
|
2311
|
-
warning: "\u203C",
|
|
2312
|
-
cross: "\xD7",
|
|
2313
|
-
squareSmall: "\u25A1",
|
|
2314
|
-
squareSmallFilled: "\u25A0",
|
|
2315
|
-
circle: "( )",
|
|
2316
|
-
circleFilled: "(*)",
|
|
2317
|
-
circleDotted: "( )",
|
|
2318
|
-
circleDouble: "( )",
|
|
2319
|
-
circleCircle: "(\u25CB)",
|
|
2320
|
-
circleCross: "(\xD7)",
|
|
2321
|
-
circlePipe: "(\u2502)",
|
|
2322
|
-
radioOn: "(*)",
|
|
2323
|
-
radioOff: "( )",
|
|
2324
|
-
checkboxOn: "[\xD7]",
|
|
2325
|
-
checkboxOff: "[ ]",
|
|
2326
|
-
checkboxCircleOn: "(\xD7)",
|
|
2327
|
-
checkboxCircleOff: "( )",
|
|
2328
|
-
pointer: ">",
|
|
2329
|
-
triangleUpOutline: "\u2206",
|
|
2330
|
-
triangleLeft: "\u25C4",
|
|
2331
|
-
triangleRight: "\u25BA",
|
|
2332
|
-
lozenge: "\u2666",
|
|
2333
|
-
lozengeOutline: "\u25CA",
|
|
2334
|
-
hamburger: "\u2261",
|
|
2335
|
-
smiley: "\u263A",
|
|
2336
|
-
mustache: "\u250C\u2500\u2510",
|
|
2337
|
-
star: "\u2736",
|
|
2338
|
-
play: "\u25BA",
|
|
2339
|
-
nodejs: "\u2666",
|
|
2340
|
-
oneSeventh: "1/7",
|
|
2341
|
-
oneNinth: "1/9",
|
|
2342
|
-
oneTenth: "1/10"
|
|
2343
|
-
};
|
|
2344
|
-
var mainSymbols = { ...common, ...specialMainSymbols };
|
|
2345
|
-
var fallbackSymbols = {
|
|
2346
|
-
...common,
|
|
2347
|
-
...specialFallbackSymbols
|
|
2348
|
-
};
|
|
2349
|
-
var shouldUseMain = isUnicodeSupported();
|
|
2350
|
-
var figures = shouldUseMain ? mainSymbols : fallbackSymbols;
|
|
2351
|
-
var esm_default = figures;
|
|
2352
|
-
var replacements = Object.entries(specialMainSymbols);
|
|
2353
|
-
|
|
2354
|
-
// ../../node_modules/@inquirer/core/dist/esm/lib/theme.js
|
|
2355
|
-
var defaultTheme = {
|
|
2356
|
-
prefix: {
|
|
2357
|
-
idle: colors2.blue("?"),
|
|
2358
|
-
// TODO: use figure
|
|
2359
|
-
done: colors2.green(esm_default.tick)
|
|
2360
|
-
},
|
|
2361
|
-
spinner: {
|
|
2362
|
-
interval: 80,
|
|
2363
|
-
frames: ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"].map((frame) => colors2.yellow(frame))
|
|
2364
|
-
},
|
|
2365
|
-
style: {
|
|
2366
|
-
answer: colors2.cyan,
|
|
2367
|
-
message: colors2.bold,
|
|
2368
|
-
error: (text) => colors2.red(`> ${text}`),
|
|
2369
|
-
defaultAnswer: (text) => colors2.dim(`(${text})`),
|
|
2370
|
-
help: colors2.dim,
|
|
2371
|
-
highlight: colors2.cyan,
|
|
2372
|
-
key: (text) => colors2.cyan(colors2.bold(`<${text}>`))
|
|
2373
|
-
}
|
|
2374
|
-
};
|
|
2375
|
-
|
|
2376
|
-
// ../../node_modules/@inquirer/core/dist/esm/lib/utils.js
|
|
2377
|
-
var import_cli_width = __toESM(require_cli_width(), 1);
|
|
2378
|
-
var import_wrap_ansi = __toESM(require_wrap_ansi(), 1);
|
|
2379
|
-
|
|
2380
|
-
// ../../node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
|
|
2381
|
-
import MuteStream from "mute-stream";
|
|
2382
|
-
|
|
2383
|
-
// ../../node_modules/@inquirer/core/node_modules/signal-exit/dist/mjs/signals.js
|
|
2384
|
-
var signals = [];
|
|
2385
|
-
signals.push("SIGHUP", "SIGINT", "SIGTERM");
|
|
2386
|
-
if (process.platform !== "win32") {
|
|
2387
|
-
signals.push(
|
|
2388
|
-
"SIGALRM",
|
|
2389
|
-
"SIGABRT",
|
|
2390
|
-
"SIGVTALRM",
|
|
2391
|
-
"SIGXCPU",
|
|
2392
|
-
"SIGXFSZ",
|
|
2393
|
-
"SIGUSR2",
|
|
2394
|
-
"SIGTRAP",
|
|
2395
|
-
"SIGSYS",
|
|
2396
|
-
"SIGQUIT",
|
|
2397
|
-
"SIGIOT"
|
|
2398
|
-
// should detect profiler and enable/disable accordingly.
|
|
2399
|
-
// see #21
|
|
2400
|
-
// 'SIGPROF'
|
|
2401
|
-
);
|
|
2402
|
-
}
|
|
2403
|
-
if (process.platform === "linux") {
|
|
2404
|
-
signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
|
|
2405
|
-
}
|
|
2406
|
-
|
|
2407
|
-
// ../../node_modules/@inquirer/core/node_modules/signal-exit/dist/mjs/index.js
|
|
2408
|
-
var processOk = (process4) => !!process4 && typeof process4 === "object" && typeof process4.removeListener === "function" && typeof process4.emit === "function" && typeof process4.reallyExit === "function" && typeof process4.listeners === "function" && typeof process4.kill === "function" && typeof process4.pid === "number" && typeof process4.on === "function";
|
|
2409
|
-
var kExitEmitter = Symbol.for("signal-exit emitter");
|
|
2410
|
-
var global = globalThis;
|
|
2411
|
-
var ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
2412
|
-
var Emitter = class {
|
|
2413
|
-
emitted = {
|
|
2414
|
-
afterExit: false,
|
|
2415
|
-
exit: false
|
|
2416
|
-
};
|
|
2417
|
-
listeners = {
|
|
2418
|
-
afterExit: [],
|
|
2419
|
-
exit: []
|
|
2420
|
-
};
|
|
2421
|
-
count = 0;
|
|
2422
|
-
id = Math.random();
|
|
2423
|
-
constructor() {
|
|
2424
|
-
if (global[kExitEmitter]) {
|
|
2425
|
-
return global[kExitEmitter];
|
|
2426
|
-
}
|
|
2427
|
-
ObjectDefineProperty(global, kExitEmitter, {
|
|
2428
|
-
value: this,
|
|
2429
|
-
writable: false,
|
|
2430
|
-
enumerable: false,
|
|
2431
|
-
configurable: false
|
|
2432
|
-
});
|
|
2433
|
-
}
|
|
2434
|
-
on(ev, fn) {
|
|
2435
|
-
this.listeners[ev].push(fn);
|
|
2436
|
-
}
|
|
2437
|
-
removeListener(ev, fn) {
|
|
2438
|
-
const list = this.listeners[ev];
|
|
2439
|
-
const i = list.indexOf(fn);
|
|
2440
|
-
if (i === -1) {
|
|
2441
|
-
return;
|
|
2442
|
-
}
|
|
2443
|
-
if (i === 0 && list.length === 1) {
|
|
2444
|
-
list.length = 0;
|
|
2445
|
-
} else {
|
|
2446
|
-
list.splice(i, 1);
|
|
2447
|
-
}
|
|
2448
|
-
}
|
|
2449
|
-
emit(ev, code, signal) {
|
|
2450
|
-
if (this.emitted[ev]) {
|
|
2451
|
-
return false;
|
|
2452
|
-
}
|
|
2453
|
-
this.emitted[ev] = true;
|
|
2454
|
-
let ret = false;
|
|
2455
|
-
for (const fn of this.listeners[ev]) {
|
|
2456
|
-
ret = fn(code, signal) === true || ret;
|
|
2457
|
-
}
|
|
2458
|
-
if (ev === "exit") {
|
|
2459
|
-
ret = this.emit("afterExit", code, signal) || ret;
|
|
2460
|
-
}
|
|
2461
|
-
return ret;
|
|
2462
|
-
}
|
|
2463
|
-
};
|
|
2464
|
-
var SignalExitBase = class {
|
|
2465
|
-
};
|
|
2466
|
-
var signalExitWrap = (handler) => {
|
|
2467
|
-
return {
|
|
2468
|
-
onExit(cb, opts) {
|
|
2469
|
-
return handler.onExit(cb, opts);
|
|
2470
|
-
},
|
|
2471
|
-
load() {
|
|
2472
|
-
return handler.load();
|
|
2473
|
-
},
|
|
2474
|
-
unload() {
|
|
2475
|
-
return handler.unload();
|
|
2476
|
-
}
|
|
2477
|
-
};
|
|
2478
|
-
};
|
|
2479
|
-
var SignalExitFallback = class extends SignalExitBase {
|
|
2480
|
-
onExit() {
|
|
2481
|
-
return () => {
|
|
2482
|
-
};
|
|
2483
|
-
}
|
|
2484
|
-
load() {
|
|
2485
|
-
}
|
|
2486
|
-
unload() {
|
|
2487
|
-
}
|
|
2488
|
-
};
|
|
2489
|
-
var SignalExit = class extends SignalExitBase {
|
|
2490
|
-
// "SIGHUP" throws an `ENOSYS` error on Windows,
|
|
2491
|
-
// so use a supported signal instead
|
|
2492
|
-
/* c8 ignore start */
|
|
2493
|
-
#hupSig = process3.platform === "win32" ? "SIGINT" : "SIGHUP";
|
|
2494
|
-
/* c8 ignore stop */
|
|
2495
|
-
#emitter = new Emitter();
|
|
2496
|
-
#process;
|
|
2497
|
-
#originalProcessEmit;
|
|
2498
|
-
#originalProcessReallyExit;
|
|
2499
|
-
#sigListeners = {};
|
|
2500
|
-
#loaded = false;
|
|
2501
|
-
constructor(process4) {
|
|
2502
|
-
super();
|
|
2503
|
-
this.#process = process4;
|
|
2504
|
-
this.#sigListeners = {};
|
|
2505
|
-
for (const sig of signals) {
|
|
2506
|
-
this.#sigListeners[sig] = () => {
|
|
2507
|
-
const listeners = this.#process.listeners(sig);
|
|
2508
|
-
let { count } = this.#emitter;
|
|
2509
|
-
const p = process4;
|
|
2510
|
-
if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
|
|
2511
|
-
count += p.__signal_exit_emitter__.count;
|
|
2512
|
-
}
|
|
2513
|
-
if (listeners.length === count) {
|
|
2514
|
-
this.unload();
|
|
2515
|
-
const ret = this.#emitter.emit("exit", null, sig);
|
|
2516
|
-
const s = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
2517
|
-
if (!ret)
|
|
2518
|
-
process4.kill(process4.pid, s);
|
|
2519
|
-
}
|
|
2520
|
-
};
|
|
2521
|
-
}
|
|
2522
|
-
this.#originalProcessReallyExit = process4.reallyExit;
|
|
2523
|
-
this.#originalProcessEmit = process4.emit;
|
|
2524
|
-
}
|
|
2525
|
-
onExit(cb, opts) {
|
|
2526
|
-
if (!processOk(this.#process)) {
|
|
2527
|
-
return () => {
|
|
2528
|
-
};
|
|
2529
|
-
}
|
|
2530
|
-
if (this.#loaded === false) {
|
|
2531
|
-
this.load();
|
|
2532
|
-
}
|
|
2533
|
-
const ev = opts?.alwaysLast ? "afterExit" : "exit";
|
|
2534
|
-
this.#emitter.on(ev, cb);
|
|
2535
|
-
return () => {
|
|
2536
|
-
this.#emitter.removeListener(ev, cb);
|
|
2537
|
-
if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) {
|
|
2538
|
-
this.unload();
|
|
2539
|
-
}
|
|
2540
|
-
};
|
|
2541
|
-
}
|
|
2542
|
-
load() {
|
|
2543
|
-
if (this.#loaded) {
|
|
2544
|
-
return;
|
|
2545
|
-
}
|
|
2546
|
-
this.#loaded = true;
|
|
2547
|
-
this.#emitter.count += 1;
|
|
2548
|
-
for (const sig of signals) {
|
|
2549
|
-
try {
|
|
2550
|
-
const fn = this.#sigListeners[sig];
|
|
2551
|
-
if (fn)
|
|
2552
|
-
this.#process.on(sig, fn);
|
|
2553
|
-
} catch (_) {
|
|
2554
|
-
}
|
|
2555
|
-
}
|
|
2556
|
-
this.#process.emit = (ev, ...a) => {
|
|
2557
|
-
return this.#processEmit(ev, ...a);
|
|
2558
|
-
};
|
|
2559
|
-
this.#process.reallyExit = (code) => {
|
|
2560
|
-
return this.#processReallyExit(code);
|
|
2561
|
-
};
|
|
2562
|
-
}
|
|
2563
|
-
unload() {
|
|
2564
|
-
if (!this.#loaded) {
|
|
2565
|
-
return;
|
|
2566
|
-
}
|
|
2567
|
-
this.#loaded = false;
|
|
2568
|
-
signals.forEach((sig) => {
|
|
2569
|
-
const listener = this.#sigListeners[sig];
|
|
2570
|
-
if (!listener) {
|
|
2571
|
-
throw new Error("Listener not defined for signal: " + sig);
|
|
2572
|
-
}
|
|
2573
|
-
try {
|
|
2574
|
-
this.#process.removeListener(sig, listener);
|
|
2575
|
-
} catch (_) {
|
|
2576
|
-
}
|
|
2577
|
-
});
|
|
2578
|
-
this.#process.emit = this.#originalProcessEmit;
|
|
2579
|
-
this.#process.reallyExit = this.#originalProcessReallyExit;
|
|
2580
|
-
this.#emitter.count -= 1;
|
|
2581
|
-
}
|
|
2582
|
-
#processReallyExit(code) {
|
|
2583
|
-
if (!processOk(this.#process)) {
|
|
2584
|
-
return 0;
|
|
2585
|
-
}
|
|
2586
|
-
this.#process.exitCode = code || 0;
|
|
2587
|
-
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
2588
|
-
return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
|
|
2589
|
-
}
|
|
2590
|
-
#processEmit(ev, ...args) {
|
|
2591
|
-
const og = this.#originalProcessEmit;
|
|
2592
|
-
if (ev === "exit" && processOk(this.#process)) {
|
|
2593
|
-
if (typeof args[0] === "number") {
|
|
2594
|
-
this.#process.exitCode = args[0];
|
|
2595
|
-
}
|
|
2596
|
-
const ret = og.call(this.#process, ev, ...args);
|
|
2597
|
-
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
2598
|
-
return ret;
|
|
2599
|
-
} else {
|
|
2600
|
-
return og.call(this.#process, ev, ...args);
|
|
2601
|
-
}
|
|
2602
|
-
}
|
|
2603
|
-
};
|
|
2604
|
-
var process3 = globalThis.process;
|
|
2605
|
-
var {
|
|
2606
|
-
/**
|
|
2607
|
-
* Called when the process is exiting, whether via signal, explicit
|
|
2608
|
-
* exit, or running out of stuff to do.
|
|
2609
|
-
*
|
|
2610
|
-
* If the global process object is not suitable for instrumentation,
|
|
2611
|
-
* then this will be a no-op.
|
|
2612
|
-
*
|
|
2613
|
-
* Returns a function that may be used to unload signal-exit.
|
|
2614
|
-
*/
|
|
2615
|
-
onExit,
|
|
2616
|
-
/**
|
|
2617
|
-
* Load the listeners. Likely you never need to call this, unless
|
|
2618
|
-
* doing a rather deep integration with signal-exit functionality.
|
|
2619
|
-
* Mostly exposed for the benefit of testing.
|
|
2620
|
-
*
|
|
2621
|
-
* @internal
|
|
2622
|
-
*/
|
|
2623
|
-
load,
|
|
2624
|
-
/**
|
|
2625
|
-
* Unload the listeners. Likely you never need to call this, unless
|
|
2626
|
-
* doing a rather deep integration with signal-exit functionality.
|
|
2627
|
-
* Mostly exposed for the benefit of testing.
|
|
2628
|
-
*
|
|
2629
|
-
* @internal
|
|
2630
|
-
*/
|
|
2631
|
-
unload
|
|
2632
|
-
} = signalExitWrap(processOk(process3) ? new SignalExit(process3) : new SignalExitFallback());
|
|
2633
|
-
|
|
2634
|
-
// ../../node_modules/@inquirer/ansi/dist/esm/index.js
|
|
2635
|
-
var ESC = "\x1B[";
|
|
2636
|
-
var cursorLeft = ESC + "G";
|
|
2637
|
-
var cursorHide = ESC + "?25l";
|
|
2638
|
-
var cursorShow = ESC + "?25h";
|
|
2639
|
-
var eraseLine = ESC + "2K";
|
|
2640
|
-
|
|
2641
|
-
// ../../node_modules/@inquirer/core/dist/esm/lib/Separator.js
|
|
2642
|
-
import colors3 from "yoctocolors-cjs";
|
|
2643
|
-
|
|
2644
648
|
// src/lib/core/error.ts
|
|
2645
649
|
import { bold as bold2, dim as dim2, redBright } from "colorette";
|
|
2646
650
|
import { ApiError, extractApiErrorInfo } from "@playcademy/sdk/internal";
|
|
@@ -2751,7 +755,7 @@ function formatError(error, indent = 0) {
|
|
|
2751
755
|
function customTransform(text) {
|
|
2752
756
|
let result = text;
|
|
2753
757
|
result = result.replace(/`([^`]+)`/g, (_, code) => greenBright(code));
|
|
2754
|
-
result = result.replace(/<<([^>]+)>>/g, (_, url) => underline(url));
|
|
758
|
+
result = result.replace(/<<([^>]+)>>/g, (_, url) => blueBright(underline(url)));
|
|
2755
759
|
result = result.replace(/<([^>]+)>/g, (_, path) => blueBright(path));
|
|
2756
760
|
return result;
|
|
2757
761
|
}
|