@nsshunt/stsobservability 1.0.92 → 1.0.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/stsobservability.mjs +1055 -1003
- package/dist/stsobservability.mjs.map +1 -1
- package/dist/stsobservability.umd.js +1137 -1085
- package/dist/stsobservability.umd.js.map +1 -1
- package/package.json +6 -6
|
@@ -1197,675 +1197,696 @@ SetVal_fn4 = function(updatedValue) {
|
|
|
1197
1197
|
__privateSet(this, _start, performance.now() - updatedValue);
|
|
1198
1198
|
}
|
|
1199
1199
|
};
|
|
1200
|
-
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
1201
1200
|
function getDefaultExportFromCjs(x) {
|
|
1202
1201
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
1203
1202
|
}
|
|
1204
1203
|
var timsort$1 = {};
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
var DEFAULT_TMP_STORAGE_LENGTH = 256;
|
|
1221
|
-
var POWERS_OF_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9];
|
|
1222
|
-
function log10(x) {
|
|
1223
|
-
if (x < 1e5) {
|
|
1224
|
-
if (x < 100) {
|
|
1225
|
-
return x < 10 ? 0 : 1;
|
|
1226
|
-
}
|
|
1227
|
-
if (x < 1e4) {
|
|
1228
|
-
return x < 1e3 ? 2 : 3;
|
|
1204
|
+
var hasRequiredTimsort$1;
|
|
1205
|
+
function requireTimsort$1() {
|
|
1206
|
+
if (hasRequiredTimsort$1) return timsort$1;
|
|
1207
|
+
hasRequiredTimsort$1 = 1;
|
|
1208
|
+
(function(exports) {
|
|
1209
|
+
(function(global, factory) {
|
|
1210
|
+
{
|
|
1211
|
+
factory(exports);
|
|
1212
|
+
}
|
|
1213
|
+
})(timsort$1, function(exports2) {
|
|
1214
|
+
exports2.__esModule = true;
|
|
1215
|
+
exports2.sort = sort;
|
|
1216
|
+
function _classCallCheck(instance, Constructor) {
|
|
1217
|
+
if (!(instance instanceof Constructor)) {
|
|
1218
|
+
throw new TypeError("Cannot call a class as a function");
|
|
1229
1219
|
}
|
|
1230
|
-
return 4;
|
|
1231
|
-
}
|
|
1232
|
-
if (x < 1e7) {
|
|
1233
|
-
return x < 1e6 ? 5 : 6;
|
|
1234
|
-
}
|
|
1235
|
-
if (x < 1e9) {
|
|
1236
|
-
return x < 1e8 ? 7 : 8;
|
|
1237
|
-
}
|
|
1238
|
-
return 9;
|
|
1239
|
-
}
|
|
1240
|
-
function alphabeticalCompare(a, b) {
|
|
1241
|
-
if (a === b) {
|
|
1242
|
-
return 0;
|
|
1243
1220
|
}
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1221
|
+
var DEFAULT_MIN_MERGE = 32;
|
|
1222
|
+
var DEFAULT_MIN_GALLOPING = 7;
|
|
1223
|
+
var DEFAULT_TMP_STORAGE_LENGTH = 256;
|
|
1224
|
+
var POWERS_OF_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9];
|
|
1225
|
+
function log10(x) {
|
|
1226
|
+
if (x < 1e5) {
|
|
1227
|
+
if (x < 100) {
|
|
1228
|
+
return x < 10 ? 0 : 1;
|
|
1251
1229
|
}
|
|
1252
|
-
if (
|
|
1253
|
-
return
|
|
1230
|
+
if (x < 1e4) {
|
|
1231
|
+
return x < 1e3 ? 2 : 3;
|
|
1254
1232
|
}
|
|
1255
|
-
|
|
1256
|
-
b = -b;
|
|
1233
|
+
return 4;
|
|
1257
1234
|
}
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
var t = 0;
|
|
1261
|
-
if (al < bl) {
|
|
1262
|
-
a *= POWERS_OF_TEN[bl - al - 1];
|
|
1263
|
-
b /= 10;
|
|
1264
|
-
t = -1;
|
|
1265
|
-
} else if (al > bl) {
|
|
1266
|
-
b *= POWERS_OF_TEN[al - bl - 1];
|
|
1267
|
-
a /= 10;
|
|
1268
|
-
t = 1;
|
|
1235
|
+
if (x < 1e7) {
|
|
1236
|
+
return x < 1e6 ? 5 : 6;
|
|
1269
1237
|
}
|
|
1270
|
-
if (
|
|
1271
|
-
return
|
|
1238
|
+
if (x < 1e9) {
|
|
1239
|
+
return x < 1e8 ? 7 : 8;
|
|
1272
1240
|
}
|
|
1273
|
-
return
|
|
1241
|
+
return 9;
|
|
1274
1242
|
}
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
return 0;
|
|
1279
|
-
}
|
|
1280
|
-
return aStr < bStr ? -1 : 1;
|
|
1281
|
-
}
|
|
1282
|
-
function minRunLength(n) {
|
|
1283
|
-
var r = 0;
|
|
1284
|
-
while (n >= DEFAULT_MIN_MERGE) {
|
|
1285
|
-
r |= n & 1;
|
|
1286
|
-
n >>= 1;
|
|
1287
|
-
}
|
|
1288
|
-
return n + r;
|
|
1289
|
-
}
|
|
1290
|
-
function makeAscendingRun(array, lo, hi, compare) {
|
|
1291
|
-
var runHi = lo + 1;
|
|
1292
|
-
if (runHi === hi) {
|
|
1293
|
-
return 1;
|
|
1294
|
-
}
|
|
1295
|
-
if (compare(array[runHi++], array[lo]) < 0) {
|
|
1296
|
-
while (runHi < hi && compare(array[runHi], array[runHi - 1]) < 0) {
|
|
1297
|
-
runHi++;
|
|
1243
|
+
function alphabeticalCompare(a, b) {
|
|
1244
|
+
if (a === b) {
|
|
1245
|
+
return 0;
|
|
1298
1246
|
}
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1247
|
+
if (~~a === a && ~~b === b) {
|
|
1248
|
+
if (a === 0 || b === 0) {
|
|
1249
|
+
return a < b ? -1 : 1;
|
|
1250
|
+
}
|
|
1251
|
+
if (a < 0 || b < 0) {
|
|
1252
|
+
if (b >= 0) {
|
|
1253
|
+
return -1;
|
|
1254
|
+
}
|
|
1255
|
+
if (a >= 0) {
|
|
1256
|
+
return 1;
|
|
1257
|
+
}
|
|
1258
|
+
a = -a;
|
|
1259
|
+
b = -b;
|
|
1260
|
+
}
|
|
1261
|
+
var al = log10(a);
|
|
1262
|
+
var bl = log10(b);
|
|
1263
|
+
var t = 0;
|
|
1264
|
+
if (al < bl) {
|
|
1265
|
+
a *= POWERS_OF_TEN[bl - al - 1];
|
|
1266
|
+
b /= 10;
|
|
1267
|
+
t = -1;
|
|
1268
|
+
} else if (al > bl) {
|
|
1269
|
+
b *= POWERS_OF_TEN[al - bl - 1];
|
|
1270
|
+
a /= 10;
|
|
1271
|
+
t = 1;
|
|
1272
|
+
}
|
|
1273
|
+
if (a === b) {
|
|
1274
|
+
return t;
|
|
1275
|
+
}
|
|
1276
|
+
return a < b ? -1 : 1;
|
|
1303
1277
|
}
|
|
1278
|
+
var aStr = String(a);
|
|
1279
|
+
var bStr = String(b);
|
|
1280
|
+
if (aStr === bStr) {
|
|
1281
|
+
return 0;
|
|
1282
|
+
}
|
|
1283
|
+
return aStr < bStr ? -1 : 1;
|
|
1304
1284
|
}
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
array[hi--] = t;
|
|
1313
|
-
}
|
|
1314
|
-
}
|
|
1315
|
-
function binaryInsertionSort(array, lo, hi, start, compare) {
|
|
1316
|
-
if (start === lo) {
|
|
1317
|
-
start++;
|
|
1285
|
+
function minRunLength(n) {
|
|
1286
|
+
var r = 0;
|
|
1287
|
+
while (n >= DEFAULT_MIN_MERGE) {
|
|
1288
|
+
r |= n & 1;
|
|
1289
|
+
n >>= 1;
|
|
1290
|
+
}
|
|
1291
|
+
return n + r;
|
|
1318
1292
|
}
|
|
1319
|
-
|
|
1320
|
-
var
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
}
|
|
1328
|
-
|
|
1293
|
+
function makeAscendingRun(array, lo, hi, compare) {
|
|
1294
|
+
var runHi = lo + 1;
|
|
1295
|
+
if (runHi === hi) {
|
|
1296
|
+
return 1;
|
|
1297
|
+
}
|
|
1298
|
+
if (compare(array[runHi++], array[lo]) < 0) {
|
|
1299
|
+
while (runHi < hi && compare(array[runHi], array[runHi - 1]) < 0) {
|
|
1300
|
+
runHi++;
|
|
1301
|
+
}
|
|
1302
|
+
reverseRun(array, lo, runHi);
|
|
1303
|
+
} else {
|
|
1304
|
+
while (runHi < hi && compare(array[runHi], array[runHi - 1]) >= 0) {
|
|
1305
|
+
runHi++;
|
|
1329
1306
|
}
|
|
1330
1307
|
}
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
break;
|
|
1340
|
-
default:
|
|
1341
|
-
while (n > 0) {
|
|
1342
|
-
array[left + n] = array[left + n - 1];
|
|
1343
|
-
n--;
|
|
1344
|
-
}
|
|
1308
|
+
return runHi - lo;
|
|
1309
|
+
}
|
|
1310
|
+
function reverseRun(array, lo, hi) {
|
|
1311
|
+
hi--;
|
|
1312
|
+
while (lo < hi) {
|
|
1313
|
+
var t = array[lo];
|
|
1314
|
+
array[lo++] = array[hi];
|
|
1315
|
+
array[hi--] = t;
|
|
1345
1316
|
}
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
var lastOffset = 0;
|
|
1351
|
-
var maxOffset = 0;
|
|
1352
|
-
var offset = 1;
|
|
1353
|
-
if (compare(value, array[start + hint]) > 0) {
|
|
1354
|
-
maxOffset = length - hint;
|
|
1355
|
-
while (offset < maxOffset && compare(value, array[start + hint + offset]) > 0) {
|
|
1356
|
-
lastOffset = offset;
|
|
1357
|
-
offset = (offset << 1) + 1;
|
|
1358
|
-
if (offset <= 0) {
|
|
1359
|
-
offset = maxOffset;
|
|
1360
|
-
}
|
|
1317
|
+
}
|
|
1318
|
+
function binaryInsertionSort(array, lo, hi, start, compare) {
|
|
1319
|
+
if (start === lo) {
|
|
1320
|
+
start++;
|
|
1361
1321
|
}
|
|
1362
|
-
|
|
1363
|
-
|
|
1322
|
+
for (; start < hi; start++) {
|
|
1323
|
+
var pivot = array[start];
|
|
1324
|
+
var left = lo;
|
|
1325
|
+
var right = start;
|
|
1326
|
+
while (left < right) {
|
|
1327
|
+
var mid = left + right >>> 1;
|
|
1328
|
+
if (compare(pivot, array[mid]) < 0) {
|
|
1329
|
+
right = mid;
|
|
1330
|
+
} else {
|
|
1331
|
+
left = mid + 1;
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
var n = start - left;
|
|
1335
|
+
switch (n) {
|
|
1336
|
+
case 3:
|
|
1337
|
+
array[left + 3] = array[left + 2];
|
|
1338
|
+
case 2:
|
|
1339
|
+
array[left + 2] = array[left + 1];
|
|
1340
|
+
case 1:
|
|
1341
|
+
array[left + 1] = array[left];
|
|
1342
|
+
break;
|
|
1343
|
+
default:
|
|
1344
|
+
while (n > 0) {
|
|
1345
|
+
array[left + n] = array[left + n - 1];
|
|
1346
|
+
n--;
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
array[left] = pivot;
|
|
1364
1350
|
}
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
maxOffset =
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1351
|
+
}
|
|
1352
|
+
function gallopLeft(value, array, start, length, hint, compare) {
|
|
1353
|
+
var lastOffset = 0;
|
|
1354
|
+
var maxOffset = 0;
|
|
1355
|
+
var offset = 1;
|
|
1356
|
+
if (compare(value, array[start + hint]) > 0) {
|
|
1357
|
+
maxOffset = length - hint;
|
|
1358
|
+
while (offset < maxOffset && compare(value, array[start + hint + offset]) > 0) {
|
|
1359
|
+
lastOffset = offset;
|
|
1360
|
+
offset = (offset << 1) + 1;
|
|
1361
|
+
if (offset <= 0) {
|
|
1362
|
+
offset = maxOffset;
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
if (offset > maxOffset) {
|
|
1373
1366
|
offset = maxOffset;
|
|
1374
1367
|
}
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
offset = maxOffset;
|
|
1378
|
-
}
|
|
1379
|
-
var tmp = lastOffset;
|
|
1380
|
-
lastOffset = hint - offset;
|
|
1381
|
-
offset = hint - tmp;
|
|
1382
|
-
}
|
|
1383
|
-
lastOffset++;
|
|
1384
|
-
while (lastOffset < offset) {
|
|
1385
|
-
var m = lastOffset + (offset - lastOffset >>> 1);
|
|
1386
|
-
if (compare(value, array[start + m]) > 0) {
|
|
1387
|
-
lastOffset = m + 1;
|
|
1368
|
+
lastOffset += hint;
|
|
1369
|
+
offset += hint;
|
|
1388
1370
|
} else {
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
if (compare(value, array[start + hint]) < 0) {
|
|
1399
|
-
maxOffset = hint + 1;
|
|
1400
|
-
while (offset < maxOffset && compare(value, array[start + hint - offset]) < 0) {
|
|
1401
|
-
lastOffset = offset;
|
|
1402
|
-
offset = (offset << 1) + 1;
|
|
1403
|
-
if (offset <= 0) {
|
|
1371
|
+
maxOffset = hint + 1;
|
|
1372
|
+
while (offset < maxOffset && compare(value, array[start + hint - offset]) <= 0) {
|
|
1373
|
+
lastOffset = offset;
|
|
1374
|
+
offset = (offset << 1) + 1;
|
|
1375
|
+
if (offset <= 0) {
|
|
1376
|
+
offset = maxOffset;
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
if (offset > maxOffset) {
|
|
1404
1380
|
offset = maxOffset;
|
|
1405
1381
|
}
|
|
1382
|
+
var tmp = lastOffset;
|
|
1383
|
+
lastOffset = hint - offset;
|
|
1384
|
+
offset = hint - tmp;
|
|
1406
1385
|
}
|
|
1407
|
-
|
|
1408
|
-
|
|
1386
|
+
lastOffset++;
|
|
1387
|
+
while (lastOffset < offset) {
|
|
1388
|
+
var m = lastOffset + (offset - lastOffset >>> 1);
|
|
1389
|
+
if (compare(value, array[start + m]) > 0) {
|
|
1390
|
+
lastOffset = m + 1;
|
|
1391
|
+
} else {
|
|
1392
|
+
offset = m;
|
|
1393
|
+
}
|
|
1409
1394
|
}
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
maxOffset =
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1395
|
+
return offset;
|
|
1396
|
+
}
|
|
1397
|
+
function gallopRight(value, array, start, length, hint, compare) {
|
|
1398
|
+
var lastOffset = 0;
|
|
1399
|
+
var maxOffset = 0;
|
|
1400
|
+
var offset = 1;
|
|
1401
|
+
if (compare(value, array[start + hint]) < 0) {
|
|
1402
|
+
maxOffset = hint + 1;
|
|
1403
|
+
while (offset < maxOffset && compare(value, array[start + hint - offset]) < 0) {
|
|
1404
|
+
lastOffset = offset;
|
|
1405
|
+
offset = (offset << 1) + 1;
|
|
1406
|
+
if (offset <= 0) {
|
|
1407
|
+
offset = maxOffset;
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
if (offset > maxOffset) {
|
|
1419
1411
|
offset = maxOffset;
|
|
1420
1412
|
}
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
offset =
|
|
1424
|
-
}
|
|
1425
|
-
lastOffset += hint;
|
|
1426
|
-
offset += hint;
|
|
1427
|
-
}
|
|
1428
|
-
lastOffset++;
|
|
1429
|
-
while (lastOffset < offset) {
|
|
1430
|
-
var m = lastOffset + (offset - lastOffset >>> 1);
|
|
1431
|
-
if (compare(value, array[start + m]) < 0) {
|
|
1432
|
-
offset = m;
|
|
1413
|
+
var tmp = lastOffset;
|
|
1414
|
+
lastOffset = hint - offset;
|
|
1415
|
+
offset = hint - tmp;
|
|
1433
1416
|
} else {
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
function TimSort2(array, compare) {
|
|
1441
|
-
_classCallCheck(this, TimSort2);
|
|
1442
|
-
this.array = null;
|
|
1443
|
-
this.compare = null;
|
|
1444
|
-
this.minGallop = DEFAULT_MIN_GALLOPING;
|
|
1445
|
-
this.length = 0;
|
|
1446
|
-
this.tmpStorageLength = DEFAULT_TMP_STORAGE_LENGTH;
|
|
1447
|
-
this.stackLength = 0;
|
|
1448
|
-
this.runStart = null;
|
|
1449
|
-
this.runLength = null;
|
|
1450
|
-
this.stackSize = 0;
|
|
1451
|
-
this.array = array;
|
|
1452
|
-
this.compare = compare;
|
|
1453
|
-
this.length = array.length;
|
|
1454
|
-
if (this.length < 2 * DEFAULT_TMP_STORAGE_LENGTH) {
|
|
1455
|
-
this.tmpStorageLength = this.length >>> 1;
|
|
1456
|
-
}
|
|
1457
|
-
this.tmp = new Array(this.tmpStorageLength);
|
|
1458
|
-
this.stackLength = this.length < 120 ? 5 : this.length < 1542 ? 10 : this.length < 119151 ? 19 : 40;
|
|
1459
|
-
this.runStart = new Array(this.stackLength);
|
|
1460
|
-
this.runLength = new Array(this.stackLength);
|
|
1461
|
-
}
|
|
1462
|
-
TimSort2.prototype.pushRun = function pushRun(runStart, runLength) {
|
|
1463
|
-
this.runStart[this.stackSize] = runStart;
|
|
1464
|
-
this.runLength[this.stackSize] = runLength;
|
|
1465
|
-
this.stackSize += 1;
|
|
1466
|
-
};
|
|
1467
|
-
TimSort2.prototype.mergeRuns = function mergeRuns() {
|
|
1468
|
-
while (this.stackSize > 1) {
|
|
1469
|
-
var n = this.stackSize - 2;
|
|
1470
|
-
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]) {
|
|
1471
|
-
if (this.runLength[n - 1] < this.runLength[n + 1]) {
|
|
1472
|
-
n--;
|
|
1417
|
+
maxOffset = length - hint;
|
|
1418
|
+
while (offset < maxOffset && compare(value, array[start + hint + offset]) >= 0) {
|
|
1419
|
+
lastOffset = offset;
|
|
1420
|
+
offset = (offset << 1) + 1;
|
|
1421
|
+
if (offset <= 0) {
|
|
1422
|
+
offset = maxOffset;
|
|
1473
1423
|
}
|
|
1474
|
-
} else if (this.runLength[n] > this.runLength[n + 1]) {
|
|
1475
|
-
break;
|
|
1476
1424
|
}
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
};
|
|
1480
|
-
TimSort2.prototype.forceMergeRuns = function forceMergeRuns() {
|
|
1481
|
-
while (this.stackSize > 1) {
|
|
1482
|
-
var n = this.stackSize - 2;
|
|
1483
|
-
if (n > 0 && this.runLength[n - 1] < this.runLength[n + 1]) {
|
|
1484
|
-
n--;
|
|
1425
|
+
if (offset > maxOffset) {
|
|
1426
|
+
offset = maxOffset;
|
|
1485
1427
|
}
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
};
|
|
1489
|
-
TimSort2.prototype.mergeAt = function mergeAt(i) {
|
|
1490
|
-
var compare = this.compare;
|
|
1491
|
-
var array = this.array;
|
|
1492
|
-
var start1 = this.runStart[i];
|
|
1493
|
-
var length1 = this.runLength[i];
|
|
1494
|
-
var start2 = this.runStart[i + 1];
|
|
1495
|
-
var length2 = this.runLength[i + 1];
|
|
1496
|
-
this.runLength[i] = length1 + length2;
|
|
1497
|
-
if (i === this.stackSize - 3) {
|
|
1498
|
-
this.runStart[i + 1] = this.runStart[i + 2];
|
|
1499
|
-
this.runLength[i + 1] = this.runLength[i + 2];
|
|
1500
|
-
}
|
|
1501
|
-
this.stackSize--;
|
|
1502
|
-
var k = gallopRight(array[start2], array, start1, length1, 0, compare);
|
|
1503
|
-
start1 += k;
|
|
1504
|
-
length1 -= k;
|
|
1505
|
-
if (length1 === 0) {
|
|
1506
|
-
return;
|
|
1507
|
-
}
|
|
1508
|
-
length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare);
|
|
1509
|
-
if (length2 === 0) {
|
|
1510
|
-
return;
|
|
1428
|
+
lastOffset += hint;
|
|
1429
|
+
offset += hint;
|
|
1511
1430
|
}
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1431
|
+
lastOffset++;
|
|
1432
|
+
while (lastOffset < offset) {
|
|
1433
|
+
var m = lastOffset + (offset - lastOffset >>> 1);
|
|
1434
|
+
if (compare(value, array[start + m]) < 0) {
|
|
1435
|
+
offset = m;
|
|
1436
|
+
} else {
|
|
1437
|
+
lastOffset = m + 1;
|
|
1438
|
+
}
|
|
1516
1439
|
}
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1440
|
+
return offset;
|
|
1441
|
+
}
|
|
1442
|
+
var TimSort = function() {
|
|
1443
|
+
function TimSort2(array, compare) {
|
|
1444
|
+
_classCallCheck(this, TimSort2);
|
|
1445
|
+
this.array = null;
|
|
1446
|
+
this.compare = null;
|
|
1447
|
+
this.minGallop = DEFAULT_MIN_GALLOPING;
|
|
1448
|
+
this.length = 0;
|
|
1449
|
+
this.tmpStorageLength = DEFAULT_TMP_STORAGE_LENGTH;
|
|
1450
|
+
this.stackLength = 0;
|
|
1451
|
+
this.runStart = null;
|
|
1452
|
+
this.runLength = null;
|
|
1453
|
+
this.stackSize = 0;
|
|
1454
|
+
this.array = array;
|
|
1455
|
+
this.compare = compare;
|
|
1456
|
+
this.length = array.length;
|
|
1457
|
+
if (this.length < 2 * DEFAULT_TMP_STORAGE_LENGTH) {
|
|
1458
|
+
this.tmpStorageLength = this.length >>> 1;
|
|
1459
|
+
}
|
|
1460
|
+
this.tmp = new Array(this.tmpStorageLength);
|
|
1461
|
+
this.stackLength = this.length < 120 ? 5 : this.length < 1542 ? 10 : this.length < 119151 ? 19 : 40;
|
|
1462
|
+
this.runStart = new Array(this.stackLength);
|
|
1463
|
+
this.runLength = new Array(this.stackLength);
|
|
1525
1464
|
}
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1465
|
+
TimSort2.prototype.pushRun = function pushRun(runStart, runLength) {
|
|
1466
|
+
this.runStart[this.stackSize] = runStart;
|
|
1467
|
+
this.runLength[this.stackSize] = runLength;
|
|
1468
|
+
this.stackSize += 1;
|
|
1469
|
+
};
|
|
1470
|
+
TimSort2.prototype.mergeRuns = function mergeRuns() {
|
|
1471
|
+
while (this.stackSize > 1) {
|
|
1472
|
+
var n = this.stackSize - 2;
|
|
1473
|
+
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]) {
|
|
1474
|
+
if (this.runLength[n - 1] < this.runLength[n + 1]) {
|
|
1475
|
+
n--;
|
|
1476
|
+
}
|
|
1477
|
+
} else if (this.runLength[n] > this.runLength[n + 1]) {
|
|
1478
|
+
break;
|
|
1479
|
+
}
|
|
1480
|
+
this.mergeAt(n);
|
|
1481
|
+
}
|
|
1482
|
+
};
|
|
1483
|
+
TimSort2.prototype.forceMergeRuns = function forceMergeRuns() {
|
|
1484
|
+
while (this.stackSize > 1) {
|
|
1485
|
+
var n = this.stackSize - 2;
|
|
1486
|
+
if (n > 0 && this.runLength[n - 1] < this.runLength[n + 1]) {
|
|
1487
|
+
n--;
|
|
1488
|
+
}
|
|
1489
|
+
this.mergeAt(n);
|
|
1490
|
+
}
|
|
1491
|
+
};
|
|
1492
|
+
TimSort2.prototype.mergeAt = function mergeAt(i) {
|
|
1493
|
+
var compare = this.compare;
|
|
1494
|
+
var array = this.array;
|
|
1495
|
+
var start1 = this.runStart[i];
|
|
1496
|
+
var length1 = this.runLength[i];
|
|
1497
|
+
var start2 = this.runStart[i + 1];
|
|
1498
|
+
var length2 = this.runLength[i + 1];
|
|
1499
|
+
this.runLength[i] = length1 + length2;
|
|
1500
|
+
if (i === this.stackSize - 3) {
|
|
1501
|
+
this.runStart[i + 1] = this.runStart[i + 2];
|
|
1502
|
+
this.runLength[i + 1] = this.runLength[i + 2];
|
|
1503
|
+
}
|
|
1504
|
+
this.stackSize--;
|
|
1505
|
+
var k = gallopRight(array[start2], array, start1, length1, 0, compare);
|
|
1506
|
+
start1 += k;
|
|
1507
|
+
length1 -= k;
|
|
1508
|
+
if (length1 === 0) {
|
|
1509
|
+
return;
|
|
1510
|
+
}
|
|
1511
|
+
length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare);
|
|
1512
|
+
if (length2 === 0) {
|
|
1513
|
+
return;
|
|
1514
|
+
}
|
|
1515
|
+
if (length1 <= length2) {
|
|
1516
|
+
this.mergeLow(start1, length1, start2, length2);
|
|
1517
|
+
} else {
|
|
1518
|
+
this.mergeHigh(start1, length1, start2, length2);
|
|
1519
|
+
}
|
|
1520
|
+
};
|
|
1521
|
+
TimSort2.prototype.mergeLow = function mergeLow(start1, length1, start2, length2) {
|
|
1522
|
+
var compare = this.compare;
|
|
1523
|
+
var array = this.array;
|
|
1524
|
+
var tmp = this.tmp;
|
|
1525
|
+
var i = 0;
|
|
1531
1526
|
for (i = 0; i < length1; i++) {
|
|
1532
|
-
|
|
1527
|
+
tmp[i] = array[start1 + i];
|
|
1533
1528
|
}
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1529
|
+
var cursor1 = 0;
|
|
1530
|
+
var cursor2 = start2;
|
|
1531
|
+
var dest = start1;
|
|
1532
|
+
array[dest++] = array[cursor2++];
|
|
1533
|
+
if (--length2 === 0) {
|
|
1534
|
+
for (i = 0; i < length1; i++) {
|
|
1535
|
+
array[dest + i] = tmp[cursor1 + i];
|
|
1536
|
+
}
|
|
1537
|
+
return;
|
|
1539
1538
|
}
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
var
|
|
1548
|
-
|
|
1549
|
-
|
|
1539
|
+
if (length1 === 1) {
|
|
1540
|
+
for (i = 0; i < length2; i++) {
|
|
1541
|
+
array[dest + i] = array[cursor2 + i];
|
|
1542
|
+
}
|
|
1543
|
+
array[dest + length2] = tmp[cursor1];
|
|
1544
|
+
return;
|
|
1545
|
+
}
|
|
1546
|
+
var minGallop = this.minGallop;
|
|
1547
|
+
while (true) {
|
|
1548
|
+
var count1 = 0;
|
|
1549
|
+
var count2 = 0;
|
|
1550
|
+
var exit = false;
|
|
1551
|
+
do {
|
|
1552
|
+
if (compare(array[cursor2], tmp[cursor1]) < 0) {
|
|
1553
|
+
array[dest++] = array[cursor2++];
|
|
1554
|
+
count2++;
|
|
1555
|
+
count1 = 0;
|
|
1556
|
+
if (--length2 === 0) {
|
|
1557
|
+
exit = true;
|
|
1558
|
+
break;
|
|
1559
|
+
}
|
|
1560
|
+
} else {
|
|
1561
|
+
array[dest++] = tmp[cursor1++];
|
|
1562
|
+
count1++;
|
|
1563
|
+
count2 = 0;
|
|
1564
|
+
if (--length1 === 1) {
|
|
1565
|
+
exit = true;
|
|
1566
|
+
break;
|
|
1567
|
+
}
|
|
1568
|
+
}
|
|
1569
|
+
} while ((count1 | count2) < minGallop);
|
|
1570
|
+
if (exit) {
|
|
1571
|
+
break;
|
|
1572
|
+
}
|
|
1573
|
+
do {
|
|
1574
|
+
count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare);
|
|
1575
|
+
if (count1 !== 0) {
|
|
1576
|
+
for (i = 0; i < count1; i++) {
|
|
1577
|
+
array[dest + i] = tmp[cursor1 + i];
|
|
1578
|
+
}
|
|
1579
|
+
dest += count1;
|
|
1580
|
+
cursor1 += count1;
|
|
1581
|
+
length1 -= count1;
|
|
1582
|
+
if (length1 <= 1) {
|
|
1583
|
+
exit = true;
|
|
1584
|
+
break;
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1550
1587
|
array[dest++] = array[cursor2++];
|
|
1551
|
-
count2++;
|
|
1552
|
-
count1 = 0;
|
|
1553
1588
|
if (--length2 === 0) {
|
|
1554
1589
|
exit = true;
|
|
1555
1590
|
break;
|
|
1556
1591
|
}
|
|
1557
|
-
|
|
1592
|
+
count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare);
|
|
1593
|
+
if (count2 !== 0) {
|
|
1594
|
+
for (i = 0; i < count2; i++) {
|
|
1595
|
+
array[dest + i] = array[cursor2 + i];
|
|
1596
|
+
}
|
|
1597
|
+
dest += count2;
|
|
1598
|
+
cursor2 += count2;
|
|
1599
|
+
length2 -= count2;
|
|
1600
|
+
if (length2 === 0) {
|
|
1601
|
+
exit = true;
|
|
1602
|
+
break;
|
|
1603
|
+
}
|
|
1604
|
+
}
|
|
1558
1605
|
array[dest++] = tmp[cursor1++];
|
|
1559
|
-
count1++;
|
|
1560
|
-
count2 = 0;
|
|
1561
1606
|
if (--length1 === 1) {
|
|
1562
1607
|
exit = true;
|
|
1563
1608
|
break;
|
|
1564
1609
|
}
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
break;
|
|
1569
|
-
}
|
|
1570
|
-
do {
|
|
1571
|
-
count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare);
|
|
1572
|
-
if (count1 !== 0) {
|
|
1573
|
-
for (i = 0; i < count1; i++) {
|
|
1574
|
-
array[dest + i] = tmp[cursor1 + i];
|
|
1575
|
-
}
|
|
1576
|
-
dest += count1;
|
|
1577
|
-
cursor1 += count1;
|
|
1578
|
-
length1 -= count1;
|
|
1579
|
-
if (length1 <= 1) {
|
|
1580
|
-
exit = true;
|
|
1581
|
-
break;
|
|
1582
|
-
}
|
|
1583
|
-
}
|
|
1584
|
-
array[dest++] = array[cursor2++];
|
|
1585
|
-
if (--length2 === 0) {
|
|
1586
|
-
exit = true;
|
|
1610
|
+
minGallop--;
|
|
1611
|
+
} while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);
|
|
1612
|
+
if (exit) {
|
|
1587
1613
|
break;
|
|
1588
1614
|
}
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
for (i = 0; i < count2; i++) {
|
|
1592
|
-
array[dest + i] = array[cursor2 + i];
|
|
1593
|
-
}
|
|
1594
|
-
dest += count2;
|
|
1595
|
-
cursor2 += count2;
|
|
1596
|
-
length2 -= count2;
|
|
1597
|
-
if (length2 === 0) {
|
|
1598
|
-
exit = true;
|
|
1599
|
-
break;
|
|
1600
|
-
}
|
|
1601
|
-
}
|
|
1602
|
-
array[dest++] = tmp[cursor1++];
|
|
1603
|
-
if (--length1 === 1) {
|
|
1604
|
-
exit = true;
|
|
1605
|
-
break;
|
|
1615
|
+
if (minGallop < 0) {
|
|
1616
|
+
minGallop = 0;
|
|
1606
1617
|
}
|
|
1607
|
-
minGallop
|
|
1608
|
-
} while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);
|
|
1609
|
-
if (exit) {
|
|
1610
|
-
break;
|
|
1611
|
-
}
|
|
1612
|
-
if (minGallop < 0) {
|
|
1613
|
-
minGallop = 0;
|
|
1618
|
+
minGallop += 2;
|
|
1614
1619
|
}
|
|
1615
|
-
minGallop
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
if (minGallop < 1) {
|
|
1619
|
-
this.minGallop = 1;
|
|
1620
|
-
}
|
|
1621
|
-
if (length1 === 1) {
|
|
1622
|
-
for (i = 0; i < length2; i++) {
|
|
1623
|
-
array[dest + i] = array[cursor2 + i];
|
|
1620
|
+
this.minGallop = minGallop;
|
|
1621
|
+
if (minGallop < 1) {
|
|
1622
|
+
this.minGallop = 1;
|
|
1624
1623
|
}
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1624
|
+
if (length1 === 1) {
|
|
1625
|
+
for (i = 0; i < length2; i++) {
|
|
1626
|
+
array[dest + i] = array[cursor2 + i];
|
|
1627
|
+
}
|
|
1628
|
+
array[dest + length2] = tmp[cursor1];
|
|
1629
|
+
} else if (length1 === 0) {
|
|
1630
|
+
throw new Error("mergeLow preconditions were not respected");
|
|
1631
|
+
} else {
|
|
1632
|
+
for (i = 0; i < length1; i++) {
|
|
1633
|
+
array[dest + i] = tmp[cursor1 + i];
|
|
1634
|
+
}
|
|
1631
1635
|
}
|
|
1632
|
-
}
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
var i = 0;
|
|
1639
|
-
for (i = 0; i < length2; i++) {
|
|
1640
|
-
tmp[i] = array[start2 + i];
|
|
1641
|
-
}
|
|
1642
|
-
var cursor1 = start1 + length1 - 1;
|
|
1643
|
-
var cursor2 = length2 - 1;
|
|
1644
|
-
var dest = start2 + length2 - 1;
|
|
1645
|
-
var customCursor = 0;
|
|
1646
|
-
var customDest = 0;
|
|
1647
|
-
array[dest--] = array[cursor1--];
|
|
1648
|
-
if (--length1 === 0) {
|
|
1649
|
-
customCursor = dest - (length2 - 1);
|
|
1636
|
+
};
|
|
1637
|
+
TimSort2.prototype.mergeHigh = function mergeHigh(start1, length1, start2, length2) {
|
|
1638
|
+
var compare = this.compare;
|
|
1639
|
+
var array = this.array;
|
|
1640
|
+
var tmp = this.tmp;
|
|
1641
|
+
var i = 0;
|
|
1650
1642
|
for (i = 0; i < length2; i++) {
|
|
1651
|
-
|
|
1643
|
+
tmp[i] = array[start2 + i];
|
|
1652
1644
|
}
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1645
|
+
var cursor1 = start1 + length1 - 1;
|
|
1646
|
+
var cursor2 = length2 - 1;
|
|
1647
|
+
var dest = start2 + length2 - 1;
|
|
1648
|
+
var customCursor = 0;
|
|
1649
|
+
var customDest = 0;
|
|
1650
|
+
array[dest--] = array[cursor1--];
|
|
1651
|
+
if (--length1 === 0) {
|
|
1652
|
+
customCursor = dest - (length2 - 1);
|
|
1653
|
+
for (i = 0; i < length2; i++) {
|
|
1654
|
+
array[customCursor + i] = tmp[i];
|
|
1655
|
+
}
|
|
1656
|
+
return;
|
|
1662
1657
|
}
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1658
|
+
if (length2 === 1) {
|
|
1659
|
+
dest -= length1;
|
|
1660
|
+
cursor1 -= length1;
|
|
1661
|
+
customDest = dest + 1;
|
|
1662
|
+
customCursor = cursor1 + 1;
|
|
1663
|
+
for (i = length1 - 1; i >= 0; i--) {
|
|
1664
|
+
array[customDest + i] = array[customCursor + i];
|
|
1665
|
+
}
|
|
1666
|
+
array[dest] = tmp[cursor2];
|
|
1667
|
+
return;
|
|
1668
|
+
}
|
|
1669
|
+
var minGallop = this.minGallop;
|
|
1670
|
+
while (true) {
|
|
1671
|
+
var count1 = 0;
|
|
1672
|
+
var count2 = 0;
|
|
1673
|
+
var exit = false;
|
|
1674
|
+
do {
|
|
1675
|
+
if (compare(tmp[cursor2], array[cursor1]) < 0) {
|
|
1676
|
+
array[dest--] = array[cursor1--];
|
|
1677
|
+
count1++;
|
|
1678
|
+
count2 = 0;
|
|
1679
|
+
if (--length1 === 0) {
|
|
1680
|
+
exit = true;
|
|
1681
|
+
break;
|
|
1682
|
+
}
|
|
1683
|
+
} else {
|
|
1684
|
+
array[dest--] = tmp[cursor2--];
|
|
1685
|
+
count2++;
|
|
1686
|
+
count1 = 0;
|
|
1687
|
+
if (--length2 === 1) {
|
|
1688
|
+
exit = true;
|
|
1689
|
+
break;
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
} while ((count1 | count2) < minGallop);
|
|
1693
|
+
if (exit) {
|
|
1694
|
+
break;
|
|
1695
|
+
}
|
|
1696
|
+
do {
|
|
1697
|
+
count1 = length1 - gallopRight(tmp[cursor2], array, start1, length1, length1 - 1, compare);
|
|
1698
|
+
if (count1 !== 0) {
|
|
1699
|
+
dest -= count1;
|
|
1700
|
+
cursor1 -= count1;
|
|
1701
|
+
length1 -= count1;
|
|
1702
|
+
customDest = dest + 1;
|
|
1703
|
+
customCursor = cursor1 + 1;
|
|
1704
|
+
for (i = count1 - 1; i >= 0; i--) {
|
|
1705
|
+
array[customDest + i] = array[customCursor + i];
|
|
1706
|
+
}
|
|
1707
|
+
if (length1 === 0) {
|
|
1708
|
+
exit = true;
|
|
1709
|
+
break;
|
|
1710
|
+
}
|
|
1679
1711
|
}
|
|
1680
|
-
} else {
|
|
1681
1712
|
array[dest--] = tmp[cursor2--];
|
|
1682
|
-
count2++;
|
|
1683
|
-
count1 = 0;
|
|
1684
1713
|
if (--length2 === 1) {
|
|
1685
1714
|
exit = true;
|
|
1686
1715
|
break;
|
|
1687
1716
|
}
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
array[customDest + i] = array[customCursor + i];
|
|
1717
|
+
count2 = length2 - gallopLeft(array[cursor1], tmp, 0, length2, length2 - 1, compare);
|
|
1718
|
+
if (count2 !== 0) {
|
|
1719
|
+
dest -= count2;
|
|
1720
|
+
cursor2 -= count2;
|
|
1721
|
+
length2 -= count2;
|
|
1722
|
+
customDest = dest + 1;
|
|
1723
|
+
customCursor = cursor2 + 1;
|
|
1724
|
+
for (i = 0; i < count2; i++) {
|
|
1725
|
+
array[customDest + i] = tmp[customCursor + i];
|
|
1726
|
+
}
|
|
1727
|
+
if (length2 <= 1) {
|
|
1728
|
+
exit = true;
|
|
1729
|
+
break;
|
|
1730
|
+
}
|
|
1703
1731
|
}
|
|
1704
|
-
|
|
1732
|
+
array[dest--] = array[cursor1--];
|
|
1733
|
+
if (--length1 === 0) {
|
|
1705
1734
|
exit = true;
|
|
1706
1735
|
break;
|
|
1707
1736
|
}
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
if (
|
|
1711
|
-
exit = true;
|
|
1737
|
+
minGallop--;
|
|
1738
|
+
} while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);
|
|
1739
|
+
if (exit) {
|
|
1712
1740
|
break;
|
|
1713
1741
|
}
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
dest -= count2;
|
|
1717
|
-
cursor2 -= count2;
|
|
1718
|
-
length2 -= count2;
|
|
1719
|
-
customDest = dest + 1;
|
|
1720
|
-
customCursor = cursor2 + 1;
|
|
1721
|
-
for (i = 0; i < count2; i++) {
|
|
1722
|
-
array[customDest + i] = tmp[customCursor + i];
|
|
1723
|
-
}
|
|
1724
|
-
if (length2 <= 1) {
|
|
1725
|
-
exit = true;
|
|
1726
|
-
break;
|
|
1727
|
-
}
|
|
1728
|
-
}
|
|
1729
|
-
array[dest--] = array[cursor1--];
|
|
1730
|
-
if (--length1 === 0) {
|
|
1731
|
-
exit = true;
|
|
1732
|
-
break;
|
|
1742
|
+
if (minGallop < 0) {
|
|
1743
|
+
minGallop = 0;
|
|
1733
1744
|
}
|
|
1734
|
-
minGallop
|
|
1735
|
-
} while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);
|
|
1736
|
-
if (exit) {
|
|
1737
|
-
break;
|
|
1745
|
+
minGallop += 2;
|
|
1738
1746
|
}
|
|
1739
|
-
|
|
1740
|
-
|
|
1747
|
+
this.minGallop = minGallop;
|
|
1748
|
+
if (minGallop < 1) {
|
|
1749
|
+
this.minGallop = 1;
|
|
1741
1750
|
}
|
|
1742
|
-
|
|
1751
|
+
if (length2 === 1) {
|
|
1752
|
+
dest -= length1;
|
|
1753
|
+
cursor1 -= length1;
|
|
1754
|
+
customDest = dest + 1;
|
|
1755
|
+
customCursor = cursor1 + 1;
|
|
1756
|
+
for (i = length1 - 1; i >= 0; i--) {
|
|
1757
|
+
array[customDest + i] = array[customCursor + i];
|
|
1758
|
+
}
|
|
1759
|
+
array[dest] = tmp[cursor2];
|
|
1760
|
+
} else if (length2 === 0) {
|
|
1761
|
+
throw new Error("mergeHigh preconditions were not respected");
|
|
1762
|
+
} else {
|
|
1763
|
+
customCursor = dest - (length2 - 1);
|
|
1764
|
+
for (i = 0; i < length2; i++) {
|
|
1765
|
+
array[customCursor + i] = tmp[i];
|
|
1766
|
+
}
|
|
1767
|
+
}
|
|
1768
|
+
};
|
|
1769
|
+
return TimSort2;
|
|
1770
|
+
}();
|
|
1771
|
+
function sort(array, compare, lo, hi) {
|
|
1772
|
+
if (!Array.isArray(array)) {
|
|
1773
|
+
throw new TypeError("Can only sort arrays");
|
|
1743
1774
|
}
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1775
|
+
if (!compare) {
|
|
1776
|
+
compare = alphabeticalCompare;
|
|
1777
|
+
} else if (typeof compare !== "function") {
|
|
1778
|
+
hi = lo;
|
|
1779
|
+
lo = compare;
|
|
1780
|
+
compare = alphabeticalCompare;
|
|
1747
1781
|
}
|
|
1748
|
-
if (
|
|
1749
|
-
|
|
1750
|
-
cursor1 -= length1;
|
|
1751
|
-
customDest = dest + 1;
|
|
1752
|
-
customCursor = cursor1 + 1;
|
|
1753
|
-
for (i = length1 - 1; i >= 0; i--) {
|
|
1754
|
-
array[customDest + i] = array[customCursor + i];
|
|
1755
|
-
}
|
|
1756
|
-
array[dest] = tmp[cursor2];
|
|
1757
|
-
} else if (length2 === 0) {
|
|
1758
|
-
throw new Error("mergeHigh preconditions were not respected");
|
|
1759
|
-
} else {
|
|
1760
|
-
customCursor = dest - (length2 - 1);
|
|
1761
|
-
for (i = 0; i < length2; i++) {
|
|
1762
|
-
array[customCursor + i] = tmp[i];
|
|
1763
|
-
}
|
|
1782
|
+
if (!lo) {
|
|
1783
|
+
lo = 0;
|
|
1764
1784
|
}
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
}();
|
|
1768
|
-
function sort(array, compare, lo, hi) {
|
|
1769
|
-
if (!Array.isArray(array)) {
|
|
1770
|
-
throw new TypeError("Can only sort arrays");
|
|
1771
|
-
}
|
|
1772
|
-
if (!compare) {
|
|
1773
|
-
compare = alphabeticalCompare;
|
|
1774
|
-
} else if (typeof compare !== "function") {
|
|
1775
|
-
hi = lo;
|
|
1776
|
-
lo = compare;
|
|
1777
|
-
compare = alphabeticalCompare;
|
|
1778
|
-
}
|
|
1779
|
-
if (!lo) {
|
|
1780
|
-
lo = 0;
|
|
1781
|
-
}
|
|
1782
|
-
if (!hi) {
|
|
1783
|
-
hi = array.length;
|
|
1784
|
-
}
|
|
1785
|
-
var remaining = hi - lo;
|
|
1786
|
-
if (remaining < 2) {
|
|
1787
|
-
return;
|
|
1788
|
-
}
|
|
1789
|
-
var runLength = 0;
|
|
1790
|
-
if (remaining < DEFAULT_MIN_MERGE) {
|
|
1791
|
-
runLength = makeAscendingRun(array, lo, hi, compare);
|
|
1792
|
-
binaryInsertionSort(array, lo, hi, lo + runLength, compare);
|
|
1793
|
-
return;
|
|
1794
|
-
}
|
|
1795
|
-
var ts = new TimSort(array, compare);
|
|
1796
|
-
var minRun = minRunLength(remaining);
|
|
1797
|
-
do {
|
|
1798
|
-
runLength = makeAscendingRun(array, lo, hi, compare);
|
|
1799
|
-
if (runLength < minRun) {
|
|
1800
|
-
var force = remaining;
|
|
1801
|
-
if (force > minRun) {
|
|
1802
|
-
force = minRun;
|
|
1803
|
-
}
|
|
1804
|
-
binaryInsertionSort(array, lo, lo + force, lo + runLength, compare);
|
|
1805
|
-
runLength = force;
|
|
1785
|
+
if (!hi) {
|
|
1786
|
+
hi = array.length;
|
|
1806
1787
|
}
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
}
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1788
|
+
var remaining = hi - lo;
|
|
1789
|
+
if (remaining < 2) {
|
|
1790
|
+
return;
|
|
1791
|
+
}
|
|
1792
|
+
var runLength = 0;
|
|
1793
|
+
if (remaining < DEFAULT_MIN_MERGE) {
|
|
1794
|
+
runLength = makeAscendingRun(array, lo, hi, compare);
|
|
1795
|
+
binaryInsertionSort(array, lo, hi, lo + runLength, compare);
|
|
1796
|
+
return;
|
|
1797
|
+
}
|
|
1798
|
+
var ts = new TimSort(array, compare);
|
|
1799
|
+
var minRun = minRunLength(remaining);
|
|
1800
|
+
do {
|
|
1801
|
+
runLength = makeAscendingRun(array, lo, hi, compare);
|
|
1802
|
+
if (runLength < minRun) {
|
|
1803
|
+
var force = remaining;
|
|
1804
|
+
if (force > minRun) {
|
|
1805
|
+
force = minRun;
|
|
1806
|
+
}
|
|
1807
|
+
binaryInsertionSort(array, lo, lo + force, lo + runLength, compare);
|
|
1808
|
+
runLength = force;
|
|
1809
|
+
}
|
|
1810
|
+
ts.pushRun(lo, runLength);
|
|
1811
|
+
ts.mergeRuns();
|
|
1812
|
+
remaining -= runLength;
|
|
1813
|
+
lo += runLength;
|
|
1814
|
+
} while (remaining !== 0);
|
|
1815
|
+
ts.forceMergeRuns();
|
|
1816
|
+
}
|
|
1817
|
+
});
|
|
1818
|
+
})(timsort$1);
|
|
1819
|
+
return timsort$1;
|
|
1837
1820
|
}
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
return
|
|
1821
|
+
var timsort;
|
|
1822
|
+
var hasRequiredTimsort;
|
|
1823
|
+
function requireTimsort() {
|
|
1824
|
+
if (hasRequiredTimsort) return timsort;
|
|
1825
|
+
hasRequiredTimsort = 1;
|
|
1826
|
+
timsort = requireTimsort$1();
|
|
1827
|
+
return timsort;
|
|
1842
1828
|
}
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1829
|
+
var timsortExports = requireTimsort();
|
|
1830
|
+
var lib;
|
|
1831
|
+
var hasRequiredLib;
|
|
1832
|
+
function requireLib() {
|
|
1833
|
+
if (hasRequiredLib) return lib;
|
|
1834
|
+
hasRequiredLib = 1;
|
|
1835
|
+
function lessThanZeroError(p) {
|
|
1836
|
+
return 'Expect percentile to be >= 0 but given "' + p + '" and its type is "' + typeof p + '".';
|
|
1837
|
+
}
|
|
1838
|
+
function greaterThanHundredError(p) {
|
|
1839
|
+
return 'Expect percentile to be <= 100 but given "' + p + '" and its type is "' + typeof p + '".';
|
|
1840
|
+
}
|
|
1841
|
+
function nanError(p) {
|
|
1842
|
+
return 'Expect percentile to be a number but given "' + p + '" and its type is "' + typeof p + '".';
|
|
1843
|
+
}
|
|
1844
|
+
function validateInput(ps) {
|
|
1845
|
+
return ps.reduce(function(errors, p) {
|
|
1846
|
+
if (isNaN(Number(p))) {
|
|
1847
|
+
errors.push(nanError(p));
|
|
1848
|
+
} else if (p < 0) {
|
|
1849
|
+
errors.push(lessThanZeroError(p));
|
|
1850
|
+
} else if (p > 100) {
|
|
1851
|
+
errors.push(greaterThanHundredError(p));
|
|
1852
|
+
}
|
|
1853
|
+
return errors;
|
|
1854
|
+
}, []);
|
|
1855
|
+
}
|
|
1856
|
+
function getPsValue(p, list) {
|
|
1857
|
+
if (p === 0) return list[0];
|
|
1858
|
+
var kIndex = Math.ceil(list.length * (p / 100)) - 1;
|
|
1859
|
+
return list[kIndex];
|
|
1860
|
+
}
|
|
1861
|
+
function percentile2(pOrPs, list, fn) {
|
|
1862
|
+
var ps = Array.isArray(pOrPs) ? pOrPs : [pOrPs];
|
|
1863
|
+
var validationErrors = validateInput(ps);
|
|
1864
|
+
if (validationErrors.length) {
|
|
1865
|
+
throw new Error(validationErrors.join(" "));
|
|
1866
|
+
}
|
|
1867
|
+
list = list.slice().sort(function(a, b) {
|
|
1868
|
+
if (fn) {
|
|
1869
|
+
a = fn(a);
|
|
1870
|
+
b = fn(b);
|
|
1871
|
+
}
|
|
1872
|
+
a = Number.isNaN(a) ? Number.NEGATIVE_INFINITY : a;
|
|
1873
|
+
b = Number.isNaN(b) ? Number.NEGATIVE_INFINITY : b;
|
|
1874
|
+
if (a > b) return 1;
|
|
1875
|
+
if (a < b) return -1;
|
|
1876
|
+
return 0;
|
|
1877
|
+
});
|
|
1878
|
+
if (ps.length === 1) {
|
|
1879
|
+
return getPsValue(ps[0], list);
|
|
1880
|
+
}
|
|
1881
|
+
return ps.map(function(p) {
|
|
1882
|
+
return getPsValue(p, list);
|
|
1883
|
+
});
|
|
1862
1884
|
}
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
});
|
|
1885
|
+
lib = percentile2;
|
|
1886
|
+
return lib;
|
|
1866
1887
|
}
|
|
1867
|
-
var
|
|
1868
|
-
const percentile
|
|
1888
|
+
var libExports = requireLib();
|
|
1889
|
+
const percentile = /* @__PURE__ */ getDefaultExportFromCjs(libExports);
|
|
1869
1890
|
class InstrumentGaugeOptions extends InstrumentBaseOptions {
|
|
1870
1891
|
constructor() {
|
|
1871
1892
|
super(...arguments);
|
|
@@ -2131,8 +2152,8 @@ NumberCompare_fn = function(a, b) {
|
|
|
2131
2152
|
};
|
|
2132
2153
|
GetPercentileData_fn = function() {
|
|
2133
2154
|
const sortedList = __privateGet(this, _timeSeriesList).slice(0);
|
|
2134
|
-
|
|
2135
|
-
return percentile
|
|
2155
|
+
timsortExports.sort(sortedList, __privateMethod(this, _InstrumentGauge_instances, NumberCompare_fn));
|
|
2156
|
+
return percentile([50, 80, 90, 95, 99, 99.95], sortedList);
|
|
2136
2157
|
};
|
|
2137
2158
|
class InstrumentObjectOptions extends InstrumentBaseOptions {
|
|
2138
2159
|
constructor() {
|
|
@@ -2472,7 +2493,7 @@ class RequestLoggerMiddleware extends STSOptionsBase {
|
|
|
2472
2493
|
}
|
|
2473
2494
|
_tinyEmitter = new WeakMap();
|
|
2474
2495
|
_RequestCompleted = new WeakMap();
|
|
2475
|
-
var ansiStyles
|
|
2496
|
+
var ansiStyles = { exports: {} };
|
|
2476
2497
|
var colorName;
|
|
2477
2498
|
var hasRequiredColorName;
|
|
2478
2499
|
function requireColorName() {
|
|
@@ -3435,181 +3456,200 @@ function requireColorConvert() {
|
|
|
3435
3456
|
colorConvert = convert;
|
|
3436
3457
|
return colorConvert;
|
|
3437
3458
|
}
|
|
3438
|
-
ansiStyles
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
const
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
const codes = /* @__PURE__ */ new Map();
|
|
3488
|
-
const styles2 = {
|
|
3489
|
-
modifier: {
|
|
3490
|
-
reset: [0, 0],
|
|
3491
|
-
// 21 isn't widely supported and 22 does the same thing
|
|
3492
|
-
bold: [1, 22],
|
|
3493
|
-
dim: [2, 22],
|
|
3494
|
-
italic: [3, 23],
|
|
3495
|
-
underline: [4, 24],
|
|
3496
|
-
inverse: [7, 27],
|
|
3497
|
-
hidden: [8, 28],
|
|
3498
|
-
strikethrough: [9, 29]
|
|
3499
|
-
},
|
|
3500
|
-
color: {
|
|
3501
|
-
black: [30, 39],
|
|
3502
|
-
red: [31, 39],
|
|
3503
|
-
green: [32, 39],
|
|
3504
|
-
yellow: [33, 39],
|
|
3505
|
-
blue: [34, 39],
|
|
3506
|
-
magenta: [35, 39],
|
|
3507
|
-
cyan: [36, 39],
|
|
3508
|
-
white: [37, 39],
|
|
3509
|
-
// Bright color
|
|
3510
|
-
blackBright: [90, 39],
|
|
3511
|
-
redBright: [91, 39],
|
|
3512
|
-
greenBright: [92, 39],
|
|
3513
|
-
yellowBright: [93, 39],
|
|
3514
|
-
blueBright: [94, 39],
|
|
3515
|
-
magentaBright: [95, 39],
|
|
3516
|
-
cyanBright: [96, 39],
|
|
3517
|
-
whiteBright: [97, 39]
|
|
3518
|
-
},
|
|
3519
|
-
bgColor: {
|
|
3520
|
-
bgBlack: [40, 49],
|
|
3521
|
-
bgRed: [41, 49],
|
|
3522
|
-
bgGreen: [42, 49],
|
|
3523
|
-
bgYellow: [43, 49],
|
|
3524
|
-
bgBlue: [44, 49],
|
|
3525
|
-
bgMagenta: [45, 49],
|
|
3526
|
-
bgCyan: [46, 49],
|
|
3527
|
-
bgWhite: [47, 49],
|
|
3528
|
-
// Bright color
|
|
3529
|
-
bgBlackBright: [100, 49],
|
|
3530
|
-
bgRedBright: [101, 49],
|
|
3531
|
-
bgGreenBright: [102, 49],
|
|
3532
|
-
bgYellowBright: [103, 49],
|
|
3533
|
-
bgBlueBright: [104, 49],
|
|
3534
|
-
bgMagentaBright: [105, 49],
|
|
3535
|
-
bgCyanBright: [106, 49],
|
|
3536
|
-
bgWhiteBright: [107, 49]
|
|
3459
|
+
ansiStyles.exports;
|
|
3460
|
+
var hasRequiredAnsiStyles;
|
|
3461
|
+
function requireAnsiStyles() {
|
|
3462
|
+
if (hasRequiredAnsiStyles) return ansiStyles.exports;
|
|
3463
|
+
hasRequiredAnsiStyles = 1;
|
|
3464
|
+
(function(module) {
|
|
3465
|
+
const wrapAnsi16 = (fn, offset) => (...args) => {
|
|
3466
|
+
const code = fn(...args);
|
|
3467
|
+
return `\x1B[${code + offset}m`;
|
|
3468
|
+
};
|
|
3469
|
+
const wrapAnsi256 = (fn, offset) => (...args) => {
|
|
3470
|
+
const code = fn(...args);
|
|
3471
|
+
return `\x1B[${38 + offset};5;${code}m`;
|
|
3472
|
+
};
|
|
3473
|
+
const wrapAnsi16m = (fn, offset) => (...args) => {
|
|
3474
|
+
const rgb = fn(...args);
|
|
3475
|
+
return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
|
3476
|
+
};
|
|
3477
|
+
const ansi2ansi = (n) => n;
|
|
3478
|
+
const rgb2rgb = (r, g, b) => [r, g, b];
|
|
3479
|
+
const setLazyProperty = (object, property, get) => {
|
|
3480
|
+
Object.defineProperty(object, property, {
|
|
3481
|
+
get: () => {
|
|
3482
|
+
const value = get();
|
|
3483
|
+
Object.defineProperty(object, property, {
|
|
3484
|
+
value,
|
|
3485
|
+
enumerable: true,
|
|
3486
|
+
configurable: true
|
|
3487
|
+
});
|
|
3488
|
+
return value;
|
|
3489
|
+
},
|
|
3490
|
+
enumerable: true,
|
|
3491
|
+
configurable: true
|
|
3492
|
+
});
|
|
3493
|
+
};
|
|
3494
|
+
let colorConvert2;
|
|
3495
|
+
const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
|
|
3496
|
+
if (colorConvert2 === void 0) {
|
|
3497
|
+
colorConvert2 = requireColorConvert();
|
|
3498
|
+
}
|
|
3499
|
+
const offset = isBackground ? 10 : 0;
|
|
3500
|
+
const styles = {};
|
|
3501
|
+
for (const [sourceSpace, suite] of Object.entries(colorConvert2)) {
|
|
3502
|
+
const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
|
|
3503
|
+
if (sourceSpace === targetSpace) {
|
|
3504
|
+
styles[name] = wrap(identity, offset);
|
|
3505
|
+
} else if (typeof suite === "object") {
|
|
3506
|
+
styles[name] = wrap(suite[targetSpace], offset);
|
|
3507
|
+
}
|
|
3537
3508
|
}
|
|
3509
|
+
return styles;
|
|
3538
3510
|
};
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3511
|
+
function assembleStyles() {
|
|
3512
|
+
const codes = /* @__PURE__ */ new Map();
|
|
3513
|
+
const styles = {
|
|
3514
|
+
modifier: {
|
|
3515
|
+
reset: [0, 0],
|
|
3516
|
+
// 21 isn't widely supported and 22 does the same thing
|
|
3517
|
+
bold: [1, 22],
|
|
3518
|
+
dim: [2, 22],
|
|
3519
|
+
italic: [3, 23],
|
|
3520
|
+
underline: [4, 24],
|
|
3521
|
+
inverse: [7, 27],
|
|
3522
|
+
hidden: [8, 28],
|
|
3523
|
+
strikethrough: [9, 29]
|
|
3524
|
+
},
|
|
3525
|
+
color: {
|
|
3526
|
+
black: [30, 39],
|
|
3527
|
+
red: [31, 39],
|
|
3528
|
+
green: [32, 39],
|
|
3529
|
+
yellow: [33, 39],
|
|
3530
|
+
blue: [34, 39],
|
|
3531
|
+
magenta: [35, 39],
|
|
3532
|
+
cyan: [36, 39],
|
|
3533
|
+
white: [37, 39],
|
|
3534
|
+
// Bright color
|
|
3535
|
+
blackBright: [90, 39],
|
|
3536
|
+
redBright: [91, 39],
|
|
3537
|
+
greenBright: [92, 39],
|
|
3538
|
+
yellowBright: [93, 39],
|
|
3539
|
+
blueBright: [94, 39],
|
|
3540
|
+
magentaBright: [95, 39],
|
|
3541
|
+
cyanBright: [96, 39],
|
|
3542
|
+
whiteBright: [97, 39]
|
|
3543
|
+
},
|
|
3544
|
+
bgColor: {
|
|
3545
|
+
bgBlack: [40, 49],
|
|
3546
|
+
bgRed: [41, 49],
|
|
3547
|
+
bgGreen: [42, 49],
|
|
3548
|
+
bgYellow: [43, 49],
|
|
3549
|
+
bgBlue: [44, 49],
|
|
3550
|
+
bgMagenta: [45, 49],
|
|
3551
|
+
bgCyan: [46, 49],
|
|
3552
|
+
bgWhite: [47, 49],
|
|
3553
|
+
// Bright color
|
|
3554
|
+
bgBlackBright: [100, 49],
|
|
3555
|
+
bgRedBright: [101, 49],
|
|
3556
|
+
bgGreenBright: [102, 49],
|
|
3557
|
+
bgYellowBright: [103, 49],
|
|
3558
|
+
bgBlueBright: [104, 49],
|
|
3559
|
+
bgMagentaBright: [105, 49],
|
|
3560
|
+
bgCyanBright: [106, 49],
|
|
3561
|
+
bgWhiteBright: [107, 49]
|
|
3562
|
+
}
|
|
3563
|
+
};
|
|
3564
|
+
styles.color.gray = styles.color.blackBright;
|
|
3565
|
+
styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
|
|
3566
|
+
styles.color.grey = styles.color.blackBright;
|
|
3567
|
+
styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
|
|
3568
|
+
for (const [groupName, group] of Object.entries(styles)) {
|
|
3569
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
3570
|
+
styles[styleName] = {
|
|
3571
|
+
open: `\x1B[${style[0]}m`,
|
|
3572
|
+
close: `\x1B[${style[1]}m`
|
|
3573
|
+
};
|
|
3574
|
+
group[styleName] = styles[styleName];
|
|
3575
|
+
codes.set(style[0], style[1]);
|
|
3576
|
+
}
|
|
3577
|
+
Object.defineProperty(styles, groupName, {
|
|
3578
|
+
value: group,
|
|
3579
|
+
enumerable: false
|
|
3580
|
+
});
|
|
3551
3581
|
}
|
|
3552
|
-
Object.defineProperty(
|
|
3553
|
-
value:
|
|
3582
|
+
Object.defineProperty(styles, "codes", {
|
|
3583
|
+
value: codes,
|
|
3554
3584
|
enumerable: false
|
|
3555
3585
|
});
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3586
|
+
styles.color.close = "\x1B[39m";
|
|
3587
|
+
styles.bgColor.close = "\x1B[49m";
|
|
3588
|
+
setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
|
|
3589
|
+
setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
|
|
3590
|
+
setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
|
|
3591
|
+
setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
|
|
3592
|
+
setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
|
|
3593
|
+
setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
|
|
3594
|
+
return styles;
|
|
3595
|
+
}
|
|
3596
|
+
Object.defineProperty(module, "exports", {
|
|
3597
|
+
enumerable: true,
|
|
3598
|
+
get: assembleStyles
|
|
3560
3599
|
});
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
var
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3600
|
+
})(ansiStyles);
|
|
3601
|
+
return ansiStyles.exports;
|
|
3602
|
+
}
|
|
3603
|
+
var browser;
|
|
3604
|
+
var hasRequiredBrowser;
|
|
3605
|
+
function requireBrowser() {
|
|
3606
|
+
if (hasRequiredBrowser) return browser;
|
|
3607
|
+
hasRequiredBrowser = 1;
|
|
3608
|
+
browser = {
|
|
3609
|
+
stdout: false,
|
|
3610
|
+
stderr: false
|
|
3611
|
+
};
|
|
3612
|
+
return browser;
|
|
3613
|
+
}
|
|
3614
|
+
var util;
|
|
3615
|
+
var hasRequiredUtil;
|
|
3616
|
+
function requireUtil() {
|
|
3617
|
+
if (hasRequiredUtil) return util;
|
|
3618
|
+
hasRequiredUtil = 1;
|
|
3619
|
+
const stringReplaceAll = (string, substring, replacer) => {
|
|
3620
|
+
let index = string.indexOf(substring);
|
|
3621
|
+
if (index === -1) {
|
|
3622
|
+
return string;
|
|
3623
|
+
}
|
|
3624
|
+
const substringLength = substring.length;
|
|
3625
|
+
let endIndex = 0;
|
|
3626
|
+
let returnValue = "";
|
|
3627
|
+
do {
|
|
3628
|
+
returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
|
|
3629
|
+
endIndex = index + substringLength;
|
|
3630
|
+
index = string.indexOf(substring, endIndex);
|
|
3631
|
+
} while (index !== -1);
|
|
3632
|
+
returnValue += string.substr(endIndex);
|
|
3633
|
+
return returnValue;
|
|
3634
|
+
};
|
|
3635
|
+
const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
|
|
3636
|
+
let endIndex = 0;
|
|
3637
|
+
let returnValue = "";
|
|
3638
|
+
do {
|
|
3639
|
+
const gotCR = string[index - 1] === "\r";
|
|
3640
|
+
returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
3641
|
+
endIndex = index + 1;
|
|
3642
|
+
index = string.indexOf("\n", endIndex);
|
|
3643
|
+
} while (index !== -1);
|
|
3644
|
+
returnValue += string.substr(endIndex);
|
|
3645
|
+
return returnValue;
|
|
3646
|
+
};
|
|
3647
|
+
util = {
|
|
3648
|
+
stringReplaceAll,
|
|
3649
|
+
stringEncaseCRLFWithFirstIndex
|
|
3650
|
+
};
|
|
3651
|
+
return util;
|
|
3652
|
+
}
|
|
3613
3653
|
var templates;
|
|
3614
3654
|
var hasRequiredTemplates;
|
|
3615
3655
|
function requireTemplates() {
|
|
@@ -3673,27 +3713,27 @@ function requireTemplates() {
|
|
|
3673
3713
|
}
|
|
3674
3714
|
return results;
|
|
3675
3715
|
}
|
|
3676
|
-
function buildStyle(chalk2,
|
|
3716
|
+
function buildStyle(chalk2, styles) {
|
|
3677
3717
|
const enabled = {};
|
|
3678
|
-
for (const layer of
|
|
3718
|
+
for (const layer of styles) {
|
|
3679
3719
|
for (const style of layer.styles) {
|
|
3680
3720
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
3681
3721
|
}
|
|
3682
3722
|
}
|
|
3683
3723
|
let current = chalk2;
|
|
3684
|
-
for (const [styleName,
|
|
3685
|
-
if (!Array.isArray(
|
|
3724
|
+
for (const [styleName, styles2] of Object.entries(enabled)) {
|
|
3725
|
+
if (!Array.isArray(styles2)) {
|
|
3686
3726
|
continue;
|
|
3687
3727
|
}
|
|
3688
3728
|
if (!(styleName in current)) {
|
|
3689
3729
|
throw new Error(`Unknown Chalk style: ${styleName}`);
|
|
3690
3730
|
}
|
|
3691
|
-
current =
|
|
3731
|
+
current = styles2.length > 0 ? current[styleName](...styles2) : current[styleName];
|
|
3692
3732
|
}
|
|
3693
3733
|
return current;
|
|
3694
3734
|
}
|
|
3695
3735
|
templates = (chalk2, temporary) => {
|
|
3696
|
-
const
|
|
3736
|
+
const styles = [];
|
|
3697
3737
|
const chunks = [];
|
|
3698
3738
|
let chunk = [];
|
|
3699
3739
|
temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
|
|
@@ -3702,200 +3742,208 @@ function requireTemplates() {
|
|
|
3702
3742
|
} else if (style) {
|
|
3703
3743
|
const string = chunk.join("");
|
|
3704
3744
|
chunk = [];
|
|
3705
|
-
chunks.push(
|
|
3706
|
-
|
|
3745
|
+
chunks.push(styles.length === 0 ? string : buildStyle(chalk2, styles)(string));
|
|
3746
|
+
styles.push({ inverse, styles: parseStyle(style) });
|
|
3707
3747
|
} else if (close) {
|
|
3708
|
-
if (
|
|
3748
|
+
if (styles.length === 0) {
|
|
3709
3749
|
throw new Error("Found extraneous } in Chalk template literal");
|
|
3710
3750
|
}
|
|
3711
|
-
chunks.push(buildStyle(chalk2,
|
|
3751
|
+
chunks.push(buildStyle(chalk2, styles)(chunk.join("")));
|
|
3712
3752
|
chunk = [];
|
|
3713
|
-
|
|
3753
|
+
styles.pop();
|
|
3714
3754
|
} else {
|
|
3715
3755
|
chunk.push(character);
|
|
3716
3756
|
}
|
|
3717
3757
|
});
|
|
3718
3758
|
chunks.push(chunk.join(""));
|
|
3719
|
-
if (
|
|
3720
|
-
const errMessage = `Chalk template literal is missing ${
|
|
3759
|
+
if (styles.length > 0) {
|
|
3760
|
+
const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
|
|
3721
3761
|
throw new Error(errMessage);
|
|
3722
3762
|
}
|
|
3723
3763
|
return chunks.join("");
|
|
3724
3764
|
};
|
|
3725
3765
|
return templates;
|
|
3726
3766
|
}
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
const {
|
|
3734
|
-
const
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
const
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3767
|
+
var source;
|
|
3768
|
+
var hasRequiredSource;
|
|
3769
|
+
function requireSource() {
|
|
3770
|
+
if (hasRequiredSource) return source;
|
|
3771
|
+
hasRequiredSource = 1;
|
|
3772
|
+
const ansiStyles2 = requireAnsiStyles();
|
|
3773
|
+
const { stdout: stdoutColor, stderr: stderrColor } = requireBrowser();
|
|
3774
|
+
const {
|
|
3775
|
+
stringReplaceAll,
|
|
3776
|
+
stringEncaseCRLFWithFirstIndex
|
|
3777
|
+
} = requireUtil();
|
|
3778
|
+
const { isArray } = Array;
|
|
3779
|
+
const levelMapping = [
|
|
3780
|
+
"ansi",
|
|
3781
|
+
"ansi",
|
|
3782
|
+
"ansi256",
|
|
3783
|
+
"ansi16m"
|
|
3784
|
+
];
|
|
3785
|
+
const styles = /* @__PURE__ */ Object.create(null);
|
|
3786
|
+
const applyOptions = (object, options = {}) => {
|
|
3787
|
+
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
3788
|
+
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
3789
|
+
}
|
|
3790
|
+
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
3791
|
+
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
3792
|
+
};
|
|
3793
|
+
class ChalkClass {
|
|
3794
|
+
constructor(options) {
|
|
3795
|
+
return chalkFactory(options);
|
|
3796
|
+
}
|
|
3797
|
+
}
|
|
3798
|
+
const chalkFactory = (options) => {
|
|
3799
|
+
const chalk3 = {};
|
|
3800
|
+
applyOptions(chalk3, options);
|
|
3801
|
+
chalk3.template = (...arguments_) => chalkTag(chalk3.template, ...arguments_);
|
|
3802
|
+
Object.setPrototypeOf(chalk3, Chalk.prototype);
|
|
3803
|
+
Object.setPrototypeOf(chalk3.template, chalk3);
|
|
3804
|
+
chalk3.template.constructor = () => {
|
|
3805
|
+
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
3806
|
+
};
|
|
3807
|
+
chalk3.template.Instance = ChalkClass;
|
|
3808
|
+
return chalk3.template;
|
|
3809
|
+
};
|
|
3810
|
+
function Chalk(options) {
|
|
3750
3811
|
return chalkFactory(options);
|
|
3751
3812
|
}
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
chalk2.template.Instance = ChalkClass;
|
|
3763
|
-
return chalk2.template;
|
|
3764
|
-
};
|
|
3765
|
-
function Chalk(options) {
|
|
3766
|
-
return chalkFactory(options);
|
|
3767
|
-
}
|
|
3768
|
-
for (const [styleName, style] of Object.entries(ansiStyles)) {
|
|
3769
|
-
styles[styleName] = {
|
|
3813
|
+
for (const [styleName, style] of Object.entries(ansiStyles2)) {
|
|
3814
|
+
styles[styleName] = {
|
|
3815
|
+
get() {
|
|
3816
|
+
const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
|
|
3817
|
+
Object.defineProperty(this, styleName, { value: builder });
|
|
3818
|
+
return builder;
|
|
3819
|
+
}
|
|
3820
|
+
};
|
|
3821
|
+
}
|
|
3822
|
+
styles.visible = {
|
|
3770
3823
|
get() {
|
|
3771
|
-
const builder = createBuilder(this,
|
|
3772
|
-
Object.defineProperty(this,
|
|
3824
|
+
const builder = createBuilder(this, this._styler, true);
|
|
3825
|
+
Object.defineProperty(this, "visible", { value: builder });
|
|
3773
3826
|
return builder;
|
|
3774
3827
|
}
|
|
3775
3828
|
};
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3829
|
+
const usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
|
|
3830
|
+
for (const model of usedModels) {
|
|
3831
|
+
styles[model] = {
|
|
3832
|
+
get() {
|
|
3833
|
+
const { level } = this;
|
|
3834
|
+
return function(...arguments_) {
|
|
3835
|
+
const styler = createStyler(ansiStyles2.color[levelMapping[level]][model](...arguments_), ansiStyles2.color.close, this._styler);
|
|
3836
|
+
return createBuilder(this, styler, this._isEmpty);
|
|
3837
|
+
};
|
|
3838
|
+
}
|
|
3839
|
+
};
|
|
3782
3840
|
}
|
|
3783
|
-
|
|
3784
|
-
const
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
}
|
|
3841
|
+
for (const model of usedModels) {
|
|
3842
|
+
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
3843
|
+
styles[bgModel] = {
|
|
3844
|
+
get() {
|
|
3845
|
+
const { level } = this;
|
|
3846
|
+
return function(...arguments_) {
|
|
3847
|
+
const styler = createStyler(ansiStyles2.bgColor[levelMapping[level]][model](...arguments_), ansiStyles2.bgColor.close, this._styler);
|
|
3848
|
+
return createBuilder(this, styler, this._isEmpty);
|
|
3849
|
+
};
|
|
3850
|
+
}
|
|
3851
|
+
};
|
|
3852
|
+
}
|
|
3853
|
+
const proto = Object.defineProperties(() => {
|
|
3854
|
+
}, {
|
|
3855
|
+
...styles,
|
|
3856
|
+
level: {
|
|
3857
|
+
enumerable: true,
|
|
3858
|
+
get() {
|
|
3859
|
+
return this._generator.level;
|
|
3860
|
+
},
|
|
3861
|
+
set(level) {
|
|
3862
|
+
this._generator.level = level;
|
|
3863
|
+
}
|
|
3793
3864
|
}
|
|
3794
|
-
};
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
};
|
|
3865
|
+
});
|
|
3866
|
+
const createStyler = (open, close, parent) => {
|
|
3867
|
+
let openAll;
|
|
3868
|
+
let closeAll;
|
|
3869
|
+
if (parent === void 0) {
|
|
3870
|
+
openAll = open;
|
|
3871
|
+
closeAll = close;
|
|
3872
|
+
} else {
|
|
3873
|
+
openAll = parent.openAll + open;
|
|
3874
|
+
closeAll = close + parent.closeAll;
|
|
3805
3875
|
}
|
|
3876
|
+
return {
|
|
3877
|
+
open,
|
|
3878
|
+
close,
|
|
3879
|
+
openAll,
|
|
3880
|
+
closeAll,
|
|
3881
|
+
parent
|
|
3882
|
+
};
|
|
3806
3883
|
};
|
|
3807
|
-
|
|
3808
|
-
const
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
}
|
|
3820
|
-
});
|
|
3821
|
-
const createStyler = (open, close, parent) => {
|
|
3822
|
-
let openAll;
|
|
3823
|
-
let closeAll;
|
|
3824
|
-
if (parent === void 0) {
|
|
3825
|
-
openAll = open;
|
|
3826
|
-
closeAll = close;
|
|
3827
|
-
} else {
|
|
3828
|
-
openAll = parent.openAll + open;
|
|
3829
|
-
closeAll = close + parent.closeAll;
|
|
3830
|
-
}
|
|
3831
|
-
return {
|
|
3832
|
-
open,
|
|
3833
|
-
close,
|
|
3834
|
-
openAll,
|
|
3835
|
-
closeAll,
|
|
3836
|
-
parent
|
|
3884
|
+
const createBuilder = (self, _styler, _isEmpty) => {
|
|
3885
|
+
const builder = (...arguments_) => {
|
|
3886
|
+
if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
|
|
3887
|
+
return applyStyle(builder, chalkTag(builder, ...arguments_));
|
|
3888
|
+
}
|
|
3889
|
+
return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
3890
|
+
};
|
|
3891
|
+
Object.setPrototypeOf(builder, proto);
|
|
3892
|
+
builder._generator = self;
|
|
3893
|
+
builder._styler = _styler;
|
|
3894
|
+
builder._isEmpty = _isEmpty;
|
|
3895
|
+
return builder;
|
|
3837
3896
|
};
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3897
|
+
const applyStyle = (self, string) => {
|
|
3898
|
+
if (self.level <= 0 || !string) {
|
|
3899
|
+
return self._isEmpty ? "" : string;
|
|
3900
|
+
}
|
|
3901
|
+
let styler = self._styler;
|
|
3902
|
+
if (styler === void 0) {
|
|
3903
|
+
return string;
|
|
3843
3904
|
}
|
|
3844
|
-
|
|
3905
|
+
const { openAll, closeAll } = styler;
|
|
3906
|
+
if (string.indexOf("\x1B") !== -1) {
|
|
3907
|
+
while (styler !== void 0) {
|
|
3908
|
+
string = stringReplaceAll(string, styler.close, styler.open);
|
|
3909
|
+
styler = styler.parent;
|
|
3910
|
+
}
|
|
3911
|
+
}
|
|
3912
|
+
const lfIndex = string.indexOf("\n");
|
|
3913
|
+
if (lfIndex !== -1) {
|
|
3914
|
+
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
3915
|
+
}
|
|
3916
|
+
return openAll + string + closeAll;
|
|
3845
3917
|
};
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
}
|
|
3852
|
-
const
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
}
|
|
3860
|
-
const { openAll, closeAll } = styler;
|
|
3861
|
-
if (string.indexOf("\x1B") !== -1) {
|
|
3862
|
-
while (styler !== void 0) {
|
|
3863
|
-
string = stringReplaceAll(string, styler.close, styler.open);
|
|
3864
|
-
styler = styler.parent;
|
|
3918
|
+
let template;
|
|
3919
|
+
const chalkTag = (chalk3, ...strings) => {
|
|
3920
|
+
const [firstString] = strings;
|
|
3921
|
+
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
3922
|
+
return strings.join(" ");
|
|
3923
|
+
}
|
|
3924
|
+
const arguments_ = strings.slice(1);
|
|
3925
|
+
const parts = [firstString.raw[0]];
|
|
3926
|
+
for (let i = 1; i < firstString.length; i++) {
|
|
3927
|
+
parts.push(
|
|
3928
|
+
String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"),
|
|
3929
|
+
String(firstString.raw[i])
|
|
3930
|
+
);
|
|
3865
3931
|
}
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
}
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
for (let i = 1; i < firstString.length; i++) {
|
|
3882
|
-
parts.push(
|
|
3883
|
-
String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"),
|
|
3884
|
-
String(firstString.raw[i])
|
|
3885
|
-
);
|
|
3886
|
-
}
|
|
3887
|
-
if (template === void 0) {
|
|
3888
|
-
template = requireTemplates();
|
|
3889
|
-
}
|
|
3890
|
-
return template(chalk2, parts.join(""));
|
|
3891
|
-
};
|
|
3892
|
-
Object.defineProperties(Chalk.prototype, styles);
|
|
3893
|
-
const chalk = Chalk();
|
|
3894
|
-
chalk.supportsColor = stdoutColor;
|
|
3895
|
-
chalk.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
3896
|
-
chalk.stderr.supportsColor = stderrColor;
|
|
3897
|
-
var source = chalk;
|
|
3898
|
-
const chalk$1 = /* @__PURE__ */ getDefaultExportFromCjs(source);
|
|
3932
|
+
if (template === void 0) {
|
|
3933
|
+
template = requireTemplates();
|
|
3934
|
+
}
|
|
3935
|
+
return template(chalk3, parts.join(""));
|
|
3936
|
+
};
|
|
3937
|
+
Object.defineProperties(Chalk.prototype, styles);
|
|
3938
|
+
const chalk2 = Chalk();
|
|
3939
|
+
chalk2.supportsColor = stdoutColor;
|
|
3940
|
+
chalk2.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
3941
|
+
chalk2.stderr.supportsColor = stderrColor;
|
|
3942
|
+
source = chalk2;
|
|
3943
|
+
return source;
|
|
3944
|
+
}
|
|
3945
|
+
var sourceExports = requireSource();
|
|
3946
|
+
const chalk = /* @__PURE__ */ getDefaultExportFromCjs(sourceExports);
|
|
3899
3947
|
function utf8Count(str) {
|
|
3900
3948
|
var strLength = str.length;
|
|
3901
3949
|
var byteLength = 0;
|
|
@@ -4007,8 +4055,8 @@ var DecodeError = (
|
|
|
4007
4055
|
__extends(DecodeError2, _super);
|
|
4008
4056
|
function DecodeError2(message) {
|
|
4009
4057
|
var _this = _super.call(this, message) || this;
|
|
4010
|
-
var
|
|
4011
|
-
Object.setPrototypeOf(_this,
|
|
4058
|
+
var proto = Object.create(DecodeError2.prototype);
|
|
4059
|
+
Object.setPrototypeOf(_this, proto);
|
|
4012
4060
|
Object.defineProperty(_this, "name", {
|
|
4013
4061
|
configurable: true,
|
|
4014
4062
|
enumerable: false,
|
|
@@ -4541,7 +4589,7 @@ class PublishTransportRESTServer extends STSOptionsBase {
|
|
|
4541
4589
|
__publicField(this, "Publish", async (payload) => {
|
|
4542
4590
|
try {
|
|
4543
4591
|
if (this.options.showPublishPayload) {
|
|
4544
|
-
console.log(chalk
|
|
4592
|
+
console.log(chalk.grey(`PublishTransportRESTServer::Publish() url: [${this.options.url}]`));
|
|
4545
4593
|
console.log(payload);
|
|
4546
4594
|
}
|
|
4547
4595
|
const encodedData = encode(payload, { ignoreUndefined: true });
|
|
@@ -4568,19 +4616,19 @@ class PublishTransportRESTServer extends STSOptionsBase {
|
|
|
4568
4616
|
}
|
|
4569
4617
|
if (retVal.status !== 200) {
|
|
4570
4618
|
if (this.options.showPublishPayload) {
|
|
4571
|
-
console.log(chalk
|
|
4619
|
+
console.log(chalk.red(`PublishTransportRESTServer::Publish() Error (_PerformPublishRESTAPI:_PerformPublish:#publishmessage): Invalid response from server: [${retVal.status}]`));
|
|
4572
4620
|
}
|
|
4573
|
-
this.options.logger.debug(chalk
|
|
4621
|
+
this.options.logger.debug(chalk.red(`Error (_PerformPublishRESTAPI:_PerformPublish:#publishmessage): Invalid response from server: [${retVal.status}]`));
|
|
4574
4622
|
return false;
|
|
4575
4623
|
} else {
|
|
4576
4624
|
if (this.options.showPublishPayload) {
|
|
4577
|
-
console.log(chalk
|
|
4625
|
+
console.log(chalk.grey(`PublishTransportRESTServer::Publish() _PerformPublishRESTAPI:_PerformPublish:#publishmessage: [${this.options.url}] - Valid response from server: [${retVal.status}]`));
|
|
4578
4626
|
}
|
|
4579
4627
|
}
|
|
4580
4628
|
return true;
|
|
4581
4629
|
} catch (error) {
|
|
4582
4630
|
if (this.options.showPublishPayload) {
|
|
4583
|
-
console.log(chalk
|
|
4631
|
+
console.log(chalk.red(`PublishTransportRESTServer::Publish() Error (PublishRESTServer:_PerformPublishRESTAPI:Error: [${error}]`));
|
|
4584
4632
|
}
|
|
4585
4633
|
return false;
|
|
4586
4634
|
}
|
|
@@ -4638,7 +4686,7 @@ class PublishInstruments extends STSOptionsBase {
|
|
|
4638
4686
|
}
|
|
4639
4687
|
async StartPublish() {
|
|
4640
4688
|
if (__privateGet(this, _publishState) !== 0) {
|
|
4641
|
-
this.options.logger.debug(chalk
|
|
4689
|
+
this.options.logger.debug(chalk.yellow(`StartPublish:${this.options.processContext.nid}: StartPublish called when not currently in the init state. Current State: [${__privateGet(this, _publishState)}]`));
|
|
4642
4690
|
return false;
|
|
4643
4691
|
}
|
|
4644
4692
|
__privateMethod(this, _PublishInstruments_instances, UpdateState_fn).call(this, 1, "StartPublish()");
|
|
@@ -4647,7 +4695,7 @@ class PublishInstruments extends STSOptionsBase {
|
|
|
4647
4695
|
}
|
|
4648
4696
|
async EndPublish() {
|
|
4649
4697
|
if (__privateGet(this, _publishState) !== 1) {
|
|
4650
|
-
this.options.logger.debug(chalk
|
|
4698
|
+
this.options.logger.debug(chalk.yellow(`EndPublish:${this.options.processContext.nid}: EndPublish called when not within the started state. Current State: [${__privateGet(this, _publishState)}]`));
|
|
4651
4699
|
return false;
|
|
4652
4700
|
}
|
|
4653
4701
|
__privateMethod(this, _PublishInstruments_instances, UpdateState_fn).call(this, 2, "EndPublish() (1)");
|
|
@@ -4687,7 +4735,7 @@ PublishTimeoutLoop_fn = function(publishInterval) {
|
|
|
4687
4735
|
UpdateState_fn = function(newState, comment) {
|
|
4688
4736
|
const previousState = __privateGet(this, _publishState);
|
|
4689
4737
|
__privateSet(this, _publishState, newState);
|
|
4690
|
-
this.options.logger.debug(chalk
|
|
4738
|
+
this.options.logger.debug(chalk.yellow(`#UpdateState:${this.options.processContext.nid}: Previous State: [${previousState}]. Current State: [${__privateGet(this, _publishState)}]. Comment: [${comment}]`));
|
|
4691
4739
|
};
|
|
4692
4740
|
var ePublishState = /* @__PURE__ */ ((ePublishState2) => {
|
|
4693
4741
|
ePublishState2[ePublishState2["init"] = 0] = "init";
|
|
@@ -4750,11 +4798,11 @@ const _PublishInstrumentController = class _PublishInstrumentController extends
|
|
|
4750
4798
|
}
|
|
4751
4799
|
SetupInstrumentation() {
|
|
4752
4800
|
if (!this.options.instrumentDefinitions) {
|
|
4753
|
-
this.options.logger.debug(chalk
|
|
4801
|
+
this.options.logger.debug(chalk.yellow(`SetupInstrumentation:${this.options.processContext.nid}: No instrument(s) defined within supplied options.`));
|
|
4754
4802
|
return;
|
|
4755
4803
|
}
|
|
4756
4804
|
if (!this.options.processContext) {
|
|
4757
|
-
this.options.logger.debug(chalk
|
|
4805
|
+
this.options.logger.debug(chalk.yellow(`SetupInstrumentation: No context defined within supplied options.`));
|
|
4758
4806
|
return;
|
|
4759
4807
|
}
|
|
4760
4808
|
__privateMethod(this, _PublishInstrumentController_instances, CreateInstruments_fn).call(this, this.options.instrumentDefinitions);
|
|
@@ -4779,7 +4827,7 @@ const _PublishInstrumentController = class _PublishInstrumentController extends
|
|
|
4779
4827
|
if (__privateGet(this, _instruments)[instrumentName]) {
|
|
4780
4828
|
__privateMethod(this, _PublishInstrumentController_instances, ProcessTelemetryCommand_fn).call(this, instrumentName, telemetry);
|
|
4781
4829
|
} else {
|
|
4782
|
-
this.options.logger.debug(chalk
|
|
4830
|
+
this.options.logger.debug(chalk.red(`UpdateInstrument:${this.options.processContext.nid}: Attempted to UpdateInstrument before initialised.`));
|
|
4783
4831
|
}
|
|
4784
4832
|
}
|
|
4785
4833
|
/**
|
|
@@ -4852,21 +4900,21 @@ const GetSTSInstrumentController = (app) => {
|
|
|
4852
4900
|
const STSInstrumentControllerPlugin = {
|
|
4853
4901
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4854
4902
|
install: (app, options) => {
|
|
4855
|
-
options.logger.debug(chalk
|
|
4903
|
+
options.logger.debug(chalk.yellow(`STSInstrumentControllerPlugin:install:Start`));
|
|
4856
4904
|
const aic = new PublishInstrumentController(options);
|
|
4857
4905
|
if (!app.config.globalProperties.$sts) {
|
|
4858
|
-
options.logger.debug(chalk
|
|
4906
|
+
options.logger.debug(chalk.cyan(`STSInstrumentControllerPlugin:install: [app.config.globalProperties.$sts] does not exist.`));
|
|
4859
4907
|
app.config.globalProperties.$sts = {};
|
|
4860
|
-
options.logger.debug(chalk
|
|
4908
|
+
options.logger.debug(chalk.cyan(`STSInstrumentControllerPlugin:install: created empty [app.config.globalProperties.$sts].`));
|
|
4861
4909
|
} else {
|
|
4862
|
-
options.logger.debug(chalk
|
|
4910
|
+
options.logger.debug(chalk.cyan(`STSInstrumentControllerPlugin:install: [app.config.globalProperties.$sts] already exists.`));
|
|
4863
4911
|
}
|
|
4864
4912
|
app.config.globalProperties.$sts.aic = aic;
|
|
4865
4913
|
app.config.globalProperties.$sts[STSInstrumentControllerPluginKey] = aic;
|
|
4866
|
-
options.logger.debug(chalk
|
|
4914
|
+
options.logger.debug(chalk.cyan(`STSInstrumentControllerPlugin:install: AgentInstrumentController installed into [app.config.globalProperties.$sts] using: [${String(STSInstrumentControllerPluginKey)}].`));
|
|
4867
4915
|
app.provide(STSInstrumentControllerPluginKey, aic);
|
|
4868
|
-
options.logger.debug(chalk
|
|
4869
|
-
options.logger.debug(chalk
|
|
4916
|
+
options.logger.debug(chalk.cyan(`STSInstrumentControllerPlugin:install: AgentInstrumentController installed into 'provide' using: [${String(STSInstrumentControllerPluginKey)}].`));
|
|
4917
|
+
options.logger.debug(chalk.green(`STSInstrumentControllerPlugin:install:End`));
|
|
4870
4918
|
}
|
|
4871
4919
|
};
|
|
4872
4920
|
var SubscriptionTopic = /* @__PURE__ */ ((SubscriptionTopic2) => {
|
|
@@ -5475,7 +5523,7 @@ class ObservabilityRESTAPISubscriber {
|
|
|
5475
5523
|
subscription.cb(payload);
|
|
5476
5524
|
}
|
|
5477
5525
|
} catch (error) {
|
|
5478
|
-
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogErrorMessage_fn).call(this, chalk
|
|
5526
|
+
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogErrorMessage_fn).call(this, chalk.red(`ObservabilityRESTAPISubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
|
|
5479
5527
|
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, RemoveKeepAlive_fn).call(this, subscription);
|
|
5480
5528
|
}
|
|
5481
5529
|
});
|
|
@@ -5487,11 +5535,11 @@ class ObservabilityRESTAPISubscriber {
|
|
|
5487
5535
|
async Subscribe(subscriptions) {
|
|
5488
5536
|
subscriptions.map(async (subId) => {
|
|
5489
5537
|
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, RemoveKeepAlive_fn).call(this, subId);
|
|
5490
|
-
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogDebugMessage_fn).call(this, chalk
|
|
5538
|
+
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogDebugMessage_fn).call(this, chalk.yellow(`ObservabilityRESTAPISubscriber:Subscribe(): Sending subscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
|
|
5491
5539
|
try {
|
|
5492
5540
|
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, AddKeepAlive_fn).call(this, subId);
|
|
5493
5541
|
} catch (error) {
|
|
5494
|
-
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogErrorMessage_fn).call(this, chalk
|
|
5542
|
+
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogErrorMessage_fn).call(this, chalk.red(`ObservabilityRESTAPISubscriber:Subscribe(): Error: response: [${JSON.stringify(error)}]`));
|
|
5495
5543
|
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, RemoveKeepAlive_fn).call(this, subId);
|
|
5496
5544
|
}
|
|
5497
5545
|
});
|
|
@@ -5502,7 +5550,7 @@ class ObservabilityRESTAPISubscriber {
|
|
|
5502
5550
|
UnSubscribe(subscriptions) {
|
|
5503
5551
|
subscriptions.map(async (subId) => {
|
|
5504
5552
|
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, RemoveKeepAlive_fn).call(this, subId);
|
|
5505
|
-
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogDebugMessage_fn).call(this, chalk
|
|
5553
|
+
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogDebugMessage_fn).call(this, chalk.yellow(`ObservabilityRESTAPISubscriber:UnSubscribe(): Sending unsubscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
|
|
5506
5554
|
});
|
|
5507
5555
|
}
|
|
5508
5556
|
}
|
|
@@ -5519,6 +5567,7 @@ InvokeRESTAPI_fn = async function(subscription) {
|
|
|
5519
5567
|
const { subscriptionKey } = subscription;
|
|
5520
5568
|
let url = "";
|
|
5521
5569
|
switch (subscriptionKey.topic) {
|
|
5570
|
+
// Services -------------------------------------------------------------------------------------------
|
|
5522
5571
|
case SubscriptionTopic.AllServicesCombined:
|
|
5523
5572
|
url = `/metrics`;
|
|
5524
5573
|
break;
|
|
@@ -5540,6 +5589,7 @@ InvokeRESTAPI_fn = async function(subscription) {
|
|
|
5540
5589
|
} else {
|
|
5541
5590
|
throw new Error(`#OutputSubscription(Services): key not provided for subscription: [${JSON.stringify(subscriptionKey)}]`);
|
|
5542
5591
|
}
|
|
5592
|
+
// Lambdas -------------------------------------------------------------------------------------------
|
|
5543
5593
|
case SubscriptionTopic.AllLambdasCombined:
|
|
5544
5594
|
url = `/metrics`;
|
|
5545
5595
|
break;
|
|
@@ -5561,6 +5611,7 @@ InvokeRESTAPI_fn = async function(subscription) {
|
|
|
5561
5611
|
} else {
|
|
5562
5612
|
throw new Error(`#OutputSubscription(Lambdas): key not provided for subscription: [${JSON.stringify(subscriptionKey)}]`);
|
|
5563
5613
|
}
|
|
5614
|
+
// User Agents -------------------------------------------------------------------------------------------
|
|
5564
5615
|
case SubscriptionTopic.AllAgentsCombined:
|
|
5565
5616
|
url = `/metrics`;
|
|
5566
5617
|
break;
|
|
@@ -5626,10 +5677,10 @@ SetupTimeout_fn = function(socketSubscribeKeepAlive, subscription, timeout) {
|
|
|
5626
5677
|
}
|
|
5627
5678
|
socketSubscribeKeepAlive.timeout = __privateMethod(this, _ObservabilityRESTAPISubscriber_instances, SetupTimeout_fn).call(this, socketSubscribeKeepAlive, subscription, timeoutDuration);
|
|
5628
5679
|
} else {
|
|
5629
|
-
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogDebugMessage_fn).call(this, chalk
|
|
5680
|
+
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogDebugMessage_fn).call(this, chalk.yellow(`Subscription removed: [${socketSubscribeKeepAlive.id}]. Processing terminate.`));
|
|
5630
5681
|
}
|
|
5631
5682
|
} catch (error) {
|
|
5632
|
-
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogErrorMessage_fn).call(this, chalk
|
|
5683
|
+
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogErrorMessage_fn).call(this, chalk.red(`ObservabilityRESTAPISubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
|
|
5633
5684
|
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, RemoveKeepAlive_fn).call(this, subscription);
|
|
5634
5685
|
}
|
|
5635
5686
|
}, timeout);
|
|
@@ -5645,40 +5696,38 @@ AddKeepAlive_fn = function(subscription) {
|
|
|
5645
5696
|
};
|
|
5646
5697
|
RemoveKeepAlive_fn = function(subscription) {
|
|
5647
5698
|
if (__privateGet(this, _socketSubscribeKeepAlive)[subscription.subscriptionKey.id]) {
|
|
5648
|
-
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogDebugMessage_fn).call(this, chalk
|
|
5699
|
+
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogDebugMessage_fn).call(this, chalk.gray(`ObservabilityRESTAPISubscriber:#RemoveKeepAlive(): subscriptionKey: [${subscription.subscriptionKey.id}]`));
|
|
5649
5700
|
clearTimeout(__privateGet(this, _socketSubscribeKeepAlive)[subscription.subscriptionKey.id].timeout);
|
|
5650
5701
|
delete __privateGet(this, _socketSubscribeKeepAlive)[subscription.subscriptionKey.id].timeout;
|
|
5651
5702
|
delete __privateGet(this, _socketSubscribeKeepAlive)[subscription.subscriptionKey.id];
|
|
5652
5703
|
}
|
|
5653
5704
|
};
|
|
5654
|
-
|
|
5655
|
-
for (
|
|
5705
|
+
const byteToHex = [];
|
|
5706
|
+
for (let i = 0; i < 256; ++i) {
|
|
5656
5707
|
byteToHex.push((i + 256).toString(16).slice(1));
|
|
5657
5708
|
}
|
|
5658
5709
|
function unsafeStringify(arr, offset = 0) {
|
|
5659
5710
|
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
5660
5711
|
}
|
|
5661
|
-
|
|
5662
|
-
|
|
5712
|
+
let getRandomValues;
|
|
5713
|
+
const rnds8 = new Uint8Array(16);
|
|
5663
5714
|
function rng() {
|
|
5664
5715
|
if (!getRandomValues) {
|
|
5665
|
-
|
|
5666
|
-
if (!getRandomValues) {
|
|
5716
|
+
if (typeof crypto === "undefined" || !crypto.getRandomValues) {
|
|
5667
5717
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
5668
5718
|
}
|
|
5719
|
+
getRandomValues = crypto.getRandomValues.bind(crypto);
|
|
5669
5720
|
}
|
|
5670
5721
|
return getRandomValues(rnds8);
|
|
5671
5722
|
}
|
|
5672
|
-
|
|
5673
|
-
const native = {
|
|
5674
|
-
randomUUID
|
|
5675
|
-
};
|
|
5723
|
+
const randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
5724
|
+
const native = { randomUUID };
|
|
5676
5725
|
function v4(options, buf, offset) {
|
|
5677
5726
|
if (native.randomUUID && !buf && !options) {
|
|
5678
5727
|
return native.randomUUID();
|
|
5679
5728
|
}
|
|
5680
5729
|
options = options || {};
|
|
5681
|
-
|
|
5730
|
+
const rnds = options.random || (options.rng || rng)();
|
|
5682
5731
|
rnds[6] = rnds[6] & 15 | 64;
|
|
5683
5732
|
rnds[8] = rnds[8] & 63 | 128;
|
|
5684
5733
|
return unsafeStringify(rnds);
|
|
@@ -5715,7 +5764,7 @@ class SocketIoMessageSender {
|
|
|
5715
5764
|
return __privateGet(this, _socket);
|
|
5716
5765
|
}
|
|
5717
5766
|
set socket(socket) {
|
|
5718
|
-
__privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk
|
|
5767
|
+
__privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk.cyan(`SocketIoMessageSender:set socket(): new socket assigned`));
|
|
5719
5768
|
__privateSet(this, _socket, socket);
|
|
5720
5769
|
}
|
|
5721
5770
|
AckListener(message, payload) {
|
|
@@ -5728,25 +5777,25 @@ class SocketIoMessageSender {
|
|
|
5728
5777
|
message.status = "SUCCESS";
|
|
5729
5778
|
message.subscriptionKeyResponse = payload;
|
|
5730
5779
|
delete __privateGet(this, _messageWithAckPayloadRecords)[message.id];
|
|
5731
|
-
__privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk
|
|
5780
|
+
__privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk.grey(`SocketIoMessageSender:AckListener(): ack received, event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
|
|
5732
5781
|
message.resolve(message);
|
|
5733
5782
|
}
|
|
5734
5783
|
}
|
|
5735
5784
|
ResponseTimout(message) {
|
|
5736
|
-
__privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk
|
|
5785
|
+
__privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk.magenta(`SocketIoMessageSender:ResponseTimout(): timeout reached: [${__privateGet(this, _timeoutValue)}], event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
|
|
5737
5786
|
delete message.timeoutId;
|
|
5738
5787
|
__privateGet(this, _socket).off(__privateMethod(this, _SocketIoMessageSender_instances, GetSubscribeKeepAliveAckEventName_fn).call(this, message.eventName, message.subscriptionKey), message.BoundAckListenerCallback);
|
|
5739
5788
|
message.endTime = performance.now();
|
|
5740
5789
|
if (message.retryCount >= __privateGet(this, _maxReties)) {
|
|
5741
5790
|
message.status = "FAIL";
|
|
5742
|
-
__privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk
|
|
5791
|
+
__privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk.red(`SocketIoMessageSender:ResponseTimout(): timeout reached after ${__privateGet(this, _maxReties)} retries, event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
|
|
5743
5792
|
delete __privateGet(this, _messageWithAckPayloadRecords)[message.id];
|
|
5744
5793
|
message.reject(message);
|
|
5745
5794
|
return;
|
|
5746
5795
|
}
|
|
5747
5796
|
message.status = "INRETRY";
|
|
5748
5797
|
message.retryCount++;
|
|
5749
|
-
__privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk
|
|
5798
|
+
__privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk.magenta(`SocketIoMessageSender:ResponseTimout(): timeout reached, retrying. Retries: [${message.retryCount}], event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
|
|
5750
5799
|
this.SendMessage(message);
|
|
5751
5800
|
}
|
|
5752
5801
|
SendMessage(message) {
|
|
@@ -5759,7 +5808,7 @@ class SocketIoMessageSender {
|
|
|
5759
5808
|
};
|
|
5760
5809
|
message.BoundAckListenerCallback = AckListenerCallback.bind(this);
|
|
5761
5810
|
__privateGet(this, _socket).on(__privateMethod(this, _SocketIoMessageSender_instances, GetSubscribeKeepAliveAckEventName_fn).call(this, message.eventName, message.subscriptionKey), message.BoundAckListenerCallback);
|
|
5762
|
-
__privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk
|
|
5811
|
+
__privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk.gray(`SocketIoMessageSender:SendMessage(): event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
|
|
5763
5812
|
__privateGet(this, _socket).emit(message.eventName, message.subscriptionKey);
|
|
5764
5813
|
}
|
|
5765
5814
|
SendMessageWithAck(eventName, subscriptionKey) {
|
|
@@ -5783,7 +5832,7 @@ class SocketIoMessageSender {
|
|
|
5783
5832
|
const killIds = [];
|
|
5784
5833
|
for (const [, message] of Object.entries(__privateGet(this, _messageWithAckPayloadRecords))) {
|
|
5785
5834
|
if (message.subscriptionKey.id.localeCompare(subscriptionKey.id) === 0) {
|
|
5786
|
-
__privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk
|
|
5835
|
+
__privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk.blue(`SocketIoMessageSender:KillMessageInFlight(): event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
|
|
5787
5836
|
clearTimeout(message.timeoutId);
|
|
5788
5837
|
delete message.timeoutId;
|
|
5789
5838
|
__privateGet(this, _socket).off(__privateMethod(this, _SocketIoMessageSender_instances, GetSubscribeKeepAliveAckEventName_fn).call(this, message.eventName, message.subscriptionKey), message.BoundAckListenerCallback);
|
|
@@ -5829,7 +5878,7 @@ class ObservabilitySocketIOSubscriber {
|
|
|
5829
5878
|
return __privateGet(this, _socket2);
|
|
5830
5879
|
}
|
|
5831
5880
|
set socket(socket) {
|
|
5832
|
-
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk
|
|
5881
|
+
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk.cyan(`ObservabilitySocketIOSubscriber:set socket(): new socket assigned`));
|
|
5833
5882
|
__privateSet(this, _socket2, socket);
|
|
5834
5883
|
__privateGet(this, _socketIoMessageSender).socket = socket;
|
|
5835
5884
|
}
|
|
@@ -5840,14 +5889,14 @@ class ObservabilitySocketIOSubscriber {
|
|
|
5840
5889
|
const socket = __privateGet(this, _socket2);
|
|
5841
5890
|
subscriptions.map(async (subId) => {
|
|
5842
5891
|
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, RemoveKeepAlive_fn2).call(this, subId);
|
|
5843
|
-
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk
|
|
5892
|
+
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk.yellow(`ObservabilitySocketIOSubscriber:Subscribe(): Sending subscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
|
|
5844
5893
|
try {
|
|
5845
5894
|
const retVal = await __privateGet(this, _socketIoMessageSender).SendMessageWithAck("subscribe", subId.subscriptionKey);
|
|
5846
|
-
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk
|
|
5895
|
+
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk.green(`ObservabilitySocketIOSubscriber:Subscribe(): SendMessageWithAck response: [${JSON.stringify(retVal)}]`));
|
|
5847
5896
|
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, AddKeepAlive_fn2).call(this, socket, subId);
|
|
5848
5897
|
socket.on(GetSocketIOSubscriptionKey(subId.subscriptionKey), subId.cb);
|
|
5849
5898
|
} catch (error) {
|
|
5850
|
-
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogErrorMessage_fn2).call(this, chalk
|
|
5899
|
+
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogErrorMessage_fn2).call(this, chalk.red(`ObservabilitySocketIOSubscriber:Subscribe(): Error: response: [${JSON.stringify(error)}]`));
|
|
5851
5900
|
socket.off(GetSocketIOSubscriptionKey(subId.subscriptionKey), subId.cb);
|
|
5852
5901
|
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, RemoveKeepAlive_fn2).call(this, subId);
|
|
5853
5902
|
}
|
|
@@ -5862,12 +5911,12 @@ class ObservabilitySocketIOSubscriber {
|
|
|
5862
5911
|
socket.off(GetSocketIOSubscriptionKey(subId.subscriptionKey), subId.cb);
|
|
5863
5912
|
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, RemoveKeepAlive_fn2).call(this, subId);
|
|
5864
5913
|
__privateGet(this, _socketIoMessageSender).KillMessageInFlight(subId.subscriptionKey);
|
|
5865
|
-
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk
|
|
5914
|
+
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk.yellow(`ObservabilitySocketIOSubscriber:UnSubscribe(): Sending unsubscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
|
|
5866
5915
|
try {
|
|
5867
5916
|
const retVal = await __privateGet(this, _socketIoMessageSender).SendMessageWithAck("unsubscribe", subId.subscriptionKey);
|
|
5868
|
-
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk
|
|
5917
|
+
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk.green(`ObservabilitySocketIOSubscriber:UnSubscribe(): SendMessageWithAck response: [${JSON.stringify(retVal)}]`));
|
|
5869
5918
|
} catch (error) {
|
|
5870
|
-
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogErrorMessage_fn2).call(this, chalk
|
|
5919
|
+
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogErrorMessage_fn2).call(this, chalk.red(`ObservabilitySocketIOSubscriber:UnSubscribe(): Error response: [${JSON.stringify(error)}]`));
|
|
5871
5920
|
}
|
|
5872
5921
|
});
|
|
5873
5922
|
}
|
|
@@ -5901,13 +5950,13 @@ AddKeepAlive_fn2 = function(socket, subscription) {
|
|
|
5901
5950
|
__privateGet(this, _socketSubscribeKeepAlive2)[subscription.subscriptionKey.id] = {
|
|
5902
5951
|
id: subscription.subscriptionKey.id,
|
|
5903
5952
|
timeout: setTimeout(async () => {
|
|
5904
|
-
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk
|
|
5953
|
+
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk.yellow(`ObservabilitySocketIOSubscriber:#AddKeepAlive:timeoutCheck(): Sending keepAlive: subscriptionKey: [${subscription.subscriptionKey.id}]`));
|
|
5905
5954
|
try {
|
|
5906
5955
|
const retVal = await __privateGet(this, _socketIoMessageSender).SendMessageWithAck("subscribeKeepAlive", subscription.subscriptionKey);
|
|
5907
|
-
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk
|
|
5956
|
+
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk.green(`ObservabilitySocketIOSubscriber:#AddKeepAlive(): SendMessageWithAck response: [${JSON.stringify(retVal)}]`));
|
|
5908
5957
|
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, AddKeepAlive_fn2).call(this, socket, subscription);
|
|
5909
5958
|
} catch (error) {
|
|
5910
|
-
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogErrorMessage_fn2).call(this, chalk
|
|
5959
|
+
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogErrorMessage_fn2).call(this, chalk.red(`ObservabilitySocketIOSubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
|
|
5911
5960
|
socket.off(GetSocketIOSubscriptionKey(subscription.subscriptionKey), subscription.cb);
|
|
5912
5961
|
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, RemoveKeepAlive_fn2).call(this, subscription);
|
|
5913
5962
|
}
|
|
@@ -5916,7 +5965,7 @@ AddKeepAlive_fn2 = function(socket, subscription) {
|
|
|
5916
5965
|
};
|
|
5917
5966
|
RemoveKeepAlive_fn2 = function(subscription) {
|
|
5918
5967
|
if (__privateGet(this, _socketSubscribeKeepAlive2)[subscription.subscriptionKey.id]) {
|
|
5919
|
-
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk
|
|
5968
|
+
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk.gray(`ObservabilitySocketIOSubscriber:#RemoveKeepAlive(): subscriptionKey: [${subscription.subscriptionKey.id}]`));
|
|
5920
5969
|
clearTimeout(__privateGet(this, _socketSubscribeKeepAlive2)[subscription.subscriptionKey.id].timeout);
|
|
5921
5970
|
delete __privateGet(this, _socketSubscribeKeepAlive2)[subscription.subscriptionKey.id];
|
|
5922
5971
|
}
|
|
@@ -5963,7 +6012,7 @@ class ObservabilitySubscriptionManager {
|
|
|
5963
6012
|
subscriptions.map((subscription) => {
|
|
5964
6013
|
const retVal = this.subscriptions.find((v) => v.subscriptionKey.id.localeCompare(subscription.subscriptionKey.id) === 0);
|
|
5965
6014
|
if (retVal) {
|
|
5966
|
-
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk
|
|
6015
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk.magenta(`AddSubscription(): Subscription: [${retVal.subscriptionKey.id}] already exists - ignoring.`));
|
|
5967
6016
|
} else {
|
|
5968
6017
|
subscriptionsToAdd.push(subscription);
|
|
5969
6018
|
}
|
|
@@ -5972,7 +6021,7 @@ class ObservabilitySubscriptionManager {
|
|
|
5972
6021
|
subscriptionsToAdd.map((s) => this.subscriptions.push(s));
|
|
5973
6022
|
(_a2 = __privateGet(this, _observabilitySocketIOSubscriber)) == null ? void 0 : _a2.Subscribe(subscriptionsToAdd);
|
|
5974
6023
|
} else {
|
|
5975
|
-
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk
|
|
6024
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk.magenta(`AddSubscription(): No valid subscriptions to subscribe.`));
|
|
5976
6025
|
}
|
|
5977
6026
|
}
|
|
5978
6027
|
RemoveSubscriptionsByKey(keyToFind) {
|
|
@@ -6021,6 +6070,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6021
6070
|
}
|
|
6022
6071
|
TransformSubscriptionPayloadCallback(subscriptionPayload, subscribeToKafka) {
|
|
6023
6072
|
switch (subscriptionPayload.subscriptionKey.topic) {
|
|
6073
|
+
// Services -----------------------------------------------------------------------------
|
|
6024
6074
|
case SubscriptionTopic.AllServicesCombined:
|
|
6025
6075
|
this.CreateModelAllServicesCombined(subscriptionPayload, subscribeToKafka);
|
|
6026
6076
|
break;
|
|
@@ -6033,6 +6083,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6033
6083
|
case SubscriptionTopic.ServiceInstance:
|
|
6034
6084
|
this.CreateModelServiceInstance(subscriptionPayload, subscribeToKafka);
|
|
6035
6085
|
break;
|
|
6086
|
+
// Lambda -----------------------------------------------------------------------------
|
|
6036
6087
|
case SubscriptionTopic.AllLambdasCombined:
|
|
6037
6088
|
this.CreateModelAllLambdasCombined(subscriptionPayload, subscribeToKafka);
|
|
6038
6089
|
break;
|
|
@@ -6045,6 +6096,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6045
6096
|
case SubscriptionTopic.LambdaSubTechnologiesInstance:
|
|
6046
6097
|
this.CreateModelLambdaSubTechnologiesInstance(subscriptionPayload, subscribeToKafka);
|
|
6047
6098
|
break;
|
|
6099
|
+
// Agents -----------------------------------------------------------------------------
|
|
6048
6100
|
case SubscriptionTopic.AllAgentsCombined:
|
|
6049
6101
|
this.CreateModelAllAgentsCombined(subscriptionPayload, subscribeToKafka);
|
|
6050
6102
|
break;
|
|
@@ -6067,7 +6119,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6067
6119
|
if (subscriptionPayload.subscriptionKey.topic.localeCompare(SubscriptionTopic.AllServicesCombined.toString()) === 0) {
|
|
6068
6120
|
__privateGet(this, _serviceModel)["STS-Service"] = ObservabilityModelUtils.GetModelForService("STS-Service", subscriptionPayload.data, subscribeToKafka, __privateGet(this, _options5).logger);
|
|
6069
6121
|
if (__privateGet(this, _serviceModel)["STS-Service"] === null) {
|
|
6070
|
-
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk
|
|
6122
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk.red(`CreateModelAllServicesCombined():Error: GetModelForService() returned null`));
|
|
6071
6123
|
}
|
|
6072
6124
|
}
|
|
6073
6125
|
} catch (error) {
|
|
@@ -6082,7 +6134,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6082
6134
|
for (const [serviceId, serviceTelemetry] of Object.entries(subscriptionPayload.data)) {
|
|
6083
6135
|
__privateGet(this, _serviceModel)[serviceId] = ObservabilityModelUtils.GetModelForService(serviceId, serviceTelemetry, subscribeToKafka, __privateGet(this, _options5).logger);
|
|
6084
6136
|
if (__privateGet(this, _serviceModel)[serviceId] === null) {
|
|
6085
|
-
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk
|
|
6137
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk.red(`CreateModelServices():Error: GetModelForService() returned null`));
|
|
6086
6138
|
}
|
|
6087
6139
|
}
|
|
6088
6140
|
} catch (error) {
|
|
@@ -6116,7 +6168,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6116
6168
|
}
|
|
6117
6169
|
}
|
|
6118
6170
|
} else {
|
|
6119
|
-
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk
|
|
6171
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk.red(`CreateModelServiceInstances():Error: GetModelForService() returned null`));
|
|
6120
6172
|
}
|
|
6121
6173
|
} else {
|
|
6122
6174
|
if (subscribeToKafka) {
|
|
@@ -6159,7 +6211,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6159
6211
|
}
|
|
6160
6212
|
}
|
|
6161
6213
|
} else {
|
|
6162
|
-
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk
|
|
6214
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk.red(`CreateModelServiceInstance():Error: GetModelForService() returned null`));
|
|
6163
6215
|
}
|
|
6164
6216
|
} else {
|
|
6165
6217
|
if (subscribeToKafka) {
|
|
@@ -6184,7 +6236,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6184
6236
|
if (Object.keys(subscriptionPayload.data).length !== 0) {
|
|
6185
6237
|
__privateGet(this, _agentModel)["STS-Agent"] = ObservabilityModelUtils.GetModelForAgent("STS-Agent", subscriptionPayload.data, subscribeToKafka, __privateGet(this, _options5).logger);
|
|
6186
6238
|
if (__privateGet(this, _agentModel)["STS-Agent"] === null) {
|
|
6187
|
-
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk
|
|
6239
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk.red(`CreateModelAllAgentsCombined():Error: GetModelForAgent() returned null`));
|
|
6188
6240
|
}
|
|
6189
6241
|
}
|
|
6190
6242
|
}
|
|
@@ -6218,7 +6270,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6218
6270
|
}
|
|
6219
6271
|
}
|
|
6220
6272
|
} else {
|
|
6221
|
-
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk
|
|
6273
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk.red(`CreateModelAgents():Error: GetModelForAgent() returned null`));
|
|
6222
6274
|
}
|
|
6223
6275
|
} else {
|
|
6224
6276
|
if (subscribeToKafka) {
|
|
@@ -6229,7 +6281,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6229
6281
|
}
|
|
6230
6282
|
}
|
|
6231
6283
|
} catch (error) {
|
|
6232
|
-
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogErrorMessage_fn3).call(this, chalk
|
|
6284
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogErrorMessage_fn3).call(this, chalk.red(`UIControllerAgent:CreateModel(): Error: [${error}]`));
|
|
6233
6285
|
}
|
|
6234
6286
|
}
|
|
6235
6287
|
// /agentId/agentWorkerId
|
|
@@ -6262,7 +6314,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6262
6314
|
}
|
|
6263
6315
|
}
|
|
6264
6316
|
} else {
|
|
6265
|
-
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk
|
|
6317
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk.red(`CreateModelAgentWorkers():Error: GetModelForAgent() returned null`));
|
|
6266
6318
|
}
|
|
6267
6319
|
} else {
|
|
6268
6320
|
if (subscribeToKafka) {
|
|
@@ -6274,7 +6326,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6274
6326
|
}
|
|
6275
6327
|
}
|
|
6276
6328
|
} catch (error) {
|
|
6277
|
-
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogErrorMessage_fn3).call(this, chalk
|
|
6329
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogErrorMessage_fn3).call(this, chalk.red(`UIControllerAgentThreads:CreateModel(): Error: [${error}]`));
|
|
6278
6330
|
}
|
|
6279
6331
|
}
|
|
6280
6332
|
// /agentId/agentWorkerId/asyncRunnerId
|
|
@@ -6304,7 +6356,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6304
6356
|
}
|
|
6305
6357
|
}
|
|
6306
6358
|
} else {
|
|
6307
|
-
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk
|
|
6359
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk.red(`CreateModelAgentWorker():Error: GetModelForAgent() returned null`));
|
|
6308
6360
|
}
|
|
6309
6361
|
} else {
|
|
6310
6362
|
if (subscribeToKafka) {
|
|
@@ -6317,7 +6369,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6317
6369
|
}
|
|
6318
6370
|
}
|
|
6319
6371
|
} catch (error) {
|
|
6320
|
-
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogErrorMessage_fn3).call(this, chalk
|
|
6372
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogErrorMessage_fn3).call(this, chalk.red(`UIControllerAgentThread:CreateModel(): Error: [${error}]`));
|
|
6321
6373
|
}
|
|
6322
6374
|
}
|
|
6323
6375
|
// --- [ Lambdas ] ------------------------------------------------------------------------------------------------------------------------------------------------
|
|
@@ -6328,7 +6380,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6328
6380
|
if (subscriptionPayload.subscriptionKey.topic.localeCompare(SubscriptionTopic.AllLambdasCombined.toString()) === 0) {
|
|
6329
6381
|
__privateGet(this, _lambdaModel)["STS-Lambda"] = ObservabilityModelUtils.GetModelForLambda("STS-Lambda", subscriptionPayload.data, subscribeToKafka, __privateGet(this, _options5).logger);
|
|
6330
6382
|
if (__privateGet(this, _lambdaModel)["STS-Lambda"] === null) {
|
|
6331
|
-
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk
|
|
6383
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk.red(`CreateModelAllLambdasCombined():Error: GetModelForLambda() returned null`));
|
|
6332
6384
|
}
|
|
6333
6385
|
}
|
|
6334
6386
|
} catch (error) {
|
|
@@ -6343,7 +6395,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6343
6395
|
for (const [technologyId, technologyTelemetry] of Object.entries(subscriptionPayload.data)) {
|
|
6344
6396
|
__privateGet(this, _lambdaModel)[technologyId] = ObservabilityModelUtils.GetModelForLambda(technologyId, technologyTelemetry, subscribeToKafka, __privateGet(this, _options5).logger);
|
|
6345
6397
|
if (__privateGet(this, _lambdaModel)[technologyId] === null) {
|
|
6346
|
-
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk
|
|
6398
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk.red(`CreateModelLambdaTechnologies():Error: GetModelForLambda() returned null`));
|
|
6347
6399
|
}
|
|
6348
6400
|
}
|
|
6349
6401
|
} catch (error) {
|
|
@@ -6377,7 +6429,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6377
6429
|
}
|
|
6378
6430
|
}
|
|
6379
6431
|
} else {
|
|
6380
|
-
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk
|
|
6432
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk.red(`CreateModelLambdaSubTechnologies():Error: GetModelForLambda() returned null`));
|
|
6381
6433
|
}
|
|
6382
6434
|
} else {
|
|
6383
6435
|
if (subscribeToKafka) {
|
|
@@ -6420,7 +6472,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6420
6472
|
}
|
|
6421
6473
|
}
|
|
6422
6474
|
} else {
|
|
6423
|
-
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk
|
|
6475
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk.red(`CreateModelLambdaSubTechnologiesInstance():Error: GetModelForLambda() returned null`));
|
|
6424
6476
|
}
|
|
6425
6477
|
} else {
|
|
6426
6478
|
if (subscribeToKafka) {
|