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