@nsshunt/stsrest01client 1.0.32 → 1.0.34

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.
@@ -1,4030 +0,0 @@
1
- (function(global, factory) {
2
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("node:fs"), require("path"), require("os"), require("crypto"), require("axios"), require("@nsshunt/stsutils")) : typeof define === "function" && define.amd ? define(["exports", "node:fs", "path", "os", "crypto", "axios", "@nsshunt/stsutils"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global["@nsshunt/stsrest01client"] = {}, global.https, global.path, global.os, global.crypto, global.axios, global.stsutils));
3
- })(this, (function(exports2, node_fs, require$$1, require$$2, require$$3, axios, stsutils) {
4
- "use strict";
5
- function getDefaultExportFromCjs(x) {
6
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
7
- }
8
- function getAugmentedNamespace(n) {
9
- if (Object.prototype.hasOwnProperty.call(n, "__esModule")) return n;
10
- var f = n.default;
11
- if (typeof f == "function") {
12
- var a = function a2() {
13
- var isInstance = false;
14
- try {
15
- isInstance = this instanceof a2;
16
- } catch {
17
- }
18
- if (isInstance) {
19
- return Reflect.construct(f, arguments, this.constructor);
20
- }
21
- return f.apply(this, arguments);
22
- };
23
- a.prototype = f.prototype;
24
- } else a = {};
25
- Object.defineProperty(a, "__esModule", { value: true });
26
- Object.keys(n).forEach(function(k) {
27
- var d = Object.getOwnPropertyDescriptor(n, k);
28
- Object.defineProperty(a, k, d.get ? d : {
29
- enumerable: true,
30
- get: function() {
31
- return n[k];
32
- }
33
- });
34
- });
35
- return a;
36
- }
37
- var main = { exports: {} };
38
- const __viteBrowserExternal = {};
39
- const __viteBrowserExternal$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
40
- __proto__: null,
41
- default: __viteBrowserExternal
42
- }, Symbol.toStringTag, { value: "Module" }));
43
- const require$$0 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1);
44
- const version = "17.2.4";
45
- const require$$4 = {
46
- version
47
- };
48
- var hasRequiredMain;
49
- function requireMain() {
50
- if (hasRequiredMain) return main.exports;
51
- hasRequiredMain = 1;
52
- const fs = require$$0;
53
- const path = require$$1;
54
- const os = require$$2;
55
- const crypto2 = require$$3;
56
- const packageJson = require$$4;
57
- const version2 = packageJson.version;
58
- const TIPS = [
59
- "🔐 encrypt with Dotenvx: https://dotenvx.com",
60
- "🔐 prevent committing .env to code: https://dotenvx.com/precommit",
61
- "🔐 prevent building .env in docker: https://dotenvx.com/prebuild",
62
- "📡 add observability to secrets: https://dotenvx.com/ops",
63
- "👥 sync secrets across teammates & machines: https://dotenvx.com/ops",
64
- "🗂️ backup and recover secrets: https://dotenvx.com/ops",
65
- "✅ audit secrets and track compliance: https://dotenvx.com/ops",
66
- "🔄 add secrets lifecycle management: https://dotenvx.com/ops",
67
- "🔑 add access controls to secrets: https://dotenvx.com/ops",
68
- "🛠️ run anywhere with `dotenvx run -- yourcommand`",
69
- "⚙️ specify custom .env file path with { path: '/custom/path/.env' }",
70
- "⚙️ enable debug logging with { debug: true }",
71
- "⚙️ override existing env vars with { override: true }",
72
- "⚙️ suppress all logs with { quiet: true }",
73
- "⚙️ write to custom object with { processEnv: myObject }",
74
- "⚙️ load multiple .env files with { path: ['.env.local', '.env'] }"
75
- ];
76
- function _getRandomTip() {
77
- return TIPS[Math.floor(Math.random() * TIPS.length)];
78
- }
79
- function parseBoolean(value) {
80
- if (typeof value === "string") {
81
- return !["false", "0", "no", "off", ""].includes(value.toLowerCase());
82
- }
83
- return Boolean(value);
84
- }
85
- function supportsAnsi() {
86
- return process.stdout.isTTY;
87
- }
88
- function dim(text) {
89
- return supportsAnsi() ? `\x1B[2m${text}\x1B[0m` : text;
90
- }
91
- const LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
92
- function parse(src) {
93
- const obj = {};
94
- let lines = src.toString();
95
- lines = lines.replace(/\r\n?/mg, "\n");
96
- let match;
97
- while ((match = LINE.exec(lines)) != null) {
98
- const key = match[1];
99
- let value = match[2] || "";
100
- value = value.trim();
101
- const maybeQuote = value[0];
102
- value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2");
103
- if (maybeQuote === '"') {
104
- value = value.replace(/\\n/g, "\n");
105
- value = value.replace(/\\r/g, "\r");
106
- }
107
- obj[key] = value;
108
- }
109
- return obj;
110
- }
111
- function _parseVault(options) {
112
- options = options || {};
113
- const vaultPath = _vaultPath(options);
114
- options.path = vaultPath;
115
- const result = DotenvModule.configDotenv(options);
116
- if (!result.parsed) {
117
- const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
118
- err.code = "MISSING_DATA";
119
- throw err;
120
- }
121
- const keys = _dotenvKey(options).split(",");
122
- const length = keys.length;
123
- let decrypted;
124
- for (let i = 0; i < length; i++) {
125
- try {
126
- const key = keys[i].trim();
127
- const attrs = _instructions(result, key);
128
- decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
129
- break;
130
- } catch (error) {
131
- if (i + 1 >= length) {
132
- throw error;
133
- }
134
- }
135
- }
136
- return DotenvModule.parse(decrypted);
137
- }
138
- function _warn(message) {
139
- console.error(`[dotenv@${version2}][WARN] ${message}`);
140
- }
141
- function _debug(message) {
142
- console.log(`[dotenv@${version2}][DEBUG] ${message}`);
143
- }
144
- function _log(message) {
145
- console.log(`[dotenv@${version2}] ${message}`);
146
- }
147
- function _dotenvKey(options) {
148
- if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
149
- return options.DOTENV_KEY;
150
- }
151
- if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
152
- return process.env.DOTENV_KEY;
153
- }
154
- return "";
155
- }
156
- function _instructions(result, dotenvKey) {
157
- let uri;
158
- try {
159
- uri = new URL(dotenvKey);
160
- } catch (error) {
161
- if (error.code === "ERR_INVALID_URL") {
162
- const err = new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");
163
- err.code = "INVALID_DOTENV_KEY";
164
- throw err;
165
- }
166
- throw error;
167
- }
168
- const key = uri.password;
169
- if (!key) {
170
- const err = new Error("INVALID_DOTENV_KEY: Missing key part");
171
- err.code = "INVALID_DOTENV_KEY";
172
- throw err;
173
- }
174
- const environment = uri.searchParams.get("environment");
175
- if (!environment) {
176
- const err = new Error("INVALID_DOTENV_KEY: Missing environment part");
177
- err.code = "INVALID_DOTENV_KEY";
178
- throw err;
179
- }
180
- const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
181
- const ciphertext = result.parsed[environmentKey];
182
- if (!ciphertext) {
183
- const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
184
- err.code = "NOT_FOUND_DOTENV_ENVIRONMENT";
185
- throw err;
186
- }
187
- return { ciphertext, key };
188
- }
189
- function _vaultPath(options) {
190
- let possibleVaultPath = null;
191
- if (options && options.path && options.path.length > 0) {
192
- if (Array.isArray(options.path)) {
193
- for (const filepath of options.path) {
194
- if (fs.existsSync(filepath)) {
195
- possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
196
- }
197
- }
198
- } else {
199
- possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
200
- }
201
- } else {
202
- possibleVaultPath = path.resolve(process.cwd(), ".env.vault");
203
- }
204
- if (fs.existsSync(possibleVaultPath)) {
205
- return possibleVaultPath;
206
- }
207
- return null;
208
- }
209
- function _resolveHome(envPath) {
210
- return envPath[0] === "~" ? path.join(os.homedir(), envPath.slice(1)) : envPath;
211
- }
212
- function _configVault(options) {
213
- const debug = parseBoolean(process.env.DOTENV_CONFIG_DEBUG || options && options.debug);
214
- const quiet = parseBoolean(process.env.DOTENV_CONFIG_QUIET || options && options.quiet);
215
- if (debug || !quiet) {
216
- _log("Loading env from encrypted .env.vault");
217
- }
218
- const parsed = DotenvModule._parseVault(options);
219
- let processEnv = process.env;
220
- if (options && options.processEnv != null) {
221
- processEnv = options.processEnv;
222
- }
223
- DotenvModule.populate(processEnv, parsed, options);
224
- return { parsed };
225
- }
226
- function configDotenv(options) {
227
- const dotenvPath = path.resolve(process.cwd(), ".env");
228
- let encoding = "utf8";
229
- let processEnv = process.env;
230
- if (options && options.processEnv != null) {
231
- processEnv = options.processEnv;
232
- }
233
- let debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || options && options.debug);
234
- let quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || options && options.quiet);
235
- if (options && options.encoding) {
236
- encoding = options.encoding;
237
- } else {
238
- if (debug) {
239
- _debug("No encoding is specified. UTF-8 is used by default");
240
- }
241
- }
242
- let optionPaths = [dotenvPath];
243
- if (options && options.path) {
244
- if (!Array.isArray(options.path)) {
245
- optionPaths = [_resolveHome(options.path)];
246
- } else {
247
- optionPaths = [];
248
- for (const filepath of options.path) {
249
- optionPaths.push(_resolveHome(filepath));
250
- }
251
- }
252
- }
253
- let lastError;
254
- const parsedAll = {};
255
- for (const path2 of optionPaths) {
256
- try {
257
- const parsed = DotenvModule.parse(fs.readFileSync(path2, { encoding }));
258
- DotenvModule.populate(parsedAll, parsed, options);
259
- } catch (e) {
260
- if (debug) {
261
- _debug(`Failed to load ${path2} ${e.message}`);
262
- }
263
- lastError = e;
264
- }
265
- }
266
- const populated = DotenvModule.populate(processEnv, parsedAll, options);
267
- debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || debug);
268
- quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || quiet);
269
- if (debug || !quiet) {
270
- const keysCount = Object.keys(populated).length;
271
- const shortPaths = [];
272
- for (const filePath of optionPaths) {
273
- try {
274
- const relative = path.relative(process.cwd(), filePath);
275
- shortPaths.push(relative);
276
- } catch (e) {
277
- if (debug) {
278
- _debug(`Failed to load ${filePath} ${e.message}`);
279
- }
280
- lastError = e;
281
- }
282
- }
283
- _log(`injecting env (${keysCount}) from ${shortPaths.join(",")} ${dim(`-- tip: ${_getRandomTip()}`)}`);
284
- }
285
- if (lastError) {
286
- return { parsed: parsedAll, error: lastError };
287
- } else {
288
- return { parsed: parsedAll };
289
- }
290
- }
291
- function config(options) {
292
- if (_dotenvKey(options).length === 0) {
293
- return DotenvModule.configDotenv(options);
294
- }
295
- const vaultPath = _vaultPath(options);
296
- if (!vaultPath) {
297
- _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
298
- return DotenvModule.configDotenv(options);
299
- }
300
- return DotenvModule._configVault(options);
301
- }
302
- function decrypt(encrypted, keyStr) {
303
- const key = Buffer.from(keyStr.slice(-64), "hex");
304
- let ciphertext = Buffer.from(encrypted, "base64");
305
- const nonce = ciphertext.subarray(0, 12);
306
- const authTag = ciphertext.subarray(-16);
307
- ciphertext = ciphertext.subarray(12, -16);
308
- try {
309
- const aesgcm = crypto2.createDecipheriv("aes-256-gcm", key, nonce);
310
- aesgcm.setAuthTag(authTag);
311
- return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
312
- } catch (error) {
313
- const isRange = error instanceof RangeError;
314
- const invalidKeyLength = error.message === "Invalid key length";
315
- const decryptionFailed = error.message === "Unsupported state or unable to authenticate data";
316
- if (isRange || invalidKeyLength) {
317
- const err = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
318
- err.code = "INVALID_DOTENV_KEY";
319
- throw err;
320
- } else if (decryptionFailed) {
321
- const err = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
322
- err.code = "DECRYPTION_FAILED";
323
- throw err;
324
- } else {
325
- throw error;
326
- }
327
- }
328
- }
329
- function populate(processEnv, parsed, options = {}) {
330
- const debug = Boolean(options && options.debug);
331
- const override = Boolean(options && options.override);
332
- const populated = {};
333
- if (typeof parsed !== "object") {
334
- const err = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
335
- err.code = "OBJECT_REQUIRED";
336
- throw err;
337
- }
338
- for (const key of Object.keys(parsed)) {
339
- if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
340
- if (override === true) {
341
- processEnv[key] = parsed[key];
342
- populated[key] = parsed[key];
343
- }
344
- if (debug) {
345
- if (override === true) {
346
- _debug(`"${key}" is already defined and WAS overwritten`);
347
- } else {
348
- _debug(`"${key}" is already defined and was NOT overwritten`);
349
- }
350
- }
351
- } else {
352
- processEnv[key] = parsed[key];
353
- populated[key] = parsed[key];
354
- }
355
- }
356
- return populated;
357
- }
358
- const DotenvModule = {
359
- configDotenv,
360
- _configVault,
361
- _parseVault,
362
- config,
363
- decrypt,
364
- parse,
365
- populate
366
- };
367
- main.exports.configDotenv = DotenvModule.configDotenv;
368
- main.exports._configVault = DotenvModule._configVault;
369
- main.exports._parseVault = DotenvModule._parseVault;
370
- main.exports.config = DotenvModule.config;
371
- main.exports.decrypt = DotenvModule.decrypt;
372
- main.exports.parse = DotenvModule.parse;
373
- main.exports.populate = DotenvModule.populate;
374
- main.exports = DotenvModule;
375
- return main.exports;
376
- }
377
- var mainExports = requireMain();
378
- const dotenv = /* @__PURE__ */ getDefaultExportFromCjs(mainExports);
379
- var ansiStyles$1 = { exports: {} };
380
- var colorName$1;
381
- var hasRequiredColorName$1;
382
- function requireColorName$1() {
383
- if (hasRequiredColorName$1) return colorName$1;
384
- hasRequiredColorName$1 = 1;
385
- colorName$1 = {
386
- "aliceblue": [240, 248, 255],
387
- "antiquewhite": [250, 235, 215],
388
- "aqua": [0, 255, 255],
389
- "aquamarine": [127, 255, 212],
390
- "azure": [240, 255, 255],
391
- "beige": [245, 245, 220],
392
- "bisque": [255, 228, 196],
393
- "black": [0, 0, 0],
394
- "blanchedalmond": [255, 235, 205],
395
- "blue": [0, 0, 255],
396
- "blueviolet": [138, 43, 226],
397
- "brown": [165, 42, 42],
398
- "burlywood": [222, 184, 135],
399
- "cadetblue": [95, 158, 160],
400
- "chartreuse": [127, 255, 0],
401
- "chocolate": [210, 105, 30],
402
- "coral": [255, 127, 80],
403
- "cornflowerblue": [100, 149, 237],
404
- "cornsilk": [255, 248, 220],
405
- "crimson": [220, 20, 60],
406
- "cyan": [0, 255, 255],
407
- "darkblue": [0, 0, 139],
408
- "darkcyan": [0, 139, 139],
409
- "darkgoldenrod": [184, 134, 11],
410
- "darkgray": [169, 169, 169],
411
- "darkgreen": [0, 100, 0],
412
- "darkgrey": [169, 169, 169],
413
- "darkkhaki": [189, 183, 107],
414
- "darkmagenta": [139, 0, 139],
415
- "darkolivegreen": [85, 107, 47],
416
- "darkorange": [255, 140, 0],
417
- "darkorchid": [153, 50, 204],
418
- "darkred": [139, 0, 0],
419
- "darksalmon": [233, 150, 122],
420
- "darkseagreen": [143, 188, 143],
421
- "darkslateblue": [72, 61, 139],
422
- "darkslategray": [47, 79, 79],
423
- "darkslategrey": [47, 79, 79],
424
- "darkturquoise": [0, 206, 209],
425
- "darkviolet": [148, 0, 211],
426
- "deeppink": [255, 20, 147],
427
- "deepskyblue": [0, 191, 255],
428
- "dimgray": [105, 105, 105],
429
- "dimgrey": [105, 105, 105],
430
- "dodgerblue": [30, 144, 255],
431
- "firebrick": [178, 34, 34],
432
- "floralwhite": [255, 250, 240],
433
- "forestgreen": [34, 139, 34],
434
- "fuchsia": [255, 0, 255],
435
- "gainsboro": [220, 220, 220],
436
- "ghostwhite": [248, 248, 255],
437
- "gold": [255, 215, 0],
438
- "goldenrod": [218, 165, 32],
439
- "gray": [128, 128, 128],
440
- "green": [0, 128, 0],
441
- "greenyellow": [173, 255, 47],
442
- "grey": [128, 128, 128],
443
- "honeydew": [240, 255, 240],
444
- "hotpink": [255, 105, 180],
445
- "indianred": [205, 92, 92],
446
- "indigo": [75, 0, 130],
447
- "ivory": [255, 255, 240],
448
- "khaki": [240, 230, 140],
449
- "lavender": [230, 230, 250],
450
- "lavenderblush": [255, 240, 245],
451
- "lawngreen": [124, 252, 0],
452
- "lemonchiffon": [255, 250, 205],
453
- "lightblue": [173, 216, 230],
454
- "lightcoral": [240, 128, 128],
455
- "lightcyan": [224, 255, 255],
456
- "lightgoldenrodyellow": [250, 250, 210],
457
- "lightgray": [211, 211, 211],
458
- "lightgreen": [144, 238, 144],
459
- "lightgrey": [211, 211, 211],
460
- "lightpink": [255, 182, 193],
461
- "lightsalmon": [255, 160, 122],
462
- "lightseagreen": [32, 178, 170],
463
- "lightskyblue": [135, 206, 250],
464
- "lightslategray": [119, 136, 153],
465
- "lightslategrey": [119, 136, 153],
466
- "lightsteelblue": [176, 196, 222],
467
- "lightyellow": [255, 255, 224],
468
- "lime": [0, 255, 0],
469
- "limegreen": [50, 205, 50],
470
- "linen": [250, 240, 230],
471
- "magenta": [255, 0, 255],
472
- "maroon": [128, 0, 0],
473
- "mediumaquamarine": [102, 205, 170],
474
- "mediumblue": [0, 0, 205],
475
- "mediumorchid": [186, 85, 211],
476
- "mediumpurple": [147, 112, 219],
477
- "mediumseagreen": [60, 179, 113],
478
- "mediumslateblue": [123, 104, 238],
479
- "mediumspringgreen": [0, 250, 154],
480
- "mediumturquoise": [72, 209, 204],
481
- "mediumvioletred": [199, 21, 133],
482
- "midnightblue": [25, 25, 112],
483
- "mintcream": [245, 255, 250],
484
- "mistyrose": [255, 228, 225],
485
- "moccasin": [255, 228, 181],
486
- "navajowhite": [255, 222, 173],
487
- "navy": [0, 0, 128],
488
- "oldlace": [253, 245, 230],
489
- "olive": [128, 128, 0],
490
- "olivedrab": [107, 142, 35],
491
- "orange": [255, 165, 0],
492
- "orangered": [255, 69, 0],
493
- "orchid": [218, 112, 214],
494
- "palegoldenrod": [238, 232, 170],
495
- "palegreen": [152, 251, 152],
496
- "paleturquoise": [175, 238, 238],
497
- "palevioletred": [219, 112, 147],
498
- "papayawhip": [255, 239, 213],
499
- "peachpuff": [255, 218, 185],
500
- "peru": [205, 133, 63],
501
- "pink": [255, 192, 203],
502
- "plum": [221, 160, 221],
503
- "powderblue": [176, 224, 230],
504
- "purple": [128, 0, 128],
505
- "rebeccapurple": [102, 51, 153],
506
- "red": [255, 0, 0],
507
- "rosybrown": [188, 143, 143],
508
- "royalblue": [65, 105, 225],
509
- "saddlebrown": [139, 69, 19],
510
- "salmon": [250, 128, 114],
511
- "sandybrown": [244, 164, 96],
512
- "seagreen": [46, 139, 87],
513
- "seashell": [255, 245, 238],
514
- "sienna": [160, 82, 45],
515
- "silver": [192, 192, 192],
516
- "skyblue": [135, 206, 235],
517
- "slateblue": [106, 90, 205],
518
- "slategray": [112, 128, 144],
519
- "slategrey": [112, 128, 144],
520
- "snow": [255, 250, 250],
521
- "springgreen": [0, 255, 127],
522
- "steelblue": [70, 130, 180],
523
- "tan": [210, 180, 140],
524
- "teal": [0, 128, 128],
525
- "thistle": [216, 191, 216],
526
- "tomato": [255, 99, 71],
527
- "turquoise": [64, 224, 208],
528
- "violet": [238, 130, 238],
529
- "wheat": [245, 222, 179],
530
- "white": [255, 255, 255],
531
- "whitesmoke": [245, 245, 245],
532
- "yellow": [255, 255, 0],
533
- "yellowgreen": [154, 205, 50]
534
- };
535
- return colorName$1;
536
- }
537
- var conversions$1;
538
- var hasRequiredConversions$1;
539
- function requireConversions$1() {
540
- if (hasRequiredConversions$1) return conversions$1;
541
- hasRequiredConversions$1 = 1;
542
- const cssKeywords = requireColorName$1();
543
- const reverseKeywords = {};
544
- for (const key of Object.keys(cssKeywords)) {
545
- reverseKeywords[cssKeywords[key]] = key;
546
- }
547
- const convert = {
548
- rgb: { channels: 3, labels: "rgb" },
549
- hsl: { channels: 3, labels: "hsl" },
550
- hsv: { channels: 3, labels: "hsv" },
551
- hwb: { channels: 3, labels: "hwb" },
552
- cmyk: { channels: 4, labels: "cmyk" },
553
- xyz: { channels: 3, labels: "xyz" },
554
- lab: { channels: 3, labels: "lab" },
555
- lch: { channels: 3, labels: "lch" },
556
- hex: { channels: 1, labels: ["hex"] },
557
- keyword: { channels: 1, labels: ["keyword"] },
558
- ansi16: { channels: 1, labels: ["ansi16"] },
559
- ansi256: { channels: 1, labels: ["ansi256"] },
560
- hcg: { channels: 3, labels: ["h", "c", "g"] },
561
- apple: { channels: 3, labels: ["r16", "g16", "b16"] },
562
- gray: { channels: 1, labels: ["gray"] }
563
- };
564
- conversions$1 = convert;
565
- for (const model of Object.keys(convert)) {
566
- if (!("channels" in convert[model])) {
567
- throw new Error("missing channels property: " + model);
568
- }
569
- if (!("labels" in convert[model])) {
570
- throw new Error("missing channel labels property: " + model);
571
- }
572
- if (convert[model].labels.length !== convert[model].channels) {
573
- throw new Error("channel and label counts mismatch: " + model);
574
- }
575
- const { channels, labels } = convert[model];
576
- delete convert[model].channels;
577
- delete convert[model].labels;
578
- Object.defineProperty(convert[model], "channels", { value: channels });
579
- Object.defineProperty(convert[model], "labels", { value: labels });
580
- }
581
- convert.rgb.hsl = function(rgb) {
582
- const r = rgb[0] / 255;
583
- const g = rgb[1] / 255;
584
- const b = rgb[2] / 255;
585
- const min = Math.min(r, g, b);
586
- const max = Math.max(r, g, b);
587
- const delta = max - min;
588
- let h;
589
- let s;
590
- if (max === min) {
591
- h = 0;
592
- } else if (r === max) {
593
- h = (g - b) / delta;
594
- } else if (g === max) {
595
- h = 2 + (b - r) / delta;
596
- } else if (b === max) {
597
- h = 4 + (r - g) / delta;
598
- }
599
- h = Math.min(h * 60, 360);
600
- if (h < 0) {
601
- h += 360;
602
- }
603
- const l = (min + max) / 2;
604
- if (max === min) {
605
- s = 0;
606
- } else if (l <= 0.5) {
607
- s = delta / (max + min);
608
- } else {
609
- s = delta / (2 - max - min);
610
- }
611
- return [h, s * 100, l * 100];
612
- };
613
- convert.rgb.hsv = function(rgb) {
614
- let rdif;
615
- let gdif;
616
- let bdif;
617
- let h;
618
- let s;
619
- const r = rgb[0] / 255;
620
- const g = rgb[1] / 255;
621
- const b = rgb[2] / 255;
622
- const v = Math.max(r, g, b);
623
- const diff = v - Math.min(r, g, b);
624
- const diffc = function(c) {
625
- return (v - c) / 6 / diff + 1 / 2;
626
- };
627
- if (diff === 0) {
628
- h = 0;
629
- s = 0;
630
- } else {
631
- s = diff / v;
632
- rdif = diffc(r);
633
- gdif = diffc(g);
634
- bdif = diffc(b);
635
- if (r === v) {
636
- h = bdif - gdif;
637
- } else if (g === v) {
638
- h = 1 / 3 + rdif - bdif;
639
- } else if (b === v) {
640
- h = 2 / 3 + gdif - rdif;
641
- }
642
- if (h < 0) {
643
- h += 1;
644
- } else if (h > 1) {
645
- h -= 1;
646
- }
647
- }
648
- return [
649
- h * 360,
650
- s * 100,
651
- v * 100
652
- ];
653
- };
654
- convert.rgb.hwb = function(rgb) {
655
- const r = rgb[0];
656
- const g = rgb[1];
657
- let b = rgb[2];
658
- const h = convert.rgb.hsl(rgb)[0];
659
- const w = 1 / 255 * Math.min(r, Math.min(g, b));
660
- b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
661
- return [h, w * 100, b * 100];
662
- };
663
- convert.rgb.cmyk = function(rgb) {
664
- const r = rgb[0] / 255;
665
- const g = rgb[1] / 255;
666
- const b = rgb[2] / 255;
667
- const k = Math.min(1 - r, 1 - g, 1 - b);
668
- const c = (1 - r - k) / (1 - k) || 0;
669
- const m = (1 - g - k) / (1 - k) || 0;
670
- const y = (1 - b - k) / (1 - k) || 0;
671
- return [c * 100, m * 100, y * 100, k * 100];
672
- };
673
- function comparativeDistance(x, y) {
674
- return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
675
- }
676
- convert.rgb.keyword = function(rgb) {
677
- const reversed = reverseKeywords[rgb];
678
- if (reversed) {
679
- return reversed;
680
- }
681
- let currentClosestDistance = Infinity;
682
- let currentClosestKeyword;
683
- for (const keyword of Object.keys(cssKeywords)) {
684
- const value = cssKeywords[keyword];
685
- const distance = comparativeDistance(rgb, value);
686
- if (distance < currentClosestDistance) {
687
- currentClosestDistance = distance;
688
- currentClosestKeyword = keyword;
689
- }
690
- }
691
- return currentClosestKeyword;
692
- };
693
- convert.keyword.rgb = function(keyword) {
694
- return cssKeywords[keyword];
695
- };
696
- convert.rgb.xyz = function(rgb) {
697
- let r = rgb[0] / 255;
698
- let g = rgb[1] / 255;
699
- let b = rgb[2] / 255;
700
- r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
701
- g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
702
- b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
703
- const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
704
- const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
705
- const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
706
- return [x * 100, y * 100, z * 100];
707
- };
708
- convert.rgb.lab = function(rgb) {
709
- const xyz = convert.rgb.xyz(rgb);
710
- let x = xyz[0];
711
- let y = xyz[1];
712
- let z = xyz[2];
713
- x /= 95.047;
714
- y /= 100;
715
- z /= 108.883;
716
- x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
717
- y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
718
- z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
719
- const l = 116 * y - 16;
720
- const a = 500 * (x - y);
721
- const b = 200 * (y - z);
722
- return [l, a, b];
723
- };
724
- convert.hsl.rgb = function(hsl) {
725
- const h = hsl[0] / 360;
726
- const s = hsl[1] / 100;
727
- const l = hsl[2] / 100;
728
- let t2;
729
- let t3;
730
- let val;
731
- if (s === 0) {
732
- val = l * 255;
733
- return [val, val, val];
734
- }
735
- if (l < 0.5) {
736
- t2 = l * (1 + s);
737
- } else {
738
- t2 = l + s - l * s;
739
- }
740
- const t1 = 2 * l - t2;
741
- const rgb = [0, 0, 0];
742
- for (let i = 0; i < 3; i++) {
743
- t3 = h + 1 / 3 * -(i - 1);
744
- if (t3 < 0) {
745
- t3++;
746
- }
747
- if (t3 > 1) {
748
- t3--;
749
- }
750
- if (6 * t3 < 1) {
751
- val = t1 + (t2 - t1) * 6 * t3;
752
- } else if (2 * t3 < 1) {
753
- val = t2;
754
- } else if (3 * t3 < 2) {
755
- val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
756
- } else {
757
- val = t1;
758
- }
759
- rgb[i] = val * 255;
760
- }
761
- return rgb;
762
- };
763
- convert.hsl.hsv = function(hsl) {
764
- const h = hsl[0];
765
- let s = hsl[1] / 100;
766
- let l = hsl[2] / 100;
767
- let smin = s;
768
- const lmin = Math.max(l, 0.01);
769
- l *= 2;
770
- s *= l <= 1 ? l : 2 - l;
771
- smin *= lmin <= 1 ? lmin : 2 - lmin;
772
- const v = (l + s) / 2;
773
- const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
774
- return [h, sv * 100, v * 100];
775
- };
776
- convert.hsv.rgb = function(hsv) {
777
- const h = hsv[0] / 60;
778
- const s = hsv[1] / 100;
779
- let v = hsv[2] / 100;
780
- const hi = Math.floor(h) % 6;
781
- const f = h - Math.floor(h);
782
- const p = 255 * v * (1 - s);
783
- const q = 255 * v * (1 - s * f);
784
- const t = 255 * v * (1 - s * (1 - f));
785
- v *= 255;
786
- switch (hi) {
787
- case 0:
788
- return [v, t, p];
789
- case 1:
790
- return [q, v, p];
791
- case 2:
792
- return [p, v, t];
793
- case 3:
794
- return [p, q, v];
795
- case 4:
796
- return [t, p, v];
797
- case 5:
798
- return [v, p, q];
799
- }
800
- };
801
- convert.hsv.hsl = function(hsv) {
802
- const h = hsv[0];
803
- const s = hsv[1] / 100;
804
- const v = hsv[2] / 100;
805
- const vmin = Math.max(v, 0.01);
806
- let sl;
807
- let l;
808
- l = (2 - s) * v;
809
- const lmin = (2 - s) * vmin;
810
- sl = s * vmin;
811
- sl /= lmin <= 1 ? lmin : 2 - lmin;
812
- sl = sl || 0;
813
- l /= 2;
814
- return [h, sl * 100, l * 100];
815
- };
816
- convert.hwb.rgb = function(hwb) {
817
- const h = hwb[0] / 360;
818
- let wh = hwb[1] / 100;
819
- let bl = hwb[2] / 100;
820
- const ratio = wh + bl;
821
- let f;
822
- if (ratio > 1) {
823
- wh /= ratio;
824
- bl /= ratio;
825
- }
826
- const i = Math.floor(6 * h);
827
- const v = 1 - bl;
828
- f = 6 * h - i;
829
- if ((i & 1) !== 0) {
830
- f = 1 - f;
831
- }
832
- const n = wh + f * (v - wh);
833
- let r;
834
- let g;
835
- let b;
836
- switch (i) {
837
- default:
838
- case 6:
839
- case 0:
840
- r = v;
841
- g = n;
842
- b = wh;
843
- break;
844
- case 1:
845
- r = n;
846
- g = v;
847
- b = wh;
848
- break;
849
- case 2:
850
- r = wh;
851
- g = v;
852
- b = n;
853
- break;
854
- case 3:
855
- r = wh;
856
- g = n;
857
- b = v;
858
- break;
859
- case 4:
860
- r = n;
861
- g = wh;
862
- b = v;
863
- break;
864
- case 5:
865
- r = v;
866
- g = wh;
867
- b = n;
868
- break;
869
- }
870
- return [r * 255, g * 255, b * 255];
871
- };
872
- convert.cmyk.rgb = function(cmyk) {
873
- const c = cmyk[0] / 100;
874
- const m = cmyk[1] / 100;
875
- const y = cmyk[2] / 100;
876
- const k = cmyk[3] / 100;
877
- const r = 1 - Math.min(1, c * (1 - k) + k);
878
- const g = 1 - Math.min(1, m * (1 - k) + k);
879
- const b = 1 - Math.min(1, y * (1 - k) + k);
880
- return [r * 255, g * 255, b * 255];
881
- };
882
- convert.xyz.rgb = function(xyz) {
883
- const x = xyz[0] / 100;
884
- const y = xyz[1] / 100;
885
- const z = xyz[2] / 100;
886
- let r;
887
- let g;
888
- let b;
889
- r = x * 3.2406 + y * -1.5372 + z * -0.4986;
890
- g = x * -0.9689 + y * 1.8758 + z * 0.0415;
891
- b = x * 0.0557 + y * -0.204 + z * 1.057;
892
- r = r > 31308e-7 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92;
893
- g = g > 31308e-7 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92;
894
- b = b > 31308e-7 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92;
895
- r = Math.min(Math.max(0, r), 1);
896
- g = Math.min(Math.max(0, g), 1);
897
- b = Math.min(Math.max(0, b), 1);
898
- return [r * 255, g * 255, b * 255];
899
- };
900
- convert.xyz.lab = function(xyz) {
901
- let x = xyz[0];
902
- let y = xyz[1];
903
- let z = xyz[2];
904
- x /= 95.047;
905
- y /= 100;
906
- z /= 108.883;
907
- x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
908
- y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
909
- z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
910
- const l = 116 * y - 16;
911
- const a = 500 * (x - y);
912
- const b = 200 * (y - z);
913
- return [l, a, b];
914
- };
915
- convert.lab.xyz = function(lab) {
916
- const l = lab[0];
917
- const a = lab[1];
918
- const b = lab[2];
919
- let x;
920
- let y;
921
- let z;
922
- y = (l + 16) / 116;
923
- x = a / 500 + y;
924
- z = y - b / 200;
925
- const y2 = y ** 3;
926
- const x2 = x ** 3;
927
- const z2 = z ** 3;
928
- y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787;
929
- x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787;
930
- z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787;
931
- x *= 95.047;
932
- y *= 100;
933
- z *= 108.883;
934
- return [x, y, z];
935
- };
936
- convert.lab.lch = function(lab) {
937
- const l = lab[0];
938
- const a = lab[1];
939
- const b = lab[2];
940
- let h;
941
- const hr = Math.atan2(b, a);
942
- h = hr * 360 / 2 / Math.PI;
943
- if (h < 0) {
944
- h += 360;
945
- }
946
- const c = Math.sqrt(a * a + b * b);
947
- return [l, c, h];
948
- };
949
- convert.lch.lab = function(lch) {
950
- const l = lch[0];
951
- const c = lch[1];
952
- const h = lch[2];
953
- const hr = h / 360 * 2 * Math.PI;
954
- const a = c * Math.cos(hr);
955
- const b = c * Math.sin(hr);
956
- return [l, a, b];
957
- };
958
- convert.rgb.ansi16 = function(args, saturation = null) {
959
- const [r, g, b] = args;
960
- let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
961
- value = Math.round(value / 50);
962
- if (value === 0) {
963
- return 30;
964
- }
965
- let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
966
- if (value === 2) {
967
- ansi += 60;
968
- }
969
- return ansi;
970
- };
971
- convert.hsv.ansi16 = function(args) {
972
- return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
973
- };
974
- convert.rgb.ansi256 = function(args) {
975
- const r = args[0];
976
- const g = args[1];
977
- const b = args[2];
978
- if (r === g && g === b) {
979
- if (r < 8) {
980
- return 16;
981
- }
982
- if (r > 248) {
983
- return 231;
984
- }
985
- return Math.round((r - 8) / 247 * 24) + 232;
986
- }
987
- const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
988
- return ansi;
989
- };
990
- convert.ansi16.rgb = function(args) {
991
- let color = args % 10;
992
- if (color === 0 || color === 7) {
993
- if (args > 50) {
994
- color += 3.5;
995
- }
996
- color = color / 10.5 * 255;
997
- return [color, color, color];
998
- }
999
- const mult = (~~(args > 50) + 1) * 0.5;
1000
- const r = (color & 1) * mult * 255;
1001
- const g = (color >> 1 & 1) * mult * 255;
1002
- const b = (color >> 2 & 1) * mult * 255;
1003
- return [r, g, b];
1004
- };
1005
- convert.ansi256.rgb = function(args) {
1006
- if (args >= 232) {
1007
- const c = (args - 232) * 10 + 8;
1008
- return [c, c, c];
1009
- }
1010
- args -= 16;
1011
- let rem;
1012
- const r = Math.floor(args / 36) / 5 * 255;
1013
- const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
1014
- const b = rem % 6 / 5 * 255;
1015
- return [r, g, b];
1016
- };
1017
- convert.rgb.hex = function(args) {
1018
- const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
1019
- const string = integer.toString(16).toUpperCase();
1020
- return "000000".substring(string.length) + string;
1021
- };
1022
- convert.hex.rgb = function(args) {
1023
- const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
1024
- if (!match) {
1025
- return [0, 0, 0];
1026
- }
1027
- let colorString = match[0];
1028
- if (match[0].length === 3) {
1029
- colorString = colorString.split("").map((char) => {
1030
- return char + char;
1031
- }).join("");
1032
- }
1033
- const integer = parseInt(colorString, 16);
1034
- const r = integer >> 16 & 255;
1035
- const g = integer >> 8 & 255;
1036
- const b = integer & 255;
1037
- return [r, g, b];
1038
- };
1039
- convert.rgb.hcg = function(rgb) {
1040
- const r = rgb[0] / 255;
1041
- const g = rgb[1] / 255;
1042
- const b = rgb[2] / 255;
1043
- const max = Math.max(Math.max(r, g), b);
1044
- const min = Math.min(Math.min(r, g), b);
1045
- const chroma = max - min;
1046
- let grayscale;
1047
- let hue;
1048
- if (chroma < 1) {
1049
- grayscale = min / (1 - chroma);
1050
- } else {
1051
- grayscale = 0;
1052
- }
1053
- if (chroma <= 0) {
1054
- hue = 0;
1055
- } else if (max === r) {
1056
- hue = (g - b) / chroma % 6;
1057
- } else if (max === g) {
1058
- hue = 2 + (b - r) / chroma;
1059
- } else {
1060
- hue = 4 + (r - g) / chroma;
1061
- }
1062
- hue /= 6;
1063
- hue %= 1;
1064
- return [hue * 360, chroma * 100, grayscale * 100];
1065
- };
1066
- convert.hsl.hcg = function(hsl) {
1067
- const s = hsl[1] / 100;
1068
- const l = hsl[2] / 100;
1069
- const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l);
1070
- let f = 0;
1071
- if (c < 1) {
1072
- f = (l - 0.5 * c) / (1 - c);
1073
- }
1074
- return [hsl[0], c * 100, f * 100];
1075
- };
1076
- convert.hsv.hcg = function(hsv) {
1077
- const s = hsv[1] / 100;
1078
- const v = hsv[2] / 100;
1079
- const c = s * v;
1080
- let f = 0;
1081
- if (c < 1) {
1082
- f = (v - c) / (1 - c);
1083
- }
1084
- return [hsv[0], c * 100, f * 100];
1085
- };
1086
- convert.hcg.rgb = function(hcg) {
1087
- const h = hcg[0] / 360;
1088
- const c = hcg[1] / 100;
1089
- const g = hcg[2] / 100;
1090
- if (c === 0) {
1091
- return [g * 255, g * 255, g * 255];
1092
- }
1093
- const pure = [0, 0, 0];
1094
- const hi = h % 1 * 6;
1095
- const v = hi % 1;
1096
- const w = 1 - v;
1097
- let mg = 0;
1098
- switch (Math.floor(hi)) {
1099
- case 0:
1100
- pure[0] = 1;
1101
- pure[1] = v;
1102
- pure[2] = 0;
1103
- break;
1104
- case 1:
1105
- pure[0] = w;
1106
- pure[1] = 1;
1107
- pure[2] = 0;
1108
- break;
1109
- case 2:
1110
- pure[0] = 0;
1111
- pure[1] = 1;
1112
- pure[2] = v;
1113
- break;
1114
- case 3:
1115
- pure[0] = 0;
1116
- pure[1] = w;
1117
- pure[2] = 1;
1118
- break;
1119
- case 4:
1120
- pure[0] = v;
1121
- pure[1] = 0;
1122
- pure[2] = 1;
1123
- break;
1124
- default:
1125
- pure[0] = 1;
1126
- pure[1] = 0;
1127
- pure[2] = w;
1128
- }
1129
- mg = (1 - c) * g;
1130
- return [
1131
- (c * pure[0] + mg) * 255,
1132
- (c * pure[1] + mg) * 255,
1133
- (c * pure[2] + mg) * 255
1134
- ];
1135
- };
1136
- convert.hcg.hsv = function(hcg) {
1137
- const c = hcg[1] / 100;
1138
- const g = hcg[2] / 100;
1139
- const v = c + g * (1 - c);
1140
- let f = 0;
1141
- if (v > 0) {
1142
- f = c / v;
1143
- }
1144
- return [hcg[0], f * 100, v * 100];
1145
- };
1146
- convert.hcg.hsl = function(hcg) {
1147
- const c = hcg[1] / 100;
1148
- const g = hcg[2] / 100;
1149
- const l = g * (1 - c) + 0.5 * c;
1150
- let s = 0;
1151
- if (l > 0 && l < 0.5) {
1152
- s = c / (2 * l);
1153
- } else if (l >= 0.5 && l < 1) {
1154
- s = c / (2 * (1 - l));
1155
- }
1156
- return [hcg[0], s * 100, l * 100];
1157
- };
1158
- convert.hcg.hwb = function(hcg) {
1159
- const c = hcg[1] / 100;
1160
- const g = hcg[2] / 100;
1161
- const v = c + g * (1 - c);
1162
- return [hcg[0], (v - c) * 100, (1 - v) * 100];
1163
- };
1164
- convert.hwb.hcg = function(hwb) {
1165
- const w = hwb[1] / 100;
1166
- const b = hwb[2] / 100;
1167
- const v = 1 - b;
1168
- const c = v - w;
1169
- let g = 0;
1170
- if (c < 1) {
1171
- g = (v - c) / (1 - c);
1172
- }
1173
- return [hwb[0], c * 100, g * 100];
1174
- };
1175
- convert.apple.rgb = function(apple) {
1176
- return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
1177
- };
1178
- convert.rgb.apple = function(rgb) {
1179
- return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
1180
- };
1181
- convert.gray.rgb = function(args) {
1182
- return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
1183
- };
1184
- convert.gray.hsl = function(args) {
1185
- return [0, 0, args[0]];
1186
- };
1187
- convert.gray.hsv = convert.gray.hsl;
1188
- convert.gray.hwb = function(gray) {
1189
- return [0, 100, gray[0]];
1190
- };
1191
- convert.gray.cmyk = function(gray) {
1192
- return [0, 0, 0, gray[0]];
1193
- };
1194
- convert.gray.lab = function(gray) {
1195
- return [gray[0], 0, 0];
1196
- };
1197
- convert.gray.hex = function(gray) {
1198
- const val = Math.round(gray[0] / 100 * 255) & 255;
1199
- const integer = (val << 16) + (val << 8) + val;
1200
- const string = integer.toString(16).toUpperCase();
1201
- return "000000".substring(string.length) + string;
1202
- };
1203
- convert.rgb.gray = function(rgb) {
1204
- const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
1205
- return [val / 255 * 100];
1206
- };
1207
- return conversions$1;
1208
- }
1209
- var route$1;
1210
- var hasRequiredRoute$1;
1211
- function requireRoute$1() {
1212
- if (hasRequiredRoute$1) return route$1;
1213
- hasRequiredRoute$1 = 1;
1214
- const conversions2 = requireConversions$1();
1215
- function buildGraph() {
1216
- const graph = {};
1217
- const models = Object.keys(conversions2);
1218
- for (let len = models.length, i = 0; i < len; i++) {
1219
- graph[models[i]] = {
1220
- // http://jsperf.com/1-vs-infinity
1221
- // micro-opt, but this is simple.
1222
- distance: -1,
1223
- parent: null
1224
- };
1225
- }
1226
- return graph;
1227
- }
1228
- function deriveBFS(fromModel) {
1229
- const graph = buildGraph();
1230
- const queue = [fromModel];
1231
- graph[fromModel].distance = 0;
1232
- while (queue.length) {
1233
- const current = queue.pop();
1234
- const adjacents = Object.keys(conversions2[current]);
1235
- for (let len = adjacents.length, i = 0; i < len; i++) {
1236
- const adjacent = adjacents[i];
1237
- const node = graph[adjacent];
1238
- if (node.distance === -1) {
1239
- node.distance = graph[current].distance + 1;
1240
- node.parent = current;
1241
- queue.unshift(adjacent);
1242
- }
1243
- }
1244
- }
1245
- return graph;
1246
- }
1247
- function link(from, to) {
1248
- return function(args) {
1249
- return to(from(args));
1250
- };
1251
- }
1252
- function wrapConversion(toModel, graph) {
1253
- const path = [graph[toModel].parent, toModel];
1254
- let fn = conversions2[graph[toModel].parent][toModel];
1255
- let cur = graph[toModel].parent;
1256
- while (graph[cur].parent) {
1257
- path.unshift(graph[cur].parent);
1258
- fn = link(conversions2[graph[cur].parent][cur], fn);
1259
- cur = graph[cur].parent;
1260
- }
1261
- fn.conversion = path;
1262
- return fn;
1263
- }
1264
- route$1 = function(fromModel) {
1265
- const graph = deriveBFS(fromModel);
1266
- const conversion = {};
1267
- const models = Object.keys(graph);
1268
- for (let len = models.length, i = 0; i < len; i++) {
1269
- const toModel = models[i];
1270
- const node = graph[toModel];
1271
- if (node.parent === null) {
1272
- continue;
1273
- }
1274
- conversion[toModel] = wrapConversion(toModel, graph);
1275
- }
1276
- return conversion;
1277
- };
1278
- return route$1;
1279
- }
1280
- var colorConvert$1;
1281
- var hasRequiredColorConvert$1;
1282
- function requireColorConvert$1() {
1283
- if (hasRequiredColorConvert$1) return colorConvert$1;
1284
- hasRequiredColorConvert$1 = 1;
1285
- const conversions2 = requireConversions$1();
1286
- const route2 = requireRoute$1();
1287
- const convert = {};
1288
- const models = Object.keys(conversions2);
1289
- function wrapRaw(fn) {
1290
- const wrappedFn = function(...args) {
1291
- const arg0 = args[0];
1292
- if (arg0 === void 0 || arg0 === null) {
1293
- return arg0;
1294
- }
1295
- if (arg0.length > 1) {
1296
- args = arg0;
1297
- }
1298
- return fn(args);
1299
- };
1300
- if ("conversion" in fn) {
1301
- wrappedFn.conversion = fn.conversion;
1302
- }
1303
- return wrappedFn;
1304
- }
1305
- function wrapRounded(fn) {
1306
- const wrappedFn = function(...args) {
1307
- const arg0 = args[0];
1308
- if (arg0 === void 0 || arg0 === null) {
1309
- return arg0;
1310
- }
1311
- if (arg0.length > 1) {
1312
- args = arg0;
1313
- }
1314
- const result = fn(args);
1315
- if (typeof result === "object") {
1316
- for (let len = result.length, i = 0; i < len; i++) {
1317
- result[i] = Math.round(result[i]);
1318
- }
1319
- }
1320
- return result;
1321
- };
1322
- if ("conversion" in fn) {
1323
- wrappedFn.conversion = fn.conversion;
1324
- }
1325
- return wrappedFn;
1326
- }
1327
- models.forEach((fromModel) => {
1328
- convert[fromModel] = {};
1329
- Object.defineProperty(convert[fromModel], "channels", { value: conversions2[fromModel].channels });
1330
- Object.defineProperty(convert[fromModel], "labels", { value: conversions2[fromModel].labels });
1331
- const routes = route2(fromModel);
1332
- const routeModels = Object.keys(routes);
1333
- routeModels.forEach((toModel) => {
1334
- const fn = routes[toModel];
1335
- convert[fromModel][toModel] = wrapRounded(fn);
1336
- convert[fromModel][toModel].raw = wrapRaw(fn);
1337
- });
1338
- });
1339
- colorConvert$1 = convert;
1340
- return colorConvert$1;
1341
- }
1342
- ansiStyles$1.exports;
1343
- var hasRequiredAnsiStyles$1;
1344
- function requireAnsiStyles$1() {
1345
- if (hasRequiredAnsiStyles$1) return ansiStyles$1.exports;
1346
- hasRequiredAnsiStyles$1 = 1;
1347
- (function(module2) {
1348
- const wrapAnsi16 = (fn, offset) => (...args) => {
1349
- const code = fn(...args);
1350
- return `\x1B[${code + offset}m`;
1351
- };
1352
- const wrapAnsi256 = (fn, offset) => (...args) => {
1353
- const code = fn(...args);
1354
- return `\x1B[${38 + offset};5;${code}m`;
1355
- };
1356
- const wrapAnsi16m = (fn, offset) => (...args) => {
1357
- const rgb = fn(...args);
1358
- return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
1359
- };
1360
- const ansi2ansi = (n) => n;
1361
- const rgb2rgb = (r, g, b) => [r, g, b];
1362
- const setLazyProperty = (object, property, get) => {
1363
- Object.defineProperty(object, property, {
1364
- get: () => {
1365
- const value = get();
1366
- Object.defineProperty(object, property, {
1367
- value,
1368
- enumerable: true,
1369
- configurable: true
1370
- });
1371
- return value;
1372
- },
1373
- enumerable: true,
1374
- configurable: true
1375
- });
1376
- };
1377
- let colorConvert2;
1378
- const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
1379
- if (colorConvert2 === void 0) {
1380
- colorConvert2 = requireColorConvert$1();
1381
- }
1382
- const offset = isBackground ? 10 : 0;
1383
- const styles = {};
1384
- for (const [sourceSpace, suite] of Object.entries(colorConvert2)) {
1385
- const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
1386
- if (sourceSpace === targetSpace) {
1387
- styles[name] = wrap(identity, offset);
1388
- } else if (typeof suite === "object") {
1389
- styles[name] = wrap(suite[targetSpace], offset);
1390
- }
1391
- }
1392
- return styles;
1393
- };
1394
- function assembleStyles() {
1395
- const codes = /* @__PURE__ */ new Map();
1396
- const styles = {
1397
- modifier: {
1398
- reset: [0, 0],
1399
- // 21 isn't widely supported and 22 does the same thing
1400
- bold: [1, 22],
1401
- dim: [2, 22],
1402
- italic: [3, 23],
1403
- underline: [4, 24],
1404
- inverse: [7, 27],
1405
- hidden: [8, 28],
1406
- strikethrough: [9, 29]
1407
- },
1408
- color: {
1409
- black: [30, 39],
1410
- red: [31, 39],
1411
- green: [32, 39],
1412
- yellow: [33, 39],
1413
- blue: [34, 39],
1414
- magenta: [35, 39],
1415
- cyan: [36, 39],
1416
- white: [37, 39],
1417
- // Bright color
1418
- blackBright: [90, 39],
1419
- redBright: [91, 39],
1420
- greenBright: [92, 39],
1421
- yellowBright: [93, 39],
1422
- blueBright: [94, 39],
1423
- magentaBright: [95, 39],
1424
- cyanBright: [96, 39],
1425
- whiteBright: [97, 39]
1426
- },
1427
- bgColor: {
1428
- bgBlack: [40, 49],
1429
- bgRed: [41, 49],
1430
- bgGreen: [42, 49],
1431
- bgYellow: [43, 49],
1432
- bgBlue: [44, 49],
1433
- bgMagenta: [45, 49],
1434
- bgCyan: [46, 49],
1435
- bgWhite: [47, 49],
1436
- // Bright color
1437
- bgBlackBright: [100, 49],
1438
- bgRedBright: [101, 49],
1439
- bgGreenBright: [102, 49],
1440
- bgYellowBright: [103, 49],
1441
- bgBlueBright: [104, 49],
1442
- bgMagentaBright: [105, 49],
1443
- bgCyanBright: [106, 49],
1444
- bgWhiteBright: [107, 49]
1445
- }
1446
- };
1447
- styles.color.gray = styles.color.blackBright;
1448
- styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
1449
- styles.color.grey = styles.color.blackBright;
1450
- styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
1451
- for (const [groupName, group] of Object.entries(styles)) {
1452
- for (const [styleName, style] of Object.entries(group)) {
1453
- styles[styleName] = {
1454
- open: `\x1B[${style[0]}m`,
1455
- close: `\x1B[${style[1]}m`
1456
- };
1457
- group[styleName] = styles[styleName];
1458
- codes.set(style[0], style[1]);
1459
- }
1460
- Object.defineProperty(styles, groupName, {
1461
- value: group,
1462
- enumerable: false
1463
- });
1464
- }
1465
- Object.defineProperty(styles, "codes", {
1466
- value: codes,
1467
- enumerable: false
1468
- });
1469
- styles.color.close = "\x1B[39m";
1470
- styles.bgColor.close = "\x1B[49m";
1471
- setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
1472
- setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
1473
- setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
1474
- setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
1475
- setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
1476
- setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
1477
- return styles;
1478
- }
1479
- Object.defineProperty(module2, "exports", {
1480
- enumerable: true,
1481
- get: assembleStyles
1482
- });
1483
- })(ansiStyles$1);
1484
- return ansiStyles$1.exports;
1485
- }
1486
- var browser$1;
1487
- var hasRequiredBrowser$1;
1488
- function requireBrowser$1() {
1489
- if (hasRequiredBrowser$1) return browser$1;
1490
- hasRequiredBrowser$1 = 1;
1491
- browser$1 = {
1492
- stdout: false,
1493
- stderr: false
1494
- };
1495
- return browser$1;
1496
- }
1497
- var util$1;
1498
- var hasRequiredUtil$1;
1499
- function requireUtil$1() {
1500
- if (hasRequiredUtil$1) return util$1;
1501
- hasRequiredUtil$1 = 1;
1502
- const stringReplaceAll = (string, substring, replacer) => {
1503
- let index = string.indexOf(substring);
1504
- if (index === -1) {
1505
- return string;
1506
- }
1507
- const substringLength = substring.length;
1508
- let endIndex = 0;
1509
- let returnValue = "";
1510
- do {
1511
- returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
1512
- endIndex = index + substringLength;
1513
- index = string.indexOf(substring, endIndex);
1514
- } while (index !== -1);
1515
- returnValue += string.substr(endIndex);
1516
- return returnValue;
1517
- };
1518
- const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
1519
- let endIndex = 0;
1520
- let returnValue = "";
1521
- do {
1522
- const gotCR = string[index - 1] === "\r";
1523
- returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
1524
- endIndex = index + 1;
1525
- index = string.indexOf("\n", endIndex);
1526
- } while (index !== -1);
1527
- returnValue += string.substr(endIndex);
1528
- return returnValue;
1529
- };
1530
- util$1 = {
1531
- stringReplaceAll,
1532
- stringEncaseCRLFWithFirstIndex
1533
- };
1534
- return util$1;
1535
- }
1536
- var templates$1;
1537
- var hasRequiredTemplates$1;
1538
- function requireTemplates$1() {
1539
- if (hasRequiredTemplates$1) return templates$1;
1540
- hasRequiredTemplates$1 = 1;
1541
- const 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;
1542
- const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
1543
- const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
1544
- const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
1545
- const ESCAPES = /* @__PURE__ */ new Map([
1546
- ["n", "\n"],
1547
- ["r", "\r"],
1548
- ["t", " "],
1549
- ["b", "\b"],
1550
- ["f", "\f"],
1551
- ["v", "\v"],
1552
- ["0", "\0"],
1553
- ["\\", "\\"],
1554
- ["e", "\x1B"],
1555
- ["a", "\x07"]
1556
- ]);
1557
- function unescape(c) {
1558
- const u = c[0] === "u";
1559
- const bracket = c[1] === "{";
1560
- if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) {
1561
- return String.fromCharCode(parseInt(c.slice(1), 16));
1562
- }
1563
- if (u && bracket) {
1564
- return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
1565
- }
1566
- return ESCAPES.get(c) || c;
1567
- }
1568
- function parseArguments(name, arguments_) {
1569
- const results = [];
1570
- const chunks = arguments_.trim().split(/\s*,\s*/g);
1571
- let matches;
1572
- for (const chunk of chunks) {
1573
- const number = Number(chunk);
1574
- if (!Number.isNaN(number)) {
1575
- results.push(number);
1576
- } else if (matches = chunk.match(STRING_REGEX)) {
1577
- results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
1578
- } else {
1579
- throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
1580
- }
1581
- }
1582
- return results;
1583
- }
1584
- function parseStyle(style) {
1585
- STYLE_REGEX.lastIndex = 0;
1586
- const results = [];
1587
- let matches;
1588
- while ((matches = STYLE_REGEX.exec(style)) !== null) {
1589
- const name = matches[1];
1590
- if (matches[2]) {
1591
- const args = parseArguments(name, matches[2]);
1592
- results.push([name].concat(args));
1593
- } else {
1594
- results.push([name]);
1595
- }
1596
- }
1597
- return results;
1598
- }
1599
- function buildStyle(chalk2, styles) {
1600
- const enabled = {};
1601
- for (const layer of styles) {
1602
- for (const style of layer.styles) {
1603
- enabled[style[0]] = layer.inverse ? null : style.slice(1);
1604
- }
1605
- }
1606
- let current = chalk2;
1607
- for (const [styleName, styles2] of Object.entries(enabled)) {
1608
- if (!Array.isArray(styles2)) {
1609
- continue;
1610
- }
1611
- if (!(styleName in current)) {
1612
- throw new Error(`Unknown Chalk style: ${styleName}`);
1613
- }
1614
- current = styles2.length > 0 ? current[styleName](...styles2) : current[styleName];
1615
- }
1616
- return current;
1617
- }
1618
- templates$1 = (chalk2, temporary) => {
1619
- const styles = [];
1620
- const chunks = [];
1621
- let chunk = [];
1622
- temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
1623
- if (escapeCharacter) {
1624
- chunk.push(unescape(escapeCharacter));
1625
- } else if (style) {
1626
- const string = chunk.join("");
1627
- chunk = [];
1628
- chunks.push(styles.length === 0 ? string : buildStyle(chalk2, styles)(string));
1629
- styles.push({ inverse, styles: parseStyle(style) });
1630
- } else if (close) {
1631
- if (styles.length === 0) {
1632
- throw new Error("Found extraneous } in Chalk template literal");
1633
- }
1634
- chunks.push(buildStyle(chalk2, styles)(chunk.join("")));
1635
- chunk = [];
1636
- styles.pop();
1637
- } else {
1638
- chunk.push(character);
1639
- }
1640
- });
1641
- chunks.push(chunk.join(""));
1642
- if (styles.length > 0) {
1643
- const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
1644
- throw new Error(errMessage);
1645
- }
1646
- return chunks.join("");
1647
- };
1648
- return templates$1;
1649
- }
1650
- var source$1;
1651
- var hasRequiredSource$1;
1652
- function requireSource$1() {
1653
- if (hasRequiredSource$1) return source$1;
1654
- hasRequiredSource$1 = 1;
1655
- const ansiStyles2 = requireAnsiStyles$1();
1656
- const { stdout: stdoutColor, stderr: stderrColor } = requireBrowser$1();
1657
- const {
1658
- stringReplaceAll,
1659
- stringEncaseCRLFWithFirstIndex
1660
- } = requireUtil$1();
1661
- const { isArray } = Array;
1662
- const levelMapping = [
1663
- "ansi",
1664
- "ansi",
1665
- "ansi256",
1666
- "ansi16m"
1667
- ];
1668
- const styles = /* @__PURE__ */ Object.create(null);
1669
- const applyOptions = (object, options = {}) => {
1670
- if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
1671
- throw new Error("The `level` option should be an integer from 0 to 3");
1672
- }
1673
- const colorLevel = stdoutColor ? stdoutColor.level : 0;
1674
- object.level = options.level === void 0 ? colorLevel : options.level;
1675
- };
1676
- class ChalkClass {
1677
- constructor(options) {
1678
- return chalkFactory(options);
1679
- }
1680
- }
1681
- const chalkFactory = (options) => {
1682
- const chalk3 = {};
1683
- applyOptions(chalk3, options);
1684
- chalk3.template = (...arguments_) => chalkTag(chalk3.template, ...arguments_);
1685
- Object.setPrototypeOf(chalk3, Chalk.prototype);
1686
- Object.setPrototypeOf(chalk3.template, chalk3);
1687
- chalk3.template.constructor = () => {
1688
- throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
1689
- };
1690
- chalk3.template.Instance = ChalkClass;
1691
- return chalk3.template;
1692
- };
1693
- function Chalk(options) {
1694
- return chalkFactory(options);
1695
- }
1696
- for (const [styleName, style] of Object.entries(ansiStyles2)) {
1697
- styles[styleName] = {
1698
- get() {
1699
- const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
1700
- Object.defineProperty(this, styleName, { value: builder });
1701
- return builder;
1702
- }
1703
- };
1704
- }
1705
- styles.visible = {
1706
- get() {
1707
- const builder = createBuilder(this, this._styler, true);
1708
- Object.defineProperty(this, "visible", { value: builder });
1709
- return builder;
1710
- }
1711
- };
1712
- const usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
1713
- for (const model of usedModels) {
1714
- styles[model] = {
1715
- get() {
1716
- const { level } = this;
1717
- return function(...arguments_) {
1718
- const styler = createStyler(ansiStyles2.color[levelMapping[level]][model](...arguments_), ansiStyles2.color.close, this._styler);
1719
- return createBuilder(this, styler, this._isEmpty);
1720
- };
1721
- }
1722
- };
1723
- }
1724
- for (const model of usedModels) {
1725
- const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
1726
- styles[bgModel] = {
1727
- get() {
1728
- const { level } = this;
1729
- return function(...arguments_) {
1730
- const styler = createStyler(ansiStyles2.bgColor[levelMapping[level]][model](...arguments_), ansiStyles2.bgColor.close, this._styler);
1731
- return createBuilder(this, styler, this._isEmpty);
1732
- };
1733
- }
1734
- };
1735
- }
1736
- const proto = Object.defineProperties(() => {
1737
- }, {
1738
- ...styles,
1739
- level: {
1740
- enumerable: true,
1741
- get() {
1742
- return this._generator.level;
1743
- },
1744
- set(level) {
1745
- this._generator.level = level;
1746
- }
1747
- }
1748
- });
1749
- const createStyler = (open, close, parent) => {
1750
- let openAll;
1751
- let closeAll;
1752
- if (parent === void 0) {
1753
- openAll = open;
1754
- closeAll = close;
1755
- } else {
1756
- openAll = parent.openAll + open;
1757
- closeAll = close + parent.closeAll;
1758
- }
1759
- return {
1760
- open,
1761
- close,
1762
- openAll,
1763
- closeAll,
1764
- parent
1765
- };
1766
- };
1767
- const createBuilder = (self2, _styler, _isEmpty) => {
1768
- const builder = (...arguments_) => {
1769
- if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
1770
- return applyStyle(builder, chalkTag(builder, ...arguments_));
1771
- }
1772
- return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
1773
- };
1774
- Object.setPrototypeOf(builder, proto);
1775
- builder._generator = self2;
1776
- builder._styler = _styler;
1777
- builder._isEmpty = _isEmpty;
1778
- return builder;
1779
- };
1780
- const applyStyle = (self2, string) => {
1781
- if (self2.level <= 0 || !string) {
1782
- return self2._isEmpty ? "" : string;
1783
- }
1784
- let styler = self2._styler;
1785
- if (styler === void 0) {
1786
- return string;
1787
- }
1788
- const { openAll, closeAll } = styler;
1789
- if (string.indexOf("\x1B") !== -1) {
1790
- while (styler !== void 0) {
1791
- string = stringReplaceAll(string, styler.close, styler.open);
1792
- styler = styler.parent;
1793
- }
1794
- }
1795
- const lfIndex = string.indexOf("\n");
1796
- if (lfIndex !== -1) {
1797
- string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
1798
- }
1799
- return openAll + string + closeAll;
1800
- };
1801
- let template;
1802
- const chalkTag = (chalk3, ...strings) => {
1803
- const [firstString] = strings;
1804
- if (!isArray(firstString) || !isArray(firstString.raw)) {
1805
- return strings.join(" ");
1806
- }
1807
- const arguments_ = strings.slice(1);
1808
- const parts = [firstString.raw[0]];
1809
- for (let i = 1; i < firstString.length; i++) {
1810
- parts.push(
1811
- String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"),
1812
- String(firstString.raw[i])
1813
- );
1814
- }
1815
- if (template === void 0) {
1816
- template = requireTemplates$1();
1817
- }
1818
- return template(chalk3, parts.join(""));
1819
- };
1820
- Object.defineProperties(Chalk.prototype, styles);
1821
- const chalk2 = Chalk();
1822
- chalk2.supportsColor = stdoutColor;
1823
- chalk2.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
1824
- chalk2.stderr.supportsColor = stderrColor;
1825
- source$1 = chalk2;
1826
- return source$1;
1827
- }
1828
- requireSource$1();
1829
- const envOptions = {};
1830
- function SetupConfig(envOptions2, logger) {
1831
- const envfile = process.env.STSENVFILE === void 0 ? "/.env" : process.env.STSENVFILE;
1832
- dotenv.config({ path: envfile });
1833
- const defconfig = {
1834
- // Node runtime environment
1835
- isProduction: process.env.NODE_ENV === void 0 ? false : process.env.NODE_ENV === "production" ? true : false,
1836
- isTest: process.env.NODE_ENV === void 0 ? false : process.env.NODE_ENV === "test" ? true : false,
1837
- dbuser: process.env.DB_USER === void 0 ? "postgres" : process.env.DB_USER,
1838
- dbpassword: process.env.DB_PASSWORD === void 0 ? "postgres" : process.env.DB_PASSWORD,
1839
- dbpasswordfile: process.env.DB_PASSWORD_FILE,
1840
- dbhost: process.env.DB_HOST === void 0 ? "localhost:5432" : process.env.DB_HOST,
1841
- database: process.env.DB_DATABASE === void 0 ? "stsrestmsdb01" : process.env.DB_DATABASE,
1842
- databaseUrl: process.env.DATABASE_URL,
1843
- connectionString: "",
1844
- defaultDatabaseConnectionString: "",
1845
- STSServerType: process.env.STS_SERVER_TYPE === void 0 ? "EXPRESS_TLS" : process.env.STS_SERVER_TYPE,
1846
- logToFile: process.env.LOG_TO_FILE === void 0 ? false : process.env.LOG_TO_FILE === "true" ? true : false,
1847
- logFilePath: process.env.LOG_FILE_PATH === void 0 ? "/var/lib/sts" : process.env.LOG_FILE_PATH,
1848
- logFileFormat: process.env.LOG_FILE_FORMAT === void 0 ? "csv" : process.env.LOG_FILE_FORMAT,
1849
- poolSize: process.env.POOL_SIZE === void 0 ? 500 : parseInt(process.env.POOL_SIZE),
1850
- useCPUs: process.env.MAX_CPU === void 0 ? -1 : parseFloat(process.env.MAX_CPU),
1851
- respawnOnFail: process.env.RESPAWN === void 0 ? true : process.env.RESPAWN === "true" ? true : false,
1852
- defaultDatabaseEntries: process.env.DEFAULT_DB_ENTRIES === void 0 ? 1e4 : parseInt(process.env.DEFAULT_DB_ENTRIES),
1853
- useRedisDatabaseCache: process.env.USE_REDIS_DATABASE_CACHE === void 0 ? false : process.env.USE_REDIS_DATABASE_CACHE === "true" ? true : false,
1854
- useSocketIoRedisAdaptor: process.env.USE_SOCKET_IO_REDIS_ADAPTOR === void 0 ? false : process.env.USE_SOCKET_IO_REDIS_ADAPTOR === "true" ? true : false,
1855
- socketIoRedisAdaptorUrl: process.env.SOCKET_IO_REDIS_ADAPTOR_URL === void 0 ? "redis://localhost:6379" : process.env.SOCKET_IO_REDIS_ADAPTOR_URL,
1856
- useRedisInstrumentationTransport: process.env.USE_REDIS_INSTRUMENTATION_TRANSPORT === void 0 ? false : process.env.USE_REDIS_INSTRUMENTATION_TRANSPORT === "true" ? true : false,
1857
- redisInstrumentationTransportUrl: process.env.REDIS_INSTRUMENTATION_TRANSPORT_URL === void 0 ? "redis://localhost:6379" : process.env.REDIS_INSTRUMENTATION_TRANSPORT_URL,
1858
- redisDatabaseCacheEndFlush: process.env.REDIS_DATABASE_CACHE_END_FLUSH === void 0 ? false : process.env.REDIS_DATABASE_CACHE_END_FLUSH === "true" ? true : false,
1859
- redisDatabaseCacheUrl: process.env.REDIS_DATABASE_CACHE_URL === void 0 ? "redis://localhost:6379" : process.env.REDIS_DATABASE_CACHE_URL,
1860
- defaultDatabaseMinExtraDataSize: process.env.DEFAULT_DATABASE_MIN_EXTRA_DATA_SIZE === void 0 ? 0 : parseInt(process.env.DEFAULT_DATABASE_MIN_EXTRA_DATA_SIZE),
1861
- defaultDatabaseMaxExtraDataSize: process.env.DEFAULT_DATABASE_MAX_EXTRA_DATA_SIZE === void 0 ? 2e3 : parseInt(process.env.DEFAULT_DATABASE_MAX_EXTRA_DATA_SIZE),
1862
- rest01endpoint: process.env.REST01_ENDPOINT === void 0 ? "https://localhost" : process.env.REST01_ENDPOINT,
1863
- rest01hostport: process.env.REST01_HOST_PORT === void 0 ? "3003" : process.env.REST01_HOST_PORT,
1864
- rest01port: process.env.REST01_PORT === void 0 ? "3003" : process.env.REST01_PORT,
1865
- rest01apiroot: process.env.REST01_APIROOT === void 0 ? "/stsrest01/v1" : process.env.REST01_APIROOT,
1866
- rest01prometheussupport: process.env.REST01_PROM_SUPPORT === void 0 ? true : process.env.REST01_PROM_SUPPORT === "true" ? true : false,
1867
- rest01prometheusclusterport: process.env.REST01_PROM_CLUSTER_PORT === void 0 ? "3013" : process.env.REST01_PROM_CLUSTER_PORT,
1868
- rest01servicename: process.env.REST01_SERVICE_NAME === void 0 ? "STSRest01" : process.env.REST01_SERVICE_NAME,
1869
- rest01serviceversion: process.env.REST01_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.REST01_SERVICE_VERSION,
1870
- stsfhirendpoint: process.env.STSFHIR_ENDPOINT === void 0 ? "https://localhost" : process.env.STSFHIR_ENDPOINT,
1871
- stsfhirhostport: process.env.STSFHIR_HOST_PORT === void 0 ? "3005" : process.env.STSFHIR_HOST_PORT,
1872
- stsfhirport: process.env.STSFHIR_PORT === void 0 ? "3005" : process.env.STSFHIR_PORT,
1873
- stsfhirapiroot: process.env.STSFHIR_APIROOT === void 0 ? "/stsfhir/r5" : process.env.STSFHIR_APIROOT,
1874
- stsfhirprometheussupport: process.env.STSFHIR_PROM_SUPPORT === void 0 ? true : process.env.STSFHIR_PROM_SUPPORT === "true" ? true : false,
1875
- stsfhirprometheusclusterport: process.env.STSFHIR_PROM_CLUSTER_PORT === void 0 ? "3015" : process.env.STSFHIR_PROM_CLUSTER_PORT,
1876
- stsfhirservicename: process.env.STSFHIR_SERVICE_NAME === void 0 ? "STSFHIR" : process.env.STSFHIR_SERVICE_NAME,
1877
- stsfhirserviceversion: process.env.STSFHIR_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.STSFHIR_SERVICE_VERSION,
1878
- ststccendpoint: process.env.STSTCC_ENDPOINT === void 0 ? "https://localhost" : process.env.STSTCC_ENDPOINT,
1879
- ststcchostport: process.env.STSTCC_HOST_PORT === void 0 ? "3024" : process.env.STSTCC_HOST_PORT,
1880
- ststccport: process.env.STSTCC_PORT === void 0 ? "3024" : process.env.STSTCC_PORT,
1881
- ststccapiroot: process.env.STSTCC_APIROOT === void 0 ? "/ststcc/v1" : process.env.STSTCC_APIROOT,
1882
- ststccprometheussupport: process.env.STSTCC_PROM_SUPPORT === void 0 ? true : process.env.STSTCC_PROM_SUPPORT === "true" ? true : false,
1883
- ststccprometheusclusterport: process.env.STSTCC_PROM_CLUSTER_PORT === void 0 ? "3025" : process.env.STSTCC_PROM_CLUSTER_PORT,
1884
- ststccservicename: process.env.STSTCC_SERVICE_NAME === void 0 ? "STSTCC" : process.env.STSTCC_SERVICE_NAME,
1885
- ststccserviceversion: process.env.STSTCC_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.STSTCC_SERVICE_VERSION,
1886
- imendpoint: process.env.IM_ENDPOINT === void 0 ? "https://localhost" : process.env.IM_ENDPOINT,
1887
- imhostport: process.env.IM_HOST_PORT === void 0 ? "3001" : process.env.IM_HOST_PORT,
1888
- import: process.env.IM_PORT === void 0 ? "3001" : process.env.IM_PORT,
1889
- imapiroot: process.env.IM_APIROOT === void 0 ? "/stsinstrumentmanager/v1" : process.env.IM_APIROOT,
1890
- imprometheussupport: process.env.IM_PROM_SUPPORT === void 0 ? true : process.env.IM_PROM_SUPPORT === "true" ? true : false,
1891
- imprometheusclusterport: process.env.IM_PROM_CLUSTER_PORT === void 0 ? "3011" : process.env.IM_PROM_CLUSTER_PORT,
1892
- imservicename: process.env.IM_SERVICE_NAME === void 0 ? "STSInstrumentManager" : process.env.IM_SERVICE_NAME,
1893
- imserviceversion: process.env.IM_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.IM_SERVICE_VERSION,
1894
- imRedisKeepAliveProcessorUrl: process.env.IM_REDIS_KEEP_ALIVE_PROCESSOR_URL === void 0 ? "redis://localhost:6379" : process.env.IM_REDIS_KEEP_ALIVE_PROCESSOR_URL,
1895
- imRedisMessageProcessorUrl: process.env.IM_REDIS_MESSAGE_PROCESSOR_URL === void 0 ? "redis://localhost:6379" : process.env.IM_REDIS_MESSAGE_PROCESSOR_URL,
1896
- asendpoint: process.env.AS_ENDPOINT === void 0 ? "https://localhost" : process.env.AS_ENDPOINT,
1897
- ashostport: process.env.AS_HOST_PORT === void 0 ? "3002" : process.env.AS_HOST_PORT,
1898
- asport: process.env.AS_PORT === void 0 ? "3002" : process.env.AS_PORT,
1899
- asapiroot: process.env.AS_API_ROOT === void 0 ? "/stsauth/v1.0" : process.env.AS_API_ROOT,
1900
- asoauthapiroot: process.env.AS_OAUTH_API_ROOT === void 0 ? "/oauth2/v2.0" : process.env.AS_OAUTH_API_ROOT,
1901
- asadminapiroot: process.env.AS_ADMIN_API_ROOT === void 0 ? "/admin/v1.0" : process.env.AS_ADMIN_API_ROOT,
1902
- asprometheussupport: process.env.AS_PROM_SUPPORT === void 0 ? true : process.env.AS_PROM_SUPPORT === "true" ? true : false,
1903
- asprometheusclusterport: process.env.AS_PROM_CLUSTER_PORT === void 0 ? "3012" : process.env.AS_PROM_CLUSTER_PORT,
1904
- asservicename: process.env.AS_SERVICE_NAME === void 0 ? "STSAuth" : process.env.AS_SERVICE_NAME,
1905
- asserviceversion: process.env.AS_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.AS_SERVICE_VERSION,
1906
- asjwksjsonpath: process.env.AS_JWKS_JSON_PATH === void 0 ? "/.well-known/jwks.json" : process.env.AS_JWKS_JSON_PATH,
1907
- asjwkskeyrotationtime: process.env.AS_JWKS_KEY_ROTATION_TIME === void 0 ? 86400 : parseInt(process.env.AS_JWKS_KEY_ROTATION_TIME),
1908
- asjwkskeypurgetimeoffset: process.env.AS_JWKS_KEY_PURGE_TIME_OFFSET === void 0 ? 300 : parseInt(process.env.AS_JWKS_KEY_PURGE_TIME_OFFSET),
1909
- asjwkskeycount: process.env.AS_JWKS_KEY_COUNT === void 0 ? 4 : parseInt(process.env.AS_JWKS_KEY_COUNT),
1910
- asaccesstokenexpire: process.env.AS_ACCESS_TOKEN_EXPIRE === void 0 ? 43200 : parseInt(process.env.AS_ACCESS_TOKEN_EXPIRE),
1911
- authorizeendpoint: process.env.AUTHORIZE_ENDPOINT === void 0 ? "https://localhost" : process.env.AUTHORIZE_ENDPOINT,
1912
- authorizeport: process.env.AUTHORIZE_PORT === void 0 ? "3010" : process.env.AUTHORIZE_PORT,
1913
- authorizeapiroot: process.env.AUTHORIZE_API_ROOT === void 0 ? "/stsa" : process.env.AUTHORIZE_API_ROOT,
1914
- authorizeapi: process.env.AUTHORIZE_API === void 0 ? "/authorize" : process.env.AUTHORIZE_API,
1915
- brokerendpoint: process.env.BROKER_ENDPOINT === void 0 ? "https://localhost" : process.env.BROKER_ENDPOINT,
1916
- brokerhostport: process.env.BROKER_HOST_PORT === void 0 ? "3006" : process.env.BROKER_HOST_PORT,
1917
- brokerport: process.env.BROKER_PORT === void 0 ? "3006" : process.env.BROKER_PORT,
1918
- brokerapiroot: process.env.BROKER_APIROOT === void 0 ? "/stsbroker/v1.0" : process.env.BROKER_APIROOT,
1919
- brokerprometheussupport: process.env.BROKER_PROM_SUPPORT === void 0 ? true : process.env.BROKER_PROM_SUPPORT === "true" ? true : false,
1920
- brokerprometheusclusterport: process.env.BROKER_PROM_CLUSTER_PORT === void 0 ? "3016" : process.env.BROKER_PROM_CLUSTER_PORT,
1921
- brokerservicename: process.env.BROKER_SERVICE_NAME === void 0 ? "STSBroker" : process.env.BROKER_SERVICE_NAME,
1922
- brokerserviceversion: process.env.BROKER_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.BROKER_SERVICE_VERSION,
1923
- trnendpoint: process.env.TRN_ENDPOINT === void 0 ? "https://localhost" : process.env.TRN_ENDPOINT,
1924
- trnhostport: process.env.TRN_HOST_PORT === void 0 ? "3007" : process.env.TRN_HOST_PORT,
1925
- trnport: process.env.TRN_PORT === void 0 ? "3007" : process.env.TRN_PORT,
1926
- trnapiroot: process.env.TRN_APIROOT === void 0 ? "/ststrn/v1.0" : process.env.TRN_APIROOT,
1927
- trnprometheussupport: process.env.TRN_PROM_SUPPORT === void 0 ? true : process.env.TRN_PROM_SUPPORT === "true" ? true : false,
1928
- trnprometheusclusterport: process.env.TRN_PROM_CLUSTER_PORT === void 0 ? "3017" : process.env.TRN_PROM_CLUSTER_PORT,
1929
- trnservicename: process.env.TRN_SERVICE_NAME === void 0 ? "STSTestRunnerNode" : process.env.TRN_SERVICE_NAME,
1930
- trnserviceversion: process.env.TRN_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.TRN_SERVICE_VERSION,
1931
- trnautostartdelay: process.env.TRN_AUTO_START_DELAY === void 0 ? 0 : parseInt(process.env.TRN_AUTO_START_DELAY),
1932
- trnautostartconfig: process.env.TRN_AUTO_START_CONFIG === void 0 ? "" : process.env.TRN_AUTO_START_CONFIG,
1933
- trnRedisMessageProcessorUrl: process.env.TRN_REDIS_MESSAGE_PROCESSOR_URL === void 0 ? "redis://localhost:6379" : process.env.TRN_REDIS_MESSAGE_PROCESSOR_URL,
1934
- lambdaendpoint: process.env.LAMBDA_ENDPOINT === void 0 ? "https://localhost" : process.env.LAMBDA_ENDPOINT,
1935
- lambdahostport: process.env.LAMBDA_HOST_PORT === void 0 ? "3009" : process.env.LAMBDA_HOST_PORT,
1936
- lambdaport: process.env.LAMBDA_PORT === void 0 ? "3009" : process.env.LAMBDA_PORT,
1937
- lambdaapiroot: process.env.LAMBDA_APIROOT === void 0 ? "/stslambda/v1.0" : process.env.LAMBDA_APIROOT,
1938
- lambdaprometheussupport: process.env.LAMBDA_PROM_SUPPORT === void 0 ? true : process.env.LAMBDA_PROM_SUPPORT === "true" ? true : false,
1939
- lambdaprometheusclusterport: process.env.LAMBDA_PROM_CLUSTER_PORT === void 0 ? "3019" : process.env.LAMBDA_PROM_CLUSTER_PORT,
1940
- lambdaservicename: process.env.LAMBDA_SERVICE_NAME === void 0 ? "STSLambda" : process.env.LAMBDA_SERVICE_NAME,
1941
- lambdaserviceversion: process.env.LAMBDA_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.LAMBDA_SERVICE_VERSION,
1942
- publishinterval: process.env.PUBLISH_INTERVAL === void 0 ? 1e3 : parseInt(process.env.PUBLISH_INTERVAL),
1943
- publishtimeout: process.env.PUBLISH_TIMEOUT === void 0 ? 750 : parseInt(process.env.PUBLISH_TIMEOUT),
1944
- transport: process.env.TRANSPORT === void 0 ? "RESTAPI" : process.env.TRANSPORT,
1945
- useSecureCookies: process.env.USE_SECURE_COOKIES === void 0 ? false : process.env.USE_SECURE_COOKIES === "true" ? true : false,
1946
- keepAlive: process.env.KEEP_ALIVE === void 0 ? true : process.env.KEEP_ALIVE === "true" ? true : false,
1947
- maxSockets: process.env.MAX_SOCKETS === void 0 ? 10 : parseInt(process.env.MAX_SOCKETS),
1948
- maxTotalSockets: process.env.MAX_TOTAL_SOCKETS === void 0 ? 20 : parseInt(process.env.MAX_TOTAL_SOCKETS),
1949
- maxFreeSockets: process.env.MAX_FREE_SOCKETS === void 0 ? 256 : parseInt(process.env.MAX_FREE_SOCKETS),
1950
- timeout: process.env.TIMEOUT === void 0 ? 1e4 : parseInt(process.env.TIMEOUT),
1951
- maxPayloadSize: process.env.MAX_PAYLOAD_SIZE === void 0 ? "50mb" : process.env.MAX_PAYLOAD_SIZE,
1952
- instrumentationObservationInterval: process.env.INSTRUMENTATION_OBSERVATION_INTERVAL === void 0 ? 1e3 : parseInt(process.env.INSTRUMENTATION_OBSERVATION_INTERVAL),
1953
- instrumentationTimeWindow: process.env.INSTRUMENTATION_TIME_WINDOW === void 0 ? 600 : parseInt(process.env.INSTRUMENTATION_TIME_WINDOW),
1954
- authJWTAccessTokenTimeout: process.env.AUTH_JWT_ACCESS_TOKEN_TIMEOUT === void 0 ? 600 : parseInt(process.env.AUTH_JWT_ACCESS_TOKEN_TIMEOUT),
1955
- authJWTRefreshTokenTimeout: process.env.AUTH_JWT_REFRESH_TOKEN_TIMEOUT === void 0 ? 3600 * 24 : parseInt(process.env.AUTH_JWT_REFRESH_TOKEN_TIMEOUT),
1956
- authCookieTimeout: process.env.AUTH_COOKIE_TIMEOUT === void 0 ? 3600 * 24 : parseInt(process.env.AUTH_COOKIE_TIMEOUT),
1957
- masterProcessExitTime: process.env.MASTER_PROCESS_EXIT_TIME === void 0 ? 500 : parseInt(process.env.MASTER_PROCESS_EXIT_TIME),
1958
- childProcessExitTime: process.env.CHILD_PROCESS_EXIT_TIME === void 0 ? 500 : parseInt(process.env.CHILD_PROCESS_EXIT_TIME),
1959
- systemInformationInterval: process.env.SYSTEM_INFORMATION_INTERVAL === void 0 ? 1e3 : parseInt(process.env.SYSTEM_INFORMATION_INTERVAL),
1960
- ignoresocketio: process.env.IGNORE_SOCKETIO === void 0 ? true : process.env.IGNORE_SOCKETIO === "true" ? true : false,
1961
- httpsserverkeypath: process.env.HTTPS_SERVER_KEY_PATH === void 0 ? "/var/lib/sts/stsglobalresources/keys/server.key" : process.env.HTTPS_SERVER_KEY_PATH,
1962
- httpsservercertpath: process.env.HTTPS_SERVER_CERT_PATH === void 0 ? "/var/lib/sts/stsglobalresources/keys/server.cert" : process.env.HTTPS_SERVER_CERT_PATH,
1963
- tsjwkskeys: process.env.TS_JWKS_KEYS === void 0 ? 3 : parseInt(process.env.TS_JWKS_KEYS),
1964
- jwksAuthConfigCache: process.env.JWKS_AUTH_CONFIG_CACHE === void 0 ? true : process.env.JWKS_AUTH_CONFIG_CACHE === "true" ? true : false,
1965
- jwksAuthConfigCacheMaxEntries: process.env.JWKS_AUTH_CONFIG_CACHE_MAX_ENTRIES === void 0 ? 5 : parseInt(process.env.JWKS_AUTH_CONFIG_CACHE_MAX_ENTRIES),
1966
- jwksAuthConfigCacheMaxAge: process.env.JWKS_AUTH_CONFIG_CACHE_MAX_AGE === void 0 ? 6e5 : parseInt(process.env.JWKS_AUTH_CONFIG_CACHE_MAX_AGE),
1967
- jwksAuthConfigRateLimit: process.env.JWKS_AUTH_CONFIG_RATE_LIMIT === void 0 ? true : process.env.JWKS_AUTH_CONFIG_RATE_LIMIT === "true" ? true : false,
1968
- jwksAuthConfigRateLimitRequestsPerMinute: process.env.JWKS_AUTH_CONFIG_RATE_LIMIT_REQUESTS_PER_MINUTE === void 0 ? 10 : parseInt(process.env.JWKS_AUTH_CONFIG_RATE_LIMIT_REQUESTS_PER_MINUTE),
1969
- jwksAuthConfigTimeout: process.env.JWKS_AUTH_CONFIG_TIMEOUT === void 0 ? 3e4 : parseInt(process.env.JWKS_AUTH_CONFIG_TIMEOUT),
1970
- influxDB_APIToken: process.env.INFLUXDB_API_TOKEN === void 0 ? "password" : process.env.INFLUXDB_API_TOKEN,
1971
- influxDB_APITokenFile: process.env.INFLUXDB_API_TOKEN_FILE,
1972
- influxDB_Url: process.env.INFLUXDB_URL === void 0 ? "http://localhost:8086" : process.env.INFLUXDB_URL,
1973
- influxDB_Org: process.env.INFLUXDB_ORG === void 0 ? "my-org" : process.env.INFLUXDB_ORG,
1974
- influxDB_Bucket: process.env.INFLUXDB_BUCKET === void 0 ? "TestBucket01" : process.env.INFLUXDB_BUCKET,
1975
- influxDB_keepAlive: process.env.INFLUXDB_KEEP_ALIVE === void 0 ? true : process.env.INFLUXDB_KEEP_ALIVE === "true" ? true : false,
1976
- influxDB_maxSockets: process.env.INFLUXDB_MAX_SOCKETS === void 0 ? 10 : parseInt(process.env.INFLUXDB_MAX_SOCKETS),
1977
- influxDB_maxTotalSockets: process.env.INFLUXDB_MAX_TOTAL_SOCKETS === void 0 ? 20 : parseInt(process.env.INFLUXDB_MAX_TOTAL_SOCKETS),
1978
- influxDB_maxFreeSockets: process.env.INFLUXDB_MAX_FREE_SOCKETS === void 0 ? 256 : parseInt(process.env.INFLUXDB_MAX_FREE_SOCKETS),
1979
- influxDB_timeout: process.env.INFLUXDB_TIMEOUT === void 0 ? 1e4 : parseInt(process.env.INFLUXDB_TIMEOUT),
1980
- influxDB_rejectUnauthorized: process.env.INFLUXDB_REJECT_UNAUTHORIZED === void 0 ? true : process.env.INFLUXDB_REJECT_UNAUTHORIZED === "true" ? true : false,
1981
- influxDB_writeDataPointFlushTimeout: process.env.INFLUXDB_WRITE_DATA_POINT_FLUSH_TIMEOUT === void 0 ? 1e3 : parseInt(process.env.INFLUXDB_WRITE_DATA_POINT_FLUSH_TIMEOUT),
1982
- kafka_clientId: process.env.KAFKA_CLIENT_ID === void 0 ? "myclient" : process.env.KAFKA_CLIENT_ID,
1983
- kafka_brokers: process.env.KAFKA_BROKERS === void 0 ? "localhost:9092" : process.env.KAFKA_BROKERS,
1984
- kafka_admin_timeout: process.env.KAFKA_ADMIN_TIMEOUT === void 0 ? 5e3 : parseInt(process.env.KAFKA_ADMIN_TIMEOUT),
1985
- kafka_connection_timeout: process.env.KAFKA_CONNECTION_TIMEOUT === void 0 ? 5e3 : parseInt(process.env.KAFKA_CONNECTION_TIMEOUT),
1986
- kafka_request_timeout: process.env.KAFKA_REQUEST_TIMEOUT === void 0 ? 5e3 : parseInt(process.env.KAFKA_REQUEST_TIMEOUT),
1987
- kafka_log_level: process.env.KAFKA_LOG_LEVEL === void 0 ? "nothing" : process.env.KAFKA_LOG_LEVEL,
1988
- kafka_keep_alive: process.env.KAFKA_KEEP_ALIVE === void 0 ? 3e4 : parseInt(process.env.KAFKA_KEEP_ALIVE),
1989
- kafka_use_ssl: process.env.KAFKA_USE_SSL === void 0 ? false : process.env.KAFKA_USE_SSL === "true" ? true : false,
1990
- kafka_ssl_rejectUnauthorized: process.env.KAFKA_SSL_REJECT_UNAUTHORIZED === void 0 ? true : process.env.KAFKA_SSL_REJECT_UNAUTHORIZED === "true" ? true : false,
1991
- kafka_ssl_cafile: process.env.KAFKA_SSL_CAFILE === void 0 ? "/my/custom/ca.crt" : process.env.KAFKA_SSL_CAFILE,
1992
- kafka_ssl_keyfile: process.env.KAFKA_SSL_KEYFILE === void 0 ? "/my/custom/client-key.pem" : process.env.KAFKA_SSL_KEYFILE,
1993
- kafka_ssl_certfile: process.env.KAFKA_SSL_CERTFILE === void 0 ? "/my/custom/client-cert.pem" : process.env.KAFKA_SSL_CERTFILE,
1994
- kafka_consume_from_beginning: process.env.KAFKA_CONSUME_FROM_BEGINNING === void 0 ? true : process.env.KAFKA_CONSUME_FROM_BEGINNING === "true" ? true : false,
1995
- observabilityPublishMode: process.env.OBSERVABILITY_PUBLISH_MODE === void 0 ? "PROXY" : process.env.OBSERVABILITY_PUBLISH_MODE,
1996
- stsUiTermObservabilityConsumptionMode: process.env.STSUITERM_OBSERVABILITY_CONSUMPTION_MODE === void 0 ? "PROXY" : process.env.STSUITERM_OBSERVABILITY_CONSUMPTION_MODE
1997
- };
1998
- const ReadFile = (passwordFile) => {
1999
- try {
2000
- node_fs.accessSync(passwordFile, node_fs.constants.R_OK);
2001
- const data = node_fs.readFileSync(passwordFile, "utf8");
2002
- if (logger) ;
2003
- return data;
2004
- } catch (err) {
2005
- return "";
2006
- }
2007
- };
2008
- const fileconfig = [
2009
- { fileprop: "dbpasswordfile", prop: "dbpassword" },
2010
- // JWKS secret file processing
2011
- { fileprop: "tsjwksstorepathfile", prop: "tsjwksstorepath" },
2012
- // InfluxDB file processing
2013
- { fileprop: "influxDB_APITokenFile", prop: "influxDB_APIToken" }
2014
- ];
2015
- fileconfig.forEach((v) => {
2016
- if (defconfig[v.fileprop] !== void 0) {
2017
- defconfig[v.prop] = ReadFile(defconfig[v.fileprop]);
2018
- }
2019
- });
2020
- for (const [key, val] of Object.entries(defconfig)) {
2021
- envOptions2[key] = val;
2022
- }
2023
- }
2024
- function $SetupOptions(envOptions2) {
2025
- SetupConfig(envOptions2);
2026
- const options = envOptions2;
2027
- if (options.dbhost) {
2028
- const hosts = options.dbhost.split(",");
2029
- envOptions2.connectionString = hosts.map((host) => {
2030
- return `postgresql://${options.dbuser}:${options.dbpassword}@${host}/${options.database}`;
2031
- }).join(",");
2032
- envOptions2.defaultDatabaseConnectionString = hosts.map((host) => {
2033
- return `postgresql://${options.dbuser}:${options.dbpassword}@${host}/postgres`;
2034
- }).join(",");
2035
- }
2036
- }
2037
- const envOptionsHandler = {
2038
- get(target, prop, receiver) {
2039
- if (Object.keys(target).length === 0) {
2040
- $SetupOptions(target);
2041
- }
2042
- return Reflect.get(target, prop, receiver);
2043
- }
2044
- };
2045
- const goptions = new Proxy(envOptions, envOptionsHandler);
2046
- const byteToHex = [];
2047
- for (let i = 0; i < 256; ++i) {
2048
- byteToHex.push((i + 256).toString(16).slice(1));
2049
- }
2050
- function unsafeStringify(arr, offset = 0) {
2051
- return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
2052
- }
2053
- let getRandomValues;
2054
- const rnds8 = new Uint8Array(16);
2055
- function rng() {
2056
- if (!getRandomValues) {
2057
- if (typeof crypto === "undefined" || !crypto.getRandomValues) {
2058
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
2059
- }
2060
- getRandomValues = crypto.getRandomValues.bind(crypto);
2061
- }
2062
- return getRandomValues(rnds8);
2063
- }
2064
- const randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
2065
- const native = { randomUUID };
2066
- function _v4(options, buf, offset) {
2067
- options = options || {};
2068
- const rnds = options.random ?? options.rng?.() ?? rng();
2069
- if (rnds.length < 16) {
2070
- throw new Error("Random bytes length must be >= 16");
2071
- }
2072
- rnds[6] = rnds[6] & 15 | 64;
2073
- rnds[8] = rnds[8] & 63 | 128;
2074
- return unsafeStringify(rnds);
2075
- }
2076
- function v4(options, buf, offset) {
2077
- if (native.randomUUID && true && !options) {
2078
- return native.randomUUID();
2079
- }
2080
- return _v4(options);
2081
- }
2082
- const isNode = Object.prototype.toString.call(typeof process !== "undefined" ? process : 0) === "[object process]";
2083
- var ansiStyles = { exports: {} };
2084
- var colorName;
2085
- var hasRequiredColorName;
2086
- function requireColorName() {
2087
- if (hasRequiredColorName) return colorName;
2088
- hasRequiredColorName = 1;
2089
- colorName = {
2090
- "aliceblue": [240, 248, 255],
2091
- "antiquewhite": [250, 235, 215],
2092
- "aqua": [0, 255, 255],
2093
- "aquamarine": [127, 255, 212],
2094
- "azure": [240, 255, 255],
2095
- "beige": [245, 245, 220],
2096
- "bisque": [255, 228, 196],
2097
- "black": [0, 0, 0],
2098
- "blanchedalmond": [255, 235, 205],
2099
- "blue": [0, 0, 255],
2100
- "blueviolet": [138, 43, 226],
2101
- "brown": [165, 42, 42],
2102
- "burlywood": [222, 184, 135],
2103
- "cadetblue": [95, 158, 160],
2104
- "chartreuse": [127, 255, 0],
2105
- "chocolate": [210, 105, 30],
2106
- "coral": [255, 127, 80],
2107
- "cornflowerblue": [100, 149, 237],
2108
- "cornsilk": [255, 248, 220],
2109
- "crimson": [220, 20, 60],
2110
- "cyan": [0, 255, 255],
2111
- "darkblue": [0, 0, 139],
2112
- "darkcyan": [0, 139, 139],
2113
- "darkgoldenrod": [184, 134, 11],
2114
- "darkgray": [169, 169, 169],
2115
- "darkgreen": [0, 100, 0],
2116
- "darkgrey": [169, 169, 169],
2117
- "darkkhaki": [189, 183, 107],
2118
- "darkmagenta": [139, 0, 139],
2119
- "darkolivegreen": [85, 107, 47],
2120
- "darkorange": [255, 140, 0],
2121
- "darkorchid": [153, 50, 204],
2122
- "darkred": [139, 0, 0],
2123
- "darksalmon": [233, 150, 122],
2124
- "darkseagreen": [143, 188, 143],
2125
- "darkslateblue": [72, 61, 139],
2126
- "darkslategray": [47, 79, 79],
2127
- "darkslategrey": [47, 79, 79],
2128
- "darkturquoise": [0, 206, 209],
2129
- "darkviolet": [148, 0, 211],
2130
- "deeppink": [255, 20, 147],
2131
- "deepskyblue": [0, 191, 255],
2132
- "dimgray": [105, 105, 105],
2133
- "dimgrey": [105, 105, 105],
2134
- "dodgerblue": [30, 144, 255],
2135
- "firebrick": [178, 34, 34],
2136
- "floralwhite": [255, 250, 240],
2137
- "forestgreen": [34, 139, 34],
2138
- "fuchsia": [255, 0, 255],
2139
- "gainsboro": [220, 220, 220],
2140
- "ghostwhite": [248, 248, 255],
2141
- "gold": [255, 215, 0],
2142
- "goldenrod": [218, 165, 32],
2143
- "gray": [128, 128, 128],
2144
- "green": [0, 128, 0],
2145
- "greenyellow": [173, 255, 47],
2146
- "grey": [128, 128, 128],
2147
- "honeydew": [240, 255, 240],
2148
- "hotpink": [255, 105, 180],
2149
- "indianred": [205, 92, 92],
2150
- "indigo": [75, 0, 130],
2151
- "ivory": [255, 255, 240],
2152
- "khaki": [240, 230, 140],
2153
- "lavender": [230, 230, 250],
2154
- "lavenderblush": [255, 240, 245],
2155
- "lawngreen": [124, 252, 0],
2156
- "lemonchiffon": [255, 250, 205],
2157
- "lightblue": [173, 216, 230],
2158
- "lightcoral": [240, 128, 128],
2159
- "lightcyan": [224, 255, 255],
2160
- "lightgoldenrodyellow": [250, 250, 210],
2161
- "lightgray": [211, 211, 211],
2162
- "lightgreen": [144, 238, 144],
2163
- "lightgrey": [211, 211, 211],
2164
- "lightpink": [255, 182, 193],
2165
- "lightsalmon": [255, 160, 122],
2166
- "lightseagreen": [32, 178, 170],
2167
- "lightskyblue": [135, 206, 250],
2168
- "lightslategray": [119, 136, 153],
2169
- "lightslategrey": [119, 136, 153],
2170
- "lightsteelblue": [176, 196, 222],
2171
- "lightyellow": [255, 255, 224],
2172
- "lime": [0, 255, 0],
2173
- "limegreen": [50, 205, 50],
2174
- "linen": [250, 240, 230],
2175
- "magenta": [255, 0, 255],
2176
- "maroon": [128, 0, 0],
2177
- "mediumaquamarine": [102, 205, 170],
2178
- "mediumblue": [0, 0, 205],
2179
- "mediumorchid": [186, 85, 211],
2180
- "mediumpurple": [147, 112, 219],
2181
- "mediumseagreen": [60, 179, 113],
2182
- "mediumslateblue": [123, 104, 238],
2183
- "mediumspringgreen": [0, 250, 154],
2184
- "mediumturquoise": [72, 209, 204],
2185
- "mediumvioletred": [199, 21, 133],
2186
- "midnightblue": [25, 25, 112],
2187
- "mintcream": [245, 255, 250],
2188
- "mistyrose": [255, 228, 225],
2189
- "moccasin": [255, 228, 181],
2190
- "navajowhite": [255, 222, 173],
2191
- "navy": [0, 0, 128],
2192
- "oldlace": [253, 245, 230],
2193
- "olive": [128, 128, 0],
2194
- "olivedrab": [107, 142, 35],
2195
- "orange": [255, 165, 0],
2196
- "orangered": [255, 69, 0],
2197
- "orchid": [218, 112, 214],
2198
- "palegoldenrod": [238, 232, 170],
2199
- "palegreen": [152, 251, 152],
2200
- "paleturquoise": [175, 238, 238],
2201
- "palevioletred": [219, 112, 147],
2202
- "papayawhip": [255, 239, 213],
2203
- "peachpuff": [255, 218, 185],
2204
- "peru": [205, 133, 63],
2205
- "pink": [255, 192, 203],
2206
- "plum": [221, 160, 221],
2207
- "powderblue": [176, 224, 230],
2208
- "purple": [128, 0, 128],
2209
- "rebeccapurple": [102, 51, 153],
2210
- "red": [255, 0, 0],
2211
- "rosybrown": [188, 143, 143],
2212
- "royalblue": [65, 105, 225],
2213
- "saddlebrown": [139, 69, 19],
2214
- "salmon": [250, 128, 114],
2215
- "sandybrown": [244, 164, 96],
2216
- "seagreen": [46, 139, 87],
2217
- "seashell": [255, 245, 238],
2218
- "sienna": [160, 82, 45],
2219
- "silver": [192, 192, 192],
2220
- "skyblue": [135, 206, 235],
2221
- "slateblue": [106, 90, 205],
2222
- "slategray": [112, 128, 144],
2223
- "slategrey": [112, 128, 144],
2224
- "snow": [255, 250, 250],
2225
- "springgreen": [0, 255, 127],
2226
- "steelblue": [70, 130, 180],
2227
- "tan": [210, 180, 140],
2228
- "teal": [0, 128, 128],
2229
- "thistle": [216, 191, 216],
2230
- "tomato": [255, 99, 71],
2231
- "turquoise": [64, 224, 208],
2232
- "violet": [238, 130, 238],
2233
- "wheat": [245, 222, 179],
2234
- "white": [255, 255, 255],
2235
- "whitesmoke": [245, 245, 245],
2236
- "yellow": [255, 255, 0],
2237
- "yellowgreen": [154, 205, 50]
2238
- };
2239
- return colorName;
2240
- }
2241
- var conversions;
2242
- var hasRequiredConversions;
2243
- function requireConversions() {
2244
- if (hasRequiredConversions) return conversions;
2245
- hasRequiredConversions = 1;
2246
- const cssKeywords = requireColorName();
2247
- const reverseKeywords = {};
2248
- for (const key of Object.keys(cssKeywords)) {
2249
- reverseKeywords[cssKeywords[key]] = key;
2250
- }
2251
- const convert = {
2252
- rgb: { channels: 3, labels: "rgb" },
2253
- hsl: { channels: 3, labels: "hsl" },
2254
- hsv: { channels: 3, labels: "hsv" },
2255
- hwb: { channels: 3, labels: "hwb" },
2256
- cmyk: { channels: 4, labels: "cmyk" },
2257
- xyz: { channels: 3, labels: "xyz" },
2258
- lab: { channels: 3, labels: "lab" },
2259
- lch: { channels: 3, labels: "lch" },
2260
- hex: { channels: 1, labels: ["hex"] },
2261
- keyword: { channels: 1, labels: ["keyword"] },
2262
- ansi16: { channels: 1, labels: ["ansi16"] },
2263
- ansi256: { channels: 1, labels: ["ansi256"] },
2264
- hcg: { channels: 3, labels: ["h", "c", "g"] },
2265
- apple: { channels: 3, labels: ["r16", "g16", "b16"] },
2266
- gray: { channels: 1, labels: ["gray"] }
2267
- };
2268
- conversions = convert;
2269
- for (const model of Object.keys(convert)) {
2270
- if (!("channels" in convert[model])) {
2271
- throw new Error("missing channels property: " + model);
2272
- }
2273
- if (!("labels" in convert[model])) {
2274
- throw new Error("missing channel labels property: " + model);
2275
- }
2276
- if (convert[model].labels.length !== convert[model].channels) {
2277
- throw new Error("channel and label counts mismatch: " + model);
2278
- }
2279
- const { channels, labels } = convert[model];
2280
- delete convert[model].channels;
2281
- delete convert[model].labels;
2282
- Object.defineProperty(convert[model], "channels", { value: channels });
2283
- Object.defineProperty(convert[model], "labels", { value: labels });
2284
- }
2285
- convert.rgb.hsl = function(rgb) {
2286
- const r = rgb[0] / 255;
2287
- const g = rgb[1] / 255;
2288
- const b = rgb[2] / 255;
2289
- const min = Math.min(r, g, b);
2290
- const max = Math.max(r, g, b);
2291
- const delta = max - min;
2292
- let h;
2293
- let s;
2294
- if (max === min) {
2295
- h = 0;
2296
- } else if (r === max) {
2297
- h = (g - b) / delta;
2298
- } else if (g === max) {
2299
- h = 2 + (b - r) / delta;
2300
- } else if (b === max) {
2301
- h = 4 + (r - g) / delta;
2302
- }
2303
- h = Math.min(h * 60, 360);
2304
- if (h < 0) {
2305
- h += 360;
2306
- }
2307
- const l = (min + max) / 2;
2308
- if (max === min) {
2309
- s = 0;
2310
- } else if (l <= 0.5) {
2311
- s = delta / (max + min);
2312
- } else {
2313
- s = delta / (2 - max - min);
2314
- }
2315
- return [h, s * 100, l * 100];
2316
- };
2317
- convert.rgb.hsv = function(rgb) {
2318
- let rdif;
2319
- let gdif;
2320
- let bdif;
2321
- let h;
2322
- let s;
2323
- const r = rgb[0] / 255;
2324
- const g = rgb[1] / 255;
2325
- const b = rgb[2] / 255;
2326
- const v = Math.max(r, g, b);
2327
- const diff = v - Math.min(r, g, b);
2328
- const diffc = function(c) {
2329
- return (v - c) / 6 / diff + 1 / 2;
2330
- };
2331
- if (diff === 0) {
2332
- h = 0;
2333
- s = 0;
2334
- } else {
2335
- s = diff / v;
2336
- rdif = diffc(r);
2337
- gdif = diffc(g);
2338
- bdif = diffc(b);
2339
- if (r === v) {
2340
- h = bdif - gdif;
2341
- } else if (g === v) {
2342
- h = 1 / 3 + rdif - bdif;
2343
- } else if (b === v) {
2344
- h = 2 / 3 + gdif - rdif;
2345
- }
2346
- if (h < 0) {
2347
- h += 1;
2348
- } else if (h > 1) {
2349
- h -= 1;
2350
- }
2351
- }
2352
- return [
2353
- h * 360,
2354
- s * 100,
2355
- v * 100
2356
- ];
2357
- };
2358
- convert.rgb.hwb = function(rgb) {
2359
- const r = rgb[0];
2360
- const g = rgb[1];
2361
- let b = rgb[2];
2362
- const h = convert.rgb.hsl(rgb)[0];
2363
- const w = 1 / 255 * Math.min(r, Math.min(g, b));
2364
- b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
2365
- return [h, w * 100, b * 100];
2366
- };
2367
- convert.rgb.cmyk = function(rgb) {
2368
- const r = rgb[0] / 255;
2369
- const g = rgb[1] / 255;
2370
- const b = rgb[2] / 255;
2371
- const k = Math.min(1 - r, 1 - g, 1 - b);
2372
- const c = (1 - r - k) / (1 - k) || 0;
2373
- const m = (1 - g - k) / (1 - k) || 0;
2374
- const y = (1 - b - k) / (1 - k) || 0;
2375
- return [c * 100, m * 100, y * 100, k * 100];
2376
- };
2377
- function comparativeDistance(x, y) {
2378
- return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
2379
- }
2380
- convert.rgb.keyword = function(rgb) {
2381
- const reversed = reverseKeywords[rgb];
2382
- if (reversed) {
2383
- return reversed;
2384
- }
2385
- let currentClosestDistance = Infinity;
2386
- let currentClosestKeyword;
2387
- for (const keyword of Object.keys(cssKeywords)) {
2388
- const value = cssKeywords[keyword];
2389
- const distance = comparativeDistance(rgb, value);
2390
- if (distance < currentClosestDistance) {
2391
- currentClosestDistance = distance;
2392
- currentClosestKeyword = keyword;
2393
- }
2394
- }
2395
- return currentClosestKeyword;
2396
- };
2397
- convert.keyword.rgb = function(keyword) {
2398
- return cssKeywords[keyword];
2399
- };
2400
- convert.rgb.xyz = function(rgb) {
2401
- let r = rgb[0] / 255;
2402
- let g = rgb[1] / 255;
2403
- let b = rgb[2] / 255;
2404
- r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
2405
- g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
2406
- b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
2407
- const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
2408
- const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
2409
- const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
2410
- return [x * 100, y * 100, z * 100];
2411
- };
2412
- convert.rgb.lab = function(rgb) {
2413
- const xyz = convert.rgb.xyz(rgb);
2414
- let x = xyz[0];
2415
- let y = xyz[1];
2416
- let z = xyz[2];
2417
- x /= 95.047;
2418
- y /= 100;
2419
- z /= 108.883;
2420
- x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
2421
- y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
2422
- z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
2423
- const l = 116 * y - 16;
2424
- const a = 500 * (x - y);
2425
- const b = 200 * (y - z);
2426
- return [l, a, b];
2427
- };
2428
- convert.hsl.rgb = function(hsl) {
2429
- const h = hsl[0] / 360;
2430
- const s = hsl[1] / 100;
2431
- const l = hsl[2] / 100;
2432
- let t2;
2433
- let t3;
2434
- let val;
2435
- if (s === 0) {
2436
- val = l * 255;
2437
- return [val, val, val];
2438
- }
2439
- if (l < 0.5) {
2440
- t2 = l * (1 + s);
2441
- } else {
2442
- t2 = l + s - l * s;
2443
- }
2444
- const t1 = 2 * l - t2;
2445
- const rgb = [0, 0, 0];
2446
- for (let i = 0; i < 3; i++) {
2447
- t3 = h + 1 / 3 * -(i - 1);
2448
- if (t3 < 0) {
2449
- t3++;
2450
- }
2451
- if (t3 > 1) {
2452
- t3--;
2453
- }
2454
- if (6 * t3 < 1) {
2455
- val = t1 + (t2 - t1) * 6 * t3;
2456
- } else if (2 * t3 < 1) {
2457
- val = t2;
2458
- } else if (3 * t3 < 2) {
2459
- val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
2460
- } else {
2461
- val = t1;
2462
- }
2463
- rgb[i] = val * 255;
2464
- }
2465
- return rgb;
2466
- };
2467
- convert.hsl.hsv = function(hsl) {
2468
- const h = hsl[0];
2469
- let s = hsl[1] / 100;
2470
- let l = hsl[2] / 100;
2471
- let smin = s;
2472
- const lmin = Math.max(l, 0.01);
2473
- l *= 2;
2474
- s *= l <= 1 ? l : 2 - l;
2475
- smin *= lmin <= 1 ? lmin : 2 - lmin;
2476
- const v = (l + s) / 2;
2477
- const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
2478
- return [h, sv * 100, v * 100];
2479
- };
2480
- convert.hsv.rgb = function(hsv) {
2481
- const h = hsv[0] / 60;
2482
- const s = hsv[1] / 100;
2483
- let v = hsv[2] / 100;
2484
- const hi = Math.floor(h) % 6;
2485
- const f = h - Math.floor(h);
2486
- const p = 255 * v * (1 - s);
2487
- const q = 255 * v * (1 - s * f);
2488
- const t = 255 * v * (1 - s * (1 - f));
2489
- v *= 255;
2490
- switch (hi) {
2491
- case 0:
2492
- return [v, t, p];
2493
- case 1:
2494
- return [q, v, p];
2495
- case 2:
2496
- return [p, v, t];
2497
- case 3:
2498
- return [p, q, v];
2499
- case 4:
2500
- return [t, p, v];
2501
- case 5:
2502
- return [v, p, q];
2503
- }
2504
- };
2505
- convert.hsv.hsl = function(hsv) {
2506
- const h = hsv[0];
2507
- const s = hsv[1] / 100;
2508
- const v = hsv[2] / 100;
2509
- const vmin = Math.max(v, 0.01);
2510
- let sl;
2511
- let l;
2512
- l = (2 - s) * v;
2513
- const lmin = (2 - s) * vmin;
2514
- sl = s * vmin;
2515
- sl /= lmin <= 1 ? lmin : 2 - lmin;
2516
- sl = sl || 0;
2517
- l /= 2;
2518
- return [h, sl * 100, l * 100];
2519
- };
2520
- convert.hwb.rgb = function(hwb) {
2521
- const h = hwb[0] / 360;
2522
- let wh = hwb[1] / 100;
2523
- let bl = hwb[2] / 100;
2524
- const ratio = wh + bl;
2525
- let f;
2526
- if (ratio > 1) {
2527
- wh /= ratio;
2528
- bl /= ratio;
2529
- }
2530
- const i = Math.floor(6 * h);
2531
- const v = 1 - bl;
2532
- f = 6 * h - i;
2533
- if ((i & 1) !== 0) {
2534
- f = 1 - f;
2535
- }
2536
- const n = wh + f * (v - wh);
2537
- let r;
2538
- let g;
2539
- let b;
2540
- switch (i) {
2541
- default:
2542
- case 6:
2543
- case 0:
2544
- r = v;
2545
- g = n;
2546
- b = wh;
2547
- break;
2548
- case 1:
2549
- r = n;
2550
- g = v;
2551
- b = wh;
2552
- break;
2553
- case 2:
2554
- r = wh;
2555
- g = v;
2556
- b = n;
2557
- break;
2558
- case 3:
2559
- r = wh;
2560
- g = n;
2561
- b = v;
2562
- break;
2563
- case 4:
2564
- r = n;
2565
- g = wh;
2566
- b = v;
2567
- break;
2568
- case 5:
2569
- r = v;
2570
- g = wh;
2571
- b = n;
2572
- break;
2573
- }
2574
- return [r * 255, g * 255, b * 255];
2575
- };
2576
- convert.cmyk.rgb = function(cmyk) {
2577
- const c = cmyk[0] / 100;
2578
- const m = cmyk[1] / 100;
2579
- const y = cmyk[2] / 100;
2580
- const k = cmyk[3] / 100;
2581
- const r = 1 - Math.min(1, c * (1 - k) + k);
2582
- const g = 1 - Math.min(1, m * (1 - k) + k);
2583
- const b = 1 - Math.min(1, y * (1 - k) + k);
2584
- return [r * 255, g * 255, b * 255];
2585
- };
2586
- convert.xyz.rgb = function(xyz) {
2587
- const x = xyz[0] / 100;
2588
- const y = xyz[1] / 100;
2589
- const z = xyz[2] / 100;
2590
- let r;
2591
- let g;
2592
- let b;
2593
- r = x * 3.2406 + y * -1.5372 + z * -0.4986;
2594
- g = x * -0.9689 + y * 1.8758 + z * 0.0415;
2595
- b = x * 0.0557 + y * -0.204 + z * 1.057;
2596
- r = r > 31308e-7 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92;
2597
- g = g > 31308e-7 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92;
2598
- b = b > 31308e-7 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92;
2599
- r = Math.min(Math.max(0, r), 1);
2600
- g = Math.min(Math.max(0, g), 1);
2601
- b = Math.min(Math.max(0, b), 1);
2602
- return [r * 255, g * 255, b * 255];
2603
- };
2604
- convert.xyz.lab = function(xyz) {
2605
- let x = xyz[0];
2606
- let y = xyz[1];
2607
- let z = xyz[2];
2608
- x /= 95.047;
2609
- y /= 100;
2610
- z /= 108.883;
2611
- x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
2612
- y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
2613
- z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
2614
- const l = 116 * y - 16;
2615
- const a = 500 * (x - y);
2616
- const b = 200 * (y - z);
2617
- return [l, a, b];
2618
- };
2619
- convert.lab.xyz = function(lab) {
2620
- const l = lab[0];
2621
- const a = lab[1];
2622
- const b = lab[2];
2623
- let x;
2624
- let y;
2625
- let z;
2626
- y = (l + 16) / 116;
2627
- x = a / 500 + y;
2628
- z = y - b / 200;
2629
- const y2 = y ** 3;
2630
- const x2 = x ** 3;
2631
- const z2 = z ** 3;
2632
- y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787;
2633
- x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787;
2634
- z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787;
2635
- x *= 95.047;
2636
- y *= 100;
2637
- z *= 108.883;
2638
- return [x, y, z];
2639
- };
2640
- convert.lab.lch = function(lab) {
2641
- const l = lab[0];
2642
- const a = lab[1];
2643
- const b = lab[2];
2644
- let h;
2645
- const hr = Math.atan2(b, a);
2646
- h = hr * 360 / 2 / Math.PI;
2647
- if (h < 0) {
2648
- h += 360;
2649
- }
2650
- const c = Math.sqrt(a * a + b * b);
2651
- return [l, c, h];
2652
- };
2653
- convert.lch.lab = function(lch) {
2654
- const l = lch[0];
2655
- const c = lch[1];
2656
- const h = lch[2];
2657
- const hr = h / 360 * 2 * Math.PI;
2658
- const a = c * Math.cos(hr);
2659
- const b = c * Math.sin(hr);
2660
- return [l, a, b];
2661
- };
2662
- convert.rgb.ansi16 = function(args, saturation = null) {
2663
- const [r, g, b] = args;
2664
- let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
2665
- value = Math.round(value / 50);
2666
- if (value === 0) {
2667
- return 30;
2668
- }
2669
- let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
2670
- if (value === 2) {
2671
- ansi += 60;
2672
- }
2673
- return ansi;
2674
- };
2675
- convert.hsv.ansi16 = function(args) {
2676
- return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
2677
- };
2678
- convert.rgb.ansi256 = function(args) {
2679
- const r = args[0];
2680
- const g = args[1];
2681
- const b = args[2];
2682
- if (r === g && g === b) {
2683
- if (r < 8) {
2684
- return 16;
2685
- }
2686
- if (r > 248) {
2687
- return 231;
2688
- }
2689
- return Math.round((r - 8) / 247 * 24) + 232;
2690
- }
2691
- const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
2692
- return ansi;
2693
- };
2694
- convert.ansi16.rgb = function(args) {
2695
- let color = args % 10;
2696
- if (color === 0 || color === 7) {
2697
- if (args > 50) {
2698
- color += 3.5;
2699
- }
2700
- color = color / 10.5 * 255;
2701
- return [color, color, color];
2702
- }
2703
- const mult = (~~(args > 50) + 1) * 0.5;
2704
- const r = (color & 1) * mult * 255;
2705
- const g = (color >> 1 & 1) * mult * 255;
2706
- const b = (color >> 2 & 1) * mult * 255;
2707
- return [r, g, b];
2708
- };
2709
- convert.ansi256.rgb = function(args) {
2710
- if (args >= 232) {
2711
- const c = (args - 232) * 10 + 8;
2712
- return [c, c, c];
2713
- }
2714
- args -= 16;
2715
- let rem;
2716
- const r = Math.floor(args / 36) / 5 * 255;
2717
- const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
2718
- const b = rem % 6 / 5 * 255;
2719
- return [r, g, b];
2720
- };
2721
- convert.rgb.hex = function(args) {
2722
- const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
2723
- const string = integer.toString(16).toUpperCase();
2724
- return "000000".substring(string.length) + string;
2725
- };
2726
- convert.hex.rgb = function(args) {
2727
- const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
2728
- if (!match) {
2729
- return [0, 0, 0];
2730
- }
2731
- let colorString = match[0];
2732
- if (match[0].length === 3) {
2733
- colorString = colorString.split("").map((char) => {
2734
- return char + char;
2735
- }).join("");
2736
- }
2737
- const integer = parseInt(colorString, 16);
2738
- const r = integer >> 16 & 255;
2739
- const g = integer >> 8 & 255;
2740
- const b = integer & 255;
2741
- return [r, g, b];
2742
- };
2743
- convert.rgb.hcg = function(rgb) {
2744
- const r = rgb[0] / 255;
2745
- const g = rgb[1] / 255;
2746
- const b = rgb[2] / 255;
2747
- const max = Math.max(Math.max(r, g), b);
2748
- const min = Math.min(Math.min(r, g), b);
2749
- const chroma = max - min;
2750
- let grayscale;
2751
- let hue;
2752
- if (chroma < 1) {
2753
- grayscale = min / (1 - chroma);
2754
- } else {
2755
- grayscale = 0;
2756
- }
2757
- if (chroma <= 0) {
2758
- hue = 0;
2759
- } else if (max === r) {
2760
- hue = (g - b) / chroma % 6;
2761
- } else if (max === g) {
2762
- hue = 2 + (b - r) / chroma;
2763
- } else {
2764
- hue = 4 + (r - g) / chroma;
2765
- }
2766
- hue /= 6;
2767
- hue %= 1;
2768
- return [hue * 360, chroma * 100, grayscale * 100];
2769
- };
2770
- convert.hsl.hcg = function(hsl) {
2771
- const s = hsl[1] / 100;
2772
- const l = hsl[2] / 100;
2773
- const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l);
2774
- let f = 0;
2775
- if (c < 1) {
2776
- f = (l - 0.5 * c) / (1 - c);
2777
- }
2778
- return [hsl[0], c * 100, f * 100];
2779
- };
2780
- convert.hsv.hcg = function(hsv) {
2781
- const s = hsv[1] / 100;
2782
- const v = hsv[2] / 100;
2783
- const c = s * v;
2784
- let f = 0;
2785
- if (c < 1) {
2786
- f = (v - c) / (1 - c);
2787
- }
2788
- return [hsv[0], c * 100, f * 100];
2789
- };
2790
- convert.hcg.rgb = function(hcg) {
2791
- const h = hcg[0] / 360;
2792
- const c = hcg[1] / 100;
2793
- const g = hcg[2] / 100;
2794
- if (c === 0) {
2795
- return [g * 255, g * 255, g * 255];
2796
- }
2797
- const pure = [0, 0, 0];
2798
- const hi = h % 1 * 6;
2799
- const v = hi % 1;
2800
- const w = 1 - v;
2801
- let mg = 0;
2802
- switch (Math.floor(hi)) {
2803
- case 0:
2804
- pure[0] = 1;
2805
- pure[1] = v;
2806
- pure[2] = 0;
2807
- break;
2808
- case 1:
2809
- pure[0] = w;
2810
- pure[1] = 1;
2811
- pure[2] = 0;
2812
- break;
2813
- case 2:
2814
- pure[0] = 0;
2815
- pure[1] = 1;
2816
- pure[2] = v;
2817
- break;
2818
- case 3:
2819
- pure[0] = 0;
2820
- pure[1] = w;
2821
- pure[2] = 1;
2822
- break;
2823
- case 4:
2824
- pure[0] = v;
2825
- pure[1] = 0;
2826
- pure[2] = 1;
2827
- break;
2828
- default:
2829
- pure[0] = 1;
2830
- pure[1] = 0;
2831
- pure[2] = w;
2832
- }
2833
- mg = (1 - c) * g;
2834
- return [
2835
- (c * pure[0] + mg) * 255,
2836
- (c * pure[1] + mg) * 255,
2837
- (c * pure[2] + mg) * 255
2838
- ];
2839
- };
2840
- convert.hcg.hsv = function(hcg) {
2841
- const c = hcg[1] / 100;
2842
- const g = hcg[2] / 100;
2843
- const v = c + g * (1 - c);
2844
- let f = 0;
2845
- if (v > 0) {
2846
- f = c / v;
2847
- }
2848
- return [hcg[0], f * 100, v * 100];
2849
- };
2850
- convert.hcg.hsl = function(hcg) {
2851
- const c = hcg[1] / 100;
2852
- const g = hcg[2] / 100;
2853
- const l = g * (1 - c) + 0.5 * c;
2854
- let s = 0;
2855
- if (l > 0 && l < 0.5) {
2856
- s = c / (2 * l);
2857
- } else if (l >= 0.5 && l < 1) {
2858
- s = c / (2 * (1 - l));
2859
- }
2860
- return [hcg[0], s * 100, l * 100];
2861
- };
2862
- convert.hcg.hwb = function(hcg) {
2863
- const c = hcg[1] / 100;
2864
- const g = hcg[2] / 100;
2865
- const v = c + g * (1 - c);
2866
- return [hcg[0], (v - c) * 100, (1 - v) * 100];
2867
- };
2868
- convert.hwb.hcg = function(hwb) {
2869
- const w = hwb[1] / 100;
2870
- const b = hwb[2] / 100;
2871
- const v = 1 - b;
2872
- const c = v - w;
2873
- let g = 0;
2874
- if (c < 1) {
2875
- g = (v - c) / (1 - c);
2876
- }
2877
- return [hwb[0], c * 100, g * 100];
2878
- };
2879
- convert.apple.rgb = function(apple) {
2880
- return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
2881
- };
2882
- convert.rgb.apple = function(rgb) {
2883
- return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
2884
- };
2885
- convert.gray.rgb = function(args) {
2886
- return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
2887
- };
2888
- convert.gray.hsl = function(args) {
2889
- return [0, 0, args[0]];
2890
- };
2891
- convert.gray.hsv = convert.gray.hsl;
2892
- convert.gray.hwb = function(gray) {
2893
- return [0, 100, gray[0]];
2894
- };
2895
- convert.gray.cmyk = function(gray) {
2896
- return [0, 0, 0, gray[0]];
2897
- };
2898
- convert.gray.lab = function(gray) {
2899
- return [gray[0], 0, 0];
2900
- };
2901
- convert.gray.hex = function(gray) {
2902
- const val = Math.round(gray[0] / 100 * 255) & 255;
2903
- const integer = (val << 16) + (val << 8) + val;
2904
- const string = integer.toString(16).toUpperCase();
2905
- return "000000".substring(string.length) + string;
2906
- };
2907
- convert.rgb.gray = function(rgb) {
2908
- const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
2909
- return [val / 255 * 100];
2910
- };
2911
- return conversions;
2912
- }
2913
- var route;
2914
- var hasRequiredRoute;
2915
- function requireRoute() {
2916
- if (hasRequiredRoute) return route;
2917
- hasRequiredRoute = 1;
2918
- const conversions2 = requireConversions();
2919
- function buildGraph() {
2920
- const graph = {};
2921
- const models = Object.keys(conversions2);
2922
- for (let len = models.length, i = 0; i < len; i++) {
2923
- graph[models[i]] = {
2924
- // http://jsperf.com/1-vs-infinity
2925
- // micro-opt, but this is simple.
2926
- distance: -1,
2927
- parent: null
2928
- };
2929
- }
2930
- return graph;
2931
- }
2932
- function deriveBFS(fromModel) {
2933
- const graph = buildGraph();
2934
- const queue = [fromModel];
2935
- graph[fromModel].distance = 0;
2936
- while (queue.length) {
2937
- const current = queue.pop();
2938
- const adjacents = Object.keys(conversions2[current]);
2939
- for (let len = adjacents.length, i = 0; i < len; i++) {
2940
- const adjacent = adjacents[i];
2941
- const node = graph[adjacent];
2942
- if (node.distance === -1) {
2943
- node.distance = graph[current].distance + 1;
2944
- node.parent = current;
2945
- queue.unshift(adjacent);
2946
- }
2947
- }
2948
- }
2949
- return graph;
2950
- }
2951
- function link(from, to) {
2952
- return function(args) {
2953
- return to(from(args));
2954
- };
2955
- }
2956
- function wrapConversion(toModel, graph) {
2957
- const path = [graph[toModel].parent, toModel];
2958
- let fn = conversions2[graph[toModel].parent][toModel];
2959
- let cur = graph[toModel].parent;
2960
- while (graph[cur].parent) {
2961
- path.unshift(graph[cur].parent);
2962
- fn = link(conversions2[graph[cur].parent][cur], fn);
2963
- cur = graph[cur].parent;
2964
- }
2965
- fn.conversion = path;
2966
- return fn;
2967
- }
2968
- route = function(fromModel) {
2969
- const graph = deriveBFS(fromModel);
2970
- const conversion = {};
2971
- const models = Object.keys(graph);
2972
- for (let len = models.length, i = 0; i < len; i++) {
2973
- const toModel = models[i];
2974
- const node = graph[toModel];
2975
- if (node.parent === null) {
2976
- continue;
2977
- }
2978
- conversion[toModel] = wrapConversion(toModel, graph);
2979
- }
2980
- return conversion;
2981
- };
2982
- return route;
2983
- }
2984
- var colorConvert;
2985
- var hasRequiredColorConvert;
2986
- function requireColorConvert() {
2987
- if (hasRequiredColorConvert) return colorConvert;
2988
- hasRequiredColorConvert = 1;
2989
- const conversions2 = requireConversions();
2990
- const route2 = requireRoute();
2991
- const convert = {};
2992
- const models = Object.keys(conversions2);
2993
- function wrapRaw(fn) {
2994
- const wrappedFn = function(...args) {
2995
- const arg0 = args[0];
2996
- if (arg0 === void 0 || arg0 === null) {
2997
- return arg0;
2998
- }
2999
- if (arg0.length > 1) {
3000
- args = arg0;
3001
- }
3002
- return fn(args);
3003
- };
3004
- if ("conversion" in fn) {
3005
- wrappedFn.conversion = fn.conversion;
3006
- }
3007
- return wrappedFn;
3008
- }
3009
- function wrapRounded(fn) {
3010
- const wrappedFn = function(...args) {
3011
- const arg0 = args[0];
3012
- if (arg0 === void 0 || arg0 === null) {
3013
- return arg0;
3014
- }
3015
- if (arg0.length > 1) {
3016
- args = arg0;
3017
- }
3018
- const result = fn(args);
3019
- if (typeof result === "object") {
3020
- for (let len = result.length, i = 0; i < len; i++) {
3021
- result[i] = Math.round(result[i]);
3022
- }
3023
- }
3024
- return result;
3025
- };
3026
- if ("conversion" in fn) {
3027
- wrappedFn.conversion = fn.conversion;
3028
- }
3029
- return wrappedFn;
3030
- }
3031
- models.forEach((fromModel) => {
3032
- convert[fromModel] = {};
3033
- Object.defineProperty(convert[fromModel], "channels", { value: conversions2[fromModel].channels });
3034
- Object.defineProperty(convert[fromModel], "labels", { value: conversions2[fromModel].labels });
3035
- const routes = route2(fromModel);
3036
- const routeModels = Object.keys(routes);
3037
- routeModels.forEach((toModel) => {
3038
- const fn = routes[toModel];
3039
- convert[fromModel][toModel] = wrapRounded(fn);
3040
- convert[fromModel][toModel].raw = wrapRaw(fn);
3041
- });
3042
- });
3043
- colorConvert = convert;
3044
- return colorConvert;
3045
- }
3046
- ansiStyles.exports;
3047
- var hasRequiredAnsiStyles;
3048
- function requireAnsiStyles() {
3049
- if (hasRequiredAnsiStyles) return ansiStyles.exports;
3050
- hasRequiredAnsiStyles = 1;
3051
- (function(module2) {
3052
- const wrapAnsi16 = (fn, offset) => (...args) => {
3053
- const code = fn(...args);
3054
- return `\x1B[${code + offset}m`;
3055
- };
3056
- const wrapAnsi256 = (fn, offset) => (...args) => {
3057
- const code = fn(...args);
3058
- return `\x1B[${38 + offset};5;${code}m`;
3059
- };
3060
- const wrapAnsi16m = (fn, offset) => (...args) => {
3061
- const rgb = fn(...args);
3062
- return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
3063
- };
3064
- const ansi2ansi = (n) => n;
3065
- const rgb2rgb = (r, g, b) => [r, g, b];
3066
- const setLazyProperty = (object, property, get) => {
3067
- Object.defineProperty(object, property, {
3068
- get: () => {
3069
- const value = get();
3070
- Object.defineProperty(object, property, {
3071
- value,
3072
- enumerable: true,
3073
- configurable: true
3074
- });
3075
- return value;
3076
- },
3077
- enumerable: true,
3078
- configurable: true
3079
- });
3080
- };
3081
- let colorConvert2;
3082
- const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
3083
- if (colorConvert2 === void 0) {
3084
- colorConvert2 = requireColorConvert();
3085
- }
3086
- const offset = isBackground ? 10 : 0;
3087
- const styles = {};
3088
- for (const [sourceSpace, suite] of Object.entries(colorConvert2)) {
3089
- const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
3090
- if (sourceSpace === targetSpace) {
3091
- styles[name] = wrap(identity, offset);
3092
- } else if (typeof suite === "object") {
3093
- styles[name] = wrap(suite[targetSpace], offset);
3094
- }
3095
- }
3096
- return styles;
3097
- };
3098
- function assembleStyles() {
3099
- const codes = /* @__PURE__ */ new Map();
3100
- const styles = {
3101
- modifier: {
3102
- reset: [0, 0],
3103
- // 21 isn't widely supported and 22 does the same thing
3104
- bold: [1, 22],
3105
- dim: [2, 22],
3106
- italic: [3, 23],
3107
- underline: [4, 24],
3108
- inverse: [7, 27],
3109
- hidden: [8, 28],
3110
- strikethrough: [9, 29]
3111
- },
3112
- color: {
3113
- black: [30, 39],
3114
- red: [31, 39],
3115
- green: [32, 39],
3116
- yellow: [33, 39],
3117
- blue: [34, 39],
3118
- magenta: [35, 39],
3119
- cyan: [36, 39],
3120
- white: [37, 39],
3121
- // Bright color
3122
- blackBright: [90, 39],
3123
- redBright: [91, 39],
3124
- greenBright: [92, 39],
3125
- yellowBright: [93, 39],
3126
- blueBright: [94, 39],
3127
- magentaBright: [95, 39],
3128
- cyanBright: [96, 39],
3129
- whiteBright: [97, 39]
3130
- },
3131
- bgColor: {
3132
- bgBlack: [40, 49],
3133
- bgRed: [41, 49],
3134
- bgGreen: [42, 49],
3135
- bgYellow: [43, 49],
3136
- bgBlue: [44, 49],
3137
- bgMagenta: [45, 49],
3138
- bgCyan: [46, 49],
3139
- bgWhite: [47, 49],
3140
- // Bright color
3141
- bgBlackBright: [100, 49],
3142
- bgRedBright: [101, 49],
3143
- bgGreenBright: [102, 49],
3144
- bgYellowBright: [103, 49],
3145
- bgBlueBright: [104, 49],
3146
- bgMagentaBright: [105, 49],
3147
- bgCyanBright: [106, 49],
3148
- bgWhiteBright: [107, 49]
3149
- }
3150
- };
3151
- styles.color.gray = styles.color.blackBright;
3152
- styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
3153
- styles.color.grey = styles.color.blackBright;
3154
- styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
3155
- for (const [groupName, group] of Object.entries(styles)) {
3156
- for (const [styleName, style] of Object.entries(group)) {
3157
- styles[styleName] = {
3158
- open: `\x1B[${style[0]}m`,
3159
- close: `\x1B[${style[1]}m`
3160
- };
3161
- group[styleName] = styles[styleName];
3162
- codes.set(style[0], style[1]);
3163
- }
3164
- Object.defineProperty(styles, groupName, {
3165
- value: group,
3166
- enumerable: false
3167
- });
3168
- }
3169
- Object.defineProperty(styles, "codes", {
3170
- value: codes,
3171
- enumerable: false
3172
- });
3173
- styles.color.close = "\x1B[39m";
3174
- styles.bgColor.close = "\x1B[49m";
3175
- setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
3176
- setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
3177
- setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
3178
- setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
3179
- setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
3180
- setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
3181
- return styles;
3182
- }
3183
- Object.defineProperty(module2, "exports", {
3184
- enumerable: true,
3185
- get: assembleStyles
3186
- });
3187
- })(ansiStyles);
3188
- return ansiStyles.exports;
3189
- }
3190
- var browser;
3191
- var hasRequiredBrowser;
3192
- function requireBrowser() {
3193
- if (hasRequiredBrowser) return browser;
3194
- hasRequiredBrowser = 1;
3195
- browser = {
3196
- stdout: false,
3197
- stderr: false
3198
- };
3199
- return browser;
3200
- }
3201
- var util;
3202
- var hasRequiredUtil;
3203
- function requireUtil() {
3204
- if (hasRequiredUtil) return util;
3205
- hasRequiredUtil = 1;
3206
- const stringReplaceAll = (string, substring, replacer) => {
3207
- let index = string.indexOf(substring);
3208
- if (index === -1) {
3209
- return string;
3210
- }
3211
- const substringLength = substring.length;
3212
- let endIndex = 0;
3213
- let returnValue = "";
3214
- do {
3215
- returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
3216
- endIndex = index + substringLength;
3217
- index = string.indexOf(substring, endIndex);
3218
- } while (index !== -1);
3219
- returnValue += string.substr(endIndex);
3220
- return returnValue;
3221
- };
3222
- const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
3223
- let endIndex = 0;
3224
- let returnValue = "";
3225
- do {
3226
- const gotCR = string[index - 1] === "\r";
3227
- returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
3228
- endIndex = index + 1;
3229
- index = string.indexOf("\n", endIndex);
3230
- } while (index !== -1);
3231
- returnValue += string.substr(endIndex);
3232
- return returnValue;
3233
- };
3234
- util = {
3235
- stringReplaceAll,
3236
- stringEncaseCRLFWithFirstIndex
3237
- };
3238
- return util;
3239
- }
3240
- var templates;
3241
- var hasRequiredTemplates;
3242
- function requireTemplates() {
3243
- if (hasRequiredTemplates) return templates;
3244
- hasRequiredTemplates = 1;
3245
- const 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;
3246
- const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
3247
- const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
3248
- const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
3249
- const ESCAPES = /* @__PURE__ */ new Map([
3250
- ["n", "\n"],
3251
- ["r", "\r"],
3252
- ["t", " "],
3253
- ["b", "\b"],
3254
- ["f", "\f"],
3255
- ["v", "\v"],
3256
- ["0", "\0"],
3257
- ["\\", "\\"],
3258
- ["e", "\x1B"],
3259
- ["a", "\x07"]
3260
- ]);
3261
- function unescape(c) {
3262
- const u = c[0] === "u";
3263
- const bracket = c[1] === "{";
3264
- if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) {
3265
- return String.fromCharCode(parseInt(c.slice(1), 16));
3266
- }
3267
- if (u && bracket) {
3268
- return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
3269
- }
3270
- return ESCAPES.get(c) || c;
3271
- }
3272
- function parseArguments(name, arguments_) {
3273
- const results = [];
3274
- const chunks = arguments_.trim().split(/\s*,\s*/g);
3275
- let matches;
3276
- for (const chunk of chunks) {
3277
- const number = Number(chunk);
3278
- if (!Number.isNaN(number)) {
3279
- results.push(number);
3280
- } else if (matches = chunk.match(STRING_REGEX)) {
3281
- results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
3282
- } else {
3283
- throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
3284
- }
3285
- }
3286
- return results;
3287
- }
3288
- function parseStyle(style) {
3289
- STYLE_REGEX.lastIndex = 0;
3290
- const results = [];
3291
- let matches;
3292
- while ((matches = STYLE_REGEX.exec(style)) !== null) {
3293
- const name = matches[1];
3294
- if (matches[2]) {
3295
- const args = parseArguments(name, matches[2]);
3296
- results.push([name].concat(args));
3297
- } else {
3298
- results.push([name]);
3299
- }
3300
- }
3301
- return results;
3302
- }
3303
- function buildStyle(chalk2, styles) {
3304
- const enabled = {};
3305
- for (const layer of styles) {
3306
- for (const style of layer.styles) {
3307
- enabled[style[0]] = layer.inverse ? null : style.slice(1);
3308
- }
3309
- }
3310
- let current = chalk2;
3311
- for (const [styleName, styles2] of Object.entries(enabled)) {
3312
- if (!Array.isArray(styles2)) {
3313
- continue;
3314
- }
3315
- if (!(styleName in current)) {
3316
- throw new Error(`Unknown Chalk style: ${styleName}`);
3317
- }
3318
- current = styles2.length > 0 ? current[styleName](...styles2) : current[styleName];
3319
- }
3320
- return current;
3321
- }
3322
- templates = (chalk2, temporary) => {
3323
- const styles = [];
3324
- const chunks = [];
3325
- let chunk = [];
3326
- temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
3327
- if (escapeCharacter) {
3328
- chunk.push(unescape(escapeCharacter));
3329
- } else if (style) {
3330
- const string = chunk.join("");
3331
- chunk = [];
3332
- chunks.push(styles.length === 0 ? string : buildStyle(chalk2, styles)(string));
3333
- styles.push({ inverse, styles: parseStyle(style) });
3334
- } else if (close) {
3335
- if (styles.length === 0) {
3336
- throw new Error("Found extraneous } in Chalk template literal");
3337
- }
3338
- chunks.push(buildStyle(chalk2, styles)(chunk.join("")));
3339
- chunk = [];
3340
- styles.pop();
3341
- } else {
3342
- chunk.push(character);
3343
- }
3344
- });
3345
- chunks.push(chunk.join(""));
3346
- if (styles.length > 0) {
3347
- const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
3348
- throw new Error(errMessage);
3349
- }
3350
- return chunks.join("");
3351
- };
3352
- return templates;
3353
- }
3354
- var source;
3355
- var hasRequiredSource;
3356
- function requireSource() {
3357
- if (hasRequiredSource) return source;
3358
- hasRequiredSource = 1;
3359
- const ansiStyles2 = requireAnsiStyles();
3360
- const { stdout: stdoutColor, stderr: stderrColor } = requireBrowser();
3361
- const {
3362
- stringReplaceAll,
3363
- stringEncaseCRLFWithFirstIndex
3364
- } = requireUtil();
3365
- const { isArray } = Array;
3366
- const levelMapping = [
3367
- "ansi",
3368
- "ansi",
3369
- "ansi256",
3370
- "ansi16m"
3371
- ];
3372
- const styles = /* @__PURE__ */ Object.create(null);
3373
- const applyOptions = (object, options = {}) => {
3374
- if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
3375
- throw new Error("The `level` option should be an integer from 0 to 3");
3376
- }
3377
- const colorLevel = stdoutColor ? stdoutColor.level : 0;
3378
- object.level = options.level === void 0 ? colorLevel : options.level;
3379
- };
3380
- class ChalkClass {
3381
- constructor(options) {
3382
- return chalkFactory(options);
3383
- }
3384
- }
3385
- const chalkFactory = (options) => {
3386
- const chalk3 = {};
3387
- applyOptions(chalk3, options);
3388
- chalk3.template = (...arguments_) => chalkTag(chalk3.template, ...arguments_);
3389
- Object.setPrototypeOf(chalk3, Chalk.prototype);
3390
- Object.setPrototypeOf(chalk3.template, chalk3);
3391
- chalk3.template.constructor = () => {
3392
- throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
3393
- };
3394
- chalk3.template.Instance = ChalkClass;
3395
- return chalk3.template;
3396
- };
3397
- function Chalk(options) {
3398
- return chalkFactory(options);
3399
- }
3400
- for (const [styleName, style] of Object.entries(ansiStyles2)) {
3401
- styles[styleName] = {
3402
- get() {
3403
- const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
3404
- Object.defineProperty(this, styleName, { value: builder });
3405
- return builder;
3406
- }
3407
- };
3408
- }
3409
- styles.visible = {
3410
- get() {
3411
- const builder = createBuilder(this, this._styler, true);
3412
- Object.defineProperty(this, "visible", { value: builder });
3413
- return builder;
3414
- }
3415
- };
3416
- const usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
3417
- for (const model of usedModels) {
3418
- styles[model] = {
3419
- get() {
3420
- const { level } = this;
3421
- return function(...arguments_) {
3422
- const styler = createStyler(ansiStyles2.color[levelMapping[level]][model](...arguments_), ansiStyles2.color.close, this._styler);
3423
- return createBuilder(this, styler, this._isEmpty);
3424
- };
3425
- }
3426
- };
3427
- }
3428
- for (const model of usedModels) {
3429
- const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
3430
- styles[bgModel] = {
3431
- get() {
3432
- const { level } = this;
3433
- return function(...arguments_) {
3434
- const styler = createStyler(ansiStyles2.bgColor[levelMapping[level]][model](...arguments_), ansiStyles2.bgColor.close, this._styler);
3435
- return createBuilder(this, styler, this._isEmpty);
3436
- };
3437
- }
3438
- };
3439
- }
3440
- const proto = Object.defineProperties(() => {
3441
- }, {
3442
- ...styles,
3443
- level: {
3444
- enumerable: true,
3445
- get() {
3446
- return this._generator.level;
3447
- },
3448
- set(level) {
3449
- this._generator.level = level;
3450
- }
3451
- }
3452
- });
3453
- const createStyler = (open, close, parent) => {
3454
- let openAll;
3455
- let closeAll;
3456
- if (parent === void 0) {
3457
- openAll = open;
3458
- closeAll = close;
3459
- } else {
3460
- openAll = parent.openAll + open;
3461
- closeAll = close + parent.closeAll;
3462
- }
3463
- return {
3464
- open,
3465
- close,
3466
- openAll,
3467
- closeAll,
3468
- parent
3469
- };
3470
- };
3471
- const createBuilder = (self2, _styler, _isEmpty) => {
3472
- const builder = (...arguments_) => {
3473
- if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
3474
- return applyStyle(builder, chalkTag(builder, ...arguments_));
3475
- }
3476
- return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
3477
- };
3478
- Object.setPrototypeOf(builder, proto);
3479
- builder._generator = self2;
3480
- builder._styler = _styler;
3481
- builder._isEmpty = _isEmpty;
3482
- return builder;
3483
- };
3484
- const applyStyle = (self2, string) => {
3485
- if (self2.level <= 0 || !string) {
3486
- return self2._isEmpty ? "" : string;
3487
- }
3488
- let styler = self2._styler;
3489
- if (styler === void 0) {
3490
- return string;
3491
- }
3492
- const { openAll, closeAll } = styler;
3493
- if (string.indexOf("\x1B") !== -1) {
3494
- while (styler !== void 0) {
3495
- string = stringReplaceAll(string, styler.close, styler.open);
3496
- styler = styler.parent;
3497
- }
3498
- }
3499
- const lfIndex = string.indexOf("\n");
3500
- if (lfIndex !== -1) {
3501
- string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
3502
- }
3503
- return openAll + string + closeAll;
3504
- };
3505
- let template;
3506
- const chalkTag = (chalk3, ...strings) => {
3507
- const [firstString] = strings;
3508
- if (!isArray(firstString) || !isArray(firstString.raw)) {
3509
- return strings.join(" ");
3510
- }
3511
- const arguments_ = strings.slice(1);
3512
- const parts = [firstString.raw[0]];
3513
- for (let i = 1; i < firstString.length; i++) {
3514
- parts.push(
3515
- String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"),
3516
- String(firstString.raw[i])
3517
- );
3518
- }
3519
- if (template === void 0) {
3520
- template = requireTemplates();
3521
- }
3522
- return template(chalk3, parts.join(""));
3523
- };
3524
- Object.defineProperties(Chalk.prototype, styles);
3525
- const chalk2 = Chalk();
3526
- chalk2.supportsColor = stdoutColor;
3527
- chalk2.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
3528
- chalk2.stderr.supportsColor = stderrColor;
3529
- source = chalk2;
3530
- return source;
3531
- }
3532
- var sourceExports = requireSource();
3533
- const chalk = /* @__PURE__ */ getDefaultExportFromCjs(sourceExports);
3534
- var StatusCodes;
3535
- (function(StatusCodes2) {
3536
- StatusCodes2[StatusCodes2["CONTINUE"] = 100] = "CONTINUE";
3537
- StatusCodes2[StatusCodes2["SWITCHING_PROTOCOLS"] = 101] = "SWITCHING_PROTOCOLS";
3538
- StatusCodes2[StatusCodes2["PROCESSING"] = 102] = "PROCESSING";
3539
- StatusCodes2[StatusCodes2["EARLY_HINTS"] = 103] = "EARLY_HINTS";
3540
- StatusCodes2[StatusCodes2["OK"] = 200] = "OK";
3541
- StatusCodes2[StatusCodes2["CREATED"] = 201] = "CREATED";
3542
- StatusCodes2[StatusCodes2["ACCEPTED"] = 202] = "ACCEPTED";
3543
- StatusCodes2[StatusCodes2["NON_AUTHORITATIVE_INFORMATION"] = 203] = "NON_AUTHORITATIVE_INFORMATION";
3544
- StatusCodes2[StatusCodes2["NO_CONTENT"] = 204] = "NO_CONTENT";
3545
- StatusCodes2[StatusCodes2["RESET_CONTENT"] = 205] = "RESET_CONTENT";
3546
- StatusCodes2[StatusCodes2["PARTIAL_CONTENT"] = 206] = "PARTIAL_CONTENT";
3547
- StatusCodes2[StatusCodes2["MULTI_STATUS"] = 207] = "MULTI_STATUS";
3548
- StatusCodes2[StatusCodes2["MULTIPLE_CHOICES"] = 300] = "MULTIPLE_CHOICES";
3549
- StatusCodes2[StatusCodes2["MOVED_PERMANENTLY"] = 301] = "MOVED_PERMANENTLY";
3550
- StatusCodes2[StatusCodes2["MOVED_TEMPORARILY"] = 302] = "MOVED_TEMPORARILY";
3551
- StatusCodes2[StatusCodes2["SEE_OTHER"] = 303] = "SEE_OTHER";
3552
- StatusCodes2[StatusCodes2["NOT_MODIFIED"] = 304] = "NOT_MODIFIED";
3553
- StatusCodes2[StatusCodes2["USE_PROXY"] = 305] = "USE_PROXY";
3554
- StatusCodes2[StatusCodes2["TEMPORARY_REDIRECT"] = 307] = "TEMPORARY_REDIRECT";
3555
- StatusCodes2[StatusCodes2["PERMANENT_REDIRECT"] = 308] = "PERMANENT_REDIRECT";
3556
- StatusCodes2[StatusCodes2["BAD_REQUEST"] = 400] = "BAD_REQUEST";
3557
- StatusCodes2[StatusCodes2["UNAUTHORIZED"] = 401] = "UNAUTHORIZED";
3558
- StatusCodes2[StatusCodes2["PAYMENT_REQUIRED"] = 402] = "PAYMENT_REQUIRED";
3559
- StatusCodes2[StatusCodes2["FORBIDDEN"] = 403] = "FORBIDDEN";
3560
- StatusCodes2[StatusCodes2["NOT_FOUND"] = 404] = "NOT_FOUND";
3561
- StatusCodes2[StatusCodes2["METHOD_NOT_ALLOWED"] = 405] = "METHOD_NOT_ALLOWED";
3562
- StatusCodes2[StatusCodes2["NOT_ACCEPTABLE"] = 406] = "NOT_ACCEPTABLE";
3563
- StatusCodes2[StatusCodes2["PROXY_AUTHENTICATION_REQUIRED"] = 407] = "PROXY_AUTHENTICATION_REQUIRED";
3564
- StatusCodes2[StatusCodes2["REQUEST_TIMEOUT"] = 408] = "REQUEST_TIMEOUT";
3565
- StatusCodes2[StatusCodes2["CONFLICT"] = 409] = "CONFLICT";
3566
- StatusCodes2[StatusCodes2["GONE"] = 410] = "GONE";
3567
- StatusCodes2[StatusCodes2["LENGTH_REQUIRED"] = 411] = "LENGTH_REQUIRED";
3568
- StatusCodes2[StatusCodes2["PRECONDITION_FAILED"] = 412] = "PRECONDITION_FAILED";
3569
- StatusCodes2[StatusCodes2["REQUEST_TOO_LONG"] = 413] = "REQUEST_TOO_LONG";
3570
- StatusCodes2[StatusCodes2["REQUEST_URI_TOO_LONG"] = 414] = "REQUEST_URI_TOO_LONG";
3571
- StatusCodes2[StatusCodes2["UNSUPPORTED_MEDIA_TYPE"] = 415] = "UNSUPPORTED_MEDIA_TYPE";
3572
- StatusCodes2[StatusCodes2["REQUESTED_RANGE_NOT_SATISFIABLE"] = 416] = "REQUESTED_RANGE_NOT_SATISFIABLE";
3573
- StatusCodes2[StatusCodes2["EXPECTATION_FAILED"] = 417] = "EXPECTATION_FAILED";
3574
- StatusCodes2[StatusCodes2["IM_A_TEAPOT"] = 418] = "IM_A_TEAPOT";
3575
- StatusCodes2[StatusCodes2["INSUFFICIENT_SPACE_ON_RESOURCE"] = 419] = "INSUFFICIENT_SPACE_ON_RESOURCE";
3576
- StatusCodes2[StatusCodes2["METHOD_FAILURE"] = 420] = "METHOD_FAILURE";
3577
- StatusCodes2[StatusCodes2["MISDIRECTED_REQUEST"] = 421] = "MISDIRECTED_REQUEST";
3578
- StatusCodes2[StatusCodes2["UNPROCESSABLE_ENTITY"] = 422] = "UNPROCESSABLE_ENTITY";
3579
- StatusCodes2[StatusCodes2["LOCKED"] = 423] = "LOCKED";
3580
- StatusCodes2[StatusCodes2["FAILED_DEPENDENCY"] = 424] = "FAILED_DEPENDENCY";
3581
- StatusCodes2[StatusCodes2["UPGRADE_REQUIRED"] = 426] = "UPGRADE_REQUIRED";
3582
- StatusCodes2[StatusCodes2["PRECONDITION_REQUIRED"] = 428] = "PRECONDITION_REQUIRED";
3583
- StatusCodes2[StatusCodes2["TOO_MANY_REQUESTS"] = 429] = "TOO_MANY_REQUESTS";
3584
- StatusCodes2[StatusCodes2["REQUEST_HEADER_FIELDS_TOO_LARGE"] = 431] = "REQUEST_HEADER_FIELDS_TOO_LARGE";
3585
- StatusCodes2[StatusCodes2["UNAVAILABLE_FOR_LEGAL_REASONS"] = 451] = "UNAVAILABLE_FOR_LEGAL_REASONS";
3586
- StatusCodes2[StatusCodes2["INTERNAL_SERVER_ERROR"] = 500] = "INTERNAL_SERVER_ERROR";
3587
- StatusCodes2[StatusCodes2["NOT_IMPLEMENTED"] = 501] = "NOT_IMPLEMENTED";
3588
- StatusCodes2[StatusCodes2["BAD_GATEWAY"] = 502] = "BAD_GATEWAY";
3589
- StatusCodes2[StatusCodes2["SERVICE_UNAVAILABLE"] = 503] = "SERVICE_UNAVAILABLE";
3590
- StatusCodes2[StatusCodes2["GATEWAY_TIMEOUT"] = 504] = "GATEWAY_TIMEOUT";
3591
- StatusCodes2[StatusCodes2["HTTP_VERSION_NOT_SUPPORTED"] = 505] = "HTTP_VERSION_NOT_SUPPORTED";
3592
- StatusCodes2[StatusCodes2["INSUFFICIENT_STORAGE"] = 507] = "INSUFFICIENT_STORAGE";
3593
- StatusCodes2[StatusCodes2["NETWORK_AUTHENTICATION_REQUIRED"] = 511] = "NETWORK_AUTHENTICATION_REQUIRED";
3594
- })(StatusCodes || (StatusCodes = {}));
3595
- class AxiosClient {
3596
- #options;
3597
- #DUMMY_USER = "USR_user01@stsmda.com.au";
3598
- //@@ needs to come from headers ??
3599
- #invokeMethods = {};
3600
- #maxRetries = 5;
3601
- #sleepDuration = [50, 100, 200, 500, 1e3, 2e3, 5e3];
3602
- #NoRetryStatusCodes = [
3603
- StatusCodes.NOT_FOUND,
3604
- StatusCodes.CONFLICT
3605
- ];
3606
- #accessToken = null;
3607
- #noRetries = false;
3608
- constructor(options) {
3609
- this.#options = options;
3610
- }
3611
- get options() {
3612
- return this.#options;
3613
- }
3614
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
3615
- #LogDebugMessage = (message) => {
3616
- this.#options.logger.debug(message);
3617
- };
3618
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
3619
- #LogErrorMessage = (message) => {
3620
- this.#options.logger.error(message);
3621
- };
3622
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
3623
- HandleError = (error) => {
3624
- this.#LogDebugMessage(chalk.red(`HandleError(): Error: [${error}]`));
3625
- let responseCode = 500;
3626
- if (axios.isAxiosError(error)) {
3627
- const axiosError = error;
3628
- if (axiosError.response) {
3629
- responseCode = axiosError.response.status;
3630
- this.#LogDebugMessage(chalk.red(`AXIOS Error Response.Status = [${axiosError.response.status}]`));
3631
- if (axiosError.response.headers) {
3632
- this.#LogErrorMessage(chalk.red(` headers: [${JSON.stringify(axiosError.response.headers)}]`));
3633
- }
3634
- if (axiosError.response.data) {
3635
- this.#LogErrorMessage(chalk.red(` data: [${JSON.stringify(axiosError.response.data)}]`));
3636
- }
3637
- try {
3638
- if (axiosError.response.config) {
3639
- this.#LogErrorMessage(chalk.red(` config: [${JSON.stringify(axiosError.response.config)}]`));
3640
- }
3641
- } catch (innererror) {
3642
- this.#LogErrorMessage(chalk.red(` could not get response config, error: [${innererror}]`));
3643
- }
3644
- } else {
3645
- this.#LogDebugMessage(chalk.red(`AXIOS Error = [${axiosError}]`));
3646
- }
3647
- }
3648
- return responseCode;
3649
- };
3650
- #TestMode = (metaData, errorCb) => {
3651
- const { id, url, httpVerb, filters, retries } = metaData;
3652
- if (retries < 1) {
3653
- errorCb(401, new Error(`Testing Error Only. Error Code: [401], Message ID: [${id}, url: [${url}], httpVerb: [${httpVerb}], filters: [${filters}], Retries: [${retries}]`));
3654
- return true;
3655
- }
3656
- if (retries < 2) {
3657
- errorCb(500, new Error(`Testing Error Only. Error Code: [500], Message ID: [${id}, url: [${url}], httpVerb: [${httpVerb}], filters: [${filters}], Retries: [${retries}]`));
3658
- return true;
3659
- }
3660
- return false;
3661
- };
3662
- #__InvokeResourceAPI = async (metaData, errorCb) => {
3663
- try {
3664
- const { url, httpVerb, resource, filters } = metaData;
3665
- if (this.#options.testingMode) {
3666
- if (this.#TestMode(metaData, errorCb)) {
3667
- return null;
3668
- }
3669
- }
3670
- let accessToken = null;
3671
- if (this.#accessToken) {
3672
- accessToken = this.#accessToken;
3673
- this.#accessToken = null;
3674
- } else {
3675
- accessToken = await this.#options.GetAccessToken();
3676
- }
3677
- let requestConfig = new stsutils.STSAxiosConfig(url, httpVerb).withDefaultHeaders().withAuthHeaders(accessToken, this.#DUMMY_USER);
3678
- if (!(httpVerb.localeCompare("get") === 0 || httpVerb.localeCompare("head") === 0)) {
3679
- requestConfig.withData(filters ? filters : resource ? resource : void 0);
3680
- }
3681
- if (isNode && this.#options.agentManager) {
3682
- requestConfig.withAgentManager(this.#options.agentManager);
3683
- }
3684
- return await axios(requestConfig.config);
3685
- } catch (error) {
3686
- const responseCode = this.HandleError(error);
3687
- errorCb(responseCode, error);
3688
- return null;
3689
- }
3690
- };
3691
- WithAccessToken = (accessToken) => {
3692
- this.#accessToken = accessToken;
3693
- return this;
3694
- };
3695
- WithNoRetries = () => {
3696
- this.#noRetries = true;
3697
- return this;
3698
- };
3699
- InvokeResourceAPI = async (url, httpVerb, resource, filters, searchParams, errorCb) => {
3700
- const id = v4();
3701
- this.#invokeMethods[id] = {
3702
- id,
3703
- retries: 0,
3704
- testFailIndexBefore: 1,
3705
- url,
3706
- httpVerb,
3707
- resource,
3708
- filters,
3709
- searchParams,
3710
- errorCb
3711
- };
3712
- let returnError = null;
3713
- const InvokeAPI = async (id2) => {
3714
- const metadataRecord = this.#invokeMethods[id2];
3715
- let performRetry = false;
3716
- const returnData = await this.#__InvokeResourceAPI(metadataRecord, (statusCode, error) => {
3717
- if (this.#noRetries === false) {
3718
- const noRetryIndex = this.#NoRetryStatusCodes.indexOf(statusCode);
3719
- if (noRetryIndex === -1) {
3720
- if (statusCode === StatusCodes.UNAUTHORIZED) {
3721
- this.#options.ResetAccessToken();
3722
- if (this.#options.clientTelemetryEvents) {
3723
- this.#options.clientTelemetryEvents.AuthenticationErrorInc();
3724
- }
3725
- }
3726
- if (isNode && this.#options.agentManager) {
3727
- this.#options.agentManager.ResetAgent();
3728
- }
3729
- performRetry = true;
3730
- } else {
3731
- returnError = error;
3732
- }
3733
- } else {
3734
- returnError = error;
3735
- this.#noRetries = false;
3736
- }
3737
- });
3738
- return {
3739
- response: returnData,
3740
- retry: performRetry
3741
- };
3742
- };
3743
- let retVal = null;
3744
- while (this.#invokeMethods[id].retries < this.#maxRetries) {
3745
- retVal = await InvokeAPI(id);
3746
- if (retVal.retry === false) {
3747
- delete this.#invokeMethods[id];
3748
- break;
3749
- } else {
3750
- await stsutils.Sleep(this.#sleepDuration[this.#invokeMethods[id].retries]);
3751
- this.#invokeMethods[id].retries++;
3752
- if (this.#options.clientTelemetryEvents) {
3753
- this.#options.clientTelemetryEvents.RetryInc();
3754
- }
3755
- }
3756
- }
3757
- if (retVal) {
3758
- if (retVal.retry === true) {
3759
- errorCb(new Error(`#InvokeResourceAPI(): Max retries exceeded. Max Retries: [${this.#invokeMethods[id].retries}]`));
3760
- delete this.#invokeMethods[id];
3761
- return null;
3762
- } else {
3763
- if (returnError) {
3764
- errorCb(returnError);
3765
- }
3766
- return retVal.response;
3767
- }
3768
- } else {
3769
- if (returnError) {
3770
- errorCb(returnError);
3771
- }
3772
- return null;
3773
- }
3774
- };
3775
- }
3776
- class STSRest01Client {
3777
- #axiosClient;
3778
- #options;
3779
- constructor(options) {
3780
- this.#options = options;
3781
- this.#axiosClient = new AxiosClient({
3782
- logger: options.logger,
3783
- testingMode: options.testingMode,
3784
- GetAccessToken: options.GetAccessToken,
3785
- ResetAccessToken: options.ResetAccessToken,
3786
- agentManager: options.agentManager,
3787
- clientTelemetryEvents: options.clientTelemetryEvents
3788
- });
3789
- }
3790
- HandleError = (error) => {
3791
- return this.#axiosClient.HandleError(error);
3792
- };
3793
- WithNoRetries = () => {
3794
- this.#axiosClient.WithNoRetries();
3795
- return this;
3796
- };
3797
- WithAccessToken = (accessToken) => {
3798
- this.#axiosClient.WithAccessToken(accessToken);
3799
- return this;
3800
- };
3801
- // --- [ Resource ] -------------------------------------------------------------------------------------------------------------------
3802
- // --- [ POST.Resource ] -------------------------------------------------------------------------------------------------------------------
3803
- PostResourceAR = async (resource, errorCb) => {
3804
- const url = `${this.#options.endpoint}${goptions.rest01apiroot}/resources`;
3805
- return await this.#axiosClient.InvokeResourceAPI(url, "post", resource, null, null, errorCb);
3806
- };
3807
- PostResourceDBR = async (resource, errorCb) => {
3808
- return (await this.PostResourceAR(resource, errorCb))?.data.detail ?? null;
3809
- };
3810
- PostResource = async (resource, errorCb) => {
3811
- return (await this.PostResourceDBR(resource, errorCb))?.resdesc ?? null;
3812
- };
3813
- // --- [ PUT.Resources ] ------------------------------------------------------------------------------------------------------------------
3814
- PutResourcesAR = async (resources, errorCb) => {
3815
- const url = `${this.#options.endpoint}${goptions.rest01apiroot}/resources`;
3816
- return await this.#axiosClient.InvokeResourceAPI(url, "put", resources, null, null, errorCb);
3817
- };
3818
- PutResourcesDBR = async (resources, errorCb) => {
3819
- return (await this.PutResourcesAR(resources, errorCb))?.data.map((r) => r.detail) ?? null;
3820
- };
3821
- PutResources = async (resources, errorCb) => {
3822
- return (await this.PutResourcesDBR(resources, errorCb))?.map((r) => r.resdesc) ?? null;
3823
- };
3824
- // --- [ PUT.Resource ] -------------------------------------------------------------------------------------------------------------------
3825
- PutResourceAR = async (resource, errorCb) => {
3826
- const url = `${this.#options.endpoint}${goptions.rest01apiroot}/resources/${resource.resname}`;
3827
- return this.#axiosClient.InvokeResourceAPI(url, "put", resource, null, null, errorCb);
3828
- };
3829
- PutResourceDBR = async (resource, errorCb) => {
3830
- return (await this.PutResourceAR(resource, errorCb))?.data.detail ?? null;
3831
- };
3832
- PutResource = async (resource, errorCb) => {
3833
- return (await this.PutResourceDBR(resource, errorCb))?.resdesc ?? null;
3834
- };
3835
- // --- [ PATCH.Resources ] ------------------------------------------------------------------------------------------------------------------
3836
- PatchResourcesAR = async (resources, errorCb) => {
3837
- const url = `${this.#options.endpoint}${goptions.rest01apiroot}/resources`;
3838
- return await this.#axiosClient.InvokeResourceAPI(url, "patch", resources, null, null, errorCb);
3839
- };
3840
- PatchResourcesDBR = async (resources, errorCb) => {
3841
- return (await this.PatchResourcesAR(resources, errorCb))?.data.map((r) => r.detail) ?? null;
3842
- };
3843
- PatchResources = async (resources, errorCb) => {
3844
- return (await this.PatchResourcesDBR(resources, errorCb))?.map((r) => r.resdesc) ?? null;
3845
- };
3846
- // --- [ PATCH.Resource ] -------------------------------------------------------------------------------------------------------------------
3847
- PatchResourceAR = async (resource, errorCb) => {
3848
- const url = `${this.#options.endpoint}${goptions.rest01apiroot}/resources/${resource.resname}`;
3849
- return this.#axiosClient.InvokeResourceAPI(url, "patch", resource, null, null, errorCb);
3850
- };
3851
- PatchResourceDBR = async (resource, errorCb) => {
3852
- return (await this.PatchResourceAR(resource, errorCb))?.data.detail ?? null;
3853
- };
3854
- PatchResource = async (resource, errorCb) => {
3855
- return (await this.PatchResourceDBR(resource, errorCb))?.resdesc ?? null;
3856
- };
3857
- // --- [ DELETE.Resources ] -------------------------------------------------------------------------------------------------------------------
3858
- DeleteResourcesAR = async (resources, errorCb) => {
3859
- const url = `${this.#options.endpoint}${goptions.rest01apiroot}/resources`;
3860
- return await this.#axiosClient.InvokeResourceAPI(url, "delete", resources, null, null, errorCb);
3861
- };
3862
- DeleteResourcesDBR = async (resources, errorCb) => {
3863
- return (await this.DeleteResourcesAR(resources, errorCb))?.data.map((r) => r.detail) ?? null;
3864
- };
3865
- DeleteResources = async (resources, errorCb) => {
3866
- return (await this.DeleteResourcesDBR(resources, errorCb))?.map((r) => r.resdesc) ?? null;
3867
- };
3868
- // --- [ DELETE.Resource ] -------------------------------------------------------------------------------------------------------------------
3869
- DeleteResourceAR = async (resource, errorCb) => {
3870
- const url = `${this.#options.endpoint}${goptions.rest01apiroot}/resources/${resource.resname}`;
3871
- return this.#axiosClient.InvokeResourceAPI(url, "delete", resource, null, null, errorCb);
3872
- };
3873
- DeleteResourceDBR = async (resource, errorCb) => {
3874
- return (await this.DeleteResourceAR(resource, errorCb))?.data.detail ?? null;
3875
- };
3876
- DeleteResource = async (resource, errorCb) => {
3877
- return (await this.DeleteResourceDBR(resource, errorCb))?.resdesc ?? null;
3878
- };
3879
- // --- [ GET.Resource ] -------------------------------------------------------------------------------------------------------------------
3880
- GetResourceAR = async (resource, filters, errorCb) => {
3881
- let url = `${this.#options.endpoint}${goptions.rest01apiroot}/resources/${resource.resname}`;
3882
- if (filters && filters.localeCompare("") !== 0) {
3883
- url = `${url}?${filters}`;
3884
- }
3885
- return this.#axiosClient.InvokeResourceAPI(url, "get", null, null, null, errorCb);
3886
- };
3887
- GetResourceDBR = async (resource, filters, errorCb) => {
3888
- return (await this.GetResourceAR(resource, filters, errorCb))?.data.detail ?? null;
3889
- };
3890
- GetResource = async (resource, filters, errorCb) => {
3891
- return (await this.GetResourceDBR(resource, filters, errorCb))?.resdesc ?? null;
3892
- };
3893
- // --- [ GET.Resources ] -------------------------------------------------------------------------------------------------------------------
3894
- GetResourcesAR = async (filters, errorCb) => {
3895
- let url = `${this.#options.endpoint}${goptions.rest01apiroot}/resources`;
3896
- if (filters && filters.localeCompare("") !== 0) {
3897
- url = `${url}?${filters}`;
3898
- }
3899
- return this.#axiosClient.InvokeResourceAPI(url, "get", null, null, null, errorCb);
3900
- };
3901
- GetResourcesDBR = async (filters, errorCb) => {
3902
- return (await this.GetResourcesAR(filters, errorCb))?.data.detail ?? null;
3903
- };
3904
- GetResources = async (filters, errorCb) => {
3905
- return (await this.GetResourcesDBR(filters, errorCb))?.map((r) => r.resdesc) ?? null;
3906
- };
3907
- // --- [ Entity ] -------------------------------------------------------------------------------------------------------------------
3908
- #checkResName = (resourceEntities) => {
3909
- let resName = "";
3910
- resourceEntities.forEach((re) => {
3911
- resName = resName.localeCompare("") === 0 ? re.resname : resName;
3912
- if (resName.localeCompare(re.resname) !== 0) {
3913
- throw new Error(`Invalid batch provided. resname not all equal. Previous checked value: [${resName}, current value: [${re.resname}]`);
3914
- } else {
3915
- resName = re.resname;
3916
- }
3917
- });
3918
- return resName;
3919
- };
3920
- // --- [ POST.Entitiy ] -------------------------------------------------------------------------------------------------------------------
3921
- PostEntityAR = async (resourceEntity, errorCb) => {
3922
- const url = `${this.#options.endpoint}${goptions.rest01apiroot}/resources/${resourceEntity.resname}/entities`;
3923
- return this.#axiosClient.InvokeResourceAPI(url, "post", resourceEntity, null, null, errorCb);
3924
- };
3925
- PostEntityDBR = async (resourceEntity, errorCb) => {
3926
- return (await this.PostEntityAR(resourceEntity, errorCb))?.data.detail ?? null;
3927
- };
3928
- PostEntity = async (resourceEntity, errorCb) => {
3929
- return (await this.PostEntityDBR(resourceEntity, errorCb))?.entvalue ?? null;
3930
- };
3931
- // --- [ PUT.Entities ] -----------------------------------------------------------------------------------------------------------------
3932
- PutEntitiesAR = async (resourceEntities, errorCb) => {
3933
- const url = `${this.#options.endpoint}${goptions.rest01apiroot}/resources/${this.#checkResName(resourceEntities)}/entities`;
3934
- return this.#axiosClient.InvokeResourceAPI(url, "put", resourceEntities, null, null, errorCb);
3935
- };
3936
- PutEntitiesDBR = async (resourceEntities, errorCb) => {
3937
- return (await this.PutEntitiesAR(resourceEntities, errorCb))?.data.map((r) => r.detail) ?? null;
3938
- };
3939
- PutEntities = async (resourceEntities, errorCb) => {
3940
- return (await this.PutEntitiesDBR(resourceEntities, errorCb))?.map((r) => r.entvalue) ?? null;
3941
- };
3942
- // --- [ PUT.Entity ] -------------------------------------------------------------------------------------------------------------------
3943
- PutEntityAR = async (entity, errorCb) => {
3944
- const url = `${this.#options.endpoint}${goptions.rest01apiroot}/resources/${entity.resname}/entities/${entity.entname}`;
3945
- return this.#axiosClient.InvokeResourceAPI(url, "put", entity, null, null, errorCb);
3946
- };
3947
- PutEntityDBR = async (resourceEntity, errorCb) => {
3948
- return (await this.PutEntityAR(resourceEntity, errorCb))?.data.detail ?? null;
3949
- };
3950
- PutEntity = async (resourceEntity, errorCb) => {
3951
- return (await this.PutEntityDBR(resourceEntity, errorCb))?.entvalue ?? null;
3952
- };
3953
- // --- [ PATCH.Entities ] -----------------------------------------------------------------------------------------------------------------
3954
- PatchEntitiesAR = async (resourceEntities, errorCb) => {
3955
- const url = `${this.#options.endpoint}${goptions.rest01apiroot}/resources/${this.#checkResName(resourceEntities)}/entities`;
3956
- return this.#axiosClient.InvokeResourceAPI(url, "patch", resourceEntities, null, null, errorCb);
3957
- };
3958
- PatchEntitiesDBR = async (resourceEntities, errorCb) => {
3959
- return (await this.PatchEntitiesAR(resourceEntities, errorCb))?.data.map((r) => r.detail) ?? null;
3960
- };
3961
- PatchEntities = async (resourceEntities, errorCb) => {
3962
- return (await this.PatchEntitiesDBR(resourceEntities, errorCb))?.map((r) => r.entvalue) ?? null;
3963
- };
3964
- // --- [ PATCH.Entity ] -------------------------------------------------------------------------------------------------------------------
3965
- PatchEntityAR = async (resourceEntity, errorCb) => {
3966
- const url = `${this.#options.endpoint}${goptions.rest01apiroot}/resources/${resourceEntity.resname}/entities/${resourceEntity.entname}`;
3967
- return this.#axiosClient.InvokeResourceAPI(url, "patch", resourceEntity, null, null, errorCb);
3968
- };
3969
- PatchEntityDBR = async (resourceEntity, errorCb) => {
3970
- return (await this.PatchEntityAR(resourceEntity, errorCb))?.data.detail ?? null;
3971
- };
3972
- PatchEntity = async (resourceEntity, errorCb) => {
3973
- return (await this.PatchEntityDBR(resourceEntity, errorCb))?.entvalue ?? null;
3974
- };
3975
- // --- [ DELETE.Entity ] -------------------------------------------------------------------------------------------------------------------
3976
- DeleteEntitiesAR = async (resourceEntities, errorCb) => {
3977
- const url = `${this.#options.endpoint}${goptions.rest01apiroot}/resources/${this.#checkResName(resourceEntities)}/entities`;
3978
- return this.#axiosClient.InvokeResourceAPI(url, "delete", resourceEntities, null, null, errorCb);
3979
- };
3980
- DeleteEntitiesDBR = async (resourceEntities, errorCb) => {
3981
- return (await this.DeleteEntitiesAR(resourceEntities, errorCb))?.data.map((r) => r.detail) ?? null;
3982
- };
3983
- DeleteEntities = async (resourceEntities, errorCb) => {
3984
- return (await this.DeleteEntitiesDBR(resourceEntities, errorCb))?.map((r) => r.entvalue) ?? null;
3985
- };
3986
- // --- [ DELETE.Entity ] -------------------------------------------------------------------------------------------------------------------
3987
- DeleteEntityAR = async (resourceEntity, errorCb) => {
3988
- const url = `${this.#options.endpoint}${goptions.rest01apiroot}/resources/${resourceEntity.resname}/entities/${resourceEntity.entname}`;
3989
- return this.#axiosClient.InvokeResourceAPI(url, "delete", resourceEntity, null, null, errorCb);
3990
- };
3991
- DeleteEntityDBR = async (resourceEntity, errorCb) => {
3992
- return (await this.DeleteEntityAR(resourceEntity, errorCb))?.data.detail ?? null;
3993
- };
3994
- DeleteEntity = async (resourceEntity, errorCb) => {
3995
- return (await this.DeleteEntityDBR(resourceEntity, errorCb))?.entvalue ?? null;
3996
- };
3997
- // --- [ GET.Entity ] -------------------------------------------------------------------------------------------------------------------
3998
- GetEntityAR = async (resourceEntity, filters, errorCb) => {
3999
- let url = `${this.#options.endpoint}${goptions.rest01apiroot}/resources/${resourceEntity.resname}/entities/${resourceEntity.entname}`;
4000
- if (filters && filters.localeCompare("") !== 0) {
4001
- url = `${url}?${filters}`;
4002
- }
4003
- return this.#axiosClient.InvokeResourceAPI(url, "get", null, null, null, errorCb);
4004
- };
4005
- GetEntityDBR = async (resourceEntity, filters, errorCb) => {
4006
- return (await this.GetEntityAR(resourceEntity, filters, errorCb))?.data.detail ?? null;
4007
- };
4008
- GetEntity = async (resourceEntity, filters, errorCb) => {
4009
- return (await this.GetEntityDBR(resourceEntity, filters, errorCb))?.entvalue ?? null;
4010
- };
4011
- // --- [ GET.Entities ] -------------------------------------------------------------------------------------------------------------------
4012
- GetEntitiesAR = async (resource, filters, errorCb) => {
4013
- let url = `${this.#options.endpoint}${goptions.rest01apiroot}/resources/${resource.resname}/entities`;
4014
- if (filters && filters.localeCompare("") !== 0) {
4015
- url = `${url}?${filters}`;
4016
- }
4017
- return this.#axiosClient.InvokeResourceAPI(url, "get", null, null, null, errorCb);
4018
- };
4019
- GetEntitiesDBR = async (resource, filters, errorCb) => {
4020
- return (await this.GetEntitiesAR(resource, filters, errorCb))?.data.detail ?? null;
4021
- };
4022
- GetEntities = async (resource, filters, errorCb) => {
4023
- return (await this.GetEntitiesDBR(resource, filters, errorCb))?.map((r) => r.entvalue) ?? null;
4024
- };
4025
- }
4026
- exports2.AxiosClient = AxiosClient;
4027
- exports2.STSRest01Client = STSRest01Client;
4028
- Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
4029
- }));
4030
- //# sourceMappingURL=stsrest01client.umd.js.map