@nsshunt/stsoauth2plugin 1.0.72 → 1.0.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/stsoauth2plugin.mjs +167 -3649
- package/dist/stsoauth2plugin.mjs.map +1 -1
- package/dist/stsoauth2plugin.umd.js +170 -3652
- package/dist/stsoauth2plugin.umd.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(global2, factory) {
|
|
2
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("vue"), require("node:worker_threads"), require("@nsshunt/stsutils"), require("@nsshunt/stsvueutils"), require("pinia"), require("
|
|
3
|
-
})(this, function(exports2, vue, wt, stsutils, stsvueutils, pinia, https, axios) {
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("vue"), require("node:worker_threads"), require("@nsshunt/stsutils"), require("@nsshunt/stsvueutils"), require("pinia"), require("@nsshunt/stsobservability"), require("node:https"), require("colors"), require("axios")) : typeof define === "function" && define.amd ? define(["exports", "vue", "node:worker_threads", "@nsshunt/stsutils", "@nsshunt/stsvueutils", "pinia", "@nsshunt/stsobservability", "node:https", "colors", "axios"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2["@nsshunt/stsoauth2plugin"] = {}, global2.vue, global2.worker_threads, global2.stsutils, global2.stsvueutils, global2.pinia, global2.stsobservability, global2.https, null, global2.axios));
|
|
3
|
+
})(this, function(exports2, vue, wt, stsutils, stsvueutils, pinia, stsobservability, https, colors, axios) {
|
|
4
4
|
"use strict";var __defProp = Object.defineProperty;
|
|
5
5
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
6
|
var __publicField = (obj, key, value) => {
|
|
@@ -57,7 +57,7 @@ var __privateMethod = (obj, member, method) => {
|
|
|
57
57
|
}
|
|
58
58
|
const wt__namespace = /* @__PURE__ */ _interopNamespaceDefault(wt);
|
|
59
59
|
const STSOAuth2ManagerPluginKey = Symbol();
|
|
60
|
-
var commonjsGlobal
|
|
60
|
+
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
61
61
|
function getDefaultExportFromCjs(x) {
|
|
62
62
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
63
63
|
}
|
|
@@ -87,14 +87,14 @@ var __privateMethod = (obj, member, method) => {
|
|
|
87
87
|
});
|
|
88
88
|
return a;
|
|
89
89
|
}
|
|
90
|
-
var ansiStyles$
|
|
91
|
-
var colorName
|
|
92
|
-
var hasRequiredColorName
|
|
93
|
-
function requireColorName
|
|
94
|
-
if (hasRequiredColorName
|
|
95
|
-
return colorName
|
|
96
|
-
hasRequiredColorName
|
|
97
|
-
colorName
|
|
90
|
+
var ansiStyles$1 = { exports: {} };
|
|
91
|
+
var colorName;
|
|
92
|
+
var hasRequiredColorName;
|
|
93
|
+
function requireColorName() {
|
|
94
|
+
if (hasRequiredColorName)
|
|
95
|
+
return colorName;
|
|
96
|
+
hasRequiredColorName = 1;
|
|
97
|
+
colorName = {
|
|
98
98
|
"aliceblue": [240, 248, 255],
|
|
99
99
|
"antiquewhite": [250, 235, 215],
|
|
100
100
|
"aqua": [0, 255, 255],
|
|
@@ -244,15 +244,15 @@ var __privateMethod = (obj, member, method) => {
|
|
|
244
244
|
"yellow": [255, 255, 0],
|
|
245
245
|
"yellowgreen": [154, 205, 50]
|
|
246
246
|
};
|
|
247
|
-
return colorName
|
|
247
|
+
return colorName;
|
|
248
248
|
}
|
|
249
|
-
var conversions
|
|
250
|
-
var hasRequiredConversions
|
|
251
|
-
function requireConversions
|
|
252
|
-
if (hasRequiredConversions
|
|
253
|
-
return conversions
|
|
254
|
-
hasRequiredConversions
|
|
255
|
-
const cssKeywords = requireColorName
|
|
249
|
+
var conversions;
|
|
250
|
+
var hasRequiredConversions;
|
|
251
|
+
function requireConversions() {
|
|
252
|
+
if (hasRequiredConversions)
|
|
253
|
+
return conversions;
|
|
254
|
+
hasRequiredConversions = 1;
|
|
255
|
+
const cssKeywords = requireColorName();
|
|
256
256
|
const reverseKeywords = {};
|
|
257
257
|
for (const key of Object.keys(cssKeywords)) {
|
|
258
258
|
reverseKeywords[cssKeywords[key]] = key;
|
|
@@ -274,7 +274,7 @@ var __privateMethod = (obj, member, method) => {
|
|
|
274
274
|
apple: { channels: 3, labels: ["r16", "g16", "b16"] },
|
|
275
275
|
gray: { channels: 1, labels: ["gray"] }
|
|
276
276
|
};
|
|
277
|
-
conversions
|
|
277
|
+
conversions = convert;
|
|
278
278
|
for (const model of Object.keys(convert)) {
|
|
279
279
|
if (!("channels" in convert[model])) {
|
|
280
280
|
throw new Error("missing channels property: " + model);
|
|
@@ -917,15 +917,15 @@ var __privateMethod = (obj, member, method) => {
|
|
|
917
917
|
const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
918
918
|
return [val / 255 * 100];
|
|
919
919
|
};
|
|
920
|
-
return conversions
|
|
920
|
+
return conversions;
|
|
921
921
|
}
|
|
922
|
-
var route
|
|
923
|
-
var hasRequiredRoute
|
|
924
|
-
function requireRoute
|
|
925
|
-
if (hasRequiredRoute
|
|
926
|
-
return route
|
|
927
|
-
hasRequiredRoute
|
|
928
|
-
const conversions2 = requireConversions
|
|
922
|
+
var route;
|
|
923
|
+
var hasRequiredRoute;
|
|
924
|
+
function requireRoute() {
|
|
925
|
+
if (hasRequiredRoute)
|
|
926
|
+
return route;
|
|
927
|
+
hasRequiredRoute = 1;
|
|
928
|
+
const conversions2 = requireConversions();
|
|
929
929
|
function buildGraph() {
|
|
930
930
|
const graph = {};
|
|
931
931
|
const models = Object.keys(conversions2);
|
|
@@ -975,7 +975,7 @@ var __privateMethod = (obj, member, method) => {
|
|
|
975
975
|
fn.conversion = path;
|
|
976
976
|
return fn;
|
|
977
977
|
}
|
|
978
|
-
route
|
|
978
|
+
route = function(fromModel) {
|
|
979
979
|
const graph = deriveBFS(fromModel);
|
|
980
980
|
const conversion = {};
|
|
981
981
|
const models = Object.keys(graph);
|
|
@@ -989,16 +989,16 @@ var __privateMethod = (obj, member, method) => {
|
|
|
989
989
|
}
|
|
990
990
|
return conversion;
|
|
991
991
|
};
|
|
992
|
-
return route
|
|
992
|
+
return route;
|
|
993
993
|
}
|
|
994
|
-
var colorConvert
|
|
995
|
-
var hasRequiredColorConvert
|
|
996
|
-
function requireColorConvert
|
|
997
|
-
if (hasRequiredColorConvert
|
|
998
|
-
return colorConvert
|
|
999
|
-
hasRequiredColorConvert
|
|
1000
|
-
const conversions2 = requireConversions
|
|
1001
|
-
const route2 = requireRoute
|
|
994
|
+
var colorConvert;
|
|
995
|
+
var hasRequiredColorConvert;
|
|
996
|
+
function requireColorConvert() {
|
|
997
|
+
if (hasRequiredColorConvert)
|
|
998
|
+
return colorConvert;
|
|
999
|
+
hasRequiredColorConvert = 1;
|
|
1000
|
+
const conversions2 = requireConversions();
|
|
1001
|
+
const route2 = requireRoute();
|
|
1002
1002
|
const convert = {};
|
|
1003
1003
|
const models = Object.keys(conversions2);
|
|
1004
1004
|
function wrapRaw(fn) {
|
|
@@ -1051,10 +1051,10 @@ var __privateMethod = (obj, member, method) => {
|
|
|
1051
1051
|
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
1052
1052
|
});
|
|
1053
1053
|
});
|
|
1054
|
-
colorConvert
|
|
1055
|
-
return colorConvert
|
|
1054
|
+
colorConvert = convert;
|
|
1055
|
+
return colorConvert;
|
|
1056
1056
|
}
|
|
1057
|
-
ansiStyles$
|
|
1057
|
+
ansiStyles$1.exports;
|
|
1058
1058
|
(function(module2) {
|
|
1059
1059
|
const wrapAnsi16 = (fn, offset) => (...args) => {
|
|
1060
1060
|
const code = fn(...args);
|
|
@@ -1088,7 +1088,7 @@ var __privateMethod = (obj, member, method) => {
|
|
|
1088
1088
|
let colorConvert2;
|
|
1089
1089
|
const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
|
|
1090
1090
|
if (colorConvert2 === void 0) {
|
|
1091
|
-
colorConvert2 = requireColorConvert
|
|
1091
|
+
colorConvert2 = requireColorConvert();
|
|
1092
1092
|
}
|
|
1093
1093
|
const offset = isBackground ? 10 : 0;
|
|
1094
1094
|
const styles2 = {};
|
|
@@ -1191,13 +1191,13 @@ var __privateMethod = (obj, member, method) => {
|
|
|
1191
1191
|
enumerable: true,
|
|
1192
1192
|
get: assembleStyles
|
|
1193
1193
|
});
|
|
1194
|
-
})(ansiStyles$
|
|
1195
|
-
var ansiStylesExports
|
|
1196
|
-
var browser
|
|
1194
|
+
})(ansiStyles$1);
|
|
1195
|
+
var ansiStylesExports = ansiStyles$1.exports;
|
|
1196
|
+
var browser = {
|
|
1197
1197
|
stdout: false,
|
|
1198
1198
|
stderr: false
|
|
1199
1199
|
};
|
|
1200
|
-
const stringReplaceAll$
|
|
1200
|
+
const stringReplaceAll$1 = (string, substring, replacer) => {
|
|
1201
1201
|
let index = string.indexOf(substring);
|
|
1202
1202
|
if (index === -1) {
|
|
1203
1203
|
return string;
|
|
@@ -1213,7 +1213,7 @@ var __privateMethod = (obj, member, method) => {
|
|
|
1213
1213
|
returnValue += string.substr(endIndex);
|
|
1214
1214
|
return returnValue;
|
|
1215
1215
|
};
|
|
1216
|
-
const stringEncaseCRLFWithFirstIndex$
|
|
1216
|
+
const stringEncaseCRLFWithFirstIndex$1 = (string, prefix, postfix, index) => {
|
|
1217
1217
|
let endIndex = 0;
|
|
1218
1218
|
let returnValue = "";
|
|
1219
1219
|
do {
|
|
@@ -1225,16 +1225,16 @@ var __privateMethod = (obj, member, method) => {
|
|
|
1225
1225
|
returnValue += string.substr(endIndex);
|
|
1226
1226
|
return returnValue;
|
|
1227
1227
|
};
|
|
1228
|
-
var util
|
|
1229
|
-
stringReplaceAll: stringReplaceAll$
|
|
1230
|
-
stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex$
|
|
1228
|
+
var util = {
|
|
1229
|
+
stringReplaceAll: stringReplaceAll$1,
|
|
1230
|
+
stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex$1
|
|
1231
1231
|
};
|
|
1232
|
-
var templates
|
|
1233
|
-
var hasRequiredTemplates
|
|
1234
|
-
function requireTemplates
|
|
1235
|
-
if (hasRequiredTemplates
|
|
1236
|
-
return templates
|
|
1237
|
-
hasRequiredTemplates
|
|
1232
|
+
var templates;
|
|
1233
|
+
var hasRequiredTemplates;
|
|
1234
|
+
function requireTemplates() {
|
|
1235
|
+
if (hasRequiredTemplates)
|
|
1236
|
+
return templates;
|
|
1237
|
+
hasRequiredTemplates = 1;
|
|
1238
1238
|
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;
|
|
1239
1239
|
const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
|
1240
1240
|
const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
|
|
@@ -1312,7 +1312,7 @@ var __privateMethod = (obj, member, method) => {
|
|
|
1312
1312
|
}
|
|
1313
1313
|
return current;
|
|
1314
1314
|
}
|
|
1315
|
-
templates
|
|
1315
|
+
templates = (chalk2, temporary) => {
|
|
1316
1316
|
const styles2 = [];
|
|
1317
1317
|
const chunks = [];
|
|
1318
1318
|
let chunk = [];
|
|
@@ -1342,92 +1342,92 @@ var __privateMethod = (obj, member, method) => {
|
|
|
1342
1342
|
}
|
|
1343
1343
|
return chunks.join("");
|
|
1344
1344
|
};
|
|
1345
|
-
return templates
|
|
1345
|
+
return templates;
|
|
1346
1346
|
}
|
|
1347
|
-
const ansiStyles
|
|
1348
|
-
const { stdout: stdoutColor
|
|
1347
|
+
const ansiStyles = ansiStylesExports;
|
|
1348
|
+
const { stdout: stdoutColor, stderr: stderrColor } = browser;
|
|
1349
1349
|
const {
|
|
1350
|
-
stringReplaceAll
|
|
1351
|
-
stringEncaseCRLFWithFirstIndex
|
|
1352
|
-
} = util
|
|
1353
|
-
const { isArray
|
|
1354
|
-
const levelMapping
|
|
1350
|
+
stringReplaceAll,
|
|
1351
|
+
stringEncaseCRLFWithFirstIndex
|
|
1352
|
+
} = util;
|
|
1353
|
+
const { isArray } = Array;
|
|
1354
|
+
const levelMapping = [
|
|
1355
1355
|
"ansi",
|
|
1356
1356
|
"ansi",
|
|
1357
1357
|
"ansi256",
|
|
1358
1358
|
"ansi16m"
|
|
1359
1359
|
];
|
|
1360
|
-
const styles
|
|
1361
|
-
const applyOptions
|
|
1360
|
+
const styles = /* @__PURE__ */ Object.create(null);
|
|
1361
|
+
const applyOptions = (object, options = {}) => {
|
|
1362
1362
|
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
1363
1363
|
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
1364
1364
|
}
|
|
1365
|
-
const colorLevel = stdoutColor
|
|
1365
|
+
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
1366
1366
|
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
1367
1367
|
};
|
|
1368
|
-
|
|
1368
|
+
class ChalkClass {
|
|
1369
1369
|
constructor(options) {
|
|
1370
|
-
return chalkFactory
|
|
1370
|
+
return chalkFactory(options);
|
|
1371
1371
|
}
|
|
1372
|
-
}
|
|
1373
|
-
const chalkFactory
|
|
1372
|
+
}
|
|
1373
|
+
const chalkFactory = (options) => {
|
|
1374
1374
|
const chalk2 = {};
|
|
1375
|
-
applyOptions
|
|
1376
|
-
chalk2.template = (...arguments_) => chalkTag
|
|
1377
|
-
Object.setPrototypeOf(chalk2, Chalk
|
|
1375
|
+
applyOptions(chalk2, options);
|
|
1376
|
+
chalk2.template = (...arguments_) => chalkTag(chalk2.template, ...arguments_);
|
|
1377
|
+
Object.setPrototypeOf(chalk2, Chalk.prototype);
|
|
1378
1378
|
Object.setPrototypeOf(chalk2.template, chalk2);
|
|
1379
1379
|
chalk2.template.constructor = () => {
|
|
1380
1380
|
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
1381
1381
|
};
|
|
1382
|
-
chalk2.template.Instance = ChalkClass
|
|
1382
|
+
chalk2.template.Instance = ChalkClass;
|
|
1383
1383
|
return chalk2.template;
|
|
1384
1384
|
};
|
|
1385
|
-
function Chalk
|
|
1386
|
-
return chalkFactory
|
|
1385
|
+
function Chalk(options) {
|
|
1386
|
+
return chalkFactory(options);
|
|
1387
1387
|
}
|
|
1388
|
-
for (const [styleName, style] of Object.entries(ansiStyles
|
|
1389
|
-
styles
|
|
1388
|
+
for (const [styleName, style] of Object.entries(ansiStyles)) {
|
|
1389
|
+
styles[styleName] = {
|
|
1390
1390
|
get() {
|
|
1391
|
-
const builder = createBuilder
|
|
1391
|
+
const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
|
|
1392
1392
|
Object.defineProperty(this, styleName, { value: builder });
|
|
1393
1393
|
return builder;
|
|
1394
1394
|
}
|
|
1395
1395
|
};
|
|
1396
1396
|
}
|
|
1397
|
-
styles
|
|
1397
|
+
styles.visible = {
|
|
1398
1398
|
get() {
|
|
1399
|
-
const builder = createBuilder
|
|
1399
|
+
const builder = createBuilder(this, this._styler, true);
|
|
1400
1400
|
Object.defineProperty(this, "visible", { value: builder });
|
|
1401
1401
|
return builder;
|
|
1402
1402
|
}
|
|
1403
1403
|
};
|
|
1404
|
-
const usedModels
|
|
1405
|
-
for (const model of usedModels
|
|
1406
|
-
styles
|
|
1404
|
+
const usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
|
|
1405
|
+
for (const model of usedModels) {
|
|
1406
|
+
styles[model] = {
|
|
1407
1407
|
get() {
|
|
1408
1408
|
const { level } = this;
|
|
1409
1409
|
return function(...arguments_) {
|
|
1410
|
-
const styler = createStyler
|
|
1411
|
-
return createBuilder
|
|
1410
|
+
const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
|
|
1411
|
+
return createBuilder(this, styler, this._isEmpty);
|
|
1412
1412
|
};
|
|
1413
1413
|
}
|
|
1414
1414
|
};
|
|
1415
1415
|
}
|
|
1416
|
-
for (const model of usedModels
|
|
1416
|
+
for (const model of usedModels) {
|
|
1417
1417
|
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
1418
|
-
styles
|
|
1418
|
+
styles[bgModel] = {
|
|
1419
1419
|
get() {
|
|
1420
1420
|
const { level } = this;
|
|
1421
1421
|
return function(...arguments_) {
|
|
1422
|
-
const styler = createStyler
|
|
1423
|
-
return createBuilder
|
|
1422
|
+
const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
|
|
1423
|
+
return createBuilder(this, styler, this._isEmpty);
|
|
1424
1424
|
};
|
|
1425
1425
|
}
|
|
1426
1426
|
};
|
|
1427
1427
|
}
|
|
1428
|
-
const proto
|
|
1428
|
+
const proto = Object.defineProperties(() => {
|
|
1429
1429
|
}, {
|
|
1430
|
-
...styles
|
|
1430
|
+
...styles,
|
|
1431
1431
|
level: {
|
|
1432
1432
|
enumerable: true,
|
|
1433
1433
|
get() {
|
|
@@ -1438,7 +1438,7 @@ var __privateMethod = (obj, member, method) => {
|
|
|
1438
1438
|
}
|
|
1439
1439
|
}
|
|
1440
1440
|
});
|
|
1441
|
-
const createStyler
|
|
1441
|
+
const createStyler = (open, close, parent) => {
|
|
1442
1442
|
let openAll;
|
|
1443
1443
|
let closeAll;
|
|
1444
1444
|
if (parent === void 0) {
|
|
@@ -1456,20 +1456,20 @@ var __privateMethod = (obj, member, method) => {
|
|
|
1456
1456
|
parent
|
|
1457
1457
|
};
|
|
1458
1458
|
};
|
|
1459
|
-
const createBuilder
|
|
1459
|
+
const createBuilder = (self2, _styler, _isEmpty) => {
|
|
1460
1460
|
const builder = (...arguments_) => {
|
|
1461
|
-
if (isArray
|
|
1462
|
-
return applyStyle
|
|
1461
|
+
if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
|
|
1462
|
+
return applyStyle(builder, chalkTag(builder, ...arguments_));
|
|
1463
1463
|
}
|
|
1464
|
-
return applyStyle
|
|
1464
|
+
return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
1465
1465
|
};
|
|
1466
|
-
Object.setPrototypeOf(builder, proto
|
|
1466
|
+
Object.setPrototypeOf(builder, proto);
|
|
1467
1467
|
builder._generator = self2;
|
|
1468
1468
|
builder._styler = _styler;
|
|
1469
1469
|
builder._isEmpty = _isEmpty;
|
|
1470
1470
|
return builder;
|
|
1471
1471
|
};
|
|
1472
|
-
const applyStyle
|
|
1472
|
+
const applyStyle = (self2, string) => {
|
|
1473
1473
|
if (self2.level <= 0 || !string) {
|
|
1474
1474
|
return self2._isEmpty ? "" : string;
|
|
1475
1475
|
}
|
|
@@ -1480,20 +1480,20 @@ var __privateMethod = (obj, member, method) => {
|
|
|
1480
1480
|
const { openAll, closeAll } = styler;
|
|
1481
1481
|
if (string.indexOf("\x1B") !== -1) {
|
|
1482
1482
|
while (styler !== void 0) {
|
|
1483
|
-
string = stringReplaceAll
|
|
1483
|
+
string = stringReplaceAll(string, styler.close, styler.open);
|
|
1484
1484
|
styler = styler.parent;
|
|
1485
1485
|
}
|
|
1486
1486
|
}
|
|
1487
1487
|
const lfIndex = string.indexOf("\n");
|
|
1488
1488
|
if (lfIndex !== -1) {
|
|
1489
|
-
string = stringEncaseCRLFWithFirstIndex
|
|
1489
|
+
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
1490
1490
|
}
|
|
1491
1491
|
return openAll + string + closeAll;
|
|
1492
1492
|
};
|
|
1493
|
-
let template
|
|
1494
|
-
const chalkTag
|
|
1493
|
+
let template;
|
|
1494
|
+
const chalkTag = (chalk2, ...strings) => {
|
|
1495
1495
|
const [firstString] = strings;
|
|
1496
|
-
if (!isArray
|
|
1496
|
+
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
1497
1497
|
return strings.join(" ");
|
|
1498
1498
|
}
|
|
1499
1499
|
const arguments_ = strings.slice(1);
|
|
@@ -1504,18 +1504,18 @@ var __privateMethod = (obj, member, method) => {
|
|
|
1504
1504
|
String(firstString.raw[i])
|
|
1505
1505
|
);
|
|
1506
1506
|
}
|
|
1507
|
-
if (template
|
|
1508
|
-
template
|
|
1507
|
+
if (template === void 0) {
|
|
1508
|
+
template = requireTemplates();
|
|
1509
1509
|
}
|
|
1510
|
-
return template
|
|
1510
|
+
return template(chalk2, parts.join(""));
|
|
1511
1511
|
};
|
|
1512
|
-
Object.defineProperties(Chalk
|
|
1513
|
-
const chalk
|
|
1514
|
-
chalk
|
|
1515
|
-
chalk
|
|
1516
|
-
chalk
|
|
1517
|
-
var source = chalk
|
|
1518
|
-
const chalk$
|
|
1512
|
+
Object.defineProperties(Chalk.prototype, styles);
|
|
1513
|
+
const chalk = Chalk();
|
|
1514
|
+
chalk.supportsColor = stdoutColor;
|
|
1515
|
+
chalk.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
1516
|
+
chalk.stderr.supportsColor = stderrColor;
|
|
1517
|
+
var source = chalk;
|
|
1518
|
+
const chalk$1 = /* @__PURE__ */ getDefaultExportFromCjs(source);
|
|
1519
1519
|
const isNode = Object.prototype.toString.call(typeof process !== "undefined" ? process : 0) === "[object process]";
|
|
1520
1520
|
var sha256$1 = { exports: {} };
|
|
1521
1521
|
function commonjsRequire(path) {
|
|
@@ -1538,7 +1538,7 @@ var __privateMethod = (obj, member, method) => {
|
|
|
1538
1538
|
{
|
|
1539
1539
|
module2.exports = factory();
|
|
1540
1540
|
}
|
|
1541
|
-
})(commonjsGlobal
|
|
1541
|
+
})(commonjsGlobal, function() {
|
|
1542
1542
|
var CryptoJS = CryptoJS || function(Math2, undefined$1) {
|
|
1543
1543
|
var crypto2;
|
|
1544
1544
|
if (typeof window !== "undefined" && window.crypto) {
|
|
@@ -1553,8 +1553,8 @@ var __privateMethod = (obj, member, method) => {
|
|
|
1553
1553
|
if (!crypto2 && typeof window !== "undefined" && window.msCrypto) {
|
|
1554
1554
|
crypto2 = window.msCrypto;
|
|
1555
1555
|
}
|
|
1556
|
-
if (!crypto2 && typeof commonjsGlobal
|
|
1557
|
-
crypto2 = commonjsGlobal
|
|
1556
|
+
if (!crypto2 && typeof commonjsGlobal !== "undefined" && commonjsGlobal.crypto) {
|
|
1557
|
+
crypto2 = commonjsGlobal.crypto;
|
|
1558
1558
|
}
|
|
1559
1559
|
if (!crypto2 && typeof commonjsRequire === "function") {
|
|
1560
1560
|
try {
|
|
@@ -2140,7 +2140,7 @@ var __privateMethod = (obj, member, method) => {
|
|
|
2140
2140
|
{
|
|
2141
2141
|
module2.exports = factory(requireCore());
|
|
2142
2142
|
}
|
|
2143
|
-
})(commonjsGlobal
|
|
2143
|
+
})(commonjsGlobal, function(CryptoJS) {
|
|
2144
2144
|
(function(Math2) {
|
|
2145
2145
|
var C = CryptoJS;
|
|
2146
2146
|
var C_lib = C.lib;
|
|
@@ -2256,7 +2256,7 @@ var __privateMethod = (obj, member, method) => {
|
|
|
2256
2256
|
{
|
|
2257
2257
|
module2.exports = factory(requireCore());
|
|
2258
2258
|
}
|
|
2259
|
-
})(commonjsGlobal
|
|
2259
|
+
})(commonjsGlobal, function(CryptoJS) {
|
|
2260
2260
|
(function() {
|
|
2261
2261
|
var C = CryptoJS;
|
|
2262
2262
|
var C_lib = C.lib;
|
|
@@ -2546,3488 +2546,6 @@ var __privateMethod = (obj, member, method) => {
|
|
|
2546
2546
|
}
|
|
2547
2547
|
*/
|
|
2548
2548
|
});
|
|
2549
|
-
var lodash_clonedeep = { exports: {} };
|
|
2550
|
-
lodash_clonedeep.exports;
|
|
2551
|
-
(function(module2, exports3) {
|
|
2552
|
-
var LARGE_ARRAY_SIZE = 200;
|
|
2553
|
-
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
2554
|
-
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
2555
|
-
var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", promiseTag = "[object Promise]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", weakMapTag = "[object WeakMap]";
|
|
2556
|
-
var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
|
|
2557
|
-
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
2558
|
-
var reFlags = /\w*$/;
|
|
2559
|
-
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
2560
|
-
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
2561
|
-
var cloneableTags = {};
|
|
2562
|
-
cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
|
|
2563
|
-
cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
|
|
2564
|
-
var freeGlobal = typeof commonjsGlobal$1 == "object" && commonjsGlobal$1 && commonjsGlobal$1.Object === Object && commonjsGlobal$1;
|
|
2565
|
-
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
2566
|
-
var root = freeGlobal || freeSelf || Function("return this")();
|
|
2567
|
-
var freeExports = exports3 && !exports3.nodeType && exports3;
|
|
2568
|
-
var freeModule = freeExports && true && module2 && !module2.nodeType && module2;
|
|
2569
|
-
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
2570
|
-
function addMapEntry(map, pair) {
|
|
2571
|
-
map.set(pair[0], pair[1]);
|
|
2572
|
-
return map;
|
|
2573
|
-
}
|
|
2574
|
-
function addSetEntry(set, value) {
|
|
2575
|
-
set.add(value);
|
|
2576
|
-
return set;
|
|
2577
|
-
}
|
|
2578
|
-
function arrayEach(array, iteratee) {
|
|
2579
|
-
var index = -1, length = array ? array.length : 0;
|
|
2580
|
-
while (++index < length) {
|
|
2581
|
-
if (iteratee(array[index], index, array) === false) {
|
|
2582
|
-
break;
|
|
2583
|
-
}
|
|
2584
|
-
}
|
|
2585
|
-
return array;
|
|
2586
|
-
}
|
|
2587
|
-
function arrayPush(array, values) {
|
|
2588
|
-
var index = -1, length = values.length, offset = array.length;
|
|
2589
|
-
while (++index < length) {
|
|
2590
|
-
array[offset + index] = values[index];
|
|
2591
|
-
}
|
|
2592
|
-
return array;
|
|
2593
|
-
}
|
|
2594
|
-
function arrayReduce(array, iteratee, accumulator, initAccum) {
|
|
2595
|
-
var index = -1, length = array ? array.length : 0;
|
|
2596
|
-
if (initAccum && length) {
|
|
2597
|
-
accumulator = array[++index];
|
|
2598
|
-
}
|
|
2599
|
-
while (++index < length) {
|
|
2600
|
-
accumulator = iteratee(accumulator, array[index], index, array);
|
|
2601
|
-
}
|
|
2602
|
-
return accumulator;
|
|
2603
|
-
}
|
|
2604
|
-
function baseTimes(n, iteratee) {
|
|
2605
|
-
var index = -1, result = Array(n);
|
|
2606
|
-
while (++index < n) {
|
|
2607
|
-
result[index] = iteratee(index);
|
|
2608
|
-
}
|
|
2609
|
-
return result;
|
|
2610
|
-
}
|
|
2611
|
-
function getValue(object, key) {
|
|
2612
|
-
return object == null ? void 0 : object[key];
|
|
2613
|
-
}
|
|
2614
|
-
function isHostObject(value) {
|
|
2615
|
-
var result = false;
|
|
2616
|
-
if (value != null && typeof value.toString != "function") {
|
|
2617
|
-
try {
|
|
2618
|
-
result = !!(value + "");
|
|
2619
|
-
} catch (e) {
|
|
2620
|
-
}
|
|
2621
|
-
}
|
|
2622
|
-
return result;
|
|
2623
|
-
}
|
|
2624
|
-
function mapToArray(map) {
|
|
2625
|
-
var index = -1, result = Array(map.size);
|
|
2626
|
-
map.forEach(function(value, key) {
|
|
2627
|
-
result[++index] = [key, value];
|
|
2628
|
-
});
|
|
2629
|
-
return result;
|
|
2630
|
-
}
|
|
2631
|
-
function overArg(func, transform) {
|
|
2632
|
-
return function(arg) {
|
|
2633
|
-
return func(transform(arg));
|
|
2634
|
-
};
|
|
2635
|
-
}
|
|
2636
|
-
function setToArray(set) {
|
|
2637
|
-
var index = -1, result = Array(set.size);
|
|
2638
|
-
set.forEach(function(value) {
|
|
2639
|
-
result[++index] = value;
|
|
2640
|
-
});
|
|
2641
|
-
return result;
|
|
2642
|
-
}
|
|
2643
|
-
var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype;
|
|
2644
|
-
var coreJsData = root["__core-js_shared__"];
|
|
2645
|
-
var maskSrcKey = function() {
|
|
2646
|
-
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
|
|
2647
|
-
return uid ? "Symbol(src)_1." + uid : "";
|
|
2648
|
-
}();
|
|
2649
|
-
var funcToString = funcProto.toString;
|
|
2650
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
2651
|
-
var objectToString = objectProto.toString;
|
|
2652
|
-
var reIsNative = RegExp(
|
|
2653
|
-
"^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
2654
|
-
);
|
|
2655
|
-
var Buffer2 = moduleExports ? root.Buffer : void 0, Symbol2 = root.Symbol, Uint8Array2 = root.Uint8Array, getPrototype = overArg(Object.getPrototypeOf, Object), objectCreate = Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice;
|
|
2656
|
-
var nativeGetSymbols = Object.getOwnPropertySymbols, nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0, nativeKeys = overArg(Object.keys, Object);
|
|
2657
|
-
var DataView2 = getNative(root, "DataView"), Map2 = getNative(root, "Map"), Promise2 = getNative(root, "Promise"), Set = getNative(root, "Set"), WeakMap2 = getNative(root, "WeakMap"), nativeCreate = getNative(Object, "create");
|
|
2658
|
-
var dataViewCtorString = toSource(DataView2), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap2);
|
|
2659
|
-
var symbolProto = Symbol2 ? Symbol2.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
|
|
2660
|
-
function Hash(entries) {
|
|
2661
|
-
var index = -1, length = entries ? entries.length : 0;
|
|
2662
|
-
this.clear();
|
|
2663
|
-
while (++index < length) {
|
|
2664
|
-
var entry = entries[index];
|
|
2665
|
-
this.set(entry[0], entry[1]);
|
|
2666
|
-
}
|
|
2667
|
-
}
|
|
2668
|
-
function hashClear() {
|
|
2669
|
-
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
|
2670
|
-
}
|
|
2671
|
-
function hashDelete(key) {
|
|
2672
|
-
return this.has(key) && delete this.__data__[key];
|
|
2673
|
-
}
|
|
2674
|
-
function hashGet(key) {
|
|
2675
|
-
var data = this.__data__;
|
|
2676
|
-
if (nativeCreate) {
|
|
2677
|
-
var result = data[key];
|
|
2678
|
-
return result === HASH_UNDEFINED ? void 0 : result;
|
|
2679
|
-
}
|
|
2680
|
-
return hasOwnProperty.call(data, key) ? data[key] : void 0;
|
|
2681
|
-
}
|
|
2682
|
-
function hashHas(key) {
|
|
2683
|
-
var data = this.__data__;
|
|
2684
|
-
return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
|
|
2685
|
-
}
|
|
2686
|
-
function hashSet(key, value) {
|
|
2687
|
-
var data = this.__data__;
|
|
2688
|
-
data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
|
|
2689
|
-
return this;
|
|
2690
|
-
}
|
|
2691
|
-
Hash.prototype.clear = hashClear;
|
|
2692
|
-
Hash.prototype["delete"] = hashDelete;
|
|
2693
|
-
Hash.prototype.get = hashGet;
|
|
2694
|
-
Hash.prototype.has = hashHas;
|
|
2695
|
-
Hash.prototype.set = hashSet;
|
|
2696
|
-
function ListCache(entries) {
|
|
2697
|
-
var index = -1, length = entries ? entries.length : 0;
|
|
2698
|
-
this.clear();
|
|
2699
|
-
while (++index < length) {
|
|
2700
|
-
var entry = entries[index];
|
|
2701
|
-
this.set(entry[0], entry[1]);
|
|
2702
|
-
}
|
|
2703
|
-
}
|
|
2704
|
-
function listCacheClear() {
|
|
2705
|
-
this.__data__ = [];
|
|
2706
|
-
}
|
|
2707
|
-
function listCacheDelete(key) {
|
|
2708
|
-
var data = this.__data__, index = assocIndexOf(data, key);
|
|
2709
|
-
if (index < 0) {
|
|
2710
|
-
return false;
|
|
2711
|
-
}
|
|
2712
|
-
var lastIndex = data.length - 1;
|
|
2713
|
-
if (index == lastIndex) {
|
|
2714
|
-
data.pop();
|
|
2715
|
-
} else {
|
|
2716
|
-
splice.call(data, index, 1);
|
|
2717
|
-
}
|
|
2718
|
-
return true;
|
|
2719
|
-
}
|
|
2720
|
-
function listCacheGet(key) {
|
|
2721
|
-
var data = this.__data__, index = assocIndexOf(data, key);
|
|
2722
|
-
return index < 0 ? void 0 : data[index][1];
|
|
2723
|
-
}
|
|
2724
|
-
function listCacheHas(key) {
|
|
2725
|
-
return assocIndexOf(this.__data__, key) > -1;
|
|
2726
|
-
}
|
|
2727
|
-
function listCacheSet(key, value) {
|
|
2728
|
-
var data = this.__data__, index = assocIndexOf(data, key);
|
|
2729
|
-
if (index < 0) {
|
|
2730
|
-
data.push([key, value]);
|
|
2731
|
-
} else {
|
|
2732
|
-
data[index][1] = value;
|
|
2733
|
-
}
|
|
2734
|
-
return this;
|
|
2735
|
-
}
|
|
2736
|
-
ListCache.prototype.clear = listCacheClear;
|
|
2737
|
-
ListCache.prototype["delete"] = listCacheDelete;
|
|
2738
|
-
ListCache.prototype.get = listCacheGet;
|
|
2739
|
-
ListCache.prototype.has = listCacheHas;
|
|
2740
|
-
ListCache.prototype.set = listCacheSet;
|
|
2741
|
-
function MapCache(entries) {
|
|
2742
|
-
var index = -1, length = entries ? entries.length : 0;
|
|
2743
|
-
this.clear();
|
|
2744
|
-
while (++index < length) {
|
|
2745
|
-
var entry = entries[index];
|
|
2746
|
-
this.set(entry[0], entry[1]);
|
|
2747
|
-
}
|
|
2748
|
-
}
|
|
2749
|
-
function mapCacheClear() {
|
|
2750
|
-
this.__data__ = {
|
|
2751
|
-
"hash": new Hash(),
|
|
2752
|
-
"map": new (Map2 || ListCache)(),
|
|
2753
|
-
"string": new Hash()
|
|
2754
|
-
};
|
|
2755
|
-
}
|
|
2756
|
-
function mapCacheDelete(key) {
|
|
2757
|
-
return getMapData(this, key)["delete"](key);
|
|
2758
|
-
}
|
|
2759
|
-
function mapCacheGet(key) {
|
|
2760
|
-
return getMapData(this, key).get(key);
|
|
2761
|
-
}
|
|
2762
|
-
function mapCacheHas(key) {
|
|
2763
|
-
return getMapData(this, key).has(key);
|
|
2764
|
-
}
|
|
2765
|
-
function mapCacheSet(key, value) {
|
|
2766
|
-
getMapData(this, key).set(key, value);
|
|
2767
|
-
return this;
|
|
2768
|
-
}
|
|
2769
|
-
MapCache.prototype.clear = mapCacheClear;
|
|
2770
|
-
MapCache.prototype["delete"] = mapCacheDelete;
|
|
2771
|
-
MapCache.prototype.get = mapCacheGet;
|
|
2772
|
-
MapCache.prototype.has = mapCacheHas;
|
|
2773
|
-
MapCache.prototype.set = mapCacheSet;
|
|
2774
|
-
function Stack(entries) {
|
|
2775
|
-
this.__data__ = new ListCache(entries);
|
|
2776
|
-
}
|
|
2777
|
-
function stackClear() {
|
|
2778
|
-
this.__data__ = new ListCache();
|
|
2779
|
-
}
|
|
2780
|
-
function stackDelete(key) {
|
|
2781
|
-
return this.__data__["delete"](key);
|
|
2782
|
-
}
|
|
2783
|
-
function stackGet(key) {
|
|
2784
|
-
return this.__data__.get(key);
|
|
2785
|
-
}
|
|
2786
|
-
function stackHas(key) {
|
|
2787
|
-
return this.__data__.has(key);
|
|
2788
|
-
}
|
|
2789
|
-
function stackSet(key, value) {
|
|
2790
|
-
var cache = this.__data__;
|
|
2791
|
-
if (cache instanceof ListCache) {
|
|
2792
|
-
var pairs = cache.__data__;
|
|
2793
|
-
if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
|
|
2794
|
-
pairs.push([key, value]);
|
|
2795
|
-
return this;
|
|
2796
|
-
}
|
|
2797
|
-
cache = this.__data__ = new MapCache(pairs);
|
|
2798
|
-
}
|
|
2799
|
-
cache.set(key, value);
|
|
2800
|
-
return this;
|
|
2801
|
-
}
|
|
2802
|
-
Stack.prototype.clear = stackClear;
|
|
2803
|
-
Stack.prototype["delete"] = stackDelete;
|
|
2804
|
-
Stack.prototype.get = stackGet;
|
|
2805
|
-
Stack.prototype.has = stackHas;
|
|
2806
|
-
Stack.prototype.set = stackSet;
|
|
2807
|
-
function arrayLikeKeys(value, inherited) {
|
|
2808
|
-
var result = isArray2(value) || isArguments(value) ? baseTimes(value.length, String) : [];
|
|
2809
|
-
var length = result.length, skipIndexes = !!length;
|
|
2810
|
-
for (var key in value) {
|
|
2811
|
-
if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isIndex(key, length)))) {
|
|
2812
|
-
result.push(key);
|
|
2813
|
-
}
|
|
2814
|
-
}
|
|
2815
|
-
return result;
|
|
2816
|
-
}
|
|
2817
|
-
function assignValue(object, key, value) {
|
|
2818
|
-
var objValue = object[key];
|
|
2819
|
-
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
|
|
2820
|
-
object[key] = value;
|
|
2821
|
-
}
|
|
2822
|
-
}
|
|
2823
|
-
function assocIndexOf(array, key) {
|
|
2824
|
-
var length = array.length;
|
|
2825
|
-
while (length--) {
|
|
2826
|
-
if (eq(array[length][0], key)) {
|
|
2827
|
-
return length;
|
|
2828
|
-
}
|
|
2829
|
-
}
|
|
2830
|
-
return -1;
|
|
2831
|
-
}
|
|
2832
|
-
function baseAssign(object, source2) {
|
|
2833
|
-
return object && copyObject(source2, keys(source2), object);
|
|
2834
|
-
}
|
|
2835
|
-
function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
|
|
2836
|
-
var result;
|
|
2837
|
-
if (customizer) {
|
|
2838
|
-
result = object ? customizer(value, key, object, stack) : customizer(value);
|
|
2839
|
-
}
|
|
2840
|
-
if (result !== void 0) {
|
|
2841
|
-
return result;
|
|
2842
|
-
}
|
|
2843
|
-
if (!isObject(value)) {
|
|
2844
|
-
return value;
|
|
2845
|
-
}
|
|
2846
|
-
var isArr = isArray2(value);
|
|
2847
|
-
if (isArr) {
|
|
2848
|
-
result = initCloneArray(value);
|
|
2849
|
-
if (!isDeep) {
|
|
2850
|
-
return copyArray(value, result);
|
|
2851
|
-
}
|
|
2852
|
-
} else {
|
|
2853
|
-
var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
|
|
2854
|
-
if (isBuffer(value)) {
|
|
2855
|
-
return cloneBuffer(value, isDeep);
|
|
2856
|
-
}
|
|
2857
|
-
if (tag == objectTag || tag == argsTag || isFunc && !object) {
|
|
2858
|
-
if (isHostObject(value)) {
|
|
2859
|
-
return object ? value : {};
|
|
2860
|
-
}
|
|
2861
|
-
result = initCloneObject(isFunc ? {} : value);
|
|
2862
|
-
if (!isDeep) {
|
|
2863
|
-
return copySymbols(value, baseAssign(result, value));
|
|
2864
|
-
}
|
|
2865
|
-
} else {
|
|
2866
|
-
if (!cloneableTags[tag]) {
|
|
2867
|
-
return object ? value : {};
|
|
2868
|
-
}
|
|
2869
|
-
result = initCloneByTag(value, tag, baseClone, isDeep);
|
|
2870
|
-
}
|
|
2871
|
-
}
|
|
2872
|
-
stack || (stack = new Stack());
|
|
2873
|
-
var stacked = stack.get(value);
|
|
2874
|
-
if (stacked) {
|
|
2875
|
-
return stacked;
|
|
2876
|
-
}
|
|
2877
|
-
stack.set(value, result);
|
|
2878
|
-
if (!isArr) {
|
|
2879
|
-
var props = isFull ? getAllKeys(value) : keys(value);
|
|
2880
|
-
}
|
|
2881
|
-
arrayEach(props || value, function(subValue, key2) {
|
|
2882
|
-
if (props) {
|
|
2883
|
-
key2 = subValue;
|
|
2884
|
-
subValue = value[key2];
|
|
2885
|
-
}
|
|
2886
|
-
assignValue(result, key2, baseClone(subValue, isDeep, isFull, customizer, key2, value, stack));
|
|
2887
|
-
});
|
|
2888
|
-
return result;
|
|
2889
|
-
}
|
|
2890
|
-
function baseCreate(proto2) {
|
|
2891
|
-
return isObject(proto2) ? objectCreate(proto2) : {};
|
|
2892
|
-
}
|
|
2893
|
-
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
|
|
2894
|
-
var result = keysFunc(object);
|
|
2895
|
-
return isArray2(object) ? result : arrayPush(result, symbolsFunc(object));
|
|
2896
|
-
}
|
|
2897
|
-
function baseGetTag(value) {
|
|
2898
|
-
return objectToString.call(value);
|
|
2899
|
-
}
|
|
2900
|
-
function baseIsNative(value) {
|
|
2901
|
-
if (!isObject(value) || isMasked(value)) {
|
|
2902
|
-
return false;
|
|
2903
|
-
}
|
|
2904
|
-
var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
|
|
2905
|
-
return pattern.test(toSource(value));
|
|
2906
|
-
}
|
|
2907
|
-
function baseKeys(object) {
|
|
2908
|
-
if (!isPrototype(object)) {
|
|
2909
|
-
return nativeKeys(object);
|
|
2910
|
-
}
|
|
2911
|
-
var result = [];
|
|
2912
|
-
for (var key in Object(object)) {
|
|
2913
|
-
if (hasOwnProperty.call(object, key) && key != "constructor") {
|
|
2914
|
-
result.push(key);
|
|
2915
|
-
}
|
|
2916
|
-
}
|
|
2917
|
-
return result;
|
|
2918
|
-
}
|
|
2919
|
-
function cloneBuffer(buffer, isDeep) {
|
|
2920
|
-
if (isDeep) {
|
|
2921
|
-
return buffer.slice();
|
|
2922
|
-
}
|
|
2923
|
-
var result = new buffer.constructor(buffer.length);
|
|
2924
|
-
buffer.copy(result);
|
|
2925
|
-
return result;
|
|
2926
|
-
}
|
|
2927
|
-
function cloneArrayBuffer(arrayBuffer) {
|
|
2928
|
-
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
|
2929
|
-
new Uint8Array2(result).set(new Uint8Array2(arrayBuffer));
|
|
2930
|
-
return result;
|
|
2931
|
-
}
|
|
2932
|
-
function cloneDataView(dataView, isDeep) {
|
|
2933
|
-
var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
|
|
2934
|
-
return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
|
|
2935
|
-
}
|
|
2936
|
-
function cloneMap(map, isDeep, cloneFunc) {
|
|
2937
|
-
var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);
|
|
2938
|
-
return arrayReduce(array, addMapEntry, new map.constructor());
|
|
2939
|
-
}
|
|
2940
|
-
function cloneRegExp(regexp) {
|
|
2941
|
-
var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
|
|
2942
|
-
result.lastIndex = regexp.lastIndex;
|
|
2943
|
-
return result;
|
|
2944
|
-
}
|
|
2945
|
-
function cloneSet(set, isDeep, cloneFunc) {
|
|
2946
|
-
var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);
|
|
2947
|
-
return arrayReduce(array, addSetEntry, new set.constructor());
|
|
2948
|
-
}
|
|
2949
|
-
function cloneSymbol(symbol) {
|
|
2950
|
-
return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
|
|
2951
|
-
}
|
|
2952
|
-
function cloneTypedArray(typedArray, isDeep) {
|
|
2953
|
-
var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
|
|
2954
|
-
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
|
|
2955
|
-
}
|
|
2956
|
-
function copyArray(source2, array) {
|
|
2957
|
-
var index = -1, length = source2.length;
|
|
2958
|
-
array || (array = Array(length));
|
|
2959
|
-
while (++index < length) {
|
|
2960
|
-
array[index] = source2[index];
|
|
2961
|
-
}
|
|
2962
|
-
return array;
|
|
2963
|
-
}
|
|
2964
|
-
function copyObject(source2, props, object, customizer) {
|
|
2965
|
-
object || (object = {});
|
|
2966
|
-
var index = -1, length = props.length;
|
|
2967
|
-
while (++index < length) {
|
|
2968
|
-
var key = props[index];
|
|
2969
|
-
var newValue = customizer ? customizer(object[key], source2[key], key, object, source2) : void 0;
|
|
2970
|
-
assignValue(object, key, newValue === void 0 ? source2[key] : newValue);
|
|
2971
|
-
}
|
|
2972
|
-
return object;
|
|
2973
|
-
}
|
|
2974
|
-
function copySymbols(source2, object) {
|
|
2975
|
-
return copyObject(source2, getSymbols(source2), object);
|
|
2976
|
-
}
|
|
2977
|
-
function getAllKeys(object) {
|
|
2978
|
-
return baseGetAllKeys(object, keys, getSymbols);
|
|
2979
|
-
}
|
|
2980
|
-
function getMapData(map, key) {
|
|
2981
|
-
var data = map.__data__;
|
|
2982
|
-
return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
2983
|
-
}
|
|
2984
|
-
function getNative(object, key) {
|
|
2985
|
-
var value = getValue(object, key);
|
|
2986
|
-
return baseIsNative(value) ? value : void 0;
|
|
2987
|
-
}
|
|
2988
|
-
var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;
|
|
2989
|
-
var getTag = baseGetTag;
|
|
2990
|
-
if (DataView2 && getTag(new DataView2(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) {
|
|
2991
|
-
getTag = function(value) {
|
|
2992
|
-
var result = objectToString.call(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : void 0;
|
|
2993
|
-
if (ctorString) {
|
|
2994
|
-
switch (ctorString) {
|
|
2995
|
-
case dataViewCtorString:
|
|
2996
|
-
return dataViewTag;
|
|
2997
|
-
case mapCtorString:
|
|
2998
|
-
return mapTag;
|
|
2999
|
-
case promiseCtorString:
|
|
3000
|
-
return promiseTag;
|
|
3001
|
-
case setCtorString:
|
|
3002
|
-
return setTag;
|
|
3003
|
-
case weakMapCtorString:
|
|
3004
|
-
return weakMapTag;
|
|
3005
|
-
}
|
|
3006
|
-
}
|
|
3007
|
-
return result;
|
|
3008
|
-
};
|
|
3009
|
-
}
|
|
3010
|
-
function initCloneArray(array) {
|
|
3011
|
-
var length = array.length, result = array.constructor(length);
|
|
3012
|
-
if (length && typeof array[0] == "string" && hasOwnProperty.call(array, "index")) {
|
|
3013
|
-
result.index = array.index;
|
|
3014
|
-
result.input = array.input;
|
|
3015
|
-
}
|
|
3016
|
-
return result;
|
|
3017
|
-
}
|
|
3018
|
-
function initCloneObject(object) {
|
|
3019
|
-
return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
|
|
3020
|
-
}
|
|
3021
|
-
function initCloneByTag(object, tag, cloneFunc, isDeep) {
|
|
3022
|
-
var Ctor = object.constructor;
|
|
3023
|
-
switch (tag) {
|
|
3024
|
-
case arrayBufferTag:
|
|
3025
|
-
return cloneArrayBuffer(object);
|
|
3026
|
-
case boolTag:
|
|
3027
|
-
case dateTag:
|
|
3028
|
-
return new Ctor(+object);
|
|
3029
|
-
case dataViewTag:
|
|
3030
|
-
return cloneDataView(object, isDeep);
|
|
3031
|
-
case float32Tag:
|
|
3032
|
-
case float64Tag:
|
|
3033
|
-
case int8Tag:
|
|
3034
|
-
case int16Tag:
|
|
3035
|
-
case int32Tag:
|
|
3036
|
-
case uint8Tag:
|
|
3037
|
-
case uint8ClampedTag:
|
|
3038
|
-
case uint16Tag:
|
|
3039
|
-
case uint32Tag:
|
|
3040
|
-
return cloneTypedArray(object, isDeep);
|
|
3041
|
-
case mapTag:
|
|
3042
|
-
return cloneMap(object, isDeep, cloneFunc);
|
|
3043
|
-
case numberTag:
|
|
3044
|
-
case stringTag:
|
|
3045
|
-
return new Ctor(object);
|
|
3046
|
-
case regexpTag:
|
|
3047
|
-
return cloneRegExp(object);
|
|
3048
|
-
case setTag:
|
|
3049
|
-
return cloneSet(object, isDeep, cloneFunc);
|
|
3050
|
-
case symbolTag:
|
|
3051
|
-
return cloneSymbol(object);
|
|
3052
|
-
}
|
|
3053
|
-
}
|
|
3054
|
-
function isIndex(value, length) {
|
|
3055
|
-
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
3056
|
-
return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
|
|
3057
|
-
}
|
|
3058
|
-
function isKeyable(value) {
|
|
3059
|
-
var type = typeof value;
|
|
3060
|
-
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
|
|
3061
|
-
}
|
|
3062
|
-
function isMasked(func) {
|
|
3063
|
-
return !!maskSrcKey && maskSrcKey in func;
|
|
3064
|
-
}
|
|
3065
|
-
function isPrototype(value) {
|
|
3066
|
-
var Ctor = value && value.constructor, proto2 = typeof Ctor == "function" && Ctor.prototype || objectProto;
|
|
3067
|
-
return value === proto2;
|
|
3068
|
-
}
|
|
3069
|
-
function toSource(func) {
|
|
3070
|
-
if (func != null) {
|
|
3071
|
-
try {
|
|
3072
|
-
return funcToString.call(func);
|
|
3073
|
-
} catch (e) {
|
|
3074
|
-
}
|
|
3075
|
-
try {
|
|
3076
|
-
return func + "";
|
|
3077
|
-
} catch (e) {
|
|
3078
|
-
}
|
|
3079
|
-
}
|
|
3080
|
-
return "";
|
|
3081
|
-
}
|
|
3082
|
-
function cloneDeep(value) {
|
|
3083
|
-
return baseClone(value, true, true);
|
|
3084
|
-
}
|
|
3085
|
-
function eq(value, other) {
|
|
3086
|
-
return value === other || value !== value && other !== other;
|
|
3087
|
-
}
|
|
3088
|
-
function isArguments(value) {
|
|
3089
|
-
return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag);
|
|
3090
|
-
}
|
|
3091
|
-
var isArray2 = Array.isArray;
|
|
3092
|
-
function isArrayLike(value) {
|
|
3093
|
-
return value != null && isLength(value.length) && !isFunction(value);
|
|
3094
|
-
}
|
|
3095
|
-
function isArrayLikeObject(value) {
|
|
3096
|
-
return isObjectLike(value) && isArrayLike(value);
|
|
3097
|
-
}
|
|
3098
|
-
var isBuffer = nativeIsBuffer || stubFalse;
|
|
3099
|
-
function isFunction(value) {
|
|
3100
|
-
var tag = isObject(value) ? objectToString.call(value) : "";
|
|
3101
|
-
return tag == funcTag || tag == genTag;
|
|
3102
|
-
}
|
|
3103
|
-
function isLength(value) {
|
|
3104
|
-
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
3105
|
-
}
|
|
3106
|
-
function isObject(value) {
|
|
3107
|
-
var type = typeof value;
|
|
3108
|
-
return !!value && (type == "object" || type == "function");
|
|
3109
|
-
}
|
|
3110
|
-
function isObjectLike(value) {
|
|
3111
|
-
return !!value && typeof value == "object";
|
|
3112
|
-
}
|
|
3113
|
-
function keys(object) {
|
|
3114
|
-
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
|
|
3115
|
-
}
|
|
3116
|
-
function stubArray() {
|
|
3117
|
-
return [];
|
|
3118
|
-
}
|
|
3119
|
-
function stubFalse() {
|
|
3120
|
-
return false;
|
|
3121
|
-
}
|
|
3122
|
-
module2.exports = cloneDeep;
|
|
3123
|
-
})(lodash_clonedeep, lodash_clonedeep.exports);
|
|
3124
|
-
lodash_clonedeep.exports;
|
|
3125
|
-
var tinyEmitter = { exports: {} };
|
|
3126
|
-
function E() {
|
|
3127
|
-
}
|
|
3128
|
-
E.prototype = {
|
|
3129
|
-
on: function(name, callback, ctx) {
|
|
3130
|
-
var e = this.e || (this.e = {});
|
|
3131
|
-
(e[name] || (e[name] = [])).push({
|
|
3132
|
-
fn: callback,
|
|
3133
|
-
ctx
|
|
3134
|
-
});
|
|
3135
|
-
return this;
|
|
3136
|
-
},
|
|
3137
|
-
once: function(name, callback, ctx) {
|
|
3138
|
-
var self2 = this;
|
|
3139
|
-
function listener() {
|
|
3140
|
-
self2.off(name, listener);
|
|
3141
|
-
callback.apply(ctx, arguments);
|
|
3142
|
-
}
|
|
3143
|
-
listener._ = callback;
|
|
3144
|
-
return this.on(name, listener, ctx);
|
|
3145
|
-
},
|
|
3146
|
-
emit: function(name) {
|
|
3147
|
-
var data = [].slice.call(arguments, 1);
|
|
3148
|
-
var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
|
|
3149
|
-
var i = 0;
|
|
3150
|
-
var len = evtArr.length;
|
|
3151
|
-
for (i; i < len; i++) {
|
|
3152
|
-
evtArr[i].fn.apply(evtArr[i].ctx, data);
|
|
3153
|
-
}
|
|
3154
|
-
return this;
|
|
3155
|
-
},
|
|
3156
|
-
off: function(name, callback) {
|
|
3157
|
-
var e = this.e || (this.e = {});
|
|
3158
|
-
var evts = e[name];
|
|
3159
|
-
var liveEvents = [];
|
|
3160
|
-
if (evts && callback) {
|
|
3161
|
-
for (var i = 0, len = evts.length; i < len; i++) {
|
|
3162
|
-
if (evts[i].fn !== callback && evts[i].fn._ !== callback)
|
|
3163
|
-
liveEvents.push(evts[i]);
|
|
3164
|
-
}
|
|
3165
|
-
}
|
|
3166
|
-
liveEvents.length ? e[name] = liveEvents : delete e[name];
|
|
3167
|
-
return this;
|
|
3168
|
-
}
|
|
3169
|
-
};
|
|
3170
|
-
tinyEmitter.exports = E;
|
|
3171
|
-
tinyEmitter.exports.TinyEmitter = E;
|
|
3172
|
-
var __defProp2 = Object.defineProperty;
|
|
3173
|
-
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3174
|
-
var __publicField2 = (obj, key, value) => {
|
|
3175
|
-
__defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3176
|
-
return value;
|
|
3177
|
-
};
|
|
3178
|
-
var Gauge = /* @__PURE__ */ ((Gauge2) => {
|
|
3179
|
-
Gauge2["ACTIVE_REQUEST_GAUGE"] = "a";
|
|
3180
|
-
Gauge2["AUTHENTICATION_COUNT_GAUGE"] = "b";
|
|
3181
|
-
Gauge2["AUTHENTICATION_ERROR_COUNT_GAUGE"] = "aa";
|
|
3182
|
-
Gauge2["AUTHENTICATION_RETRY_COUNT_GAUGE"] = "ab";
|
|
3183
|
-
Gauge2["CONNECTION_POOL_IDLE_GAUGE"] = "c";
|
|
3184
|
-
Gauge2["CONNECTION_POOL_TOTAL_GAUGE"] = "d";
|
|
3185
|
-
Gauge2["CONNECTION_POOL_WAITING_GAUGE"] = "e";
|
|
3186
|
-
Gauge2["CPU_LOAD_GAUGE"] = "f";
|
|
3187
|
-
Gauge2["CPU_SYSTEM_LOAD_GAUGE"] = "g";
|
|
3188
|
-
Gauge2["DURATION_GAUGE"] = "h";
|
|
3189
|
-
Gauge2["DURATION_HISTOGRAM_GAUGE"] = "i";
|
|
3190
|
-
Gauge2["ERROR_COUNT_GAUGE"] = "j";
|
|
3191
|
-
Gauge2["LATENCY_GAUGE"] = "k";
|
|
3192
|
-
Gauge2["LATENCY_HISTOGRAM_GAUGE"] = "l";
|
|
3193
|
-
Gauge2["LOGGER"] = "m";
|
|
3194
|
-
Gauge2["LOGGER_COPY"] = "n";
|
|
3195
|
-
Gauge2["NETWORK_RX_GAUGE"] = "o";
|
|
3196
|
-
Gauge2["NETWORK_TX_GAUGE"] = "p";
|
|
3197
|
-
Gauge2["REQUEST_COUNT_GAUGE"] = "q";
|
|
3198
|
-
Gauge2["RETRY_COUNT_GAUGE"] = "r";
|
|
3199
|
-
Gauge2["TIMER_GAUGE"] = "s";
|
|
3200
|
-
Gauge2["VELOCITY_GAUGE"] = "t";
|
|
3201
|
-
Gauge2["CONNECTION_COUNT_GAUGE"] = "u";
|
|
3202
|
-
Gauge2["OBJECT_GAUGE"] = "v";
|
|
3203
|
-
Gauge2["PAYLOAD_SIZE"] = "w";
|
|
3204
|
-
Gauge2["CORE_COUNT_GAUGE"] = "x";
|
|
3205
|
-
Gauge2["CHILD_COUNT"] = "y";
|
|
3206
|
-
Gauge2["UNKNOWN"] = "z";
|
|
3207
|
-
return Gauge2;
|
|
3208
|
-
})(Gauge || {});
|
|
3209
|
-
var GaugeTypes = /* @__PURE__ */ ((GaugeTypes2) => {
|
|
3210
|
-
GaugeTypes2["GAUGE_TYPE"] = "_";
|
|
3211
|
-
GaugeTypes2["INSTRUMENT_GAUGE"] = "a";
|
|
3212
|
-
GaugeTypes2["INSTRUMENT_VELOCITY"] = "b";
|
|
3213
|
-
GaugeTypes2["INSTRUMENT_HISTOGRAM"] = "c";
|
|
3214
|
-
GaugeTypes2["INSTRUMENT_LOG"] = "d";
|
|
3215
|
-
GaugeTypes2["INSTRUMENT_TIMER"] = "e";
|
|
3216
|
-
GaugeTypes2["INSTRUMENT_OBJECT"] = "f";
|
|
3217
|
-
return GaugeTypes2;
|
|
3218
|
-
})(GaugeTypes || {});
|
|
3219
|
-
GaugeTypes.GAUGE_TYPE;
|
|
3220
|
-
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
3221
|
-
var timsort$1 = {};
|
|
3222
|
-
(function(exports3) {
|
|
3223
|
-
(function(global2, factory) {
|
|
3224
|
-
{
|
|
3225
|
-
factory(exports3);
|
|
3226
|
-
}
|
|
3227
|
-
})(commonjsGlobal, function(exports22) {
|
|
3228
|
-
exports22.__esModule = true;
|
|
3229
|
-
exports22.sort = sort;
|
|
3230
|
-
function _classCallCheck(instance, Constructor) {
|
|
3231
|
-
if (!(instance instanceof Constructor)) {
|
|
3232
|
-
throw new TypeError("Cannot call a class as a function");
|
|
3233
|
-
}
|
|
3234
|
-
}
|
|
3235
|
-
var DEFAULT_MIN_MERGE = 32;
|
|
3236
|
-
var DEFAULT_MIN_GALLOPING = 7;
|
|
3237
|
-
var DEFAULT_TMP_STORAGE_LENGTH = 256;
|
|
3238
|
-
var POWERS_OF_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9];
|
|
3239
|
-
function log10(x) {
|
|
3240
|
-
if (x < 1e5) {
|
|
3241
|
-
if (x < 100) {
|
|
3242
|
-
return x < 10 ? 0 : 1;
|
|
3243
|
-
}
|
|
3244
|
-
if (x < 1e4) {
|
|
3245
|
-
return x < 1e3 ? 2 : 3;
|
|
3246
|
-
}
|
|
3247
|
-
return 4;
|
|
3248
|
-
}
|
|
3249
|
-
if (x < 1e7) {
|
|
3250
|
-
return x < 1e6 ? 5 : 6;
|
|
3251
|
-
}
|
|
3252
|
-
if (x < 1e9) {
|
|
3253
|
-
return x < 1e8 ? 7 : 8;
|
|
3254
|
-
}
|
|
3255
|
-
return 9;
|
|
3256
|
-
}
|
|
3257
|
-
function alphabeticalCompare(a, b) {
|
|
3258
|
-
if (a === b) {
|
|
3259
|
-
return 0;
|
|
3260
|
-
}
|
|
3261
|
-
if (~~a === a && ~~b === b) {
|
|
3262
|
-
if (a === 0 || b === 0) {
|
|
3263
|
-
return a < b ? -1 : 1;
|
|
3264
|
-
}
|
|
3265
|
-
if (a < 0 || b < 0) {
|
|
3266
|
-
if (b >= 0) {
|
|
3267
|
-
return -1;
|
|
3268
|
-
}
|
|
3269
|
-
if (a >= 0) {
|
|
3270
|
-
return 1;
|
|
3271
|
-
}
|
|
3272
|
-
a = -a;
|
|
3273
|
-
b = -b;
|
|
3274
|
-
}
|
|
3275
|
-
var al = log10(a);
|
|
3276
|
-
var bl = log10(b);
|
|
3277
|
-
var t = 0;
|
|
3278
|
-
if (al < bl) {
|
|
3279
|
-
a *= POWERS_OF_TEN[bl - al - 1];
|
|
3280
|
-
b /= 10;
|
|
3281
|
-
t = -1;
|
|
3282
|
-
} else if (al > bl) {
|
|
3283
|
-
b *= POWERS_OF_TEN[al - bl - 1];
|
|
3284
|
-
a /= 10;
|
|
3285
|
-
t = 1;
|
|
3286
|
-
}
|
|
3287
|
-
if (a === b) {
|
|
3288
|
-
return t;
|
|
3289
|
-
}
|
|
3290
|
-
return a < b ? -1 : 1;
|
|
3291
|
-
}
|
|
3292
|
-
var aStr = String(a);
|
|
3293
|
-
var bStr = String(b);
|
|
3294
|
-
if (aStr === bStr) {
|
|
3295
|
-
return 0;
|
|
3296
|
-
}
|
|
3297
|
-
return aStr < bStr ? -1 : 1;
|
|
3298
|
-
}
|
|
3299
|
-
function minRunLength(n) {
|
|
3300
|
-
var r = 0;
|
|
3301
|
-
while (n >= DEFAULT_MIN_MERGE) {
|
|
3302
|
-
r |= n & 1;
|
|
3303
|
-
n >>= 1;
|
|
3304
|
-
}
|
|
3305
|
-
return n + r;
|
|
3306
|
-
}
|
|
3307
|
-
function makeAscendingRun(array, lo, hi, compare) {
|
|
3308
|
-
var runHi = lo + 1;
|
|
3309
|
-
if (runHi === hi) {
|
|
3310
|
-
return 1;
|
|
3311
|
-
}
|
|
3312
|
-
if (compare(array[runHi++], array[lo]) < 0) {
|
|
3313
|
-
while (runHi < hi && compare(array[runHi], array[runHi - 1]) < 0) {
|
|
3314
|
-
runHi++;
|
|
3315
|
-
}
|
|
3316
|
-
reverseRun(array, lo, runHi);
|
|
3317
|
-
} else {
|
|
3318
|
-
while (runHi < hi && compare(array[runHi], array[runHi - 1]) >= 0) {
|
|
3319
|
-
runHi++;
|
|
3320
|
-
}
|
|
3321
|
-
}
|
|
3322
|
-
return runHi - lo;
|
|
3323
|
-
}
|
|
3324
|
-
function reverseRun(array, lo, hi) {
|
|
3325
|
-
hi--;
|
|
3326
|
-
while (lo < hi) {
|
|
3327
|
-
var t = array[lo];
|
|
3328
|
-
array[lo++] = array[hi];
|
|
3329
|
-
array[hi--] = t;
|
|
3330
|
-
}
|
|
3331
|
-
}
|
|
3332
|
-
function binaryInsertionSort(array, lo, hi, start, compare) {
|
|
3333
|
-
if (start === lo) {
|
|
3334
|
-
start++;
|
|
3335
|
-
}
|
|
3336
|
-
for (; start < hi; start++) {
|
|
3337
|
-
var pivot = array[start];
|
|
3338
|
-
var left = lo;
|
|
3339
|
-
var right = start;
|
|
3340
|
-
while (left < right) {
|
|
3341
|
-
var mid = left + right >>> 1;
|
|
3342
|
-
if (compare(pivot, array[mid]) < 0) {
|
|
3343
|
-
right = mid;
|
|
3344
|
-
} else {
|
|
3345
|
-
left = mid + 1;
|
|
3346
|
-
}
|
|
3347
|
-
}
|
|
3348
|
-
var n = start - left;
|
|
3349
|
-
switch (n) {
|
|
3350
|
-
case 3:
|
|
3351
|
-
array[left + 3] = array[left + 2];
|
|
3352
|
-
case 2:
|
|
3353
|
-
array[left + 2] = array[left + 1];
|
|
3354
|
-
case 1:
|
|
3355
|
-
array[left + 1] = array[left];
|
|
3356
|
-
break;
|
|
3357
|
-
default:
|
|
3358
|
-
while (n > 0) {
|
|
3359
|
-
array[left + n] = array[left + n - 1];
|
|
3360
|
-
n--;
|
|
3361
|
-
}
|
|
3362
|
-
}
|
|
3363
|
-
array[left] = pivot;
|
|
3364
|
-
}
|
|
3365
|
-
}
|
|
3366
|
-
function gallopLeft(value, array, start, length, hint, compare) {
|
|
3367
|
-
var lastOffset = 0;
|
|
3368
|
-
var maxOffset = 0;
|
|
3369
|
-
var offset = 1;
|
|
3370
|
-
if (compare(value, array[start + hint]) > 0) {
|
|
3371
|
-
maxOffset = length - hint;
|
|
3372
|
-
while (offset < maxOffset && compare(value, array[start + hint + offset]) > 0) {
|
|
3373
|
-
lastOffset = offset;
|
|
3374
|
-
offset = (offset << 1) + 1;
|
|
3375
|
-
if (offset <= 0) {
|
|
3376
|
-
offset = maxOffset;
|
|
3377
|
-
}
|
|
3378
|
-
}
|
|
3379
|
-
if (offset > maxOffset) {
|
|
3380
|
-
offset = maxOffset;
|
|
3381
|
-
}
|
|
3382
|
-
lastOffset += hint;
|
|
3383
|
-
offset += hint;
|
|
3384
|
-
} else {
|
|
3385
|
-
maxOffset = hint + 1;
|
|
3386
|
-
while (offset < maxOffset && compare(value, array[start + hint - offset]) <= 0) {
|
|
3387
|
-
lastOffset = offset;
|
|
3388
|
-
offset = (offset << 1) + 1;
|
|
3389
|
-
if (offset <= 0) {
|
|
3390
|
-
offset = maxOffset;
|
|
3391
|
-
}
|
|
3392
|
-
}
|
|
3393
|
-
if (offset > maxOffset) {
|
|
3394
|
-
offset = maxOffset;
|
|
3395
|
-
}
|
|
3396
|
-
var tmp = lastOffset;
|
|
3397
|
-
lastOffset = hint - offset;
|
|
3398
|
-
offset = hint - tmp;
|
|
3399
|
-
}
|
|
3400
|
-
lastOffset++;
|
|
3401
|
-
while (lastOffset < offset) {
|
|
3402
|
-
var m = lastOffset + (offset - lastOffset >>> 1);
|
|
3403
|
-
if (compare(value, array[start + m]) > 0) {
|
|
3404
|
-
lastOffset = m + 1;
|
|
3405
|
-
} else {
|
|
3406
|
-
offset = m;
|
|
3407
|
-
}
|
|
3408
|
-
}
|
|
3409
|
-
return offset;
|
|
3410
|
-
}
|
|
3411
|
-
function gallopRight(value, array, start, length, hint, compare) {
|
|
3412
|
-
var lastOffset = 0;
|
|
3413
|
-
var maxOffset = 0;
|
|
3414
|
-
var offset = 1;
|
|
3415
|
-
if (compare(value, array[start + hint]) < 0) {
|
|
3416
|
-
maxOffset = hint + 1;
|
|
3417
|
-
while (offset < maxOffset && compare(value, array[start + hint - offset]) < 0) {
|
|
3418
|
-
lastOffset = offset;
|
|
3419
|
-
offset = (offset << 1) + 1;
|
|
3420
|
-
if (offset <= 0) {
|
|
3421
|
-
offset = maxOffset;
|
|
3422
|
-
}
|
|
3423
|
-
}
|
|
3424
|
-
if (offset > maxOffset) {
|
|
3425
|
-
offset = maxOffset;
|
|
3426
|
-
}
|
|
3427
|
-
var tmp = lastOffset;
|
|
3428
|
-
lastOffset = hint - offset;
|
|
3429
|
-
offset = hint - tmp;
|
|
3430
|
-
} else {
|
|
3431
|
-
maxOffset = length - hint;
|
|
3432
|
-
while (offset < maxOffset && compare(value, array[start + hint + offset]) >= 0) {
|
|
3433
|
-
lastOffset = offset;
|
|
3434
|
-
offset = (offset << 1) + 1;
|
|
3435
|
-
if (offset <= 0) {
|
|
3436
|
-
offset = maxOffset;
|
|
3437
|
-
}
|
|
3438
|
-
}
|
|
3439
|
-
if (offset > maxOffset) {
|
|
3440
|
-
offset = maxOffset;
|
|
3441
|
-
}
|
|
3442
|
-
lastOffset += hint;
|
|
3443
|
-
offset += hint;
|
|
3444
|
-
}
|
|
3445
|
-
lastOffset++;
|
|
3446
|
-
while (lastOffset < offset) {
|
|
3447
|
-
var m = lastOffset + (offset - lastOffset >>> 1);
|
|
3448
|
-
if (compare(value, array[start + m]) < 0) {
|
|
3449
|
-
offset = m;
|
|
3450
|
-
} else {
|
|
3451
|
-
lastOffset = m + 1;
|
|
3452
|
-
}
|
|
3453
|
-
}
|
|
3454
|
-
return offset;
|
|
3455
|
-
}
|
|
3456
|
-
var TimSort = function() {
|
|
3457
|
-
function TimSort2(array, compare) {
|
|
3458
|
-
_classCallCheck(this, TimSort2);
|
|
3459
|
-
this.array = null;
|
|
3460
|
-
this.compare = null;
|
|
3461
|
-
this.minGallop = DEFAULT_MIN_GALLOPING;
|
|
3462
|
-
this.length = 0;
|
|
3463
|
-
this.tmpStorageLength = DEFAULT_TMP_STORAGE_LENGTH;
|
|
3464
|
-
this.stackLength = 0;
|
|
3465
|
-
this.runStart = null;
|
|
3466
|
-
this.runLength = null;
|
|
3467
|
-
this.stackSize = 0;
|
|
3468
|
-
this.array = array;
|
|
3469
|
-
this.compare = compare;
|
|
3470
|
-
this.length = array.length;
|
|
3471
|
-
if (this.length < 2 * DEFAULT_TMP_STORAGE_LENGTH) {
|
|
3472
|
-
this.tmpStorageLength = this.length >>> 1;
|
|
3473
|
-
}
|
|
3474
|
-
this.tmp = new Array(this.tmpStorageLength);
|
|
3475
|
-
this.stackLength = this.length < 120 ? 5 : this.length < 1542 ? 10 : this.length < 119151 ? 19 : 40;
|
|
3476
|
-
this.runStart = new Array(this.stackLength);
|
|
3477
|
-
this.runLength = new Array(this.stackLength);
|
|
3478
|
-
}
|
|
3479
|
-
TimSort2.prototype.pushRun = function pushRun(runStart, runLength) {
|
|
3480
|
-
this.runStart[this.stackSize] = runStart;
|
|
3481
|
-
this.runLength[this.stackSize] = runLength;
|
|
3482
|
-
this.stackSize += 1;
|
|
3483
|
-
};
|
|
3484
|
-
TimSort2.prototype.mergeRuns = function mergeRuns() {
|
|
3485
|
-
while (this.stackSize > 1) {
|
|
3486
|
-
var n = this.stackSize - 2;
|
|
3487
|
-
if (n >= 1 && this.runLength[n - 1] <= this.runLength[n] + this.runLength[n + 1] || n >= 2 && this.runLength[n - 2] <= this.runLength[n] + this.runLength[n - 1]) {
|
|
3488
|
-
if (this.runLength[n - 1] < this.runLength[n + 1]) {
|
|
3489
|
-
n--;
|
|
3490
|
-
}
|
|
3491
|
-
} else if (this.runLength[n] > this.runLength[n + 1]) {
|
|
3492
|
-
break;
|
|
3493
|
-
}
|
|
3494
|
-
this.mergeAt(n);
|
|
3495
|
-
}
|
|
3496
|
-
};
|
|
3497
|
-
TimSort2.prototype.forceMergeRuns = function forceMergeRuns() {
|
|
3498
|
-
while (this.stackSize > 1) {
|
|
3499
|
-
var n = this.stackSize - 2;
|
|
3500
|
-
if (n > 0 && this.runLength[n - 1] < this.runLength[n + 1]) {
|
|
3501
|
-
n--;
|
|
3502
|
-
}
|
|
3503
|
-
this.mergeAt(n);
|
|
3504
|
-
}
|
|
3505
|
-
};
|
|
3506
|
-
TimSort2.prototype.mergeAt = function mergeAt(i) {
|
|
3507
|
-
var compare = this.compare;
|
|
3508
|
-
var array = this.array;
|
|
3509
|
-
var start1 = this.runStart[i];
|
|
3510
|
-
var length1 = this.runLength[i];
|
|
3511
|
-
var start2 = this.runStart[i + 1];
|
|
3512
|
-
var length2 = this.runLength[i + 1];
|
|
3513
|
-
this.runLength[i] = length1 + length2;
|
|
3514
|
-
if (i === this.stackSize - 3) {
|
|
3515
|
-
this.runStart[i + 1] = this.runStart[i + 2];
|
|
3516
|
-
this.runLength[i + 1] = this.runLength[i + 2];
|
|
3517
|
-
}
|
|
3518
|
-
this.stackSize--;
|
|
3519
|
-
var k = gallopRight(array[start2], array, start1, length1, 0, compare);
|
|
3520
|
-
start1 += k;
|
|
3521
|
-
length1 -= k;
|
|
3522
|
-
if (length1 === 0) {
|
|
3523
|
-
return;
|
|
3524
|
-
}
|
|
3525
|
-
length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare);
|
|
3526
|
-
if (length2 === 0) {
|
|
3527
|
-
return;
|
|
3528
|
-
}
|
|
3529
|
-
if (length1 <= length2) {
|
|
3530
|
-
this.mergeLow(start1, length1, start2, length2);
|
|
3531
|
-
} else {
|
|
3532
|
-
this.mergeHigh(start1, length1, start2, length2);
|
|
3533
|
-
}
|
|
3534
|
-
};
|
|
3535
|
-
TimSort2.prototype.mergeLow = function mergeLow(start1, length1, start2, length2) {
|
|
3536
|
-
var compare = this.compare;
|
|
3537
|
-
var array = this.array;
|
|
3538
|
-
var tmp = this.tmp;
|
|
3539
|
-
var i = 0;
|
|
3540
|
-
for (i = 0; i < length1; i++) {
|
|
3541
|
-
tmp[i] = array[start1 + i];
|
|
3542
|
-
}
|
|
3543
|
-
var cursor1 = 0;
|
|
3544
|
-
var cursor2 = start2;
|
|
3545
|
-
var dest = start1;
|
|
3546
|
-
array[dest++] = array[cursor2++];
|
|
3547
|
-
if (--length2 === 0) {
|
|
3548
|
-
for (i = 0; i < length1; i++) {
|
|
3549
|
-
array[dest + i] = tmp[cursor1 + i];
|
|
3550
|
-
}
|
|
3551
|
-
return;
|
|
3552
|
-
}
|
|
3553
|
-
if (length1 === 1) {
|
|
3554
|
-
for (i = 0; i < length2; i++) {
|
|
3555
|
-
array[dest + i] = array[cursor2 + i];
|
|
3556
|
-
}
|
|
3557
|
-
array[dest + length2] = tmp[cursor1];
|
|
3558
|
-
return;
|
|
3559
|
-
}
|
|
3560
|
-
var minGallop = this.minGallop;
|
|
3561
|
-
while (true) {
|
|
3562
|
-
var count1 = 0;
|
|
3563
|
-
var count2 = 0;
|
|
3564
|
-
var exit = false;
|
|
3565
|
-
do {
|
|
3566
|
-
if (compare(array[cursor2], tmp[cursor1]) < 0) {
|
|
3567
|
-
array[dest++] = array[cursor2++];
|
|
3568
|
-
count2++;
|
|
3569
|
-
count1 = 0;
|
|
3570
|
-
if (--length2 === 0) {
|
|
3571
|
-
exit = true;
|
|
3572
|
-
break;
|
|
3573
|
-
}
|
|
3574
|
-
} else {
|
|
3575
|
-
array[dest++] = tmp[cursor1++];
|
|
3576
|
-
count1++;
|
|
3577
|
-
count2 = 0;
|
|
3578
|
-
if (--length1 === 1) {
|
|
3579
|
-
exit = true;
|
|
3580
|
-
break;
|
|
3581
|
-
}
|
|
3582
|
-
}
|
|
3583
|
-
} while ((count1 | count2) < minGallop);
|
|
3584
|
-
if (exit) {
|
|
3585
|
-
break;
|
|
3586
|
-
}
|
|
3587
|
-
do {
|
|
3588
|
-
count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare);
|
|
3589
|
-
if (count1 !== 0) {
|
|
3590
|
-
for (i = 0; i < count1; i++) {
|
|
3591
|
-
array[dest + i] = tmp[cursor1 + i];
|
|
3592
|
-
}
|
|
3593
|
-
dest += count1;
|
|
3594
|
-
cursor1 += count1;
|
|
3595
|
-
length1 -= count1;
|
|
3596
|
-
if (length1 <= 1) {
|
|
3597
|
-
exit = true;
|
|
3598
|
-
break;
|
|
3599
|
-
}
|
|
3600
|
-
}
|
|
3601
|
-
array[dest++] = array[cursor2++];
|
|
3602
|
-
if (--length2 === 0) {
|
|
3603
|
-
exit = true;
|
|
3604
|
-
break;
|
|
3605
|
-
}
|
|
3606
|
-
count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare);
|
|
3607
|
-
if (count2 !== 0) {
|
|
3608
|
-
for (i = 0; i < count2; i++) {
|
|
3609
|
-
array[dest + i] = array[cursor2 + i];
|
|
3610
|
-
}
|
|
3611
|
-
dest += count2;
|
|
3612
|
-
cursor2 += count2;
|
|
3613
|
-
length2 -= count2;
|
|
3614
|
-
if (length2 === 0) {
|
|
3615
|
-
exit = true;
|
|
3616
|
-
break;
|
|
3617
|
-
}
|
|
3618
|
-
}
|
|
3619
|
-
array[dest++] = tmp[cursor1++];
|
|
3620
|
-
if (--length1 === 1) {
|
|
3621
|
-
exit = true;
|
|
3622
|
-
break;
|
|
3623
|
-
}
|
|
3624
|
-
minGallop--;
|
|
3625
|
-
} while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);
|
|
3626
|
-
if (exit) {
|
|
3627
|
-
break;
|
|
3628
|
-
}
|
|
3629
|
-
if (minGallop < 0) {
|
|
3630
|
-
minGallop = 0;
|
|
3631
|
-
}
|
|
3632
|
-
minGallop += 2;
|
|
3633
|
-
}
|
|
3634
|
-
this.minGallop = minGallop;
|
|
3635
|
-
if (minGallop < 1) {
|
|
3636
|
-
this.minGallop = 1;
|
|
3637
|
-
}
|
|
3638
|
-
if (length1 === 1) {
|
|
3639
|
-
for (i = 0; i < length2; i++) {
|
|
3640
|
-
array[dest + i] = array[cursor2 + i];
|
|
3641
|
-
}
|
|
3642
|
-
array[dest + length2] = tmp[cursor1];
|
|
3643
|
-
} else if (length1 === 0) {
|
|
3644
|
-
throw new Error("mergeLow preconditions were not respected");
|
|
3645
|
-
} else {
|
|
3646
|
-
for (i = 0; i < length1; i++) {
|
|
3647
|
-
array[dest + i] = tmp[cursor1 + i];
|
|
3648
|
-
}
|
|
3649
|
-
}
|
|
3650
|
-
};
|
|
3651
|
-
TimSort2.prototype.mergeHigh = function mergeHigh(start1, length1, start2, length2) {
|
|
3652
|
-
var compare = this.compare;
|
|
3653
|
-
var array = this.array;
|
|
3654
|
-
var tmp = this.tmp;
|
|
3655
|
-
var i = 0;
|
|
3656
|
-
for (i = 0; i < length2; i++) {
|
|
3657
|
-
tmp[i] = array[start2 + i];
|
|
3658
|
-
}
|
|
3659
|
-
var cursor1 = start1 + length1 - 1;
|
|
3660
|
-
var cursor2 = length2 - 1;
|
|
3661
|
-
var dest = start2 + length2 - 1;
|
|
3662
|
-
var customCursor = 0;
|
|
3663
|
-
var customDest = 0;
|
|
3664
|
-
array[dest--] = array[cursor1--];
|
|
3665
|
-
if (--length1 === 0) {
|
|
3666
|
-
customCursor = dest - (length2 - 1);
|
|
3667
|
-
for (i = 0; i < length2; i++) {
|
|
3668
|
-
array[customCursor + i] = tmp[i];
|
|
3669
|
-
}
|
|
3670
|
-
return;
|
|
3671
|
-
}
|
|
3672
|
-
if (length2 === 1) {
|
|
3673
|
-
dest -= length1;
|
|
3674
|
-
cursor1 -= length1;
|
|
3675
|
-
customDest = dest + 1;
|
|
3676
|
-
customCursor = cursor1 + 1;
|
|
3677
|
-
for (i = length1 - 1; i >= 0; i--) {
|
|
3678
|
-
array[customDest + i] = array[customCursor + i];
|
|
3679
|
-
}
|
|
3680
|
-
array[dest] = tmp[cursor2];
|
|
3681
|
-
return;
|
|
3682
|
-
}
|
|
3683
|
-
var minGallop = this.minGallop;
|
|
3684
|
-
while (true) {
|
|
3685
|
-
var count1 = 0;
|
|
3686
|
-
var count2 = 0;
|
|
3687
|
-
var exit = false;
|
|
3688
|
-
do {
|
|
3689
|
-
if (compare(tmp[cursor2], array[cursor1]) < 0) {
|
|
3690
|
-
array[dest--] = array[cursor1--];
|
|
3691
|
-
count1++;
|
|
3692
|
-
count2 = 0;
|
|
3693
|
-
if (--length1 === 0) {
|
|
3694
|
-
exit = true;
|
|
3695
|
-
break;
|
|
3696
|
-
}
|
|
3697
|
-
} else {
|
|
3698
|
-
array[dest--] = tmp[cursor2--];
|
|
3699
|
-
count2++;
|
|
3700
|
-
count1 = 0;
|
|
3701
|
-
if (--length2 === 1) {
|
|
3702
|
-
exit = true;
|
|
3703
|
-
break;
|
|
3704
|
-
}
|
|
3705
|
-
}
|
|
3706
|
-
} while ((count1 | count2) < minGallop);
|
|
3707
|
-
if (exit) {
|
|
3708
|
-
break;
|
|
3709
|
-
}
|
|
3710
|
-
do {
|
|
3711
|
-
count1 = length1 - gallopRight(tmp[cursor2], array, start1, length1, length1 - 1, compare);
|
|
3712
|
-
if (count1 !== 0) {
|
|
3713
|
-
dest -= count1;
|
|
3714
|
-
cursor1 -= count1;
|
|
3715
|
-
length1 -= count1;
|
|
3716
|
-
customDest = dest + 1;
|
|
3717
|
-
customCursor = cursor1 + 1;
|
|
3718
|
-
for (i = count1 - 1; i >= 0; i--) {
|
|
3719
|
-
array[customDest + i] = array[customCursor + i];
|
|
3720
|
-
}
|
|
3721
|
-
if (length1 === 0) {
|
|
3722
|
-
exit = true;
|
|
3723
|
-
break;
|
|
3724
|
-
}
|
|
3725
|
-
}
|
|
3726
|
-
array[dest--] = tmp[cursor2--];
|
|
3727
|
-
if (--length2 === 1) {
|
|
3728
|
-
exit = true;
|
|
3729
|
-
break;
|
|
3730
|
-
}
|
|
3731
|
-
count2 = length2 - gallopLeft(array[cursor1], tmp, 0, length2, length2 - 1, compare);
|
|
3732
|
-
if (count2 !== 0) {
|
|
3733
|
-
dest -= count2;
|
|
3734
|
-
cursor2 -= count2;
|
|
3735
|
-
length2 -= count2;
|
|
3736
|
-
customDest = dest + 1;
|
|
3737
|
-
customCursor = cursor2 + 1;
|
|
3738
|
-
for (i = 0; i < count2; i++) {
|
|
3739
|
-
array[customDest + i] = tmp[customCursor + i];
|
|
3740
|
-
}
|
|
3741
|
-
if (length2 <= 1) {
|
|
3742
|
-
exit = true;
|
|
3743
|
-
break;
|
|
3744
|
-
}
|
|
3745
|
-
}
|
|
3746
|
-
array[dest--] = array[cursor1--];
|
|
3747
|
-
if (--length1 === 0) {
|
|
3748
|
-
exit = true;
|
|
3749
|
-
break;
|
|
3750
|
-
}
|
|
3751
|
-
minGallop--;
|
|
3752
|
-
} while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);
|
|
3753
|
-
if (exit) {
|
|
3754
|
-
break;
|
|
3755
|
-
}
|
|
3756
|
-
if (minGallop < 0) {
|
|
3757
|
-
minGallop = 0;
|
|
3758
|
-
}
|
|
3759
|
-
minGallop += 2;
|
|
3760
|
-
}
|
|
3761
|
-
this.minGallop = minGallop;
|
|
3762
|
-
if (minGallop < 1) {
|
|
3763
|
-
this.minGallop = 1;
|
|
3764
|
-
}
|
|
3765
|
-
if (length2 === 1) {
|
|
3766
|
-
dest -= length1;
|
|
3767
|
-
cursor1 -= length1;
|
|
3768
|
-
customDest = dest + 1;
|
|
3769
|
-
customCursor = cursor1 + 1;
|
|
3770
|
-
for (i = length1 - 1; i >= 0; i--) {
|
|
3771
|
-
array[customDest + i] = array[customCursor + i];
|
|
3772
|
-
}
|
|
3773
|
-
array[dest] = tmp[cursor2];
|
|
3774
|
-
} else if (length2 === 0) {
|
|
3775
|
-
throw new Error("mergeHigh preconditions were not respected");
|
|
3776
|
-
} else {
|
|
3777
|
-
customCursor = dest - (length2 - 1);
|
|
3778
|
-
for (i = 0; i < length2; i++) {
|
|
3779
|
-
array[customCursor + i] = tmp[i];
|
|
3780
|
-
}
|
|
3781
|
-
}
|
|
3782
|
-
};
|
|
3783
|
-
return TimSort2;
|
|
3784
|
-
}();
|
|
3785
|
-
function sort(array, compare, lo, hi) {
|
|
3786
|
-
if (!Array.isArray(array)) {
|
|
3787
|
-
throw new TypeError("Can only sort arrays");
|
|
3788
|
-
}
|
|
3789
|
-
if (!compare) {
|
|
3790
|
-
compare = alphabeticalCompare;
|
|
3791
|
-
} else if (typeof compare !== "function") {
|
|
3792
|
-
hi = lo;
|
|
3793
|
-
lo = compare;
|
|
3794
|
-
compare = alphabeticalCompare;
|
|
3795
|
-
}
|
|
3796
|
-
if (!lo) {
|
|
3797
|
-
lo = 0;
|
|
3798
|
-
}
|
|
3799
|
-
if (!hi) {
|
|
3800
|
-
hi = array.length;
|
|
3801
|
-
}
|
|
3802
|
-
var remaining = hi - lo;
|
|
3803
|
-
if (remaining < 2) {
|
|
3804
|
-
return;
|
|
3805
|
-
}
|
|
3806
|
-
var runLength = 0;
|
|
3807
|
-
if (remaining < DEFAULT_MIN_MERGE) {
|
|
3808
|
-
runLength = makeAscendingRun(array, lo, hi, compare);
|
|
3809
|
-
binaryInsertionSort(array, lo, hi, lo + runLength, compare);
|
|
3810
|
-
return;
|
|
3811
|
-
}
|
|
3812
|
-
var ts = new TimSort(array, compare);
|
|
3813
|
-
var minRun = minRunLength(remaining);
|
|
3814
|
-
do {
|
|
3815
|
-
runLength = makeAscendingRun(array, lo, hi, compare);
|
|
3816
|
-
if (runLength < minRun) {
|
|
3817
|
-
var force = remaining;
|
|
3818
|
-
if (force > minRun) {
|
|
3819
|
-
force = minRun;
|
|
3820
|
-
}
|
|
3821
|
-
binaryInsertionSort(array, lo, lo + force, lo + runLength, compare);
|
|
3822
|
-
runLength = force;
|
|
3823
|
-
}
|
|
3824
|
-
ts.pushRun(lo, runLength);
|
|
3825
|
-
ts.mergeRuns();
|
|
3826
|
-
remaining -= runLength;
|
|
3827
|
-
lo += runLength;
|
|
3828
|
-
} while (remaining !== 0);
|
|
3829
|
-
ts.forceMergeRuns();
|
|
3830
|
-
}
|
|
3831
|
-
});
|
|
3832
|
-
})(timsort$1);
|
|
3833
|
-
var ansiStyles$1 = { exports: {} };
|
|
3834
|
-
var colorName;
|
|
3835
|
-
var hasRequiredColorName;
|
|
3836
|
-
function requireColorName() {
|
|
3837
|
-
if (hasRequiredColorName)
|
|
3838
|
-
return colorName;
|
|
3839
|
-
hasRequiredColorName = 1;
|
|
3840
|
-
colorName = {
|
|
3841
|
-
"aliceblue": [240, 248, 255],
|
|
3842
|
-
"antiquewhite": [250, 235, 215],
|
|
3843
|
-
"aqua": [0, 255, 255],
|
|
3844
|
-
"aquamarine": [127, 255, 212],
|
|
3845
|
-
"azure": [240, 255, 255],
|
|
3846
|
-
"beige": [245, 245, 220],
|
|
3847
|
-
"bisque": [255, 228, 196],
|
|
3848
|
-
"black": [0, 0, 0],
|
|
3849
|
-
"blanchedalmond": [255, 235, 205],
|
|
3850
|
-
"blue": [0, 0, 255],
|
|
3851
|
-
"blueviolet": [138, 43, 226],
|
|
3852
|
-
"brown": [165, 42, 42],
|
|
3853
|
-
"burlywood": [222, 184, 135],
|
|
3854
|
-
"cadetblue": [95, 158, 160],
|
|
3855
|
-
"chartreuse": [127, 255, 0],
|
|
3856
|
-
"chocolate": [210, 105, 30],
|
|
3857
|
-
"coral": [255, 127, 80],
|
|
3858
|
-
"cornflowerblue": [100, 149, 237],
|
|
3859
|
-
"cornsilk": [255, 248, 220],
|
|
3860
|
-
"crimson": [220, 20, 60],
|
|
3861
|
-
"cyan": [0, 255, 255],
|
|
3862
|
-
"darkblue": [0, 0, 139],
|
|
3863
|
-
"darkcyan": [0, 139, 139],
|
|
3864
|
-
"darkgoldenrod": [184, 134, 11],
|
|
3865
|
-
"darkgray": [169, 169, 169],
|
|
3866
|
-
"darkgreen": [0, 100, 0],
|
|
3867
|
-
"darkgrey": [169, 169, 169],
|
|
3868
|
-
"darkkhaki": [189, 183, 107],
|
|
3869
|
-
"darkmagenta": [139, 0, 139],
|
|
3870
|
-
"darkolivegreen": [85, 107, 47],
|
|
3871
|
-
"darkorange": [255, 140, 0],
|
|
3872
|
-
"darkorchid": [153, 50, 204],
|
|
3873
|
-
"darkred": [139, 0, 0],
|
|
3874
|
-
"darksalmon": [233, 150, 122],
|
|
3875
|
-
"darkseagreen": [143, 188, 143],
|
|
3876
|
-
"darkslateblue": [72, 61, 139],
|
|
3877
|
-
"darkslategray": [47, 79, 79],
|
|
3878
|
-
"darkslategrey": [47, 79, 79],
|
|
3879
|
-
"darkturquoise": [0, 206, 209],
|
|
3880
|
-
"darkviolet": [148, 0, 211],
|
|
3881
|
-
"deeppink": [255, 20, 147],
|
|
3882
|
-
"deepskyblue": [0, 191, 255],
|
|
3883
|
-
"dimgray": [105, 105, 105],
|
|
3884
|
-
"dimgrey": [105, 105, 105],
|
|
3885
|
-
"dodgerblue": [30, 144, 255],
|
|
3886
|
-
"firebrick": [178, 34, 34],
|
|
3887
|
-
"floralwhite": [255, 250, 240],
|
|
3888
|
-
"forestgreen": [34, 139, 34],
|
|
3889
|
-
"fuchsia": [255, 0, 255],
|
|
3890
|
-
"gainsboro": [220, 220, 220],
|
|
3891
|
-
"ghostwhite": [248, 248, 255],
|
|
3892
|
-
"gold": [255, 215, 0],
|
|
3893
|
-
"goldenrod": [218, 165, 32],
|
|
3894
|
-
"gray": [128, 128, 128],
|
|
3895
|
-
"green": [0, 128, 0],
|
|
3896
|
-
"greenyellow": [173, 255, 47],
|
|
3897
|
-
"grey": [128, 128, 128],
|
|
3898
|
-
"honeydew": [240, 255, 240],
|
|
3899
|
-
"hotpink": [255, 105, 180],
|
|
3900
|
-
"indianred": [205, 92, 92],
|
|
3901
|
-
"indigo": [75, 0, 130],
|
|
3902
|
-
"ivory": [255, 255, 240],
|
|
3903
|
-
"khaki": [240, 230, 140],
|
|
3904
|
-
"lavender": [230, 230, 250],
|
|
3905
|
-
"lavenderblush": [255, 240, 245],
|
|
3906
|
-
"lawngreen": [124, 252, 0],
|
|
3907
|
-
"lemonchiffon": [255, 250, 205],
|
|
3908
|
-
"lightblue": [173, 216, 230],
|
|
3909
|
-
"lightcoral": [240, 128, 128],
|
|
3910
|
-
"lightcyan": [224, 255, 255],
|
|
3911
|
-
"lightgoldenrodyellow": [250, 250, 210],
|
|
3912
|
-
"lightgray": [211, 211, 211],
|
|
3913
|
-
"lightgreen": [144, 238, 144],
|
|
3914
|
-
"lightgrey": [211, 211, 211],
|
|
3915
|
-
"lightpink": [255, 182, 193],
|
|
3916
|
-
"lightsalmon": [255, 160, 122],
|
|
3917
|
-
"lightseagreen": [32, 178, 170],
|
|
3918
|
-
"lightskyblue": [135, 206, 250],
|
|
3919
|
-
"lightslategray": [119, 136, 153],
|
|
3920
|
-
"lightslategrey": [119, 136, 153],
|
|
3921
|
-
"lightsteelblue": [176, 196, 222],
|
|
3922
|
-
"lightyellow": [255, 255, 224],
|
|
3923
|
-
"lime": [0, 255, 0],
|
|
3924
|
-
"limegreen": [50, 205, 50],
|
|
3925
|
-
"linen": [250, 240, 230],
|
|
3926
|
-
"magenta": [255, 0, 255],
|
|
3927
|
-
"maroon": [128, 0, 0],
|
|
3928
|
-
"mediumaquamarine": [102, 205, 170],
|
|
3929
|
-
"mediumblue": [0, 0, 205],
|
|
3930
|
-
"mediumorchid": [186, 85, 211],
|
|
3931
|
-
"mediumpurple": [147, 112, 219],
|
|
3932
|
-
"mediumseagreen": [60, 179, 113],
|
|
3933
|
-
"mediumslateblue": [123, 104, 238],
|
|
3934
|
-
"mediumspringgreen": [0, 250, 154],
|
|
3935
|
-
"mediumturquoise": [72, 209, 204],
|
|
3936
|
-
"mediumvioletred": [199, 21, 133],
|
|
3937
|
-
"midnightblue": [25, 25, 112],
|
|
3938
|
-
"mintcream": [245, 255, 250],
|
|
3939
|
-
"mistyrose": [255, 228, 225],
|
|
3940
|
-
"moccasin": [255, 228, 181],
|
|
3941
|
-
"navajowhite": [255, 222, 173],
|
|
3942
|
-
"navy": [0, 0, 128],
|
|
3943
|
-
"oldlace": [253, 245, 230],
|
|
3944
|
-
"olive": [128, 128, 0],
|
|
3945
|
-
"olivedrab": [107, 142, 35],
|
|
3946
|
-
"orange": [255, 165, 0],
|
|
3947
|
-
"orangered": [255, 69, 0],
|
|
3948
|
-
"orchid": [218, 112, 214],
|
|
3949
|
-
"palegoldenrod": [238, 232, 170],
|
|
3950
|
-
"palegreen": [152, 251, 152],
|
|
3951
|
-
"paleturquoise": [175, 238, 238],
|
|
3952
|
-
"palevioletred": [219, 112, 147],
|
|
3953
|
-
"papayawhip": [255, 239, 213],
|
|
3954
|
-
"peachpuff": [255, 218, 185],
|
|
3955
|
-
"peru": [205, 133, 63],
|
|
3956
|
-
"pink": [255, 192, 203],
|
|
3957
|
-
"plum": [221, 160, 221],
|
|
3958
|
-
"powderblue": [176, 224, 230],
|
|
3959
|
-
"purple": [128, 0, 128],
|
|
3960
|
-
"rebeccapurple": [102, 51, 153],
|
|
3961
|
-
"red": [255, 0, 0],
|
|
3962
|
-
"rosybrown": [188, 143, 143],
|
|
3963
|
-
"royalblue": [65, 105, 225],
|
|
3964
|
-
"saddlebrown": [139, 69, 19],
|
|
3965
|
-
"salmon": [250, 128, 114],
|
|
3966
|
-
"sandybrown": [244, 164, 96],
|
|
3967
|
-
"seagreen": [46, 139, 87],
|
|
3968
|
-
"seashell": [255, 245, 238],
|
|
3969
|
-
"sienna": [160, 82, 45],
|
|
3970
|
-
"silver": [192, 192, 192],
|
|
3971
|
-
"skyblue": [135, 206, 235],
|
|
3972
|
-
"slateblue": [106, 90, 205],
|
|
3973
|
-
"slategray": [112, 128, 144],
|
|
3974
|
-
"slategrey": [112, 128, 144],
|
|
3975
|
-
"snow": [255, 250, 250],
|
|
3976
|
-
"springgreen": [0, 255, 127],
|
|
3977
|
-
"steelblue": [70, 130, 180],
|
|
3978
|
-
"tan": [210, 180, 140],
|
|
3979
|
-
"teal": [0, 128, 128],
|
|
3980
|
-
"thistle": [216, 191, 216],
|
|
3981
|
-
"tomato": [255, 99, 71],
|
|
3982
|
-
"turquoise": [64, 224, 208],
|
|
3983
|
-
"violet": [238, 130, 238],
|
|
3984
|
-
"wheat": [245, 222, 179],
|
|
3985
|
-
"white": [255, 255, 255],
|
|
3986
|
-
"whitesmoke": [245, 245, 245],
|
|
3987
|
-
"yellow": [255, 255, 0],
|
|
3988
|
-
"yellowgreen": [154, 205, 50]
|
|
3989
|
-
};
|
|
3990
|
-
return colorName;
|
|
3991
|
-
}
|
|
3992
|
-
var conversions;
|
|
3993
|
-
var hasRequiredConversions;
|
|
3994
|
-
function requireConversions() {
|
|
3995
|
-
if (hasRequiredConversions)
|
|
3996
|
-
return conversions;
|
|
3997
|
-
hasRequiredConversions = 1;
|
|
3998
|
-
const cssKeywords = requireColorName();
|
|
3999
|
-
const reverseKeywords = {};
|
|
4000
|
-
for (const key of Object.keys(cssKeywords)) {
|
|
4001
|
-
reverseKeywords[cssKeywords[key]] = key;
|
|
4002
|
-
}
|
|
4003
|
-
const convert = {
|
|
4004
|
-
rgb: { channels: 3, labels: "rgb" },
|
|
4005
|
-
hsl: { channels: 3, labels: "hsl" },
|
|
4006
|
-
hsv: { channels: 3, labels: "hsv" },
|
|
4007
|
-
hwb: { channels: 3, labels: "hwb" },
|
|
4008
|
-
cmyk: { channels: 4, labels: "cmyk" },
|
|
4009
|
-
xyz: { channels: 3, labels: "xyz" },
|
|
4010
|
-
lab: { channels: 3, labels: "lab" },
|
|
4011
|
-
lch: { channels: 3, labels: "lch" },
|
|
4012
|
-
hex: { channels: 1, labels: ["hex"] },
|
|
4013
|
-
keyword: { channels: 1, labels: ["keyword"] },
|
|
4014
|
-
ansi16: { channels: 1, labels: ["ansi16"] },
|
|
4015
|
-
ansi256: { channels: 1, labels: ["ansi256"] },
|
|
4016
|
-
hcg: { channels: 3, labels: ["h", "c", "g"] },
|
|
4017
|
-
apple: { channels: 3, labels: ["r16", "g16", "b16"] },
|
|
4018
|
-
gray: { channels: 1, labels: ["gray"] }
|
|
4019
|
-
};
|
|
4020
|
-
conversions = convert;
|
|
4021
|
-
for (const model of Object.keys(convert)) {
|
|
4022
|
-
if (!("channels" in convert[model])) {
|
|
4023
|
-
throw new Error("missing channels property: " + model);
|
|
4024
|
-
}
|
|
4025
|
-
if (!("labels" in convert[model])) {
|
|
4026
|
-
throw new Error("missing channel labels property: " + model);
|
|
4027
|
-
}
|
|
4028
|
-
if (convert[model].labels.length !== convert[model].channels) {
|
|
4029
|
-
throw new Error("channel and label counts mismatch: " + model);
|
|
4030
|
-
}
|
|
4031
|
-
const { channels, labels } = convert[model];
|
|
4032
|
-
delete convert[model].channels;
|
|
4033
|
-
delete convert[model].labels;
|
|
4034
|
-
Object.defineProperty(convert[model], "channels", { value: channels });
|
|
4035
|
-
Object.defineProperty(convert[model], "labels", { value: labels });
|
|
4036
|
-
}
|
|
4037
|
-
convert.rgb.hsl = function(rgb) {
|
|
4038
|
-
const r = rgb[0] / 255;
|
|
4039
|
-
const g = rgb[1] / 255;
|
|
4040
|
-
const b = rgb[2] / 255;
|
|
4041
|
-
const min = Math.min(r, g, b);
|
|
4042
|
-
const max = Math.max(r, g, b);
|
|
4043
|
-
const delta = max - min;
|
|
4044
|
-
let h;
|
|
4045
|
-
let s;
|
|
4046
|
-
if (max === min) {
|
|
4047
|
-
h = 0;
|
|
4048
|
-
} else if (r === max) {
|
|
4049
|
-
h = (g - b) / delta;
|
|
4050
|
-
} else if (g === max) {
|
|
4051
|
-
h = 2 + (b - r) / delta;
|
|
4052
|
-
} else if (b === max) {
|
|
4053
|
-
h = 4 + (r - g) / delta;
|
|
4054
|
-
}
|
|
4055
|
-
h = Math.min(h * 60, 360);
|
|
4056
|
-
if (h < 0) {
|
|
4057
|
-
h += 360;
|
|
4058
|
-
}
|
|
4059
|
-
const l = (min + max) / 2;
|
|
4060
|
-
if (max === min) {
|
|
4061
|
-
s = 0;
|
|
4062
|
-
} else if (l <= 0.5) {
|
|
4063
|
-
s = delta / (max + min);
|
|
4064
|
-
} else {
|
|
4065
|
-
s = delta / (2 - max - min);
|
|
4066
|
-
}
|
|
4067
|
-
return [h, s * 100, l * 100];
|
|
4068
|
-
};
|
|
4069
|
-
convert.rgb.hsv = function(rgb) {
|
|
4070
|
-
let rdif;
|
|
4071
|
-
let gdif;
|
|
4072
|
-
let bdif;
|
|
4073
|
-
let h;
|
|
4074
|
-
let s;
|
|
4075
|
-
const r = rgb[0] / 255;
|
|
4076
|
-
const g = rgb[1] / 255;
|
|
4077
|
-
const b = rgb[2] / 255;
|
|
4078
|
-
const v = Math.max(r, g, b);
|
|
4079
|
-
const diff = v - Math.min(r, g, b);
|
|
4080
|
-
const diffc = function(c) {
|
|
4081
|
-
return (v - c) / 6 / diff + 1 / 2;
|
|
4082
|
-
};
|
|
4083
|
-
if (diff === 0) {
|
|
4084
|
-
h = 0;
|
|
4085
|
-
s = 0;
|
|
4086
|
-
} else {
|
|
4087
|
-
s = diff / v;
|
|
4088
|
-
rdif = diffc(r);
|
|
4089
|
-
gdif = diffc(g);
|
|
4090
|
-
bdif = diffc(b);
|
|
4091
|
-
if (r === v) {
|
|
4092
|
-
h = bdif - gdif;
|
|
4093
|
-
} else if (g === v) {
|
|
4094
|
-
h = 1 / 3 + rdif - bdif;
|
|
4095
|
-
} else if (b === v) {
|
|
4096
|
-
h = 2 / 3 + gdif - rdif;
|
|
4097
|
-
}
|
|
4098
|
-
if (h < 0) {
|
|
4099
|
-
h += 1;
|
|
4100
|
-
} else if (h > 1) {
|
|
4101
|
-
h -= 1;
|
|
4102
|
-
}
|
|
4103
|
-
}
|
|
4104
|
-
return [
|
|
4105
|
-
h * 360,
|
|
4106
|
-
s * 100,
|
|
4107
|
-
v * 100
|
|
4108
|
-
];
|
|
4109
|
-
};
|
|
4110
|
-
convert.rgb.hwb = function(rgb) {
|
|
4111
|
-
const r = rgb[0];
|
|
4112
|
-
const g = rgb[1];
|
|
4113
|
-
let b = rgb[2];
|
|
4114
|
-
const h = convert.rgb.hsl(rgb)[0];
|
|
4115
|
-
const w = 1 / 255 * Math.min(r, Math.min(g, b));
|
|
4116
|
-
b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
|
|
4117
|
-
return [h, w * 100, b * 100];
|
|
4118
|
-
};
|
|
4119
|
-
convert.rgb.cmyk = function(rgb) {
|
|
4120
|
-
const r = rgb[0] / 255;
|
|
4121
|
-
const g = rgb[1] / 255;
|
|
4122
|
-
const b = rgb[2] / 255;
|
|
4123
|
-
const k = Math.min(1 - r, 1 - g, 1 - b);
|
|
4124
|
-
const c = (1 - r - k) / (1 - k) || 0;
|
|
4125
|
-
const m = (1 - g - k) / (1 - k) || 0;
|
|
4126
|
-
const y = (1 - b - k) / (1 - k) || 0;
|
|
4127
|
-
return [c * 100, m * 100, y * 100, k * 100];
|
|
4128
|
-
};
|
|
4129
|
-
function comparativeDistance(x, y) {
|
|
4130
|
-
return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
|
|
4131
|
-
}
|
|
4132
|
-
convert.rgb.keyword = function(rgb) {
|
|
4133
|
-
const reversed = reverseKeywords[rgb];
|
|
4134
|
-
if (reversed) {
|
|
4135
|
-
return reversed;
|
|
4136
|
-
}
|
|
4137
|
-
let currentClosestDistance = Infinity;
|
|
4138
|
-
let currentClosestKeyword;
|
|
4139
|
-
for (const keyword of Object.keys(cssKeywords)) {
|
|
4140
|
-
const value = cssKeywords[keyword];
|
|
4141
|
-
const distance = comparativeDistance(rgb, value);
|
|
4142
|
-
if (distance < currentClosestDistance) {
|
|
4143
|
-
currentClosestDistance = distance;
|
|
4144
|
-
currentClosestKeyword = keyword;
|
|
4145
|
-
}
|
|
4146
|
-
}
|
|
4147
|
-
return currentClosestKeyword;
|
|
4148
|
-
};
|
|
4149
|
-
convert.keyword.rgb = function(keyword) {
|
|
4150
|
-
return cssKeywords[keyword];
|
|
4151
|
-
};
|
|
4152
|
-
convert.rgb.xyz = function(rgb) {
|
|
4153
|
-
let r = rgb[0] / 255;
|
|
4154
|
-
let g = rgb[1] / 255;
|
|
4155
|
-
let b = rgb[2] / 255;
|
|
4156
|
-
r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
|
|
4157
|
-
g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
|
|
4158
|
-
b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
|
|
4159
|
-
const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
|
|
4160
|
-
const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
|
|
4161
|
-
const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
|
|
4162
|
-
return [x * 100, y * 100, z * 100];
|
|
4163
|
-
};
|
|
4164
|
-
convert.rgb.lab = function(rgb) {
|
|
4165
|
-
const xyz = convert.rgb.xyz(rgb);
|
|
4166
|
-
let x = xyz[0];
|
|
4167
|
-
let y = xyz[1];
|
|
4168
|
-
let z = xyz[2];
|
|
4169
|
-
x /= 95.047;
|
|
4170
|
-
y /= 100;
|
|
4171
|
-
z /= 108.883;
|
|
4172
|
-
x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
4173
|
-
y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
4174
|
-
z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
4175
|
-
const l = 116 * y - 16;
|
|
4176
|
-
const a = 500 * (x - y);
|
|
4177
|
-
const b = 200 * (y - z);
|
|
4178
|
-
return [l, a, b];
|
|
4179
|
-
};
|
|
4180
|
-
convert.hsl.rgb = function(hsl) {
|
|
4181
|
-
const h = hsl[0] / 360;
|
|
4182
|
-
const s = hsl[1] / 100;
|
|
4183
|
-
const l = hsl[2] / 100;
|
|
4184
|
-
let t2;
|
|
4185
|
-
let t3;
|
|
4186
|
-
let val;
|
|
4187
|
-
if (s === 0) {
|
|
4188
|
-
val = l * 255;
|
|
4189
|
-
return [val, val, val];
|
|
4190
|
-
}
|
|
4191
|
-
if (l < 0.5) {
|
|
4192
|
-
t2 = l * (1 + s);
|
|
4193
|
-
} else {
|
|
4194
|
-
t2 = l + s - l * s;
|
|
4195
|
-
}
|
|
4196
|
-
const t1 = 2 * l - t2;
|
|
4197
|
-
const rgb = [0, 0, 0];
|
|
4198
|
-
for (let i = 0; i < 3; i++) {
|
|
4199
|
-
t3 = h + 1 / 3 * -(i - 1);
|
|
4200
|
-
if (t3 < 0) {
|
|
4201
|
-
t3++;
|
|
4202
|
-
}
|
|
4203
|
-
if (t3 > 1) {
|
|
4204
|
-
t3--;
|
|
4205
|
-
}
|
|
4206
|
-
if (6 * t3 < 1) {
|
|
4207
|
-
val = t1 + (t2 - t1) * 6 * t3;
|
|
4208
|
-
} else if (2 * t3 < 1) {
|
|
4209
|
-
val = t2;
|
|
4210
|
-
} else if (3 * t3 < 2) {
|
|
4211
|
-
val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
|
4212
|
-
} else {
|
|
4213
|
-
val = t1;
|
|
4214
|
-
}
|
|
4215
|
-
rgb[i] = val * 255;
|
|
4216
|
-
}
|
|
4217
|
-
return rgb;
|
|
4218
|
-
};
|
|
4219
|
-
convert.hsl.hsv = function(hsl) {
|
|
4220
|
-
const h = hsl[0];
|
|
4221
|
-
let s = hsl[1] / 100;
|
|
4222
|
-
let l = hsl[2] / 100;
|
|
4223
|
-
let smin = s;
|
|
4224
|
-
const lmin = Math.max(l, 0.01);
|
|
4225
|
-
l *= 2;
|
|
4226
|
-
s *= l <= 1 ? l : 2 - l;
|
|
4227
|
-
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
4228
|
-
const v = (l + s) / 2;
|
|
4229
|
-
const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
|
|
4230
|
-
return [h, sv * 100, v * 100];
|
|
4231
|
-
};
|
|
4232
|
-
convert.hsv.rgb = function(hsv) {
|
|
4233
|
-
const h = hsv[0] / 60;
|
|
4234
|
-
const s = hsv[1] / 100;
|
|
4235
|
-
let v = hsv[2] / 100;
|
|
4236
|
-
const hi = Math.floor(h) % 6;
|
|
4237
|
-
const f = h - Math.floor(h);
|
|
4238
|
-
const p = 255 * v * (1 - s);
|
|
4239
|
-
const q = 255 * v * (1 - s * f);
|
|
4240
|
-
const t = 255 * v * (1 - s * (1 - f));
|
|
4241
|
-
v *= 255;
|
|
4242
|
-
switch (hi) {
|
|
4243
|
-
case 0:
|
|
4244
|
-
return [v, t, p];
|
|
4245
|
-
case 1:
|
|
4246
|
-
return [q, v, p];
|
|
4247
|
-
case 2:
|
|
4248
|
-
return [p, v, t];
|
|
4249
|
-
case 3:
|
|
4250
|
-
return [p, q, v];
|
|
4251
|
-
case 4:
|
|
4252
|
-
return [t, p, v];
|
|
4253
|
-
case 5:
|
|
4254
|
-
return [v, p, q];
|
|
4255
|
-
}
|
|
4256
|
-
};
|
|
4257
|
-
convert.hsv.hsl = function(hsv) {
|
|
4258
|
-
const h = hsv[0];
|
|
4259
|
-
const s = hsv[1] / 100;
|
|
4260
|
-
const v = hsv[2] / 100;
|
|
4261
|
-
const vmin = Math.max(v, 0.01);
|
|
4262
|
-
let sl;
|
|
4263
|
-
let l;
|
|
4264
|
-
l = (2 - s) * v;
|
|
4265
|
-
const lmin = (2 - s) * vmin;
|
|
4266
|
-
sl = s * vmin;
|
|
4267
|
-
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
4268
|
-
sl = sl || 0;
|
|
4269
|
-
l /= 2;
|
|
4270
|
-
return [h, sl * 100, l * 100];
|
|
4271
|
-
};
|
|
4272
|
-
convert.hwb.rgb = function(hwb) {
|
|
4273
|
-
const h = hwb[0] / 360;
|
|
4274
|
-
let wh = hwb[1] / 100;
|
|
4275
|
-
let bl = hwb[2] / 100;
|
|
4276
|
-
const ratio = wh + bl;
|
|
4277
|
-
let f;
|
|
4278
|
-
if (ratio > 1) {
|
|
4279
|
-
wh /= ratio;
|
|
4280
|
-
bl /= ratio;
|
|
4281
|
-
}
|
|
4282
|
-
const i = Math.floor(6 * h);
|
|
4283
|
-
const v = 1 - bl;
|
|
4284
|
-
f = 6 * h - i;
|
|
4285
|
-
if ((i & 1) !== 0) {
|
|
4286
|
-
f = 1 - f;
|
|
4287
|
-
}
|
|
4288
|
-
const n = wh + f * (v - wh);
|
|
4289
|
-
let r;
|
|
4290
|
-
let g;
|
|
4291
|
-
let b;
|
|
4292
|
-
switch (i) {
|
|
4293
|
-
default:
|
|
4294
|
-
case 6:
|
|
4295
|
-
case 0:
|
|
4296
|
-
r = v;
|
|
4297
|
-
g = n;
|
|
4298
|
-
b = wh;
|
|
4299
|
-
break;
|
|
4300
|
-
case 1:
|
|
4301
|
-
r = n;
|
|
4302
|
-
g = v;
|
|
4303
|
-
b = wh;
|
|
4304
|
-
break;
|
|
4305
|
-
case 2:
|
|
4306
|
-
r = wh;
|
|
4307
|
-
g = v;
|
|
4308
|
-
b = n;
|
|
4309
|
-
break;
|
|
4310
|
-
case 3:
|
|
4311
|
-
r = wh;
|
|
4312
|
-
g = n;
|
|
4313
|
-
b = v;
|
|
4314
|
-
break;
|
|
4315
|
-
case 4:
|
|
4316
|
-
r = n;
|
|
4317
|
-
g = wh;
|
|
4318
|
-
b = v;
|
|
4319
|
-
break;
|
|
4320
|
-
case 5:
|
|
4321
|
-
r = v;
|
|
4322
|
-
g = wh;
|
|
4323
|
-
b = n;
|
|
4324
|
-
break;
|
|
4325
|
-
}
|
|
4326
|
-
return [r * 255, g * 255, b * 255];
|
|
4327
|
-
};
|
|
4328
|
-
convert.cmyk.rgb = function(cmyk) {
|
|
4329
|
-
const c = cmyk[0] / 100;
|
|
4330
|
-
const m = cmyk[1] / 100;
|
|
4331
|
-
const y = cmyk[2] / 100;
|
|
4332
|
-
const k = cmyk[3] / 100;
|
|
4333
|
-
const r = 1 - Math.min(1, c * (1 - k) + k);
|
|
4334
|
-
const g = 1 - Math.min(1, m * (1 - k) + k);
|
|
4335
|
-
const b = 1 - Math.min(1, y * (1 - k) + k);
|
|
4336
|
-
return [r * 255, g * 255, b * 255];
|
|
4337
|
-
};
|
|
4338
|
-
convert.xyz.rgb = function(xyz) {
|
|
4339
|
-
const x = xyz[0] / 100;
|
|
4340
|
-
const y = xyz[1] / 100;
|
|
4341
|
-
const z = xyz[2] / 100;
|
|
4342
|
-
let r;
|
|
4343
|
-
let g;
|
|
4344
|
-
let b;
|
|
4345
|
-
r = x * 3.2406 + y * -1.5372 + z * -0.4986;
|
|
4346
|
-
g = x * -0.9689 + y * 1.8758 + z * 0.0415;
|
|
4347
|
-
b = x * 0.0557 + y * -0.204 + z * 1.057;
|
|
4348
|
-
r = r > 31308e-7 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92;
|
|
4349
|
-
g = g > 31308e-7 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92;
|
|
4350
|
-
b = b > 31308e-7 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92;
|
|
4351
|
-
r = Math.min(Math.max(0, r), 1);
|
|
4352
|
-
g = Math.min(Math.max(0, g), 1);
|
|
4353
|
-
b = Math.min(Math.max(0, b), 1);
|
|
4354
|
-
return [r * 255, g * 255, b * 255];
|
|
4355
|
-
};
|
|
4356
|
-
convert.xyz.lab = function(xyz) {
|
|
4357
|
-
let x = xyz[0];
|
|
4358
|
-
let y = xyz[1];
|
|
4359
|
-
let z = xyz[2];
|
|
4360
|
-
x /= 95.047;
|
|
4361
|
-
y /= 100;
|
|
4362
|
-
z /= 108.883;
|
|
4363
|
-
x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
4364
|
-
y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
4365
|
-
z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
4366
|
-
const l = 116 * y - 16;
|
|
4367
|
-
const a = 500 * (x - y);
|
|
4368
|
-
const b = 200 * (y - z);
|
|
4369
|
-
return [l, a, b];
|
|
4370
|
-
};
|
|
4371
|
-
convert.lab.xyz = function(lab) {
|
|
4372
|
-
const l = lab[0];
|
|
4373
|
-
const a = lab[1];
|
|
4374
|
-
const b = lab[2];
|
|
4375
|
-
let x;
|
|
4376
|
-
let y;
|
|
4377
|
-
let z;
|
|
4378
|
-
y = (l + 16) / 116;
|
|
4379
|
-
x = a / 500 + y;
|
|
4380
|
-
z = y - b / 200;
|
|
4381
|
-
const y2 = y ** 3;
|
|
4382
|
-
const x2 = x ** 3;
|
|
4383
|
-
const z2 = z ** 3;
|
|
4384
|
-
y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787;
|
|
4385
|
-
x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787;
|
|
4386
|
-
z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787;
|
|
4387
|
-
x *= 95.047;
|
|
4388
|
-
y *= 100;
|
|
4389
|
-
z *= 108.883;
|
|
4390
|
-
return [x, y, z];
|
|
4391
|
-
};
|
|
4392
|
-
convert.lab.lch = function(lab) {
|
|
4393
|
-
const l = lab[0];
|
|
4394
|
-
const a = lab[1];
|
|
4395
|
-
const b = lab[2];
|
|
4396
|
-
let h;
|
|
4397
|
-
const hr = Math.atan2(b, a);
|
|
4398
|
-
h = hr * 360 / 2 / Math.PI;
|
|
4399
|
-
if (h < 0) {
|
|
4400
|
-
h += 360;
|
|
4401
|
-
}
|
|
4402
|
-
const c = Math.sqrt(a * a + b * b);
|
|
4403
|
-
return [l, c, h];
|
|
4404
|
-
};
|
|
4405
|
-
convert.lch.lab = function(lch) {
|
|
4406
|
-
const l = lch[0];
|
|
4407
|
-
const c = lch[1];
|
|
4408
|
-
const h = lch[2];
|
|
4409
|
-
const hr = h / 360 * 2 * Math.PI;
|
|
4410
|
-
const a = c * Math.cos(hr);
|
|
4411
|
-
const b = c * Math.sin(hr);
|
|
4412
|
-
return [l, a, b];
|
|
4413
|
-
};
|
|
4414
|
-
convert.rgb.ansi16 = function(args, saturation = null) {
|
|
4415
|
-
const [r, g, b] = args;
|
|
4416
|
-
let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
|
|
4417
|
-
value = Math.round(value / 50);
|
|
4418
|
-
if (value === 0) {
|
|
4419
|
-
return 30;
|
|
4420
|
-
}
|
|
4421
|
-
let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
|
|
4422
|
-
if (value === 2) {
|
|
4423
|
-
ansi += 60;
|
|
4424
|
-
}
|
|
4425
|
-
return ansi;
|
|
4426
|
-
};
|
|
4427
|
-
convert.hsv.ansi16 = function(args) {
|
|
4428
|
-
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
|
4429
|
-
};
|
|
4430
|
-
convert.rgb.ansi256 = function(args) {
|
|
4431
|
-
const r = args[0];
|
|
4432
|
-
const g = args[1];
|
|
4433
|
-
const b = args[2];
|
|
4434
|
-
if (r === g && g === b) {
|
|
4435
|
-
if (r < 8) {
|
|
4436
|
-
return 16;
|
|
4437
|
-
}
|
|
4438
|
-
if (r > 248) {
|
|
4439
|
-
return 231;
|
|
4440
|
-
}
|
|
4441
|
-
return Math.round((r - 8) / 247 * 24) + 232;
|
|
4442
|
-
}
|
|
4443
|
-
const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
|
|
4444
|
-
return ansi;
|
|
4445
|
-
};
|
|
4446
|
-
convert.ansi16.rgb = function(args) {
|
|
4447
|
-
let color = args % 10;
|
|
4448
|
-
if (color === 0 || color === 7) {
|
|
4449
|
-
if (args > 50) {
|
|
4450
|
-
color += 3.5;
|
|
4451
|
-
}
|
|
4452
|
-
color = color / 10.5 * 255;
|
|
4453
|
-
return [color, color, color];
|
|
4454
|
-
}
|
|
4455
|
-
const mult = (~~(args > 50) + 1) * 0.5;
|
|
4456
|
-
const r = (color & 1) * mult * 255;
|
|
4457
|
-
const g = (color >> 1 & 1) * mult * 255;
|
|
4458
|
-
const b = (color >> 2 & 1) * mult * 255;
|
|
4459
|
-
return [r, g, b];
|
|
4460
|
-
};
|
|
4461
|
-
convert.ansi256.rgb = function(args) {
|
|
4462
|
-
if (args >= 232) {
|
|
4463
|
-
const c = (args - 232) * 10 + 8;
|
|
4464
|
-
return [c, c, c];
|
|
4465
|
-
}
|
|
4466
|
-
args -= 16;
|
|
4467
|
-
let rem;
|
|
4468
|
-
const r = Math.floor(args / 36) / 5 * 255;
|
|
4469
|
-
const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
|
|
4470
|
-
const b = rem % 6 / 5 * 255;
|
|
4471
|
-
return [r, g, b];
|
|
4472
|
-
};
|
|
4473
|
-
convert.rgb.hex = function(args) {
|
|
4474
|
-
const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
|
|
4475
|
-
const string = integer.toString(16).toUpperCase();
|
|
4476
|
-
return "000000".substring(string.length) + string;
|
|
4477
|
-
};
|
|
4478
|
-
convert.hex.rgb = function(args) {
|
|
4479
|
-
const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
4480
|
-
if (!match) {
|
|
4481
|
-
return [0, 0, 0];
|
|
4482
|
-
}
|
|
4483
|
-
let colorString = match[0];
|
|
4484
|
-
if (match[0].length === 3) {
|
|
4485
|
-
colorString = colorString.split("").map((char) => {
|
|
4486
|
-
return char + char;
|
|
4487
|
-
}).join("");
|
|
4488
|
-
}
|
|
4489
|
-
const integer = parseInt(colorString, 16);
|
|
4490
|
-
const r = integer >> 16 & 255;
|
|
4491
|
-
const g = integer >> 8 & 255;
|
|
4492
|
-
const b = integer & 255;
|
|
4493
|
-
return [r, g, b];
|
|
4494
|
-
};
|
|
4495
|
-
convert.rgb.hcg = function(rgb) {
|
|
4496
|
-
const r = rgb[0] / 255;
|
|
4497
|
-
const g = rgb[1] / 255;
|
|
4498
|
-
const b = rgb[2] / 255;
|
|
4499
|
-
const max = Math.max(Math.max(r, g), b);
|
|
4500
|
-
const min = Math.min(Math.min(r, g), b);
|
|
4501
|
-
const chroma = max - min;
|
|
4502
|
-
let grayscale;
|
|
4503
|
-
let hue;
|
|
4504
|
-
if (chroma < 1) {
|
|
4505
|
-
grayscale = min / (1 - chroma);
|
|
4506
|
-
} else {
|
|
4507
|
-
grayscale = 0;
|
|
4508
|
-
}
|
|
4509
|
-
if (chroma <= 0) {
|
|
4510
|
-
hue = 0;
|
|
4511
|
-
} else if (max === r) {
|
|
4512
|
-
hue = (g - b) / chroma % 6;
|
|
4513
|
-
} else if (max === g) {
|
|
4514
|
-
hue = 2 + (b - r) / chroma;
|
|
4515
|
-
} else {
|
|
4516
|
-
hue = 4 + (r - g) / chroma;
|
|
4517
|
-
}
|
|
4518
|
-
hue /= 6;
|
|
4519
|
-
hue %= 1;
|
|
4520
|
-
return [hue * 360, chroma * 100, grayscale * 100];
|
|
4521
|
-
};
|
|
4522
|
-
convert.hsl.hcg = function(hsl) {
|
|
4523
|
-
const s = hsl[1] / 100;
|
|
4524
|
-
const l = hsl[2] / 100;
|
|
4525
|
-
const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l);
|
|
4526
|
-
let f = 0;
|
|
4527
|
-
if (c < 1) {
|
|
4528
|
-
f = (l - 0.5 * c) / (1 - c);
|
|
4529
|
-
}
|
|
4530
|
-
return [hsl[0], c * 100, f * 100];
|
|
4531
|
-
};
|
|
4532
|
-
convert.hsv.hcg = function(hsv) {
|
|
4533
|
-
const s = hsv[1] / 100;
|
|
4534
|
-
const v = hsv[2] / 100;
|
|
4535
|
-
const c = s * v;
|
|
4536
|
-
let f = 0;
|
|
4537
|
-
if (c < 1) {
|
|
4538
|
-
f = (v - c) / (1 - c);
|
|
4539
|
-
}
|
|
4540
|
-
return [hsv[0], c * 100, f * 100];
|
|
4541
|
-
};
|
|
4542
|
-
convert.hcg.rgb = function(hcg) {
|
|
4543
|
-
const h = hcg[0] / 360;
|
|
4544
|
-
const c = hcg[1] / 100;
|
|
4545
|
-
const g = hcg[2] / 100;
|
|
4546
|
-
if (c === 0) {
|
|
4547
|
-
return [g * 255, g * 255, g * 255];
|
|
4548
|
-
}
|
|
4549
|
-
const pure = [0, 0, 0];
|
|
4550
|
-
const hi = h % 1 * 6;
|
|
4551
|
-
const v = hi % 1;
|
|
4552
|
-
const w = 1 - v;
|
|
4553
|
-
let mg = 0;
|
|
4554
|
-
switch (Math.floor(hi)) {
|
|
4555
|
-
case 0:
|
|
4556
|
-
pure[0] = 1;
|
|
4557
|
-
pure[1] = v;
|
|
4558
|
-
pure[2] = 0;
|
|
4559
|
-
break;
|
|
4560
|
-
case 1:
|
|
4561
|
-
pure[0] = w;
|
|
4562
|
-
pure[1] = 1;
|
|
4563
|
-
pure[2] = 0;
|
|
4564
|
-
break;
|
|
4565
|
-
case 2:
|
|
4566
|
-
pure[0] = 0;
|
|
4567
|
-
pure[1] = 1;
|
|
4568
|
-
pure[2] = v;
|
|
4569
|
-
break;
|
|
4570
|
-
case 3:
|
|
4571
|
-
pure[0] = 0;
|
|
4572
|
-
pure[1] = w;
|
|
4573
|
-
pure[2] = 1;
|
|
4574
|
-
break;
|
|
4575
|
-
case 4:
|
|
4576
|
-
pure[0] = v;
|
|
4577
|
-
pure[1] = 0;
|
|
4578
|
-
pure[2] = 1;
|
|
4579
|
-
break;
|
|
4580
|
-
default:
|
|
4581
|
-
pure[0] = 1;
|
|
4582
|
-
pure[1] = 0;
|
|
4583
|
-
pure[2] = w;
|
|
4584
|
-
}
|
|
4585
|
-
mg = (1 - c) * g;
|
|
4586
|
-
return [
|
|
4587
|
-
(c * pure[0] + mg) * 255,
|
|
4588
|
-
(c * pure[1] + mg) * 255,
|
|
4589
|
-
(c * pure[2] + mg) * 255
|
|
4590
|
-
];
|
|
4591
|
-
};
|
|
4592
|
-
convert.hcg.hsv = function(hcg) {
|
|
4593
|
-
const c = hcg[1] / 100;
|
|
4594
|
-
const g = hcg[2] / 100;
|
|
4595
|
-
const v = c + g * (1 - c);
|
|
4596
|
-
let f = 0;
|
|
4597
|
-
if (v > 0) {
|
|
4598
|
-
f = c / v;
|
|
4599
|
-
}
|
|
4600
|
-
return [hcg[0], f * 100, v * 100];
|
|
4601
|
-
};
|
|
4602
|
-
convert.hcg.hsl = function(hcg) {
|
|
4603
|
-
const c = hcg[1] / 100;
|
|
4604
|
-
const g = hcg[2] / 100;
|
|
4605
|
-
const l = g * (1 - c) + 0.5 * c;
|
|
4606
|
-
let s = 0;
|
|
4607
|
-
if (l > 0 && l < 0.5) {
|
|
4608
|
-
s = c / (2 * l);
|
|
4609
|
-
} else if (l >= 0.5 && l < 1) {
|
|
4610
|
-
s = c / (2 * (1 - l));
|
|
4611
|
-
}
|
|
4612
|
-
return [hcg[0], s * 100, l * 100];
|
|
4613
|
-
};
|
|
4614
|
-
convert.hcg.hwb = function(hcg) {
|
|
4615
|
-
const c = hcg[1] / 100;
|
|
4616
|
-
const g = hcg[2] / 100;
|
|
4617
|
-
const v = c + g * (1 - c);
|
|
4618
|
-
return [hcg[0], (v - c) * 100, (1 - v) * 100];
|
|
4619
|
-
};
|
|
4620
|
-
convert.hwb.hcg = function(hwb) {
|
|
4621
|
-
const w = hwb[1] / 100;
|
|
4622
|
-
const b = hwb[2] / 100;
|
|
4623
|
-
const v = 1 - b;
|
|
4624
|
-
const c = v - w;
|
|
4625
|
-
let g = 0;
|
|
4626
|
-
if (c < 1) {
|
|
4627
|
-
g = (v - c) / (1 - c);
|
|
4628
|
-
}
|
|
4629
|
-
return [hwb[0], c * 100, g * 100];
|
|
4630
|
-
};
|
|
4631
|
-
convert.apple.rgb = function(apple) {
|
|
4632
|
-
return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
|
|
4633
|
-
};
|
|
4634
|
-
convert.rgb.apple = function(rgb) {
|
|
4635
|
-
return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
|
|
4636
|
-
};
|
|
4637
|
-
convert.gray.rgb = function(args) {
|
|
4638
|
-
return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
|
|
4639
|
-
};
|
|
4640
|
-
convert.gray.hsl = function(args) {
|
|
4641
|
-
return [0, 0, args[0]];
|
|
4642
|
-
};
|
|
4643
|
-
convert.gray.hsv = convert.gray.hsl;
|
|
4644
|
-
convert.gray.hwb = function(gray) {
|
|
4645
|
-
return [0, 100, gray[0]];
|
|
4646
|
-
};
|
|
4647
|
-
convert.gray.cmyk = function(gray) {
|
|
4648
|
-
return [0, 0, 0, gray[0]];
|
|
4649
|
-
};
|
|
4650
|
-
convert.gray.lab = function(gray) {
|
|
4651
|
-
return [gray[0], 0, 0];
|
|
4652
|
-
};
|
|
4653
|
-
convert.gray.hex = function(gray) {
|
|
4654
|
-
const val = Math.round(gray[0] / 100 * 255) & 255;
|
|
4655
|
-
const integer = (val << 16) + (val << 8) + val;
|
|
4656
|
-
const string = integer.toString(16).toUpperCase();
|
|
4657
|
-
return "000000".substring(string.length) + string;
|
|
4658
|
-
};
|
|
4659
|
-
convert.rgb.gray = function(rgb) {
|
|
4660
|
-
const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
4661
|
-
return [val / 255 * 100];
|
|
4662
|
-
};
|
|
4663
|
-
return conversions;
|
|
4664
|
-
}
|
|
4665
|
-
var route;
|
|
4666
|
-
var hasRequiredRoute;
|
|
4667
|
-
function requireRoute() {
|
|
4668
|
-
if (hasRequiredRoute)
|
|
4669
|
-
return route;
|
|
4670
|
-
hasRequiredRoute = 1;
|
|
4671
|
-
const conversions2 = requireConversions();
|
|
4672
|
-
function buildGraph() {
|
|
4673
|
-
const graph = {};
|
|
4674
|
-
const models = Object.keys(conversions2);
|
|
4675
|
-
for (let len = models.length, i = 0; i < len; i++) {
|
|
4676
|
-
graph[models[i]] = {
|
|
4677
|
-
// http://jsperf.com/1-vs-infinity
|
|
4678
|
-
// micro-opt, but this is simple.
|
|
4679
|
-
distance: -1,
|
|
4680
|
-
parent: null
|
|
4681
|
-
};
|
|
4682
|
-
}
|
|
4683
|
-
return graph;
|
|
4684
|
-
}
|
|
4685
|
-
function deriveBFS(fromModel) {
|
|
4686
|
-
const graph = buildGraph();
|
|
4687
|
-
const queue = [fromModel];
|
|
4688
|
-
graph[fromModel].distance = 0;
|
|
4689
|
-
while (queue.length) {
|
|
4690
|
-
const current = queue.pop();
|
|
4691
|
-
const adjacents = Object.keys(conversions2[current]);
|
|
4692
|
-
for (let len = adjacents.length, i = 0; i < len; i++) {
|
|
4693
|
-
const adjacent = adjacents[i];
|
|
4694
|
-
const node = graph[adjacent];
|
|
4695
|
-
if (node.distance === -1) {
|
|
4696
|
-
node.distance = graph[current].distance + 1;
|
|
4697
|
-
node.parent = current;
|
|
4698
|
-
queue.unshift(adjacent);
|
|
4699
|
-
}
|
|
4700
|
-
}
|
|
4701
|
-
}
|
|
4702
|
-
return graph;
|
|
4703
|
-
}
|
|
4704
|
-
function link(from, to) {
|
|
4705
|
-
return function(args) {
|
|
4706
|
-
return to(from(args));
|
|
4707
|
-
};
|
|
4708
|
-
}
|
|
4709
|
-
function wrapConversion(toModel, graph) {
|
|
4710
|
-
const path = [graph[toModel].parent, toModel];
|
|
4711
|
-
let fn = conversions2[graph[toModel].parent][toModel];
|
|
4712
|
-
let cur = graph[toModel].parent;
|
|
4713
|
-
while (graph[cur].parent) {
|
|
4714
|
-
path.unshift(graph[cur].parent);
|
|
4715
|
-
fn = link(conversions2[graph[cur].parent][cur], fn);
|
|
4716
|
-
cur = graph[cur].parent;
|
|
4717
|
-
}
|
|
4718
|
-
fn.conversion = path;
|
|
4719
|
-
return fn;
|
|
4720
|
-
}
|
|
4721
|
-
route = function(fromModel) {
|
|
4722
|
-
const graph = deriveBFS(fromModel);
|
|
4723
|
-
const conversion = {};
|
|
4724
|
-
const models = Object.keys(graph);
|
|
4725
|
-
for (let len = models.length, i = 0; i < len; i++) {
|
|
4726
|
-
const toModel = models[i];
|
|
4727
|
-
const node = graph[toModel];
|
|
4728
|
-
if (node.parent === null) {
|
|
4729
|
-
continue;
|
|
4730
|
-
}
|
|
4731
|
-
conversion[toModel] = wrapConversion(toModel, graph);
|
|
4732
|
-
}
|
|
4733
|
-
return conversion;
|
|
4734
|
-
};
|
|
4735
|
-
return route;
|
|
4736
|
-
}
|
|
4737
|
-
var colorConvert;
|
|
4738
|
-
var hasRequiredColorConvert;
|
|
4739
|
-
function requireColorConvert() {
|
|
4740
|
-
if (hasRequiredColorConvert)
|
|
4741
|
-
return colorConvert;
|
|
4742
|
-
hasRequiredColorConvert = 1;
|
|
4743
|
-
const conversions2 = requireConversions();
|
|
4744
|
-
const route2 = requireRoute();
|
|
4745
|
-
const convert = {};
|
|
4746
|
-
const models = Object.keys(conversions2);
|
|
4747
|
-
function wrapRaw(fn) {
|
|
4748
|
-
const wrappedFn = function(...args) {
|
|
4749
|
-
const arg0 = args[0];
|
|
4750
|
-
if (arg0 === void 0 || arg0 === null) {
|
|
4751
|
-
return arg0;
|
|
4752
|
-
}
|
|
4753
|
-
if (arg0.length > 1) {
|
|
4754
|
-
args = arg0;
|
|
4755
|
-
}
|
|
4756
|
-
return fn(args);
|
|
4757
|
-
};
|
|
4758
|
-
if ("conversion" in fn) {
|
|
4759
|
-
wrappedFn.conversion = fn.conversion;
|
|
4760
|
-
}
|
|
4761
|
-
return wrappedFn;
|
|
4762
|
-
}
|
|
4763
|
-
function wrapRounded(fn) {
|
|
4764
|
-
const wrappedFn = function(...args) {
|
|
4765
|
-
const arg0 = args[0];
|
|
4766
|
-
if (arg0 === void 0 || arg0 === null) {
|
|
4767
|
-
return arg0;
|
|
4768
|
-
}
|
|
4769
|
-
if (arg0.length > 1) {
|
|
4770
|
-
args = arg0;
|
|
4771
|
-
}
|
|
4772
|
-
const result = fn(args);
|
|
4773
|
-
if (typeof result === "object") {
|
|
4774
|
-
for (let len = result.length, i = 0; i < len; i++) {
|
|
4775
|
-
result[i] = Math.round(result[i]);
|
|
4776
|
-
}
|
|
4777
|
-
}
|
|
4778
|
-
return result;
|
|
4779
|
-
};
|
|
4780
|
-
if ("conversion" in fn) {
|
|
4781
|
-
wrappedFn.conversion = fn.conversion;
|
|
4782
|
-
}
|
|
4783
|
-
return wrappedFn;
|
|
4784
|
-
}
|
|
4785
|
-
models.forEach((fromModel) => {
|
|
4786
|
-
convert[fromModel] = {};
|
|
4787
|
-
Object.defineProperty(convert[fromModel], "channels", { value: conversions2[fromModel].channels });
|
|
4788
|
-
Object.defineProperty(convert[fromModel], "labels", { value: conversions2[fromModel].labels });
|
|
4789
|
-
const routes = route2(fromModel);
|
|
4790
|
-
const routeModels = Object.keys(routes);
|
|
4791
|
-
routeModels.forEach((toModel) => {
|
|
4792
|
-
const fn = routes[toModel];
|
|
4793
|
-
convert[fromModel][toModel] = wrapRounded(fn);
|
|
4794
|
-
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
4795
|
-
});
|
|
4796
|
-
});
|
|
4797
|
-
colorConvert = convert;
|
|
4798
|
-
return colorConvert;
|
|
4799
|
-
}
|
|
4800
|
-
ansiStyles$1.exports;
|
|
4801
|
-
(function(module2) {
|
|
4802
|
-
const wrapAnsi16 = (fn, offset) => (...args) => {
|
|
4803
|
-
const code = fn(...args);
|
|
4804
|
-
return `\x1B[${code + offset}m`;
|
|
4805
|
-
};
|
|
4806
|
-
const wrapAnsi256 = (fn, offset) => (...args) => {
|
|
4807
|
-
const code = fn(...args);
|
|
4808
|
-
return `\x1B[${38 + offset};5;${code}m`;
|
|
4809
|
-
};
|
|
4810
|
-
const wrapAnsi16m = (fn, offset) => (...args) => {
|
|
4811
|
-
const rgb = fn(...args);
|
|
4812
|
-
return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
|
4813
|
-
};
|
|
4814
|
-
const ansi2ansi = (n) => n;
|
|
4815
|
-
const rgb2rgb = (r, g, b) => [r, g, b];
|
|
4816
|
-
const setLazyProperty = (object, property, get) => {
|
|
4817
|
-
Object.defineProperty(object, property, {
|
|
4818
|
-
get: () => {
|
|
4819
|
-
const value = get();
|
|
4820
|
-
Object.defineProperty(object, property, {
|
|
4821
|
-
value,
|
|
4822
|
-
enumerable: true,
|
|
4823
|
-
configurable: true
|
|
4824
|
-
});
|
|
4825
|
-
return value;
|
|
4826
|
-
},
|
|
4827
|
-
enumerable: true,
|
|
4828
|
-
configurable: true
|
|
4829
|
-
});
|
|
4830
|
-
};
|
|
4831
|
-
let colorConvert2;
|
|
4832
|
-
const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
|
|
4833
|
-
if (colorConvert2 === void 0) {
|
|
4834
|
-
colorConvert2 = requireColorConvert();
|
|
4835
|
-
}
|
|
4836
|
-
const offset = isBackground ? 10 : 0;
|
|
4837
|
-
const styles2 = {};
|
|
4838
|
-
for (const [sourceSpace, suite] of Object.entries(colorConvert2)) {
|
|
4839
|
-
const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
|
|
4840
|
-
if (sourceSpace === targetSpace) {
|
|
4841
|
-
styles2[name] = wrap(identity, offset);
|
|
4842
|
-
} else if (typeof suite === "object") {
|
|
4843
|
-
styles2[name] = wrap(suite[targetSpace], offset);
|
|
4844
|
-
}
|
|
4845
|
-
}
|
|
4846
|
-
return styles2;
|
|
4847
|
-
};
|
|
4848
|
-
function assembleStyles() {
|
|
4849
|
-
const codes = /* @__PURE__ */ new Map();
|
|
4850
|
-
const styles2 = {
|
|
4851
|
-
modifier: {
|
|
4852
|
-
reset: [0, 0],
|
|
4853
|
-
// 21 isn't widely supported and 22 does the same thing
|
|
4854
|
-
bold: [1, 22],
|
|
4855
|
-
dim: [2, 22],
|
|
4856
|
-
italic: [3, 23],
|
|
4857
|
-
underline: [4, 24],
|
|
4858
|
-
inverse: [7, 27],
|
|
4859
|
-
hidden: [8, 28],
|
|
4860
|
-
strikethrough: [9, 29]
|
|
4861
|
-
},
|
|
4862
|
-
color: {
|
|
4863
|
-
black: [30, 39],
|
|
4864
|
-
red: [31, 39],
|
|
4865
|
-
green: [32, 39],
|
|
4866
|
-
yellow: [33, 39],
|
|
4867
|
-
blue: [34, 39],
|
|
4868
|
-
magenta: [35, 39],
|
|
4869
|
-
cyan: [36, 39],
|
|
4870
|
-
white: [37, 39],
|
|
4871
|
-
// Bright color
|
|
4872
|
-
blackBright: [90, 39],
|
|
4873
|
-
redBright: [91, 39],
|
|
4874
|
-
greenBright: [92, 39],
|
|
4875
|
-
yellowBright: [93, 39],
|
|
4876
|
-
blueBright: [94, 39],
|
|
4877
|
-
magentaBright: [95, 39],
|
|
4878
|
-
cyanBright: [96, 39],
|
|
4879
|
-
whiteBright: [97, 39]
|
|
4880
|
-
},
|
|
4881
|
-
bgColor: {
|
|
4882
|
-
bgBlack: [40, 49],
|
|
4883
|
-
bgRed: [41, 49],
|
|
4884
|
-
bgGreen: [42, 49],
|
|
4885
|
-
bgYellow: [43, 49],
|
|
4886
|
-
bgBlue: [44, 49],
|
|
4887
|
-
bgMagenta: [45, 49],
|
|
4888
|
-
bgCyan: [46, 49],
|
|
4889
|
-
bgWhite: [47, 49],
|
|
4890
|
-
// Bright color
|
|
4891
|
-
bgBlackBright: [100, 49],
|
|
4892
|
-
bgRedBright: [101, 49],
|
|
4893
|
-
bgGreenBright: [102, 49],
|
|
4894
|
-
bgYellowBright: [103, 49],
|
|
4895
|
-
bgBlueBright: [104, 49],
|
|
4896
|
-
bgMagentaBright: [105, 49],
|
|
4897
|
-
bgCyanBright: [106, 49],
|
|
4898
|
-
bgWhiteBright: [107, 49]
|
|
4899
|
-
}
|
|
4900
|
-
};
|
|
4901
|
-
styles2.color.gray = styles2.color.blackBright;
|
|
4902
|
-
styles2.bgColor.bgGray = styles2.bgColor.bgBlackBright;
|
|
4903
|
-
styles2.color.grey = styles2.color.blackBright;
|
|
4904
|
-
styles2.bgColor.bgGrey = styles2.bgColor.bgBlackBright;
|
|
4905
|
-
for (const [groupName, group] of Object.entries(styles2)) {
|
|
4906
|
-
for (const [styleName, style] of Object.entries(group)) {
|
|
4907
|
-
styles2[styleName] = {
|
|
4908
|
-
open: `\x1B[${style[0]}m`,
|
|
4909
|
-
close: `\x1B[${style[1]}m`
|
|
4910
|
-
};
|
|
4911
|
-
group[styleName] = styles2[styleName];
|
|
4912
|
-
codes.set(style[0], style[1]);
|
|
4913
|
-
}
|
|
4914
|
-
Object.defineProperty(styles2, groupName, {
|
|
4915
|
-
value: group,
|
|
4916
|
-
enumerable: false
|
|
4917
|
-
});
|
|
4918
|
-
}
|
|
4919
|
-
Object.defineProperty(styles2, "codes", {
|
|
4920
|
-
value: codes,
|
|
4921
|
-
enumerable: false
|
|
4922
|
-
});
|
|
4923
|
-
styles2.color.close = "\x1B[39m";
|
|
4924
|
-
styles2.bgColor.close = "\x1B[49m";
|
|
4925
|
-
setLazyProperty(styles2.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
|
|
4926
|
-
setLazyProperty(styles2.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
|
|
4927
|
-
setLazyProperty(styles2.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
|
|
4928
|
-
setLazyProperty(styles2.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
|
|
4929
|
-
setLazyProperty(styles2.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
|
|
4930
|
-
setLazyProperty(styles2.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
|
|
4931
|
-
return styles2;
|
|
4932
|
-
}
|
|
4933
|
-
Object.defineProperty(module2, "exports", {
|
|
4934
|
-
enumerable: true,
|
|
4935
|
-
get: assembleStyles
|
|
4936
|
-
});
|
|
4937
|
-
})(ansiStyles$1);
|
|
4938
|
-
var ansiStylesExports = ansiStyles$1.exports;
|
|
4939
|
-
var browser = {
|
|
4940
|
-
stdout: false,
|
|
4941
|
-
stderr: false
|
|
4942
|
-
};
|
|
4943
|
-
const stringReplaceAll$1 = (string, substring, replacer) => {
|
|
4944
|
-
let index = string.indexOf(substring);
|
|
4945
|
-
if (index === -1) {
|
|
4946
|
-
return string;
|
|
4947
|
-
}
|
|
4948
|
-
const substringLength = substring.length;
|
|
4949
|
-
let endIndex = 0;
|
|
4950
|
-
let returnValue = "";
|
|
4951
|
-
do {
|
|
4952
|
-
returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
|
|
4953
|
-
endIndex = index + substringLength;
|
|
4954
|
-
index = string.indexOf(substring, endIndex);
|
|
4955
|
-
} while (index !== -1);
|
|
4956
|
-
returnValue += string.substr(endIndex);
|
|
4957
|
-
return returnValue;
|
|
4958
|
-
};
|
|
4959
|
-
const stringEncaseCRLFWithFirstIndex$1 = (string, prefix, postfix, index) => {
|
|
4960
|
-
let endIndex = 0;
|
|
4961
|
-
let returnValue = "";
|
|
4962
|
-
do {
|
|
4963
|
-
const gotCR = string[index - 1] === "\r";
|
|
4964
|
-
returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
4965
|
-
endIndex = index + 1;
|
|
4966
|
-
index = string.indexOf("\n", endIndex);
|
|
4967
|
-
} while (index !== -1);
|
|
4968
|
-
returnValue += string.substr(endIndex);
|
|
4969
|
-
return returnValue;
|
|
4970
|
-
};
|
|
4971
|
-
var util = {
|
|
4972
|
-
stringReplaceAll: stringReplaceAll$1,
|
|
4973
|
-
stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex$1
|
|
4974
|
-
};
|
|
4975
|
-
var templates;
|
|
4976
|
-
var hasRequiredTemplates;
|
|
4977
|
-
function requireTemplates() {
|
|
4978
|
-
if (hasRequiredTemplates)
|
|
4979
|
-
return templates;
|
|
4980
|
-
hasRequiredTemplates = 1;
|
|
4981
|
-
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;
|
|
4982
|
-
const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
|
4983
|
-
const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
|
|
4984
|
-
const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
|
|
4985
|
-
const ESCAPES = /* @__PURE__ */ new Map([
|
|
4986
|
-
["n", "\n"],
|
|
4987
|
-
["r", "\r"],
|
|
4988
|
-
["t", " "],
|
|
4989
|
-
["b", "\b"],
|
|
4990
|
-
["f", "\f"],
|
|
4991
|
-
["v", "\v"],
|
|
4992
|
-
["0", "\0"],
|
|
4993
|
-
["\\", "\\"],
|
|
4994
|
-
["e", "\x1B"],
|
|
4995
|
-
["a", "\x07"]
|
|
4996
|
-
]);
|
|
4997
|
-
function unescape2(c) {
|
|
4998
|
-
const u = c[0] === "u";
|
|
4999
|
-
const bracket = c[1] === "{";
|
|
5000
|
-
if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) {
|
|
5001
|
-
return String.fromCharCode(parseInt(c.slice(1), 16));
|
|
5002
|
-
}
|
|
5003
|
-
if (u && bracket) {
|
|
5004
|
-
return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
|
|
5005
|
-
}
|
|
5006
|
-
return ESCAPES.get(c) || c;
|
|
5007
|
-
}
|
|
5008
|
-
function parseArguments(name, arguments_) {
|
|
5009
|
-
const results = [];
|
|
5010
|
-
const chunks = arguments_.trim().split(/\s*,\s*/g);
|
|
5011
|
-
let matches;
|
|
5012
|
-
for (const chunk of chunks) {
|
|
5013
|
-
const number = Number(chunk);
|
|
5014
|
-
if (!Number.isNaN(number)) {
|
|
5015
|
-
results.push(number);
|
|
5016
|
-
} else if (matches = chunk.match(STRING_REGEX)) {
|
|
5017
|
-
results.push(matches[2].replace(ESCAPE_REGEX, (m, escape2, character) => escape2 ? unescape2(escape2) : character));
|
|
5018
|
-
} else {
|
|
5019
|
-
throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
|
|
5020
|
-
}
|
|
5021
|
-
}
|
|
5022
|
-
return results;
|
|
5023
|
-
}
|
|
5024
|
-
function parseStyle(style) {
|
|
5025
|
-
STYLE_REGEX.lastIndex = 0;
|
|
5026
|
-
const results = [];
|
|
5027
|
-
let matches;
|
|
5028
|
-
while ((matches = STYLE_REGEX.exec(style)) !== null) {
|
|
5029
|
-
const name = matches[1];
|
|
5030
|
-
if (matches[2]) {
|
|
5031
|
-
const args = parseArguments(name, matches[2]);
|
|
5032
|
-
results.push([name].concat(args));
|
|
5033
|
-
} else {
|
|
5034
|
-
results.push([name]);
|
|
5035
|
-
}
|
|
5036
|
-
}
|
|
5037
|
-
return results;
|
|
5038
|
-
}
|
|
5039
|
-
function buildStyle(chalk2, styles2) {
|
|
5040
|
-
const enabled = {};
|
|
5041
|
-
for (const layer of styles2) {
|
|
5042
|
-
for (const style of layer.styles) {
|
|
5043
|
-
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
5044
|
-
}
|
|
5045
|
-
}
|
|
5046
|
-
let current = chalk2;
|
|
5047
|
-
for (const [styleName, styles3] of Object.entries(enabled)) {
|
|
5048
|
-
if (!Array.isArray(styles3)) {
|
|
5049
|
-
continue;
|
|
5050
|
-
}
|
|
5051
|
-
if (!(styleName in current)) {
|
|
5052
|
-
throw new Error(`Unknown Chalk style: ${styleName}`);
|
|
5053
|
-
}
|
|
5054
|
-
current = styles3.length > 0 ? current[styleName](...styles3) : current[styleName];
|
|
5055
|
-
}
|
|
5056
|
-
return current;
|
|
5057
|
-
}
|
|
5058
|
-
templates = (chalk2, temporary) => {
|
|
5059
|
-
const styles2 = [];
|
|
5060
|
-
const chunks = [];
|
|
5061
|
-
let chunk = [];
|
|
5062
|
-
temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
|
|
5063
|
-
if (escapeCharacter) {
|
|
5064
|
-
chunk.push(unescape2(escapeCharacter));
|
|
5065
|
-
} else if (style) {
|
|
5066
|
-
const string = chunk.join("");
|
|
5067
|
-
chunk = [];
|
|
5068
|
-
chunks.push(styles2.length === 0 ? string : buildStyle(chalk2, styles2)(string));
|
|
5069
|
-
styles2.push({ inverse, styles: parseStyle(style) });
|
|
5070
|
-
} else if (close) {
|
|
5071
|
-
if (styles2.length === 0) {
|
|
5072
|
-
throw new Error("Found extraneous } in Chalk template literal");
|
|
5073
|
-
}
|
|
5074
|
-
chunks.push(buildStyle(chalk2, styles2)(chunk.join("")));
|
|
5075
|
-
chunk = [];
|
|
5076
|
-
styles2.pop();
|
|
5077
|
-
} else {
|
|
5078
|
-
chunk.push(character);
|
|
5079
|
-
}
|
|
5080
|
-
});
|
|
5081
|
-
chunks.push(chunk.join(""));
|
|
5082
|
-
if (styles2.length > 0) {
|
|
5083
|
-
const errMessage = `Chalk template literal is missing ${styles2.length} closing bracket${styles2.length === 1 ? "" : "s"} (\`}\`)`;
|
|
5084
|
-
throw new Error(errMessage);
|
|
5085
|
-
}
|
|
5086
|
-
return chunks.join("");
|
|
5087
|
-
};
|
|
5088
|
-
return templates;
|
|
5089
|
-
}
|
|
5090
|
-
const ansiStyles = ansiStylesExports;
|
|
5091
|
-
const { stdout: stdoutColor, stderr: stderrColor } = browser;
|
|
5092
|
-
const {
|
|
5093
|
-
stringReplaceAll,
|
|
5094
|
-
stringEncaseCRLFWithFirstIndex
|
|
5095
|
-
} = util;
|
|
5096
|
-
const { isArray } = Array;
|
|
5097
|
-
const levelMapping = [
|
|
5098
|
-
"ansi",
|
|
5099
|
-
"ansi",
|
|
5100
|
-
"ansi256",
|
|
5101
|
-
"ansi16m"
|
|
5102
|
-
];
|
|
5103
|
-
const styles = /* @__PURE__ */ Object.create(null);
|
|
5104
|
-
const applyOptions = (object, options = {}) => {
|
|
5105
|
-
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
5106
|
-
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
5107
|
-
}
|
|
5108
|
-
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
5109
|
-
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
5110
|
-
};
|
|
5111
|
-
class ChalkClass {
|
|
5112
|
-
constructor(options) {
|
|
5113
|
-
return chalkFactory(options);
|
|
5114
|
-
}
|
|
5115
|
-
}
|
|
5116
|
-
const chalkFactory = (options) => {
|
|
5117
|
-
const chalk2 = {};
|
|
5118
|
-
applyOptions(chalk2, options);
|
|
5119
|
-
chalk2.template = (...arguments_) => chalkTag(chalk2.template, ...arguments_);
|
|
5120
|
-
Object.setPrototypeOf(chalk2, Chalk.prototype);
|
|
5121
|
-
Object.setPrototypeOf(chalk2.template, chalk2);
|
|
5122
|
-
chalk2.template.constructor = () => {
|
|
5123
|
-
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
5124
|
-
};
|
|
5125
|
-
chalk2.template.Instance = ChalkClass;
|
|
5126
|
-
return chalk2.template;
|
|
5127
|
-
};
|
|
5128
|
-
function Chalk(options) {
|
|
5129
|
-
return chalkFactory(options);
|
|
5130
|
-
}
|
|
5131
|
-
for (const [styleName, style] of Object.entries(ansiStyles)) {
|
|
5132
|
-
styles[styleName] = {
|
|
5133
|
-
get() {
|
|
5134
|
-
const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
|
|
5135
|
-
Object.defineProperty(this, styleName, { value: builder });
|
|
5136
|
-
return builder;
|
|
5137
|
-
}
|
|
5138
|
-
};
|
|
5139
|
-
}
|
|
5140
|
-
styles.visible = {
|
|
5141
|
-
get() {
|
|
5142
|
-
const builder = createBuilder(this, this._styler, true);
|
|
5143
|
-
Object.defineProperty(this, "visible", { value: builder });
|
|
5144
|
-
return builder;
|
|
5145
|
-
}
|
|
5146
|
-
};
|
|
5147
|
-
const usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
|
|
5148
|
-
for (const model of usedModels) {
|
|
5149
|
-
styles[model] = {
|
|
5150
|
-
get() {
|
|
5151
|
-
const { level } = this;
|
|
5152
|
-
return function(...arguments_) {
|
|
5153
|
-
const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
|
|
5154
|
-
return createBuilder(this, styler, this._isEmpty);
|
|
5155
|
-
};
|
|
5156
|
-
}
|
|
5157
|
-
};
|
|
5158
|
-
}
|
|
5159
|
-
for (const model of usedModels) {
|
|
5160
|
-
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
5161
|
-
styles[bgModel] = {
|
|
5162
|
-
get() {
|
|
5163
|
-
const { level } = this;
|
|
5164
|
-
return function(...arguments_) {
|
|
5165
|
-
const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
|
|
5166
|
-
return createBuilder(this, styler, this._isEmpty);
|
|
5167
|
-
};
|
|
5168
|
-
}
|
|
5169
|
-
};
|
|
5170
|
-
}
|
|
5171
|
-
const proto = Object.defineProperties(() => {
|
|
5172
|
-
}, {
|
|
5173
|
-
...styles,
|
|
5174
|
-
level: {
|
|
5175
|
-
enumerable: true,
|
|
5176
|
-
get() {
|
|
5177
|
-
return this._generator.level;
|
|
5178
|
-
},
|
|
5179
|
-
set(level) {
|
|
5180
|
-
this._generator.level = level;
|
|
5181
|
-
}
|
|
5182
|
-
}
|
|
5183
|
-
});
|
|
5184
|
-
const createStyler = (open, close, parent) => {
|
|
5185
|
-
let openAll;
|
|
5186
|
-
let closeAll;
|
|
5187
|
-
if (parent === void 0) {
|
|
5188
|
-
openAll = open;
|
|
5189
|
-
closeAll = close;
|
|
5190
|
-
} else {
|
|
5191
|
-
openAll = parent.openAll + open;
|
|
5192
|
-
closeAll = close + parent.closeAll;
|
|
5193
|
-
}
|
|
5194
|
-
return {
|
|
5195
|
-
open,
|
|
5196
|
-
close,
|
|
5197
|
-
openAll,
|
|
5198
|
-
closeAll,
|
|
5199
|
-
parent
|
|
5200
|
-
};
|
|
5201
|
-
};
|
|
5202
|
-
const createBuilder = (self2, _styler, _isEmpty) => {
|
|
5203
|
-
const builder = (...arguments_) => {
|
|
5204
|
-
if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
|
|
5205
|
-
return applyStyle(builder, chalkTag(builder, ...arguments_));
|
|
5206
|
-
}
|
|
5207
|
-
return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
5208
|
-
};
|
|
5209
|
-
Object.setPrototypeOf(builder, proto);
|
|
5210
|
-
builder._generator = self2;
|
|
5211
|
-
builder._styler = _styler;
|
|
5212
|
-
builder._isEmpty = _isEmpty;
|
|
5213
|
-
return builder;
|
|
5214
|
-
};
|
|
5215
|
-
const applyStyle = (self2, string) => {
|
|
5216
|
-
if (self2.level <= 0 || !string) {
|
|
5217
|
-
return self2._isEmpty ? "" : string;
|
|
5218
|
-
}
|
|
5219
|
-
let styler = self2._styler;
|
|
5220
|
-
if (styler === void 0) {
|
|
5221
|
-
return string;
|
|
5222
|
-
}
|
|
5223
|
-
const { openAll, closeAll } = styler;
|
|
5224
|
-
if (string.indexOf("\x1B") !== -1) {
|
|
5225
|
-
while (styler !== void 0) {
|
|
5226
|
-
string = stringReplaceAll(string, styler.close, styler.open);
|
|
5227
|
-
styler = styler.parent;
|
|
5228
|
-
}
|
|
5229
|
-
}
|
|
5230
|
-
const lfIndex = string.indexOf("\n");
|
|
5231
|
-
if (lfIndex !== -1) {
|
|
5232
|
-
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
5233
|
-
}
|
|
5234
|
-
return openAll + string + closeAll;
|
|
5235
|
-
};
|
|
5236
|
-
let template;
|
|
5237
|
-
const chalkTag = (chalk2, ...strings) => {
|
|
5238
|
-
const [firstString] = strings;
|
|
5239
|
-
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
5240
|
-
return strings.join(" ");
|
|
5241
|
-
}
|
|
5242
|
-
const arguments_ = strings.slice(1);
|
|
5243
|
-
const parts = [firstString.raw[0]];
|
|
5244
|
-
for (let i = 1; i < firstString.length; i++) {
|
|
5245
|
-
parts.push(
|
|
5246
|
-
String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"),
|
|
5247
|
-
String(firstString.raw[i])
|
|
5248
|
-
);
|
|
5249
|
-
}
|
|
5250
|
-
if (template === void 0) {
|
|
5251
|
-
template = requireTemplates();
|
|
5252
|
-
}
|
|
5253
|
-
return template(chalk2, parts.join(""));
|
|
5254
|
-
};
|
|
5255
|
-
Object.defineProperties(Chalk.prototype, styles);
|
|
5256
|
-
const chalk = Chalk();
|
|
5257
|
-
chalk.supportsColor = stdoutColor;
|
|
5258
|
-
chalk.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
5259
|
-
chalk.stderr.supportsColor = stderrColor;
|
|
5260
|
-
const STSInstrumentControllerPluginKey = Symbol();
|
|
5261
|
-
new TextEncoder();
|
|
5262
|
-
new TextDecoder();
|
|
5263
|
-
var ExtData = (
|
|
5264
|
-
/** @class */
|
|
5265
|
-
/* @__PURE__ */ function() {
|
|
5266
|
-
function ExtData2(type, data) {
|
|
5267
|
-
this.type = type;
|
|
5268
|
-
this.data = data;
|
|
5269
|
-
}
|
|
5270
|
-
return ExtData2;
|
|
5271
|
-
}()
|
|
5272
|
-
);
|
|
5273
|
-
var __extends = /* @__PURE__ */ function() {
|
|
5274
|
-
var extendStatics = function(d, b) {
|
|
5275
|
-
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
5276
|
-
d2.__proto__ = b2;
|
|
5277
|
-
} || function(d2, b2) {
|
|
5278
|
-
for (var p in b2)
|
|
5279
|
-
if (Object.prototype.hasOwnProperty.call(b2, p))
|
|
5280
|
-
d2[p] = b2[p];
|
|
5281
|
-
};
|
|
5282
|
-
return extendStatics(d, b);
|
|
5283
|
-
};
|
|
5284
|
-
return function(d, b) {
|
|
5285
|
-
if (typeof b !== "function" && b !== null)
|
|
5286
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
5287
|
-
extendStatics(d, b);
|
|
5288
|
-
function __() {
|
|
5289
|
-
this.constructor = d;
|
|
5290
|
-
}
|
|
5291
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
5292
|
-
};
|
|
5293
|
-
}();
|
|
5294
|
-
var DecodeError = (
|
|
5295
|
-
/** @class */
|
|
5296
|
-
function(_super) {
|
|
5297
|
-
__extends(DecodeError2, _super);
|
|
5298
|
-
function DecodeError2(message) {
|
|
5299
|
-
var _this = _super.call(this, message) || this;
|
|
5300
|
-
var proto2 = Object.create(DecodeError2.prototype);
|
|
5301
|
-
Object.setPrototypeOf(_this, proto2);
|
|
5302
|
-
Object.defineProperty(_this, "name", {
|
|
5303
|
-
configurable: true,
|
|
5304
|
-
enumerable: false,
|
|
5305
|
-
value: DecodeError2.name
|
|
5306
|
-
});
|
|
5307
|
-
return _this;
|
|
5308
|
-
}
|
|
5309
|
-
return DecodeError2;
|
|
5310
|
-
}(Error)
|
|
5311
|
-
);
|
|
5312
|
-
function setInt64(view, offset, value) {
|
|
5313
|
-
var high = Math.floor(value / 4294967296);
|
|
5314
|
-
var low = value;
|
|
5315
|
-
view.setUint32(offset, high);
|
|
5316
|
-
view.setUint32(offset + 4, low);
|
|
5317
|
-
}
|
|
5318
|
-
function getInt64(view, offset) {
|
|
5319
|
-
var high = view.getInt32(offset);
|
|
5320
|
-
var low = view.getUint32(offset + 4);
|
|
5321
|
-
return high * 4294967296 + low;
|
|
5322
|
-
}
|
|
5323
|
-
var EXT_TIMESTAMP = -1;
|
|
5324
|
-
var TIMESTAMP32_MAX_SEC = 4294967296 - 1;
|
|
5325
|
-
var TIMESTAMP64_MAX_SEC = 17179869184 - 1;
|
|
5326
|
-
function encodeTimeSpecToTimestamp(_a2) {
|
|
5327
|
-
var sec = _a2.sec, nsec = _a2.nsec;
|
|
5328
|
-
if (sec >= 0 && nsec >= 0 && sec <= TIMESTAMP64_MAX_SEC) {
|
|
5329
|
-
if (nsec === 0 && sec <= TIMESTAMP32_MAX_SEC) {
|
|
5330
|
-
var rv = new Uint8Array(4);
|
|
5331
|
-
var view = new DataView(rv.buffer);
|
|
5332
|
-
view.setUint32(0, sec);
|
|
5333
|
-
return rv;
|
|
5334
|
-
} else {
|
|
5335
|
-
var secHigh = sec / 4294967296;
|
|
5336
|
-
var secLow = sec & 4294967295;
|
|
5337
|
-
var rv = new Uint8Array(8);
|
|
5338
|
-
var view = new DataView(rv.buffer);
|
|
5339
|
-
view.setUint32(0, nsec << 2 | secHigh & 3);
|
|
5340
|
-
view.setUint32(4, secLow);
|
|
5341
|
-
return rv;
|
|
5342
|
-
}
|
|
5343
|
-
} else {
|
|
5344
|
-
var rv = new Uint8Array(12);
|
|
5345
|
-
var view = new DataView(rv.buffer);
|
|
5346
|
-
view.setUint32(0, nsec);
|
|
5347
|
-
setInt64(view, 4, sec);
|
|
5348
|
-
return rv;
|
|
5349
|
-
}
|
|
5350
|
-
}
|
|
5351
|
-
function encodeDateToTimeSpec(date) {
|
|
5352
|
-
var msec = date.getTime();
|
|
5353
|
-
var sec = Math.floor(msec / 1e3);
|
|
5354
|
-
var nsec = (msec - sec * 1e3) * 1e6;
|
|
5355
|
-
var nsecInSec = Math.floor(nsec / 1e9);
|
|
5356
|
-
return {
|
|
5357
|
-
sec: sec + nsecInSec,
|
|
5358
|
-
nsec: nsec - nsecInSec * 1e9
|
|
5359
|
-
};
|
|
5360
|
-
}
|
|
5361
|
-
function encodeTimestampExtension(object) {
|
|
5362
|
-
if (object instanceof Date) {
|
|
5363
|
-
var timeSpec = encodeDateToTimeSpec(object);
|
|
5364
|
-
return encodeTimeSpecToTimestamp(timeSpec);
|
|
5365
|
-
} else {
|
|
5366
|
-
return null;
|
|
5367
|
-
}
|
|
5368
|
-
}
|
|
5369
|
-
function decodeTimestampToTimeSpec(data) {
|
|
5370
|
-
var view = new DataView(data.buffer, data.byteOffset, data.byteLength);
|
|
5371
|
-
switch (data.byteLength) {
|
|
5372
|
-
case 4: {
|
|
5373
|
-
var sec = view.getUint32(0);
|
|
5374
|
-
var nsec = 0;
|
|
5375
|
-
return { sec, nsec };
|
|
5376
|
-
}
|
|
5377
|
-
case 8: {
|
|
5378
|
-
var nsec30AndSecHigh2 = view.getUint32(0);
|
|
5379
|
-
var secLow32 = view.getUint32(4);
|
|
5380
|
-
var sec = (nsec30AndSecHigh2 & 3) * 4294967296 + secLow32;
|
|
5381
|
-
var nsec = nsec30AndSecHigh2 >>> 2;
|
|
5382
|
-
return { sec, nsec };
|
|
5383
|
-
}
|
|
5384
|
-
case 12: {
|
|
5385
|
-
var sec = getInt64(view, 4);
|
|
5386
|
-
var nsec = view.getUint32(0);
|
|
5387
|
-
return { sec, nsec };
|
|
5388
|
-
}
|
|
5389
|
-
default:
|
|
5390
|
-
throw new DecodeError("Unrecognized data size for timestamp (expected 4, 8, or 12): ".concat(data.length));
|
|
5391
|
-
}
|
|
5392
|
-
}
|
|
5393
|
-
function decodeTimestampExtension(data) {
|
|
5394
|
-
var timeSpec = decodeTimestampToTimeSpec(data);
|
|
5395
|
-
return new Date(timeSpec.sec * 1e3 + timeSpec.nsec / 1e6);
|
|
5396
|
-
}
|
|
5397
|
-
var timestampExtension = {
|
|
5398
|
-
type: EXT_TIMESTAMP,
|
|
5399
|
-
encode: encodeTimestampExtension,
|
|
5400
|
-
decode: decodeTimestampExtension
|
|
5401
|
-
};
|
|
5402
|
-
/** @class */
|
|
5403
|
-
(function() {
|
|
5404
|
-
function ExtensionCodec2() {
|
|
5405
|
-
this.builtInEncoders = [];
|
|
5406
|
-
this.builtInDecoders = [];
|
|
5407
|
-
this.encoders = [];
|
|
5408
|
-
this.decoders = [];
|
|
5409
|
-
this.register(timestampExtension);
|
|
5410
|
-
}
|
|
5411
|
-
ExtensionCodec2.prototype.register = function(_a2) {
|
|
5412
|
-
var type = _a2.type, encode2 = _a2.encode, decode = _a2.decode;
|
|
5413
|
-
if (type >= 0) {
|
|
5414
|
-
this.encoders[type] = encode2;
|
|
5415
|
-
this.decoders[type] = decode;
|
|
5416
|
-
} else {
|
|
5417
|
-
var index = 1 + type;
|
|
5418
|
-
this.builtInEncoders[index] = encode2;
|
|
5419
|
-
this.builtInDecoders[index] = decode;
|
|
5420
|
-
}
|
|
5421
|
-
};
|
|
5422
|
-
ExtensionCodec2.prototype.tryToEncode = function(object, context) {
|
|
5423
|
-
for (var i = 0; i < this.builtInEncoders.length; i++) {
|
|
5424
|
-
var encodeExt = this.builtInEncoders[i];
|
|
5425
|
-
if (encodeExt != null) {
|
|
5426
|
-
var data = encodeExt(object, context);
|
|
5427
|
-
if (data != null) {
|
|
5428
|
-
var type = -1 - i;
|
|
5429
|
-
return new ExtData(type, data);
|
|
5430
|
-
}
|
|
5431
|
-
}
|
|
5432
|
-
}
|
|
5433
|
-
for (var i = 0; i < this.encoders.length; i++) {
|
|
5434
|
-
var encodeExt = this.encoders[i];
|
|
5435
|
-
if (encodeExt != null) {
|
|
5436
|
-
var data = encodeExt(object, context);
|
|
5437
|
-
if (data != null) {
|
|
5438
|
-
var type = i;
|
|
5439
|
-
return new ExtData(type, data);
|
|
5440
|
-
}
|
|
5441
|
-
}
|
|
5442
|
-
}
|
|
5443
|
-
if (object instanceof ExtData) {
|
|
5444
|
-
return object;
|
|
5445
|
-
}
|
|
5446
|
-
return null;
|
|
5447
|
-
};
|
|
5448
|
-
ExtensionCodec2.prototype.decode = function(data, type, context) {
|
|
5449
|
-
var decodeExt = type < 0 ? this.builtInDecoders[-1 - type] : this.decoders[type];
|
|
5450
|
-
if (decodeExt) {
|
|
5451
|
-
return decodeExt(data, type, context);
|
|
5452
|
-
} else {
|
|
5453
|
-
return new ExtData(type, data);
|
|
5454
|
-
}
|
|
5455
|
-
};
|
|
5456
|
-
ExtensionCodec2.defaultCodec = new ExtensionCodec2();
|
|
5457
|
-
return ExtensionCodec2;
|
|
5458
|
-
})();
|
|
5459
|
-
var SubscriptionTopic = /* @__PURE__ */ ((SubscriptionTopic2) => {
|
|
5460
|
-
SubscriptionTopic2["AllServicesCombined"] = "AllServicesCombined";
|
|
5461
|
-
SubscriptionTopic2["Services"] = "Services";
|
|
5462
|
-
SubscriptionTopic2["ServiceInstances"] = "ServiceInstances";
|
|
5463
|
-
SubscriptionTopic2["ServiceInstance"] = "ServiceInstance";
|
|
5464
|
-
SubscriptionTopic2["AllAgentsCombined"] = "AllAgentsCombined";
|
|
5465
|
-
SubscriptionTopic2["Agents"] = "Agents";
|
|
5466
|
-
SubscriptionTopic2["AgentWorkers"] = "AgentWorkers";
|
|
5467
|
-
SubscriptionTopic2["AgentWorker"] = "AgentWorker";
|
|
5468
|
-
SubscriptionTopic2["AllLambdasCombined"] = "AllLambdasCombined";
|
|
5469
|
-
SubscriptionTopic2["LambdaTechnologies"] = "LambdaTechnologies";
|
|
5470
|
-
SubscriptionTopic2["LambdaSubTechnologies"] = "LambdaSubTechnologies";
|
|
5471
|
-
SubscriptionTopic2["LambdaSubTechnologiesInstance"] = "LambdaSubTechnologiesInstance";
|
|
5472
|
-
SubscriptionTopic2["LogProcessing"] = "LogProcessing";
|
|
5473
|
-
return SubscriptionTopic2;
|
|
5474
|
-
})(SubscriptionTopic || {});
|
|
5475
|
-
const _ObservabilityModelUtils = class _ObservabilityModelUtils2 {
|
|
5476
|
-
static GetModelNode(data) {
|
|
5477
|
-
const fixedSize = 2;
|
|
5478
|
-
const padLength = 9;
|
|
5479
|
-
try {
|
|
5480
|
-
return {
|
|
5481
|
-
val: data,
|
|
5482
|
-
vf: parseFloat(data.toString()).toFixed(fixedSize).padStart(padLength, " "),
|
|
5483
|
-
value: parseFloat(data.toString()).toFixed(fixedSize)
|
|
5484
|
-
};
|
|
5485
|
-
} catch (error) {
|
|
5486
|
-
return {
|
|
5487
|
-
val: 0,
|
|
5488
|
-
vf: "",
|
|
5489
|
-
value: ""
|
|
5490
|
-
};
|
|
5491
|
-
}
|
|
5492
|
-
}
|
|
5493
|
-
static GetModelNodeRawStringArray(data) {
|
|
5494
|
-
try {
|
|
5495
|
-
return {
|
|
5496
|
-
val: data
|
|
5497
|
-
};
|
|
5498
|
-
} catch (error) {
|
|
5499
|
-
return {
|
|
5500
|
-
val: []
|
|
5501
|
-
};
|
|
5502
|
-
}
|
|
5503
|
-
}
|
|
5504
|
-
static GetModelNodeObject(data) {
|
|
5505
|
-
try {
|
|
5506
|
-
return {
|
|
5507
|
-
val: JSON.parse(data)
|
|
5508
|
-
};
|
|
5509
|
-
} catch (error) {
|
|
5510
|
-
return {
|
|
5511
|
-
val: null
|
|
5512
|
-
};
|
|
5513
|
-
}
|
|
5514
|
-
}
|
|
5515
|
-
static GetModelNodeWithQuantile(data, quantileData) {
|
|
5516
|
-
let quantile2 = "";
|
|
5517
|
-
const quantileDataElementArray = [];
|
|
5518
|
-
for (const [key, val] of Object.entries(quantileData)) {
|
|
5519
|
-
quantile2 += parseFloat(val.toFixed(2)).toString().padStart(8, " ");
|
|
5520
|
-
quantileDataElementArray.push([
|
|
5521
|
-
key,
|
|
5522
|
-
val
|
|
5523
|
-
]);
|
|
5524
|
-
}
|
|
5525
|
-
const fixedSize = 2;
|
|
5526
|
-
const padLength = 9;
|
|
5527
|
-
try {
|
|
5528
|
-
return {
|
|
5529
|
-
val: data,
|
|
5530
|
-
vf: parseFloat(data.toString()).toFixed(fixedSize).padStart(padLength, " "),
|
|
5531
|
-
value: parseFloat(data.toString()).toFixed(fixedSize),
|
|
5532
|
-
percentile: quantileDataElementArray,
|
|
5533
|
-
percentileFormatted: quantile2
|
|
5534
|
-
};
|
|
5535
|
-
} catch (error) {
|
|
5536
|
-
return {
|
|
5537
|
-
val: 0,
|
|
5538
|
-
vf: "",
|
|
5539
|
-
value: "",
|
|
5540
|
-
percentile: [],
|
|
5541
|
-
percentileFormatted: ""
|
|
5542
|
-
};
|
|
5543
|
-
}
|
|
5544
|
-
}
|
|
5545
|
-
static GetModelNodeHistFromInfluxData(data) {
|
|
5546
|
-
try {
|
|
5547
|
-
const histVal = [];
|
|
5548
|
-
if (data) {
|
|
5549
|
-
for (const [key, val] of Object.entries(data)) {
|
|
5550
|
-
const dataElement = [
|
|
5551
|
-
val,
|
|
5552
|
-
key,
|
|
5553
|
-
parseInt(key)
|
|
5554
|
-
];
|
|
5555
|
-
histVal.push(dataElement);
|
|
5556
|
-
}
|
|
5557
|
-
}
|
|
5558
|
-
try {
|
|
5559
|
-
return {
|
|
5560
|
-
hist: histVal
|
|
5561
|
-
};
|
|
5562
|
-
} catch (error) {
|
|
5563
|
-
return {
|
|
5564
|
-
hist: []
|
|
5565
|
-
};
|
|
5566
|
-
}
|
|
5567
|
-
} catch (error) {
|
|
5568
|
-
return {
|
|
5569
|
-
hist: []
|
|
5570
|
-
};
|
|
5571
|
-
}
|
|
5572
|
-
}
|
|
5573
|
-
static GetModelForService(id, data, subscribeToKafka, logger) {
|
|
5574
|
-
try {
|
|
5575
|
-
const parseLog = [];
|
|
5576
|
-
const model = {
|
|
5577
|
-
id,
|
|
5578
|
-
instruments: {}
|
|
5579
|
-
};
|
|
5580
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.REQUEST_COUNT_GAUGE, "requestCount");
|
|
5581
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.ERROR_COUNT_GAUGE, "errorCount");
|
|
5582
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.RETRY_COUNT_GAUGE, "retryCount");
|
|
5583
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_COUNT_GAUGE, "authenticationCount");
|
|
5584
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE, "authenticationErrorCount");
|
|
5585
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE, "authenticationRetryCount");
|
|
5586
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.VELOCITY_GAUGE, "velocity");
|
|
5587
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.ACTIVE_REQUEST_GAUGE, "activeRequestCount");
|
|
5588
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_COUNT_GAUGE, "connectionCount");
|
|
5589
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_POOL_TOTAL_GAUGE, "connectionPoolCount");
|
|
5590
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_POOL_IDLE_GAUGE, "connectionIdleCount");
|
|
5591
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_POOL_WAITING_GAUGE, "connectionWaitingCount");
|
|
5592
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CORE_COUNT_GAUGE, "coreCount");
|
|
5593
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.TIMER_GAUGE, "timer");
|
|
5594
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.NETWORK_RX_GAUGE, "rx");
|
|
5595
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.NETWORK_TX_GAUGE, "tx");
|
|
5596
|
-
_ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.CPU_LOAD_GAUGE, "cpu", "cpu_quantile");
|
|
5597
|
-
_ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.CPU_SYSTEM_LOAD_GAUGE, "systemcpu", "systemcpu_quantile");
|
|
5598
|
-
_ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.DURATION_GAUGE, "duration", "duration_quantile");
|
|
5599
|
-
_ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.LATENCY_GAUGE, "latency", "latency_quantile");
|
|
5600
|
-
_ObservabilityModelUtils2.ParseModelNodeHisto(model, data, parseLog, Gauge.DURATION_HISTOGRAM_GAUGE, "duration_histo");
|
|
5601
|
-
_ObservabilityModelUtils2.ParseModelNodeHisto(model, data, parseLog, Gauge.LATENCY_HISTOGRAM_GAUGE, "latency_histo");
|
|
5602
|
-
_ObservabilityModelUtils2.ParseModelNodeObject(model, data, parseLog, Gauge.OBJECT_GAUGE, "memory");
|
|
5603
|
-
if (!subscribeToKafka) {
|
|
5604
|
-
model.instruments[Gauge.LOGGER] = _ObservabilityModelUtils2.GetModelNodeRawStringArray(data["logMessages"]);
|
|
5605
|
-
}
|
|
5606
|
-
if (parseLog.length > 0) {
|
|
5607
|
-
parseLog.forEach((logEntry) => logger.debug(logEntry));
|
|
5608
|
-
}
|
|
5609
|
-
return model;
|
|
5610
|
-
} catch (error) {
|
|
5611
|
-
return null;
|
|
5612
|
-
}
|
|
5613
|
-
}
|
|
5614
|
-
static GetModelForLambda(id, data, subscribeToKafka, logger) {
|
|
5615
|
-
try {
|
|
5616
|
-
const parseLog = [];
|
|
5617
|
-
const model = {
|
|
5618
|
-
id,
|
|
5619
|
-
instruments: {}
|
|
5620
|
-
};
|
|
5621
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.REQUEST_COUNT_GAUGE, "requestCount");
|
|
5622
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.ERROR_COUNT_GAUGE, "errorCount");
|
|
5623
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.RETRY_COUNT_GAUGE, "retryCount");
|
|
5624
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_COUNT_GAUGE, "authenticationCount");
|
|
5625
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE, "authenticationErrorCount");
|
|
5626
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE, "authenticationRetryCount");
|
|
5627
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.VELOCITY_GAUGE, "velocity");
|
|
5628
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.ACTIVE_REQUEST_GAUGE, "activeRequestCount");
|
|
5629
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_COUNT_GAUGE, "connectionCount");
|
|
5630
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_POOL_TOTAL_GAUGE, "connectionPoolCount");
|
|
5631
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_POOL_IDLE_GAUGE, "connectionIdleCount");
|
|
5632
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_POOL_WAITING_GAUGE, "connectionWaitingCount");
|
|
5633
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CORE_COUNT_GAUGE, "coreCount");
|
|
5634
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.TIMER_GAUGE, "timer");
|
|
5635
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.NETWORK_RX_GAUGE, "rx");
|
|
5636
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.NETWORK_TX_GAUGE, "tx");
|
|
5637
|
-
_ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.CPU_LOAD_GAUGE, "cpu", "cpu_quantile");
|
|
5638
|
-
_ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.CPU_SYSTEM_LOAD_GAUGE, "systemcpu", "systemcpu_quantile");
|
|
5639
|
-
_ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.DURATION_GAUGE, "duration", "duration_quantile");
|
|
5640
|
-
_ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.LATENCY_GAUGE, "latency", "latency_quantile");
|
|
5641
|
-
_ObservabilityModelUtils2.ParseModelNodeHisto(model, data, parseLog, Gauge.DURATION_HISTOGRAM_GAUGE, "duration_histo");
|
|
5642
|
-
_ObservabilityModelUtils2.ParseModelNodeHisto(model, data, parseLog, Gauge.LATENCY_HISTOGRAM_GAUGE, "latency_histo");
|
|
5643
|
-
_ObservabilityModelUtils2.ParseModelNodeObject(model, data, parseLog, Gauge.OBJECT_GAUGE, "memory");
|
|
5644
|
-
if (!subscribeToKafka) {
|
|
5645
|
-
model.instruments[Gauge.LOGGER] = _ObservabilityModelUtils2.GetModelNodeRawStringArray(data["logMessages"]);
|
|
5646
|
-
}
|
|
5647
|
-
if (parseLog.length > 0) {
|
|
5648
|
-
parseLog.forEach((logEntry) => logger.debug(logEntry));
|
|
5649
|
-
}
|
|
5650
|
-
return model;
|
|
5651
|
-
} catch (error) {
|
|
5652
|
-
return null;
|
|
5653
|
-
}
|
|
5654
|
-
}
|
|
5655
|
-
static GetModelForAgent(id, data, subscribeToKafka, logger) {
|
|
5656
|
-
try {
|
|
5657
|
-
if (Object.keys(data).length === 0) {
|
|
5658
|
-
return null;
|
|
5659
|
-
}
|
|
5660
|
-
const parseLog = [];
|
|
5661
|
-
const model = {
|
|
5662
|
-
id,
|
|
5663
|
-
instruments: {}
|
|
5664
|
-
};
|
|
5665
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.REQUEST_COUNT_GAUGE, "requestCount");
|
|
5666
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.ERROR_COUNT_GAUGE, "errorCount");
|
|
5667
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.RETRY_COUNT_GAUGE, "retryCount");
|
|
5668
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_COUNT_GAUGE, "authenticationCount");
|
|
5669
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE, "authenticationErrorCount");
|
|
5670
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE, "authenticationRetryCount");
|
|
5671
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.VELOCITY_GAUGE, "velocity");
|
|
5672
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CORE_COUNT_GAUGE, "coreCount");
|
|
5673
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.TIMER_GAUGE, "timer");
|
|
5674
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.ACTIVE_REQUEST_GAUGE, "activeRequestCount");
|
|
5675
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.NETWORK_RX_GAUGE, "rx");
|
|
5676
|
-
_ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.NETWORK_TX_GAUGE, "tx");
|
|
5677
|
-
_ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.DURATION_GAUGE, "duration", "duration_quantile");
|
|
5678
|
-
_ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.LATENCY_GAUGE, "latency", "latency_quantile");
|
|
5679
|
-
_ObservabilityModelUtils2.ParseModelNodeHisto(model, data, parseLog, Gauge.DURATION_HISTOGRAM_GAUGE, "duration_histo");
|
|
5680
|
-
_ObservabilityModelUtils2.ParseModelNodeHisto(model, data, parseLog, Gauge.LATENCY_HISTOGRAM_GAUGE, "latency_histo");
|
|
5681
|
-
if (!subscribeToKafka) {
|
|
5682
|
-
model.instruments[Gauge.LOGGER] = _ObservabilityModelUtils2.GetModelNodeRawStringArray(data["logMessages"]);
|
|
5683
|
-
}
|
|
5684
|
-
if (parseLog.length > 0) {
|
|
5685
|
-
parseLog.forEach((logEntry) => logger.debug(logEntry));
|
|
5686
|
-
}
|
|
5687
|
-
return model;
|
|
5688
|
-
} catch (error) {
|
|
5689
|
-
return null;
|
|
5690
|
-
}
|
|
5691
|
-
}
|
|
5692
|
-
};
|
|
5693
|
-
__publicField2(_ObservabilityModelUtils, "ParseModelNode", (model, data, parseLog, gaugeName, fieldName) => {
|
|
5694
|
-
if (fieldName in data) {
|
|
5695
|
-
model.instruments[gaugeName] = _ObservabilityModelUtils.GetModelNode(data[fieldName]);
|
|
5696
|
-
} else {
|
|
5697
|
-
parseLog.push(`ObservabilityModelUtils:ParseModelNode(): Field not present: [${fieldName}], default to [0]`);
|
|
5698
|
-
model.instruments[gaugeName] = _ObservabilityModelUtils.GetModelNode(0);
|
|
5699
|
-
}
|
|
5700
|
-
});
|
|
5701
|
-
__publicField2(_ObservabilityModelUtils, "ParseModelNodeWithQuantile", (model, data, parseLog, gaugeName, fieldName, quantileFieldName) => {
|
|
5702
|
-
if (fieldName in data && quantileFieldName in data) {
|
|
5703
|
-
model.instruments[gaugeName] = _ObservabilityModelUtils.GetModelNodeWithQuantile(data[fieldName], data[quantileFieldName]);
|
|
5704
|
-
} else if (fieldName in data) {
|
|
5705
|
-
const dataVal = data[fieldName];
|
|
5706
|
-
parseLog.push(`ObservabilityModelUtils:ParseModelNodeWithQuantile(): QuantileFieldName not present: [${quantileFieldName}], default to [${dataVal},{}]`);
|
|
5707
|
-
model.instruments[gaugeName] = _ObservabilityModelUtils.GetModelNodeWithQuantile(dataVal, {});
|
|
5708
|
-
} else {
|
|
5709
|
-
parseLog.push(`ObservabilityModelUtils:ParseModelNodeWithQuantile(): Field not present: [${fieldName}], QuantileFieldName not present: [${quantileFieldName}], default to [0,{}]`);
|
|
5710
|
-
model.instruments[gaugeName] = _ObservabilityModelUtils.GetModelNodeWithQuantile(0, {});
|
|
5711
|
-
}
|
|
5712
|
-
});
|
|
5713
|
-
__publicField2(_ObservabilityModelUtils, "ParseModelNodeHisto", (model, data, parseLog, gaugeName, fieldName) => {
|
|
5714
|
-
if (fieldName in data) {
|
|
5715
|
-
model.instruments[gaugeName] = _ObservabilityModelUtils.GetModelNodeHistFromInfluxData(data[fieldName]);
|
|
5716
|
-
} else {
|
|
5717
|
-
parseLog.push(`ObservabilityModelUtils:ParseModelNodeHisto(): Field not present: [${fieldName}], default to [{}]`);
|
|
5718
|
-
model.instruments[gaugeName] = _ObservabilityModelUtils.GetModelNodeHistFromInfluxData({});
|
|
5719
|
-
}
|
|
5720
|
-
});
|
|
5721
|
-
__publicField2(_ObservabilityModelUtils, "ParseModelNodeObject", (model, data, parseLog, gaugeName, fieldName) => {
|
|
5722
|
-
if (fieldName in data) {
|
|
5723
|
-
model.instruments[gaugeName] = _ObservabilityModelUtils.GetModelNodeObject(data[fieldName]);
|
|
5724
|
-
} else {
|
|
5725
|
-
parseLog.push(`ObservabilityModelUtils:ParseModelNodeObject(): Field not present: [${fieldName}], default to [{}]`);
|
|
5726
|
-
model.instruments[gaugeName] = _ObservabilityModelUtils.GetModelNodeObject({});
|
|
5727
|
-
}
|
|
5728
|
-
});
|
|
5729
|
-
const byteToHex = [];
|
|
5730
|
-
for (let i = 0; i < 256; ++i) {
|
|
5731
|
-
byteToHex.push((i + 256).toString(16).slice(1));
|
|
5732
|
-
}
|
|
5733
|
-
typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
5734
|
-
const instrumentationObservationInterval = 1e3;
|
|
5735
|
-
const instrumentationTimeWindow = 600;
|
|
5736
|
-
const consoleLogging = true;
|
|
5737
|
-
const instrumentLogging = true;
|
|
5738
|
-
({
|
|
5739
|
-
coreFieldList: [
|
|
5740
|
-
{ fieldName: "requestCount", gauge: Gauge.REQUEST_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
5741
|
-
{ fieldName: "errorCount", gauge: Gauge.ERROR_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
5742
|
-
{ fieldName: "retryCount", gauge: Gauge.RETRY_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
5743
|
-
{ fieldName: "authenticationCount", gauge: Gauge.AUTHENTICATION_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
5744
|
-
{ fieldName: "authenticationErrorCount", gauge: Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
5745
|
-
{ fieldName: "authenticationRetryCount", gauge: Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
5746
|
-
{ fieldName: "velocity", gauge: Gauge.VELOCITY_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
|
|
5747
|
-
{
|
|
5748
|
-
fieldName: "activeRequestCount",
|
|
5749
|
-
gauge: Gauge.ACTIVE_REQUEST_GAUGE,
|
|
5750
|
-
instrumentProperty: "val",
|
|
5751
|
-
dataType: "number",
|
|
5752
|
-
timeSeriesIndex: true,
|
|
5753
|
-
quantile: true,
|
|
5754
|
-
influxdbDataType: "intField",
|
|
5755
|
-
gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
|
|
5756
|
-
instrumentOptions: {
|
|
5757
|
-
interval: instrumentationObservationInterval,
|
|
5758
|
-
sampleSize: instrumentationTimeWindow
|
|
5759
|
-
}
|
|
5760
|
-
},
|
|
5761
|
-
{ fieldName: "coreCount", gauge: Gauge.CORE_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
5762
|
-
{ fieldName: "rx", gauge: Gauge.NETWORK_RX_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
|
|
5763
|
-
{ fieldName: "tx", gauge: Gauge.NETWORK_TX_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
|
|
5764
|
-
{ fieldName: "timer", gauge: Gauge.TIMER_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_TIMER },
|
|
5765
|
-
{
|
|
5766
|
-
fieldName: "duration",
|
|
5767
|
-
gauge: Gauge.DURATION_GAUGE,
|
|
5768
|
-
instrumentProperty: "val",
|
|
5769
|
-
dataType: "number",
|
|
5770
|
-
timeSeriesIndex: true,
|
|
5771
|
-
quantile: true,
|
|
5772
|
-
influxdbDataType: "floatField",
|
|
5773
|
-
gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
|
|
5774
|
-
instrumentOptions: {
|
|
5775
|
-
interval: instrumentationObservationInterval,
|
|
5776
|
-
sampleSize: instrumentationTimeWindow
|
|
5777
|
-
},
|
|
5778
|
-
histo: [
|
|
5779
|
-
{ label: "B10", bucketLimit: 10 },
|
|
5780
|
-
{ label: "B20", bucketLimit: 20 },
|
|
5781
|
-
{ label: "B50", bucketLimit: 50 },
|
|
5782
|
-
{ label: "B100", bucketLimit: 100 },
|
|
5783
|
-
{ label: "B1000", bucketLimit: 1e3 },
|
|
5784
|
-
{ label: "B50000", bucketLimit: 5e4 },
|
|
5785
|
-
{ label: "BInfinity", bucketLimit: -1 }
|
|
5786
|
-
],
|
|
5787
|
-
histoGaugeType: Gauge.DURATION_HISTOGRAM_GAUGE
|
|
5788
|
-
},
|
|
5789
|
-
{
|
|
5790
|
-
fieldName: "latency",
|
|
5791
|
-
gauge: Gauge.LATENCY_GAUGE,
|
|
5792
|
-
instrumentProperty: "val",
|
|
5793
|
-
dataType: "number",
|
|
5794
|
-
timeSeriesIndex: true,
|
|
5795
|
-
quantile: true,
|
|
5796
|
-
influxdbDataType: "floatField",
|
|
5797
|
-
gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
|
|
5798
|
-
instrumentOptions: {
|
|
5799
|
-
interval: instrumentationObservationInterval,
|
|
5800
|
-
sampleSize: instrumentationTimeWindow
|
|
5801
|
-
},
|
|
5802
|
-
histo: [
|
|
5803
|
-
{ label: "B10", bucketLimit: 10 },
|
|
5804
|
-
{ label: "B20", bucketLimit: 20 },
|
|
5805
|
-
{ label: "B50", bucketLimit: 50 },
|
|
5806
|
-
{ label: "B100", bucketLimit: 100 },
|
|
5807
|
-
{ label: "B1000", bucketLimit: 1e3 },
|
|
5808
|
-
{ label: "B50000", bucketLimit: 5e4 },
|
|
5809
|
-
{ label: "BInfinity", bucketLimit: -1 }
|
|
5810
|
-
],
|
|
5811
|
-
histoGaugeType: Gauge.LATENCY_HISTOGRAM_GAUGE
|
|
5812
|
-
}
|
|
5813
|
-
],
|
|
5814
|
-
logFieldList: [
|
|
5815
|
-
{
|
|
5816
|
-
fieldName: "log",
|
|
5817
|
-
gauge: Gauge.LOGGER,
|
|
5818
|
-
instrumentProperty: "val",
|
|
5819
|
-
dataType: "string",
|
|
5820
|
-
timeSeriesIndex: false,
|
|
5821
|
-
quantile: false,
|
|
5822
|
-
influxdbDataType: "stringField",
|
|
5823
|
-
gaugeType: GaugeTypes.INSTRUMENT_LOG,
|
|
5824
|
-
instrumentOptions: {
|
|
5825
|
-
consoleLogging,
|
|
5826
|
-
instrumentLogging
|
|
5827
|
-
}
|
|
5828
|
-
}
|
|
5829
|
-
],
|
|
5830
|
-
services: {
|
|
5831
|
-
["service"]: {
|
|
5832
|
-
influxDBContextTags: [
|
|
5833
|
-
"serviceId",
|
|
5834
|
-
"serviceName",
|
|
5835
|
-
"serviceVersion",
|
|
5836
|
-
"serviceInstanceId",
|
|
5837
|
-
"serviceInstanceProcessId",
|
|
5838
|
-
"hostName",
|
|
5839
|
-
"pid",
|
|
5840
|
-
"ppid"
|
|
5841
|
-
],
|
|
5842
|
-
redisIndexPrefixDefinitions: {
|
|
5843
|
-
timeSeriesIndex: "idx:serviceIndexTimeSeries",
|
|
5844
|
-
timeSeriesPrefix: "/serviceTimeSeries:",
|
|
5845
|
-
instantIndex: "idx:serviceIndexInstant",
|
|
5846
|
-
instantPrefix: "/serviceInstant:"
|
|
5847
|
-
},
|
|
5848
|
-
fieldList: [
|
|
5849
|
-
{
|
|
5850
|
-
fieldName: "cpu",
|
|
5851
|
-
gauge: Gauge.CPU_LOAD_GAUGE,
|
|
5852
|
-
instrumentProperty: "val",
|
|
5853
|
-
dataType: "number",
|
|
5854
|
-
timeSeriesIndex: true,
|
|
5855
|
-
quantile: true,
|
|
5856
|
-
influxdbDataType: "floatField",
|
|
5857
|
-
gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
|
|
5858
|
-
instrumentOptions: {
|
|
5859
|
-
interval: instrumentationObservationInterval,
|
|
5860
|
-
sampleSize: instrumentationTimeWindow
|
|
5861
|
-
}
|
|
5862
|
-
},
|
|
5863
|
-
{
|
|
5864
|
-
fieldName: "connectionCount",
|
|
5865
|
-
gauge: Gauge.CONNECTION_COUNT_GAUGE,
|
|
5866
|
-
instrumentProperty: "val",
|
|
5867
|
-
dataType: "number",
|
|
5868
|
-
timeSeriesIndex: true,
|
|
5869
|
-
quantile: true,
|
|
5870
|
-
influxdbDataType: "intField",
|
|
5871
|
-
gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
|
|
5872
|
-
instrumentOptions: {
|
|
5873
|
-
interval: instrumentationObservationInterval,
|
|
5874
|
-
sampleSize: instrumentationTimeWindow
|
|
5875
|
-
}
|
|
5876
|
-
},
|
|
5877
|
-
{ fieldName: "connectionPoolCount", gauge: Gauge.CONNECTION_POOL_TOTAL_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
5878
|
-
{ fieldName: "connectionIdleCount", gauge: Gauge.CONNECTION_POOL_IDLE_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
5879
|
-
{ fieldName: "connectionWaitingCount", gauge: Gauge.CONNECTION_POOL_WAITING_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
5880
|
-
{ fieldName: "systemcpu", gauge: Gauge.CPU_SYSTEM_LOAD_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
5881
|
-
{
|
|
5882
|
-
fieldName: "memory",
|
|
5883
|
-
gauge: Gauge.OBJECT_GAUGE,
|
|
5884
|
-
instrumentProperty: "val",
|
|
5885
|
-
dataType: "JSON",
|
|
5886
|
-
influxdbDataType: "stringField",
|
|
5887
|
-
gaugeType: GaugeTypes.INSTRUMENT_OBJECT,
|
|
5888
|
-
instrumentOptions: {
|
|
5889
|
-
label: "InstrumentObjectMaster"
|
|
5890
|
-
}
|
|
5891
|
-
}
|
|
5892
|
-
],
|
|
5893
|
-
GetPathFromContext(context) {
|
|
5894
|
-
const { serviceId, serviceInstanceId, serviceInstanceProcessId } = context;
|
|
5895
|
-
return `/${serviceId}/${serviceInstanceId}/${serviceInstanceProcessId}`;
|
|
5896
|
-
},
|
|
5897
|
-
redisQueryFilters: {
|
|
5898
|
-
level1ContextField: "serviceType",
|
|
5899
|
-
level2ContextField: "appid",
|
|
5900
|
-
level3ContextField: "appinstanceid"
|
|
5901
|
-
},
|
|
5902
|
-
subscriptionTopics: [
|
|
5903
|
-
{
|
|
5904
|
-
subscriptionTopic: SubscriptionTopic.AllServicesCombined,
|
|
5905
|
-
route: "/metrics"
|
|
5906
|
-
},
|
|
5907
|
-
{
|
|
5908
|
-
subscriptionTopic: SubscriptionTopic.Services,
|
|
5909
|
-
route: "/metrics/services"
|
|
5910
|
-
},
|
|
5911
|
-
{
|
|
5912
|
-
subscriptionTopic: SubscriptionTopic.ServiceInstances,
|
|
5913
|
-
route: "/metrics/services/:key"
|
|
5914
|
-
},
|
|
5915
|
-
{
|
|
5916
|
-
subscriptionTopic: SubscriptionTopic.ServiceInstance,
|
|
5917
|
-
route: "/metrics/services/:key/:subkey"
|
|
5918
|
-
}
|
|
5919
|
-
]
|
|
5920
|
-
},
|
|
5921
|
-
["agent"]: {
|
|
5922
|
-
influxDBContextTags: [
|
|
5923
|
-
"id",
|
|
5924
|
-
"hostName",
|
|
5925
|
-
"agentName",
|
|
5926
|
-
"threadId",
|
|
5927
|
-
"asyncRunnerId"
|
|
5928
|
-
],
|
|
5929
|
-
redisIndexPrefixDefinitions: {
|
|
5930
|
-
timeSeriesIndex: "idx:agentIndexTimeSeries",
|
|
5931
|
-
timeSeriesPrefix: "/agentTimeSeries:",
|
|
5932
|
-
instantIndex: "idx:agentIndexInstant",
|
|
5933
|
-
instantPrefix: "/agentInstant:"
|
|
5934
|
-
},
|
|
5935
|
-
fieldList: [
|
|
5936
|
-
{ fieldName: "childCount", gauge: Gauge.CHILD_COUNT, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE }
|
|
5937
|
-
],
|
|
5938
|
-
//@@ need type declare in appframework ?? agent does not use appframework ... perhaps stspublisher
|
|
5939
|
-
GetPathFromContext(context) {
|
|
5940
|
-
const { agentName, threadId, asyncRunnerId } = context;
|
|
5941
|
-
return `/${agentName}/${threadId}/${asyncRunnerId}`;
|
|
5942
|
-
},
|
|
5943
|
-
redisQueryFilters: {
|
|
5944
|
-
level1ContextField: "serviceType",
|
|
5945
|
-
level2ContextField: "appid",
|
|
5946
|
-
//@@ this should be named something else
|
|
5947
|
-
level3ContextField: "appinstanceid"
|
|
5948
|
-
//@@ this should be named something else
|
|
5949
|
-
},
|
|
5950
|
-
subscriptionTopics: [
|
|
5951
|
-
{
|
|
5952
|
-
subscriptionTopic: SubscriptionTopic.AllAgentsCombined,
|
|
5953
|
-
route: "/metrics"
|
|
5954
|
-
},
|
|
5955
|
-
{
|
|
5956
|
-
subscriptionTopic: SubscriptionTopic.Agents,
|
|
5957
|
-
route: "/metrics/agents"
|
|
5958
|
-
},
|
|
5959
|
-
{
|
|
5960
|
-
subscriptionTopic: SubscriptionTopic.AgentWorkers,
|
|
5961
|
-
route: "/metrics/agents/:key"
|
|
5962
|
-
},
|
|
5963
|
-
{
|
|
5964
|
-
subscriptionTopic: SubscriptionTopic.AgentWorker,
|
|
5965
|
-
route: "/metrics/agents/:key/:subkey"
|
|
5966
|
-
}
|
|
5967
|
-
]
|
|
5968
|
-
},
|
|
5969
|
-
["lambda"]: {
|
|
5970
|
-
influxDBContextTags: [
|
|
5971
|
-
"technology",
|
|
5972
|
-
"subTechnology",
|
|
5973
|
-
"lambdaFunctionName",
|
|
5974
|
-
"lambdaInstance",
|
|
5975
|
-
"hostName",
|
|
5976
|
-
"processId",
|
|
5977
|
-
"parentProcessId",
|
|
5978
|
-
"useCase",
|
|
5979
|
-
"pattern"
|
|
5980
|
-
],
|
|
5981
|
-
redisIndexPrefixDefinitions: {
|
|
5982
|
-
timeSeriesIndex: "idx:lambdaIndexTimeSeries",
|
|
5983
|
-
timeSeriesPrefix: "/lambdaTimeSeries:",
|
|
5984
|
-
instantIndex: "idx:lambdaIndexInstant",
|
|
5985
|
-
instantPrefix: "/lambdaInstant:"
|
|
5986
|
-
},
|
|
5987
|
-
fieldList: [
|
|
5988
|
-
{ fieldName: "cpu", gauge: Gauge.CPU_LOAD_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
5989
|
-
{ fieldName: "connectionCount", gauge: Gauge.CONNECTION_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
5990
|
-
{ fieldName: "connectionPoolCount", gauge: Gauge.CONNECTION_POOL_TOTAL_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
5991
|
-
{ fieldName: "connectionIdleCount", gauge: Gauge.CONNECTION_POOL_IDLE_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
5992
|
-
{ fieldName: "connectionWaitingCount", gauge: Gauge.CONNECTION_POOL_WAITING_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
5993
|
-
{ fieldName: "systemcpu", gauge: Gauge.CPU_SYSTEM_LOAD_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
|
|
5994
|
-
{ fieldName: "memory", gauge: Gauge.OBJECT_GAUGE, instrumentProperty: "val", dataType: "JSON", influxdbDataType: "stringField", gaugeType: GaugeTypes.INSTRUMENT_OBJECT }
|
|
5995
|
-
],
|
|
5996
|
-
//@@ need type declare in appframework
|
|
5997
|
-
GetPathFromContext(context) {
|
|
5998
|
-
const { technology, subTechnology, lambdaInstance } = context;
|
|
5999
|
-
return `/${technology}/${subTechnology}/${lambdaInstance}`;
|
|
6000
|
-
},
|
|
6001
|
-
redisQueryFilters: {
|
|
6002
|
-
level1ContextField: "serviceType",
|
|
6003
|
-
level2ContextField: "technology",
|
|
6004
|
-
level3ContextField: "subTechnology"
|
|
6005
|
-
},
|
|
6006
|
-
subscriptionTopics: [
|
|
6007
|
-
{
|
|
6008
|
-
subscriptionTopic: SubscriptionTopic.AllLambdasCombined,
|
|
6009
|
-
// uicontrollerlanding
|
|
6010
|
-
route: "/metrics"
|
|
6011
|
-
},
|
|
6012
|
-
{
|
|
6013
|
-
subscriptionTopic: SubscriptionTopic.LambdaTechnologies,
|
|
6014
|
-
// uicontrollerlambda
|
|
6015
|
-
route: "/metrics/lambdas"
|
|
6016
|
-
},
|
|
6017
|
-
{
|
|
6018
|
-
subscriptionTopic: SubscriptionTopic.LambdaSubTechnologies,
|
|
6019
|
-
// uicontrollerlambdasubtechnologies
|
|
6020
|
-
route: "/metrics/lambdas/:key"
|
|
6021
|
-
},
|
|
6022
|
-
{
|
|
6023
|
-
subscriptionTopic: SubscriptionTopic.LambdaSubTechnologiesInstance,
|
|
6024
|
-
// uicontrollerlambdasubtechnologiesinstance
|
|
6025
|
-
route: "/metrics/lambdas/:key/:subkey"
|
|
6026
|
-
}
|
|
6027
|
-
]
|
|
6028
|
-
}
|
|
6029
|
-
}
|
|
6030
|
-
});
|
|
6031
2549
|
class STSOAuth2Manager {
|
|
6032
2550
|
// ms
|
|
6033
2551
|
constructor(app, options) {
|
|
@@ -6058,7 +2576,7 @@ var __privateMethod = (obj, member, method) => {
|
|
|
6058
2576
|
__privateAdd(this, _semaphoreRetrySleep, 50);
|
|
6059
2577
|
__privateAdd(this, _ProcessMessageResponse, (data) => {
|
|
6060
2578
|
const messageResponse = data;
|
|
6061
|
-
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$
|
|
2579
|
+
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$1.yellow(`STSOAuth2Manager:#ProcessMessageResponse: message data = [${JSON.stringify(messageResponse)}]`));
|
|
6062
2580
|
if (messageResponse.messageId === -1) {
|
|
6063
2581
|
switch (messageResponse.command) {
|
|
6064
2582
|
case IOauth2ListenerCommand.AUTHENTICATE_EVENT:
|
|
@@ -6095,10 +2613,10 @@ var __privateMethod = (obj, member, method) => {
|
|
|
6095
2613
|
__privateGet(this, _messageHandlers)[message.messageId] = (response) => {
|
|
6096
2614
|
clearTimeout(timeout);
|
|
6097
2615
|
delete __privateGet(this, _messageHandlers)[message.messageId];
|
|
6098
|
-
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$
|
|
2616
|
+
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$1.yellow(`STSOAuth2Manager:#PostMessage: resolve callback response= [${JSON.stringify(response)}]`));
|
|
6099
2617
|
resolve(response);
|
|
6100
2618
|
};
|
|
6101
|
-
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$
|
|
2619
|
+
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$1.yellow(`STSOAuth2Manager:#PostMessage: posting message = [${JSON.stringify(message)}]`));
|
|
6102
2620
|
__privateGet(this, _oauth2ManagerPort).postMessage(message);
|
|
6103
2621
|
});
|
|
6104
2622
|
});
|
|
@@ -6142,10 +2660,10 @@ var __privateMethod = (obj, member, method) => {
|
|
|
6142
2660
|
}
|
|
6143
2661
|
});
|
|
6144
2662
|
__privateAdd(this, _SetupRoute, (app, router) => {
|
|
6145
|
-
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$
|
|
2663
|
+
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$1.gray(`STSOAuth2Manager:#SetupRoute`));
|
|
6146
2664
|
router.beforeEach(async (to, from, next) => {
|
|
6147
2665
|
const oAuth2Manager = app.config.globalProperties.$sts[STSOAuth2ManagerPluginKey];
|
|
6148
|
-
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$
|
|
2666
|
+
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$1.gray(`beforeEach: from: [${from.path}], to: [${to.path}]`));
|
|
6149
2667
|
if (__privateGet(this, _GetStore).call(this).LoggedIn === false) {
|
|
6150
2668
|
__privateMethod(this, _LogInfoMessage, LogInfoMessage_fn).call(this, `Not logged in`);
|
|
6151
2669
|
if (to.path.localeCompare(`${__privateGet(this, _options).uriBase}authorize`) === 0) {
|
|
@@ -6176,9 +2694,9 @@ var __privateMethod = (obj, member, method) => {
|
|
|
6176
2694
|
}
|
|
6177
2695
|
const str = to.query;
|
|
6178
2696
|
if (str[stsutils.OAuth2ParameterType.CODE] || str[stsutils.OAuth2ParameterType.ERROR]) {
|
|
6179
|
-
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$
|
|
2697
|
+
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$1.magenta(`STSOAuth2Manager:#SetupRoute:Processing redirect: [${JSON.stringify(str)}]`));
|
|
6180
2698
|
const retVal = await oAuth2Manager.HandleRedirect(str);
|
|
6181
|
-
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$
|
|
2699
|
+
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$1.magenta(`STSOAuth2Manager:#SetupRoute:Redirect result: [${retVal}]`));
|
|
6182
2700
|
if (retVal) {
|
|
6183
2701
|
next({
|
|
6184
2702
|
path: `${__privateGet(this, _options).uriBase}`,
|
|
@@ -6234,7 +2752,7 @@ var __privateMethod = (obj, member, method) => {
|
|
|
6234
2752
|
throw new Error(`STSOAuth2Manager:ExecuteRefreshToken:maxSemaphoreRetries: [${__privateGet(this, _maxSemaphoreRetries)}] exceeded.`);
|
|
6235
2753
|
}
|
|
6236
2754
|
await stsutils.Sleep(__privateGet(this, _semaphoreRetrySleep));
|
|
6237
|
-
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$
|
|
2755
|
+
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$1.cyan(`STSOAuth2Manager:ExecuteRefreshToken:locked by operationSemaphore, retry count: [${retryCount}]`));
|
|
6238
2756
|
return await this.ExecuteRefreshToken(retryCount + 1);
|
|
6239
2757
|
} else {
|
|
6240
2758
|
__privateSet(this, _operationSemaphore, true);
|
|
@@ -6255,7 +2773,7 @@ var __privateMethod = (obj, member, method) => {
|
|
|
6255
2773
|
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, `STSOAuth2Manager:RestoreSession:response: [${JSON.stringify(response.payload)}]`);
|
|
6256
2774
|
return response.payload;
|
|
6257
2775
|
} catch (error) {
|
|
6258
|
-
__privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$
|
|
2776
|
+
__privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$1.red(`RestoreSession Error: ${error}`));
|
|
6259
2777
|
return false;
|
|
6260
2778
|
}
|
|
6261
2779
|
});
|
|
@@ -6270,18 +2788,18 @@ var __privateMethod = (obj, member, method) => {
|
|
|
6270
2788
|
return response.payload.authorizeOptionsClientCopy;
|
|
6271
2789
|
}
|
|
6272
2790
|
} catch (error) {
|
|
6273
|
-
__privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$
|
|
2791
|
+
__privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$1.red(`Authorize Error: ${error}`));
|
|
6274
2792
|
}
|
|
6275
2793
|
return {};
|
|
6276
2794
|
});
|
|
6277
2795
|
__publicField(this, "HandleRedirect", async (queryVars) => {
|
|
6278
2796
|
try {
|
|
6279
|
-
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$
|
|
2797
|
+
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$1.magenta(`STSOAuth2Manager:HandleRedirect`));
|
|
6280
2798
|
let response = null;
|
|
6281
2799
|
if (queryVars[stsutils.OAuth2ParameterType.CODE]) {
|
|
6282
2800
|
const authorizeOptions = __privateGet(this, _transactionStore).get(__privateGet(this, _STORAGE_AUTHORIZE_OPTIONS_KEY));
|
|
6283
2801
|
__privateGet(this, _transactionStore).remove(__privateGet(this, _STORAGE_AUTHORIZE_OPTIONS_KEY));
|
|
6284
|
-
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$
|
|
2802
|
+
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$1.magenta(`STSOAuth2Manager:HandleRedirect: sending HANDLE_REDIRECT command`));
|
|
6285
2803
|
response = await __privateGet(this, _PostMessage).call(this, { command: IOauth2ListenerCommand.HANDLE_REDIRECT, payload: {
|
|
6286
2804
|
queryVars,
|
|
6287
2805
|
authorizeOptions
|
|
@@ -6289,10 +2807,10 @@ var __privateMethod = (obj, member, method) => {
|
|
|
6289
2807
|
} else {
|
|
6290
2808
|
response = await __privateGet(this, _PostMessage).call(this, { command: IOauth2ListenerCommand.HANDLE_REDIRECT, payload: queryVars });
|
|
6291
2809
|
}
|
|
6292
|
-
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$
|
|
2810
|
+
__privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$1.magenta(`STSOAuth2Manager:HandleRedirect: HANDLE_REDIRECT response: [${JSON.stringify(response)}]`));
|
|
6293
2811
|
return response.payload;
|
|
6294
2812
|
} catch (error) {
|
|
6295
|
-
__privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$
|
|
2813
|
+
__privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$1.red(`HandleRedirect Error: ${error}`));
|
|
6296
2814
|
return false;
|
|
6297
2815
|
}
|
|
6298
2816
|
});
|
|
@@ -6301,7 +2819,7 @@ var __privateMethod = (obj, member, method) => {
|
|
|
6301
2819
|
const response = await __privateGet(this, _PostMessage).call(this, { command: IOauth2ListenerCommand.LOGOUT });
|
|
6302
2820
|
return response.payload;
|
|
6303
2821
|
} catch (error) {
|
|
6304
|
-
__privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$
|
|
2822
|
+
__privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$1.red(`Logout Error: ${error}`));
|
|
6305
2823
|
return false;
|
|
6306
2824
|
}
|
|
6307
2825
|
});
|
|
@@ -6311,7 +2829,7 @@ var __privateMethod = (obj, member, method) => {
|
|
|
6311
2829
|
const response = await __privateGet(this, _PostMessage).call(this, { command: IOauth2ListenerCommand.LOGOUT });
|
|
6312
2830
|
return response.payload;
|
|
6313
2831
|
} catch (error) {
|
|
6314
|
-
__privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$
|
|
2832
|
+
__privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$1.red(`InvokeExternalAPI Error: ${error}`));
|
|
6315
2833
|
return null;
|
|
6316
2834
|
}
|
|
6317
2835
|
});
|
|
@@ -6324,8 +2842,8 @@ var __privateMethod = (obj, member, method) => {
|
|
|
6324
2842
|
});
|
|
6325
2843
|
__privateSet(this, _options, options);
|
|
6326
2844
|
if (!isNode) {
|
|
6327
|
-
if (app.config.globalProperties.$sts[STSInstrumentControllerPluginKey]) {
|
|
6328
|
-
const STSInstrumentController = app.config.globalProperties.$sts[STSInstrumentControllerPluginKey];
|
|
2845
|
+
if (app.config.globalProperties.$sts[stsobservability.STSInstrumentControllerPluginKey]) {
|
|
2846
|
+
const STSInstrumentController = app.config.globalProperties.$sts[stsobservability.STSInstrumentControllerPluginKey];
|
|
6329
2847
|
__privateSet(this, _aic, STSInstrumentController);
|
|
6330
2848
|
}
|
|
6331
2849
|
__privateSet(this, _router, app.config.globalProperties.$router);
|
|
@@ -6342,10 +2860,10 @@ var __privateMethod = (obj, member, method) => {
|
|
|
6342
2860
|
}
|
|
6343
2861
|
if (!isNode) {
|
|
6344
2862
|
__privateGet(this, _worker).onmessage = (data) => {
|
|
6345
|
-
__privateMethod(this, _LogInfoMessage, LogInfoMessage_fn).call(this, chalk$
|
|
2863
|
+
__privateMethod(this, _LogInfoMessage, LogInfoMessage_fn).call(this, chalk$1.green(`this.#worker.onmessage = [${data}]`));
|
|
6346
2864
|
};
|
|
6347
2865
|
__privateGet(this, _worker).onerror = (error) => {
|
|
6348
|
-
__privateMethod(this, _LogInfoMessage, LogInfoMessage_fn).call(this, chalk$
|
|
2866
|
+
__privateMethod(this, _LogInfoMessage, LogInfoMessage_fn).call(this, chalk$1.green(`this.#worker.onerror = [${JSON.stringify(error)}]`));
|
|
6349
2867
|
};
|
|
6350
2868
|
}
|
|
6351
2869
|
let workerMessage;
|
|
@@ -6654,7 +3172,7 @@ var __privateMethod = (obj, member, method) => {
|
|
|
6654
3172
|
// Ensure cookies are passed to the service
|
|
6655
3173
|
timeout: __privateGet(this, _options2).timeout
|
|
6656
3174
|
};
|
|
6657
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
3175
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.magenta(`#RestoreSession:session request detail: [${JSON.stringify(rConfig)}]`));
|
|
6658
3176
|
if (isNode) {
|
|
6659
3177
|
rConfig.httpsAgent = __privateGet(this, _httpsAgent);
|
|
6660
3178
|
}
|
|
@@ -6731,29 +3249,29 @@ var __privateMethod = (obj, member, method) => {
|
|
|
6731
3249
|
__privateAdd(this, _HandleRedirect, async (payload) => {
|
|
6732
3250
|
const queryVars = payload.queryVars;
|
|
6733
3251
|
const authorizeOptions = payload.authorizeOptions;
|
|
6734
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
6735
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
3252
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.magenta(`#HandleRedirect: HandleRedirect`));
|
|
3253
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.magenta(`#HandleRedirect: HandleRedirect:Query Vars: [${JSON.stringify(queryVars)}]`));
|
|
6736
3254
|
if (queryVars[stsutils.OAuth2ParameterType.CODE]) {
|
|
6737
3255
|
const response = queryVars;
|
|
6738
3256
|
__privateMethod(this, _LogInfoMessage2, LogInfoMessage_fn2).call(this, `authorizeOptions from transaction state: [${JSON.stringify(authorizeOptions)}]`);
|
|
6739
3257
|
const redirectState = response.state;
|
|
6740
3258
|
const authorizeOptionsState = authorizeOptions.state;
|
|
6741
3259
|
if (authorizeOptionsState.localeCompare(redirectState) === 0) {
|
|
6742
|
-
__privateMethod(this, _LogInfoMessage2, LogInfoMessage_fn2).call(this, chalk$
|
|
3260
|
+
__privateMethod(this, _LogInfoMessage2, LogInfoMessage_fn2).call(this, chalk$1.green("redirected state (from queryVars) matched previously saved transaction authorizeOptions state"));
|
|
6743
3261
|
return await __privateGet(this, _GetToken).call(this, authorizeOptions, response);
|
|
6744
3262
|
} else {
|
|
6745
|
-
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$
|
|
6746
|
-
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$
|
|
6747
|
-
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$
|
|
3263
|
+
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$1.red("redirected state (from queryVars) did NOT match previously saved transaction authorizeOptions state"));
|
|
3264
|
+
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$1.red(`authorizeOptionsState: [${authorizeOptionsState}]`));
|
|
3265
|
+
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$1.red(`redirectState: [${redirectState}]`));
|
|
6748
3266
|
__privateGet(this, _HandleErrorEvent2).call(this, { message: "State un-matched" });
|
|
6749
3267
|
return false;
|
|
6750
3268
|
}
|
|
6751
3269
|
} else if (queryVars[stsutils.OAuth2ParameterType.ERROR]) {
|
|
6752
|
-
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$
|
|
3270
|
+
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$1.red(`State un-matched (1)`));
|
|
6753
3271
|
__privateGet(this, _HandleErrorEvent2).call(this, { message: "State un-matched" });
|
|
6754
3272
|
return false;
|
|
6755
3273
|
} else {
|
|
6756
|
-
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$
|
|
3274
|
+
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$1.red(`State un-matched (2)`));
|
|
6757
3275
|
__privateGet(this, _HandleErrorEvent2).call(this, { message: "State un-matched" });
|
|
6758
3276
|
return false;
|
|
6759
3277
|
}
|
|
@@ -6779,7 +3297,7 @@ var __privateMethod = (obj, member, method) => {
|
|
|
6779
3297
|
*/
|
|
6780
3298
|
// Get access_token, refresh_token and id_token using OAuth2 Authorization Code Flow
|
|
6781
3299
|
__privateAdd(this, _GetTokenFromBroker, async (authorizationCodeFlowParameters) => {
|
|
6782
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
3300
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.magenta(`#GetTokenFromBroker`));
|
|
6783
3301
|
__privateGet(this, _clientSessionStore).remove(__privateGet(this, _STORAGE_SESSION_KEY2));
|
|
6784
3302
|
const url = `${__privateGet(this, _options2).brokerendpoint}:${__privateGet(this, _options2).brokerport}${__privateGet(this, _options2).brokerapiroot}/token`;
|
|
6785
3303
|
try {
|
|
@@ -6791,15 +3309,15 @@ var __privateMethod = (obj, member, method) => {
|
|
|
6791
3309
|
// Ensure cookies are passed to the service
|
|
6792
3310
|
timeout: __privateGet(this, _options2).timeout
|
|
6793
3311
|
};
|
|
6794
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
3312
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.magenta(`#GetTokenFromBroker: request config: [${JSON.stringify(rConfig)}]`));
|
|
6795
3313
|
if (isNode) {
|
|
6796
3314
|
rConfig.httpsAgent = __privateGet(this, _httpsAgent);
|
|
6797
3315
|
}
|
|
6798
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
3316
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.magenta(`#GetTokenFromBroker: axios API call`));
|
|
6799
3317
|
const retVal = await axios(rConfig);
|
|
6800
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
3318
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.magenta(`#GetTokenFromBroker: axios API call result: [${retVal.status}]`));
|
|
6801
3319
|
if (retVal.status === StatusCodes.OK) {
|
|
6802
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
3320
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.magenta(`#GetTokenFromBroker: storing tokens`));
|
|
6803
3321
|
const tokenResponse = retVal.data;
|
|
6804
3322
|
__privateGet(this, _HandleAuthenticateEvent2).call(this, tokenResponse.id_token);
|
|
6805
3323
|
const newSessionData = {
|
|
@@ -6811,18 +3329,18 @@ var __privateMethod = (obj, member, method) => {
|
|
|
6811
3329
|
__privateGet(this, _clientSessionStore).set(__privateGet(this, _STORAGE_SESSION_KEY2), newSessionData);
|
|
6812
3330
|
return true;
|
|
6813
3331
|
} else if (retVal.status === StatusCodes.UNAUTHORIZED) {
|
|
6814
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
3332
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.magenta(`#GetTokenFromBroker: NOT storing tokens, status: [${retVal.status}]`));
|
|
6815
3333
|
__privateGet(this, _HandleAuthenticateEvent2).call(this, null);
|
|
6816
3334
|
return false;
|
|
6817
3335
|
} else {
|
|
6818
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
3336
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.magenta(`#GetTokenFromBroker: NOT storing tokens (general error 1), status: [${retVal.status}]`));
|
|
6819
3337
|
__privateGet(this, _HandleAuthenticateEvent2).call(this, null);
|
|
6820
|
-
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$
|
|
6821
|
-
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$
|
|
3338
|
+
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$1.red("Could not obtain access_token from token end-point:-"));
|
|
3339
|
+
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$1.red(JSON.stringify(retVal.data)));
|
|
6822
3340
|
return false;
|
|
6823
3341
|
}
|
|
6824
3342
|
} catch (error) {
|
|
6825
|
-
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$
|
|
3343
|
+
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$1.red(`#GetTokenFromBroker: NOT storing tokens (general error 2), status: [${error}]`));
|
|
6826
3344
|
__privateGet(this, _HandleAuthenticateEvent2).call(this, null);
|
|
6827
3345
|
return false;
|
|
6828
3346
|
}
|
|
@@ -6868,10 +3386,10 @@ var __privateMethod = (obj, member, method) => {
|
|
|
6868
3386
|
}
|
|
6869
3387
|
*/
|
|
6870
3388
|
__privateAdd(this, _RefreshToken, async () => {
|
|
6871
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
3389
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.cyan(`STSOAuth2Worker:#RefreshToken:start`));
|
|
6872
3390
|
const sessionData = __privateGet(this, _clientSessionStore).get(__privateGet(this, _STORAGE_SESSION_KEY2));
|
|
6873
3391
|
if (sessionData) {
|
|
6874
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
3392
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.cyan(`STSOAuth2Worker:#RefreshToken:sessionData: [${JSON.stringify(sessionData)}]`));
|
|
6875
3393
|
const currentSessionData = sessionData.tokenResponse;
|
|
6876
3394
|
const refreshFlowParameters = {
|
|
6877
3395
|
client_id: __privateGet(this, _options2).client_id,
|
|
@@ -6881,7 +3399,7 @@ var __privateMethod = (obj, member, method) => {
|
|
|
6881
3399
|
};
|
|
6882
3400
|
return await __privateGet(this, _GetTokenFromBroker).call(this, refreshFlowParameters);
|
|
6883
3401
|
} else {
|
|
6884
|
-
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$
|
|
3402
|
+
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$1.red(`STSOAuth2Worker:#RefreshToken:sessionData not found within clientSessionStore`));
|
|
6885
3403
|
return false;
|
|
6886
3404
|
}
|
|
6887
3405
|
});
|
|
@@ -6916,7 +3434,7 @@ var __privateMethod = (obj, member, method) => {
|
|
|
6916
3434
|
// Ensure cookies are passed to the service
|
|
6917
3435
|
timeout: __privateGet(this, _options2).timeout
|
|
6918
3436
|
};
|
|
6919
|
-
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$
|
|
3437
|
+
__privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.magenta(`#Logout: request config: [${rConfig}]`));
|
|
6920
3438
|
if (isNode) {
|
|
6921
3439
|
rConfig.httpsAgent = __privateGet(this, _httpsAgent);
|
|
6922
3440
|
}
|
|
@@ -6924,14 +3442,14 @@ var __privateMethod = (obj, member, method) => {
|
|
|
6924
3442
|
if (retVal.data.status === StatusCodes.OK) {
|
|
6925
3443
|
return true;
|
|
6926
3444
|
} else {
|
|
6927
|
-
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$
|
|
6928
|
-
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$
|
|
3445
|
+
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$1.red("Error during logout (1: server side)"));
|
|
3446
|
+
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$1.red(JSON.stringify(retVal.data)));
|
|
6929
3447
|
return false;
|
|
6930
3448
|
}
|
|
6931
3449
|
} catch (error) {
|
|
6932
|
-
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$
|
|
6933
|
-
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$
|
|
6934
|
-
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$
|
|
3450
|
+
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$1.red("Error during logout (2: server side)"));
|
|
3451
|
+
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$1.red(error));
|
|
3452
|
+
__privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$1.red(JSON.stringify(error)));
|
|
6935
3453
|
return false;
|
|
6936
3454
|
}
|
|
6937
3455
|
} else {
|
|
@@ -6957,7 +3475,7 @@ var __privateMethod = (obj, member, method) => {
|
|
|
6957
3475
|
}));
|
|
6958
3476
|
}
|
|
6959
3477
|
this.SetupListener();
|
|
6960
|
-
__privateGet(this, _UpdateInstrument).call(this, Gauge.LOGGER, {
|
|
3478
|
+
__privateGet(this, _UpdateInstrument).call(this, stsobservability.Gauge.LOGGER, {
|
|
6961
3479
|
LogMessage: `STSOauth2 Plugin - Successfully Loaded`
|
|
6962
3480
|
});
|
|
6963
3481
|
}
|