@nsshunt/stsoauth2plugin 1.0.155 → 1.0.156

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.
@@ -5,8 +5,8 @@ const wt = require("node:worker_threads");
5
5
  const stsutils = require("@nsshunt/stsutils");
6
6
  const stsvueutils = require("@nsshunt/stsvueutils");
7
7
  const pinia = require("pinia");
8
- const stsobservability = require("@nsshunt/stsobservability");
9
8
  const axios = require("axios");
9
+ const stsobservability = require("@nsshunt/stsobservability");
10
10
  const http = require("node:http");
11
11
  const https = require("node:https");
12
12
  function _interopNamespaceDefault(e) {
@@ -31,13 +31,13 @@ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof win
31
31
  function getDefaultExportFromCjs(x) {
32
32
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
33
33
  }
34
- var ansiStyles = { exports: {} };
35
- var colorName;
36
- var hasRequiredColorName;
37
- function requireColorName() {
38
- if (hasRequiredColorName) return colorName;
39
- hasRequiredColorName = 1;
40
- colorName = {
34
+ var ansiStyles$1 = { exports: {} };
35
+ var colorName$1;
36
+ var hasRequiredColorName$1;
37
+ function requireColorName$1() {
38
+ if (hasRequiredColorName$1) return colorName$1;
39
+ hasRequiredColorName$1 = 1;
40
+ colorName$1 = {
41
41
  "aliceblue": [240, 248, 255],
42
42
  "antiquewhite": [250, 235, 215],
43
43
  "aqua": [0, 255, 255],
@@ -187,14 +187,14 @@ function requireColorName() {
187
187
  "yellow": [255, 255, 0],
188
188
  "yellowgreen": [154, 205, 50]
189
189
  };
190
- return colorName;
190
+ return colorName$1;
191
191
  }
192
- var conversions;
193
- var hasRequiredConversions;
194
- function requireConversions() {
195
- if (hasRequiredConversions) return conversions;
196
- hasRequiredConversions = 1;
197
- const cssKeywords = requireColorName();
192
+ var conversions$1;
193
+ var hasRequiredConversions$1;
194
+ function requireConversions$1() {
195
+ if (hasRequiredConversions$1) return conversions$1;
196
+ hasRequiredConversions$1 = 1;
197
+ const cssKeywords = requireColorName$1();
198
198
  const reverseKeywords = {};
199
199
  for (const key of Object.keys(cssKeywords)) {
200
200
  reverseKeywords[cssKeywords[key]] = key;
@@ -216,7 +216,7 @@ function requireConversions() {
216
216
  apple: { channels: 3, labels: ["r16", "g16", "b16"] },
217
217
  gray: { channels: 1, labels: ["gray"] }
218
218
  };
219
- conversions = convert;
219
+ conversions$1 = convert;
220
220
  for (const model of Object.keys(convert)) {
221
221
  if (!("channels" in convert[model])) {
222
222
  throw new Error("missing channels property: " + model);
@@ -859,14 +859,14 @@ function requireConversions() {
859
859
  const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
860
860
  return [val / 255 * 100];
861
861
  };
862
- return conversions;
862
+ return conversions$1;
863
863
  }
864
- var route;
865
- var hasRequiredRoute;
866
- function requireRoute() {
867
- if (hasRequiredRoute) return route;
868
- hasRequiredRoute = 1;
869
- const conversions2 = requireConversions();
864
+ var route$1;
865
+ var hasRequiredRoute$1;
866
+ function requireRoute$1() {
867
+ if (hasRequiredRoute$1) return route$1;
868
+ hasRequiredRoute$1 = 1;
869
+ const conversions2 = requireConversions$1();
870
870
  function buildGraph() {
871
871
  const graph = {};
872
872
  const models = Object.keys(conversions2);
@@ -916,7 +916,7 @@ function requireRoute() {
916
916
  fn.conversion = path;
917
917
  return fn;
918
918
  }
919
- route = function(fromModel) {
919
+ route$1 = function(fromModel) {
920
920
  const graph = deriveBFS(fromModel);
921
921
  const conversion = {};
922
922
  const models = Object.keys(graph);
@@ -930,15 +930,15 @@ function requireRoute() {
930
930
  }
931
931
  return conversion;
932
932
  };
933
- return route;
933
+ return route$1;
934
934
  }
935
- var colorConvert;
936
- var hasRequiredColorConvert;
937
- function requireColorConvert() {
938
- if (hasRequiredColorConvert) return colorConvert;
939
- hasRequiredColorConvert = 1;
940
- const conversions2 = requireConversions();
941
- const route2 = requireRoute();
935
+ var colorConvert$1;
936
+ var hasRequiredColorConvert$1;
937
+ function requireColorConvert$1() {
938
+ if (hasRequiredColorConvert$1) return colorConvert$1;
939
+ hasRequiredColorConvert$1 = 1;
940
+ const conversions2 = requireConversions$1();
941
+ const route2 = requireRoute$1();
942
942
  const convert = {};
943
943
  const models = Object.keys(conversions2);
944
944
  function wrapRaw(fn) {
@@ -991,14 +991,14 @@ function requireColorConvert() {
991
991
  convert[fromModel][toModel].raw = wrapRaw(fn);
992
992
  });
993
993
  });
994
- colorConvert = convert;
995
- return colorConvert;
994
+ colorConvert$1 = convert;
995
+ return colorConvert$1;
996
996
  }
997
- ansiStyles.exports;
998
- var hasRequiredAnsiStyles;
999
- function requireAnsiStyles() {
1000
- if (hasRequiredAnsiStyles) return ansiStyles.exports;
1001
- hasRequiredAnsiStyles = 1;
997
+ ansiStyles$1.exports;
998
+ var hasRequiredAnsiStyles$1;
999
+ function requireAnsiStyles$1() {
1000
+ if (hasRequiredAnsiStyles$1) return ansiStyles$1.exports;
1001
+ hasRequiredAnsiStyles$1 = 1;
1002
1002
  (function(module2) {
1003
1003
  const wrapAnsi16 = (fn, offset) => (...args) => {
1004
1004
  const code = fn(...args);
@@ -1032,7 +1032,7 @@ function requireAnsiStyles() {
1032
1032
  let colorConvert2;
1033
1033
  const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
1034
1034
  if (colorConvert2 === void 0) {
1035
- colorConvert2 = requireColorConvert();
1035
+ colorConvert2 = requireColorConvert$1();
1036
1036
  }
1037
1037
  const offset = isBackground ? 10 : 0;
1038
1038
  const styles = {};
@@ -1135,25 +1135,25 @@ function requireAnsiStyles() {
1135
1135
  enumerable: true,
1136
1136
  get: assembleStyles
1137
1137
  });
1138
- })(ansiStyles);
1139
- return ansiStyles.exports;
1138
+ })(ansiStyles$1);
1139
+ return ansiStyles$1.exports;
1140
1140
  }
1141
- var browser;
1142
- var hasRequiredBrowser;
1143
- function requireBrowser() {
1144
- if (hasRequiredBrowser) return browser;
1145
- hasRequiredBrowser = 1;
1146
- browser = {
1141
+ var browser$1;
1142
+ var hasRequiredBrowser$1;
1143
+ function requireBrowser$1() {
1144
+ if (hasRequiredBrowser$1) return browser$1;
1145
+ hasRequiredBrowser$1 = 1;
1146
+ browser$1 = {
1147
1147
  stdout: false,
1148
1148
  stderr: false
1149
1149
  };
1150
- return browser;
1150
+ return browser$1;
1151
1151
  }
1152
- var util;
1153
- var hasRequiredUtil;
1154
- function requireUtil() {
1155
- if (hasRequiredUtil) return util;
1156
- hasRequiredUtil = 1;
1152
+ var util$1;
1153
+ var hasRequiredUtil$1;
1154
+ function requireUtil$1() {
1155
+ if (hasRequiredUtil$1) return util$1;
1156
+ hasRequiredUtil$1 = 1;
1157
1157
  const stringReplaceAll = (string, substring, replacer) => {
1158
1158
  let index = string.indexOf(substring);
1159
1159
  if (index === -1) {
@@ -1182,17 +1182,17 @@ function requireUtil() {
1182
1182
  returnValue += string.substr(endIndex);
1183
1183
  return returnValue;
1184
1184
  };
1185
- util = {
1185
+ util$1 = {
1186
1186
  stringReplaceAll,
1187
1187
  stringEncaseCRLFWithFirstIndex
1188
1188
  };
1189
- return util;
1189
+ return util$1;
1190
1190
  }
1191
- var templates;
1192
- var hasRequiredTemplates;
1193
- function requireTemplates() {
1194
- if (hasRequiredTemplates) return templates;
1195
- hasRequiredTemplates = 1;
1191
+ var templates$1;
1192
+ var hasRequiredTemplates$1;
1193
+ function requireTemplates$1() {
1194
+ if (hasRequiredTemplates$1) return templates$1;
1195
+ hasRequiredTemplates$1 = 1;
1196
1196
  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;
1197
1197
  const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
1198
1198
  const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
@@ -1270,7 +1270,7 @@ function requireTemplates() {
1270
1270
  }
1271
1271
  return current;
1272
1272
  }
1273
- templates = (chalk2, temporary) => {
1273
+ templates$1 = (chalk2, temporary) => {
1274
1274
  const styles = [];
1275
1275
  const chunks = [];
1276
1276
  let chunk = [];
@@ -1300,19 +1300,19 @@ function requireTemplates() {
1300
1300
  }
1301
1301
  return chunks.join("");
1302
1302
  };
1303
- return templates;
1303
+ return templates$1;
1304
1304
  }
1305
- var source;
1306
- var hasRequiredSource;
1307
- function requireSource() {
1308
- if (hasRequiredSource) return source;
1309
- hasRequiredSource = 1;
1310
- const ansiStyles2 = requireAnsiStyles();
1311
- const { stdout: stdoutColor, stderr: stderrColor } = requireBrowser();
1305
+ var source$1;
1306
+ var hasRequiredSource$1;
1307
+ function requireSource$1() {
1308
+ if (hasRequiredSource$1) return source$1;
1309
+ hasRequiredSource$1 = 1;
1310
+ const ansiStyles2 = requireAnsiStyles$1();
1311
+ const { stdout: stdoutColor, stderr: stderrColor } = requireBrowser$1();
1312
1312
  const {
1313
1313
  stringReplaceAll,
1314
1314
  stringEncaseCRLFWithFirstIndex
1315
- } = requireUtil();
1315
+ } = requireUtil$1();
1316
1316
  const { isArray } = Array;
1317
1317
  const levelMapping = [
1318
1318
  "ansi",
@@ -1468,7 +1468,7 @@ function requireSource() {
1468
1468
  );
1469
1469
  }
1470
1470
  if (template === void 0) {
1471
- template = requireTemplates();
1471
+ template = requireTemplates$1();
1472
1472
  }
1473
1473
  return template(chalk3, parts.join(""));
1474
1474
  };
@@ -1477,10 +1477,10 @@ function requireSource() {
1477
1477
  chalk2.supportsColor = stdoutColor;
1478
1478
  chalk2.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
1479
1479
  chalk2.stderr.supportsColor = stderrColor;
1480
- source = chalk2;
1481
- return source;
1480
+ source$1 = chalk2;
1481
+ return source$1;
1482
1482
  }
1483
- var sourceExports = requireSource();
1483
+ var sourceExports = requireSource$1();
1484
1484
  const chalk = /* @__PURE__ */ getDefaultExportFromCjs(sourceExports);
1485
1485
  const isNode = Object.prototype.toString.call(typeof process !== "undefined" ? process : 0) === "[object process]";
1486
1486
  var AuthorizeOptionsResponseType = /* @__PURE__ */ ((AuthorizeOptionsResponseType2) => {
@@ -1617,6 +1617,3258 @@ const STSOauth2Store = pinia.defineStore("__sts__STSOauth2Store", {
1617
1617
  }
1618
1618
  */
1619
1619
  });
1620
+ var tinyEmitter = { exports: {} };
1621
+ var hasRequiredTinyEmitter;
1622
+ function requireTinyEmitter() {
1623
+ if (hasRequiredTinyEmitter) return tinyEmitter.exports;
1624
+ hasRequiredTinyEmitter = 1;
1625
+ function E() {
1626
+ }
1627
+ E.prototype = {
1628
+ on: function(name, callback, ctx) {
1629
+ var e = this.e || (this.e = {});
1630
+ (e[name] || (e[name] = [])).push({
1631
+ fn: callback,
1632
+ ctx
1633
+ });
1634
+ return this;
1635
+ },
1636
+ once: function(name, callback, ctx) {
1637
+ var self2 = this;
1638
+ function listener() {
1639
+ self2.off(name, listener);
1640
+ callback.apply(ctx, arguments);
1641
+ }
1642
+ listener._ = callback;
1643
+ return this.on(name, listener, ctx);
1644
+ },
1645
+ emit: function(name) {
1646
+ var data = [].slice.call(arguments, 1);
1647
+ var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
1648
+ var i = 0;
1649
+ var len = evtArr.length;
1650
+ for (i; i < len; i++) {
1651
+ evtArr[i].fn.apply(evtArr[i].ctx, data);
1652
+ }
1653
+ return this;
1654
+ },
1655
+ off: function(name, callback) {
1656
+ var e = this.e || (this.e = {});
1657
+ var evts = e[name];
1658
+ var liveEvents = [];
1659
+ if (evts && callback) {
1660
+ for (var i = 0, len = evts.length; i < len; i++) {
1661
+ if (evts[i].fn !== callback && evts[i].fn._ !== callback)
1662
+ liveEvents.push(evts[i]);
1663
+ }
1664
+ }
1665
+ liveEvents.length ? e[name] = liveEvents : delete e[name];
1666
+ return this;
1667
+ }
1668
+ };
1669
+ tinyEmitter.exports = E;
1670
+ tinyEmitter.exports.TinyEmitter = E;
1671
+ return tinyEmitter.exports;
1672
+ }
1673
+ requireTinyEmitter();
1674
+ var lodash_clonedeep = { exports: {} };
1675
+ lodash_clonedeep.exports;
1676
+ var hasRequiredLodash_clonedeep;
1677
+ function requireLodash_clonedeep() {
1678
+ if (hasRequiredLodash_clonedeep) return lodash_clonedeep.exports;
1679
+ hasRequiredLodash_clonedeep = 1;
1680
+ (function(module2, exports$1) {
1681
+ var LARGE_ARRAY_SIZE = 200;
1682
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
1683
+ var MAX_SAFE_INTEGER = 9007199254740991;
1684
+ var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", promiseTag = "[object Promise]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", weakMapTag = "[object WeakMap]";
1685
+ var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
1686
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
1687
+ var reFlags = /\w*$/;
1688
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
1689
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
1690
+ var cloneableTags = {};
1691
+ cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
1692
+ cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
1693
+ var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
1694
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
1695
+ var root = freeGlobal || freeSelf || Function("return this")();
1696
+ var freeExports = exports$1 && !exports$1.nodeType && exports$1;
1697
+ var freeModule = freeExports && true && module2 && !module2.nodeType && module2;
1698
+ var moduleExports = freeModule && freeModule.exports === freeExports;
1699
+ function addMapEntry(map, pair) {
1700
+ map.set(pair[0], pair[1]);
1701
+ return map;
1702
+ }
1703
+ function addSetEntry(set, value) {
1704
+ set.add(value);
1705
+ return set;
1706
+ }
1707
+ function arrayEach(array, iteratee) {
1708
+ var index = -1, length = array ? array.length : 0;
1709
+ while (++index < length) {
1710
+ if (iteratee(array[index], index, array) === false) {
1711
+ break;
1712
+ }
1713
+ }
1714
+ return array;
1715
+ }
1716
+ function arrayPush(array, values) {
1717
+ var index = -1, length = values.length, offset = array.length;
1718
+ while (++index < length) {
1719
+ array[offset + index] = values[index];
1720
+ }
1721
+ return array;
1722
+ }
1723
+ function arrayReduce(array, iteratee, accumulator, initAccum) {
1724
+ var index = -1, length = array ? array.length : 0;
1725
+ while (++index < length) {
1726
+ accumulator = iteratee(accumulator, array[index], index, array);
1727
+ }
1728
+ return accumulator;
1729
+ }
1730
+ function baseTimes(n, iteratee) {
1731
+ var index = -1, result = Array(n);
1732
+ while (++index < n) {
1733
+ result[index] = iteratee(index);
1734
+ }
1735
+ return result;
1736
+ }
1737
+ function getValue(object, key) {
1738
+ return object == null ? void 0 : object[key];
1739
+ }
1740
+ function isHostObject(value) {
1741
+ var result = false;
1742
+ if (value != null && typeof value.toString != "function") {
1743
+ try {
1744
+ result = !!(value + "");
1745
+ } catch (e) {
1746
+ }
1747
+ }
1748
+ return result;
1749
+ }
1750
+ function mapToArray(map) {
1751
+ var index = -1, result = Array(map.size);
1752
+ map.forEach(function(value, key) {
1753
+ result[++index] = [key, value];
1754
+ });
1755
+ return result;
1756
+ }
1757
+ function overArg(func, transform) {
1758
+ return function(arg) {
1759
+ return func(transform(arg));
1760
+ };
1761
+ }
1762
+ function setToArray(set) {
1763
+ var index = -1, result = Array(set.size);
1764
+ set.forEach(function(value) {
1765
+ result[++index] = value;
1766
+ });
1767
+ return result;
1768
+ }
1769
+ var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype;
1770
+ var coreJsData = root["__core-js_shared__"];
1771
+ var maskSrcKey = (function() {
1772
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
1773
+ return uid ? "Symbol(src)_1." + uid : "";
1774
+ })();
1775
+ var funcToString = funcProto.toString;
1776
+ var hasOwnProperty = objectProto.hasOwnProperty;
1777
+ var objectToString = objectProto.toString;
1778
+ var reIsNative = RegExp(
1779
+ "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
1780
+ );
1781
+ var Buffer = moduleExports ? root.Buffer : void 0, Symbol2 = root.Symbol, Uint8Array2 = root.Uint8Array, getPrototype = overArg(Object.getPrototypeOf, Object), objectCreate = Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice;
1782
+ var nativeGetSymbols = Object.getOwnPropertySymbols, nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0, nativeKeys = overArg(Object.keys, Object);
1783
+ var DataView2 = getNative(root, "DataView"), Map2 = getNative(root, "Map"), Promise2 = getNative(root, "Promise"), Set = getNative(root, "Set"), WeakMap = getNative(root, "WeakMap"), nativeCreate = getNative(Object, "create");
1784
+ var dataViewCtorString = toSource(DataView2), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap);
1785
+ var symbolProto = Symbol2 ? Symbol2.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
1786
+ function Hash(entries) {
1787
+ var index = -1, length = entries ? entries.length : 0;
1788
+ this.clear();
1789
+ while (++index < length) {
1790
+ var entry = entries[index];
1791
+ this.set(entry[0], entry[1]);
1792
+ }
1793
+ }
1794
+ function hashClear() {
1795
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
1796
+ }
1797
+ function hashDelete(key) {
1798
+ return this.has(key) && delete this.__data__[key];
1799
+ }
1800
+ function hashGet(key) {
1801
+ var data = this.__data__;
1802
+ if (nativeCreate) {
1803
+ var result = data[key];
1804
+ return result === HASH_UNDEFINED ? void 0 : result;
1805
+ }
1806
+ return hasOwnProperty.call(data, key) ? data[key] : void 0;
1807
+ }
1808
+ function hashHas(key) {
1809
+ var data = this.__data__;
1810
+ return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
1811
+ }
1812
+ function hashSet(key, value) {
1813
+ var data = this.__data__;
1814
+ data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
1815
+ return this;
1816
+ }
1817
+ Hash.prototype.clear = hashClear;
1818
+ Hash.prototype["delete"] = hashDelete;
1819
+ Hash.prototype.get = hashGet;
1820
+ Hash.prototype.has = hashHas;
1821
+ Hash.prototype.set = hashSet;
1822
+ function ListCache(entries) {
1823
+ var index = -1, length = entries ? entries.length : 0;
1824
+ this.clear();
1825
+ while (++index < length) {
1826
+ var entry = entries[index];
1827
+ this.set(entry[0], entry[1]);
1828
+ }
1829
+ }
1830
+ function listCacheClear() {
1831
+ this.__data__ = [];
1832
+ }
1833
+ function listCacheDelete(key) {
1834
+ var data = this.__data__, index = assocIndexOf(data, key);
1835
+ if (index < 0) {
1836
+ return false;
1837
+ }
1838
+ var lastIndex = data.length - 1;
1839
+ if (index == lastIndex) {
1840
+ data.pop();
1841
+ } else {
1842
+ splice.call(data, index, 1);
1843
+ }
1844
+ return true;
1845
+ }
1846
+ function listCacheGet(key) {
1847
+ var data = this.__data__, index = assocIndexOf(data, key);
1848
+ return index < 0 ? void 0 : data[index][1];
1849
+ }
1850
+ function listCacheHas(key) {
1851
+ return assocIndexOf(this.__data__, key) > -1;
1852
+ }
1853
+ function listCacheSet(key, value) {
1854
+ var data = this.__data__, index = assocIndexOf(data, key);
1855
+ if (index < 0) {
1856
+ data.push([key, value]);
1857
+ } else {
1858
+ data[index][1] = value;
1859
+ }
1860
+ return this;
1861
+ }
1862
+ ListCache.prototype.clear = listCacheClear;
1863
+ ListCache.prototype["delete"] = listCacheDelete;
1864
+ ListCache.prototype.get = listCacheGet;
1865
+ ListCache.prototype.has = listCacheHas;
1866
+ ListCache.prototype.set = listCacheSet;
1867
+ function MapCache(entries) {
1868
+ var index = -1, length = entries ? entries.length : 0;
1869
+ this.clear();
1870
+ while (++index < length) {
1871
+ var entry = entries[index];
1872
+ this.set(entry[0], entry[1]);
1873
+ }
1874
+ }
1875
+ function mapCacheClear() {
1876
+ this.__data__ = {
1877
+ "hash": new Hash(),
1878
+ "map": new (Map2 || ListCache)(),
1879
+ "string": new Hash()
1880
+ };
1881
+ }
1882
+ function mapCacheDelete(key) {
1883
+ return getMapData(this, key)["delete"](key);
1884
+ }
1885
+ function mapCacheGet(key) {
1886
+ return getMapData(this, key).get(key);
1887
+ }
1888
+ function mapCacheHas(key) {
1889
+ return getMapData(this, key).has(key);
1890
+ }
1891
+ function mapCacheSet(key, value) {
1892
+ getMapData(this, key).set(key, value);
1893
+ return this;
1894
+ }
1895
+ MapCache.prototype.clear = mapCacheClear;
1896
+ MapCache.prototype["delete"] = mapCacheDelete;
1897
+ MapCache.prototype.get = mapCacheGet;
1898
+ MapCache.prototype.has = mapCacheHas;
1899
+ MapCache.prototype.set = mapCacheSet;
1900
+ function Stack(entries) {
1901
+ this.__data__ = new ListCache(entries);
1902
+ }
1903
+ function stackClear() {
1904
+ this.__data__ = new ListCache();
1905
+ }
1906
+ function stackDelete(key) {
1907
+ return this.__data__["delete"](key);
1908
+ }
1909
+ function stackGet(key) {
1910
+ return this.__data__.get(key);
1911
+ }
1912
+ function stackHas(key) {
1913
+ return this.__data__.has(key);
1914
+ }
1915
+ function stackSet(key, value) {
1916
+ var cache = this.__data__;
1917
+ if (cache instanceof ListCache) {
1918
+ var pairs = cache.__data__;
1919
+ if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
1920
+ pairs.push([key, value]);
1921
+ return this;
1922
+ }
1923
+ cache = this.__data__ = new MapCache(pairs);
1924
+ }
1925
+ cache.set(key, value);
1926
+ return this;
1927
+ }
1928
+ Stack.prototype.clear = stackClear;
1929
+ Stack.prototype["delete"] = stackDelete;
1930
+ Stack.prototype.get = stackGet;
1931
+ Stack.prototype.has = stackHas;
1932
+ Stack.prototype.set = stackSet;
1933
+ function arrayLikeKeys(value, inherited) {
1934
+ var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
1935
+ var length = result.length, skipIndexes = !!length;
1936
+ for (var key in value) {
1937
+ if (hasOwnProperty.call(value, key) && !(skipIndexes && (key == "length" || isIndex(key, length)))) {
1938
+ result.push(key);
1939
+ }
1940
+ }
1941
+ return result;
1942
+ }
1943
+ function assignValue(object, key, value) {
1944
+ var objValue = object[key];
1945
+ if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
1946
+ object[key] = value;
1947
+ }
1948
+ }
1949
+ function assocIndexOf(array, key) {
1950
+ var length = array.length;
1951
+ while (length--) {
1952
+ if (eq(array[length][0], key)) {
1953
+ return length;
1954
+ }
1955
+ }
1956
+ return -1;
1957
+ }
1958
+ function baseAssign(object, source2) {
1959
+ return object && copyObject(source2, keys(source2), object);
1960
+ }
1961
+ function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
1962
+ var result;
1963
+ if (customizer) {
1964
+ result = object ? customizer(value, key, object, stack) : customizer(value);
1965
+ }
1966
+ if (result !== void 0) {
1967
+ return result;
1968
+ }
1969
+ if (!isObject(value)) {
1970
+ return value;
1971
+ }
1972
+ var isArr = isArray(value);
1973
+ if (isArr) {
1974
+ result = initCloneArray(value);
1975
+ if (!isDeep) {
1976
+ return copyArray(value, result);
1977
+ }
1978
+ } else {
1979
+ var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
1980
+ if (isBuffer(value)) {
1981
+ return cloneBuffer(value, isDeep);
1982
+ }
1983
+ if (tag == objectTag || tag == argsTag || isFunc && !object) {
1984
+ if (isHostObject(value)) {
1985
+ return object ? value : {};
1986
+ }
1987
+ result = initCloneObject(isFunc ? {} : value);
1988
+ if (!isDeep) {
1989
+ return copySymbols(value, baseAssign(result, value));
1990
+ }
1991
+ } else {
1992
+ if (!cloneableTags[tag]) {
1993
+ return object ? value : {};
1994
+ }
1995
+ result = initCloneByTag(value, tag, baseClone, isDeep);
1996
+ }
1997
+ }
1998
+ stack || (stack = new Stack());
1999
+ var stacked = stack.get(value);
2000
+ if (stacked) {
2001
+ return stacked;
2002
+ }
2003
+ stack.set(value, result);
2004
+ if (!isArr) {
2005
+ var props = isFull ? getAllKeys(value) : keys(value);
2006
+ }
2007
+ arrayEach(props || value, function(subValue, key2) {
2008
+ if (props) {
2009
+ key2 = subValue;
2010
+ subValue = value[key2];
2011
+ }
2012
+ assignValue(result, key2, baseClone(subValue, isDeep, isFull, customizer, key2, value, stack));
2013
+ });
2014
+ return result;
2015
+ }
2016
+ function baseCreate(proto) {
2017
+ return isObject(proto) ? objectCreate(proto) : {};
2018
+ }
2019
+ function baseGetAllKeys(object, keysFunc, symbolsFunc) {
2020
+ var result = keysFunc(object);
2021
+ return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
2022
+ }
2023
+ function baseGetTag(value) {
2024
+ return objectToString.call(value);
2025
+ }
2026
+ function baseIsNative(value) {
2027
+ if (!isObject(value) || isMasked(value)) {
2028
+ return false;
2029
+ }
2030
+ var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
2031
+ return pattern.test(toSource(value));
2032
+ }
2033
+ function baseKeys(object) {
2034
+ if (!isPrototype(object)) {
2035
+ return nativeKeys(object);
2036
+ }
2037
+ var result = [];
2038
+ for (var key in Object(object)) {
2039
+ if (hasOwnProperty.call(object, key) && key != "constructor") {
2040
+ result.push(key);
2041
+ }
2042
+ }
2043
+ return result;
2044
+ }
2045
+ function cloneBuffer(buffer, isDeep) {
2046
+ if (isDeep) {
2047
+ return buffer.slice();
2048
+ }
2049
+ var result = new buffer.constructor(buffer.length);
2050
+ buffer.copy(result);
2051
+ return result;
2052
+ }
2053
+ function cloneArrayBuffer(arrayBuffer) {
2054
+ var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
2055
+ new Uint8Array2(result).set(new Uint8Array2(arrayBuffer));
2056
+ return result;
2057
+ }
2058
+ function cloneDataView(dataView, isDeep) {
2059
+ var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
2060
+ return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
2061
+ }
2062
+ function cloneMap(map, isDeep, cloneFunc) {
2063
+ var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);
2064
+ return arrayReduce(array, addMapEntry, new map.constructor());
2065
+ }
2066
+ function cloneRegExp(regexp) {
2067
+ var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
2068
+ result.lastIndex = regexp.lastIndex;
2069
+ return result;
2070
+ }
2071
+ function cloneSet(set, isDeep, cloneFunc) {
2072
+ var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);
2073
+ return arrayReduce(array, addSetEntry, new set.constructor());
2074
+ }
2075
+ function cloneSymbol(symbol) {
2076
+ return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
2077
+ }
2078
+ function cloneTypedArray(typedArray, isDeep) {
2079
+ var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
2080
+ return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
2081
+ }
2082
+ function copyArray(source2, array) {
2083
+ var index = -1, length = source2.length;
2084
+ array || (array = Array(length));
2085
+ while (++index < length) {
2086
+ array[index] = source2[index];
2087
+ }
2088
+ return array;
2089
+ }
2090
+ function copyObject(source2, props, object, customizer) {
2091
+ object || (object = {});
2092
+ var index = -1, length = props.length;
2093
+ while (++index < length) {
2094
+ var key = props[index];
2095
+ var newValue = void 0;
2096
+ assignValue(object, key, newValue === void 0 ? source2[key] : newValue);
2097
+ }
2098
+ return object;
2099
+ }
2100
+ function copySymbols(source2, object) {
2101
+ return copyObject(source2, getSymbols(source2), object);
2102
+ }
2103
+ function getAllKeys(object) {
2104
+ return baseGetAllKeys(object, keys, getSymbols);
2105
+ }
2106
+ function getMapData(map, key) {
2107
+ var data = map.__data__;
2108
+ return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
2109
+ }
2110
+ function getNative(object, key) {
2111
+ var value = getValue(object, key);
2112
+ return baseIsNative(value) ? value : void 0;
2113
+ }
2114
+ var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;
2115
+ var getTag = baseGetTag;
2116
+ if (DataView2 && getTag(new DataView2(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
2117
+ getTag = function(value) {
2118
+ var result = objectToString.call(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : void 0;
2119
+ if (ctorString) {
2120
+ switch (ctorString) {
2121
+ case dataViewCtorString:
2122
+ return dataViewTag;
2123
+ case mapCtorString:
2124
+ return mapTag;
2125
+ case promiseCtorString:
2126
+ return promiseTag;
2127
+ case setCtorString:
2128
+ return setTag;
2129
+ case weakMapCtorString:
2130
+ return weakMapTag;
2131
+ }
2132
+ }
2133
+ return result;
2134
+ };
2135
+ }
2136
+ function initCloneArray(array) {
2137
+ var length = array.length, result = array.constructor(length);
2138
+ if (length && typeof array[0] == "string" && hasOwnProperty.call(array, "index")) {
2139
+ result.index = array.index;
2140
+ result.input = array.input;
2141
+ }
2142
+ return result;
2143
+ }
2144
+ function initCloneObject(object) {
2145
+ return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
2146
+ }
2147
+ function initCloneByTag(object, tag, cloneFunc, isDeep) {
2148
+ var Ctor = object.constructor;
2149
+ switch (tag) {
2150
+ case arrayBufferTag:
2151
+ return cloneArrayBuffer(object);
2152
+ case boolTag:
2153
+ case dateTag:
2154
+ return new Ctor(+object);
2155
+ case dataViewTag:
2156
+ return cloneDataView(object, isDeep);
2157
+ case float32Tag:
2158
+ case float64Tag:
2159
+ case int8Tag:
2160
+ case int16Tag:
2161
+ case int32Tag:
2162
+ case uint8Tag:
2163
+ case uint8ClampedTag:
2164
+ case uint16Tag:
2165
+ case uint32Tag:
2166
+ return cloneTypedArray(object, isDeep);
2167
+ case mapTag:
2168
+ return cloneMap(object, isDeep, cloneFunc);
2169
+ case numberTag:
2170
+ case stringTag:
2171
+ return new Ctor(object);
2172
+ case regexpTag:
2173
+ return cloneRegExp(object);
2174
+ case setTag:
2175
+ return cloneSet(object, isDeep, cloneFunc);
2176
+ case symbolTag:
2177
+ return cloneSymbol(object);
2178
+ }
2179
+ }
2180
+ function isIndex(value, length) {
2181
+ length = length == null ? MAX_SAFE_INTEGER : length;
2182
+ return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
2183
+ }
2184
+ function isKeyable(value) {
2185
+ var type = typeof value;
2186
+ return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
2187
+ }
2188
+ function isMasked(func) {
2189
+ return !!maskSrcKey && maskSrcKey in func;
2190
+ }
2191
+ function isPrototype(value) {
2192
+ var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
2193
+ return value === proto;
2194
+ }
2195
+ function toSource(func) {
2196
+ if (func != null) {
2197
+ try {
2198
+ return funcToString.call(func);
2199
+ } catch (e) {
2200
+ }
2201
+ try {
2202
+ return func + "";
2203
+ } catch (e) {
2204
+ }
2205
+ }
2206
+ return "";
2207
+ }
2208
+ function cloneDeep(value) {
2209
+ return baseClone(value, true, true);
2210
+ }
2211
+ function eq(value, other) {
2212
+ return value === other || value !== value && other !== other;
2213
+ }
2214
+ function isArguments(value) {
2215
+ return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag);
2216
+ }
2217
+ var isArray = Array.isArray;
2218
+ function isArrayLike(value) {
2219
+ return value != null && isLength(value.length) && !isFunction(value);
2220
+ }
2221
+ function isArrayLikeObject(value) {
2222
+ return isObjectLike(value) && isArrayLike(value);
2223
+ }
2224
+ var isBuffer = nativeIsBuffer || stubFalse;
2225
+ function isFunction(value) {
2226
+ var tag = isObject(value) ? objectToString.call(value) : "";
2227
+ return tag == funcTag || tag == genTag;
2228
+ }
2229
+ function isLength(value) {
2230
+ return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
2231
+ }
2232
+ function isObject(value) {
2233
+ var type = typeof value;
2234
+ return !!value && (type == "object" || type == "function");
2235
+ }
2236
+ function isObjectLike(value) {
2237
+ return !!value && typeof value == "object";
2238
+ }
2239
+ function keys(object) {
2240
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
2241
+ }
2242
+ function stubArray() {
2243
+ return [];
2244
+ }
2245
+ function stubFalse() {
2246
+ return false;
2247
+ }
2248
+ module2.exports = cloneDeep;
2249
+ })(lodash_clonedeep, lodash_clonedeep.exports);
2250
+ return lodash_clonedeep.exports;
2251
+ }
2252
+ requireLodash_clonedeep();
2253
+ var SubscriptionTopic = /* @__PURE__ */ ((SubscriptionTopic2) => {
2254
+ SubscriptionTopic2["AllServicesCombined"] = "AllServicesCombined";
2255
+ SubscriptionTopic2["Services"] = "Services";
2256
+ SubscriptionTopic2["ServiceInstances"] = "ServiceInstances";
2257
+ SubscriptionTopic2["ServiceInstance"] = "ServiceInstance";
2258
+ SubscriptionTopic2["AllAgentsCombined"] = "AllAgentsCombined";
2259
+ SubscriptionTopic2["Agents"] = "Agents";
2260
+ SubscriptionTopic2["AgentWorkers"] = "AgentWorkers";
2261
+ SubscriptionTopic2["AgentWorker"] = "AgentWorker";
2262
+ SubscriptionTopic2["AllLambdasCombined"] = "AllLambdasCombined";
2263
+ SubscriptionTopic2["LambdaTechnologies"] = "LambdaTechnologies";
2264
+ SubscriptionTopic2["LambdaSubTechnologies"] = "LambdaSubTechnologies";
2265
+ SubscriptionTopic2["LambdaSubTechnologiesInstance"] = "LambdaSubTechnologiesInstance";
2266
+ SubscriptionTopic2["LogProcessing"] = "LogProcessing";
2267
+ return SubscriptionTopic2;
2268
+ })(SubscriptionTopic || {});
2269
+ var ansiStyles = { exports: {} };
2270
+ var colorName;
2271
+ var hasRequiredColorName;
2272
+ function requireColorName() {
2273
+ if (hasRequiredColorName) return colorName;
2274
+ hasRequiredColorName = 1;
2275
+ colorName = {
2276
+ "aliceblue": [240, 248, 255],
2277
+ "antiquewhite": [250, 235, 215],
2278
+ "aqua": [0, 255, 255],
2279
+ "aquamarine": [127, 255, 212],
2280
+ "azure": [240, 255, 255],
2281
+ "beige": [245, 245, 220],
2282
+ "bisque": [255, 228, 196],
2283
+ "black": [0, 0, 0],
2284
+ "blanchedalmond": [255, 235, 205],
2285
+ "blue": [0, 0, 255],
2286
+ "blueviolet": [138, 43, 226],
2287
+ "brown": [165, 42, 42],
2288
+ "burlywood": [222, 184, 135],
2289
+ "cadetblue": [95, 158, 160],
2290
+ "chartreuse": [127, 255, 0],
2291
+ "chocolate": [210, 105, 30],
2292
+ "coral": [255, 127, 80],
2293
+ "cornflowerblue": [100, 149, 237],
2294
+ "cornsilk": [255, 248, 220],
2295
+ "crimson": [220, 20, 60],
2296
+ "cyan": [0, 255, 255],
2297
+ "darkblue": [0, 0, 139],
2298
+ "darkcyan": [0, 139, 139],
2299
+ "darkgoldenrod": [184, 134, 11],
2300
+ "darkgray": [169, 169, 169],
2301
+ "darkgreen": [0, 100, 0],
2302
+ "darkgrey": [169, 169, 169],
2303
+ "darkkhaki": [189, 183, 107],
2304
+ "darkmagenta": [139, 0, 139],
2305
+ "darkolivegreen": [85, 107, 47],
2306
+ "darkorange": [255, 140, 0],
2307
+ "darkorchid": [153, 50, 204],
2308
+ "darkred": [139, 0, 0],
2309
+ "darksalmon": [233, 150, 122],
2310
+ "darkseagreen": [143, 188, 143],
2311
+ "darkslateblue": [72, 61, 139],
2312
+ "darkslategray": [47, 79, 79],
2313
+ "darkslategrey": [47, 79, 79],
2314
+ "darkturquoise": [0, 206, 209],
2315
+ "darkviolet": [148, 0, 211],
2316
+ "deeppink": [255, 20, 147],
2317
+ "deepskyblue": [0, 191, 255],
2318
+ "dimgray": [105, 105, 105],
2319
+ "dimgrey": [105, 105, 105],
2320
+ "dodgerblue": [30, 144, 255],
2321
+ "firebrick": [178, 34, 34],
2322
+ "floralwhite": [255, 250, 240],
2323
+ "forestgreen": [34, 139, 34],
2324
+ "fuchsia": [255, 0, 255],
2325
+ "gainsboro": [220, 220, 220],
2326
+ "ghostwhite": [248, 248, 255],
2327
+ "gold": [255, 215, 0],
2328
+ "goldenrod": [218, 165, 32],
2329
+ "gray": [128, 128, 128],
2330
+ "green": [0, 128, 0],
2331
+ "greenyellow": [173, 255, 47],
2332
+ "grey": [128, 128, 128],
2333
+ "honeydew": [240, 255, 240],
2334
+ "hotpink": [255, 105, 180],
2335
+ "indianred": [205, 92, 92],
2336
+ "indigo": [75, 0, 130],
2337
+ "ivory": [255, 255, 240],
2338
+ "khaki": [240, 230, 140],
2339
+ "lavender": [230, 230, 250],
2340
+ "lavenderblush": [255, 240, 245],
2341
+ "lawngreen": [124, 252, 0],
2342
+ "lemonchiffon": [255, 250, 205],
2343
+ "lightblue": [173, 216, 230],
2344
+ "lightcoral": [240, 128, 128],
2345
+ "lightcyan": [224, 255, 255],
2346
+ "lightgoldenrodyellow": [250, 250, 210],
2347
+ "lightgray": [211, 211, 211],
2348
+ "lightgreen": [144, 238, 144],
2349
+ "lightgrey": [211, 211, 211],
2350
+ "lightpink": [255, 182, 193],
2351
+ "lightsalmon": [255, 160, 122],
2352
+ "lightseagreen": [32, 178, 170],
2353
+ "lightskyblue": [135, 206, 250],
2354
+ "lightslategray": [119, 136, 153],
2355
+ "lightslategrey": [119, 136, 153],
2356
+ "lightsteelblue": [176, 196, 222],
2357
+ "lightyellow": [255, 255, 224],
2358
+ "lime": [0, 255, 0],
2359
+ "limegreen": [50, 205, 50],
2360
+ "linen": [250, 240, 230],
2361
+ "magenta": [255, 0, 255],
2362
+ "maroon": [128, 0, 0],
2363
+ "mediumaquamarine": [102, 205, 170],
2364
+ "mediumblue": [0, 0, 205],
2365
+ "mediumorchid": [186, 85, 211],
2366
+ "mediumpurple": [147, 112, 219],
2367
+ "mediumseagreen": [60, 179, 113],
2368
+ "mediumslateblue": [123, 104, 238],
2369
+ "mediumspringgreen": [0, 250, 154],
2370
+ "mediumturquoise": [72, 209, 204],
2371
+ "mediumvioletred": [199, 21, 133],
2372
+ "midnightblue": [25, 25, 112],
2373
+ "mintcream": [245, 255, 250],
2374
+ "mistyrose": [255, 228, 225],
2375
+ "moccasin": [255, 228, 181],
2376
+ "navajowhite": [255, 222, 173],
2377
+ "navy": [0, 0, 128],
2378
+ "oldlace": [253, 245, 230],
2379
+ "olive": [128, 128, 0],
2380
+ "olivedrab": [107, 142, 35],
2381
+ "orange": [255, 165, 0],
2382
+ "orangered": [255, 69, 0],
2383
+ "orchid": [218, 112, 214],
2384
+ "palegoldenrod": [238, 232, 170],
2385
+ "palegreen": [152, 251, 152],
2386
+ "paleturquoise": [175, 238, 238],
2387
+ "palevioletred": [219, 112, 147],
2388
+ "papayawhip": [255, 239, 213],
2389
+ "peachpuff": [255, 218, 185],
2390
+ "peru": [205, 133, 63],
2391
+ "pink": [255, 192, 203],
2392
+ "plum": [221, 160, 221],
2393
+ "powderblue": [176, 224, 230],
2394
+ "purple": [128, 0, 128],
2395
+ "rebeccapurple": [102, 51, 153],
2396
+ "red": [255, 0, 0],
2397
+ "rosybrown": [188, 143, 143],
2398
+ "royalblue": [65, 105, 225],
2399
+ "saddlebrown": [139, 69, 19],
2400
+ "salmon": [250, 128, 114],
2401
+ "sandybrown": [244, 164, 96],
2402
+ "seagreen": [46, 139, 87],
2403
+ "seashell": [255, 245, 238],
2404
+ "sienna": [160, 82, 45],
2405
+ "silver": [192, 192, 192],
2406
+ "skyblue": [135, 206, 235],
2407
+ "slateblue": [106, 90, 205],
2408
+ "slategray": [112, 128, 144],
2409
+ "slategrey": [112, 128, 144],
2410
+ "snow": [255, 250, 250],
2411
+ "springgreen": [0, 255, 127],
2412
+ "steelblue": [70, 130, 180],
2413
+ "tan": [210, 180, 140],
2414
+ "teal": [0, 128, 128],
2415
+ "thistle": [216, 191, 216],
2416
+ "tomato": [255, 99, 71],
2417
+ "turquoise": [64, 224, 208],
2418
+ "violet": [238, 130, 238],
2419
+ "wheat": [245, 222, 179],
2420
+ "white": [255, 255, 255],
2421
+ "whitesmoke": [245, 245, 245],
2422
+ "yellow": [255, 255, 0],
2423
+ "yellowgreen": [154, 205, 50]
2424
+ };
2425
+ return colorName;
2426
+ }
2427
+ var conversions;
2428
+ var hasRequiredConversions;
2429
+ function requireConversions() {
2430
+ if (hasRequiredConversions) return conversions;
2431
+ hasRequiredConversions = 1;
2432
+ const cssKeywords = requireColorName();
2433
+ const reverseKeywords = {};
2434
+ for (const key of Object.keys(cssKeywords)) {
2435
+ reverseKeywords[cssKeywords[key]] = key;
2436
+ }
2437
+ const convert = {
2438
+ rgb: { channels: 3, labels: "rgb" },
2439
+ hsl: { channels: 3, labels: "hsl" },
2440
+ hsv: { channels: 3, labels: "hsv" },
2441
+ hwb: { channels: 3, labels: "hwb" },
2442
+ cmyk: { channels: 4, labels: "cmyk" },
2443
+ xyz: { channels: 3, labels: "xyz" },
2444
+ lab: { channels: 3, labels: "lab" },
2445
+ lch: { channels: 3, labels: "lch" },
2446
+ hex: { channels: 1, labels: ["hex"] },
2447
+ keyword: { channels: 1, labels: ["keyword"] },
2448
+ ansi16: { channels: 1, labels: ["ansi16"] },
2449
+ ansi256: { channels: 1, labels: ["ansi256"] },
2450
+ hcg: { channels: 3, labels: ["h", "c", "g"] },
2451
+ apple: { channels: 3, labels: ["r16", "g16", "b16"] },
2452
+ gray: { channels: 1, labels: ["gray"] }
2453
+ };
2454
+ conversions = convert;
2455
+ for (const model of Object.keys(convert)) {
2456
+ if (!("channels" in convert[model])) {
2457
+ throw new Error("missing channels property: " + model);
2458
+ }
2459
+ if (!("labels" in convert[model])) {
2460
+ throw new Error("missing channel labels property: " + model);
2461
+ }
2462
+ if (convert[model].labels.length !== convert[model].channels) {
2463
+ throw new Error("channel and label counts mismatch: " + model);
2464
+ }
2465
+ const { channels, labels } = convert[model];
2466
+ delete convert[model].channels;
2467
+ delete convert[model].labels;
2468
+ Object.defineProperty(convert[model], "channels", { value: channels });
2469
+ Object.defineProperty(convert[model], "labels", { value: labels });
2470
+ }
2471
+ convert.rgb.hsl = function(rgb) {
2472
+ const r = rgb[0] / 255;
2473
+ const g = rgb[1] / 255;
2474
+ const b = rgb[2] / 255;
2475
+ const min = Math.min(r, g, b);
2476
+ const max = Math.max(r, g, b);
2477
+ const delta = max - min;
2478
+ let h;
2479
+ let s;
2480
+ if (max === min) {
2481
+ h = 0;
2482
+ } else if (r === max) {
2483
+ h = (g - b) / delta;
2484
+ } else if (g === max) {
2485
+ h = 2 + (b - r) / delta;
2486
+ } else if (b === max) {
2487
+ h = 4 + (r - g) / delta;
2488
+ }
2489
+ h = Math.min(h * 60, 360);
2490
+ if (h < 0) {
2491
+ h += 360;
2492
+ }
2493
+ const l = (min + max) / 2;
2494
+ if (max === min) {
2495
+ s = 0;
2496
+ } else if (l <= 0.5) {
2497
+ s = delta / (max + min);
2498
+ } else {
2499
+ s = delta / (2 - max - min);
2500
+ }
2501
+ return [h, s * 100, l * 100];
2502
+ };
2503
+ convert.rgb.hsv = function(rgb) {
2504
+ let rdif;
2505
+ let gdif;
2506
+ let bdif;
2507
+ let h;
2508
+ let s;
2509
+ const r = rgb[0] / 255;
2510
+ const g = rgb[1] / 255;
2511
+ const b = rgb[2] / 255;
2512
+ const v = Math.max(r, g, b);
2513
+ const diff = v - Math.min(r, g, b);
2514
+ const diffc = function(c) {
2515
+ return (v - c) / 6 / diff + 1 / 2;
2516
+ };
2517
+ if (diff === 0) {
2518
+ h = 0;
2519
+ s = 0;
2520
+ } else {
2521
+ s = diff / v;
2522
+ rdif = diffc(r);
2523
+ gdif = diffc(g);
2524
+ bdif = diffc(b);
2525
+ if (r === v) {
2526
+ h = bdif - gdif;
2527
+ } else if (g === v) {
2528
+ h = 1 / 3 + rdif - bdif;
2529
+ } else if (b === v) {
2530
+ h = 2 / 3 + gdif - rdif;
2531
+ }
2532
+ if (h < 0) {
2533
+ h += 1;
2534
+ } else if (h > 1) {
2535
+ h -= 1;
2536
+ }
2537
+ }
2538
+ return [
2539
+ h * 360,
2540
+ s * 100,
2541
+ v * 100
2542
+ ];
2543
+ };
2544
+ convert.rgb.hwb = function(rgb) {
2545
+ const r = rgb[0];
2546
+ const g = rgb[1];
2547
+ let b = rgb[2];
2548
+ const h = convert.rgb.hsl(rgb)[0];
2549
+ const w = 1 / 255 * Math.min(r, Math.min(g, b));
2550
+ b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
2551
+ return [h, w * 100, b * 100];
2552
+ };
2553
+ convert.rgb.cmyk = function(rgb) {
2554
+ const r = rgb[0] / 255;
2555
+ const g = rgb[1] / 255;
2556
+ const b = rgb[2] / 255;
2557
+ const k = Math.min(1 - r, 1 - g, 1 - b);
2558
+ const c = (1 - r - k) / (1 - k) || 0;
2559
+ const m = (1 - g - k) / (1 - k) || 0;
2560
+ const y = (1 - b - k) / (1 - k) || 0;
2561
+ return [c * 100, m * 100, y * 100, k * 100];
2562
+ };
2563
+ function comparativeDistance(x, y) {
2564
+ return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
2565
+ }
2566
+ convert.rgb.keyword = function(rgb) {
2567
+ const reversed = reverseKeywords[rgb];
2568
+ if (reversed) {
2569
+ return reversed;
2570
+ }
2571
+ let currentClosestDistance = Infinity;
2572
+ let currentClosestKeyword;
2573
+ for (const keyword of Object.keys(cssKeywords)) {
2574
+ const value = cssKeywords[keyword];
2575
+ const distance = comparativeDistance(rgb, value);
2576
+ if (distance < currentClosestDistance) {
2577
+ currentClosestDistance = distance;
2578
+ currentClosestKeyword = keyword;
2579
+ }
2580
+ }
2581
+ return currentClosestKeyword;
2582
+ };
2583
+ convert.keyword.rgb = function(keyword) {
2584
+ return cssKeywords[keyword];
2585
+ };
2586
+ convert.rgb.xyz = function(rgb) {
2587
+ let r = rgb[0] / 255;
2588
+ let g = rgb[1] / 255;
2589
+ let b = rgb[2] / 255;
2590
+ r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
2591
+ g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
2592
+ b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
2593
+ const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
2594
+ const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
2595
+ const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
2596
+ return [x * 100, y * 100, z * 100];
2597
+ };
2598
+ convert.rgb.lab = function(rgb) {
2599
+ const xyz = convert.rgb.xyz(rgb);
2600
+ let x = xyz[0];
2601
+ let y = xyz[1];
2602
+ let z = xyz[2];
2603
+ x /= 95.047;
2604
+ y /= 100;
2605
+ z /= 108.883;
2606
+ x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
2607
+ y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
2608
+ z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
2609
+ const l = 116 * y - 16;
2610
+ const a = 500 * (x - y);
2611
+ const b = 200 * (y - z);
2612
+ return [l, a, b];
2613
+ };
2614
+ convert.hsl.rgb = function(hsl) {
2615
+ const h = hsl[0] / 360;
2616
+ const s = hsl[1] / 100;
2617
+ const l = hsl[2] / 100;
2618
+ let t2;
2619
+ let t3;
2620
+ let val;
2621
+ if (s === 0) {
2622
+ val = l * 255;
2623
+ return [val, val, val];
2624
+ }
2625
+ if (l < 0.5) {
2626
+ t2 = l * (1 + s);
2627
+ } else {
2628
+ t2 = l + s - l * s;
2629
+ }
2630
+ const t1 = 2 * l - t2;
2631
+ const rgb = [0, 0, 0];
2632
+ for (let i = 0; i < 3; i++) {
2633
+ t3 = h + 1 / 3 * -(i - 1);
2634
+ if (t3 < 0) {
2635
+ t3++;
2636
+ }
2637
+ if (t3 > 1) {
2638
+ t3--;
2639
+ }
2640
+ if (6 * t3 < 1) {
2641
+ val = t1 + (t2 - t1) * 6 * t3;
2642
+ } else if (2 * t3 < 1) {
2643
+ val = t2;
2644
+ } else if (3 * t3 < 2) {
2645
+ val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
2646
+ } else {
2647
+ val = t1;
2648
+ }
2649
+ rgb[i] = val * 255;
2650
+ }
2651
+ return rgb;
2652
+ };
2653
+ convert.hsl.hsv = function(hsl) {
2654
+ const h = hsl[0];
2655
+ let s = hsl[1] / 100;
2656
+ let l = hsl[2] / 100;
2657
+ let smin = s;
2658
+ const lmin = Math.max(l, 0.01);
2659
+ l *= 2;
2660
+ s *= l <= 1 ? l : 2 - l;
2661
+ smin *= lmin <= 1 ? lmin : 2 - lmin;
2662
+ const v = (l + s) / 2;
2663
+ const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
2664
+ return [h, sv * 100, v * 100];
2665
+ };
2666
+ convert.hsv.rgb = function(hsv) {
2667
+ const h = hsv[0] / 60;
2668
+ const s = hsv[1] / 100;
2669
+ let v = hsv[2] / 100;
2670
+ const hi = Math.floor(h) % 6;
2671
+ const f = h - Math.floor(h);
2672
+ const p = 255 * v * (1 - s);
2673
+ const q = 255 * v * (1 - s * f);
2674
+ const t = 255 * v * (1 - s * (1 - f));
2675
+ v *= 255;
2676
+ switch (hi) {
2677
+ case 0:
2678
+ return [v, t, p];
2679
+ case 1:
2680
+ return [q, v, p];
2681
+ case 2:
2682
+ return [p, v, t];
2683
+ case 3:
2684
+ return [p, q, v];
2685
+ case 4:
2686
+ return [t, p, v];
2687
+ case 5:
2688
+ return [v, p, q];
2689
+ }
2690
+ };
2691
+ convert.hsv.hsl = function(hsv) {
2692
+ const h = hsv[0];
2693
+ const s = hsv[1] / 100;
2694
+ const v = hsv[2] / 100;
2695
+ const vmin = Math.max(v, 0.01);
2696
+ let sl;
2697
+ let l;
2698
+ l = (2 - s) * v;
2699
+ const lmin = (2 - s) * vmin;
2700
+ sl = s * vmin;
2701
+ sl /= lmin <= 1 ? lmin : 2 - lmin;
2702
+ sl = sl || 0;
2703
+ l /= 2;
2704
+ return [h, sl * 100, l * 100];
2705
+ };
2706
+ convert.hwb.rgb = function(hwb) {
2707
+ const h = hwb[0] / 360;
2708
+ let wh = hwb[1] / 100;
2709
+ let bl = hwb[2] / 100;
2710
+ const ratio = wh + bl;
2711
+ let f;
2712
+ if (ratio > 1) {
2713
+ wh /= ratio;
2714
+ bl /= ratio;
2715
+ }
2716
+ const i = Math.floor(6 * h);
2717
+ const v = 1 - bl;
2718
+ f = 6 * h - i;
2719
+ if ((i & 1) !== 0) {
2720
+ f = 1 - f;
2721
+ }
2722
+ const n = wh + f * (v - wh);
2723
+ let r;
2724
+ let g;
2725
+ let b;
2726
+ switch (i) {
2727
+ default:
2728
+ case 6:
2729
+ case 0:
2730
+ r = v;
2731
+ g = n;
2732
+ b = wh;
2733
+ break;
2734
+ case 1:
2735
+ r = n;
2736
+ g = v;
2737
+ b = wh;
2738
+ break;
2739
+ case 2:
2740
+ r = wh;
2741
+ g = v;
2742
+ b = n;
2743
+ break;
2744
+ case 3:
2745
+ r = wh;
2746
+ g = n;
2747
+ b = v;
2748
+ break;
2749
+ case 4:
2750
+ r = n;
2751
+ g = wh;
2752
+ b = v;
2753
+ break;
2754
+ case 5:
2755
+ r = v;
2756
+ g = wh;
2757
+ b = n;
2758
+ break;
2759
+ }
2760
+ return [r * 255, g * 255, b * 255];
2761
+ };
2762
+ convert.cmyk.rgb = function(cmyk) {
2763
+ const c = cmyk[0] / 100;
2764
+ const m = cmyk[1] / 100;
2765
+ const y = cmyk[2] / 100;
2766
+ const k = cmyk[3] / 100;
2767
+ const r = 1 - Math.min(1, c * (1 - k) + k);
2768
+ const g = 1 - Math.min(1, m * (1 - k) + k);
2769
+ const b = 1 - Math.min(1, y * (1 - k) + k);
2770
+ return [r * 255, g * 255, b * 255];
2771
+ };
2772
+ convert.xyz.rgb = function(xyz) {
2773
+ const x = xyz[0] / 100;
2774
+ const y = xyz[1] / 100;
2775
+ const z = xyz[2] / 100;
2776
+ let r;
2777
+ let g;
2778
+ let b;
2779
+ r = x * 3.2406 + y * -1.5372 + z * -0.4986;
2780
+ g = x * -0.9689 + y * 1.8758 + z * 0.0415;
2781
+ b = x * 0.0557 + y * -0.204 + z * 1.057;
2782
+ r = r > 31308e-7 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92;
2783
+ g = g > 31308e-7 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92;
2784
+ b = b > 31308e-7 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92;
2785
+ r = Math.min(Math.max(0, r), 1);
2786
+ g = Math.min(Math.max(0, g), 1);
2787
+ b = Math.min(Math.max(0, b), 1);
2788
+ return [r * 255, g * 255, b * 255];
2789
+ };
2790
+ convert.xyz.lab = function(xyz) {
2791
+ let x = xyz[0];
2792
+ let y = xyz[1];
2793
+ let z = xyz[2];
2794
+ x /= 95.047;
2795
+ y /= 100;
2796
+ z /= 108.883;
2797
+ x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
2798
+ y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
2799
+ z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
2800
+ const l = 116 * y - 16;
2801
+ const a = 500 * (x - y);
2802
+ const b = 200 * (y - z);
2803
+ return [l, a, b];
2804
+ };
2805
+ convert.lab.xyz = function(lab) {
2806
+ const l = lab[0];
2807
+ const a = lab[1];
2808
+ const b = lab[2];
2809
+ let x;
2810
+ let y;
2811
+ let z;
2812
+ y = (l + 16) / 116;
2813
+ x = a / 500 + y;
2814
+ z = y - b / 200;
2815
+ const y2 = y ** 3;
2816
+ const x2 = x ** 3;
2817
+ const z2 = z ** 3;
2818
+ y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787;
2819
+ x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787;
2820
+ z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787;
2821
+ x *= 95.047;
2822
+ y *= 100;
2823
+ z *= 108.883;
2824
+ return [x, y, z];
2825
+ };
2826
+ convert.lab.lch = function(lab) {
2827
+ const l = lab[0];
2828
+ const a = lab[1];
2829
+ const b = lab[2];
2830
+ let h;
2831
+ const hr = Math.atan2(b, a);
2832
+ h = hr * 360 / 2 / Math.PI;
2833
+ if (h < 0) {
2834
+ h += 360;
2835
+ }
2836
+ const c = Math.sqrt(a * a + b * b);
2837
+ return [l, c, h];
2838
+ };
2839
+ convert.lch.lab = function(lch) {
2840
+ const l = lch[0];
2841
+ const c = lch[1];
2842
+ const h = lch[2];
2843
+ const hr = h / 360 * 2 * Math.PI;
2844
+ const a = c * Math.cos(hr);
2845
+ const b = c * Math.sin(hr);
2846
+ return [l, a, b];
2847
+ };
2848
+ convert.rgb.ansi16 = function(args, saturation = null) {
2849
+ const [r, g, b] = args;
2850
+ let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
2851
+ value = Math.round(value / 50);
2852
+ if (value === 0) {
2853
+ return 30;
2854
+ }
2855
+ let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
2856
+ if (value === 2) {
2857
+ ansi += 60;
2858
+ }
2859
+ return ansi;
2860
+ };
2861
+ convert.hsv.ansi16 = function(args) {
2862
+ return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
2863
+ };
2864
+ convert.rgb.ansi256 = function(args) {
2865
+ const r = args[0];
2866
+ const g = args[1];
2867
+ const b = args[2];
2868
+ if (r === g && g === b) {
2869
+ if (r < 8) {
2870
+ return 16;
2871
+ }
2872
+ if (r > 248) {
2873
+ return 231;
2874
+ }
2875
+ return Math.round((r - 8) / 247 * 24) + 232;
2876
+ }
2877
+ const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
2878
+ return ansi;
2879
+ };
2880
+ convert.ansi16.rgb = function(args) {
2881
+ let color = args % 10;
2882
+ if (color === 0 || color === 7) {
2883
+ if (args > 50) {
2884
+ color += 3.5;
2885
+ }
2886
+ color = color / 10.5 * 255;
2887
+ return [color, color, color];
2888
+ }
2889
+ const mult = (~~(args > 50) + 1) * 0.5;
2890
+ const r = (color & 1) * mult * 255;
2891
+ const g = (color >> 1 & 1) * mult * 255;
2892
+ const b = (color >> 2 & 1) * mult * 255;
2893
+ return [r, g, b];
2894
+ };
2895
+ convert.ansi256.rgb = function(args) {
2896
+ if (args >= 232) {
2897
+ const c = (args - 232) * 10 + 8;
2898
+ return [c, c, c];
2899
+ }
2900
+ args -= 16;
2901
+ let rem;
2902
+ const r = Math.floor(args / 36) / 5 * 255;
2903
+ const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
2904
+ const b = rem % 6 / 5 * 255;
2905
+ return [r, g, b];
2906
+ };
2907
+ convert.rgb.hex = function(args) {
2908
+ const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
2909
+ const string = integer.toString(16).toUpperCase();
2910
+ return "000000".substring(string.length) + string;
2911
+ };
2912
+ convert.hex.rgb = function(args) {
2913
+ const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
2914
+ if (!match) {
2915
+ return [0, 0, 0];
2916
+ }
2917
+ let colorString = match[0];
2918
+ if (match[0].length === 3) {
2919
+ colorString = colorString.split("").map((char) => {
2920
+ return char + char;
2921
+ }).join("");
2922
+ }
2923
+ const integer = parseInt(colorString, 16);
2924
+ const r = integer >> 16 & 255;
2925
+ const g = integer >> 8 & 255;
2926
+ const b = integer & 255;
2927
+ return [r, g, b];
2928
+ };
2929
+ convert.rgb.hcg = function(rgb) {
2930
+ const r = rgb[0] / 255;
2931
+ const g = rgb[1] / 255;
2932
+ const b = rgb[2] / 255;
2933
+ const max = Math.max(Math.max(r, g), b);
2934
+ const min = Math.min(Math.min(r, g), b);
2935
+ const chroma = max - min;
2936
+ let grayscale;
2937
+ let hue;
2938
+ if (chroma < 1) {
2939
+ grayscale = min / (1 - chroma);
2940
+ } else {
2941
+ grayscale = 0;
2942
+ }
2943
+ if (chroma <= 0) {
2944
+ hue = 0;
2945
+ } else if (max === r) {
2946
+ hue = (g - b) / chroma % 6;
2947
+ } else if (max === g) {
2948
+ hue = 2 + (b - r) / chroma;
2949
+ } else {
2950
+ hue = 4 + (r - g) / chroma;
2951
+ }
2952
+ hue /= 6;
2953
+ hue %= 1;
2954
+ return [hue * 360, chroma * 100, grayscale * 100];
2955
+ };
2956
+ convert.hsl.hcg = function(hsl) {
2957
+ const s = hsl[1] / 100;
2958
+ const l = hsl[2] / 100;
2959
+ const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l);
2960
+ let f = 0;
2961
+ if (c < 1) {
2962
+ f = (l - 0.5 * c) / (1 - c);
2963
+ }
2964
+ return [hsl[0], c * 100, f * 100];
2965
+ };
2966
+ convert.hsv.hcg = function(hsv) {
2967
+ const s = hsv[1] / 100;
2968
+ const v = hsv[2] / 100;
2969
+ const c = s * v;
2970
+ let f = 0;
2971
+ if (c < 1) {
2972
+ f = (v - c) / (1 - c);
2973
+ }
2974
+ return [hsv[0], c * 100, f * 100];
2975
+ };
2976
+ convert.hcg.rgb = function(hcg) {
2977
+ const h = hcg[0] / 360;
2978
+ const c = hcg[1] / 100;
2979
+ const g = hcg[2] / 100;
2980
+ if (c === 0) {
2981
+ return [g * 255, g * 255, g * 255];
2982
+ }
2983
+ const pure = [0, 0, 0];
2984
+ const hi = h % 1 * 6;
2985
+ const v = hi % 1;
2986
+ const w = 1 - v;
2987
+ let mg = 0;
2988
+ switch (Math.floor(hi)) {
2989
+ case 0:
2990
+ pure[0] = 1;
2991
+ pure[1] = v;
2992
+ pure[2] = 0;
2993
+ break;
2994
+ case 1:
2995
+ pure[0] = w;
2996
+ pure[1] = 1;
2997
+ pure[2] = 0;
2998
+ break;
2999
+ case 2:
3000
+ pure[0] = 0;
3001
+ pure[1] = 1;
3002
+ pure[2] = v;
3003
+ break;
3004
+ case 3:
3005
+ pure[0] = 0;
3006
+ pure[1] = w;
3007
+ pure[2] = 1;
3008
+ break;
3009
+ case 4:
3010
+ pure[0] = v;
3011
+ pure[1] = 0;
3012
+ pure[2] = 1;
3013
+ break;
3014
+ default:
3015
+ pure[0] = 1;
3016
+ pure[1] = 0;
3017
+ pure[2] = w;
3018
+ }
3019
+ mg = (1 - c) * g;
3020
+ return [
3021
+ (c * pure[0] + mg) * 255,
3022
+ (c * pure[1] + mg) * 255,
3023
+ (c * pure[2] + mg) * 255
3024
+ ];
3025
+ };
3026
+ convert.hcg.hsv = function(hcg) {
3027
+ const c = hcg[1] / 100;
3028
+ const g = hcg[2] / 100;
3029
+ const v = c + g * (1 - c);
3030
+ let f = 0;
3031
+ if (v > 0) {
3032
+ f = c / v;
3033
+ }
3034
+ return [hcg[0], f * 100, v * 100];
3035
+ };
3036
+ convert.hcg.hsl = function(hcg) {
3037
+ const c = hcg[1] / 100;
3038
+ const g = hcg[2] / 100;
3039
+ const l = g * (1 - c) + 0.5 * c;
3040
+ let s = 0;
3041
+ if (l > 0 && l < 0.5) {
3042
+ s = c / (2 * l);
3043
+ } else if (l >= 0.5 && l < 1) {
3044
+ s = c / (2 * (1 - l));
3045
+ }
3046
+ return [hcg[0], s * 100, l * 100];
3047
+ };
3048
+ convert.hcg.hwb = function(hcg) {
3049
+ const c = hcg[1] / 100;
3050
+ const g = hcg[2] / 100;
3051
+ const v = c + g * (1 - c);
3052
+ return [hcg[0], (v - c) * 100, (1 - v) * 100];
3053
+ };
3054
+ convert.hwb.hcg = function(hwb) {
3055
+ const w = hwb[1] / 100;
3056
+ const b = hwb[2] / 100;
3057
+ const v = 1 - b;
3058
+ const c = v - w;
3059
+ let g = 0;
3060
+ if (c < 1) {
3061
+ g = (v - c) / (1 - c);
3062
+ }
3063
+ return [hwb[0], c * 100, g * 100];
3064
+ };
3065
+ convert.apple.rgb = function(apple) {
3066
+ return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
3067
+ };
3068
+ convert.rgb.apple = function(rgb) {
3069
+ return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
3070
+ };
3071
+ convert.gray.rgb = function(args) {
3072
+ return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
3073
+ };
3074
+ convert.gray.hsl = function(args) {
3075
+ return [0, 0, args[0]];
3076
+ };
3077
+ convert.gray.hsv = convert.gray.hsl;
3078
+ convert.gray.hwb = function(gray) {
3079
+ return [0, 100, gray[0]];
3080
+ };
3081
+ convert.gray.cmyk = function(gray) {
3082
+ return [0, 0, 0, gray[0]];
3083
+ };
3084
+ convert.gray.lab = function(gray) {
3085
+ return [gray[0], 0, 0];
3086
+ };
3087
+ convert.gray.hex = function(gray) {
3088
+ const val = Math.round(gray[0] / 100 * 255) & 255;
3089
+ const integer = (val << 16) + (val << 8) + val;
3090
+ const string = integer.toString(16).toUpperCase();
3091
+ return "000000".substring(string.length) + string;
3092
+ };
3093
+ convert.rgb.gray = function(rgb) {
3094
+ const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
3095
+ return [val / 255 * 100];
3096
+ };
3097
+ return conversions;
3098
+ }
3099
+ var route;
3100
+ var hasRequiredRoute;
3101
+ function requireRoute() {
3102
+ if (hasRequiredRoute) return route;
3103
+ hasRequiredRoute = 1;
3104
+ const conversions2 = requireConversions();
3105
+ function buildGraph() {
3106
+ const graph = {};
3107
+ const models = Object.keys(conversions2);
3108
+ for (let len = models.length, i = 0; i < len; i++) {
3109
+ graph[models[i]] = {
3110
+ // http://jsperf.com/1-vs-infinity
3111
+ // micro-opt, but this is simple.
3112
+ distance: -1,
3113
+ parent: null
3114
+ };
3115
+ }
3116
+ return graph;
3117
+ }
3118
+ function deriveBFS(fromModel) {
3119
+ const graph = buildGraph();
3120
+ const queue = [fromModel];
3121
+ graph[fromModel].distance = 0;
3122
+ while (queue.length) {
3123
+ const current = queue.pop();
3124
+ const adjacents = Object.keys(conversions2[current]);
3125
+ for (let len = adjacents.length, i = 0; i < len; i++) {
3126
+ const adjacent = adjacents[i];
3127
+ const node = graph[adjacent];
3128
+ if (node.distance === -1) {
3129
+ node.distance = graph[current].distance + 1;
3130
+ node.parent = current;
3131
+ queue.unshift(adjacent);
3132
+ }
3133
+ }
3134
+ }
3135
+ return graph;
3136
+ }
3137
+ function link(from, to) {
3138
+ return function(args) {
3139
+ return to(from(args));
3140
+ };
3141
+ }
3142
+ function wrapConversion(toModel, graph) {
3143
+ const path = [graph[toModel].parent, toModel];
3144
+ let fn = conversions2[graph[toModel].parent][toModel];
3145
+ let cur = graph[toModel].parent;
3146
+ while (graph[cur].parent) {
3147
+ path.unshift(graph[cur].parent);
3148
+ fn = link(conversions2[graph[cur].parent][cur], fn);
3149
+ cur = graph[cur].parent;
3150
+ }
3151
+ fn.conversion = path;
3152
+ return fn;
3153
+ }
3154
+ route = function(fromModel) {
3155
+ const graph = deriveBFS(fromModel);
3156
+ const conversion = {};
3157
+ const models = Object.keys(graph);
3158
+ for (let len = models.length, i = 0; i < len; i++) {
3159
+ const toModel = models[i];
3160
+ const node = graph[toModel];
3161
+ if (node.parent === null) {
3162
+ continue;
3163
+ }
3164
+ conversion[toModel] = wrapConversion(toModel, graph);
3165
+ }
3166
+ return conversion;
3167
+ };
3168
+ return route;
3169
+ }
3170
+ var colorConvert;
3171
+ var hasRequiredColorConvert;
3172
+ function requireColorConvert() {
3173
+ if (hasRequiredColorConvert) return colorConvert;
3174
+ hasRequiredColorConvert = 1;
3175
+ const conversions2 = requireConversions();
3176
+ const route2 = requireRoute();
3177
+ const convert = {};
3178
+ const models = Object.keys(conversions2);
3179
+ function wrapRaw(fn) {
3180
+ const wrappedFn = function(...args) {
3181
+ const arg0 = args[0];
3182
+ if (arg0 === void 0 || arg0 === null) {
3183
+ return arg0;
3184
+ }
3185
+ if (arg0.length > 1) {
3186
+ args = arg0;
3187
+ }
3188
+ return fn(args);
3189
+ };
3190
+ if ("conversion" in fn) {
3191
+ wrappedFn.conversion = fn.conversion;
3192
+ }
3193
+ return wrappedFn;
3194
+ }
3195
+ function wrapRounded(fn) {
3196
+ const wrappedFn = function(...args) {
3197
+ const arg0 = args[0];
3198
+ if (arg0 === void 0 || arg0 === null) {
3199
+ return arg0;
3200
+ }
3201
+ if (arg0.length > 1) {
3202
+ args = arg0;
3203
+ }
3204
+ const result = fn(args);
3205
+ if (typeof result === "object") {
3206
+ for (let len = result.length, i = 0; i < len; i++) {
3207
+ result[i] = Math.round(result[i]);
3208
+ }
3209
+ }
3210
+ return result;
3211
+ };
3212
+ if ("conversion" in fn) {
3213
+ wrappedFn.conversion = fn.conversion;
3214
+ }
3215
+ return wrappedFn;
3216
+ }
3217
+ models.forEach((fromModel) => {
3218
+ convert[fromModel] = {};
3219
+ Object.defineProperty(convert[fromModel], "channels", { value: conversions2[fromModel].channels });
3220
+ Object.defineProperty(convert[fromModel], "labels", { value: conversions2[fromModel].labels });
3221
+ const routes = route2(fromModel);
3222
+ const routeModels = Object.keys(routes);
3223
+ routeModels.forEach((toModel) => {
3224
+ const fn = routes[toModel];
3225
+ convert[fromModel][toModel] = wrapRounded(fn);
3226
+ convert[fromModel][toModel].raw = wrapRaw(fn);
3227
+ });
3228
+ });
3229
+ colorConvert = convert;
3230
+ return colorConvert;
3231
+ }
3232
+ ansiStyles.exports;
3233
+ var hasRequiredAnsiStyles;
3234
+ function requireAnsiStyles() {
3235
+ if (hasRequiredAnsiStyles) return ansiStyles.exports;
3236
+ hasRequiredAnsiStyles = 1;
3237
+ (function(module2) {
3238
+ const wrapAnsi16 = (fn, offset) => (...args) => {
3239
+ const code = fn(...args);
3240
+ return `\x1B[${code + offset}m`;
3241
+ };
3242
+ const wrapAnsi256 = (fn, offset) => (...args) => {
3243
+ const code = fn(...args);
3244
+ return `\x1B[${38 + offset};5;${code}m`;
3245
+ };
3246
+ const wrapAnsi16m = (fn, offset) => (...args) => {
3247
+ const rgb = fn(...args);
3248
+ return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
3249
+ };
3250
+ const ansi2ansi = (n) => n;
3251
+ const rgb2rgb = (r, g, b) => [r, g, b];
3252
+ const setLazyProperty = (object, property, get) => {
3253
+ Object.defineProperty(object, property, {
3254
+ get: () => {
3255
+ const value = get();
3256
+ Object.defineProperty(object, property, {
3257
+ value,
3258
+ enumerable: true,
3259
+ configurable: true
3260
+ });
3261
+ return value;
3262
+ },
3263
+ enumerable: true,
3264
+ configurable: true
3265
+ });
3266
+ };
3267
+ let colorConvert2;
3268
+ const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
3269
+ if (colorConvert2 === void 0) {
3270
+ colorConvert2 = requireColorConvert();
3271
+ }
3272
+ const offset = isBackground ? 10 : 0;
3273
+ const styles = {};
3274
+ for (const [sourceSpace, suite] of Object.entries(colorConvert2)) {
3275
+ const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
3276
+ if (sourceSpace === targetSpace) {
3277
+ styles[name] = wrap(identity, offset);
3278
+ } else if (typeof suite === "object") {
3279
+ styles[name] = wrap(suite[targetSpace], offset);
3280
+ }
3281
+ }
3282
+ return styles;
3283
+ };
3284
+ function assembleStyles() {
3285
+ const codes = /* @__PURE__ */ new Map();
3286
+ const styles = {
3287
+ modifier: {
3288
+ reset: [0, 0],
3289
+ // 21 isn't widely supported and 22 does the same thing
3290
+ bold: [1, 22],
3291
+ dim: [2, 22],
3292
+ italic: [3, 23],
3293
+ underline: [4, 24],
3294
+ inverse: [7, 27],
3295
+ hidden: [8, 28],
3296
+ strikethrough: [9, 29]
3297
+ },
3298
+ color: {
3299
+ black: [30, 39],
3300
+ red: [31, 39],
3301
+ green: [32, 39],
3302
+ yellow: [33, 39],
3303
+ blue: [34, 39],
3304
+ magenta: [35, 39],
3305
+ cyan: [36, 39],
3306
+ white: [37, 39],
3307
+ // Bright color
3308
+ blackBright: [90, 39],
3309
+ redBright: [91, 39],
3310
+ greenBright: [92, 39],
3311
+ yellowBright: [93, 39],
3312
+ blueBright: [94, 39],
3313
+ magentaBright: [95, 39],
3314
+ cyanBright: [96, 39],
3315
+ whiteBright: [97, 39]
3316
+ },
3317
+ bgColor: {
3318
+ bgBlack: [40, 49],
3319
+ bgRed: [41, 49],
3320
+ bgGreen: [42, 49],
3321
+ bgYellow: [43, 49],
3322
+ bgBlue: [44, 49],
3323
+ bgMagenta: [45, 49],
3324
+ bgCyan: [46, 49],
3325
+ bgWhite: [47, 49],
3326
+ // Bright color
3327
+ bgBlackBright: [100, 49],
3328
+ bgRedBright: [101, 49],
3329
+ bgGreenBright: [102, 49],
3330
+ bgYellowBright: [103, 49],
3331
+ bgBlueBright: [104, 49],
3332
+ bgMagentaBright: [105, 49],
3333
+ bgCyanBright: [106, 49],
3334
+ bgWhiteBright: [107, 49]
3335
+ }
3336
+ };
3337
+ styles.color.gray = styles.color.blackBright;
3338
+ styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
3339
+ styles.color.grey = styles.color.blackBright;
3340
+ styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
3341
+ for (const [groupName, group] of Object.entries(styles)) {
3342
+ for (const [styleName, style] of Object.entries(group)) {
3343
+ styles[styleName] = {
3344
+ open: `\x1B[${style[0]}m`,
3345
+ close: `\x1B[${style[1]}m`
3346
+ };
3347
+ group[styleName] = styles[styleName];
3348
+ codes.set(style[0], style[1]);
3349
+ }
3350
+ Object.defineProperty(styles, groupName, {
3351
+ value: group,
3352
+ enumerable: false
3353
+ });
3354
+ }
3355
+ Object.defineProperty(styles, "codes", {
3356
+ value: codes,
3357
+ enumerable: false
3358
+ });
3359
+ styles.color.close = "\x1B[39m";
3360
+ styles.bgColor.close = "\x1B[49m";
3361
+ setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
3362
+ setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
3363
+ setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
3364
+ setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
3365
+ setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
3366
+ setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
3367
+ return styles;
3368
+ }
3369
+ Object.defineProperty(module2, "exports", {
3370
+ enumerable: true,
3371
+ get: assembleStyles
3372
+ });
3373
+ })(ansiStyles);
3374
+ return ansiStyles.exports;
3375
+ }
3376
+ var browser;
3377
+ var hasRequiredBrowser;
3378
+ function requireBrowser() {
3379
+ if (hasRequiredBrowser) return browser;
3380
+ hasRequiredBrowser = 1;
3381
+ browser = {
3382
+ stdout: false,
3383
+ stderr: false
3384
+ };
3385
+ return browser;
3386
+ }
3387
+ var util;
3388
+ var hasRequiredUtil;
3389
+ function requireUtil() {
3390
+ if (hasRequiredUtil) return util;
3391
+ hasRequiredUtil = 1;
3392
+ const stringReplaceAll = (string, substring, replacer) => {
3393
+ let index = string.indexOf(substring);
3394
+ if (index === -1) {
3395
+ return string;
3396
+ }
3397
+ const substringLength = substring.length;
3398
+ let endIndex = 0;
3399
+ let returnValue = "";
3400
+ do {
3401
+ returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
3402
+ endIndex = index + substringLength;
3403
+ index = string.indexOf(substring, endIndex);
3404
+ } while (index !== -1);
3405
+ returnValue += string.substr(endIndex);
3406
+ return returnValue;
3407
+ };
3408
+ const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
3409
+ let endIndex = 0;
3410
+ let returnValue = "";
3411
+ do {
3412
+ const gotCR = string[index - 1] === "\r";
3413
+ returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
3414
+ endIndex = index + 1;
3415
+ index = string.indexOf("\n", endIndex);
3416
+ } while (index !== -1);
3417
+ returnValue += string.substr(endIndex);
3418
+ return returnValue;
3419
+ };
3420
+ util = {
3421
+ stringReplaceAll,
3422
+ stringEncaseCRLFWithFirstIndex
3423
+ };
3424
+ return util;
3425
+ }
3426
+ var templates;
3427
+ var hasRequiredTemplates;
3428
+ function requireTemplates() {
3429
+ if (hasRequiredTemplates) return templates;
3430
+ hasRequiredTemplates = 1;
3431
+ 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;
3432
+ const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
3433
+ const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
3434
+ const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
3435
+ const ESCAPES = /* @__PURE__ */ new Map([
3436
+ ["n", "\n"],
3437
+ ["r", "\r"],
3438
+ ["t", " "],
3439
+ ["b", "\b"],
3440
+ ["f", "\f"],
3441
+ ["v", "\v"],
3442
+ ["0", "\0"],
3443
+ ["\\", "\\"],
3444
+ ["e", "\x1B"],
3445
+ ["a", "\x07"]
3446
+ ]);
3447
+ function unescape2(c) {
3448
+ const u = c[0] === "u";
3449
+ const bracket = c[1] === "{";
3450
+ if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) {
3451
+ return String.fromCharCode(parseInt(c.slice(1), 16));
3452
+ }
3453
+ if (u && bracket) {
3454
+ return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
3455
+ }
3456
+ return ESCAPES.get(c) || c;
3457
+ }
3458
+ function parseArguments(name, arguments_) {
3459
+ const results = [];
3460
+ const chunks = arguments_.trim().split(/\s*,\s*/g);
3461
+ let matches;
3462
+ for (const chunk of chunks) {
3463
+ const number = Number(chunk);
3464
+ if (!Number.isNaN(number)) {
3465
+ results.push(number);
3466
+ } else if (matches = chunk.match(STRING_REGEX)) {
3467
+ results.push(matches[2].replace(ESCAPE_REGEX, (m, escape2, character) => escape2 ? unescape2(escape2) : character));
3468
+ } else {
3469
+ throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
3470
+ }
3471
+ }
3472
+ return results;
3473
+ }
3474
+ function parseStyle(style) {
3475
+ STYLE_REGEX.lastIndex = 0;
3476
+ const results = [];
3477
+ let matches;
3478
+ while ((matches = STYLE_REGEX.exec(style)) !== null) {
3479
+ const name = matches[1];
3480
+ if (matches[2]) {
3481
+ const args = parseArguments(name, matches[2]);
3482
+ results.push([name].concat(args));
3483
+ } else {
3484
+ results.push([name]);
3485
+ }
3486
+ }
3487
+ return results;
3488
+ }
3489
+ function buildStyle(chalk2, styles) {
3490
+ const enabled = {};
3491
+ for (const layer of styles) {
3492
+ for (const style of layer.styles) {
3493
+ enabled[style[0]] = layer.inverse ? null : style.slice(1);
3494
+ }
3495
+ }
3496
+ let current = chalk2;
3497
+ for (const [styleName, styles2] of Object.entries(enabled)) {
3498
+ if (!Array.isArray(styles2)) {
3499
+ continue;
3500
+ }
3501
+ if (!(styleName in current)) {
3502
+ throw new Error(`Unknown Chalk style: ${styleName}`);
3503
+ }
3504
+ current = styles2.length > 0 ? current[styleName](...styles2) : current[styleName];
3505
+ }
3506
+ return current;
3507
+ }
3508
+ templates = (chalk2, temporary) => {
3509
+ const styles = [];
3510
+ const chunks = [];
3511
+ let chunk = [];
3512
+ temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
3513
+ if (escapeCharacter) {
3514
+ chunk.push(unescape2(escapeCharacter));
3515
+ } else if (style) {
3516
+ const string = chunk.join("");
3517
+ chunk = [];
3518
+ chunks.push(styles.length === 0 ? string : buildStyle(chalk2, styles)(string));
3519
+ styles.push({ inverse, styles: parseStyle(style) });
3520
+ } else if (close) {
3521
+ if (styles.length === 0) {
3522
+ throw new Error("Found extraneous } in Chalk template literal");
3523
+ }
3524
+ chunks.push(buildStyle(chalk2, styles)(chunk.join("")));
3525
+ chunk = [];
3526
+ styles.pop();
3527
+ } else {
3528
+ chunk.push(character);
3529
+ }
3530
+ });
3531
+ chunks.push(chunk.join(""));
3532
+ if (styles.length > 0) {
3533
+ const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
3534
+ throw new Error(errMessage);
3535
+ }
3536
+ return chunks.join("");
3537
+ };
3538
+ return templates;
3539
+ }
3540
+ var source;
3541
+ var hasRequiredSource;
3542
+ function requireSource() {
3543
+ if (hasRequiredSource) return source;
3544
+ hasRequiredSource = 1;
3545
+ const ansiStyles2 = requireAnsiStyles();
3546
+ const { stdout: stdoutColor, stderr: stderrColor } = requireBrowser();
3547
+ const {
3548
+ stringReplaceAll,
3549
+ stringEncaseCRLFWithFirstIndex
3550
+ } = requireUtil();
3551
+ const { isArray } = Array;
3552
+ const levelMapping = [
3553
+ "ansi",
3554
+ "ansi",
3555
+ "ansi256",
3556
+ "ansi16m"
3557
+ ];
3558
+ const styles = /* @__PURE__ */ Object.create(null);
3559
+ const applyOptions = (object, options = {}) => {
3560
+ if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
3561
+ throw new Error("The `level` option should be an integer from 0 to 3");
3562
+ }
3563
+ const colorLevel = stdoutColor ? stdoutColor.level : 0;
3564
+ object.level = options.level === void 0 ? colorLevel : options.level;
3565
+ };
3566
+ class ChalkClass {
3567
+ constructor(options) {
3568
+ return chalkFactory(options);
3569
+ }
3570
+ }
3571
+ const chalkFactory = (options) => {
3572
+ const chalk3 = {};
3573
+ applyOptions(chalk3, options);
3574
+ chalk3.template = (...arguments_) => chalkTag(chalk3.template, ...arguments_);
3575
+ Object.setPrototypeOf(chalk3, Chalk.prototype);
3576
+ Object.setPrototypeOf(chalk3.template, chalk3);
3577
+ chalk3.template.constructor = () => {
3578
+ throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
3579
+ };
3580
+ chalk3.template.Instance = ChalkClass;
3581
+ return chalk3.template;
3582
+ };
3583
+ function Chalk(options) {
3584
+ return chalkFactory(options);
3585
+ }
3586
+ for (const [styleName, style] of Object.entries(ansiStyles2)) {
3587
+ styles[styleName] = {
3588
+ get() {
3589
+ const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
3590
+ Object.defineProperty(this, styleName, { value: builder });
3591
+ return builder;
3592
+ }
3593
+ };
3594
+ }
3595
+ styles.visible = {
3596
+ get() {
3597
+ const builder = createBuilder(this, this._styler, true);
3598
+ Object.defineProperty(this, "visible", { value: builder });
3599
+ return builder;
3600
+ }
3601
+ };
3602
+ const usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
3603
+ for (const model of usedModels) {
3604
+ styles[model] = {
3605
+ get() {
3606
+ const { level } = this;
3607
+ return function(...arguments_) {
3608
+ const styler = createStyler(ansiStyles2.color[levelMapping[level]][model](...arguments_), ansiStyles2.color.close, this._styler);
3609
+ return createBuilder(this, styler, this._isEmpty);
3610
+ };
3611
+ }
3612
+ };
3613
+ }
3614
+ for (const model of usedModels) {
3615
+ const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
3616
+ styles[bgModel] = {
3617
+ get() {
3618
+ const { level } = this;
3619
+ return function(...arguments_) {
3620
+ const styler = createStyler(ansiStyles2.bgColor[levelMapping[level]][model](...arguments_), ansiStyles2.bgColor.close, this._styler);
3621
+ return createBuilder(this, styler, this._isEmpty);
3622
+ };
3623
+ }
3624
+ };
3625
+ }
3626
+ const proto = Object.defineProperties(() => {
3627
+ }, {
3628
+ ...styles,
3629
+ level: {
3630
+ enumerable: true,
3631
+ get() {
3632
+ return this._generator.level;
3633
+ },
3634
+ set(level) {
3635
+ this._generator.level = level;
3636
+ }
3637
+ }
3638
+ });
3639
+ const createStyler = (open, close, parent) => {
3640
+ let openAll;
3641
+ let closeAll;
3642
+ if (parent === void 0) {
3643
+ openAll = open;
3644
+ closeAll = close;
3645
+ } else {
3646
+ openAll = parent.openAll + open;
3647
+ closeAll = close + parent.closeAll;
3648
+ }
3649
+ return {
3650
+ open,
3651
+ close,
3652
+ openAll,
3653
+ closeAll,
3654
+ parent
3655
+ };
3656
+ };
3657
+ const createBuilder = (self2, _styler, _isEmpty) => {
3658
+ const builder = (...arguments_) => {
3659
+ if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
3660
+ return applyStyle(builder, chalkTag(builder, ...arguments_));
3661
+ }
3662
+ return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
3663
+ };
3664
+ Object.setPrototypeOf(builder, proto);
3665
+ builder._generator = self2;
3666
+ builder._styler = _styler;
3667
+ builder._isEmpty = _isEmpty;
3668
+ return builder;
3669
+ };
3670
+ const applyStyle = (self2, string) => {
3671
+ if (self2.level <= 0 || !string) {
3672
+ return self2._isEmpty ? "" : string;
3673
+ }
3674
+ let styler = self2._styler;
3675
+ if (styler === void 0) {
3676
+ return string;
3677
+ }
3678
+ const { openAll, closeAll } = styler;
3679
+ if (string.indexOf("\x1B") !== -1) {
3680
+ while (styler !== void 0) {
3681
+ string = stringReplaceAll(string, styler.close, styler.open);
3682
+ styler = styler.parent;
3683
+ }
3684
+ }
3685
+ const lfIndex = string.indexOf("\n");
3686
+ if (lfIndex !== -1) {
3687
+ string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
3688
+ }
3689
+ return openAll + string + closeAll;
3690
+ };
3691
+ let template;
3692
+ const chalkTag = (chalk3, ...strings) => {
3693
+ const [firstString] = strings;
3694
+ if (!isArray(firstString) || !isArray(firstString.raw)) {
3695
+ return strings.join(" ");
3696
+ }
3697
+ const arguments_ = strings.slice(1);
3698
+ const parts = [firstString.raw[0]];
3699
+ for (let i = 1; i < firstString.length; i++) {
3700
+ parts.push(
3701
+ String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"),
3702
+ String(firstString.raw[i])
3703
+ );
3704
+ }
3705
+ if (template === void 0) {
3706
+ template = requireTemplates();
3707
+ }
3708
+ return template(chalk3, parts.join(""));
3709
+ };
3710
+ Object.defineProperties(Chalk.prototype, styles);
3711
+ const chalk2 = Chalk();
3712
+ chalk2.supportsColor = stdoutColor;
3713
+ chalk2.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
3714
+ chalk2.stderr.supportsColor = stderrColor;
3715
+ source = chalk2;
3716
+ return source;
3717
+ }
3718
+ requireSource();
3719
+ var Gauge = /* @__PURE__ */ ((Gauge2) => {
3720
+ Gauge2["ACTIVE_REQUEST_GAUGE"] = "a";
3721
+ Gauge2["AUTHENTICATION_COUNT_GAUGE"] = "b";
3722
+ Gauge2["AUTHENTICATION_ERROR_COUNT_GAUGE"] = "aa";
3723
+ Gauge2["AUTHENTICATION_RETRY_COUNT_GAUGE"] = "ab";
3724
+ Gauge2["CONNECTION_POOL_IDLE_GAUGE"] = "c";
3725
+ Gauge2["CONNECTION_POOL_TOTAL_GAUGE"] = "d";
3726
+ Gauge2["CONNECTION_POOL_WAITING_GAUGE"] = "e";
3727
+ Gauge2["CPU_LOAD_GAUGE"] = "f";
3728
+ Gauge2["CPU_SYSTEM_LOAD_GAUGE"] = "g";
3729
+ Gauge2["DURATION_GAUGE"] = "h";
3730
+ Gauge2["DURATION_HISTOGRAM_GAUGE"] = "i";
3731
+ Gauge2["ERROR_COUNT_GAUGE"] = "j";
3732
+ Gauge2["LATENCY_GAUGE"] = "k";
3733
+ Gauge2["LATENCY_HISTOGRAM_GAUGE"] = "l";
3734
+ Gauge2["LOGGER"] = "m";
3735
+ Gauge2["LOGGER_COPY"] = "n";
3736
+ Gauge2["NETWORK_RX_GAUGE"] = "o";
3737
+ Gauge2["NETWORK_TX_GAUGE"] = "p";
3738
+ Gauge2["REQUEST_COUNT_GAUGE"] = "q";
3739
+ Gauge2["RETRY_COUNT_GAUGE"] = "r";
3740
+ Gauge2["TIMER_GAUGE"] = "s";
3741
+ Gauge2["VELOCITY_GAUGE"] = "t";
3742
+ Gauge2["CONNECTION_COUNT_GAUGE"] = "u";
3743
+ Gauge2["OBJECT_GAUGE"] = "v";
3744
+ Gauge2["PAYLOAD_SIZE"] = "w";
3745
+ Gauge2["CORE_COUNT_GAUGE"] = "x";
3746
+ Gauge2["CHILD_COUNT"] = "y";
3747
+ Gauge2["UNKNOWN"] = "z";
3748
+ return Gauge2;
3749
+ })(Gauge || {});
3750
+ var GaugeTypes = /* @__PURE__ */ ((GaugeTypes2) => {
3751
+ GaugeTypes2["GAUGE_TYPE"] = "_";
3752
+ GaugeTypes2["INSTRUMENT_GAUGE"] = "a";
3753
+ GaugeTypes2["INSTRUMENT_VELOCITY"] = "b";
3754
+ GaugeTypes2["INSTRUMENT_HISTOGRAM"] = "c";
3755
+ GaugeTypes2["INSTRUMENT_LOG"] = "d";
3756
+ GaugeTypes2["INSTRUMENT_TIMER"] = "e";
3757
+ GaugeTypes2["INSTRUMENT_OBJECT"] = "f";
3758
+ return GaugeTypes2;
3759
+ })(GaugeTypes || {});
3760
+ class InstrumentBase {
3761
+ #label = "";
3762
+ #options = null;
3763
+ #data = {};
3764
+ // Use for copy objects only.
3765
+ //protected _data: Record<string, any> = { };
3766
+ constructor(options = {}) {
3767
+ if (typeof options === "string" || options instanceof String) {
3768
+ throw new Error("Instrument parameter must be an options object.");
3769
+ }
3770
+ this.#options = options;
3771
+ if (options.label) {
3772
+ this.#label = options.label;
3773
+ } else {
3774
+ this.#label = "InstrumentGauge";
3775
+ }
3776
+ }
3777
+ [GaugeTypes.GAUGE_TYPE] = GaugeTypes.INSTRUMENT_OBJECT;
3778
+ // Default Gauge type
3779
+ val;
3780
+ WithLabel(label) {
3781
+ this.label = label;
3782
+ return this;
3783
+ }
3784
+ DefineCopyProperties(propertyNames) {
3785
+ propertyNames.forEach((propertyName) => {
3786
+ Object.defineProperty(this, propertyName, {
3787
+ enumerable: true,
3788
+ get: () => this.#data[propertyName],
3789
+ set: (value) => {
3790
+ if (value === void 0) {
3791
+ return;
3792
+ }
3793
+ this.#data[propertyName] = value;
3794
+ }
3795
+ });
3796
+ });
3797
+ }
3798
+ GetNumber(val) {
3799
+ if (Number.isInteger(val)) {
3800
+ return val;
3801
+ } else {
3802
+ return Math.round((val + Number.EPSILON) * 100) / 100;
3803
+ }
3804
+ }
3805
+ get options() {
3806
+ return this.#options;
3807
+ }
3808
+ set options(optionsValue) {
3809
+ this.#options = optionsValue;
3810
+ }
3811
+ get label() {
3812
+ return this.#label;
3813
+ }
3814
+ set label(labelValue) {
3815
+ this.#label = labelValue;
3816
+ }
3817
+ StopTimer() {
3818
+ }
3819
+ ProcessTelemetry(telemetry) {
3820
+ throw new Error(`Must override in extended class: [ProcessTelemetry]: [${telemetry}].`);
3821
+ }
3822
+ /*
3823
+ toJSON()
3824
+ {
3825
+ return this._serialValue;
3826
+ }
3827
+ */
3828
+ /*
3829
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols
3830
+ [Symbol.iterator]() {
3831
+ // Use a new index for each iterator. This makes multiple
3832
+ // iterations over the iterable safe for non-trivial cases,
3833
+ // such as use of break or nested looping over the same iterable.
3834
+ let index = 0;
3835
+
3836
+ return {
3837
+ next: () => {
3838
+ if (index < 1) {
3839
+ return {value: this.GetFormatted(), done: false}
3840
+ } else {
3841
+ return {done: true}
3842
+ }
3843
+ }
3844
+ }
3845
+ }
3846
+ */
3847
+ }
3848
+ var timsort$1 = {};
3849
+ var hasRequiredTimsort$1;
3850
+ function requireTimsort$1() {
3851
+ if (hasRequiredTimsort$1) return timsort$1;
3852
+ hasRequiredTimsort$1 = 1;
3853
+ (function(exports$1) {
3854
+ (function(global2, factory) {
3855
+ {
3856
+ factory(exports$1);
3857
+ }
3858
+ })(timsort$1, function(exports2) {
3859
+ exports2.__esModule = true;
3860
+ exports2.sort = sort;
3861
+ function _classCallCheck(instance, Constructor) {
3862
+ if (!(instance instanceof Constructor)) {
3863
+ throw new TypeError("Cannot call a class as a function");
3864
+ }
3865
+ }
3866
+ var DEFAULT_MIN_MERGE = 32;
3867
+ var DEFAULT_MIN_GALLOPING = 7;
3868
+ var DEFAULT_TMP_STORAGE_LENGTH = 256;
3869
+ var POWERS_OF_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9];
3870
+ function log10(x) {
3871
+ if (x < 1e5) {
3872
+ if (x < 100) {
3873
+ return x < 10 ? 0 : 1;
3874
+ }
3875
+ if (x < 1e4) {
3876
+ return x < 1e3 ? 2 : 3;
3877
+ }
3878
+ return 4;
3879
+ }
3880
+ if (x < 1e7) {
3881
+ return x < 1e6 ? 5 : 6;
3882
+ }
3883
+ if (x < 1e9) {
3884
+ return x < 1e8 ? 7 : 8;
3885
+ }
3886
+ return 9;
3887
+ }
3888
+ function alphabeticalCompare(a, b) {
3889
+ if (a === b) {
3890
+ return 0;
3891
+ }
3892
+ if (~~a === a && ~~b === b) {
3893
+ if (a === 0 || b === 0) {
3894
+ return a < b ? -1 : 1;
3895
+ }
3896
+ if (a < 0 || b < 0) {
3897
+ if (b >= 0) {
3898
+ return -1;
3899
+ }
3900
+ if (a >= 0) {
3901
+ return 1;
3902
+ }
3903
+ a = -a;
3904
+ b = -b;
3905
+ }
3906
+ var al = log10(a);
3907
+ var bl = log10(b);
3908
+ var t = 0;
3909
+ if (al < bl) {
3910
+ a *= POWERS_OF_TEN[bl - al - 1];
3911
+ b /= 10;
3912
+ t = -1;
3913
+ } else if (al > bl) {
3914
+ b *= POWERS_OF_TEN[al - bl - 1];
3915
+ a /= 10;
3916
+ t = 1;
3917
+ }
3918
+ if (a === b) {
3919
+ return t;
3920
+ }
3921
+ return a < b ? -1 : 1;
3922
+ }
3923
+ var aStr = String(a);
3924
+ var bStr = String(b);
3925
+ if (aStr === bStr) {
3926
+ return 0;
3927
+ }
3928
+ return aStr < bStr ? -1 : 1;
3929
+ }
3930
+ function minRunLength(n) {
3931
+ var r = 0;
3932
+ while (n >= DEFAULT_MIN_MERGE) {
3933
+ r |= n & 1;
3934
+ n >>= 1;
3935
+ }
3936
+ return n + r;
3937
+ }
3938
+ function makeAscendingRun(array, lo, hi, compare) {
3939
+ var runHi = lo + 1;
3940
+ if (runHi === hi) {
3941
+ return 1;
3942
+ }
3943
+ if (compare(array[runHi++], array[lo]) < 0) {
3944
+ while (runHi < hi && compare(array[runHi], array[runHi - 1]) < 0) {
3945
+ runHi++;
3946
+ }
3947
+ reverseRun(array, lo, runHi);
3948
+ } else {
3949
+ while (runHi < hi && compare(array[runHi], array[runHi - 1]) >= 0) {
3950
+ runHi++;
3951
+ }
3952
+ }
3953
+ return runHi - lo;
3954
+ }
3955
+ function reverseRun(array, lo, hi) {
3956
+ hi--;
3957
+ while (lo < hi) {
3958
+ var t = array[lo];
3959
+ array[lo++] = array[hi];
3960
+ array[hi--] = t;
3961
+ }
3962
+ }
3963
+ function binaryInsertionSort(array, lo, hi, start, compare) {
3964
+ if (start === lo) {
3965
+ start++;
3966
+ }
3967
+ for (; start < hi; start++) {
3968
+ var pivot = array[start];
3969
+ var left = lo;
3970
+ var right = start;
3971
+ while (left < right) {
3972
+ var mid = left + right >>> 1;
3973
+ if (compare(pivot, array[mid]) < 0) {
3974
+ right = mid;
3975
+ } else {
3976
+ left = mid + 1;
3977
+ }
3978
+ }
3979
+ var n = start - left;
3980
+ switch (n) {
3981
+ case 3:
3982
+ array[left + 3] = array[left + 2];
3983
+ case 2:
3984
+ array[left + 2] = array[left + 1];
3985
+ case 1:
3986
+ array[left + 1] = array[left];
3987
+ break;
3988
+ default:
3989
+ while (n > 0) {
3990
+ array[left + n] = array[left + n - 1];
3991
+ n--;
3992
+ }
3993
+ }
3994
+ array[left] = pivot;
3995
+ }
3996
+ }
3997
+ function gallopLeft(value, array, start, length, hint, compare) {
3998
+ var lastOffset = 0;
3999
+ var maxOffset = 0;
4000
+ var offset = 1;
4001
+ if (compare(value, array[start + hint]) > 0) {
4002
+ maxOffset = length - hint;
4003
+ while (offset < maxOffset && compare(value, array[start + hint + offset]) > 0) {
4004
+ lastOffset = offset;
4005
+ offset = (offset << 1) + 1;
4006
+ if (offset <= 0) {
4007
+ offset = maxOffset;
4008
+ }
4009
+ }
4010
+ if (offset > maxOffset) {
4011
+ offset = maxOffset;
4012
+ }
4013
+ lastOffset += hint;
4014
+ offset += hint;
4015
+ } else {
4016
+ maxOffset = hint + 1;
4017
+ while (offset < maxOffset && compare(value, array[start + hint - offset]) <= 0) {
4018
+ lastOffset = offset;
4019
+ offset = (offset << 1) + 1;
4020
+ if (offset <= 0) {
4021
+ offset = maxOffset;
4022
+ }
4023
+ }
4024
+ if (offset > maxOffset) {
4025
+ offset = maxOffset;
4026
+ }
4027
+ var tmp = lastOffset;
4028
+ lastOffset = hint - offset;
4029
+ offset = hint - tmp;
4030
+ }
4031
+ lastOffset++;
4032
+ while (lastOffset < offset) {
4033
+ var m = lastOffset + (offset - lastOffset >>> 1);
4034
+ if (compare(value, array[start + m]) > 0) {
4035
+ lastOffset = m + 1;
4036
+ } else {
4037
+ offset = m;
4038
+ }
4039
+ }
4040
+ return offset;
4041
+ }
4042
+ function gallopRight(value, array, start, length, hint, compare) {
4043
+ var lastOffset = 0;
4044
+ var maxOffset = 0;
4045
+ var offset = 1;
4046
+ if (compare(value, array[start + hint]) < 0) {
4047
+ maxOffset = hint + 1;
4048
+ while (offset < maxOffset && compare(value, array[start + hint - offset]) < 0) {
4049
+ lastOffset = offset;
4050
+ offset = (offset << 1) + 1;
4051
+ if (offset <= 0) {
4052
+ offset = maxOffset;
4053
+ }
4054
+ }
4055
+ if (offset > maxOffset) {
4056
+ offset = maxOffset;
4057
+ }
4058
+ var tmp = lastOffset;
4059
+ lastOffset = hint - offset;
4060
+ offset = hint - tmp;
4061
+ } else {
4062
+ maxOffset = length - hint;
4063
+ while (offset < maxOffset && compare(value, array[start + hint + offset]) >= 0) {
4064
+ lastOffset = offset;
4065
+ offset = (offset << 1) + 1;
4066
+ if (offset <= 0) {
4067
+ offset = maxOffset;
4068
+ }
4069
+ }
4070
+ if (offset > maxOffset) {
4071
+ offset = maxOffset;
4072
+ }
4073
+ lastOffset += hint;
4074
+ offset += hint;
4075
+ }
4076
+ lastOffset++;
4077
+ while (lastOffset < offset) {
4078
+ var m = lastOffset + (offset - lastOffset >>> 1);
4079
+ if (compare(value, array[start + m]) < 0) {
4080
+ offset = m;
4081
+ } else {
4082
+ lastOffset = m + 1;
4083
+ }
4084
+ }
4085
+ return offset;
4086
+ }
4087
+ var TimSort = (function() {
4088
+ function TimSort2(array, compare) {
4089
+ _classCallCheck(this, TimSort2);
4090
+ this.array = null;
4091
+ this.compare = null;
4092
+ this.minGallop = DEFAULT_MIN_GALLOPING;
4093
+ this.length = 0;
4094
+ this.tmpStorageLength = DEFAULT_TMP_STORAGE_LENGTH;
4095
+ this.stackLength = 0;
4096
+ this.runStart = null;
4097
+ this.runLength = null;
4098
+ this.stackSize = 0;
4099
+ this.array = array;
4100
+ this.compare = compare;
4101
+ this.length = array.length;
4102
+ if (this.length < 2 * DEFAULT_TMP_STORAGE_LENGTH) {
4103
+ this.tmpStorageLength = this.length >>> 1;
4104
+ }
4105
+ this.tmp = new Array(this.tmpStorageLength);
4106
+ this.stackLength = this.length < 120 ? 5 : this.length < 1542 ? 10 : this.length < 119151 ? 19 : 40;
4107
+ this.runStart = new Array(this.stackLength);
4108
+ this.runLength = new Array(this.stackLength);
4109
+ }
4110
+ TimSort2.prototype.pushRun = function pushRun(runStart, runLength) {
4111
+ this.runStart[this.stackSize] = runStart;
4112
+ this.runLength[this.stackSize] = runLength;
4113
+ this.stackSize += 1;
4114
+ };
4115
+ TimSort2.prototype.mergeRuns = function mergeRuns() {
4116
+ while (this.stackSize > 1) {
4117
+ var n = this.stackSize - 2;
4118
+ if (n >= 1 && this.runLength[n - 1] <= this.runLength[n] + this.runLength[n + 1] || n >= 2 && this.runLength[n - 2] <= this.runLength[n] + this.runLength[n - 1]) {
4119
+ if (this.runLength[n - 1] < this.runLength[n + 1]) {
4120
+ n--;
4121
+ }
4122
+ } else if (this.runLength[n] > this.runLength[n + 1]) {
4123
+ break;
4124
+ }
4125
+ this.mergeAt(n);
4126
+ }
4127
+ };
4128
+ TimSort2.prototype.forceMergeRuns = function forceMergeRuns() {
4129
+ while (this.stackSize > 1) {
4130
+ var n = this.stackSize - 2;
4131
+ if (n > 0 && this.runLength[n - 1] < this.runLength[n + 1]) {
4132
+ n--;
4133
+ }
4134
+ this.mergeAt(n);
4135
+ }
4136
+ };
4137
+ TimSort2.prototype.mergeAt = function mergeAt(i) {
4138
+ var compare = this.compare;
4139
+ var array = this.array;
4140
+ var start1 = this.runStart[i];
4141
+ var length1 = this.runLength[i];
4142
+ var start2 = this.runStart[i + 1];
4143
+ var length2 = this.runLength[i + 1];
4144
+ this.runLength[i] = length1 + length2;
4145
+ if (i === this.stackSize - 3) {
4146
+ this.runStart[i + 1] = this.runStart[i + 2];
4147
+ this.runLength[i + 1] = this.runLength[i + 2];
4148
+ }
4149
+ this.stackSize--;
4150
+ var k = gallopRight(array[start2], array, start1, length1, 0, compare);
4151
+ start1 += k;
4152
+ length1 -= k;
4153
+ if (length1 === 0) {
4154
+ return;
4155
+ }
4156
+ length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare);
4157
+ if (length2 === 0) {
4158
+ return;
4159
+ }
4160
+ if (length1 <= length2) {
4161
+ this.mergeLow(start1, length1, start2, length2);
4162
+ } else {
4163
+ this.mergeHigh(start1, length1, start2, length2);
4164
+ }
4165
+ };
4166
+ TimSort2.prototype.mergeLow = function mergeLow(start1, length1, start2, length2) {
4167
+ var compare = this.compare;
4168
+ var array = this.array;
4169
+ var tmp = this.tmp;
4170
+ var i = 0;
4171
+ for (i = 0; i < length1; i++) {
4172
+ tmp[i] = array[start1 + i];
4173
+ }
4174
+ var cursor1 = 0;
4175
+ var cursor2 = start2;
4176
+ var dest = start1;
4177
+ array[dest++] = array[cursor2++];
4178
+ if (--length2 === 0) {
4179
+ for (i = 0; i < length1; i++) {
4180
+ array[dest + i] = tmp[cursor1 + i];
4181
+ }
4182
+ return;
4183
+ }
4184
+ if (length1 === 1) {
4185
+ for (i = 0; i < length2; i++) {
4186
+ array[dest + i] = array[cursor2 + i];
4187
+ }
4188
+ array[dest + length2] = tmp[cursor1];
4189
+ return;
4190
+ }
4191
+ var minGallop = this.minGallop;
4192
+ while (true) {
4193
+ var count1 = 0;
4194
+ var count2 = 0;
4195
+ var exit = false;
4196
+ do {
4197
+ if (compare(array[cursor2], tmp[cursor1]) < 0) {
4198
+ array[dest++] = array[cursor2++];
4199
+ count2++;
4200
+ count1 = 0;
4201
+ if (--length2 === 0) {
4202
+ exit = true;
4203
+ break;
4204
+ }
4205
+ } else {
4206
+ array[dest++] = tmp[cursor1++];
4207
+ count1++;
4208
+ count2 = 0;
4209
+ if (--length1 === 1) {
4210
+ exit = true;
4211
+ break;
4212
+ }
4213
+ }
4214
+ } while ((count1 | count2) < minGallop);
4215
+ if (exit) {
4216
+ break;
4217
+ }
4218
+ do {
4219
+ count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare);
4220
+ if (count1 !== 0) {
4221
+ for (i = 0; i < count1; i++) {
4222
+ array[dest + i] = tmp[cursor1 + i];
4223
+ }
4224
+ dest += count1;
4225
+ cursor1 += count1;
4226
+ length1 -= count1;
4227
+ if (length1 <= 1) {
4228
+ exit = true;
4229
+ break;
4230
+ }
4231
+ }
4232
+ array[dest++] = array[cursor2++];
4233
+ if (--length2 === 0) {
4234
+ exit = true;
4235
+ break;
4236
+ }
4237
+ count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare);
4238
+ if (count2 !== 0) {
4239
+ for (i = 0; i < count2; i++) {
4240
+ array[dest + i] = array[cursor2 + i];
4241
+ }
4242
+ dest += count2;
4243
+ cursor2 += count2;
4244
+ length2 -= count2;
4245
+ if (length2 === 0) {
4246
+ exit = true;
4247
+ break;
4248
+ }
4249
+ }
4250
+ array[dest++] = tmp[cursor1++];
4251
+ if (--length1 === 1) {
4252
+ exit = true;
4253
+ break;
4254
+ }
4255
+ minGallop--;
4256
+ } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);
4257
+ if (exit) {
4258
+ break;
4259
+ }
4260
+ if (minGallop < 0) {
4261
+ minGallop = 0;
4262
+ }
4263
+ minGallop += 2;
4264
+ }
4265
+ this.minGallop = minGallop;
4266
+ if (minGallop < 1) {
4267
+ this.minGallop = 1;
4268
+ }
4269
+ if (length1 === 1) {
4270
+ for (i = 0; i < length2; i++) {
4271
+ array[dest + i] = array[cursor2 + i];
4272
+ }
4273
+ array[dest + length2] = tmp[cursor1];
4274
+ } else if (length1 === 0) {
4275
+ throw new Error("mergeLow preconditions were not respected");
4276
+ } else {
4277
+ for (i = 0; i < length1; i++) {
4278
+ array[dest + i] = tmp[cursor1 + i];
4279
+ }
4280
+ }
4281
+ };
4282
+ TimSort2.prototype.mergeHigh = function mergeHigh(start1, length1, start2, length2) {
4283
+ var compare = this.compare;
4284
+ var array = this.array;
4285
+ var tmp = this.tmp;
4286
+ var i = 0;
4287
+ for (i = 0; i < length2; i++) {
4288
+ tmp[i] = array[start2 + i];
4289
+ }
4290
+ var cursor1 = start1 + length1 - 1;
4291
+ var cursor2 = length2 - 1;
4292
+ var dest = start2 + length2 - 1;
4293
+ var customCursor = 0;
4294
+ var customDest = 0;
4295
+ array[dest--] = array[cursor1--];
4296
+ if (--length1 === 0) {
4297
+ customCursor = dest - (length2 - 1);
4298
+ for (i = 0; i < length2; i++) {
4299
+ array[customCursor + i] = tmp[i];
4300
+ }
4301
+ return;
4302
+ }
4303
+ if (length2 === 1) {
4304
+ dest -= length1;
4305
+ cursor1 -= length1;
4306
+ customDest = dest + 1;
4307
+ customCursor = cursor1 + 1;
4308
+ for (i = length1 - 1; i >= 0; i--) {
4309
+ array[customDest + i] = array[customCursor + i];
4310
+ }
4311
+ array[dest] = tmp[cursor2];
4312
+ return;
4313
+ }
4314
+ var minGallop = this.minGallop;
4315
+ while (true) {
4316
+ var count1 = 0;
4317
+ var count2 = 0;
4318
+ var exit = false;
4319
+ do {
4320
+ if (compare(tmp[cursor2], array[cursor1]) < 0) {
4321
+ array[dest--] = array[cursor1--];
4322
+ count1++;
4323
+ count2 = 0;
4324
+ if (--length1 === 0) {
4325
+ exit = true;
4326
+ break;
4327
+ }
4328
+ } else {
4329
+ array[dest--] = tmp[cursor2--];
4330
+ count2++;
4331
+ count1 = 0;
4332
+ if (--length2 === 1) {
4333
+ exit = true;
4334
+ break;
4335
+ }
4336
+ }
4337
+ } while ((count1 | count2) < minGallop);
4338
+ if (exit) {
4339
+ break;
4340
+ }
4341
+ do {
4342
+ count1 = length1 - gallopRight(tmp[cursor2], array, start1, length1, length1 - 1, compare);
4343
+ if (count1 !== 0) {
4344
+ dest -= count1;
4345
+ cursor1 -= count1;
4346
+ length1 -= count1;
4347
+ customDest = dest + 1;
4348
+ customCursor = cursor1 + 1;
4349
+ for (i = count1 - 1; i >= 0; i--) {
4350
+ array[customDest + i] = array[customCursor + i];
4351
+ }
4352
+ if (length1 === 0) {
4353
+ exit = true;
4354
+ break;
4355
+ }
4356
+ }
4357
+ array[dest--] = tmp[cursor2--];
4358
+ if (--length2 === 1) {
4359
+ exit = true;
4360
+ break;
4361
+ }
4362
+ count2 = length2 - gallopLeft(array[cursor1], tmp, 0, length2, length2 - 1, compare);
4363
+ if (count2 !== 0) {
4364
+ dest -= count2;
4365
+ cursor2 -= count2;
4366
+ length2 -= count2;
4367
+ customDest = dest + 1;
4368
+ customCursor = cursor2 + 1;
4369
+ for (i = 0; i < count2; i++) {
4370
+ array[customDest + i] = tmp[customCursor + i];
4371
+ }
4372
+ if (length2 <= 1) {
4373
+ exit = true;
4374
+ break;
4375
+ }
4376
+ }
4377
+ array[dest--] = array[cursor1--];
4378
+ if (--length1 === 0) {
4379
+ exit = true;
4380
+ break;
4381
+ }
4382
+ minGallop--;
4383
+ } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);
4384
+ if (exit) {
4385
+ break;
4386
+ }
4387
+ if (minGallop < 0) {
4388
+ minGallop = 0;
4389
+ }
4390
+ minGallop += 2;
4391
+ }
4392
+ this.minGallop = minGallop;
4393
+ if (minGallop < 1) {
4394
+ this.minGallop = 1;
4395
+ }
4396
+ if (length2 === 1) {
4397
+ dest -= length1;
4398
+ cursor1 -= length1;
4399
+ customDest = dest + 1;
4400
+ customCursor = cursor1 + 1;
4401
+ for (i = length1 - 1; i >= 0; i--) {
4402
+ array[customDest + i] = array[customCursor + i];
4403
+ }
4404
+ array[dest] = tmp[cursor2];
4405
+ } else if (length2 === 0) {
4406
+ throw new Error("mergeHigh preconditions were not respected");
4407
+ } else {
4408
+ customCursor = dest - (length2 - 1);
4409
+ for (i = 0; i < length2; i++) {
4410
+ array[customCursor + i] = tmp[i];
4411
+ }
4412
+ }
4413
+ };
4414
+ return TimSort2;
4415
+ })();
4416
+ function sort(array, compare, lo, hi) {
4417
+ if (!Array.isArray(array)) {
4418
+ throw new TypeError("Can only sort arrays");
4419
+ }
4420
+ if (!compare) {
4421
+ compare = alphabeticalCompare;
4422
+ } else if (typeof compare !== "function") {
4423
+ hi = lo;
4424
+ lo = compare;
4425
+ compare = alphabeticalCompare;
4426
+ }
4427
+ if (!lo) {
4428
+ lo = 0;
4429
+ }
4430
+ if (!hi) {
4431
+ hi = array.length;
4432
+ }
4433
+ var remaining = hi - lo;
4434
+ if (remaining < 2) {
4435
+ return;
4436
+ }
4437
+ var runLength = 0;
4438
+ if (remaining < DEFAULT_MIN_MERGE) {
4439
+ runLength = makeAscendingRun(array, lo, hi, compare);
4440
+ binaryInsertionSort(array, lo, hi, lo + runLength, compare);
4441
+ return;
4442
+ }
4443
+ var ts = new TimSort(array, compare);
4444
+ var minRun = minRunLength(remaining);
4445
+ do {
4446
+ runLength = makeAscendingRun(array, lo, hi, compare);
4447
+ if (runLength < minRun) {
4448
+ var force = remaining;
4449
+ if (force > minRun) {
4450
+ force = minRun;
4451
+ }
4452
+ binaryInsertionSort(array, lo, lo + force, lo + runLength, compare);
4453
+ runLength = force;
4454
+ }
4455
+ ts.pushRun(lo, runLength);
4456
+ ts.mergeRuns();
4457
+ remaining -= runLength;
4458
+ lo += runLength;
4459
+ } while (remaining !== 0);
4460
+ ts.forceMergeRuns();
4461
+ }
4462
+ });
4463
+ })(timsort$1);
4464
+ return timsort$1;
4465
+ }
4466
+ var timsort;
4467
+ var hasRequiredTimsort;
4468
+ function requireTimsort() {
4469
+ if (hasRequiredTimsort) return timsort;
4470
+ hasRequiredTimsort = 1;
4471
+ timsort = requireTimsort$1();
4472
+ return timsort;
4473
+ }
4474
+ requireTimsort();
4475
+ new TextEncoder();
4476
+ new TextDecoder();
4477
+ class ExtData {
4478
+ type;
4479
+ data;
4480
+ constructor(type, data) {
4481
+ this.type = type;
4482
+ this.data = data;
4483
+ }
4484
+ }
4485
+ class DecodeError extends Error {
4486
+ constructor(message) {
4487
+ super(message);
4488
+ const proto = Object.create(DecodeError.prototype);
4489
+ Object.setPrototypeOf(this, proto);
4490
+ Object.defineProperty(this, "name", {
4491
+ configurable: true,
4492
+ enumerable: false,
4493
+ value: DecodeError.name
4494
+ });
4495
+ }
4496
+ }
4497
+ function setInt64(view, offset, value) {
4498
+ const high = Math.floor(value / 4294967296);
4499
+ const low = value;
4500
+ view.setUint32(offset, high);
4501
+ view.setUint32(offset + 4, low);
4502
+ }
4503
+ function getInt64(view, offset) {
4504
+ const high = view.getInt32(offset);
4505
+ const low = view.getUint32(offset + 4);
4506
+ return high * 4294967296 + low;
4507
+ }
4508
+ const EXT_TIMESTAMP = -1;
4509
+ const TIMESTAMP32_MAX_SEC = 4294967296 - 1;
4510
+ const TIMESTAMP64_MAX_SEC = 17179869184 - 1;
4511
+ function encodeTimeSpecToTimestamp({ sec, nsec }) {
4512
+ if (sec >= 0 && nsec >= 0 && sec <= TIMESTAMP64_MAX_SEC) {
4513
+ if (nsec === 0 && sec <= TIMESTAMP32_MAX_SEC) {
4514
+ const rv = new Uint8Array(4);
4515
+ const view = new DataView(rv.buffer);
4516
+ view.setUint32(0, sec);
4517
+ return rv;
4518
+ } else {
4519
+ const secHigh = sec / 4294967296;
4520
+ const secLow = sec & 4294967295;
4521
+ const rv = new Uint8Array(8);
4522
+ const view = new DataView(rv.buffer);
4523
+ view.setUint32(0, nsec << 2 | secHigh & 3);
4524
+ view.setUint32(4, secLow);
4525
+ return rv;
4526
+ }
4527
+ } else {
4528
+ const rv = new Uint8Array(12);
4529
+ const view = new DataView(rv.buffer);
4530
+ view.setUint32(0, nsec);
4531
+ setInt64(view, 4, sec);
4532
+ return rv;
4533
+ }
4534
+ }
4535
+ function encodeDateToTimeSpec(date) {
4536
+ const msec = date.getTime();
4537
+ const sec = Math.floor(msec / 1e3);
4538
+ const nsec = (msec - sec * 1e3) * 1e6;
4539
+ const nsecInSec = Math.floor(nsec / 1e9);
4540
+ return {
4541
+ sec: sec + nsecInSec,
4542
+ nsec: nsec - nsecInSec * 1e9
4543
+ };
4544
+ }
4545
+ function encodeTimestampExtension(object) {
4546
+ if (object instanceof Date) {
4547
+ const timeSpec = encodeDateToTimeSpec(object);
4548
+ return encodeTimeSpecToTimestamp(timeSpec);
4549
+ } else {
4550
+ return null;
4551
+ }
4552
+ }
4553
+ function decodeTimestampToTimeSpec(data) {
4554
+ const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
4555
+ switch (data.byteLength) {
4556
+ case 4: {
4557
+ const sec = view.getUint32(0);
4558
+ const nsec = 0;
4559
+ return { sec, nsec };
4560
+ }
4561
+ case 8: {
4562
+ const nsec30AndSecHigh2 = view.getUint32(0);
4563
+ const secLow32 = view.getUint32(4);
4564
+ const sec = (nsec30AndSecHigh2 & 3) * 4294967296 + secLow32;
4565
+ const nsec = nsec30AndSecHigh2 >>> 2;
4566
+ return { sec, nsec };
4567
+ }
4568
+ case 12: {
4569
+ const sec = getInt64(view, 4);
4570
+ const nsec = view.getUint32(0);
4571
+ return { sec, nsec };
4572
+ }
4573
+ default:
4574
+ throw new DecodeError(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${data.length}`);
4575
+ }
4576
+ }
4577
+ function decodeTimestampExtension(data) {
4578
+ const timeSpec = decodeTimestampToTimeSpec(data);
4579
+ return new Date(timeSpec.sec * 1e3 + timeSpec.nsec / 1e6);
4580
+ }
4581
+ const timestampExtension = {
4582
+ type: EXT_TIMESTAMP,
4583
+ encode: encodeTimestampExtension,
4584
+ decode: decodeTimestampExtension
4585
+ };
4586
+ class ExtensionCodec {
4587
+ static defaultCodec = new ExtensionCodec();
4588
+ // ensures ExtensionCodecType<X> matches ExtensionCodec<X>
4589
+ // this will make type errors a lot more clear
4590
+ // eslint-disable-next-line @typescript-eslint/naming-convention
4591
+ __brand;
4592
+ // built-in extensions
4593
+ builtInEncoders = [];
4594
+ builtInDecoders = [];
4595
+ // custom extensions
4596
+ encoders = [];
4597
+ decoders = [];
4598
+ constructor() {
4599
+ this.register(timestampExtension);
4600
+ }
4601
+ register({ type, encode: encode2, decode }) {
4602
+ if (type >= 0) {
4603
+ this.encoders[type] = encode2;
4604
+ this.decoders[type] = decode;
4605
+ } else {
4606
+ const index = -1 - type;
4607
+ this.builtInEncoders[index] = encode2;
4608
+ this.builtInDecoders[index] = decode;
4609
+ }
4610
+ }
4611
+ tryToEncode(object, context) {
4612
+ for (let i = 0; i < this.builtInEncoders.length; i++) {
4613
+ const encodeExt = this.builtInEncoders[i];
4614
+ if (encodeExt != null) {
4615
+ const data = encodeExt(object, context);
4616
+ if (data != null) {
4617
+ const type = -1 - i;
4618
+ return new ExtData(type, data);
4619
+ }
4620
+ }
4621
+ }
4622
+ for (let i = 0; i < this.encoders.length; i++) {
4623
+ const encodeExt = this.encoders[i];
4624
+ if (encodeExt != null) {
4625
+ const data = encodeExt(object, context);
4626
+ if (data != null) {
4627
+ const type = i;
4628
+ return new ExtData(type, data);
4629
+ }
4630
+ }
4631
+ }
4632
+ if (object instanceof ExtData) {
4633
+ return object;
4634
+ }
4635
+ return null;
4636
+ }
4637
+ decode(data, type, context) {
4638
+ const decodeExt = type < 0 ? this.builtInDecoders[-1 - type] : this.decoders[type];
4639
+ if (decodeExt) {
4640
+ return decodeExt(data, type, context);
4641
+ } else {
4642
+ return new ExtData(type, data);
4643
+ }
4644
+ }
4645
+ }
4646
+ const STSInstrumentControllerPluginKey = /* @__PURE__ */ Symbol("instrumentController");
4647
+ const instrumentationObservationInterval = 1e3;
4648
+ const instrumentationTimeWindow = 600;
4649
+ const consoleLogging = false;
4650
+ const instrumentLogging = true;
4651
+ ({
4652
+ coreFieldList: [
4653
+ { fieldName: "requestCount", gauge: Gauge.REQUEST_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4654
+ { fieldName: "errorCount", gauge: Gauge.ERROR_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4655
+ { fieldName: "retryCount", gauge: Gauge.RETRY_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4656
+ { fieldName: "authenticationCount", gauge: Gauge.AUTHENTICATION_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4657
+ { fieldName: "authenticationErrorCount", gauge: Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4658
+ { fieldName: "authenticationRetryCount", gauge: Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4659
+ { fieldName: "velocity", gauge: Gauge.VELOCITY_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
4660
+ {
4661
+ fieldName: "activeRequestCount",
4662
+ gauge: Gauge.ACTIVE_REQUEST_GAUGE,
4663
+ instrumentProperty: "val",
4664
+ dataType: "number",
4665
+ timeSeriesIndex: true,
4666
+ quantile: true,
4667
+ influxdbDataType: "intField",
4668
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
4669
+ instrumentOptions: {
4670
+ interval: instrumentationObservationInterval,
4671
+ sampleSize: instrumentationTimeWindow
4672
+ }
4673
+ },
4674
+ { fieldName: "coreCount", gauge: Gauge.CORE_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4675
+ { fieldName: "rx", gauge: Gauge.NETWORK_RX_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
4676
+ { fieldName: "tx", gauge: Gauge.NETWORK_TX_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
4677
+ { fieldName: "timer", gauge: Gauge.TIMER_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_TIMER },
4678
+ {
4679
+ fieldName: "duration",
4680
+ gauge: Gauge.DURATION_GAUGE,
4681
+ instrumentProperty: "val",
4682
+ dataType: "number",
4683
+ timeSeriesIndex: true,
4684
+ quantile: true,
4685
+ influxdbDataType: "floatField",
4686
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
4687
+ instrumentOptions: {
4688
+ interval: instrumentationObservationInterval,
4689
+ sampleSize: instrumentationTimeWindow
4690
+ },
4691
+ histo: [
4692
+ { label: "B10", bucketLimit: 10 },
4693
+ { label: "B20", bucketLimit: 20 },
4694
+ { label: "B50", bucketLimit: 50 },
4695
+ { label: "B100", bucketLimit: 100 },
4696
+ { label: "B1000", bucketLimit: 1e3 },
4697
+ { label: "B50000", bucketLimit: 5e4 },
4698
+ { label: "BInfinity", bucketLimit: -1 }
4699
+ ],
4700
+ histoGauge: Gauge.DURATION_HISTOGRAM_GAUGE
4701
+ },
4702
+ {
4703
+ fieldName: "latency",
4704
+ gauge: Gauge.LATENCY_GAUGE,
4705
+ instrumentProperty: "val",
4706
+ dataType: "number",
4707
+ timeSeriesIndex: true,
4708
+ quantile: true,
4709
+ influxdbDataType: "floatField",
4710
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
4711
+ instrumentOptions: {
4712
+ interval: instrumentationObservationInterval,
4713
+ sampleSize: instrumentationTimeWindow
4714
+ },
4715
+ histo: [
4716
+ { label: "B10", bucketLimit: 10 },
4717
+ { label: "B20", bucketLimit: 20 },
4718
+ { label: "B50", bucketLimit: 50 },
4719
+ { label: "B100", bucketLimit: 100 },
4720
+ { label: "B1000", bucketLimit: 1e3 },
4721
+ { label: "B50000", bucketLimit: 5e4 },
4722
+ { label: "BInfinity", bucketLimit: -1 }
4723
+ ],
4724
+ histoGauge: Gauge.LATENCY_HISTOGRAM_GAUGE
4725
+ }
4726
+ ],
4727
+ logFieldList: [
4728
+ {
4729
+ fieldName: "log",
4730
+ gauge: Gauge.LOGGER,
4731
+ instrumentProperty: "val",
4732
+ dataType: "string",
4733
+ timeSeriesIndex: false,
4734
+ quantile: false,
4735
+ influxdbDataType: "stringField",
4736
+ gaugeType: GaugeTypes.INSTRUMENT_LOG,
4737
+ instrumentOptions: {
4738
+ consoleLogging,
4739
+ instrumentLogging
4740
+ }
4741
+ }
4742
+ ],
4743
+ services: {
4744
+ ["service"]: {
4745
+ fieldList: [
4746
+ {
4747
+ fieldName: "cpu",
4748
+ gauge: Gauge.CPU_LOAD_GAUGE,
4749
+ instrumentProperty: "val",
4750
+ dataType: "number",
4751
+ timeSeriesIndex: true,
4752
+ quantile: true,
4753
+ influxdbDataType: "floatField",
4754
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
4755
+ instrumentOptions: {
4756
+ interval: instrumentationObservationInterval,
4757
+ sampleSize: instrumentationTimeWindow
4758
+ }
4759
+ },
4760
+ {
4761
+ fieldName: "connectionCount",
4762
+ gauge: Gauge.CONNECTION_COUNT_GAUGE,
4763
+ instrumentProperty: "val",
4764
+ dataType: "number",
4765
+ timeSeriesIndex: true,
4766
+ quantile: true,
4767
+ influxdbDataType: "intField",
4768
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
4769
+ instrumentOptions: {
4770
+ interval: instrumentationObservationInterval,
4771
+ sampleSize: instrumentationTimeWindow
4772
+ }
4773
+ },
4774
+ { fieldName: "connectionPoolCount", gauge: Gauge.CONNECTION_POOL_TOTAL_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4775
+ { fieldName: "connectionIdleCount", gauge: Gauge.CONNECTION_POOL_IDLE_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4776
+ { fieldName: "connectionWaitingCount", gauge: Gauge.CONNECTION_POOL_WAITING_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4777
+ { fieldName: "systemcpu", gauge: Gauge.CPU_SYSTEM_LOAD_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4778
+ {
4779
+ fieldName: "memory",
4780
+ gauge: Gauge.OBJECT_GAUGE,
4781
+ instrumentProperty: "val",
4782
+ dataType: "JSON",
4783
+ influxdbDataType: "stringField",
4784
+ gaugeType: GaugeTypes.INSTRUMENT_OBJECT,
4785
+ instrumentOptions: {
4786
+ label: "InstrumentObjectMaster"
4787
+ }
4788
+ }
4789
+ ],
4790
+ subscriptionTopics: [
4791
+ {
4792
+ subscriptionTopic: SubscriptionTopic.AllServicesCombined,
4793
+ route: "/metrics"
4794
+ },
4795
+ {
4796
+ subscriptionTopic: SubscriptionTopic.Services,
4797
+ route: "/metrics/services"
4798
+ },
4799
+ {
4800
+ subscriptionTopic: SubscriptionTopic.ServiceInstances,
4801
+ route: "/metrics/services/:key"
4802
+ },
4803
+ {
4804
+ subscriptionTopic: SubscriptionTopic.ServiceInstance,
4805
+ route: "/metrics/services/:key/:subkey"
4806
+ }
4807
+ ]
4808
+ },
4809
+ ["agent"]: {
4810
+ fieldList: [
4811
+ { fieldName: "childCount", gauge: Gauge.CHILD_COUNT, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE }
4812
+ ],
4813
+ subscriptionTopics: [
4814
+ {
4815
+ subscriptionTopic: SubscriptionTopic.AllAgentsCombined,
4816
+ route: "/metrics"
4817
+ },
4818
+ {
4819
+ subscriptionTopic: SubscriptionTopic.Agents,
4820
+ route: "/metrics/agents"
4821
+ },
4822
+ {
4823
+ subscriptionTopic: SubscriptionTopic.AgentWorkers,
4824
+ route: "/metrics/agents/:key"
4825
+ },
4826
+ {
4827
+ subscriptionTopic: SubscriptionTopic.AgentWorker,
4828
+ route: "/metrics/agents/:key/:subkey"
4829
+ }
4830
+ ]
4831
+ },
4832
+ ["lambda"]: {
4833
+ fieldList: [
4834
+ { fieldName: "cpu", gauge: Gauge.CPU_LOAD_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4835
+ { fieldName: "connectionCount", gauge: Gauge.CONNECTION_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4836
+ { fieldName: "connectionPoolCount", gauge: Gauge.CONNECTION_POOL_TOTAL_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4837
+ { fieldName: "connectionIdleCount", gauge: Gauge.CONNECTION_POOL_IDLE_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4838
+ { fieldName: "connectionWaitingCount", gauge: Gauge.CONNECTION_POOL_WAITING_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4839
+ { fieldName: "systemcpu", gauge: Gauge.CPU_SYSTEM_LOAD_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4840
+ { fieldName: "memory", gauge: Gauge.OBJECT_GAUGE, instrumentProperty: "val", dataType: "JSON", influxdbDataType: "stringField", gaugeType: GaugeTypes.INSTRUMENT_OBJECT }
4841
+ ],
4842
+ subscriptionTopics: [
4843
+ {
4844
+ subscriptionTopic: SubscriptionTopic.AllLambdasCombined,
4845
+ // uicontrollerlanding
4846
+ route: "/metrics"
4847
+ },
4848
+ {
4849
+ subscriptionTopic: SubscriptionTopic.LambdaTechnologies,
4850
+ // uicontrollerlambda
4851
+ route: "/metrics/lambdas"
4852
+ },
4853
+ {
4854
+ subscriptionTopic: SubscriptionTopic.LambdaSubTechnologies,
4855
+ // uicontrollerlambdasubtechnologies
4856
+ route: "/metrics/lambdas/:key"
4857
+ },
4858
+ {
4859
+ subscriptionTopic: SubscriptionTopic.LambdaSubTechnologiesInstance,
4860
+ // uicontrollerlambdasubtechnologiesinstance
4861
+ route: "/metrics/lambdas/:key/:subkey"
4862
+ }
4863
+ ]
4864
+ }
4865
+ }
4866
+ });
4867
+ const byteToHex = [];
4868
+ for (let i = 0; i < 256; ++i) {
4869
+ byteToHex.push((i + 256).toString(16).slice(1));
4870
+ }
4871
+ typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
1620
4872
  class STSOAuth2Manager {
1621
4873
  #router = null;
1622
4874
  #STORAGE_AUTHORIZE_OPTIONS_KEY = "authorize_options.stsmda.com.au";
@@ -1638,8 +4890,8 @@ class STSOAuth2Manager {
1638
4890
  constructor(app, options) {
1639
4891
  this.#options = options;
1640
4892
  if (!isNode) {
1641
- if (app.config.globalProperties.$sts[stsobservability.STSInstrumentControllerPluginKey]) {
1642
- const STSInstrumentController = app.config.globalProperties.$sts[stsobservability.STSInstrumentControllerPluginKey];
4893
+ if (app.config.globalProperties.$sts[STSInstrumentControllerPluginKey]) {
4894
+ const STSInstrumentController = app.config.globalProperties.$sts[STSInstrumentControllerPluginKey];
1643
4895
  this.#aic = STSInstrumentController;
1644
4896
  }
1645
4897
  this.#router = app.config.globalProperties.$router;
@@ -1980,7 +5232,7 @@ var hasRequiredCore;
1980
5232
  function requireCore() {
1981
5233
  if (hasRequiredCore) return core$1.exports;
1982
5234
  hasRequiredCore = 1;
1983
- (function(module2, exports2) {
5235
+ (function(module2, exports$1) {
1984
5236
  (function(root, factory) {
1985
5237
  {
1986
5238
  module2.exports = factory();
@@ -2587,7 +5839,7 @@ var hasRequiredSha256;
2587
5839
  function requireSha256() {
2588
5840
  if (hasRequiredSha256) return sha256$2.exports;
2589
5841
  hasRequiredSha256 = 1;
2590
- (function(module2, exports2) {
5842
+ (function(module2, exports$1) {
2591
5843
  (function(root, factory) {
2592
5844
  {
2593
5845
  module2.exports = factory(requireCore());
@@ -2710,7 +5962,7 @@ var hasRequiredEncBase64;
2710
5962
  function requireEncBase64() {
2711
5963
  if (hasRequiredEncBase64) return encBase64$1.exports;
2712
5964
  hasRequiredEncBase64 = 1;
2713
- (function(module2, exports2) {
5965
+ (function(module2, exports$1) {
2714
5966
  (function(root, factory) {
2715
5967
  {
2716
5968
  module2.exports = factory(requireCore());