@nsshunt/stsobservability 1.0.3 → 1.0.5

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.
@@ -989,12 +989,12 @@ var __privateMethod = (obj, member, method) => {
989
989
  __privateSet(this, _useLatestMessages, useLatestMessages);
990
990
  return this;
991
991
  }
992
- WithConsoleLogging(consoleLogging) {
993
- __privateSet(this, _consoleLogging, consoleLogging);
992
+ WithConsoleLogging(consoleLogging2) {
993
+ __privateSet(this, _consoleLogging, consoleLogging2);
994
994
  return this;
995
995
  }
996
- WithInstrumentLogging(instrumentLogging) {
997
- __privateSet(this, _instrumentLogging, instrumentLogging);
996
+ WithInstrumentLogging(instrumentLogging2) {
997
+ __privateSet(this, _instrumentLogging, instrumentLogging2);
998
998
  return this;
999
999
  }
1000
1000
  get MaxSize() {
@@ -1255,35 +1255,9 @@ var __privateMethod = (obj, member, method) => {
1255
1255
  return (d + "." + pad(h) + ":" + pad(m) + ":" + pad(s)).padStart(12);
1256
1256
  };
1257
1257
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
1258
- function getDefaultExportFromCjs$1(x) {
1258
+ function getDefaultExportFromCjs(x) {
1259
1259
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
1260
1260
  }
1261
- function getAugmentedNamespace(n) {
1262
- if (n.__esModule)
1263
- return n;
1264
- var f = n.default;
1265
- if (typeof f == "function") {
1266
- var a = function a2() {
1267
- if (this instanceof a2) {
1268
- return Reflect.construct(f, arguments, this.constructor);
1269
- }
1270
- return f.apply(this, arguments);
1271
- };
1272
- a.prototype = f.prototype;
1273
- } else
1274
- a = {};
1275
- Object.defineProperty(a, "__esModule", { value: true });
1276
- Object.keys(n).forEach(function(k) {
1277
- var d = Object.getOwnPropertyDescriptor(n, k);
1278
- Object.defineProperty(a, k, d.get ? d : {
1279
- enumerable: true,
1280
- get: function() {
1281
- return n[k];
1282
- }
1283
- });
1284
- });
1285
- return a;
1286
- }
1287
1261
  var timsort$1 = {};
1288
1262
  (function(exports3) {
1289
1263
  (function(global2, factory) {
@@ -1951,7 +1925,7 @@ var __privateMethod = (obj, member, method) => {
1951
1925
  });
1952
1926
  }
1953
1927
  var lib = percentile;
1954
- const percentile$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(lib);
1928
+ const percentile$1 = /* @__PURE__ */ getDefaultExportFromCjs(lib);
1955
1929
  class InstrumentGaugeOptions extends InstrumentBaseOptions {
1956
1930
  constructor() {
1957
1931
  super(...arguments);
@@ -2575,14 +2549,14 @@ var __privateMethod = (obj, member, method) => {
2575
2549
  }
2576
2550
  _tinyEmitter = new WeakMap();
2577
2551
  _RequestCompleted = new WeakMap();
2578
- var ansiStyles$3 = { exports: {} };
2579
- var colorName$1;
2580
- var hasRequiredColorName$1;
2581
- function requireColorName$1() {
2582
- if (hasRequiredColorName$1)
2583
- return colorName$1;
2584
- hasRequiredColorName$1 = 1;
2585
- colorName$1 = {
2552
+ var ansiStyles$1 = { exports: {} };
2553
+ var colorName;
2554
+ var hasRequiredColorName;
2555
+ function requireColorName() {
2556
+ if (hasRequiredColorName)
2557
+ return colorName;
2558
+ hasRequiredColorName = 1;
2559
+ colorName = {
2586
2560
  "aliceblue": [240, 248, 255],
2587
2561
  "antiquewhite": [250, 235, 215],
2588
2562
  "aqua": [0, 255, 255],
@@ -2732,15 +2706,15 @@ var __privateMethod = (obj, member, method) => {
2732
2706
  "yellow": [255, 255, 0],
2733
2707
  "yellowgreen": [154, 205, 50]
2734
2708
  };
2735
- return colorName$1;
2709
+ return colorName;
2736
2710
  }
2737
- var conversions$1;
2738
- var hasRequiredConversions$1;
2739
- function requireConversions$1() {
2740
- if (hasRequiredConversions$1)
2741
- return conversions$1;
2742
- hasRequiredConversions$1 = 1;
2743
- const cssKeywords = requireColorName$1();
2711
+ var conversions;
2712
+ var hasRequiredConversions;
2713
+ function requireConversions() {
2714
+ if (hasRequiredConversions)
2715
+ return conversions;
2716
+ hasRequiredConversions = 1;
2717
+ const cssKeywords = requireColorName();
2744
2718
  const reverseKeywords = {};
2745
2719
  for (const key of Object.keys(cssKeywords)) {
2746
2720
  reverseKeywords[cssKeywords[key]] = key;
@@ -2762,7 +2736,7 @@ var __privateMethod = (obj, member, method) => {
2762
2736
  apple: { channels: 3, labels: ["r16", "g16", "b16"] },
2763
2737
  gray: { channels: 1, labels: ["gray"] }
2764
2738
  };
2765
- conversions$1 = convert;
2739
+ conversions = convert;
2766
2740
  for (const model of Object.keys(convert)) {
2767
2741
  if (!("channels" in convert[model])) {
2768
2742
  throw new Error("missing channels property: " + model);
@@ -3405,15 +3379,15 @@ var __privateMethod = (obj, member, method) => {
3405
3379
  const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
3406
3380
  return [val / 255 * 100];
3407
3381
  };
3408
- return conversions$1;
3382
+ return conversions;
3409
3383
  }
3410
- var route$1;
3411
- var hasRequiredRoute$1;
3412
- function requireRoute$1() {
3413
- if (hasRequiredRoute$1)
3414
- return route$1;
3415
- hasRequiredRoute$1 = 1;
3416
- const conversions2 = requireConversions$1();
3384
+ var route;
3385
+ var hasRequiredRoute;
3386
+ function requireRoute() {
3387
+ if (hasRequiredRoute)
3388
+ return route;
3389
+ hasRequiredRoute = 1;
3390
+ const conversions2 = requireConversions();
3417
3391
  function buildGraph() {
3418
3392
  const graph = {};
3419
3393
  const models = Object.keys(conversions2);
@@ -3452,18 +3426,18 @@ var __privateMethod = (obj, member, method) => {
3452
3426
  };
3453
3427
  }
3454
3428
  function wrapConversion(toModel, graph) {
3455
- const path2 = [graph[toModel].parent, toModel];
3429
+ const path = [graph[toModel].parent, toModel];
3456
3430
  let fn = conversions2[graph[toModel].parent][toModel];
3457
3431
  let cur = graph[toModel].parent;
3458
3432
  while (graph[cur].parent) {
3459
- path2.unshift(graph[cur].parent);
3433
+ path.unshift(graph[cur].parent);
3460
3434
  fn = link(conversions2[graph[cur].parent][cur], fn);
3461
3435
  cur = graph[cur].parent;
3462
3436
  }
3463
- fn.conversion = path2;
3437
+ fn.conversion = path;
3464
3438
  return fn;
3465
3439
  }
3466
- route$1 = function(fromModel) {
3440
+ route = function(fromModel) {
3467
3441
  const graph = deriveBFS(fromModel);
3468
3442
  const conversion = {};
3469
3443
  const models = Object.keys(graph);
@@ -3477,16 +3451,16 @@ var __privateMethod = (obj, member, method) => {
3477
3451
  }
3478
3452
  return conversion;
3479
3453
  };
3480
- return route$1;
3454
+ return route;
3481
3455
  }
3482
- var colorConvert$1;
3483
- var hasRequiredColorConvert$1;
3484
- function requireColorConvert$1() {
3485
- if (hasRequiredColorConvert$1)
3486
- return colorConvert$1;
3487
- hasRequiredColorConvert$1 = 1;
3488
- const conversions2 = requireConversions$1();
3489
- const route2 = requireRoute$1();
3456
+ var colorConvert;
3457
+ var hasRequiredColorConvert;
3458
+ function requireColorConvert() {
3459
+ if (hasRequiredColorConvert)
3460
+ return colorConvert;
3461
+ hasRequiredColorConvert = 1;
3462
+ const conversions2 = requireConversions();
3463
+ const route2 = requireRoute();
3490
3464
  const convert = {};
3491
3465
  const models = Object.keys(conversions2);
3492
3466
  function wrapRaw(fn) {
@@ -3539,10 +3513,10 @@ var __privateMethod = (obj, member, method) => {
3539
3513
  convert[fromModel][toModel].raw = wrapRaw(fn);
3540
3514
  });
3541
3515
  });
3542
- colorConvert$1 = convert;
3543
- return colorConvert$1;
3516
+ colorConvert = convert;
3517
+ return colorConvert;
3544
3518
  }
3545
- ansiStyles$3.exports;
3519
+ ansiStyles$1.exports;
3546
3520
  (function(module2) {
3547
3521
  const wrapAnsi16 = (fn, offset) => (...args) => {
3548
3522
  const code = fn(...args);
@@ -3576,16 +3550,16 @@ var __privateMethod = (obj, member, method) => {
3576
3550
  let colorConvert2;
3577
3551
  const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
3578
3552
  if (colorConvert2 === void 0) {
3579
- colorConvert2 = requireColorConvert$1();
3553
+ colorConvert2 = requireColorConvert();
3580
3554
  }
3581
3555
  const offset = isBackground ? 10 : 0;
3582
3556
  const styles2 = {};
3583
3557
  for (const [sourceSpace, suite] of Object.entries(colorConvert2)) {
3584
- const name2 = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
3558
+ const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
3585
3559
  if (sourceSpace === targetSpace) {
3586
- styles2[name2] = wrap(identity, offset);
3560
+ styles2[name] = wrap(identity, offset);
3587
3561
  } else if (typeof suite === "object") {
3588
- styles2[name2] = wrap(suite[targetSpace], offset);
3562
+ styles2[name] = wrap(suite[targetSpace], offset);
3589
3563
  }
3590
3564
  }
3591
3565
  return styles2;
@@ -3679,13 +3653,13 @@ var __privateMethod = (obj, member, method) => {
3679
3653
  enumerable: true,
3680
3654
  get: assembleStyles
3681
3655
  });
3682
- })(ansiStyles$3);
3683
- var ansiStylesExports$1 = ansiStyles$3.exports;
3684
- var browser$2 = {
3656
+ })(ansiStyles$1);
3657
+ var ansiStylesExports = ansiStyles$1.exports;
3658
+ var browser = {
3685
3659
  stdout: false,
3686
3660
  stderr: false
3687
3661
  };
3688
- const stringReplaceAll$3 = (string, substring, replacer) => {
3662
+ const stringReplaceAll$1 = (string, substring, replacer) => {
3689
3663
  let index = string.indexOf(substring);
3690
3664
  if (index === -1) {
3691
3665
  return string;
@@ -3701,7 +3675,7 @@ var __privateMethod = (obj, member, method) => {
3701
3675
  returnValue += string.substr(endIndex);
3702
3676
  return returnValue;
3703
3677
  };
3704
- const stringEncaseCRLFWithFirstIndex$3 = (string, prefix, postfix, index) => {
3678
+ const stringEncaseCRLFWithFirstIndex$1 = (string, prefix, postfix, index) => {
3705
3679
  let endIndex = 0;
3706
3680
  let returnValue = "";
3707
3681
  do {
@@ -3713,16 +3687,16 @@ var __privateMethod = (obj, member, method) => {
3713
3687
  returnValue += string.substr(endIndex);
3714
3688
  return returnValue;
3715
3689
  };
3716
- var util$1 = {
3717
- stringReplaceAll: stringReplaceAll$3,
3718
- stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex$3
3690
+ var util = {
3691
+ stringReplaceAll: stringReplaceAll$1,
3692
+ stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex$1
3719
3693
  };
3720
- var templates$1;
3721
- var hasRequiredTemplates$1;
3722
- function requireTemplates$1() {
3723
- if (hasRequiredTemplates$1)
3724
- return templates$1;
3725
- hasRequiredTemplates$1 = 1;
3694
+ var templates;
3695
+ var hasRequiredTemplates;
3696
+ function requireTemplates() {
3697
+ if (hasRequiredTemplates)
3698
+ return templates;
3699
+ hasRequiredTemplates = 1;
3726
3700
  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;
3727
3701
  const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
3728
3702
  const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
@@ -3750,7 +3724,7 @@ var __privateMethod = (obj, member, method) => {
3750
3724
  }
3751
3725
  return ESCAPES.get(c) || c;
3752
3726
  }
3753
- function parseArguments(name2, arguments_) {
3727
+ function parseArguments(name, arguments_) {
3754
3728
  const results = [];
3755
3729
  const chunks = arguments_.trim().split(/\s*,\s*/g);
3756
3730
  let matches;
@@ -3761,7 +3735,7 @@ var __privateMethod = (obj, member, method) => {
3761
3735
  } else if (matches = chunk.match(STRING_REGEX)) {
3762
3736
  results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
3763
3737
  } else {
3764
- throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name2}')`);
3738
+ throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
3765
3739
  }
3766
3740
  }
3767
3741
  return results;
@@ -3771,12 +3745,12 @@ var __privateMethod = (obj, member, method) => {
3771
3745
  const results = [];
3772
3746
  let matches;
3773
3747
  while ((matches = STYLE_REGEX.exec(style)) !== null) {
3774
- const name2 = matches[1];
3748
+ const name = matches[1];
3775
3749
  if (matches[2]) {
3776
- const args = parseArguments(name2, matches[2]);
3777
- results.push([name2].concat(args));
3750
+ const args = parseArguments(name, matches[2]);
3751
+ results.push([name].concat(args));
3778
3752
  } else {
3779
- results.push([name2]);
3753
+ results.push([name]);
3780
3754
  }
3781
3755
  }
3782
3756
  return results;
@@ -3800,7 +3774,7 @@ var __privateMethod = (obj, member, method) => {
3800
3774
  }
3801
3775
  return current;
3802
3776
  }
3803
- templates$1 = (chalk2, temporary) => {
3777
+ templates = (chalk2, temporary) => {
3804
3778
  const styles2 = [];
3805
3779
  const chunks = [];
3806
3780
  let chunk = [];
@@ -3830,92 +3804,92 @@ var __privateMethod = (obj, member, method) => {
3830
3804
  }
3831
3805
  return chunks.join("");
3832
3806
  };
3833
- return templates$1;
3807
+ return templates;
3834
3808
  }
3835
- const ansiStyles$2 = ansiStylesExports$1;
3836
- const { stdout: stdoutColor$1, stderr: stderrColor$1 } = browser$2;
3809
+ const ansiStyles = ansiStylesExports;
3810
+ const { stdout: stdoutColor, stderr: stderrColor } = browser;
3837
3811
  const {
3838
- stringReplaceAll: stringReplaceAll$2,
3839
- stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex$2
3840
- } = util$1;
3841
- const { isArray: isArray$1 } = Array;
3842
- const levelMapping$1 = [
3812
+ stringReplaceAll,
3813
+ stringEncaseCRLFWithFirstIndex
3814
+ } = util;
3815
+ const { isArray } = Array;
3816
+ const levelMapping = [
3843
3817
  "ansi",
3844
3818
  "ansi",
3845
3819
  "ansi256",
3846
3820
  "ansi16m"
3847
3821
  ];
3848
- const styles$1 = /* @__PURE__ */ Object.create(null);
3849
- const applyOptions$1 = (object, options = {}) => {
3822
+ const styles = /* @__PURE__ */ Object.create(null);
3823
+ const applyOptions = (object, options = {}) => {
3850
3824
  if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
3851
3825
  throw new Error("The `level` option should be an integer from 0 to 3");
3852
3826
  }
3853
- const colorLevel = stdoutColor$1 ? stdoutColor$1.level : 0;
3827
+ const colorLevel = stdoutColor ? stdoutColor.level : 0;
3854
3828
  object.level = options.level === void 0 ? colorLevel : options.level;
3855
3829
  };
3856
- let ChalkClass$1 = class ChalkClass {
3830
+ class ChalkClass {
3857
3831
  constructor(options) {
3858
- return chalkFactory$1(options);
3832
+ return chalkFactory(options);
3859
3833
  }
3860
- };
3861
- const chalkFactory$1 = (options) => {
3834
+ }
3835
+ const chalkFactory = (options) => {
3862
3836
  const chalk2 = {};
3863
- applyOptions$1(chalk2, options);
3864
- chalk2.template = (...arguments_) => chalkTag$1(chalk2.template, ...arguments_);
3865
- Object.setPrototypeOf(chalk2, Chalk$1.prototype);
3837
+ applyOptions(chalk2, options);
3838
+ chalk2.template = (...arguments_) => chalkTag(chalk2.template, ...arguments_);
3839
+ Object.setPrototypeOf(chalk2, Chalk.prototype);
3866
3840
  Object.setPrototypeOf(chalk2.template, chalk2);
3867
3841
  chalk2.template.constructor = () => {
3868
3842
  throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
3869
3843
  };
3870
- chalk2.template.Instance = ChalkClass$1;
3844
+ chalk2.template.Instance = ChalkClass;
3871
3845
  return chalk2.template;
3872
3846
  };
3873
- function Chalk$1(options) {
3874
- return chalkFactory$1(options);
3847
+ function Chalk(options) {
3848
+ return chalkFactory(options);
3875
3849
  }
3876
- for (const [styleName, style] of Object.entries(ansiStyles$2)) {
3877
- styles$1[styleName] = {
3850
+ for (const [styleName, style] of Object.entries(ansiStyles)) {
3851
+ styles[styleName] = {
3878
3852
  get() {
3879
- const builder = createBuilder$1(this, createStyler$1(style.open, style.close, this._styler), this._isEmpty);
3853
+ const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
3880
3854
  Object.defineProperty(this, styleName, { value: builder });
3881
3855
  return builder;
3882
3856
  }
3883
3857
  };
3884
3858
  }
3885
- styles$1.visible = {
3859
+ styles.visible = {
3886
3860
  get() {
3887
- const builder = createBuilder$1(this, this._styler, true);
3861
+ const builder = createBuilder(this, this._styler, true);
3888
3862
  Object.defineProperty(this, "visible", { value: builder });
3889
3863
  return builder;
3890
3864
  }
3891
3865
  };
3892
- const usedModels$1 = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
3893
- for (const model of usedModels$1) {
3894
- styles$1[model] = {
3866
+ const usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
3867
+ for (const model of usedModels) {
3868
+ styles[model] = {
3895
3869
  get() {
3896
3870
  const { level } = this;
3897
3871
  return function(...arguments_) {
3898
- const styler = createStyler$1(ansiStyles$2.color[levelMapping$1[level]][model](...arguments_), ansiStyles$2.color.close, this._styler);
3899
- return createBuilder$1(this, styler, this._isEmpty);
3872
+ const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
3873
+ return createBuilder(this, styler, this._isEmpty);
3900
3874
  };
3901
3875
  }
3902
3876
  };
3903
3877
  }
3904
- for (const model of usedModels$1) {
3878
+ for (const model of usedModels) {
3905
3879
  const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
3906
- styles$1[bgModel] = {
3880
+ styles[bgModel] = {
3907
3881
  get() {
3908
3882
  const { level } = this;
3909
3883
  return function(...arguments_) {
3910
- const styler = createStyler$1(ansiStyles$2.bgColor[levelMapping$1[level]][model](...arguments_), ansiStyles$2.bgColor.close, this._styler);
3911
- return createBuilder$1(this, styler, this._isEmpty);
3884
+ const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
3885
+ return createBuilder(this, styler, this._isEmpty);
3912
3886
  };
3913
3887
  }
3914
3888
  };
3915
3889
  }
3916
- const proto$1 = Object.defineProperties(() => {
3890
+ const proto = Object.defineProperties(() => {
3917
3891
  }, {
3918
- ...styles$1,
3892
+ ...styles,
3919
3893
  level: {
3920
3894
  enumerable: true,
3921
3895
  get() {
@@ -3926,7 +3900,7 @@ var __privateMethod = (obj, member, method) => {
3926
3900
  }
3927
3901
  }
3928
3902
  });
3929
- const createStyler$1 = (open, close, parent) => {
3903
+ const createStyler = (open, close, parent) => {
3930
3904
  let openAll;
3931
3905
  let closeAll;
3932
3906
  if (parent === void 0) {
@@ -3944,20 +3918,20 @@ var __privateMethod = (obj, member, method) => {
3944
3918
  parent
3945
3919
  };
3946
3920
  };
3947
- const createBuilder$1 = (self2, _styler, _isEmpty) => {
3921
+ const createBuilder = (self2, _styler, _isEmpty) => {
3948
3922
  const builder = (...arguments_) => {
3949
- if (isArray$1(arguments_[0]) && isArray$1(arguments_[0].raw)) {
3950
- return applyStyle$1(builder, chalkTag$1(builder, ...arguments_));
3923
+ if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
3924
+ return applyStyle(builder, chalkTag(builder, ...arguments_));
3951
3925
  }
3952
- return applyStyle$1(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
3926
+ return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
3953
3927
  };
3954
- Object.setPrototypeOf(builder, proto$1);
3928
+ Object.setPrototypeOf(builder, proto);
3955
3929
  builder._generator = self2;
3956
3930
  builder._styler = _styler;
3957
3931
  builder._isEmpty = _isEmpty;
3958
3932
  return builder;
3959
3933
  };
3960
- const applyStyle$1 = (self2, string) => {
3934
+ const applyStyle = (self2, string) => {
3961
3935
  if (self2.level <= 0 || !string) {
3962
3936
  return self2._isEmpty ? "" : string;
3963
3937
  }
@@ -3968,20 +3942,20 @@ var __privateMethod = (obj, member, method) => {
3968
3942
  const { openAll, closeAll } = styler;
3969
3943
  if (string.indexOf("\x1B") !== -1) {
3970
3944
  while (styler !== void 0) {
3971
- string = stringReplaceAll$2(string, styler.close, styler.open);
3945
+ string = stringReplaceAll(string, styler.close, styler.open);
3972
3946
  styler = styler.parent;
3973
3947
  }
3974
3948
  }
3975
3949
  const lfIndex = string.indexOf("\n");
3976
3950
  if (lfIndex !== -1) {
3977
- string = stringEncaseCRLFWithFirstIndex$2(string, closeAll, openAll, lfIndex);
3951
+ string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
3978
3952
  }
3979
3953
  return openAll + string + closeAll;
3980
3954
  };
3981
- let template$1;
3982
- const chalkTag$1 = (chalk2, ...strings) => {
3955
+ let template;
3956
+ const chalkTag = (chalk2, ...strings) => {
3983
3957
  const [firstString] = strings;
3984
- if (!isArray$1(firstString) || !isArray$1(firstString.raw)) {
3958
+ if (!isArray(firstString) || !isArray(firstString.raw)) {
3985
3959
  return strings.join(" ");
3986
3960
  }
3987
3961
  const arguments_ = strings.slice(1);
@@ -3992,18 +3966,18 @@ var __privateMethod = (obj, member, method) => {
3992
3966
  String(firstString.raw[i])
3993
3967
  );
3994
3968
  }
3995
- if (template$1 === void 0) {
3996
- template$1 = requireTemplates$1();
3969
+ if (template === void 0) {
3970
+ template = requireTemplates();
3997
3971
  }
3998
- return template$1(chalk2, parts.join(""));
3972
+ return template(chalk2, parts.join(""));
3999
3973
  };
4000
- Object.defineProperties(Chalk$1.prototype, styles$1);
4001
- const chalk$2 = Chalk$1();
4002
- chalk$2.supportsColor = stdoutColor$1;
4003
- chalk$2.stderr = Chalk$1({ level: stderrColor$1 ? stderrColor$1.level : 0 });
4004
- chalk$2.stderr.supportsColor = stderrColor$1;
4005
- var source$1 = chalk$2;
4006
- const chalk$3 = /* @__PURE__ */ getDefaultExportFromCjs$1(source$1);
3974
+ Object.defineProperties(Chalk.prototype, styles);
3975
+ const chalk = Chalk();
3976
+ chalk.supportsColor = stdoutColor;
3977
+ chalk.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
3978
+ chalk.stderr.supportsColor = stderrColor;
3979
+ var source = chalk;
3980
+ const chalk$1 = /* @__PURE__ */ getDefaultExportFromCjs(source);
4007
3981
  var ePublishState = /* @__PURE__ */ ((ePublishState2) => {
4008
3982
  ePublishState2[ePublishState2["init"] = 0] = "init";
4009
3983
  ePublishState2[ePublishState2["started"] = 1] = "started";
@@ -4055,7 +4029,7 @@ var __privateMethod = (obj, member, method) => {
4055
4029
  }
4056
4030
  async StartPublish() {
4057
4031
  if (__privateGet(this, _publishState) !== 0) {
4058
- this.options.logger.debug(chalk$3.yellow(`StartPublish:${this.options.processContext.nid}: StartPublish called when not currently in the init state.`));
4032
+ this.options.logger.debug(chalk$1.yellow(`StartPublish:${this.options.processContext.nid}: StartPublish called when not currently in the init state.`));
4059
4033
  return false;
4060
4034
  }
4061
4035
  __privateSet(this, _publishState, 1);
@@ -4064,7 +4038,7 @@ var __privateMethod = (obj, member, method) => {
4064
4038
  }
4065
4039
  async EndPublish() {
4066
4040
  if (__privateGet(this, _publishState) !== 1) {
4067
- this.options.logger.debug(chalk$3.yellow(`EndPublish:${this.options.processContext.nid}: EndPublish called when not within the started state.`));
4041
+ this.options.logger.debug(chalk$1.yellow(`EndPublish:${this.options.processContext.nid}: EndPublish called when not within the started state.`));
4068
4042
  return false;
4069
4043
  }
4070
4044
  __privateSet(this, _publishState, 2);
@@ -4079,11 +4053,11 @@ var __privateMethod = (obj, member, method) => {
4079
4053
  }
4080
4054
  SetupInstrumentation() {
4081
4055
  if (!this.options.instrumentDefinitions) {
4082
- this.options.logger.debug(chalk$3.yellow(`SetupInstrumentation:${this.options.processContext.nid}: No instrument(s) defined within supplied options.`));
4056
+ this.options.logger.debug(chalk$1.yellow(`SetupInstrumentation:${this.options.processContext.nid}: No instrument(s) defined within supplied options.`));
4083
4057
  return;
4084
4058
  }
4085
4059
  if (!this.options.processContext) {
4086
- this.options.logger.debug(chalk$3.yellow(`SetupInstrumentation: No context defined within supplied options.`));
4060
+ this.options.logger.debug(chalk$1.yellow(`SetupInstrumentation: No context defined within supplied options.`));
4087
4061
  return;
4088
4062
  }
4089
4063
  __privateMethod(this, _CreateInstruments, CreateInstruments_fn).call(this, this.options.instrumentDefinitions);
@@ -4108,7 +4082,7 @@ var __privateMethod = (obj, member, method) => {
4108
4082
  if (__privateGet(this, _instruments)[instrumentName]) {
4109
4083
  __privateMethod(this, _ProcessTelemetryCommand, ProcessTelemetryCommand_fn).call(this, instrumentName, telemetry);
4110
4084
  } else {
4111
- this.options.logger.debug(chalk$3.red(`UpdateInstrument:${this.options.processContext.nid}: Attempted to UpdateInstrument before initialised.`));
4085
+ this.options.logger.debug(chalk$1.red(`UpdateInstrument:${this.options.processContext.nid}: Attempted to UpdateInstrument before initialised.`));
4112
4086
  }
4113
4087
  }
4114
4088
  /*
@@ -4337,21 +4311,21 @@ var __privateMethod = (obj, member, method) => {
4337
4311
  const STSInstrumentControllerPlugin = {
4338
4312
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4339
4313
  install: (app, options) => {
4340
- options.logger.debug(chalk$3.yellow(`STSInstrumentControllerPlugin:install:Start`));
4314
+ options.logger.debug(chalk$1.yellow(`STSInstrumentControllerPlugin:install:Start`));
4341
4315
  const aic = new AgentInstrumentController(options);
4342
4316
  if (!app.config.globalProperties.$sts) {
4343
- options.logger.debug(chalk$3.cyan(`STSInstrumentControllerPlugin:install: [app.config.globalProperties.$sts] does not exist.`));
4317
+ options.logger.debug(chalk$1.cyan(`STSInstrumentControllerPlugin:install: [app.config.globalProperties.$sts] does not exist.`));
4344
4318
  app.config.globalProperties.$sts = {};
4345
- options.logger.debug(chalk$3.cyan(`STSInstrumentControllerPlugin:install: created empty [app.config.globalProperties.$sts].`));
4319
+ options.logger.debug(chalk$1.cyan(`STSInstrumentControllerPlugin:install: created empty [app.config.globalProperties.$sts].`));
4346
4320
  } else {
4347
- options.logger.debug(chalk$3.cyan(`STSInstrumentControllerPlugin:install: [app.config.globalProperties.$sts] already exists.`));
4321
+ options.logger.debug(chalk$1.cyan(`STSInstrumentControllerPlugin:install: [app.config.globalProperties.$sts] already exists.`));
4348
4322
  }
4349
4323
  app.config.globalProperties.$sts.aic = aic;
4350
4324
  app.config.globalProperties.$sts[STSInstrumentControllerPluginKey] = aic;
4351
- options.logger.debug(chalk$3.cyan(`STSInstrumentControllerPlugin:install: AgentInstrumentController installed into [app.config.globalProperties.$sts] using: [${String(STSInstrumentControllerPluginKey)}].`));
4325
+ options.logger.debug(chalk$1.cyan(`STSInstrumentControllerPlugin:install: AgentInstrumentController installed into [app.config.globalProperties.$sts] using: [${String(STSInstrumentControllerPluginKey)}].`));
4352
4326
  app.provide(STSInstrumentControllerPluginKey, aic);
4353
- options.logger.debug(chalk$3.cyan(`STSInstrumentControllerPlugin:install: AgentInstrumentController installed into 'provide' using: [${String(STSInstrumentControllerPluginKey)}].`));
4354
- options.logger.debug(chalk$3.green(`STSInstrumentControllerPlugin:install:End`));
4327
+ options.logger.debug(chalk$1.cyan(`STSInstrumentControllerPlugin:install: AgentInstrumentController installed into 'provide' using: [${String(STSInstrumentControllerPluginKey)}].`));
4328
+ options.logger.debug(chalk$1.green(`STSInstrumentControllerPlugin:install:End`));
4355
4329
  }
4356
4330
  };
4357
4331
  function utf8Count(str) {
@@ -5037,14 +5011,14 @@ var __privateMethod = (obj, member, method) => {
5037
5011
  }
5038
5012
  }
5039
5013
  if (retVal.status !== 200) {
5040
- this.options.logger.debug(chalk$3.red(`Error (_PerformPublishRESTAPI:_PerformPublish:#publishmessage): Invalid response from server: [${retVal.status}]`));
5014
+ this.options.logger.debug(chalk$1.red(`Error (_PerformPublishRESTAPI:_PerformPublish:#publishmessage): Invalid response from server: [${retVal.status}]`));
5041
5015
  return false;
5042
5016
  } else {
5043
- this.options.logger.debug(chalk$3.green(`_PerformPublishRESTAPI:_PerformPublish:#publishmessage: [${this.options.url}] - Valid response from server: [${retVal.status}]`));
5017
+ this.options.logger.debug(chalk$1.green(`_PerformPublishRESTAPI:_PerformPublish:#publishmessage: [${this.options.url}] - Valid response from server: [${retVal.status}]`));
5044
5018
  }
5045
5019
  return true;
5046
5020
  } catch (error) {
5047
- this.options.logger.error(chalk$3.red(`Error (PublishRESTServer:_PerformPublishRESTAPI:Error: [${error}]`));
5021
+ this.options.logger.error(chalk$1.red(`Error (PublishRESTServer:_PerformPublishRESTAPI:Error: [${error}]`));
5048
5022
  return false;
5049
5023
  }
5050
5024
  });
@@ -5403,7 +5377,7 @@ var __privateMethod = (obj, member, method) => {
5403
5377
  subscription.cb(payload);
5404
5378
  }
5405
5379
  } catch (error) {
5406
- __privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$3.red(`ObservabilityRESTAPISubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
5380
+ __privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$1.red(`ObservabilityRESTAPISubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
5407
5381
  __privateMethod(this, _RemoveKeepAlive, RemoveKeepAlive_fn).call(this, subscription);
5408
5382
  }
5409
5383
  });
@@ -5415,11 +5389,11 @@ var __privateMethod = (obj, member, method) => {
5415
5389
  async Subscribe(subscriptions) {
5416
5390
  subscriptions.map(async (subId) => {
5417
5391
  __privateMethod(this, _RemoveKeepAlive, RemoveKeepAlive_fn).call(this, subId);
5418
- __privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$3.yellow(`ObservabilityRESTAPISubscriber:Subscribe(): Sending subscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
5392
+ __privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$1.yellow(`ObservabilityRESTAPISubscriber:Subscribe(): Sending subscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
5419
5393
  try {
5420
5394
  __privateMethod(this, _AddKeepAlive, AddKeepAlive_fn).call(this, subId);
5421
5395
  } catch (error) {
5422
- __privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$3.red(`ObservabilityRESTAPISubscriber:Subscribe(): Error: response: [${JSON.stringify(error)}]`));
5396
+ __privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$1.red(`ObservabilityRESTAPISubscriber:Subscribe(): Error: response: [${JSON.stringify(error)}]`));
5423
5397
  __privateMethod(this, _RemoveKeepAlive, RemoveKeepAlive_fn).call(this, subId);
5424
5398
  }
5425
5399
  });
@@ -5430,7 +5404,7 @@ var __privateMethod = (obj, member, method) => {
5430
5404
  UnSubscribe(subscriptions) {
5431
5405
  subscriptions.map(async (subId) => {
5432
5406
  __privateMethod(this, _RemoveKeepAlive, RemoveKeepAlive_fn).call(this, subId);
5433
- __privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$3.yellow(`ObservabilityRESTAPISubscriber:UnSubscribe(): Sending unsubscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
5407
+ __privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$1.yellow(`ObservabilityRESTAPISubscriber:UnSubscribe(): Sending unsubscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
5434
5408
  });
5435
5409
  }
5436
5410
  }
@@ -5567,13 +5541,13 @@ var __privateMethod = (obj, member, method) => {
5567
5541
  if (timeoutDuration < 500) {
5568
5542
  timeoutDuration = 500;
5569
5543
  }
5570
- __privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$3.yellow(`Total duration for subscription: [${diff}], waiting: [${timeoutDuration}]`));
5544
+ __privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$1.yellow(`Total duration for subscription: [${diff}], waiting: [${timeoutDuration}]`));
5571
5545
  socketSubscribeKeepAlive.timeout = __privateMethod(this, _SetupTimeout, SetupTimeout_fn).call(this, socketSubscribeKeepAlive, subscription, timeoutDuration);
5572
5546
  } else {
5573
- __privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$3.yellow(`Subscription removed: [${socketSubscribeKeepAlive.id}]. Processing terminate.`));
5547
+ __privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$1.yellow(`Subscription removed: [${socketSubscribeKeepAlive.id}]. Processing terminate.`));
5574
5548
  }
5575
5549
  } catch (error) {
5576
- __privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$3.red(`ObservabilityRESTAPISubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
5550
+ __privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$1.red(`ObservabilityRESTAPISubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
5577
5551
  __privateMethod(this, _RemoveKeepAlive, RemoveKeepAlive_fn).call(this, subscription);
5578
5552
  }
5579
5553
  }, timeout);
@@ -5591,7 +5565,7 @@ var __privateMethod = (obj, member, method) => {
5591
5565
  _RemoveKeepAlive = new WeakSet();
5592
5566
  RemoveKeepAlive_fn = function(subscription) {
5593
5567
  if (__privateGet(this, _socketSubscribeKeepAlive)[subscription.subscriptionKey.id]) {
5594
- __privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$3.gray(`ObservabilityRESTAPISubscriber:#RemoveKeepAlive(): subscriptionKey: [${subscription.subscriptionKey.id}]`));
5568
+ __privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$1.gray(`ObservabilityRESTAPISubscriber:#RemoveKeepAlive(): subscriptionKey: [${subscription.subscriptionKey.id}]`));
5595
5569
  clearTimeout(__privateGet(this, _socketSubscribeKeepAlive)[subscription.subscriptionKey.id].timeout);
5596
5570
  delete __privateGet(this, _socketSubscribeKeepAlive)[subscription.subscriptionKey.id].timeout;
5597
5571
  delete __privateGet(this, _socketSubscribeKeepAlive)[subscription.subscriptionKey.id];
@@ -5669,7 +5643,7 @@ var __privateMethod = (obj, member, method) => {
5669
5643
  return __privateGet(this, _socket);
5670
5644
  }
5671
5645
  set socket(socket) {
5672
- __privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$3.cyan(`SocketIoMessageSender:set socket(): new socket assigned`));
5646
+ __privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.cyan(`SocketIoMessageSender:set socket(): new socket assigned`));
5673
5647
  __privateSet(this, _socket, socket);
5674
5648
  }
5675
5649
  AckListener(message, payload) {
@@ -5682,25 +5656,25 @@ var __privateMethod = (obj, member, method) => {
5682
5656
  message.status = "SUCCESS";
5683
5657
  message.subscriptionKeyResponse = payload;
5684
5658
  delete __privateGet(this, _messageWithAckPayloadRecords)[message.id];
5685
- __privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$3.grey(`SocketIoMessageSender:AckListener(): ack received, event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5659
+ __privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.grey(`SocketIoMessageSender:AckListener(): ack received, event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5686
5660
  message.resolve(message);
5687
5661
  }
5688
5662
  }
5689
5663
  ResponseTimout(message) {
5690
- __privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$3.magenta(`SocketIoMessageSender:ResponseTimout(): timeout reached: [${__privateGet(this, _timeoutValue)}], event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5664
+ __privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.magenta(`SocketIoMessageSender:ResponseTimout(): timeout reached: [${__privateGet(this, _timeoutValue)}], event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5691
5665
  delete message.timeoutId;
5692
5666
  __privateGet(this, _socket).off(__privateMethod(this, _GetSubscribeKeepAliveAckEventName, GetSubscribeKeepAliveAckEventName_fn).call(this, message.eventName, message.subscriptionKey), message.BoundAckListenerCallback);
5693
5667
  message.endTime = performance.now();
5694
5668
  if (message.retryCount >= __privateGet(this, _maxReties)) {
5695
5669
  message.status = "FAIL";
5696
- __privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$3.red(`SocketIoMessageSender:ResponseTimout(): timeout reached after ${__privateGet(this, _maxReties)} retries, event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5670
+ __privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.red(`SocketIoMessageSender:ResponseTimout(): timeout reached after ${__privateGet(this, _maxReties)} retries, event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5697
5671
  delete __privateGet(this, _messageWithAckPayloadRecords)[message.id];
5698
5672
  message.reject(message);
5699
5673
  return;
5700
5674
  }
5701
5675
  message.status = "INRETRY";
5702
5676
  message.retryCount++;
5703
- __privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$3.magenta(`SocketIoMessageSender:ResponseTimout(): timeout reached, retrying. Retries: [${message.retryCount}], event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5677
+ __privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.magenta(`SocketIoMessageSender:ResponseTimout(): timeout reached, retrying. Retries: [${message.retryCount}], event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5704
5678
  this.SendMessage(message);
5705
5679
  }
5706
5680
  SendMessage(message) {
@@ -5713,7 +5687,7 @@ var __privateMethod = (obj, member, method) => {
5713
5687
  };
5714
5688
  message.BoundAckListenerCallback = AckListenerCallback.bind(this);
5715
5689
  __privateGet(this, _socket).on(__privateMethod(this, _GetSubscribeKeepAliveAckEventName, GetSubscribeKeepAliveAckEventName_fn).call(this, message.eventName, message.subscriptionKey), message.BoundAckListenerCallback);
5716
- __privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$3.gray(`SocketIoMessageSender:SendMessage(): event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5690
+ __privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.gray(`SocketIoMessageSender:SendMessage(): event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5717
5691
  __privateGet(this, _socket).emit(message.eventName, message.subscriptionKey);
5718
5692
  }
5719
5693
  SendMessageWithAck(eventName, subscriptionKey) {
@@ -5737,7 +5711,7 @@ var __privateMethod = (obj, member, method) => {
5737
5711
  const killIds = [];
5738
5712
  for (const [, message] of Object.entries(__privateGet(this, _messageWithAckPayloadRecords))) {
5739
5713
  if (message.subscriptionKey.id.localeCompare(subscriptionKey.id) === 0) {
5740
- __privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$3.blue(`SocketIoMessageSender:KillMessageInFlight(): event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5714
+ __privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.blue(`SocketIoMessageSender:KillMessageInFlight(): event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5741
5715
  clearTimeout(message.timeoutId);
5742
5716
  delete message.timeoutId;
5743
5717
  __privateGet(this, _socket).off(__privateMethod(this, _GetSubscribeKeepAliveAckEventName, GetSubscribeKeepAliveAckEventName_fn).call(this, message.eventName, message.subscriptionKey), message.BoundAckListenerCallback);
@@ -5787,7 +5761,7 @@ var __privateMethod = (obj, member, method) => {
5787
5761
  return __privateGet(this, _socket2);
5788
5762
  }
5789
5763
  set socket(socket) {
5790
- __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$3.cyan(`ObservabilitySocketIOSubscriber:set socket(): new socket assigned`));
5764
+ __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$1.cyan(`ObservabilitySocketIOSubscriber:set socket(): new socket assigned`));
5791
5765
  __privateSet(this, _socket2, socket);
5792
5766
  __privateGet(this, _socketIoMessageSender).socket = socket;
5793
5767
  }
@@ -5798,14 +5772,14 @@ var __privateMethod = (obj, member, method) => {
5798
5772
  const socket = __privateGet(this, _socket2);
5799
5773
  subscriptions.map(async (subId) => {
5800
5774
  __privateMethod(this, _RemoveKeepAlive2, RemoveKeepAlive_fn2).call(this, subId);
5801
- __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$3.yellow(`ObservabilitySocketIOSubscriber:Subscribe(): Sending subscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
5775
+ __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$1.yellow(`ObservabilitySocketIOSubscriber:Subscribe(): Sending subscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
5802
5776
  try {
5803
5777
  const retVal = await __privateGet(this, _socketIoMessageSender).SendMessageWithAck("subscribe", subId.subscriptionKey);
5804
- __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$3.green(`ObservabilitySocketIOSubscriber:Subscribe(): SendMessageWithAck response: [${JSON.stringify(retVal)}]`));
5778
+ __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$1.green(`ObservabilitySocketIOSubscriber:Subscribe(): SendMessageWithAck response: [${JSON.stringify(retVal)}]`));
5805
5779
  __privateMethod(this, _AddKeepAlive2, AddKeepAlive_fn2).call(this, socket, subId);
5806
5780
  socket.on(GetSocketIOSubscriptionKey(subId.subscriptionKey), subId.cb);
5807
5781
  } catch (error) {
5808
- __privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$3.red(`ObservabilitySocketIOSubscriber:Subscribe(): Error: response: [${JSON.stringify(error)}]`));
5782
+ __privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$1.red(`ObservabilitySocketIOSubscriber:Subscribe(): Error: response: [${JSON.stringify(error)}]`));
5809
5783
  socket.off(GetSocketIOSubscriptionKey(subId.subscriptionKey), subId.cb);
5810
5784
  __privateMethod(this, _RemoveKeepAlive2, RemoveKeepAlive_fn2).call(this, subId);
5811
5785
  }
@@ -5820,12 +5794,12 @@ var __privateMethod = (obj, member, method) => {
5820
5794
  socket.off(GetSocketIOSubscriptionKey(subId.subscriptionKey), subId.cb);
5821
5795
  __privateMethod(this, _RemoveKeepAlive2, RemoveKeepAlive_fn2).call(this, subId);
5822
5796
  __privateGet(this, _socketIoMessageSender).KillMessageInFlight(subId.subscriptionKey);
5823
- __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$3.yellow(`ObservabilitySocketIOSubscriber:UnSubscribe(): Sending unsubscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
5797
+ __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$1.yellow(`ObservabilitySocketIOSubscriber:UnSubscribe(): Sending unsubscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
5824
5798
  try {
5825
5799
  const retVal = await __privateGet(this, _socketIoMessageSender).SendMessageWithAck("unsubscribe", subId.subscriptionKey);
5826
- __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$3.green(`ObservabilitySocketIOSubscriber:UnSubscribe(): SendMessageWithAck response: [${JSON.stringify(retVal)}]`));
5800
+ __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$1.green(`ObservabilitySocketIOSubscriber:UnSubscribe(): SendMessageWithAck response: [${JSON.stringify(retVal)}]`));
5827
5801
  } catch (error) {
5828
- __privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$3.red(`ObservabilitySocketIOSubscriber:UnSubscribe(): Error response: [${JSON.stringify(error)}]`));
5802
+ __privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$1.red(`ObservabilitySocketIOSubscriber:UnSubscribe(): Error response: [${JSON.stringify(error)}]`));
5829
5803
  }
5830
5804
  });
5831
5805
  }
@@ -5861,13 +5835,13 @@ var __privateMethod = (obj, member, method) => {
5861
5835
  __privateGet(this, _socketSubscribeKeepAlive2)[subscription.subscriptionKey.id] = {
5862
5836
  id: subscription.subscriptionKey.id,
5863
5837
  timeout: setTimeout(async () => {
5864
- __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$3.yellow(`ObservabilitySocketIOSubscriber:#AddKeepAlive:timeoutCheck(): Sending keepAlive: subscriptionKey: [${subscription.subscriptionKey.id}]`));
5838
+ __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$1.yellow(`ObservabilitySocketIOSubscriber:#AddKeepAlive:timeoutCheck(): Sending keepAlive: subscriptionKey: [${subscription.subscriptionKey.id}]`));
5865
5839
  try {
5866
5840
  const retVal = await __privateGet(this, _socketIoMessageSender).SendMessageWithAck("subscribeKeepAlive", subscription.subscriptionKey);
5867
- __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$3.green(`ObservabilitySocketIOSubscriber:#AddKeepAlive(): SendMessageWithAck response: [${JSON.stringify(retVal)}]`));
5841
+ __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$1.green(`ObservabilitySocketIOSubscriber:#AddKeepAlive(): SendMessageWithAck response: [${JSON.stringify(retVal)}]`));
5868
5842
  __privateMethod(this, _AddKeepAlive2, AddKeepAlive_fn2).call(this, socket, subscription);
5869
5843
  } catch (error) {
5870
- __privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$3.red(`ObservabilitySocketIOSubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
5844
+ __privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$1.red(`ObservabilitySocketIOSubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
5871
5845
  socket.off(GetSocketIOSubscriptionKey(subscription.subscriptionKey), subscription.cb);
5872
5846
  __privateMethod(this, _RemoveKeepAlive2, RemoveKeepAlive_fn2).call(this, subscription);
5873
5847
  }
@@ -5877,7 +5851,7 @@ var __privateMethod = (obj, member, method) => {
5877
5851
  _RemoveKeepAlive2 = new WeakSet();
5878
5852
  RemoveKeepAlive_fn2 = function(subscription) {
5879
5853
  if (__privateGet(this, _socketSubscribeKeepAlive2)[subscription.subscriptionKey.id]) {
5880
- __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$3.gray(`ObservabilitySocketIOSubscriber:#RemoveKeepAlive(): subscriptionKey: [${subscription.subscriptionKey.id}]`));
5854
+ __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$1.gray(`ObservabilitySocketIOSubscriber:#RemoveKeepAlive(): subscriptionKey: [${subscription.subscriptionKey.id}]`));
5881
5855
  clearTimeout(__privateGet(this, _socketSubscribeKeepAlive2)[subscription.subscriptionKey.id].timeout);
5882
5856
  delete __privateGet(this, _socketSubscribeKeepAlive2)[subscription.subscriptionKey.id];
5883
5857
  }
@@ -5925,7 +5899,7 @@ var __privateMethod = (obj, member, method) => {
5925
5899
  subscriptions.map((subscription) => {
5926
5900
  const retVal = this.subscriptions.find((v) => v.subscriptionKey.id.localeCompare(subscription.subscriptionKey.id) === 0);
5927
5901
  if (retVal) {
5928
- __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$3.magenta(`AddSubscription(): Subscription: [${retVal.subscriptionKey.id}] already exists - ignoring.`));
5902
+ __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.magenta(`AddSubscription(): Subscription: [${retVal.subscriptionKey.id}] already exists - ignoring.`));
5929
5903
  } else {
5930
5904
  subscriptionsToAdd.push(subscription);
5931
5905
  }
@@ -5934,7 +5908,7 @@ var __privateMethod = (obj, member, method) => {
5934
5908
  subscriptionsToAdd.map((s) => this.subscriptions.push(s));
5935
5909
  (_a2 = __privateGet(this, _observabilitySocketIOSubscriber)) == null ? void 0 : _a2.Subscribe(subscriptionsToAdd);
5936
5910
  } else {
5937
- __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$3.magenta(`AddSubscription(): No valid subscriptions to subscribe.`));
5911
+ __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.magenta(`AddSubscription(): No valid subscriptions to subscribe.`));
5938
5912
  }
5939
5913
  }
5940
5914
  RemoveSubscriptionsByKey(keyToFind) {
@@ -6029,7 +6003,7 @@ var __privateMethod = (obj, member, method) => {
6029
6003
  if (subscriptionPayload.subscriptionKey.topic.localeCompare(SubscriptionTopic.AllServicesCombined.toString()) === 0) {
6030
6004
  __privateGet(this, _serviceModel)["STS-Service"] = ObservabilityModelUtils.GetModelForService("STS-Service", subscriptionPayload.data, subscribeToKafka, __privateGet(this, _options5).logger);
6031
6005
  if (__privateGet(this, _serviceModel)["STS-Service"] === null) {
6032
- __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$3.red(`CreateModelAllServicesCombined():Error: GetModelForService() returned null`));
6006
+ __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelAllServicesCombined():Error: GetModelForService() returned null`));
6033
6007
  }
6034
6008
  }
6035
6009
  } catch (error) {
@@ -6044,7 +6018,7 @@ var __privateMethod = (obj, member, method) => {
6044
6018
  for (const [serviceId, serviceTelemetry] of Object.entries(subscriptionPayload.data)) {
6045
6019
  __privateGet(this, _serviceModel)[serviceId] = ObservabilityModelUtils.GetModelForService(serviceId, serviceTelemetry, subscribeToKafka, __privateGet(this, _options5).logger);
6046
6020
  if (__privateGet(this, _serviceModel)[serviceId] === null) {
6047
- __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$3.red(`CreateModelServices():Error: GetModelForService() returned null`));
6021
+ __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelServices():Error: GetModelForService() returned null`));
6048
6022
  }
6049
6023
  }
6050
6024
  } catch (error) {
@@ -6078,7 +6052,7 @@ var __privateMethod = (obj, member, method) => {
6078
6052
  }
6079
6053
  }
6080
6054
  } else {
6081
- __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$3.red(`CreateModelServiceInstances():Error: GetModelForService() returned null`));
6055
+ __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelServiceInstances():Error: GetModelForService() returned null`));
6082
6056
  }
6083
6057
  } else {
6084
6058
  if (subscribeToKafka) {
@@ -6121,7 +6095,7 @@ var __privateMethod = (obj, member, method) => {
6121
6095
  }
6122
6096
  }
6123
6097
  } else {
6124
- __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$3.red(`CreateModelServiceInstance():Error: GetModelForService() returned null`));
6098
+ __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelServiceInstance():Error: GetModelForService() returned null`));
6125
6099
  }
6126
6100
  } else {
6127
6101
  if (subscribeToKafka) {
@@ -6146,7 +6120,7 @@ var __privateMethod = (obj, member, method) => {
6146
6120
  if (Object.keys(subscriptionPayload.data).length !== 0) {
6147
6121
  __privateGet(this, _agentModel)["STS-Agent"] = ObservabilityModelUtils.GetModelForAgent("STS-Agent", subscriptionPayload.data, subscribeToKafka, __privateGet(this, _options5).logger);
6148
6122
  if (__privateGet(this, _agentModel)["STS-Agent"] === null) {
6149
- __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$3.red(`CreateModelAllAgentsCombined():Error: GetModelForAgent() returned null`));
6123
+ __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelAllAgentsCombined():Error: GetModelForAgent() returned null`));
6150
6124
  }
6151
6125
  }
6152
6126
  }
@@ -6180,7 +6154,7 @@ var __privateMethod = (obj, member, method) => {
6180
6154
  }
6181
6155
  }
6182
6156
  } else {
6183
- __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$3.red(`CreateModelAgents():Error: GetModelForAgent() returned null`));
6157
+ __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelAgents():Error: GetModelForAgent() returned null`));
6184
6158
  }
6185
6159
  } else {
6186
6160
  if (subscribeToKafka) {
@@ -6191,7 +6165,7 @@ var __privateMethod = (obj, member, method) => {
6191
6165
  }
6192
6166
  }
6193
6167
  } catch (error) {
6194
- __privateMethod(this, _LogErrorMessage3, LogErrorMessage_fn3).call(this, chalk$3.red(`UIControllerAgent:CreateModel(): Error: [${error}]`));
6168
+ __privateMethod(this, _LogErrorMessage3, LogErrorMessage_fn3).call(this, chalk$1.red(`UIControllerAgent:CreateModel(): Error: [${error}]`));
6195
6169
  }
6196
6170
  }
6197
6171
  // /agentId/agentWorkerId
@@ -6224,7 +6198,7 @@ var __privateMethod = (obj, member, method) => {
6224
6198
  }
6225
6199
  }
6226
6200
  } else {
6227
- __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$3.red(`CreateModelAgentWorkers():Error: GetModelForAgent() returned null`));
6201
+ __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelAgentWorkers():Error: GetModelForAgent() returned null`));
6228
6202
  }
6229
6203
  } else {
6230
6204
  if (subscribeToKafka) {
@@ -6236,7 +6210,7 @@ var __privateMethod = (obj, member, method) => {
6236
6210
  }
6237
6211
  }
6238
6212
  } catch (error) {
6239
- __privateMethod(this, _LogErrorMessage3, LogErrorMessage_fn3).call(this, chalk$3.red(`UIControllerAgentThreads:CreateModel(): Error: [${error}]`));
6213
+ __privateMethod(this, _LogErrorMessage3, LogErrorMessage_fn3).call(this, chalk$1.red(`UIControllerAgentThreads:CreateModel(): Error: [${error}]`));
6240
6214
  }
6241
6215
  }
6242
6216
  // /agentId/agentWorkerId/asyncRunnerId
@@ -6266,7 +6240,7 @@ var __privateMethod = (obj, member, method) => {
6266
6240
  }
6267
6241
  }
6268
6242
  } else {
6269
- __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$3.red(`CreateModelAgentWorker():Error: GetModelForAgent() returned null`));
6243
+ __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelAgentWorker():Error: GetModelForAgent() returned null`));
6270
6244
  }
6271
6245
  } else {
6272
6246
  if (subscribeToKafka) {
@@ -6279,7 +6253,7 @@ var __privateMethod = (obj, member, method) => {
6279
6253
  }
6280
6254
  }
6281
6255
  } catch (error) {
6282
- __privateMethod(this, _LogErrorMessage3, LogErrorMessage_fn3).call(this, chalk$3.red(`UIControllerAgentThread:CreateModel(): Error: [${error}]`));
6256
+ __privateMethod(this, _LogErrorMessage3, LogErrorMessage_fn3).call(this, chalk$1.red(`UIControllerAgentThread:CreateModel(): Error: [${error}]`));
6283
6257
  }
6284
6258
  }
6285
6259
  // --- [ Lambdas ] ------------------------------------------------------------------------------------------------------------------------------------------------
@@ -6290,7 +6264,7 @@ var __privateMethod = (obj, member, method) => {
6290
6264
  if (subscriptionPayload.subscriptionKey.topic.localeCompare(SubscriptionTopic.AllLambdasCombined.toString()) === 0) {
6291
6265
  __privateGet(this, _lambdaModel)["STS-Lambda"] = ObservabilityModelUtils.GetModelForLambda("STS-Lambda", subscriptionPayload.data, subscribeToKafka, __privateGet(this, _options5).logger);
6292
6266
  if (__privateGet(this, _lambdaModel)["STS-Lambda"] === null) {
6293
- __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$3.red(`CreateModelAllLambdasCombined():Error: GetModelForLambda() returned null`));
6267
+ __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelAllLambdasCombined():Error: GetModelForLambda() returned null`));
6294
6268
  }
6295
6269
  }
6296
6270
  } catch (error) {
@@ -6305,7 +6279,7 @@ var __privateMethod = (obj, member, method) => {
6305
6279
  for (const [technologyId, technologyTelemetry] of Object.entries(subscriptionPayload.data)) {
6306
6280
  __privateGet(this, _lambdaModel)[technologyId] = ObservabilityModelUtils.GetModelForLambda(technologyId, technologyTelemetry, subscribeToKafka, __privateGet(this, _options5).logger);
6307
6281
  if (__privateGet(this, _lambdaModel)[technologyId] === null) {
6308
- __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$3.red(`CreateModelLambdaTechnologies():Error: GetModelForLambda() returned null`));
6282
+ __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelLambdaTechnologies():Error: GetModelForLambda() returned null`));
6309
6283
  }
6310
6284
  }
6311
6285
  } catch (error) {
@@ -6339,7 +6313,7 @@ var __privateMethod = (obj, member, method) => {
6339
6313
  }
6340
6314
  }
6341
6315
  } else {
6342
- __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$3.red(`CreateModelLambdaSubTechnologies():Error: GetModelForLambda() returned null`));
6316
+ __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelLambdaSubTechnologies():Error: GetModelForLambda() returned null`));
6343
6317
  }
6344
6318
  } else {
6345
6319
  if (subscribeToKafka) {
@@ -6382,7 +6356,7 @@ var __privateMethod = (obj, member, method) => {
6382
6356
  }
6383
6357
  }
6384
6358
  } else {
6385
- __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$3.red(`CreateModelLambdaSubTechnologiesInstance():Error: GetModelForLambda() returned null`));
6359
+ __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelLambdaSubTechnologiesInstance():Error: GetModelForLambda() returned null`));
6386
6360
  }
6387
6361
  } else {
6388
6362
  if (subscribeToKafka) {
@@ -6441,21 +6415,21 @@ var __privateMethod = (obj, member, method) => {
6441
6415
  get sockets() {
6442
6416
  return __privateGet(this, _sockets);
6443
6417
  }
6444
- SetupClientSideSocket(name2, address, onConnectCallBack, socketEventsCallBack, errorCallBack) {
6445
- this.sockets[name2] = {
6446
- name: name2,
6418
+ SetupClientSideSocket(name, address, onConnectCallBack, socketEventsCallBack, errorCallBack) {
6419
+ this.sockets[name] = {
6420
+ name,
6447
6421
  address,
6448
6422
  socket: null,
6449
6423
  errorCallBack
6450
6424
  };
6451
- __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name2, onConnectCallBack, socketEventsCallBack);
6452
- return this.sockets[name2].socket;
6425
+ __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack);
6426
+ return this.sockets[name].socket;
6453
6427
  }
6454
- GetSocket(name2) {
6455
- return this.sockets[name2].socket;
6428
+ GetSocket(name) {
6429
+ return this.sockets[name].socket;
6456
6430
  }
6457
- GetSocketDetail(name2) {
6458
- return this.sockets[name2];
6431
+ GetSocketDetail(name) {
6432
+ return this.sockets[name];
6459
6433
  }
6460
6434
  }
6461
6435
  _options6 = new WeakMap();
@@ -6472,17 +6446,17 @@ var __privateMethod = (obj, member, method) => {
6472
6446
  __privateGet(this, _options6).logger.error(message);
6473
6447
  };
6474
6448
  _EstablishSocketConnect = new WeakSet();
6475
- EstablishSocketConnect_fn = function(name2, onConnectCallBack, socketEventsCallBack) {
6476
- const socketDetail = this.sockets[name2];
6449
+ EstablishSocketConnect_fn = function(name, onConnectCallBack, socketEventsCallBack) {
6450
+ const socketDetail = this.sockets[name];
6477
6451
  if (socketDetail.socket !== null) {
6478
6452
  if (socketDetail.socket.connected === true) {
6479
6453
  socketDetail.socket.disconnect();
6480
6454
  }
6481
6455
  socketDetail.socket = null;
6482
6456
  if (isNode) {
6483
- setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name2, onConnectCallBack, socketEventsCallBack), 100).unref();
6457
+ setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100).unref();
6484
6458
  } else {
6485
- setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name2, onConnectCallBack, socketEventsCallBack), 100);
6459
+ setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100);
6486
6460
  }
6487
6461
  return;
6488
6462
  }
@@ -6524,12 +6498,12 @@ var __privateMethod = (obj, member, method) => {
6524
6498
  {
6525
6499
  __privateMethod(this, _LogDebugMessage5, LogDebugMessage_fn5).call(this, "The server disconnected using disconnectSockets, i.e. normal safe shutdown from explicit disconnection by the server.");
6526
6500
  __privateMethod(this, _LogDebugMessage5, LogDebugMessage_fn5).call(this, "The connection will be re-established when the server becomes available.");
6527
- const socketDetail2 = this.sockets[name2];
6501
+ const socketDetail2 = this.sockets[name];
6528
6502
  socketDetail2.socket = null;
6529
6503
  if (isNode) {
6530
- setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name2, onConnectCallBack, socketEventsCallBack), 100).unref();
6504
+ setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100).unref();
6531
6505
  } else {
6532
- setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name2, onConnectCallBack, socketEventsCallBack), 100);
6506
+ setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100);
6533
6507
  }
6534
6508
  }
6535
6509
  break;
@@ -6543,2197 +6517,120 @@ var __privateMethod = (obj, member, method) => {
6543
6517
  {
6544
6518
  __privateMethod(this, _LogDebugMessage5, LogDebugMessage_fn5).call(this, `Server unexpectedly disconnected. Reason: [${reason}]`);
6545
6519
  __privateMethod(this, _LogDebugMessage5, LogDebugMessage_fn5).call(this, "The connection will be re-established when the server becomes available.");
6546
- const socketDetail2 = this.sockets[name2];
6520
+ const socketDetail2 = this.sockets[name];
6547
6521
  if (socketDetail2.socket) {
6548
6522
  socketDetail2.socket.disconnect();
6549
6523
  }
6550
6524
  socketDetail2.socket = null;
6551
6525
  if (isNode) {
6552
- setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name2, onConnectCallBack, socketEventsCallBack), 100).unref();
6526
+ setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100).unref();
6553
6527
  } else {
6554
- setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name2, onConnectCallBack, socketEventsCallBack), 100);
6528
+ setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100);
6555
6529
  }
6556
6530
  }
6557
6531
  break;
6558
6532
  }
6559
6533
  });
6560
6534
  };
6561
- var main$1 = { exports: {} };
6562
- const __viteBrowserExternal$1 = {};
6563
- const __viteBrowserExternal$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6564
- __proto__: null,
6565
- default: __viteBrowserExternal$1
6566
- }, Symbol.toStringTag, { value: "Module" }));
6567
- const require$$3 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$2);
6568
- const name = "dotenv";
6569
- const version$1 = "16.4.5";
6570
- const description = "Loads environment variables from .env file";
6571
- const main = "lib/main.js";
6572
- const types = "lib/main.d.ts";
6573
- const exports$1 = {
6574
- ".": {
6575
- types: "./lib/main.d.ts",
6576
- require: "./lib/main.js",
6577
- "default": "./lib/main.js"
6578
- },
6579
- "./config": "./config.js",
6580
- "./config.js": "./config.js",
6581
- "./lib/env-options": "./lib/env-options.js",
6582
- "./lib/env-options.js": "./lib/env-options.js",
6583
- "./lib/cli-options": "./lib/cli-options.js",
6584
- "./lib/cli-options.js": "./lib/cli-options.js",
6585
- "./package.json": "./package.json"
6586
- };
6587
- const scripts = {
6588
- "dts-check": "tsc --project tests/types/tsconfig.json",
6589
- lint: "standard",
6590
- "lint-readme": "standard-markdown",
6591
- pretest: "npm run lint && npm run dts-check",
6592
- test: "tap tests/*.js --100 -Rspec",
6593
- "test:coverage": "tap --coverage-report=lcov",
6594
- prerelease: "npm test",
6595
- release: "standard-version"
6596
- };
6597
- const repository = {
6598
- type: "git",
6599
- url: "git://github.com/motdotla/dotenv.git"
6600
- };
6601
- const funding = "https://dotenvx.com";
6602
- const keywords = [
6603
- "dotenv",
6604
- "env",
6605
- ".env",
6606
- "environment",
6607
- "variables",
6608
- "config",
6609
- "settings"
6610
- ];
6611
- const readmeFilename = "README.md";
6612
- const license = "BSD-2-Clause";
6613
- const devDependencies = {
6614
- "@definitelytyped/dtslint": "^0.0.133",
6615
- "@types/node": "^18.11.3",
6616
- decache: "^4.6.1",
6617
- sinon: "^14.0.1",
6618
- standard: "^17.0.0",
6619
- "standard-markdown": "^7.1.0",
6620
- "standard-version": "^9.5.0",
6621
- tap: "^16.3.0",
6622
- tar: "^6.1.11",
6623
- typescript: "^4.8.4"
6624
- };
6625
- const engines = {
6626
- node: ">=12"
6627
- };
6628
- const browser$1 = {
6629
- fs: false
6630
- };
6631
- const require$$4 = {
6632
- name,
6633
- version: version$1,
6634
- description,
6635
- main,
6636
- types,
6637
- exports: exports$1,
6638
- scripts,
6639
- repository,
6640
- funding,
6641
- keywords,
6642
- readmeFilename,
6643
- license,
6644
- devDependencies,
6645
- engines,
6646
- browser: browser$1
6647
- };
6648
- const fs$1 = require$$3;
6649
- const path = require$$3;
6650
- const os = require$$3;
6651
- const crypto$1 = require$$3;
6652
- const packageJson = require$$4;
6653
- const version = packageJson.version;
6654
- const LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
6655
- function parse(src) {
6656
- const obj = {};
6657
- let lines = src.toString();
6658
- lines = lines.replace(/\r\n?/mg, "\n");
6659
- let match;
6660
- while ((match = LINE.exec(lines)) != null) {
6661
- const key = match[1];
6662
- let value = match[2] || "";
6663
- value = value.trim();
6664
- const maybeQuote = value[0];
6665
- value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2");
6666
- if (maybeQuote === '"') {
6667
- value = value.replace(/\\n/g, "\n");
6668
- value = value.replace(/\\r/g, "\r");
6669
- }
6670
- obj[key] = value;
6671
- }
6672
- return obj;
6673
- }
6674
- function _parseVault(options) {
6675
- const vaultPath = _vaultPath(options);
6676
- const result = DotenvModule.configDotenv({ path: vaultPath });
6677
- if (!result.parsed) {
6678
- const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
6679
- err.code = "MISSING_DATA";
6680
- throw err;
6681
- }
6682
- const keys = _dotenvKey(options).split(",");
6683
- const length = keys.length;
6684
- let decrypted;
6685
- for (let i = 0; i < length; i++) {
6686
- try {
6687
- const key = keys[i].trim();
6688
- const attrs = _instructions(result, key);
6689
- decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
6690
- break;
6691
- } catch (error) {
6692
- if (i + 1 >= length) {
6693
- throw error;
6694
- }
6695
- }
6696
- }
6697
- return DotenvModule.parse(decrypted);
6698
- }
6699
- function _log(message) {
6700
- console.log(`[dotenv@${version}][INFO] ${message}`);
6701
- }
6702
- function _warn(message) {
6703
- console.log(`[dotenv@${version}][WARN] ${message}`);
6704
- }
6705
- function _debug(message) {
6706
- console.log(`[dotenv@${version}][DEBUG] ${message}`);
6707
- }
6708
- function _dotenvKey(options) {
6709
- if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
6710
- return options.DOTENV_KEY;
6711
- }
6712
- if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
6713
- return process.env.DOTENV_KEY;
6714
- }
6715
- return "";
6716
- }
6717
- function _instructions(result, dotenvKey) {
6718
- let uri;
6719
- try {
6720
- uri = new URL(dotenvKey);
6721
- } catch (error) {
6722
- if (error.code === "ERR_INVALID_URL") {
6723
- const err = new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");
6724
- err.code = "INVALID_DOTENV_KEY";
6725
- throw err;
6726
- }
6727
- throw error;
6728
- }
6729
- const key = uri.password;
6730
- if (!key) {
6731
- const err = new Error("INVALID_DOTENV_KEY: Missing key part");
6732
- err.code = "INVALID_DOTENV_KEY";
6733
- throw err;
6734
- }
6735
- const environment = uri.searchParams.get("environment");
6736
- if (!environment) {
6737
- const err = new Error("INVALID_DOTENV_KEY: Missing environment part");
6738
- err.code = "INVALID_DOTENV_KEY";
6739
- throw err;
6740
- }
6741
- const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
6742
- const ciphertext = result.parsed[environmentKey];
6743
- if (!ciphertext) {
6744
- const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
6745
- err.code = "NOT_FOUND_DOTENV_ENVIRONMENT";
6746
- throw err;
6747
- }
6748
- return { ciphertext, key };
6749
- }
6750
- function _vaultPath(options) {
6751
- let possibleVaultPath = null;
6752
- if (options && options.path && options.path.length > 0) {
6753
- if (Array.isArray(options.path)) {
6754
- for (const filepath of options.path) {
6755
- if (fs$1.existsSync(filepath)) {
6756
- possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
6757
- }
6758
- }
6759
- } else {
6760
- possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
6761
- }
6762
- } else {
6763
- possibleVaultPath = path.resolve(process.cwd(), ".env.vault");
6764
- }
6765
- if (fs$1.existsSync(possibleVaultPath)) {
6766
- return possibleVaultPath;
6767
- }
6768
- return null;
6769
- }
6770
- function _resolveHome(envPath) {
6771
- return envPath[0] === "~" ? path.join(os.homedir(), envPath.slice(1)) : envPath;
6772
- }
6773
- function _configVault(options) {
6774
- _log("Loading env from encrypted .env.vault");
6775
- const parsed = DotenvModule._parseVault(options);
6776
- let processEnv = process.env;
6777
- if (options && options.processEnv != null) {
6778
- processEnv = options.processEnv;
6779
- }
6780
- DotenvModule.populate(processEnv, parsed, options);
6781
- return { parsed };
6782
- }
6783
- function configDotenv(options) {
6784
- const dotenvPath = path.resolve(process.cwd(), ".env");
6785
- let encoding = "utf8";
6786
- const debug = Boolean(options && options.debug);
6787
- if (options && options.encoding) {
6788
- encoding = options.encoding;
6789
- } else {
6790
- if (debug) {
6791
- _debug("No encoding is specified. UTF-8 is used by default");
6792
- }
6793
- }
6794
- let optionPaths = [dotenvPath];
6795
- if (options && options.path) {
6796
- if (!Array.isArray(options.path)) {
6797
- optionPaths = [_resolveHome(options.path)];
6798
- } else {
6799
- optionPaths = [];
6800
- for (const filepath of options.path) {
6801
- optionPaths.push(_resolveHome(filepath));
6535
+ var influxDBDataType = /* @__PURE__ */ ((influxDBDataType2) => {
6536
+ influxDBDataType2["intField"] = "intField";
6537
+ influxDBDataType2["floatField"] = "floatField";
6538
+ influxDBDataType2["stringField"] = "stringField";
6539
+ return influxDBDataType2;
6540
+ })(influxDBDataType || {});
6541
+ const instrumentationObservationInterval = 1e3;
6542
+ const instrumentationTimeWindow = 600;
6543
+ const consoleLogging = true;
6544
+ const instrumentLogging = true;
6545
+ const globalServiceDefinitions = {
6546
+ coreFieldList: [
6547
+ { fieldName: "requestCount", gauge: Gauge.REQUEST_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6548
+ { fieldName: "errorCount", gauge: Gauge.ERROR_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6549
+ { fieldName: "retryCount", gauge: Gauge.RETRY_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6550
+ { fieldName: "authenticationCount", gauge: Gauge.AUTHENTICATION_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6551
+ { fieldName: "authenticationErrorCount", gauge: Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6552
+ { fieldName: "authenticationRetryCount", gauge: Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6553
+ { fieldName: "velocity", gauge: Gauge.VELOCITY_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
6554
+ {
6555
+ fieldName: "activeRequestCount",
6556
+ gauge: Gauge.ACTIVE_REQUEST_GAUGE,
6557
+ instrumentProperty: "val",
6558
+ dataType: "number",
6559
+ timeSeriesIndex: true,
6560
+ quantile: true,
6561
+ influxdbDataType: "intField",
6562
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
6563
+ instrumentOptions: {
6564
+ interval: instrumentationObservationInterval,
6565
+ sampleSize: instrumentationTimeWindow
6802
6566
  }
6567
+ },
6568
+ { fieldName: "coreCount", gauge: Gauge.CORE_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6569
+ { fieldName: "rx", gauge: Gauge.NETWORK_RX_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
6570
+ { fieldName: "tx", gauge: Gauge.NETWORK_TX_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
6571
+ { fieldName: "timer", gauge: Gauge.TIMER_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_TIMER },
6572
+ {
6573
+ fieldName: "duration",
6574
+ gauge: Gauge.DURATION_GAUGE,
6575
+ instrumentProperty: "val",
6576
+ dataType: "number",
6577
+ timeSeriesIndex: true,
6578
+ quantile: true,
6579
+ influxdbDataType: "floatField",
6580
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
6581
+ instrumentOptions: {
6582
+ interval: instrumentationObservationInterval,
6583
+ sampleSize: instrumentationTimeWindow
6584
+ },
6585
+ histo: [
6586
+ { label: "B10", bucketLimit: 10 },
6587
+ { label: "B20", bucketLimit: 20 },
6588
+ { label: "B50", bucketLimit: 50 },
6589
+ { label: "B100", bucketLimit: 100 },
6590
+ { label: "B1000", bucketLimit: 1e3 },
6591
+ { label: "B50000", bucketLimit: 5e4 },
6592
+ { label: "BInfinity", bucketLimit: -1 }
6593
+ ],
6594
+ histoGaugeType: Gauge.DURATION_HISTOGRAM_GAUGE
6595
+ },
6596
+ {
6597
+ fieldName: "latency",
6598
+ gauge: Gauge.LATENCY_GAUGE,
6599
+ instrumentProperty: "val",
6600
+ dataType: "number",
6601
+ timeSeriesIndex: true,
6602
+ quantile: true,
6603
+ influxdbDataType: "floatField",
6604
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
6605
+ instrumentOptions: {
6606
+ interval: instrumentationObservationInterval,
6607
+ sampleSize: instrumentationTimeWindow
6608
+ },
6609
+ histo: [
6610
+ { label: "B10", bucketLimit: 10 },
6611
+ { label: "B20", bucketLimit: 20 },
6612
+ { label: "B50", bucketLimit: 50 },
6613
+ { label: "B100", bucketLimit: 100 },
6614
+ { label: "B1000", bucketLimit: 1e3 },
6615
+ { label: "B50000", bucketLimit: 5e4 },
6616
+ { label: "BInfinity", bucketLimit: -1 }
6617
+ ],
6618
+ histoGaugeType: Gauge.LATENCY_HISTOGRAM_GAUGE
6803
6619
  }
6804
- }
6805
- let lastError;
6806
- const parsedAll = {};
6807
- for (const path2 of optionPaths) {
6808
- try {
6809
- const parsed = DotenvModule.parse(fs$1.readFileSync(path2, { encoding }));
6810
- DotenvModule.populate(parsedAll, parsed, options);
6811
- } catch (e) {
6812
- if (debug) {
6813
- _debug(`Failed to load ${path2} ${e.message}`);
6814
- }
6815
- lastError = e;
6816
- }
6817
- }
6818
- let processEnv = process.env;
6819
- if (options && options.processEnv != null) {
6820
- processEnv = options.processEnv;
6821
- }
6822
- DotenvModule.populate(processEnv, parsedAll, options);
6823
- if (lastError) {
6824
- return { parsed: parsedAll, error: lastError };
6825
- } else {
6826
- return { parsed: parsedAll };
6827
- }
6828
- }
6829
- function config(options) {
6830
- if (_dotenvKey(options).length === 0) {
6831
- return DotenvModule.configDotenv(options);
6832
- }
6833
- const vaultPath = _vaultPath(options);
6834
- if (!vaultPath) {
6835
- _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
6836
- return DotenvModule.configDotenv(options);
6837
- }
6838
- return DotenvModule._configVault(options);
6839
- }
6840
- function decrypt(encrypted, keyStr) {
6841
- const key = Buffer.from(keyStr.slice(-64), "hex");
6842
- let ciphertext = Buffer.from(encrypted, "base64");
6843
- const nonce = ciphertext.subarray(0, 12);
6844
- const authTag = ciphertext.subarray(-16);
6845
- ciphertext = ciphertext.subarray(12, -16);
6846
- try {
6847
- const aesgcm = crypto$1.createDecipheriv("aes-256-gcm", key, nonce);
6848
- aesgcm.setAuthTag(authTag);
6849
- return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
6850
- } catch (error) {
6851
- const isRange = error instanceof RangeError;
6852
- const invalidKeyLength = error.message === "Invalid key length";
6853
- const decryptionFailed = error.message === "Unsupported state or unable to authenticate data";
6854
- if (isRange || invalidKeyLength) {
6855
- const err = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
6856
- err.code = "INVALID_DOTENV_KEY";
6857
- throw err;
6858
- } else if (decryptionFailed) {
6859
- const err = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
6860
- err.code = "DECRYPTION_FAILED";
6861
- throw err;
6862
- } else {
6863
- throw error;
6864
- }
6865
- }
6866
- }
6867
- function populate(processEnv, parsed, options = {}) {
6868
- const debug = Boolean(options && options.debug);
6869
- const override = Boolean(options && options.override);
6870
- if (typeof parsed !== "object") {
6871
- const err = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
6872
- err.code = "OBJECT_REQUIRED";
6873
- throw err;
6874
- }
6875
- for (const key of Object.keys(parsed)) {
6876
- if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
6877
- if (override === true) {
6878
- processEnv[key] = parsed[key];
6879
- }
6880
- if (debug) {
6881
- if (override === true) {
6882
- _debug(`"${key}" is already defined and WAS overwritten`);
6883
- } else {
6884
- _debug(`"${key}" is already defined and was NOT overwritten`);
6885
- }
6886
- }
6887
- } else {
6888
- processEnv[key] = parsed[key];
6889
- }
6890
- }
6891
- }
6892
- const DotenvModule = {
6893
- configDotenv,
6894
- _configVault,
6895
- _parseVault,
6896
- config,
6897
- decrypt,
6898
- parse,
6899
- populate
6900
- };
6901
- main$1.exports.configDotenv = DotenvModule.configDotenv;
6902
- main$1.exports._configVault = DotenvModule._configVault;
6903
- main$1.exports._parseVault = DotenvModule._parseVault;
6904
- var config_1 = main$1.exports.config = DotenvModule.config;
6905
- main$1.exports.decrypt = DotenvModule.decrypt;
6906
- main$1.exports.parse = DotenvModule.parse;
6907
- main$1.exports.populate = DotenvModule.populate;
6908
- main$1.exports = DotenvModule;
6909
- const __viteBrowserExternal = {};
6910
- const fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6911
- __proto__: null,
6912
- default: __viteBrowserExternal
6913
- }, Symbol.toStringTag, { value: "Module" }));
6914
- function getDefaultExportFromCjs(x) {
6915
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
6916
- }
6917
- var ansiStyles$1 = { exports: {} };
6918
- var colorName;
6919
- var hasRequiredColorName;
6920
- function requireColorName() {
6921
- if (hasRequiredColorName)
6922
- return colorName;
6923
- hasRequiredColorName = 1;
6924
- colorName = {
6925
- "aliceblue": [240, 248, 255],
6926
- "antiquewhite": [250, 235, 215],
6927
- "aqua": [0, 255, 255],
6928
- "aquamarine": [127, 255, 212],
6929
- "azure": [240, 255, 255],
6930
- "beige": [245, 245, 220],
6931
- "bisque": [255, 228, 196],
6932
- "black": [0, 0, 0],
6933
- "blanchedalmond": [255, 235, 205],
6934
- "blue": [0, 0, 255],
6935
- "blueviolet": [138, 43, 226],
6936
- "brown": [165, 42, 42],
6937
- "burlywood": [222, 184, 135],
6938
- "cadetblue": [95, 158, 160],
6939
- "chartreuse": [127, 255, 0],
6940
- "chocolate": [210, 105, 30],
6941
- "coral": [255, 127, 80],
6942
- "cornflowerblue": [100, 149, 237],
6943
- "cornsilk": [255, 248, 220],
6944
- "crimson": [220, 20, 60],
6945
- "cyan": [0, 255, 255],
6946
- "darkblue": [0, 0, 139],
6947
- "darkcyan": [0, 139, 139],
6948
- "darkgoldenrod": [184, 134, 11],
6949
- "darkgray": [169, 169, 169],
6950
- "darkgreen": [0, 100, 0],
6951
- "darkgrey": [169, 169, 169],
6952
- "darkkhaki": [189, 183, 107],
6953
- "darkmagenta": [139, 0, 139],
6954
- "darkolivegreen": [85, 107, 47],
6955
- "darkorange": [255, 140, 0],
6956
- "darkorchid": [153, 50, 204],
6957
- "darkred": [139, 0, 0],
6958
- "darksalmon": [233, 150, 122],
6959
- "darkseagreen": [143, 188, 143],
6960
- "darkslateblue": [72, 61, 139],
6961
- "darkslategray": [47, 79, 79],
6962
- "darkslategrey": [47, 79, 79],
6963
- "darkturquoise": [0, 206, 209],
6964
- "darkviolet": [148, 0, 211],
6965
- "deeppink": [255, 20, 147],
6966
- "deepskyblue": [0, 191, 255],
6967
- "dimgray": [105, 105, 105],
6968
- "dimgrey": [105, 105, 105],
6969
- "dodgerblue": [30, 144, 255],
6970
- "firebrick": [178, 34, 34],
6971
- "floralwhite": [255, 250, 240],
6972
- "forestgreen": [34, 139, 34],
6973
- "fuchsia": [255, 0, 255],
6974
- "gainsboro": [220, 220, 220],
6975
- "ghostwhite": [248, 248, 255],
6976
- "gold": [255, 215, 0],
6977
- "goldenrod": [218, 165, 32],
6978
- "gray": [128, 128, 128],
6979
- "green": [0, 128, 0],
6980
- "greenyellow": [173, 255, 47],
6981
- "grey": [128, 128, 128],
6982
- "honeydew": [240, 255, 240],
6983
- "hotpink": [255, 105, 180],
6984
- "indianred": [205, 92, 92],
6985
- "indigo": [75, 0, 130],
6986
- "ivory": [255, 255, 240],
6987
- "khaki": [240, 230, 140],
6988
- "lavender": [230, 230, 250],
6989
- "lavenderblush": [255, 240, 245],
6990
- "lawngreen": [124, 252, 0],
6991
- "lemonchiffon": [255, 250, 205],
6992
- "lightblue": [173, 216, 230],
6993
- "lightcoral": [240, 128, 128],
6994
- "lightcyan": [224, 255, 255],
6995
- "lightgoldenrodyellow": [250, 250, 210],
6996
- "lightgray": [211, 211, 211],
6997
- "lightgreen": [144, 238, 144],
6998
- "lightgrey": [211, 211, 211],
6999
- "lightpink": [255, 182, 193],
7000
- "lightsalmon": [255, 160, 122],
7001
- "lightseagreen": [32, 178, 170],
7002
- "lightskyblue": [135, 206, 250],
7003
- "lightslategray": [119, 136, 153],
7004
- "lightslategrey": [119, 136, 153],
7005
- "lightsteelblue": [176, 196, 222],
7006
- "lightyellow": [255, 255, 224],
7007
- "lime": [0, 255, 0],
7008
- "limegreen": [50, 205, 50],
7009
- "linen": [250, 240, 230],
7010
- "magenta": [255, 0, 255],
7011
- "maroon": [128, 0, 0],
7012
- "mediumaquamarine": [102, 205, 170],
7013
- "mediumblue": [0, 0, 205],
7014
- "mediumorchid": [186, 85, 211],
7015
- "mediumpurple": [147, 112, 219],
7016
- "mediumseagreen": [60, 179, 113],
7017
- "mediumslateblue": [123, 104, 238],
7018
- "mediumspringgreen": [0, 250, 154],
7019
- "mediumturquoise": [72, 209, 204],
7020
- "mediumvioletred": [199, 21, 133],
7021
- "midnightblue": [25, 25, 112],
7022
- "mintcream": [245, 255, 250],
7023
- "mistyrose": [255, 228, 225],
7024
- "moccasin": [255, 228, 181],
7025
- "navajowhite": [255, 222, 173],
7026
- "navy": [0, 0, 128],
7027
- "oldlace": [253, 245, 230],
7028
- "olive": [128, 128, 0],
7029
- "olivedrab": [107, 142, 35],
7030
- "orange": [255, 165, 0],
7031
- "orangered": [255, 69, 0],
7032
- "orchid": [218, 112, 214],
7033
- "palegoldenrod": [238, 232, 170],
7034
- "palegreen": [152, 251, 152],
7035
- "paleturquoise": [175, 238, 238],
7036
- "palevioletred": [219, 112, 147],
7037
- "papayawhip": [255, 239, 213],
7038
- "peachpuff": [255, 218, 185],
7039
- "peru": [205, 133, 63],
7040
- "pink": [255, 192, 203],
7041
- "plum": [221, 160, 221],
7042
- "powderblue": [176, 224, 230],
7043
- "purple": [128, 0, 128],
7044
- "rebeccapurple": [102, 51, 153],
7045
- "red": [255, 0, 0],
7046
- "rosybrown": [188, 143, 143],
7047
- "royalblue": [65, 105, 225],
7048
- "saddlebrown": [139, 69, 19],
7049
- "salmon": [250, 128, 114],
7050
- "sandybrown": [244, 164, 96],
7051
- "seagreen": [46, 139, 87],
7052
- "seashell": [255, 245, 238],
7053
- "sienna": [160, 82, 45],
7054
- "silver": [192, 192, 192],
7055
- "skyblue": [135, 206, 235],
7056
- "slateblue": [106, 90, 205],
7057
- "slategray": [112, 128, 144],
7058
- "slategrey": [112, 128, 144],
7059
- "snow": [255, 250, 250],
7060
- "springgreen": [0, 255, 127],
7061
- "steelblue": [70, 130, 180],
7062
- "tan": [210, 180, 140],
7063
- "teal": [0, 128, 128],
7064
- "thistle": [216, 191, 216],
7065
- "tomato": [255, 99, 71],
7066
- "turquoise": [64, 224, 208],
7067
- "violet": [238, 130, 238],
7068
- "wheat": [245, 222, 179],
7069
- "white": [255, 255, 255],
7070
- "whitesmoke": [245, 245, 245],
7071
- "yellow": [255, 255, 0],
7072
- "yellowgreen": [154, 205, 50]
7073
- };
7074
- return colorName;
7075
- }
7076
- var conversions;
7077
- var hasRequiredConversions;
7078
- function requireConversions() {
7079
- if (hasRequiredConversions)
7080
- return conversions;
7081
- hasRequiredConversions = 1;
7082
- const cssKeywords = requireColorName();
7083
- const reverseKeywords = {};
7084
- for (const key of Object.keys(cssKeywords)) {
7085
- reverseKeywords[cssKeywords[key]] = key;
7086
- }
7087
- const convert = {
7088
- rgb: { channels: 3, labels: "rgb" },
7089
- hsl: { channels: 3, labels: "hsl" },
7090
- hsv: { channels: 3, labels: "hsv" },
7091
- hwb: { channels: 3, labels: "hwb" },
7092
- cmyk: { channels: 4, labels: "cmyk" },
7093
- xyz: { channels: 3, labels: "xyz" },
7094
- lab: { channels: 3, labels: "lab" },
7095
- lch: { channels: 3, labels: "lch" },
7096
- hex: { channels: 1, labels: ["hex"] },
7097
- keyword: { channels: 1, labels: ["keyword"] },
7098
- ansi16: { channels: 1, labels: ["ansi16"] },
7099
- ansi256: { channels: 1, labels: ["ansi256"] },
7100
- hcg: { channels: 3, labels: ["h", "c", "g"] },
7101
- apple: { channels: 3, labels: ["r16", "g16", "b16"] },
7102
- gray: { channels: 1, labels: ["gray"] }
7103
- };
7104
- conversions = convert;
7105
- for (const model of Object.keys(convert)) {
7106
- if (!("channels" in convert[model])) {
7107
- throw new Error("missing channels property: " + model);
7108
- }
7109
- if (!("labels" in convert[model])) {
7110
- throw new Error("missing channel labels property: " + model);
7111
- }
7112
- if (convert[model].labels.length !== convert[model].channels) {
7113
- throw new Error("channel and label counts mismatch: " + model);
7114
- }
7115
- const { channels, labels } = convert[model];
7116
- delete convert[model].channels;
7117
- delete convert[model].labels;
7118
- Object.defineProperty(convert[model], "channels", { value: channels });
7119
- Object.defineProperty(convert[model], "labels", { value: labels });
7120
- }
7121
- convert.rgb.hsl = function(rgb) {
7122
- const r = rgb[0] / 255;
7123
- const g = rgb[1] / 255;
7124
- const b = rgb[2] / 255;
7125
- const min = Math.min(r, g, b);
7126
- const max = Math.max(r, g, b);
7127
- const delta = max - min;
7128
- let h;
7129
- let s;
7130
- if (max === min) {
7131
- h = 0;
7132
- } else if (r === max) {
7133
- h = (g - b) / delta;
7134
- } else if (g === max) {
7135
- h = 2 + (b - r) / delta;
7136
- } else if (b === max) {
7137
- h = 4 + (r - g) / delta;
7138
- }
7139
- h = Math.min(h * 60, 360);
7140
- if (h < 0) {
7141
- h += 360;
7142
- }
7143
- const l = (min + max) / 2;
7144
- if (max === min) {
7145
- s = 0;
7146
- } else if (l <= 0.5) {
7147
- s = delta / (max + min);
7148
- } else {
7149
- s = delta / (2 - max - min);
7150
- }
7151
- return [h, s * 100, l * 100];
7152
- };
7153
- convert.rgb.hsv = function(rgb) {
7154
- let rdif;
7155
- let gdif;
7156
- let bdif;
7157
- let h;
7158
- let s;
7159
- const r = rgb[0] / 255;
7160
- const g = rgb[1] / 255;
7161
- const b = rgb[2] / 255;
7162
- const v = Math.max(r, g, b);
7163
- const diff = v - Math.min(r, g, b);
7164
- const diffc = function(c) {
7165
- return (v - c) / 6 / diff + 1 / 2;
7166
- };
7167
- if (diff === 0) {
7168
- h = 0;
7169
- s = 0;
7170
- } else {
7171
- s = diff / v;
7172
- rdif = diffc(r);
7173
- gdif = diffc(g);
7174
- bdif = diffc(b);
7175
- if (r === v) {
7176
- h = bdif - gdif;
7177
- } else if (g === v) {
7178
- h = 1 / 3 + rdif - bdif;
7179
- } else if (b === v) {
7180
- h = 2 / 3 + gdif - rdif;
7181
- }
7182
- if (h < 0) {
7183
- h += 1;
7184
- } else if (h > 1) {
7185
- h -= 1;
7186
- }
7187
- }
7188
- return [
7189
- h * 360,
7190
- s * 100,
7191
- v * 100
7192
- ];
7193
- };
7194
- convert.rgb.hwb = function(rgb) {
7195
- const r = rgb[0];
7196
- const g = rgb[1];
7197
- let b = rgb[2];
7198
- const h = convert.rgb.hsl(rgb)[0];
7199
- const w = 1 / 255 * Math.min(r, Math.min(g, b));
7200
- b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
7201
- return [h, w * 100, b * 100];
7202
- };
7203
- convert.rgb.cmyk = function(rgb) {
7204
- const r = rgb[0] / 255;
7205
- const g = rgb[1] / 255;
7206
- const b = rgb[2] / 255;
7207
- const k = Math.min(1 - r, 1 - g, 1 - b);
7208
- const c = (1 - r - k) / (1 - k) || 0;
7209
- const m = (1 - g - k) / (1 - k) || 0;
7210
- const y = (1 - b - k) / (1 - k) || 0;
7211
- return [c * 100, m * 100, y * 100, k * 100];
7212
- };
7213
- function comparativeDistance(x, y) {
7214
- return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
7215
- }
7216
- convert.rgb.keyword = function(rgb) {
7217
- const reversed = reverseKeywords[rgb];
7218
- if (reversed) {
7219
- return reversed;
7220
- }
7221
- let currentClosestDistance = Infinity;
7222
- let currentClosestKeyword;
7223
- for (const keyword of Object.keys(cssKeywords)) {
7224
- const value = cssKeywords[keyword];
7225
- const distance = comparativeDistance(rgb, value);
7226
- if (distance < currentClosestDistance) {
7227
- currentClosestDistance = distance;
7228
- currentClosestKeyword = keyword;
7229
- }
7230
- }
7231
- return currentClosestKeyword;
7232
- };
7233
- convert.keyword.rgb = function(keyword) {
7234
- return cssKeywords[keyword];
7235
- };
7236
- convert.rgb.xyz = function(rgb) {
7237
- let r = rgb[0] / 255;
7238
- let g = rgb[1] / 255;
7239
- let b = rgb[2] / 255;
7240
- r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
7241
- g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
7242
- b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
7243
- const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
7244
- const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
7245
- const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
7246
- return [x * 100, y * 100, z * 100];
7247
- };
7248
- convert.rgb.lab = function(rgb) {
7249
- const xyz = convert.rgb.xyz(rgb);
7250
- let x = xyz[0];
7251
- let y = xyz[1];
7252
- let z = xyz[2];
7253
- x /= 95.047;
7254
- y /= 100;
7255
- z /= 108.883;
7256
- x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
7257
- y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
7258
- z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
7259
- const l = 116 * y - 16;
7260
- const a = 500 * (x - y);
7261
- const b = 200 * (y - z);
7262
- return [l, a, b];
7263
- };
7264
- convert.hsl.rgb = function(hsl) {
7265
- const h = hsl[0] / 360;
7266
- const s = hsl[1] / 100;
7267
- const l = hsl[2] / 100;
7268
- let t2;
7269
- let t3;
7270
- let val;
7271
- if (s === 0) {
7272
- val = l * 255;
7273
- return [val, val, val];
7274
- }
7275
- if (l < 0.5) {
7276
- t2 = l * (1 + s);
7277
- } else {
7278
- t2 = l + s - l * s;
7279
- }
7280
- const t1 = 2 * l - t2;
7281
- const rgb = [0, 0, 0];
7282
- for (let i = 0; i < 3; i++) {
7283
- t3 = h + 1 / 3 * -(i - 1);
7284
- if (t3 < 0) {
7285
- t3++;
7286
- }
7287
- if (t3 > 1) {
7288
- t3--;
7289
- }
7290
- if (6 * t3 < 1) {
7291
- val = t1 + (t2 - t1) * 6 * t3;
7292
- } else if (2 * t3 < 1) {
7293
- val = t2;
7294
- } else if (3 * t3 < 2) {
7295
- val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
7296
- } else {
7297
- val = t1;
7298
- }
7299
- rgb[i] = val * 255;
7300
- }
7301
- return rgb;
7302
- };
7303
- convert.hsl.hsv = function(hsl) {
7304
- const h = hsl[0];
7305
- let s = hsl[1] / 100;
7306
- let l = hsl[2] / 100;
7307
- let smin = s;
7308
- const lmin = Math.max(l, 0.01);
7309
- l *= 2;
7310
- s *= l <= 1 ? l : 2 - l;
7311
- smin *= lmin <= 1 ? lmin : 2 - lmin;
7312
- const v = (l + s) / 2;
7313
- const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
7314
- return [h, sv * 100, v * 100];
7315
- };
7316
- convert.hsv.rgb = function(hsv) {
7317
- const h = hsv[0] / 60;
7318
- const s = hsv[1] / 100;
7319
- let v = hsv[2] / 100;
7320
- const hi = Math.floor(h) % 6;
7321
- const f = h - Math.floor(h);
7322
- const p = 255 * v * (1 - s);
7323
- const q = 255 * v * (1 - s * f);
7324
- const t = 255 * v * (1 - s * (1 - f));
7325
- v *= 255;
7326
- switch (hi) {
7327
- case 0:
7328
- return [v, t, p];
7329
- case 1:
7330
- return [q, v, p];
7331
- case 2:
7332
- return [p, v, t];
7333
- case 3:
7334
- return [p, q, v];
7335
- case 4:
7336
- return [t, p, v];
7337
- case 5:
7338
- return [v, p, q];
7339
- }
7340
- };
7341
- convert.hsv.hsl = function(hsv) {
7342
- const h = hsv[0];
7343
- const s = hsv[1] / 100;
7344
- const v = hsv[2] / 100;
7345
- const vmin = Math.max(v, 0.01);
7346
- let sl;
7347
- let l;
7348
- l = (2 - s) * v;
7349
- const lmin = (2 - s) * vmin;
7350
- sl = s * vmin;
7351
- sl /= lmin <= 1 ? lmin : 2 - lmin;
7352
- sl = sl || 0;
7353
- l /= 2;
7354
- return [h, sl * 100, l * 100];
7355
- };
7356
- convert.hwb.rgb = function(hwb) {
7357
- const h = hwb[0] / 360;
7358
- let wh = hwb[1] / 100;
7359
- let bl = hwb[2] / 100;
7360
- const ratio = wh + bl;
7361
- let f;
7362
- if (ratio > 1) {
7363
- wh /= ratio;
7364
- bl /= ratio;
7365
- }
7366
- const i = Math.floor(6 * h);
7367
- const v = 1 - bl;
7368
- f = 6 * h - i;
7369
- if ((i & 1) !== 0) {
7370
- f = 1 - f;
7371
- }
7372
- const n = wh + f * (v - wh);
7373
- let r;
7374
- let g;
7375
- let b;
7376
- switch (i) {
7377
- default:
7378
- case 6:
7379
- case 0:
7380
- r = v;
7381
- g = n;
7382
- b = wh;
7383
- break;
7384
- case 1:
7385
- r = n;
7386
- g = v;
7387
- b = wh;
7388
- break;
7389
- case 2:
7390
- r = wh;
7391
- g = v;
7392
- b = n;
7393
- break;
7394
- case 3:
7395
- r = wh;
7396
- g = n;
7397
- b = v;
7398
- break;
7399
- case 4:
7400
- r = n;
7401
- g = wh;
7402
- b = v;
7403
- break;
7404
- case 5:
7405
- r = v;
7406
- g = wh;
7407
- b = n;
7408
- break;
7409
- }
7410
- return [r * 255, g * 255, b * 255];
7411
- };
7412
- convert.cmyk.rgb = function(cmyk) {
7413
- const c = cmyk[0] / 100;
7414
- const m = cmyk[1] / 100;
7415
- const y = cmyk[2] / 100;
7416
- const k = cmyk[3] / 100;
7417
- const r = 1 - Math.min(1, c * (1 - k) + k);
7418
- const g = 1 - Math.min(1, m * (1 - k) + k);
7419
- const b = 1 - Math.min(1, y * (1 - k) + k);
7420
- return [r * 255, g * 255, b * 255];
7421
- };
7422
- convert.xyz.rgb = function(xyz) {
7423
- const x = xyz[0] / 100;
7424
- const y = xyz[1] / 100;
7425
- const z = xyz[2] / 100;
7426
- let r;
7427
- let g;
7428
- let b;
7429
- r = x * 3.2406 + y * -1.5372 + z * -0.4986;
7430
- g = x * -0.9689 + y * 1.8758 + z * 0.0415;
7431
- b = x * 0.0557 + y * -0.204 + z * 1.057;
7432
- r = r > 31308e-7 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92;
7433
- g = g > 31308e-7 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92;
7434
- b = b > 31308e-7 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92;
7435
- r = Math.min(Math.max(0, r), 1);
7436
- g = Math.min(Math.max(0, g), 1);
7437
- b = Math.min(Math.max(0, b), 1);
7438
- return [r * 255, g * 255, b * 255];
7439
- };
7440
- convert.xyz.lab = function(xyz) {
7441
- let x = xyz[0];
7442
- let y = xyz[1];
7443
- let z = xyz[2];
7444
- x /= 95.047;
7445
- y /= 100;
7446
- z /= 108.883;
7447
- x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
7448
- y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
7449
- z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
7450
- const l = 116 * y - 16;
7451
- const a = 500 * (x - y);
7452
- const b = 200 * (y - z);
7453
- return [l, a, b];
7454
- };
7455
- convert.lab.xyz = function(lab) {
7456
- const l = lab[0];
7457
- const a = lab[1];
7458
- const b = lab[2];
7459
- let x;
7460
- let y;
7461
- let z;
7462
- y = (l + 16) / 116;
7463
- x = a / 500 + y;
7464
- z = y - b / 200;
7465
- const y2 = y ** 3;
7466
- const x2 = x ** 3;
7467
- const z2 = z ** 3;
7468
- y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787;
7469
- x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787;
7470
- z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787;
7471
- x *= 95.047;
7472
- y *= 100;
7473
- z *= 108.883;
7474
- return [x, y, z];
7475
- };
7476
- convert.lab.lch = function(lab) {
7477
- const l = lab[0];
7478
- const a = lab[1];
7479
- const b = lab[2];
7480
- let h;
7481
- const hr = Math.atan2(b, a);
7482
- h = hr * 360 / 2 / Math.PI;
7483
- if (h < 0) {
7484
- h += 360;
7485
- }
7486
- const c = Math.sqrt(a * a + b * b);
7487
- return [l, c, h];
7488
- };
7489
- convert.lch.lab = function(lch) {
7490
- const l = lch[0];
7491
- const c = lch[1];
7492
- const h = lch[2];
7493
- const hr = h / 360 * 2 * Math.PI;
7494
- const a = c * Math.cos(hr);
7495
- const b = c * Math.sin(hr);
7496
- return [l, a, b];
7497
- };
7498
- convert.rgb.ansi16 = function(args, saturation = null) {
7499
- const [r, g, b] = args;
7500
- let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
7501
- value = Math.round(value / 50);
7502
- if (value === 0) {
7503
- return 30;
7504
- }
7505
- let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
7506
- if (value === 2) {
7507
- ansi += 60;
7508
- }
7509
- return ansi;
7510
- };
7511
- convert.hsv.ansi16 = function(args) {
7512
- return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
7513
- };
7514
- convert.rgb.ansi256 = function(args) {
7515
- const r = args[0];
7516
- const g = args[1];
7517
- const b = args[2];
7518
- if (r === g && g === b) {
7519
- if (r < 8) {
7520
- return 16;
7521
- }
7522
- if (r > 248) {
7523
- return 231;
7524
- }
7525
- return Math.round((r - 8) / 247 * 24) + 232;
7526
- }
7527
- const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
7528
- return ansi;
7529
- };
7530
- convert.ansi16.rgb = function(args) {
7531
- let color = args % 10;
7532
- if (color === 0 || color === 7) {
7533
- if (args > 50) {
7534
- color += 3.5;
7535
- }
7536
- color = color / 10.5 * 255;
7537
- return [color, color, color];
7538
- }
7539
- const mult = (~~(args > 50) + 1) * 0.5;
7540
- const r = (color & 1) * mult * 255;
7541
- const g = (color >> 1 & 1) * mult * 255;
7542
- const b = (color >> 2 & 1) * mult * 255;
7543
- return [r, g, b];
7544
- };
7545
- convert.ansi256.rgb = function(args) {
7546
- if (args >= 232) {
7547
- const c = (args - 232) * 10 + 8;
7548
- return [c, c, c];
7549
- }
7550
- args -= 16;
7551
- let rem;
7552
- const r = Math.floor(args / 36) / 5 * 255;
7553
- const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
7554
- const b = rem % 6 / 5 * 255;
7555
- return [r, g, b];
7556
- };
7557
- convert.rgb.hex = function(args) {
7558
- const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
7559
- const string = integer.toString(16).toUpperCase();
7560
- return "000000".substring(string.length) + string;
7561
- };
7562
- convert.hex.rgb = function(args) {
7563
- const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
7564
- if (!match) {
7565
- return [0, 0, 0];
7566
- }
7567
- let colorString = match[0];
7568
- if (match[0].length === 3) {
7569
- colorString = colorString.split("").map((char) => {
7570
- return char + char;
7571
- }).join("");
7572
- }
7573
- const integer = parseInt(colorString, 16);
7574
- const r = integer >> 16 & 255;
7575
- const g = integer >> 8 & 255;
7576
- const b = integer & 255;
7577
- return [r, g, b];
7578
- };
7579
- convert.rgb.hcg = function(rgb) {
7580
- const r = rgb[0] / 255;
7581
- const g = rgb[1] / 255;
7582
- const b = rgb[2] / 255;
7583
- const max = Math.max(Math.max(r, g), b);
7584
- const min = Math.min(Math.min(r, g), b);
7585
- const chroma = max - min;
7586
- let grayscale;
7587
- let hue;
7588
- if (chroma < 1) {
7589
- grayscale = min / (1 - chroma);
7590
- } else {
7591
- grayscale = 0;
7592
- }
7593
- if (chroma <= 0) {
7594
- hue = 0;
7595
- } else if (max === r) {
7596
- hue = (g - b) / chroma % 6;
7597
- } else if (max === g) {
7598
- hue = 2 + (b - r) / chroma;
7599
- } else {
7600
- hue = 4 + (r - g) / chroma;
7601
- }
7602
- hue /= 6;
7603
- hue %= 1;
7604
- return [hue * 360, chroma * 100, grayscale * 100];
7605
- };
7606
- convert.hsl.hcg = function(hsl) {
7607
- const s = hsl[1] / 100;
7608
- const l = hsl[2] / 100;
7609
- const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l);
7610
- let f = 0;
7611
- if (c < 1) {
7612
- f = (l - 0.5 * c) / (1 - c);
7613
- }
7614
- return [hsl[0], c * 100, f * 100];
7615
- };
7616
- convert.hsv.hcg = function(hsv) {
7617
- const s = hsv[1] / 100;
7618
- const v = hsv[2] / 100;
7619
- const c = s * v;
7620
- let f = 0;
7621
- if (c < 1) {
7622
- f = (v - c) / (1 - c);
7623
- }
7624
- return [hsv[0], c * 100, f * 100];
7625
- };
7626
- convert.hcg.rgb = function(hcg) {
7627
- const h = hcg[0] / 360;
7628
- const c = hcg[1] / 100;
7629
- const g = hcg[2] / 100;
7630
- if (c === 0) {
7631
- return [g * 255, g * 255, g * 255];
7632
- }
7633
- const pure = [0, 0, 0];
7634
- const hi = h % 1 * 6;
7635
- const v = hi % 1;
7636
- const w = 1 - v;
7637
- let mg = 0;
7638
- switch (Math.floor(hi)) {
7639
- case 0:
7640
- pure[0] = 1;
7641
- pure[1] = v;
7642
- pure[2] = 0;
7643
- break;
7644
- case 1:
7645
- pure[0] = w;
7646
- pure[1] = 1;
7647
- pure[2] = 0;
7648
- break;
7649
- case 2:
7650
- pure[0] = 0;
7651
- pure[1] = 1;
7652
- pure[2] = v;
7653
- break;
7654
- case 3:
7655
- pure[0] = 0;
7656
- pure[1] = w;
7657
- pure[2] = 1;
7658
- break;
7659
- case 4:
7660
- pure[0] = v;
7661
- pure[1] = 0;
7662
- pure[2] = 1;
7663
- break;
7664
- default:
7665
- pure[0] = 1;
7666
- pure[1] = 0;
7667
- pure[2] = w;
7668
- }
7669
- mg = (1 - c) * g;
7670
- return [
7671
- (c * pure[0] + mg) * 255,
7672
- (c * pure[1] + mg) * 255,
7673
- (c * pure[2] + mg) * 255
7674
- ];
7675
- };
7676
- convert.hcg.hsv = function(hcg) {
7677
- const c = hcg[1] / 100;
7678
- const g = hcg[2] / 100;
7679
- const v = c + g * (1 - c);
7680
- let f = 0;
7681
- if (v > 0) {
7682
- f = c / v;
7683
- }
7684
- return [hcg[0], f * 100, v * 100];
7685
- };
7686
- convert.hcg.hsl = function(hcg) {
7687
- const c = hcg[1] / 100;
7688
- const g = hcg[2] / 100;
7689
- const l = g * (1 - c) + 0.5 * c;
7690
- let s = 0;
7691
- if (l > 0 && l < 0.5) {
7692
- s = c / (2 * l);
7693
- } else if (l >= 0.5 && l < 1) {
7694
- s = c / (2 * (1 - l));
7695
- }
7696
- return [hcg[0], s * 100, l * 100];
7697
- };
7698
- convert.hcg.hwb = function(hcg) {
7699
- const c = hcg[1] / 100;
7700
- const g = hcg[2] / 100;
7701
- const v = c + g * (1 - c);
7702
- return [hcg[0], (v - c) * 100, (1 - v) * 100];
7703
- };
7704
- convert.hwb.hcg = function(hwb) {
7705
- const w = hwb[1] / 100;
7706
- const b = hwb[2] / 100;
7707
- const v = 1 - b;
7708
- const c = v - w;
7709
- let g = 0;
7710
- if (c < 1) {
7711
- g = (v - c) / (1 - c);
7712
- }
7713
- return [hwb[0], c * 100, g * 100];
7714
- };
7715
- convert.apple.rgb = function(apple) {
7716
- return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
7717
- };
7718
- convert.rgb.apple = function(rgb) {
7719
- return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
7720
- };
7721
- convert.gray.rgb = function(args) {
7722
- return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
7723
- };
7724
- convert.gray.hsl = function(args) {
7725
- return [0, 0, args[0]];
7726
- };
7727
- convert.gray.hsv = convert.gray.hsl;
7728
- convert.gray.hwb = function(gray) {
7729
- return [0, 100, gray[0]];
7730
- };
7731
- convert.gray.cmyk = function(gray) {
7732
- return [0, 0, 0, gray[0]];
7733
- };
7734
- convert.gray.lab = function(gray) {
7735
- return [gray[0], 0, 0];
7736
- };
7737
- convert.gray.hex = function(gray) {
7738
- const val = Math.round(gray[0] / 100 * 255) & 255;
7739
- const integer = (val << 16) + (val << 8) + val;
7740
- const string = integer.toString(16).toUpperCase();
7741
- return "000000".substring(string.length) + string;
7742
- };
7743
- convert.rgb.gray = function(rgb) {
7744
- const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
7745
- return [val / 255 * 100];
7746
- };
7747
- return conversions;
7748
- }
7749
- var route;
7750
- var hasRequiredRoute;
7751
- function requireRoute() {
7752
- if (hasRequiredRoute)
7753
- return route;
7754
- hasRequiredRoute = 1;
7755
- const conversions2 = requireConversions();
7756
- function buildGraph() {
7757
- const graph = {};
7758
- const models = Object.keys(conversions2);
7759
- for (let len = models.length, i = 0; i < len; i++) {
7760
- graph[models[i]] = {
7761
- // http://jsperf.com/1-vs-infinity
7762
- // micro-opt, but this is simple.
7763
- distance: -1,
7764
- parent: null
7765
- };
7766
- }
7767
- return graph;
7768
- }
7769
- function deriveBFS(fromModel) {
7770
- const graph = buildGraph();
7771
- const queue = [fromModel];
7772
- graph[fromModel].distance = 0;
7773
- while (queue.length) {
7774
- const current = queue.pop();
7775
- const adjacents = Object.keys(conversions2[current]);
7776
- for (let len = adjacents.length, i = 0; i < len; i++) {
7777
- const adjacent = adjacents[i];
7778
- const node = graph[adjacent];
7779
- if (node.distance === -1) {
7780
- node.distance = graph[current].distance + 1;
7781
- node.parent = current;
7782
- queue.unshift(adjacent);
7783
- }
7784
- }
7785
- }
7786
- return graph;
7787
- }
7788
- function link(from, to) {
7789
- return function(args) {
7790
- return to(from(args));
7791
- };
7792
- }
7793
- function wrapConversion(toModel, graph) {
7794
- const path2 = [graph[toModel].parent, toModel];
7795
- let fn = conversions2[graph[toModel].parent][toModel];
7796
- let cur = graph[toModel].parent;
7797
- while (graph[cur].parent) {
7798
- path2.unshift(graph[cur].parent);
7799
- fn = link(conversions2[graph[cur].parent][cur], fn);
7800
- cur = graph[cur].parent;
7801
- }
7802
- fn.conversion = path2;
7803
- return fn;
7804
- }
7805
- route = function(fromModel) {
7806
- const graph = deriveBFS(fromModel);
7807
- const conversion = {};
7808
- const models = Object.keys(graph);
7809
- for (let len = models.length, i = 0; i < len; i++) {
7810
- const toModel = models[i];
7811
- const node = graph[toModel];
7812
- if (node.parent === null) {
7813
- continue;
7814
- }
7815
- conversion[toModel] = wrapConversion(toModel, graph);
7816
- }
7817
- return conversion;
7818
- };
7819
- return route;
7820
- }
7821
- var colorConvert;
7822
- var hasRequiredColorConvert;
7823
- function requireColorConvert() {
7824
- if (hasRequiredColorConvert)
7825
- return colorConvert;
7826
- hasRequiredColorConvert = 1;
7827
- const conversions2 = requireConversions();
7828
- const route2 = requireRoute();
7829
- const convert = {};
7830
- const models = Object.keys(conversions2);
7831
- function wrapRaw(fn) {
7832
- const wrappedFn = function(...args) {
7833
- const arg0 = args[0];
7834
- if (arg0 === void 0 || arg0 === null) {
7835
- return arg0;
7836
- }
7837
- if (arg0.length > 1) {
7838
- args = arg0;
7839
- }
7840
- return fn(args);
7841
- };
7842
- if ("conversion" in fn) {
7843
- wrappedFn.conversion = fn.conversion;
7844
- }
7845
- return wrappedFn;
7846
- }
7847
- function wrapRounded(fn) {
7848
- const wrappedFn = function(...args) {
7849
- const arg0 = args[0];
7850
- if (arg0 === void 0 || arg0 === null) {
7851
- return arg0;
7852
- }
7853
- if (arg0.length > 1) {
7854
- args = arg0;
7855
- }
7856
- const result = fn(args);
7857
- if (typeof result === "object") {
7858
- for (let len = result.length, i = 0; i < len; i++) {
7859
- result[i] = Math.round(result[i]);
7860
- }
7861
- }
7862
- return result;
7863
- };
7864
- if ("conversion" in fn) {
7865
- wrappedFn.conversion = fn.conversion;
7866
- }
7867
- return wrappedFn;
7868
- }
7869
- models.forEach((fromModel) => {
7870
- convert[fromModel] = {};
7871
- Object.defineProperty(convert[fromModel], "channels", { value: conversions2[fromModel].channels });
7872
- Object.defineProperty(convert[fromModel], "labels", { value: conversions2[fromModel].labels });
7873
- const routes = route2(fromModel);
7874
- const routeModels = Object.keys(routes);
7875
- routeModels.forEach((toModel) => {
7876
- const fn = routes[toModel];
7877
- convert[fromModel][toModel] = wrapRounded(fn);
7878
- convert[fromModel][toModel].raw = wrapRaw(fn);
7879
- });
7880
- });
7881
- colorConvert = convert;
7882
- return colorConvert;
7883
- }
7884
- ansiStyles$1.exports;
7885
- (function(module2) {
7886
- const wrapAnsi16 = (fn, offset) => (...args) => {
7887
- const code = fn(...args);
7888
- return `\x1B[${code + offset}m`;
7889
- };
7890
- const wrapAnsi256 = (fn, offset) => (...args) => {
7891
- const code = fn(...args);
7892
- return `\x1B[${38 + offset};5;${code}m`;
7893
- };
7894
- const wrapAnsi16m = (fn, offset) => (...args) => {
7895
- const rgb = fn(...args);
7896
- return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
7897
- };
7898
- const ansi2ansi = (n) => n;
7899
- const rgb2rgb = (r, g, b) => [r, g, b];
7900
- const setLazyProperty = (object, property, get) => {
7901
- Object.defineProperty(object, property, {
7902
- get: () => {
7903
- const value = get();
7904
- Object.defineProperty(object, property, {
7905
- value,
7906
- enumerable: true,
7907
- configurable: true
7908
- });
7909
- return value;
7910
- },
7911
- enumerable: true,
7912
- configurable: true
7913
- });
7914
- };
7915
- let colorConvert2;
7916
- const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
7917
- if (colorConvert2 === void 0) {
7918
- colorConvert2 = requireColorConvert();
7919
- }
7920
- const offset = isBackground ? 10 : 0;
7921
- const styles2 = {};
7922
- for (const [sourceSpace, suite] of Object.entries(colorConvert2)) {
7923
- const name2 = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
7924
- if (sourceSpace === targetSpace) {
7925
- styles2[name2] = wrap(identity, offset);
7926
- } else if (typeof suite === "object") {
7927
- styles2[name2] = wrap(suite[targetSpace], offset);
7928
- }
7929
- }
7930
- return styles2;
7931
- };
7932
- function assembleStyles() {
7933
- const codes = /* @__PURE__ */ new Map();
7934
- const styles2 = {
7935
- modifier: {
7936
- reset: [0, 0],
7937
- // 21 isn't widely supported and 22 does the same thing
7938
- bold: [1, 22],
7939
- dim: [2, 22],
7940
- italic: [3, 23],
7941
- underline: [4, 24],
7942
- inverse: [7, 27],
7943
- hidden: [8, 28],
7944
- strikethrough: [9, 29]
7945
- },
7946
- color: {
7947
- black: [30, 39],
7948
- red: [31, 39],
7949
- green: [32, 39],
7950
- yellow: [33, 39],
7951
- blue: [34, 39],
7952
- magenta: [35, 39],
7953
- cyan: [36, 39],
7954
- white: [37, 39],
7955
- // Bright color
7956
- blackBright: [90, 39],
7957
- redBright: [91, 39],
7958
- greenBright: [92, 39],
7959
- yellowBright: [93, 39],
7960
- blueBright: [94, 39],
7961
- magentaBright: [95, 39],
7962
- cyanBright: [96, 39],
7963
- whiteBright: [97, 39]
7964
- },
7965
- bgColor: {
7966
- bgBlack: [40, 49],
7967
- bgRed: [41, 49],
7968
- bgGreen: [42, 49],
7969
- bgYellow: [43, 49],
7970
- bgBlue: [44, 49],
7971
- bgMagenta: [45, 49],
7972
- bgCyan: [46, 49],
7973
- bgWhite: [47, 49],
7974
- // Bright color
7975
- bgBlackBright: [100, 49],
7976
- bgRedBright: [101, 49],
7977
- bgGreenBright: [102, 49],
7978
- bgYellowBright: [103, 49],
7979
- bgBlueBright: [104, 49],
7980
- bgMagentaBright: [105, 49],
7981
- bgCyanBright: [106, 49],
7982
- bgWhiteBright: [107, 49]
7983
- }
7984
- };
7985
- styles2.color.gray = styles2.color.blackBright;
7986
- styles2.bgColor.bgGray = styles2.bgColor.bgBlackBright;
7987
- styles2.color.grey = styles2.color.blackBright;
7988
- styles2.bgColor.bgGrey = styles2.bgColor.bgBlackBright;
7989
- for (const [groupName, group] of Object.entries(styles2)) {
7990
- for (const [styleName, style] of Object.entries(group)) {
7991
- styles2[styleName] = {
7992
- open: `\x1B[${style[0]}m`,
7993
- close: `\x1B[${style[1]}m`
7994
- };
7995
- group[styleName] = styles2[styleName];
7996
- codes.set(style[0], style[1]);
7997
- }
7998
- Object.defineProperty(styles2, groupName, {
7999
- value: group,
8000
- enumerable: false
8001
- });
8002
- }
8003
- Object.defineProperty(styles2, "codes", {
8004
- value: codes,
8005
- enumerable: false
8006
- });
8007
- styles2.color.close = "\x1B[39m";
8008
- styles2.bgColor.close = "\x1B[49m";
8009
- setLazyProperty(styles2.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
8010
- setLazyProperty(styles2.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
8011
- setLazyProperty(styles2.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
8012
- setLazyProperty(styles2.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
8013
- setLazyProperty(styles2.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
8014
- setLazyProperty(styles2.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
8015
- return styles2;
8016
- }
8017
- Object.defineProperty(module2, "exports", {
8018
- enumerable: true,
8019
- get: assembleStyles
8020
- });
8021
- })(ansiStyles$1);
8022
- var ansiStylesExports = ansiStyles$1.exports;
8023
- var browser = {
8024
- stdout: false,
8025
- stderr: false
8026
- };
8027
- const stringReplaceAll$1 = (string, substring, replacer) => {
8028
- let index = string.indexOf(substring);
8029
- if (index === -1) {
8030
- return string;
8031
- }
8032
- const substringLength = substring.length;
8033
- let endIndex = 0;
8034
- let returnValue = "";
8035
- do {
8036
- returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
8037
- endIndex = index + substringLength;
8038
- index = string.indexOf(substring, endIndex);
8039
- } while (index !== -1);
8040
- returnValue += string.substr(endIndex);
8041
- return returnValue;
8042
- };
8043
- const stringEncaseCRLFWithFirstIndex$1 = (string, prefix, postfix, index) => {
8044
- let endIndex = 0;
8045
- let returnValue = "";
8046
- do {
8047
- const gotCR = string[index - 1] === "\r";
8048
- returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
8049
- endIndex = index + 1;
8050
- index = string.indexOf("\n", endIndex);
8051
- } while (index !== -1);
8052
- returnValue += string.substr(endIndex);
8053
- return returnValue;
8054
- };
8055
- var util = {
8056
- stringReplaceAll: stringReplaceAll$1,
8057
- stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex$1
8058
- };
8059
- var templates;
8060
- var hasRequiredTemplates;
8061
- function requireTemplates() {
8062
- if (hasRequiredTemplates)
8063
- return templates;
8064
- hasRequiredTemplates = 1;
8065
- 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;
8066
- const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
8067
- const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
8068
- const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
8069
- const ESCAPES = /* @__PURE__ */ new Map([
8070
- ["n", "\n"],
8071
- ["r", "\r"],
8072
- ["t", " "],
8073
- ["b", "\b"],
8074
- ["f", "\f"],
8075
- ["v", "\v"],
8076
- ["0", "\0"],
8077
- ["\\", "\\"],
8078
- ["e", "\x1B"],
8079
- ["a", "\x07"]
8080
- ]);
8081
- function unescape(c) {
8082
- const u = c[0] === "u";
8083
- const bracket = c[1] === "{";
8084
- if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) {
8085
- return String.fromCharCode(parseInt(c.slice(1), 16));
8086
- }
8087
- if (u && bracket) {
8088
- return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
8089
- }
8090
- return ESCAPES.get(c) || c;
8091
- }
8092
- function parseArguments(name2, arguments_) {
8093
- const results = [];
8094
- const chunks = arguments_.trim().split(/\s*,\s*/g);
8095
- let matches;
8096
- for (const chunk of chunks) {
8097
- const number = Number(chunk);
8098
- if (!Number.isNaN(number)) {
8099
- results.push(number);
8100
- } else if (matches = chunk.match(STRING_REGEX)) {
8101
- results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
8102
- } else {
8103
- throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name2}')`);
8104
- }
8105
- }
8106
- return results;
8107
- }
8108
- function parseStyle(style) {
8109
- STYLE_REGEX.lastIndex = 0;
8110
- const results = [];
8111
- let matches;
8112
- while ((matches = STYLE_REGEX.exec(style)) !== null) {
8113
- const name2 = matches[1];
8114
- if (matches[2]) {
8115
- const args = parseArguments(name2, matches[2]);
8116
- results.push([name2].concat(args));
8117
- } else {
8118
- results.push([name2]);
8119
- }
8120
- }
8121
- return results;
8122
- }
8123
- function buildStyle(chalk2, styles2) {
8124
- const enabled = {};
8125
- for (const layer of styles2) {
8126
- for (const style of layer.styles) {
8127
- enabled[style[0]] = layer.inverse ? null : style.slice(1);
8128
- }
8129
- }
8130
- let current = chalk2;
8131
- for (const [styleName, styles3] of Object.entries(enabled)) {
8132
- if (!Array.isArray(styles3)) {
8133
- continue;
8134
- }
8135
- if (!(styleName in current)) {
8136
- throw new Error(`Unknown Chalk style: ${styleName}`);
8137
- }
8138
- current = styles3.length > 0 ? current[styleName](...styles3) : current[styleName];
8139
- }
8140
- return current;
8141
- }
8142
- templates = (chalk2, temporary) => {
8143
- const styles2 = [];
8144
- const chunks = [];
8145
- let chunk = [];
8146
- temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
8147
- if (escapeCharacter) {
8148
- chunk.push(unescape(escapeCharacter));
8149
- } else if (style) {
8150
- const string = chunk.join("");
8151
- chunk = [];
8152
- chunks.push(styles2.length === 0 ? string : buildStyle(chalk2, styles2)(string));
8153
- styles2.push({ inverse, styles: parseStyle(style) });
8154
- } else if (close) {
8155
- if (styles2.length === 0) {
8156
- throw new Error("Found extraneous } in Chalk template literal");
8157
- }
8158
- chunks.push(buildStyle(chalk2, styles2)(chunk.join("")));
8159
- chunk = [];
8160
- styles2.pop();
8161
- } else {
8162
- chunk.push(character);
8163
- }
8164
- });
8165
- chunks.push(chunk.join(""));
8166
- if (styles2.length > 0) {
8167
- const errMessage = `Chalk template literal is missing ${styles2.length} closing bracket${styles2.length === 1 ? "" : "s"} (\`}\`)`;
8168
- throw new Error(errMessage);
8169
- }
8170
- return chunks.join("");
8171
- };
8172
- return templates;
8173
- }
8174
- const ansiStyles = ansiStylesExports;
8175
- const { stdout: stdoutColor, stderr: stderrColor } = browser;
8176
- const {
8177
- stringReplaceAll,
8178
- stringEncaseCRLFWithFirstIndex
8179
- } = util;
8180
- const { isArray } = Array;
8181
- const levelMapping = [
8182
- "ansi",
8183
- "ansi",
8184
- "ansi256",
8185
- "ansi16m"
8186
- ];
8187
- const styles = /* @__PURE__ */ Object.create(null);
8188
- const applyOptions = (object, options = {}) => {
8189
- if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
8190
- throw new Error("The `level` option should be an integer from 0 to 3");
8191
- }
8192
- const colorLevel = stdoutColor ? stdoutColor.level : 0;
8193
- object.level = options.level === void 0 ? colorLevel : options.level;
8194
- };
8195
- class ChalkClass {
8196
- constructor(options) {
8197
- return chalkFactory(options);
8198
- }
8199
- }
8200
- const chalkFactory = (options) => {
8201
- const chalk2 = {};
8202
- applyOptions(chalk2, options);
8203
- chalk2.template = (...arguments_) => chalkTag(chalk2.template, ...arguments_);
8204
- Object.setPrototypeOf(chalk2, Chalk.prototype);
8205
- Object.setPrototypeOf(chalk2.template, chalk2);
8206
- chalk2.template.constructor = () => {
8207
- throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
8208
- };
8209
- chalk2.template.Instance = ChalkClass;
8210
- return chalk2.template;
8211
- };
8212
- function Chalk(options) {
8213
- return chalkFactory(options);
8214
- }
8215
- for (const [styleName, style] of Object.entries(ansiStyles)) {
8216
- styles[styleName] = {
8217
- get() {
8218
- const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
8219
- Object.defineProperty(this, styleName, { value: builder });
8220
- return builder;
8221
- }
8222
- };
8223
- }
8224
- styles.visible = {
8225
- get() {
8226
- const builder = createBuilder(this, this._styler, true);
8227
- Object.defineProperty(this, "visible", { value: builder });
8228
- return builder;
8229
- }
8230
- };
8231
- const usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
8232
- for (const model of usedModels) {
8233
- styles[model] = {
8234
- get() {
8235
- const { level } = this;
8236
- return function(...arguments_) {
8237
- const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
8238
- return createBuilder(this, styler, this._isEmpty);
8239
- };
8240
- }
8241
- };
8242
- }
8243
- for (const model of usedModels) {
8244
- const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
8245
- styles[bgModel] = {
8246
- get() {
8247
- const { level } = this;
8248
- return function(...arguments_) {
8249
- const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
8250
- return createBuilder(this, styler, this._isEmpty);
8251
- };
8252
- }
8253
- };
8254
- }
8255
- const proto = Object.defineProperties(() => {
8256
- }, {
8257
- ...styles,
8258
- level: {
8259
- enumerable: true,
8260
- get() {
8261
- return this._generator.level;
8262
- },
8263
- set(level) {
8264
- this._generator.level = level;
8265
- }
8266
- }
8267
- });
8268
- const createStyler = (open, close, parent) => {
8269
- let openAll;
8270
- let closeAll;
8271
- if (parent === void 0) {
8272
- openAll = open;
8273
- closeAll = close;
8274
- } else {
8275
- openAll = parent.openAll + open;
8276
- closeAll = close + parent.closeAll;
8277
- }
8278
- return {
8279
- open,
8280
- close,
8281
- openAll,
8282
- closeAll,
8283
- parent
8284
- };
8285
- };
8286
- const createBuilder = (self2, _styler, _isEmpty) => {
8287
- const builder = (...arguments_) => {
8288
- if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
8289
- return applyStyle(builder, chalkTag(builder, ...arguments_));
8290
- }
8291
- return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
8292
- };
8293
- Object.setPrototypeOf(builder, proto);
8294
- builder._generator = self2;
8295
- builder._styler = _styler;
8296
- builder._isEmpty = _isEmpty;
8297
- return builder;
8298
- };
8299
- const applyStyle = (self2, string) => {
8300
- if (self2.level <= 0 || !string) {
8301
- return self2._isEmpty ? "" : string;
8302
- }
8303
- let styler = self2._styler;
8304
- if (styler === void 0) {
8305
- return string;
8306
- }
8307
- const { openAll, closeAll } = styler;
8308
- if (string.indexOf("\x1B") !== -1) {
8309
- while (styler !== void 0) {
8310
- string = stringReplaceAll(string, styler.close, styler.open);
8311
- styler = styler.parent;
8312
- }
8313
- }
8314
- const lfIndex = string.indexOf("\n");
8315
- if (lfIndex !== -1) {
8316
- string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
8317
- }
8318
- return openAll + string + closeAll;
8319
- };
8320
- let template;
8321
- const chalkTag = (chalk2, ...strings) => {
8322
- const [firstString] = strings;
8323
- if (!isArray(firstString) || !isArray(firstString.raw)) {
8324
- return strings.join(" ");
8325
- }
8326
- const arguments_ = strings.slice(1);
8327
- const parts = [firstString.raw[0]];
8328
- for (let i = 1; i < firstString.length; i++) {
8329
- parts.push(
8330
- String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"),
8331
- String(firstString.raw[i])
8332
- );
8333
- }
8334
- if (template === void 0) {
8335
- template = requireTemplates();
8336
- }
8337
- return template(chalk2, parts.join(""));
8338
- };
8339
- Object.defineProperties(Chalk.prototype, styles);
8340
- const chalk = Chalk();
8341
- chalk.supportsColor = stdoutColor;
8342
- chalk.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
8343
- chalk.stderr.supportsColor = stderrColor;
8344
- var source = chalk;
8345
- const chalk$1 = /* @__PURE__ */ getDefaultExportFromCjs(source);
8346
- const { accessSync, constants, readFileSync } = fs;
8347
- let envOptions = null;
8348
- function SetupConfig(envOptions2, logger) {
8349
- const envfile = process.env.STSENVFILE === void 0 ? "/.env" : process.env.STSENVFILE;
8350
- config_1({ path: envfile });
8351
- const defconfig = {
8352
- // Node runtime environment
8353
- isProduction: process.env.NODE_ENV === void 0 ? false : process.env.NODE_ENV === "production" ? true : false,
8354
- isTest: process.env.NODE_ENV === void 0 ? false : process.env.NODE_ENV === "test" ? true : false,
8355
- consoleLogErrors: process.env.CONSOLE_LOG_ERRORS === void 0 ? false : process.env.CONSOLE_LOG_ERRORS === "true" ? true : false,
8356
- dbuser: process.env.DB_USER === void 0 ? "postgres" : process.env.DB_USER,
8357
- dbpassword: process.env.DB_PASSWORD === void 0 ? "postgres" : process.env.DB_PASSWORD,
8358
- dbpasswordfile: process.env.DB_PASSWORD_FILE,
8359
- dbhost: process.env.DB_HOST === void 0 ? "localhost:5432" : process.env.DB_HOST,
8360
- database: process.env.DB_DATABASE === void 0 ? "stsrestmsdb01" : process.env.DB_DATABASE,
8361
- databaseUrl: process.env.DATABASE_URL,
8362
- databasescriptfolder: process.env.DB_SCRIPT_FOLDER === void 0 ? "/var/lib/sts/stsglobalresources/db-scripts" : process.env.DB_SCRIPT_FOLDER,
8363
- connectionString: "",
8364
- defaultDatabaseConnectionString: "",
8365
- logToFile: process.env.LOG_TO_FILE === void 0 ? false : process.env.LOG_TO_FILE === "true" ? true : false,
8366
- logFilePath: process.env.LOG_FILE_PATH === void 0 ? "/var/lib/sts" : process.env.LOG_FILE_PATH,
8367
- logFileFormat: process.env.LOG_FILE_FORMAT === void 0 ? "csv" : process.env.LOG_FILE_FORMAT,
8368
- poolSize: process.env.POOL_SIZE === void 0 ? 500 : parseInt(process.env.POOL_SIZE),
8369
- useCPUs: process.env.MAX_CPU === void 0 ? -1 : parseFloat(process.env.MAX_CPU),
8370
- respawnOnFail: process.env.RESPAWN === void 0 ? false : process.env.RESPAWN === "true" ? true : false,
8371
- defaultDatabaseEntries: process.env.DEFAULT_DB_ENTRIES === void 0 ? 1e4 : parseInt(process.env.DEFAULT_DB_ENTRIES),
8372
- useRedis: process.env.USE_REDIS === void 0 ? false : process.env.USE_REDIS === "true" ? true : false,
8373
- useL1Redis: process.env.USE_L1_REDIS === void 0 ? false : process.env.USE_L1_REDIS === "true" ? true : false,
8374
- useRedisAdaptor: process.env.USE_REDIS_ADAPTOR === void 0 ? false : process.env.USE_REDIS_ADAPTOR === "true" ? true : false,
8375
- redisAdaptorUrl: process.env.REDIS_ADAPTOR_URL === void 0 ? "redis://localhost:6379" : process.env.REDIS_ADAPTOR_URL,
8376
- useRedisInstrumentationTransport: process.env.USE_REDIS_INSTRUMENTATION_TRANSPORT === void 0 ? false : process.env.USE_REDIS_INSTRUMENTATION_TRANSPORT === "true" ? true : false,
8377
- redisInstrumentationTransportUrl: process.env.REDIS_INSTRUMENTATION_TRANSPORT_URL === void 0 ? "redis://localhost:6379" : process.env.REDIS_INSTRUMENTATION_TRANSPORT_URL,
8378
- endFlush: process.env.REDIS_END_FLUSH === void 0 ? false : process.env.REDIS_END_FLUSH === "true" ? true : false,
8379
- redisPort: process.env.REDIS_PORT === void 0 ? "6379" : process.env.REDIS_PORT,
8380
- redisServer: process.env.REDIS_SERVER === void 0 ? "localhost" : process.env.REDIS_SERVER,
8381
- k6ScriptPath: process.env.K6SCRIPTPATH === void 0 ? "." : process.env.K6SCRIPTPATH,
8382
- defaultDatabaseMinExtraDataSize: process.env.DEFAULT_DATABASE_MIN_EXTRA_DATA_SIZE === void 0 ? 0 : parseInt(process.env.DEFAULT_DATABASE_MIN_EXTRA_DATA_SIZE),
8383
- defaultDatabaseMaxExtraDataSize: process.env.DEFAULT_DATABASE_MAX_EXTRA_DATA_SIZE === void 0 ? 2e3 : parseInt(process.env.DEFAULT_DATABASE_MAX_EXTRA_DATA_SIZE),
8384
- rest01endpoint: process.env.REST01_ENDPOINT === void 0 ? "https://localhost" : process.env.REST01_ENDPOINT,
8385
- rest01hostport: process.env.REST01_HOST_PORT === void 0 ? "3003" : process.env.REST01_HOST_PORT,
8386
- rest01port: process.env.REST01_PORT === void 0 ? "3003" : process.env.REST01_PORT,
8387
- rest01apiroot: process.env.REST01_APIROOT === void 0 ? "/stsrest01/v1" : process.env.REST01_APIROOT,
8388
- rest01apiidentifier: process.env.REST01_API_IDENTIFIER,
8389
- rest01apiidentifierfile: process.env.REST01_API_IDENTIFIER_FILE,
8390
- rest01prometheussupport: process.env.REST01_PROM_SUPPORT === void 0 ? true : process.env.REST01_PROM_SUPPORT === "true" ? true : false,
8391
- rest01prometheusclusterport: process.env.REST01_PROM_CLUSTER_PORT === void 0 ? "3013" : process.env.REST01_PROM_CLUSTER_PORT,
8392
- rest01servicename: process.env.REST01_SERVICE_NAME === void 0 ? "STSRest01" : process.env.REST01_SERVICE_NAME,
8393
- rest01serviceversion: process.env.REST01_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.REST01_SERVICE_VERSION,
8394
- rest01clientid: process.env.REST01_CLIENT_ID,
8395
- rest01clientidfile: process.env.REST01_CLIENT_ID_FILE,
8396
- rest01clientsecret: process.env.REST01_CLIENT_SECRET,
8397
- rest01clientsecretfile: process.env.REST01_CLIENT_SECRET_FILE,
8398
- imendpoint: process.env.IM_ENDPOINT === void 0 ? "https://localhost" : process.env.IM_ENDPOINT,
8399
- imhostport: process.env.IM_HOST_PORT === void 0 ? "3001" : process.env.IM_HOST_PORT,
8400
- import: process.env.IM_PORT === void 0 ? "3001" : process.env.IM_PORT,
8401
- imapiroot: process.env.IM_APIROOT === void 0 ? "/stsinstrumentmanager/v1" : process.env.IM_APIROOT,
8402
- imapiidentifier: process.env.IM_API_IDENTIFIER,
8403
- imapiidentifierfile: process.env.IM_API_IDENTIFIER_FILE,
8404
- imprometheussupport: process.env.IM_PROM_SUPPORT === void 0 ? true : process.env.IM_PROM_SUPPORT === "true" ? true : false,
8405
- imprometheusclusterport: process.env.IM_PROM_CLUSTER_PORT === void 0 ? "3011" : process.env.IM_PROM_CLUSTER_PORT,
8406
- imservicename: process.env.IM_SERVICE_NAME === void 0 ? "STSInstrumentManager" : process.env.IM_SERVICE_NAME,
8407
- imserviceversion: process.env.IM_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.IM_SERVICE_VERSION,
8408
- imclientid: process.env.IM_CLIENT_ID,
8409
- imclientidfile: process.env.IM_CLIENT_ID_FILE,
8410
- imclientsecret: process.env.IM_CLIENT_SECRET,
8411
- imclientsecretfile: process.env.IM_CLIENT_SECRET_FILE,
8412
- toendpoint: process.env.TO_ENDPOINT === void 0 ? "https://localhost" : process.env.TO_ENDPOINT,
8413
- tohostport: process.env.TO_HOST_PORT === void 0 ? "3004" : process.env.TO_HOST_PORT,
8414
- toport: process.env.TO_PORT === void 0 ? "3004" : process.env.TO_PORT,
8415
- toapiroot: process.env.TO_APIROOT === void 0 ? "/ststestorchestrator/v1" : process.env.TO_APIROOT,
8416
- toapiidentifier: process.env.TO_API_IDENTIFIER,
8417
- toapiidentifierfile: process.env.TO_API_IDENTIFIER_FILE,
8418
- toprometheussupport: process.env.TO_PROM_SUPPORT === void 0 ? true : process.env.TO_PROM_SUPPORT === "true" ? true : false,
8419
- toprometheusclusterport: process.env.TO_PROM_CLUSTER_PORT === void 0 ? "3014" : process.env.TO_PROM_CLUSTER_PORT,
8420
- toservicename: process.env.TO_SERVICE_NAME === void 0 ? "STSTestOrchestrator" : process.env.TO_SERVICE_NAME,
8421
- toserviceversion: process.env.TO_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.TO_SERVICE_VERSION,
8422
- toclientid: process.env.TO_CLIENT_ID,
8423
- toclientidfile: process.env.TO_CLIENT_ID_FILE,
8424
- toclientsecret: process.env.TO_CLIENT_SECRET,
8425
- toclientsecretfile: process.env.TO_CLIENT_SECRET_FILE,
8426
- asendpoint: process.env.AS_ENDPOINT === void 0 ? "https://localhost" : process.env.AS_ENDPOINT,
8427
- ashostport: process.env.AS_HOST_PORT === void 0 ? "3002" : process.env.AS_HOST_PORT,
8428
- asport: process.env.AS_PORT === void 0 ? "3002" : process.env.AS_PORT,
8429
- asapiroot: process.env.AS_API_ROOT === void 0 ? "/stsauth/v1.0" : process.env.AS_API_ROOT,
8430
- asoauthapiroot: process.env.AS_OAUTH_API_ROOT === void 0 ? "/oauth2/v2.0" : process.env.AS_OAUTH_API_ROOT,
8431
- asadminapiroot: process.env.AS_ADMIN_API_ROOT === void 0 ? "/admin/v1.0" : process.env.AS_ADMIN_API_ROOT,
8432
- asapiidentifier: process.env.AS_API_IDENTIFIER === void 0 ? "https://stsmda.com.au/stsauthapi/v1.0/" : process.env.AS_API_IDENTIFIER,
8433
- asapiidentifierfile: process.env.AS_API_IDENTIFIER_FILE,
8434
- asoauthapiidentifier: process.env.AS_OAUTH_API_IDENTIFIER === void 0 ? "https://stsmda.com.au/stsauthoauthapi/v2.0/" : process.env.AS_OAUTH_API_IDENTIFIER,
8435
- asoauthapiidentifierfile: process.env.AS_OAUTH_API_IDENTIFIER_FILE,
8436
- asadminapiidentifier: process.env.AS_ADMIN_API_IDENTIFIER === void 0 ? "https://stsmda.com.au/stsauthadminapi/v1.0/" : process.env.AS_ADMIN_API_IDENTIFIER,
8437
- asadminapiidentifierfile: process.env.AS_ADMIN_API_IDENTIFIER_FILE,
8438
- asprometheussupport: process.env.AS_PROM_SUPPORT === void 0 ? true : process.env.AS_PROM_SUPPORT === "true" ? true : false,
8439
- asprometheusclusterport: process.env.AS_PROM_CLUSTER_PORT === void 0 ? "3012" : process.env.AS_PROM_CLUSTER_PORT,
8440
- asservicename: process.env.AS_SERVICE_NAME === void 0 ? "STSAuth" : process.env.AS_SERVICE_NAME,
8441
- asserviceversion: process.env.AS_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.AS_SERVICE_VERSION,
8442
- asclientid: process.env.AS_CLIENT_ID,
8443
- asclientidfile: process.env.AS_CLIENT_ID_FILE,
8444
- asclientsecret: process.env.AS_CLIENT_SECRET,
8445
- asclientsecretfile: process.env.AS_CLIENT_SECRET_FILE,
8446
- asjwksjsonpath: process.env.AS_JWKS_JSON_PATH === void 0 ? "/.well-known/jwks.json" : process.env.AS_JWKS_JSON_PATH,
8447
- asjwkskeyrotationtime: process.env.AS_JWKS_KEY_ROTATION_TIME === void 0 ? 86400 : parseInt(process.env.AS_JWKS_KEY_ROTATION_TIME),
8448
- asjwkskeypurgetimeoffset: process.env.AS_JWKS_KEY_PURGE_TIME_OFFSET === void 0 ? 300 : parseInt(process.env.AS_JWKS_KEY_PURGE_TIME_OFFSET),
8449
- asjwkskeycount: process.env.AS_JWKS_KEY_COUNT === void 0 ? 4 : parseInt(process.env.AS_JWKS_KEY_COUNT),
8450
- asaccesstokenexpire: process.env.AS_ACCESS_TOKEN_EXPIRE === void 0 ? 43200 : parseInt(process.env.AS_ACCESS_TOKEN_EXPIRE),
8451
- authorizeendpoint: process.env.AUTHORIZE_ENDPOINT === void 0 ? "https://localhost" : process.env.AUTHORIZE_ENDPOINT,
8452
- authorizeport: process.env.AUTHORIZE_PORT === void 0 ? "3010" : process.env.AUTHORIZE_PORT,
8453
- authorizeapiroot: process.env.AUTHORIZE_API_ROOT === void 0 ? "/stsa" : process.env.AUTHORIZE_API_ROOT,
8454
- authorizeapi: process.env.AUTHORIZE_API === void 0 ? "/authorize" : process.env.AUTHORIZE_API,
8455
- brokerendpoint: process.env.BROKER_ENDPOINT === void 0 ? "https://localhost" : process.env.BROKER_ENDPOINT,
8456
- brokerhostport: process.env.BROKER_HOST_PORT === void 0 ? "3006" : process.env.BROKER_HOST_PORT,
8457
- brokerport: process.env.BROKER_PORT === void 0 ? "3006" : process.env.BROKER_PORT,
8458
- brokerapiroot: process.env.BROKER_APIROOT === void 0 ? "/stsbroker/v1.0" : process.env.BROKER_APIROOT,
8459
- brokerapiidentifier: process.env.BROKER_API_IDENTIFIER,
8460
- brokerapiidentifierfile: process.env.BROKER_API_IDENTIFIER_FILE,
8461
- brokerprometheussupport: process.env.BROKER_PROM_SUPPORT === void 0 ? true : process.env.BROKER_PROM_SUPPORT === "true" ? true : false,
8462
- brokerprometheusclusterport: process.env.BROKER_PROM_CLUSTER_PORT === void 0 ? "3016" : process.env.BROKER_PROM_CLUSTER_PORT,
8463
- brokerservicename: process.env.BROKER_SERVICE_NAME === void 0 ? "STSBroker" : process.env.BROKER_SERVICE_NAME,
8464
- brokerserviceversion: process.env.BROKER_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.BROKER_SERVICE_VERSION,
8465
- brokerclientid: process.env.BROKER_CLIENT_ID,
8466
- brokerclientidfile: process.env.BROKER_CLIENT_ID_FILE,
8467
- brokerclientsecret: process.env.BROKER_CLIENT_SECRET,
8468
- brokerclientsecretfile: process.env.BROKER_CLIENT_SECRET_FILE,
8469
- trnendpoint: process.env.TRN_ENDPOINT === void 0 ? "https://localhost" : process.env.TRN_ENDPOINT,
8470
- trnhostport: process.env.TRN_HOST_PORT === void 0 ? "3007" : process.env.TRN_HOST_PORT,
8471
- trnport: process.env.TRN_PORT === void 0 ? "3007" : process.env.TRN_PORT,
8472
- trnapiroot: process.env.TRN_APIROOT === void 0 ? "/ststrn/v1.0" : process.env.TRN_APIROOT,
8473
- trnapiidentifier: process.env.TRN_API_IDENTIFIER,
8474
- trnapiidentifierfile: process.env.TRN_API_IDENTIFIER_FILE,
8475
- trnprometheussupport: process.env.TRN_PROM_SUPPORT === void 0 ? true : process.env.TRN_PROM_SUPPORT === "true" ? true : false,
8476
- trnprometheusclusterport: process.env.TRN_PROM_CLUSTER_PORT === void 0 ? "3017" : process.env.TRN_PROM_CLUSTER_PORT,
8477
- trnservicename: process.env.TRN_SERVICE_NAME === void 0 ? "STSTestRunnerNode" : process.env.TRN_SERVICE_NAME,
8478
- trnserviceversion: process.env.TRN_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.TRN_SERVICE_VERSION,
8479
- trnclientid: process.env.TRN_CLIENT_ID,
8480
- trnclientidfile: process.env.TRN_CLIENT_ID_FILE,
8481
- trnclientsecret: process.env.TRN_CLIENT_SECRET,
8482
- trnclientsecretfile: process.env.TRN_CLIENT_SECRET_FILE,
8483
- trncallbackuri: process.env.TRN_CALLBACK_URI === void 0 ? "https://localhost:3007/ststrn/v1.0/" : process.env.TRN_CALLBACK_URI,
8484
- trnautostartdelay: process.env.TRN_AUTO_START_DELAY === void 0 ? 0 : parseInt(process.env.TRN_AUTO_START_DELAY),
8485
- trnautostartconfig: process.env.TRN_AUTO_START_CONFIG === void 0 ? "" : process.env.TRN_AUTO_START_CONFIG,
8486
- trprometheussupport: process.env.TR_PROM_SUPPORT === void 0 ? true : process.env.TR_PROM_SUPPORT === "true" ? true : false,
8487
- trprometheusclusterport: process.env.TR_PROM_CLUSTER_PORT === void 0 ? "3015" : process.env.TR_PROM_CLUSTER_PORT,
8488
- trservicename: process.env.TR_SERVICE_NAME === void 0 ? "STSRestRunner" : process.env.TR_SERVICE_NAME,
8489
- trserviceversion: process.env.TR_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.TR_SERVICE_VERSION,
8490
- trclientid: process.env.TR_CLIENT_ID,
8491
- trclientidfile: process.env.TR_CLIENT_ID_FILE,
8492
- trclientsecret: process.env.TR_CLIENT_SECRET,
8493
- trclientsecretfile: process.env.TR_CLIENT_SECRET_FILE,
8494
- lambdaendpoint: process.env.LAMBDA_ENDPOINT === void 0 ? "https://localhost" : process.env.LAMBDA_ENDPOINT,
8495
- lambdahostport: process.env.LAMBDA_HOST_PORT === void 0 ? "3009" : process.env.LAMBDA_HOST_PORT,
8496
- lambdaport: process.env.LAMBDA_PORT === void 0 ? "3009" : process.env.LAMBDA_PORT,
8497
- lambdaapiroot: process.env.LAMBDA_APIROOT === void 0 ? "/stslambda/v1.0" : process.env.LAMBDA_APIROOT,
8498
- lambdaapiidentifier: process.env.LAMBDA_API_IDENTIFIER,
8499
- lambdaapiidentifierfile: process.env.LAMBDA_API_IDENTIFIER_FILE,
8500
- lambdaprometheussupport: process.env.LAMBDA_PROM_SUPPORT === void 0 ? true : process.env.LAMBDA_PROM_SUPPORT === "true" ? true : false,
8501
- lambdaprometheusclusterport: process.env.LAMBDA_PROM_CLUSTER_PORT === void 0 ? "3019" : process.env.LAMBDA_PROM_CLUSTER_PORT,
8502
- lambdaservicename: process.env.LAMBDA_SERVICE_NAME === void 0 ? "STSLambda" : process.env.LAMBDA_SERVICE_NAME,
8503
- lambdaserviceversion: process.env.LAMBDA_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.LAMBDA_SERVICE_VERSION,
8504
- lambdaclientid: process.env.LAMBDA_CLIENT_ID,
8505
- lambdaclientidfile: process.env.LAMBDA_CLIENT_ID_FILE,
8506
- lambdaclientsecret: process.env.LAMBDA_CLIENT_SECRET,
8507
- lambdaclientsecretfile: process.env.LAMBDA_CLIENT_SECRET_FILE,
8508
- publishinterval: process.env.PUBLISH_INTERVAL === void 0 ? 1e3 : parseInt(process.env.PUBLISH_INTERVAL),
8509
- publishtimeout: process.env.PUBLISH_TIMEOUT === void 0 ? 750 : parseInt(process.env.PUBLISH_TIMEOUT),
8510
- publishdebug: process.env.PUBLISH_DEBUG === void 0 ? false : process.env.PUBLISH_DEBUG === "true" ? true : false,
8511
- transport: process.env.TRANSPORT === void 0 ? "RESTAPI" : process.env.TRANSPORT,
8512
- useSecureCookies: process.env.USE_SECURE_COOKIES === void 0 ? false : process.env.USE_SECURE_COOKIES === "true" ? true : false,
8513
- keepAlive: process.env.KEEP_ALIVE === void 0 ? true : process.env.KEEP_ALIVE === "true" ? true : false,
8514
- maxSockets: process.env.MAX_SOCKETS === void 0 ? 10 : parseInt(process.env.MAX_SOCKETS),
8515
- maxTotalSockets: process.env.MAX_TOTAL_SOCKETS === void 0 ? 20 : parseInt(process.env.MAX_TOTAL_SOCKETS),
8516
- maxFreeSockets: process.env.MAX_FREE_SOCKETS === void 0 ? 256 : parseInt(process.env.MAX_FREE_SOCKETS),
8517
- timeout: process.env.TIMEOUT === void 0 ? 1e4 : parseInt(process.env.TIMEOUT),
8518
- maxPayloadSize: process.env.MAX_PAYLOAD_SIZE === void 0 ? "50mb" : process.env.MAX_PAYLOAD_SIZE,
8519
- instrumentationObservationInterval: process.env.INSTRUMENTATION_OBSERVATION_INTERVAL === void 0 ? 1e3 : parseInt(process.env.INSTRUMENTATION_OBSERVATION_INTERVAL),
8520
- instrumentationTimeWindow: process.env.INSTRUMENTATION_TIME_WINDOW === void 0 ? 600 : parseInt(process.env.INSTRUMENTATION_TIME_WINDOW),
8521
- authJWTAccessTokenTimeout: process.env.AUTH_JWT_ACCESS_TOKEN_TIMEOUT === void 0 ? 600 : parseInt(process.env.AUTH_JWT_ACCESS_TOKEN_TIMEOUT),
8522
- authJWTRefreshTokenTimeout: process.env.AUTH_JWT_REFRESH_TOKEN_TIMEOUT === void 0 ? 3600 * 24 : parseInt(process.env.AUTH_JWT_REFRESH_TOKEN_TIMEOUT),
8523
- authCookieTimeout: process.env.AUTH_COOKIE_TIMEOUT === void 0 ? 3600 * 24 : parseInt(process.env.AUTH_COOKIE_TIMEOUT),
8524
- masterProcessExitTime: process.env.MASTER_PROCESS_EXIT_TIME === void 0 ? 500 : parseInt(process.env.MASTER_PROCESS_EXIT_TIME),
8525
- childProcessExitTime: process.env.CHILD_PROCESS_EXIT_TIME === void 0 ? 500 : parseInt(process.env.CHILD_PROCESS_EXIT_TIME),
8526
- systemInformationInterval: process.env.SYSTEM_INFORMATION_INTERVAL === void 0 ? 1e3 : parseInt(process.env.SYSTEM_INFORMATION_INTERVAL),
8527
- ignoresocketio: process.env.IGNORE_SOCKETIO === void 0 ? true : process.env.IGNORE_SOCKETIO === "true" ? true : false,
8528
- httpsserverkeypath: process.env.HTTPS_SERVER_KEY_PATH === void 0 ? "/var/lib/sts/stsglobalresources/keys/server.key" : process.env.HTTPS_SERVER_KEY_PATH,
8529
- httpsservercertpath: process.env.HTTPS_SERVER_CERT_PATH === void 0 ? "/var/lib/sts/stsglobalresources/keys/server.cert" : process.env.HTTPS_SERVER_CERT_PATH,
8530
- tsjwkskeys: process.env.TS_JWKS_KEYS === void 0 ? 3 : parseInt(process.env.TS_JWKS_KEYS),
8531
- tsjwksstorepath: process.env.TS_JWKS_STORE_PATH === void 0 ? "/var/lib/sts/stsglobalresources/.stsauthprivate/jwks-private.json" : process.env.TS_JWKS_STORE_PATH,
8532
- tsjwksstorepathfile: process.env.TS_JWKS_STORE_PATH_FILE,
8533
- tsjwksstorepublicpath: process.env.TS_JWKS_STORE_PUBLIC_PATH === void 0 ? "/var/lib/sts/stsglobalresources/.well-known/jwks.json" : process.env.TS_JWKS_STORE_PUBLIC_PATH,
8534
- jwksAuthConfigCache: process.env.JWKS_AUTH_CONFIG_CACHE === void 0 ? true : process.env.JWKS_AUTH_CONFIG_CACHE === "true" ? true : false,
8535
- jwksAuthConfigCacheMaxEntries: process.env.JWKS_AUTH_CONFIG_CACHE_MAX_ENTRIES === void 0 ? 5 : parseInt(process.env.JWKS_AUTH_CONFIG_CACHE_MAX_ENTRIES),
8536
- jwksAuthConfigCacheMaxAge: process.env.JWKS_AUTH_CONFIG_CACHE_MAX_AGE === void 0 ? 6e5 : parseInt(process.env.JWKS_AUTH_CONFIG_CACHE_MAX_AGE),
8537
- jwksAuthConfigRateLimit: process.env.JWKS_AUTH_CONFIG_RATE_LIMIT === void 0 ? true : process.env.JWKS_AUTH_CONFIG_RATE_LIMIT === "true" ? true : false,
8538
- jwksAuthConfigRateLimitRequestsPerMinute: process.env.JWKS_AUTH_CONFIG_RATE_LIMIT_REQUESTS_PER_MINUTE === void 0 ? 10 : parseInt(process.env.JWKS_AUTH_CONFIG_RATE_LIMIT_REQUESTS_PER_MINUTE),
8539
- jwksAuthConfigTimeout: process.env.JWKS_AUTH_CONFIG_TIMEOUT === void 0 ? 3e4 : parseInt(process.env.JWKS_AUTH_CONFIG_TIMEOUT),
8540
- influxDB_APIToken: process.env.INFLUXDB_API_TOKEN === void 0 ? "password" : process.env.INFLUXDB_API_TOKEN,
8541
- influxDB_APITokenFile: process.env.INFLUXDB_API_TOKEN_FILE,
8542
- influxDB_Url: process.env.INFLUXDB_URL === void 0 ? "http://localhost:8086" : process.env.INFLUXDB_URL,
8543
- influxDB_Org: process.env.INFLUXDB_ORG === void 0 ? "my-org" : process.env.INFLUXDB_ORG,
8544
- influxDB_Bucket: process.env.INFLUXDB_BUCKET === void 0 ? "TestBucket01" : process.env.INFLUXDB_BUCKET,
8545
- influxDB_keepAlive: process.env.INFLUXDB_KEEP_ALIVE === void 0 ? true : process.env.INFLUXDB_KEEP_ALIVE === "true" ? true : false,
8546
- influxDB_maxSockets: process.env.INFLUXDB_MAX_SOCKETS === void 0 ? 10 : parseInt(process.env.INFLUXDB_MAX_SOCKETS),
8547
- influxDB_maxTotalSockets: process.env.INFLUXDB_MAX_TOTAL_SOCKETS === void 0 ? 20 : parseInt(process.env.INFLUXDB_MAX_TOTAL_SOCKETS),
8548
- influxDB_maxFreeSockets: process.env.INFLUXDB_MAX_FREE_SOCKETS === void 0 ? 256 : parseInt(process.env.INFLUXDB_MAX_FREE_SOCKETS),
8549
- influxDB_timeout: process.env.INFLUXDB_TIMEOUT === void 0 ? 1e4 : parseInt(process.env.INFLUXDB_TIMEOUT),
8550
- influxDB_rejectUnauthorized: process.env.INFLUXDB_REJECT_UNAUTHORIZED === void 0 ? true : process.env.INFLUXDB_REJECT_UNAUTHORIZED === "true" ? true : false,
8551
- influxDB_writeDataPointFlushTimeout: process.env.INFLUXDB_WRITE_DATA_POINT_FLUSH_TIMEOUT === void 0 ? 1e3 : parseInt(process.env.INFLUXDB_WRITE_DATA_POINT_FLUSH_TIMEOUT),
8552
- kafka_clientId: process.env.KAFKA_CLIENT_ID === void 0 ? "myclient" : process.env.KAFKA_CLIENT_ID,
8553
- kafka_brokers: process.env.KAFKA_BROKERS === void 0 ? "localhost:9092" : process.env.KAFKA_BROKERS,
8554
- kafka_admin_timeout: process.env.KAFKA_ADMIN_TIMEOUT === void 0 ? 5e3 : parseInt(process.env.KAFKA_ADMIN_TIMEOUT),
8555
- kafka_connection_timeout: process.env.KAFKA_CONNECTION_TIMEOUT === void 0 ? 5e3 : parseInt(process.env.KAFKA_CONNECTION_TIMEOUT),
8556
- kafka_request_timeout: process.env.KAFKA_REQUEST_TIMEOUT === void 0 ? 5e3 : parseInt(process.env.KAFKA_REQUEST_TIMEOUT),
8557
- kafka_log_level: process.env.KAFKA_LOG_LEVEL === void 0 ? "nothing" : process.env.KAFKA_LOG_LEVEL,
8558
- kafka_keep_alive: process.env.KAFKA_KEEP_ALIVE === void 0 ? 3e4 : parseInt(process.env.KAFKA_KEEP_ALIVE),
8559
- kafka_use_ssl: process.env.KAFKA_USE_SSL === void 0 ? false : process.env.KAFKA_USE_SSL === "true" ? true : false,
8560
- kafka_ssl_rejectUnauthorized: process.env.KAFKA_SSL_REJECT_UNAUTHORIZED === void 0 ? true : process.env.KAFKA_SSL_REJECT_UNAUTHORIZED === "true" ? true : false,
8561
- kafka_ssl_cafile: process.env.KAFKA_SSL_CAFILE === void 0 ? "/my/custom/ca.crt" : process.env.KAFKA_SSL_CAFILE,
8562
- kafka_ssl_keyfile: process.env.KAFKA_SSL_KEYFILE === void 0 ? "/my/custom/client-key.pem" : process.env.KAFKA_SSL_KEYFILE,
8563
- kafka_ssl_certfile: process.env.KAFKA_SSL_CERTFILE === void 0 ? "/my/custom/client-cert.pem" : process.env.KAFKA_SSL_CERTFILE,
8564
- kafka_consume_from_beginning: process.env.KAFKA_CONSUME_FROM_BEGINNING === void 0 ? true : process.env.KAFKA_CONSUME_FROM_BEGINNING === "true" ? true : false,
8565
- observabilityPublishMode: process.env.OBSERVABILITY_PUBLISH_MODE === void 0 ? "PROXY" : process.env.OBSERVABILITY_PUBLISH_MODE,
8566
- stsUiTermObservabilityConsumptionMode: process.env.STSUITERM_OBSERVABILITY_CONSUMPTION_MODE === void 0 ? "PROXY" : process.env.STSUITERM_OBSERVABILITY_CONSUMPTION_MODE
8567
- };
8568
- const ReadFile = (passwordFile) => {
8569
- try {
8570
- accessSync(passwordFile, constants.R_OK);
8571
- const data = readFileSync(passwordFile, "utf8");
8572
- if (logger)
8573
- logger.debug(chalk$1.green(`Successfully loaded password file: [${passwordFile}]`));
8574
- return data;
8575
- } catch (err) {
8576
- if (logger)
8577
- logger.debug(chalk$1.red(`Problem loading password file: [${passwordFile}], Error: [${err}]`));
8578
- return "";
8579
- }
8580
- };
8581
- const fileconfig = [
8582
- { fileprop: "dbpasswordfile", prop: "dbpassword" },
8583
- // API identifier file processing
8584
- { fileprop: "asapiidentifierfile", prop: "asapiidentifier" },
8585
- { fileprop: "asoauthapiidentifierfile", prop: "asoauthapiidentifier" },
8586
- { fileprop: "asadminapiidentifierfile", prop: "asadminapiidentifier" },
8587
- { fileprop: "rest01apiidentifierfile", prop: "rest01apiidentifier" },
8588
- { fileprop: "brokerapiidentifierfile", prop: "brokerapiidentifier" },
8589
- { fileprop: "toapiidentifierfile", prop: "toapiidentifier" },
8590
- { fileprop: "imapiidentifierfile", prop: "imapiidentifier" },
8591
- { fileprop: "trnapiidentifierfile", prop: "trnapiidentifier" },
8592
- { fileprop: "lambdaapiidentifierfile", prop: "lambdaapiidentifier" },
8593
- // Client ID file processing
8594
- { fileprop: "asclientidfile", prop: "asclientid" },
8595
- { fileprop: "rest01clientidfile", prop: "rest01clientid" },
8596
- { fileprop: "brokerclientidfile", prop: "brokerclientid" },
8597
- { fileprop: "toclientidfile", prop: "toclientid" },
8598
- { fileprop: "imclientidfile", prop: "imclientid" },
8599
- { fileprop: "trclientidfile", prop: "trclientid" },
8600
- { fileprop: "trnclientidfile", prop: "trnclientid" },
8601
- { fileprop: "lambdaclientidfile", prop: "lambdaclientid" },
8602
- // Client secret file processing
8603
- { fileprop: "asclientsecretfile", prop: "asclientsecret" },
8604
- { fileprop: "rest01clientsecretfile", prop: "rest01clientsecret" },
8605
- { fileprop: "brokerclientsecretfile", prop: "brokerclientsecret" },
8606
- { fileprop: "toclientsecretfile", prop: "toclientsecret" },
8607
- { fileprop: "imclientsecretfile", prop: "imclientsecret" },
8608
- { fileprop: "trclientsecretfile", prop: "trclientsecret" },
8609
- { fileprop: "trnclientsecretfile", prop: "trnclientsecret" },
8610
- { fileprop: "lambdaclientsecretfile", prop: "lambdaclientsecret" },
8611
- // JWKS secret file processing
8612
- { fileprop: "tsjwksstorepathfile", prop: "tsjwksstorepath" },
8613
- // InfluxDB file processing
8614
- { fileprop: "influxDB_APITokenFile", prop: "influxDB_APIToken" }
8615
- ];
8616
- fileconfig.forEach((v) => {
8617
- if (defconfig[v.fileprop] !== void 0) {
8618
- defconfig[v.prop] = ReadFile(defconfig[v.fileprop]);
8619
- }
8620
- });
8621
- for (const [key, val] of Object.entries(defconfig)) {
8622
- envOptions2[key] = val;
8623
- }
8624
- }
8625
- function $SetupOptions(envOptions2) {
8626
- SetupConfig(envOptions2);
8627
- const options = envOptions2;
8628
- const hosts = options.dbhost.split(",");
8629
- envOptions2.connectionString = hosts.map((host) => {
8630
- return `postgresql://${options.dbuser}:${options.dbpassword}@${host}/${options.database}`;
8631
- }).join(",");
8632
- envOptions2.defaultDatabaseConnectionString = hosts.map((host) => {
8633
- return `postgresql://${options.dbuser}:${options.dbpassword}@${host}/postgres`;
8634
- }).join(",");
8635
- }
8636
- function $Options() {
8637
- if (envOptions === null) {
8638
- envOptions = {};
8639
- $SetupOptions(envOptions);
8640
- }
8641
- return envOptions;
8642
- }
8643
- const goptions = $Options();
8644
- var influxDBDataType = /* @__PURE__ */ ((influxDBDataType2) => {
8645
- influxDBDataType2["intField"] = "intField";
8646
- influxDBDataType2["floatField"] = "floatField";
8647
- influxDBDataType2["stringField"] = "stringField";
8648
- return influxDBDataType2;
8649
- })(influxDBDataType || {});
8650
- const globalServiceDefinitions = {
8651
- coreFieldList: [
8652
- { fieldName: "requestCount", gauge: Gauge.REQUEST_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
8653
- { fieldName: "errorCount", gauge: Gauge.ERROR_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
8654
- { fieldName: "retryCount", gauge: Gauge.RETRY_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
8655
- { fieldName: "authenticationCount", gauge: Gauge.AUTHENTICATION_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
8656
- { fieldName: "authenticationErrorCount", gauge: Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
8657
- { fieldName: "authenticationRetryCount", gauge: Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
8658
- { fieldName: "velocity", gauge: Gauge.VELOCITY_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
8659
- {
8660
- fieldName: "activeRequestCount",
8661
- gauge: Gauge.ACTIVE_REQUEST_GAUGE,
8662
- instrumentProperty: "val",
8663
- dataType: "number",
8664
- timeSeriesIndex: true,
8665
- quantile: true,
8666
- influxdbDataType: "intField",
8667
- gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
8668
- instrumentOptions: {
8669
- interval: goptions.instrumentationObservationInterval,
8670
- sampleSize: goptions.instrumentationTimeWindow
8671
- }
8672
- },
8673
- { fieldName: "coreCount", gauge: Gauge.CORE_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
8674
- { fieldName: "rx", gauge: Gauge.NETWORK_RX_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
8675
- { fieldName: "tx", gauge: Gauge.NETWORK_TX_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
8676
- { fieldName: "timer", gauge: Gauge.TIMER_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_TIMER },
8677
- {
8678
- fieldName: "duration",
8679
- gauge: Gauge.DURATION_GAUGE,
8680
- instrumentProperty: "val",
8681
- dataType: "number",
8682
- timeSeriesIndex: true,
8683
- quantile: true,
8684
- influxdbDataType: "floatField",
8685
- gaugeType: GaugeTypes.INSTRUMENT_HISTOGRAM,
8686
- instrumentOptions: {
8687
- interval: goptions.instrumentationObservationInterval,
8688
- sampleSize: goptions.instrumentationTimeWindow
8689
- },
8690
- histo: [
8691
- { label: "B10", bucketLimit: 10 },
8692
- { label: "B20", bucketLimit: 20 },
8693
- { label: "B50", bucketLimit: 50 },
8694
- { label: "B100", bucketLimit: 100 },
8695
- { label: "B1000", bucketLimit: 1e3 },
8696
- { label: "B50000", bucketLimit: 5e4 },
8697
- { label: "BInfinity", bucketLimit: -1 }
8698
- ]
8699
- },
8700
- {
8701
- fieldName: "latency",
8702
- gauge: Gauge.LATENCY_GAUGE,
8703
- instrumentProperty: "val",
8704
- dataType: "number",
8705
- timeSeriesIndex: true,
8706
- quantile: true,
8707
- influxdbDataType: "floatField",
8708
- gaugeType: GaugeTypes.INSTRUMENT_HISTOGRAM,
8709
- instrumentOptions: {
8710
- interval: goptions.instrumentationObservationInterval,
8711
- sampleSize: goptions.instrumentationTimeWindow
8712
- },
8713
- histo: [
8714
- { label: "B10", bucketLimit: 10 },
8715
- { label: "B20", bucketLimit: 20 },
8716
- { label: "B50", bucketLimit: 50 },
8717
- { label: "B100", bucketLimit: 100 },
8718
- { label: "B1000", bucketLimit: 1e3 },
8719
- { label: "B50000", bucketLimit: 5e4 },
8720
- { label: "BInfinity", bucketLimit: -1 }
8721
- ]
8722
- }
8723
- ],
8724
- logFieldList: [
8725
- {
8726
- fieldName: "log",
8727
- gauge: Gauge.LOGGER,
8728
- instrumentProperty: "val",
8729
- dataType: "string",
8730
- timeSeriesIndex: false,
8731
- quantile: false,
8732
- influxdbDataType: "stringField",
8733
- gaugeType: GaugeTypes.INSTRUMENT_LOG,
8734
- instrumentOptions: {
8735
- consoleLogging: goptions.consoleLogging,
8736
- instrumentLogging: goptions.instrumentLogging
6620
+ ],
6621
+ logFieldList: [
6622
+ {
6623
+ fieldName: "log",
6624
+ gauge: Gauge.LOGGER,
6625
+ instrumentProperty: "val",
6626
+ dataType: "string",
6627
+ timeSeriesIndex: false,
6628
+ quantile: false,
6629
+ influxdbDataType: "stringField",
6630
+ gaugeType: GaugeTypes.INSTRUMENT_LOG,
6631
+ instrumentOptions: {
6632
+ consoleLogging,
6633
+ instrumentLogging
8737
6634
  }
8738
6635
  }
8739
6636
  ],
@@ -8766,8 +6663,8 @@ var __privateMethod = (obj, member, method) => {
8766
6663
  influxdbDataType: "floatField",
8767
6664
  gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
8768
6665
  instrumentOptions: {
8769
- interval: goptions.instrumentationObservationInterval,
8770
- sampleSize: goptions.instrumentationTimeWindow
6666
+ interval: instrumentationObservationInterval,
6667
+ sampleSize: instrumentationTimeWindow
8771
6668
  }
8772
6669
  },
8773
6670
  {
@@ -8780,8 +6677,8 @@ var __privateMethod = (obj, member, method) => {
8780
6677
  influxdbDataType: "intField",
8781
6678
  gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
8782
6679
  instrumentOptions: {
8783
- interval: goptions.instrumentationObservationInterval,
8784
- sampleSize: goptions.instrumentationTimeWindow
6680
+ interval: instrumentationObservationInterval,
6681
+ sampleSize: instrumentationTimeWindow
8785
6682
  }
8786
6683
  },
8787
6684
  { fieldName: "connectionPoolCount", gauge: Gauge.CONNECTION_POOL_TOTAL_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
@@ -8951,6 +6848,9 @@ var __privateMethod = (obj, member, method) => {
8951
6848
  } else {
8952
6849
  retVal.push([v.gauge, v.gaugeType]);
8953
6850
  }
6851
+ if (v.histo) {
6852
+ retVal.push([v.histoGaugeType, GaugeTypes.INSTRUMENT_HISTOGRAM]);
6853
+ }
8954
6854
  });
8955
6855
  return retVal;
8956
6856
  };