@bpinternal/readiness 0.0.3 → 0.0.4
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 +1640 -182
- package/package.json +3 -5
- package/tsconfig.tsbuildinfo +1 -1
package/dist/index.js
CHANGED
|
@@ -33,14 +33,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
33
33
|
));
|
|
34
34
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
35
|
|
|
36
|
-
// node_modules/.pnpm/@bpinternal+log4bot@0.0.5_@types+node@18.19.20/node_modules/@bpinternal/log4bot/dist/typings.js
|
|
37
|
-
var require_typings = __commonJS({
|
|
38
|
-
"node_modules/.pnpm/@bpinternal+log4bot@0.0.5_@types+node@18.19.20/node_modules/@bpinternal/log4bot/dist/typings.js"(exports2) {
|
|
39
|
-
"use strict";
|
|
40
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
|
|
44
36
|
// node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js
|
|
45
37
|
var require_lodash = __commonJS({
|
|
46
38
|
"node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js"(exports2, module2) {
|
|
@@ -5947,10 +5939,10 @@ var init_source = __esm({
|
|
|
5947
5939
|
}
|
|
5948
5940
|
};
|
|
5949
5941
|
chalkFactory = (options) => {
|
|
5950
|
-
const
|
|
5951
|
-
applyOptions(
|
|
5952
|
-
Object.setPrototypeOf(
|
|
5953
|
-
return
|
|
5942
|
+
const chalk5 = (...strings) => strings.join(" ");
|
|
5943
|
+
applyOptions(chalk5, options);
|
|
5944
|
+
Object.setPrototypeOf(chalk5, createChalk.prototype);
|
|
5945
|
+
return chalk5;
|
|
5954
5946
|
};
|
|
5955
5947
|
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
|
5956
5948
|
for (const [styleName, style] of Object.entries(ansi_styles_default)) {
|
|
@@ -10062,26 +10054,59 @@ var require_moment = __commonJS({
|
|
|
10062
10054
|
}
|
|
10063
10055
|
});
|
|
10064
10056
|
|
|
10065
|
-
// node_modules/.pnpm/@bpinternal+log4bot@0.0.
|
|
10066
|
-
var
|
|
10067
|
-
"node_modules/.pnpm/@bpinternal+log4bot@0.0.
|
|
10057
|
+
// node_modules/.pnpm/@bpinternal+log4bot@0.0.6/node_modules/@bpinternal/log4bot/dist/index.js
|
|
10058
|
+
var require_dist = __commonJS({
|
|
10059
|
+
"node_modules/.pnpm/@bpinternal+log4bot@0.0.6/node_modules/@bpinternal/log4bot/dist/index.js"(exports2, module2) {
|
|
10068
10060
|
"use strict";
|
|
10069
|
-
var
|
|
10070
|
-
|
|
10071
|
-
|
|
10072
|
-
|
|
10073
|
-
|
|
10074
|
-
var
|
|
10075
|
-
var
|
|
10076
|
-
var
|
|
10077
|
-
|
|
10078
|
-
|
|
10061
|
+
var __create2 = Object.create;
|
|
10062
|
+
var __defProp2 = Object.defineProperty;
|
|
10063
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
10064
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
10065
|
+
var __getProtoOf2 = Object.getPrototypeOf;
|
|
10066
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
10067
|
+
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
|
|
10068
|
+
var __export2 = (target, all) => {
|
|
10069
|
+
for (var name in all)
|
|
10070
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
10071
|
+
};
|
|
10072
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
10073
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10074
|
+
for (let key of __getOwnPropNames2(from))
|
|
10075
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
10076
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
10077
|
+
}
|
|
10078
|
+
return to;
|
|
10079
|
+
};
|
|
10080
|
+
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
10081
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
10082
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
10083
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
10084
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
10085
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
10086
|
+
mod
|
|
10087
|
+
));
|
|
10088
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
10089
|
+
var src_exports = {};
|
|
10090
|
+
__export2(src_exports, {
|
|
10091
|
+
ConsoleTransport: () => ConsoleTransport,
|
|
10092
|
+
JSONFormatter: () => JSONFormatter,
|
|
10093
|
+
Logger: () => Logger2,
|
|
10094
|
+
TextFormatter: () => TextFormatter
|
|
10095
|
+
});
|
|
10096
|
+
module2.exports = __toCommonJS2(src_exports);
|
|
10097
|
+
var import_lodash2 = __toESM2(require_lodash());
|
|
10098
|
+
var import_regex_parser = __toESM2(require_lib());
|
|
10099
|
+
var import_chalk4 = __toESM2((init_source(), __toCommonJS(source_exports)));
|
|
10100
|
+
var import_lodash = __toESM2(require_lodash());
|
|
10101
|
+
var import_moment = __toESM2(require_moment());
|
|
10102
|
+
var import_os = __toESM2(require("os"));
|
|
10103
|
+
var import_util = __toESM2(require("util"));
|
|
10079
10104
|
function _serializeArgs(args) {
|
|
10080
|
-
if (
|
|
10105
|
+
if (import_lodash.default.isArray(args)) {
|
|
10081
10106
|
return args.map((arg) => _serializeArgs(arg)).join(", ");
|
|
10082
|
-
} else if (
|
|
10083
|
-
return
|
|
10084
|
-
} else if (
|
|
10107
|
+
} else if (import_lodash.default.isObject(args)) {
|
|
10108
|
+
return import_util.default.inspect(args, false, 2, true);
|
|
10109
|
+
} else if (import_lodash.default.isString(args)) {
|
|
10085
10110
|
return args.trim();
|
|
10086
10111
|
} else if (args && args.toString) {
|
|
10087
10112
|
return args.toString();
|
|
@@ -10089,58 +10114,41 @@ var require_text = __commonJS({
|
|
|
10089
10114
|
return "";
|
|
10090
10115
|
}
|
|
10091
10116
|
}
|
|
10092
|
-
|
|
10117
|
+
__name(_serializeArgs, "_serializeArgs");
|
|
10118
|
+
var _TextFormatter = class _TextFormatter {
|
|
10093
10119
|
constructor() {
|
|
10094
10120
|
}
|
|
10095
10121
|
format(config, entry) {
|
|
10096
|
-
const time = (0,
|
|
10122
|
+
const time = (0, import_moment.default)().format(config.timeFormat);
|
|
10097
10123
|
const serializedMetadata = entry.metadata ? _serializeArgs(entry.metadata) : "";
|
|
10098
10124
|
const prefix = config.prefix ? `[${config.prefix}] ` : "";
|
|
10099
10125
|
let displayName = `${prefix}${entry.namespace}`;
|
|
10100
10126
|
displayName += entry.namespace.length ? " " : "";
|
|
10101
|
-
const newLineIndent =
|
|
10102
|
-
let indentedMessage = entry.level === "error" ? entry.message : entry.message.replace(/\r\n|\n/g,
|
|
10127
|
+
const newLineIndent = import_chalk4.default.dim(" ".repeat(`${time} ${displayName}`.length));
|
|
10128
|
+
let indentedMessage = entry.level === "error" ? entry.message : entry.message.replace(/\r\n|\n/g, import_os.default.EOL + newLineIndent);
|
|
10103
10129
|
if (entry.type === "stacktrace" && entry.stack) {
|
|
10104
|
-
indentedMessage +=
|
|
10105
|
-
indentedMessage +=
|
|
10130
|
+
indentedMessage += import_chalk4.default.grey(import_os.default.EOL + "STACK TRACE");
|
|
10131
|
+
indentedMessage += import_chalk4.default.grey(import_os.default.EOL + entry.stack);
|
|
10106
10132
|
}
|
|
10107
10133
|
const color = config.colors[entry.level];
|
|
10108
|
-
const coloredDisplayName = typeof color === "string" ?
|
|
10109
|
-
const greyTime =
|
|
10134
|
+
const coloredDisplayName = typeof color === "string" ? import_chalk4.default[color].bold(displayName) : import_chalk4.default.rgb(...color).bold(displayName);
|
|
10135
|
+
const greyTime = import_chalk4.default.grey(time);
|
|
10110
10136
|
return {
|
|
10111
10137
|
...entry,
|
|
10112
10138
|
formatted: `${greyTime} ${coloredDisplayName}${indentedMessage} ${serializedMetadata}`
|
|
10113
10139
|
};
|
|
10114
10140
|
}
|
|
10115
10141
|
};
|
|
10116
|
-
|
|
10117
|
-
|
|
10118
|
-
|
|
10119
|
-
|
|
10120
|
-
// node_modules/.pnpm/@bpinternal+log4bot@0.0.5_@types+node@18.19.20/node_modules/@bpinternal/log4bot/dist/transports/console.js
|
|
10121
|
-
var require_console = __commonJS({
|
|
10122
|
-
"node_modules/.pnpm/@bpinternal+log4bot@0.0.5_@types+node@18.19.20/node_modules/@bpinternal/log4bot/dist/transports/console.js"(exports2) {
|
|
10123
|
-
"use strict";
|
|
10124
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
10125
|
-
exports2.ConsoleTransport = void 0;
|
|
10126
|
-
var ConsoleTransport = class {
|
|
10142
|
+
__name(_TextFormatter, "TextFormatter");
|
|
10143
|
+
var TextFormatter = _TextFormatter;
|
|
10144
|
+
var _ConsoleTransport = class _ConsoleTransport {
|
|
10127
10145
|
send(_config, entry) {
|
|
10128
10146
|
console.log(entry.formatted);
|
|
10129
10147
|
}
|
|
10130
10148
|
};
|
|
10131
|
-
|
|
10132
|
-
|
|
10133
|
-
|
|
10134
|
-
|
|
10135
|
-
// node_modules/.pnpm/@bpinternal+log4bot@0.0.5_@types+node@18.19.20/node_modules/@bpinternal/log4bot/dist/config.js
|
|
10136
|
-
var require_config = __commonJS({
|
|
10137
|
-
"node_modules/.pnpm/@bpinternal+log4bot@0.0.5_@types+node@18.19.20/node_modules/@bpinternal/log4bot/dist/config.js"(exports2) {
|
|
10138
|
-
"use strict";
|
|
10139
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
10140
|
-
exports2.defaultConfig = void 0;
|
|
10141
|
-
var text_1 = require_text();
|
|
10142
|
-
var console_1 = require_console();
|
|
10143
|
-
exports2.defaultConfig = {
|
|
10149
|
+
__name(_ConsoleTransport, "ConsoleTransport");
|
|
10150
|
+
var ConsoleTransport = _ConsoleTransport;
|
|
10151
|
+
var defaultConfig = {
|
|
10144
10152
|
level: "info",
|
|
10145
10153
|
timeFormat: "L HH:mm:ss.SSS",
|
|
10146
10154
|
namespaceDelimiter: ":",
|
|
@@ -10151,28 +10159,13 @@ var require_config = __commonJS({
|
|
|
10151
10159
|
error: "red",
|
|
10152
10160
|
critical: [139, 0, 0]
|
|
10153
10161
|
},
|
|
10154
|
-
formatter: new
|
|
10155
|
-
transports: [new
|
|
10162
|
+
formatter: new TextFormatter(),
|
|
10163
|
+
transports: [new ConsoleTransport()],
|
|
10156
10164
|
indent: false,
|
|
10157
10165
|
filters: {},
|
|
10158
10166
|
// show all logs
|
|
10159
10167
|
prefix: ""
|
|
10160
10168
|
};
|
|
10161
|
-
}
|
|
10162
|
-
});
|
|
10163
|
-
|
|
10164
|
-
// node_modules/.pnpm/@bpinternal+log4bot@0.0.5_@types+node@18.19.20/node_modules/@bpinternal/log4bot/dist/logger.js
|
|
10165
|
-
var require_logger = __commonJS({
|
|
10166
|
-
"node_modules/.pnpm/@bpinternal+log4bot@0.0.5_@types+node@18.19.20/node_modules/@bpinternal/log4bot/dist/logger.js"(exports2) {
|
|
10167
|
-
"use strict";
|
|
10168
|
-
var __importDefault = exports2 && exports2.__importDefault || function(mod) {
|
|
10169
|
-
return mod && mod.__esModule ? mod : { "default": mod };
|
|
10170
|
-
};
|
|
10171
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
10172
|
-
exports2.Logger = void 0;
|
|
10173
|
-
var lodash_1 = __importDefault(require_lodash());
|
|
10174
|
-
var regex_parser_1 = __importDefault(require_lib());
|
|
10175
|
-
var config_1 = require_config();
|
|
10176
10169
|
var idx = 0;
|
|
10177
10170
|
var LogLevelValue = {
|
|
10178
10171
|
critical: idx++,
|
|
@@ -10181,28 +10174,28 @@ var require_logger = __commonJS({
|
|
|
10181
10174
|
info: idx++,
|
|
10182
10175
|
debug: idx++
|
|
10183
10176
|
};
|
|
10184
|
-
var
|
|
10177
|
+
var _Logger = class _Logger2 {
|
|
10185
10178
|
constructor(name = "", config) {
|
|
10186
10179
|
this._loggers = /* @__PURE__ */ new Map();
|
|
10187
|
-
this._config =
|
|
10180
|
+
this._config = defaultConfig;
|
|
10188
10181
|
this._filters = {};
|
|
10189
10182
|
this.parent = null;
|
|
10190
10183
|
this.namespace = "";
|
|
10191
|
-
this._log = (entry) => {
|
|
10184
|
+
this._log = /* @__PURE__ */ __name((entry) => {
|
|
10192
10185
|
this._send(entry);
|
|
10193
10186
|
if (this._currentError) {
|
|
10194
10187
|
const { message, stack } = this._currentError;
|
|
10195
10188
|
this._send({ type: "stacktrace", level: entry.level, message, stack });
|
|
10196
10189
|
this._currentError = void 0;
|
|
10197
10190
|
}
|
|
10198
|
-
};
|
|
10191
|
+
}, "_log");
|
|
10199
10192
|
this.namespace = name;
|
|
10200
10193
|
config && this.configure(config);
|
|
10201
10194
|
}
|
|
10202
10195
|
configure(config) {
|
|
10203
10196
|
this._config = { ...this._config, ...config };
|
|
10204
10197
|
if (config.filters) {
|
|
10205
|
-
this._filters =
|
|
10198
|
+
this._filters = import_lodash2.default.mapValues(config.filters, import_regex_parser.default);
|
|
10206
10199
|
}
|
|
10207
10200
|
for (const logger of this._loggers.values()) {
|
|
10208
10201
|
logger.configure(config);
|
|
@@ -10212,7 +10205,7 @@ var require_logger = __commonJS({
|
|
|
10212
10205
|
if (this._loggers.has(name)) {
|
|
10213
10206
|
return this._loggers.get(name);
|
|
10214
10207
|
}
|
|
10215
|
-
const logger = new
|
|
10208
|
+
const logger = new _Logger2("", { ...this._config });
|
|
10216
10209
|
logger.parent = this;
|
|
10217
10210
|
logger.namespace = logger.parent.namespace.length ? logger.parent.namespace + this._config.namespaceDelimiter : "";
|
|
10218
10211
|
logger.namespace += name;
|
|
@@ -10258,17 +10251,9 @@ var require_logger = __commonJS({
|
|
|
10258
10251
|
this._config.transports.forEach((transport) => transport.send(this._config, formattedEntry));
|
|
10259
10252
|
}
|
|
10260
10253
|
};
|
|
10261
|
-
|
|
10262
|
-
|
|
10263
|
-
|
|
10264
|
-
|
|
10265
|
-
// node_modules/.pnpm/@bpinternal+log4bot@0.0.5_@types+node@18.19.20/node_modules/@bpinternal/log4bot/dist/formatters/json.js
|
|
10266
|
-
var require_json = __commonJS({
|
|
10267
|
-
"node_modules/.pnpm/@bpinternal+log4bot@0.0.5_@types+node@18.19.20/node_modules/@bpinternal/log4bot/dist/formatters/json.js"(exports2) {
|
|
10268
|
-
"use strict";
|
|
10269
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
10270
|
-
exports2.JSONFormatter = void 0;
|
|
10271
|
-
var JSONFormatter = class {
|
|
10254
|
+
__name(_Logger, "Logger");
|
|
10255
|
+
var Logger2 = _Logger;
|
|
10256
|
+
var _JSONFormatter = class _JSONFormatter {
|
|
10272
10257
|
constructor() {
|
|
10273
10258
|
}
|
|
10274
10259
|
format(config, entry) {
|
|
@@ -10280,82 +10265,1555 @@ var require_json = __commonJS({
|
|
|
10280
10265
|
};
|
|
10281
10266
|
}
|
|
10282
10267
|
};
|
|
10283
|
-
|
|
10268
|
+
__name(_JSONFormatter, "JSONFormatter");
|
|
10269
|
+
var JSONFormatter = _JSONFormatter;
|
|
10270
|
+
}
|
|
10271
|
+
});
|
|
10272
|
+
|
|
10273
|
+
// node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js
|
|
10274
|
+
var require_color_name = __commonJS({
|
|
10275
|
+
"node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js"(exports2, module2) {
|
|
10276
|
+
"use strict";
|
|
10277
|
+
module2.exports = {
|
|
10278
|
+
"aliceblue": [240, 248, 255],
|
|
10279
|
+
"antiquewhite": [250, 235, 215],
|
|
10280
|
+
"aqua": [0, 255, 255],
|
|
10281
|
+
"aquamarine": [127, 255, 212],
|
|
10282
|
+
"azure": [240, 255, 255],
|
|
10283
|
+
"beige": [245, 245, 220],
|
|
10284
|
+
"bisque": [255, 228, 196],
|
|
10285
|
+
"black": [0, 0, 0],
|
|
10286
|
+
"blanchedalmond": [255, 235, 205],
|
|
10287
|
+
"blue": [0, 0, 255],
|
|
10288
|
+
"blueviolet": [138, 43, 226],
|
|
10289
|
+
"brown": [165, 42, 42],
|
|
10290
|
+
"burlywood": [222, 184, 135],
|
|
10291
|
+
"cadetblue": [95, 158, 160],
|
|
10292
|
+
"chartreuse": [127, 255, 0],
|
|
10293
|
+
"chocolate": [210, 105, 30],
|
|
10294
|
+
"coral": [255, 127, 80],
|
|
10295
|
+
"cornflowerblue": [100, 149, 237],
|
|
10296
|
+
"cornsilk": [255, 248, 220],
|
|
10297
|
+
"crimson": [220, 20, 60],
|
|
10298
|
+
"cyan": [0, 255, 255],
|
|
10299
|
+
"darkblue": [0, 0, 139],
|
|
10300
|
+
"darkcyan": [0, 139, 139],
|
|
10301
|
+
"darkgoldenrod": [184, 134, 11],
|
|
10302
|
+
"darkgray": [169, 169, 169],
|
|
10303
|
+
"darkgreen": [0, 100, 0],
|
|
10304
|
+
"darkgrey": [169, 169, 169],
|
|
10305
|
+
"darkkhaki": [189, 183, 107],
|
|
10306
|
+
"darkmagenta": [139, 0, 139],
|
|
10307
|
+
"darkolivegreen": [85, 107, 47],
|
|
10308
|
+
"darkorange": [255, 140, 0],
|
|
10309
|
+
"darkorchid": [153, 50, 204],
|
|
10310
|
+
"darkred": [139, 0, 0],
|
|
10311
|
+
"darksalmon": [233, 150, 122],
|
|
10312
|
+
"darkseagreen": [143, 188, 143],
|
|
10313
|
+
"darkslateblue": [72, 61, 139],
|
|
10314
|
+
"darkslategray": [47, 79, 79],
|
|
10315
|
+
"darkslategrey": [47, 79, 79],
|
|
10316
|
+
"darkturquoise": [0, 206, 209],
|
|
10317
|
+
"darkviolet": [148, 0, 211],
|
|
10318
|
+
"deeppink": [255, 20, 147],
|
|
10319
|
+
"deepskyblue": [0, 191, 255],
|
|
10320
|
+
"dimgray": [105, 105, 105],
|
|
10321
|
+
"dimgrey": [105, 105, 105],
|
|
10322
|
+
"dodgerblue": [30, 144, 255],
|
|
10323
|
+
"firebrick": [178, 34, 34],
|
|
10324
|
+
"floralwhite": [255, 250, 240],
|
|
10325
|
+
"forestgreen": [34, 139, 34],
|
|
10326
|
+
"fuchsia": [255, 0, 255],
|
|
10327
|
+
"gainsboro": [220, 220, 220],
|
|
10328
|
+
"ghostwhite": [248, 248, 255],
|
|
10329
|
+
"gold": [255, 215, 0],
|
|
10330
|
+
"goldenrod": [218, 165, 32],
|
|
10331
|
+
"gray": [128, 128, 128],
|
|
10332
|
+
"green": [0, 128, 0],
|
|
10333
|
+
"greenyellow": [173, 255, 47],
|
|
10334
|
+
"grey": [128, 128, 128],
|
|
10335
|
+
"honeydew": [240, 255, 240],
|
|
10336
|
+
"hotpink": [255, 105, 180],
|
|
10337
|
+
"indianred": [205, 92, 92],
|
|
10338
|
+
"indigo": [75, 0, 130],
|
|
10339
|
+
"ivory": [255, 255, 240],
|
|
10340
|
+
"khaki": [240, 230, 140],
|
|
10341
|
+
"lavender": [230, 230, 250],
|
|
10342
|
+
"lavenderblush": [255, 240, 245],
|
|
10343
|
+
"lawngreen": [124, 252, 0],
|
|
10344
|
+
"lemonchiffon": [255, 250, 205],
|
|
10345
|
+
"lightblue": [173, 216, 230],
|
|
10346
|
+
"lightcoral": [240, 128, 128],
|
|
10347
|
+
"lightcyan": [224, 255, 255],
|
|
10348
|
+
"lightgoldenrodyellow": [250, 250, 210],
|
|
10349
|
+
"lightgray": [211, 211, 211],
|
|
10350
|
+
"lightgreen": [144, 238, 144],
|
|
10351
|
+
"lightgrey": [211, 211, 211],
|
|
10352
|
+
"lightpink": [255, 182, 193],
|
|
10353
|
+
"lightsalmon": [255, 160, 122],
|
|
10354
|
+
"lightseagreen": [32, 178, 170],
|
|
10355
|
+
"lightskyblue": [135, 206, 250],
|
|
10356
|
+
"lightslategray": [119, 136, 153],
|
|
10357
|
+
"lightslategrey": [119, 136, 153],
|
|
10358
|
+
"lightsteelblue": [176, 196, 222],
|
|
10359
|
+
"lightyellow": [255, 255, 224],
|
|
10360
|
+
"lime": [0, 255, 0],
|
|
10361
|
+
"limegreen": [50, 205, 50],
|
|
10362
|
+
"linen": [250, 240, 230],
|
|
10363
|
+
"magenta": [255, 0, 255],
|
|
10364
|
+
"maroon": [128, 0, 0],
|
|
10365
|
+
"mediumaquamarine": [102, 205, 170],
|
|
10366
|
+
"mediumblue": [0, 0, 205],
|
|
10367
|
+
"mediumorchid": [186, 85, 211],
|
|
10368
|
+
"mediumpurple": [147, 112, 219],
|
|
10369
|
+
"mediumseagreen": [60, 179, 113],
|
|
10370
|
+
"mediumslateblue": [123, 104, 238],
|
|
10371
|
+
"mediumspringgreen": [0, 250, 154],
|
|
10372
|
+
"mediumturquoise": [72, 209, 204],
|
|
10373
|
+
"mediumvioletred": [199, 21, 133],
|
|
10374
|
+
"midnightblue": [25, 25, 112],
|
|
10375
|
+
"mintcream": [245, 255, 250],
|
|
10376
|
+
"mistyrose": [255, 228, 225],
|
|
10377
|
+
"moccasin": [255, 228, 181],
|
|
10378
|
+
"navajowhite": [255, 222, 173],
|
|
10379
|
+
"navy": [0, 0, 128],
|
|
10380
|
+
"oldlace": [253, 245, 230],
|
|
10381
|
+
"olive": [128, 128, 0],
|
|
10382
|
+
"olivedrab": [107, 142, 35],
|
|
10383
|
+
"orange": [255, 165, 0],
|
|
10384
|
+
"orangered": [255, 69, 0],
|
|
10385
|
+
"orchid": [218, 112, 214],
|
|
10386
|
+
"palegoldenrod": [238, 232, 170],
|
|
10387
|
+
"palegreen": [152, 251, 152],
|
|
10388
|
+
"paleturquoise": [175, 238, 238],
|
|
10389
|
+
"palevioletred": [219, 112, 147],
|
|
10390
|
+
"papayawhip": [255, 239, 213],
|
|
10391
|
+
"peachpuff": [255, 218, 185],
|
|
10392
|
+
"peru": [205, 133, 63],
|
|
10393
|
+
"pink": [255, 192, 203],
|
|
10394
|
+
"plum": [221, 160, 221],
|
|
10395
|
+
"powderblue": [176, 224, 230],
|
|
10396
|
+
"purple": [128, 0, 128],
|
|
10397
|
+
"rebeccapurple": [102, 51, 153],
|
|
10398
|
+
"red": [255, 0, 0],
|
|
10399
|
+
"rosybrown": [188, 143, 143],
|
|
10400
|
+
"royalblue": [65, 105, 225],
|
|
10401
|
+
"saddlebrown": [139, 69, 19],
|
|
10402
|
+
"salmon": [250, 128, 114],
|
|
10403
|
+
"sandybrown": [244, 164, 96],
|
|
10404
|
+
"seagreen": [46, 139, 87],
|
|
10405
|
+
"seashell": [255, 245, 238],
|
|
10406
|
+
"sienna": [160, 82, 45],
|
|
10407
|
+
"silver": [192, 192, 192],
|
|
10408
|
+
"skyblue": [135, 206, 235],
|
|
10409
|
+
"slateblue": [106, 90, 205],
|
|
10410
|
+
"slategray": [112, 128, 144],
|
|
10411
|
+
"slategrey": [112, 128, 144],
|
|
10412
|
+
"snow": [255, 250, 250],
|
|
10413
|
+
"springgreen": [0, 255, 127],
|
|
10414
|
+
"steelblue": [70, 130, 180],
|
|
10415
|
+
"tan": [210, 180, 140],
|
|
10416
|
+
"teal": [0, 128, 128],
|
|
10417
|
+
"thistle": [216, 191, 216],
|
|
10418
|
+
"tomato": [255, 99, 71],
|
|
10419
|
+
"turquoise": [64, 224, 208],
|
|
10420
|
+
"violet": [238, 130, 238],
|
|
10421
|
+
"wheat": [245, 222, 179],
|
|
10422
|
+
"white": [255, 255, 255],
|
|
10423
|
+
"whitesmoke": [245, 245, 245],
|
|
10424
|
+
"yellow": [255, 255, 0],
|
|
10425
|
+
"yellowgreen": [154, 205, 50]
|
|
10426
|
+
};
|
|
10427
|
+
}
|
|
10428
|
+
});
|
|
10429
|
+
|
|
10430
|
+
// node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js
|
|
10431
|
+
var require_conversions = __commonJS({
|
|
10432
|
+
"node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js"(exports2, module2) {
|
|
10433
|
+
var cssKeywords = require_color_name();
|
|
10434
|
+
var reverseKeywords = {};
|
|
10435
|
+
for (const key of Object.keys(cssKeywords)) {
|
|
10436
|
+
reverseKeywords[cssKeywords[key]] = key;
|
|
10437
|
+
}
|
|
10438
|
+
var convert = {
|
|
10439
|
+
rgb: { channels: 3, labels: "rgb" },
|
|
10440
|
+
hsl: { channels: 3, labels: "hsl" },
|
|
10441
|
+
hsv: { channels: 3, labels: "hsv" },
|
|
10442
|
+
hwb: { channels: 3, labels: "hwb" },
|
|
10443
|
+
cmyk: { channels: 4, labels: "cmyk" },
|
|
10444
|
+
xyz: { channels: 3, labels: "xyz" },
|
|
10445
|
+
lab: { channels: 3, labels: "lab" },
|
|
10446
|
+
lch: { channels: 3, labels: "lch" },
|
|
10447
|
+
hex: { channels: 1, labels: ["hex"] },
|
|
10448
|
+
keyword: { channels: 1, labels: ["keyword"] },
|
|
10449
|
+
ansi16: { channels: 1, labels: ["ansi16"] },
|
|
10450
|
+
ansi256: { channels: 1, labels: ["ansi256"] },
|
|
10451
|
+
hcg: { channels: 3, labels: ["h", "c", "g"] },
|
|
10452
|
+
apple: { channels: 3, labels: ["r16", "g16", "b16"] },
|
|
10453
|
+
gray: { channels: 1, labels: ["gray"] }
|
|
10454
|
+
};
|
|
10455
|
+
module2.exports = convert;
|
|
10456
|
+
for (const model of Object.keys(convert)) {
|
|
10457
|
+
if (!("channels" in convert[model])) {
|
|
10458
|
+
throw new Error("missing channels property: " + model);
|
|
10459
|
+
}
|
|
10460
|
+
if (!("labels" in convert[model])) {
|
|
10461
|
+
throw new Error("missing channel labels property: " + model);
|
|
10462
|
+
}
|
|
10463
|
+
if (convert[model].labels.length !== convert[model].channels) {
|
|
10464
|
+
throw new Error("channel and label counts mismatch: " + model);
|
|
10465
|
+
}
|
|
10466
|
+
const { channels, labels } = convert[model];
|
|
10467
|
+
delete convert[model].channels;
|
|
10468
|
+
delete convert[model].labels;
|
|
10469
|
+
Object.defineProperty(convert[model], "channels", { value: channels });
|
|
10470
|
+
Object.defineProperty(convert[model], "labels", { value: labels });
|
|
10471
|
+
}
|
|
10472
|
+
convert.rgb.hsl = function(rgb) {
|
|
10473
|
+
const r2 = rgb[0] / 255;
|
|
10474
|
+
const g = rgb[1] / 255;
|
|
10475
|
+
const b = rgb[2] / 255;
|
|
10476
|
+
const min = Math.min(r2, g, b);
|
|
10477
|
+
const max = Math.max(r2, g, b);
|
|
10478
|
+
const delta = max - min;
|
|
10479
|
+
let h2;
|
|
10480
|
+
let s2;
|
|
10481
|
+
if (max === min) {
|
|
10482
|
+
h2 = 0;
|
|
10483
|
+
} else if (r2 === max) {
|
|
10484
|
+
h2 = (g - b) / delta;
|
|
10485
|
+
} else if (g === max) {
|
|
10486
|
+
h2 = 2 + (b - r2) / delta;
|
|
10487
|
+
} else if (b === max) {
|
|
10488
|
+
h2 = 4 + (r2 - g) / delta;
|
|
10489
|
+
}
|
|
10490
|
+
h2 = Math.min(h2 * 60, 360);
|
|
10491
|
+
if (h2 < 0) {
|
|
10492
|
+
h2 += 360;
|
|
10493
|
+
}
|
|
10494
|
+
const l = (min + max) / 2;
|
|
10495
|
+
if (max === min) {
|
|
10496
|
+
s2 = 0;
|
|
10497
|
+
} else if (l <= 0.5) {
|
|
10498
|
+
s2 = delta / (max + min);
|
|
10499
|
+
} else {
|
|
10500
|
+
s2 = delta / (2 - max - min);
|
|
10501
|
+
}
|
|
10502
|
+
return [h2, s2 * 100, l * 100];
|
|
10503
|
+
};
|
|
10504
|
+
convert.rgb.hsv = function(rgb) {
|
|
10505
|
+
let rdif;
|
|
10506
|
+
let gdif;
|
|
10507
|
+
let bdif;
|
|
10508
|
+
let h2;
|
|
10509
|
+
let s2;
|
|
10510
|
+
const r2 = rgb[0] / 255;
|
|
10511
|
+
const g = rgb[1] / 255;
|
|
10512
|
+
const b = rgb[2] / 255;
|
|
10513
|
+
const v = Math.max(r2, g, b);
|
|
10514
|
+
const diff = v - Math.min(r2, g, b);
|
|
10515
|
+
const diffc = function(c) {
|
|
10516
|
+
return (v - c) / 6 / diff + 1 / 2;
|
|
10517
|
+
};
|
|
10518
|
+
if (diff === 0) {
|
|
10519
|
+
h2 = 0;
|
|
10520
|
+
s2 = 0;
|
|
10521
|
+
} else {
|
|
10522
|
+
s2 = diff / v;
|
|
10523
|
+
rdif = diffc(r2);
|
|
10524
|
+
gdif = diffc(g);
|
|
10525
|
+
bdif = diffc(b);
|
|
10526
|
+
if (r2 === v) {
|
|
10527
|
+
h2 = bdif - gdif;
|
|
10528
|
+
} else if (g === v) {
|
|
10529
|
+
h2 = 1 / 3 + rdif - bdif;
|
|
10530
|
+
} else if (b === v) {
|
|
10531
|
+
h2 = 2 / 3 + gdif - rdif;
|
|
10532
|
+
}
|
|
10533
|
+
if (h2 < 0) {
|
|
10534
|
+
h2 += 1;
|
|
10535
|
+
} else if (h2 > 1) {
|
|
10536
|
+
h2 -= 1;
|
|
10537
|
+
}
|
|
10538
|
+
}
|
|
10539
|
+
return [
|
|
10540
|
+
h2 * 360,
|
|
10541
|
+
s2 * 100,
|
|
10542
|
+
v * 100
|
|
10543
|
+
];
|
|
10544
|
+
};
|
|
10545
|
+
convert.rgb.hwb = function(rgb) {
|
|
10546
|
+
const r2 = rgb[0];
|
|
10547
|
+
const g = rgb[1];
|
|
10548
|
+
let b = rgb[2];
|
|
10549
|
+
const h2 = convert.rgb.hsl(rgb)[0];
|
|
10550
|
+
const w = 1 / 255 * Math.min(r2, Math.min(g, b));
|
|
10551
|
+
b = 1 - 1 / 255 * Math.max(r2, Math.max(g, b));
|
|
10552
|
+
return [h2, w * 100, b * 100];
|
|
10553
|
+
};
|
|
10554
|
+
convert.rgb.cmyk = function(rgb) {
|
|
10555
|
+
const r2 = rgb[0] / 255;
|
|
10556
|
+
const g = rgb[1] / 255;
|
|
10557
|
+
const b = rgb[2] / 255;
|
|
10558
|
+
const k = Math.min(1 - r2, 1 - g, 1 - b);
|
|
10559
|
+
const c = (1 - r2 - k) / (1 - k) || 0;
|
|
10560
|
+
const m2 = (1 - g - k) / (1 - k) || 0;
|
|
10561
|
+
const y = (1 - b - k) / (1 - k) || 0;
|
|
10562
|
+
return [c * 100, m2 * 100, y * 100, k * 100];
|
|
10563
|
+
};
|
|
10564
|
+
function comparativeDistance(x2, y) {
|
|
10565
|
+
return (x2[0] - y[0]) ** 2 + (x2[1] - y[1]) ** 2 + (x2[2] - y[2]) ** 2;
|
|
10566
|
+
}
|
|
10567
|
+
convert.rgb.keyword = function(rgb) {
|
|
10568
|
+
const reversed = reverseKeywords[rgb];
|
|
10569
|
+
if (reversed) {
|
|
10570
|
+
return reversed;
|
|
10571
|
+
}
|
|
10572
|
+
let currentClosestDistance = Infinity;
|
|
10573
|
+
let currentClosestKeyword;
|
|
10574
|
+
for (const keyword of Object.keys(cssKeywords)) {
|
|
10575
|
+
const value = cssKeywords[keyword];
|
|
10576
|
+
const distance = comparativeDistance(rgb, value);
|
|
10577
|
+
if (distance < currentClosestDistance) {
|
|
10578
|
+
currentClosestDistance = distance;
|
|
10579
|
+
currentClosestKeyword = keyword;
|
|
10580
|
+
}
|
|
10581
|
+
}
|
|
10582
|
+
return currentClosestKeyword;
|
|
10583
|
+
};
|
|
10584
|
+
convert.keyword.rgb = function(keyword) {
|
|
10585
|
+
return cssKeywords[keyword];
|
|
10586
|
+
};
|
|
10587
|
+
convert.rgb.xyz = function(rgb) {
|
|
10588
|
+
let r2 = rgb[0] / 255;
|
|
10589
|
+
let g = rgb[1] / 255;
|
|
10590
|
+
let b = rgb[2] / 255;
|
|
10591
|
+
r2 = r2 > 0.04045 ? ((r2 + 0.055) / 1.055) ** 2.4 : r2 / 12.92;
|
|
10592
|
+
g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
|
|
10593
|
+
b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
|
|
10594
|
+
const x2 = r2 * 0.4124 + g * 0.3576 + b * 0.1805;
|
|
10595
|
+
const y = r2 * 0.2126 + g * 0.7152 + b * 0.0722;
|
|
10596
|
+
const z2 = r2 * 0.0193 + g * 0.1192 + b * 0.9505;
|
|
10597
|
+
return [x2 * 100, y * 100, z2 * 100];
|
|
10598
|
+
};
|
|
10599
|
+
convert.rgb.lab = function(rgb) {
|
|
10600
|
+
const xyz = convert.rgb.xyz(rgb);
|
|
10601
|
+
let x2 = xyz[0];
|
|
10602
|
+
let y = xyz[1];
|
|
10603
|
+
let z2 = xyz[2];
|
|
10604
|
+
x2 /= 95.047;
|
|
10605
|
+
y /= 100;
|
|
10606
|
+
z2 /= 108.883;
|
|
10607
|
+
x2 = x2 > 8856e-6 ? x2 ** (1 / 3) : 7.787 * x2 + 16 / 116;
|
|
10608
|
+
y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
10609
|
+
z2 = z2 > 8856e-6 ? z2 ** (1 / 3) : 7.787 * z2 + 16 / 116;
|
|
10610
|
+
const l = 116 * y - 16;
|
|
10611
|
+
const a = 500 * (x2 - y);
|
|
10612
|
+
const b = 200 * (y - z2);
|
|
10613
|
+
return [l, a, b];
|
|
10614
|
+
};
|
|
10615
|
+
convert.hsl.rgb = function(hsl) {
|
|
10616
|
+
const h2 = hsl[0] / 360;
|
|
10617
|
+
const s2 = hsl[1] / 100;
|
|
10618
|
+
const l = hsl[2] / 100;
|
|
10619
|
+
let t2;
|
|
10620
|
+
let t3;
|
|
10621
|
+
let val;
|
|
10622
|
+
if (s2 === 0) {
|
|
10623
|
+
val = l * 255;
|
|
10624
|
+
return [val, val, val];
|
|
10625
|
+
}
|
|
10626
|
+
if (l < 0.5) {
|
|
10627
|
+
t2 = l * (1 + s2);
|
|
10628
|
+
} else {
|
|
10629
|
+
t2 = l + s2 - l * s2;
|
|
10630
|
+
}
|
|
10631
|
+
const t1 = 2 * l - t2;
|
|
10632
|
+
const rgb = [0, 0, 0];
|
|
10633
|
+
for (let i2 = 0; i2 < 3; i2++) {
|
|
10634
|
+
t3 = h2 + 1 / 3 * -(i2 - 1);
|
|
10635
|
+
if (t3 < 0) {
|
|
10636
|
+
t3++;
|
|
10637
|
+
}
|
|
10638
|
+
if (t3 > 1) {
|
|
10639
|
+
t3--;
|
|
10640
|
+
}
|
|
10641
|
+
if (6 * t3 < 1) {
|
|
10642
|
+
val = t1 + (t2 - t1) * 6 * t3;
|
|
10643
|
+
} else if (2 * t3 < 1) {
|
|
10644
|
+
val = t2;
|
|
10645
|
+
} else if (3 * t3 < 2) {
|
|
10646
|
+
val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
|
10647
|
+
} else {
|
|
10648
|
+
val = t1;
|
|
10649
|
+
}
|
|
10650
|
+
rgb[i2] = val * 255;
|
|
10651
|
+
}
|
|
10652
|
+
return rgb;
|
|
10653
|
+
};
|
|
10654
|
+
convert.hsl.hsv = function(hsl) {
|
|
10655
|
+
const h2 = hsl[0];
|
|
10656
|
+
let s2 = hsl[1] / 100;
|
|
10657
|
+
let l = hsl[2] / 100;
|
|
10658
|
+
let smin = s2;
|
|
10659
|
+
const lmin = Math.max(l, 0.01);
|
|
10660
|
+
l *= 2;
|
|
10661
|
+
s2 *= l <= 1 ? l : 2 - l;
|
|
10662
|
+
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
10663
|
+
const v = (l + s2) / 2;
|
|
10664
|
+
const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s2 / (l + s2);
|
|
10665
|
+
return [h2, sv * 100, v * 100];
|
|
10666
|
+
};
|
|
10667
|
+
convert.hsv.rgb = function(hsv) {
|
|
10668
|
+
const h2 = hsv[0] / 60;
|
|
10669
|
+
const s2 = hsv[1] / 100;
|
|
10670
|
+
let v = hsv[2] / 100;
|
|
10671
|
+
const hi = Math.floor(h2) % 6;
|
|
10672
|
+
const f3 = h2 - Math.floor(h2);
|
|
10673
|
+
const p = 255 * v * (1 - s2);
|
|
10674
|
+
const q = 255 * v * (1 - s2 * f3);
|
|
10675
|
+
const t2 = 255 * v * (1 - s2 * (1 - f3));
|
|
10676
|
+
v *= 255;
|
|
10677
|
+
switch (hi) {
|
|
10678
|
+
case 0:
|
|
10679
|
+
return [v, t2, p];
|
|
10680
|
+
case 1:
|
|
10681
|
+
return [q, v, p];
|
|
10682
|
+
case 2:
|
|
10683
|
+
return [p, v, t2];
|
|
10684
|
+
case 3:
|
|
10685
|
+
return [p, q, v];
|
|
10686
|
+
case 4:
|
|
10687
|
+
return [t2, p, v];
|
|
10688
|
+
case 5:
|
|
10689
|
+
return [v, p, q];
|
|
10690
|
+
}
|
|
10691
|
+
};
|
|
10692
|
+
convert.hsv.hsl = function(hsv) {
|
|
10693
|
+
const h2 = hsv[0];
|
|
10694
|
+
const s2 = hsv[1] / 100;
|
|
10695
|
+
const v = hsv[2] / 100;
|
|
10696
|
+
const vmin = Math.max(v, 0.01);
|
|
10697
|
+
let sl;
|
|
10698
|
+
let l;
|
|
10699
|
+
l = (2 - s2) * v;
|
|
10700
|
+
const lmin = (2 - s2) * vmin;
|
|
10701
|
+
sl = s2 * vmin;
|
|
10702
|
+
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
10703
|
+
sl = sl || 0;
|
|
10704
|
+
l /= 2;
|
|
10705
|
+
return [h2, sl * 100, l * 100];
|
|
10706
|
+
};
|
|
10707
|
+
convert.hwb.rgb = function(hwb) {
|
|
10708
|
+
const h2 = hwb[0] / 360;
|
|
10709
|
+
let wh = hwb[1] / 100;
|
|
10710
|
+
let bl = hwb[2] / 100;
|
|
10711
|
+
const ratio = wh + bl;
|
|
10712
|
+
let f3;
|
|
10713
|
+
if (ratio > 1) {
|
|
10714
|
+
wh /= ratio;
|
|
10715
|
+
bl /= ratio;
|
|
10716
|
+
}
|
|
10717
|
+
const i2 = Math.floor(6 * h2);
|
|
10718
|
+
const v = 1 - bl;
|
|
10719
|
+
f3 = 6 * h2 - i2;
|
|
10720
|
+
if ((i2 & 1) !== 0) {
|
|
10721
|
+
f3 = 1 - f3;
|
|
10722
|
+
}
|
|
10723
|
+
const n = wh + f3 * (v - wh);
|
|
10724
|
+
let r2;
|
|
10725
|
+
let g;
|
|
10726
|
+
let b;
|
|
10727
|
+
switch (i2) {
|
|
10728
|
+
default:
|
|
10729
|
+
case 6:
|
|
10730
|
+
case 0:
|
|
10731
|
+
r2 = v;
|
|
10732
|
+
g = n;
|
|
10733
|
+
b = wh;
|
|
10734
|
+
break;
|
|
10735
|
+
case 1:
|
|
10736
|
+
r2 = n;
|
|
10737
|
+
g = v;
|
|
10738
|
+
b = wh;
|
|
10739
|
+
break;
|
|
10740
|
+
case 2:
|
|
10741
|
+
r2 = wh;
|
|
10742
|
+
g = v;
|
|
10743
|
+
b = n;
|
|
10744
|
+
break;
|
|
10745
|
+
case 3:
|
|
10746
|
+
r2 = wh;
|
|
10747
|
+
g = n;
|
|
10748
|
+
b = v;
|
|
10749
|
+
break;
|
|
10750
|
+
case 4:
|
|
10751
|
+
r2 = n;
|
|
10752
|
+
g = wh;
|
|
10753
|
+
b = v;
|
|
10754
|
+
break;
|
|
10755
|
+
case 5:
|
|
10756
|
+
r2 = v;
|
|
10757
|
+
g = wh;
|
|
10758
|
+
b = n;
|
|
10759
|
+
break;
|
|
10760
|
+
}
|
|
10761
|
+
return [r2 * 255, g * 255, b * 255];
|
|
10762
|
+
};
|
|
10763
|
+
convert.cmyk.rgb = function(cmyk) {
|
|
10764
|
+
const c = cmyk[0] / 100;
|
|
10765
|
+
const m2 = cmyk[1] / 100;
|
|
10766
|
+
const y = cmyk[2] / 100;
|
|
10767
|
+
const k = cmyk[3] / 100;
|
|
10768
|
+
const r2 = 1 - Math.min(1, c * (1 - k) + k);
|
|
10769
|
+
const g = 1 - Math.min(1, m2 * (1 - k) + k);
|
|
10770
|
+
const b = 1 - Math.min(1, y * (1 - k) + k);
|
|
10771
|
+
return [r2 * 255, g * 255, b * 255];
|
|
10772
|
+
};
|
|
10773
|
+
convert.xyz.rgb = function(xyz) {
|
|
10774
|
+
const x2 = xyz[0] / 100;
|
|
10775
|
+
const y = xyz[1] / 100;
|
|
10776
|
+
const z2 = xyz[2] / 100;
|
|
10777
|
+
let r2;
|
|
10778
|
+
let g;
|
|
10779
|
+
let b;
|
|
10780
|
+
r2 = x2 * 3.2406 + y * -1.5372 + z2 * -0.4986;
|
|
10781
|
+
g = x2 * -0.9689 + y * 1.8758 + z2 * 0.0415;
|
|
10782
|
+
b = x2 * 0.0557 + y * -0.204 + z2 * 1.057;
|
|
10783
|
+
r2 = r2 > 31308e-7 ? 1.055 * r2 ** (1 / 2.4) - 0.055 : r2 * 12.92;
|
|
10784
|
+
g = g > 31308e-7 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92;
|
|
10785
|
+
b = b > 31308e-7 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92;
|
|
10786
|
+
r2 = Math.min(Math.max(0, r2), 1);
|
|
10787
|
+
g = Math.min(Math.max(0, g), 1);
|
|
10788
|
+
b = Math.min(Math.max(0, b), 1);
|
|
10789
|
+
return [r2 * 255, g * 255, b * 255];
|
|
10790
|
+
};
|
|
10791
|
+
convert.xyz.lab = function(xyz) {
|
|
10792
|
+
let x2 = xyz[0];
|
|
10793
|
+
let y = xyz[1];
|
|
10794
|
+
let z2 = xyz[2];
|
|
10795
|
+
x2 /= 95.047;
|
|
10796
|
+
y /= 100;
|
|
10797
|
+
z2 /= 108.883;
|
|
10798
|
+
x2 = x2 > 8856e-6 ? x2 ** (1 / 3) : 7.787 * x2 + 16 / 116;
|
|
10799
|
+
y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
10800
|
+
z2 = z2 > 8856e-6 ? z2 ** (1 / 3) : 7.787 * z2 + 16 / 116;
|
|
10801
|
+
const l = 116 * y - 16;
|
|
10802
|
+
const a = 500 * (x2 - y);
|
|
10803
|
+
const b = 200 * (y - z2);
|
|
10804
|
+
return [l, a, b];
|
|
10805
|
+
};
|
|
10806
|
+
convert.lab.xyz = function(lab) {
|
|
10807
|
+
const l = lab[0];
|
|
10808
|
+
const a = lab[1];
|
|
10809
|
+
const b = lab[2];
|
|
10810
|
+
let x2;
|
|
10811
|
+
let y;
|
|
10812
|
+
let z2;
|
|
10813
|
+
y = (l + 16) / 116;
|
|
10814
|
+
x2 = a / 500 + y;
|
|
10815
|
+
z2 = y - b / 200;
|
|
10816
|
+
const y2 = y ** 3;
|
|
10817
|
+
const x22 = x2 ** 3;
|
|
10818
|
+
const z22 = z2 ** 3;
|
|
10819
|
+
y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787;
|
|
10820
|
+
x2 = x22 > 8856e-6 ? x22 : (x2 - 16 / 116) / 7.787;
|
|
10821
|
+
z2 = z22 > 8856e-6 ? z22 : (z2 - 16 / 116) / 7.787;
|
|
10822
|
+
x2 *= 95.047;
|
|
10823
|
+
y *= 100;
|
|
10824
|
+
z2 *= 108.883;
|
|
10825
|
+
return [x2, y, z2];
|
|
10826
|
+
};
|
|
10827
|
+
convert.lab.lch = function(lab) {
|
|
10828
|
+
const l = lab[0];
|
|
10829
|
+
const a = lab[1];
|
|
10830
|
+
const b = lab[2];
|
|
10831
|
+
let h2;
|
|
10832
|
+
const hr = Math.atan2(b, a);
|
|
10833
|
+
h2 = hr * 360 / 2 / Math.PI;
|
|
10834
|
+
if (h2 < 0) {
|
|
10835
|
+
h2 += 360;
|
|
10836
|
+
}
|
|
10837
|
+
const c = Math.sqrt(a * a + b * b);
|
|
10838
|
+
return [l, c, h2];
|
|
10839
|
+
};
|
|
10840
|
+
convert.lch.lab = function(lch) {
|
|
10841
|
+
const l = lch[0];
|
|
10842
|
+
const c = lch[1];
|
|
10843
|
+
const h2 = lch[2];
|
|
10844
|
+
const hr = h2 / 360 * 2 * Math.PI;
|
|
10845
|
+
const a = c * Math.cos(hr);
|
|
10846
|
+
const b = c * Math.sin(hr);
|
|
10847
|
+
return [l, a, b];
|
|
10848
|
+
};
|
|
10849
|
+
convert.rgb.ansi16 = function(args, saturation = null) {
|
|
10850
|
+
const [r2, g, b] = args;
|
|
10851
|
+
let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
|
|
10852
|
+
value = Math.round(value / 50);
|
|
10853
|
+
if (value === 0) {
|
|
10854
|
+
return 30;
|
|
10855
|
+
}
|
|
10856
|
+
let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r2 / 255));
|
|
10857
|
+
if (value === 2) {
|
|
10858
|
+
ansi += 60;
|
|
10859
|
+
}
|
|
10860
|
+
return ansi;
|
|
10861
|
+
};
|
|
10862
|
+
convert.hsv.ansi16 = function(args) {
|
|
10863
|
+
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
|
10864
|
+
};
|
|
10865
|
+
convert.rgb.ansi256 = function(args) {
|
|
10866
|
+
const r2 = args[0];
|
|
10867
|
+
const g = args[1];
|
|
10868
|
+
const b = args[2];
|
|
10869
|
+
if (r2 === g && g === b) {
|
|
10870
|
+
if (r2 < 8) {
|
|
10871
|
+
return 16;
|
|
10872
|
+
}
|
|
10873
|
+
if (r2 > 248) {
|
|
10874
|
+
return 231;
|
|
10875
|
+
}
|
|
10876
|
+
return Math.round((r2 - 8) / 247 * 24) + 232;
|
|
10877
|
+
}
|
|
10878
|
+
const ansi = 16 + 36 * Math.round(r2 / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
|
|
10879
|
+
return ansi;
|
|
10880
|
+
};
|
|
10881
|
+
convert.ansi16.rgb = function(args) {
|
|
10882
|
+
let color = args % 10;
|
|
10883
|
+
if (color === 0 || color === 7) {
|
|
10884
|
+
if (args > 50) {
|
|
10885
|
+
color += 3.5;
|
|
10886
|
+
}
|
|
10887
|
+
color = color / 10.5 * 255;
|
|
10888
|
+
return [color, color, color];
|
|
10889
|
+
}
|
|
10890
|
+
const mult = (~~(args > 50) + 1) * 0.5;
|
|
10891
|
+
const r2 = (color & 1) * mult * 255;
|
|
10892
|
+
const g = (color >> 1 & 1) * mult * 255;
|
|
10893
|
+
const b = (color >> 2 & 1) * mult * 255;
|
|
10894
|
+
return [r2, g, b];
|
|
10895
|
+
};
|
|
10896
|
+
convert.ansi256.rgb = function(args) {
|
|
10897
|
+
if (args >= 232) {
|
|
10898
|
+
const c = (args - 232) * 10 + 8;
|
|
10899
|
+
return [c, c, c];
|
|
10900
|
+
}
|
|
10901
|
+
args -= 16;
|
|
10902
|
+
let rem;
|
|
10903
|
+
const r2 = Math.floor(args / 36) / 5 * 255;
|
|
10904
|
+
const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
|
|
10905
|
+
const b = rem % 6 / 5 * 255;
|
|
10906
|
+
return [r2, g, b];
|
|
10907
|
+
};
|
|
10908
|
+
convert.rgb.hex = function(args) {
|
|
10909
|
+
const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
|
|
10910
|
+
const string = integer.toString(16).toUpperCase();
|
|
10911
|
+
return "000000".substring(string.length) + string;
|
|
10912
|
+
};
|
|
10913
|
+
convert.hex.rgb = function(args) {
|
|
10914
|
+
const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
10915
|
+
if (!match) {
|
|
10916
|
+
return [0, 0, 0];
|
|
10917
|
+
}
|
|
10918
|
+
let colorString = match[0];
|
|
10919
|
+
if (match[0].length === 3) {
|
|
10920
|
+
colorString = colorString.split("").map((char) => {
|
|
10921
|
+
return char + char;
|
|
10922
|
+
}).join("");
|
|
10923
|
+
}
|
|
10924
|
+
const integer = parseInt(colorString, 16);
|
|
10925
|
+
const r2 = integer >> 16 & 255;
|
|
10926
|
+
const g = integer >> 8 & 255;
|
|
10927
|
+
const b = integer & 255;
|
|
10928
|
+
return [r2, g, b];
|
|
10929
|
+
};
|
|
10930
|
+
convert.rgb.hcg = function(rgb) {
|
|
10931
|
+
const r2 = rgb[0] / 255;
|
|
10932
|
+
const g = rgb[1] / 255;
|
|
10933
|
+
const b = rgb[2] / 255;
|
|
10934
|
+
const max = Math.max(Math.max(r2, g), b);
|
|
10935
|
+
const min = Math.min(Math.min(r2, g), b);
|
|
10936
|
+
const chroma = max - min;
|
|
10937
|
+
let grayscale;
|
|
10938
|
+
let hue;
|
|
10939
|
+
if (chroma < 1) {
|
|
10940
|
+
grayscale = min / (1 - chroma);
|
|
10941
|
+
} else {
|
|
10942
|
+
grayscale = 0;
|
|
10943
|
+
}
|
|
10944
|
+
if (chroma <= 0) {
|
|
10945
|
+
hue = 0;
|
|
10946
|
+
} else if (max === r2) {
|
|
10947
|
+
hue = (g - b) / chroma % 6;
|
|
10948
|
+
} else if (max === g) {
|
|
10949
|
+
hue = 2 + (b - r2) / chroma;
|
|
10950
|
+
} else {
|
|
10951
|
+
hue = 4 + (r2 - g) / chroma;
|
|
10952
|
+
}
|
|
10953
|
+
hue /= 6;
|
|
10954
|
+
hue %= 1;
|
|
10955
|
+
return [hue * 360, chroma * 100, grayscale * 100];
|
|
10956
|
+
};
|
|
10957
|
+
convert.hsl.hcg = function(hsl) {
|
|
10958
|
+
const s2 = hsl[1] / 100;
|
|
10959
|
+
const l = hsl[2] / 100;
|
|
10960
|
+
const c = l < 0.5 ? 2 * s2 * l : 2 * s2 * (1 - l);
|
|
10961
|
+
let f3 = 0;
|
|
10962
|
+
if (c < 1) {
|
|
10963
|
+
f3 = (l - 0.5 * c) / (1 - c);
|
|
10964
|
+
}
|
|
10965
|
+
return [hsl[0], c * 100, f3 * 100];
|
|
10966
|
+
};
|
|
10967
|
+
convert.hsv.hcg = function(hsv) {
|
|
10968
|
+
const s2 = hsv[1] / 100;
|
|
10969
|
+
const v = hsv[2] / 100;
|
|
10970
|
+
const c = s2 * v;
|
|
10971
|
+
let f3 = 0;
|
|
10972
|
+
if (c < 1) {
|
|
10973
|
+
f3 = (v - c) / (1 - c);
|
|
10974
|
+
}
|
|
10975
|
+
return [hsv[0], c * 100, f3 * 100];
|
|
10976
|
+
};
|
|
10977
|
+
convert.hcg.rgb = function(hcg) {
|
|
10978
|
+
const h2 = hcg[0] / 360;
|
|
10979
|
+
const c = hcg[1] / 100;
|
|
10980
|
+
const g = hcg[2] / 100;
|
|
10981
|
+
if (c === 0) {
|
|
10982
|
+
return [g * 255, g * 255, g * 255];
|
|
10983
|
+
}
|
|
10984
|
+
const pure = [0, 0, 0];
|
|
10985
|
+
const hi = h2 % 1 * 6;
|
|
10986
|
+
const v = hi % 1;
|
|
10987
|
+
const w = 1 - v;
|
|
10988
|
+
let mg = 0;
|
|
10989
|
+
switch (Math.floor(hi)) {
|
|
10990
|
+
case 0:
|
|
10991
|
+
pure[0] = 1;
|
|
10992
|
+
pure[1] = v;
|
|
10993
|
+
pure[2] = 0;
|
|
10994
|
+
break;
|
|
10995
|
+
case 1:
|
|
10996
|
+
pure[0] = w;
|
|
10997
|
+
pure[1] = 1;
|
|
10998
|
+
pure[2] = 0;
|
|
10999
|
+
break;
|
|
11000
|
+
case 2:
|
|
11001
|
+
pure[0] = 0;
|
|
11002
|
+
pure[1] = 1;
|
|
11003
|
+
pure[2] = v;
|
|
11004
|
+
break;
|
|
11005
|
+
case 3:
|
|
11006
|
+
pure[0] = 0;
|
|
11007
|
+
pure[1] = w;
|
|
11008
|
+
pure[2] = 1;
|
|
11009
|
+
break;
|
|
11010
|
+
case 4:
|
|
11011
|
+
pure[0] = v;
|
|
11012
|
+
pure[1] = 0;
|
|
11013
|
+
pure[2] = 1;
|
|
11014
|
+
break;
|
|
11015
|
+
default:
|
|
11016
|
+
pure[0] = 1;
|
|
11017
|
+
pure[1] = 0;
|
|
11018
|
+
pure[2] = w;
|
|
11019
|
+
}
|
|
11020
|
+
mg = (1 - c) * g;
|
|
11021
|
+
return [
|
|
11022
|
+
(c * pure[0] + mg) * 255,
|
|
11023
|
+
(c * pure[1] + mg) * 255,
|
|
11024
|
+
(c * pure[2] + mg) * 255
|
|
11025
|
+
];
|
|
11026
|
+
};
|
|
11027
|
+
convert.hcg.hsv = function(hcg) {
|
|
11028
|
+
const c = hcg[1] / 100;
|
|
11029
|
+
const g = hcg[2] / 100;
|
|
11030
|
+
const v = c + g * (1 - c);
|
|
11031
|
+
let f3 = 0;
|
|
11032
|
+
if (v > 0) {
|
|
11033
|
+
f3 = c / v;
|
|
11034
|
+
}
|
|
11035
|
+
return [hcg[0], f3 * 100, v * 100];
|
|
11036
|
+
};
|
|
11037
|
+
convert.hcg.hsl = function(hcg) {
|
|
11038
|
+
const c = hcg[1] / 100;
|
|
11039
|
+
const g = hcg[2] / 100;
|
|
11040
|
+
const l = g * (1 - c) + 0.5 * c;
|
|
11041
|
+
let s2 = 0;
|
|
11042
|
+
if (l > 0 && l < 0.5) {
|
|
11043
|
+
s2 = c / (2 * l);
|
|
11044
|
+
} else if (l >= 0.5 && l < 1) {
|
|
11045
|
+
s2 = c / (2 * (1 - l));
|
|
11046
|
+
}
|
|
11047
|
+
return [hcg[0], s2 * 100, l * 100];
|
|
11048
|
+
};
|
|
11049
|
+
convert.hcg.hwb = function(hcg) {
|
|
11050
|
+
const c = hcg[1] / 100;
|
|
11051
|
+
const g = hcg[2] / 100;
|
|
11052
|
+
const v = c + g * (1 - c);
|
|
11053
|
+
return [hcg[0], (v - c) * 100, (1 - v) * 100];
|
|
11054
|
+
};
|
|
11055
|
+
convert.hwb.hcg = function(hwb) {
|
|
11056
|
+
const w = hwb[1] / 100;
|
|
11057
|
+
const b = hwb[2] / 100;
|
|
11058
|
+
const v = 1 - b;
|
|
11059
|
+
const c = v - w;
|
|
11060
|
+
let g = 0;
|
|
11061
|
+
if (c < 1) {
|
|
11062
|
+
g = (v - c) / (1 - c);
|
|
11063
|
+
}
|
|
11064
|
+
return [hwb[0], c * 100, g * 100];
|
|
11065
|
+
};
|
|
11066
|
+
convert.apple.rgb = function(apple) {
|
|
11067
|
+
return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
|
|
11068
|
+
};
|
|
11069
|
+
convert.rgb.apple = function(rgb) {
|
|
11070
|
+
return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
|
|
11071
|
+
};
|
|
11072
|
+
convert.gray.rgb = function(args) {
|
|
11073
|
+
return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
|
|
11074
|
+
};
|
|
11075
|
+
convert.gray.hsl = function(args) {
|
|
11076
|
+
return [0, 0, args[0]];
|
|
11077
|
+
};
|
|
11078
|
+
convert.gray.hsv = convert.gray.hsl;
|
|
11079
|
+
convert.gray.hwb = function(gray) {
|
|
11080
|
+
return [0, 100, gray[0]];
|
|
11081
|
+
};
|
|
11082
|
+
convert.gray.cmyk = function(gray) {
|
|
11083
|
+
return [0, 0, 0, gray[0]];
|
|
11084
|
+
};
|
|
11085
|
+
convert.gray.lab = function(gray) {
|
|
11086
|
+
return [gray[0], 0, 0];
|
|
11087
|
+
};
|
|
11088
|
+
convert.gray.hex = function(gray) {
|
|
11089
|
+
const val = Math.round(gray[0] / 100 * 255) & 255;
|
|
11090
|
+
const integer = (val << 16) + (val << 8) + val;
|
|
11091
|
+
const string = integer.toString(16).toUpperCase();
|
|
11092
|
+
return "000000".substring(string.length) + string;
|
|
11093
|
+
};
|
|
11094
|
+
convert.rgb.gray = function(rgb) {
|
|
11095
|
+
const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
11096
|
+
return [val / 255 * 100];
|
|
11097
|
+
};
|
|
11098
|
+
}
|
|
11099
|
+
});
|
|
11100
|
+
|
|
11101
|
+
// node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js
|
|
11102
|
+
var require_route = __commonJS({
|
|
11103
|
+
"node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js"(exports2, module2) {
|
|
11104
|
+
var conversions = require_conversions();
|
|
11105
|
+
function buildGraph() {
|
|
11106
|
+
const graph = {};
|
|
11107
|
+
const models = Object.keys(conversions);
|
|
11108
|
+
for (let len = models.length, i2 = 0; i2 < len; i2++) {
|
|
11109
|
+
graph[models[i2]] = {
|
|
11110
|
+
// http://jsperf.com/1-vs-infinity
|
|
11111
|
+
// micro-opt, but this is simple.
|
|
11112
|
+
distance: -1,
|
|
11113
|
+
parent: null
|
|
11114
|
+
};
|
|
11115
|
+
}
|
|
11116
|
+
return graph;
|
|
11117
|
+
}
|
|
11118
|
+
function deriveBFS(fromModel) {
|
|
11119
|
+
const graph = buildGraph();
|
|
11120
|
+
const queue = [fromModel];
|
|
11121
|
+
graph[fromModel].distance = 0;
|
|
11122
|
+
while (queue.length) {
|
|
11123
|
+
const current = queue.pop();
|
|
11124
|
+
const adjacents = Object.keys(conversions[current]);
|
|
11125
|
+
for (let len = adjacents.length, i2 = 0; i2 < len; i2++) {
|
|
11126
|
+
const adjacent = adjacents[i2];
|
|
11127
|
+
const node = graph[adjacent];
|
|
11128
|
+
if (node.distance === -1) {
|
|
11129
|
+
node.distance = graph[current].distance + 1;
|
|
11130
|
+
node.parent = current;
|
|
11131
|
+
queue.unshift(adjacent);
|
|
11132
|
+
}
|
|
11133
|
+
}
|
|
11134
|
+
}
|
|
11135
|
+
return graph;
|
|
11136
|
+
}
|
|
11137
|
+
function link(from, to) {
|
|
11138
|
+
return function(args) {
|
|
11139
|
+
return to(from(args));
|
|
11140
|
+
};
|
|
11141
|
+
}
|
|
11142
|
+
function wrapConversion(toModel, graph) {
|
|
11143
|
+
const path = [graph[toModel].parent, toModel];
|
|
11144
|
+
let fn = conversions[graph[toModel].parent][toModel];
|
|
11145
|
+
let cur = graph[toModel].parent;
|
|
11146
|
+
while (graph[cur].parent) {
|
|
11147
|
+
path.unshift(graph[cur].parent);
|
|
11148
|
+
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
11149
|
+
cur = graph[cur].parent;
|
|
11150
|
+
}
|
|
11151
|
+
fn.conversion = path;
|
|
11152
|
+
return fn;
|
|
11153
|
+
}
|
|
11154
|
+
module2.exports = function(fromModel) {
|
|
11155
|
+
const graph = deriveBFS(fromModel);
|
|
11156
|
+
const conversion = {};
|
|
11157
|
+
const models = Object.keys(graph);
|
|
11158
|
+
for (let len = models.length, i2 = 0; i2 < len; i2++) {
|
|
11159
|
+
const toModel = models[i2];
|
|
11160
|
+
const node = graph[toModel];
|
|
11161
|
+
if (node.parent === null) {
|
|
11162
|
+
continue;
|
|
11163
|
+
}
|
|
11164
|
+
conversion[toModel] = wrapConversion(toModel, graph);
|
|
11165
|
+
}
|
|
11166
|
+
return conversion;
|
|
11167
|
+
};
|
|
10284
11168
|
}
|
|
10285
11169
|
});
|
|
10286
11170
|
|
|
10287
|
-
// node_modules/.pnpm
|
|
10288
|
-
var
|
|
10289
|
-
"node_modules/.pnpm
|
|
11171
|
+
// node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js
|
|
11172
|
+
var require_color_convert = __commonJS({
|
|
11173
|
+
"node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js"(exports2, module2) {
|
|
11174
|
+
var conversions = require_conversions();
|
|
11175
|
+
var route = require_route();
|
|
11176
|
+
var convert = {};
|
|
11177
|
+
var models = Object.keys(conversions);
|
|
11178
|
+
function wrapRaw(fn) {
|
|
11179
|
+
const wrappedFn = function(...args) {
|
|
11180
|
+
const arg0 = args[0];
|
|
11181
|
+
if (arg0 === void 0 || arg0 === null) {
|
|
11182
|
+
return arg0;
|
|
11183
|
+
}
|
|
11184
|
+
if (arg0.length > 1) {
|
|
11185
|
+
args = arg0;
|
|
11186
|
+
}
|
|
11187
|
+
return fn(args);
|
|
11188
|
+
};
|
|
11189
|
+
if ("conversion" in fn) {
|
|
11190
|
+
wrappedFn.conversion = fn.conversion;
|
|
11191
|
+
}
|
|
11192
|
+
return wrappedFn;
|
|
11193
|
+
}
|
|
11194
|
+
function wrapRounded(fn) {
|
|
11195
|
+
const wrappedFn = function(...args) {
|
|
11196
|
+
const arg0 = args[0];
|
|
11197
|
+
if (arg0 === void 0 || arg0 === null) {
|
|
11198
|
+
return arg0;
|
|
11199
|
+
}
|
|
11200
|
+
if (arg0.length > 1) {
|
|
11201
|
+
args = arg0;
|
|
11202
|
+
}
|
|
11203
|
+
const result = fn(args);
|
|
11204
|
+
if (typeof result === "object") {
|
|
11205
|
+
for (let len = result.length, i2 = 0; i2 < len; i2++) {
|
|
11206
|
+
result[i2] = Math.round(result[i2]);
|
|
11207
|
+
}
|
|
11208
|
+
}
|
|
11209
|
+
return result;
|
|
11210
|
+
};
|
|
11211
|
+
if ("conversion" in fn) {
|
|
11212
|
+
wrappedFn.conversion = fn.conversion;
|
|
11213
|
+
}
|
|
11214
|
+
return wrappedFn;
|
|
11215
|
+
}
|
|
11216
|
+
models.forEach((fromModel) => {
|
|
11217
|
+
convert[fromModel] = {};
|
|
11218
|
+
Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels });
|
|
11219
|
+
Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels });
|
|
11220
|
+
const routes = route(fromModel);
|
|
11221
|
+
const routeModels = Object.keys(routes);
|
|
11222
|
+
routeModels.forEach((toModel) => {
|
|
11223
|
+
const fn = routes[toModel];
|
|
11224
|
+
convert[fromModel][toModel] = wrapRounded(fn);
|
|
11225
|
+
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
11226
|
+
});
|
|
11227
|
+
});
|
|
11228
|
+
module2.exports = convert;
|
|
11229
|
+
}
|
|
11230
|
+
});
|
|
11231
|
+
|
|
11232
|
+
// node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js
|
|
11233
|
+
var require_ansi_styles = __commonJS({
|
|
11234
|
+
"node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js"(exports2, module2) {
|
|
10290
11235
|
"use strict";
|
|
10291
|
-
var
|
|
10292
|
-
|
|
10293
|
-
|
|
10294
|
-
|
|
10295
|
-
|
|
10296
|
-
|
|
10297
|
-
|
|
10298
|
-
|
|
10299
|
-
|
|
10300
|
-
|
|
10301
|
-
|
|
10302
|
-
|
|
10303
|
-
|
|
10304
|
-
|
|
11236
|
+
var wrapAnsi162 = (fn, offset) => (...args) => {
|
|
11237
|
+
const code = fn(...args);
|
|
11238
|
+
return `\x1B[${code + offset}m`;
|
|
11239
|
+
};
|
|
11240
|
+
var wrapAnsi2562 = (fn, offset) => (...args) => {
|
|
11241
|
+
const code = fn(...args);
|
|
11242
|
+
return `\x1B[${38 + offset};5;${code}m`;
|
|
11243
|
+
};
|
|
11244
|
+
var wrapAnsi16m2 = (fn, offset) => (...args) => {
|
|
11245
|
+
const rgb = fn(...args);
|
|
11246
|
+
return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
|
11247
|
+
};
|
|
11248
|
+
var ansi2ansi = (n) => n;
|
|
11249
|
+
var rgb2rgb = (r2, g, b) => [r2, g, b];
|
|
11250
|
+
var setLazyProperty = (object, property, get) => {
|
|
11251
|
+
Object.defineProperty(object, property, {
|
|
11252
|
+
get: () => {
|
|
11253
|
+
const value = get();
|
|
11254
|
+
Object.defineProperty(object, property, {
|
|
11255
|
+
value,
|
|
11256
|
+
enumerable: true,
|
|
11257
|
+
configurable: true
|
|
11258
|
+
});
|
|
11259
|
+
return value;
|
|
11260
|
+
},
|
|
11261
|
+
enumerable: true,
|
|
11262
|
+
configurable: true
|
|
11263
|
+
});
|
|
11264
|
+
};
|
|
11265
|
+
var colorConvert;
|
|
11266
|
+
var makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
|
|
11267
|
+
if (colorConvert === void 0) {
|
|
11268
|
+
colorConvert = require_color_convert();
|
|
11269
|
+
}
|
|
11270
|
+
const offset = isBackground ? 10 : 0;
|
|
11271
|
+
const styles3 = {};
|
|
11272
|
+
for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
|
|
11273
|
+
const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
|
|
11274
|
+
if (sourceSpace === targetSpace) {
|
|
11275
|
+
styles3[name] = wrap(identity, offset);
|
|
11276
|
+
} else if (typeof suite === "object") {
|
|
11277
|
+
styles3[name] = wrap(suite[targetSpace], offset);
|
|
11278
|
+
}
|
|
11279
|
+
}
|
|
11280
|
+
return styles3;
|
|
11281
|
+
};
|
|
11282
|
+
function assembleStyles2() {
|
|
11283
|
+
const codes = /* @__PURE__ */ new Map();
|
|
11284
|
+
const styles3 = {
|
|
11285
|
+
modifier: {
|
|
11286
|
+
reset: [0, 0],
|
|
11287
|
+
// 21 isn't widely supported and 22 does the same thing
|
|
11288
|
+
bold: [1, 22],
|
|
11289
|
+
dim: [2, 22],
|
|
11290
|
+
italic: [3, 23],
|
|
11291
|
+
underline: [4, 24],
|
|
11292
|
+
inverse: [7, 27],
|
|
11293
|
+
hidden: [8, 28],
|
|
11294
|
+
strikethrough: [9, 29]
|
|
11295
|
+
},
|
|
11296
|
+
color: {
|
|
11297
|
+
black: [30, 39],
|
|
11298
|
+
red: [31, 39],
|
|
11299
|
+
green: [32, 39],
|
|
11300
|
+
yellow: [33, 39],
|
|
11301
|
+
blue: [34, 39],
|
|
11302
|
+
magenta: [35, 39],
|
|
11303
|
+
cyan: [36, 39],
|
|
11304
|
+
white: [37, 39],
|
|
11305
|
+
// Bright color
|
|
11306
|
+
blackBright: [90, 39],
|
|
11307
|
+
redBright: [91, 39],
|
|
11308
|
+
greenBright: [92, 39],
|
|
11309
|
+
yellowBright: [93, 39],
|
|
11310
|
+
blueBright: [94, 39],
|
|
11311
|
+
magentaBright: [95, 39],
|
|
11312
|
+
cyanBright: [96, 39],
|
|
11313
|
+
whiteBright: [97, 39]
|
|
11314
|
+
},
|
|
11315
|
+
bgColor: {
|
|
11316
|
+
bgBlack: [40, 49],
|
|
11317
|
+
bgRed: [41, 49],
|
|
11318
|
+
bgGreen: [42, 49],
|
|
11319
|
+
bgYellow: [43, 49],
|
|
11320
|
+
bgBlue: [44, 49],
|
|
11321
|
+
bgMagenta: [45, 49],
|
|
11322
|
+
bgCyan: [46, 49],
|
|
11323
|
+
bgWhite: [47, 49],
|
|
11324
|
+
// Bright color
|
|
11325
|
+
bgBlackBright: [100, 49],
|
|
11326
|
+
bgRedBright: [101, 49],
|
|
11327
|
+
bgGreenBright: [102, 49],
|
|
11328
|
+
bgYellowBright: [103, 49],
|
|
11329
|
+
bgBlueBright: [104, 49],
|
|
11330
|
+
bgMagentaBright: [105, 49],
|
|
11331
|
+
bgCyanBright: [106, 49],
|
|
11332
|
+
bgWhiteBright: [107, 49]
|
|
11333
|
+
}
|
|
11334
|
+
};
|
|
11335
|
+
styles3.color.gray = styles3.color.blackBright;
|
|
11336
|
+
styles3.bgColor.bgGray = styles3.bgColor.bgBlackBright;
|
|
11337
|
+
styles3.color.grey = styles3.color.blackBright;
|
|
11338
|
+
styles3.bgColor.bgGrey = styles3.bgColor.bgBlackBright;
|
|
11339
|
+
for (const [groupName, group] of Object.entries(styles3)) {
|
|
11340
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
11341
|
+
styles3[styleName] = {
|
|
11342
|
+
open: `\x1B[${style[0]}m`,
|
|
11343
|
+
close: `\x1B[${style[1]}m`
|
|
11344
|
+
};
|
|
11345
|
+
group[styleName] = styles3[styleName];
|
|
11346
|
+
codes.set(style[0], style[1]);
|
|
11347
|
+
}
|
|
11348
|
+
Object.defineProperty(styles3, groupName, {
|
|
11349
|
+
value: group,
|
|
11350
|
+
enumerable: false
|
|
11351
|
+
});
|
|
11352
|
+
}
|
|
11353
|
+
Object.defineProperty(styles3, "codes", {
|
|
11354
|
+
value: codes,
|
|
11355
|
+
enumerable: false
|
|
11356
|
+
});
|
|
11357
|
+
styles3.color.close = "\x1B[39m";
|
|
11358
|
+
styles3.bgColor.close = "\x1B[49m";
|
|
11359
|
+
setLazyProperty(styles3.color, "ansi", () => makeDynamicStyles(wrapAnsi162, "ansi16", ansi2ansi, false));
|
|
11360
|
+
setLazyProperty(styles3.color, "ansi256", () => makeDynamicStyles(wrapAnsi2562, "ansi256", ansi2ansi, false));
|
|
11361
|
+
setLazyProperty(styles3.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m2, "rgb", rgb2rgb, false));
|
|
11362
|
+
setLazyProperty(styles3.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi162, "ansi16", ansi2ansi, true));
|
|
11363
|
+
setLazyProperty(styles3.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi2562, "ansi256", ansi2ansi, true));
|
|
11364
|
+
setLazyProperty(styles3.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m2, "rgb", rgb2rgb, true));
|
|
11365
|
+
return styles3;
|
|
11366
|
+
}
|
|
11367
|
+
Object.defineProperty(module2, "exports", {
|
|
11368
|
+
enumerable: true,
|
|
11369
|
+
get: assembleStyles2
|
|
10305
11370
|
});
|
|
10306
|
-
|
|
10307
|
-
|
|
10308
|
-
|
|
10309
|
-
|
|
11371
|
+
}
|
|
11372
|
+
});
|
|
11373
|
+
|
|
11374
|
+
// node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js
|
|
11375
|
+
var require_has_flag = __commonJS({
|
|
11376
|
+
"node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports2, module2) {
|
|
11377
|
+
"use strict";
|
|
11378
|
+
module2.exports = (flag, argv = process.argv) => {
|
|
11379
|
+
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
11380
|
+
const position = argv.indexOf(prefix + flag);
|
|
11381
|
+
const terminatorPosition = argv.indexOf("--");
|
|
11382
|
+
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
10310
11383
|
};
|
|
10311
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
10312
|
-
__exportStar(require_json(), exports2);
|
|
10313
|
-
__exportStar(require_text(), exports2);
|
|
10314
11384
|
}
|
|
10315
11385
|
});
|
|
10316
11386
|
|
|
10317
|
-
// node_modules/.pnpm
|
|
10318
|
-
var
|
|
10319
|
-
"node_modules/.pnpm
|
|
11387
|
+
// node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js
|
|
11388
|
+
var require_supports_color = __commonJS({
|
|
11389
|
+
"node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports2, module2) {
|
|
11390
|
+
"use strict";
|
|
11391
|
+
var os2 = require("os");
|
|
11392
|
+
var tty2 = require("tty");
|
|
11393
|
+
var hasFlag2 = require_has_flag();
|
|
11394
|
+
var { env: env2 } = process;
|
|
11395
|
+
var forceColor;
|
|
11396
|
+
if (hasFlag2("no-color") || hasFlag2("no-colors") || hasFlag2("color=false") || hasFlag2("color=never")) {
|
|
11397
|
+
forceColor = 0;
|
|
11398
|
+
} else if (hasFlag2("color") || hasFlag2("colors") || hasFlag2("color=true") || hasFlag2("color=always")) {
|
|
11399
|
+
forceColor = 1;
|
|
11400
|
+
}
|
|
11401
|
+
if ("FORCE_COLOR" in env2) {
|
|
11402
|
+
if (env2.FORCE_COLOR === "true") {
|
|
11403
|
+
forceColor = 1;
|
|
11404
|
+
} else if (env2.FORCE_COLOR === "false") {
|
|
11405
|
+
forceColor = 0;
|
|
11406
|
+
} else {
|
|
11407
|
+
forceColor = env2.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env2.FORCE_COLOR, 10), 3);
|
|
11408
|
+
}
|
|
11409
|
+
}
|
|
11410
|
+
function translateLevel2(level) {
|
|
11411
|
+
if (level === 0) {
|
|
11412
|
+
return false;
|
|
11413
|
+
}
|
|
11414
|
+
return {
|
|
11415
|
+
level,
|
|
11416
|
+
hasBasic: true,
|
|
11417
|
+
has256: level >= 2,
|
|
11418
|
+
has16m: level >= 3
|
|
11419
|
+
};
|
|
11420
|
+
}
|
|
11421
|
+
function supportsColor2(haveStream, streamIsTTY) {
|
|
11422
|
+
if (forceColor === 0) {
|
|
11423
|
+
return 0;
|
|
11424
|
+
}
|
|
11425
|
+
if (hasFlag2("color=16m") || hasFlag2("color=full") || hasFlag2("color=truecolor")) {
|
|
11426
|
+
return 3;
|
|
11427
|
+
}
|
|
11428
|
+
if (hasFlag2("color=256")) {
|
|
11429
|
+
return 2;
|
|
11430
|
+
}
|
|
11431
|
+
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
11432
|
+
return 0;
|
|
11433
|
+
}
|
|
11434
|
+
const min = forceColor || 0;
|
|
11435
|
+
if (env2.TERM === "dumb") {
|
|
11436
|
+
return min;
|
|
11437
|
+
}
|
|
11438
|
+
if (process.platform === "win32") {
|
|
11439
|
+
const osRelease = os2.release().split(".");
|
|
11440
|
+
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
11441
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
11442
|
+
}
|
|
11443
|
+
return 1;
|
|
11444
|
+
}
|
|
11445
|
+
if ("CI" in env2) {
|
|
11446
|
+
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env2) || env2.CI_NAME === "codeship") {
|
|
11447
|
+
return 1;
|
|
11448
|
+
}
|
|
11449
|
+
return min;
|
|
11450
|
+
}
|
|
11451
|
+
if ("TEAMCITY_VERSION" in env2) {
|
|
11452
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env2.TEAMCITY_VERSION) ? 1 : 0;
|
|
11453
|
+
}
|
|
11454
|
+
if (env2.COLORTERM === "truecolor") {
|
|
11455
|
+
return 3;
|
|
11456
|
+
}
|
|
11457
|
+
if ("TERM_PROGRAM" in env2) {
|
|
11458
|
+
const version = parseInt((env2.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
11459
|
+
switch (env2.TERM_PROGRAM) {
|
|
11460
|
+
case "iTerm.app":
|
|
11461
|
+
return version >= 3 ? 3 : 2;
|
|
11462
|
+
case "Apple_Terminal":
|
|
11463
|
+
return 2;
|
|
11464
|
+
}
|
|
11465
|
+
}
|
|
11466
|
+
if (/-256(color)?$/i.test(env2.TERM)) {
|
|
11467
|
+
return 2;
|
|
11468
|
+
}
|
|
11469
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env2.TERM)) {
|
|
11470
|
+
return 1;
|
|
11471
|
+
}
|
|
11472
|
+
if ("COLORTERM" in env2) {
|
|
11473
|
+
return 1;
|
|
11474
|
+
}
|
|
11475
|
+
return min;
|
|
11476
|
+
}
|
|
11477
|
+
function getSupportLevel(stream) {
|
|
11478
|
+
const level = supportsColor2(stream, stream && stream.isTTY);
|
|
11479
|
+
return translateLevel2(level);
|
|
11480
|
+
}
|
|
11481
|
+
module2.exports = {
|
|
11482
|
+
supportsColor: getSupportLevel,
|
|
11483
|
+
stdout: translateLevel2(supportsColor2(true, tty2.isatty(1))),
|
|
11484
|
+
stderr: translateLevel2(supportsColor2(true, tty2.isatty(2)))
|
|
11485
|
+
};
|
|
11486
|
+
}
|
|
11487
|
+
});
|
|
11488
|
+
|
|
11489
|
+
// node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js
|
|
11490
|
+
var require_util = __commonJS({
|
|
11491
|
+
"node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js"(exports2, module2) {
|
|
10320
11492
|
"use strict";
|
|
10321
|
-
var
|
|
10322
|
-
|
|
10323
|
-
|
|
10324
|
-
|
|
10325
|
-
|
|
10326
|
-
|
|
10327
|
-
|
|
10328
|
-
|
|
10329
|
-
|
|
10330
|
-
|
|
10331
|
-
|
|
10332
|
-
|
|
10333
|
-
|
|
10334
|
-
|
|
11493
|
+
var stringReplaceAll2 = (string, substring, replacer) => {
|
|
11494
|
+
let index = string.indexOf(substring);
|
|
11495
|
+
if (index === -1) {
|
|
11496
|
+
return string;
|
|
11497
|
+
}
|
|
11498
|
+
const substringLength = substring.length;
|
|
11499
|
+
let endIndex = 0;
|
|
11500
|
+
let returnValue = "";
|
|
11501
|
+
do {
|
|
11502
|
+
returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
|
|
11503
|
+
endIndex = index + substringLength;
|
|
11504
|
+
index = string.indexOf(substring, endIndex);
|
|
11505
|
+
} while (index !== -1);
|
|
11506
|
+
returnValue += string.substr(endIndex);
|
|
11507
|
+
return returnValue;
|
|
11508
|
+
};
|
|
11509
|
+
var stringEncaseCRLFWithFirstIndex2 = (string, prefix, postfix, index) => {
|
|
11510
|
+
let endIndex = 0;
|
|
11511
|
+
let returnValue = "";
|
|
11512
|
+
do {
|
|
11513
|
+
const gotCR = string[index - 1] === "\r";
|
|
11514
|
+
returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
11515
|
+
endIndex = index + 1;
|
|
11516
|
+
index = string.indexOf("\n", endIndex);
|
|
11517
|
+
} while (index !== -1);
|
|
11518
|
+
returnValue += string.substr(endIndex);
|
|
11519
|
+
return returnValue;
|
|
11520
|
+
};
|
|
11521
|
+
module2.exports = {
|
|
11522
|
+
stringReplaceAll: stringReplaceAll2,
|
|
11523
|
+
stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex2
|
|
11524
|
+
};
|
|
11525
|
+
}
|
|
11526
|
+
});
|
|
11527
|
+
|
|
11528
|
+
// node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js
|
|
11529
|
+
var require_templates = __commonJS({
|
|
11530
|
+
"node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js"(exports2, module2) {
|
|
11531
|
+
"use strict";
|
|
11532
|
+
var TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
|
|
11533
|
+
var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
|
11534
|
+
var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
|
|
11535
|
+
var ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
|
|
11536
|
+
var ESCAPES = /* @__PURE__ */ new Map([
|
|
11537
|
+
["n", "\n"],
|
|
11538
|
+
["r", "\r"],
|
|
11539
|
+
["t", " "],
|
|
11540
|
+
["b", "\b"],
|
|
11541
|
+
["f", "\f"],
|
|
11542
|
+
["v", "\v"],
|
|
11543
|
+
["0", "\0"],
|
|
11544
|
+
["\\", "\\"],
|
|
11545
|
+
["e", "\x1B"],
|
|
11546
|
+
["a", "\x07"]
|
|
11547
|
+
]);
|
|
11548
|
+
function unescape2(c) {
|
|
11549
|
+
const u = c[0] === "u";
|
|
11550
|
+
const bracket = c[1] === "{";
|
|
11551
|
+
if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) {
|
|
11552
|
+
return String.fromCharCode(parseInt(c.slice(1), 16));
|
|
11553
|
+
}
|
|
11554
|
+
if (u && bracket) {
|
|
11555
|
+
return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
|
|
11556
|
+
}
|
|
11557
|
+
return ESCAPES.get(c) || c;
|
|
11558
|
+
}
|
|
11559
|
+
function parseArguments(name, arguments_) {
|
|
11560
|
+
const results = [];
|
|
11561
|
+
const chunks = arguments_.trim().split(/\s*,\s*/g);
|
|
11562
|
+
let matches;
|
|
11563
|
+
for (const chunk of chunks) {
|
|
11564
|
+
const number = Number(chunk);
|
|
11565
|
+
if (!Number.isNaN(number)) {
|
|
11566
|
+
results.push(number);
|
|
11567
|
+
} else if (matches = chunk.match(STRING_REGEX)) {
|
|
11568
|
+
results.push(matches[2].replace(ESCAPE_REGEX, (m2, escape2, character) => escape2 ? unescape2(escape2) : character));
|
|
11569
|
+
} else {
|
|
11570
|
+
throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
|
|
11571
|
+
}
|
|
11572
|
+
}
|
|
11573
|
+
return results;
|
|
11574
|
+
}
|
|
11575
|
+
function parseStyle(style) {
|
|
11576
|
+
STYLE_REGEX.lastIndex = 0;
|
|
11577
|
+
const results = [];
|
|
11578
|
+
let matches;
|
|
11579
|
+
while ((matches = STYLE_REGEX.exec(style)) !== null) {
|
|
11580
|
+
const name = matches[1];
|
|
11581
|
+
if (matches[2]) {
|
|
11582
|
+
const args = parseArguments(name, matches[2]);
|
|
11583
|
+
results.push([name].concat(args));
|
|
11584
|
+
} else {
|
|
11585
|
+
results.push([name]);
|
|
11586
|
+
}
|
|
11587
|
+
}
|
|
11588
|
+
return results;
|
|
11589
|
+
}
|
|
11590
|
+
function buildStyle(chalk5, styles3) {
|
|
11591
|
+
const enabled = {};
|
|
11592
|
+
for (const layer of styles3) {
|
|
11593
|
+
for (const style of layer.styles) {
|
|
11594
|
+
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
11595
|
+
}
|
|
11596
|
+
}
|
|
11597
|
+
let current = chalk5;
|
|
11598
|
+
for (const [styleName, styles4] of Object.entries(enabled)) {
|
|
11599
|
+
if (!Array.isArray(styles4)) {
|
|
11600
|
+
continue;
|
|
11601
|
+
}
|
|
11602
|
+
if (!(styleName in current)) {
|
|
11603
|
+
throw new Error(`Unknown Chalk style: ${styleName}`);
|
|
11604
|
+
}
|
|
11605
|
+
current = styles4.length > 0 ? current[styleName](...styles4) : current[styleName];
|
|
11606
|
+
}
|
|
11607
|
+
return current;
|
|
11608
|
+
}
|
|
11609
|
+
module2.exports = (chalk5, temporary) => {
|
|
11610
|
+
const styles3 = [];
|
|
11611
|
+
const chunks = [];
|
|
11612
|
+
let chunk = [];
|
|
11613
|
+
temporary.replace(TEMPLATE_REGEX, (m2, escapeCharacter, inverse, style, close, character) => {
|
|
11614
|
+
if (escapeCharacter) {
|
|
11615
|
+
chunk.push(unescape2(escapeCharacter));
|
|
11616
|
+
} else if (style) {
|
|
11617
|
+
const string = chunk.join("");
|
|
11618
|
+
chunk = [];
|
|
11619
|
+
chunks.push(styles3.length === 0 ? string : buildStyle(chalk5, styles3)(string));
|
|
11620
|
+
styles3.push({ inverse, styles: parseStyle(style) });
|
|
11621
|
+
} else if (close) {
|
|
11622
|
+
if (styles3.length === 0) {
|
|
11623
|
+
throw new Error("Found extraneous } in Chalk template literal");
|
|
11624
|
+
}
|
|
11625
|
+
chunks.push(buildStyle(chalk5, styles3)(chunk.join("")));
|
|
11626
|
+
chunk = [];
|
|
11627
|
+
styles3.pop();
|
|
11628
|
+
} else {
|
|
11629
|
+
chunk.push(character);
|
|
11630
|
+
}
|
|
11631
|
+
});
|
|
11632
|
+
chunks.push(chunk.join(""));
|
|
11633
|
+
if (styles3.length > 0) {
|
|
11634
|
+
const errMessage = `Chalk template literal is missing ${styles3.length} closing bracket${styles3.length === 1 ? "" : "s"} (\`}\`)`;
|
|
11635
|
+
throw new Error(errMessage);
|
|
11636
|
+
}
|
|
11637
|
+
return chunks.join("");
|
|
11638
|
+
};
|
|
11639
|
+
}
|
|
11640
|
+
});
|
|
11641
|
+
|
|
11642
|
+
// node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js
|
|
11643
|
+
var require_source = __commonJS({
|
|
11644
|
+
"node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js"(exports2, module2) {
|
|
11645
|
+
"use strict";
|
|
11646
|
+
var ansiStyles2 = require_ansi_styles();
|
|
11647
|
+
var { stdout: stdoutColor2, stderr: stderrColor2 } = require_supports_color();
|
|
11648
|
+
var {
|
|
11649
|
+
stringReplaceAll: stringReplaceAll2,
|
|
11650
|
+
stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex2
|
|
11651
|
+
} = require_util();
|
|
11652
|
+
var { isArray } = Array;
|
|
11653
|
+
var levelMapping2 = [
|
|
11654
|
+
"ansi",
|
|
11655
|
+
"ansi",
|
|
11656
|
+
"ansi256",
|
|
11657
|
+
"ansi16m"
|
|
11658
|
+
];
|
|
11659
|
+
var styles3 = /* @__PURE__ */ Object.create(null);
|
|
11660
|
+
var applyOptions2 = (object, options = {}) => {
|
|
11661
|
+
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
11662
|
+
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
11663
|
+
}
|
|
11664
|
+
const colorLevel = stdoutColor2 ? stdoutColor2.level : 0;
|
|
11665
|
+
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
11666
|
+
};
|
|
11667
|
+
var ChalkClass = class {
|
|
11668
|
+
constructor(options) {
|
|
11669
|
+
return chalkFactory2(options);
|
|
11670
|
+
}
|
|
11671
|
+
};
|
|
11672
|
+
var chalkFactory2 = (options) => {
|
|
11673
|
+
const chalk6 = {};
|
|
11674
|
+
applyOptions2(chalk6, options);
|
|
11675
|
+
chalk6.template = (...arguments_) => chalkTag(chalk6.template, ...arguments_);
|
|
11676
|
+
Object.setPrototypeOf(chalk6, Chalk2.prototype);
|
|
11677
|
+
Object.setPrototypeOf(chalk6.template, chalk6);
|
|
11678
|
+
chalk6.template.constructor = () => {
|
|
11679
|
+
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
11680
|
+
};
|
|
11681
|
+
chalk6.template.Instance = ChalkClass;
|
|
11682
|
+
return chalk6.template;
|
|
11683
|
+
};
|
|
11684
|
+
function Chalk2(options) {
|
|
11685
|
+
return chalkFactory2(options);
|
|
11686
|
+
}
|
|
11687
|
+
for (const [styleName, style] of Object.entries(ansiStyles2)) {
|
|
11688
|
+
styles3[styleName] = {
|
|
11689
|
+
get() {
|
|
11690
|
+
const builder = createBuilder2(this, createStyler2(style.open, style.close, this._styler), this._isEmpty);
|
|
11691
|
+
Object.defineProperty(this, styleName, { value: builder });
|
|
11692
|
+
return builder;
|
|
11693
|
+
}
|
|
11694
|
+
};
|
|
11695
|
+
}
|
|
11696
|
+
styles3.visible = {
|
|
11697
|
+
get() {
|
|
11698
|
+
const builder = createBuilder2(this, this._styler, true);
|
|
11699
|
+
Object.defineProperty(this, "visible", { value: builder });
|
|
11700
|
+
return builder;
|
|
11701
|
+
}
|
|
11702
|
+
};
|
|
11703
|
+
var usedModels2 = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
|
|
11704
|
+
for (const model of usedModels2) {
|
|
11705
|
+
styles3[model] = {
|
|
11706
|
+
get() {
|
|
11707
|
+
const { level } = this;
|
|
11708
|
+
return function(...arguments_) {
|
|
11709
|
+
const styler = createStyler2(ansiStyles2.color[levelMapping2[level]][model](...arguments_), ansiStyles2.color.close, this._styler);
|
|
11710
|
+
return createBuilder2(this, styler, this._isEmpty);
|
|
11711
|
+
};
|
|
11712
|
+
}
|
|
11713
|
+
};
|
|
11714
|
+
}
|
|
11715
|
+
for (const model of usedModels2) {
|
|
11716
|
+
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
11717
|
+
styles3[bgModel] = {
|
|
11718
|
+
get() {
|
|
11719
|
+
const { level } = this;
|
|
11720
|
+
return function(...arguments_) {
|
|
11721
|
+
const styler = createStyler2(ansiStyles2.bgColor[levelMapping2[level]][model](...arguments_), ansiStyles2.bgColor.close, this._styler);
|
|
11722
|
+
return createBuilder2(this, styler, this._isEmpty);
|
|
11723
|
+
};
|
|
11724
|
+
}
|
|
11725
|
+
};
|
|
11726
|
+
}
|
|
11727
|
+
var proto2 = Object.defineProperties(() => {
|
|
11728
|
+
}, {
|
|
11729
|
+
...styles3,
|
|
11730
|
+
level: {
|
|
11731
|
+
enumerable: true,
|
|
11732
|
+
get() {
|
|
11733
|
+
return this._generator.level;
|
|
11734
|
+
},
|
|
11735
|
+
set(level) {
|
|
11736
|
+
this._generator.level = level;
|
|
11737
|
+
}
|
|
11738
|
+
}
|
|
10335
11739
|
});
|
|
10336
|
-
var
|
|
10337
|
-
|
|
10338
|
-
|
|
10339
|
-
|
|
11740
|
+
var createStyler2 = (open, close, parent) => {
|
|
11741
|
+
let openAll;
|
|
11742
|
+
let closeAll;
|
|
11743
|
+
if (parent === void 0) {
|
|
11744
|
+
openAll = open;
|
|
11745
|
+
closeAll = close;
|
|
11746
|
+
} else {
|
|
11747
|
+
openAll = parent.openAll + open;
|
|
11748
|
+
closeAll = close + parent.closeAll;
|
|
11749
|
+
}
|
|
11750
|
+
return {
|
|
11751
|
+
open,
|
|
11752
|
+
close,
|
|
11753
|
+
openAll,
|
|
11754
|
+
closeAll,
|
|
11755
|
+
parent
|
|
11756
|
+
};
|
|
10340
11757
|
};
|
|
10341
|
-
|
|
10342
|
-
|
|
10343
|
-
|
|
10344
|
-
|
|
10345
|
-
|
|
10346
|
-
|
|
10347
|
-
|
|
10348
|
-
|
|
10349
|
-
|
|
10350
|
-
|
|
10351
|
-
|
|
10352
|
-
|
|
10353
|
-
|
|
10354
|
-
|
|
10355
|
-
|
|
10356
|
-
|
|
10357
|
-
|
|
10358
|
-
|
|
11758
|
+
var createBuilder2 = (self2, _styler, _isEmpty) => {
|
|
11759
|
+
const builder = (...arguments_) => {
|
|
11760
|
+
if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
|
|
11761
|
+
return applyStyle2(builder, chalkTag(builder, ...arguments_));
|
|
11762
|
+
}
|
|
11763
|
+
return applyStyle2(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
11764
|
+
};
|
|
11765
|
+
Object.setPrototypeOf(builder, proto2);
|
|
11766
|
+
builder._generator = self2;
|
|
11767
|
+
builder._styler = _styler;
|
|
11768
|
+
builder._isEmpty = _isEmpty;
|
|
11769
|
+
return builder;
|
|
11770
|
+
};
|
|
11771
|
+
var applyStyle2 = (self2, string) => {
|
|
11772
|
+
if (self2.level <= 0 || !string) {
|
|
11773
|
+
return self2._isEmpty ? "" : string;
|
|
11774
|
+
}
|
|
11775
|
+
let styler = self2._styler;
|
|
11776
|
+
if (styler === void 0) {
|
|
11777
|
+
return string;
|
|
11778
|
+
}
|
|
11779
|
+
const { openAll, closeAll } = styler;
|
|
11780
|
+
if (string.indexOf("\x1B") !== -1) {
|
|
11781
|
+
while (styler !== void 0) {
|
|
11782
|
+
string = stringReplaceAll2(string, styler.close, styler.open);
|
|
11783
|
+
styler = styler.parent;
|
|
11784
|
+
}
|
|
11785
|
+
}
|
|
11786
|
+
const lfIndex = string.indexOf("\n");
|
|
11787
|
+
if (lfIndex !== -1) {
|
|
11788
|
+
string = stringEncaseCRLFWithFirstIndex2(string, closeAll, openAll, lfIndex);
|
|
11789
|
+
}
|
|
11790
|
+
return openAll + string + closeAll;
|
|
11791
|
+
};
|
|
11792
|
+
var template;
|
|
11793
|
+
var chalkTag = (chalk6, ...strings) => {
|
|
11794
|
+
const [firstString] = strings;
|
|
11795
|
+
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
11796
|
+
return strings.join(" ");
|
|
11797
|
+
}
|
|
11798
|
+
const arguments_ = strings.slice(1);
|
|
11799
|
+
const parts = [firstString.raw[0]];
|
|
11800
|
+
for (let i2 = 1; i2 < firstString.length; i2++) {
|
|
11801
|
+
parts.push(
|
|
11802
|
+
String(arguments_[i2 - 1]).replace(/[{}\\]/g, "\\$&"),
|
|
11803
|
+
String(firstString.raw[i2])
|
|
11804
|
+
);
|
|
11805
|
+
}
|
|
11806
|
+
if (template === void 0) {
|
|
11807
|
+
template = require_templates();
|
|
11808
|
+
}
|
|
11809
|
+
return template(chalk6, parts.join(""));
|
|
11810
|
+
};
|
|
11811
|
+
Object.defineProperties(Chalk2.prototype, styles3);
|
|
11812
|
+
var chalk5 = Chalk2();
|
|
11813
|
+
chalk5.supportsColor = stdoutColor2;
|
|
11814
|
+
chalk5.stderr = Chalk2({ level: stderrColor2 ? stderrColor2.level : 0 });
|
|
11815
|
+
chalk5.stderr.supportsColor = stderrColor2;
|
|
11816
|
+
module2.exports = chalk5;
|
|
10359
11817
|
}
|
|
10360
11818
|
});
|
|
10361
11819
|
|
|
@@ -14245,7 +15703,7 @@ var require_node = __commonJS({
|
|
|
14245
15703
|
);
|
|
14246
15704
|
exports2.colors = [6, 2, 3, 4, 5, 1];
|
|
14247
15705
|
try {
|
|
14248
|
-
const supportsColor2 =
|
|
15706
|
+
const supportsColor2 = require_supports_color();
|
|
14249
15707
|
if (supportsColor2 && (supportsColor2.stderr || supportsColor2).level >= 2) {
|
|
14250
15708
|
exports2.colors = [
|
|
14251
15709
|
20,
|
|
@@ -15970,7 +17428,7 @@ var require_ClusterOptions = __commonJS({
|
|
|
15970
17428
|
});
|
|
15971
17429
|
|
|
15972
17430
|
// node_modules/.pnpm/ioredis@5.3.2/node_modules/ioredis/built/cluster/util.js
|
|
15973
|
-
var
|
|
17431
|
+
var require_util2 = __commonJS({
|
|
15974
17432
|
"node_modules/.pnpm/ioredis@5.3.2/node_modules/ioredis/built/cluster/util.js"(exports2) {
|
|
15975
17433
|
"use strict";
|
|
15976
17434
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
@@ -16074,7 +17532,7 @@ var require_ClusterSubscriber = __commonJS({
|
|
|
16074
17532
|
"node_modules/.pnpm/ioredis@5.3.2/node_modules/ioredis/built/cluster/ClusterSubscriber.js"(exports2) {
|
|
16075
17533
|
"use strict";
|
|
16076
17534
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
16077
|
-
var util_1 =
|
|
17535
|
+
var util_1 = require_util2();
|
|
16078
17536
|
var utils_1 = require_utils2();
|
|
16079
17537
|
var Redis_1 = require_Redis();
|
|
16080
17538
|
var debug = (0, utils_1.Debug)("cluster:subscriber");
|
|
@@ -16215,7 +17673,7 @@ var require_ConnectionPool = __commonJS({
|
|
|
16215
17673
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
16216
17674
|
var events_1 = require("events");
|
|
16217
17675
|
var utils_1 = require_utils2();
|
|
16218
|
-
var util_1 =
|
|
17676
|
+
var util_1 = require_util2();
|
|
16219
17677
|
var Redis_1 = require_Redis();
|
|
16220
17678
|
var debug = (0, utils_1.Debug)("cluster:connectionPool");
|
|
16221
17679
|
var ConnectionPool = class extends events_1.EventEmitter {
|
|
@@ -16763,7 +18221,7 @@ var require_cluster = __commonJS({
|
|
|
16763
18221
|
var ClusterSubscriber_1 = require_ClusterSubscriber();
|
|
16764
18222
|
var ConnectionPool_1 = require_ConnectionPool();
|
|
16765
18223
|
var DelayQueue_1 = require_DelayQueue();
|
|
16766
|
-
var util_1 =
|
|
18224
|
+
var util_1 = require_util2();
|
|
16767
18225
|
var Deque = require_denque();
|
|
16768
18226
|
var debug = (0, utils_1.Debug)("cluster");
|
|
16769
18227
|
var REJECT_OVERWRITTEN_COMMANDS = /* @__PURE__ */ new WeakSet();
|
|
@@ -43544,7 +45002,7 @@ var require_type_is = __commonJS({
|
|
|
43544
45002
|
});
|
|
43545
45003
|
|
|
43546
45004
|
// node_modules/.pnpm/body-parser@1.20.1/node_modules/body-parser/lib/types/json.js
|
|
43547
|
-
var
|
|
45005
|
+
var require_json = __commonJS({
|
|
43548
45006
|
"node_modules/.pnpm/body-parser@1.20.1/node_modules/body-parser/lib/types/json.js"(exports2, module2) {
|
|
43549
45007
|
"use strict";
|
|
43550
45008
|
var bytes = require_bytes();
|
|
@@ -43724,7 +45182,7 @@ var require_raw = __commonJS({
|
|
|
43724
45182
|
});
|
|
43725
45183
|
|
|
43726
45184
|
// node_modules/.pnpm/body-parser@1.20.1/node_modules/body-parser/lib/types/text.js
|
|
43727
|
-
var
|
|
45185
|
+
var require_text = __commonJS({
|
|
43728
45186
|
"node_modules/.pnpm/body-parser@1.20.1/node_modules/body-parser/lib/types/text.js"(exports2, module2) {
|
|
43729
45187
|
"use strict";
|
|
43730
45188
|
var bytes = require_bytes();
|
|
@@ -45866,13 +47324,13 @@ var require_body_parser = __commonJS({
|
|
|
45866
47324
|
}
|
|
45867
47325
|
switch (parserName) {
|
|
45868
47326
|
case "json":
|
|
45869
|
-
parser =
|
|
47327
|
+
parser = require_json();
|
|
45870
47328
|
break;
|
|
45871
47329
|
case "raw":
|
|
45872
47330
|
parser = require_raw();
|
|
45873
47331
|
break;
|
|
45874
47332
|
case "text":
|
|
45875
|
-
parser =
|
|
47333
|
+
parser = require_text();
|
|
45876
47334
|
break;
|
|
45877
47335
|
case "urlencoded":
|
|
45878
47336
|
parser = require_urlencoded();
|
|
@@ -46449,7 +47907,7 @@ var require_methods = __commonJS({
|
|
|
46449
47907
|
});
|
|
46450
47908
|
|
|
46451
47909
|
// node_modules/.pnpm/express@4.18.2/node_modules/express/lib/router/route.js
|
|
46452
|
-
var
|
|
47910
|
+
var require_route2 = __commonJS({
|
|
46453
47911
|
"node_modules/.pnpm/express@4.18.2/node_modules/express/lib/router/route.js"(exports2, module2) {
|
|
46454
47912
|
"use strict";
|
|
46455
47913
|
var debug = require_src2()("express:router:route");
|
|
@@ -46578,7 +48036,7 @@ var require_utils_merge = __commonJS({
|
|
|
46578
48036
|
var require_router = __commonJS({
|
|
46579
48037
|
"node_modules/.pnpm/express@4.18.2/node_modules/express/lib/router/index.js"(exports2, module2) {
|
|
46580
48038
|
"use strict";
|
|
46581
|
-
var Route =
|
|
48039
|
+
var Route = require_route2();
|
|
46582
48040
|
var Layer = require_layer();
|
|
46583
48041
|
var methods = require_methods();
|
|
46584
48042
|
var mixin = require_utils_merge();
|
|
@@ -51140,7 +52598,7 @@ var require_express = __commonJS({
|
|
|
51140
52598
|
var EventEmitter = require("events").EventEmitter;
|
|
51141
52599
|
var mixin = require_merge_descriptors();
|
|
51142
52600
|
var proto2 = require_application();
|
|
51143
|
-
var Route =
|
|
52601
|
+
var Route = require_route2();
|
|
51144
52602
|
var Router = require_router();
|
|
51145
52603
|
var req = require_request();
|
|
51146
52604
|
var res = require_response();
|
|
@@ -51211,10 +52669,10 @@ var require_express2 = __commonJS({
|
|
|
51211
52669
|
|
|
51212
52670
|
// src/index.ts
|
|
51213
52671
|
var import_log4bot = __toESM(require_dist());
|
|
51214
|
-
|
|
52672
|
+
var import_chalk3 = __toESM(require_source());
|
|
51215
52673
|
|
|
51216
52674
|
// src/check.ts
|
|
51217
|
-
|
|
52675
|
+
var import_chalk = __toESM(require_source());
|
|
51218
52676
|
var import_ioredis = __toESM(require_built3());
|
|
51219
52677
|
var import_pg = __toESM(require_lib4());
|
|
51220
52678
|
|
|
@@ -52504,13 +53962,13 @@ async function checkAll(logger, configs, setReadiness) {
|
|
|
52504
53962
|
configs.map(async (config) => {
|
|
52505
53963
|
while (true) {
|
|
52506
53964
|
try {
|
|
52507
|
-
logger.debug(`${
|
|
53965
|
+
logger.debug(`${import_chalk.default.green(config.name)} check of type ${import_chalk.default.blue(config.type)} is being checked`);
|
|
52508
53966
|
await check(config);
|
|
52509
|
-
logger.debug(`${
|
|
53967
|
+
logger.debug(`${import_chalk.default.green(config.name)} check of type ${import_chalk.default.blue(config.type)} is ready!`);
|
|
52510
53968
|
setReadiness(config.name, true);
|
|
52511
53969
|
} catch (err) {
|
|
52512
53970
|
logger.error(
|
|
52513
|
-
`${
|
|
53971
|
+
`${import_chalk.default.yellow(config.name)} check of type ${import_chalk.default.blue(config.type)} not ready yet retrying in 1s... ${err}`
|
|
52514
53972
|
);
|
|
52515
53973
|
setReadiness(config.name, false);
|
|
52516
53974
|
}
|
|
@@ -52553,7 +54011,7 @@ async function delay(delayInms) {
|
|
|
52553
54011
|
}
|
|
52554
54012
|
|
|
52555
54013
|
// src/config.ts
|
|
52556
|
-
|
|
54014
|
+
var import_chalk2 = __toESM(require_source());
|
|
52557
54015
|
|
|
52558
54016
|
// node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
|
|
52559
54017
|
var util;
|
|
@@ -56308,7 +57766,7 @@ var configSchema = z.array(z.discriminatedUnion("type", [postgresCheck, httpChec
|
|
|
56308
57766
|
var getConfig = () => {
|
|
56309
57767
|
const configContent = process.env.CONFIG;
|
|
56310
57768
|
if (!configContent) {
|
|
56311
|
-
throw new Error(`${
|
|
57769
|
+
throw new Error(`${import_chalk2.default.red("Missing config!")} Please set the CONFIG environment variable`);
|
|
56312
57770
|
}
|
|
56313
57771
|
try {
|
|
56314
57772
|
const config = JSON.parse(configContent);
|
|
@@ -56358,19 +57816,19 @@ async function main() {
|
|
|
56358
57816
|
readinessMap[name] = isReady;
|
|
56359
57817
|
const allReady = Object.values(readinessMap).every((r2) => r2);
|
|
56360
57818
|
if (allReady && !ready) {
|
|
56361
|
-
logger.info(
|
|
57819
|
+
logger.info(import_chalk3.default.green("All checks passed!"));
|
|
56362
57820
|
ready = true;
|
|
56363
57821
|
} else if (ready && !allReady) {
|
|
56364
|
-
logger.info(
|
|
57822
|
+
logger.info(import_chalk3.default.red("Some checks failed!"));
|
|
56365
57823
|
ready = false;
|
|
56366
57824
|
}
|
|
56367
57825
|
});
|
|
56368
57826
|
await startServer(logger, (_, res) => {
|
|
56369
57827
|
if (ready) {
|
|
56370
|
-
logger.debug(`Received readiness probe ${
|
|
57828
|
+
logger.debug(`Received readiness probe ${import_chalk3.default.green("OK")}`);
|
|
56371
57829
|
res.sendStatus(200);
|
|
56372
57830
|
} else {
|
|
56373
|
-
logger.info(`Received readiness probe ${
|
|
57831
|
+
logger.info(`Received readiness probe ${import_chalk3.default.red("NOT READY")}`);
|
|
56374
57832
|
res.sendStatus(400);
|
|
56375
57833
|
}
|
|
56376
57834
|
});
|