@nsshunt/stsinstrumentmanagerclient 1.0.20 → 1.0.21
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/index.cjs +405 -2127
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +405 -2149
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
- package/types/publish/middleware/requestLoggerMiddleware.d.ts +3 -3
- package/types/publish/middleware/requestLoggerMiddleware.d.ts.map +1 -1
- package/types/publish/publishInstrumentController.d.ts +2 -3
- package/types/publish/publishInstrumentController.d.ts.map +1 -1
- package/types/publish/publishInstruments.d.ts +2 -3
- package/types/publish/publishInstruments.d.ts.map +1 -1
- package/types/publish/publishers/publishTransportRESTServer.d.ts +2 -3
- package/types/publish/publishers/publishTransportRESTServer.d.ts.map +1 -1
package/dist/index.cjs
CHANGED
|
@@ -6,7 +6,6 @@ var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
|
|
6
6
|
var __getOwnPropNames$1 = Object.getOwnPropertyNames;
|
|
7
7
|
var __getProtoOf$1 = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __commonJSMin$1 = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
10
9
|
var __copyProps$1 = (to, from, except, desc) => {
|
|
11
10
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames$1(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
11
|
key = keys[i];
|
|
@@ -22,7 +21,6 @@ var __toESM$1 = (mod, isNodeMode, target) => (target = mod != null ? __create$1(
|
|
|
22
21
|
enumerable: true
|
|
23
22
|
}) : target, mod));
|
|
24
23
|
//#endregion
|
|
25
|
-
let _nsshunt_stsutils = require("@nsshunt/stsutils");
|
|
26
24
|
let tiny_emitter = require("tiny-emitter");
|
|
27
25
|
let lodash_clonedeep = require("lodash.clonedeep");
|
|
28
26
|
lodash_clonedeep = __toESM$1(lodash_clonedeep);
|
|
@@ -30,6 +28,7 @@ let detect_node = require("detect-node");
|
|
|
30
28
|
detect_node = __toESM$1(detect_node);
|
|
31
29
|
let axios = require("axios");
|
|
32
30
|
axios = __toESM$1(axios);
|
|
31
|
+
let _nsshunt_stsutils = require("@nsshunt/stsutils");
|
|
33
32
|
let vue = require("vue");
|
|
34
33
|
let _nsshunt_stssocketioutils = require("@nsshunt/stssocketioutils");
|
|
35
34
|
//#region src/commonTypes.ts
|
|
@@ -161,13 +160,11 @@ var RequestLoggerMiddlewareEventName = /* @__PURE__ */ function(RequestLoggerMid
|
|
|
161
160
|
RequestLoggerMiddlewareEventName["UpdateInstrument_D_VAL"] = "UpdateInstrument_D_VAL";
|
|
162
161
|
return RequestLoggerMiddlewareEventName;
|
|
163
162
|
}({});
|
|
164
|
-
var RequestLoggerMiddleware = class
|
|
163
|
+
var RequestLoggerMiddleware = class {
|
|
164
|
+
options;
|
|
165
165
|
#tinyEmitter = new tiny_emitter.TinyEmitter();
|
|
166
166
|
constructor(options) {
|
|
167
|
-
|
|
168
|
-
}
|
|
169
|
-
get options() {
|
|
170
|
-
return super.options;
|
|
167
|
+
this.options = options;
|
|
171
168
|
}
|
|
172
169
|
on(eventName, callBackFn) {
|
|
173
170
|
this.#tinyEmitter.on(eventName, callBackFn);
|
|
@@ -214,2055 +211,342 @@ var RequestLoggerMiddleware = class extends _nsshunt_stsutils.STSOptionsBase {
|
|
|
214
211
|
};
|
|
215
212
|
};
|
|
216
213
|
//#endregion
|
|
217
|
-
//#region node_modules/
|
|
218
|
-
var
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
],
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
],
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
],
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
],
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
],
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
],
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
],
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
],
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
226
|
|
274
|
-
],
|
|
275
|
-
"brown": [
|
|
276
|
-
165,
|
|
277
|
-
42,
|
|
278
|
-
42
|
|
279
|
-
],
|
|
280
|
-
"burlywood": [
|
|
281
|
-
222,
|
|
282
|
-
184,
|
|
283
|
-
135
|
|
284
|
-
],
|
|
285
|
-
"cadetblue": [
|
|
286
|
-
95,
|
|
287
|
-
158,
|
|
288
|
-
160
|
|
289
|
-
],
|
|
290
|
-
"chartreuse": [
|
|
291
|
-
127,
|
|
292
|
-
255,
|
|
293
|
-
0
|
|
294
|
-
],
|
|
295
|
-
"chocolate": [
|
|
296
|
-
210,
|
|
297
|
-
105,
|
|
298
|
-
30
|
|
299
|
-
],
|
|
300
|
-
"coral": [
|
|
301
|
-
255,
|
|
302
|
-
127,
|
|
303
|
-
80
|
|
304
|
-
],
|
|
305
|
-
"cornflowerblue": [
|
|
306
|
-
100,
|
|
307
|
-
149,
|
|
308
|
-
237
|
|
309
|
-
],
|
|
310
|
-
"cornsilk": [
|
|
311
|
-
255,
|
|
312
|
-
248,
|
|
313
|
-
220
|
|
314
|
-
],
|
|
315
|
-
"crimson": [
|
|
316
|
-
220,
|
|
317
|
-
20,
|
|
318
|
-
60
|
|
319
|
-
],
|
|
320
|
-
"cyan": [
|
|
321
|
-
0,
|
|
322
|
-
255,
|
|
323
|
-
255
|
|
324
|
-
],
|
|
325
|
-
"darkblue": [
|
|
326
|
-
0,
|
|
327
|
-
0,
|
|
328
|
-
139
|
|
329
|
-
],
|
|
330
|
-
"darkcyan": [
|
|
331
|
-
0,
|
|
332
|
-
139,
|
|
333
|
-
139
|
|
334
|
-
],
|
|
335
|
-
"darkgoldenrod": [
|
|
336
|
-
184,
|
|
337
|
-
134,
|
|
338
|
-
11
|
|
339
|
-
],
|
|
340
|
-
"darkgray": [
|
|
341
|
-
169,
|
|
342
|
-
169,
|
|
343
|
-
169
|
|
344
|
-
],
|
|
345
|
-
"darkgreen": [
|
|
346
|
-
0,
|
|
347
|
-
100,
|
|
348
|
-
0
|
|
349
|
-
],
|
|
350
|
-
"darkgrey": [
|
|
351
|
-
169,
|
|
352
|
-
169,
|
|
353
|
-
169
|
|
354
|
-
],
|
|
355
|
-
"darkkhaki": [
|
|
356
|
-
189,
|
|
357
|
-
183,
|
|
358
|
-
107
|
|
359
|
-
],
|
|
360
|
-
"darkmagenta": [
|
|
361
|
-
139,
|
|
362
|
-
0,
|
|
363
|
-
139
|
|
364
|
-
],
|
|
365
|
-
"darkolivegreen": [
|
|
366
|
-
85,
|
|
367
|
-
107,
|
|
368
|
-
47
|
|
369
|
-
],
|
|
370
|
-
"darkorange": [
|
|
371
|
-
255,
|
|
372
|
-
140,
|
|
373
|
-
0
|
|
374
|
-
],
|
|
375
|
-
"darkorchid": [
|
|
376
|
-
153,
|
|
377
|
-
50,
|
|
378
|
-
204
|
|
379
|
-
],
|
|
380
|
-
"darkred": [
|
|
381
|
-
139,
|
|
382
|
-
0,
|
|
383
|
-
0
|
|
384
|
-
],
|
|
385
|
-
"darksalmon": [
|
|
386
|
-
233,
|
|
387
|
-
150,
|
|
388
|
-
122
|
|
389
|
-
],
|
|
390
|
-
"darkseagreen": [
|
|
391
|
-
143,
|
|
392
|
-
188,
|
|
393
|
-
143
|
|
394
|
-
],
|
|
395
|
-
"darkslateblue": [
|
|
396
|
-
72,
|
|
397
|
-
61,
|
|
398
|
-
139
|
|
399
|
-
],
|
|
400
|
-
"darkslategray": [
|
|
401
|
-
47,
|
|
402
|
-
79,
|
|
403
|
-
79
|
|
404
|
-
],
|
|
405
|
-
"darkslategrey": [
|
|
406
|
-
47,
|
|
407
|
-
79,
|
|
408
|
-
79
|
|
409
|
-
],
|
|
410
|
-
"darkturquoise": [
|
|
411
|
-
0,
|
|
412
|
-
206,
|
|
413
|
-
209
|
|
414
|
-
],
|
|
415
|
-
"darkviolet": [
|
|
416
|
-
148,
|
|
417
|
-
0,
|
|
418
|
-
211
|
|
419
|
-
],
|
|
420
|
-
"deeppink": [
|
|
421
|
-
255,
|
|
422
|
-
20,
|
|
423
|
-
147
|
|
424
|
-
],
|
|
425
|
-
"deepskyblue": [
|
|
426
|
-
0,
|
|
427
|
-
191,
|
|
428
|
-
255
|
|
429
|
-
],
|
|
430
|
-
"dimgray": [
|
|
431
|
-
105,
|
|
432
|
-
105,
|
|
433
|
-
105
|
|
434
|
-
],
|
|
435
|
-
"dimgrey": [
|
|
436
|
-
105,
|
|
437
|
-
105,
|
|
438
|
-
105
|
|
439
|
-
],
|
|
440
|
-
"dodgerblue": [
|
|
441
|
-
30,
|
|
442
|
-
144,
|
|
443
|
-
255
|
|
444
|
-
],
|
|
445
|
-
"firebrick": [
|
|
446
|
-
178,
|
|
447
|
-
34,
|
|
448
|
-
34
|
|
449
|
-
],
|
|
450
|
-
"floralwhite": [
|
|
451
|
-
255,
|
|
452
|
-
250,
|
|
453
|
-
240
|
|
454
|
-
],
|
|
455
|
-
"forestgreen": [
|
|
456
|
-
34,
|
|
457
|
-
139,
|
|
458
|
-
34
|
|
459
|
-
],
|
|
460
|
-
"fuchsia": [
|
|
461
|
-
255,
|
|
462
|
-
0,
|
|
463
|
-
255
|
|
464
|
-
],
|
|
465
|
-
"gainsboro": [
|
|
466
|
-
220,
|
|
467
|
-
220,
|
|
468
|
-
220
|
|
469
|
-
],
|
|
470
|
-
"ghostwhite": [
|
|
471
|
-
248,
|
|
472
|
-
248,
|
|
473
|
-
255
|
|
474
|
-
],
|
|
475
|
-
"gold": [
|
|
476
|
-
255,
|
|
477
|
-
215,
|
|
478
|
-
0
|
|
479
|
-
],
|
|
480
|
-
"goldenrod": [
|
|
481
|
-
218,
|
|
482
|
-
165,
|
|
483
|
-
32
|
|
484
|
-
],
|
|
485
|
-
"gray": [
|
|
486
|
-
128,
|
|
487
|
-
128,
|
|
488
|
-
128
|
|
489
|
-
],
|
|
490
|
-
"green": [
|
|
491
|
-
0,
|
|
492
|
-
128,
|
|
493
|
-
0
|
|
494
|
-
],
|
|
495
|
-
"greenyellow": [
|
|
496
|
-
173,
|
|
497
|
-
255,
|
|
498
|
-
47
|
|
499
|
-
],
|
|
500
|
-
"grey": [
|
|
501
|
-
128,
|
|
502
|
-
128,
|
|
503
|
-
128
|
|
504
|
-
],
|
|
505
|
-
"honeydew": [
|
|
506
|
-
240,
|
|
507
|
-
255,
|
|
508
|
-
240
|
|
509
|
-
],
|
|
510
|
-
"hotpink": [
|
|
511
|
-
255,
|
|
512
|
-
105,
|
|
513
|
-
180
|
|
514
|
-
],
|
|
515
|
-
"indianred": [
|
|
516
|
-
205,
|
|
517
|
-
92,
|
|
518
|
-
92
|
|
519
|
-
],
|
|
520
|
-
"indigo": [
|
|
521
|
-
75,
|
|
522
|
-
0,
|
|
523
|
-
130
|
|
524
|
-
],
|
|
525
|
-
"ivory": [
|
|
526
|
-
255,
|
|
527
|
-
255,
|
|
528
|
-
240
|
|
529
|
-
],
|
|
530
|
-
"khaki": [
|
|
531
|
-
240,
|
|
532
|
-
230,
|
|
533
|
-
140
|
|
534
|
-
],
|
|
535
|
-
"lavender": [
|
|
536
|
-
230,
|
|
537
|
-
230,
|
|
538
|
-
250
|
|
539
|
-
],
|
|
540
|
-
"lavenderblush": [
|
|
541
|
-
255,
|
|
542
|
-
240,
|
|
543
|
-
245
|
|
544
|
-
],
|
|
545
|
-
"lawngreen": [
|
|
546
|
-
124,
|
|
547
|
-
252,
|
|
548
|
-
0
|
|
549
|
-
],
|
|
550
|
-
"lemonchiffon": [
|
|
551
|
-
255,
|
|
552
|
-
250,
|
|
553
|
-
205
|
|
554
|
-
],
|
|
555
|
-
"lightblue": [
|
|
556
|
-
173,
|
|
557
|
-
216,
|
|
558
|
-
230
|
|
559
|
-
],
|
|
560
|
-
"lightcoral": [
|
|
561
|
-
240,
|
|
562
|
-
128,
|
|
563
|
-
128
|
|
564
|
-
],
|
|
565
|
-
"lightcyan": [
|
|
566
|
-
224,
|
|
567
|
-
255,
|
|
568
|
-
255
|
|
569
|
-
],
|
|
570
|
-
"lightgoldenrodyellow": [
|
|
571
|
-
250,
|
|
572
|
-
250,
|
|
573
|
-
210
|
|
574
|
-
],
|
|
575
|
-
"lightgray": [
|
|
576
|
-
211,
|
|
577
|
-
211,
|
|
578
|
-
211
|
|
579
|
-
],
|
|
580
|
-
"lightgreen": [
|
|
581
|
-
144,
|
|
582
|
-
238,
|
|
583
|
-
144
|
|
584
|
-
],
|
|
585
|
-
"lightgrey": [
|
|
586
|
-
211,
|
|
587
|
-
211,
|
|
588
|
-
211
|
|
589
|
-
],
|
|
590
|
-
"lightpink": [
|
|
591
|
-
255,
|
|
592
|
-
182,
|
|
593
|
-
193
|
|
594
|
-
],
|
|
595
|
-
"lightsalmon": [
|
|
596
|
-
255,
|
|
597
|
-
160,
|
|
598
|
-
122
|
|
599
|
-
],
|
|
600
|
-
"lightseagreen": [
|
|
601
|
-
32,
|
|
602
|
-
178,
|
|
603
|
-
170
|
|
604
|
-
],
|
|
605
|
-
"lightskyblue": [
|
|
606
|
-
135,
|
|
607
|
-
206,
|
|
608
|
-
250
|
|
609
|
-
],
|
|
610
|
-
"lightslategray": [
|
|
611
|
-
119,
|
|
612
|
-
136,
|
|
613
|
-
153
|
|
614
|
-
],
|
|
615
|
-
"lightslategrey": [
|
|
616
|
-
119,
|
|
617
|
-
136,
|
|
618
|
-
153
|
|
619
|
-
],
|
|
620
|
-
"lightsteelblue": [
|
|
621
|
-
176,
|
|
622
|
-
196,
|
|
623
|
-
222
|
|
624
|
-
],
|
|
625
|
-
"lightyellow": [
|
|
626
|
-
255,
|
|
627
|
-
255,
|
|
628
|
-
224
|
|
629
|
-
],
|
|
630
|
-
"lime": [
|
|
631
|
-
0,
|
|
632
|
-
255,
|
|
633
|
-
0
|
|
634
|
-
],
|
|
635
|
-
"limegreen": [
|
|
636
|
-
50,
|
|
637
|
-
205,
|
|
638
|
-
50
|
|
639
|
-
],
|
|
640
|
-
"linen": [
|
|
641
|
-
250,
|
|
642
|
-
240,
|
|
643
|
-
230
|
|
644
|
-
],
|
|
645
|
-
"magenta": [
|
|
646
|
-
255,
|
|
647
|
-
0,
|
|
648
|
-
255
|
|
649
|
-
],
|
|
650
|
-
"maroon": [
|
|
651
|
-
128,
|
|
652
|
-
0,
|
|
653
|
-
0
|
|
654
|
-
],
|
|
655
|
-
"mediumaquamarine": [
|
|
656
|
-
102,
|
|
657
|
-
205,
|
|
658
|
-
170
|
|
659
|
-
],
|
|
660
|
-
"mediumblue": [
|
|
661
|
-
0,
|
|
662
|
-
0,
|
|
663
|
-
205
|
|
664
|
-
],
|
|
665
|
-
"mediumorchid": [
|
|
666
|
-
186,
|
|
667
|
-
85,
|
|
668
|
-
211
|
|
669
|
-
],
|
|
670
|
-
"mediumpurple": [
|
|
671
|
-
147,
|
|
672
|
-
112,
|
|
673
|
-
219
|
|
674
|
-
],
|
|
675
|
-
"mediumseagreen": [
|
|
676
|
-
60,
|
|
677
|
-
179,
|
|
678
|
-
113
|
|
679
|
-
],
|
|
680
|
-
"mediumslateblue": [
|
|
681
|
-
123,
|
|
682
|
-
104,
|
|
683
|
-
238
|
|
684
|
-
],
|
|
685
|
-
"mediumspringgreen": [
|
|
686
|
-
0,
|
|
687
|
-
250,
|
|
688
|
-
154
|
|
689
|
-
],
|
|
690
|
-
"mediumturquoise": [
|
|
691
|
-
72,
|
|
692
|
-
209,
|
|
693
|
-
204
|
|
694
|
-
],
|
|
695
|
-
"mediumvioletred": [
|
|
696
|
-
199,
|
|
697
|
-
21,
|
|
698
|
-
133
|
|
699
|
-
],
|
|
700
|
-
"midnightblue": [
|
|
701
|
-
25,
|
|
702
|
-
25,
|
|
703
|
-
112
|
|
704
|
-
],
|
|
705
|
-
"mintcream": [
|
|
706
|
-
245,
|
|
707
|
-
255,
|
|
708
|
-
250
|
|
709
|
-
],
|
|
710
|
-
"mistyrose": [
|
|
711
|
-
255,
|
|
712
|
-
228,
|
|
713
|
-
225
|
|
714
|
-
],
|
|
715
|
-
"moccasin": [
|
|
716
|
-
255,
|
|
717
|
-
228,
|
|
718
|
-
181
|
|
719
|
-
],
|
|
720
|
-
"navajowhite": [
|
|
721
|
-
255,
|
|
722
|
-
222,
|
|
723
|
-
173
|
|
724
|
-
],
|
|
725
|
-
"navy": [
|
|
726
|
-
0,
|
|
727
|
-
0,
|
|
728
|
-
128
|
|
729
|
-
],
|
|
730
|
-
"oldlace": [
|
|
731
|
-
253,
|
|
732
|
-
245,
|
|
733
|
-
230
|
|
734
|
-
],
|
|
735
|
-
"olive": [
|
|
736
|
-
128,
|
|
737
|
-
128,
|
|
738
|
-
0
|
|
739
|
-
],
|
|
740
|
-
"olivedrab": [
|
|
741
|
-
107,
|
|
742
|
-
142,
|
|
743
|
-
35
|
|
744
|
-
],
|
|
745
|
-
"orange": [
|
|
746
|
-
255,
|
|
747
|
-
165,
|
|
748
|
-
0
|
|
749
|
-
],
|
|
750
|
-
"orangered": [
|
|
751
|
-
255,
|
|
752
|
-
69,
|
|
753
|
-
0
|
|
754
|
-
],
|
|
755
|
-
"orchid": [
|
|
756
|
-
218,
|
|
757
|
-
112,
|
|
758
|
-
214
|
|
759
|
-
],
|
|
760
|
-
"palegoldenrod": [
|
|
761
|
-
238,
|
|
762
|
-
232,
|
|
763
|
-
170
|
|
764
|
-
],
|
|
765
|
-
"palegreen": [
|
|
766
|
-
152,
|
|
767
|
-
251,
|
|
768
|
-
152
|
|
769
|
-
],
|
|
770
|
-
"paleturquoise": [
|
|
771
|
-
175,
|
|
772
|
-
238,
|
|
773
|
-
238
|
|
774
|
-
],
|
|
775
|
-
"palevioletred": [
|
|
776
|
-
219,
|
|
777
|
-
112,
|
|
778
|
-
147
|
|
779
|
-
],
|
|
780
|
-
"papayawhip": [
|
|
781
|
-
255,
|
|
782
|
-
239,
|
|
783
|
-
213
|
|
784
|
-
],
|
|
785
|
-
"peachpuff": [
|
|
786
|
-
255,
|
|
787
|
-
218,
|
|
788
|
-
185
|
|
789
|
-
],
|
|
790
|
-
"peru": [
|
|
791
|
-
205,
|
|
792
|
-
133,
|
|
793
|
-
63
|
|
794
|
-
],
|
|
795
|
-
"pink": [
|
|
796
|
-
255,
|
|
797
|
-
192,
|
|
798
|
-
203
|
|
799
|
-
],
|
|
800
|
-
"plum": [
|
|
801
|
-
221,
|
|
802
|
-
160,
|
|
803
|
-
221
|
|
804
|
-
],
|
|
805
|
-
"powderblue": [
|
|
806
|
-
176,
|
|
807
|
-
224,
|
|
808
|
-
230
|
|
809
|
-
],
|
|
810
|
-
"purple": [
|
|
811
|
-
128,
|
|
812
|
-
0,
|
|
813
|
-
128
|
|
814
|
-
],
|
|
815
|
-
"rebeccapurple": [
|
|
816
|
-
102,
|
|
817
|
-
51,
|
|
818
|
-
153
|
|
819
|
-
],
|
|
820
|
-
"red": [
|
|
821
|
-
255,
|
|
822
|
-
0,
|
|
823
|
-
0
|
|
824
|
-
],
|
|
825
|
-
"rosybrown": [
|
|
826
|
-
188,
|
|
827
|
-
143,
|
|
828
|
-
143
|
|
829
|
-
],
|
|
830
|
-
"royalblue": [
|
|
831
|
-
65,
|
|
832
|
-
105,
|
|
833
|
-
225
|
|
834
|
-
],
|
|
835
|
-
"saddlebrown": [
|
|
836
|
-
139,
|
|
837
|
-
69,
|
|
838
|
-
19
|
|
839
|
-
],
|
|
840
|
-
"salmon": [
|
|
841
|
-
250,
|
|
842
|
-
128,
|
|
843
|
-
114
|
|
844
|
-
],
|
|
845
|
-
"sandybrown": [
|
|
846
|
-
244,
|
|
847
|
-
164,
|
|
848
|
-
96
|
|
849
|
-
],
|
|
850
|
-
"seagreen": [
|
|
851
|
-
46,
|
|
852
|
-
139,
|
|
853
|
-
87
|
|
854
|
-
],
|
|
855
|
-
"seashell": [
|
|
856
|
-
255,
|
|
857
|
-
245,
|
|
858
|
-
238
|
|
859
|
-
],
|
|
860
|
-
"sienna": [
|
|
861
|
-
160,
|
|
862
|
-
82,
|
|
863
|
-
45
|
|
864
|
-
],
|
|
865
|
-
"silver": [
|
|
866
|
-
192,
|
|
867
|
-
192,
|
|
868
|
-
192
|
|
869
|
-
],
|
|
870
|
-
"skyblue": [
|
|
871
|
-
135,
|
|
872
|
-
206,
|
|
873
|
-
235
|
|
874
|
-
],
|
|
875
|
-
"slateblue": [
|
|
876
|
-
106,
|
|
877
|
-
90,
|
|
878
|
-
205
|
|
879
|
-
],
|
|
880
|
-
"slategray": [
|
|
881
|
-
112,
|
|
882
|
-
128,
|
|
883
|
-
144
|
|
884
|
-
],
|
|
885
|
-
"slategrey": [
|
|
886
|
-
112,
|
|
887
|
-
128,
|
|
888
|
-
144
|
|
889
|
-
],
|
|
890
|
-
"snow": [
|
|
891
|
-
255,
|
|
892
|
-
250,
|
|
893
|
-
250
|
|
894
|
-
],
|
|
895
|
-
"springgreen": [
|
|
896
|
-
0,
|
|
897
|
-
255,
|
|
898
|
-
127
|
|
899
|
-
],
|
|
900
|
-
"steelblue": [
|
|
901
|
-
70,
|
|
902
|
-
130,
|
|
903
|
-
180
|
|
904
|
-
],
|
|
905
|
-
"tan": [
|
|
906
|
-
210,
|
|
907
|
-
180,
|
|
908
|
-
140
|
|
909
|
-
],
|
|
910
|
-
"teal": [
|
|
911
|
-
0,
|
|
912
|
-
128,
|
|
913
|
-
128
|
|
914
|
-
],
|
|
915
|
-
"thistle": [
|
|
916
|
-
216,
|
|
917
|
-
191,
|
|
918
|
-
216
|
|
919
|
-
],
|
|
920
|
-
"tomato": [
|
|
921
|
-
255,
|
|
922
|
-
99,
|
|
923
|
-
71
|
|
924
|
-
],
|
|
925
|
-
"turquoise": [
|
|
926
|
-
64,
|
|
927
|
-
224,
|
|
928
|
-
208
|
|
929
|
-
],
|
|
930
|
-
"violet": [
|
|
931
|
-
238,
|
|
932
|
-
130,
|
|
933
|
-
238
|
|
934
|
-
],
|
|
935
|
-
"wheat": [
|
|
936
|
-
245,
|
|
937
|
-
222,
|
|
938
|
-
179
|
|
939
|
-
],
|
|
940
|
-
"white": [
|
|
941
|
-
255,
|
|
942
|
-
255,
|
|
943
|
-
255
|
|
944
|
-
],
|
|
945
|
-
"whitesmoke": [
|
|
946
|
-
245,
|
|
947
|
-
245,
|
|
948
|
-
245
|
|
949
|
-
],
|
|
950
|
-
"yellow": [
|
|
951
|
-
255,
|
|
952
|
-
255,
|
|
953
|
-
0
|
|
954
|
-
],
|
|
955
|
-
"yellowgreen": [
|
|
956
|
-
154,
|
|
957
|
-
205,
|
|
958
|
-
50
|
|
959
|
-
]
|
|
960
|
-
};
|
|
961
|
-
}));
|
|
962
|
-
//#endregion
|
|
963
|
-
//#region node_modules/color-convert/conversions.js
|
|
964
|
-
var require_conversions = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
965
|
-
var cssKeywords = require_color_name();
|
|
966
|
-
var reverseKeywords = {};
|
|
967
|
-
for (const key of Object.keys(cssKeywords)) reverseKeywords[cssKeywords[key]] = key;
|
|
968
|
-
var convert = {
|
|
969
|
-
rgb: {
|
|
970
|
-
channels: 3,
|
|
971
|
-
labels: "rgb"
|
|
972
|
-
},
|
|
973
|
-
hsl: {
|
|
974
|
-
channels: 3,
|
|
975
|
-
labels: "hsl"
|
|
976
|
-
},
|
|
977
|
-
hsv: {
|
|
978
|
-
channels: 3,
|
|
979
|
-
labels: "hsv"
|
|
980
|
-
},
|
|
981
|
-
hwb: {
|
|
982
|
-
channels: 3,
|
|
983
|
-
labels: "hwb"
|
|
984
|
-
},
|
|
985
|
-
cmyk: {
|
|
986
|
-
channels: 4,
|
|
987
|
-
labels: "cmyk"
|
|
988
|
-
},
|
|
989
|
-
xyz: {
|
|
990
|
-
channels: 3,
|
|
991
|
-
labels: "xyz"
|
|
992
|
-
},
|
|
993
|
-
lab: {
|
|
994
|
-
channels: 3,
|
|
995
|
-
labels: "lab"
|
|
996
|
-
},
|
|
997
|
-
lch: {
|
|
998
|
-
channels: 3,
|
|
999
|
-
labels: "lch"
|
|
1000
|
-
},
|
|
1001
|
-
hex: {
|
|
1002
|
-
channels: 1,
|
|
1003
|
-
labels: ["hex"]
|
|
1004
|
-
},
|
|
1005
|
-
keyword: {
|
|
1006
|
-
channels: 1,
|
|
1007
|
-
labels: ["keyword"]
|
|
1008
|
-
},
|
|
1009
|
-
ansi16: {
|
|
1010
|
-
channels: 1,
|
|
1011
|
-
labels: ["ansi16"]
|
|
1012
|
-
},
|
|
1013
|
-
ansi256: {
|
|
1014
|
-
channels: 1,
|
|
1015
|
-
labels: ["ansi256"]
|
|
1016
|
-
},
|
|
1017
|
-
hcg: {
|
|
1018
|
-
channels: 3,
|
|
1019
|
-
labels: [
|
|
1020
|
-
"h",
|
|
1021
|
-
"c",
|
|
1022
|
-
"g"
|
|
1023
|
-
]
|
|
1024
|
-
},
|
|
1025
|
-
apple: {
|
|
1026
|
-
channels: 3,
|
|
1027
|
-
labels: [
|
|
1028
|
-
"r16",
|
|
1029
|
-
"g16",
|
|
1030
|
-
"b16"
|
|
1031
|
-
]
|
|
1032
|
-
},
|
|
1033
|
-
gray: {
|
|
1034
|
-
channels: 1,
|
|
1035
|
-
labels: ["gray"]
|
|
1036
|
-
}
|
|
1037
|
-
};
|
|
1038
|
-
module.exports = convert;
|
|
1039
|
-
for (const model of Object.keys(convert)) {
|
|
1040
|
-
if (!("channels" in convert[model])) throw new Error("missing channels property: " + model);
|
|
1041
|
-
if (!("labels" in convert[model])) throw new Error("missing channel labels property: " + model);
|
|
1042
|
-
if (convert[model].labels.length !== convert[model].channels) throw new Error("channel and label counts mismatch: " + model);
|
|
1043
|
-
const { channels, labels } = convert[model];
|
|
1044
|
-
delete convert[model].channels;
|
|
1045
|
-
delete convert[model].labels;
|
|
1046
|
-
Object.defineProperty(convert[model], "channels", { value: channels });
|
|
1047
|
-
Object.defineProperty(convert[model], "labels", { value: labels });
|
|
1048
|
-
}
|
|
1049
|
-
convert.rgb.hsl = function(rgb) {
|
|
1050
|
-
const r = rgb[0] / 255;
|
|
1051
|
-
const g = rgb[1] / 255;
|
|
1052
|
-
const b = rgb[2] / 255;
|
|
1053
|
-
const min = Math.min(r, g, b);
|
|
1054
|
-
const max = Math.max(r, g, b);
|
|
1055
|
-
const delta = max - min;
|
|
1056
|
-
let h;
|
|
1057
|
-
let s;
|
|
1058
|
-
if (max === min) h = 0;
|
|
1059
|
-
else if (r === max) h = (g - b) / delta;
|
|
1060
|
-
else if (g === max) h = 2 + (b - r) / delta;
|
|
1061
|
-
else if (b === max) h = 4 + (r - g) / delta;
|
|
1062
|
-
h = Math.min(h * 60, 360);
|
|
1063
|
-
if (h < 0) h += 360;
|
|
1064
|
-
const l = (min + max) / 2;
|
|
1065
|
-
if (max === min) s = 0;
|
|
1066
|
-
else if (l <= .5) s = delta / (max + min);
|
|
1067
|
-
else s = delta / (2 - max - min);
|
|
1068
|
-
return [
|
|
1069
|
-
h,
|
|
1070
|
-
s * 100,
|
|
1071
|
-
l * 100
|
|
1072
|
-
];
|
|
1073
|
-
};
|
|
1074
|
-
convert.rgb.hsv = function(rgb) {
|
|
1075
|
-
let rdif;
|
|
1076
|
-
let gdif;
|
|
1077
|
-
let bdif;
|
|
1078
|
-
let h;
|
|
1079
|
-
let s;
|
|
1080
|
-
const r = rgb[0] / 255;
|
|
1081
|
-
const g = rgb[1] / 255;
|
|
1082
|
-
const b = rgb[2] / 255;
|
|
1083
|
-
const v = Math.max(r, g, b);
|
|
1084
|
-
const diff = v - Math.min(r, g, b);
|
|
1085
|
-
const diffc = function(c) {
|
|
1086
|
-
return (v - c) / 6 / diff + 1 / 2;
|
|
1087
|
-
};
|
|
1088
|
-
if (diff === 0) {
|
|
1089
|
-
h = 0;
|
|
1090
|
-
s = 0;
|
|
1091
|
-
} else {
|
|
1092
|
-
s = diff / v;
|
|
1093
|
-
rdif = diffc(r);
|
|
1094
|
-
gdif = diffc(g);
|
|
1095
|
-
bdif = diffc(b);
|
|
1096
|
-
if (r === v) h = bdif - gdif;
|
|
1097
|
-
else if (g === v) h = 1 / 3 + rdif - bdif;
|
|
1098
|
-
else if (b === v) h = 2 / 3 + gdif - rdif;
|
|
1099
|
-
if (h < 0) h += 1;
|
|
1100
|
-
else if (h > 1) h -= 1;
|
|
1101
|
-
}
|
|
1102
|
-
return [
|
|
1103
|
-
h * 360,
|
|
1104
|
-
s * 100,
|
|
1105
|
-
v * 100
|
|
1106
|
-
];
|
|
1107
|
-
};
|
|
1108
|
-
convert.rgb.hwb = function(rgb) {
|
|
1109
|
-
const r = rgb[0];
|
|
1110
|
-
const g = rgb[1];
|
|
1111
|
-
let b = rgb[2];
|
|
1112
|
-
const h = convert.rgb.hsl(rgb)[0];
|
|
1113
|
-
const w = 1 / 255 * Math.min(r, Math.min(g, b));
|
|
1114
|
-
b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
|
|
1115
|
-
return [
|
|
1116
|
-
h,
|
|
1117
|
-
w * 100,
|
|
1118
|
-
b * 100
|
|
1119
|
-
];
|
|
1120
|
-
};
|
|
1121
|
-
convert.rgb.cmyk = function(rgb) {
|
|
1122
|
-
const r = rgb[0] / 255;
|
|
1123
|
-
const g = rgb[1] / 255;
|
|
1124
|
-
const b = rgb[2] / 255;
|
|
1125
|
-
const k = Math.min(1 - r, 1 - g, 1 - b);
|
|
1126
|
-
const c = (1 - r - k) / (1 - k) || 0;
|
|
1127
|
-
const m = (1 - g - k) / (1 - k) || 0;
|
|
1128
|
-
const y = (1 - b - k) / (1 - k) || 0;
|
|
1129
|
-
return [
|
|
1130
|
-
c * 100,
|
|
1131
|
-
m * 100,
|
|
1132
|
-
y * 100,
|
|
1133
|
-
k * 100
|
|
1134
|
-
];
|
|
1135
|
-
};
|
|
1136
|
-
function comparativeDistance(x, y) {
|
|
1137
|
-
return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
|
|
1138
|
-
}
|
|
1139
|
-
convert.rgb.keyword = function(rgb) {
|
|
1140
|
-
const reversed = reverseKeywords[rgb];
|
|
1141
|
-
if (reversed) return reversed;
|
|
1142
|
-
let currentClosestDistance = Infinity;
|
|
1143
|
-
let currentClosestKeyword;
|
|
1144
|
-
for (const keyword of Object.keys(cssKeywords)) {
|
|
1145
|
-
const value = cssKeywords[keyword];
|
|
1146
|
-
const distance = comparativeDistance(rgb, value);
|
|
1147
|
-
if (distance < currentClosestDistance) {
|
|
1148
|
-
currentClosestDistance = distance;
|
|
1149
|
-
currentClosestKeyword = keyword;
|
|
1150
|
-
}
|
|
1151
|
-
}
|
|
1152
|
-
return currentClosestKeyword;
|
|
1153
|
-
};
|
|
1154
|
-
convert.keyword.rgb = function(keyword) {
|
|
1155
|
-
return cssKeywords[keyword];
|
|
1156
|
-
};
|
|
1157
|
-
convert.rgb.xyz = function(rgb) {
|
|
1158
|
-
let r = rgb[0] / 255;
|
|
1159
|
-
let g = rgb[1] / 255;
|
|
1160
|
-
let b = rgb[2] / 255;
|
|
1161
|
-
r = r > .04045 ? ((r + .055) / 1.055) ** 2.4 : r / 12.92;
|
|
1162
|
-
g = g > .04045 ? ((g + .055) / 1.055) ** 2.4 : g / 12.92;
|
|
1163
|
-
b = b > .04045 ? ((b + .055) / 1.055) ** 2.4 : b / 12.92;
|
|
1164
|
-
const x = r * .4124 + g * .3576 + b * .1805;
|
|
1165
|
-
const y = r * .2126 + g * .7152 + b * .0722;
|
|
1166
|
-
const z = r * .0193 + g * .1192 + b * .9505;
|
|
1167
|
-
return [
|
|
1168
|
-
x * 100,
|
|
1169
|
-
y * 100,
|
|
1170
|
-
z * 100
|
|
1171
|
-
];
|
|
1172
|
-
};
|
|
1173
|
-
convert.rgb.lab = function(rgb) {
|
|
1174
|
-
const xyz = convert.rgb.xyz(rgb);
|
|
1175
|
-
let x = xyz[0];
|
|
1176
|
-
let y = xyz[1];
|
|
1177
|
-
let z = xyz[2];
|
|
1178
|
-
x /= 95.047;
|
|
1179
|
-
y /= 100;
|
|
1180
|
-
z /= 108.883;
|
|
1181
|
-
x = x > .008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
1182
|
-
y = y > .008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
1183
|
-
z = z > .008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
1184
|
-
return [
|
|
1185
|
-
116 * y - 16,
|
|
1186
|
-
500 * (x - y),
|
|
1187
|
-
200 * (y - z)
|
|
1188
|
-
];
|
|
1189
|
-
};
|
|
1190
|
-
convert.hsl.rgb = function(hsl) {
|
|
1191
|
-
const h = hsl[0] / 360;
|
|
1192
|
-
const s = hsl[1] / 100;
|
|
1193
|
-
const l = hsl[2] / 100;
|
|
1194
|
-
let t2;
|
|
1195
|
-
let t3;
|
|
1196
|
-
let val;
|
|
1197
|
-
if (s === 0) {
|
|
1198
|
-
val = l * 255;
|
|
1199
|
-
return [
|
|
1200
|
-
val,
|
|
1201
|
-
val,
|
|
1202
|
-
val
|
|
1203
|
-
];
|
|
1204
|
-
}
|
|
1205
|
-
if (l < .5) t2 = l * (1 + s);
|
|
1206
|
-
else t2 = l + s - l * s;
|
|
1207
|
-
const t1 = 2 * l - t2;
|
|
1208
|
-
const rgb = [
|
|
1209
|
-
0,
|
|
1210
|
-
0,
|
|
1211
|
-
0
|
|
1212
|
-
];
|
|
1213
|
-
for (let i = 0; i < 3; i++) {
|
|
1214
|
-
t3 = h + 1 / 3 * -(i - 1);
|
|
1215
|
-
if (t3 < 0) t3++;
|
|
1216
|
-
if (t3 > 1) t3--;
|
|
1217
|
-
if (6 * t3 < 1) val = t1 + (t2 - t1) * 6 * t3;
|
|
1218
|
-
else if (2 * t3 < 1) val = t2;
|
|
1219
|
-
else if (3 * t3 < 2) val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
|
1220
|
-
else val = t1;
|
|
1221
|
-
rgb[i] = val * 255;
|
|
1222
|
-
}
|
|
1223
|
-
return rgb;
|
|
1224
|
-
};
|
|
1225
|
-
convert.hsl.hsv = function(hsl) {
|
|
1226
|
-
const h = hsl[0];
|
|
1227
|
-
let s = hsl[1] / 100;
|
|
1228
|
-
let l = hsl[2] / 100;
|
|
1229
|
-
let smin = s;
|
|
1230
|
-
const lmin = Math.max(l, .01);
|
|
1231
|
-
l *= 2;
|
|
1232
|
-
s *= l <= 1 ? l : 2 - l;
|
|
1233
|
-
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
1234
|
-
const v = (l + s) / 2;
|
|
1235
|
-
return [
|
|
1236
|
-
h,
|
|
1237
|
-
(l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s)) * 100,
|
|
1238
|
-
v * 100
|
|
1239
|
-
];
|
|
1240
|
-
};
|
|
1241
|
-
convert.hsv.rgb = function(hsv) {
|
|
1242
|
-
const h = hsv[0] / 60;
|
|
1243
|
-
const s = hsv[1] / 100;
|
|
1244
|
-
let v = hsv[2] / 100;
|
|
1245
|
-
const hi = Math.floor(h) % 6;
|
|
1246
|
-
const f = h - Math.floor(h);
|
|
1247
|
-
const p = 255 * v * (1 - s);
|
|
1248
|
-
const q = 255 * v * (1 - s * f);
|
|
1249
|
-
const t = 255 * v * (1 - s * (1 - f));
|
|
1250
|
-
v *= 255;
|
|
1251
|
-
switch (hi) {
|
|
1252
|
-
case 0: return [
|
|
1253
|
-
v,
|
|
1254
|
-
t,
|
|
1255
|
-
p
|
|
1256
|
-
];
|
|
1257
|
-
case 1: return [
|
|
1258
|
-
q,
|
|
1259
|
-
v,
|
|
1260
|
-
p
|
|
1261
|
-
];
|
|
1262
|
-
case 2: return [
|
|
1263
|
-
p,
|
|
1264
|
-
v,
|
|
1265
|
-
t
|
|
1266
|
-
];
|
|
1267
|
-
case 3: return [
|
|
1268
|
-
p,
|
|
1269
|
-
q,
|
|
1270
|
-
v
|
|
1271
|
-
];
|
|
1272
|
-
case 4: return [
|
|
1273
|
-
t,
|
|
1274
|
-
p,
|
|
1275
|
-
v
|
|
1276
|
-
];
|
|
1277
|
-
case 5: return [
|
|
1278
|
-
v,
|
|
1279
|
-
p,
|
|
1280
|
-
q
|
|
1281
|
-
];
|
|
1282
|
-
}
|
|
1283
|
-
};
|
|
1284
|
-
convert.hsv.hsl = function(hsv) {
|
|
1285
|
-
const h = hsv[0];
|
|
1286
|
-
const s = hsv[1] / 100;
|
|
1287
|
-
const v = hsv[2] / 100;
|
|
1288
|
-
const vmin = Math.max(v, .01);
|
|
1289
|
-
let sl;
|
|
1290
|
-
let l;
|
|
1291
|
-
l = (2 - s) * v;
|
|
1292
|
-
const lmin = (2 - s) * vmin;
|
|
1293
|
-
sl = s * vmin;
|
|
1294
|
-
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
1295
|
-
sl = sl || 0;
|
|
1296
|
-
l /= 2;
|
|
1297
|
-
return [
|
|
1298
|
-
h,
|
|
1299
|
-
sl * 100,
|
|
1300
|
-
l * 100
|
|
1301
|
-
];
|
|
1302
|
-
};
|
|
1303
|
-
convert.hwb.rgb = function(hwb) {
|
|
1304
|
-
const h = hwb[0] / 360;
|
|
1305
|
-
let wh = hwb[1] / 100;
|
|
1306
|
-
let bl = hwb[2] / 100;
|
|
1307
|
-
const ratio = wh + bl;
|
|
1308
|
-
let f;
|
|
1309
|
-
if (ratio > 1) {
|
|
1310
|
-
wh /= ratio;
|
|
1311
|
-
bl /= ratio;
|
|
1312
|
-
}
|
|
1313
|
-
const i = Math.floor(6 * h);
|
|
1314
|
-
const v = 1 - bl;
|
|
1315
|
-
f = 6 * h - i;
|
|
1316
|
-
if ((i & 1) !== 0) f = 1 - f;
|
|
1317
|
-
const n = wh + f * (v - wh);
|
|
1318
|
-
let r;
|
|
1319
|
-
let g;
|
|
1320
|
-
let b;
|
|
1321
|
-
switch (i) {
|
|
1322
|
-
default:
|
|
1323
|
-
case 6:
|
|
1324
|
-
case 0:
|
|
1325
|
-
r = v;
|
|
1326
|
-
g = n;
|
|
1327
|
-
b = wh;
|
|
1328
|
-
break;
|
|
1329
|
-
case 1:
|
|
1330
|
-
r = n;
|
|
1331
|
-
g = v;
|
|
1332
|
-
b = wh;
|
|
1333
|
-
break;
|
|
1334
|
-
case 2:
|
|
1335
|
-
r = wh;
|
|
1336
|
-
g = v;
|
|
1337
|
-
b = n;
|
|
1338
|
-
break;
|
|
1339
|
-
case 3:
|
|
1340
|
-
r = wh;
|
|
1341
|
-
g = n;
|
|
1342
|
-
b = v;
|
|
1343
|
-
break;
|
|
1344
|
-
case 4:
|
|
1345
|
-
r = n;
|
|
1346
|
-
g = wh;
|
|
1347
|
-
b = v;
|
|
1348
|
-
break;
|
|
1349
|
-
case 5:
|
|
1350
|
-
r = v;
|
|
1351
|
-
g = wh;
|
|
1352
|
-
b = n;
|
|
1353
|
-
break;
|
|
1354
|
-
}
|
|
1355
|
-
return [
|
|
1356
|
-
r * 255,
|
|
1357
|
-
g * 255,
|
|
1358
|
-
b * 255
|
|
1359
|
-
];
|
|
1360
|
-
};
|
|
1361
|
-
convert.cmyk.rgb = function(cmyk) {
|
|
1362
|
-
const c = cmyk[0] / 100;
|
|
1363
|
-
const m = cmyk[1] / 100;
|
|
1364
|
-
const y = cmyk[2] / 100;
|
|
1365
|
-
const k = cmyk[3] / 100;
|
|
1366
|
-
const r = 1 - Math.min(1, c * (1 - k) + k);
|
|
1367
|
-
const g = 1 - Math.min(1, m * (1 - k) + k);
|
|
1368
|
-
const b = 1 - Math.min(1, y * (1 - k) + k);
|
|
1369
|
-
return [
|
|
1370
|
-
r * 255,
|
|
1371
|
-
g * 255,
|
|
1372
|
-
b * 255
|
|
1373
|
-
];
|
|
1374
|
-
};
|
|
1375
|
-
convert.xyz.rgb = function(xyz) {
|
|
1376
|
-
const x = xyz[0] / 100;
|
|
1377
|
-
const y = xyz[1] / 100;
|
|
1378
|
-
const z = xyz[2] / 100;
|
|
1379
|
-
let r;
|
|
1380
|
-
let g;
|
|
1381
|
-
let b;
|
|
1382
|
-
r = x * 3.2406 + y * -1.5372 + z * -.4986;
|
|
1383
|
-
g = x * -.9689 + y * 1.8758 + z * .0415;
|
|
1384
|
-
b = x * .0557 + y * -.204 + z * 1.057;
|
|
1385
|
-
r = r > .0031308 ? 1.055 * r ** (1 / 2.4) - .055 : r * 12.92;
|
|
1386
|
-
g = g > .0031308 ? 1.055 * g ** (1 / 2.4) - .055 : g * 12.92;
|
|
1387
|
-
b = b > .0031308 ? 1.055 * b ** (1 / 2.4) - .055 : b * 12.92;
|
|
1388
|
-
r = Math.min(Math.max(0, r), 1);
|
|
1389
|
-
g = Math.min(Math.max(0, g), 1);
|
|
1390
|
-
b = Math.min(Math.max(0, b), 1);
|
|
1391
|
-
return [
|
|
1392
|
-
r * 255,
|
|
1393
|
-
g * 255,
|
|
1394
|
-
b * 255
|
|
1395
|
-
];
|
|
1396
|
-
};
|
|
1397
|
-
convert.xyz.lab = function(xyz) {
|
|
1398
|
-
let x = xyz[0];
|
|
1399
|
-
let y = xyz[1];
|
|
1400
|
-
let z = xyz[2];
|
|
1401
|
-
x /= 95.047;
|
|
1402
|
-
y /= 100;
|
|
1403
|
-
z /= 108.883;
|
|
1404
|
-
x = x > .008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
1405
|
-
y = y > .008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
1406
|
-
z = z > .008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
1407
|
-
return [
|
|
1408
|
-
116 * y - 16,
|
|
1409
|
-
500 * (x - y),
|
|
1410
|
-
200 * (y - z)
|
|
1411
|
-
];
|
|
1412
|
-
};
|
|
1413
|
-
convert.lab.xyz = function(lab) {
|
|
1414
|
-
const l = lab[0];
|
|
1415
|
-
const a = lab[1];
|
|
1416
|
-
const b = lab[2];
|
|
1417
|
-
let x;
|
|
1418
|
-
let y;
|
|
1419
|
-
let z;
|
|
1420
|
-
y = (l + 16) / 116;
|
|
1421
|
-
x = a / 500 + y;
|
|
1422
|
-
z = y - b / 200;
|
|
1423
|
-
const y2 = y ** 3;
|
|
1424
|
-
const x2 = x ** 3;
|
|
1425
|
-
const z2 = z ** 3;
|
|
1426
|
-
y = y2 > .008856 ? y2 : (y - 16 / 116) / 7.787;
|
|
1427
|
-
x = x2 > .008856 ? x2 : (x - 16 / 116) / 7.787;
|
|
1428
|
-
z = z2 > .008856 ? z2 : (z - 16 / 116) / 7.787;
|
|
1429
|
-
x *= 95.047;
|
|
1430
|
-
y *= 100;
|
|
1431
|
-
z *= 108.883;
|
|
1432
|
-
return [
|
|
1433
|
-
x,
|
|
1434
|
-
y,
|
|
1435
|
-
z
|
|
1436
|
-
];
|
|
1437
|
-
};
|
|
1438
|
-
convert.lab.lch = function(lab) {
|
|
1439
|
-
const l = lab[0];
|
|
1440
|
-
const a = lab[1];
|
|
1441
|
-
const b = lab[2];
|
|
1442
|
-
let h;
|
|
1443
|
-
h = Math.atan2(b, a) * 360 / 2 / Math.PI;
|
|
1444
|
-
if (h < 0) h += 360;
|
|
1445
|
-
return [
|
|
1446
|
-
l,
|
|
1447
|
-
Math.sqrt(a * a + b * b),
|
|
1448
|
-
h
|
|
1449
|
-
];
|
|
1450
|
-
};
|
|
1451
|
-
convert.lch.lab = function(lch) {
|
|
1452
|
-
const l = lch[0];
|
|
1453
|
-
const c = lch[1];
|
|
1454
|
-
const hr = lch[2] / 360 * 2 * Math.PI;
|
|
1455
|
-
return [
|
|
1456
|
-
l,
|
|
1457
|
-
c * Math.cos(hr),
|
|
1458
|
-
c * Math.sin(hr)
|
|
1459
|
-
];
|
|
1460
|
-
};
|
|
1461
|
-
convert.rgb.ansi16 = function(args, saturation = null) {
|
|
1462
|
-
const [r, g, b] = args;
|
|
1463
|
-
let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
|
|
1464
|
-
value = Math.round(value / 50);
|
|
1465
|
-
if (value === 0) return 30;
|
|
1466
|
-
let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
|
|
1467
|
-
if (value === 2) ansi += 60;
|
|
1468
|
-
return ansi;
|
|
1469
|
-
};
|
|
1470
|
-
convert.hsv.ansi16 = function(args) {
|
|
1471
|
-
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
|
1472
|
-
};
|
|
1473
|
-
convert.rgb.ansi256 = function(args) {
|
|
1474
|
-
const r = args[0];
|
|
1475
|
-
const g = args[1];
|
|
1476
|
-
const b = args[2];
|
|
1477
|
-
if (r === g && g === b) {
|
|
1478
|
-
if (r < 8) return 16;
|
|
1479
|
-
if (r > 248) return 231;
|
|
1480
|
-
return Math.round((r - 8) / 247 * 24) + 232;
|
|
1481
|
-
}
|
|
1482
|
-
return 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
|
|
1483
|
-
};
|
|
1484
|
-
convert.ansi16.rgb = function(args) {
|
|
1485
|
-
let color = args % 10;
|
|
1486
|
-
if (color === 0 || color === 7) {
|
|
1487
|
-
if (args > 50) color += 3.5;
|
|
1488
|
-
color = color / 10.5 * 255;
|
|
1489
|
-
return [
|
|
1490
|
-
color,
|
|
1491
|
-
color,
|
|
1492
|
-
color
|
|
1493
|
-
];
|
|
1494
|
-
}
|
|
1495
|
-
const mult = (~~(args > 50) + 1) * .5;
|
|
1496
|
-
return [
|
|
1497
|
-
(color & 1) * mult * 255,
|
|
1498
|
-
(color >> 1 & 1) * mult * 255,
|
|
1499
|
-
(color >> 2 & 1) * mult * 255
|
|
1500
|
-
];
|
|
1501
|
-
};
|
|
1502
|
-
convert.ansi256.rgb = function(args) {
|
|
1503
|
-
if (args >= 232) {
|
|
1504
|
-
const c = (args - 232) * 10 + 8;
|
|
1505
|
-
return [
|
|
1506
|
-
c,
|
|
1507
|
-
c,
|
|
1508
|
-
c
|
|
1509
|
-
];
|
|
1510
|
-
}
|
|
1511
|
-
args -= 16;
|
|
1512
|
-
let rem;
|
|
1513
|
-
return [
|
|
1514
|
-
Math.floor(args / 36) / 5 * 255,
|
|
1515
|
-
Math.floor((rem = args % 36) / 6) / 5 * 255,
|
|
1516
|
-
rem % 6 / 5 * 255
|
|
1517
|
-
];
|
|
1518
|
-
};
|
|
1519
|
-
convert.rgb.hex = function(args) {
|
|
1520
|
-
const string = (((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255)).toString(16).toUpperCase();
|
|
1521
|
-
return "000000".substring(string.length) + string;
|
|
1522
|
-
};
|
|
1523
|
-
convert.hex.rgb = function(args) {
|
|
1524
|
-
const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
1525
|
-
if (!match) return [
|
|
1526
|
-
0,
|
|
1527
|
-
0,
|
|
1528
|
-
0
|
|
1529
|
-
];
|
|
1530
|
-
let colorString = match[0];
|
|
1531
|
-
if (match[0].length === 3) colorString = colorString.split("").map((char) => {
|
|
1532
|
-
return char + char;
|
|
1533
|
-
}).join("");
|
|
1534
|
-
const integer = parseInt(colorString, 16);
|
|
1535
|
-
return [
|
|
1536
|
-
integer >> 16 & 255,
|
|
1537
|
-
integer >> 8 & 255,
|
|
1538
|
-
integer & 255
|
|
1539
|
-
];
|
|
1540
|
-
};
|
|
1541
|
-
convert.rgb.hcg = function(rgb) {
|
|
1542
|
-
const r = rgb[0] / 255;
|
|
1543
|
-
const g = rgb[1] / 255;
|
|
1544
|
-
const b = rgb[2] / 255;
|
|
1545
|
-
const max = Math.max(Math.max(r, g), b);
|
|
1546
|
-
const min = Math.min(Math.min(r, g), b);
|
|
1547
|
-
const chroma = max - min;
|
|
1548
|
-
let grayscale;
|
|
1549
|
-
let hue;
|
|
1550
|
-
if (chroma < 1) grayscale = min / (1 - chroma);
|
|
1551
|
-
else grayscale = 0;
|
|
1552
|
-
if (chroma <= 0) hue = 0;
|
|
1553
|
-
else if (max === r) hue = (g - b) / chroma % 6;
|
|
1554
|
-
else if (max === g) hue = 2 + (b - r) / chroma;
|
|
1555
|
-
else hue = 4 + (r - g) / chroma;
|
|
1556
|
-
hue /= 6;
|
|
1557
|
-
hue %= 1;
|
|
1558
|
-
return [
|
|
1559
|
-
hue * 360,
|
|
1560
|
-
chroma * 100,
|
|
1561
|
-
grayscale * 100
|
|
1562
|
-
];
|
|
1563
|
-
};
|
|
1564
|
-
convert.hsl.hcg = function(hsl) {
|
|
1565
|
-
const s = hsl[1] / 100;
|
|
1566
|
-
const l = hsl[2] / 100;
|
|
1567
|
-
const c = l < .5 ? 2 * s * l : 2 * s * (1 - l);
|
|
1568
|
-
let f = 0;
|
|
1569
|
-
if (c < 1) f = (l - .5 * c) / (1 - c);
|
|
1570
|
-
return [
|
|
1571
|
-
hsl[0],
|
|
1572
|
-
c * 100,
|
|
1573
|
-
f * 100
|
|
1574
|
-
];
|
|
1575
|
-
};
|
|
1576
|
-
convert.hsv.hcg = function(hsv) {
|
|
1577
|
-
const s = hsv[1] / 100;
|
|
1578
|
-
const v = hsv[2] / 100;
|
|
1579
|
-
const c = s * v;
|
|
1580
|
-
let f = 0;
|
|
1581
|
-
if (c < 1) f = (v - c) / (1 - c);
|
|
1582
|
-
return [
|
|
1583
|
-
hsv[0],
|
|
1584
|
-
c * 100,
|
|
1585
|
-
f * 100
|
|
1586
|
-
];
|
|
1587
|
-
};
|
|
1588
|
-
convert.hcg.rgb = function(hcg) {
|
|
1589
|
-
const h = hcg[0] / 360;
|
|
1590
|
-
const c = hcg[1] / 100;
|
|
1591
|
-
const g = hcg[2] / 100;
|
|
1592
|
-
if (c === 0) return [
|
|
1593
|
-
g * 255,
|
|
1594
|
-
g * 255,
|
|
1595
|
-
g * 255
|
|
1596
|
-
];
|
|
1597
|
-
const pure = [
|
|
1598
|
-
0,
|
|
1599
|
-
0,
|
|
1600
|
-
0
|
|
1601
|
-
];
|
|
1602
|
-
const hi = h % 1 * 6;
|
|
1603
|
-
const v = hi % 1;
|
|
1604
|
-
const w = 1 - v;
|
|
1605
|
-
let mg = 0;
|
|
1606
|
-
switch (Math.floor(hi)) {
|
|
1607
|
-
case 0:
|
|
1608
|
-
pure[0] = 1;
|
|
1609
|
-
pure[1] = v;
|
|
1610
|
-
pure[2] = 0;
|
|
1611
|
-
break;
|
|
1612
|
-
case 1:
|
|
1613
|
-
pure[0] = w;
|
|
1614
|
-
pure[1] = 1;
|
|
1615
|
-
pure[2] = 0;
|
|
1616
|
-
break;
|
|
1617
|
-
case 2:
|
|
1618
|
-
pure[0] = 0;
|
|
1619
|
-
pure[1] = 1;
|
|
1620
|
-
pure[2] = v;
|
|
1621
|
-
break;
|
|
1622
|
-
case 3:
|
|
1623
|
-
pure[0] = 0;
|
|
1624
|
-
pure[1] = w;
|
|
1625
|
-
pure[2] = 1;
|
|
1626
|
-
break;
|
|
1627
|
-
case 4:
|
|
1628
|
-
pure[0] = v;
|
|
1629
|
-
pure[1] = 0;
|
|
1630
|
-
pure[2] = 1;
|
|
1631
|
-
break;
|
|
1632
|
-
default:
|
|
1633
|
-
pure[0] = 1;
|
|
1634
|
-
pure[1] = 0;
|
|
1635
|
-
pure[2] = w;
|
|
1636
|
-
}
|
|
1637
|
-
mg = (1 - c) * g;
|
|
1638
|
-
return [
|
|
1639
|
-
(c * pure[0] + mg) * 255,
|
|
1640
|
-
(c * pure[1] + mg) * 255,
|
|
1641
|
-
(c * pure[2] + mg) * 255
|
|
1642
|
-
];
|
|
1643
|
-
};
|
|
1644
|
-
convert.hcg.hsv = function(hcg) {
|
|
1645
|
-
const c = hcg[1] / 100;
|
|
1646
|
-
const v = c + hcg[2] / 100 * (1 - c);
|
|
1647
|
-
let f = 0;
|
|
1648
|
-
if (v > 0) f = c / v;
|
|
1649
|
-
return [
|
|
1650
|
-
hcg[0],
|
|
1651
|
-
f * 100,
|
|
1652
|
-
v * 100
|
|
1653
|
-
];
|
|
1654
|
-
};
|
|
1655
|
-
convert.hcg.hsl = function(hcg) {
|
|
1656
|
-
const c = hcg[1] / 100;
|
|
1657
|
-
const l = hcg[2] / 100 * (1 - c) + .5 * c;
|
|
1658
|
-
let s = 0;
|
|
1659
|
-
if (l > 0 && l < .5) s = c / (2 * l);
|
|
1660
|
-
else if (l >= .5 && l < 1) s = c / (2 * (1 - l));
|
|
1661
|
-
return [
|
|
1662
|
-
hcg[0],
|
|
1663
|
-
s * 100,
|
|
1664
|
-
l * 100
|
|
1665
|
-
];
|
|
1666
|
-
};
|
|
1667
|
-
convert.hcg.hwb = function(hcg) {
|
|
1668
|
-
const c = hcg[1] / 100;
|
|
1669
|
-
const v = c + hcg[2] / 100 * (1 - c);
|
|
1670
|
-
return [
|
|
1671
|
-
hcg[0],
|
|
1672
|
-
(v - c) * 100,
|
|
1673
|
-
(1 - v) * 100
|
|
1674
|
-
];
|
|
1675
|
-
};
|
|
1676
|
-
convert.hwb.hcg = function(hwb) {
|
|
1677
|
-
const w = hwb[1] / 100;
|
|
1678
|
-
const v = 1 - hwb[2] / 100;
|
|
1679
|
-
const c = v - w;
|
|
1680
|
-
let g = 0;
|
|
1681
|
-
if (c < 1) g = (v - c) / (1 - c);
|
|
1682
|
-
return [
|
|
1683
|
-
hwb[0],
|
|
1684
|
-
c * 100,
|
|
1685
|
-
g * 100
|
|
1686
|
-
];
|
|
1687
|
-
};
|
|
1688
|
-
convert.apple.rgb = function(apple) {
|
|
1689
|
-
return [
|
|
1690
|
-
apple[0] / 65535 * 255,
|
|
1691
|
-
apple[1] / 65535 * 255,
|
|
1692
|
-
apple[2] / 65535 * 255
|
|
1693
|
-
];
|
|
1694
|
-
};
|
|
1695
|
-
convert.rgb.apple = function(rgb) {
|
|
1696
|
-
return [
|
|
1697
|
-
rgb[0] / 255 * 65535,
|
|
1698
|
-
rgb[1] / 255 * 65535,
|
|
1699
|
-
rgb[2] / 255 * 65535
|
|
1700
|
-
];
|
|
1701
|
-
};
|
|
1702
|
-
convert.gray.rgb = function(args) {
|
|
1703
|
-
return [
|
|
1704
|
-
args[0] / 100 * 255,
|
|
1705
|
-
args[0] / 100 * 255,
|
|
1706
|
-
args[0] / 100 * 255
|
|
1707
|
-
];
|
|
1708
|
-
};
|
|
1709
|
-
convert.gray.hsl = function(args) {
|
|
1710
|
-
return [
|
|
1711
|
-
0,
|
|
1712
|
-
0,
|
|
1713
|
-
args[0]
|
|
1714
|
-
];
|
|
1715
|
-
};
|
|
1716
|
-
convert.gray.hsv = convert.gray.hsl;
|
|
1717
|
-
convert.gray.hwb = function(gray) {
|
|
1718
|
-
return [
|
|
1719
|
-
0,
|
|
1720
|
-
100,
|
|
1721
|
-
gray[0]
|
|
1722
|
-
];
|
|
1723
|
-
};
|
|
1724
|
-
convert.gray.cmyk = function(gray) {
|
|
1725
|
-
return [
|
|
1726
|
-
0,
|
|
1727
|
-
0,
|
|
1728
|
-
0,
|
|
1729
|
-
gray[0]
|
|
1730
|
-
];
|
|
1731
|
-
};
|
|
1732
|
-
convert.gray.lab = function(gray) {
|
|
1733
|
-
return [
|
|
1734
|
-
gray[0],
|
|
1735
|
-
0,
|
|
1736
|
-
0
|
|
1737
|
-
];
|
|
1738
|
-
};
|
|
1739
|
-
convert.gray.hex = function(gray) {
|
|
1740
|
-
const val = Math.round(gray[0] / 100 * 255) & 255;
|
|
1741
|
-
const string = ((val << 16) + (val << 8) + val).toString(16).toUpperCase();
|
|
1742
|
-
return "000000".substring(string.length) + string;
|
|
1743
|
-
};
|
|
1744
|
-
convert.rgb.gray = function(rgb) {
|
|
1745
|
-
return [(rgb[0] + rgb[1] + rgb[2]) / 3 / 255 * 100];
|
|
1746
|
-
};
|
|
1747
|
-
}));
|
|
1748
|
-
//#endregion
|
|
1749
|
-
//#region node_modules/color-convert/route.js
|
|
1750
|
-
var require_route = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
1751
|
-
var conversions = require_conversions();
|
|
1752
|
-
function buildGraph() {
|
|
1753
|
-
const graph = {};
|
|
1754
|
-
const models = Object.keys(conversions);
|
|
1755
|
-
for (let len = models.length, i = 0; i < len; i++) graph[models[i]] = {
|
|
1756
|
-
distance: -1,
|
|
1757
|
-
parent: null
|
|
1758
|
-
};
|
|
1759
|
-
return graph;
|
|
1760
|
-
}
|
|
1761
|
-
function deriveBFS(fromModel) {
|
|
1762
|
-
const graph = buildGraph();
|
|
1763
|
-
const queue = [fromModel];
|
|
1764
|
-
graph[fromModel].distance = 0;
|
|
1765
|
-
while (queue.length) {
|
|
1766
|
-
const current = queue.pop();
|
|
1767
|
-
const adjacents = Object.keys(conversions[current]);
|
|
1768
|
-
for (let len = adjacents.length, i = 0; i < len; i++) {
|
|
1769
|
-
const adjacent = adjacents[i];
|
|
1770
|
-
const node = graph[adjacent];
|
|
1771
|
-
if (node.distance === -1) {
|
|
1772
|
-
node.distance = graph[current].distance + 1;
|
|
1773
|
-
node.parent = current;
|
|
1774
|
-
queue.unshift(adjacent);
|
|
1775
|
-
}
|
|
1776
|
-
}
|
|
1777
|
-
}
|
|
1778
|
-
return graph;
|
|
1779
|
-
}
|
|
1780
|
-
function link(from, to) {
|
|
1781
|
-
return function(args) {
|
|
1782
|
-
return to(from(args));
|
|
1783
|
-
};
|
|
214
|
+
//#region node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
215
|
+
var ANSI_BACKGROUND_OFFSET = 10;
|
|
216
|
+
var wrapAnsi16 = (offset = 0) => (code) => `\u001B[${code + offset}m`;
|
|
217
|
+
var wrapAnsi256 = (offset = 0) => (code) => `\u001B[${38 + offset};5;${code}m`;
|
|
218
|
+
var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`;
|
|
219
|
+
var styles$1 = {
|
|
220
|
+
modifier: {
|
|
221
|
+
reset: [0, 0],
|
|
222
|
+
bold: [1, 22],
|
|
223
|
+
dim: [2, 22],
|
|
224
|
+
italic: [3, 23],
|
|
225
|
+
underline: [4, 24],
|
|
226
|
+
overline: [53, 55],
|
|
227
|
+
inverse: [7, 27],
|
|
228
|
+
hidden: [8, 28],
|
|
229
|
+
strikethrough: [9, 29]
|
|
230
|
+
},
|
|
231
|
+
color: {
|
|
232
|
+
black: [30, 39],
|
|
233
|
+
red: [31, 39],
|
|
234
|
+
green: [32, 39],
|
|
235
|
+
yellow: [33, 39],
|
|
236
|
+
blue: [34, 39],
|
|
237
|
+
magenta: [35, 39],
|
|
238
|
+
cyan: [36, 39],
|
|
239
|
+
white: [37, 39],
|
|
240
|
+
blackBright: [90, 39],
|
|
241
|
+
gray: [90, 39],
|
|
242
|
+
grey: [90, 39],
|
|
243
|
+
redBright: [91, 39],
|
|
244
|
+
greenBright: [92, 39],
|
|
245
|
+
yellowBright: [93, 39],
|
|
246
|
+
blueBright: [94, 39],
|
|
247
|
+
magentaBright: [95, 39],
|
|
248
|
+
cyanBright: [96, 39],
|
|
249
|
+
whiteBright: [97, 39]
|
|
250
|
+
},
|
|
251
|
+
bgColor: {
|
|
252
|
+
bgBlack: [40, 49],
|
|
253
|
+
bgRed: [41, 49],
|
|
254
|
+
bgGreen: [42, 49],
|
|
255
|
+
bgYellow: [43, 49],
|
|
256
|
+
bgBlue: [44, 49],
|
|
257
|
+
bgMagenta: [45, 49],
|
|
258
|
+
bgCyan: [46, 49],
|
|
259
|
+
bgWhite: [47, 49],
|
|
260
|
+
bgBlackBright: [100, 49],
|
|
261
|
+
bgGray: [100, 49],
|
|
262
|
+
bgGrey: [100, 49],
|
|
263
|
+
bgRedBright: [101, 49],
|
|
264
|
+
bgGreenBright: [102, 49],
|
|
265
|
+
bgYellowBright: [103, 49],
|
|
266
|
+
bgBlueBright: [104, 49],
|
|
267
|
+
bgMagentaBright: [105, 49],
|
|
268
|
+
bgCyanBright: [106, 49],
|
|
269
|
+
bgWhiteBright: [107, 49]
|
|
1784
270
|
}
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
const models = Object.keys(graph);
|
|
1801
|
-
for (let len = models.length, i = 0; i < len; i++) {
|
|
1802
|
-
const toModel = models[i];
|
|
1803
|
-
if (graph[toModel].parent === null) continue;
|
|
1804
|
-
conversion[toModel] = wrapConversion(toModel, graph);
|
|
271
|
+
};
|
|
272
|
+
Object.keys(styles$1.modifier);
|
|
273
|
+
var foregroundColorNames = Object.keys(styles$1.color);
|
|
274
|
+
var backgroundColorNames = Object.keys(styles$1.bgColor);
|
|
275
|
+
[...foregroundColorNames, ...backgroundColorNames];
|
|
276
|
+
function assembleStyles() {
|
|
277
|
+
const codes = /* @__PURE__ */ new Map();
|
|
278
|
+
for (const [groupName, group] of Object.entries(styles$1)) {
|
|
279
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
280
|
+
styles$1[styleName] = {
|
|
281
|
+
open: `\u001B[${style[0]}m`,
|
|
282
|
+
close: `\u001B[${style[1]}m`
|
|
283
|
+
};
|
|
284
|
+
group[styleName] = styles$1[styleName];
|
|
285
|
+
codes.set(style[0], style[1]);
|
|
1805
286
|
}
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
//#endregion
|
|
1810
|
-
//#region node_modules/color-convert/index.js
|
|
1811
|
-
var require_color_convert = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
1812
|
-
var conversions = require_conversions();
|
|
1813
|
-
var route = require_route();
|
|
1814
|
-
var convert = {};
|
|
1815
|
-
var models = Object.keys(conversions);
|
|
1816
|
-
function wrapRaw(fn) {
|
|
1817
|
-
const wrappedFn = function(...args) {
|
|
1818
|
-
const arg0 = args[0];
|
|
1819
|
-
if (arg0 === void 0 || arg0 === null) return arg0;
|
|
1820
|
-
if (arg0.length > 1) args = arg0;
|
|
1821
|
-
return fn(args);
|
|
1822
|
-
};
|
|
1823
|
-
if ("conversion" in fn) wrappedFn.conversion = fn.conversion;
|
|
1824
|
-
return wrappedFn;
|
|
1825
|
-
}
|
|
1826
|
-
function wrapRounded(fn) {
|
|
1827
|
-
const wrappedFn = function(...args) {
|
|
1828
|
-
const arg0 = args[0];
|
|
1829
|
-
if (arg0 === void 0 || arg0 === null) return arg0;
|
|
1830
|
-
if (arg0.length > 1) args = arg0;
|
|
1831
|
-
const result = fn(args);
|
|
1832
|
-
if (typeof result === "object") for (let len = result.length, i = 0; i < len; i++) result[i] = Math.round(result[i]);
|
|
1833
|
-
return result;
|
|
1834
|
-
};
|
|
1835
|
-
if ("conversion" in fn) wrappedFn.conversion = fn.conversion;
|
|
1836
|
-
return wrappedFn;
|
|
1837
|
-
}
|
|
1838
|
-
models.forEach((fromModel) => {
|
|
1839
|
-
convert[fromModel] = {};
|
|
1840
|
-
Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels });
|
|
1841
|
-
Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels });
|
|
1842
|
-
const routes = route(fromModel);
|
|
1843
|
-
Object.keys(routes).forEach((toModel) => {
|
|
1844
|
-
const fn = routes[toModel];
|
|
1845
|
-
convert[fromModel][toModel] = wrapRounded(fn);
|
|
1846
|
-
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
287
|
+
Object.defineProperty(styles$1, groupName, {
|
|
288
|
+
value: group,
|
|
289
|
+
enumerable: false
|
|
1847
290
|
});
|
|
291
|
+
}
|
|
292
|
+
Object.defineProperty(styles$1, "codes", {
|
|
293
|
+
value: codes,
|
|
294
|
+
enumerable: false
|
|
1848
295
|
});
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
var rgb2rgb = (r, g, b) => [
|
|
1867
|
-
r,
|
|
1868
|
-
g,
|
|
1869
|
-
b
|
|
1870
|
-
];
|
|
1871
|
-
var setLazyProperty = (object, property, get) => {
|
|
1872
|
-
Object.defineProperty(object, property, {
|
|
1873
|
-
get: () => {
|
|
1874
|
-
const value = get();
|
|
1875
|
-
Object.defineProperty(object, property, {
|
|
1876
|
-
value,
|
|
1877
|
-
enumerable: true,
|
|
1878
|
-
configurable: true
|
|
1879
|
-
});
|
|
1880
|
-
return value;
|
|
296
|
+
styles$1.color.close = "\x1B[39m";
|
|
297
|
+
styles$1.bgColor.close = "\x1B[49m";
|
|
298
|
+
styles$1.color.ansi = wrapAnsi16();
|
|
299
|
+
styles$1.color.ansi256 = wrapAnsi256();
|
|
300
|
+
styles$1.color.ansi16m = wrapAnsi16m();
|
|
301
|
+
styles$1.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
302
|
+
styles$1.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
303
|
+
styles$1.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
304
|
+
Object.defineProperties(styles$1, {
|
|
305
|
+
rgbToAnsi256: {
|
|
306
|
+
value(red, green, blue) {
|
|
307
|
+
if (red === green && green === blue) {
|
|
308
|
+
if (red < 8) return 16;
|
|
309
|
+
if (red > 248) return 231;
|
|
310
|
+
return Math.round((red - 8) / 247 * 24) + 232;
|
|
311
|
+
}
|
|
312
|
+
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
1881
313
|
},
|
|
1882
|
-
enumerable:
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
const codes = /* @__PURE__ */ new Map();
|
|
1901
|
-
const styles = {
|
|
1902
|
-
modifier: {
|
|
1903
|
-
reset: [0, 0],
|
|
1904
|
-
bold: [1, 22],
|
|
1905
|
-
dim: [2, 22],
|
|
1906
|
-
italic: [3, 23],
|
|
1907
|
-
underline: [4, 24],
|
|
1908
|
-
inverse: [7, 27],
|
|
1909
|
-
hidden: [8, 28],
|
|
1910
|
-
strikethrough: [9, 29]
|
|
314
|
+
enumerable: false
|
|
315
|
+
},
|
|
316
|
+
hexToRgb: {
|
|
317
|
+
value(hex) {
|
|
318
|
+
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
319
|
+
if (!matches) return [
|
|
320
|
+
0,
|
|
321
|
+
0,
|
|
322
|
+
0
|
|
323
|
+
];
|
|
324
|
+
let [colorString] = matches;
|
|
325
|
+
if (colorString.length === 3) colorString = [...colorString].map((character) => character + character).join("");
|
|
326
|
+
const integer = Number.parseInt(colorString, 16);
|
|
327
|
+
return [
|
|
328
|
+
integer >> 16 & 255,
|
|
329
|
+
integer >> 8 & 255,
|
|
330
|
+
integer & 255
|
|
331
|
+
];
|
|
1911
332
|
},
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
333
|
+
enumerable: false
|
|
334
|
+
},
|
|
335
|
+
hexToAnsi256: {
|
|
336
|
+
value: (hex) => styles$1.rgbToAnsi256(...styles$1.hexToRgb(hex)),
|
|
337
|
+
enumerable: false
|
|
338
|
+
},
|
|
339
|
+
ansi256ToAnsi: {
|
|
340
|
+
value(code) {
|
|
341
|
+
if (code < 8) return 30 + code;
|
|
342
|
+
if (code < 16) return 90 + (code - 8);
|
|
343
|
+
let red;
|
|
344
|
+
let green;
|
|
345
|
+
let blue;
|
|
346
|
+
if (code >= 232) {
|
|
347
|
+
red = ((code - 232) * 10 + 8) / 255;
|
|
348
|
+
green = red;
|
|
349
|
+
blue = red;
|
|
350
|
+
} else {
|
|
351
|
+
code -= 16;
|
|
352
|
+
const remainder = code % 36;
|
|
353
|
+
red = Math.floor(code / 36) / 5;
|
|
354
|
+
green = Math.floor(remainder / 6) / 5;
|
|
355
|
+
blue = remainder % 6 / 5;
|
|
356
|
+
}
|
|
357
|
+
const value = Math.max(red, green, blue) * 2;
|
|
358
|
+
if (value === 0) return 30;
|
|
359
|
+
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
360
|
+
if (value === 2) result += 60;
|
|
361
|
+
return result;
|
|
1929
362
|
},
|
|
1930
|
-
bgColor: {
|
|
1931
|
-
bgBlack: [40, 49],
|
|
1932
|
-
bgRed: [41, 49],
|
|
1933
|
-
bgGreen: [42, 49],
|
|
1934
|
-
bgYellow: [43, 49],
|
|
1935
|
-
bgBlue: [44, 49],
|
|
1936
|
-
bgMagenta: [45, 49],
|
|
1937
|
-
bgCyan: [46, 49],
|
|
1938
|
-
bgWhite: [47, 49],
|
|
1939
|
-
bgBlackBright: [100, 49],
|
|
1940
|
-
bgRedBright: [101, 49],
|
|
1941
|
-
bgGreenBright: [102, 49],
|
|
1942
|
-
bgYellowBright: [103, 49],
|
|
1943
|
-
bgBlueBright: [104, 49],
|
|
1944
|
-
bgMagentaBright: [105, 49],
|
|
1945
|
-
bgCyanBright: [106, 49],
|
|
1946
|
-
bgWhiteBright: [107, 49]
|
|
1947
|
-
}
|
|
1948
|
-
};
|
|
1949
|
-
styles.color.gray = styles.color.blackBright;
|
|
1950
|
-
styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
|
|
1951
|
-
styles.color.grey = styles.color.blackBright;
|
|
1952
|
-
styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
|
|
1953
|
-
for (const [groupName, group] of Object.entries(styles)) {
|
|
1954
|
-
for (const [styleName, style] of Object.entries(group)) {
|
|
1955
|
-
styles[styleName] = {
|
|
1956
|
-
open: `\u001B[${style[0]}m`,
|
|
1957
|
-
close: `\u001B[${style[1]}m`
|
|
1958
|
-
};
|
|
1959
|
-
group[styleName] = styles[styleName];
|
|
1960
|
-
codes.set(style[0], style[1]);
|
|
1961
|
-
}
|
|
1962
|
-
Object.defineProperty(styles, groupName, {
|
|
1963
|
-
value: group,
|
|
1964
|
-
enumerable: false
|
|
1965
|
-
});
|
|
1966
|
-
}
|
|
1967
|
-
Object.defineProperty(styles, "codes", {
|
|
1968
|
-
value: codes,
|
|
1969
363
|
enumerable: false
|
|
1970
|
-
}
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
return styles;
|
|
1980
|
-
}
|
|
1981
|
-
Object.defineProperty(module, "exports", {
|
|
1982
|
-
enumerable: true,
|
|
1983
|
-
get: assembleStyles
|
|
364
|
+
},
|
|
365
|
+
rgbToAnsi: {
|
|
366
|
+
value: (red, green, blue) => styles$1.ansi256ToAnsi(styles$1.rgbToAnsi256(red, green, blue)),
|
|
367
|
+
enumerable: false
|
|
368
|
+
},
|
|
369
|
+
hexToAnsi: {
|
|
370
|
+
value: (hex) => styles$1.ansi256ToAnsi(styles$1.hexToAnsi256(hex)),
|
|
371
|
+
enumerable: false
|
|
372
|
+
}
|
|
1984
373
|
});
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
var require_browser = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
1989
|
-
module.exports = {
|
|
1990
|
-
stdout: false,
|
|
1991
|
-
stderr: false
|
|
1992
|
-
};
|
|
1993
|
-
}));
|
|
374
|
+
return styles$1;
|
|
375
|
+
}
|
|
376
|
+
var ansiStyles = assembleStyles();
|
|
1994
377
|
//#endregion
|
|
1995
|
-
//#region node_modules/chalk/source/
|
|
1996
|
-
var
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
const gotCR = string[index - 1] === "\r";
|
|
2016
|
-
returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
2017
|
-
endIndex = index + 1;
|
|
2018
|
-
index = string.indexOf("\n", endIndex);
|
|
2019
|
-
} while (index !== -1);
|
|
2020
|
-
returnValue += string.substr(endIndex);
|
|
2021
|
-
return returnValue;
|
|
2022
|
-
};
|
|
2023
|
-
module.exports = {
|
|
2024
|
-
stringReplaceAll,
|
|
2025
|
-
stringEncaseCRLFWithFirstIndex
|
|
2026
|
-
};
|
|
2027
|
-
}));
|
|
378
|
+
//#region node_modules/chalk/source/vendor/supports-color/browser.js
|
|
379
|
+
var level = (() => {
|
|
380
|
+
if (!("navigator" in globalThis)) return 0;
|
|
381
|
+
if (globalThis.navigator.userAgentData) {
|
|
382
|
+
const brand = navigator.userAgentData.brands.find(({ brand }) => brand === "Chromium");
|
|
383
|
+
if (brand && brand.version > 93) return 3;
|
|
384
|
+
}
|
|
385
|
+
if (/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)) return 1;
|
|
386
|
+
return 0;
|
|
387
|
+
})();
|
|
388
|
+
var colorSupport = level !== 0 && {
|
|
389
|
+
level,
|
|
390
|
+
hasBasic: true,
|
|
391
|
+
has256: level >= 2,
|
|
392
|
+
has16m: level >= 3
|
|
393
|
+
};
|
|
394
|
+
var supportsColor = {
|
|
395
|
+
stdout: colorSupport,
|
|
396
|
+
stderr: colorSupport
|
|
397
|
+
};
|
|
2028
398
|
//#endregion
|
|
2029
|
-
//#region node_modules/chalk/source/
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
const
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
const chunks = arguments_.trim().split(/\s*,\s*/g);
|
|
2057
|
-
let matches;
|
|
2058
|
-
for (const chunk of chunks) {
|
|
2059
|
-
const number = Number(chunk);
|
|
2060
|
-
if (!Number.isNaN(number)) results.push(number);
|
|
2061
|
-
else if (matches = chunk.match(STRING_REGEX)) results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
|
|
2062
|
-
else throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
|
|
2063
|
-
}
|
|
2064
|
-
return results;
|
|
2065
|
-
}
|
|
2066
|
-
function parseStyle(style) {
|
|
2067
|
-
STYLE_REGEX.lastIndex = 0;
|
|
2068
|
-
const results = [];
|
|
2069
|
-
let matches;
|
|
2070
|
-
while ((matches = STYLE_REGEX.exec(style)) !== null) {
|
|
2071
|
-
const name = matches[1];
|
|
2072
|
-
if (matches[2]) {
|
|
2073
|
-
const args = parseArguments(name, matches[2]);
|
|
2074
|
-
results.push([name].concat(args));
|
|
2075
|
-
} else results.push([name]);
|
|
2076
|
-
}
|
|
2077
|
-
return results;
|
|
2078
|
-
}
|
|
2079
|
-
function buildStyle(chalk, styles) {
|
|
2080
|
-
const enabled = {};
|
|
2081
|
-
for (const layer of styles) for (const style of layer.styles) enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
2082
|
-
let current = chalk;
|
|
2083
|
-
for (const [styleName, styles] of Object.entries(enabled)) {
|
|
2084
|
-
if (!Array.isArray(styles)) continue;
|
|
2085
|
-
if (!(styleName in current)) throw new Error(`Unknown Chalk style: ${styleName}`);
|
|
2086
|
-
current = styles.length > 0 ? current[styleName](...styles) : current[styleName];
|
|
2087
|
-
}
|
|
2088
|
-
return current;
|
|
2089
|
-
}
|
|
2090
|
-
module.exports = (chalk, temporary) => {
|
|
2091
|
-
const styles = [];
|
|
2092
|
-
const chunks = [];
|
|
2093
|
-
let chunk = [];
|
|
2094
|
-
temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
|
|
2095
|
-
if (escapeCharacter) chunk.push(unescape(escapeCharacter));
|
|
2096
|
-
else if (style) {
|
|
2097
|
-
const string = chunk.join("");
|
|
2098
|
-
chunk = [];
|
|
2099
|
-
chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string));
|
|
2100
|
-
styles.push({
|
|
2101
|
-
inverse,
|
|
2102
|
-
styles: parseStyle(style)
|
|
2103
|
-
});
|
|
2104
|
-
} else if (close) {
|
|
2105
|
-
if (styles.length === 0) throw new Error("Found extraneous } in Chalk template literal");
|
|
2106
|
-
chunks.push(buildStyle(chalk, styles)(chunk.join("")));
|
|
2107
|
-
chunk = [];
|
|
2108
|
-
styles.pop();
|
|
2109
|
-
} else chunk.push(character);
|
|
2110
|
-
});
|
|
2111
|
-
chunks.push(chunk.join(""));
|
|
2112
|
-
if (styles.length > 0) {
|
|
2113
|
-
const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
|
|
2114
|
-
throw new Error(errMessage);
|
|
2115
|
-
}
|
|
2116
|
-
return chunks.join("");
|
|
2117
|
-
};
|
|
2118
|
-
}));
|
|
399
|
+
//#region node_modules/chalk/source/utilities.js
|
|
400
|
+
function stringReplaceAll(string, substring, replacer) {
|
|
401
|
+
let index = string.indexOf(substring);
|
|
402
|
+
if (index === -1) return string;
|
|
403
|
+
const substringLength = substring.length;
|
|
404
|
+
let endIndex = 0;
|
|
405
|
+
let returnValue = "";
|
|
406
|
+
do {
|
|
407
|
+
returnValue += string.slice(endIndex, index) + substring + replacer;
|
|
408
|
+
endIndex = index + substringLength;
|
|
409
|
+
index = string.indexOf(substring, endIndex);
|
|
410
|
+
} while (index !== -1);
|
|
411
|
+
returnValue += string.slice(endIndex);
|
|
412
|
+
return returnValue;
|
|
413
|
+
}
|
|
414
|
+
function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
|
|
415
|
+
let endIndex = 0;
|
|
416
|
+
let returnValue = "";
|
|
417
|
+
do {
|
|
418
|
+
const gotCR = string[index - 1] === "\r";
|
|
419
|
+
returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
420
|
+
endIndex = index + 1;
|
|
421
|
+
index = string.indexOf("\n", endIndex);
|
|
422
|
+
} while (index !== -1);
|
|
423
|
+
returnValue += string.slice(endIndex);
|
|
424
|
+
return returnValue;
|
|
425
|
+
}
|
|
2119
426
|
//#endregion
|
|
2120
|
-
//#region node_modules
|
|
2121
|
-
var
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
427
|
+
//#region node_modules/chalk/source/index.js
|
|
428
|
+
var { stdout: stdoutColor, stderr: stderrColor } = supportsColor;
|
|
429
|
+
var GENERATOR = Symbol("GENERATOR");
|
|
430
|
+
var STYLER = Symbol("STYLER");
|
|
431
|
+
var IS_EMPTY = Symbol("IS_EMPTY");
|
|
432
|
+
var levelMapping = [
|
|
433
|
+
"ansi",
|
|
434
|
+
"ansi",
|
|
435
|
+
"ansi256",
|
|
436
|
+
"ansi16m"
|
|
437
|
+
];
|
|
438
|
+
var styles = Object.create(null);
|
|
439
|
+
var applyOptions = (object, options = {}) => {
|
|
440
|
+
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) throw new Error("The `level` option should be an integer from 0 to 3");
|
|
441
|
+
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
442
|
+
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
443
|
+
};
|
|
444
|
+
var chalkFactory = (options) => {
|
|
445
|
+
const chalk = (...strings) => strings.join(" ");
|
|
446
|
+
applyOptions(chalk, options);
|
|
447
|
+
Object.setPrototypeOf(chalk, createChalk.prototype);
|
|
448
|
+
return chalk;
|
|
449
|
+
};
|
|
450
|
+
function createChalk(options) {
|
|
451
|
+
return chalkFactory(options);
|
|
452
|
+
}
|
|
453
|
+
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
|
454
|
+
for (const [styleName, style] of Object.entries(ansiStyles)) styles[styleName] = { get() {
|
|
455
|
+
const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
|
|
456
|
+
Object.defineProperty(this, styleName, { value: builder });
|
|
457
|
+
return builder;
|
|
458
|
+
} };
|
|
459
|
+
styles.visible = { get() {
|
|
460
|
+
const builder = createBuilder(this, this[STYLER], true);
|
|
461
|
+
Object.defineProperty(this, "visible", { value: builder });
|
|
462
|
+
return builder;
|
|
463
|
+
} };
|
|
464
|
+
var getModelAnsi = (model, level, type, ...arguments_) => {
|
|
465
|
+
if (model === "rgb") {
|
|
466
|
+
if (level === "ansi16m") return ansiStyles[type].ansi16m(...arguments_);
|
|
467
|
+
if (level === "ansi256") return ansiStyles[type].ansi256(ansiStyles.rgbToAnsi256(...arguments_));
|
|
468
|
+
return ansiStyles[type].ansi(ansiStyles.rgbToAnsi(...arguments_));
|
|
469
|
+
}
|
|
470
|
+
if (model === "hex") return getModelAnsi("rgb", level, type, ...ansiStyles.hexToRgb(...arguments_));
|
|
471
|
+
return ansiStyles[type][model](...arguments_);
|
|
472
|
+
};
|
|
473
|
+
for (const model of [
|
|
474
|
+
"rgb",
|
|
475
|
+
"hex",
|
|
476
|
+
"ansi256"
|
|
477
|
+
]) {
|
|
478
|
+
styles[model] = { get() {
|
|
479
|
+
const { level } = this;
|
|
480
|
+
return function(...arguments_) {
|
|
481
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansiStyles.color.close, this[STYLER]);
|
|
482
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
2151
483
|
};
|
|
2152
|
-
chalk.template.Instance = ChalkClass;
|
|
2153
|
-
return chalk.template;
|
|
2154
|
-
};
|
|
2155
|
-
function Chalk(options) {
|
|
2156
|
-
return chalkFactory(options);
|
|
2157
|
-
}
|
|
2158
|
-
for (const [styleName, style] of Object.entries(ansiStyles)) styles[styleName] = { get() {
|
|
2159
|
-
const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
|
|
2160
|
-
Object.defineProperty(this, styleName, { value: builder });
|
|
2161
|
-
return builder;
|
|
2162
|
-
} };
|
|
2163
|
-
styles.visible = { get() {
|
|
2164
|
-
const builder = createBuilder(this, this._styler, true);
|
|
2165
|
-
Object.defineProperty(this, "visible", { value: builder });
|
|
2166
|
-
return builder;
|
|
2167
484
|
} };
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
"hex",
|
|
2171
|
-
"keyword",
|
|
2172
|
-
"hsl",
|
|
2173
|
-
"hsv",
|
|
2174
|
-
"hwb",
|
|
2175
|
-
"ansi",
|
|
2176
|
-
"ansi256"
|
|
2177
|
-
];
|
|
2178
|
-
for (const model of usedModels) styles[model] = { get() {
|
|
485
|
+
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
486
|
+
styles[bgModel] = { get() {
|
|
2179
487
|
const { level } = this;
|
|
2180
488
|
return function(...arguments_) {
|
|
2181
|
-
const styler = createStyler(
|
|
2182
|
-
return createBuilder(this, styler, this
|
|
489
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansiStyles.bgColor.close, this[STYLER]);
|
|
490
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
2183
491
|
};
|
|
2184
492
|
} };
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
var proto = Object.defineProperties(() => {}, {
|
|
2196
|
-
...styles,
|
|
2197
|
-
level: {
|
|
2198
|
-
enumerable: true,
|
|
2199
|
-
get() {
|
|
2200
|
-
return this._generator.level;
|
|
2201
|
-
},
|
|
2202
|
-
set(level) {
|
|
2203
|
-
this._generator.level = level;
|
|
2204
|
-
}
|
|
2205
|
-
}
|
|
2206
|
-
});
|
|
2207
|
-
var createStyler = (open, close, parent) => {
|
|
2208
|
-
let openAll;
|
|
2209
|
-
let closeAll;
|
|
2210
|
-
if (parent === void 0) {
|
|
2211
|
-
openAll = open;
|
|
2212
|
-
closeAll = close;
|
|
2213
|
-
} else {
|
|
2214
|
-
openAll = parent.openAll + open;
|
|
2215
|
-
closeAll = close + parent.closeAll;
|
|
2216
|
-
}
|
|
2217
|
-
return {
|
|
2218
|
-
open,
|
|
2219
|
-
close,
|
|
2220
|
-
openAll,
|
|
2221
|
-
closeAll,
|
|
2222
|
-
parent
|
|
2223
|
-
};
|
|
2224
|
-
};
|
|
2225
|
-
var createBuilder = (self, _styler, _isEmpty) => {
|
|
2226
|
-
const builder = (...arguments_) => {
|
|
2227
|
-
if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) return applyStyle(builder, chalkTag(builder, ...arguments_));
|
|
2228
|
-
return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
2229
|
-
};
|
|
2230
|
-
Object.setPrototypeOf(builder, proto);
|
|
2231
|
-
builder._generator = self;
|
|
2232
|
-
builder._styler = _styler;
|
|
2233
|
-
builder._isEmpty = _isEmpty;
|
|
2234
|
-
return builder;
|
|
2235
|
-
};
|
|
2236
|
-
var applyStyle = (self, string) => {
|
|
2237
|
-
if (self.level <= 0 || !string) return self._isEmpty ? "" : string;
|
|
2238
|
-
let styler = self._styler;
|
|
2239
|
-
if (styler === void 0) return string;
|
|
2240
|
-
const { openAll, closeAll } = styler;
|
|
2241
|
-
if (string.indexOf("\x1B") !== -1) while (styler !== void 0) {
|
|
2242
|
-
string = stringReplaceAll(string, styler.close, styler.open);
|
|
2243
|
-
styler = styler.parent;
|
|
493
|
+
}
|
|
494
|
+
var proto = Object.defineProperties(() => {}, {
|
|
495
|
+
...styles,
|
|
496
|
+
level: {
|
|
497
|
+
enumerable: true,
|
|
498
|
+
get() {
|
|
499
|
+
return this[GENERATOR].level;
|
|
500
|
+
},
|
|
501
|
+
set(level) {
|
|
502
|
+
this[GENERATOR].level = level;
|
|
2244
503
|
}
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
504
|
+
}
|
|
505
|
+
});
|
|
506
|
+
var createStyler = (open, close, parent) => {
|
|
507
|
+
let openAll;
|
|
508
|
+
let closeAll;
|
|
509
|
+
if (parent === void 0) {
|
|
510
|
+
openAll = open;
|
|
511
|
+
closeAll = close;
|
|
512
|
+
} else {
|
|
513
|
+
openAll = parent.openAll + open;
|
|
514
|
+
closeAll = close + parent.closeAll;
|
|
515
|
+
}
|
|
516
|
+
return {
|
|
517
|
+
open,
|
|
518
|
+
close,
|
|
519
|
+
openAll,
|
|
520
|
+
closeAll,
|
|
521
|
+
parent
|
|
2258
522
|
};
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
523
|
+
};
|
|
524
|
+
var createBuilder = (self, _styler, _isEmpty) => {
|
|
525
|
+
const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
526
|
+
Object.setPrototypeOf(builder, proto);
|
|
527
|
+
builder[GENERATOR] = self;
|
|
528
|
+
builder[STYLER] = _styler;
|
|
529
|
+
builder[IS_EMPTY] = _isEmpty;
|
|
530
|
+
return builder;
|
|
531
|
+
};
|
|
532
|
+
var applyStyle = (self, string) => {
|
|
533
|
+
if (self.level <= 0 || !string) return self[IS_EMPTY] ? "" : string;
|
|
534
|
+
let styler = self[STYLER];
|
|
535
|
+
if (styler === void 0) return string;
|
|
536
|
+
const { openAll, closeAll } = styler;
|
|
537
|
+
if (string.includes("\x1B")) while (styler !== void 0) {
|
|
538
|
+
string = stringReplaceAll(string, styler.close, styler.open);
|
|
539
|
+
styler = styler.parent;
|
|
540
|
+
}
|
|
541
|
+
const lfIndex = string.indexOf("\n");
|
|
542
|
+
if (lfIndex !== -1) string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
543
|
+
return openAll + string + closeAll;
|
|
544
|
+
};
|
|
545
|
+
Object.defineProperties(createChalk.prototype, styles);
|
|
546
|
+
var chalk = createChalk();
|
|
547
|
+
createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
548
|
+
//#endregion
|
|
549
|
+
//#region node_modules/@nsshunt/stsobservability/dist/index.mjs
|
|
2266
550
|
var __create = Object.create;
|
|
2267
551
|
var __defProp = Object.defineProperty;
|
|
2268
552
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -3639,8 +1923,8 @@ var require_lib = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3639
1923
|
}
|
|
3640
1924
|
module.exports = percentile;
|
|
3641
1925
|
}));
|
|
3642
|
-
var import_timsort = /* @__PURE__ */ __toESM(require_timsort());
|
|
3643
|
-
var import_lib = /* @__PURE__ */ __toESM(require_lib());
|
|
1926
|
+
var import_timsort = /* @__PURE__ */ __toESM(require_timsort(), 1);
|
|
1927
|
+
var import_lib = /* @__PURE__ */ __toESM(require_lib(), 1);
|
|
3644
1928
|
var InstrumentGauge = class extends InstrumentBase {
|
|
3645
1929
|
#val = 0;
|
|
3646
1930
|
#maxval = null;
|
|
@@ -4452,17 +2736,15 @@ function encode(value, options) {
|
|
|
4452
2736
|
}
|
|
4453
2737
|
//#endregion
|
|
4454
2738
|
//#region src/publish/publishers/publishTransportRESTServer.ts
|
|
4455
|
-
var PublishTransportRESTServer = class
|
|
2739
|
+
var PublishTransportRESTServer = class {
|
|
2740
|
+
options;
|
|
4456
2741
|
constructor(options) {
|
|
4457
|
-
|
|
4458
|
-
}
|
|
4459
|
-
get options() {
|
|
4460
|
-
return super.options;
|
|
2742
|
+
this.options = options;
|
|
4461
2743
|
}
|
|
4462
2744
|
Publish = async (payload) => {
|
|
4463
2745
|
try {
|
|
4464
2746
|
if (this.options.showPublishPayload) {
|
|
4465
|
-
console.log(
|
|
2747
|
+
console.log(chalk.grey(`PublishTransportRESTServer::Publish() url: [${this.options.url}]`));
|
|
4466
2748
|
console.log(payload);
|
|
4467
2749
|
}
|
|
4468
2750
|
const encodedData = encode(payload, { ignoreUndefined: true });
|
|
@@ -4481,13 +2763,13 @@ var PublishTransportRESTServer = class extends _nsshunt_stsutils.STSOptionsBase
|
|
|
4481
2763
|
retVal = await (0, axios.default)(new _nsshunt_stsutils.STSAxiosConfig(this.options.url, "post", headers).withData(blob).config);
|
|
4482
2764
|
}
|
|
4483
2765
|
if (retVal.status !== 200) {
|
|
4484
|
-
if (this.options.showPublishPayload) console.log(
|
|
4485
|
-
this.options.logger.debug(
|
|
2766
|
+
if (this.options.showPublishPayload) console.log(chalk.red(`PublishTransportRESTServer::Publish() Error (_PerformPublishRESTAPI:_PerformPublish:#publishmessage): Invalid response from server: [${retVal.status}]`));
|
|
2767
|
+
this.options.logger.debug(chalk.red(`Error (_PerformPublishRESTAPI:_PerformPublish:#publishmessage): Invalid response from server: [${retVal.status}]`));
|
|
4486
2768
|
return false;
|
|
4487
|
-
} else if (this.options.showPublishPayload) console.log(
|
|
2769
|
+
} else if (this.options.showPublishPayload) console.log(chalk.grey(`PublishTransportRESTServer::Publish() _PerformPublishRESTAPI:_PerformPublish:#publishmessage: [${this.options.url}] - Valid response from server: [${retVal.status}]`));
|
|
4488
2770
|
return true;
|
|
4489
2771
|
} catch (error) {
|
|
4490
|
-
if (this.options.showPublishPayload) console.log(
|
|
2772
|
+
if (this.options.showPublishPayload) console.log(chalk.red(`PublishTransportRESTServer::Publish() Error (PublishRESTServer:_PerformPublishRESTAPI:Error: [${error}]`));
|
|
4491
2773
|
return false;
|
|
4492
2774
|
}
|
|
4493
2775
|
};
|
|
@@ -4507,13 +2789,14 @@ var ePublishState$1 = /* @__PURE__ */ function(ePublishState) {
|
|
|
4507
2789
|
/**
|
|
4508
2790
|
* This class managers the creation of instruments and the publication of instrumentation telemetry to the instrument manager service.
|
|
4509
2791
|
*/
|
|
4510
|
-
var PublishInstruments = class
|
|
2792
|
+
var PublishInstruments = class {
|
|
2793
|
+
options;
|
|
4511
2794
|
#inPublish = false;
|
|
4512
2795
|
#observer = null;
|
|
4513
2796
|
#publishState = ePublishState$1.init;
|
|
4514
2797
|
#publisherTransport = null;
|
|
4515
2798
|
constructor(options) {
|
|
4516
|
-
|
|
2799
|
+
this.options = options;
|
|
4517
2800
|
this.#publisherTransport = null;
|
|
4518
2801
|
switch (options.publishTransportBaseOptions.transportType) {
|
|
4519
2802
|
case TransportType.RESTAPI:
|
|
@@ -4522,9 +2805,6 @@ var PublishInstruments = class extends _nsshunt_stsutils.STSOptionsBase {
|
|
|
4522
2805
|
}
|
|
4523
2806
|
this.#UpdateState(ePublishState$1.init, "constructor()");
|
|
4524
2807
|
}
|
|
4525
|
-
get options() {
|
|
4526
|
-
return super.options;
|
|
4527
|
-
}
|
|
4528
2808
|
async Publish() {
|
|
4529
2809
|
if (this.#inPublish) return false;
|
|
4530
2810
|
if (this.#publisherTransport) try {
|
|
@@ -4553,7 +2833,7 @@ var PublishInstruments = class extends _nsshunt_stsutils.STSOptionsBase {
|
|
|
4553
2833
|
}
|
|
4554
2834
|
async StartPublish() {
|
|
4555
2835
|
if (this.#publishState !== ePublishState$1.init) {
|
|
4556
|
-
this.options.logger.debug(
|
|
2836
|
+
this.options.logger.debug(chalk.yellow(`StartPublish:${this.options.processContext.nid}: StartPublish called when not currently in the init state. Current State: [${this.#publishState}]`));
|
|
4557
2837
|
return false;
|
|
4558
2838
|
}
|
|
4559
2839
|
this.#UpdateState(ePublishState$1.started, "StartPublish()");
|
|
@@ -4563,11 +2843,11 @@ var PublishInstruments = class extends _nsshunt_stsutils.STSOptionsBase {
|
|
|
4563
2843
|
#UpdateState(newState, comment) {
|
|
4564
2844
|
const previousState = this.#publishState;
|
|
4565
2845
|
this.#publishState = newState;
|
|
4566
|
-
this.options.logger.debug(
|
|
2846
|
+
this.options.logger.debug(chalk.yellow(`#UpdateState:${this.options.processContext.nid}: Previous State: [${previousState}]. Current State: [${this.#publishState}]. Comment: [${comment}]`));
|
|
4567
2847
|
}
|
|
4568
2848
|
async EndPublish() {
|
|
4569
2849
|
if (this.#publishState !== ePublishState$1.started) {
|
|
4570
|
-
this.options.logger.debug(
|
|
2850
|
+
this.options.logger.debug(chalk.yellow(`EndPublish:${this.options.processContext.nid}: EndPublish called when not within the started state. Current State: [${this.#publishState}]`));
|
|
4571
2851
|
return false;
|
|
4572
2852
|
}
|
|
4573
2853
|
this.#UpdateState(ePublishState$1.stopping, "EndPublish() (1)");
|
|
@@ -4592,11 +2872,12 @@ var ePublishState = /* @__PURE__ */ function(ePublishState) {
|
|
|
4592
2872
|
/**
|
|
4593
2873
|
* This class managers the creation of instruments and the publication of instrumentation telemetry to the instrument manager service.
|
|
4594
2874
|
*/
|
|
4595
|
-
var PublishInstrumentController = class PublishInstrumentController
|
|
2875
|
+
var PublishInstrumentController = class PublishInstrumentController {
|
|
2876
|
+
options;
|
|
4596
2877
|
#instruments = {};
|
|
4597
2878
|
#publisher = null;
|
|
4598
2879
|
constructor(options) {
|
|
4599
|
-
|
|
2880
|
+
this.options = options;
|
|
4600
2881
|
this.SetupInstrumentation();
|
|
4601
2882
|
this.#publisher = new PublishInstruments({
|
|
4602
2883
|
logger: options.logger,
|
|
@@ -4608,9 +2889,6 @@ var PublishInstrumentController = class PublishInstrumentController extends _nss
|
|
|
4608
2889
|
});
|
|
4609
2890
|
if (this.options.autoStart === true) this.StartPublish();
|
|
4610
2891
|
}
|
|
4611
|
-
get options() {
|
|
4612
|
-
return super.options;
|
|
4613
|
-
}
|
|
4614
2892
|
async StartPublish() {
|
|
4615
2893
|
return this.#publisher.StartPublish();
|
|
4616
2894
|
}
|
|
@@ -4677,11 +2955,11 @@ var PublishInstrumentController = class PublishInstrumentController extends _nss
|
|
|
4677
2955
|
}
|
|
4678
2956
|
SetupInstrumentation() {
|
|
4679
2957
|
if (!this.options.instrumentDefinitions) {
|
|
4680
|
-
this.options.logger.debug(
|
|
2958
|
+
this.options.logger.debug(chalk.yellow(`SetupInstrumentation:${this.options.processContext.nid}: No instrument(s) defined within supplied options.`));
|
|
4681
2959
|
return;
|
|
4682
2960
|
}
|
|
4683
2961
|
if (!this.options.processContext) {
|
|
4684
|
-
this.options.logger.debug(
|
|
2962
|
+
this.options.logger.debug(chalk.yellow(`SetupInstrumentation: No context defined within supplied options.`));
|
|
4685
2963
|
return;
|
|
4686
2964
|
}
|
|
4687
2965
|
this.#CreateInstruments(this.options.instrumentDefinitions);
|
|
@@ -4702,7 +2980,7 @@ var PublishInstrumentController = class PublishInstrumentController extends _nss
|
|
|
4702
2980
|
*/
|
|
4703
2981
|
UpdateInstrument(instrumentName, telemetry) {
|
|
4704
2982
|
if (this.#instruments[instrumentName]) this.#ProcessTelemetryCommand(instrumentName, telemetry);
|
|
4705
|
-
else this.options.logger.debug(
|
|
2983
|
+
else this.options.logger.debug(chalk.red(`UpdateInstrument:${this.options.processContext.nid}: Attempted to UpdateInstrument before initialised.`));
|
|
4706
2984
|
}
|
|
4707
2985
|
/**
|
|
4708
2986
|
* Add additional instrument publishers. Usually invoked when adding workers to the app and/or async runners within a worker.
|
|
@@ -4727,19 +3005,19 @@ var GetSTSInstrumentController = (app) => {
|
|
|
4727
3005
|
return app.config.globalProperties.$sts[STSInstrumentControllerPluginKey];
|
|
4728
3006
|
};
|
|
4729
3007
|
var STSInstrumentControllerPlugin = { install: (app, options) => {
|
|
4730
|
-
options.logger.debug(
|
|
3008
|
+
options.logger.debug(chalk.yellow(`STSInstrumentControllerPlugin:install:Start`));
|
|
4731
3009
|
const aic = new PublishInstrumentController(options);
|
|
4732
3010
|
if (!app.config.globalProperties.$sts) {
|
|
4733
|
-
options.logger.debug(
|
|
3011
|
+
options.logger.debug(chalk.cyan(`STSInstrumentControllerPlugin:install: [app.config.globalProperties.$sts] does not exist.`));
|
|
4734
3012
|
app.config.globalProperties.$sts = {};
|
|
4735
|
-
options.logger.debug(
|
|
4736
|
-
} else options.logger.debug(
|
|
3013
|
+
options.logger.debug(chalk.cyan(`STSInstrumentControllerPlugin:install: created empty [app.config.globalProperties.$sts].`));
|
|
3014
|
+
} else options.logger.debug(chalk.cyan(`STSInstrumentControllerPlugin:install: [app.config.globalProperties.$sts] already exists.`));
|
|
4737
3015
|
app.config.globalProperties.$sts.aic = aic;
|
|
4738
3016
|
app.config.globalProperties.$sts[STSInstrumentControllerPluginKey] = aic;
|
|
4739
|
-
options.logger.debug(
|
|
3017
|
+
options.logger.debug(chalk.cyan(`STSInstrumentControllerPlugin:install: AgentInstrumentController installed into [app.config.globalProperties.$sts] using: [${String(STSInstrumentControllerPluginKey)}].`));
|
|
4740
3018
|
app.provide(STSInstrumentControllerPluginKey, aic);
|
|
4741
|
-
options.logger.debug(
|
|
4742
|
-
options.logger.debug(
|
|
3019
|
+
options.logger.debug(chalk.cyan(`STSInstrumentControllerPlugin:install: AgentInstrumentController installed into 'provide' using: [${String(STSInstrumentControllerPluginKey)}].`));
|
|
3020
|
+
options.logger.debug(chalk.green(`STSInstrumentControllerPlugin:install:End`));
|
|
4743
3021
|
} };
|
|
4744
3022
|
//#endregion
|
|
4745
3023
|
//#region src/globalServiceDefinitions.ts
|
|
@@ -5503,7 +3781,7 @@ var ObservabilityPayloadTransformer = class {
|
|
|
5503
3781
|
this.#serviceModel = {};
|
|
5504
3782
|
if (subscriptionPayload.subscriptionKey.topic.localeCompare(SubscriptionTopic.AllServicesCombined.toString()) === 0) {
|
|
5505
3783
|
this.#serviceModel["STS-Service"] = ObservabilityModelUtils.GetModelForService("STS-Service", subscriptionPayload.data, this.#options.logger);
|
|
5506
|
-
if (this.#serviceModel["STS-Service"] === null) this.#LogDebugMessage(
|
|
3784
|
+
if (this.#serviceModel["STS-Service"] === null) this.#LogDebugMessage(chalk.red(`CreateModelAllServicesCombined():Error: GetModelForService() returned null`));
|
|
5507
3785
|
}
|
|
5508
3786
|
} catch (error) {
|
|
5509
3787
|
this.#LogErrorMessage(error);
|
|
@@ -5515,7 +3793,7 @@ var ObservabilityPayloadTransformer = class {
|
|
|
5515
3793
|
this.#serviceModel = {};
|
|
5516
3794
|
for (const [serviceId, serviceTelemetry] of Object.entries(subscriptionPayload.data)) {
|
|
5517
3795
|
this.#serviceModel[serviceId] = ObservabilityModelUtils.GetModelForService(serviceId, serviceTelemetry, this.#options.logger);
|
|
5518
|
-
if (this.#serviceModel[serviceId] === null) this.#LogDebugMessage(
|
|
3796
|
+
if (this.#serviceModel[serviceId] === null) this.#LogDebugMessage(chalk.red(`CreateModelServices():Error: GetModelForService() returned null`));
|
|
5519
3797
|
}
|
|
5520
3798
|
} catch (error) {
|
|
5521
3799
|
return;
|
|
@@ -5527,7 +3805,7 @@ var ObservabilityPayloadTransformer = class {
|
|
|
5527
3805
|
for (const [serviceId, service] of Object.entries(subscriptionPayload.data)) for (const [serviceInstanceId, serviceInstanceTelemetry] of Object.entries(service)) if (serviceInstanceTelemetry.cpu && serviceInstanceTelemetry.cpu > 0) {
|
|
5528
3806
|
this.#serviceModel[serviceInstanceId] = ObservabilityModelUtils.GetModelForService(serviceInstanceId, serviceInstanceTelemetry, this.#options.logger);
|
|
5529
3807
|
if (this.#serviceModel[serviceInstanceId] !== null) this.#serviceModel[serviceInstanceId].options = { serviceId };
|
|
5530
|
-
else this.#LogDebugMessage(
|
|
3808
|
+
else this.#LogDebugMessage(chalk.red(`CreateModelServiceInstances():Error: GetModelForService() returned null`));
|
|
5531
3809
|
}
|
|
5532
3810
|
} catch (error) {
|
|
5533
3811
|
return;
|
|
@@ -5542,7 +3820,7 @@ var ObservabilityPayloadTransformer = class {
|
|
|
5542
3820
|
serviceId,
|
|
5543
3821
|
serviceInstanceId
|
|
5544
3822
|
};
|
|
5545
|
-
else this.#LogDebugMessage(
|
|
3823
|
+
else this.#LogDebugMessage(chalk.red(`CreateModelServiceInstance():Error: GetModelForService() returned null`));
|
|
5546
3824
|
}
|
|
5547
3825
|
} catch (error) {
|
|
5548
3826
|
return;
|
|
@@ -5554,7 +3832,7 @@ var ObservabilityPayloadTransformer = class {
|
|
|
5554
3832
|
if (subscriptionPayload.subscriptionKey.topic.localeCompare(SubscriptionTopic.AllAgentsCombined.toString()) === 0) {
|
|
5555
3833
|
if (Object.keys(subscriptionPayload.data).length !== 0) {
|
|
5556
3834
|
this.#agentModel["STS-Agent"] = ObservabilityModelUtils.GetModelForAgent("STS-Agent", subscriptionPayload.data, this.#options.logger);
|
|
5557
|
-
if (this.#agentModel["STS-Agent"] === null) this.#LogDebugMessage(
|
|
3835
|
+
if (this.#agentModel["STS-Agent"] === null) this.#LogDebugMessage(chalk.red(`CreateModelAllAgentsCombined():Error: GetModelForAgent() returned null`));
|
|
5558
3836
|
}
|
|
5559
3837
|
}
|
|
5560
3838
|
} catch (error) {
|
|
@@ -5567,10 +3845,10 @@ var ObservabilityPayloadTransformer = class {
|
|
|
5567
3845
|
this.#agentModel = {};
|
|
5568
3846
|
for (const [agentId, agentInstanceTelemetry] of Object.entries(subscriptionPayload.data)) if (agentInstanceTelemetry.timer) {
|
|
5569
3847
|
this.#agentModel[agentId] = ObservabilityModelUtils.GetModelForAgent(agentId, agentInstanceTelemetry, this.#options.logger);
|
|
5570
|
-
if (this.#agentModel[agentId] !== null) {} else this.#LogDebugMessage(
|
|
3848
|
+
if (this.#agentModel[agentId] !== null) {} else this.#LogDebugMessage(chalk.red(`CreateModelAgents():Error: GetModelForAgent() returned null`));
|
|
5571
3849
|
}
|
|
5572
3850
|
} catch (error) {
|
|
5573
|
-
this.#LogErrorMessage(
|
|
3851
|
+
this.#LogErrorMessage(chalk.red(`UIControllerAgent:CreateModel(): Error: [${error}]`));
|
|
5574
3852
|
}
|
|
5575
3853
|
}
|
|
5576
3854
|
CreateModelAgentWorkers(subscriptionPayload) {
|
|
@@ -5583,10 +3861,10 @@ var ObservabilityPayloadTransformer = class {
|
|
|
5583
3861
|
const coreCount = this.#agentModel[threadKey].instruments[Gauge.CORE_COUNT_GAUGE].val;
|
|
5584
3862
|
this.#agentModel[threadKey].canNavigate = coreCount > 0;
|
|
5585
3863
|
this.#agentModel[threadKey].options = { agentId };
|
|
5586
|
-
} else this.#LogDebugMessage(
|
|
3864
|
+
} else this.#LogDebugMessage(chalk.red(`CreateModelAgentWorkers():Error: GetModelForAgent() returned null`));
|
|
5587
3865
|
}
|
|
5588
3866
|
} catch (error) {
|
|
5589
|
-
this.#LogErrorMessage(
|
|
3867
|
+
this.#LogErrorMessage(chalk.red(`UIControllerAgentThreads:CreateModel(): Error: [${error}]`));
|
|
5590
3868
|
}
|
|
5591
3869
|
}
|
|
5592
3870
|
CreateModelAgentWorker(subscriptionPayload) {
|
|
@@ -5594,7 +3872,7 @@ var ObservabilityPayloadTransformer = class {
|
|
|
5594
3872
|
this.#agentModel = {};
|
|
5595
3873
|
for (const [agentId, agentWorker] of Object.entries(subscriptionPayload.data)) for (const [agentWorkerId, asyncRunnerData] of Object.entries(agentWorker)) for (const [asyncRunnerId, agentInstanceTelemetry] of Object.entries(asyncRunnerData)) if (agentInstanceTelemetry.timer) this.#agentModel[asyncRunnerId] = ObservabilityModelUtils.GetModelForAgent(asyncRunnerId, agentInstanceTelemetry, this.#options.logger);
|
|
5596
3874
|
} catch (error) {
|
|
5597
|
-
this.#LogErrorMessage(
|
|
3875
|
+
this.#LogErrorMessage(chalk.red(`UIControllerAgentThread:CreateModel(): Error: [${error}]`));
|
|
5598
3876
|
}
|
|
5599
3877
|
}
|
|
5600
3878
|
CreateModelAllLambdasCombined(subscriptionPayload) {
|
|
@@ -5602,7 +3880,7 @@ var ObservabilityPayloadTransformer = class {
|
|
|
5602
3880
|
this.#lambdaModel = {};
|
|
5603
3881
|
if (subscriptionPayload.subscriptionKey.topic.localeCompare(SubscriptionTopic.AllLambdasCombined.toString()) === 0) {
|
|
5604
3882
|
this.#lambdaModel["STS-Lambda"] = ObservabilityModelUtils.GetModelForLambda("STS-Lambda", subscriptionPayload.data, this.#options.logger);
|
|
5605
|
-
if (this.#lambdaModel["STS-Lambda"] === null) this.#LogDebugMessage(
|
|
3883
|
+
if (this.#lambdaModel["STS-Lambda"] === null) this.#LogDebugMessage(chalk.red(`CreateModelAllLambdasCombined():Error: GetModelForLambda() returned null`));
|
|
5606
3884
|
}
|
|
5607
3885
|
} catch (error) {
|
|
5608
3886
|
this.#LogErrorMessage(error);
|
|
@@ -5614,7 +3892,7 @@ var ObservabilityPayloadTransformer = class {
|
|
|
5614
3892
|
this.#lambdaModel = {};
|
|
5615
3893
|
for (const [technologyId, technologyTelemetry] of Object.entries(subscriptionPayload.data)) {
|
|
5616
3894
|
this.#lambdaModel[technologyId] = ObservabilityModelUtils.GetModelForLambda(technologyId, technologyTelemetry, this.#options.logger);
|
|
5617
|
-
if (this.#lambdaModel[technologyId] === null) this.#LogDebugMessage(
|
|
3895
|
+
if (this.#lambdaModel[technologyId] === null) this.#LogDebugMessage(chalk.red(`CreateModelLambdaTechnologies():Error: GetModelForLambda() returned null`));
|
|
5618
3896
|
}
|
|
5619
3897
|
} catch (error) {
|
|
5620
3898
|
return;
|
|
@@ -5626,7 +3904,7 @@ var ObservabilityPayloadTransformer = class {
|
|
|
5626
3904
|
for (const [technologyId, technologyTelemetry] of Object.entries(subscriptionPayload.data)) for (const [subTechnologyId, subTechnologyTelemetry] of Object.entries(technologyTelemetry)) if (subTechnologyTelemetry.cpu && subTechnologyTelemetry.cpu > 0) {
|
|
5627
3905
|
this.#lambdaModel[subTechnologyId] = ObservabilityModelUtils.GetModelForLambda(subTechnologyId, subTechnologyTelemetry, this.#options.logger);
|
|
5628
3906
|
if (this.#lambdaModel[subTechnologyId] !== null) this.#lambdaModel[subTechnologyId].options = { technologyId };
|
|
5629
|
-
else this.#LogDebugMessage(
|
|
3907
|
+
else this.#LogDebugMessage(chalk.red(`CreateModelLambdaSubTechnologies():Error: GetModelForLambda() returned null`));
|
|
5630
3908
|
}
|
|
5631
3909
|
} catch (error) {
|
|
5632
3910
|
return;
|
|
@@ -5641,7 +3919,7 @@ var ObservabilityPayloadTransformer = class {
|
|
|
5641
3919
|
technologyId,
|
|
5642
3920
|
subTechnologyId
|
|
5643
3921
|
};
|
|
5644
|
-
else this.#LogDebugMessage(
|
|
3922
|
+
else this.#LogDebugMessage(chalk.red(`CreateModelLambdaSubTechnologiesInstance():Error: GetModelForLambda() returned null`));
|
|
5645
3923
|
}
|
|
5646
3924
|
} catch (error) {
|
|
5647
3925
|
return;
|
|
@@ -5667,11 +3945,11 @@ var RESTClientSubscriber = class {
|
|
|
5667
3945
|
async Subscribe(subscriptions) {
|
|
5668
3946
|
subscriptions.map(async (subId) => {
|
|
5669
3947
|
this.#RemoveKeepAlive(subId);
|
|
5670
|
-
this.#LogDebugMessage(
|
|
3948
|
+
this.#LogDebugMessage(chalk.yellow(`RESTClientSubscriber:Subscribe(): Sending subscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
|
|
5671
3949
|
try {
|
|
5672
3950
|
this.#AddKeepAlive(subId);
|
|
5673
3951
|
} catch (error) {
|
|
5674
|
-
this.#LogErrorMessage(
|
|
3952
|
+
this.#LogErrorMessage(chalk.red(`RESTClientSubscriber:Subscribe(): Error: response: [${JSON.stringify(error)}]`));
|
|
5675
3953
|
this.#RemoveKeepAlive(subId);
|
|
5676
3954
|
}
|
|
5677
3955
|
});
|
|
@@ -5679,17 +3957,17 @@ var RESTClientSubscriber = class {
|
|
|
5679
3957
|
UnSubscribe(subscriptions) {
|
|
5680
3958
|
subscriptions.map(async (subId) => {
|
|
5681
3959
|
this.#RemoveKeepAlive(subId);
|
|
5682
|
-
this.#LogDebugMessage(
|
|
3960
|
+
this.#LogDebugMessage(chalk.yellow(`RESTClientSubscriber:UnSubscribe(): Sending unsubscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
|
|
5683
3961
|
});
|
|
5684
3962
|
}
|
|
5685
3963
|
UpdateModelCursor = (subscriptions) => {
|
|
5686
|
-
this.#LogDebugMessage(
|
|
3964
|
+
this.#LogDebugMessage(chalk.yellow(`RESTClientSubscriber:UnSubscribe(): UpdateModelCursor()`));
|
|
5687
3965
|
this.UnSubscribe(this.#currentSubscriptions);
|
|
5688
3966
|
this.#currentSubscriptions = subscriptions;
|
|
5689
3967
|
this.Subscribe(this.#currentSubscriptions);
|
|
5690
3968
|
};
|
|
5691
3969
|
async #InvokeRESTAPI(subscription) {
|
|
5692
|
-
this.#LogDebugMessage(
|
|
3970
|
+
this.#LogDebugMessage(chalk.yellow(`RESTClientSubscriber:#InvokeRESTAPI(): subscriptionKey: [${subscription.subscriptionKey.id}]`));
|
|
5693
3971
|
const { subscriptionKey } = subscription;
|
|
5694
3972
|
let url = "";
|
|
5695
3973
|
switch (subscriptionKey.topic) {
|
|
@@ -5745,36 +4023,36 @@ var RESTClientSubscriber = class {
|
|
|
5745
4023
|
let retVal;
|
|
5746
4024
|
const start = performance.now();
|
|
5747
4025
|
try {
|
|
5748
|
-
this.#LogDebugMessage(
|
|
4026
|
+
this.#LogDebugMessage(chalk.yellow(`RESTClientSubscriber:#InvokeRESTAPI(): axios call: endPointUrl: [${endPointUrl}]`));
|
|
5749
4027
|
if (detect_node.default && this.#options.agentManager) retVal = await (0, axios.default)(new _nsshunt_stsutils.STSAxiosConfig(endPointUrl, "get").withDefaultHeaders().withAgentManager(this.#options.agentManager).config);
|
|
5750
4028
|
else retVal = await (0, axios.default)(new _nsshunt_stsutils.STSAxiosConfig(endPointUrl, "get").withDefaultHeaders().config);
|
|
5751
|
-
if (retVal) if (retVal.data) {} else this.#LogDebugMessage(
|
|
5752
|
-
else this.#LogDebugMessage(
|
|
4029
|
+
if (retVal) if (retVal.data) {} else this.#LogDebugMessage(chalk.yellow(`RESTClientSubscriber:#InvokeRESTAPI(): no retVal.data`));
|
|
4030
|
+
else this.#LogDebugMessage(chalk.yellow(`RESTClientSubscriber:#InvokeRESTAPI(): no retVal`));
|
|
5753
4031
|
performance.now() - start;
|
|
5754
4032
|
if (subscriptionKey.topic.localeCompare(SubscriptionTopic.AllServicesCombined) === 0) return retVal.data["services"];
|
|
5755
4033
|
if (subscriptionKey.topic.localeCompare(SubscriptionTopic.AllAgentsCombined) === 0) return retVal.data["agents"];
|
|
5756
4034
|
if (subscriptionKey.topic.localeCompare(SubscriptionTopic.AllLambdasCombined) === 0) return retVal.data["lambdas"];
|
|
5757
4035
|
return retVal.data;
|
|
5758
4036
|
} catch (error) {
|
|
5759
|
-
this.#LogErrorMessage(
|
|
4037
|
+
this.#LogErrorMessage(chalk.red(`RESTClientSubscriber:#InvokeRESTAPI(): subscriptionKey: [${subscription.subscriptionKey.id}], Error: [${error}]`));
|
|
5760
4038
|
return null;
|
|
5761
4039
|
}
|
|
5762
4040
|
} else return null;
|
|
5763
4041
|
}
|
|
5764
4042
|
#GetData = async (subscription) => {
|
|
5765
4043
|
try {
|
|
5766
|
-
this.#LogDebugMessage(
|
|
4044
|
+
this.#LogDebugMessage(chalk.yellow(`RESTClientSubscriber:#GetData(): subscriptionKey: [${JSON.stringify(subscription.subscriptionKey)}`));
|
|
5767
4045
|
const retVal = await this.#InvokeRESTAPI(subscription);
|
|
5768
4046
|
if (retVal) {
|
|
5769
4047
|
const payload = {
|
|
5770
4048
|
subscriptionKey: subscription.subscriptionKey,
|
|
5771
4049
|
data: retVal
|
|
5772
4050
|
};
|
|
5773
|
-
this.#LogDebugMessage(
|
|
4051
|
+
this.#LogDebugMessage(chalk.yellow(`RESTClientSubscriber:#GetData(): data returned: subscriptionKey: [${JSON.stringify(subscription.subscriptionKey)}`));
|
|
5774
4052
|
subscription.cb(payload);
|
|
5775
|
-
} else this.#LogDebugMessage(
|
|
4053
|
+
} else this.#LogDebugMessage(chalk.yellow(`RESTClientSubscriber:#GetData(): No data returned: subscriptionKey: [${JSON.stringify(subscription.subscriptionKey)}`));
|
|
5776
4054
|
} catch (error) {
|
|
5777
|
-
this.#LogErrorMessage(
|
|
4055
|
+
this.#LogErrorMessage(chalk.red(`RESTClientSubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
|
|
5778
4056
|
this.#RemoveKeepAlive(subscription);
|
|
5779
4057
|
}
|
|
5780
4058
|
};
|
|
@@ -5787,27 +4065,27 @@ var RESTClientSubscriber = class {
|
|
|
5787
4065
|
const diff = performance.now() - start;
|
|
5788
4066
|
let timeoutDuration = (this.#options.keepAlive ?? 1e3) - diff;
|
|
5789
4067
|
if (timeoutDuration < 500) timeoutDuration = 500;
|
|
5790
|
-
this.#LogDebugMessage(
|
|
4068
|
+
this.#LogDebugMessage(chalk.yellow(`Total duration for subscription: [${diff}], waiting: [${timeoutDuration}]`));
|
|
5791
4069
|
socketSubscribeKeepAlive.timeout = this.#SetupTimeout(socketSubscribeKeepAlive, subscription, timeoutDuration);
|
|
5792
|
-
} else this.#LogDebugMessage(
|
|
4070
|
+
} else this.#LogDebugMessage(chalk.yellow(`RESTClientSubscriber: Subscription removed: [${socketSubscribeKeepAlive.id}]. Processing terminate.`));
|
|
5793
4071
|
} catch (error) {
|
|
5794
|
-
this.#LogErrorMessage(
|
|
4072
|
+
this.#LogErrorMessage(chalk.red(`RESTClientSubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
|
|
5795
4073
|
this.#RemoveKeepAlive(subscription);
|
|
5796
4074
|
}
|
|
5797
4075
|
}, timeout);
|
|
5798
4076
|
}
|
|
5799
4077
|
#AddKeepAlive(subscription) {
|
|
5800
|
-
this.#LogDebugMessage(
|
|
4078
|
+
this.#LogDebugMessage(chalk.yellow(`RESTClientSubscriber:#AddKeepAlive(): subscriptionKey: [${subscription.subscriptionKey.id}]`));
|
|
5801
4079
|
this.#RemoveKeepAlive(subscription);
|
|
5802
4080
|
const socketSubscribeKeepAlive = { id: subscription.subscriptionKey.id };
|
|
5803
4081
|
socketSubscribeKeepAlive.timeout = this.#SetupTimeout(socketSubscribeKeepAlive, subscription, this.#options.keepAlive ?? 1e3);
|
|
5804
4082
|
this.#socketSubscribeKeepAlive[subscription.subscriptionKey.id] = socketSubscribeKeepAlive;
|
|
5805
|
-
this.#LogDebugMessage(
|
|
4083
|
+
this.#LogDebugMessage(chalk.yellow(`RESTClientSubscriber:#AddKeepAlive(): Getting Data: subscriptionKey: [${subscription.subscriptionKey.id}]`));
|
|
5806
4084
|
this.#GetData(subscription);
|
|
5807
4085
|
}
|
|
5808
4086
|
#RemoveKeepAlive(subscription) {
|
|
5809
4087
|
if (this.#socketSubscribeKeepAlive[subscription.subscriptionKey.id]) {
|
|
5810
|
-
this.#LogDebugMessage(
|
|
4088
|
+
this.#LogDebugMessage(chalk.gray(`RESTClientSubscriber:#RemoveKeepAlive(): subscriptionKey: [${subscription.subscriptionKey.id}]`));
|
|
5811
4089
|
clearTimeout(this.#socketSubscribeKeepAlive[subscription.subscriptionKey.id].timeout);
|
|
5812
4090
|
delete this.#socketSubscribeKeepAlive[subscription.subscriptionKey.id].timeout;
|
|
5813
4091
|
delete this.#socketSubscribeKeepAlive[subscription.subscriptionKey.id];
|
|
@@ -5826,9 +4104,9 @@ var SocketClientSubscriber = class extends _nsshunt_stssocketioutils.SocketIoCli
|
|
|
5826
4104
|
super("STSVueTilsTester");
|
|
5827
4105
|
this.#id = globalThis.crypto.randomUUID();
|
|
5828
4106
|
this.#options = options;
|
|
5829
|
-
this.LogDebugMessage(
|
|
4107
|
+
this.LogDebugMessage(chalk.cyan(`${this.logPrefix}Start()`));
|
|
5830
4108
|
const url = `${this.#options.instrumentManagerEndpoint}:${this.#options.instrumentManagerPort}/${SOCKET_NAMESPACE$1}/`;
|
|
5831
|
-
this.LogDebugMessage(
|
|
4109
|
+
this.LogDebugMessage(chalk.cyan(`${this.logPrefix}SetupSocket() url: [${url}]`));
|
|
5832
4110
|
this.WithAddress(url).WithLogger(this.#options.logger ?? _nsshunt_stsutils.defaultLogger).SetupSocket();
|
|
5833
4111
|
}
|
|
5834
4112
|
get id() {
|
|
@@ -5847,17 +4125,17 @@ var SocketClientSubscriber = class extends _nsshunt_stssocketioutils.SocketIoCli
|
|
|
5847
4125
|
subscriptions.map(async (subId) => {
|
|
5848
4126
|
try {
|
|
5849
4127
|
if (this.socket) {
|
|
5850
|
-
this.LogDebugMessage(
|
|
4128
|
+
this.LogDebugMessage(chalk.yellow(`ObservabilitySocketIOSubscriber:Subscribe(): Sending subscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
|
|
5851
4129
|
this.socket.timeout(1e3).emit("subscribe", subId.subscriptionKey, (error, data) => {
|
|
5852
|
-
if (error) this.LogErrorMessage(
|
|
4130
|
+
if (error) this.LogErrorMessage(chalk.red(`ObservabilitySocketIOSubscriber:Subscribe(): Error: [${error}], data: [${data}]`));
|
|
5853
4131
|
else {
|
|
5854
|
-
this.LogDebugMessage(
|
|
4132
|
+
this.LogDebugMessage(chalk.green(`ObservabilitySocketIOSubscriber:Subscribe(): Response: [${JSON.stringify(data)}]`));
|
|
5855
4133
|
this.subscriptions[subId.subscriptionKey.id] = subId;
|
|
5856
4134
|
}
|
|
5857
4135
|
});
|
|
5858
4136
|
}
|
|
5859
4137
|
} catch (error) {
|
|
5860
|
-
this.LogErrorMessage(
|
|
4138
|
+
this.LogErrorMessage(chalk.red(`ObservabilitySocketIOSubscriber:Subscribe(): Error: response: [${JSON.stringify(error)}]`));
|
|
5861
4139
|
}
|
|
5862
4140
|
});
|
|
5863
4141
|
}
|
|
@@ -5865,31 +4143,31 @@ var SocketClientSubscriber = class extends _nsshunt_stssocketioutils.SocketIoCli
|
|
|
5865
4143
|
subscriptions.map(async (subId) => {
|
|
5866
4144
|
try {
|
|
5867
4145
|
if (this.socket) {
|
|
5868
|
-
this.LogDebugMessage(
|
|
4146
|
+
this.LogDebugMessage(chalk.yellow(`ObservabilitySocketIOSubscriber:UnSubscribe(): Sending unsubscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
|
|
5869
4147
|
this.socket.timeout(1e3).emit("unsubscribe", subId.subscriptionKey, (error, data) => {
|
|
5870
|
-
if (error) this.LogErrorMessage(
|
|
4148
|
+
if (error) this.LogErrorMessage(chalk.red(`ObservabilitySocketIOSubscriber:UnSubscribe(): Error: [${error}], data: [${data}]`));
|
|
5871
4149
|
else {
|
|
5872
|
-
this.LogDebugMessage(
|
|
4150
|
+
this.LogDebugMessage(chalk.green(`ObservabilitySocketIOSubscriber:UnSubscribe(): Response: [${JSON.stringify(data)}]`));
|
|
5873
4151
|
delete this.subscriptions[subId.subscriptionKey.id];
|
|
5874
4152
|
}
|
|
5875
4153
|
});
|
|
5876
4154
|
}
|
|
5877
4155
|
} catch (error) {
|
|
5878
|
-
this.LogErrorMessage(
|
|
4156
|
+
this.LogErrorMessage(chalk.red(`ObservabilitySocketIOSubscriber:UnSubscribe(): Error response: [${JSON.stringify(error)}]`));
|
|
5879
4157
|
}
|
|
5880
4158
|
});
|
|
5881
4159
|
}
|
|
5882
4160
|
SocketConnect(socket) {
|
|
5883
|
-
this.LogDebugMessage(
|
|
4161
|
+
this.LogDebugMessage(chalk.magenta(`${this.logPrefix}SocketConnect(): Socket ID: [${socket.id}]`));
|
|
5884
4162
|
this.UpdateModelCursor(this.#currentSubscriptions);
|
|
5885
4163
|
}
|
|
5886
4164
|
SocketError(error) {
|
|
5887
|
-
this.LogErrorMessage(
|
|
4165
|
+
this.LogErrorMessage(chalk.red(`${this.logPrefix}SocketError(): Error: [${error}]`));
|
|
5888
4166
|
}
|
|
5889
4167
|
SetupSocketEvents(socket) {
|
|
5890
|
-
this.LogDebugMessage(
|
|
4168
|
+
this.LogDebugMessage(chalk.magenta(`${this.logPrefix}SetupSocketEvents(): Socket ID: [${socket.id}]`));
|
|
5891
4169
|
if (this.socket) this.socket.on("subscriptionData", (data, cb) => {
|
|
5892
|
-
this.LogDebugMessage(
|
|
4170
|
+
this.LogDebugMessage(chalk.magenta(`${this.logPrefix}SetupSocketEvents(): on subscriptionData(): Socket ID: [${socket.id}]`));
|
|
5893
4171
|
const subId = data.subscriptionKey.id;
|
|
5894
4172
|
const currentSubscriptions = Object.keys(this.subscriptions).toString();
|
|
5895
4173
|
if (this.subscriptions[subId]) {
|
|
@@ -5899,10 +4177,10 @@ var SocketClientSubscriber = class extends _nsshunt_stssocketioutils.SocketIoCli
|
|
|
5899
4177
|
});
|
|
5900
4178
|
}
|
|
5901
4179
|
SocketConnectError(error) {
|
|
5902
|
-
this.LogErrorMessage(
|
|
4180
|
+
this.LogErrorMessage(chalk.red(`${this.logPrefix}SocketConnectError(): Error: [${error}]`));
|
|
5903
4181
|
}
|
|
5904
4182
|
SocketDisconnect(reason) {
|
|
5905
|
-
this.LogErrorMessage(
|
|
4183
|
+
this.LogErrorMessage(chalk.red(`${this.logPrefix}SocketDisconnect(): reason: [${reason}]`));
|
|
5906
4184
|
}
|
|
5907
4185
|
};
|
|
5908
4186
|
//#endregion
|
|
@@ -5915,9 +4193,9 @@ var SocketBrowserClientLogPublisher = class extends _nsshunt_stssocketioutils.So
|
|
|
5915
4193
|
super("stsinstrumentmanagerclient:SocketBrowserClientLogPublisher");
|
|
5916
4194
|
this.#options = options;
|
|
5917
4195
|
this.#id = globalThis.crypto.randomUUID();
|
|
5918
|
-
this.LogDebugMessage(
|
|
4196
|
+
this.LogDebugMessage(chalk.cyan(`${this.logPrefix}Start()`));
|
|
5919
4197
|
const url = `${this.#options.imendpoint}:${this.#options.import}/${SOCKET_NAMESPACE}/`;
|
|
5920
|
-
this.LogDebugMessage(
|
|
4198
|
+
this.LogDebugMessage(chalk.cyan(`${this.logPrefix}SetupSocket() url: [${url}]`));
|
|
5921
4199
|
this.WithAddress(url).WithLogger(_nsshunt_stsutils.defaultLogger).SetupSocket();
|
|
5922
4200
|
}
|
|
5923
4201
|
get id() {
|
|
@@ -5927,20 +4205,20 @@ var SocketBrowserClientLogPublisher = class extends _nsshunt_stssocketioutils.So
|
|
|
5927
4205
|
return `stsinstrumentmanagerclient:SocketBrowserClientLogPublisher:`;
|
|
5928
4206
|
}
|
|
5929
4207
|
SocketConnect(socket) {
|
|
5930
|
-
this.LogDebugMessage(
|
|
4208
|
+
this.LogDebugMessage(chalk.magenta(`${this.logPrefix}SocketConnect(): Socket ID: [${socket.id}], Joining Room: [${this.#options.rooms}]`));
|
|
5931
4209
|
socket.emit("__STSjoinRoom", this.#options.rooms);
|
|
5932
4210
|
}
|
|
5933
4211
|
SocketError(error) {
|
|
5934
|
-
this.LogErrorMessage(
|
|
4212
|
+
this.LogErrorMessage(chalk.red(`${this.logPrefix}SocketError(): Error: [${error}]`));
|
|
5935
4213
|
}
|
|
5936
4214
|
SetupSocketEvents(socket) {
|
|
5937
|
-
this.LogDebugMessage(
|
|
4215
|
+
this.LogDebugMessage(chalk.magenta(`${this.logPrefix}SetupSocketEvents(): Socket ID: [${socket.id}]`));
|
|
5938
4216
|
}
|
|
5939
4217
|
SocketConnectError(error) {
|
|
5940
|
-
this.LogErrorMessage(
|
|
4218
|
+
this.LogErrorMessage(chalk.red(`${this.logPrefix}SocketConnectError(): Error: [${error}]`));
|
|
5941
4219
|
}
|
|
5942
4220
|
SocketDisconnect(reason) {
|
|
5943
|
-
this.LogErrorMessage(
|
|
4221
|
+
this.LogErrorMessage(chalk.red(`${this.logPrefix}SocketDisconnect(): reason: [${reason}]`));
|
|
5944
4222
|
}
|
|
5945
4223
|
};
|
|
5946
4224
|
//#endregion
|