@nsshunt/stsrest01client 1.0.43 → 1.0.44
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 +646 -4091
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +645 -4090
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
//#region \0rolldown/runtime.js
|
|
3
|
-
var __create
|
|
4
|
-
var __defProp
|
|
5
|
-
var __getOwnPropDesc
|
|
6
|
-
var __getOwnPropNames
|
|
7
|
-
var __getProtoOf
|
|
8
|
-
var __hasOwnProp
|
|
9
|
-
var __commonJSMin
|
|
10
|
-
var __copyProps
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
12
|
key = keys[i];
|
|
13
|
-
if (!__hasOwnProp
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
14
|
get: ((k) => from[k]).bind(null, key),
|
|
15
|
-
enumerable: !(desc = __getOwnPropDesc
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
21
21
|
value: mod,
|
|
22
22
|
enumerable: true
|
|
23
23
|
}) : target, mod));
|
|
24
24
|
//#endregion
|
|
25
25
|
let node_fs = require("node:fs");
|
|
26
26
|
let axios = require("axios");
|
|
27
|
-
axios = __toESM
|
|
27
|
+
axios = __toESM(axios);
|
|
28
28
|
let _nsshunt_stsutils = require("@nsshunt/stsutils");
|
|
29
29
|
//#region __vite-browser-external
|
|
30
|
-
var require___vite_browser_external = /* @__PURE__ */ __commonJSMin
|
|
30
|
+
var require___vite_browser_external = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
31
31
|
module.exports = {};
|
|
32
32
|
}));
|
|
33
33
|
//#endregion
|
|
34
34
|
//#region node_modules/@nsshunt/stsconfig/dist/index.mjs
|
|
35
|
-
var import_main = /* @__PURE__ */ __toESM
|
|
35
|
+
var import_main = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
36
36
|
var fs = require___vite_browser_external();
|
|
37
37
|
var path = require("path");
|
|
38
38
|
var os = require("os");
|
|
@@ -299,2059 +299,333 @@ var import_main = /* @__PURE__ */ __toESM$1((/* @__PURE__ */ __commonJSMin$1(((e
|
|
|
299
299
|
module.exports.populate = DotenvModule.populate;
|
|
300
300
|
module.exports = DotenvModule;
|
|
301
301
|
})))(), 1);
|
|
302
|
-
var
|
|
303
|
-
var
|
|
304
|
-
var
|
|
305
|
-
var
|
|
306
|
-
var
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
302
|
+
var ANSI_BACKGROUND_OFFSET$1 = 10;
|
|
303
|
+
var wrapAnsi16$1 = (offset = 0) => (code) => `\u001B[${code + offset}m`;
|
|
304
|
+
var wrapAnsi256$1 = (offset = 0) => (code) => `\u001B[${38 + offset};5;${code}m`;
|
|
305
|
+
var wrapAnsi16m$1 = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`;
|
|
306
|
+
var styles$1$1 = {
|
|
307
|
+
modifier: {
|
|
308
|
+
reset: [0, 0],
|
|
309
|
+
bold: [1, 22],
|
|
310
|
+
dim: [2, 22],
|
|
311
|
+
italic: [3, 23],
|
|
312
|
+
underline: [4, 24],
|
|
313
|
+
overline: [53, 55],
|
|
314
|
+
inverse: [7, 27],
|
|
315
|
+
hidden: [8, 28],
|
|
316
|
+
strikethrough: [9, 29]
|
|
317
|
+
},
|
|
318
|
+
color: {
|
|
319
|
+
black: [30, 39],
|
|
320
|
+
red: [31, 39],
|
|
321
|
+
green: [32, 39],
|
|
322
|
+
yellow: [33, 39],
|
|
323
|
+
blue: [34, 39],
|
|
324
|
+
magenta: [35, 39],
|
|
325
|
+
cyan: [36, 39],
|
|
326
|
+
white: [37, 39],
|
|
327
|
+
blackBright: [90, 39],
|
|
328
|
+
gray: [90, 39],
|
|
329
|
+
grey: [90, 39],
|
|
330
|
+
redBright: [91, 39],
|
|
331
|
+
greenBright: [92, 39],
|
|
332
|
+
yellowBright: [93, 39],
|
|
333
|
+
blueBright: [94, 39],
|
|
334
|
+
magentaBright: [95, 39],
|
|
335
|
+
cyanBright: [96, 39],
|
|
336
|
+
whiteBright: [97, 39]
|
|
337
|
+
},
|
|
338
|
+
bgColor: {
|
|
339
|
+
bgBlack: [40, 49],
|
|
340
|
+
bgRed: [41, 49],
|
|
341
|
+
bgGreen: [42, 49],
|
|
342
|
+
bgYellow: [43, 49],
|
|
343
|
+
bgBlue: [44, 49],
|
|
344
|
+
bgMagenta: [45, 49],
|
|
345
|
+
bgCyan: [46, 49],
|
|
346
|
+
bgWhite: [47, 49],
|
|
347
|
+
bgBlackBright: [100, 49],
|
|
348
|
+
bgGray: [100, 49],
|
|
349
|
+
bgGrey: [100, 49],
|
|
350
|
+
bgRedBright: [101, 49],
|
|
351
|
+
bgGreenBright: [102, 49],
|
|
352
|
+
bgYellowBright: [103, 49],
|
|
353
|
+
bgBlueBright: [104, 49],
|
|
354
|
+
bgMagentaBright: [105, 49],
|
|
355
|
+
bgCyanBright: [106, 49],
|
|
356
|
+
bgWhiteBright: [107, 49]
|
|
316
357
|
}
|
|
317
|
-
return to;
|
|
318
358
|
};
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
215
|
|
334
|
-
],
|
|
335
|
-
"aqua": [
|
|
336
|
-
0,
|
|
337
|
-
255,
|
|
338
|
-
255
|
|
339
|
-
],
|
|
340
|
-
"aquamarine": [
|
|
341
|
-
127,
|
|
342
|
-
255,
|
|
343
|
-
212
|
|
344
|
-
],
|
|
345
|
-
"azure": [
|
|
346
|
-
240,
|
|
347
|
-
255,
|
|
348
|
-
255
|
|
349
|
-
],
|
|
350
|
-
"beige": [
|
|
351
|
-
245,
|
|
352
|
-
245,
|
|
353
|
-
220
|
|
354
|
-
],
|
|
355
|
-
"bisque": [
|
|
356
|
-
255,
|
|
357
|
-
228,
|
|
358
|
-
196
|
|
359
|
-
],
|
|
360
|
-
"black": [
|
|
361
|
-
0,
|
|
362
|
-
0,
|
|
363
|
-
0
|
|
364
|
-
],
|
|
365
|
-
"blanchedalmond": [
|
|
366
|
-
255,
|
|
367
|
-
235,
|
|
368
|
-
205
|
|
369
|
-
],
|
|
370
|
-
"blue": [
|
|
371
|
-
0,
|
|
372
|
-
0,
|
|
373
|
-
255
|
|
374
|
-
],
|
|
375
|
-
"blueviolet": [
|
|
376
|
-
138,
|
|
377
|
-
43,
|
|
378
|
-
226
|
|
379
|
-
],
|
|
380
|
-
"brown": [
|
|
381
|
-
165,
|
|
382
|
-
42,
|
|
383
|
-
42
|
|
384
|
-
],
|
|
385
|
-
"burlywood": [
|
|
386
|
-
222,
|
|
387
|
-
184,
|
|
388
|
-
135
|
|
389
|
-
],
|
|
390
|
-
"cadetblue": [
|
|
391
|
-
95,
|
|
392
|
-
158,
|
|
393
|
-
160
|
|
394
|
-
],
|
|
395
|
-
"chartreuse": [
|
|
396
|
-
127,
|
|
397
|
-
255,
|
|
398
|
-
0
|
|
399
|
-
],
|
|
400
|
-
"chocolate": [
|
|
401
|
-
210,
|
|
402
|
-
105,
|
|
403
|
-
30
|
|
404
|
-
],
|
|
405
|
-
"coral": [
|
|
406
|
-
255,
|
|
407
|
-
127,
|
|
408
|
-
80
|
|
409
|
-
],
|
|
410
|
-
"cornflowerblue": [
|
|
411
|
-
100,
|
|
412
|
-
149,
|
|
413
|
-
237
|
|
414
|
-
],
|
|
415
|
-
"cornsilk": [
|
|
416
|
-
255,
|
|
417
|
-
248,
|
|
418
|
-
220
|
|
419
|
-
],
|
|
420
|
-
"crimson": [
|
|
421
|
-
220,
|
|
422
|
-
20,
|
|
423
|
-
60
|
|
424
|
-
],
|
|
425
|
-
"cyan": [
|
|
426
|
-
0,
|
|
427
|
-
255,
|
|
428
|
-
255
|
|
429
|
-
],
|
|
430
|
-
"darkblue": [
|
|
431
|
-
0,
|
|
432
|
-
0,
|
|
433
|
-
139
|
|
434
|
-
],
|
|
435
|
-
"darkcyan": [
|
|
436
|
-
0,
|
|
437
|
-
139,
|
|
438
|
-
139
|
|
439
|
-
],
|
|
440
|
-
"darkgoldenrod": [
|
|
441
|
-
184,
|
|
442
|
-
134,
|
|
443
|
-
11
|
|
444
|
-
],
|
|
445
|
-
"darkgray": [
|
|
446
|
-
169,
|
|
447
|
-
169,
|
|
448
|
-
169
|
|
449
|
-
],
|
|
450
|
-
"darkgreen": [
|
|
451
|
-
0,
|
|
452
|
-
100,
|
|
453
|
-
0
|
|
454
|
-
],
|
|
455
|
-
"darkgrey": [
|
|
456
|
-
169,
|
|
457
|
-
169,
|
|
458
|
-
169
|
|
459
|
-
],
|
|
460
|
-
"darkkhaki": [
|
|
461
|
-
189,
|
|
462
|
-
183,
|
|
463
|
-
107
|
|
464
|
-
],
|
|
465
|
-
"darkmagenta": [
|
|
466
|
-
139,
|
|
467
|
-
0,
|
|
468
|
-
139
|
|
469
|
-
],
|
|
470
|
-
"darkolivegreen": [
|
|
471
|
-
85,
|
|
472
|
-
107,
|
|
473
|
-
47
|
|
474
|
-
],
|
|
475
|
-
"darkorange": [
|
|
476
|
-
255,
|
|
477
|
-
140,
|
|
478
|
-
0
|
|
479
|
-
],
|
|
480
|
-
"darkorchid": [
|
|
481
|
-
153,
|
|
482
|
-
50,
|
|
483
|
-
204
|
|
484
|
-
],
|
|
485
|
-
"darkred": [
|
|
486
|
-
139,
|
|
487
|
-
0,
|
|
488
|
-
0
|
|
489
|
-
],
|
|
490
|
-
"darksalmon": [
|
|
491
|
-
233,
|
|
492
|
-
150,
|
|
493
|
-
122
|
|
494
|
-
],
|
|
495
|
-
"darkseagreen": [
|
|
496
|
-
143,
|
|
497
|
-
188,
|
|
498
|
-
143
|
|
499
|
-
],
|
|
500
|
-
"darkslateblue": [
|
|
501
|
-
72,
|
|
502
|
-
61,
|
|
503
|
-
139
|
|
504
|
-
],
|
|
505
|
-
"darkslategray": [
|
|
506
|
-
47,
|
|
507
|
-
79,
|
|
508
|
-
79
|
|
509
|
-
],
|
|
510
|
-
"darkslategrey": [
|
|
511
|
-
47,
|
|
512
|
-
79,
|
|
513
|
-
79
|
|
514
|
-
],
|
|
515
|
-
"darkturquoise": [
|
|
516
|
-
0,
|
|
517
|
-
206,
|
|
518
|
-
209
|
|
519
|
-
],
|
|
520
|
-
"darkviolet": [
|
|
521
|
-
148,
|
|
522
|
-
0,
|
|
523
|
-
211
|
|
524
|
-
],
|
|
525
|
-
"deeppink": [
|
|
526
|
-
255,
|
|
527
|
-
20,
|
|
528
|
-
147
|
|
529
|
-
],
|
|
530
|
-
"deepskyblue": [
|
|
531
|
-
0,
|
|
532
|
-
191,
|
|
533
|
-
255
|
|
534
|
-
],
|
|
535
|
-
"dimgray": [
|
|
536
|
-
105,
|
|
537
|
-
105,
|
|
538
|
-
105
|
|
539
|
-
],
|
|
540
|
-
"dimgrey": [
|
|
541
|
-
105,
|
|
542
|
-
105,
|
|
543
|
-
105
|
|
544
|
-
],
|
|
545
|
-
"dodgerblue": [
|
|
546
|
-
30,
|
|
547
|
-
144,
|
|
548
|
-
255
|
|
549
|
-
],
|
|
550
|
-
"firebrick": [
|
|
551
|
-
178,
|
|
552
|
-
34,
|
|
553
|
-
34
|
|
554
|
-
],
|
|
555
|
-
"floralwhite": [
|
|
556
|
-
255,
|
|
557
|
-
250,
|
|
558
|
-
240
|
|
559
|
-
],
|
|
560
|
-
"forestgreen": [
|
|
561
|
-
34,
|
|
562
|
-
139,
|
|
563
|
-
34
|
|
564
|
-
],
|
|
565
|
-
"fuchsia": [
|
|
566
|
-
255,
|
|
567
|
-
0,
|
|
568
|
-
255
|
|
569
|
-
],
|
|
570
|
-
"gainsboro": [
|
|
571
|
-
220,
|
|
572
|
-
220,
|
|
573
|
-
220
|
|
574
|
-
],
|
|
575
|
-
"ghostwhite": [
|
|
576
|
-
248,
|
|
577
|
-
248,
|
|
578
|
-
255
|
|
579
|
-
],
|
|
580
|
-
"gold": [
|
|
581
|
-
255,
|
|
582
|
-
215,
|
|
583
|
-
0
|
|
584
|
-
],
|
|
585
|
-
"goldenrod": [
|
|
586
|
-
218,
|
|
587
|
-
165,
|
|
588
|
-
32
|
|
589
|
-
],
|
|
590
|
-
"gray": [
|
|
591
|
-
128,
|
|
592
|
-
128,
|
|
593
|
-
128
|
|
594
|
-
],
|
|
595
|
-
"green": [
|
|
596
|
-
0,
|
|
597
|
-
128,
|
|
598
|
-
0
|
|
599
|
-
],
|
|
600
|
-
"greenyellow": [
|
|
601
|
-
173,
|
|
602
|
-
255,
|
|
603
|
-
47
|
|
604
|
-
],
|
|
605
|
-
"grey": [
|
|
606
|
-
128,
|
|
607
|
-
128,
|
|
608
|
-
128
|
|
609
|
-
],
|
|
610
|
-
"honeydew": [
|
|
611
|
-
240,
|
|
612
|
-
255,
|
|
613
|
-
240
|
|
614
|
-
],
|
|
615
|
-
"hotpink": [
|
|
616
|
-
255,
|
|
617
|
-
105,
|
|
618
|
-
180
|
|
619
|
-
],
|
|
620
|
-
"indianred": [
|
|
621
|
-
205,
|
|
622
|
-
92,
|
|
623
|
-
92
|
|
624
|
-
],
|
|
625
|
-
"indigo": [
|
|
626
|
-
75,
|
|
627
|
-
0,
|
|
628
|
-
130
|
|
629
|
-
],
|
|
630
|
-
"ivory": [
|
|
631
|
-
255,
|
|
632
|
-
255,
|
|
633
|
-
240
|
|
634
|
-
],
|
|
635
|
-
"khaki": [
|
|
636
|
-
240,
|
|
637
|
-
230,
|
|
638
|
-
140
|
|
639
|
-
],
|
|
640
|
-
"lavender": [
|
|
641
|
-
230,
|
|
642
|
-
230,
|
|
643
|
-
250
|
|
644
|
-
],
|
|
645
|
-
"lavenderblush": [
|
|
646
|
-
255,
|
|
647
|
-
240,
|
|
648
|
-
245
|
|
649
|
-
],
|
|
650
|
-
"lawngreen": [
|
|
651
|
-
124,
|
|
652
|
-
252,
|
|
653
|
-
0
|
|
654
|
-
],
|
|
655
|
-
"lemonchiffon": [
|
|
656
|
-
255,
|
|
657
|
-
250,
|
|
658
|
-
205
|
|
659
|
-
],
|
|
660
|
-
"lightblue": [
|
|
661
|
-
173,
|
|
662
|
-
216,
|
|
663
|
-
230
|
|
664
|
-
],
|
|
665
|
-
"lightcoral": [
|
|
666
|
-
240,
|
|
667
|
-
128,
|
|
668
|
-
128
|
|
669
|
-
],
|
|
670
|
-
"lightcyan": [
|
|
671
|
-
224,
|
|
672
|
-
255,
|
|
673
|
-
255
|
|
674
|
-
],
|
|
675
|
-
"lightgoldenrodyellow": [
|
|
676
|
-
250,
|
|
677
|
-
250,
|
|
678
|
-
210
|
|
679
|
-
],
|
|
680
|
-
"lightgray": [
|
|
681
|
-
211,
|
|
682
|
-
211,
|
|
683
|
-
211
|
|
684
|
-
],
|
|
685
|
-
"lightgreen": [
|
|
686
|
-
144,
|
|
687
|
-
238,
|
|
688
|
-
144
|
|
689
|
-
],
|
|
690
|
-
"lightgrey": [
|
|
691
|
-
211,
|
|
692
|
-
211,
|
|
693
|
-
211
|
|
694
|
-
],
|
|
695
|
-
"lightpink": [
|
|
696
|
-
255,
|
|
697
|
-
182,
|
|
698
|
-
193
|
|
699
|
-
],
|
|
700
|
-
"lightsalmon": [
|
|
701
|
-
255,
|
|
702
|
-
160,
|
|
703
|
-
122
|
|
704
|
-
],
|
|
705
|
-
"lightseagreen": [
|
|
706
|
-
32,
|
|
707
|
-
178,
|
|
708
|
-
170
|
|
709
|
-
],
|
|
710
|
-
"lightskyblue": [
|
|
711
|
-
135,
|
|
712
|
-
206,
|
|
713
|
-
250
|
|
714
|
-
],
|
|
715
|
-
"lightslategray": [
|
|
716
|
-
119,
|
|
717
|
-
136,
|
|
718
|
-
153
|
|
719
|
-
],
|
|
720
|
-
"lightslategrey": [
|
|
721
|
-
119,
|
|
722
|
-
136,
|
|
723
|
-
153
|
|
724
|
-
],
|
|
725
|
-
"lightsteelblue": [
|
|
726
|
-
176,
|
|
727
|
-
196,
|
|
728
|
-
222
|
|
729
|
-
],
|
|
730
|
-
"lightyellow": [
|
|
731
|
-
255,
|
|
732
|
-
255,
|
|
733
|
-
224
|
|
734
|
-
],
|
|
735
|
-
"lime": [
|
|
736
|
-
0,
|
|
737
|
-
255,
|
|
738
|
-
0
|
|
739
|
-
],
|
|
740
|
-
"limegreen": [
|
|
741
|
-
50,
|
|
742
|
-
205,
|
|
743
|
-
50
|
|
744
|
-
],
|
|
745
|
-
"linen": [
|
|
746
|
-
250,
|
|
747
|
-
240,
|
|
748
|
-
230
|
|
749
|
-
],
|
|
750
|
-
"magenta": [
|
|
751
|
-
255,
|
|
752
|
-
0,
|
|
753
|
-
255
|
|
754
|
-
],
|
|
755
|
-
"maroon": [
|
|
756
|
-
128,
|
|
757
|
-
0,
|
|
758
|
-
0
|
|
759
|
-
],
|
|
760
|
-
"mediumaquamarine": [
|
|
761
|
-
102,
|
|
762
|
-
205,
|
|
763
|
-
170
|
|
764
|
-
],
|
|
765
|
-
"mediumblue": [
|
|
766
|
-
0,
|
|
767
|
-
0,
|
|
768
|
-
205
|
|
769
|
-
],
|
|
770
|
-
"mediumorchid": [
|
|
771
|
-
186,
|
|
772
|
-
85,
|
|
773
|
-
211
|
|
774
|
-
],
|
|
775
|
-
"mediumpurple": [
|
|
776
|
-
147,
|
|
777
|
-
112,
|
|
778
|
-
219
|
|
779
|
-
],
|
|
780
|
-
"mediumseagreen": [
|
|
781
|
-
60,
|
|
782
|
-
179,
|
|
783
|
-
113
|
|
784
|
-
],
|
|
785
|
-
"mediumslateblue": [
|
|
786
|
-
123,
|
|
787
|
-
104,
|
|
788
|
-
238
|
|
789
|
-
],
|
|
790
|
-
"mediumspringgreen": [
|
|
791
|
-
0,
|
|
792
|
-
250,
|
|
793
|
-
154
|
|
794
|
-
],
|
|
795
|
-
"mediumturquoise": [
|
|
796
|
-
72,
|
|
797
|
-
209,
|
|
798
|
-
204
|
|
799
|
-
],
|
|
800
|
-
"mediumvioletred": [
|
|
801
|
-
199,
|
|
802
|
-
21,
|
|
803
|
-
133
|
|
804
|
-
],
|
|
805
|
-
"midnightblue": [
|
|
806
|
-
25,
|
|
807
|
-
25,
|
|
808
|
-
112
|
|
809
|
-
],
|
|
810
|
-
"mintcream": [
|
|
811
|
-
245,
|
|
812
|
-
255,
|
|
813
|
-
250
|
|
814
|
-
],
|
|
815
|
-
"mistyrose": [
|
|
816
|
-
255,
|
|
817
|
-
228,
|
|
818
|
-
225
|
|
819
|
-
],
|
|
820
|
-
"moccasin": [
|
|
821
|
-
255,
|
|
822
|
-
228,
|
|
823
|
-
181
|
|
824
|
-
],
|
|
825
|
-
"navajowhite": [
|
|
826
|
-
255,
|
|
827
|
-
222,
|
|
828
|
-
173
|
|
829
|
-
],
|
|
830
|
-
"navy": [
|
|
831
|
-
0,
|
|
832
|
-
0,
|
|
833
|
-
128
|
|
834
|
-
],
|
|
835
|
-
"oldlace": [
|
|
836
|
-
253,
|
|
837
|
-
245,
|
|
838
|
-
230
|
|
839
|
-
],
|
|
840
|
-
"olive": [
|
|
841
|
-
128,
|
|
842
|
-
128,
|
|
843
|
-
0
|
|
844
|
-
],
|
|
845
|
-
"olivedrab": [
|
|
846
|
-
107,
|
|
847
|
-
142,
|
|
848
|
-
35
|
|
849
|
-
],
|
|
850
|
-
"orange": [
|
|
851
|
-
255,
|
|
852
|
-
165,
|
|
853
|
-
0
|
|
854
|
-
],
|
|
855
|
-
"orangered": [
|
|
856
|
-
255,
|
|
857
|
-
69,
|
|
858
|
-
0
|
|
859
|
-
],
|
|
860
|
-
"orchid": [
|
|
861
|
-
218,
|
|
862
|
-
112,
|
|
863
|
-
214
|
|
864
|
-
],
|
|
865
|
-
"palegoldenrod": [
|
|
866
|
-
238,
|
|
867
|
-
232,
|
|
868
|
-
170
|
|
869
|
-
],
|
|
870
|
-
"palegreen": [
|
|
871
|
-
152,
|
|
872
|
-
251,
|
|
873
|
-
152
|
|
874
|
-
],
|
|
875
|
-
"paleturquoise": [
|
|
876
|
-
175,
|
|
877
|
-
238,
|
|
878
|
-
238
|
|
879
|
-
],
|
|
880
|
-
"palevioletred": [
|
|
881
|
-
219,
|
|
882
|
-
112,
|
|
883
|
-
147
|
|
884
|
-
],
|
|
885
|
-
"papayawhip": [
|
|
886
|
-
255,
|
|
887
|
-
239,
|
|
888
|
-
213
|
|
889
|
-
],
|
|
890
|
-
"peachpuff": [
|
|
891
|
-
255,
|
|
892
|
-
218,
|
|
893
|
-
185
|
|
894
|
-
],
|
|
895
|
-
"peru": [
|
|
896
|
-
205,
|
|
897
|
-
133,
|
|
898
|
-
63
|
|
899
|
-
],
|
|
900
|
-
"pink": [
|
|
901
|
-
255,
|
|
902
|
-
192,
|
|
903
|
-
203
|
|
904
|
-
],
|
|
905
|
-
"plum": [
|
|
906
|
-
221,
|
|
907
|
-
160,
|
|
908
|
-
221
|
|
909
|
-
],
|
|
910
|
-
"powderblue": [
|
|
911
|
-
176,
|
|
912
|
-
224,
|
|
913
|
-
230
|
|
914
|
-
],
|
|
915
|
-
"purple": [
|
|
916
|
-
128,
|
|
917
|
-
0,
|
|
918
|
-
128
|
|
919
|
-
],
|
|
920
|
-
"rebeccapurple": [
|
|
921
|
-
102,
|
|
922
|
-
51,
|
|
923
|
-
153
|
|
924
|
-
],
|
|
925
|
-
"red": [
|
|
926
|
-
255,
|
|
927
|
-
0,
|
|
928
|
-
0
|
|
929
|
-
],
|
|
930
|
-
"rosybrown": [
|
|
931
|
-
188,
|
|
932
|
-
143,
|
|
933
|
-
143
|
|
934
|
-
],
|
|
935
|
-
"royalblue": [
|
|
936
|
-
65,
|
|
937
|
-
105,
|
|
938
|
-
225
|
|
939
|
-
],
|
|
940
|
-
"saddlebrown": [
|
|
941
|
-
139,
|
|
942
|
-
69,
|
|
943
|
-
19
|
|
944
|
-
],
|
|
945
|
-
"salmon": [
|
|
946
|
-
250,
|
|
947
|
-
128,
|
|
948
|
-
114
|
|
949
|
-
],
|
|
950
|
-
"sandybrown": [
|
|
951
|
-
244,
|
|
952
|
-
164,
|
|
953
|
-
96
|
|
954
|
-
],
|
|
955
|
-
"seagreen": [
|
|
956
|
-
46,
|
|
957
|
-
139,
|
|
958
|
-
87
|
|
959
|
-
],
|
|
960
|
-
"seashell": [
|
|
961
|
-
255,
|
|
962
|
-
245,
|
|
963
|
-
238
|
|
964
|
-
],
|
|
965
|
-
"sienna": [
|
|
966
|
-
160,
|
|
967
|
-
82,
|
|
968
|
-
45
|
|
969
|
-
],
|
|
970
|
-
"silver": [
|
|
971
|
-
192,
|
|
972
|
-
192,
|
|
973
|
-
192
|
|
974
|
-
],
|
|
975
|
-
"skyblue": [
|
|
976
|
-
135,
|
|
977
|
-
206,
|
|
978
|
-
235
|
|
979
|
-
],
|
|
980
|
-
"slateblue": [
|
|
981
|
-
106,
|
|
982
|
-
90,
|
|
983
|
-
205
|
|
984
|
-
],
|
|
985
|
-
"slategray": [
|
|
986
|
-
112,
|
|
987
|
-
128,
|
|
988
|
-
144
|
|
989
|
-
],
|
|
990
|
-
"slategrey": [
|
|
991
|
-
112,
|
|
992
|
-
128,
|
|
993
|
-
144
|
|
994
|
-
],
|
|
995
|
-
"snow": [
|
|
996
|
-
255,
|
|
997
|
-
250,
|
|
998
|
-
250
|
|
999
|
-
],
|
|
1000
|
-
"springgreen": [
|
|
1001
|
-
0,
|
|
1002
|
-
255,
|
|
1003
|
-
127
|
|
1004
|
-
],
|
|
1005
|
-
"steelblue": [
|
|
1006
|
-
70,
|
|
1007
|
-
130,
|
|
1008
|
-
180
|
|
1009
|
-
],
|
|
1010
|
-
"tan": [
|
|
1011
|
-
210,
|
|
1012
|
-
180,
|
|
1013
|
-
140
|
|
1014
|
-
],
|
|
1015
|
-
"teal": [
|
|
1016
|
-
0,
|
|
1017
|
-
128,
|
|
1018
|
-
128
|
|
1019
|
-
],
|
|
1020
|
-
"thistle": [
|
|
1021
|
-
216,
|
|
1022
|
-
191,
|
|
1023
|
-
216
|
|
1024
|
-
],
|
|
1025
|
-
"tomato": [
|
|
1026
|
-
255,
|
|
1027
|
-
99,
|
|
1028
|
-
71
|
|
1029
|
-
],
|
|
1030
|
-
"turquoise": [
|
|
1031
|
-
64,
|
|
1032
|
-
224,
|
|
1033
|
-
208
|
|
1034
|
-
],
|
|
1035
|
-
"violet": [
|
|
1036
|
-
238,
|
|
1037
|
-
130,
|
|
1038
|
-
238
|
|
1039
|
-
],
|
|
1040
|
-
"wheat": [
|
|
1041
|
-
245,
|
|
1042
|
-
222,
|
|
1043
|
-
179
|
|
1044
|
-
],
|
|
1045
|
-
"white": [
|
|
1046
|
-
255,
|
|
1047
|
-
255,
|
|
1048
|
-
255
|
|
1049
|
-
],
|
|
1050
|
-
"whitesmoke": [
|
|
1051
|
-
245,
|
|
1052
|
-
245,
|
|
1053
|
-
245
|
|
1054
|
-
],
|
|
1055
|
-
"yellow": [
|
|
1056
|
-
255,
|
|
1057
|
-
255,
|
|
1058
|
-
0
|
|
1059
|
-
],
|
|
1060
|
-
"yellowgreen": [
|
|
1061
|
-
154,
|
|
1062
|
-
205,
|
|
1063
|
-
50
|
|
1064
|
-
]
|
|
1065
|
-
};
|
|
1066
|
-
}));
|
|
1067
|
-
var require_conversions$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1068
|
-
var cssKeywords = require_color_name$1();
|
|
1069
|
-
var reverseKeywords = {};
|
|
1070
|
-
for (const key of Object.keys(cssKeywords)) reverseKeywords[cssKeywords[key]] = key;
|
|
1071
|
-
var convert = {
|
|
1072
|
-
rgb: {
|
|
1073
|
-
channels: 3,
|
|
1074
|
-
labels: "rgb"
|
|
1075
|
-
},
|
|
1076
|
-
hsl: {
|
|
1077
|
-
channels: 3,
|
|
1078
|
-
labels: "hsl"
|
|
1079
|
-
},
|
|
1080
|
-
hsv: {
|
|
1081
|
-
channels: 3,
|
|
1082
|
-
labels: "hsv"
|
|
1083
|
-
},
|
|
1084
|
-
hwb: {
|
|
1085
|
-
channels: 3,
|
|
1086
|
-
labels: "hwb"
|
|
1087
|
-
},
|
|
1088
|
-
cmyk: {
|
|
1089
|
-
channels: 4,
|
|
1090
|
-
labels: "cmyk"
|
|
1091
|
-
},
|
|
1092
|
-
xyz: {
|
|
1093
|
-
channels: 3,
|
|
1094
|
-
labels: "xyz"
|
|
1095
|
-
},
|
|
1096
|
-
lab: {
|
|
1097
|
-
channels: 3,
|
|
1098
|
-
labels: "lab"
|
|
1099
|
-
},
|
|
1100
|
-
lch: {
|
|
1101
|
-
channels: 3,
|
|
1102
|
-
labels: "lch"
|
|
1103
|
-
},
|
|
1104
|
-
hex: {
|
|
1105
|
-
channels: 1,
|
|
1106
|
-
labels: ["hex"]
|
|
1107
|
-
},
|
|
1108
|
-
keyword: {
|
|
1109
|
-
channels: 1,
|
|
1110
|
-
labels: ["keyword"]
|
|
1111
|
-
},
|
|
1112
|
-
ansi16: {
|
|
1113
|
-
channels: 1,
|
|
1114
|
-
labels: ["ansi16"]
|
|
1115
|
-
},
|
|
1116
|
-
ansi256: {
|
|
1117
|
-
channels: 1,
|
|
1118
|
-
labels: ["ansi256"]
|
|
1119
|
-
},
|
|
1120
|
-
hcg: {
|
|
1121
|
-
channels: 3,
|
|
1122
|
-
labels: [
|
|
1123
|
-
"h",
|
|
1124
|
-
"c",
|
|
1125
|
-
"g"
|
|
1126
|
-
]
|
|
1127
|
-
},
|
|
1128
|
-
apple: {
|
|
1129
|
-
channels: 3,
|
|
1130
|
-
labels: [
|
|
1131
|
-
"r16",
|
|
1132
|
-
"g16",
|
|
1133
|
-
"b16"
|
|
1134
|
-
]
|
|
1135
|
-
},
|
|
1136
|
-
gray: {
|
|
1137
|
-
channels: 1,
|
|
1138
|
-
labels: ["gray"]
|
|
1139
|
-
}
|
|
1140
|
-
};
|
|
1141
|
-
module.exports = convert;
|
|
1142
|
-
for (const model of Object.keys(convert)) {
|
|
1143
|
-
if (!("channels" in convert[model])) throw new Error("missing channels property: " + model);
|
|
1144
|
-
if (!("labels" in convert[model])) throw new Error("missing channel labels property: " + model);
|
|
1145
|
-
if (convert[model].labels.length !== convert[model].channels) throw new Error("channel and label counts mismatch: " + model);
|
|
1146
|
-
const { channels, labels } = convert[model];
|
|
1147
|
-
delete convert[model].channels;
|
|
1148
|
-
delete convert[model].labels;
|
|
1149
|
-
Object.defineProperty(convert[model], "channels", { value: channels });
|
|
1150
|
-
Object.defineProperty(convert[model], "labels", { value: labels });
|
|
1151
|
-
}
|
|
1152
|
-
convert.rgb.hsl = function(rgb) {
|
|
1153
|
-
const r = rgb[0] / 255;
|
|
1154
|
-
const g = rgb[1] / 255;
|
|
1155
|
-
const b = rgb[2] / 255;
|
|
1156
|
-
const min = Math.min(r, g, b);
|
|
1157
|
-
const max = Math.max(r, g, b);
|
|
1158
|
-
const delta = max - min;
|
|
1159
|
-
let h;
|
|
1160
|
-
let s;
|
|
1161
|
-
if (max === min) h = 0;
|
|
1162
|
-
else if (r === max) h = (g - b) / delta;
|
|
1163
|
-
else if (g === max) h = 2 + (b - r) / delta;
|
|
1164
|
-
else if (b === max) h = 4 + (r - g) / delta;
|
|
1165
|
-
h = Math.min(h * 60, 360);
|
|
1166
|
-
if (h < 0) h += 360;
|
|
1167
|
-
const l = (min + max) / 2;
|
|
1168
|
-
if (max === min) s = 0;
|
|
1169
|
-
else if (l <= .5) s = delta / (max + min);
|
|
1170
|
-
else s = delta / (2 - max - min);
|
|
1171
|
-
return [
|
|
1172
|
-
h,
|
|
1173
|
-
s * 100,
|
|
1174
|
-
l * 100
|
|
1175
|
-
];
|
|
1176
|
-
};
|
|
1177
|
-
convert.rgb.hsv = function(rgb) {
|
|
1178
|
-
let rdif;
|
|
1179
|
-
let gdif;
|
|
1180
|
-
let bdif;
|
|
1181
|
-
let h;
|
|
1182
|
-
let s;
|
|
1183
|
-
const r = rgb[0] / 255;
|
|
1184
|
-
const g = rgb[1] / 255;
|
|
1185
|
-
const b = rgb[2] / 255;
|
|
1186
|
-
const v = Math.max(r, g, b);
|
|
1187
|
-
const diff = v - Math.min(r, g, b);
|
|
1188
|
-
const diffc = function(c) {
|
|
1189
|
-
return (v - c) / 6 / diff + 1 / 2;
|
|
1190
|
-
};
|
|
1191
|
-
if (diff === 0) {
|
|
1192
|
-
h = 0;
|
|
1193
|
-
s = 0;
|
|
1194
|
-
} else {
|
|
1195
|
-
s = diff / v;
|
|
1196
|
-
rdif = diffc(r);
|
|
1197
|
-
gdif = diffc(g);
|
|
1198
|
-
bdif = diffc(b);
|
|
1199
|
-
if (r === v) h = bdif - gdif;
|
|
1200
|
-
else if (g === v) h = 1 / 3 + rdif - bdif;
|
|
1201
|
-
else if (b === v) h = 2 / 3 + gdif - rdif;
|
|
1202
|
-
if (h < 0) h += 1;
|
|
1203
|
-
else if (h > 1) h -= 1;
|
|
1204
|
-
}
|
|
1205
|
-
return [
|
|
1206
|
-
h * 360,
|
|
1207
|
-
s * 100,
|
|
1208
|
-
v * 100
|
|
1209
|
-
];
|
|
1210
|
-
};
|
|
1211
|
-
convert.rgb.hwb = function(rgb) {
|
|
1212
|
-
const r = rgb[0];
|
|
1213
|
-
const g = rgb[1];
|
|
1214
|
-
let b = rgb[2];
|
|
1215
|
-
const h = convert.rgb.hsl(rgb)[0];
|
|
1216
|
-
const w = 1 / 255 * Math.min(r, Math.min(g, b));
|
|
1217
|
-
b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
|
|
1218
|
-
return [
|
|
1219
|
-
h,
|
|
1220
|
-
w * 100,
|
|
1221
|
-
b * 100
|
|
1222
|
-
];
|
|
1223
|
-
};
|
|
1224
|
-
convert.rgb.cmyk = function(rgb) {
|
|
1225
|
-
const r = rgb[0] / 255;
|
|
1226
|
-
const g = rgb[1] / 255;
|
|
1227
|
-
const b = rgb[2] / 255;
|
|
1228
|
-
const k = Math.min(1 - r, 1 - g, 1 - b);
|
|
1229
|
-
const c = (1 - r - k) / (1 - k) || 0;
|
|
1230
|
-
const m = (1 - g - k) / (1 - k) || 0;
|
|
1231
|
-
const y = (1 - b - k) / (1 - k) || 0;
|
|
1232
|
-
return [
|
|
1233
|
-
c * 100,
|
|
1234
|
-
m * 100,
|
|
1235
|
-
y * 100,
|
|
1236
|
-
k * 100
|
|
1237
|
-
];
|
|
1238
|
-
};
|
|
1239
|
-
function comparativeDistance(x, y) {
|
|
1240
|
-
return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
|
|
1241
|
-
}
|
|
1242
|
-
convert.rgb.keyword = function(rgb) {
|
|
1243
|
-
const reversed = reverseKeywords[rgb];
|
|
1244
|
-
if (reversed) return reversed;
|
|
1245
|
-
let currentClosestDistance = Infinity;
|
|
1246
|
-
let currentClosestKeyword;
|
|
1247
|
-
for (const keyword of Object.keys(cssKeywords)) {
|
|
1248
|
-
const value = cssKeywords[keyword];
|
|
1249
|
-
const distance = comparativeDistance(rgb, value);
|
|
1250
|
-
if (distance < currentClosestDistance) {
|
|
1251
|
-
currentClosestDistance = distance;
|
|
1252
|
-
currentClosestKeyword = keyword;
|
|
1253
|
-
}
|
|
1254
|
-
}
|
|
1255
|
-
return currentClosestKeyword;
|
|
1256
|
-
};
|
|
1257
|
-
convert.keyword.rgb = function(keyword) {
|
|
1258
|
-
return cssKeywords[keyword];
|
|
1259
|
-
};
|
|
1260
|
-
convert.rgb.xyz = function(rgb) {
|
|
1261
|
-
let r = rgb[0] / 255;
|
|
1262
|
-
let g = rgb[1] / 255;
|
|
1263
|
-
let b = rgb[2] / 255;
|
|
1264
|
-
r = r > .04045 ? ((r + .055) / 1.055) ** 2.4 : r / 12.92;
|
|
1265
|
-
g = g > .04045 ? ((g + .055) / 1.055) ** 2.4 : g / 12.92;
|
|
1266
|
-
b = b > .04045 ? ((b + .055) / 1.055) ** 2.4 : b / 12.92;
|
|
1267
|
-
const x = r * .4124 + g * .3576 + b * .1805;
|
|
1268
|
-
const y = r * .2126 + g * .7152 + b * .0722;
|
|
1269
|
-
const z = r * .0193 + g * .1192 + b * .9505;
|
|
1270
|
-
return [
|
|
1271
|
-
x * 100,
|
|
1272
|
-
y * 100,
|
|
1273
|
-
z * 100
|
|
1274
|
-
];
|
|
1275
|
-
};
|
|
1276
|
-
convert.rgb.lab = function(rgb) {
|
|
1277
|
-
const xyz = convert.rgb.xyz(rgb);
|
|
1278
|
-
let x = xyz[0];
|
|
1279
|
-
let y = xyz[1];
|
|
1280
|
-
let z = xyz[2];
|
|
1281
|
-
x /= 95.047;
|
|
1282
|
-
y /= 100;
|
|
1283
|
-
z /= 108.883;
|
|
1284
|
-
x = x > .008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
1285
|
-
y = y > .008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
1286
|
-
z = z > .008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
1287
|
-
return [
|
|
1288
|
-
116 * y - 16,
|
|
1289
|
-
500 * (x - y),
|
|
1290
|
-
200 * (y - z)
|
|
1291
|
-
];
|
|
1292
|
-
};
|
|
1293
|
-
convert.hsl.rgb = function(hsl) {
|
|
1294
|
-
const h = hsl[0] / 360;
|
|
1295
|
-
const s = hsl[1] / 100;
|
|
1296
|
-
const l = hsl[2] / 100;
|
|
1297
|
-
let t2;
|
|
1298
|
-
let t3;
|
|
1299
|
-
let val;
|
|
1300
|
-
if (s === 0) {
|
|
1301
|
-
val = l * 255;
|
|
1302
|
-
return [
|
|
1303
|
-
val,
|
|
1304
|
-
val,
|
|
1305
|
-
val
|
|
1306
|
-
];
|
|
1307
|
-
}
|
|
1308
|
-
if (l < .5) t2 = l * (1 + s);
|
|
1309
|
-
else t2 = l + s - l * s;
|
|
1310
|
-
const t1 = 2 * l - t2;
|
|
1311
|
-
const rgb = [
|
|
1312
|
-
0,
|
|
1313
|
-
0,
|
|
1314
|
-
0
|
|
1315
|
-
];
|
|
1316
|
-
for (let i = 0; i < 3; i++) {
|
|
1317
|
-
t3 = h + 1 / 3 * -(i - 1);
|
|
1318
|
-
if (t3 < 0) t3++;
|
|
1319
|
-
if (t3 > 1) t3--;
|
|
1320
|
-
if (6 * t3 < 1) val = t1 + (t2 - t1) * 6 * t3;
|
|
1321
|
-
else if (2 * t3 < 1) val = t2;
|
|
1322
|
-
else if (3 * t3 < 2) val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
|
1323
|
-
else val = t1;
|
|
1324
|
-
rgb[i] = val * 255;
|
|
1325
|
-
}
|
|
1326
|
-
return rgb;
|
|
1327
|
-
};
|
|
1328
|
-
convert.hsl.hsv = function(hsl) {
|
|
1329
|
-
const h = hsl[0];
|
|
1330
|
-
let s = hsl[1] / 100;
|
|
1331
|
-
let l = hsl[2] / 100;
|
|
1332
|
-
let smin = s;
|
|
1333
|
-
const lmin = Math.max(l, .01);
|
|
1334
|
-
l *= 2;
|
|
1335
|
-
s *= l <= 1 ? l : 2 - l;
|
|
1336
|
-
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
1337
|
-
const v = (l + s) / 2;
|
|
1338
|
-
return [
|
|
1339
|
-
h,
|
|
1340
|
-
(l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s)) * 100,
|
|
1341
|
-
v * 100
|
|
1342
|
-
];
|
|
1343
|
-
};
|
|
1344
|
-
convert.hsv.rgb = function(hsv) {
|
|
1345
|
-
const h = hsv[0] / 60;
|
|
1346
|
-
const s = hsv[1] / 100;
|
|
1347
|
-
let v = hsv[2] / 100;
|
|
1348
|
-
const hi = Math.floor(h) % 6;
|
|
1349
|
-
const f = h - Math.floor(h);
|
|
1350
|
-
const p = 255 * v * (1 - s);
|
|
1351
|
-
const q = 255 * v * (1 - s * f);
|
|
1352
|
-
const t = 255 * v * (1 - s * (1 - f));
|
|
1353
|
-
v *= 255;
|
|
1354
|
-
switch (hi) {
|
|
1355
|
-
case 0: return [
|
|
1356
|
-
v,
|
|
1357
|
-
t,
|
|
1358
|
-
p
|
|
1359
|
-
];
|
|
1360
|
-
case 1: return [
|
|
1361
|
-
q,
|
|
1362
|
-
v,
|
|
1363
|
-
p
|
|
1364
|
-
];
|
|
1365
|
-
case 2: return [
|
|
1366
|
-
p,
|
|
1367
|
-
v,
|
|
1368
|
-
t
|
|
1369
|
-
];
|
|
1370
|
-
case 3: return [
|
|
1371
|
-
p,
|
|
1372
|
-
q,
|
|
1373
|
-
v
|
|
1374
|
-
];
|
|
1375
|
-
case 4: return [
|
|
1376
|
-
t,
|
|
1377
|
-
p,
|
|
1378
|
-
v
|
|
1379
|
-
];
|
|
1380
|
-
case 5: return [
|
|
1381
|
-
v,
|
|
1382
|
-
p,
|
|
1383
|
-
q
|
|
1384
|
-
];
|
|
1385
|
-
}
|
|
1386
|
-
};
|
|
1387
|
-
convert.hsv.hsl = function(hsv) {
|
|
1388
|
-
const h = hsv[0];
|
|
1389
|
-
const s = hsv[1] / 100;
|
|
1390
|
-
const v = hsv[2] / 100;
|
|
1391
|
-
const vmin = Math.max(v, .01);
|
|
1392
|
-
let sl;
|
|
1393
|
-
let l;
|
|
1394
|
-
l = (2 - s) * v;
|
|
1395
|
-
const lmin = (2 - s) * vmin;
|
|
1396
|
-
sl = s * vmin;
|
|
1397
|
-
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
1398
|
-
sl = sl || 0;
|
|
1399
|
-
l /= 2;
|
|
1400
|
-
return [
|
|
1401
|
-
h,
|
|
1402
|
-
sl * 100,
|
|
1403
|
-
l * 100
|
|
1404
|
-
];
|
|
1405
|
-
};
|
|
1406
|
-
convert.hwb.rgb = function(hwb) {
|
|
1407
|
-
const h = hwb[0] / 360;
|
|
1408
|
-
let wh = hwb[1] / 100;
|
|
1409
|
-
let bl = hwb[2] / 100;
|
|
1410
|
-
const ratio = wh + bl;
|
|
1411
|
-
let f;
|
|
1412
|
-
if (ratio > 1) {
|
|
1413
|
-
wh /= ratio;
|
|
1414
|
-
bl /= ratio;
|
|
1415
|
-
}
|
|
1416
|
-
const i = Math.floor(6 * h);
|
|
1417
|
-
const v = 1 - bl;
|
|
1418
|
-
f = 6 * h - i;
|
|
1419
|
-
if ((i & 1) !== 0) f = 1 - f;
|
|
1420
|
-
const n = wh + f * (v - wh);
|
|
1421
|
-
let r;
|
|
1422
|
-
let g;
|
|
1423
|
-
let b;
|
|
1424
|
-
switch (i) {
|
|
1425
|
-
default:
|
|
1426
|
-
case 6:
|
|
1427
|
-
case 0:
|
|
1428
|
-
r = v;
|
|
1429
|
-
g = n;
|
|
1430
|
-
b = wh;
|
|
1431
|
-
break;
|
|
1432
|
-
case 1:
|
|
1433
|
-
r = n;
|
|
1434
|
-
g = v;
|
|
1435
|
-
b = wh;
|
|
1436
|
-
break;
|
|
1437
|
-
case 2:
|
|
1438
|
-
r = wh;
|
|
1439
|
-
g = v;
|
|
1440
|
-
b = n;
|
|
1441
|
-
break;
|
|
1442
|
-
case 3:
|
|
1443
|
-
r = wh;
|
|
1444
|
-
g = n;
|
|
1445
|
-
b = v;
|
|
1446
|
-
break;
|
|
1447
|
-
case 4:
|
|
1448
|
-
r = n;
|
|
1449
|
-
g = wh;
|
|
1450
|
-
b = v;
|
|
1451
|
-
break;
|
|
1452
|
-
case 5:
|
|
1453
|
-
r = v;
|
|
1454
|
-
g = wh;
|
|
1455
|
-
b = n;
|
|
1456
|
-
break;
|
|
1457
|
-
}
|
|
1458
|
-
return [
|
|
1459
|
-
r * 255,
|
|
1460
|
-
g * 255,
|
|
1461
|
-
b * 255
|
|
1462
|
-
];
|
|
1463
|
-
};
|
|
1464
|
-
convert.cmyk.rgb = function(cmyk) {
|
|
1465
|
-
const c = cmyk[0] / 100;
|
|
1466
|
-
const m = cmyk[1] / 100;
|
|
1467
|
-
const y = cmyk[2] / 100;
|
|
1468
|
-
const k = cmyk[3] / 100;
|
|
1469
|
-
const r = 1 - Math.min(1, c * (1 - k) + k);
|
|
1470
|
-
const g = 1 - Math.min(1, m * (1 - k) + k);
|
|
1471
|
-
const b = 1 - Math.min(1, y * (1 - k) + k);
|
|
1472
|
-
return [
|
|
1473
|
-
r * 255,
|
|
1474
|
-
g * 255,
|
|
1475
|
-
b * 255
|
|
1476
|
-
];
|
|
1477
|
-
};
|
|
1478
|
-
convert.xyz.rgb = function(xyz) {
|
|
1479
|
-
const x = xyz[0] / 100;
|
|
1480
|
-
const y = xyz[1] / 100;
|
|
1481
|
-
const z = xyz[2] / 100;
|
|
1482
|
-
let r;
|
|
1483
|
-
let g;
|
|
1484
|
-
let b;
|
|
1485
|
-
r = x * 3.2406 + y * -1.5372 + z * -.4986;
|
|
1486
|
-
g = x * -.9689 + y * 1.8758 + z * .0415;
|
|
1487
|
-
b = x * .0557 + y * -.204 + z * 1.057;
|
|
1488
|
-
r = r > .0031308 ? 1.055 * r ** (1 / 2.4) - .055 : r * 12.92;
|
|
1489
|
-
g = g > .0031308 ? 1.055 * g ** (1 / 2.4) - .055 : g * 12.92;
|
|
1490
|
-
b = b > .0031308 ? 1.055 * b ** (1 / 2.4) - .055 : b * 12.92;
|
|
1491
|
-
r = Math.min(Math.max(0, r), 1);
|
|
1492
|
-
g = Math.min(Math.max(0, g), 1);
|
|
1493
|
-
b = Math.min(Math.max(0, b), 1);
|
|
1494
|
-
return [
|
|
1495
|
-
r * 255,
|
|
1496
|
-
g * 255,
|
|
1497
|
-
b * 255
|
|
1498
|
-
];
|
|
1499
|
-
};
|
|
1500
|
-
convert.xyz.lab = function(xyz) {
|
|
1501
|
-
let x = xyz[0];
|
|
1502
|
-
let y = xyz[1];
|
|
1503
|
-
let z = xyz[2];
|
|
1504
|
-
x /= 95.047;
|
|
1505
|
-
y /= 100;
|
|
1506
|
-
z /= 108.883;
|
|
1507
|
-
x = x > .008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
1508
|
-
y = y > .008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
1509
|
-
z = z > .008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
1510
|
-
return [
|
|
1511
|
-
116 * y - 16,
|
|
1512
|
-
500 * (x - y),
|
|
1513
|
-
200 * (y - z)
|
|
1514
|
-
];
|
|
1515
|
-
};
|
|
1516
|
-
convert.lab.xyz = function(lab) {
|
|
1517
|
-
const l = lab[0];
|
|
1518
|
-
const a = lab[1];
|
|
1519
|
-
const b = lab[2];
|
|
1520
|
-
let x;
|
|
1521
|
-
let y;
|
|
1522
|
-
let z;
|
|
1523
|
-
y = (l + 16) / 116;
|
|
1524
|
-
x = a / 500 + y;
|
|
1525
|
-
z = y - b / 200;
|
|
1526
|
-
const y2 = y ** 3;
|
|
1527
|
-
const x2 = x ** 3;
|
|
1528
|
-
const z2 = z ** 3;
|
|
1529
|
-
y = y2 > .008856 ? y2 : (y - 16 / 116) / 7.787;
|
|
1530
|
-
x = x2 > .008856 ? x2 : (x - 16 / 116) / 7.787;
|
|
1531
|
-
z = z2 > .008856 ? z2 : (z - 16 / 116) / 7.787;
|
|
1532
|
-
x *= 95.047;
|
|
1533
|
-
y *= 100;
|
|
1534
|
-
z *= 108.883;
|
|
1535
|
-
return [
|
|
1536
|
-
x,
|
|
1537
|
-
y,
|
|
1538
|
-
z
|
|
1539
|
-
];
|
|
1540
|
-
};
|
|
1541
|
-
convert.lab.lch = function(lab) {
|
|
1542
|
-
const l = lab[0];
|
|
1543
|
-
const a = lab[1];
|
|
1544
|
-
const b = lab[2];
|
|
1545
|
-
let h;
|
|
1546
|
-
h = Math.atan2(b, a) * 360 / 2 / Math.PI;
|
|
1547
|
-
if (h < 0) h += 360;
|
|
1548
|
-
return [
|
|
1549
|
-
l,
|
|
1550
|
-
Math.sqrt(a * a + b * b),
|
|
1551
|
-
h
|
|
1552
|
-
];
|
|
1553
|
-
};
|
|
1554
|
-
convert.lch.lab = function(lch) {
|
|
1555
|
-
const l = lch[0];
|
|
1556
|
-
const c = lch[1];
|
|
1557
|
-
const hr = lch[2] / 360 * 2 * Math.PI;
|
|
1558
|
-
return [
|
|
1559
|
-
l,
|
|
1560
|
-
c * Math.cos(hr),
|
|
1561
|
-
c * Math.sin(hr)
|
|
1562
|
-
];
|
|
1563
|
-
};
|
|
1564
|
-
convert.rgb.ansi16 = function(args, saturation = null) {
|
|
1565
|
-
const [r, g, b] = args;
|
|
1566
|
-
let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
|
|
1567
|
-
value = Math.round(value / 50);
|
|
1568
|
-
if (value === 0) return 30;
|
|
1569
|
-
let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
|
|
1570
|
-
if (value === 2) ansi += 60;
|
|
1571
|
-
return ansi;
|
|
1572
|
-
};
|
|
1573
|
-
convert.hsv.ansi16 = function(args) {
|
|
1574
|
-
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
|
1575
|
-
};
|
|
1576
|
-
convert.rgb.ansi256 = function(args) {
|
|
1577
|
-
const r = args[0];
|
|
1578
|
-
const g = args[1];
|
|
1579
|
-
const b = args[2];
|
|
1580
|
-
if (r === g && g === b) {
|
|
1581
|
-
if (r < 8) return 16;
|
|
1582
|
-
if (r > 248) return 231;
|
|
1583
|
-
return Math.round((r - 8) / 247 * 24) + 232;
|
|
1584
|
-
}
|
|
1585
|
-
return 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
|
|
1586
|
-
};
|
|
1587
|
-
convert.ansi16.rgb = function(args) {
|
|
1588
|
-
let color = args % 10;
|
|
1589
|
-
if (color === 0 || color === 7) {
|
|
1590
|
-
if (args > 50) color += 3.5;
|
|
1591
|
-
color = color / 10.5 * 255;
|
|
1592
|
-
return [
|
|
1593
|
-
color,
|
|
1594
|
-
color,
|
|
1595
|
-
color
|
|
1596
|
-
];
|
|
1597
|
-
}
|
|
1598
|
-
const mult = (~~(args > 50) + 1) * .5;
|
|
1599
|
-
return [
|
|
1600
|
-
(color & 1) * mult * 255,
|
|
1601
|
-
(color >> 1 & 1) * mult * 255,
|
|
1602
|
-
(color >> 2 & 1) * mult * 255
|
|
1603
|
-
];
|
|
1604
|
-
};
|
|
1605
|
-
convert.ansi256.rgb = function(args) {
|
|
1606
|
-
if (args >= 232) {
|
|
1607
|
-
const c = (args - 232) * 10 + 8;
|
|
1608
|
-
return [
|
|
1609
|
-
c,
|
|
1610
|
-
c,
|
|
1611
|
-
c
|
|
1612
|
-
];
|
|
1613
|
-
}
|
|
1614
|
-
args -= 16;
|
|
1615
|
-
let rem;
|
|
1616
|
-
return [
|
|
1617
|
-
Math.floor(args / 36) / 5 * 255,
|
|
1618
|
-
Math.floor((rem = args % 36) / 6) / 5 * 255,
|
|
1619
|
-
rem % 6 / 5 * 255
|
|
1620
|
-
];
|
|
1621
|
-
};
|
|
1622
|
-
convert.rgb.hex = function(args) {
|
|
1623
|
-
const string = (((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255)).toString(16).toUpperCase();
|
|
1624
|
-
return "000000".substring(string.length) + string;
|
|
1625
|
-
};
|
|
1626
|
-
convert.hex.rgb = function(args) {
|
|
1627
|
-
const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
1628
|
-
if (!match) return [
|
|
1629
|
-
0,
|
|
1630
|
-
0,
|
|
1631
|
-
0
|
|
1632
|
-
];
|
|
1633
|
-
let colorString = match[0];
|
|
1634
|
-
if (match[0].length === 3) colorString = colorString.split("").map((char) => {
|
|
1635
|
-
return char + char;
|
|
1636
|
-
}).join("");
|
|
1637
|
-
const integer = parseInt(colorString, 16);
|
|
1638
|
-
return [
|
|
1639
|
-
integer >> 16 & 255,
|
|
1640
|
-
integer >> 8 & 255,
|
|
1641
|
-
integer & 255
|
|
1642
|
-
];
|
|
1643
|
-
};
|
|
1644
|
-
convert.rgb.hcg = function(rgb) {
|
|
1645
|
-
const r = rgb[0] / 255;
|
|
1646
|
-
const g = rgb[1] / 255;
|
|
1647
|
-
const b = rgb[2] / 255;
|
|
1648
|
-
const max = Math.max(Math.max(r, g), b);
|
|
1649
|
-
const min = Math.min(Math.min(r, g), b);
|
|
1650
|
-
const chroma = max - min;
|
|
1651
|
-
let grayscale;
|
|
1652
|
-
let hue;
|
|
1653
|
-
if (chroma < 1) grayscale = min / (1 - chroma);
|
|
1654
|
-
else grayscale = 0;
|
|
1655
|
-
if (chroma <= 0) hue = 0;
|
|
1656
|
-
else if (max === r) hue = (g - b) / chroma % 6;
|
|
1657
|
-
else if (max === g) hue = 2 + (b - r) / chroma;
|
|
1658
|
-
else hue = 4 + (r - g) / chroma;
|
|
1659
|
-
hue /= 6;
|
|
1660
|
-
hue %= 1;
|
|
1661
|
-
return [
|
|
1662
|
-
hue * 360,
|
|
1663
|
-
chroma * 100,
|
|
1664
|
-
grayscale * 100
|
|
1665
|
-
];
|
|
1666
|
-
};
|
|
1667
|
-
convert.hsl.hcg = function(hsl) {
|
|
1668
|
-
const s = hsl[1] / 100;
|
|
1669
|
-
const l = hsl[2] / 100;
|
|
1670
|
-
const c = l < .5 ? 2 * s * l : 2 * s * (1 - l);
|
|
1671
|
-
let f = 0;
|
|
1672
|
-
if (c < 1) f = (l - .5 * c) / (1 - c);
|
|
1673
|
-
return [
|
|
1674
|
-
hsl[0],
|
|
1675
|
-
c * 100,
|
|
1676
|
-
f * 100
|
|
1677
|
-
];
|
|
1678
|
-
};
|
|
1679
|
-
convert.hsv.hcg = function(hsv) {
|
|
1680
|
-
const s = hsv[1] / 100;
|
|
1681
|
-
const v = hsv[2] / 100;
|
|
1682
|
-
const c = s * v;
|
|
1683
|
-
let f = 0;
|
|
1684
|
-
if (c < 1) f = (v - c) / (1 - c);
|
|
1685
|
-
return [
|
|
1686
|
-
hsv[0],
|
|
1687
|
-
c * 100,
|
|
1688
|
-
f * 100
|
|
1689
|
-
];
|
|
1690
|
-
};
|
|
1691
|
-
convert.hcg.rgb = function(hcg) {
|
|
1692
|
-
const h = hcg[0] / 360;
|
|
1693
|
-
const c = hcg[1] / 100;
|
|
1694
|
-
const g = hcg[2] / 100;
|
|
1695
|
-
if (c === 0) return [
|
|
1696
|
-
g * 255,
|
|
1697
|
-
g * 255,
|
|
1698
|
-
g * 255
|
|
1699
|
-
];
|
|
1700
|
-
const pure = [
|
|
1701
|
-
0,
|
|
1702
|
-
0,
|
|
1703
|
-
0
|
|
1704
|
-
];
|
|
1705
|
-
const hi = h % 1 * 6;
|
|
1706
|
-
const v = hi % 1;
|
|
1707
|
-
const w = 1 - v;
|
|
1708
|
-
let mg = 0;
|
|
1709
|
-
switch (Math.floor(hi)) {
|
|
1710
|
-
case 0:
|
|
1711
|
-
pure[0] = 1;
|
|
1712
|
-
pure[1] = v;
|
|
1713
|
-
pure[2] = 0;
|
|
1714
|
-
break;
|
|
1715
|
-
case 1:
|
|
1716
|
-
pure[0] = w;
|
|
1717
|
-
pure[1] = 1;
|
|
1718
|
-
pure[2] = 0;
|
|
1719
|
-
break;
|
|
1720
|
-
case 2:
|
|
1721
|
-
pure[0] = 0;
|
|
1722
|
-
pure[1] = 1;
|
|
1723
|
-
pure[2] = v;
|
|
1724
|
-
break;
|
|
1725
|
-
case 3:
|
|
1726
|
-
pure[0] = 0;
|
|
1727
|
-
pure[1] = w;
|
|
1728
|
-
pure[2] = 1;
|
|
1729
|
-
break;
|
|
1730
|
-
case 4:
|
|
1731
|
-
pure[0] = v;
|
|
1732
|
-
pure[1] = 0;
|
|
1733
|
-
pure[2] = 1;
|
|
1734
|
-
break;
|
|
1735
|
-
default:
|
|
1736
|
-
pure[0] = 1;
|
|
1737
|
-
pure[1] = 0;
|
|
1738
|
-
pure[2] = w;
|
|
1739
|
-
}
|
|
1740
|
-
mg = (1 - c) * g;
|
|
1741
|
-
return [
|
|
1742
|
-
(c * pure[0] + mg) * 255,
|
|
1743
|
-
(c * pure[1] + mg) * 255,
|
|
1744
|
-
(c * pure[2] + mg) * 255
|
|
1745
|
-
];
|
|
1746
|
-
};
|
|
1747
|
-
convert.hcg.hsv = function(hcg) {
|
|
1748
|
-
const c = hcg[1] / 100;
|
|
1749
|
-
const v = c + hcg[2] / 100 * (1 - c);
|
|
1750
|
-
let f = 0;
|
|
1751
|
-
if (v > 0) f = c / v;
|
|
1752
|
-
return [
|
|
1753
|
-
hcg[0],
|
|
1754
|
-
f * 100,
|
|
1755
|
-
v * 100
|
|
1756
|
-
];
|
|
1757
|
-
};
|
|
1758
|
-
convert.hcg.hsl = function(hcg) {
|
|
1759
|
-
const c = hcg[1] / 100;
|
|
1760
|
-
const l = hcg[2] / 100 * (1 - c) + .5 * c;
|
|
1761
|
-
let s = 0;
|
|
1762
|
-
if (l > 0 && l < .5) s = c / (2 * l);
|
|
1763
|
-
else if (l >= .5 && l < 1) s = c / (2 * (1 - l));
|
|
1764
|
-
return [
|
|
1765
|
-
hcg[0],
|
|
1766
|
-
s * 100,
|
|
1767
|
-
l * 100
|
|
1768
|
-
];
|
|
1769
|
-
};
|
|
1770
|
-
convert.hcg.hwb = function(hcg) {
|
|
1771
|
-
const c = hcg[1] / 100;
|
|
1772
|
-
const v = c + hcg[2] / 100 * (1 - c);
|
|
1773
|
-
return [
|
|
1774
|
-
hcg[0],
|
|
1775
|
-
(v - c) * 100,
|
|
1776
|
-
(1 - v) * 100
|
|
1777
|
-
];
|
|
1778
|
-
};
|
|
1779
|
-
convert.hwb.hcg = function(hwb) {
|
|
1780
|
-
const w = hwb[1] / 100;
|
|
1781
|
-
const v = 1 - hwb[2] / 100;
|
|
1782
|
-
const c = v - w;
|
|
1783
|
-
let g = 0;
|
|
1784
|
-
if (c < 1) g = (v - c) / (1 - c);
|
|
1785
|
-
return [
|
|
1786
|
-
hwb[0],
|
|
1787
|
-
c * 100,
|
|
1788
|
-
g * 100
|
|
1789
|
-
];
|
|
1790
|
-
};
|
|
1791
|
-
convert.apple.rgb = function(apple) {
|
|
1792
|
-
return [
|
|
1793
|
-
apple[0] / 65535 * 255,
|
|
1794
|
-
apple[1] / 65535 * 255,
|
|
1795
|
-
apple[2] / 65535 * 255
|
|
1796
|
-
];
|
|
1797
|
-
};
|
|
1798
|
-
convert.rgb.apple = function(rgb) {
|
|
1799
|
-
return [
|
|
1800
|
-
rgb[0] / 255 * 65535,
|
|
1801
|
-
rgb[1] / 255 * 65535,
|
|
1802
|
-
rgb[2] / 255 * 65535
|
|
1803
|
-
];
|
|
1804
|
-
};
|
|
1805
|
-
convert.gray.rgb = function(args) {
|
|
1806
|
-
return [
|
|
1807
|
-
args[0] / 100 * 255,
|
|
1808
|
-
args[0] / 100 * 255,
|
|
1809
|
-
args[0] / 100 * 255
|
|
1810
|
-
];
|
|
1811
|
-
};
|
|
1812
|
-
convert.gray.hsl = function(args) {
|
|
1813
|
-
return [
|
|
1814
|
-
0,
|
|
1815
|
-
0,
|
|
1816
|
-
args[0]
|
|
1817
|
-
];
|
|
1818
|
-
};
|
|
1819
|
-
convert.gray.hsv = convert.gray.hsl;
|
|
1820
|
-
convert.gray.hwb = function(gray) {
|
|
1821
|
-
return [
|
|
1822
|
-
0,
|
|
1823
|
-
100,
|
|
1824
|
-
gray[0]
|
|
1825
|
-
];
|
|
1826
|
-
};
|
|
1827
|
-
convert.gray.cmyk = function(gray) {
|
|
1828
|
-
return [
|
|
1829
|
-
0,
|
|
1830
|
-
0,
|
|
1831
|
-
0,
|
|
1832
|
-
gray[0]
|
|
1833
|
-
];
|
|
1834
|
-
};
|
|
1835
|
-
convert.gray.lab = function(gray) {
|
|
1836
|
-
return [
|
|
1837
|
-
gray[0],
|
|
1838
|
-
0,
|
|
1839
|
-
0
|
|
1840
|
-
];
|
|
1841
|
-
};
|
|
1842
|
-
convert.gray.hex = function(gray) {
|
|
1843
|
-
const val = Math.round(gray[0] / 100 * 255) & 255;
|
|
1844
|
-
const string = ((val << 16) + (val << 8) + val).toString(16).toUpperCase();
|
|
1845
|
-
return "000000".substring(string.length) + string;
|
|
1846
|
-
};
|
|
1847
|
-
convert.rgb.gray = function(rgb) {
|
|
1848
|
-
return [(rgb[0] + rgb[1] + rgb[2]) / 3 / 255 * 100];
|
|
1849
|
-
};
|
|
1850
|
-
}));
|
|
1851
|
-
var require_route$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1852
|
-
var conversions = require_conversions$1();
|
|
1853
|
-
function buildGraph() {
|
|
1854
|
-
const graph = {};
|
|
1855
|
-
const models = Object.keys(conversions);
|
|
1856
|
-
for (let len = models.length, i = 0; i < len; i++) graph[models[i]] = {
|
|
1857
|
-
distance: -1,
|
|
1858
|
-
parent: null
|
|
1859
|
-
};
|
|
1860
|
-
return graph;
|
|
1861
|
-
}
|
|
1862
|
-
function deriveBFS(fromModel) {
|
|
1863
|
-
const graph = buildGraph();
|
|
1864
|
-
const queue = [fromModel];
|
|
1865
|
-
graph[fromModel].distance = 0;
|
|
1866
|
-
while (queue.length) {
|
|
1867
|
-
const current = queue.pop();
|
|
1868
|
-
const adjacents = Object.keys(conversions[current]);
|
|
1869
|
-
for (let len = adjacents.length, i = 0; i < len; i++) {
|
|
1870
|
-
const adjacent = adjacents[i];
|
|
1871
|
-
const node = graph[adjacent];
|
|
1872
|
-
if (node.distance === -1) {
|
|
1873
|
-
node.distance = graph[current].distance + 1;
|
|
1874
|
-
node.parent = current;
|
|
1875
|
-
queue.unshift(adjacent);
|
|
1876
|
-
}
|
|
1877
|
-
}
|
|
1878
|
-
}
|
|
1879
|
-
return graph;
|
|
1880
|
-
}
|
|
1881
|
-
function link(from, to) {
|
|
1882
|
-
return function(args) {
|
|
1883
|
-
return to(from(args));
|
|
1884
|
-
};
|
|
1885
|
-
}
|
|
1886
|
-
function wrapConversion(toModel, graph) {
|
|
1887
|
-
const path = [graph[toModel].parent, toModel];
|
|
1888
|
-
let fn = conversions[graph[toModel].parent][toModel];
|
|
1889
|
-
let cur = graph[toModel].parent;
|
|
1890
|
-
while (graph[cur].parent) {
|
|
1891
|
-
path.unshift(graph[cur].parent);
|
|
1892
|
-
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
1893
|
-
cur = graph[cur].parent;
|
|
1894
|
-
}
|
|
1895
|
-
fn.conversion = path;
|
|
1896
|
-
return fn;
|
|
1897
|
-
}
|
|
1898
|
-
module.exports = function(fromModel) {
|
|
1899
|
-
const graph = deriveBFS(fromModel);
|
|
1900
|
-
const conversion = {};
|
|
1901
|
-
const models = Object.keys(graph);
|
|
1902
|
-
for (let len = models.length, i = 0; i < len; i++) {
|
|
1903
|
-
const toModel = models[i];
|
|
1904
|
-
if (graph[toModel].parent === null) continue;
|
|
1905
|
-
conversion[toModel] = wrapConversion(toModel, graph);
|
|
359
|
+
Object.keys(styles$1$1.modifier);
|
|
360
|
+
var foregroundColorNames$1 = Object.keys(styles$1$1.color);
|
|
361
|
+
var backgroundColorNames$1 = Object.keys(styles$1$1.bgColor);
|
|
362
|
+
[...foregroundColorNames$1, ...backgroundColorNames$1];
|
|
363
|
+
function assembleStyles$1() {
|
|
364
|
+
const codes = /* @__PURE__ */ new Map();
|
|
365
|
+
for (const [groupName, group] of Object.entries(styles$1$1)) {
|
|
366
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
367
|
+
styles$1$1[styleName] = {
|
|
368
|
+
open: `\u001B[${style[0]}m`,
|
|
369
|
+
close: `\u001B[${style[1]}m`
|
|
370
|
+
};
|
|
371
|
+
group[styleName] = styles$1$1[styleName];
|
|
372
|
+
codes.set(style[0], style[1]);
|
|
1906
373
|
}
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
var require_color_convert$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1911
|
-
var conversions = require_conversions$1();
|
|
1912
|
-
var route = require_route$1();
|
|
1913
|
-
var convert = {};
|
|
1914
|
-
var models = Object.keys(conversions);
|
|
1915
|
-
function wrapRaw(fn) {
|
|
1916
|
-
const wrappedFn = function(...args) {
|
|
1917
|
-
const arg0 = args[0];
|
|
1918
|
-
if (arg0 === void 0 || arg0 === null) return arg0;
|
|
1919
|
-
if (arg0.length > 1) args = arg0;
|
|
1920
|
-
return fn(args);
|
|
1921
|
-
};
|
|
1922
|
-
if ("conversion" in fn) wrappedFn.conversion = fn.conversion;
|
|
1923
|
-
return wrappedFn;
|
|
1924
|
-
}
|
|
1925
|
-
function wrapRounded(fn) {
|
|
1926
|
-
const wrappedFn = function(...args) {
|
|
1927
|
-
const arg0 = args[0];
|
|
1928
|
-
if (arg0 === void 0 || arg0 === null) return arg0;
|
|
1929
|
-
if (arg0.length > 1) args = arg0;
|
|
1930
|
-
const result = fn(args);
|
|
1931
|
-
if (typeof result === "object") for (let len = result.length, i = 0; i < len; i++) result[i] = Math.round(result[i]);
|
|
1932
|
-
return result;
|
|
1933
|
-
};
|
|
1934
|
-
if ("conversion" in fn) wrappedFn.conversion = fn.conversion;
|
|
1935
|
-
return wrappedFn;
|
|
1936
|
-
}
|
|
1937
|
-
models.forEach((fromModel) => {
|
|
1938
|
-
convert[fromModel] = {};
|
|
1939
|
-
Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels });
|
|
1940
|
-
Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels });
|
|
1941
|
-
const routes = route(fromModel);
|
|
1942
|
-
Object.keys(routes).forEach((toModel) => {
|
|
1943
|
-
const fn = routes[toModel];
|
|
1944
|
-
convert[fromModel][toModel] = wrapRounded(fn);
|
|
1945
|
-
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
374
|
+
Object.defineProperty(styles$1$1, groupName, {
|
|
375
|
+
value: group,
|
|
376
|
+
enumerable: false
|
|
1946
377
|
});
|
|
378
|
+
}
|
|
379
|
+
Object.defineProperty(styles$1$1, "codes", {
|
|
380
|
+
value: codes,
|
|
381
|
+
enumerable: false
|
|
1947
382
|
});
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
g,
|
|
1966
|
-
b
|
|
1967
|
-
];
|
|
1968
|
-
var setLazyProperty = (object, property, get) => {
|
|
1969
|
-
Object.defineProperty(object, property, {
|
|
1970
|
-
get: () => {
|
|
1971
|
-
const value = get();
|
|
1972
|
-
Object.defineProperty(object, property, {
|
|
1973
|
-
value,
|
|
1974
|
-
enumerable: true,
|
|
1975
|
-
configurable: true
|
|
1976
|
-
});
|
|
1977
|
-
return value;
|
|
383
|
+
styles$1$1.color.close = "\x1B[39m";
|
|
384
|
+
styles$1$1.bgColor.close = "\x1B[49m";
|
|
385
|
+
styles$1$1.color.ansi = wrapAnsi16$1();
|
|
386
|
+
styles$1$1.color.ansi256 = wrapAnsi256$1();
|
|
387
|
+
styles$1$1.color.ansi16m = wrapAnsi16m$1();
|
|
388
|
+
styles$1$1.bgColor.ansi = wrapAnsi16$1(ANSI_BACKGROUND_OFFSET$1);
|
|
389
|
+
styles$1$1.bgColor.ansi256 = wrapAnsi256$1(ANSI_BACKGROUND_OFFSET$1);
|
|
390
|
+
styles$1$1.bgColor.ansi16m = wrapAnsi16m$1(ANSI_BACKGROUND_OFFSET$1);
|
|
391
|
+
Object.defineProperties(styles$1$1, {
|
|
392
|
+
rgbToAnsi256: {
|
|
393
|
+
value(red, green, blue) {
|
|
394
|
+
if (red === green && green === blue) {
|
|
395
|
+
if (red < 8) return 16;
|
|
396
|
+
if (red > 248) return 231;
|
|
397
|
+
return Math.round((red - 8) / 247 * 24) + 232;
|
|
398
|
+
}
|
|
399
|
+
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
1978
400
|
},
|
|
1979
|
-
enumerable:
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
const codes = /* @__PURE__ */ new Map();
|
|
1998
|
-
const styles = {
|
|
1999
|
-
modifier: {
|
|
2000
|
-
reset: [0, 0],
|
|
2001
|
-
bold: [1, 22],
|
|
2002
|
-
dim: [2, 22],
|
|
2003
|
-
italic: [3, 23],
|
|
2004
|
-
underline: [4, 24],
|
|
2005
|
-
inverse: [7, 27],
|
|
2006
|
-
hidden: [8, 28],
|
|
2007
|
-
strikethrough: [9, 29]
|
|
401
|
+
enumerable: false
|
|
402
|
+
},
|
|
403
|
+
hexToRgb: {
|
|
404
|
+
value(hex) {
|
|
405
|
+
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
406
|
+
if (!matches) return [
|
|
407
|
+
0,
|
|
408
|
+
0,
|
|
409
|
+
0
|
|
410
|
+
];
|
|
411
|
+
let [colorString] = matches;
|
|
412
|
+
if (colorString.length === 3) colorString = [...colorString].map((character) => character + character).join("");
|
|
413
|
+
const integer = Number.parseInt(colorString, 16);
|
|
414
|
+
return [
|
|
415
|
+
integer >> 16 & 255,
|
|
416
|
+
integer >> 8 & 255,
|
|
417
|
+
integer & 255
|
|
418
|
+
];
|
|
2008
419
|
},
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
420
|
+
enumerable: false
|
|
421
|
+
},
|
|
422
|
+
hexToAnsi256: {
|
|
423
|
+
value: (hex) => styles$1$1.rgbToAnsi256(...styles$1$1.hexToRgb(hex)),
|
|
424
|
+
enumerable: false
|
|
425
|
+
},
|
|
426
|
+
ansi256ToAnsi: {
|
|
427
|
+
value(code) {
|
|
428
|
+
if (code < 8) return 30 + code;
|
|
429
|
+
if (code < 16) return 90 + (code - 8);
|
|
430
|
+
let red;
|
|
431
|
+
let green;
|
|
432
|
+
let blue;
|
|
433
|
+
if (code >= 232) {
|
|
434
|
+
red = ((code - 232) * 10 + 8) / 255;
|
|
435
|
+
green = red;
|
|
436
|
+
blue = red;
|
|
437
|
+
} else {
|
|
438
|
+
code -= 16;
|
|
439
|
+
const remainder = code % 36;
|
|
440
|
+
red = Math.floor(code / 36) / 5;
|
|
441
|
+
green = Math.floor(remainder / 6) / 5;
|
|
442
|
+
blue = remainder % 6 / 5;
|
|
443
|
+
}
|
|
444
|
+
const value = Math.max(red, green, blue) * 2;
|
|
445
|
+
if (value === 0) return 30;
|
|
446
|
+
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
447
|
+
if (value === 2) result += 60;
|
|
448
|
+
return result;
|
|
2026
449
|
},
|
|
2027
|
-
bgColor: {
|
|
2028
|
-
bgBlack: [40, 49],
|
|
2029
|
-
bgRed: [41, 49],
|
|
2030
|
-
bgGreen: [42, 49],
|
|
2031
|
-
bgYellow: [43, 49],
|
|
2032
|
-
bgBlue: [44, 49],
|
|
2033
|
-
bgMagenta: [45, 49],
|
|
2034
|
-
bgCyan: [46, 49],
|
|
2035
|
-
bgWhite: [47, 49],
|
|
2036
|
-
bgBlackBright: [100, 49],
|
|
2037
|
-
bgRedBright: [101, 49],
|
|
2038
|
-
bgGreenBright: [102, 49],
|
|
2039
|
-
bgYellowBright: [103, 49],
|
|
2040
|
-
bgBlueBright: [104, 49],
|
|
2041
|
-
bgMagentaBright: [105, 49],
|
|
2042
|
-
bgCyanBright: [106, 49],
|
|
2043
|
-
bgWhiteBright: [107, 49]
|
|
2044
|
-
}
|
|
2045
|
-
};
|
|
2046
|
-
styles.color.gray = styles.color.blackBright;
|
|
2047
|
-
styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
|
|
2048
|
-
styles.color.grey = styles.color.blackBright;
|
|
2049
|
-
styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
|
|
2050
|
-
for (const [groupName, group] of Object.entries(styles)) {
|
|
2051
|
-
for (const [styleName, style] of Object.entries(group)) {
|
|
2052
|
-
styles[styleName] = {
|
|
2053
|
-
open: `\u001B[${style[0]}m`,
|
|
2054
|
-
close: `\u001B[${style[1]}m`
|
|
2055
|
-
};
|
|
2056
|
-
group[styleName] = styles[styleName];
|
|
2057
|
-
codes.set(style[0], style[1]);
|
|
2058
|
-
}
|
|
2059
|
-
Object.defineProperty(styles, groupName, {
|
|
2060
|
-
value: group,
|
|
2061
|
-
enumerable: false
|
|
2062
|
-
});
|
|
2063
|
-
}
|
|
2064
|
-
Object.defineProperty(styles, "codes", {
|
|
2065
|
-
value: codes,
|
|
2066
450
|
enumerable: false
|
|
2067
|
-
}
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
|
|
2076
|
-
return styles;
|
|
2077
|
-
}
|
|
2078
|
-
Object.defineProperty(module, "exports", {
|
|
2079
|
-
enumerable: true,
|
|
2080
|
-
get: assembleStyles
|
|
2081
|
-
});
|
|
2082
|
-
}));
|
|
2083
|
-
var require_browser$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2084
|
-
module.exports = {
|
|
2085
|
-
stdout: false,
|
|
2086
|
-
stderr: false
|
|
2087
|
-
};
|
|
2088
|
-
}));
|
|
2089
|
-
var require_util$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2090
|
-
var stringReplaceAll = (string, substring, replacer) => {
|
|
2091
|
-
let index = string.indexOf(substring);
|
|
2092
|
-
if (index === -1) return string;
|
|
2093
|
-
const substringLength = substring.length;
|
|
2094
|
-
let endIndex = 0;
|
|
2095
|
-
let returnValue = "";
|
|
2096
|
-
do {
|
|
2097
|
-
returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
|
|
2098
|
-
endIndex = index + substringLength;
|
|
2099
|
-
index = string.indexOf(substring, endIndex);
|
|
2100
|
-
} while (index !== -1);
|
|
2101
|
-
returnValue += string.substr(endIndex);
|
|
2102
|
-
return returnValue;
|
|
2103
|
-
};
|
|
2104
|
-
var stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
|
|
2105
|
-
let endIndex = 0;
|
|
2106
|
-
let returnValue = "";
|
|
2107
|
-
do {
|
|
2108
|
-
const gotCR = string[index - 1] === "\r";
|
|
2109
|
-
returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
2110
|
-
endIndex = index + 1;
|
|
2111
|
-
index = string.indexOf("\n", endIndex);
|
|
2112
|
-
} while (index !== -1);
|
|
2113
|
-
returnValue += string.substr(endIndex);
|
|
2114
|
-
return returnValue;
|
|
2115
|
-
};
|
|
2116
|
-
module.exports = {
|
|
2117
|
-
stringReplaceAll,
|
|
2118
|
-
stringEncaseCRLFWithFirstIndex
|
|
2119
|
-
};
|
|
2120
|
-
}));
|
|
2121
|
-
var require_templates$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2122
|
-
var TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
|
|
2123
|
-
var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
|
2124
|
-
var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
|
|
2125
|
-
var ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
|
|
2126
|
-
var ESCAPES = new Map([
|
|
2127
|
-
["n", "\n"],
|
|
2128
|
-
["r", "\r"],
|
|
2129
|
-
["t", " "],
|
|
2130
|
-
["b", "\b"],
|
|
2131
|
-
["f", "\f"],
|
|
2132
|
-
["v", "\v"],
|
|
2133
|
-
["0", "\0"],
|
|
2134
|
-
["\\", "\\"],
|
|
2135
|
-
["e", "\x1B"],
|
|
2136
|
-
["a", "\x07"]
|
|
2137
|
-
]);
|
|
2138
|
-
function unescape(c) {
|
|
2139
|
-
const u = c[0] === "u";
|
|
2140
|
-
const bracket = c[1] === "{";
|
|
2141
|
-
if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) return String.fromCharCode(parseInt(c.slice(1), 16));
|
|
2142
|
-
if (u && bracket) return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
|
|
2143
|
-
return ESCAPES.get(c) || c;
|
|
2144
|
-
}
|
|
2145
|
-
function parseArguments(name, arguments_) {
|
|
2146
|
-
const results = [];
|
|
2147
|
-
const chunks = arguments_.trim().split(/\s*,\s*/g);
|
|
2148
|
-
let matches;
|
|
2149
|
-
for (const chunk of chunks) {
|
|
2150
|
-
const number = Number(chunk);
|
|
2151
|
-
if (!Number.isNaN(number)) results.push(number);
|
|
2152
|
-
else if (matches = chunk.match(STRING_REGEX)) results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
|
|
2153
|
-
else throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
|
|
2154
|
-
}
|
|
2155
|
-
return results;
|
|
2156
|
-
}
|
|
2157
|
-
function parseStyle(style) {
|
|
2158
|
-
STYLE_REGEX.lastIndex = 0;
|
|
2159
|
-
const results = [];
|
|
2160
|
-
let matches;
|
|
2161
|
-
while ((matches = STYLE_REGEX.exec(style)) !== null) {
|
|
2162
|
-
const name = matches[1];
|
|
2163
|
-
if (matches[2]) {
|
|
2164
|
-
const args = parseArguments(name, matches[2]);
|
|
2165
|
-
results.push([name].concat(args));
|
|
2166
|
-
} else results.push([name]);
|
|
451
|
+
},
|
|
452
|
+
rgbToAnsi: {
|
|
453
|
+
value: (red, green, blue) => styles$1$1.ansi256ToAnsi(styles$1$1.rgbToAnsi256(red, green, blue)),
|
|
454
|
+
enumerable: false
|
|
455
|
+
},
|
|
456
|
+
hexToAnsi: {
|
|
457
|
+
value: (hex) => styles$1$1.ansi256ToAnsi(styles$1$1.hexToAnsi256(hex)),
|
|
458
|
+
enumerable: false
|
|
2167
459
|
}
|
|
2168
|
-
|
|
460
|
+
});
|
|
461
|
+
return styles$1$1;
|
|
462
|
+
}
|
|
463
|
+
var ansiStyles$1 = assembleStyles$1();
|
|
464
|
+
var level$1 = (() => {
|
|
465
|
+
if (!("navigator" in globalThis)) return 0;
|
|
466
|
+
if (globalThis.navigator.userAgentData) {
|
|
467
|
+
const brand = navigator.userAgentData.brands.find(({ brand }) => brand === "Chromium");
|
|
468
|
+
if (brand && brand.version > 93) return 3;
|
|
2169
469
|
}
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
470
|
+
if (/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)) return 1;
|
|
471
|
+
return 0;
|
|
472
|
+
})();
|
|
473
|
+
var colorSupport$1 = level$1 !== 0 && {
|
|
474
|
+
level: level$1,
|
|
475
|
+
hasBasic: true,
|
|
476
|
+
has256: level$1 >= 2,
|
|
477
|
+
has16m: level$1 >= 3
|
|
478
|
+
};
|
|
479
|
+
var supportsColor$1 = {
|
|
480
|
+
stdout: colorSupport$1,
|
|
481
|
+
stderr: colorSupport$1
|
|
482
|
+
};
|
|
483
|
+
function stringReplaceAll$1(string, substring, replacer) {
|
|
484
|
+
let index = string.indexOf(substring);
|
|
485
|
+
if (index === -1) return string;
|
|
486
|
+
const substringLength = substring.length;
|
|
487
|
+
let endIndex = 0;
|
|
488
|
+
let returnValue = "";
|
|
489
|
+
do {
|
|
490
|
+
returnValue += string.slice(endIndex, index) + substring + replacer;
|
|
491
|
+
endIndex = index + substringLength;
|
|
492
|
+
index = string.indexOf(substring, endIndex);
|
|
493
|
+
} while (index !== -1);
|
|
494
|
+
returnValue += string.slice(endIndex);
|
|
495
|
+
return returnValue;
|
|
496
|
+
}
|
|
497
|
+
function stringEncaseCRLFWithFirstIndex$1(string, prefix, postfix, index) {
|
|
498
|
+
let endIndex = 0;
|
|
499
|
+
let returnValue = "";
|
|
500
|
+
do {
|
|
501
|
+
const gotCR = string[index - 1] === "\r";
|
|
502
|
+
returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
503
|
+
endIndex = index + 1;
|
|
504
|
+
index = string.indexOf("\n", endIndex);
|
|
505
|
+
} while (index !== -1);
|
|
506
|
+
returnValue += string.slice(endIndex);
|
|
507
|
+
return returnValue;
|
|
508
|
+
}
|
|
509
|
+
var { stdout: stdoutColor$1, stderr: stderrColor$1 } = supportsColor$1;
|
|
510
|
+
var GENERATOR$1 = Symbol("GENERATOR");
|
|
511
|
+
var STYLER$1 = Symbol("STYLER");
|
|
512
|
+
var IS_EMPTY$1 = Symbol("IS_EMPTY");
|
|
513
|
+
var levelMapping$1 = [
|
|
514
|
+
"ansi",
|
|
515
|
+
"ansi",
|
|
516
|
+
"ansi256",
|
|
517
|
+
"ansi16m"
|
|
518
|
+
];
|
|
519
|
+
var styles$2 = Object.create(null);
|
|
520
|
+
var applyOptions$1 = (object, options = {}) => {
|
|
521
|
+
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");
|
|
522
|
+
const colorLevel = stdoutColor$1 ? stdoutColor$1.level : 0;
|
|
523
|
+
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
524
|
+
};
|
|
525
|
+
var chalkFactory$1 = (options) => {
|
|
526
|
+
const chalk = (...strings) => strings.join(" ");
|
|
527
|
+
applyOptions$1(chalk, options);
|
|
528
|
+
Object.setPrototypeOf(chalk, createChalk$1.prototype);
|
|
529
|
+
return chalk;
|
|
530
|
+
};
|
|
531
|
+
function createChalk$1(options) {
|
|
532
|
+
return chalkFactory$1(options);
|
|
533
|
+
}
|
|
534
|
+
Object.setPrototypeOf(createChalk$1.prototype, Function.prototype);
|
|
535
|
+
for (const [styleName, style] of Object.entries(ansiStyles$1)) styles$2[styleName] = { get() {
|
|
536
|
+
const builder = createBuilder$1(this, createStyler$1(style.open, style.close, this[STYLER$1]), this[IS_EMPTY$1]);
|
|
537
|
+
Object.defineProperty(this, styleName, { value: builder });
|
|
538
|
+
return builder;
|
|
539
|
+
} };
|
|
540
|
+
styles$2.visible = { get() {
|
|
541
|
+
const builder = createBuilder$1(this, this[STYLER$1], true);
|
|
542
|
+
Object.defineProperty(this, "visible", { value: builder });
|
|
543
|
+
return builder;
|
|
544
|
+
} };
|
|
545
|
+
var getModelAnsi$1 = (model, level, type, ...arguments_) => {
|
|
546
|
+
if (model === "rgb") {
|
|
547
|
+
if (level === "ansi16m") return ansiStyles$1[type].ansi16m(...arguments_);
|
|
548
|
+
if (level === "ansi256") return ansiStyles$1[type].ansi256(ansiStyles$1.rgbToAnsi256(...arguments_));
|
|
549
|
+
return ansiStyles$1[type].ansi(ansiStyles$1.rgbToAnsi(...arguments_));
|
|
2180
550
|
}
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
});
|
|
2195
|
-
} else if (close) {
|
|
2196
|
-
if (styles.length === 0) throw new Error("Found extraneous } in Chalk template literal");
|
|
2197
|
-
chunks.push(buildStyle(chalk, styles)(chunk.join("")));
|
|
2198
|
-
chunk = [];
|
|
2199
|
-
styles.pop();
|
|
2200
|
-
} else chunk.push(character);
|
|
2201
|
-
});
|
|
2202
|
-
chunks.push(chunk.join(""));
|
|
2203
|
-
if (styles.length > 0) {
|
|
2204
|
-
const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
|
|
2205
|
-
throw new Error(errMessage);
|
|
2206
|
-
}
|
|
2207
|
-
return chunks.join("");
|
|
2208
|
-
};
|
|
2209
|
-
}));
|
|
2210
|
-
var import_source$1 = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2211
|
-
var ansiStyles = require_ansi_styles$1();
|
|
2212
|
-
var { stdout: stdoutColor, stderr: stderrColor } = require_browser$2();
|
|
2213
|
-
var { stringReplaceAll, stringEncaseCRLFWithFirstIndex } = require_util$1();
|
|
2214
|
-
var { isArray } = Array;
|
|
2215
|
-
var levelMapping = [
|
|
2216
|
-
"ansi",
|
|
2217
|
-
"ansi",
|
|
2218
|
-
"ansi256",
|
|
2219
|
-
"ansi16m"
|
|
2220
|
-
];
|
|
2221
|
-
var styles = Object.create(null);
|
|
2222
|
-
var applyOptions = (object, options = {}) => {
|
|
2223
|
-
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");
|
|
2224
|
-
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
2225
|
-
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
2226
|
-
};
|
|
2227
|
-
var ChalkClass = class {
|
|
2228
|
-
constructor(options) {
|
|
2229
|
-
return chalkFactory(options);
|
|
2230
|
-
}
|
|
2231
|
-
};
|
|
2232
|
-
var chalkFactory = (options) => {
|
|
2233
|
-
const chalk = {};
|
|
2234
|
-
applyOptions(chalk, options);
|
|
2235
|
-
chalk.template = (...arguments_) => chalkTag(chalk.template, ...arguments_);
|
|
2236
|
-
Object.setPrototypeOf(chalk, Chalk.prototype);
|
|
2237
|
-
Object.setPrototypeOf(chalk.template, chalk);
|
|
2238
|
-
chalk.template.constructor = () => {
|
|
2239
|
-
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
551
|
+
if (model === "hex") return getModelAnsi$1("rgb", level, type, ...ansiStyles$1.hexToRgb(...arguments_));
|
|
552
|
+
return ansiStyles$1[type][model](...arguments_);
|
|
553
|
+
};
|
|
554
|
+
for (const model of [
|
|
555
|
+
"rgb",
|
|
556
|
+
"hex",
|
|
557
|
+
"ansi256"
|
|
558
|
+
]) {
|
|
559
|
+
styles$2[model] = { get() {
|
|
560
|
+
const { level } = this;
|
|
561
|
+
return function(...arguments_) {
|
|
562
|
+
const styler = createStyler$1(getModelAnsi$1(model, levelMapping$1[level], "color", ...arguments_), ansiStyles$1.color.close, this[STYLER$1]);
|
|
563
|
+
return createBuilder$1(this, styler, this[IS_EMPTY$1]);
|
|
2240
564
|
};
|
|
2241
|
-
chalk.template.Instance = ChalkClass;
|
|
2242
|
-
return chalk.template;
|
|
2243
|
-
};
|
|
2244
|
-
function Chalk(options) {
|
|
2245
|
-
return chalkFactory(options);
|
|
2246
|
-
}
|
|
2247
|
-
for (const [styleName, style] of Object.entries(ansiStyles)) styles[styleName] = { get() {
|
|
2248
|
-
const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
|
|
2249
|
-
Object.defineProperty(this, styleName, { value: builder });
|
|
2250
|
-
return builder;
|
|
2251
565
|
} };
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
Object.defineProperty(this, "visible", { value: builder });
|
|
2255
|
-
return builder;
|
|
2256
|
-
} };
|
|
2257
|
-
var usedModels = [
|
|
2258
|
-
"rgb",
|
|
2259
|
-
"hex",
|
|
2260
|
-
"keyword",
|
|
2261
|
-
"hsl",
|
|
2262
|
-
"hsv",
|
|
2263
|
-
"hwb",
|
|
2264
|
-
"ansi",
|
|
2265
|
-
"ansi256"
|
|
2266
|
-
];
|
|
2267
|
-
for (const model of usedModels) styles[model] = { get() {
|
|
566
|
+
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
567
|
+
styles$2[bgModel] = { get() {
|
|
2268
568
|
const { level } = this;
|
|
2269
569
|
return function(...arguments_) {
|
|
2270
|
-
const styler = createStyler(
|
|
2271
|
-
return createBuilder(this, styler, this
|
|
570
|
+
const styler = createStyler$1(getModelAnsi$1(model, levelMapping$1[level], "bgColor", ...arguments_), ansiStyles$1.bgColor.close, this[STYLER$1]);
|
|
571
|
+
return createBuilder$1(this, styler, this[IS_EMPTY$1]);
|
|
2272
572
|
};
|
|
2273
573
|
} };
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
var proto = Object.defineProperties(() => {}, {
|
|
2285
|
-
...styles,
|
|
2286
|
-
level: {
|
|
2287
|
-
enumerable: true,
|
|
2288
|
-
get() {
|
|
2289
|
-
return this._generator.level;
|
|
2290
|
-
},
|
|
2291
|
-
set(level) {
|
|
2292
|
-
this._generator.level = level;
|
|
2293
|
-
}
|
|
2294
|
-
}
|
|
2295
|
-
});
|
|
2296
|
-
var createStyler = (open, close, parent) => {
|
|
2297
|
-
let openAll;
|
|
2298
|
-
let closeAll;
|
|
2299
|
-
if (parent === void 0) {
|
|
2300
|
-
openAll = open;
|
|
2301
|
-
closeAll = close;
|
|
2302
|
-
} else {
|
|
2303
|
-
openAll = parent.openAll + open;
|
|
2304
|
-
closeAll = close + parent.closeAll;
|
|
2305
|
-
}
|
|
2306
|
-
return {
|
|
2307
|
-
open,
|
|
2308
|
-
close,
|
|
2309
|
-
openAll,
|
|
2310
|
-
closeAll,
|
|
2311
|
-
parent
|
|
2312
|
-
};
|
|
2313
|
-
};
|
|
2314
|
-
var createBuilder = (self, _styler, _isEmpty) => {
|
|
2315
|
-
const builder = (...arguments_) => {
|
|
2316
|
-
if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) return applyStyle(builder, chalkTag(builder, ...arguments_));
|
|
2317
|
-
return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
2318
|
-
};
|
|
2319
|
-
Object.setPrototypeOf(builder, proto);
|
|
2320
|
-
builder._generator = self;
|
|
2321
|
-
builder._styler = _styler;
|
|
2322
|
-
builder._isEmpty = _isEmpty;
|
|
2323
|
-
return builder;
|
|
2324
|
-
};
|
|
2325
|
-
var applyStyle = (self, string) => {
|
|
2326
|
-
if (self.level <= 0 || !string) return self._isEmpty ? "" : string;
|
|
2327
|
-
let styler = self._styler;
|
|
2328
|
-
if (styler === void 0) return string;
|
|
2329
|
-
const { openAll, closeAll } = styler;
|
|
2330
|
-
if (string.indexOf("\x1B") !== -1) while (styler !== void 0) {
|
|
2331
|
-
string = stringReplaceAll(string, styler.close, styler.open);
|
|
2332
|
-
styler = styler.parent;
|
|
574
|
+
}
|
|
575
|
+
var proto$1 = Object.defineProperties(() => {}, {
|
|
576
|
+
...styles$2,
|
|
577
|
+
level: {
|
|
578
|
+
enumerable: true,
|
|
579
|
+
get() {
|
|
580
|
+
return this[GENERATOR$1].level;
|
|
581
|
+
},
|
|
582
|
+
set(level) {
|
|
583
|
+
this[GENERATOR$1].level = level;
|
|
2333
584
|
}
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
585
|
+
}
|
|
586
|
+
});
|
|
587
|
+
var createStyler$1 = (open, close, parent) => {
|
|
588
|
+
let openAll;
|
|
589
|
+
let closeAll;
|
|
590
|
+
if (parent === void 0) {
|
|
591
|
+
openAll = open;
|
|
592
|
+
closeAll = close;
|
|
593
|
+
} else {
|
|
594
|
+
openAll = parent.openAll + open;
|
|
595
|
+
closeAll = close + parent.closeAll;
|
|
596
|
+
}
|
|
597
|
+
return {
|
|
598
|
+
open,
|
|
599
|
+
close,
|
|
600
|
+
openAll,
|
|
601
|
+
closeAll,
|
|
602
|
+
parent
|
|
2347
603
|
};
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
604
|
+
};
|
|
605
|
+
var createBuilder$1 = (self, _styler, _isEmpty) => {
|
|
606
|
+
const builder = (...arguments_) => applyStyle$1(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
607
|
+
Object.setPrototypeOf(builder, proto$1);
|
|
608
|
+
builder[GENERATOR$1] = self;
|
|
609
|
+
builder[STYLER$1] = _styler;
|
|
610
|
+
builder[IS_EMPTY$1] = _isEmpty;
|
|
611
|
+
return builder;
|
|
612
|
+
};
|
|
613
|
+
var applyStyle$1 = (self, string) => {
|
|
614
|
+
if (self.level <= 0 || !string) return self[IS_EMPTY$1] ? "" : string;
|
|
615
|
+
let styler = self[STYLER$1];
|
|
616
|
+
if (styler === void 0) return string;
|
|
617
|
+
const { openAll, closeAll } = styler;
|
|
618
|
+
if (string.includes("\x1B")) while (styler !== void 0) {
|
|
619
|
+
string = stringReplaceAll$1(string, styler.close, styler.open);
|
|
620
|
+
styler = styler.parent;
|
|
621
|
+
}
|
|
622
|
+
const lfIndex = string.indexOf("\n");
|
|
623
|
+
if (lfIndex !== -1) string = stringEncaseCRLFWithFirstIndex$1(string, closeAll, openAll, lfIndex);
|
|
624
|
+
return openAll + string + closeAll;
|
|
625
|
+
};
|
|
626
|
+
Object.defineProperties(createChalk$1.prototype, styles$2);
|
|
627
|
+
var chalk$1 = createChalk$1();
|
|
628
|
+
createChalk$1({ level: stderrColor$1 ? stderrColor$1.level : 0 });
|
|
2355
629
|
var envOptions = {};
|
|
2356
630
|
function SetupConfig(envOptions, logger) {
|
|
2357
631
|
const envfile = process.env.STSENVFILE === void 0 ? "/.env" : process.env.STSENVFILE;
|
|
@@ -2525,10 +799,10 @@ function SetupConfig(envOptions, logger) {
|
|
|
2525
799
|
try {
|
|
2526
800
|
(0, node_fs.accessSync)(passwordFile, node_fs.constants.R_OK);
|
|
2527
801
|
const data = (0, node_fs.readFileSync)(passwordFile, "utf8");
|
|
2528
|
-
if (logger) logger.debug(
|
|
802
|
+
if (logger) logger.debug(chalk$1.green(`Successfully loaded password file: [${passwordFile}]`));
|
|
2529
803
|
return data;
|
|
2530
804
|
} catch (err) {
|
|
2531
|
-
if (logger) logger.debug(
|
|
805
|
+
if (logger) logger.debug(chalk$1.red(`Problem loading password file: [${passwordFile}], Error: [${err}]`));
|
|
2532
806
|
return "";
|
|
2533
807
|
}
|
|
2534
808
|
};
|
|
@@ -2568,2060 +842,343 @@ var goptions = new Proxy(envOptions, { get(target, prop, receiver) {
|
|
|
2568
842
|
return Reflect.get(target, prop, receiver);
|
|
2569
843
|
} });
|
|
2570
844
|
//#endregion
|
|
2571
|
-
//#region node_modules/
|
|
2572
|
-
var
|
|
845
|
+
//#region node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
846
|
+
var import_browser = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2573
847
|
module.exports = false;
|
|
2574
|
-
}));
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
var
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
],
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
],
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
],
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
],
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
],
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
],
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
],
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
],
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
],
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
],
|
|
2629
|
-
|
|
2630
|
-
138,
|
|
2631
|
-
43,
|
|
2632
|
-
226
|
|
2633
|
-
],
|
|
2634
|
-
"brown": [
|
|
2635
|
-
165,
|
|
2636
|
-
42,
|
|
2637
|
-
42
|
|
2638
|
-
],
|
|
2639
|
-
"burlywood": [
|
|
2640
|
-
222,
|
|
2641
|
-
184,
|
|
2642
|
-
135
|
|
2643
|
-
],
|
|
2644
|
-
"cadetblue": [
|
|
2645
|
-
95,
|
|
2646
|
-
158,
|
|
2647
|
-
160
|
|
2648
|
-
],
|
|
2649
|
-
"chartreuse": [
|
|
2650
|
-
127,
|
|
2651
|
-
255,
|
|
2652
|
-
0
|
|
2653
|
-
],
|
|
2654
|
-
"chocolate": [
|
|
2655
|
-
210,
|
|
2656
|
-
105,
|
|
2657
|
-
30
|
|
2658
|
-
],
|
|
2659
|
-
"coral": [
|
|
2660
|
-
255,
|
|
2661
|
-
127,
|
|
2662
|
-
80
|
|
2663
|
-
],
|
|
2664
|
-
"cornflowerblue": [
|
|
2665
|
-
100,
|
|
2666
|
-
149,
|
|
2667
|
-
237
|
|
2668
|
-
],
|
|
2669
|
-
"cornsilk": [
|
|
2670
|
-
255,
|
|
2671
|
-
248,
|
|
2672
|
-
220
|
|
2673
|
-
],
|
|
2674
|
-
"crimson": [
|
|
2675
|
-
220,
|
|
2676
|
-
20,
|
|
2677
|
-
60
|
|
2678
|
-
],
|
|
2679
|
-
"cyan": [
|
|
2680
|
-
0,
|
|
2681
|
-
255,
|
|
2682
|
-
255
|
|
2683
|
-
],
|
|
2684
|
-
"darkblue": [
|
|
2685
|
-
0,
|
|
2686
|
-
0,
|
|
2687
|
-
139
|
|
2688
|
-
],
|
|
2689
|
-
"darkcyan": [
|
|
2690
|
-
0,
|
|
2691
|
-
139,
|
|
2692
|
-
139
|
|
2693
|
-
],
|
|
2694
|
-
"darkgoldenrod": [
|
|
2695
|
-
184,
|
|
2696
|
-
134,
|
|
2697
|
-
11
|
|
2698
|
-
],
|
|
2699
|
-
"darkgray": [
|
|
2700
|
-
169,
|
|
2701
|
-
169,
|
|
2702
|
-
169
|
|
2703
|
-
],
|
|
2704
|
-
"darkgreen": [
|
|
2705
|
-
0,
|
|
2706
|
-
100,
|
|
2707
|
-
0
|
|
2708
|
-
],
|
|
2709
|
-
"darkgrey": [
|
|
2710
|
-
169,
|
|
2711
|
-
169,
|
|
2712
|
-
169
|
|
2713
|
-
],
|
|
2714
|
-
"darkkhaki": [
|
|
2715
|
-
189,
|
|
2716
|
-
183,
|
|
2717
|
-
107
|
|
2718
|
-
],
|
|
2719
|
-
"darkmagenta": [
|
|
2720
|
-
139,
|
|
2721
|
-
0,
|
|
2722
|
-
139
|
|
2723
|
-
],
|
|
2724
|
-
"darkolivegreen": [
|
|
2725
|
-
85,
|
|
2726
|
-
107,
|
|
2727
|
-
47
|
|
2728
|
-
],
|
|
2729
|
-
"darkorange": [
|
|
2730
|
-
255,
|
|
2731
|
-
140,
|
|
2732
|
-
0
|
|
2733
|
-
],
|
|
2734
|
-
"darkorchid": [
|
|
2735
|
-
153,
|
|
2736
|
-
50,
|
|
2737
|
-
204
|
|
2738
|
-
],
|
|
2739
|
-
"darkred": [
|
|
2740
|
-
139,
|
|
2741
|
-
0,
|
|
2742
|
-
0
|
|
2743
|
-
],
|
|
2744
|
-
"darksalmon": [
|
|
2745
|
-
233,
|
|
2746
|
-
150,
|
|
2747
|
-
122
|
|
2748
|
-
],
|
|
2749
|
-
"darkseagreen": [
|
|
2750
|
-
143,
|
|
2751
|
-
188,
|
|
2752
|
-
143
|
|
2753
|
-
],
|
|
2754
|
-
"darkslateblue": [
|
|
2755
|
-
72,
|
|
2756
|
-
61,
|
|
2757
|
-
139
|
|
2758
|
-
],
|
|
2759
|
-
"darkslategray": [
|
|
2760
|
-
47,
|
|
2761
|
-
79,
|
|
2762
|
-
79
|
|
2763
|
-
],
|
|
2764
|
-
"darkslategrey": [
|
|
2765
|
-
47,
|
|
2766
|
-
79,
|
|
2767
|
-
79
|
|
2768
|
-
],
|
|
2769
|
-
"darkturquoise": [
|
|
2770
|
-
0,
|
|
2771
|
-
206,
|
|
2772
|
-
209
|
|
2773
|
-
],
|
|
2774
|
-
"darkviolet": [
|
|
2775
|
-
148,
|
|
2776
|
-
0,
|
|
2777
|
-
211
|
|
2778
|
-
],
|
|
2779
|
-
"deeppink": [
|
|
2780
|
-
255,
|
|
2781
|
-
20,
|
|
2782
|
-
147
|
|
2783
|
-
],
|
|
2784
|
-
"deepskyblue": [
|
|
2785
|
-
0,
|
|
2786
|
-
191,
|
|
2787
|
-
255
|
|
2788
|
-
],
|
|
2789
|
-
"dimgray": [
|
|
2790
|
-
105,
|
|
2791
|
-
105,
|
|
2792
|
-
105
|
|
2793
|
-
],
|
|
2794
|
-
"dimgrey": [
|
|
2795
|
-
105,
|
|
2796
|
-
105,
|
|
2797
|
-
105
|
|
2798
|
-
],
|
|
2799
|
-
"dodgerblue": [
|
|
2800
|
-
30,
|
|
2801
|
-
144,
|
|
2802
|
-
255
|
|
2803
|
-
],
|
|
2804
|
-
"firebrick": [
|
|
2805
|
-
178,
|
|
2806
|
-
34,
|
|
2807
|
-
34
|
|
2808
|
-
],
|
|
2809
|
-
"floralwhite": [
|
|
2810
|
-
255,
|
|
2811
|
-
250,
|
|
2812
|
-
240
|
|
2813
|
-
],
|
|
2814
|
-
"forestgreen": [
|
|
2815
|
-
34,
|
|
2816
|
-
139,
|
|
2817
|
-
34
|
|
2818
|
-
],
|
|
2819
|
-
"fuchsia": [
|
|
2820
|
-
255,
|
|
2821
|
-
0,
|
|
2822
|
-
255
|
|
2823
|
-
],
|
|
2824
|
-
"gainsboro": [
|
|
2825
|
-
220,
|
|
2826
|
-
220,
|
|
2827
|
-
220
|
|
2828
|
-
],
|
|
2829
|
-
"ghostwhite": [
|
|
2830
|
-
248,
|
|
2831
|
-
248,
|
|
2832
|
-
255
|
|
2833
|
-
],
|
|
2834
|
-
"gold": [
|
|
2835
|
-
255,
|
|
2836
|
-
215,
|
|
2837
|
-
0
|
|
2838
|
-
],
|
|
2839
|
-
"goldenrod": [
|
|
2840
|
-
218,
|
|
2841
|
-
165,
|
|
2842
|
-
32
|
|
2843
|
-
],
|
|
2844
|
-
"gray": [
|
|
2845
|
-
128,
|
|
2846
|
-
128,
|
|
2847
|
-
128
|
|
2848
|
-
],
|
|
2849
|
-
"green": [
|
|
2850
|
-
0,
|
|
2851
|
-
128,
|
|
2852
|
-
0
|
|
2853
|
-
],
|
|
2854
|
-
"greenyellow": [
|
|
2855
|
-
173,
|
|
2856
|
-
255,
|
|
2857
|
-
47
|
|
2858
|
-
],
|
|
2859
|
-
"grey": [
|
|
2860
|
-
128,
|
|
2861
|
-
128,
|
|
2862
|
-
128
|
|
2863
|
-
],
|
|
2864
|
-
"honeydew": [
|
|
2865
|
-
240,
|
|
2866
|
-
255,
|
|
2867
|
-
240
|
|
2868
|
-
],
|
|
2869
|
-
"hotpink": [
|
|
2870
|
-
255,
|
|
2871
|
-
105,
|
|
2872
|
-
180
|
|
2873
|
-
],
|
|
2874
|
-
"indianred": [
|
|
2875
|
-
205,
|
|
2876
|
-
92,
|
|
2877
|
-
92
|
|
2878
|
-
],
|
|
2879
|
-
"indigo": [
|
|
2880
|
-
75,
|
|
2881
|
-
0,
|
|
2882
|
-
130
|
|
2883
|
-
],
|
|
2884
|
-
"ivory": [
|
|
2885
|
-
255,
|
|
2886
|
-
255,
|
|
2887
|
-
240
|
|
2888
|
-
],
|
|
2889
|
-
"khaki": [
|
|
2890
|
-
240,
|
|
2891
|
-
230,
|
|
2892
|
-
140
|
|
2893
|
-
],
|
|
2894
|
-
"lavender": [
|
|
2895
|
-
230,
|
|
2896
|
-
230,
|
|
2897
|
-
250
|
|
2898
|
-
],
|
|
2899
|
-
"lavenderblush": [
|
|
2900
|
-
255,
|
|
2901
|
-
240,
|
|
2902
|
-
245
|
|
2903
|
-
],
|
|
2904
|
-
"lawngreen": [
|
|
2905
|
-
124,
|
|
2906
|
-
252,
|
|
2907
|
-
0
|
|
2908
|
-
],
|
|
2909
|
-
"lemonchiffon": [
|
|
2910
|
-
255,
|
|
2911
|
-
250,
|
|
2912
|
-
205
|
|
2913
|
-
],
|
|
2914
|
-
"lightblue": [
|
|
2915
|
-
173,
|
|
2916
|
-
216,
|
|
2917
|
-
230
|
|
2918
|
-
],
|
|
2919
|
-
"lightcoral": [
|
|
2920
|
-
240,
|
|
2921
|
-
128,
|
|
2922
|
-
128
|
|
2923
|
-
],
|
|
2924
|
-
"lightcyan": [
|
|
2925
|
-
224,
|
|
2926
|
-
255,
|
|
2927
|
-
255
|
|
2928
|
-
],
|
|
2929
|
-
"lightgoldenrodyellow": [
|
|
2930
|
-
250,
|
|
2931
|
-
250,
|
|
2932
|
-
210
|
|
2933
|
-
],
|
|
2934
|
-
"lightgray": [
|
|
2935
|
-
211,
|
|
2936
|
-
211,
|
|
2937
|
-
211
|
|
2938
|
-
],
|
|
2939
|
-
"lightgreen": [
|
|
2940
|
-
144,
|
|
2941
|
-
238,
|
|
2942
|
-
144
|
|
2943
|
-
],
|
|
2944
|
-
"lightgrey": [
|
|
2945
|
-
211,
|
|
2946
|
-
211,
|
|
2947
|
-
211
|
|
2948
|
-
],
|
|
2949
|
-
"lightpink": [
|
|
2950
|
-
255,
|
|
2951
|
-
182,
|
|
2952
|
-
193
|
|
2953
|
-
],
|
|
2954
|
-
"lightsalmon": [
|
|
2955
|
-
255,
|
|
2956
|
-
160,
|
|
2957
|
-
122
|
|
2958
|
-
],
|
|
2959
|
-
"lightseagreen": [
|
|
2960
|
-
32,
|
|
2961
|
-
178,
|
|
2962
|
-
170
|
|
2963
|
-
],
|
|
2964
|
-
"lightskyblue": [
|
|
2965
|
-
135,
|
|
2966
|
-
206,
|
|
2967
|
-
250
|
|
2968
|
-
],
|
|
2969
|
-
"lightslategray": [
|
|
2970
|
-
119,
|
|
2971
|
-
136,
|
|
2972
|
-
153
|
|
2973
|
-
],
|
|
2974
|
-
"lightslategrey": [
|
|
2975
|
-
119,
|
|
2976
|
-
136,
|
|
2977
|
-
153
|
|
2978
|
-
],
|
|
2979
|
-
"lightsteelblue": [
|
|
2980
|
-
176,
|
|
2981
|
-
196,
|
|
2982
|
-
222
|
|
2983
|
-
],
|
|
2984
|
-
"lightyellow": [
|
|
2985
|
-
255,
|
|
2986
|
-
255,
|
|
2987
|
-
224
|
|
2988
|
-
],
|
|
2989
|
-
"lime": [
|
|
2990
|
-
0,
|
|
2991
|
-
255,
|
|
2992
|
-
0
|
|
2993
|
-
],
|
|
2994
|
-
"limegreen": [
|
|
2995
|
-
50,
|
|
2996
|
-
205,
|
|
2997
|
-
50
|
|
2998
|
-
],
|
|
2999
|
-
"linen": [
|
|
3000
|
-
250,
|
|
3001
|
-
240,
|
|
3002
|
-
230
|
|
3003
|
-
],
|
|
3004
|
-
"magenta": [
|
|
3005
|
-
255,
|
|
3006
|
-
0,
|
|
3007
|
-
255
|
|
3008
|
-
],
|
|
3009
|
-
"maroon": [
|
|
3010
|
-
128,
|
|
3011
|
-
0,
|
|
3012
|
-
0
|
|
3013
|
-
],
|
|
3014
|
-
"mediumaquamarine": [
|
|
3015
|
-
102,
|
|
3016
|
-
205,
|
|
3017
|
-
170
|
|
3018
|
-
],
|
|
3019
|
-
"mediumblue": [
|
|
3020
|
-
0,
|
|
3021
|
-
0,
|
|
3022
|
-
205
|
|
3023
|
-
],
|
|
3024
|
-
"mediumorchid": [
|
|
3025
|
-
186,
|
|
3026
|
-
85,
|
|
3027
|
-
211
|
|
3028
|
-
],
|
|
3029
|
-
"mediumpurple": [
|
|
3030
|
-
147,
|
|
3031
|
-
112,
|
|
3032
|
-
219
|
|
3033
|
-
],
|
|
3034
|
-
"mediumseagreen": [
|
|
3035
|
-
60,
|
|
3036
|
-
179,
|
|
3037
|
-
113
|
|
3038
|
-
],
|
|
3039
|
-
"mediumslateblue": [
|
|
3040
|
-
123,
|
|
3041
|
-
104,
|
|
3042
|
-
238
|
|
3043
|
-
],
|
|
3044
|
-
"mediumspringgreen": [
|
|
3045
|
-
0,
|
|
3046
|
-
250,
|
|
3047
|
-
154
|
|
3048
|
-
],
|
|
3049
|
-
"mediumturquoise": [
|
|
3050
|
-
72,
|
|
3051
|
-
209,
|
|
3052
|
-
204
|
|
3053
|
-
],
|
|
3054
|
-
"mediumvioletred": [
|
|
3055
|
-
199,
|
|
3056
|
-
21,
|
|
3057
|
-
133
|
|
3058
|
-
],
|
|
3059
|
-
"midnightblue": [
|
|
3060
|
-
25,
|
|
3061
|
-
25,
|
|
3062
|
-
112
|
|
3063
|
-
],
|
|
3064
|
-
"mintcream": [
|
|
3065
|
-
245,
|
|
3066
|
-
255,
|
|
3067
|
-
250
|
|
3068
|
-
],
|
|
3069
|
-
"mistyrose": [
|
|
3070
|
-
255,
|
|
3071
|
-
228,
|
|
3072
|
-
225
|
|
3073
|
-
],
|
|
3074
|
-
"moccasin": [
|
|
3075
|
-
255,
|
|
3076
|
-
228,
|
|
3077
|
-
181
|
|
3078
|
-
],
|
|
3079
|
-
"navajowhite": [
|
|
3080
|
-
255,
|
|
3081
|
-
222,
|
|
3082
|
-
173
|
|
3083
|
-
],
|
|
3084
|
-
"navy": [
|
|
3085
|
-
0,
|
|
3086
|
-
0,
|
|
3087
|
-
128
|
|
3088
|
-
],
|
|
3089
|
-
"oldlace": [
|
|
3090
|
-
253,
|
|
3091
|
-
245,
|
|
3092
|
-
230
|
|
3093
|
-
],
|
|
3094
|
-
"olive": [
|
|
3095
|
-
128,
|
|
3096
|
-
128,
|
|
3097
|
-
0
|
|
3098
|
-
],
|
|
3099
|
-
"olivedrab": [
|
|
3100
|
-
107,
|
|
3101
|
-
142,
|
|
3102
|
-
35
|
|
3103
|
-
],
|
|
3104
|
-
"orange": [
|
|
3105
|
-
255,
|
|
3106
|
-
165,
|
|
3107
|
-
0
|
|
3108
|
-
],
|
|
3109
|
-
"orangered": [
|
|
3110
|
-
255,
|
|
3111
|
-
69,
|
|
3112
|
-
0
|
|
3113
|
-
],
|
|
3114
|
-
"orchid": [
|
|
3115
|
-
218,
|
|
3116
|
-
112,
|
|
3117
|
-
214
|
|
3118
|
-
],
|
|
3119
|
-
"palegoldenrod": [
|
|
3120
|
-
238,
|
|
3121
|
-
232,
|
|
3122
|
-
170
|
|
3123
|
-
],
|
|
3124
|
-
"palegreen": [
|
|
3125
|
-
152,
|
|
3126
|
-
251,
|
|
3127
|
-
152
|
|
3128
|
-
],
|
|
3129
|
-
"paleturquoise": [
|
|
3130
|
-
175,
|
|
3131
|
-
238,
|
|
3132
|
-
238
|
|
3133
|
-
],
|
|
3134
|
-
"palevioletred": [
|
|
3135
|
-
219,
|
|
3136
|
-
112,
|
|
3137
|
-
147
|
|
3138
|
-
],
|
|
3139
|
-
"papayawhip": [
|
|
3140
|
-
255,
|
|
3141
|
-
239,
|
|
3142
|
-
213
|
|
3143
|
-
],
|
|
3144
|
-
"peachpuff": [
|
|
3145
|
-
255,
|
|
3146
|
-
218,
|
|
3147
|
-
185
|
|
3148
|
-
],
|
|
3149
|
-
"peru": [
|
|
3150
|
-
205,
|
|
3151
|
-
133,
|
|
3152
|
-
63
|
|
3153
|
-
],
|
|
3154
|
-
"pink": [
|
|
3155
|
-
255,
|
|
3156
|
-
192,
|
|
3157
|
-
203
|
|
3158
|
-
],
|
|
3159
|
-
"plum": [
|
|
3160
|
-
221,
|
|
3161
|
-
160,
|
|
3162
|
-
221
|
|
3163
|
-
],
|
|
3164
|
-
"powderblue": [
|
|
3165
|
-
176,
|
|
3166
|
-
224,
|
|
3167
|
-
230
|
|
3168
|
-
],
|
|
3169
|
-
"purple": [
|
|
3170
|
-
128,
|
|
3171
|
-
0,
|
|
3172
|
-
128
|
|
3173
|
-
],
|
|
3174
|
-
"rebeccapurple": [
|
|
3175
|
-
102,
|
|
3176
|
-
51,
|
|
3177
|
-
153
|
|
3178
|
-
],
|
|
3179
|
-
"red": [
|
|
3180
|
-
255,
|
|
3181
|
-
0,
|
|
3182
|
-
0
|
|
3183
|
-
],
|
|
3184
|
-
"rosybrown": [
|
|
3185
|
-
188,
|
|
3186
|
-
143,
|
|
3187
|
-
143
|
|
3188
|
-
],
|
|
3189
|
-
"royalblue": [
|
|
3190
|
-
65,
|
|
3191
|
-
105,
|
|
3192
|
-
225
|
|
3193
|
-
],
|
|
3194
|
-
"saddlebrown": [
|
|
3195
|
-
139,
|
|
3196
|
-
69,
|
|
3197
|
-
19
|
|
3198
|
-
],
|
|
3199
|
-
"salmon": [
|
|
3200
|
-
250,
|
|
3201
|
-
128,
|
|
3202
|
-
114
|
|
3203
|
-
],
|
|
3204
|
-
"sandybrown": [
|
|
3205
|
-
244,
|
|
3206
|
-
164,
|
|
3207
|
-
96
|
|
3208
|
-
],
|
|
3209
|
-
"seagreen": [
|
|
3210
|
-
46,
|
|
3211
|
-
139,
|
|
3212
|
-
87
|
|
3213
|
-
],
|
|
3214
|
-
"seashell": [
|
|
3215
|
-
255,
|
|
3216
|
-
245,
|
|
3217
|
-
238
|
|
3218
|
-
],
|
|
3219
|
-
"sienna": [
|
|
3220
|
-
160,
|
|
3221
|
-
82,
|
|
3222
|
-
45
|
|
3223
|
-
],
|
|
3224
|
-
"silver": [
|
|
3225
|
-
192,
|
|
3226
|
-
192,
|
|
3227
|
-
192
|
|
3228
|
-
],
|
|
3229
|
-
"skyblue": [
|
|
3230
|
-
135,
|
|
3231
|
-
206,
|
|
3232
|
-
235
|
|
3233
|
-
],
|
|
3234
|
-
"slateblue": [
|
|
3235
|
-
106,
|
|
3236
|
-
90,
|
|
3237
|
-
205
|
|
3238
|
-
],
|
|
3239
|
-
"slategray": [
|
|
3240
|
-
112,
|
|
3241
|
-
128,
|
|
3242
|
-
144
|
|
3243
|
-
],
|
|
3244
|
-
"slategrey": [
|
|
3245
|
-
112,
|
|
3246
|
-
128,
|
|
3247
|
-
144
|
|
3248
|
-
],
|
|
3249
|
-
"snow": [
|
|
3250
|
-
255,
|
|
3251
|
-
250,
|
|
3252
|
-
250
|
|
3253
|
-
],
|
|
3254
|
-
"springgreen": [
|
|
3255
|
-
0,
|
|
3256
|
-
255,
|
|
3257
|
-
127
|
|
3258
|
-
],
|
|
3259
|
-
"steelblue": [
|
|
3260
|
-
70,
|
|
3261
|
-
130,
|
|
3262
|
-
180
|
|
3263
|
-
],
|
|
3264
|
-
"tan": [
|
|
3265
|
-
210,
|
|
3266
|
-
180,
|
|
3267
|
-
140
|
|
3268
|
-
],
|
|
3269
|
-
"teal": [
|
|
3270
|
-
0,
|
|
3271
|
-
128,
|
|
3272
|
-
128
|
|
3273
|
-
],
|
|
3274
|
-
"thistle": [
|
|
3275
|
-
216,
|
|
3276
|
-
191,
|
|
3277
|
-
216
|
|
3278
|
-
],
|
|
3279
|
-
"tomato": [
|
|
3280
|
-
255,
|
|
3281
|
-
99,
|
|
3282
|
-
71
|
|
3283
|
-
],
|
|
3284
|
-
"turquoise": [
|
|
3285
|
-
64,
|
|
3286
|
-
224,
|
|
3287
|
-
208
|
|
3288
|
-
],
|
|
3289
|
-
"violet": [
|
|
3290
|
-
238,
|
|
3291
|
-
130,
|
|
3292
|
-
238
|
|
3293
|
-
],
|
|
3294
|
-
"wheat": [
|
|
3295
|
-
245,
|
|
3296
|
-
222,
|
|
3297
|
-
179
|
|
3298
|
-
],
|
|
3299
|
-
"white": [
|
|
3300
|
-
255,
|
|
3301
|
-
255,
|
|
3302
|
-
255
|
|
3303
|
-
],
|
|
3304
|
-
"whitesmoke": [
|
|
3305
|
-
245,
|
|
3306
|
-
245,
|
|
3307
|
-
245
|
|
3308
|
-
],
|
|
3309
|
-
"yellow": [
|
|
3310
|
-
255,
|
|
3311
|
-
255,
|
|
3312
|
-
0
|
|
3313
|
-
],
|
|
3314
|
-
"yellowgreen": [
|
|
3315
|
-
154,
|
|
3316
|
-
205,
|
|
3317
|
-
50
|
|
3318
|
-
]
|
|
3319
|
-
};
|
|
3320
|
-
}));
|
|
3321
|
-
//#endregion
|
|
3322
|
-
//#region node_modules/color-convert/conversions.js
|
|
3323
|
-
var require_conversions = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
3324
|
-
var cssKeywords = require_color_name();
|
|
3325
|
-
var reverseKeywords = {};
|
|
3326
|
-
for (const key of Object.keys(cssKeywords)) reverseKeywords[cssKeywords[key]] = key;
|
|
3327
|
-
var convert = {
|
|
3328
|
-
rgb: {
|
|
3329
|
-
channels: 3,
|
|
3330
|
-
labels: "rgb"
|
|
3331
|
-
},
|
|
3332
|
-
hsl: {
|
|
3333
|
-
channels: 3,
|
|
3334
|
-
labels: "hsl"
|
|
3335
|
-
},
|
|
3336
|
-
hsv: {
|
|
3337
|
-
channels: 3,
|
|
3338
|
-
labels: "hsv"
|
|
3339
|
-
},
|
|
3340
|
-
hwb: {
|
|
3341
|
-
channels: 3,
|
|
3342
|
-
labels: "hwb"
|
|
3343
|
-
},
|
|
3344
|
-
cmyk: {
|
|
3345
|
-
channels: 4,
|
|
3346
|
-
labels: "cmyk"
|
|
3347
|
-
},
|
|
3348
|
-
xyz: {
|
|
3349
|
-
channels: 3,
|
|
3350
|
-
labels: "xyz"
|
|
3351
|
-
},
|
|
3352
|
-
lab: {
|
|
3353
|
-
channels: 3,
|
|
3354
|
-
labels: "lab"
|
|
3355
|
-
},
|
|
3356
|
-
lch: {
|
|
3357
|
-
channels: 3,
|
|
3358
|
-
labels: "lch"
|
|
3359
|
-
},
|
|
3360
|
-
hex: {
|
|
3361
|
-
channels: 1,
|
|
3362
|
-
labels: ["hex"]
|
|
3363
|
-
},
|
|
3364
|
-
keyword: {
|
|
3365
|
-
channels: 1,
|
|
3366
|
-
labels: ["keyword"]
|
|
3367
|
-
},
|
|
3368
|
-
ansi16: {
|
|
3369
|
-
channels: 1,
|
|
3370
|
-
labels: ["ansi16"]
|
|
3371
|
-
},
|
|
3372
|
-
ansi256: {
|
|
3373
|
-
channels: 1,
|
|
3374
|
-
labels: ["ansi256"]
|
|
3375
|
-
},
|
|
3376
|
-
hcg: {
|
|
3377
|
-
channels: 3,
|
|
3378
|
-
labels: [
|
|
3379
|
-
"h",
|
|
3380
|
-
"c",
|
|
3381
|
-
"g"
|
|
3382
|
-
]
|
|
3383
|
-
},
|
|
3384
|
-
apple: {
|
|
3385
|
-
channels: 3,
|
|
3386
|
-
labels: [
|
|
3387
|
-
"r16",
|
|
3388
|
-
"g16",
|
|
3389
|
-
"b16"
|
|
3390
|
-
]
|
|
3391
|
-
},
|
|
3392
|
-
gray: {
|
|
3393
|
-
channels: 1,
|
|
3394
|
-
labels: ["gray"]
|
|
3395
|
-
}
|
|
3396
|
-
};
|
|
3397
|
-
module.exports = convert;
|
|
3398
|
-
for (const model of Object.keys(convert)) {
|
|
3399
|
-
if (!("channels" in convert[model])) throw new Error("missing channels property: " + model);
|
|
3400
|
-
if (!("labels" in convert[model])) throw new Error("missing channel labels property: " + model);
|
|
3401
|
-
if (convert[model].labels.length !== convert[model].channels) throw new Error("channel and label counts mismatch: " + model);
|
|
3402
|
-
const { channels, labels } = convert[model];
|
|
3403
|
-
delete convert[model].channels;
|
|
3404
|
-
delete convert[model].labels;
|
|
3405
|
-
Object.defineProperty(convert[model], "channels", { value: channels });
|
|
3406
|
-
Object.defineProperty(convert[model], "labels", { value: labels });
|
|
3407
|
-
}
|
|
3408
|
-
convert.rgb.hsl = function(rgb) {
|
|
3409
|
-
const r = rgb[0] / 255;
|
|
3410
|
-
const g = rgb[1] / 255;
|
|
3411
|
-
const b = rgb[2] / 255;
|
|
3412
|
-
const min = Math.min(r, g, b);
|
|
3413
|
-
const max = Math.max(r, g, b);
|
|
3414
|
-
const delta = max - min;
|
|
3415
|
-
let h;
|
|
3416
|
-
let s;
|
|
3417
|
-
if (max === min) h = 0;
|
|
3418
|
-
else if (r === max) h = (g - b) / delta;
|
|
3419
|
-
else if (g === max) h = 2 + (b - r) / delta;
|
|
3420
|
-
else if (b === max) h = 4 + (r - g) / delta;
|
|
3421
|
-
h = Math.min(h * 60, 360);
|
|
3422
|
-
if (h < 0) h += 360;
|
|
3423
|
-
const l = (min + max) / 2;
|
|
3424
|
-
if (max === min) s = 0;
|
|
3425
|
-
else if (l <= .5) s = delta / (max + min);
|
|
3426
|
-
else s = delta / (2 - max - min);
|
|
3427
|
-
return [
|
|
3428
|
-
h,
|
|
3429
|
-
s * 100,
|
|
3430
|
-
l * 100
|
|
3431
|
-
];
|
|
3432
|
-
};
|
|
3433
|
-
convert.rgb.hsv = function(rgb) {
|
|
3434
|
-
let rdif;
|
|
3435
|
-
let gdif;
|
|
3436
|
-
let bdif;
|
|
3437
|
-
let h;
|
|
3438
|
-
let s;
|
|
3439
|
-
const r = rgb[0] / 255;
|
|
3440
|
-
const g = rgb[1] / 255;
|
|
3441
|
-
const b = rgb[2] / 255;
|
|
3442
|
-
const v = Math.max(r, g, b);
|
|
3443
|
-
const diff = v - Math.min(r, g, b);
|
|
3444
|
-
const diffc = function(c) {
|
|
3445
|
-
return (v - c) / 6 / diff + 1 / 2;
|
|
3446
|
-
};
|
|
3447
|
-
if (diff === 0) {
|
|
3448
|
-
h = 0;
|
|
3449
|
-
s = 0;
|
|
3450
|
-
} else {
|
|
3451
|
-
s = diff / v;
|
|
3452
|
-
rdif = diffc(r);
|
|
3453
|
-
gdif = diffc(g);
|
|
3454
|
-
bdif = diffc(b);
|
|
3455
|
-
if (r === v) h = bdif - gdif;
|
|
3456
|
-
else if (g === v) h = 1 / 3 + rdif - bdif;
|
|
3457
|
-
else if (b === v) h = 2 / 3 + gdif - rdif;
|
|
3458
|
-
if (h < 0) h += 1;
|
|
3459
|
-
else if (h > 1) h -= 1;
|
|
3460
|
-
}
|
|
3461
|
-
return [
|
|
3462
|
-
h * 360,
|
|
3463
|
-
s * 100,
|
|
3464
|
-
v * 100
|
|
3465
|
-
];
|
|
3466
|
-
};
|
|
3467
|
-
convert.rgb.hwb = function(rgb) {
|
|
3468
|
-
const r = rgb[0];
|
|
3469
|
-
const g = rgb[1];
|
|
3470
|
-
let b = rgb[2];
|
|
3471
|
-
const h = convert.rgb.hsl(rgb)[0];
|
|
3472
|
-
const w = 1 / 255 * Math.min(r, Math.min(g, b));
|
|
3473
|
-
b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
|
|
3474
|
-
return [
|
|
3475
|
-
h,
|
|
3476
|
-
w * 100,
|
|
3477
|
-
b * 100
|
|
3478
|
-
];
|
|
3479
|
-
};
|
|
3480
|
-
convert.rgb.cmyk = function(rgb) {
|
|
3481
|
-
const r = rgb[0] / 255;
|
|
3482
|
-
const g = rgb[1] / 255;
|
|
3483
|
-
const b = rgb[2] / 255;
|
|
3484
|
-
const k = Math.min(1 - r, 1 - g, 1 - b);
|
|
3485
|
-
const c = (1 - r - k) / (1 - k) || 0;
|
|
3486
|
-
const m = (1 - g - k) / (1 - k) || 0;
|
|
3487
|
-
const y = (1 - b - k) / (1 - k) || 0;
|
|
3488
|
-
return [
|
|
3489
|
-
c * 100,
|
|
3490
|
-
m * 100,
|
|
3491
|
-
y * 100,
|
|
3492
|
-
k * 100
|
|
3493
|
-
];
|
|
3494
|
-
};
|
|
3495
|
-
function comparativeDistance(x, y) {
|
|
3496
|
-
return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
|
|
3497
|
-
}
|
|
3498
|
-
convert.rgb.keyword = function(rgb) {
|
|
3499
|
-
const reversed = reverseKeywords[rgb];
|
|
3500
|
-
if (reversed) return reversed;
|
|
3501
|
-
let currentClosestDistance = Infinity;
|
|
3502
|
-
let currentClosestKeyword;
|
|
3503
|
-
for (const keyword of Object.keys(cssKeywords)) {
|
|
3504
|
-
const value = cssKeywords[keyword];
|
|
3505
|
-
const distance = comparativeDistance(rgb, value);
|
|
3506
|
-
if (distance < currentClosestDistance) {
|
|
3507
|
-
currentClosestDistance = distance;
|
|
3508
|
-
currentClosestKeyword = keyword;
|
|
3509
|
-
}
|
|
3510
|
-
}
|
|
3511
|
-
return currentClosestKeyword;
|
|
3512
|
-
};
|
|
3513
|
-
convert.keyword.rgb = function(keyword) {
|
|
3514
|
-
return cssKeywords[keyword];
|
|
3515
|
-
};
|
|
3516
|
-
convert.rgb.xyz = function(rgb) {
|
|
3517
|
-
let r = rgb[0] / 255;
|
|
3518
|
-
let g = rgb[1] / 255;
|
|
3519
|
-
let b = rgb[2] / 255;
|
|
3520
|
-
r = r > .04045 ? ((r + .055) / 1.055) ** 2.4 : r / 12.92;
|
|
3521
|
-
g = g > .04045 ? ((g + .055) / 1.055) ** 2.4 : g / 12.92;
|
|
3522
|
-
b = b > .04045 ? ((b + .055) / 1.055) ** 2.4 : b / 12.92;
|
|
3523
|
-
const x = r * .4124 + g * .3576 + b * .1805;
|
|
3524
|
-
const y = r * .2126 + g * .7152 + b * .0722;
|
|
3525
|
-
const z = r * .0193 + g * .1192 + b * .9505;
|
|
3526
|
-
return [
|
|
3527
|
-
x * 100,
|
|
3528
|
-
y * 100,
|
|
3529
|
-
z * 100
|
|
3530
|
-
];
|
|
3531
|
-
};
|
|
3532
|
-
convert.rgb.lab = function(rgb) {
|
|
3533
|
-
const xyz = convert.rgb.xyz(rgb);
|
|
3534
|
-
let x = xyz[0];
|
|
3535
|
-
let y = xyz[1];
|
|
3536
|
-
let z = xyz[2];
|
|
3537
|
-
x /= 95.047;
|
|
3538
|
-
y /= 100;
|
|
3539
|
-
z /= 108.883;
|
|
3540
|
-
x = x > .008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
3541
|
-
y = y > .008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
3542
|
-
z = z > .008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
3543
|
-
return [
|
|
3544
|
-
116 * y - 16,
|
|
3545
|
-
500 * (x - y),
|
|
3546
|
-
200 * (y - z)
|
|
3547
|
-
];
|
|
3548
|
-
};
|
|
3549
|
-
convert.hsl.rgb = function(hsl) {
|
|
3550
|
-
const h = hsl[0] / 360;
|
|
3551
|
-
const s = hsl[1] / 100;
|
|
3552
|
-
const l = hsl[2] / 100;
|
|
3553
|
-
let t2;
|
|
3554
|
-
let t3;
|
|
3555
|
-
let val;
|
|
3556
|
-
if (s === 0) {
|
|
3557
|
-
val = l * 255;
|
|
3558
|
-
return [
|
|
3559
|
-
val,
|
|
3560
|
-
val,
|
|
3561
|
-
val
|
|
3562
|
-
];
|
|
3563
|
-
}
|
|
3564
|
-
if (l < .5) t2 = l * (1 + s);
|
|
3565
|
-
else t2 = l + s - l * s;
|
|
3566
|
-
const t1 = 2 * l - t2;
|
|
3567
|
-
const rgb = [
|
|
3568
|
-
0,
|
|
3569
|
-
0,
|
|
3570
|
-
0
|
|
3571
|
-
];
|
|
3572
|
-
for (let i = 0; i < 3; i++) {
|
|
3573
|
-
t3 = h + 1 / 3 * -(i - 1);
|
|
3574
|
-
if (t3 < 0) t3++;
|
|
3575
|
-
if (t3 > 1) t3--;
|
|
3576
|
-
if (6 * t3 < 1) val = t1 + (t2 - t1) * 6 * t3;
|
|
3577
|
-
else if (2 * t3 < 1) val = t2;
|
|
3578
|
-
else if (3 * t3 < 2) val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
|
3579
|
-
else val = t1;
|
|
3580
|
-
rgb[i] = val * 255;
|
|
3581
|
-
}
|
|
3582
|
-
return rgb;
|
|
3583
|
-
};
|
|
3584
|
-
convert.hsl.hsv = function(hsl) {
|
|
3585
|
-
const h = hsl[0];
|
|
3586
|
-
let s = hsl[1] / 100;
|
|
3587
|
-
let l = hsl[2] / 100;
|
|
3588
|
-
let smin = s;
|
|
3589
|
-
const lmin = Math.max(l, .01);
|
|
3590
|
-
l *= 2;
|
|
3591
|
-
s *= l <= 1 ? l : 2 - l;
|
|
3592
|
-
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
3593
|
-
const v = (l + s) / 2;
|
|
3594
|
-
return [
|
|
3595
|
-
h,
|
|
3596
|
-
(l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s)) * 100,
|
|
3597
|
-
v * 100
|
|
3598
|
-
];
|
|
3599
|
-
};
|
|
3600
|
-
convert.hsv.rgb = function(hsv) {
|
|
3601
|
-
const h = hsv[0] / 60;
|
|
3602
|
-
const s = hsv[1] / 100;
|
|
3603
|
-
let v = hsv[2] / 100;
|
|
3604
|
-
const hi = Math.floor(h) % 6;
|
|
3605
|
-
const f = h - Math.floor(h);
|
|
3606
|
-
const p = 255 * v * (1 - s);
|
|
3607
|
-
const q = 255 * v * (1 - s * f);
|
|
3608
|
-
const t = 255 * v * (1 - s * (1 - f));
|
|
3609
|
-
v *= 255;
|
|
3610
|
-
switch (hi) {
|
|
3611
|
-
case 0: return [
|
|
3612
|
-
v,
|
|
3613
|
-
t,
|
|
3614
|
-
p
|
|
3615
|
-
];
|
|
3616
|
-
case 1: return [
|
|
3617
|
-
q,
|
|
3618
|
-
v,
|
|
3619
|
-
p
|
|
3620
|
-
];
|
|
3621
|
-
case 2: return [
|
|
3622
|
-
p,
|
|
3623
|
-
v,
|
|
3624
|
-
t
|
|
3625
|
-
];
|
|
3626
|
-
case 3: return [
|
|
3627
|
-
p,
|
|
3628
|
-
q,
|
|
3629
|
-
v
|
|
3630
|
-
];
|
|
3631
|
-
case 4: return [
|
|
3632
|
-
t,
|
|
3633
|
-
p,
|
|
3634
|
-
v
|
|
3635
|
-
];
|
|
3636
|
-
case 5: return [
|
|
3637
|
-
v,
|
|
3638
|
-
p,
|
|
3639
|
-
q
|
|
3640
|
-
];
|
|
3641
|
-
}
|
|
3642
|
-
};
|
|
3643
|
-
convert.hsv.hsl = function(hsv) {
|
|
3644
|
-
const h = hsv[0];
|
|
3645
|
-
const s = hsv[1] / 100;
|
|
3646
|
-
const v = hsv[2] / 100;
|
|
3647
|
-
const vmin = Math.max(v, .01);
|
|
3648
|
-
let sl;
|
|
3649
|
-
let l;
|
|
3650
|
-
l = (2 - s) * v;
|
|
3651
|
-
const lmin = (2 - s) * vmin;
|
|
3652
|
-
sl = s * vmin;
|
|
3653
|
-
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
3654
|
-
sl = sl || 0;
|
|
3655
|
-
l /= 2;
|
|
3656
|
-
return [
|
|
3657
|
-
h,
|
|
3658
|
-
sl * 100,
|
|
3659
|
-
l * 100
|
|
3660
|
-
];
|
|
3661
|
-
};
|
|
3662
|
-
convert.hwb.rgb = function(hwb) {
|
|
3663
|
-
const h = hwb[0] / 360;
|
|
3664
|
-
let wh = hwb[1] / 100;
|
|
3665
|
-
let bl = hwb[2] / 100;
|
|
3666
|
-
const ratio = wh + bl;
|
|
3667
|
-
let f;
|
|
3668
|
-
if (ratio > 1) {
|
|
3669
|
-
wh /= ratio;
|
|
3670
|
-
bl /= ratio;
|
|
3671
|
-
}
|
|
3672
|
-
const i = Math.floor(6 * h);
|
|
3673
|
-
const v = 1 - bl;
|
|
3674
|
-
f = 6 * h - i;
|
|
3675
|
-
if ((i & 1) !== 0) f = 1 - f;
|
|
3676
|
-
const n = wh + f * (v - wh);
|
|
3677
|
-
let r;
|
|
3678
|
-
let g;
|
|
3679
|
-
let b;
|
|
3680
|
-
switch (i) {
|
|
3681
|
-
default:
|
|
3682
|
-
case 6:
|
|
3683
|
-
case 0:
|
|
3684
|
-
r = v;
|
|
3685
|
-
g = n;
|
|
3686
|
-
b = wh;
|
|
3687
|
-
break;
|
|
3688
|
-
case 1:
|
|
3689
|
-
r = n;
|
|
3690
|
-
g = v;
|
|
3691
|
-
b = wh;
|
|
3692
|
-
break;
|
|
3693
|
-
case 2:
|
|
3694
|
-
r = wh;
|
|
3695
|
-
g = v;
|
|
3696
|
-
b = n;
|
|
3697
|
-
break;
|
|
3698
|
-
case 3:
|
|
3699
|
-
r = wh;
|
|
3700
|
-
g = n;
|
|
3701
|
-
b = v;
|
|
3702
|
-
break;
|
|
3703
|
-
case 4:
|
|
3704
|
-
r = n;
|
|
3705
|
-
g = wh;
|
|
3706
|
-
b = v;
|
|
3707
|
-
break;
|
|
3708
|
-
case 5:
|
|
3709
|
-
r = v;
|
|
3710
|
-
g = wh;
|
|
3711
|
-
b = n;
|
|
3712
|
-
break;
|
|
3713
|
-
}
|
|
3714
|
-
return [
|
|
3715
|
-
r * 255,
|
|
3716
|
-
g * 255,
|
|
3717
|
-
b * 255
|
|
3718
|
-
];
|
|
3719
|
-
};
|
|
3720
|
-
convert.cmyk.rgb = function(cmyk) {
|
|
3721
|
-
const c = cmyk[0] / 100;
|
|
3722
|
-
const m = cmyk[1] / 100;
|
|
3723
|
-
const y = cmyk[2] / 100;
|
|
3724
|
-
const k = cmyk[3] / 100;
|
|
3725
|
-
const r = 1 - Math.min(1, c * (1 - k) + k);
|
|
3726
|
-
const g = 1 - Math.min(1, m * (1 - k) + k);
|
|
3727
|
-
const b = 1 - Math.min(1, y * (1 - k) + k);
|
|
3728
|
-
return [
|
|
3729
|
-
r * 255,
|
|
3730
|
-
g * 255,
|
|
3731
|
-
b * 255
|
|
3732
|
-
];
|
|
3733
|
-
};
|
|
3734
|
-
convert.xyz.rgb = function(xyz) {
|
|
3735
|
-
const x = xyz[0] / 100;
|
|
3736
|
-
const y = xyz[1] / 100;
|
|
3737
|
-
const z = xyz[2] / 100;
|
|
3738
|
-
let r;
|
|
3739
|
-
let g;
|
|
3740
|
-
let b;
|
|
3741
|
-
r = x * 3.2406 + y * -1.5372 + z * -.4986;
|
|
3742
|
-
g = x * -.9689 + y * 1.8758 + z * .0415;
|
|
3743
|
-
b = x * .0557 + y * -.204 + z * 1.057;
|
|
3744
|
-
r = r > .0031308 ? 1.055 * r ** (1 / 2.4) - .055 : r * 12.92;
|
|
3745
|
-
g = g > .0031308 ? 1.055 * g ** (1 / 2.4) - .055 : g * 12.92;
|
|
3746
|
-
b = b > .0031308 ? 1.055 * b ** (1 / 2.4) - .055 : b * 12.92;
|
|
3747
|
-
r = Math.min(Math.max(0, r), 1);
|
|
3748
|
-
g = Math.min(Math.max(0, g), 1);
|
|
3749
|
-
b = Math.min(Math.max(0, b), 1);
|
|
3750
|
-
return [
|
|
3751
|
-
r * 255,
|
|
3752
|
-
g * 255,
|
|
3753
|
-
b * 255
|
|
3754
|
-
];
|
|
3755
|
-
};
|
|
3756
|
-
convert.xyz.lab = function(xyz) {
|
|
3757
|
-
let x = xyz[0];
|
|
3758
|
-
let y = xyz[1];
|
|
3759
|
-
let z = xyz[2];
|
|
3760
|
-
x /= 95.047;
|
|
3761
|
-
y /= 100;
|
|
3762
|
-
z /= 108.883;
|
|
3763
|
-
x = x > .008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
3764
|
-
y = y > .008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
3765
|
-
z = z > .008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
3766
|
-
return [
|
|
3767
|
-
116 * y - 16,
|
|
3768
|
-
500 * (x - y),
|
|
3769
|
-
200 * (y - z)
|
|
3770
|
-
];
|
|
3771
|
-
};
|
|
3772
|
-
convert.lab.xyz = function(lab) {
|
|
3773
|
-
const l = lab[0];
|
|
3774
|
-
const a = lab[1];
|
|
3775
|
-
const b = lab[2];
|
|
3776
|
-
let x;
|
|
3777
|
-
let y;
|
|
3778
|
-
let z;
|
|
3779
|
-
y = (l + 16) / 116;
|
|
3780
|
-
x = a / 500 + y;
|
|
3781
|
-
z = y - b / 200;
|
|
3782
|
-
const y2 = y ** 3;
|
|
3783
|
-
const x2 = x ** 3;
|
|
3784
|
-
const z2 = z ** 3;
|
|
3785
|
-
y = y2 > .008856 ? y2 : (y - 16 / 116) / 7.787;
|
|
3786
|
-
x = x2 > .008856 ? x2 : (x - 16 / 116) / 7.787;
|
|
3787
|
-
z = z2 > .008856 ? z2 : (z - 16 / 116) / 7.787;
|
|
3788
|
-
x *= 95.047;
|
|
3789
|
-
y *= 100;
|
|
3790
|
-
z *= 108.883;
|
|
3791
|
-
return [
|
|
3792
|
-
x,
|
|
3793
|
-
y,
|
|
3794
|
-
z
|
|
3795
|
-
];
|
|
3796
|
-
};
|
|
3797
|
-
convert.lab.lch = function(lab) {
|
|
3798
|
-
const l = lab[0];
|
|
3799
|
-
const a = lab[1];
|
|
3800
|
-
const b = lab[2];
|
|
3801
|
-
let h;
|
|
3802
|
-
h = Math.atan2(b, a) * 360 / 2 / Math.PI;
|
|
3803
|
-
if (h < 0) h += 360;
|
|
3804
|
-
return [
|
|
3805
|
-
l,
|
|
3806
|
-
Math.sqrt(a * a + b * b),
|
|
3807
|
-
h
|
|
3808
|
-
];
|
|
3809
|
-
};
|
|
3810
|
-
convert.lch.lab = function(lch) {
|
|
3811
|
-
const l = lch[0];
|
|
3812
|
-
const c = lch[1];
|
|
3813
|
-
const hr = lch[2] / 360 * 2 * Math.PI;
|
|
3814
|
-
return [
|
|
3815
|
-
l,
|
|
3816
|
-
c * Math.cos(hr),
|
|
3817
|
-
c * Math.sin(hr)
|
|
3818
|
-
];
|
|
3819
|
-
};
|
|
3820
|
-
convert.rgb.ansi16 = function(args, saturation = null) {
|
|
3821
|
-
const [r, g, b] = args;
|
|
3822
|
-
let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
|
|
3823
|
-
value = Math.round(value / 50);
|
|
3824
|
-
if (value === 0) return 30;
|
|
3825
|
-
let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
|
|
3826
|
-
if (value === 2) ansi += 60;
|
|
3827
|
-
return ansi;
|
|
3828
|
-
};
|
|
3829
|
-
convert.hsv.ansi16 = function(args) {
|
|
3830
|
-
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
|
3831
|
-
};
|
|
3832
|
-
convert.rgb.ansi256 = function(args) {
|
|
3833
|
-
const r = args[0];
|
|
3834
|
-
const g = args[1];
|
|
3835
|
-
const b = args[2];
|
|
3836
|
-
if (r === g && g === b) {
|
|
3837
|
-
if (r < 8) return 16;
|
|
3838
|
-
if (r > 248) return 231;
|
|
3839
|
-
return Math.round((r - 8) / 247 * 24) + 232;
|
|
3840
|
-
}
|
|
3841
|
-
return 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
|
|
3842
|
-
};
|
|
3843
|
-
convert.ansi16.rgb = function(args) {
|
|
3844
|
-
let color = args % 10;
|
|
3845
|
-
if (color === 0 || color === 7) {
|
|
3846
|
-
if (args > 50) color += 3.5;
|
|
3847
|
-
color = color / 10.5 * 255;
|
|
3848
|
-
return [
|
|
3849
|
-
color,
|
|
3850
|
-
color,
|
|
3851
|
-
color
|
|
3852
|
-
];
|
|
3853
|
-
}
|
|
3854
|
-
const mult = (~~(args > 50) + 1) * .5;
|
|
3855
|
-
return [
|
|
3856
|
-
(color & 1) * mult * 255,
|
|
3857
|
-
(color >> 1 & 1) * mult * 255,
|
|
3858
|
-
(color >> 2 & 1) * mult * 255
|
|
3859
|
-
];
|
|
3860
|
-
};
|
|
3861
|
-
convert.ansi256.rgb = function(args) {
|
|
3862
|
-
if (args >= 232) {
|
|
3863
|
-
const c = (args - 232) * 10 + 8;
|
|
3864
|
-
return [
|
|
3865
|
-
c,
|
|
3866
|
-
c,
|
|
3867
|
-
c
|
|
3868
|
-
];
|
|
3869
|
-
}
|
|
3870
|
-
args -= 16;
|
|
3871
|
-
let rem;
|
|
3872
|
-
return [
|
|
3873
|
-
Math.floor(args / 36) / 5 * 255,
|
|
3874
|
-
Math.floor((rem = args % 36) / 6) / 5 * 255,
|
|
3875
|
-
rem % 6 / 5 * 255
|
|
3876
|
-
];
|
|
3877
|
-
};
|
|
3878
|
-
convert.rgb.hex = function(args) {
|
|
3879
|
-
const string = (((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255)).toString(16).toUpperCase();
|
|
3880
|
-
return "000000".substring(string.length) + string;
|
|
3881
|
-
};
|
|
3882
|
-
convert.hex.rgb = function(args) {
|
|
3883
|
-
const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
3884
|
-
if (!match) return [
|
|
3885
|
-
0,
|
|
3886
|
-
0,
|
|
3887
|
-
0
|
|
3888
|
-
];
|
|
3889
|
-
let colorString = match[0];
|
|
3890
|
-
if (match[0].length === 3) colorString = colorString.split("").map((char) => {
|
|
3891
|
-
return char + char;
|
|
3892
|
-
}).join("");
|
|
3893
|
-
const integer = parseInt(colorString, 16);
|
|
3894
|
-
return [
|
|
3895
|
-
integer >> 16 & 255,
|
|
3896
|
-
integer >> 8 & 255,
|
|
3897
|
-
integer & 255
|
|
3898
|
-
];
|
|
3899
|
-
};
|
|
3900
|
-
convert.rgb.hcg = function(rgb) {
|
|
3901
|
-
const r = rgb[0] / 255;
|
|
3902
|
-
const g = rgb[1] / 255;
|
|
3903
|
-
const b = rgb[2] / 255;
|
|
3904
|
-
const max = Math.max(Math.max(r, g), b);
|
|
3905
|
-
const min = Math.min(Math.min(r, g), b);
|
|
3906
|
-
const chroma = max - min;
|
|
3907
|
-
let grayscale;
|
|
3908
|
-
let hue;
|
|
3909
|
-
if (chroma < 1) grayscale = min / (1 - chroma);
|
|
3910
|
-
else grayscale = 0;
|
|
3911
|
-
if (chroma <= 0) hue = 0;
|
|
3912
|
-
else if (max === r) hue = (g - b) / chroma % 6;
|
|
3913
|
-
else if (max === g) hue = 2 + (b - r) / chroma;
|
|
3914
|
-
else hue = 4 + (r - g) / chroma;
|
|
3915
|
-
hue /= 6;
|
|
3916
|
-
hue %= 1;
|
|
3917
|
-
return [
|
|
3918
|
-
hue * 360,
|
|
3919
|
-
chroma * 100,
|
|
3920
|
-
grayscale * 100
|
|
3921
|
-
];
|
|
3922
|
-
};
|
|
3923
|
-
convert.hsl.hcg = function(hsl) {
|
|
3924
|
-
const s = hsl[1] / 100;
|
|
3925
|
-
const l = hsl[2] / 100;
|
|
3926
|
-
const c = l < .5 ? 2 * s * l : 2 * s * (1 - l);
|
|
3927
|
-
let f = 0;
|
|
3928
|
-
if (c < 1) f = (l - .5 * c) / (1 - c);
|
|
3929
|
-
return [
|
|
3930
|
-
hsl[0],
|
|
3931
|
-
c * 100,
|
|
3932
|
-
f * 100
|
|
3933
|
-
];
|
|
3934
|
-
};
|
|
3935
|
-
convert.hsv.hcg = function(hsv) {
|
|
3936
|
-
const s = hsv[1] / 100;
|
|
3937
|
-
const v = hsv[2] / 100;
|
|
3938
|
-
const c = s * v;
|
|
3939
|
-
let f = 0;
|
|
3940
|
-
if (c < 1) f = (v - c) / (1 - c);
|
|
3941
|
-
return [
|
|
3942
|
-
hsv[0],
|
|
3943
|
-
c * 100,
|
|
3944
|
-
f * 100
|
|
3945
|
-
];
|
|
3946
|
-
};
|
|
3947
|
-
convert.hcg.rgb = function(hcg) {
|
|
3948
|
-
const h = hcg[0] / 360;
|
|
3949
|
-
const c = hcg[1] / 100;
|
|
3950
|
-
const g = hcg[2] / 100;
|
|
3951
|
-
if (c === 0) return [
|
|
3952
|
-
g * 255,
|
|
3953
|
-
g * 255,
|
|
3954
|
-
g * 255
|
|
3955
|
-
];
|
|
3956
|
-
const pure = [
|
|
3957
|
-
0,
|
|
3958
|
-
0,
|
|
3959
|
-
0
|
|
3960
|
-
];
|
|
3961
|
-
const hi = h % 1 * 6;
|
|
3962
|
-
const v = hi % 1;
|
|
3963
|
-
const w = 1 - v;
|
|
3964
|
-
let mg = 0;
|
|
3965
|
-
switch (Math.floor(hi)) {
|
|
3966
|
-
case 0:
|
|
3967
|
-
pure[0] = 1;
|
|
3968
|
-
pure[1] = v;
|
|
3969
|
-
pure[2] = 0;
|
|
3970
|
-
break;
|
|
3971
|
-
case 1:
|
|
3972
|
-
pure[0] = w;
|
|
3973
|
-
pure[1] = 1;
|
|
3974
|
-
pure[2] = 0;
|
|
3975
|
-
break;
|
|
3976
|
-
case 2:
|
|
3977
|
-
pure[0] = 0;
|
|
3978
|
-
pure[1] = 1;
|
|
3979
|
-
pure[2] = v;
|
|
3980
|
-
break;
|
|
3981
|
-
case 3:
|
|
3982
|
-
pure[0] = 0;
|
|
3983
|
-
pure[1] = w;
|
|
3984
|
-
pure[2] = 1;
|
|
3985
|
-
break;
|
|
3986
|
-
case 4:
|
|
3987
|
-
pure[0] = v;
|
|
3988
|
-
pure[1] = 0;
|
|
3989
|
-
pure[2] = 1;
|
|
3990
|
-
break;
|
|
3991
|
-
default:
|
|
3992
|
-
pure[0] = 1;
|
|
3993
|
-
pure[1] = 0;
|
|
3994
|
-
pure[2] = w;
|
|
3995
|
-
}
|
|
3996
|
-
mg = (1 - c) * g;
|
|
3997
|
-
return [
|
|
3998
|
-
(c * pure[0] + mg) * 255,
|
|
3999
|
-
(c * pure[1] + mg) * 255,
|
|
4000
|
-
(c * pure[2] + mg) * 255
|
|
4001
|
-
];
|
|
4002
|
-
};
|
|
4003
|
-
convert.hcg.hsv = function(hcg) {
|
|
4004
|
-
const c = hcg[1] / 100;
|
|
4005
|
-
const v = c + hcg[2] / 100 * (1 - c);
|
|
4006
|
-
let f = 0;
|
|
4007
|
-
if (v > 0) f = c / v;
|
|
4008
|
-
return [
|
|
4009
|
-
hcg[0],
|
|
4010
|
-
f * 100,
|
|
4011
|
-
v * 100
|
|
4012
|
-
];
|
|
4013
|
-
};
|
|
4014
|
-
convert.hcg.hsl = function(hcg) {
|
|
4015
|
-
const c = hcg[1] / 100;
|
|
4016
|
-
const l = hcg[2] / 100 * (1 - c) + .5 * c;
|
|
4017
|
-
let s = 0;
|
|
4018
|
-
if (l > 0 && l < .5) s = c / (2 * l);
|
|
4019
|
-
else if (l >= .5 && l < 1) s = c / (2 * (1 - l));
|
|
4020
|
-
return [
|
|
4021
|
-
hcg[0],
|
|
4022
|
-
s * 100,
|
|
4023
|
-
l * 100
|
|
4024
|
-
];
|
|
4025
|
-
};
|
|
4026
|
-
convert.hcg.hwb = function(hcg) {
|
|
4027
|
-
const c = hcg[1] / 100;
|
|
4028
|
-
const v = c + hcg[2] / 100 * (1 - c);
|
|
4029
|
-
return [
|
|
4030
|
-
hcg[0],
|
|
4031
|
-
(v - c) * 100,
|
|
4032
|
-
(1 - v) * 100
|
|
4033
|
-
];
|
|
4034
|
-
};
|
|
4035
|
-
convert.hwb.hcg = function(hwb) {
|
|
4036
|
-
const w = hwb[1] / 100;
|
|
4037
|
-
const v = 1 - hwb[2] / 100;
|
|
4038
|
-
const c = v - w;
|
|
4039
|
-
let g = 0;
|
|
4040
|
-
if (c < 1) g = (v - c) / (1 - c);
|
|
4041
|
-
return [
|
|
4042
|
-
hwb[0],
|
|
4043
|
-
c * 100,
|
|
4044
|
-
g * 100
|
|
4045
|
-
];
|
|
4046
|
-
};
|
|
4047
|
-
convert.apple.rgb = function(apple) {
|
|
4048
|
-
return [
|
|
4049
|
-
apple[0] / 65535 * 255,
|
|
4050
|
-
apple[1] / 65535 * 255,
|
|
4051
|
-
apple[2] / 65535 * 255
|
|
4052
|
-
];
|
|
4053
|
-
};
|
|
4054
|
-
convert.rgb.apple = function(rgb) {
|
|
4055
|
-
return [
|
|
4056
|
-
rgb[0] / 255 * 65535,
|
|
4057
|
-
rgb[1] / 255 * 65535,
|
|
4058
|
-
rgb[2] / 255 * 65535
|
|
4059
|
-
];
|
|
4060
|
-
};
|
|
4061
|
-
convert.gray.rgb = function(args) {
|
|
4062
|
-
return [
|
|
4063
|
-
args[0] / 100 * 255,
|
|
4064
|
-
args[0] / 100 * 255,
|
|
4065
|
-
args[0] / 100 * 255
|
|
4066
|
-
];
|
|
4067
|
-
};
|
|
4068
|
-
convert.gray.hsl = function(args) {
|
|
4069
|
-
return [
|
|
4070
|
-
0,
|
|
4071
|
-
0,
|
|
4072
|
-
args[0]
|
|
4073
|
-
];
|
|
4074
|
-
};
|
|
4075
|
-
convert.gray.hsv = convert.gray.hsl;
|
|
4076
|
-
convert.gray.hwb = function(gray) {
|
|
4077
|
-
return [
|
|
4078
|
-
0,
|
|
4079
|
-
100,
|
|
4080
|
-
gray[0]
|
|
4081
|
-
];
|
|
4082
|
-
};
|
|
4083
|
-
convert.gray.cmyk = function(gray) {
|
|
4084
|
-
return [
|
|
4085
|
-
0,
|
|
4086
|
-
0,
|
|
4087
|
-
0,
|
|
4088
|
-
gray[0]
|
|
4089
|
-
];
|
|
4090
|
-
};
|
|
4091
|
-
convert.gray.lab = function(gray) {
|
|
4092
|
-
return [
|
|
4093
|
-
gray[0],
|
|
4094
|
-
0,
|
|
4095
|
-
0
|
|
4096
|
-
];
|
|
4097
|
-
};
|
|
4098
|
-
convert.gray.hex = function(gray) {
|
|
4099
|
-
const val = Math.round(gray[0] / 100 * 255) & 255;
|
|
4100
|
-
const string = ((val << 16) + (val << 8) + val).toString(16).toUpperCase();
|
|
4101
|
-
return "000000".substring(string.length) + string;
|
|
4102
|
-
};
|
|
4103
|
-
convert.rgb.gray = function(rgb) {
|
|
4104
|
-
return [(rgb[0] + rgb[1] + rgb[2]) / 3 / 255 * 100];
|
|
4105
|
-
};
|
|
4106
|
-
}));
|
|
4107
|
-
//#endregion
|
|
4108
|
-
//#region node_modules/color-convert/route.js
|
|
4109
|
-
var require_route = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
4110
|
-
var conversions = require_conversions();
|
|
4111
|
-
function buildGraph() {
|
|
4112
|
-
const graph = {};
|
|
4113
|
-
const models = Object.keys(conversions);
|
|
4114
|
-
for (let len = models.length, i = 0; i < len; i++) graph[models[i]] = {
|
|
4115
|
-
distance: -1,
|
|
4116
|
-
parent: null
|
|
4117
|
-
};
|
|
4118
|
-
return graph;
|
|
4119
|
-
}
|
|
4120
|
-
function deriveBFS(fromModel) {
|
|
4121
|
-
const graph = buildGraph();
|
|
4122
|
-
const queue = [fromModel];
|
|
4123
|
-
graph[fromModel].distance = 0;
|
|
4124
|
-
while (queue.length) {
|
|
4125
|
-
const current = queue.pop();
|
|
4126
|
-
const adjacents = Object.keys(conversions[current]);
|
|
4127
|
-
for (let len = adjacents.length, i = 0; i < len; i++) {
|
|
4128
|
-
const adjacent = adjacents[i];
|
|
4129
|
-
const node = graph[adjacent];
|
|
4130
|
-
if (node.distance === -1) {
|
|
4131
|
-
node.distance = graph[current].distance + 1;
|
|
4132
|
-
node.parent = current;
|
|
4133
|
-
queue.unshift(adjacent);
|
|
4134
|
-
}
|
|
4135
|
-
}
|
|
4136
|
-
}
|
|
4137
|
-
return graph;
|
|
4138
|
-
}
|
|
4139
|
-
function link(from, to) {
|
|
4140
|
-
return function(args) {
|
|
4141
|
-
return to(from(args));
|
|
4142
|
-
};
|
|
4143
|
-
}
|
|
4144
|
-
function wrapConversion(toModel, graph) {
|
|
4145
|
-
const path = [graph[toModel].parent, toModel];
|
|
4146
|
-
let fn = conversions[graph[toModel].parent][toModel];
|
|
4147
|
-
let cur = graph[toModel].parent;
|
|
4148
|
-
while (graph[cur].parent) {
|
|
4149
|
-
path.unshift(graph[cur].parent);
|
|
4150
|
-
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
4151
|
-
cur = graph[cur].parent;
|
|
4152
|
-
}
|
|
4153
|
-
fn.conversion = path;
|
|
4154
|
-
return fn;
|
|
848
|
+
})))(), 1);
|
|
849
|
+
var ANSI_BACKGROUND_OFFSET = 10;
|
|
850
|
+
var wrapAnsi16 = (offset = 0) => (code) => `\u001B[${code + offset}m`;
|
|
851
|
+
var wrapAnsi256 = (offset = 0) => (code) => `\u001B[${38 + offset};5;${code}m`;
|
|
852
|
+
var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`;
|
|
853
|
+
var styles$1 = {
|
|
854
|
+
modifier: {
|
|
855
|
+
reset: [0, 0],
|
|
856
|
+
bold: [1, 22],
|
|
857
|
+
dim: [2, 22],
|
|
858
|
+
italic: [3, 23],
|
|
859
|
+
underline: [4, 24],
|
|
860
|
+
overline: [53, 55],
|
|
861
|
+
inverse: [7, 27],
|
|
862
|
+
hidden: [8, 28],
|
|
863
|
+
strikethrough: [9, 29]
|
|
864
|
+
},
|
|
865
|
+
color: {
|
|
866
|
+
black: [30, 39],
|
|
867
|
+
red: [31, 39],
|
|
868
|
+
green: [32, 39],
|
|
869
|
+
yellow: [33, 39],
|
|
870
|
+
blue: [34, 39],
|
|
871
|
+
magenta: [35, 39],
|
|
872
|
+
cyan: [36, 39],
|
|
873
|
+
white: [37, 39],
|
|
874
|
+
blackBright: [90, 39],
|
|
875
|
+
gray: [90, 39],
|
|
876
|
+
grey: [90, 39],
|
|
877
|
+
redBright: [91, 39],
|
|
878
|
+
greenBright: [92, 39],
|
|
879
|
+
yellowBright: [93, 39],
|
|
880
|
+
blueBright: [94, 39],
|
|
881
|
+
magentaBright: [95, 39],
|
|
882
|
+
cyanBright: [96, 39],
|
|
883
|
+
whiteBright: [97, 39]
|
|
884
|
+
},
|
|
885
|
+
bgColor: {
|
|
886
|
+
bgBlack: [40, 49],
|
|
887
|
+
bgRed: [41, 49],
|
|
888
|
+
bgGreen: [42, 49],
|
|
889
|
+
bgYellow: [43, 49],
|
|
890
|
+
bgBlue: [44, 49],
|
|
891
|
+
bgMagenta: [45, 49],
|
|
892
|
+
bgCyan: [46, 49],
|
|
893
|
+
bgWhite: [47, 49],
|
|
894
|
+
bgBlackBright: [100, 49],
|
|
895
|
+
bgGray: [100, 49],
|
|
896
|
+
bgGrey: [100, 49],
|
|
897
|
+
bgRedBright: [101, 49],
|
|
898
|
+
bgGreenBright: [102, 49],
|
|
899
|
+
bgYellowBright: [103, 49],
|
|
900
|
+
bgBlueBright: [104, 49],
|
|
901
|
+
bgMagentaBright: [105, 49],
|
|
902
|
+
bgCyanBright: [106, 49],
|
|
903
|
+
bgWhiteBright: [107, 49]
|
|
4155
904
|
}
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
905
|
+
};
|
|
906
|
+
Object.keys(styles$1.modifier);
|
|
907
|
+
var foregroundColorNames = Object.keys(styles$1.color);
|
|
908
|
+
var backgroundColorNames = Object.keys(styles$1.bgColor);
|
|
909
|
+
[...foregroundColorNames, ...backgroundColorNames];
|
|
910
|
+
function assembleStyles() {
|
|
911
|
+
const codes = /* @__PURE__ */ new Map();
|
|
912
|
+
for (const [groupName, group] of Object.entries(styles$1)) {
|
|
913
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
914
|
+
styles$1[styleName] = {
|
|
915
|
+
open: `\u001B[${style[0]}m`,
|
|
916
|
+
close: `\u001B[${style[1]}m`
|
|
917
|
+
};
|
|
918
|
+
group[styleName] = styles$1[styleName];
|
|
919
|
+
codes.set(style[0], style[1]);
|
|
4164
920
|
}
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
//#endregion
|
|
4169
|
-
//#region node_modules/color-convert/index.js
|
|
4170
|
-
var require_color_convert = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
4171
|
-
var conversions = require_conversions();
|
|
4172
|
-
var route = require_route();
|
|
4173
|
-
var convert = {};
|
|
4174
|
-
var models = Object.keys(conversions);
|
|
4175
|
-
function wrapRaw(fn) {
|
|
4176
|
-
const wrappedFn = function(...args) {
|
|
4177
|
-
const arg0 = args[0];
|
|
4178
|
-
if (arg0 === void 0 || arg0 === null) return arg0;
|
|
4179
|
-
if (arg0.length > 1) args = arg0;
|
|
4180
|
-
return fn(args);
|
|
4181
|
-
};
|
|
4182
|
-
if ("conversion" in fn) wrappedFn.conversion = fn.conversion;
|
|
4183
|
-
return wrappedFn;
|
|
4184
|
-
}
|
|
4185
|
-
function wrapRounded(fn) {
|
|
4186
|
-
const wrappedFn = function(...args) {
|
|
4187
|
-
const arg0 = args[0];
|
|
4188
|
-
if (arg0 === void 0 || arg0 === null) return arg0;
|
|
4189
|
-
if (arg0.length > 1) args = arg0;
|
|
4190
|
-
const result = fn(args);
|
|
4191
|
-
if (typeof result === "object") for (let len = result.length, i = 0; i < len; i++) result[i] = Math.round(result[i]);
|
|
4192
|
-
return result;
|
|
4193
|
-
};
|
|
4194
|
-
if ("conversion" in fn) wrappedFn.conversion = fn.conversion;
|
|
4195
|
-
return wrappedFn;
|
|
4196
|
-
}
|
|
4197
|
-
models.forEach((fromModel) => {
|
|
4198
|
-
convert[fromModel] = {};
|
|
4199
|
-
Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels });
|
|
4200
|
-
Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels });
|
|
4201
|
-
const routes = route(fromModel);
|
|
4202
|
-
Object.keys(routes).forEach((toModel) => {
|
|
4203
|
-
const fn = routes[toModel];
|
|
4204
|
-
convert[fromModel][toModel] = wrapRounded(fn);
|
|
4205
|
-
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
921
|
+
Object.defineProperty(styles$1, groupName, {
|
|
922
|
+
value: group,
|
|
923
|
+
enumerable: false
|
|
4206
924
|
});
|
|
925
|
+
}
|
|
926
|
+
Object.defineProperty(styles$1, "codes", {
|
|
927
|
+
value: codes,
|
|
928
|
+
enumerable: false
|
|
4207
929
|
});
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
var rgb2rgb = (r, g, b) => [
|
|
4226
|
-
r,
|
|
4227
|
-
g,
|
|
4228
|
-
b
|
|
4229
|
-
];
|
|
4230
|
-
var setLazyProperty = (object, property, get) => {
|
|
4231
|
-
Object.defineProperty(object, property, {
|
|
4232
|
-
get: () => {
|
|
4233
|
-
const value = get();
|
|
4234
|
-
Object.defineProperty(object, property, {
|
|
4235
|
-
value,
|
|
4236
|
-
enumerable: true,
|
|
4237
|
-
configurable: true
|
|
4238
|
-
});
|
|
4239
|
-
return value;
|
|
930
|
+
styles$1.color.close = "\x1B[39m";
|
|
931
|
+
styles$1.bgColor.close = "\x1B[49m";
|
|
932
|
+
styles$1.color.ansi = wrapAnsi16();
|
|
933
|
+
styles$1.color.ansi256 = wrapAnsi256();
|
|
934
|
+
styles$1.color.ansi16m = wrapAnsi16m();
|
|
935
|
+
styles$1.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
936
|
+
styles$1.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
937
|
+
styles$1.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
938
|
+
Object.defineProperties(styles$1, {
|
|
939
|
+
rgbToAnsi256: {
|
|
940
|
+
value(red, green, blue) {
|
|
941
|
+
if (red === green && green === blue) {
|
|
942
|
+
if (red < 8) return 16;
|
|
943
|
+
if (red > 248) return 231;
|
|
944
|
+
return Math.round((red - 8) / 247 * 24) + 232;
|
|
945
|
+
}
|
|
946
|
+
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
4240
947
|
},
|
|
4241
|
-
enumerable:
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
const codes = /* @__PURE__ */ new Map();
|
|
4260
|
-
const styles = {
|
|
4261
|
-
modifier: {
|
|
4262
|
-
reset: [0, 0],
|
|
4263
|
-
bold: [1, 22],
|
|
4264
|
-
dim: [2, 22],
|
|
4265
|
-
italic: [3, 23],
|
|
4266
|
-
underline: [4, 24],
|
|
4267
|
-
inverse: [7, 27],
|
|
4268
|
-
hidden: [8, 28],
|
|
4269
|
-
strikethrough: [9, 29]
|
|
948
|
+
enumerable: false
|
|
949
|
+
},
|
|
950
|
+
hexToRgb: {
|
|
951
|
+
value(hex) {
|
|
952
|
+
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
953
|
+
if (!matches) return [
|
|
954
|
+
0,
|
|
955
|
+
0,
|
|
956
|
+
0
|
|
957
|
+
];
|
|
958
|
+
let [colorString] = matches;
|
|
959
|
+
if (colorString.length === 3) colorString = [...colorString].map((character) => character + character).join("");
|
|
960
|
+
const integer = Number.parseInt(colorString, 16);
|
|
961
|
+
return [
|
|
962
|
+
integer >> 16 & 255,
|
|
963
|
+
integer >> 8 & 255,
|
|
964
|
+
integer & 255
|
|
965
|
+
];
|
|
4270
966
|
},
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
967
|
+
enumerable: false
|
|
968
|
+
},
|
|
969
|
+
hexToAnsi256: {
|
|
970
|
+
value: (hex) => styles$1.rgbToAnsi256(...styles$1.hexToRgb(hex)),
|
|
971
|
+
enumerable: false
|
|
972
|
+
},
|
|
973
|
+
ansi256ToAnsi: {
|
|
974
|
+
value(code) {
|
|
975
|
+
if (code < 8) return 30 + code;
|
|
976
|
+
if (code < 16) return 90 + (code - 8);
|
|
977
|
+
let red;
|
|
978
|
+
let green;
|
|
979
|
+
let blue;
|
|
980
|
+
if (code >= 232) {
|
|
981
|
+
red = ((code - 232) * 10 + 8) / 255;
|
|
982
|
+
green = red;
|
|
983
|
+
blue = red;
|
|
984
|
+
} else {
|
|
985
|
+
code -= 16;
|
|
986
|
+
const remainder = code % 36;
|
|
987
|
+
red = Math.floor(code / 36) / 5;
|
|
988
|
+
green = Math.floor(remainder / 6) / 5;
|
|
989
|
+
blue = remainder % 6 / 5;
|
|
990
|
+
}
|
|
991
|
+
const value = Math.max(red, green, blue) * 2;
|
|
992
|
+
if (value === 0) return 30;
|
|
993
|
+
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
994
|
+
if (value === 2) result += 60;
|
|
995
|
+
return result;
|
|
4288
996
|
},
|
|
4289
|
-
bgColor: {
|
|
4290
|
-
bgBlack: [40, 49],
|
|
4291
|
-
bgRed: [41, 49],
|
|
4292
|
-
bgGreen: [42, 49],
|
|
4293
|
-
bgYellow: [43, 49],
|
|
4294
|
-
bgBlue: [44, 49],
|
|
4295
|
-
bgMagenta: [45, 49],
|
|
4296
|
-
bgCyan: [46, 49],
|
|
4297
|
-
bgWhite: [47, 49],
|
|
4298
|
-
bgBlackBright: [100, 49],
|
|
4299
|
-
bgRedBright: [101, 49],
|
|
4300
|
-
bgGreenBright: [102, 49],
|
|
4301
|
-
bgYellowBright: [103, 49],
|
|
4302
|
-
bgBlueBright: [104, 49],
|
|
4303
|
-
bgMagentaBright: [105, 49],
|
|
4304
|
-
bgCyanBright: [106, 49],
|
|
4305
|
-
bgWhiteBright: [107, 49]
|
|
4306
|
-
}
|
|
4307
|
-
};
|
|
4308
|
-
styles.color.gray = styles.color.blackBright;
|
|
4309
|
-
styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
|
|
4310
|
-
styles.color.grey = styles.color.blackBright;
|
|
4311
|
-
styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
|
|
4312
|
-
for (const [groupName, group] of Object.entries(styles)) {
|
|
4313
|
-
for (const [styleName, style] of Object.entries(group)) {
|
|
4314
|
-
styles[styleName] = {
|
|
4315
|
-
open: `\u001B[${style[0]}m`,
|
|
4316
|
-
close: `\u001B[${style[1]}m`
|
|
4317
|
-
};
|
|
4318
|
-
group[styleName] = styles[styleName];
|
|
4319
|
-
codes.set(style[0], style[1]);
|
|
4320
|
-
}
|
|
4321
|
-
Object.defineProperty(styles, groupName, {
|
|
4322
|
-
value: group,
|
|
4323
|
-
enumerable: false
|
|
4324
|
-
});
|
|
4325
|
-
}
|
|
4326
|
-
Object.defineProperty(styles, "codes", {
|
|
4327
|
-
value: codes,
|
|
4328
997
|
enumerable: false
|
|
4329
|
-
}
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
return styles;
|
|
4339
|
-
}
|
|
4340
|
-
Object.defineProperty(module, "exports", {
|
|
4341
|
-
enumerable: true,
|
|
4342
|
-
get: assembleStyles
|
|
998
|
+
},
|
|
999
|
+
rgbToAnsi: {
|
|
1000
|
+
value: (red, green, blue) => styles$1.ansi256ToAnsi(styles$1.rgbToAnsi256(red, green, blue)),
|
|
1001
|
+
enumerable: false
|
|
1002
|
+
},
|
|
1003
|
+
hexToAnsi: {
|
|
1004
|
+
value: (hex) => styles$1.ansi256ToAnsi(styles$1.hexToAnsi256(hex)),
|
|
1005
|
+
enumerable: false
|
|
1006
|
+
}
|
|
4343
1007
|
});
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
var require_browser = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
4348
|
-
module.exports = {
|
|
4349
|
-
stdout: false,
|
|
4350
|
-
stderr: false
|
|
4351
|
-
};
|
|
4352
|
-
}));
|
|
4353
|
-
//#endregion
|
|
4354
|
-
//#region node_modules/chalk/source/util.js
|
|
4355
|
-
var require_util = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
4356
|
-
var stringReplaceAll = (string, substring, replacer) => {
|
|
4357
|
-
let index = string.indexOf(substring);
|
|
4358
|
-
if (index === -1) return string;
|
|
4359
|
-
const substringLength = substring.length;
|
|
4360
|
-
let endIndex = 0;
|
|
4361
|
-
let returnValue = "";
|
|
4362
|
-
do {
|
|
4363
|
-
returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
|
|
4364
|
-
endIndex = index + substringLength;
|
|
4365
|
-
index = string.indexOf(substring, endIndex);
|
|
4366
|
-
} while (index !== -1);
|
|
4367
|
-
returnValue += string.substr(endIndex);
|
|
4368
|
-
return returnValue;
|
|
4369
|
-
};
|
|
4370
|
-
var stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
|
|
4371
|
-
let endIndex = 0;
|
|
4372
|
-
let returnValue = "";
|
|
4373
|
-
do {
|
|
4374
|
-
const gotCR = string[index - 1] === "\r";
|
|
4375
|
-
returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
4376
|
-
endIndex = index + 1;
|
|
4377
|
-
index = string.indexOf("\n", endIndex);
|
|
4378
|
-
} while (index !== -1);
|
|
4379
|
-
returnValue += string.substr(endIndex);
|
|
4380
|
-
return returnValue;
|
|
4381
|
-
};
|
|
4382
|
-
module.exports = {
|
|
4383
|
-
stringReplaceAll,
|
|
4384
|
-
stringEncaseCRLFWithFirstIndex
|
|
4385
|
-
};
|
|
4386
|
-
}));
|
|
1008
|
+
return styles$1;
|
|
1009
|
+
}
|
|
1010
|
+
var ansiStyles = assembleStyles();
|
|
4387
1011
|
//#endregion
|
|
4388
|
-
//#region node_modules/chalk/source/
|
|
4389
|
-
var
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
var ESCAPES = new Map([
|
|
4395
|
-
["n", "\n"],
|
|
4396
|
-
["r", "\r"],
|
|
4397
|
-
["t", " "],
|
|
4398
|
-
["b", "\b"],
|
|
4399
|
-
["f", "\f"],
|
|
4400
|
-
["v", "\v"],
|
|
4401
|
-
["0", "\0"],
|
|
4402
|
-
["\\", "\\"],
|
|
4403
|
-
["e", "\x1B"],
|
|
4404
|
-
["a", "\x07"]
|
|
4405
|
-
]);
|
|
4406
|
-
function unescape(c) {
|
|
4407
|
-
const u = c[0] === "u";
|
|
4408
|
-
const bracket = c[1] === "{";
|
|
4409
|
-
if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) return String.fromCharCode(parseInt(c.slice(1), 16));
|
|
4410
|
-
if (u && bracket) return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
|
|
4411
|
-
return ESCAPES.get(c) || c;
|
|
1012
|
+
//#region node_modules/chalk/source/vendor/supports-color/browser.js
|
|
1013
|
+
var level = (() => {
|
|
1014
|
+
if (!("navigator" in globalThis)) return 0;
|
|
1015
|
+
if (globalThis.navigator.userAgentData) {
|
|
1016
|
+
const brand = navigator.userAgentData.brands.find(({ brand }) => brand === "Chromium");
|
|
1017
|
+
if (brand && brand.version > 93) return 3;
|
|
4412
1018
|
}
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
if (escapeCharacter) chunk.push(unescape(escapeCharacter));
|
|
4455
|
-
else if (style) {
|
|
4456
|
-
const string = chunk.join("");
|
|
4457
|
-
chunk = [];
|
|
4458
|
-
chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string));
|
|
4459
|
-
styles.push({
|
|
4460
|
-
inverse,
|
|
4461
|
-
styles: parseStyle(style)
|
|
4462
|
-
});
|
|
4463
|
-
} else if (close) {
|
|
4464
|
-
if (styles.length === 0) throw new Error("Found extraneous } in Chalk template literal");
|
|
4465
|
-
chunks.push(buildStyle(chalk, styles)(chunk.join("")));
|
|
4466
|
-
chunk = [];
|
|
4467
|
-
styles.pop();
|
|
4468
|
-
} else chunk.push(character);
|
|
4469
|
-
});
|
|
4470
|
-
chunks.push(chunk.join(""));
|
|
4471
|
-
if (styles.length > 0) {
|
|
4472
|
-
const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
|
|
4473
|
-
throw new Error(errMessage);
|
|
4474
|
-
}
|
|
4475
|
-
return chunks.join("");
|
|
4476
|
-
};
|
|
4477
|
-
}));
|
|
1019
|
+
if (/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)) return 1;
|
|
1020
|
+
return 0;
|
|
1021
|
+
})();
|
|
1022
|
+
var colorSupport = level !== 0 && {
|
|
1023
|
+
level,
|
|
1024
|
+
hasBasic: true,
|
|
1025
|
+
has256: level >= 2,
|
|
1026
|
+
has16m: level >= 3
|
|
1027
|
+
};
|
|
1028
|
+
var supportsColor = {
|
|
1029
|
+
stdout: colorSupport,
|
|
1030
|
+
stderr: colorSupport
|
|
1031
|
+
};
|
|
1032
|
+
//#endregion
|
|
1033
|
+
//#region node_modules/chalk/source/utilities.js
|
|
1034
|
+
function stringReplaceAll(string, substring, replacer) {
|
|
1035
|
+
let index = string.indexOf(substring);
|
|
1036
|
+
if (index === -1) return string;
|
|
1037
|
+
const substringLength = substring.length;
|
|
1038
|
+
let endIndex = 0;
|
|
1039
|
+
let returnValue = "";
|
|
1040
|
+
do {
|
|
1041
|
+
returnValue += string.slice(endIndex, index) + substring + replacer;
|
|
1042
|
+
endIndex = index + substringLength;
|
|
1043
|
+
index = string.indexOf(substring, endIndex);
|
|
1044
|
+
} while (index !== -1);
|
|
1045
|
+
returnValue += string.slice(endIndex);
|
|
1046
|
+
return returnValue;
|
|
1047
|
+
}
|
|
1048
|
+
function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
|
|
1049
|
+
let endIndex = 0;
|
|
1050
|
+
let returnValue = "";
|
|
1051
|
+
do {
|
|
1052
|
+
const gotCR = string[index - 1] === "\r";
|
|
1053
|
+
returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
1054
|
+
endIndex = index + 1;
|
|
1055
|
+
index = string.indexOf("\n", endIndex);
|
|
1056
|
+
} while (index !== -1);
|
|
1057
|
+
returnValue += string.slice(endIndex);
|
|
1058
|
+
return returnValue;
|
|
1059
|
+
}
|
|
4478
1060
|
//#endregion
|
|
4479
1061
|
//#region node_modules/chalk/source/index.js
|
|
4480
|
-
var
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
};
|
|
4514
|
-
|
|
4515
|
-
|
|
1062
|
+
var { stdout: stdoutColor, stderr: stderrColor } = supportsColor;
|
|
1063
|
+
var GENERATOR = Symbol("GENERATOR");
|
|
1064
|
+
var STYLER = Symbol("STYLER");
|
|
1065
|
+
var IS_EMPTY = Symbol("IS_EMPTY");
|
|
1066
|
+
var levelMapping = [
|
|
1067
|
+
"ansi",
|
|
1068
|
+
"ansi",
|
|
1069
|
+
"ansi256",
|
|
1070
|
+
"ansi16m"
|
|
1071
|
+
];
|
|
1072
|
+
var styles = Object.create(null);
|
|
1073
|
+
var applyOptions = (object, options = {}) => {
|
|
1074
|
+
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");
|
|
1075
|
+
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
1076
|
+
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
1077
|
+
};
|
|
1078
|
+
var chalkFactory = (options) => {
|
|
1079
|
+
const chalk = (...strings) => strings.join(" ");
|
|
1080
|
+
applyOptions(chalk, options);
|
|
1081
|
+
Object.setPrototypeOf(chalk, createChalk.prototype);
|
|
1082
|
+
return chalk;
|
|
1083
|
+
};
|
|
1084
|
+
function createChalk(options) {
|
|
1085
|
+
return chalkFactory(options);
|
|
1086
|
+
}
|
|
1087
|
+
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
|
1088
|
+
for (const [styleName, style] of Object.entries(ansiStyles)) styles[styleName] = { get() {
|
|
1089
|
+
const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
|
|
1090
|
+
Object.defineProperty(this, styleName, { value: builder });
|
|
1091
|
+
return builder;
|
|
1092
|
+
} };
|
|
1093
|
+
styles.visible = { get() {
|
|
1094
|
+
const builder = createBuilder(this, this[STYLER], true);
|
|
1095
|
+
Object.defineProperty(this, "visible", { value: builder });
|
|
1096
|
+
return builder;
|
|
1097
|
+
} };
|
|
1098
|
+
var getModelAnsi = (model, level, type, ...arguments_) => {
|
|
1099
|
+
if (model === "rgb") {
|
|
1100
|
+
if (level === "ansi16m") return ansiStyles[type].ansi16m(...arguments_);
|
|
1101
|
+
if (level === "ansi256") return ansiStyles[type].ansi256(ansiStyles.rgbToAnsi256(...arguments_));
|
|
1102
|
+
return ansiStyles[type].ansi(ansiStyles.rgbToAnsi(...arguments_));
|
|
4516
1103
|
}
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
} };
|
|
4527
|
-
var usedModels = [
|
|
4528
|
-
"rgb",
|
|
4529
|
-
"hex",
|
|
4530
|
-
"keyword",
|
|
4531
|
-
"hsl",
|
|
4532
|
-
"hsv",
|
|
4533
|
-
"hwb",
|
|
4534
|
-
"ansi",
|
|
4535
|
-
"ansi256"
|
|
4536
|
-
];
|
|
4537
|
-
for (const model of usedModels) styles[model] = { get() {
|
|
1104
|
+
if (model === "hex") return getModelAnsi("rgb", level, type, ...ansiStyles.hexToRgb(...arguments_));
|
|
1105
|
+
return ansiStyles[type][model](...arguments_);
|
|
1106
|
+
};
|
|
1107
|
+
for (const model of [
|
|
1108
|
+
"rgb",
|
|
1109
|
+
"hex",
|
|
1110
|
+
"ansi256"
|
|
1111
|
+
]) {
|
|
1112
|
+
styles[model] = { get() {
|
|
4538
1113
|
const { level } = this;
|
|
4539
1114
|
return function(...arguments_) {
|
|
4540
|
-
const styler = createStyler(
|
|
4541
|
-
return createBuilder(this, styler, this
|
|
1115
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansiStyles.color.close, this[STYLER]);
|
|
1116
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
4542
1117
|
};
|
|
4543
1118
|
} };
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
return createBuilder(this, styler, this._isEmpty);
|
|
4551
|
-
};
|
|
4552
|
-
} };
|
|
4553
|
-
}
|
|
4554
|
-
var proto = Object.defineProperties(() => {}, {
|
|
4555
|
-
...styles,
|
|
4556
|
-
level: {
|
|
4557
|
-
enumerable: true,
|
|
4558
|
-
get() {
|
|
4559
|
-
return this._generator.level;
|
|
4560
|
-
},
|
|
4561
|
-
set(level) {
|
|
4562
|
-
this._generator.level = level;
|
|
4563
|
-
}
|
|
4564
|
-
}
|
|
4565
|
-
});
|
|
4566
|
-
var createStyler = (open, close, parent) => {
|
|
4567
|
-
let openAll;
|
|
4568
|
-
let closeAll;
|
|
4569
|
-
if (parent === void 0) {
|
|
4570
|
-
openAll = open;
|
|
4571
|
-
closeAll = close;
|
|
4572
|
-
} else {
|
|
4573
|
-
openAll = parent.openAll + open;
|
|
4574
|
-
closeAll = close + parent.closeAll;
|
|
4575
|
-
}
|
|
4576
|
-
return {
|
|
4577
|
-
open,
|
|
4578
|
-
close,
|
|
4579
|
-
openAll,
|
|
4580
|
-
closeAll,
|
|
4581
|
-
parent
|
|
4582
|
-
};
|
|
4583
|
-
};
|
|
4584
|
-
var createBuilder = (self, _styler, _isEmpty) => {
|
|
4585
|
-
const builder = (...arguments_) => {
|
|
4586
|
-
if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) return applyStyle(builder, chalkTag(builder, ...arguments_));
|
|
4587
|
-
return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
1119
|
+
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
1120
|
+
styles[bgModel] = { get() {
|
|
1121
|
+
const { level } = this;
|
|
1122
|
+
return function(...arguments_) {
|
|
1123
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansiStyles.bgColor.close, this[STYLER]);
|
|
1124
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
4588
1125
|
};
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
if (string.indexOf("\x1B") !== -1) while (styler !== void 0) {
|
|
4601
|
-
string = stringReplaceAll(string, styler.close, styler.open);
|
|
4602
|
-
styler = styler.parent;
|
|
1126
|
+
} };
|
|
1127
|
+
}
|
|
1128
|
+
var proto = Object.defineProperties(() => {}, {
|
|
1129
|
+
...styles,
|
|
1130
|
+
level: {
|
|
1131
|
+
enumerable: true,
|
|
1132
|
+
get() {
|
|
1133
|
+
return this[GENERATOR].level;
|
|
1134
|
+
},
|
|
1135
|
+
set(level) {
|
|
1136
|
+
this[GENERATOR].level = level;
|
|
4603
1137
|
}
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
1138
|
+
}
|
|
1139
|
+
});
|
|
1140
|
+
var createStyler = (open, close, parent) => {
|
|
1141
|
+
let openAll;
|
|
1142
|
+
let closeAll;
|
|
1143
|
+
if (parent === void 0) {
|
|
1144
|
+
openAll = open;
|
|
1145
|
+
closeAll = close;
|
|
1146
|
+
} else {
|
|
1147
|
+
openAll = parent.openAll + open;
|
|
1148
|
+
closeAll = close + parent.closeAll;
|
|
1149
|
+
}
|
|
1150
|
+
return {
|
|
1151
|
+
open,
|
|
1152
|
+
close,
|
|
1153
|
+
openAll,
|
|
1154
|
+
closeAll,
|
|
1155
|
+
parent
|
|
4617
1156
|
};
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
1157
|
+
};
|
|
1158
|
+
var createBuilder = (self, _styler, _isEmpty) => {
|
|
1159
|
+
const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
1160
|
+
Object.setPrototypeOf(builder, proto);
|
|
1161
|
+
builder[GENERATOR] = self;
|
|
1162
|
+
builder[STYLER] = _styler;
|
|
1163
|
+
builder[IS_EMPTY] = _isEmpty;
|
|
1164
|
+
return builder;
|
|
1165
|
+
};
|
|
1166
|
+
var applyStyle = (self, string) => {
|
|
1167
|
+
if (self.level <= 0 || !string) return self[IS_EMPTY] ? "" : string;
|
|
1168
|
+
let styler = self[STYLER];
|
|
1169
|
+
if (styler === void 0) return string;
|
|
1170
|
+
const { openAll, closeAll } = styler;
|
|
1171
|
+
if (string.includes("\x1B")) while (styler !== void 0) {
|
|
1172
|
+
string = stringReplaceAll(string, styler.close, styler.open);
|
|
1173
|
+
styler = styler.parent;
|
|
1174
|
+
}
|
|
1175
|
+
const lfIndex = string.indexOf("\n");
|
|
1176
|
+
if (lfIndex !== -1) string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
1177
|
+
return openAll + string + closeAll;
|
|
1178
|
+
};
|
|
1179
|
+
Object.defineProperties(createChalk.prototype, styles);
|
|
1180
|
+
var chalk = createChalk();
|
|
1181
|
+
createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
4625
1182
|
//#endregion
|
|
4626
1183
|
//#region node_modules/http-status-codes/build/es/status-codes.js
|
|
4627
1184
|
var StatusCodes;
|
|
@@ -4983,8 +1540,6 @@ var StatusCodes;
|
|
|
4983
1540
|
})(StatusCodes || (StatusCodes = {}));
|
|
4984
1541
|
//#endregion
|
|
4985
1542
|
//#region src/axiosClient.ts
|
|
4986
|
-
var import_browser = /* @__PURE__ */ __toESM$1(require_browser$1());
|
|
4987
|
-
var import_source = /* @__PURE__ */ __toESM$1(require_source());
|
|
4988
1543
|
var AxiosClient = class {
|
|
4989
1544
|
#options;
|
|
4990
1545
|
#DUMMY_USER = "USR_user01@stsmda.com.au";
|
|
@@ -5015,21 +1570,21 @@ var AxiosClient = class {
|
|
|
5015
1570
|
this.#options.logger.error(message);
|
|
5016
1571
|
};
|
|
5017
1572
|
HandleError = (error) => {
|
|
5018
|
-
this.#LogDebugMessage(
|
|
1573
|
+
this.#LogDebugMessage(chalk.red(`HandleError(): Error: [${error}]`));
|
|
5019
1574
|
let responseCode = 500;
|
|
5020
1575
|
if (axios.default.isAxiosError(error)) {
|
|
5021
1576
|
const axiosError = error;
|
|
5022
1577
|
if (axiosError.response) {
|
|
5023
1578
|
responseCode = axiosError.response.status;
|
|
5024
|
-
this.#LogDebugMessage(
|
|
5025
|
-
if (axiosError.response.headers) this.#LogErrorMessage(
|
|
5026
|
-
if (axiosError.response.data) this.#LogErrorMessage(
|
|
1579
|
+
this.#LogDebugMessage(chalk.red(`AXIOS Error Response.Status = [${axiosError.response.status}]`));
|
|
1580
|
+
if (axiosError.response.headers) this.#LogErrorMessage(chalk.red(` headers: [${JSON.stringify(axiosError.response.headers)}]`));
|
|
1581
|
+
if (axiosError.response.data) this.#LogErrorMessage(chalk.red(` data: [${JSON.stringify(axiosError.response.data)}]`));
|
|
5027
1582
|
try {
|
|
5028
|
-
if (axiosError.response.config) this.#LogErrorMessage(
|
|
1583
|
+
if (axiosError.response.config) this.#LogErrorMessage(chalk.red(` config: [${JSON.stringify(axiosError.response.config)}]`));
|
|
5029
1584
|
} catch (innererror) {
|
|
5030
|
-
this.#LogErrorMessage(
|
|
1585
|
+
this.#LogErrorMessage(chalk.red(` could not get response config, error: [${innererror}]`));
|
|
5031
1586
|
}
|
|
5032
|
-
} else this.#LogDebugMessage(
|
|
1587
|
+
} else this.#LogDebugMessage(chalk.red(`AXIOS Error = [${axiosError}]`));
|
|
5033
1588
|
}
|
|
5034
1589
|
return responseCode;
|
|
5035
1590
|
};
|