@nsshunt/stsutils 1.19.91 → 1.19.93

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 CHANGED
@@ -1,2078 +1,340 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region \0rolldown/runtime.js
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
- key = keys[i];
13
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
- get: ((k) => from[k]).bind(null, key),
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
2
+ //#region node_modules/chalk/source/vendor/ansi-styles/index.js
3
+ var ANSI_BACKGROUND_OFFSET = 10;
4
+ var wrapAnsi16 = (offset = 0) => (code) => `\u001B[${code + offset}m`;
5
+ var wrapAnsi256 = (offset = 0) => (code) => `\u001B[${38 + offset};5;${code}m`;
6
+ var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`;
7
+ var styles$1 = {
8
+ modifier: {
9
+ reset: [0, 0],
10
+ bold: [1, 22],
11
+ dim: [2, 22],
12
+ italic: [3, 23],
13
+ underline: [4, 24],
14
+ overline: [53, 55],
15
+ inverse: [7, 27],
16
+ hidden: [8, 28],
17
+ strikethrough: [9, 29]
18
+ },
19
+ color: {
20
+ black: [30, 39],
21
+ red: [31, 39],
22
+ green: [32, 39],
23
+ yellow: [33, 39],
24
+ blue: [34, 39],
25
+ magenta: [35, 39],
26
+ cyan: [36, 39],
27
+ white: [37, 39],
28
+ blackBright: [90, 39],
29
+ gray: [90, 39],
30
+ grey: [90, 39],
31
+ redBright: [91, 39],
32
+ greenBright: [92, 39],
33
+ yellowBright: [93, 39],
34
+ blueBright: [94, 39],
35
+ magentaBright: [95, 39],
36
+ cyanBright: [96, 39],
37
+ whiteBright: [97, 39]
38
+ },
39
+ bgColor: {
40
+ bgBlack: [40, 49],
41
+ bgRed: [41, 49],
42
+ bgGreen: [42, 49],
43
+ bgYellow: [43, 49],
44
+ bgBlue: [44, 49],
45
+ bgMagenta: [45, 49],
46
+ bgCyan: [46, 49],
47
+ bgWhite: [47, 49],
48
+ bgBlackBright: [100, 49],
49
+ bgGray: [100, 49],
50
+ bgGrey: [100, 49],
51
+ bgRedBright: [101, 49],
52
+ bgGreenBright: [102, 49],
53
+ bgYellowBright: [103, 49],
54
+ bgBlueBright: [104, 49],
55
+ bgMagentaBright: [105, 49],
56
+ bgCyanBright: [106, 49],
57
+ bgWhiteBright: [107, 49]
17
58
  }
18
- return to;
19
59
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
21
- value: mod,
22
- enumerable: true
23
- }) : target, mod));
24
- //#endregion
25
- let ajv_dist_jtd_js = require("ajv/dist/jtd.js");
26
- ajv_dist_jtd_js = __toESM(ajv_dist_jtd_js);
27
- //#region node_modules/color-name/index.js
28
- var require_color_name = /* @__PURE__ */ __commonJSMin(((exports, module) => {
29
- module.exports = {
30
- "aliceblue": [
31
- 240,
32
- 248,
33
- 255
34
- ],
35
- "antiquewhite": [
36
- 250,
37
- 235,
38
- 215
39
- ],
40
- "aqua": [
41
- 0,
42
- 255,
43
- 255
44
- ],
45
- "aquamarine": [
46
- 127,
47
- 255,
48
- 212
49
- ],
50
- "azure": [
51
- 240,
52
- 255,
53
- 255
54
- ],
55
- "beige": [
56
- 245,
57
- 245,
58
- 220
59
- ],
60
- "bisque": [
61
- 255,
62
- 228,
63
- 196
64
- ],
65
- "black": [
66
- 0,
67
- 0,
68
- 0
69
- ],
70
- "blanchedalmond": [
71
- 255,
72
- 235,
73
- 205
74
- ],
75
- "blue": [
76
- 0,
77
- 0,
78
- 255
79
- ],
80
- "blueviolet": [
81
- 138,
82
- 43,
83
- 226
84
- ],
85
- "brown": [
86
- 165,
87
- 42,
88
- 42
89
- ],
90
- "burlywood": [
91
- 222,
92
- 184,
93
- 135
94
- ],
95
- "cadetblue": [
96
- 95,
97
- 158,
98
- 160
99
- ],
100
- "chartreuse": [
101
- 127,
102
- 255,
103
- 0
104
- ],
105
- "chocolate": [
106
- 210,
107
- 105,
108
- 30
109
- ],
110
- "coral": [
111
- 255,
112
- 127,
113
- 80
114
- ],
115
- "cornflowerblue": [
116
- 100,
117
- 149,
118
- 237
119
- ],
120
- "cornsilk": [
121
- 255,
122
- 248,
123
- 220
124
- ],
125
- "crimson": [
126
- 220,
127
- 20,
128
- 60
129
- ],
130
- "cyan": [
131
- 0,
132
- 255,
133
- 255
134
- ],
135
- "darkblue": [
136
- 0,
137
- 0,
138
- 139
139
- ],
140
- "darkcyan": [
141
- 0,
142
- 139,
143
- 139
144
- ],
145
- "darkgoldenrod": [
146
- 184,
147
- 134,
148
- 11
149
- ],
150
- "darkgray": [
151
- 169,
152
- 169,
153
- 169
154
- ],
155
- "darkgreen": [
156
- 0,
157
- 100,
158
- 0
159
- ],
160
- "darkgrey": [
161
- 169,
162
- 169,
163
- 169
164
- ],
165
- "darkkhaki": [
166
- 189,
167
- 183,
168
- 107
169
- ],
170
- "darkmagenta": [
171
- 139,
172
- 0,
173
- 139
174
- ],
175
- "darkolivegreen": [
176
- 85,
177
- 107,
178
- 47
179
- ],
180
- "darkorange": [
181
- 255,
182
- 140,
183
- 0
184
- ],
185
- "darkorchid": [
186
- 153,
187
- 50,
188
- 204
189
- ],
190
- "darkred": [
191
- 139,
192
- 0,
193
- 0
194
- ],
195
- "darksalmon": [
196
- 233,
197
- 150,
198
- 122
199
- ],
200
- "darkseagreen": [
201
- 143,
202
- 188,
203
- 143
204
- ],
205
- "darkslateblue": [
206
- 72,
207
- 61,
208
- 139
209
- ],
210
- "darkslategray": [
211
- 47,
212
- 79,
213
- 79
214
- ],
215
- "darkslategrey": [
216
- 47,
217
- 79,
218
- 79
219
- ],
220
- "darkturquoise": [
221
- 0,
222
- 206,
223
- 209
224
- ],
225
- "darkviolet": [
226
- 148,
227
- 0,
228
- 211
229
- ],
230
- "deeppink": [
231
- 255,
232
- 20,
233
- 147
234
- ],
235
- "deepskyblue": [
236
- 0,
237
- 191,
238
- 255
239
- ],
240
- "dimgray": [
241
- 105,
242
- 105,
243
- 105
244
- ],
245
- "dimgrey": [
246
- 105,
247
- 105,
248
- 105
249
- ],
250
- "dodgerblue": [
251
- 30,
252
- 144,
253
- 255
254
- ],
255
- "firebrick": [
256
- 178,
257
- 34,
258
- 34
259
- ],
260
- "floralwhite": [
261
- 255,
262
- 250,
263
- 240
264
- ],
265
- "forestgreen": [
266
- 34,
267
- 139,
268
- 34
269
- ],
270
- "fuchsia": [
271
- 255,
272
- 0,
273
- 255
274
- ],
275
- "gainsboro": [
276
- 220,
277
- 220,
278
- 220
279
- ],
280
- "ghostwhite": [
281
- 248,
282
- 248,
283
- 255
284
- ],
285
- "gold": [
286
- 255,
287
- 215,
288
- 0
289
- ],
290
- "goldenrod": [
291
- 218,
292
- 165,
293
- 32
294
- ],
295
- "gray": [
296
- 128,
297
- 128,
298
- 128
299
- ],
300
- "green": [
301
- 0,
302
- 128,
303
- 0
304
- ],
305
- "greenyellow": [
306
- 173,
307
- 255,
308
- 47
309
- ],
310
- "grey": [
311
- 128,
312
- 128,
313
- 128
314
- ],
315
- "honeydew": [
316
- 240,
317
- 255,
318
- 240
319
- ],
320
- "hotpink": [
321
- 255,
322
- 105,
323
- 180
324
- ],
325
- "indianred": [
326
- 205,
327
- 92,
328
- 92
329
- ],
330
- "indigo": [
331
- 75,
332
- 0,
333
- 130
334
- ],
335
- "ivory": [
336
- 255,
337
- 255,
338
- 240
339
- ],
340
- "khaki": [
341
- 240,
342
- 230,
343
- 140
344
- ],
345
- "lavender": [
346
- 230,
347
- 230,
348
- 250
349
- ],
350
- "lavenderblush": [
351
- 255,
352
- 240,
353
- 245
354
- ],
355
- "lawngreen": [
356
- 124,
357
- 252,
358
- 0
359
- ],
360
- "lemonchiffon": [
361
- 255,
362
- 250,
363
- 205
364
- ],
365
- "lightblue": [
366
- 173,
367
- 216,
368
- 230
369
- ],
370
- "lightcoral": [
371
- 240,
372
- 128,
373
- 128
374
- ],
375
- "lightcyan": [
376
- 224,
377
- 255,
378
- 255
379
- ],
380
- "lightgoldenrodyellow": [
381
- 250,
382
- 250,
383
- 210
384
- ],
385
- "lightgray": [
386
- 211,
387
- 211,
388
- 211
389
- ],
390
- "lightgreen": [
391
- 144,
392
- 238,
393
- 144
394
- ],
395
- "lightgrey": [
396
- 211,
397
- 211,
398
- 211
399
- ],
400
- "lightpink": [
401
- 255,
402
- 182,
403
- 193
404
- ],
405
- "lightsalmon": [
406
- 255,
407
- 160,
408
- 122
409
- ],
410
- "lightseagreen": [
411
- 32,
412
- 178,
413
- 170
414
- ],
415
- "lightskyblue": [
416
- 135,
417
- 206,
418
- 250
419
- ],
420
- "lightslategray": [
421
- 119,
422
- 136,
423
- 153
424
- ],
425
- "lightslategrey": [
426
- 119,
427
- 136,
428
- 153
429
- ],
430
- "lightsteelblue": [
431
- 176,
432
- 196,
433
- 222
434
- ],
435
- "lightyellow": [
436
- 255,
437
- 255,
438
- 224
439
- ],
440
- "lime": [
441
- 0,
442
- 255,
443
- 0
444
- ],
445
- "limegreen": [
446
- 50,
447
- 205,
448
- 50
449
- ],
450
- "linen": [
451
- 250,
452
- 240,
453
- 230
454
- ],
455
- "magenta": [
456
- 255,
457
- 0,
458
- 255
459
- ],
460
- "maroon": [
461
- 128,
462
- 0,
463
- 0
464
- ],
465
- "mediumaquamarine": [
466
- 102,
467
- 205,
468
- 170
469
- ],
470
- "mediumblue": [
471
- 0,
472
- 0,
473
- 205
474
- ],
475
- "mediumorchid": [
476
- 186,
477
- 85,
478
- 211
479
- ],
480
- "mediumpurple": [
481
- 147,
482
- 112,
483
- 219
484
- ],
485
- "mediumseagreen": [
486
- 60,
487
- 179,
488
- 113
489
- ],
490
- "mediumslateblue": [
491
- 123,
492
- 104,
493
- 238
494
- ],
495
- "mediumspringgreen": [
496
- 0,
497
- 250,
498
- 154
499
- ],
500
- "mediumturquoise": [
501
- 72,
502
- 209,
503
- 204
504
- ],
505
- "mediumvioletred": [
506
- 199,
507
- 21,
508
- 133
509
- ],
510
- "midnightblue": [
511
- 25,
512
- 25,
513
- 112
514
- ],
515
- "mintcream": [
516
- 245,
517
- 255,
518
- 250
519
- ],
520
- "mistyrose": [
521
- 255,
522
- 228,
523
- 225
524
- ],
525
- "moccasin": [
526
- 255,
527
- 228,
528
- 181
529
- ],
530
- "navajowhite": [
531
- 255,
532
- 222,
533
- 173
534
- ],
535
- "navy": [
536
- 0,
537
- 0,
538
- 128
539
- ],
540
- "oldlace": [
541
- 253,
542
- 245,
543
- 230
544
- ],
545
- "olive": [
546
- 128,
547
- 128,
548
- 0
549
- ],
550
- "olivedrab": [
551
- 107,
552
- 142,
553
- 35
554
- ],
555
- "orange": [
556
- 255,
557
- 165,
558
- 0
559
- ],
560
- "orangered": [
561
- 255,
562
- 69,
563
- 0
564
- ],
565
- "orchid": [
566
- 218,
567
- 112,
568
- 214
569
- ],
570
- "palegoldenrod": [
571
- 238,
572
- 232,
573
- 170
574
- ],
575
- "palegreen": [
576
- 152,
577
- 251,
578
- 152
579
- ],
580
- "paleturquoise": [
581
- 175,
582
- 238,
583
- 238
584
- ],
585
- "palevioletred": [
586
- 219,
587
- 112,
588
- 147
589
- ],
590
- "papayawhip": [
591
- 255,
592
- 239,
593
- 213
594
- ],
595
- "peachpuff": [
596
- 255,
597
- 218,
598
- 185
599
- ],
600
- "peru": [
601
- 205,
602
- 133,
603
- 63
604
- ],
605
- "pink": [
606
- 255,
607
- 192,
608
- 203
609
- ],
610
- "plum": [
611
- 221,
612
- 160,
613
- 221
614
- ],
615
- "powderblue": [
616
- 176,
617
- 224,
618
- 230
619
- ],
620
- "purple": [
621
- 128,
622
- 0,
623
- 128
624
- ],
625
- "rebeccapurple": [
626
- 102,
627
- 51,
628
- 153
629
- ],
630
- "red": [
631
- 255,
632
- 0,
633
- 0
634
- ],
635
- "rosybrown": [
636
- 188,
637
- 143,
638
- 143
639
- ],
640
- "royalblue": [
641
- 65,
642
- 105,
643
- 225
644
- ],
645
- "saddlebrown": [
646
- 139,
647
- 69,
648
- 19
649
- ],
650
- "salmon": [
651
- 250,
652
- 128,
653
- 114
654
- ],
655
- "sandybrown": [
656
- 244,
657
- 164,
658
- 96
659
- ],
660
- "seagreen": [
661
- 46,
662
- 139,
663
- 87
664
- ],
665
- "seashell": [
666
- 255,
667
- 245,
668
- 238
669
- ],
670
- "sienna": [
671
- 160,
672
- 82,
673
- 45
674
- ],
675
- "silver": [
676
- 192,
677
- 192,
678
- 192
679
- ],
680
- "skyblue": [
681
- 135,
682
- 206,
683
- 235
684
- ],
685
- "slateblue": [
686
- 106,
687
- 90,
688
- 205
689
- ],
690
- "slategray": [
691
- 112,
692
- 128,
693
- 144
694
- ],
695
- "slategrey": [
696
- 112,
697
- 128,
698
- 144
699
- ],
700
- "snow": [
701
- 255,
702
- 250,
703
- 250
704
- ],
705
- "springgreen": [
706
- 0,
707
- 255,
708
- 127
709
- ],
710
- "steelblue": [
711
- 70,
712
- 130,
713
- 180
714
- ],
715
- "tan": [
716
- 210,
717
- 180,
718
- 140
719
- ],
720
- "teal": [
721
- 0,
722
- 128,
723
- 128
724
- ],
725
- "thistle": [
726
- 216,
727
- 191,
728
- 216
729
- ],
730
- "tomato": [
731
- 255,
732
- 99,
733
- 71
734
- ],
735
- "turquoise": [
736
- 64,
737
- 224,
738
- 208
739
- ],
740
- "violet": [
741
- 238,
742
- 130,
743
- 238
744
- ],
745
- "wheat": [
746
- 245,
747
- 222,
748
- 179
749
- ],
750
- "white": [
751
- 255,
752
- 255,
753
- 255
754
- ],
755
- "whitesmoke": [
756
- 245,
757
- 245,
758
- 245
759
- ],
760
- "yellow": [
761
- 255,
762
- 255,
763
- 0
764
- ],
765
- "yellowgreen": [
766
- 154,
767
- 205,
768
- 50
769
- ]
770
- };
771
- }));
772
- //#endregion
773
- //#region node_modules/color-convert/conversions.js
774
- var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
775
- var cssKeywords = require_color_name();
776
- var reverseKeywords = {};
777
- for (const key of Object.keys(cssKeywords)) reverseKeywords[cssKeywords[key]] = key;
778
- var convert = {
779
- rgb: {
780
- channels: 3,
781
- labels: "rgb"
782
- },
783
- hsl: {
784
- channels: 3,
785
- labels: "hsl"
786
- },
787
- hsv: {
788
- channels: 3,
789
- labels: "hsv"
790
- },
791
- hwb: {
792
- channels: 3,
793
- labels: "hwb"
794
- },
795
- cmyk: {
796
- channels: 4,
797
- labels: "cmyk"
798
- },
799
- xyz: {
800
- channels: 3,
801
- labels: "xyz"
802
- },
803
- lab: {
804
- channels: 3,
805
- labels: "lab"
806
- },
807
- lch: {
808
- channels: 3,
809
- labels: "lch"
810
- },
811
- hex: {
812
- channels: 1,
813
- labels: ["hex"]
814
- },
815
- keyword: {
816
- channels: 1,
817
- labels: ["keyword"]
818
- },
819
- ansi16: {
820
- channels: 1,
821
- labels: ["ansi16"]
822
- },
823
- ansi256: {
824
- channels: 1,
825
- labels: ["ansi256"]
826
- },
827
- hcg: {
828
- channels: 3,
829
- labels: [
830
- "h",
831
- "c",
832
- "g"
833
- ]
834
- },
835
- apple: {
836
- channels: 3,
837
- labels: [
838
- "r16",
839
- "g16",
840
- "b16"
841
- ]
842
- },
843
- gray: {
844
- channels: 1,
845
- labels: ["gray"]
846
- }
847
- };
848
- module.exports = convert;
849
- for (const model of Object.keys(convert)) {
850
- if (!("channels" in convert[model])) throw new Error("missing channels property: " + model);
851
- if (!("labels" in convert[model])) throw new Error("missing channel labels property: " + model);
852
- if (convert[model].labels.length !== convert[model].channels) throw new Error("channel and label counts mismatch: " + model);
853
- const { channels, labels } = convert[model];
854
- delete convert[model].channels;
855
- delete convert[model].labels;
856
- Object.defineProperty(convert[model], "channels", { value: channels });
857
- Object.defineProperty(convert[model], "labels", { value: labels });
858
- }
859
- convert.rgb.hsl = function(rgb) {
860
- const r = rgb[0] / 255;
861
- const g = rgb[1] / 255;
862
- const b = rgb[2] / 255;
863
- const min = Math.min(r, g, b);
864
- const max = Math.max(r, g, b);
865
- const delta = max - min;
866
- let h;
867
- let s;
868
- if (max === min) h = 0;
869
- else if (r === max) h = (g - b) / delta;
870
- else if (g === max) h = 2 + (b - r) / delta;
871
- else if (b === max) h = 4 + (r - g) / delta;
872
- h = Math.min(h * 60, 360);
873
- if (h < 0) h += 360;
874
- const l = (min + max) / 2;
875
- if (max === min) s = 0;
876
- else if (l <= .5) s = delta / (max + min);
877
- else s = delta / (2 - max - min);
878
- return [
879
- h,
880
- s * 100,
881
- l * 100
882
- ];
883
- };
884
- convert.rgb.hsv = function(rgb) {
885
- let rdif;
886
- let gdif;
887
- let bdif;
888
- let h;
889
- let s;
890
- const r = rgb[0] / 255;
891
- const g = rgb[1] / 255;
892
- const b = rgb[2] / 255;
893
- const v = Math.max(r, g, b);
894
- const diff = v - Math.min(r, g, b);
895
- const diffc = function(c) {
896
- return (v - c) / 6 / diff + 1 / 2;
897
- };
898
- if (diff === 0) {
899
- h = 0;
900
- s = 0;
901
- } else {
902
- s = diff / v;
903
- rdif = diffc(r);
904
- gdif = diffc(g);
905
- bdif = diffc(b);
906
- if (r === v) h = bdif - gdif;
907
- else if (g === v) h = 1 / 3 + rdif - bdif;
908
- else if (b === v) h = 2 / 3 + gdif - rdif;
909
- if (h < 0) h += 1;
910
- else if (h > 1) h -= 1;
911
- }
912
- return [
913
- h * 360,
914
- s * 100,
915
- v * 100
916
- ];
917
- };
918
- convert.rgb.hwb = function(rgb) {
919
- const r = rgb[0];
920
- const g = rgb[1];
921
- let b = rgb[2];
922
- const h = convert.rgb.hsl(rgb)[0];
923
- const w = 1 / 255 * Math.min(r, Math.min(g, b));
924
- b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
925
- return [
926
- h,
927
- w * 100,
928
- b * 100
929
- ];
930
- };
931
- convert.rgb.cmyk = function(rgb) {
932
- const r = rgb[0] / 255;
933
- const g = rgb[1] / 255;
934
- const b = rgb[2] / 255;
935
- const k = Math.min(1 - r, 1 - g, 1 - b);
936
- const c = (1 - r - k) / (1 - k) || 0;
937
- const m = (1 - g - k) / (1 - k) || 0;
938
- const y = (1 - b - k) / (1 - k) || 0;
939
- return [
940
- c * 100,
941
- m * 100,
942
- y * 100,
943
- k * 100
944
- ];
945
- };
946
- function comparativeDistance(x, y) {
947
- return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
948
- }
949
- convert.rgb.keyword = function(rgb) {
950
- const reversed = reverseKeywords[rgb];
951
- if (reversed) return reversed;
952
- let currentClosestDistance = Infinity;
953
- let currentClosestKeyword;
954
- for (const keyword of Object.keys(cssKeywords)) {
955
- const value = cssKeywords[keyword];
956
- const distance = comparativeDistance(rgb, value);
957
- if (distance < currentClosestDistance) {
958
- currentClosestDistance = distance;
959
- currentClosestKeyword = keyword;
960
- }
961
- }
962
- return currentClosestKeyword;
963
- };
964
- convert.keyword.rgb = function(keyword) {
965
- return cssKeywords[keyword];
966
- };
967
- convert.rgb.xyz = function(rgb) {
968
- let r = rgb[0] / 255;
969
- let g = rgb[1] / 255;
970
- let b = rgb[2] / 255;
971
- r = r > .04045 ? ((r + .055) / 1.055) ** 2.4 : r / 12.92;
972
- g = g > .04045 ? ((g + .055) / 1.055) ** 2.4 : g / 12.92;
973
- b = b > .04045 ? ((b + .055) / 1.055) ** 2.4 : b / 12.92;
974
- const x = r * .4124 + g * .3576 + b * .1805;
975
- const y = r * .2126 + g * .7152 + b * .0722;
976
- const z = r * .0193 + g * .1192 + b * .9505;
977
- return [
978
- x * 100,
979
- y * 100,
980
- z * 100
981
- ];
982
- };
983
- convert.rgb.lab = function(rgb) {
984
- const xyz = convert.rgb.xyz(rgb);
985
- let x = xyz[0];
986
- let y = xyz[1];
987
- let z = xyz[2];
988
- x /= 95.047;
989
- y /= 100;
990
- z /= 108.883;
991
- x = x > .008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
992
- y = y > .008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
993
- z = z > .008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
994
- return [
995
- 116 * y - 16,
996
- 500 * (x - y),
997
- 200 * (y - z)
998
- ];
999
- };
1000
- convert.hsl.rgb = function(hsl) {
1001
- const h = hsl[0] / 360;
1002
- const s = hsl[1] / 100;
1003
- const l = hsl[2] / 100;
1004
- let t2;
1005
- let t3;
1006
- let val;
1007
- if (s === 0) {
1008
- val = l * 255;
1009
- return [
1010
- val,
1011
- val,
1012
- val
1013
- ];
1014
- }
1015
- if (l < .5) t2 = l * (1 + s);
1016
- else t2 = l + s - l * s;
1017
- const t1 = 2 * l - t2;
1018
- const rgb = [
1019
- 0,
1020
- 0,
1021
- 0
1022
- ];
1023
- for (let i = 0; i < 3; i++) {
1024
- t3 = h + 1 / 3 * -(i - 1);
1025
- if (t3 < 0) t3++;
1026
- if (t3 > 1) t3--;
1027
- if (6 * t3 < 1) val = t1 + (t2 - t1) * 6 * t3;
1028
- else if (2 * t3 < 1) val = t2;
1029
- else if (3 * t3 < 2) val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
1030
- else val = t1;
1031
- rgb[i] = val * 255;
1032
- }
1033
- return rgb;
1034
- };
1035
- convert.hsl.hsv = function(hsl) {
1036
- const h = hsl[0];
1037
- let s = hsl[1] / 100;
1038
- let l = hsl[2] / 100;
1039
- let smin = s;
1040
- const lmin = Math.max(l, .01);
1041
- l *= 2;
1042
- s *= l <= 1 ? l : 2 - l;
1043
- smin *= lmin <= 1 ? lmin : 2 - lmin;
1044
- const v = (l + s) / 2;
1045
- return [
1046
- h,
1047
- (l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s)) * 100,
1048
- v * 100
1049
- ];
1050
- };
1051
- convert.hsv.rgb = function(hsv) {
1052
- const h = hsv[0] / 60;
1053
- const s = hsv[1] / 100;
1054
- let v = hsv[2] / 100;
1055
- const hi = Math.floor(h) % 6;
1056
- const f = h - Math.floor(h);
1057
- const p = 255 * v * (1 - s);
1058
- const q = 255 * v * (1 - s * f);
1059
- const t = 255 * v * (1 - s * (1 - f));
1060
- v *= 255;
1061
- switch (hi) {
1062
- case 0: return [
1063
- v,
1064
- t,
1065
- p
1066
- ];
1067
- case 1: return [
1068
- q,
1069
- v,
1070
- p
1071
- ];
1072
- case 2: return [
1073
- p,
1074
- v,
1075
- t
1076
- ];
1077
- case 3: return [
1078
- p,
1079
- q,
1080
- v
1081
- ];
1082
- case 4: return [
1083
- t,
1084
- p,
1085
- v
1086
- ];
1087
- case 5: return [
1088
- v,
1089
- p,
1090
- q
1091
- ];
1092
- }
1093
- };
1094
- convert.hsv.hsl = function(hsv) {
1095
- const h = hsv[0];
1096
- const s = hsv[1] / 100;
1097
- const v = hsv[2] / 100;
1098
- const vmin = Math.max(v, .01);
1099
- let sl;
1100
- let l;
1101
- l = (2 - s) * v;
1102
- const lmin = (2 - s) * vmin;
1103
- sl = s * vmin;
1104
- sl /= lmin <= 1 ? lmin : 2 - lmin;
1105
- sl = sl || 0;
1106
- l /= 2;
1107
- return [
1108
- h,
1109
- sl * 100,
1110
- l * 100
1111
- ];
1112
- };
1113
- convert.hwb.rgb = function(hwb) {
1114
- const h = hwb[0] / 360;
1115
- let wh = hwb[1] / 100;
1116
- let bl = hwb[2] / 100;
1117
- const ratio = wh + bl;
1118
- let f;
1119
- if (ratio > 1) {
1120
- wh /= ratio;
1121
- bl /= ratio;
1122
- }
1123
- const i = Math.floor(6 * h);
1124
- const v = 1 - bl;
1125
- f = 6 * h - i;
1126
- if ((i & 1) !== 0) f = 1 - f;
1127
- const n = wh + f * (v - wh);
1128
- let r;
1129
- let g;
1130
- let b;
1131
- switch (i) {
1132
- default:
1133
- case 6:
1134
- case 0:
1135
- r = v;
1136
- g = n;
1137
- b = wh;
1138
- break;
1139
- case 1:
1140
- r = n;
1141
- g = v;
1142
- b = wh;
1143
- break;
1144
- case 2:
1145
- r = wh;
1146
- g = v;
1147
- b = n;
1148
- break;
1149
- case 3:
1150
- r = wh;
1151
- g = n;
1152
- b = v;
1153
- break;
1154
- case 4:
1155
- r = n;
1156
- g = wh;
1157
- b = v;
1158
- break;
1159
- case 5:
1160
- r = v;
1161
- g = wh;
1162
- b = n;
1163
- break;
1164
- }
1165
- return [
1166
- r * 255,
1167
- g * 255,
1168
- b * 255
1169
- ];
1170
- };
1171
- convert.cmyk.rgb = function(cmyk) {
1172
- const c = cmyk[0] / 100;
1173
- const m = cmyk[1] / 100;
1174
- const y = cmyk[2] / 100;
1175
- const k = cmyk[3] / 100;
1176
- const r = 1 - Math.min(1, c * (1 - k) + k);
1177
- const g = 1 - Math.min(1, m * (1 - k) + k);
1178
- const b = 1 - Math.min(1, y * (1 - k) + k);
1179
- return [
1180
- r * 255,
1181
- g * 255,
1182
- b * 255
1183
- ];
1184
- };
1185
- convert.xyz.rgb = function(xyz) {
1186
- const x = xyz[0] / 100;
1187
- const y = xyz[1] / 100;
1188
- const z = xyz[2] / 100;
1189
- let r;
1190
- let g;
1191
- let b;
1192
- r = x * 3.2406 + y * -1.5372 + z * -.4986;
1193
- g = x * -.9689 + y * 1.8758 + z * .0415;
1194
- b = x * .0557 + y * -.204 + z * 1.057;
1195
- r = r > .0031308 ? 1.055 * r ** (1 / 2.4) - .055 : r * 12.92;
1196
- g = g > .0031308 ? 1.055 * g ** (1 / 2.4) - .055 : g * 12.92;
1197
- b = b > .0031308 ? 1.055 * b ** (1 / 2.4) - .055 : b * 12.92;
1198
- r = Math.min(Math.max(0, r), 1);
1199
- g = Math.min(Math.max(0, g), 1);
1200
- b = Math.min(Math.max(0, b), 1);
1201
- return [
1202
- r * 255,
1203
- g * 255,
1204
- b * 255
1205
- ];
1206
- };
1207
- convert.xyz.lab = function(xyz) {
1208
- let x = xyz[0];
1209
- let y = xyz[1];
1210
- let z = xyz[2];
1211
- x /= 95.047;
1212
- y /= 100;
1213
- z /= 108.883;
1214
- x = x > .008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
1215
- y = y > .008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
1216
- z = z > .008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
1217
- return [
1218
- 116 * y - 16,
1219
- 500 * (x - y),
1220
- 200 * (y - z)
1221
- ];
1222
- };
1223
- convert.lab.xyz = function(lab) {
1224
- const l = lab[0];
1225
- const a = lab[1];
1226
- const b = lab[2];
1227
- let x;
1228
- let y;
1229
- let z;
1230
- y = (l + 16) / 116;
1231
- x = a / 500 + y;
1232
- z = y - b / 200;
1233
- const y2 = y ** 3;
1234
- const x2 = x ** 3;
1235
- const z2 = z ** 3;
1236
- y = y2 > .008856 ? y2 : (y - 16 / 116) / 7.787;
1237
- x = x2 > .008856 ? x2 : (x - 16 / 116) / 7.787;
1238
- z = z2 > .008856 ? z2 : (z - 16 / 116) / 7.787;
1239
- x *= 95.047;
1240
- y *= 100;
1241
- z *= 108.883;
1242
- return [
1243
- x,
1244
- y,
1245
- z
1246
- ];
1247
- };
1248
- convert.lab.lch = function(lab) {
1249
- const l = lab[0];
1250
- const a = lab[1];
1251
- const b = lab[2];
1252
- let h;
1253
- h = Math.atan2(b, a) * 360 / 2 / Math.PI;
1254
- if (h < 0) h += 360;
1255
- return [
1256
- l,
1257
- Math.sqrt(a * a + b * b),
1258
- h
1259
- ];
1260
- };
1261
- convert.lch.lab = function(lch) {
1262
- const l = lch[0];
1263
- const c = lch[1];
1264
- const hr = lch[2] / 360 * 2 * Math.PI;
1265
- return [
1266
- l,
1267
- c * Math.cos(hr),
1268
- c * Math.sin(hr)
1269
- ];
1270
- };
1271
- convert.rgb.ansi16 = function(args, saturation = null) {
1272
- const [r, g, b] = args;
1273
- let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
1274
- value = Math.round(value / 50);
1275
- if (value === 0) return 30;
1276
- let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
1277
- if (value === 2) ansi += 60;
1278
- return ansi;
1279
- };
1280
- convert.hsv.ansi16 = function(args) {
1281
- return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
1282
- };
1283
- convert.rgb.ansi256 = function(args) {
1284
- const r = args[0];
1285
- const g = args[1];
1286
- const b = args[2];
1287
- if (r === g && g === b) {
1288
- if (r < 8) return 16;
1289
- if (r > 248) return 231;
1290
- return Math.round((r - 8) / 247 * 24) + 232;
1291
- }
1292
- return 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
1293
- };
1294
- convert.ansi16.rgb = function(args) {
1295
- let color = args % 10;
1296
- if (color === 0 || color === 7) {
1297
- if (args > 50) color += 3.5;
1298
- color = color / 10.5 * 255;
1299
- return [
1300
- color,
1301
- color,
1302
- color
1303
- ];
1304
- }
1305
- const mult = (~~(args > 50) + 1) * .5;
1306
- return [
1307
- (color & 1) * mult * 255,
1308
- (color >> 1 & 1) * mult * 255,
1309
- (color >> 2 & 1) * mult * 255
1310
- ];
1311
- };
1312
- convert.ansi256.rgb = function(args) {
1313
- if (args >= 232) {
1314
- const c = (args - 232) * 10 + 8;
1315
- return [
1316
- c,
1317
- c,
1318
- c
1319
- ];
1320
- }
1321
- args -= 16;
1322
- let rem;
1323
- return [
1324
- Math.floor(args / 36) / 5 * 255,
1325
- Math.floor((rem = args % 36) / 6) / 5 * 255,
1326
- rem % 6 / 5 * 255
1327
- ];
1328
- };
1329
- convert.rgb.hex = function(args) {
1330
- const string = (((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255)).toString(16).toUpperCase();
1331
- return "000000".substring(string.length) + string;
1332
- };
1333
- convert.hex.rgb = function(args) {
1334
- const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
1335
- if (!match) return [
1336
- 0,
1337
- 0,
1338
- 0
1339
- ];
1340
- let colorString = match[0];
1341
- if (match[0].length === 3) colorString = colorString.split("").map((char) => {
1342
- return char + char;
1343
- }).join("");
1344
- const integer = parseInt(colorString, 16);
1345
- return [
1346
- integer >> 16 & 255,
1347
- integer >> 8 & 255,
1348
- integer & 255
1349
- ];
1350
- };
1351
- convert.rgb.hcg = function(rgb) {
1352
- const r = rgb[0] / 255;
1353
- const g = rgb[1] / 255;
1354
- const b = rgb[2] / 255;
1355
- const max = Math.max(Math.max(r, g), b);
1356
- const min = Math.min(Math.min(r, g), b);
1357
- const chroma = max - min;
1358
- let grayscale;
1359
- let hue;
1360
- if (chroma < 1) grayscale = min / (1 - chroma);
1361
- else grayscale = 0;
1362
- if (chroma <= 0) hue = 0;
1363
- else if (max === r) hue = (g - b) / chroma % 6;
1364
- else if (max === g) hue = 2 + (b - r) / chroma;
1365
- else hue = 4 + (r - g) / chroma;
1366
- hue /= 6;
1367
- hue %= 1;
1368
- return [
1369
- hue * 360,
1370
- chroma * 100,
1371
- grayscale * 100
1372
- ];
1373
- };
1374
- convert.hsl.hcg = function(hsl) {
1375
- const s = hsl[1] / 100;
1376
- const l = hsl[2] / 100;
1377
- const c = l < .5 ? 2 * s * l : 2 * s * (1 - l);
1378
- let f = 0;
1379
- if (c < 1) f = (l - .5 * c) / (1 - c);
1380
- return [
1381
- hsl[0],
1382
- c * 100,
1383
- f * 100
1384
- ];
1385
- };
1386
- convert.hsv.hcg = function(hsv) {
1387
- const s = hsv[1] / 100;
1388
- const v = hsv[2] / 100;
1389
- const c = s * v;
1390
- let f = 0;
1391
- if (c < 1) f = (v - c) / (1 - c);
1392
- return [
1393
- hsv[0],
1394
- c * 100,
1395
- f * 100
1396
- ];
1397
- };
1398
- convert.hcg.rgb = function(hcg) {
1399
- const h = hcg[0] / 360;
1400
- const c = hcg[1] / 100;
1401
- const g = hcg[2] / 100;
1402
- if (c === 0) return [
1403
- g * 255,
1404
- g * 255,
1405
- g * 255
1406
- ];
1407
- const pure = [
1408
- 0,
1409
- 0,
1410
- 0
1411
- ];
1412
- const hi = h % 1 * 6;
1413
- const v = hi % 1;
1414
- const w = 1 - v;
1415
- let mg = 0;
1416
- switch (Math.floor(hi)) {
1417
- case 0:
1418
- pure[0] = 1;
1419
- pure[1] = v;
1420
- pure[2] = 0;
1421
- break;
1422
- case 1:
1423
- pure[0] = w;
1424
- pure[1] = 1;
1425
- pure[2] = 0;
1426
- break;
1427
- case 2:
1428
- pure[0] = 0;
1429
- pure[1] = 1;
1430
- pure[2] = v;
1431
- break;
1432
- case 3:
1433
- pure[0] = 0;
1434
- pure[1] = w;
1435
- pure[2] = 1;
1436
- break;
1437
- case 4:
1438
- pure[0] = v;
1439
- pure[1] = 0;
1440
- pure[2] = 1;
1441
- break;
1442
- default:
1443
- pure[0] = 1;
1444
- pure[1] = 0;
1445
- pure[2] = w;
1446
- }
1447
- mg = (1 - c) * g;
1448
- return [
1449
- (c * pure[0] + mg) * 255,
1450
- (c * pure[1] + mg) * 255,
1451
- (c * pure[2] + mg) * 255
1452
- ];
1453
- };
1454
- convert.hcg.hsv = function(hcg) {
1455
- const c = hcg[1] / 100;
1456
- const v = c + hcg[2] / 100 * (1 - c);
1457
- let f = 0;
1458
- if (v > 0) f = c / v;
1459
- return [
1460
- hcg[0],
1461
- f * 100,
1462
- v * 100
1463
- ];
1464
- };
1465
- convert.hcg.hsl = function(hcg) {
1466
- const c = hcg[1] / 100;
1467
- const l = hcg[2] / 100 * (1 - c) + .5 * c;
1468
- let s = 0;
1469
- if (l > 0 && l < .5) s = c / (2 * l);
1470
- else if (l >= .5 && l < 1) s = c / (2 * (1 - l));
1471
- return [
1472
- hcg[0],
1473
- s * 100,
1474
- l * 100
1475
- ];
1476
- };
1477
- convert.hcg.hwb = function(hcg) {
1478
- const c = hcg[1] / 100;
1479
- const v = c + hcg[2] / 100 * (1 - c);
1480
- return [
1481
- hcg[0],
1482
- (v - c) * 100,
1483
- (1 - v) * 100
1484
- ];
1485
- };
1486
- convert.hwb.hcg = function(hwb) {
1487
- const w = hwb[1] / 100;
1488
- const v = 1 - hwb[2] / 100;
1489
- const c = v - w;
1490
- let g = 0;
1491
- if (c < 1) g = (v - c) / (1 - c);
1492
- return [
1493
- hwb[0],
1494
- c * 100,
1495
- g * 100
1496
- ];
1497
- };
1498
- convert.apple.rgb = function(apple) {
1499
- return [
1500
- apple[0] / 65535 * 255,
1501
- apple[1] / 65535 * 255,
1502
- apple[2] / 65535 * 255
1503
- ];
1504
- };
1505
- convert.rgb.apple = function(rgb) {
1506
- return [
1507
- rgb[0] / 255 * 65535,
1508
- rgb[1] / 255 * 65535,
1509
- rgb[2] / 255 * 65535
1510
- ];
1511
- };
1512
- convert.gray.rgb = function(args) {
1513
- return [
1514
- args[0] / 100 * 255,
1515
- args[0] / 100 * 255,
1516
- args[0] / 100 * 255
1517
- ];
1518
- };
1519
- convert.gray.hsl = function(args) {
1520
- return [
1521
- 0,
1522
- 0,
1523
- args[0]
1524
- ];
1525
- };
1526
- convert.gray.hsv = convert.gray.hsl;
1527
- convert.gray.hwb = function(gray) {
1528
- return [
1529
- 0,
1530
- 100,
1531
- gray[0]
1532
- ];
1533
- };
1534
- convert.gray.cmyk = function(gray) {
1535
- return [
1536
- 0,
1537
- 0,
1538
- 0,
1539
- gray[0]
1540
- ];
1541
- };
1542
- convert.gray.lab = function(gray) {
1543
- return [
1544
- gray[0],
1545
- 0,
1546
- 0
1547
- ];
1548
- };
1549
- convert.gray.hex = function(gray) {
1550
- const val = Math.round(gray[0] / 100 * 255) & 255;
1551
- const string = ((val << 16) + (val << 8) + val).toString(16).toUpperCase();
1552
- return "000000".substring(string.length) + string;
1553
- };
1554
- convert.rgb.gray = function(rgb) {
1555
- return [(rgb[0] + rgb[1] + rgb[2]) / 3 / 255 * 100];
1556
- };
1557
- }));
1558
- //#endregion
1559
- //#region node_modules/color-convert/route.js
1560
- var require_route = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1561
- var conversions = require_conversions();
1562
- function buildGraph() {
1563
- const graph = {};
1564
- const models = Object.keys(conversions);
1565
- for (let len = models.length, i = 0; i < len; i++) graph[models[i]] = {
1566
- distance: -1,
1567
- parent: null
1568
- };
1569
- return graph;
1570
- }
1571
- function deriveBFS(fromModel) {
1572
- const graph = buildGraph();
1573
- const queue = [fromModel];
1574
- graph[fromModel].distance = 0;
1575
- while (queue.length) {
1576
- const current = queue.pop();
1577
- const adjacents = Object.keys(conversions[current]);
1578
- for (let len = adjacents.length, i = 0; i < len; i++) {
1579
- const adjacent = adjacents[i];
1580
- const node = graph[adjacent];
1581
- if (node.distance === -1) {
1582
- node.distance = graph[current].distance + 1;
1583
- node.parent = current;
1584
- queue.unshift(adjacent);
1585
- }
1586
- }
1587
- }
1588
- return graph;
1589
- }
1590
- function link(from, to) {
1591
- return function(args) {
1592
- return to(from(args));
1593
- };
1594
- }
1595
- function wrapConversion(toModel, graph) {
1596
- const path = [graph[toModel].parent, toModel];
1597
- let fn = conversions[graph[toModel].parent][toModel];
1598
- let cur = graph[toModel].parent;
1599
- while (graph[cur].parent) {
1600
- path.unshift(graph[cur].parent);
1601
- fn = link(conversions[graph[cur].parent][cur], fn);
1602
- cur = graph[cur].parent;
1603
- }
1604
- fn.conversion = path;
1605
- return fn;
1606
- }
1607
- module.exports = function(fromModel) {
1608
- const graph = deriveBFS(fromModel);
1609
- const conversion = {};
1610
- const models = Object.keys(graph);
1611
- for (let len = models.length, i = 0; i < len; i++) {
1612
- const toModel = models[i];
1613
- if (graph[toModel].parent === null) continue;
1614
- conversion[toModel] = wrapConversion(toModel, graph);
60
+ Object.keys(styles$1.modifier);
61
+ var foregroundColorNames = Object.keys(styles$1.color);
62
+ var backgroundColorNames = Object.keys(styles$1.bgColor);
63
+ [...foregroundColorNames, ...backgroundColorNames];
64
+ function assembleStyles() {
65
+ const codes = /* @__PURE__ */ new Map();
66
+ for (const [groupName, group] of Object.entries(styles$1)) {
67
+ for (const [styleName, style] of Object.entries(group)) {
68
+ styles$1[styleName] = {
69
+ open: `\u001B[${style[0]}m`,
70
+ close: `\u001B[${style[1]}m`
71
+ };
72
+ group[styleName] = styles$1[styleName];
73
+ codes.set(style[0], style[1]);
1615
74
  }
1616
- return conversion;
1617
- };
1618
- }));
1619
- //#endregion
1620
- //#region node_modules/color-convert/index.js
1621
- var require_color_convert = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1622
- var conversions = require_conversions();
1623
- var route = require_route();
1624
- var convert = {};
1625
- var models = Object.keys(conversions);
1626
- function wrapRaw(fn) {
1627
- const wrappedFn = function(...args) {
1628
- const arg0 = args[0];
1629
- if (arg0 === void 0 || arg0 === null) return arg0;
1630
- if (arg0.length > 1) args = arg0;
1631
- return fn(args);
1632
- };
1633
- if ("conversion" in fn) wrappedFn.conversion = fn.conversion;
1634
- return wrappedFn;
1635
- }
1636
- function wrapRounded(fn) {
1637
- const wrappedFn = function(...args) {
1638
- const arg0 = args[0];
1639
- if (arg0 === void 0 || arg0 === null) return arg0;
1640
- if (arg0.length > 1) args = arg0;
1641
- const result = fn(args);
1642
- if (typeof result === "object") for (let len = result.length, i = 0; i < len; i++) result[i] = Math.round(result[i]);
1643
- return result;
1644
- };
1645
- if ("conversion" in fn) wrappedFn.conversion = fn.conversion;
1646
- return wrappedFn;
1647
- }
1648
- models.forEach((fromModel) => {
1649
- convert[fromModel] = {};
1650
- Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels });
1651
- Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels });
1652
- const routes = route(fromModel);
1653
- Object.keys(routes).forEach((toModel) => {
1654
- const fn = routes[toModel];
1655
- convert[fromModel][toModel] = wrapRounded(fn);
1656
- convert[fromModel][toModel].raw = wrapRaw(fn);
75
+ Object.defineProperty(styles$1, groupName, {
76
+ value: group,
77
+ enumerable: false
1657
78
  });
79
+ }
80
+ Object.defineProperty(styles$1, "codes", {
81
+ value: codes,
82
+ enumerable: false
1658
83
  });
1659
- module.exports = convert;
1660
- }));
1661
- //#endregion
1662
- //#region node_modules/ansi-styles/index.js
1663
- var require_ansi_styles = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1664
- var wrapAnsi16 = (fn, offset) => (...args) => {
1665
- return `\u001B[${fn(...args) + offset}m`;
1666
- };
1667
- var wrapAnsi256 = (fn, offset) => (...args) => {
1668
- const code = fn(...args);
1669
- return `\u001B[${38 + offset};5;${code}m`;
1670
- };
1671
- var wrapAnsi16m = (fn, offset) => (...args) => {
1672
- const rgb = fn(...args);
1673
- return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
1674
- };
1675
- var ansi2ansi = (n) => n;
1676
- var rgb2rgb = (r, g, b) => [
1677
- r,
1678
- g,
1679
- b
1680
- ];
1681
- var setLazyProperty = (object, property, get) => {
1682
- Object.defineProperty(object, property, {
1683
- get: () => {
1684
- const value = get();
1685
- Object.defineProperty(object, property, {
1686
- value,
1687
- enumerable: true,
1688
- configurable: true
1689
- });
1690
- return value;
84
+ styles$1.color.close = "\x1B[39m";
85
+ styles$1.bgColor.close = "\x1B[49m";
86
+ styles$1.color.ansi = wrapAnsi16();
87
+ styles$1.color.ansi256 = wrapAnsi256();
88
+ styles$1.color.ansi16m = wrapAnsi16m();
89
+ styles$1.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
90
+ styles$1.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
91
+ styles$1.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
92
+ Object.defineProperties(styles$1, {
93
+ rgbToAnsi256: {
94
+ value(red, green, blue) {
95
+ if (red === green && green === blue) {
96
+ if (red < 8) return 16;
97
+ if (red > 248) return 231;
98
+ return Math.round((red - 8) / 247 * 24) + 232;
99
+ }
100
+ return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
1691
101
  },
1692
- enumerable: true,
1693
- configurable: true
1694
- });
1695
- };
1696
- /** @type {typeof import('color-convert')} */
1697
- var colorConvert;
1698
- var makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
1699
- if (colorConvert === void 0) colorConvert = require_color_convert();
1700
- const offset = isBackground ? 10 : 0;
1701
- const styles = {};
1702
- for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
1703
- const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
1704
- if (sourceSpace === targetSpace) styles[name] = wrap(identity, offset);
1705
- else if (typeof suite === "object") styles[name] = wrap(suite[targetSpace], offset);
1706
- }
1707
- return styles;
1708
- };
1709
- function assembleStyles() {
1710
- const codes = /* @__PURE__ */ new Map();
1711
- const styles = {
1712
- modifier: {
1713
- reset: [0, 0],
1714
- bold: [1, 22],
1715
- dim: [2, 22],
1716
- italic: [3, 23],
1717
- underline: [4, 24],
1718
- inverse: [7, 27],
1719
- hidden: [8, 28],
1720
- strikethrough: [9, 29]
102
+ enumerable: false
103
+ },
104
+ hexToRgb: {
105
+ value(hex) {
106
+ const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
107
+ if (!matches) return [
108
+ 0,
109
+ 0,
110
+ 0
111
+ ];
112
+ let [colorString] = matches;
113
+ if (colorString.length === 3) colorString = [...colorString].map((character) => character + character).join("");
114
+ const integer = Number.parseInt(colorString, 16);
115
+ return [
116
+ integer >> 16 & 255,
117
+ integer >> 8 & 255,
118
+ integer & 255
119
+ ];
1721
120
  },
1722
- color: {
1723
- black: [30, 39],
1724
- red: [31, 39],
1725
- green: [32, 39],
1726
- yellow: [33, 39],
1727
- blue: [34, 39],
1728
- magenta: [35, 39],
1729
- cyan: [36, 39],
1730
- white: [37, 39],
1731
- blackBright: [90, 39],
1732
- redBright: [91, 39],
1733
- greenBright: [92, 39],
1734
- yellowBright: [93, 39],
1735
- blueBright: [94, 39],
1736
- magentaBright: [95, 39],
1737
- cyanBright: [96, 39],
1738
- whiteBright: [97, 39]
121
+ enumerable: false
122
+ },
123
+ hexToAnsi256: {
124
+ value: (hex) => styles$1.rgbToAnsi256(...styles$1.hexToRgb(hex)),
125
+ enumerable: false
126
+ },
127
+ ansi256ToAnsi: {
128
+ value(code) {
129
+ if (code < 8) return 30 + code;
130
+ if (code < 16) return 90 + (code - 8);
131
+ let red;
132
+ let green;
133
+ let blue;
134
+ if (code >= 232) {
135
+ red = ((code - 232) * 10 + 8) / 255;
136
+ green = red;
137
+ blue = red;
138
+ } else {
139
+ code -= 16;
140
+ const remainder = code % 36;
141
+ red = Math.floor(code / 36) / 5;
142
+ green = Math.floor(remainder / 6) / 5;
143
+ blue = remainder % 6 / 5;
144
+ }
145
+ const value = Math.max(red, green, blue) * 2;
146
+ if (value === 0) return 30;
147
+ let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
148
+ if (value === 2) result += 60;
149
+ return result;
1739
150
  },
1740
- bgColor: {
1741
- bgBlack: [40, 49],
1742
- bgRed: [41, 49],
1743
- bgGreen: [42, 49],
1744
- bgYellow: [43, 49],
1745
- bgBlue: [44, 49],
1746
- bgMagenta: [45, 49],
1747
- bgCyan: [46, 49],
1748
- bgWhite: [47, 49],
1749
- bgBlackBright: [100, 49],
1750
- bgRedBright: [101, 49],
1751
- bgGreenBright: [102, 49],
1752
- bgYellowBright: [103, 49],
1753
- bgBlueBright: [104, 49],
1754
- bgMagentaBright: [105, 49],
1755
- bgCyanBright: [106, 49],
1756
- bgWhiteBright: [107, 49]
1757
- }
1758
- };
1759
- styles.color.gray = styles.color.blackBright;
1760
- styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
1761
- styles.color.grey = styles.color.blackBright;
1762
- styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
1763
- for (const [groupName, group] of Object.entries(styles)) {
1764
- for (const [styleName, style] of Object.entries(group)) {
1765
- styles[styleName] = {
1766
- open: `\u001B[${style[0]}m`,
1767
- close: `\u001B[${style[1]}m`
1768
- };
1769
- group[styleName] = styles[styleName];
1770
- codes.set(style[0], style[1]);
1771
- }
1772
- Object.defineProperty(styles, groupName, {
1773
- value: group,
1774
- enumerable: false
1775
- });
1776
- }
1777
- Object.defineProperty(styles, "codes", {
1778
- value: codes,
1779
151
  enumerable: false
1780
- });
1781
- styles.color.close = "\x1B[39m";
1782
- styles.bgColor.close = "\x1B[49m";
1783
- setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
1784
- setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
1785
- setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
1786
- setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
1787
- setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
1788
- setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
1789
- return styles;
1790
- }
1791
- Object.defineProperty(module, "exports", {
1792
- enumerable: true,
1793
- get: assembleStyles
152
+ },
153
+ rgbToAnsi: {
154
+ value: (red, green, blue) => styles$1.ansi256ToAnsi(styles$1.rgbToAnsi256(red, green, blue)),
155
+ enumerable: false
156
+ },
157
+ hexToAnsi: {
158
+ value: (hex) => styles$1.ansi256ToAnsi(styles$1.hexToAnsi256(hex)),
159
+ enumerable: false
160
+ }
1794
161
  });
1795
- }));
1796
- //#endregion
1797
- //#region node_modules/supports-color/browser.js
1798
- var require_browser = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1799
- module.exports = {
1800
- stdout: false,
1801
- stderr: false
1802
- };
1803
- }));
162
+ return styles$1;
163
+ }
164
+ var ansiStyles = assembleStyles();
1804
165
  //#endregion
1805
- //#region node_modules/chalk/source/util.js
1806
- var require_util = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1807
- var stringReplaceAll = (string, substring, replacer) => {
1808
- let index = string.indexOf(substring);
1809
- if (index === -1) return string;
1810
- const substringLength = substring.length;
1811
- let endIndex = 0;
1812
- let returnValue = "";
1813
- do {
1814
- returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
1815
- endIndex = index + substringLength;
1816
- index = string.indexOf(substring, endIndex);
1817
- } while (index !== -1);
1818
- returnValue += string.substr(endIndex);
1819
- return returnValue;
1820
- };
1821
- var stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
1822
- let endIndex = 0;
1823
- let returnValue = "";
1824
- do {
1825
- const gotCR = string[index - 1] === "\r";
1826
- returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
1827
- endIndex = index + 1;
1828
- index = string.indexOf("\n", endIndex);
1829
- } while (index !== -1);
1830
- returnValue += string.substr(endIndex);
1831
- return returnValue;
1832
- };
1833
- module.exports = {
1834
- stringReplaceAll,
1835
- stringEncaseCRLFWithFirstIndex
1836
- };
1837
- }));
166
+ //#region node_modules/chalk/source/vendor/supports-color/browser.js
167
+ var level = (() => {
168
+ if (!("navigator" in globalThis)) return 0;
169
+ if (globalThis.navigator.userAgentData) {
170
+ const brand = navigator.userAgentData.brands.find(({ brand }) => brand === "Chromium");
171
+ if (brand && brand.version > 93) return 3;
172
+ }
173
+ if (/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)) return 1;
174
+ return 0;
175
+ })();
176
+ var colorSupport = level !== 0 && {
177
+ level,
178
+ hasBasic: true,
179
+ has256: level >= 2,
180
+ has16m: level >= 3
181
+ };
182
+ var supportsColor = {
183
+ stdout: colorSupport,
184
+ stderr: colorSupport
185
+ };
1838
186
  //#endregion
1839
- //#region node_modules/chalk/source/templates.js
1840
- var require_templates = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1841
- 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;
1842
- var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
1843
- var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
1844
- var ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
1845
- var ESCAPES = new Map([
1846
- ["n", "\n"],
1847
- ["r", "\r"],
1848
- ["t", " "],
1849
- ["b", "\b"],
1850
- ["f", "\f"],
1851
- ["v", "\v"],
1852
- ["0", "\0"],
1853
- ["\\", "\\"],
1854
- ["e", "\x1B"],
1855
- ["a", "\x07"]
1856
- ]);
1857
- function unescape(c) {
1858
- const u = c[0] === "u";
1859
- const bracket = c[1] === "{";
1860
- if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) return String.fromCharCode(parseInt(c.slice(1), 16));
1861
- if (u && bracket) return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
1862
- return ESCAPES.get(c) || c;
1863
- }
1864
- function parseArguments(name, arguments_) {
1865
- const results = [];
1866
- const chunks = arguments_.trim().split(/\s*,\s*/g);
1867
- let matches;
1868
- for (const chunk of chunks) {
1869
- const number = Number(chunk);
1870
- if (!Number.isNaN(number)) results.push(number);
1871
- else if (matches = chunk.match(STRING_REGEX)) results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
1872
- else throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
1873
- }
1874
- return results;
1875
- }
1876
- function parseStyle(style) {
1877
- STYLE_REGEX.lastIndex = 0;
1878
- const results = [];
1879
- let matches;
1880
- while ((matches = STYLE_REGEX.exec(style)) !== null) {
1881
- const name = matches[1];
1882
- if (matches[2]) {
1883
- const args = parseArguments(name, matches[2]);
1884
- results.push([name].concat(args));
1885
- } else results.push([name]);
1886
- }
1887
- return results;
1888
- }
1889
- function buildStyle(chalk, styles) {
1890
- const enabled = {};
1891
- for (const layer of styles) for (const style of layer.styles) enabled[style[0]] = layer.inverse ? null : style.slice(1);
1892
- let current = chalk;
1893
- for (const [styleName, styles] of Object.entries(enabled)) {
1894
- if (!Array.isArray(styles)) continue;
1895
- if (!(styleName in current)) throw new Error(`Unknown Chalk style: ${styleName}`);
1896
- current = styles.length > 0 ? current[styleName](...styles) : current[styleName];
1897
- }
1898
- return current;
1899
- }
1900
- module.exports = (chalk, temporary) => {
1901
- const styles = [];
1902
- const chunks = [];
1903
- let chunk = [];
1904
- temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
1905
- if (escapeCharacter) chunk.push(unescape(escapeCharacter));
1906
- else if (style) {
1907
- const string = chunk.join("");
1908
- chunk = [];
1909
- chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string));
1910
- styles.push({
1911
- inverse,
1912
- styles: parseStyle(style)
1913
- });
1914
- } else if (close) {
1915
- if (styles.length === 0) throw new Error("Found extraneous } in Chalk template literal");
1916
- chunks.push(buildStyle(chalk, styles)(chunk.join("")));
1917
- chunk = [];
1918
- styles.pop();
1919
- } else chunk.push(character);
1920
- });
1921
- chunks.push(chunk.join(""));
1922
- if (styles.length > 0) {
1923
- const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
1924
- throw new Error(errMessage);
1925
- }
1926
- return chunks.join("");
1927
- };
1928
- }));
187
+ //#region node_modules/chalk/source/utilities.js
188
+ function stringReplaceAll(string, substring, replacer) {
189
+ let index = string.indexOf(substring);
190
+ if (index === -1) return string;
191
+ const substringLength = substring.length;
192
+ let endIndex = 0;
193
+ let returnValue = "";
194
+ do {
195
+ returnValue += string.slice(endIndex, index) + substring + replacer;
196
+ endIndex = index + substringLength;
197
+ index = string.indexOf(substring, endIndex);
198
+ } while (index !== -1);
199
+ returnValue += string.slice(endIndex);
200
+ return returnValue;
201
+ }
202
+ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
203
+ let endIndex = 0;
204
+ let returnValue = "";
205
+ do {
206
+ const gotCR = string[index - 1] === "\r";
207
+ returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
208
+ endIndex = index + 1;
209
+ index = string.indexOf("\n", endIndex);
210
+ } while (index !== -1);
211
+ returnValue += string.slice(endIndex);
212
+ return returnValue;
213
+ }
1929
214
  //#endregion
1930
- //#region src/commonTypes.ts
1931
- var import_source = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
1932
- var ansiStyles = require_ansi_styles();
1933
- var { stdout: stdoutColor, stderr: stderrColor } = require_browser();
1934
- var { stringReplaceAll, stringEncaseCRLFWithFirstIndex } = require_util();
1935
- var { isArray } = Array;
1936
- var levelMapping = [
1937
- "ansi",
1938
- "ansi",
1939
- "ansi256",
1940
- "ansi16m"
1941
- ];
1942
- var styles = Object.create(null);
1943
- var applyOptions = (object, options = {}) => {
1944
- 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");
1945
- const colorLevel = stdoutColor ? stdoutColor.level : 0;
1946
- object.level = options.level === void 0 ? colorLevel : options.level;
1947
- };
1948
- var ChalkClass = class {
1949
- constructor(options) {
1950
- return chalkFactory(options);
1951
- }
1952
- };
1953
- var chalkFactory = (options) => {
1954
- const chalk = {};
1955
- applyOptions(chalk, options);
1956
- chalk.template = (...arguments_) => chalkTag(chalk.template, ...arguments_);
1957
- Object.setPrototypeOf(chalk, Chalk.prototype);
1958
- Object.setPrototypeOf(chalk.template, chalk);
1959
- chalk.template.constructor = () => {
1960
- throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
215
+ //#region node_modules/chalk/source/index.js
216
+ var { stdout: stdoutColor, stderr: stderrColor } = supportsColor;
217
+ var GENERATOR = Symbol("GENERATOR");
218
+ var STYLER = Symbol("STYLER");
219
+ var IS_EMPTY = Symbol("IS_EMPTY");
220
+ var levelMapping = [
221
+ "ansi",
222
+ "ansi",
223
+ "ansi256",
224
+ "ansi16m"
225
+ ];
226
+ var styles = Object.create(null);
227
+ var applyOptions = (object, options = {}) => {
228
+ 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");
229
+ const colorLevel = stdoutColor ? stdoutColor.level : 0;
230
+ object.level = options.level === void 0 ? colorLevel : options.level;
231
+ };
232
+ var chalkFactory = (options) => {
233
+ const chalk = (...strings) => strings.join(" ");
234
+ applyOptions(chalk, options);
235
+ Object.setPrototypeOf(chalk, createChalk.prototype);
236
+ return chalk;
237
+ };
238
+ function createChalk(options) {
239
+ return chalkFactory(options);
240
+ }
241
+ Object.setPrototypeOf(createChalk.prototype, Function.prototype);
242
+ for (const [styleName, style] of Object.entries(ansiStyles)) styles[styleName] = { get() {
243
+ const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
244
+ Object.defineProperty(this, styleName, { value: builder });
245
+ return builder;
246
+ } };
247
+ styles.visible = { get() {
248
+ const builder = createBuilder(this, this[STYLER], true);
249
+ Object.defineProperty(this, "visible", { value: builder });
250
+ return builder;
251
+ } };
252
+ var getModelAnsi = (model, level, type, ...arguments_) => {
253
+ if (model === "rgb") {
254
+ if (level === "ansi16m") return ansiStyles[type].ansi16m(...arguments_);
255
+ if (level === "ansi256") return ansiStyles[type].ansi256(ansiStyles.rgbToAnsi256(...arguments_));
256
+ return ansiStyles[type].ansi(ansiStyles.rgbToAnsi(...arguments_));
257
+ }
258
+ if (model === "hex") return getModelAnsi("rgb", level, type, ...ansiStyles.hexToRgb(...arguments_));
259
+ return ansiStyles[type][model](...arguments_);
260
+ };
261
+ for (const model of [
262
+ "rgb",
263
+ "hex",
264
+ "ansi256"
265
+ ]) {
266
+ styles[model] = { get() {
267
+ const { level } = this;
268
+ return function(...arguments_) {
269
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansiStyles.color.close, this[STYLER]);
270
+ return createBuilder(this, styler, this[IS_EMPTY]);
1961
271
  };
1962
- chalk.template.Instance = ChalkClass;
1963
- return chalk.template;
1964
- };
1965
- function Chalk(options) {
1966
- return chalkFactory(options);
1967
- }
1968
- for (const [styleName, style] of Object.entries(ansiStyles)) styles[styleName] = { get() {
1969
- const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
1970
- Object.defineProperty(this, styleName, { value: builder });
1971
- return builder;
1972
- } };
1973
- styles.visible = { get() {
1974
- const builder = createBuilder(this, this._styler, true);
1975
- Object.defineProperty(this, "visible", { value: builder });
1976
- return builder;
1977
272
  } };
1978
- var usedModels = [
1979
- "rgb",
1980
- "hex",
1981
- "keyword",
1982
- "hsl",
1983
- "hsv",
1984
- "hwb",
1985
- "ansi",
1986
- "ansi256"
1987
- ];
1988
- for (const model of usedModels) styles[model] = { get() {
273
+ const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
274
+ styles[bgModel] = { get() {
1989
275
  const { level } = this;
1990
276
  return function(...arguments_) {
1991
- const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
1992
- return createBuilder(this, styler, this._isEmpty);
277
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansiStyles.bgColor.close, this[STYLER]);
278
+ return createBuilder(this, styler, this[IS_EMPTY]);
1993
279
  };
1994
280
  } };
1995
- for (const model of usedModels) {
1996
- const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
1997
- styles[bgModel] = { get() {
1998
- const { level } = this;
1999
- return function(...arguments_) {
2000
- const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
2001
- return createBuilder(this, styler, this._isEmpty);
2002
- };
2003
- } };
2004
- }
2005
- var proto = Object.defineProperties(() => {}, {
2006
- ...styles,
2007
- level: {
2008
- enumerable: true,
2009
- get() {
2010
- return this._generator.level;
2011
- },
2012
- set(level) {
2013
- this._generator.level = level;
2014
- }
2015
- }
2016
- });
2017
- var createStyler = (open, close, parent) => {
2018
- let openAll;
2019
- let closeAll;
2020
- if (parent === void 0) {
2021
- openAll = open;
2022
- closeAll = close;
2023
- } else {
2024
- openAll = parent.openAll + open;
2025
- closeAll = close + parent.closeAll;
2026
- }
2027
- return {
2028
- open,
2029
- close,
2030
- openAll,
2031
- closeAll,
2032
- parent
2033
- };
2034
- };
2035
- var createBuilder = (self, _styler, _isEmpty) => {
2036
- const builder = (...arguments_) => {
2037
- if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) return applyStyle(builder, chalkTag(builder, ...arguments_));
2038
- return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
2039
- };
2040
- Object.setPrototypeOf(builder, proto);
2041
- builder._generator = self;
2042
- builder._styler = _styler;
2043
- builder._isEmpty = _isEmpty;
2044
- return builder;
2045
- };
2046
- var applyStyle = (self, string) => {
2047
- if (self.level <= 0 || !string) return self._isEmpty ? "" : string;
2048
- let styler = self._styler;
2049
- if (styler === void 0) return string;
2050
- const { openAll, closeAll } = styler;
2051
- if (string.indexOf("\x1B") !== -1) while (styler !== void 0) {
2052
- string = stringReplaceAll(string, styler.close, styler.open);
2053
- styler = styler.parent;
281
+ }
282
+ var proto = Object.defineProperties(() => {}, {
283
+ ...styles,
284
+ level: {
285
+ enumerable: true,
286
+ get() {
287
+ return this[GENERATOR].level;
288
+ },
289
+ set(level) {
290
+ this[GENERATOR].level = level;
2054
291
  }
2055
- const lfIndex = string.indexOf("\n");
2056
- if (lfIndex !== -1) string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
2057
- return openAll + string + closeAll;
2058
- };
2059
- var template;
2060
- var chalkTag = (chalk, ...strings) => {
2061
- const [firstString] = strings;
2062
- if (!isArray(firstString) || !isArray(firstString.raw)) return strings.join(" ");
2063
- const arguments_ = strings.slice(1);
2064
- const parts = [firstString.raw[0]];
2065
- for (let i = 1; i < firstString.length; i++) parts.push(String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"), String(firstString.raw[i]));
2066
- if (template === void 0) template = require_templates();
2067
- return template(chalk, parts.join(""));
292
+ }
293
+ });
294
+ var createStyler = (open, close, parent) => {
295
+ let openAll;
296
+ let closeAll;
297
+ if (parent === void 0) {
298
+ openAll = open;
299
+ closeAll = close;
300
+ } else {
301
+ openAll = parent.openAll + open;
302
+ closeAll = close + parent.closeAll;
303
+ }
304
+ return {
305
+ open,
306
+ close,
307
+ openAll,
308
+ closeAll,
309
+ parent
2068
310
  };
2069
- Object.defineProperties(Chalk.prototype, styles);
2070
- var chalk = Chalk();
2071
- chalk.supportsColor = stdoutColor;
2072
- chalk.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
2073
- chalk.stderr.supportsColor = stderrColor;
2074
- module.exports = chalk;
2075
- })))());
311
+ };
312
+ var createBuilder = (self, _styler, _isEmpty) => {
313
+ const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
314
+ Object.setPrototypeOf(builder, proto);
315
+ builder[GENERATOR] = self;
316
+ builder[STYLER] = _styler;
317
+ builder[IS_EMPTY] = _isEmpty;
318
+ return builder;
319
+ };
320
+ var applyStyle = (self, string) => {
321
+ if (self.level <= 0 || !string) return self[IS_EMPTY] ? "" : string;
322
+ let styler = self[STYLER];
323
+ if (styler === void 0) return string;
324
+ const { openAll, closeAll } = styler;
325
+ if (string.includes("\x1B")) while (styler !== void 0) {
326
+ string = stringReplaceAll(string, styler.close, styler.open);
327
+ styler = styler.parent;
328
+ }
329
+ const lfIndex = string.indexOf("\n");
330
+ if (lfIndex !== -1) string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
331
+ return openAll + string + closeAll;
332
+ };
333
+ Object.defineProperties(createChalk.prototype, styles);
334
+ var chalk = createChalk();
335
+ createChalk({ level: stderrColor ? stderrColor.level : 0 });
336
+ //#endregion
337
+ //#region src/commonTypes.ts
2076
338
  var ModelDelimeter = /* @__PURE__ */ function(ModelDelimeter) {
2077
339
  ModelDelimeter["ROOT"] = "_";
2078
340
  ModelDelimeter["SEPERATOR"] = "|";
@@ -2095,25 +357,25 @@ var CheckValidChar = (checkParams) => {
2095
357
  };
2096
358
  var defaultLogger = {
2097
359
  debug(message) {
2098
- console.log(import_source.default.grey(`debug: ${message}`));
360
+ console.log(chalk.grey(`debug: ${message}`));
2099
361
  },
2100
362
  error(message) {
2101
- console.log(import_source.default.red(`error: ${message}`));
363
+ console.log(chalk.red(`error: ${message}`));
2102
364
  },
2103
365
  http(message) {
2104
- console.log(import_source.default.cyan(`http: ${message}`));
366
+ console.log(chalk.cyan(`http: ${message}`));
2105
367
  },
2106
368
  info(message) {
2107
- console.log(import_source.default.white(`info: ${message}`));
369
+ console.log(chalk.white(`info: ${message}`));
2108
370
  },
2109
371
  silly(message) {
2110
- console.log(import_source.default.yellow(`silly: ${message}`));
372
+ console.log(chalk.yellow(`silly: ${message}`));
2111
373
  },
2112
374
  verbose(message) {
2113
- console.log(import_source.default.green(`verbose: ${message}`));
375
+ console.log(chalk.green(`verbose: ${message}`));
2114
376
  },
2115
377
  warn(message) {
2116
- console.log(import_source.default.magenta(`warn: ${message}`));
378
+ console.log(chalk.magenta(`warn: ${message}`));
2117
379
  }
2118
380
  };
2119
381
  var emptyLogger = {
@@ -2144,32 +406,6 @@ function GetErrorPayload(errorCode, details = null) {
2144
406
  };
2145
407
  }
2146
408
  //#endregion
2147
- //#region src/validate.ts
2148
- var ajv = new ajv_dist_jtd_js.default();
2149
- var _Validate = (validator, payload) => {
2150
- if (!validator(payload)) return validator.errors;
2151
- else return null;
2152
- };
2153
- function AddSchema(name, schema) {
2154
- ajv.addSchema(schema, name);
2155
- }
2156
- function Validate(name, payload) {
2157
- const validator = ajv.getSchema(name);
2158
- if (validator) return _Validate(validator, payload);
2159
- }
2160
- //#endregion
2161
- //#region src/stsoptionsbase.ts
2162
- var STSOptionsBase = class {
2163
- #options;
2164
- constructor(options = null) {
2165
- this.#options = options;
2166
- if (options !== null) if (typeof options.validator === "undefined") {} else Validate(options.validator, options);
2167
- }
2168
- get options() {
2169
- return this.#options;
2170
- }
2171
- };
2172
- //#endregion
2173
409
  //#region src/sleep.ts
2174
410
  async function Sleep(milliseconds = 1e3) {
2175
411
  return new Promise((resolve) => setTimeout(resolve, milliseconds));
@@ -2513,7 +749,9 @@ var AgentManager = class {
2513
749
  }
2514
750
  };
2515
751
  //#endregion
2516
- exports.AddSchema = AddSchema;
752
+ //#region src/index.ts
753
+ var isNode = typeof process !== "undefined" && typeof process.release !== "undefined" && process.release.name === "node";
754
+ //#endregion
2517
755
  exports.CheckValidChar = CheckValidChar;
2518
756
  exports.GetErrorPayload = GetErrorPayload;
2519
757
  exports.JestSleep = JestSleep;
@@ -2523,13 +761,12 @@ exports.OAuth2ParameterType = OAuth2ParameterType;
2523
761
  exports.OIDCAddressClaim = OIDCAddressClaim;
2524
762
  exports.OIDCStandardClaim = OIDCStandardClaim;
2525
763
  exports.STSAxiosConfig = STSAxiosConfig;
2526
- exports.STSOptionsBase = STSOptionsBase;
2527
764
  exports.Sleep = Sleep;
2528
- exports.Validate = Validate;
2529
765
  exports.compareParameterTypes = compareParameterTypes;
2530
766
  exports.createAgentManager = createAgentManager;
2531
767
  exports.defaultLogger = defaultLogger;
2532
768
  exports.edbaction = edbaction;
2533
769
  exports.emptyLogger = emptyLogger;
770
+ exports.isNode = isNode;
2534
771
 
2535
772
  //# sourceMappingURL=index.cjs.map