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