@nsshunt/stsoauth2plugin 1.0.162 → 1.0.163
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 +695 -4120
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +691 -4116
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -1,2101 +1,382 @@
|
|
|
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$1 = Object.create;
|
|
4
|
+
var __defProp$1 = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames$1 = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf$1 = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __commonJSMin$1 = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
10
|
+
var __copyProps$1 = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames$1(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
12
|
key = keys[i];
|
|
13
|
-
if (!__hasOwnProp$
|
|
13
|
+
if (!__hasOwnProp$1.call(to, key) && key !== except) __defProp$1(to, key, {
|
|
14
14
|
get: ((k) => from[k]).bind(null, key),
|
|
15
|
-
enumerable: !(desc = __getOwnPropDesc$
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc$1(from, key)) || desc.enumerable
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM$
|
|
20
|
+
var __toESM$1 = (mod, isNodeMode, target) => (target = mod != null ? __create$1(__getProtoOf$1(mod)) : {}, __copyProps$1(isNodeMode || !mod || !mod.__esModule ? __defProp$1(target, "default", {
|
|
21
21
|
value: mod,
|
|
22
22
|
enumerable: true
|
|
23
23
|
}) : target, mod));
|
|
24
24
|
//#endregion
|
|
25
25
|
let vue = require("vue");
|
|
26
26
|
let node_worker_threads = require("node:worker_threads");
|
|
27
|
-
node_worker_threads = __toESM$
|
|
27
|
+
node_worker_threads = __toESM$1(node_worker_threads);
|
|
28
28
|
let _nsshunt_stsutils = require("@nsshunt/stsutils");
|
|
29
29
|
let _nsshunt_stsvueutils = require("@nsshunt/stsvueutils");
|
|
30
30
|
let pinia = require("pinia");
|
|
31
31
|
let axios = require("axios");
|
|
32
|
-
axios = __toESM$
|
|
32
|
+
axios = __toESM$1(axios);
|
|
33
33
|
let _nsshunt_stsobservability = require("@nsshunt/stsobservability");
|
|
34
34
|
let node_http = require("node:http");
|
|
35
|
-
node_http = __toESM$
|
|
35
|
+
node_http = __toESM$1(node_http);
|
|
36
36
|
let node_https = require("node:https");
|
|
37
|
-
node_https = __toESM$
|
|
37
|
+
node_https = __toESM$1(node_https);
|
|
38
38
|
//#region src/stsPluginKeys.ts
|
|
39
39
|
var STSOAuth2ManagerPluginKey = Symbol();
|
|
40
40
|
//#endregion
|
|
41
|
-
//#region node_modules/
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
],
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
],
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
],
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
],
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
],
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
],
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
],
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
],
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
226
|
|
98
|
-
],
|
|
99
|
-
"brown": [
|
|
100
|
-
165,
|
|
101
|
-
42,
|
|
102
|
-
42
|
|
103
|
-
],
|
|
104
|
-
"burlywood": [
|
|
105
|
-
222,
|
|
106
|
-
184,
|
|
107
|
-
135
|
|
108
|
-
],
|
|
109
|
-
"cadetblue": [
|
|
110
|
-
95,
|
|
111
|
-
158,
|
|
112
|
-
160
|
|
113
|
-
],
|
|
114
|
-
"chartreuse": [
|
|
115
|
-
127,
|
|
116
|
-
255,
|
|
117
|
-
0
|
|
118
|
-
],
|
|
119
|
-
"chocolate": [
|
|
120
|
-
210,
|
|
121
|
-
105,
|
|
122
|
-
30
|
|
123
|
-
],
|
|
124
|
-
"coral": [
|
|
125
|
-
255,
|
|
126
|
-
127,
|
|
127
|
-
80
|
|
128
|
-
],
|
|
129
|
-
"cornflowerblue": [
|
|
130
|
-
100,
|
|
131
|
-
149,
|
|
132
|
-
237
|
|
133
|
-
],
|
|
134
|
-
"cornsilk": [
|
|
135
|
-
255,
|
|
136
|
-
248,
|
|
137
|
-
220
|
|
138
|
-
],
|
|
139
|
-
"crimson": [
|
|
140
|
-
220,
|
|
141
|
-
20,
|
|
142
|
-
60
|
|
143
|
-
],
|
|
144
|
-
"cyan": [
|
|
145
|
-
0,
|
|
146
|
-
255,
|
|
147
|
-
255
|
|
148
|
-
],
|
|
149
|
-
"darkblue": [
|
|
150
|
-
0,
|
|
151
|
-
0,
|
|
152
|
-
139
|
|
153
|
-
],
|
|
154
|
-
"darkcyan": [
|
|
155
|
-
0,
|
|
156
|
-
139,
|
|
157
|
-
139
|
|
158
|
-
],
|
|
159
|
-
"darkgoldenrod": [
|
|
160
|
-
184,
|
|
161
|
-
134,
|
|
162
|
-
11
|
|
163
|
-
],
|
|
164
|
-
"darkgray": [
|
|
165
|
-
169,
|
|
166
|
-
169,
|
|
167
|
-
169
|
|
168
|
-
],
|
|
169
|
-
"darkgreen": [
|
|
170
|
-
0,
|
|
171
|
-
100,
|
|
172
|
-
0
|
|
173
|
-
],
|
|
174
|
-
"darkgrey": [
|
|
175
|
-
169,
|
|
176
|
-
169,
|
|
177
|
-
169
|
|
178
|
-
],
|
|
179
|
-
"darkkhaki": [
|
|
180
|
-
189,
|
|
181
|
-
183,
|
|
182
|
-
107
|
|
183
|
-
],
|
|
184
|
-
"darkmagenta": [
|
|
185
|
-
139,
|
|
186
|
-
0,
|
|
187
|
-
139
|
|
188
|
-
],
|
|
189
|
-
"darkolivegreen": [
|
|
190
|
-
85,
|
|
191
|
-
107,
|
|
192
|
-
47
|
|
193
|
-
],
|
|
194
|
-
"darkorange": [
|
|
195
|
-
255,
|
|
196
|
-
140,
|
|
197
|
-
0
|
|
198
|
-
],
|
|
199
|
-
"darkorchid": [
|
|
200
|
-
153,
|
|
201
|
-
50,
|
|
202
|
-
204
|
|
203
|
-
],
|
|
204
|
-
"darkred": [
|
|
205
|
-
139,
|
|
206
|
-
0,
|
|
207
|
-
0
|
|
208
|
-
],
|
|
209
|
-
"darksalmon": [
|
|
210
|
-
233,
|
|
211
|
-
150,
|
|
212
|
-
122
|
|
213
|
-
],
|
|
214
|
-
"darkseagreen": [
|
|
215
|
-
143,
|
|
216
|
-
188,
|
|
217
|
-
143
|
|
218
|
-
],
|
|
219
|
-
"darkslateblue": [
|
|
220
|
-
72,
|
|
221
|
-
61,
|
|
222
|
-
139
|
|
223
|
-
],
|
|
224
|
-
"darkslategray": [
|
|
225
|
-
47,
|
|
226
|
-
79,
|
|
227
|
-
79
|
|
228
|
-
],
|
|
229
|
-
"darkslategrey": [
|
|
230
|
-
47,
|
|
231
|
-
79,
|
|
232
|
-
79
|
|
233
|
-
],
|
|
234
|
-
"darkturquoise": [
|
|
235
|
-
0,
|
|
236
|
-
206,
|
|
237
|
-
209
|
|
238
|
-
],
|
|
239
|
-
"darkviolet": [
|
|
240
|
-
148,
|
|
241
|
-
0,
|
|
242
|
-
211
|
|
243
|
-
],
|
|
244
|
-
"deeppink": [
|
|
245
|
-
255,
|
|
246
|
-
20,
|
|
247
|
-
147
|
|
248
|
-
],
|
|
249
|
-
"deepskyblue": [
|
|
250
|
-
0,
|
|
251
|
-
191,
|
|
252
|
-
255
|
|
253
|
-
],
|
|
254
|
-
"dimgray": [
|
|
255
|
-
105,
|
|
256
|
-
105,
|
|
257
|
-
105
|
|
258
|
-
],
|
|
259
|
-
"dimgrey": [
|
|
260
|
-
105,
|
|
261
|
-
105,
|
|
262
|
-
105
|
|
263
|
-
],
|
|
264
|
-
"dodgerblue": [
|
|
265
|
-
30,
|
|
266
|
-
144,
|
|
267
|
-
255
|
|
268
|
-
],
|
|
269
|
-
"firebrick": [
|
|
270
|
-
178,
|
|
271
|
-
34,
|
|
272
|
-
34
|
|
273
|
-
],
|
|
274
|
-
"floralwhite": [
|
|
275
|
-
255,
|
|
276
|
-
250,
|
|
277
|
-
240
|
|
278
|
-
],
|
|
279
|
-
"forestgreen": [
|
|
280
|
-
34,
|
|
281
|
-
139,
|
|
282
|
-
34
|
|
283
|
-
],
|
|
284
|
-
"fuchsia": [
|
|
285
|
-
255,
|
|
286
|
-
0,
|
|
287
|
-
255
|
|
288
|
-
],
|
|
289
|
-
"gainsboro": [
|
|
290
|
-
220,
|
|
291
|
-
220,
|
|
292
|
-
220
|
|
293
|
-
],
|
|
294
|
-
"ghostwhite": [
|
|
295
|
-
248,
|
|
296
|
-
248,
|
|
297
|
-
255
|
|
298
|
-
],
|
|
299
|
-
"gold": [
|
|
300
|
-
255,
|
|
301
|
-
215,
|
|
302
|
-
0
|
|
303
|
-
],
|
|
304
|
-
"goldenrod": [
|
|
305
|
-
218,
|
|
306
|
-
165,
|
|
307
|
-
32
|
|
308
|
-
],
|
|
309
|
-
"gray": [
|
|
310
|
-
128,
|
|
311
|
-
128,
|
|
312
|
-
128
|
|
313
|
-
],
|
|
314
|
-
"green": [
|
|
315
|
-
0,
|
|
316
|
-
128,
|
|
317
|
-
0
|
|
318
|
-
],
|
|
319
|
-
"greenyellow": [
|
|
320
|
-
173,
|
|
321
|
-
255,
|
|
322
|
-
47
|
|
323
|
-
],
|
|
324
|
-
"grey": [
|
|
325
|
-
128,
|
|
326
|
-
128,
|
|
327
|
-
128
|
|
328
|
-
],
|
|
329
|
-
"honeydew": [
|
|
330
|
-
240,
|
|
331
|
-
255,
|
|
332
|
-
240
|
|
333
|
-
],
|
|
334
|
-
"hotpink": [
|
|
335
|
-
255,
|
|
336
|
-
105,
|
|
337
|
-
180
|
|
338
|
-
],
|
|
339
|
-
"indianred": [
|
|
340
|
-
205,
|
|
341
|
-
92,
|
|
342
|
-
92
|
|
343
|
-
],
|
|
344
|
-
"indigo": [
|
|
345
|
-
75,
|
|
346
|
-
0,
|
|
347
|
-
130
|
|
348
|
-
],
|
|
349
|
-
"ivory": [
|
|
350
|
-
255,
|
|
351
|
-
255,
|
|
352
|
-
240
|
|
353
|
-
],
|
|
354
|
-
"khaki": [
|
|
355
|
-
240,
|
|
356
|
-
230,
|
|
357
|
-
140
|
|
358
|
-
],
|
|
359
|
-
"lavender": [
|
|
360
|
-
230,
|
|
361
|
-
230,
|
|
362
|
-
250
|
|
363
|
-
],
|
|
364
|
-
"lavenderblush": [
|
|
365
|
-
255,
|
|
366
|
-
240,
|
|
367
|
-
245
|
|
368
|
-
],
|
|
369
|
-
"lawngreen": [
|
|
370
|
-
124,
|
|
371
|
-
252,
|
|
372
|
-
0
|
|
373
|
-
],
|
|
374
|
-
"lemonchiffon": [
|
|
375
|
-
255,
|
|
376
|
-
250,
|
|
377
|
-
205
|
|
378
|
-
],
|
|
379
|
-
"lightblue": [
|
|
380
|
-
173,
|
|
381
|
-
216,
|
|
382
|
-
230
|
|
383
|
-
],
|
|
384
|
-
"lightcoral": [
|
|
385
|
-
240,
|
|
386
|
-
128,
|
|
387
|
-
128
|
|
388
|
-
],
|
|
389
|
-
"lightcyan": [
|
|
390
|
-
224,
|
|
391
|
-
255,
|
|
392
|
-
255
|
|
393
|
-
],
|
|
394
|
-
"lightgoldenrodyellow": [
|
|
395
|
-
250,
|
|
396
|
-
250,
|
|
397
|
-
210
|
|
398
|
-
],
|
|
399
|
-
"lightgray": [
|
|
400
|
-
211,
|
|
401
|
-
211,
|
|
402
|
-
211
|
|
403
|
-
],
|
|
404
|
-
"lightgreen": [
|
|
405
|
-
144,
|
|
406
|
-
238,
|
|
407
|
-
144
|
|
408
|
-
],
|
|
409
|
-
"lightgrey": [
|
|
410
|
-
211,
|
|
411
|
-
211,
|
|
412
|
-
211
|
|
413
|
-
],
|
|
414
|
-
"lightpink": [
|
|
415
|
-
255,
|
|
416
|
-
182,
|
|
417
|
-
193
|
|
418
|
-
],
|
|
419
|
-
"lightsalmon": [
|
|
420
|
-
255,
|
|
421
|
-
160,
|
|
422
|
-
122
|
|
423
|
-
],
|
|
424
|
-
"lightseagreen": [
|
|
425
|
-
32,
|
|
426
|
-
178,
|
|
427
|
-
170
|
|
428
|
-
],
|
|
429
|
-
"lightskyblue": [
|
|
430
|
-
135,
|
|
431
|
-
206,
|
|
432
|
-
250
|
|
433
|
-
],
|
|
434
|
-
"lightslategray": [
|
|
435
|
-
119,
|
|
436
|
-
136,
|
|
437
|
-
153
|
|
438
|
-
],
|
|
439
|
-
"lightslategrey": [
|
|
440
|
-
119,
|
|
441
|
-
136,
|
|
442
|
-
153
|
|
443
|
-
],
|
|
444
|
-
"lightsteelblue": [
|
|
445
|
-
176,
|
|
446
|
-
196,
|
|
447
|
-
222
|
|
448
|
-
],
|
|
449
|
-
"lightyellow": [
|
|
450
|
-
255,
|
|
451
|
-
255,
|
|
452
|
-
224
|
|
453
|
-
],
|
|
454
|
-
"lime": [
|
|
455
|
-
0,
|
|
456
|
-
255,
|
|
457
|
-
0
|
|
458
|
-
],
|
|
459
|
-
"limegreen": [
|
|
460
|
-
50,
|
|
461
|
-
205,
|
|
462
|
-
50
|
|
463
|
-
],
|
|
464
|
-
"linen": [
|
|
465
|
-
250,
|
|
466
|
-
240,
|
|
467
|
-
230
|
|
468
|
-
],
|
|
469
|
-
"magenta": [
|
|
470
|
-
255,
|
|
471
|
-
0,
|
|
472
|
-
255
|
|
473
|
-
],
|
|
474
|
-
"maroon": [
|
|
475
|
-
128,
|
|
476
|
-
0,
|
|
477
|
-
0
|
|
478
|
-
],
|
|
479
|
-
"mediumaquamarine": [
|
|
480
|
-
102,
|
|
481
|
-
205,
|
|
482
|
-
170
|
|
483
|
-
],
|
|
484
|
-
"mediumblue": [
|
|
485
|
-
0,
|
|
486
|
-
0,
|
|
487
|
-
205
|
|
488
|
-
],
|
|
489
|
-
"mediumorchid": [
|
|
490
|
-
186,
|
|
491
|
-
85,
|
|
492
|
-
211
|
|
493
|
-
],
|
|
494
|
-
"mediumpurple": [
|
|
495
|
-
147,
|
|
496
|
-
112,
|
|
497
|
-
219
|
|
498
|
-
],
|
|
499
|
-
"mediumseagreen": [
|
|
500
|
-
60,
|
|
501
|
-
179,
|
|
502
|
-
113
|
|
503
|
-
],
|
|
504
|
-
"mediumslateblue": [
|
|
505
|
-
123,
|
|
506
|
-
104,
|
|
507
|
-
238
|
|
508
|
-
],
|
|
509
|
-
"mediumspringgreen": [
|
|
510
|
-
0,
|
|
511
|
-
250,
|
|
512
|
-
154
|
|
513
|
-
],
|
|
514
|
-
"mediumturquoise": [
|
|
515
|
-
72,
|
|
516
|
-
209,
|
|
517
|
-
204
|
|
518
|
-
],
|
|
519
|
-
"mediumvioletred": [
|
|
520
|
-
199,
|
|
521
|
-
21,
|
|
522
|
-
133
|
|
523
|
-
],
|
|
524
|
-
"midnightblue": [
|
|
525
|
-
25,
|
|
526
|
-
25,
|
|
527
|
-
112
|
|
528
|
-
],
|
|
529
|
-
"mintcream": [
|
|
530
|
-
245,
|
|
531
|
-
255,
|
|
532
|
-
250
|
|
533
|
-
],
|
|
534
|
-
"mistyrose": [
|
|
535
|
-
255,
|
|
536
|
-
228,
|
|
537
|
-
225
|
|
538
|
-
],
|
|
539
|
-
"moccasin": [
|
|
540
|
-
255,
|
|
541
|
-
228,
|
|
542
|
-
181
|
|
543
|
-
],
|
|
544
|
-
"navajowhite": [
|
|
545
|
-
255,
|
|
546
|
-
222,
|
|
547
|
-
173
|
|
548
|
-
],
|
|
549
|
-
"navy": [
|
|
550
|
-
0,
|
|
551
|
-
0,
|
|
552
|
-
128
|
|
553
|
-
],
|
|
554
|
-
"oldlace": [
|
|
555
|
-
253,
|
|
556
|
-
245,
|
|
557
|
-
230
|
|
558
|
-
],
|
|
559
|
-
"olive": [
|
|
560
|
-
128,
|
|
561
|
-
128,
|
|
562
|
-
0
|
|
563
|
-
],
|
|
564
|
-
"olivedrab": [
|
|
565
|
-
107,
|
|
566
|
-
142,
|
|
567
|
-
35
|
|
568
|
-
],
|
|
569
|
-
"orange": [
|
|
570
|
-
255,
|
|
571
|
-
165,
|
|
572
|
-
0
|
|
573
|
-
],
|
|
574
|
-
"orangered": [
|
|
575
|
-
255,
|
|
576
|
-
69,
|
|
577
|
-
0
|
|
578
|
-
],
|
|
579
|
-
"orchid": [
|
|
580
|
-
218,
|
|
581
|
-
112,
|
|
582
|
-
214
|
|
583
|
-
],
|
|
584
|
-
"palegoldenrod": [
|
|
585
|
-
238,
|
|
586
|
-
232,
|
|
587
|
-
170
|
|
588
|
-
],
|
|
589
|
-
"palegreen": [
|
|
590
|
-
152,
|
|
591
|
-
251,
|
|
592
|
-
152
|
|
593
|
-
],
|
|
594
|
-
"paleturquoise": [
|
|
595
|
-
175,
|
|
596
|
-
238,
|
|
597
|
-
238
|
|
598
|
-
],
|
|
599
|
-
"palevioletred": [
|
|
600
|
-
219,
|
|
601
|
-
112,
|
|
602
|
-
147
|
|
603
|
-
],
|
|
604
|
-
"papayawhip": [
|
|
605
|
-
255,
|
|
606
|
-
239,
|
|
607
|
-
213
|
|
608
|
-
],
|
|
609
|
-
"peachpuff": [
|
|
610
|
-
255,
|
|
611
|
-
218,
|
|
612
|
-
185
|
|
613
|
-
],
|
|
614
|
-
"peru": [
|
|
615
|
-
205,
|
|
616
|
-
133,
|
|
617
|
-
63
|
|
618
|
-
],
|
|
619
|
-
"pink": [
|
|
620
|
-
255,
|
|
621
|
-
192,
|
|
622
|
-
203
|
|
623
|
-
],
|
|
624
|
-
"plum": [
|
|
625
|
-
221,
|
|
626
|
-
160,
|
|
627
|
-
221
|
|
628
|
-
],
|
|
629
|
-
"powderblue": [
|
|
630
|
-
176,
|
|
631
|
-
224,
|
|
632
|
-
230
|
|
633
|
-
],
|
|
634
|
-
"purple": [
|
|
635
|
-
128,
|
|
636
|
-
0,
|
|
637
|
-
128
|
|
638
|
-
],
|
|
639
|
-
"rebeccapurple": [
|
|
640
|
-
102,
|
|
641
|
-
51,
|
|
642
|
-
153
|
|
643
|
-
],
|
|
644
|
-
"red": [
|
|
645
|
-
255,
|
|
646
|
-
0,
|
|
647
|
-
0
|
|
648
|
-
],
|
|
649
|
-
"rosybrown": [
|
|
650
|
-
188,
|
|
651
|
-
143,
|
|
652
|
-
143
|
|
653
|
-
],
|
|
654
|
-
"royalblue": [
|
|
655
|
-
65,
|
|
656
|
-
105,
|
|
657
|
-
225
|
|
658
|
-
],
|
|
659
|
-
"saddlebrown": [
|
|
660
|
-
139,
|
|
661
|
-
69,
|
|
662
|
-
19
|
|
663
|
-
],
|
|
664
|
-
"salmon": [
|
|
665
|
-
250,
|
|
666
|
-
128,
|
|
667
|
-
114
|
|
668
|
-
],
|
|
669
|
-
"sandybrown": [
|
|
670
|
-
244,
|
|
671
|
-
164,
|
|
672
|
-
96
|
|
673
|
-
],
|
|
674
|
-
"seagreen": [
|
|
675
|
-
46,
|
|
676
|
-
139,
|
|
677
|
-
87
|
|
678
|
-
],
|
|
679
|
-
"seashell": [
|
|
680
|
-
255,
|
|
681
|
-
245,
|
|
682
|
-
238
|
|
683
|
-
],
|
|
684
|
-
"sienna": [
|
|
685
|
-
160,
|
|
686
|
-
82,
|
|
687
|
-
45
|
|
688
|
-
],
|
|
689
|
-
"silver": [
|
|
690
|
-
192,
|
|
691
|
-
192,
|
|
692
|
-
192
|
|
693
|
-
],
|
|
694
|
-
"skyblue": [
|
|
695
|
-
135,
|
|
696
|
-
206,
|
|
697
|
-
235
|
|
698
|
-
],
|
|
699
|
-
"slateblue": [
|
|
700
|
-
106,
|
|
701
|
-
90,
|
|
702
|
-
205
|
|
703
|
-
],
|
|
704
|
-
"slategray": [
|
|
705
|
-
112,
|
|
706
|
-
128,
|
|
707
|
-
144
|
|
708
|
-
],
|
|
709
|
-
"slategrey": [
|
|
710
|
-
112,
|
|
711
|
-
128,
|
|
712
|
-
144
|
|
713
|
-
],
|
|
714
|
-
"snow": [
|
|
715
|
-
255,
|
|
716
|
-
250,
|
|
717
|
-
250
|
|
718
|
-
],
|
|
719
|
-
"springgreen": [
|
|
720
|
-
0,
|
|
721
|
-
255,
|
|
722
|
-
127
|
|
723
|
-
],
|
|
724
|
-
"steelblue": [
|
|
725
|
-
70,
|
|
726
|
-
130,
|
|
727
|
-
180
|
|
728
|
-
],
|
|
729
|
-
"tan": [
|
|
730
|
-
210,
|
|
731
|
-
180,
|
|
732
|
-
140
|
|
733
|
-
],
|
|
734
|
-
"teal": [
|
|
735
|
-
0,
|
|
736
|
-
128,
|
|
737
|
-
128
|
|
738
|
-
],
|
|
739
|
-
"thistle": [
|
|
740
|
-
216,
|
|
741
|
-
191,
|
|
742
|
-
216
|
|
743
|
-
],
|
|
744
|
-
"tomato": [
|
|
745
|
-
255,
|
|
746
|
-
99,
|
|
747
|
-
71
|
|
748
|
-
],
|
|
749
|
-
"turquoise": [
|
|
750
|
-
64,
|
|
751
|
-
224,
|
|
752
|
-
208
|
|
753
|
-
],
|
|
754
|
-
"violet": [
|
|
755
|
-
238,
|
|
756
|
-
130,
|
|
757
|
-
238
|
|
758
|
-
],
|
|
759
|
-
"wheat": [
|
|
760
|
-
245,
|
|
761
|
-
222,
|
|
762
|
-
179
|
|
763
|
-
],
|
|
764
|
-
"white": [
|
|
765
|
-
255,
|
|
766
|
-
255,
|
|
767
|
-
255
|
|
768
|
-
],
|
|
769
|
-
"whitesmoke": [
|
|
770
|
-
245,
|
|
771
|
-
245,
|
|
772
|
-
245
|
|
773
|
-
],
|
|
774
|
-
"yellow": [
|
|
775
|
-
255,
|
|
776
|
-
255,
|
|
777
|
-
0
|
|
778
|
-
],
|
|
779
|
-
"yellowgreen": [
|
|
780
|
-
154,
|
|
781
|
-
205,
|
|
782
|
-
50
|
|
783
|
-
]
|
|
784
|
-
};
|
|
785
|
-
}));
|
|
786
|
-
//#endregion
|
|
787
|
-
//#region node_modules/color-convert/conversions.js
|
|
788
|
-
var require_conversions$1 = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
|
|
789
|
-
var cssKeywords = require_color_name$1();
|
|
790
|
-
var reverseKeywords = {};
|
|
791
|
-
for (const key of Object.keys(cssKeywords)) reverseKeywords[cssKeywords[key]] = key;
|
|
792
|
-
var convert = {
|
|
793
|
-
rgb: {
|
|
794
|
-
channels: 3,
|
|
795
|
-
labels: "rgb"
|
|
796
|
-
},
|
|
797
|
-
hsl: {
|
|
798
|
-
channels: 3,
|
|
799
|
-
labels: "hsl"
|
|
800
|
-
},
|
|
801
|
-
hsv: {
|
|
802
|
-
channels: 3,
|
|
803
|
-
labels: "hsv"
|
|
804
|
-
},
|
|
805
|
-
hwb: {
|
|
806
|
-
channels: 3,
|
|
807
|
-
labels: "hwb"
|
|
808
|
-
},
|
|
809
|
-
cmyk: {
|
|
810
|
-
channels: 4,
|
|
811
|
-
labels: "cmyk"
|
|
812
|
-
},
|
|
813
|
-
xyz: {
|
|
814
|
-
channels: 3,
|
|
815
|
-
labels: "xyz"
|
|
816
|
-
},
|
|
817
|
-
lab: {
|
|
818
|
-
channels: 3,
|
|
819
|
-
labels: "lab"
|
|
820
|
-
},
|
|
821
|
-
lch: {
|
|
822
|
-
channels: 3,
|
|
823
|
-
labels: "lch"
|
|
824
|
-
},
|
|
825
|
-
hex: {
|
|
826
|
-
channels: 1,
|
|
827
|
-
labels: ["hex"]
|
|
828
|
-
},
|
|
829
|
-
keyword: {
|
|
830
|
-
channels: 1,
|
|
831
|
-
labels: ["keyword"]
|
|
832
|
-
},
|
|
833
|
-
ansi16: {
|
|
834
|
-
channels: 1,
|
|
835
|
-
labels: ["ansi16"]
|
|
836
|
-
},
|
|
837
|
-
ansi256: {
|
|
838
|
-
channels: 1,
|
|
839
|
-
labels: ["ansi256"]
|
|
840
|
-
},
|
|
841
|
-
hcg: {
|
|
842
|
-
channels: 3,
|
|
843
|
-
labels: [
|
|
844
|
-
"h",
|
|
845
|
-
"c",
|
|
846
|
-
"g"
|
|
847
|
-
]
|
|
848
|
-
},
|
|
849
|
-
apple: {
|
|
850
|
-
channels: 3,
|
|
851
|
-
labels: [
|
|
852
|
-
"r16",
|
|
853
|
-
"g16",
|
|
854
|
-
"b16"
|
|
855
|
-
]
|
|
856
|
-
},
|
|
857
|
-
gray: {
|
|
858
|
-
channels: 1,
|
|
859
|
-
labels: ["gray"]
|
|
860
|
-
}
|
|
861
|
-
};
|
|
862
|
-
module.exports = convert;
|
|
863
|
-
for (const model of Object.keys(convert)) {
|
|
864
|
-
if (!("channels" in convert[model])) throw new Error("missing channels property: " + model);
|
|
865
|
-
if (!("labels" in convert[model])) throw new Error("missing channel labels property: " + model);
|
|
866
|
-
if (convert[model].labels.length !== convert[model].channels) throw new Error("channel and label counts mismatch: " + model);
|
|
867
|
-
const { channels, labels } = convert[model];
|
|
868
|
-
delete convert[model].channels;
|
|
869
|
-
delete convert[model].labels;
|
|
870
|
-
Object.defineProperty(convert[model], "channels", { value: channels });
|
|
871
|
-
Object.defineProperty(convert[model], "labels", { value: labels });
|
|
872
|
-
}
|
|
873
|
-
convert.rgb.hsl = function(rgb) {
|
|
874
|
-
const r = rgb[0] / 255;
|
|
875
|
-
const g = rgb[1] / 255;
|
|
876
|
-
const b = rgb[2] / 255;
|
|
877
|
-
const min = Math.min(r, g, b);
|
|
878
|
-
const max = Math.max(r, g, b);
|
|
879
|
-
const delta = max - min;
|
|
880
|
-
let h;
|
|
881
|
-
let s;
|
|
882
|
-
if (max === min) h = 0;
|
|
883
|
-
else if (r === max) h = (g - b) / delta;
|
|
884
|
-
else if (g === max) h = 2 + (b - r) / delta;
|
|
885
|
-
else if (b === max) h = 4 + (r - g) / delta;
|
|
886
|
-
h = Math.min(h * 60, 360);
|
|
887
|
-
if (h < 0) h += 360;
|
|
888
|
-
const l = (min + max) / 2;
|
|
889
|
-
if (max === min) s = 0;
|
|
890
|
-
else if (l <= .5) s = delta / (max + min);
|
|
891
|
-
else s = delta / (2 - max - min);
|
|
892
|
-
return [
|
|
893
|
-
h,
|
|
894
|
-
s * 100,
|
|
895
|
-
l * 100
|
|
896
|
-
];
|
|
897
|
-
};
|
|
898
|
-
convert.rgb.hsv = function(rgb) {
|
|
899
|
-
let rdif;
|
|
900
|
-
let gdif;
|
|
901
|
-
let bdif;
|
|
902
|
-
let h;
|
|
903
|
-
let s;
|
|
904
|
-
const r = rgb[0] / 255;
|
|
905
|
-
const g = rgb[1] / 255;
|
|
906
|
-
const b = rgb[2] / 255;
|
|
907
|
-
const v = Math.max(r, g, b);
|
|
908
|
-
const diff = v - Math.min(r, g, b);
|
|
909
|
-
const diffc = function(c) {
|
|
910
|
-
return (v - c) / 6 / diff + 1 / 2;
|
|
911
|
-
};
|
|
912
|
-
if (diff === 0) {
|
|
913
|
-
h = 0;
|
|
914
|
-
s = 0;
|
|
915
|
-
} else {
|
|
916
|
-
s = diff / v;
|
|
917
|
-
rdif = diffc(r);
|
|
918
|
-
gdif = diffc(g);
|
|
919
|
-
bdif = diffc(b);
|
|
920
|
-
if (r === v) h = bdif - gdif;
|
|
921
|
-
else if (g === v) h = 1 / 3 + rdif - bdif;
|
|
922
|
-
else if (b === v) h = 2 / 3 + gdif - rdif;
|
|
923
|
-
if (h < 0) h += 1;
|
|
924
|
-
else if (h > 1) h -= 1;
|
|
925
|
-
}
|
|
926
|
-
return [
|
|
927
|
-
h * 360,
|
|
928
|
-
s * 100,
|
|
929
|
-
v * 100
|
|
930
|
-
];
|
|
931
|
-
};
|
|
932
|
-
convert.rgb.hwb = function(rgb) {
|
|
933
|
-
const r = rgb[0];
|
|
934
|
-
const g = rgb[1];
|
|
935
|
-
let b = rgb[2];
|
|
936
|
-
const h = convert.rgb.hsl(rgb)[0];
|
|
937
|
-
const w = 1 / 255 * Math.min(r, Math.min(g, b));
|
|
938
|
-
b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
|
|
939
|
-
return [
|
|
940
|
-
h,
|
|
941
|
-
w * 100,
|
|
942
|
-
b * 100
|
|
943
|
-
];
|
|
944
|
-
};
|
|
945
|
-
convert.rgb.cmyk = function(rgb) {
|
|
946
|
-
const r = rgb[0] / 255;
|
|
947
|
-
const g = rgb[1] / 255;
|
|
948
|
-
const b = rgb[2] / 255;
|
|
949
|
-
const k = Math.min(1 - r, 1 - g, 1 - b);
|
|
950
|
-
const c = (1 - r - k) / (1 - k) || 0;
|
|
951
|
-
const m = (1 - g - k) / (1 - k) || 0;
|
|
952
|
-
const y = (1 - b - k) / (1 - k) || 0;
|
|
953
|
-
return [
|
|
954
|
-
c * 100,
|
|
955
|
-
m * 100,
|
|
956
|
-
y * 100,
|
|
957
|
-
k * 100
|
|
958
|
-
];
|
|
959
|
-
};
|
|
960
|
-
function comparativeDistance(x, y) {
|
|
961
|
-
return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
|
|
962
|
-
}
|
|
963
|
-
convert.rgb.keyword = function(rgb) {
|
|
964
|
-
const reversed = reverseKeywords[rgb];
|
|
965
|
-
if (reversed) return reversed;
|
|
966
|
-
let currentClosestDistance = Infinity;
|
|
967
|
-
let currentClosestKeyword;
|
|
968
|
-
for (const keyword of Object.keys(cssKeywords)) {
|
|
969
|
-
const value = cssKeywords[keyword];
|
|
970
|
-
const distance = comparativeDistance(rgb, value);
|
|
971
|
-
if (distance < currentClosestDistance) {
|
|
972
|
-
currentClosestDistance = distance;
|
|
973
|
-
currentClosestKeyword = keyword;
|
|
974
|
-
}
|
|
975
|
-
}
|
|
976
|
-
return currentClosestKeyword;
|
|
977
|
-
};
|
|
978
|
-
convert.keyword.rgb = function(keyword) {
|
|
979
|
-
return cssKeywords[keyword];
|
|
980
|
-
};
|
|
981
|
-
convert.rgb.xyz = function(rgb) {
|
|
982
|
-
let r = rgb[0] / 255;
|
|
983
|
-
let g = rgb[1] / 255;
|
|
984
|
-
let b = rgb[2] / 255;
|
|
985
|
-
r = r > .04045 ? ((r + .055) / 1.055) ** 2.4 : r / 12.92;
|
|
986
|
-
g = g > .04045 ? ((g + .055) / 1.055) ** 2.4 : g / 12.92;
|
|
987
|
-
b = b > .04045 ? ((b + .055) / 1.055) ** 2.4 : b / 12.92;
|
|
988
|
-
const x = r * .4124 + g * .3576 + b * .1805;
|
|
989
|
-
const y = r * .2126 + g * .7152 + b * .0722;
|
|
990
|
-
const z = r * .0193 + g * .1192 + b * .9505;
|
|
991
|
-
return [
|
|
992
|
-
x * 100,
|
|
993
|
-
y * 100,
|
|
994
|
-
z * 100
|
|
995
|
-
];
|
|
996
|
-
};
|
|
997
|
-
convert.rgb.lab = function(rgb) {
|
|
998
|
-
const xyz = convert.rgb.xyz(rgb);
|
|
999
|
-
let x = xyz[0];
|
|
1000
|
-
let y = xyz[1];
|
|
1001
|
-
let z = xyz[2];
|
|
1002
|
-
x /= 95.047;
|
|
1003
|
-
y /= 100;
|
|
1004
|
-
z /= 108.883;
|
|
1005
|
-
x = x > .008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
1006
|
-
y = y > .008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
1007
|
-
z = z > .008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
1008
|
-
return [
|
|
1009
|
-
116 * y - 16,
|
|
1010
|
-
500 * (x - y),
|
|
1011
|
-
200 * (y - z)
|
|
1012
|
-
];
|
|
1013
|
-
};
|
|
1014
|
-
convert.hsl.rgb = function(hsl) {
|
|
1015
|
-
const h = hsl[0] / 360;
|
|
1016
|
-
const s = hsl[1] / 100;
|
|
1017
|
-
const l = hsl[2] / 100;
|
|
1018
|
-
let t2;
|
|
1019
|
-
let t3;
|
|
1020
|
-
let val;
|
|
1021
|
-
if (s === 0) {
|
|
1022
|
-
val = l * 255;
|
|
1023
|
-
return [
|
|
1024
|
-
val,
|
|
1025
|
-
val,
|
|
1026
|
-
val
|
|
1027
|
-
];
|
|
1028
|
-
}
|
|
1029
|
-
if (l < .5) t2 = l * (1 + s);
|
|
1030
|
-
else t2 = l + s - l * s;
|
|
1031
|
-
const t1 = 2 * l - t2;
|
|
1032
|
-
const rgb = [
|
|
1033
|
-
0,
|
|
1034
|
-
0,
|
|
1035
|
-
0
|
|
1036
|
-
];
|
|
1037
|
-
for (let i = 0; i < 3; i++) {
|
|
1038
|
-
t3 = h + 1 / 3 * -(i - 1);
|
|
1039
|
-
if (t3 < 0) t3++;
|
|
1040
|
-
if (t3 > 1) t3--;
|
|
1041
|
-
if (6 * t3 < 1) val = t1 + (t2 - t1) * 6 * t3;
|
|
1042
|
-
else if (2 * t3 < 1) val = t2;
|
|
1043
|
-
else if (3 * t3 < 2) val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
|
1044
|
-
else val = t1;
|
|
1045
|
-
rgb[i] = val * 255;
|
|
1046
|
-
}
|
|
1047
|
-
return rgb;
|
|
1048
|
-
};
|
|
1049
|
-
convert.hsl.hsv = function(hsl) {
|
|
1050
|
-
const h = hsl[0];
|
|
1051
|
-
let s = hsl[1] / 100;
|
|
1052
|
-
let l = hsl[2] / 100;
|
|
1053
|
-
let smin = s;
|
|
1054
|
-
const lmin = Math.max(l, .01);
|
|
1055
|
-
l *= 2;
|
|
1056
|
-
s *= l <= 1 ? l : 2 - l;
|
|
1057
|
-
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
1058
|
-
const v = (l + s) / 2;
|
|
1059
|
-
return [
|
|
1060
|
-
h,
|
|
1061
|
-
(l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s)) * 100,
|
|
1062
|
-
v * 100
|
|
1063
|
-
];
|
|
1064
|
-
};
|
|
1065
|
-
convert.hsv.rgb = function(hsv) {
|
|
1066
|
-
const h = hsv[0] / 60;
|
|
1067
|
-
const s = hsv[1] / 100;
|
|
1068
|
-
let v = hsv[2] / 100;
|
|
1069
|
-
const hi = Math.floor(h) % 6;
|
|
1070
|
-
const f = h - Math.floor(h);
|
|
1071
|
-
const p = 255 * v * (1 - s);
|
|
1072
|
-
const q = 255 * v * (1 - s * f);
|
|
1073
|
-
const t = 255 * v * (1 - s * (1 - f));
|
|
1074
|
-
v *= 255;
|
|
1075
|
-
switch (hi) {
|
|
1076
|
-
case 0: return [
|
|
1077
|
-
v,
|
|
1078
|
-
t,
|
|
1079
|
-
p
|
|
1080
|
-
];
|
|
1081
|
-
case 1: return [
|
|
1082
|
-
q,
|
|
1083
|
-
v,
|
|
1084
|
-
p
|
|
1085
|
-
];
|
|
1086
|
-
case 2: return [
|
|
1087
|
-
p,
|
|
1088
|
-
v,
|
|
1089
|
-
t
|
|
1090
|
-
];
|
|
1091
|
-
case 3: return [
|
|
1092
|
-
p,
|
|
1093
|
-
q,
|
|
1094
|
-
v
|
|
1095
|
-
];
|
|
1096
|
-
case 4: return [
|
|
1097
|
-
t,
|
|
1098
|
-
p,
|
|
1099
|
-
v
|
|
1100
|
-
];
|
|
1101
|
-
case 5: return [
|
|
1102
|
-
v,
|
|
1103
|
-
p,
|
|
1104
|
-
q
|
|
1105
|
-
];
|
|
1106
|
-
}
|
|
1107
|
-
};
|
|
1108
|
-
convert.hsv.hsl = function(hsv) {
|
|
1109
|
-
const h = hsv[0];
|
|
1110
|
-
const s = hsv[1] / 100;
|
|
1111
|
-
const v = hsv[2] / 100;
|
|
1112
|
-
const vmin = Math.max(v, .01);
|
|
1113
|
-
let sl;
|
|
1114
|
-
let l;
|
|
1115
|
-
l = (2 - s) * v;
|
|
1116
|
-
const lmin = (2 - s) * vmin;
|
|
1117
|
-
sl = s * vmin;
|
|
1118
|
-
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
1119
|
-
sl = sl || 0;
|
|
1120
|
-
l /= 2;
|
|
1121
|
-
return [
|
|
1122
|
-
h,
|
|
1123
|
-
sl * 100,
|
|
1124
|
-
l * 100
|
|
1125
|
-
];
|
|
1126
|
-
};
|
|
1127
|
-
convert.hwb.rgb = function(hwb) {
|
|
1128
|
-
const h = hwb[0] / 360;
|
|
1129
|
-
let wh = hwb[1] / 100;
|
|
1130
|
-
let bl = hwb[2] / 100;
|
|
1131
|
-
const ratio = wh + bl;
|
|
1132
|
-
let f;
|
|
1133
|
-
if (ratio > 1) {
|
|
1134
|
-
wh /= ratio;
|
|
1135
|
-
bl /= ratio;
|
|
1136
|
-
}
|
|
1137
|
-
const i = Math.floor(6 * h);
|
|
1138
|
-
const v = 1 - bl;
|
|
1139
|
-
f = 6 * h - i;
|
|
1140
|
-
if ((i & 1) !== 0) f = 1 - f;
|
|
1141
|
-
const n = wh + f * (v - wh);
|
|
1142
|
-
let r;
|
|
1143
|
-
let g;
|
|
1144
|
-
let b;
|
|
1145
|
-
switch (i) {
|
|
1146
|
-
default:
|
|
1147
|
-
case 6:
|
|
1148
|
-
case 0:
|
|
1149
|
-
r = v;
|
|
1150
|
-
g = n;
|
|
1151
|
-
b = wh;
|
|
1152
|
-
break;
|
|
1153
|
-
case 1:
|
|
1154
|
-
r = n;
|
|
1155
|
-
g = v;
|
|
1156
|
-
b = wh;
|
|
1157
|
-
break;
|
|
1158
|
-
case 2:
|
|
1159
|
-
r = wh;
|
|
1160
|
-
g = v;
|
|
1161
|
-
b = n;
|
|
1162
|
-
break;
|
|
1163
|
-
case 3:
|
|
1164
|
-
r = wh;
|
|
1165
|
-
g = n;
|
|
1166
|
-
b = v;
|
|
1167
|
-
break;
|
|
1168
|
-
case 4:
|
|
1169
|
-
r = n;
|
|
1170
|
-
g = wh;
|
|
1171
|
-
b = v;
|
|
1172
|
-
break;
|
|
1173
|
-
case 5:
|
|
1174
|
-
r = v;
|
|
1175
|
-
g = wh;
|
|
1176
|
-
b = n;
|
|
1177
|
-
break;
|
|
1178
|
-
}
|
|
1179
|
-
return [
|
|
1180
|
-
r * 255,
|
|
1181
|
-
g * 255,
|
|
1182
|
-
b * 255
|
|
1183
|
-
];
|
|
1184
|
-
};
|
|
1185
|
-
convert.cmyk.rgb = function(cmyk) {
|
|
1186
|
-
const c = cmyk[0] / 100;
|
|
1187
|
-
const m = cmyk[1] / 100;
|
|
1188
|
-
const y = cmyk[2] / 100;
|
|
1189
|
-
const k = cmyk[3] / 100;
|
|
1190
|
-
const r = 1 - Math.min(1, c * (1 - k) + k);
|
|
1191
|
-
const g = 1 - Math.min(1, m * (1 - k) + k);
|
|
1192
|
-
const b = 1 - Math.min(1, y * (1 - k) + k);
|
|
1193
|
-
return [
|
|
1194
|
-
r * 255,
|
|
1195
|
-
g * 255,
|
|
1196
|
-
b * 255
|
|
1197
|
-
];
|
|
1198
|
-
};
|
|
1199
|
-
convert.xyz.rgb = function(xyz) {
|
|
1200
|
-
const x = xyz[0] / 100;
|
|
1201
|
-
const y = xyz[1] / 100;
|
|
1202
|
-
const z = xyz[2] / 100;
|
|
1203
|
-
let r;
|
|
1204
|
-
let g;
|
|
1205
|
-
let b;
|
|
1206
|
-
r = x * 3.2406 + y * -1.5372 + z * -.4986;
|
|
1207
|
-
g = x * -.9689 + y * 1.8758 + z * .0415;
|
|
1208
|
-
b = x * .0557 + y * -.204 + z * 1.057;
|
|
1209
|
-
r = r > .0031308 ? 1.055 * r ** (1 / 2.4) - .055 : r * 12.92;
|
|
1210
|
-
g = g > .0031308 ? 1.055 * g ** (1 / 2.4) - .055 : g * 12.92;
|
|
1211
|
-
b = b > .0031308 ? 1.055 * b ** (1 / 2.4) - .055 : b * 12.92;
|
|
1212
|
-
r = Math.min(Math.max(0, r), 1);
|
|
1213
|
-
g = Math.min(Math.max(0, g), 1);
|
|
1214
|
-
b = Math.min(Math.max(0, b), 1);
|
|
1215
|
-
return [
|
|
1216
|
-
r * 255,
|
|
1217
|
-
g * 255,
|
|
1218
|
-
b * 255
|
|
1219
|
-
];
|
|
1220
|
-
};
|
|
1221
|
-
convert.xyz.lab = function(xyz) {
|
|
1222
|
-
let x = xyz[0];
|
|
1223
|
-
let y = xyz[1];
|
|
1224
|
-
let z = xyz[2];
|
|
1225
|
-
x /= 95.047;
|
|
1226
|
-
y /= 100;
|
|
1227
|
-
z /= 108.883;
|
|
1228
|
-
x = x > .008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
1229
|
-
y = y > .008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
1230
|
-
z = z > .008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
1231
|
-
return [
|
|
1232
|
-
116 * y - 16,
|
|
1233
|
-
500 * (x - y),
|
|
1234
|
-
200 * (y - z)
|
|
1235
|
-
];
|
|
1236
|
-
};
|
|
1237
|
-
convert.lab.xyz = function(lab) {
|
|
1238
|
-
const l = lab[0];
|
|
1239
|
-
const a = lab[1];
|
|
1240
|
-
const b = lab[2];
|
|
1241
|
-
let x;
|
|
1242
|
-
let y;
|
|
1243
|
-
let z;
|
|
1244
|
-
y = (l + 16) / 116;
|
|
1245
|
-
x = a / 500 + y;
|
|
1246
|
-
z = y - b / 200;
|
|
1247
|
-
const y2 = y ** 3;
|
|
1248
|
-
const x2 = x ** 3;
|
|
1249
|
-
const z2 = z ** 3;
|
|
1250
|
-
y = y2 > .008856 ? y2 : (y - 16 / 116) / 7.787;
|
|
1251
|
-
x = x2 > .008856 ? x2 : (x - 16 / 116) / 7.787;
|
|
1252
|
-
z = z2 > .008856 ? z2 : (z - 16 / 116) / 7.787;
|
|
1253
|
-
x *= 95.047;
|
|
1254
|
-
y *= 100;
|
|
1255
|
-
z *= 108.883;
|
|
1256
|
-
return [
|
|
1257
|
-
x,
|
|
1258
|
-
y,
|
|
1259
|
-
z
|
|
1260
|
-
];
|
|
1261
|
-
};
|
|
1262
|
-
convert.lab.lch = function(lab) {
|
|
1263
|
-
const l = lab[0];
|
|
1264
|
-
const a = lab[1];
|
|
1265
|
-
const b = lab[2];
|
|
1266
|
-
let h;
|
|
1267
|
-
h = Math.atan2(b, a) * 360 / 2 / Math.PI;
|
|
1268
|
-
if (h < 0) h += 360;
|
|
1269
|
-
return [
|
|
1270
|
-
l,
|
|
1271
|
-
Math.sqrt(a * a + b * b),
|
|
1272
|
-
h
|
|
1273
|
-
];
|
|
1274
|
-
};
|
|
1275
|
-
convert.lch.lab = function(lch) {
|
|
1276
|
-
const l = lch[0];
|
|
1277
|
-
const c = lch[1];
|
|
1278
|
-
const hr = lch[2] / 360 * 2 * Math.PI;
|
|
1279
|
-
return [
|
|
1280
|
-
l,
|
|
1281
|
-
c * Math.cos(hr),
|
|
1282
|
-
c * Math.sin(hr)
|
|
1283
|
-
];
|
|
1284
|
-
};
|
|
1285
|
-
convert.rgb.ansi16 = function(args, saturation = null) {
|
|
1286
|
-
const [r, g, b] = args;
|
|
1287
|
-
let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
|
|
1288
|
-
value = Math.round(value / 50);
|
|
1289
|
-
if (value === 0) return 30;
|
|
1290
|
-
let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
|
|
1291
|
-
if (value === 2) ansi += 60;
|
|
1292
|
-
return ansi;
|
|
1293
|
-
};
|
|
1294
|
-
convert.hsv.ansi16 = function(args) {
|
|
1295
|
-
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
|
1296
|
-
};
|
|
1297
|
-
convert.rgb.ansi256 = function(args) {
|
|
1298
|
-
const r = args[0];
|
|
1299
|
-
const g = args[1];
|
|
1300
|
-
const b = args[2];
|
|
1301
|
-
if (r === g && g === b) {
|
|
1302
|
-
if (r < 8) return 16;
|
|
1303
|
-
if (r > 248) return 231;
|
|
1304
|
-
return Math.round((r - 8) / 247 * 24) + 232;
|
|
1305
|
-
}
|
|
1306
|
-
return 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
|
|
1307
|
-
};
|
|
1308
|
-
convert.ansi16.rgb = function(args) {
|
|
1309
|
-
let color = args % 10;
|
|
1310
|
-
if (color === 0 || color === 7) {
|
|
1311
|
-
if (args > 50) color += 3.5;
|
|
1312
|
-
color = color / 10.5 * 255;
|
|
1313
|
-
return [
|
|
1314
|
-
color,
|
|
1315
|
-
color,
|
|
1316
|
-
color
|
|
1317
|
-
];
|
|
1318
|
-
}
|
|
1319
|
-
const mult = (~~(args > 50) + 1) * .5;
|
|
1320
|
-
return [
|
|
1321
|
-
(color & 1) * mult * 255,
|
|
1322
|
-
(color >> 1 & 1) * mult * 255,
|
|
1323
|
-
(color >> 2 & 1) * mult * 255
|
|
1324
|
-
];
|
|
1325
|
-
};
|
|
1326
|
-
convert.ansi256.rgb = function(args) {
|
|
1327
|
-
if (args >= 232) {
|
|
1328
|
-
const c = (args - 232) * 10 + 8;
|
|
1329
|
-
return [
|
|
1330
|
-
c,
|
|
1331
|
-
c,
|
|
1332
|
-
c
|
|
1333
|
-
];
|
|
1334
|
-
}
|
|
1335
|
-
args -= 16;
|
|
1336
|
-
let rem;
|
|
1337
|
-
return [
|
|
1338
|
-
Math.floor(args / 36) / 5 * 255,
|
|
1339
|
-
Math.floor((rem = args % 36) / 6) / 5 * 255,
|
|
1340
|
-
rem % 6 / 5 * 255
|
|
1341
|
-
];
|
|
1342
|
-
};
|
|
1343
|
-
convert.rgb.hex = function(args) {
|
|
1344
|
-
const string = (((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255)).toString(16).toUpperCase();
|
|
1345
|
-
return "000000".substring(string.length) + string;
|
|
1346
|
-
};
|
|
1347
|
-
convert.hex.rgb = function(args) {
|
|
1348
|
-
const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
1349
|
-
if (!match) return [
|
|
1350
|
-
0,
|
|
1351
|
-
0,
|
|
1352
|
-
0
|
|
1353
|
-
];
|
|
1354
|
-
let colorString = match[0];
|
|
1355
|
-
if (match[0].length === 3) colorString = colorString.split("").map((char) => {
|
|
1356
|
-
return char + char;
|
|
1357
|
-
}).join("");
|
|
1358
|
-
const integer = parseInt(colorString, 16);
|
|
1359
|
-
return [
|
|
1360
|
-
integer >> 16 & 255,
|
|
1361
|
-
integer >> 8 & 255,
|
|
1362
|
-
integer & 255
|
|
1363
|
-
];
|
|
1364
|
-
};
|
|
1365
|
-
convert.rgb.hcg = function(rgb) {
|
|
1366
|
-
const r = rgb[0] / 255;
|
|
1367
|
-
const g = rgb[1] / 255;
|
|
1368
|
-
const b = rgb[2] / 255;
|
|
1369
|
-
const max = Math.max(Math.max(r, g), b);
|
|
1370
|
-
const min = Math.min(Math.min(r, g), b);
|
|
1371
|
-
const chroma = max - min;
|
|
1372
|
-
let grayscale;
|
|
1373
|
-
let hue;
|
|
1374
|
-
if (chroma < 1) grayscale = min / (1 - chroma);
|
|
1375
|
-
else grayscale = 0;
|
|
1376
|
-
if (chroma <= 0) hue = 0;
|
|
1377
|
-
else if (max === r) hue = (g - b) / chroma % 6;
|
|
1378
|
-
else if (max === g) hue = 2 + (b - r) / chroma;
|
|
1379
|
-
else hue = 4 + (r - g) / chroma;
|
|
1380
|
-
hue /= 6;
|
|
1381
|
-
hue %= 1;
|
|
1382
|
-
return [
|
|
1383
|
-
hue * 360,
|
|
1384
|
-
chroma * 100,
|
|
1385
|
-
grayscale * 100
|
|
1386
|
-
];
|
|
1387
|
-
};
|
|
1388
|
-
convert.hsl.hcg = function(hsl) {
|
|
1389
|
-
const s = hsl[1] / 100;
|
|
1390
|
-
const l = hsl[2] / 100;
|
|
1391
|
-
const c = l < .5 ? 2 * s * l : 2 * s * (1 - l);
|
|
1392
|
-
let f = 0;
|
|
1393
|
-
if (c < 1) f = (l - .5 * c) / (1 - c);
|
|
1394
|
-
return [
|
|
1395
|
-
hsl[0],
|
|
1396
|
-
c * 100,
|
|
1397
|
-
f * 100
|
|
1398
|
-
];
|
|
1399
|
-
};
|
|
1400
|
-
convert.hsv.hcg = function(hsv) {
|
|
1401
|
-
const s = hsv[1] / 100;
|
|
1402
|
-
const v = hsv[2] / 100;
|
|
1403
|
-
const c = s * v;
|
|
1404
|
-
let f = 0;
|
|
1405
|
-
if (c < 1) f = (v - c) / (1 - c);
|
|
1406
|
-
return [
|
|
1407
|
-
hsv[0],
|
|
1408
|
-
c * 100,
|
|
1409
|
-
f * 100
|
|
1410
|
-
];
|
|
1411
|
-
};
|
|
1412
|
-
convert.hcg.rgb = function(hcg) {
|
|
1413
|
-
const h = hcg[0] / 360;
|
|
1414
|
-
const c = hcg[1] / 100;
|
|
1415
|
-
const g = hcg[2] / 100;
|
|
1416
|
-
if (c === 0) return [
|
|
1417
|
-
g * 255,
|
|
1418
|
-
g * 255,
|
|
1419
|
-
g * 255
|
|
1420
|
-
];
|
|
1421
|
-
const pure = [
|
|
1422
|
-
0,
|
|
1423
|
-
0,
|
|
1424
|
-
0
|
|
1425
|
-
];
|
|
1426
|
-
const hi = h % 1 * 6;
|
|
1427
|
-
const v = hi % 1;
|
|
1428
|
-
const w = 1 - v;
|
|
1429
|
-
let mg = 0;
|
|
1430
|
-
switch (Math.floor(hi)) {
|
|
1431
|
-
case 0:
|
|
1432
|
-
pure[0] = 1;
|
|
1433
|
-
pure[1] = v;
|
|
1434
|
-
pure[2] = 0;
|
|
1435
|
-
break;
|
|
1436
|
-
case 1:
|
|
1437
|
-
pure[0] = w;
|
|
1438
|
-
pure[1] = 1;
|
|
1439
|
-
pure[2] = 0;
|
|
1440
|
-
break;
|
|
1441
|
-
case 2:
|
|
1442
|
-
pure[0] = 0;
|
|
1443
|
-
pure[1] = 1;
|
|
1444
|
-
pure[2] = v;
|
|
1445
|
-
break;
|
|
1446
|
-
case 3:
|
|
1447
|
-
pure[0] = 0;
|
|
1448
|
-
pure[1] = w;
|
|
1449
|
-
pure[2] = 1;
|
|
1450
|
-
break;
|
|
1451
|
-
case 4:
|
|
1452
|
-
pure[0] = v;
|
|
1453
|
-
pure[1] = 0;
|
|
1454
|
-
pure[2] = 1;
|
|
1455
|
-
break;
|
|
1456
|
-
default:
|
|
1457
|
-
pure[0] = 1;
|
|
1458
|
-
pure[1] = 0;
|
|
1459
|
-
pure[2] = w;
|
|
1460
|
-
}
|
|
1461
|
-
mg = (1 - c) * g;
|
|
1462
|
-
return [
|
|
1463
|
-
(c * pure[0] + mg) * 255,
|
|
1464
|
-
(c * pure[1] + mg) * 255,
|
|
1465
|
-
(c * pure[2] + mg) * 255
|
|
1466
|
-
];
|
|
1467
|
-
};
|
|
1468
|
-
convert.hcg.hsv = function(hcg) {
|
|
1469
|
-
const c = hcg[1] / 100;
|
|
1470
|
-
const v = c + hcg[2] / 100 * (1 - c);
|
|
1471
|
-
let f = 0;
|
|
1472
|
-
if (v > 0) f = c / v;
|
|
1473
|
-
return [
|
|
1474
|
-
hcg[0],
|
|
1475
|
-
f * 100,
|
|
1476
|
-
v * 100
|
|
1477
|
-
];
|
|
1478
|
-
};
|
|
1479
|
-
convert.hcg.hsl = function(hcg) {
|
|
1480
|
-
const c = hcg[1] / 100;
|
|
1481
|
-
const l = hcg[2] / 100 * (1 - c) + .5 * c;
|
|
1482
|
-
let s = 0;
|
|
1483
|
-
if (l > 0 && l < .5) s = c / (2 * l);
|
|
1484
|
-
else if (l >= .5 && l < 1) s = c / (2 * (1 - l));
|
|
1485
|
-
return [
|
|
1486
|
-
hcg[0],
|
|
1487
|
-
s * 100,
|
|
1488
|
-
l * 100
|
|
1489
|
-
];
|
|
1490
|
-
};
|
|
1491
|
-
convert.hcg.hwb = function(hcg) {
|
|
1492
|
-
const c = hcg[1] / 100;
|
|
1493
|
-
const v = c + hcg[2] / 100 * (1 - c);
|
|
1494
|
-
return [
|
|
1495
|
-
hcg[0],
|
|
1496
|
-
(v - c) * 100,
|
|
1497
|
-
(1 - v) * 100
|
|
1498
|
-
];
|
|
1499
|
-
};
|
|
1500
|
-
convert.hwb.hcg = function(hwb) {
|
|
1501
|
-
const w = hwb[1] / 100;
|
|
1502
|
-
const v = 1 - hwb[2] / 100;
|
|
1503
|
-
const c = v - w;
|
|
1504
|
-
let g = 0;
|
|
1505
|
-
if (c < 1) g = (v - c) / (1 - c);
|
|
1506
|
-
return [
|
|
1507
|
-
hwb[0],
|
|
1508
|
-
c * 100,
|
|
1509
|
-
g * 100
|
|
1510
|
-
];
|
|
1511
|
-
};
|
|
1512
|
-
convert.apple.rgb = function(apple) {
|
|
1513
|
-
return [
|
|
1514
|
-
apple[0] / 65535 * 255,
|
|
1515
|
-
apple[1] / 65535 * 255,
|
|
1516
|
-
apple[2] / 65535 * 255
|
|
1517
|
-
];
|
|
1518
|
-
};
|
|
1519
|
-
convert.rgb.apple = function(rgb) {
|
|
1520
|
-
return [
|
|
1521
|
-
rgb[0] / 255 * 65535,
|
|
1522
|
-
rgb[1] / 255 * 65535,
|
|
1523
|
-
rgb[2] / 255 * 65535
|
|
1524
|
-
];
|
|
1525
|
-
};
|
|
1526
|
-
convert.gray.rgb = function(args) {
|
|
1527
|
-
return [
|
|
1528
|
-
args[0] / 100 * 255,
|
|
1529
|
-
args[0] / 100 * 255,
|
|
1530
|
-
args[0] / 100 * 255
|
|
1531
|
-
];
|
|
1532
|
-
};
|
|
1533
|
-
convert.gray.hsl = function(args) {
|
|
1534
|
-
return [
|
|
1535
|
-
0,
|
|
1536
|
-
0,
|
|
1537
|
-
args[0]
|
|
1538
|
-
];
|
|
1539
|
-
};
|
|
1540
|
-
convert.gray.hsv = convert.gray.hsl;
|
|
1541
|
-
convert.gray.hwb = function(gray) {
|
|
1542
|
-
return [
|
|
1543
|
-
0,
|
|
1544
|
-
100,
|
|
1545
|
-
gray[0]
|
|
1546
|
-
];
|
|
1547
|
-
};
|
|
1548
|
-
convert.gray.cmyk = function(gray) {
|
|
1549
|
-
return [
|
|
1550
|
-
0,
|
|
1551
|
-
0,
|
|
1552
|
-
0,
|
|
1553
|
-
gray[0]
|
|
1554
|
-
];
|
|
1555
|
-
};
|
|
1556
|
-
convert.gray.lab = function(gray) {
|
|
1557
|
-
return [
|
|
1558
|
-
gray[0],
|
|
1559
|
-
0,
|
|
1560
|
-
0
|
|
1561
|
-
];
|
|
1562
|
-
};
|
|
1563
|
-
convert.gray.hex = function(gray) {
|
|
1564
|
-
const val = Math.round(gray[0] / 100 * 255) & 255;
|
|
1565
|
-
const string = ((val << 16) + (val << 8) + val).toString(16).toUpperCase();
|
|
1566
|
-
return "000000".substring(string.length) + string;
|
|
1567
|
-
};
|
|
1568
|
-
convert.rgb.gray = function(rgb) {
|
|
1569
|
-
return [(rgb[0] + rgb[1] + rgb[2]) / 3 / 255 * 100];
|
|
1570
|
-
};
|
|
1571
|
-
}));
|
|
1572
|
-
//#endregion
|
|
1573
|
-
//#region node_modules/color-convert/route.js
|
|
1574
|
-
var require_route$1 = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
|
|
1575
|
-
var conversions = require_conversions$1();
|
|
1576
|
-
function buildGraph() {
|
|
1577
|
-
const graph = {};
|
|
1578
|
-
const models = Object.keys(conversions);
|
|
1579
|
-
for (let len = models.length, i = 0; i < len; i++) graph[models[i]] = {
|
|
1580
|
-
distance: -1,
|
|
1581
|
-
parent: null
|
|
1582
|
-
};
|
|
1583
|
-
return graph;
|
|
1584
|
-
}
|
|
1585
|
-
function deriveBFS(fromModel) {
|
|
1586
|
-
const graph = buildGraph();
|
|
1587
|
-
const queue = [fromModel];
|
|
1588
|
-
graph[fromModel].distance = 0;
|
|
1589
|
-
while (queue.length) {
|
|
1590
|
-
const current = queue.pop();
|
|
1591
|
-
const adjacents = Object.keys(conversions[current]);
|
|
1592
|
-
for (let len = adjacents.length, i = 0; i < len; i++) {
|
|
1593
|
-
const adjacent = adjacents[i];
|
|
1594
|
-
const node = graph[adjacent];
|
|
1595
|
-
if (node.distance === -1) {
|
|
1596
|
-
node.distance = graph[current].distance + 1;
|
|
1597
|
-
node.parent = current;
|
|
1598
|
-
queue.unshift(adjacent);
|
|
1599
|
-
}
|
|
1600
|
-
}
|
|
1601
|
-
}
|
|
1602
|
-
return graph;
|
|
1603
|
-
}
|
|
1604
|
-
function link(from, to) {
|
|
1605
|
-
return function(args) {
|
|
1606
|
-
return to(from(args));
|
|
1607
|
-
};
|
|
1608
|
-
}
|
|
1609
|
-
function wrapConversion(toModel, graph) {
|
|
1610
|
-
const path = [graph[toModel].parent, toModel];
|
|
1611
|
-
let fn = conversions[graph[toModel].parent][toModel];
|
|
1612
|
-
let cur = graph[toModel].parent;
|
|
1613
|
-
while (graph[cur].parent) {
|
|
1614
|
-
path.unshift(graph[cur].parent);
|
|
1615
|
-
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
1616
|
-
cur = graph[cur].parent;
|
|
1617
|
-
}
|
|
1618
|
-
fn.conversion = path;
|
|
1619
|
-
return fn;
|
|
41
|
+
//#region node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
42
|
+
var ANSI_BACKGROUND_OFFSET$1 = 10;
|
|
43
|
+
var wrapAnsi16$1 = (offset = 0) => (code) => `\u001B[${code + offset}m`;
|
|
44
|
+
var wrapAnsi256$1 = (offset = 0) => (code) => `\u001B[${38 + offset};5;${code}m`;
|
|
45
|
+
var wrapAnsi16m$1 = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`;
|
|
46
|
+
var styles$3 = {
|
|
47
|
+
modifier: {
|
|
48
|
+
reset: [0, 0],
|
|
49
|
+
bold: [1, 22],
|
|
50
|
+
dim: [2, 22],
|
|
51
|
+
italic: [3, 23],
|
|
52
|
+
underline: [4, 24],
|
|
53
|
+
overline: [53, 55],
|
|
54
|
+
inverse: [7, 27],
|
|
55
|
+
hidden: [8, 28],
|
|
56
|
+
strikethrough: [9, 29]
|
|
57
|
+
},
|
|
58
|
+
color: {
|
|
59
|
+
black: [30, 39],
|
|
60
|
+
red: [31, 39],
|
|
61
|
+
green: [32, 39],
|
|
62
|
+
yellow: [33, 39],
|
|
63
|
+
blue: [34, 39],
|
|
64
|
+
magenta: [35, 39],
|
|
65
|
+
cyan: [36, 39],
|
|
66
|
+
white: [37, 39],
|
|
67
|
+
blackBright: [90, 39],
|
|
68
|
+
gray: [90, 39],
|
|
69
|
+
grey: [90, 39],
|
|
70
|
+
redBright: [91, 39],
|
|
71
|
+
greenBright: [92, 39],
|
|
72
|
+
yellowBright: [93, 39],
|
|
73
|
+
blueBright: [94, 39],
|
|
74
|
+
magentaBright: [95, 39],
|
|
75
|
+
cyanBright: [96, 39],
|
|
76
|
+
whiteBright: [97, 39]
|
|
77
|
+
},
|
|
78
|
+
bgColor: {
|
|
79
|
+
bgBlack: [40, 49],
|
|
80
|
+
bgRed: [41, 49],
|
|
81
|
+
bgGreen: [42, 49],
|
|
82
|
+
bgYellow: [43, 49],
|
|
83
|
+
bgBlue: [44, 49],
|
|
84
|
+
bgMagenta: [45, 49],
|
|
85
|
+
bgCyan: [46, 49],
|
|
86
|
+
bgWhite: [47, 49],
|
|
87
|
+
bgBlackBright: [100, 49],
|
|
88
|
+
bgGray: [100, 49],
|
|
89
|
+
bgGrey: [100, 49],
|
|
90
|
+
bgRedBright: [101, 49],
|
|
91
|
+
bgGreenBright: [102, 49],
|
|
92
|
+
bgYellowBright: [103, 49],
|
|
93
|
+
bgBlueBright: [104, 49],
|
|
94
|
+
bgMagentaBright: [105, 49],
|
|
95
|
+
bgCyanBright: [106, 49],
|
|
96
|
+
bgWhiteBright: [107, 49]
|
|
1620
97
|
}
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
98
|
+
};
|
|
99
|
+
Object.keys(styles$3.modifier);
|
|
100
|
+
var foregroundColorNames$1 = Object.keys(styles$3.color);
|
|
101
|
+
var backgroundColorNames$1 = Object.keys(styles$3.bgColor);
|
|
102
|
+
[...foregroundColorNames$1, ...backgroundColorNames$1];
|
|
103
|
+
function assembleStyles$1() {
|
|
104
|
+
const codes = /* @__PURE__ */ new Map();
|
|
105
|
+
for (const [groupName, group] of Object.entries(styles$3)) {
|
|
106
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
107
|
+
styles$3[styleName] = {
|
|
108
|
+
open: `\u001B[${style[0]}m`,
|
|
109
|
+
close: `\u001B[${style[1]}m`
|
|
110
|
+
};
|
|
111
|
+
group[styleName] = styles$3[styleName];
|
|
112
|
+
codes.set(style[0], style[1]);
|
|
1629
113
|
}
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
//#endregion
|
|
1634
|
-
//#region node_modules/color-convert/index.js
|
|
1635
|
-
var require_color_convert$1 = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
|
|
1636
|
-
var conversions = require_conversions$1();
|
|
1637
|
-
var route = require_route$1();
|
|
1638
|
-
var convert = {};
|
|
1639
|
-
var models = Object.keys(conversions);
|
|
1640
|
-
function wrapRaw(fn) {
|
|
1641
|
-
const wrappedFn = function(...args) {
|
|
1642
|
-
const arg0 = args[0];
|
|
1643
|
-
if (arg0 === void 0 || arg0 === null) return arg0;
|
|
1644
|
-
if (arg0.length > 1) args = arg0;
|
|
1645
|
-
return fn(args);
|
|
1646
|
-
};
|
|
1647
|
-
if ("conversion" in fn) wrappedFn.conversion = fn.conversion;
|
|
1648
|
-
return wrappedFn;
|
|
1649
|
-
}
|
|
1650
|
-
function wrapRounded(fn) {
|
|
1651
|
-
const wrappedFn = function(...args) {
|
|
1652
|
-
const arg0 = args[0];
|
|
1653
|
-
if (arg0 === void 0 || arg0 === null) return arg0;
|
|
1654
|
-
if (arg0.length > 1) args = arg0;
|
|
1655
|
-
const result = fn(args);
|
|
1656
|
-
if (typeof result === "object") for (let len = result.length, i = 0; i < len; i++) result[i] = Math.round(result[i]);
|
|
1657
|
-
return result;
|
|
1658
|
-
};
|
|
1659
|
-
if ("conversion" in fn) wrappedFn.conversion = fn.conversion;
|
|
1660
|
-
return wrappedFn;
|
|
1661
|
-
}
|
|
1662
|
-
models.forEach((fromModel) => {
|
|
1663
|
-
convert[fromModel] = {};
|
|
1664
|
-
Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels });
|
|
1665
|
-
Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels });
|
|
1666
|
-
const routes = route(fromModel);
|
|
1667
|
-
Object.keys(routes).forEach((toModel) => {
|
|
1668
|
-
const fn = routes[toModel];
|
|
1669
|
-
convert[fromModel][toModel] = wrapRounded(fn);
|
|
1670
|
-
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
114
|
+
Object.defineProperty(styles$3, groupName, {
|
|
115
|
+
value: group,
|
|
116
|
+
enumerable: false
|
|
1671
117
|
});
|
|
118
|
+
}
|
|
119
|
+
Object.defineProperty(styles$3, "codes", {
|
|
120
|
+
value: codes,
|
|
121
|
+
enumerable: false
|
|
1672
122
|
});
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
var rgb2rgb = (r, g, b) => [
|
|
1691
|
-
r,
|
|
1692
|
-
g,
|
|
1693
|
-
b
|
|
1694
|
-
];
|
|
1695
|
-
var setLazyProperty = (object, property, get) => {
|
|
1696
|
-
Object.defineProperty(object, property, {
|
|
1697
|
-
get: () => {
|
|
1698
|
-
const value = get();
|
|
1699
|
-
Object.defineProperty(object, property, {
|
|
1700
|
-
value,
|
|
1701
|
-
enumerable: true,
|
|
1702
|
-
configurable: true
|
|
1703
|
-
});
|
|
1704
|
-
return value;
|
|
123
|
+
styles$3.color.close = "\x1B[39m";
|
|
124
|
+
styles$3.bgColor.close = "\x1B[49m";
|
|
125
|
+
styles$3.color.ansi = wrapAnsi16$1();
|
|
126
|
+
styles$3.color.ansi256 = wrapAnsi256$1();
|
|
127
|
+
styles$3.color.ansi16m = wrapAnsi16m$1();
|
|
128
|
+
styles$3.bgColor.ansi = wrapAnsi16$1(ANSI_BACKGROUND_OFFSET$1);
|
|
129
|
+
styles$3.bgColor.ansi256 = wrapAnsi256$1(ANSI_BACKGROUND_OFFSET$1);
|
|
130
|
+
styles$3.bgColor.ansi16m = wrapAnsi16m$1(ANSI_BACKGROUND_OFFSET$1);
|
|
131
|
+
Object.defineProperties(styles$3, {
|
|
132
|
+
rgbToAnsi256: {
|
|
133
|
+
value(red, green, blue) {
|
|
134
|
+
if (red === green && green === blue) {
|
|
135
|
+
if (red < 8) return 16;
|
|
136
|
+
if (red > 248) return 231;
|
|
137
|
+
return Math.round((red - 8) / 247 * 24) + 232;
|
|
138
|
+
}
|
|
139
|
+
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
1705
140
|
},
|
|
1706
|
-
enumerable:
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
const codes = /* @__PURE__ */ new Map();
|
|
1725
|
-
const styles = {
|
|
1726
|
-
modifier: {
|
|
1727
|
-
reset: [0, 0],
|
|
1728
|
-
bold: [1, 22],
|
|
1729
|
-
dim: [2, 22],
|
|
1730
|
-
italic: [3, 23],
|
|
1731
|
-
underline: [4, 24],
|
|
1732
|
-
inverse: [7, 27],
|
|
1733
|
-
hidden: [8, 28],
|
|
1734
|
-
strikethrough: [9, 29]
|
|
141
|
+
enumerable: false
|
|
142
|
+
},
|
|
143
|
+
hexToRgb: {
|
|
144
|
+
value(hex) {
|
|
145
|
+
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
146
|
+
if (!matches) return [
|
|
147
|
+
0,
|
|
148
|
+
0,
|
|
149
|
+
0
|
|
150
|
+
];
|
|
151
|
+
let [colorString] = matches;
|
|
152
|
+
if (colorString.length === 3) colorString = [...colorString].map((character) => character + character).join("");
|
|
153
|
+
const integer = Number.parseInt(colorString, 16);
|
|
154
|
+
return [
|
|
155
|
+
integer >> 16 & 255,
|
|
156
|
+
integer >> 8 & 255,
|
|
157
|
+
integer & 255
|
|
158
|
+
];
|
|
1735
159
|
},
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
160
|
+
enumerable: false
|
|
161
|
+
},
|
|
162
|
+
hexToAnsi256: {
|
|
163
|
+
value: (hex) => styles$3.rgbToAnsi256(...styles$3.hexToRgb(hex)),
|
|
164
|
+
enumerable: false
|
|
165
|
+
},
|
|
166
|
+
ansi256ToAnsi: {
|
|
167
|
+
value(code) {
|
|
168
|
+
if (code < 8) return 30 + code;
|
|
169
|
+
if (code < 16) return 90 + (code - 8);
|
|
170
|
+
let red;
|
|
171
|
+
let green;
|
|
172
|
+
let blue;
|
|
173
|
+
if (code >= 232) {
|
|
174
|
+
red = ((code - 232) * 10 + 8) / 255;
|
|
175
|
+
green = red;
|
|
176
|
+
blue = red;
|
|
177
|
+
} else {
|
|
178
|
+
code -= 16;
|
|
179
|
+
const remainder = code % 36;
|
|
180
|
+
red = Math.floor(code / 36) / 5;
|
|
181
|
+
green = Math.floor(remainder / 6) / 5;
|
|
182
|
+
blue = remainder % 6 / 5;
|
|
183
|
+
}
|
|
184
|
+
const value = Math.max(red, green, blue) * 2;
|
|
185
|
+
if (value === 0) return 30;
|
|
186
|
+
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
187
|
+
if (value === 2) result += 60;
|
|
188
|
+
return result;
|
|
1753
189
|
},
|
|
1754
|
-
bgColor: {
|
|
1755
|
-
bgBlack: [40, 49],
|
|
1756
|
-
bgRed: [41, 49],
|
|
1757
|
-
bgGreen: [42, 49],
|
|
1758
|
-
bgYellow: [43, 49],
|
|
1759
|
-
bgBlue: [44, 49],
|
|
1760
|
-
bgMagenta: [45, 49],
|
|
1761
|
-
bgCyan: [46, 49],
|
|
1762
|
-
bgWhite: [47, 49],
|
|
1763
|
-
bgBlackBright: [100, 49],
|
|
1764
|
-
bgRedBright: [101, 49],
|
|
1765
|
-
bgGreenBright: [102, 49],
|
|
1766
|
-
bgYellowBright: [103, 49],
|
|
1767
|
-
bgBlueBright: [104, 49],
|
|
1768
|
-
bgMagentaBright: [105, 49],
|
|
1769
|
-
bgCyanBright: [106, 49],
|
|
1770
|
-
bgWhiteBright: [107, 49]
|
|
1771
|
-
}
|
|
1772
|
-
};
|
|
1773
|
-
styles.color.gray = styles.color.blackBright;
|
|
1774
|
-
styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
|
|
1775
|
-
styles.color.grey = styles.color.blackBright;
|
|
1776
|
-
styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
|
|
1777
|
-
for (const [groupName, group] of Object.entries(styles)) {
|
|
1778
|
-
for (const [styleName, style] of Object.entries(group)) {
|
|
1779
|
-
styles[styleName] = {
|
|
1780
|
-
open: `\u001B[${style[0]}m`,
|
|
1781
|
-
close: `\u001B[${style[1]}m`
|
|
1782
|
-
};
|
|
1783
|
-
group[styleName] = styles[styleName];
|
|
1784
|
-
codes.set(style[0], style[1]);
|
|
1785
|
-
}
|
|
1786
|
-
Object.defineProperty(styles, groupName, {
|
|
1787
|
-
value: group,
|
|
1788
|
-
enumerable: false
|
|
1789
|
-
});
|
|
1790
|
-
}
|
|
1791
|
-
Object.defineProperty(styles, "codes", {
|
|
1792
|
-
value: codes,
|
|
1793
190
|
enumerable: false
|
|
1794
|
-
}
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
return styles;
|
|
1804
|
-
}
|
|
1805
|
-
Object.defineProperty(module, "exports", {
|
|
1806
|
-
enumerable: true,
|
|
1807
|
-
get: assembleStyles
|
|
191
|
+
},
|
|
192
|
+
rgbToAnsi: {
|
|
193
|
+
value: (red, green, blue) => styles$3.ansi256ToAnsi(styles$3.rgbToAnsi256(red, green, blue)),
|
|
194
|
+
enumerable: false
|
|
195
|
+
},
|
|
196
|
+
hexToAnsi: {
|
|
197
|
+
value: (hex) => styles$3.ansi256ToAnsi(styles$3.hexToAnsi256(hex)),
|
|
198
|
+
enumerable: false
|
|
199
|
+
}
|
|
1808
200
|
});
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
var require_browser$2 = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
|
|
1813
|
-
module.exports = {
|
|
1814
|
-
stdout: false,
|
|
1815
|
-
stderr: false
|
|
1816
|
-
};
|
|
1817
|
-
}));
|
|
201
|
+
return styles$3;
|
|
202
|
+
}
|
|
203
|
+
var ansiStyles$1 = assembleStyles$1();
|
|
1818
204
|
//#endregion
|
|
1819
|
-
//#region node_modules/chalk/source/
|
|
1820
|
-
var
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
const gotCR = string[index - 1] === "\r";
|
|
1840
|
-
returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
1841
|
-
endIndex = index + 1;
|
|
1842
|
-
index = string.indexOf("\n", endIndex);
|
|
1843
|
-
} while (index !== -1);
|
|
1844
|
-
returnValue += string.substr(endIndex);
|
|
1845
|
-
return returnValue;
|
|
1846
|
-
};
|
|
1847
|
-
module.exports = {
|
|
1848
|
-
stringReplaceAll,
|
|
1849
|
-
stringEncaseCRLFWithFirstIndex
|
|
1850
|
-
};
|
|
1851
|
-
}));
|
|
205
|
+
//#region node_modules/chalk/source/vendor/supports-color/browser.js
|
|
206
|
+
var level$1 = (() => {
|
|
207
|
+
if (!("navigator" in globalThis)) return 0;
|
|
208
|
+
if (globalThis.navigator.userAgentData) {
|
|
209
|
+
const brand = navigator.userAgentData.brands.find(({ brand }) => brand === "Chromium");
|
|
210
|
+
if (brand && brand.version > 93) return 3;
|
|
211
|
+
}
|
|
212
|
+
if (/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)) return 1;
|
|
213
|
+
return 0;
|
|
214
|
+
})();
|
|
215
|
+
var colorSupport$1 = level$1 !== 0 && {
|
|
216
|
+
level: level$1,
|
|
217
|
+
hasBasic: true,
|
|
218
|
+
has256: level$1 >= 2,
|
|
219
|
+
has16m: level$1 >= 3
|
|
220
|
+
};
|
|
221
|
+
var supportsColor$1 = {
|
|
222
|
+
stdout: colorSupport$1,
|
|
223
|
+
stderr: colorSupport$1
|
|
224
|
+
};
|
|
1852
225
|
//#endregion
|
|
1853
|
-
//#region node_modules/chalk/source/
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
const
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
const chunks = arguments_.trim().split(/\s*,\s*/g);
|
|
1881
|
-
let matches;
|
|
1882
|
-
for (const chunk of chunks) {
|
|
1883
|
-
const number = Number(chunk);
|
|
1884
|
-
if (!Number.isNaN(number)) results.push(number);
|
|
1885
|
-
else if (matches = chunk.match(STRING_REGEX)) results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
|
|
1886
|
-
else throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
|
|
1887
|
-
}
|
|
1888
|
-
return results;
|
|
1889
|
-
}
|
|
1890
|
-
function parseStyle(style) {
|
|
1891
|
-
STYLE_REGEX.lastIndex = 0;
|
|
1892
|
-
const results = [];
|
|
1893
|
-
let matches;
|
|
1894
|
-
while ((matches = STYLE_REGEX.exec(style)) !== null) {
|
|
1895
|
-
const name = matches[1];
|
|
1896
|
-
if (matches[2]) {
|
|
1897
|
-
const args = parseArguments(name, matches[2]);
|
|
1898
|
-
results.push([name].concat(args));
|
|
1899
|
-
} else results.push([name]);
|
|
1900
|
-
}
|
|
1901
|
-
return results;
|
|
1902
|
-
}
|
|
1903
|
-
function buildStyle(chalk, styles) {
|
|
1904
|
-
const enabled = {};
|
|
1905
|
-
for (const layer of styles) for (const style of layer.styles) enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
1906
|
-
let current = chalk;
|
|
1907
|
-
for (const [styleName, styles] of Object.entries(enabled)) {
|
|
1908
|
-
if (!Array.isArray(styles)) continue;
|
|
1909
|
-
if (!(styleName in current)) throw new Error(`Unknown Chalk style: ${styleName}`);
|
|
1910
|
-
current = styles.length > 0 ? current[styleName](...styles) : current[styleName];
|
|
1911
|
-
}
|
|
1912
|
-
return current;
|
|
1913
|
-
}
|
|
1914
|
-
module.exports = (chalk, temporary) => {
|
|
1915
|
-
const styles = [];
|
|
1916
|
-
const chunks = [];
|
|
1917
|
-
let chunk = [];
|
|
1918
|
-
temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
|
|
1919
|
-
if (escapeCharacter) chunk.push(unescape(escapeCharacter));
|
|
1920
|
-
else if (style) {
|
|
1921
|
-
const string = chunk.join("");
|
|
1922
|
-
chunk = [];
|
|
1923
|
-
chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string));
|
|
1924
|
-
styles.push({
|
|
1925
|
-
inverse,
|
|
1926
|
-
styles: parseStyle(style)
|
|
1927
|
-
});
|
|
1928
|
-
} else if (close) {
|
|
1929
|
-
if (styles.length === 0) throw new Error("Found extraneous } in Chalk template literal");
|
|
1930
|
-
chunks.push(buildStyle(chalk, styles)(chunk.join("")));
|
|
1931
|
-
chunk = [];
|
|
1932
|
-
styles.pop();
|
|
1933
|
-
} else chunk.push(character);
|
|
1934
|
-
});
|
|
1935
|
-
chunks.push(chunk.join(""));
|
|
1936
|
-
if (styles.length > 0) {
|
|
1937
|
-
const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
|
|
1938
|
-
throw new Error(errMessage);
|
|
1939
|
-
}
|
|
1940
|
-
return chunks.join("");
|
|
1941
|
-
};
|
|
1942
|
-
}));
|
|
226
|
+
//#region node_modules/chalk/source/utilities.js
|
|
227
|
+
function stringReplaceAll$1(string, substring, replacer) {
|
|
228
|
+
let index = string.indexOf(substring);
|
|
229
|
+
if (index === -1) return string;
|
|
230
|
+
const substringLength = substring.length;
|
|
231
|
+
let endIndex = 0;
|
|
232
|
+
let returnValue = "";
|
|
233
|
+
do {
|
|
234
|
+
returnValue += string.slice(endIndex, index) + substring + replacer;
|
|
235
|
+
endIndex = index + substringLength;
|
|
236
|
+
index = string.indexOf(substring, endIndex);
|
|
237
|
+
} while (index !== -1);
|
|
238
|
+
returnValue += string.slice(endIndex);
|
|
239
|
+
return returnValue;
|
|
240
|
+
}
|
|
241
|
+
function stringEncaseCRLFWithFirstIndex$1(string, prefix, postfix, index) {
|
|
242
|
+
let endIndex = 0;
|
|
243
|
+
let returnValue = "";
|
|
244
|
+
do {
|
|
245
|
+
const gotCR = string[index - 1] === "\r";
|
|
246
|
+
returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
247
|
+
endIndex = index + 1;
|
|
248
|
+
index = string.indexOf("\n", endIndex);
|
|
249
|
+
} while (index !== -1);
|
|
250
|
+
returnValue += string.slice(endIndex);
|
|
251
|
+
return returnValue;
|
|
252
|
+
}
|
|
1943
253
|
//#endregion
|
|
1944
254
|
//#region node_modules/chalk/source/index.js
|
|
1945
|
-
var
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
255
|
+
var { stdout: stdoutColor$1, stderr: stderrColor$1 } = supportsColor$1;
|
|
256
|
+
var GENERATOR$1 = Symbol("GENERATOR");
|
|
257
|
+
var STYLER$1 = Symbol("STYLER");
|
|
258
|
+
var IS_EMPTY$1 = Symbol("IS_EMPTY");
|
|
259
|
+
var levelMapping$1 = [
|
|
260
|
+
"ansi",
|
|
261
|
+
"ansi",
|
|
262
|
+
"ansi256",
|
|
263
|
+
"ansi16m"
|
|
264
|
+
];
|
|
265
|
+
var styles$2 = Object.create(null);
|
|
266
|
+
var applyOptions$1 = (object, options = {}) => {
|
|
267
|
+
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");
|
|
268
|
+
const colorLevel = stdoutColor$1 ? stdoutColor$1.level : 0;
|
|
269
|
+
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
270
|
+
};
|
|
271
|
+
var chalkFactory$1 = (options) => {
|
|
272
|
+
const chalk = (...strings) => strings.join(" ");
|
|
273
|
+
applyOptions$1(chalk, options);
|
|
274
|
+
Object.setPrototypeOf(chalk, createChalk$1.prototype);
|
|
275
|
+
return chalk;
|
|
276
|
+
};
|
|
277
|
+
function createChalk$1(options) {
|
|
278
|
+
return chalkFactory$1(options);
|
|
279
|
+
}
|
|
280
|
+
Object.setPrototypeOf(createChalk$1.prototype, Function.prototype);
|
|
281
|
+
for (const [styleName, style] of Object.entries(ansiStyles$1)) styles$2[styleName] = { get() {
|
|
282
|
+
const builder = createBuilder$1(this, createStyler$1(style.open, style.close, this[STYLER$1]), this[IS_EMPTY$1]);
|
|
283
|
+
Object.defineProperty(this, styleName, { value: builder });
|
|
284
|
+
return builder;
|
|
285
|
+
} };
|
|
286
|
+
styles$2.visible = { get() {
|
|
287
|
+
const builder = createBuilder$1(this, this[STYLER$1], true);
|
|
288
|
+
Object.defineProperty(this, "visible", { value: builder });
|
|
289
|
+
return builder;
|
|
290
|
+
} };
|
|
291
|
+
var getModelAnsi$1 = (model, level, type, ...arguments_) => {
|
|
292
|
+
if (model === "rgb") {
|
|
293
|
+
if (level === "ansi16m") return ansiStyles$1[type].ansi16m(...arguments_);
|
|
294
|
+
if (level === "ansi256") return ansiStyles$1[type].ansi256(ansiStyles$1.rgbToAnsi256(...arguments_));
|
|
295
|
+
return ansiStyles$1[type].ansi(ansiStyles$1.rgbToAnsi(...arguments_));
|
|
296
|
+
}
|
|
297
|
+
if (model === "hex") return getModelAnsi$1("rgb", level, type, ...ansiStyles$1.hexToRgb(...arguments_));
|
|
298
|
+
return ansiStyles$1[type][model](...arguments_);
|
|
299
|
+
};
|
|
300
|
+
for (const model of [
|
|
301
|
+
"rgb",
|
|
302
|
+
"hex",
|
|
303
|
+
"ansi256"
|
|
304
|
+
]) {
|
|
305
|
+
styles$2[model] = { get() {
|
|
306
|
+
const { level } = this;
|
|
307
|
+
return function(...arguments_) {
|
|
308
|
+
const styler = createStyler$1(getModelAnsi$1(model, levelMapping$1[level], "color", ...arguments_), ansiStyles$1.color.close, this[STYLER$1]);
|
|
309
|
+
return createBuilder$1(this, styler, this[IS_EMPTY$1]);
|
|
1975
310
|
};
|
|
1976
|
-
chalk.template.Instance = ChalkClass;
|
|
1977
|
-
return chalk.template;
|
|
1978
|
-
};
|
|
1979
|
-
function Chalk(options) {
|
|
1980
|
-
return chalkFactory(options);
|
|
1981
|
-
}
|
|
1982
|
-
for (const [styleName, style] of Object.entries(ansiStyles)) styles[styleName] = { get() {
|
|
1983
|
-
const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
|
|
1984
|
-
Object.defineProperty(this, styleName, { value: builder });
|
|
1985
|
-
return builder;
|
|
1986
|
-
} };
|
|
1987
|
-
styles.visible = { get() {
|
|
1988
|
-
const builder = createBuilder(this, this._styler, true);
|
|
1989
|
-
Object.defineProperty(this, "visible", { value: builder });
|
|
1990
|
-
return builder;
|
|
1991
311
|
} };
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
"hex",
|
|
1995
|
-
"keyword",
|
|
1996
|
-
"hsl",
|
|
1997
|
-
"hsv",
|
|
1998
|
-
"hwb",
|
|
1999
|
-
"ansi",
|
|
2000
|
-
"ansi256"
|
|
2001
|
-
];
|
|
2002
|
-
for (const model of usedModels) styles[model] = { get() {
|
|
312
|
+
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
313
|
+
styles$2[bgModel] = { get() {
|
|
2003
314
|
const { level } = this;
|
|
2004
315
|
return function(...arguments_) {
|
|
2005
|
-
const styler = createStyler(
|
|
2006
|
-
return createBuilder(this, styler, this
|
|
316
|
+
const styler = createStyler$1(getModelAnsi$1(model, levelMapping$1[level], "bgColor", ...arguments_), ansiStyles$1.bgColor.close, this[STYLER$1]);
|
|
317
|
+
return createBuilder$1(this, styler, this[IS_EMPTY$1]);
|
|
2007
318
|
};
|
|
2008
319
|
} };
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
var proto = Object.defineProperties(() => {}, {
|
|
2020
|
-
...styles,
|
|
2021
|
-
level: {
|
|
2022
|
-
enumerable: true,
|
|
2023
|
-
get() {
|
|
2024
|
-
return this._generator.level;
|
|
2025
|
-
},
|
|
2026
|
-
set(level) {
|
|
2027
|
-
this._generator.level = level;
|
|
2028
|
-
}
|
|
2029
|
-
}
|
|
2030
|
-
});
|
|
2031
|
-
var createStyler = (open, close, parent) => {
|
|
2032
|
-
let openAll;
|
|
2033
|
-
let closeAll;
|
|
2034
|
-
if (parent === void 0) {
|
|
2035
|
-
openAll = open;
|
|
2036
|
-
closeAll = close;
|
|
2037
|
-
} else {
|
|
2038
|
-
openAll = parent.openAll + open;
|
|
2039
|
-
closeAll = close + parent.closeAll;
|
|
2040
|
-
}
|
|
2041
|
-
return {
|
|
2042
|
-
open,
|
|
2043
|
-
close,
|
|
2044
|
-
openAll,
|
|
2045
|
-
closeAll,
|
|
2046
|
-
parent
|
|
2047
|
-
};
|
|
2048
|
-
};
|
|
2049
|
-
var createBuilder = (self, _styler, _isEmpty) => {
|
|
2050
|
-
const builder = (...arguments_) => {
|
|
2051
|
-
if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) return applyStyle(builder, chalkTag(builder, ...arguments_));
|
|
2052
|
-
return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
2053
|
-
};
|
|
2054
|
-
Object.setPrototypeOf(builder, proto);
|
|
2055
|
-
builder._generator = self;
|
|
2056
|
-
builder._styler = _styler;
|
|
2057
|
-
builder._isEmpty = _isEmpty;
|
|
2058
|
-
return builder;
|
|
2059
|
-
};
|
|
2060
|
-
var applyStyle = (self, string) => {
|
|
2061
|
-
if (self.level <= 0 || !string) return self._isEmpty ? "" : string;
|
|
2062
|
-
let styler = self._styler;
|
|
2063
|
-
if (styler === void 0) return string;
|
|
2064
|
-
const { openAll, closeAll } = styler;
|
|
2065
|
-
if (string.indexOf("\x1B") !== -1) while (styler !== void 0) {
|
|
2066
|
-
string = stringReplaceAll(string, styler.close, styler.open);
|
|
2067
|
-
styler = styler.parent;
|
|
320
|
+
}
|
|
321
|
+
var proto$1 = Object.defineProperties(() => {}, {
|
|
322
|
+
...styles$2,
|
|
323
|
+
level: {
|
|
324
|
+
enumerable: true,
|
|
325
|
+
get() {
|
|
326
|
+
return this[GENERATOR$1].level;
|
|
327
|
+
},
|
|
328
|
+
set(level) {
|
|
329
|
+
this[GENERATOR$1].level = level;
|
|
2068
330
|
}
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
var createStyler$1 = (open, close, parent) => {
|
|
334
|
+
let openAll;
|
|
335
|
+
let closeAll;
|
|
336
|
+
if (parent === void 0) {
|
|
337
|
+
openAll = open;
|
|
338
|
+
closeAll = close;
|
|
339
|
+
} else {
|
|
340
|
+
openAll = parent.openAll + open;
|
|
341
|
+
closeAll = close + parent.closeAll;
|
|
342
|
+
}
|
|
343
|
+
return {
|
|
344
|
+
open,
|
|
345
|
+
close,
|
|
346
|
+
openAll,
|
|
347
|
+
closeAll,
|
|
348
|
+
parent
|
|
2082
349
|
};
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
var
|
|
2093
|
-
|
|
2094
|
-
|
|
350
|
+
};
|
|
351
|
+
var createBuilder$1 = (self, _styler, _isEmpty) => {
|
|
352
|
+
const builder = (...arguments_) => applyStyle$1(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
353
|
+
Object.setPrototypeOf(builder, proto$1);
|
|
354
|
+
builder[GENERATOR$1] = self;
|
|
355
|
+
builder[STYLER$1] = _styler;
|
|
356
|
+
builder[IS_EMPTY$1] = _isEmpty;
|
|
357
|
+
return builder;
|
|
358
|
+
};
|
|
359
|
+
var applyStyle$1 = (self, string) => {
|
|
360
|
+
if (self.level <= 0 || !string) return self[IS_EMPTY$1] ? "" : string;
|
|
361
|
+
let styler = self[STYLER$1];
|
|
362
|
+
if (styler === void 0) return string;
|
|
363
|
+
const { openAll, closeAll } = styler;
|
|
364
|
+
if (string.includes("\x1B")) while (styler !== void 0) {
|
|
365
|
+
string = stringReplaceAll$1(string, styler.close, styler.open);
|
|
366
|
+
styler = styler.parent;
|
|
367
|
+
}
|
|
368
|
+
const lfIndex = string.indexOf("\n");
|
|
369
|
+
if (lfIndex !== -1) string = stringEncaseCRLFWithFirstIndex$1(string, closeAll, openAll, lfIndex);
|
|
370
|
+
return openAll + string + closeAll;
|
|
371
|
+
};
|
|
372
|
+
Object.defineProperties(createChalk$1.prototype, styles$2);
|
|
373
|
+
var chalk$1 = createChalk$1();
|
|
374
|
+
createChalk$1({ level: stderrColor$1 ? stderrColor$1.level : 0 });
|
|
2095
375
|
//#endregion
|
|
2096
376
|
//#region src/stsoauth2types.ts
|
|
2097
|
-
var
|
|
2098
|
-
|
|
377
|
+
var import_browser = /* @__PURE__ */ __toESM$1((/* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
378
|
+
module.exports = false;
|
|
379
|
+
})))(), 1);
|
|
2099
380
|
var AuthorizeOptionsResponseType = /* @__PURE__ */ function(AuthorizeOptionsResponseType) {
|
|
2100
381
|
AuthorizeOptionsResponseType["CODE"] = "code";
|
|
2101
382
|
AuthorizeOptionsResponseType["ID_TOKEN"] = "id_token";
|
|
@@ -2210,7 +491,7 @@ var STSOauth2Store = (0, pinia.defineStore)("__sts__STSOauth2Store", {
|
|
|
2210
491
|
});
|
|
2211
492
|
//#endregion
|
|
2212
493
|
//#region node_modules/tiny-emitter/index.js
|
|
2213
|
-
var require_tiny_emitter = /* @__PURE__ */ __commonJSMin$
|
|
494
|
+
var require_tiny_emitter = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
2214
495
|
function E() {}
|
|
2215
496
|
E.prototype = {
|
|
2216
497
|
on: function(name, callback, ctx) {
|
|
@@ -2254,7 +535,7 @@ var require_tiny_emitter = /* @__PURE__ */ __commonJSMin$2(((exports, module) =>
|
|
|
2254
535
|
}));
|
|
2255
536
|
//#endregion
|
|
2256
537
|
//#region node_modules/lodash.clonedeep/index.js
|
|
2257
|
-
var require_lodash_clonedeep = /* @__PURE__ */ __commonJSMin$
|
|
538
|
+
var require_lodash_clonedeep = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
2258
539
|
/**
|
|
2259
540
|
* lodash (Custom Build) <https://lodash.com/>
|
|
2260
541
|
* Build: `lodash modularize exports="npm" -o ./`
|
|
@@ -3662,7 +1943,6 @@ var require_lodash_clonedeep = /* @__PURE__ */ __commonJSMin$2(((exports, module
|
|
|
3662
1943
|
}));
|
|
3663
1944
|
require_tiny_emitter();
|
|
3664
1945
|
require_lodash_clonedeep();
|
|
3665
|
-
var __commonJSMin$1 = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
3666
1946
|
var SubscriptionTopic = /* @__PURE__ */ function(SubscriptionTopic) {
|
|
3667
1947
|
SubscriptionTopic["AllServicesCombined"] = "AllServicesCombined";
|
|
3668
1948
|
SubscriptionTopic["Services"] = "Services";
|
|
@@ -3679,2038 +1959,333 @@ var SubscriptionTopic = /* @__PURE__ */ function(SubscriptionTopic) {
|
|
|
3679
1959
|
SubscriptionTopic["LogProcessing"] = "LogProcessing";
|
|
3680
1960
|
return SubscriptionTopic;
|
|
3681
1961
|
}({});
|
|
3682
|
-
var
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
],
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
],
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
],
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
],
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
],
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
],
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
],
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
],
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
226
|
|
3738
|
-
],
|
|
3739
|
-
"brown": [
|
|
3740
|
-
165,
|
|
3741
|
-
42,
|
|
3742
|
-
42
|
|
3743
|
-
],
|
|
3744
|
-
"burlywood": [
|
|
3745
|
-
222,
|
|
3746
|
-
184,
|
|
3747
|
-
135
|
|
3748
|
-
],
|
|
3749
|
-
"cadetblue": [
|
|
3750
|
-
95,
|
|
3751
|
-
158,
|
|
3752
|
-
160
|
|
3753
|
-
],
|
|
3754
|
-
"chartreuse": [
|
|
3755
|
-
127,
|
|
3756
|
-
255,
|
|
3757
|
-
0
|
|
3758
|
-
],
|
|
3759
|
-
"chocolate": [
|
|
3760
|
-
210,
|
|
3761
|
-
105,
|
|
3762
|
-
30
|
|
3763
|
-
],
|
|
3764
|
-
"coral": [
|
|
3765
|
-
255,
|
|
3766
|
-
127,
|
|
3767
|
-
80
|
|
3768
|
-
],
|
|
3769
|
-
"cornflowerblue": [
|
|
3770
|
-
100,
|
|
3771
|
-
149,
|
|
3772
|
-
237
|
|
3773
|
-
],
|
|
3774
|
-
"cornsilk": [
|
|
3775
|
-
255,
|
|
3776
|
-
248,
|
|
3777
|
-
220
|
|
3778
|
-
],
|
|
3779
|
-
"crimson": [
|
|
3780
|
-
220,
|
|
3781
|
-
20,
|
|
3782
|
-
60
|
|
3783
|
-
],
|
|
3784
|
-
"cyan": [
|
|
3785
|
-
0,
|
|
3786
|
-
255,
|
|
3787
|
-
255
|
|
3788
|
-
],
|
|
3789
|
-
"darkblue": [
|
|
3790
|
-
0,
|
|
3791
|
-
0,
|
|
3792
|
-
139
|
|
3793
|
-
],
|
|
3794
|
-
"darkcyan": [
|
|
3795
|
-
0,
|
|
3796
|
-
139,
|
|
3797
|
-
139
|
|
3798
|
-
],
|
|
3799
|
-
"darkgoldenrod": [
|
|
3800
|
-
184,
|
|
3801
|
-
134,
|
|
3802
|
-
11
|
|
3803
|
-
],
|
|
3804
|
-
"darkgray": [
|
|
3805
|
-
169,
|
|
3806
|
-
169,
|
|
3807
|
-
169
|
|
3808
|
-
],
|
|
3809
|
-
"darkgreen": [
|
|
3810
|
-
0,
|
|
3811
|
-
100,
|
|
3812
|
-
0
|
|
3813
|
-
],
|
|
3814
|
-
"darkgrey": [
|
|
3815
|
-
169,
|
|
3816
|
-
169,
|
|
3817
|
-
169
|
|
3818
|
-
],
|
|
3819
|
-
"darkkhaki": [
|
|
3820
|
-
189,
|
|
3821
|
-
183,
|
|
3822
|
-
107
|
|
3823
|
-
],
|
|
3824
|
-
"darkmagenta": [
|
|
3825
|
-
139,
|
|
3826
|
-
0,
|
|
3827
|
-
139
|
|
3828
|
-
],
|
|
3829
|
-
"darkolivegreen": [
|
|
3830
|
-
85,
|
|
3831
|
-
107,
|
|
3832
|
-
47
|
|
3833
|
-
],
|
|
3834
|
-
"darkorange": [
|
|
3835
|
-
255,
|
|
3836
|
-
140,
|
|
3837
|
-
0
|
|
3838
|
-
],
|
|
3839
|
-
"darkorchid": [
|
|
3840
|
-
153,
|
|
3841
|
-
50,
|
|
3842
|
-
204
|
|
3843
|
-
],
|
|
3844
|
-
"darkred": [
|
|
3845
|
-
139,
|
|
3846
|
-
0,
|
|
3847
|
-
0
|
|
3848
|
-
],
|
|
3849
|
-
"darksalmon": [
|
|
3850
|
-
233,
|
|
3851
|
-
150,
|
|
3852
|
-
122
|
|
3853
|
-
],
|
|
3854
|
-
"darkseagreen": [
|
|
3855
|
-
143,
|
|
3856
|
-
188,
|
|
3857
|
-
143
|
|
3858
|
-
],
|
|
3859
|
-
"darkslateblue": [
|
|
3860
|
-
72,
|
|
3861
|
-
61,
|
|
3862
|
-
139
|
|
3863
|
-
],
|
|
3864
|
-
"darkslategray": [
|
|
3865
|
-
47,
|
|
3866
|
-
79,
|
|
3867
|
-
79
|
|
3868
|
-
],
|
|
3869
|
-
"darkslategrey": [
|
|
3870
|
-
47,
|
|
3871
|
-
79,
|
|
3872
|
-
79
|
|
3873
|
-
],
|
|
3874
|
-
"darkturquoise": [
|
|
3875
|
-
0,
|
|
3876
|
-
206,
|
|
3877
|
-
209
|
|
3878
|
-
],
|
|
3879
|
-
"darkviolet": [
|
|
3880
|
-
148,
|
|
3881
|
-
0,
|
|
3882
|
-
211
|
|
3883
|
-
],
|
|
3884
|
-
"deeppink": [
|
|
3885
|
-
255,
|
|
3886
|
-
20,
|
|
3887
|
-
147
|
|
3888
|
-
],
|
|
3889
|
-
"deepskyblue": [
|
|
3890
|
-
0,
|
|
3891
|
-
191,
|
|
3892
|
-
255
|
|
3893
|
-
],
|
|
3894
|
-
"dimgray": [
|
|
3895
|
-
105,
|
|
3896
|
-
105,
|
|
3897
|
-
105
|
|
3898
|
-
],
|
|
3899
|
-
"dimgrey": [
|
|
3900
|
-
105,
|
|
3901
|
-
105,
|
|
3902
|
-
105
|
|
3903
|
-
],
|
|
3904
|
-
"dodgerblue": [
|
|
3905
|
-
30,
|
|
3906
|
-
144,
|
|
3907
|
-
255
|
|
3908
|
-
],
|
|
3909
|
-
"firebrick": [
|
|
3910
|
-
178,
|
|
3911
|
-
34,
|
|
3912
|
-
34
|
|
3913
|
-
],
|
|
3914
|
-
"floralwhite": [
|
|
3915
|
-
255,
|
|
3916
|
-
250,
|
|
3917
|
-
240
|
|
3918
|
-
],
|
|
3919
|
-
"forestgreen": [
|
|
3920
|
-
34,
|
|
3921
|
-
139,
|
|
3922
|
-
34
|
|
3923
|
-
],
|
|
3924
|
-
"fuchsia": [
|
|
3925
|
-
255,
|
|
3926
|
-
0,
|
|
3927
|
-
255
|
|
3928
|
-
],
|
|
3929
|
-
"gainsboro": [
|
|
3930
|
-
220,
|
|
3931
|
-
220,
|
|
3932
|
-
220
|
|
3933
|
-
],
|
|
3934
|
-
"ghostwhite": [
|
|
3935
|
-
248,
|
|
3936
|
-
248,
|
|
3937
|
-
255
|
|
3938
|
-
],
|
|
3939
|
-
"gold": [
|
|
3940
|
-
255,
|
|
3941
|
-
215,
|
|
3942
|
-
0
|
|
3943
|
-
],
|
|
3944
|
-
"goldenrod": [
|
|
3945
|
-
218,
|
|
3946
|
-
165,
|
|
3947
|
-
32
|
|
3948
|
-
],
|
|
3949
|
-
"gray": [
|
|
3950
|
-
128,
|
|
3951
|
-
128,
|
|
3952
|
-
128
|
|
3953
|
-
],
|
|
3954
|
-
"green": [
|
|
3955
|
-
0,
|
|
3956
|
-
128,
|
|
3957
|
-
0
|
|
3958
|
-
],
|
|
3959
|
-
"greenyellow": [
|
|
3960
|
-
173,
|
|
3961
|
-
255,
|
|
3962
|
-
47
|
|
3963
|
-
],
|
|
3964
|
-
"grey": [
|
|
3965
|
-
128,
|
|
3966
|
-
128,
|
|
3967
|
-
128
|
|
3968
|
-
],
|
|
3969
|
-
"honeydew": [
|
|
3970
|
-
240,
|
|
3971
|
-
255,
|
|
3972
|
-
240
|
|
3973
|
-
],
|
|
3974
|
-
"hotpink": [
|
|
3975
|
-
255,
|
|
3976
|
-
105,
|
|
3977
|
-
180
|
|
3978
|
-
],
|
|
3979
|
-
"indianred": [
|
|
3980
|
-
205,
|
|
3981
|
-
92,
|
|
3982
|
-
92
|
|
3983
|
-
],
|
|
3984
|
-
"indigo": [
|
|
3985
|
-
75,
|
|
3986
|
-
0,
|
|
3987
|
-
130
|
|
3988
|
-
],
|
|
3989
|
-
"ivory": [
|
|
3990
|
-
255,
|
|
3991
|
-
255,
|
|
3992
|
-
240
|
|
3993
|
-
],
|
|
3994
|
-
"khaki": [
|
|
3995
|
-
240,
|
|
3996
|
-
230,
|
|
3997
|
-
140
|
|
3998
|
-
],
|
|
3999
|
-
"lavender": [
|
|
4000
|
-
230,
|
|
4001
|
-
230,
|
|
4002
|
-
250
|
|
4003
|
-
],
|
|
4004
|
-
"lavenderblush": [
|
|
4005
|
-
255,
|
|
4006
|
-
240,
|
|
4007
|
-
245
|
|
4008
|
-
],
|
|
4009
|
-
"lawngreen": [
|
|
4010
|
-
124,
|
|
4011
|
-
252,
|
|
4012
|
-
0
|
|
4013
|
-
],
|
|
4014
|
-
"lemonchiffon": [
|
|
4015
|
-
255,
|
|
4016
|
-
250,
|
|
4017
|
-
205
|
|
4018
|
-
],
|
|
4019
|
-
"lightblue": [
|
|
4020
|
-
173,
|
|
4021
|
-
216,
|
|
4022
|
-
230
|
|
4023
|
-
],
|
|
4024
|
-
"lightcoral": [
|
|
4025
|
-
240,
|
|
4026
|
-
128,
|
|
4027
|
-
128
|
|
4028
|
-
],
|
|
4029
|
-
"lightcyan": [
|
|
4030
|
-
224,
|
|
4031
|
-
255,
|
|
4032
|
-
255
|
|
4033
|
-
],
|
|
4034
|
-
"lightgoldenrodyellow": [
|
|
4035
|
-
250,
|
|
4036
|
-
250,
|
|
4037
|
-
210
|
|
4038
|
-
],
|
|
4039
|
-
"lightgray": [
|
|
4040
|
-
211,
|
|
4041
|
-
211,
|
|
4042
|
-
211
|
|
4043
|
-
],
|
|
4044
|
-
"lightgreen": [
|
|
4045
|
-
144,
|
|
4046
|
-
238,
|
|
4047
|
-
144
|
|
4048
|
-
],
|
|
4049
|
-
"lightgrey": [
|
|
4050
|
-
211,
|
|
4051
|
-
211,
|
|
4052
|
-
211
|
|
4053
|
-
],
|
|
4054
|
-
"lightpink": [
|
|
4055
|
-
255,
|
|
4056
|
-
182,
|
|
4057
|
-
193
|
|
4058
|
-
],
|
|
4059
|
-
"lightsalmon": [
|
|
4060
|
-
255,
|
|
4061
|
-
160,
|
|
4062
|
-
122
|
|
4063
|
-
],
|
|
4064
|
-
"lightseagreen": [
|
|
4065
|
-
32,
|
|
4066
|
-
178,
|
|
4067
|
-
170
|
|
4068
|
-
],
|
|
4069
|
-
"lightskyblue": [
|
|
4070
|
-
135,
|
|
4071
|
-
206,
|
|
4072
|
-
250
|
|
4073
|
-
],
|
|
4074
|
-
"lightslategray": [
|
|
4075
|
-
119,
|
|
4076
|
-
136,
|
|
4077
|
-
153
|
|
4078
|
-
],
|
|
4079
|
-
"lightslategrey": [
|
|
4080
|
-
119,
|
|
4081
|
-
136,
|
|
4082
|
-
153
|
|
4083
|
-
],
|
|
4084
|
-
"lightsteelblue": [
|
|
4085
|
-
176,
|
|
4086
|
-
196,
|
|
4087
|
-
222
|
|
4088
|
-
],
|
|
4089
|
-
"lightyellow": [
|
|
4090
|
-
255,
|
|
4091
|
-
255,
|
|
4092
|
-
224
|
|
4093
|
-
],
|
|
4094
|
-
"lime": [
|
|
4095
|
-
0,
|
|
4096
|
-
255,
|
|
4097
|
-
0
|
|
4098
|
-
],
|
|
4099
|
-
"limegreen": [
|
|
4100
|
-
50,
|
|
4101
|
-
205,
|
|
4102
|
-
50
|
|
4103
|
-
],
|
|
4104
|
-
"linen": [
|
|
4105
|
-
250,
|
|
4106
|
-
240,
|
|
4107
|
-
230
|
|
4108
|
-
],
|
|
4109
|
-
"magenta": [
|
|
4110
|
-
255,
|
|
4111
|
-
0,
|
|
4112
|
-
255
|
|
4113
|
-
],
|
|
4114
|
-
"maroon": [
|
|
4115
|
-
128,
|
|
4116
|
-
0,
|
|
4117
|
-
0
|
|
4118
|
-
],
|
|
4119
|
-
"mediumaquamarine": [
|
|
4120
|
-
102,
|
|
4121
|
-
205,
|
|
4122
|
-
170
|
|
4123
|
-
],
|
|
4124
|
-
"mediumblue": [
|
|
4125
|
-
0,
|
|
4126
|
-
0,
|
|
4127
|
-
205
|
|
4128
|
-
],
|
|
4129
|
-
"mediumorchid": [
|
|
4130
|
-
186,
|
|
4131
|
-
85,
|
|
4132
|
-
211
|
|
4133
|
-
],
|
|
4134
|
-
"mediumpurple": [
|
|
4135
|
-
147,
|
|
4136
|
-
112,
|
|
4137
|
-
219
|
|
4138
|
-
],
|
|
4139
|
-
"mediumseagreen": [
|
|
4140
|
-
60,
|
|
4141
|
-
179,
|
|
4142
|
-
113
|
|
4143
|
-
],
|
|
4144
|
-
"mediumslateblue": [
|
|
4145
|
-
123,
|
|
4146
|
-
104,
|
|
4147
|
-
238
|
|
4148
|
-
],
|
|
4149
|
-
"mediumspringgreen": [
|
|
4150
|
-
0,
|
|
4151
|
-
250,
|
|
4152
|
-
154
|
|
4153
|
-
],
|
|
4154
|
-
"mediumturquoise": [
|
|
4155
|
-
72,
|
|
4156
|
-
209,
|
|
4157
|
-
204
|
|
4158
|
-
],
|
|
4159
|
-
"mediumvioletred": [
|
|
4160
|
-
199,
|
|
4161
|
-
21,
|
|
4162
|
-
133
|
|
4163
|
-
],
|
|
4164
|
-
"midnightblue": [
|
|
4165
|
-
25,
|
|
4166
|
-
25,
|
|
4167
|
-
112
|
|
4168
|
-
],
|
|
4169
|
-
"mintcream": [
|
|
4170
|
-
245,
|
|
4171
|
-
255,
|
|
4172
|
-
250
|
|
4173
|
-
],
|
|
4174
|
-
"mistyrose": [
|
|
4175
|
-
255,
|
|
4176
|
-
228,
|
|
4177
|
-
225
|
|
4178
|
-
],
|
|
4179
|
-
"moccasin": [
|
|
4180
|
-
255,
|
|
4181
|
-
228,
|
|
4182
|
-
181
|
|
4183
|
-
],
|
|
4184
|
-
"navajowhite": [
|
|
4185
|
-
255,
|
|
4186
|
-
222,
|
|
4187
|
-
173
|
|
4188
|
-
],
|
|
4189
|
-
"navy": [
|
|
4190
|
-
0,
|
|
4191
|
-
0,
|
|
4192
|
-
128
|
|
4193
|
-
],
|
|
4194
|
-
"oldlace": [
|
|
4195
|
-
253,
|
|
4196
|
-
245,
|
|
4197
|
-
230
|
|
4198
|
-
],
|
|
4199
|
-
"olive": [
|
|
4200
|
-
128,
|
|
4201
|
-
128,
|
|
4202
|
-
0
|
|
4203
|
-
],
|
|
4204
|
-
"olivedrab": [
|
|
4205
|
-
107,
|
|
4206
|
-
142,
|
|
4207
|
-
35
|
|
4208
|
-
],
|
|
4209
|
-
"orange": [
|
|
4210
|
-
255,
|
|
4211
|
-
165,
|
|
4212
|
-
0
|
|
4213
|
-
],
|
|
4214
|
-
"orangered": [
|
|
4215
|
-
255,
|
|
4216
|
-
69,
|
|
4217
|
-
0
|
|
4218
|
-
],
|
|
4219
|
-
"orchid": [
|
|
4220
|
-
218,
|
|
4221
|
-
112,
|
|
4222
|
-
214
|
|
4223
|
-
],
|
|
4224
|
-
"palegoldenrod": [
|
|
4225
|
-
238,
|
|
4226
|
-
232,
|
|
4227
|
-
170
|
|
4228
|
-
],
|
|
4229
|
-
"palegreen": [
|
|
4230
|
-
152,
|
|
4231
|
-
251,
|
|
4232
|
-
152
|
|
4233
|
-
],
|
|
4234
|
-
"paleturquoise": [
|
|
4235
|
-
175,
|
|
4236
|
-
238,
|
|
4237
|
-
238
|
|
4238
|
-
],
|
|
4239
|
-
"palevioletred": [
|
|
4240
|
-
219,
|
|
4241
|
-
112,
|
|
4242
|
-
147
|
|
4243
|
-
],
|
|
4244
|
-
"papayawhip": [
|
|
4245
|
-
255,
|
|
4246
|
-
239,
|
|
4247
|
-
213
|
|
4248
|
-
],
|
|
4249
|
-
"peachpuff": [
|
|
4250
|
-
255,
|
|
4251
|
-
218,
|
|
4252
|
-
185
|
|
4253
|
-
],
|
|
4254
|
-
"peru": [
|
|
4255
|
-
205,
|
|
4256
|
-
133,
|
|
4257
|
-
63
|
|
4258
|
-
],
|
|
4259
|
-
"pink": [
|
|
4260
|
-
255,
|
|
4261
|
-
192,
|
|
4262
|
-
203
|
|
4263
|
-
],
|
|
4264
|
-
"plum": [
|
|
4265
|
-
221,
|
|
4266
|
-
160,
|
|
4267
|
-
221
|
|
4268
|
-
],
|
|
4269
|
-
"powderblue": [
|
|
4270
|
-
176,
|
|
4271
|
-
224,
|
|
4272
|
-
230
|
|
4273
|
-
],
|
|
4274
|
-
"purple": [
|
|
4275
|
-
128,
|
|
4276
|
-
0,
|
|
4277
|
-
128
|
|
4278
|
-
],
|
|
4279
|
-
"rebeccapurple": [
|
|
4280
|
-
102,
|
|
4281
|
-
51,
|
|
4282
|
-
153
|
|
4283
|
-
],
|
|
4284
|
-
"red": [
|
|
4285
|
-
255,
|
|
4286
|
-
0,
|
|
4287
|
-
0
|
|
4288
|
-
],
|
|
4289
|
-
"rosybrown": [
|
|
4290
|
-
188,
|
|
4291
|
-
143,
|
|
4292
|
-
143
|
|
4293
|
-
],
|
|
4294
|
-
"royalblue": [
|
|
4295
|
-
65,
|
|
4296
|
-
105,
|
|
4297
|
-
225
|
|
4298
|
-
],
|
|
4299
|
-
"saddlebrown": [
|
|
4300
|
-
139,
|
|
4301
|
-
69,
|
|
4302
|
-
19
|
|
4303
|
-
],
|
|
4304
|
-
"salmon": [
|
|
4305
|
-
250,
|
|
4306
|
-
128,
|
|
4307
|
-
114
|
|
4308
|
-
],
|
|
4309
|
-
"sandybrown": [
|
|
4310
|
-
244,
|
|
4311
|
-
164,
|
|
4312
|
-
96
|
|
4313
|
-
],
|
|
4314
|
-
"seagreen": [
|
|
4315
|
-
46,
|
|
4316
|
-
139,
|
|
4317
|
-
87
|
|
4318
|
-
],
|
|
4319
|
-
"seashell": [
|
|
4320
|
-
255,
|
|
4321
|
-
245,
|
|
4322
|
-
238
|
|
4323
|
-
],
|
|
4324
|
-
"sienna": [
|
|
4325
|
-
160,
|
|
4326
|
-
82,
|
|
4327
|
-
45
|
|
4328
|
-
],
|
|
4329
|
-
"silver": [
|
|
4330
|
-
192,
|
|
4331
|
-
192,
|
|
4332
|
-
192
|
|
4333
|
-
],
|
|
4334
|
-
"skyblue": [
|
|
4335
|
-
135,
|
|
4336
|
-
206,
|
|
4337
|
-
235
|
|
4338
|
-
],
|
|
4339
|
-
"slateblue": [
|
|
4340
|
-
106,
|
|
4341
|
-
90,
|
|
4342
|
-
205
|
|
4343
|
-
],
|
|
4344
|
-
"slategray": [
|
|
4345
|
-
112,
|
|
4346
|
-
128,
|
|
4347
|
-
144
|
|
4348
|
-
],
|
|
4349
|
-
"slategrey": [
|
|
4350
|
-
112,
|
|
4351
|
-
128,
|
|
4352
|
-
144
|
|
4353
|
-
],
|
|
4354
|
-
"snow": [
|
|
4355
|
-
255,
|
|
4356
|
-
250,
|
|
4357
|
-
250
|
|
4358
|
-
],
|
|
4359
|
-
"springgreen": [
|
|
4360
|
-
0,
|
|
4361
|
-
255,
|
|
4362
|
-
127
|
|
4363
|
-
],
|
|
4364
|
-
"steelblue": [
|
|
4365
|
-
70,
|
|
4366
|
-
130,
|
|
4367
|
-
180
|
|
4368
|
-
],
|
|
4369
|
-
"tan": [
|
|
4370
|
-
210,
|
|
4371
|
-
180,
|
|
4372
|
-
140
|
|
4373
|
-
],
|
|
4374
|
-
"teal": [
|
|
4375
|
-
0,
|
|
4376
|
-
128,
|
|
4377
|
-
128
|
|
4378
|
-
],
|
|
4379
|
-
"thistle": [
|
|
4380
|
-
216,
|
|
4381
|
-
191,
|
|
4382
|
-
216
|
|
4383
|
-
],
|
|
4384
|
-
"tomato": [
|
|
4385
|
-
255,
|
|
4386
|
-
99,
|
|
4387
|
-
71
|
|
4388
|
-
],
|
|
4389
|
-
"turquoise": [
|
|
4390
|
-
64,
|
|
4391
|
-
224,
|
|
4392
|
-
208
|
|
4393
|
-
],
|
|
4394
|
-
"violet": [
|
|
4395
|
-
238,
|
|
4396
|
-
130,
|
|
4397
|
-
238
|
|
4398
|
-
],
|
|
4399
|
-
"wheat": [
|
|
4400
|
-
245,
|
|
4401
|
-
222,
|
|
4402
|
-
179
|
|
4403
|
-
],
|
|
4404
|
-
"white": [
|
|
4405
|
-
255,
|
|
4406
|
-
255,
|
|
4407
|
-
255
|
|
4408
|
-
],
|
|
4409
|
-
"whitesmoke": [
|
|
4410
|
-
245,
|
|
4411
|
-
245,
|
|
4412
|
-
245
|
|
4413
|
-
],
|
|
4414
|
-
"yellow": [
|
|
4415
|
-
255,
|
|
4416
|
-
255,
|
|
4417
|
-
0
|
|
4418
|
-
],
|
|
4419
|
-
"yellowgreen": [
|
|
4420
|
-
154,
|
|
4421
|
-
205,
|
|
4422
|
-
50
|
|
4423
|
-
]
|
|
4424
|
-
};
|
|
4425
|
-
}));
|
|
4426
|
-
var require_conversions = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
4427
|
-
var cssKeywords = require_color_name();
|
|
4428
|
-
var reverseKeywords = {};
|
|
4429
|
-
for (const key of Object.keys(cssKeywords)) reverseKeywords[cssKeywords[key]] = key;
|
|
4430
|
-
var convert = {
|
|
4431
|
-
rgb: {
|
|
4432
|
-
channels: 3,
|
|
4433
|
-
labels: "rgb"
|
|
4434
|
-
},
|
|
4435
|
-
hsl: {
|
|
4436
|
-
channels: 3,
|
|
4437
|
-
labels: "hsl"
|
|
4438
|
-
},
|
|
4439
|
-
hsv: {
|
|
4440
|
-
channels: 3,
|
|
4441
|
-
labels: "hsv"
|
|
4442
|
-
},
|
|
4443
|
-
hwb: {
|
|
4444
|
-
channels: 3,
|
|
4445
|
-
labels: "hwb"
|
|
4446
|
-
},
|
|
4447
|
-
cmyk: {
|
|
4448
|
-
channels: 4,
|
|
4449
|
-
labels: "cmyk"
|
|
4450
|
-
},
|
|
4451
|
-
xyz: {
|
|
4452
|
-
channels: 3,
|
|
4453
|
-
labels: "xyz"
|
|
4454
|
-
},
|
|
4455
|
-
lab: {
|
|
4456
|
-
channels: 3,
|
|
4457
|
-
labels: "lab"
|
|
4458
|
-
},
|
|
4459
|
-
lch: {
|
|
4460
|
-
channels: 3,
|
|
4461
|
-
labels: "lch"
|
|
4462
|
-
},
|
|
4463
|
-
hex: {
|
|
4464
|
-
channels: 1,
|
|
4465
|
-
labels: ["hex"]
|
|
4466
|
-
},
|
|
4467
|
-
keyword: {
|
|
4468
|
-
channels: 1,
|
|
4469
|
-
labels: ["keyword"]
|
|
4470
|
-
},
|
|
4471
|
-
ansi16: {
|
|
4472
|
-
channels: 1,
|
|
4473
|
-
labels: ["ansi16"]
|
|
4474
|
-
},
|
|
4475
|
-
ansi256: {
|
|
4476
|
-
channels: 1,
|
|
4477
|
-
labels: ["ansi256"]
|
|
4478
|
-
},
|
|
4479
|
-
hcg: {
|
|
4480
|
-
channels: 3,
|
|
4481
|
-
labels: [
|
|
4482
|
-
"h",
|
|
4483
|
-
"c",
|
|
4484
|
-
"g"
|
|
4485
|
-
]
|
|
4486
|
-
},
|
|
4487
|
-
apple: {
|
|
4488
|
-
channels: 3,
|
|
4489
|
-
labels: [
|
|
4490
|
-
"r16",
|
|
4491
|
-
"g16",
|
|
4492
|
-
"b16"
|
|
4493
|
-
]
|
|
4494
|
-
},
|
|
4495
|
-
gray: {
|
|
4496
|
-
channels: 1,
|
|
4497
|
-
labels: ["gray"]
|
|
4498
|
-
}
|
|
4499
|
-
};
|
|
4500
|
-
module.exports = convert;
|
|
4501
|
-
for (const model of Object.keys(convert)) {
|
|
4502
|
-
if (!("channels" in convert[model])) throw new Error("missing channels property: " + model);
|
|
4503
|
-
if (!("labels" in convert[model])) throw new Error("missing channel labels property: " + model);
|
|
4504
|
-
if (convert[model].labels.length !== convert[model].channels) throw new Error("channel and label counts mismatch: " + model);
|
|
4505
|
-
const { channels, labels } = convert[model];
|
|
4506
|
-
delete convert[model].channels;
|
|
4507
|
-
delete convert[model].labels;
|
|
4508
|
-
Object.defineProperty(convert[model], "channels", { value: channels });
|
|
4509
|
-
Object.defineProperty(convert[model], "labels", { value: labels });
|
|
4510
|
-
}
|
|
4511
|
-
convert.rgb.hsl = function(rgb) {
|
|
4512
|
-
const r = rgb[0] / 255;
|
|
4513
|
-
const g = rgb[1] / 255;
|
|
4514
|
-
const b = rgb[2] / 255;
|
|
4515
|
-
const min = Math.min(r, g, b);
|
|
4516
|
-
const max = Math.max(r, g, b);
|
|
4517
|
-
const delta = max - min;
|
|
4518
|
-
let h;
|
|
4519
|
-
let s;
|
|
4520
|
-
if (max === min) h = 0;
|
|
4521
|
-
else if (r === max) h = (g - b) / delta;
|
|
4522
|
-
else if (g === max) h = 2 + (b - r) / delta;
|
|
4523
|
-
else if (b === max) h = 4 + (r - g) / delta;
|
|
4524
|
-
h = Math.min(h * 60, 360);
|
|
4525
|
-
if (h < 0) h += 360;
|
|
4526
|
-
const l = (min + max) / 2;
|
|
4527
|
-
if (max === min) s = 0;
|
|
4528
|
-
else if (l <= .5) s = delta / (max + min);
|
|
4529
|
-
else s = delta / (2 - max - min);
|
|
4530
|
-
return [
|
|
4531
|
-
h,
|
|
4532
|
-
s * 100,
|
|
4533
|
-
l * 100
|
|
4534
|
-
];
|
|
4535
|
-
};
|
|
4536
|
-
convert.rgb.hsv = function(rgb) {
|
|
4537
|
-
let rdif;
|
|
4538
|
-
let gdif;
|
|
4539
|
-
let bdif;
|
|
4540
|
-
let h;
|
|
4541
|
-
let s;
|
|
4542
|
-
const r = rgb[0] / 255;
|
|
4543
|
-
const g = rgb[1] / 255;
|
|
4544
|
-
const b = rgb[2] / 255;
|
|
4545
|
-
const v = Math.max(r, g, b);
|
|
4546
|
-
const diff = v - Math.min(r, g, b);
|
|
4547
|
-
const diffc = function(c) {
|
|
4548
|
-
return (v - c) / 6 / diff + 1 / 2;
|
|
4549
|
-
};
|
|
4550
|
-
if (diff === 0) {
|
|
4551
|
-
h = 0;
|
|
4552
|
-
s = 0;
|
|
4553
|
-
} else {
|
|
4554
|
-
s = diff / v;
|
|
4555
|
-
rdif = diffc(r);
|
|
4556
|
-
gdif = diffc(g);
|
|
4557
|
-
bdif = diffc(b);
|
|
4558
|
-
if (r === v) h = bdif - gdif;
|
|
4559
|
-
else if (g === v) h = 1 / 3 + rdif - bdif;
|
|
4560
|
-
else if (b === v) h = 2 / 3 + gdif - rdif;
|
|
4561
|
-
if (h < 0) h += 1;
|
|
4562
|
-
else if (h > 1) h -= 1;
|
|
4563
|
-
}
|
|
4564
|
-
return [
|
|
4565
|
-
h * 360,
|
|
4566
|
-
s * 100,
|
|
4567
|
-
v * 100
|
|
4568
|
-
];
|
|
4569
|
-
};
|
|
4570
|
-
convert.rgb.hwb = function(rgb) {
|
|
4571
|
-
const r = rgb[0];
|
|
4572
|
-
const g = rgb[1];
|
|
4573
|
-
let b = rgb[2];
|
|
4574
|
-
const h = convert.rgb.hsl(rgb)[0];
|
|
4575
|
-
const w = 1 / 255 * Math.min(r, Math.min(g, b));
|
|
4576
|
-
b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
|
|
4577
|
-
return [
|
|
4578
|
-
h,
|
|
4579
|
-
w * 100,
|
|
4580
|
-
b * 100
|
|
4581
|
-
];
|
|
4582
|
-
};
|
|
4583
|
-
convert.rgb.cmyk = function(rgb) {
|
|
4584
|
-
const r = rgb[0] / 255;
|
|
4585
|
-
const g = rgb[1] / 255;
|
|
4586
|
-
const b = rgb[2] / 255;
|
|
4587
|
-
const k = Math.min(1 - r, 1 - g, 1 - b);
|
|
4588
|
-
const c = (1 - r - k) / (1 - k) || 0;
|
|
4589
|
-
const m = (1 - g - k) / (1 - k) || 0;
|
|
4590
|
-
const y = (1 - b - k) / (1 - k) || 0;
|
|
4591
|
-
return [
|
|
4592
|
-
c * 100,
|
|
4593
|
-
m * 100,
|
|
4594
|
-
y * 100,
|
|
4595
|
-
k * 100
|
|
4596
|
-
];
|
|
4597
|
-
};
|
|
4598
|
-
function comparativeDistance(x, y) {
|
|
4599
|
-
return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
|
|
4600
|
-
}
|
|
4601
|
-
convert.rgb.keyword = function(rgb) {
|
|
4602
|
-
const reversed = reverseKeywords[rgb];
|
|
4603
|
-
if (reversed) return reversed;
|
|
4604
|
-
let currentClosestDistance = Infinity;
|
|
4605
|
-
let currentClosestKeyword;
|
|
4606
|
-
for (const keyword of Object.keys(cssKeywords)) {
|
|
4607
|
-
const value = cssKeywords[keyword];
|
|
4608
|
-
const distance = comparativeDistance(rgb, value);
|
|
4609
|
-
if (distance < currentClosestDistance) {
|
|
4610
|
-
currentClosestDistance = distance;
|
|
4611
|
-
currentClosestKeyword = keyword;
|
|
4612
|
-
}
|
|
4613
|
-
}
|
|
4614
|
-
return currentClosestKeyword;
|
|
4615
|
-
};
|
|
4616
|
-
convert.keyword.rgb = function(keyword) {
|
|
4617
|
-
return cssKeywords[keyword];
|
|
4618
|
-
};
|
|
4619
|
-
convert.rgb.xyz = function(rgb) {
|
|
4620
|
-
let r = rgb[0] / 255;
|
|
4621
|
-
let g = rgb[1] / 255;
|
|
4622
|
-
let b = rgb[2] / 255;
|
|
4623
|
-
r = r > .04045 ? ((r + .055) / 1.055) ** 2.4 : r / 12.92;
|
|
4624
|
-
g = g > .04045 ? ((g + .055) / 1.055) ** 2.4 : g / 12.92;
|
|
4625
|
-
b = b > .04045 ? ((b + .055) / 1.055) ** 2.4 : b / 12.92;
|
|
4626
|
-
const x = r * .4124 + g * .3576 + b * .1805;
|
|
4627
|
-
const y = r * .2126 + g * .7152 + b * .0722;
|
|
4628
|
-
const z = r * .0193 + g * .1192 + b * .9505;
|
|
4629
|
-
return [
|
|
4630
|
-
x * 100,
|
|
4631
|
-
y * 100,
|
|
4632
|
-
z * 100
|
|
4633
|
-
];
|
|
4634
|
-
};
|
|
4635
|
-
convert.rgb.lab = function(rgb) {
|
|
4636
|
-
const xyz = convert.rgb.xyz(rgb);
|
|
4637
|
-
let x = xyz[0];
|
|
4638
|
-
let y = xyz[1];
|
|
4639
|
-
let z = xyz[2];
|
|
4640
|
-
x /= 95.047;
|
|
4641
|
-
y /= 100;
|
|
4642
|
-
z /= 108.883;
|
|
4643
|
-
x = x > .008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
4644
|
-
y = y > .008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
4645
|
-
z = z > .008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
4646
|
-
return [
|
|
4647
|
-
116 * y - 16,
|
|
4648
|
-
500 * (x - y),
|
|
4649
|
-
200 * (y - z)
|
|
4650
|
-
];
|
|
4651
|
-
};
|
|
4652
|
-
convert.hsl.rgb = function(hsl) {
|
|
4653
|
-
const h = hsl[0] / 360;
|
|
4654
|
-
const s = hsl[1] / 100;
|
|
4655
|
-
const l = hsl[2] / 100;
|
|
4656
|
-
let t2;
|
|
4657
|
-
let t3;
|
|
4658
|
-
let val;
|
|
4659
|
-
if (s === 0) {
|
|
4660
|
-
val = l * 255;
|
|
4661
|
-
return [
|
|
4662
|
-
val,
|
|
4663
|
-
val,
|
|
4664
|
-
val
|
|
4665
|
-
];
|
|
4666
|
-
}
|
|
4667
|
-
if (l < .5) t2 = l * (1 + s);
|
|
4668
|
-
else t2 = l + s - l * s;
|
|
4669
|
-
const t1 = 2 * l - t2;
|
|
4670
|
-
const rgb = [
|
|
4671
|
-
0,
|
|
4672
|
-
0,
|
|
4673
|
-
0
|
|
4674
|
-
];
|
|
4675
|
-
for (let i = 0; i < 3; i++) {
|
|
4676
|
-
t3 = h + 1 / 3 * -(i - 1);
|
|
4677
|
-
if (t3 < 0) t3++;
|
|
4678
|
-
if (t3 > 1) t3--;
|
|
4679
|
-
if (6 * t3 < 1) val = t1 + (t2 - t1) * 6 * t3;
|
|
4680
|
-
else if (2 * t3 < 1) val = t2;
|
|
4681
|
-
else if (3 * t3 < 2) val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
|
4682
|
-
else val = t1;
|
|
4683
|
-
rgb[i] = val * 255;
|
|
4684
|
-
}
|
|
4685
|
-
return rgb;
|
|
4686
|
-
};
|
|
4687
|
-
convert.hsl.hsv = function(hsl) {
|
|
4688
|
-
const h = hsl[0];
|
|
4689
|
-
let s = hsl[1] / 100;
|
|
4690
|
-
let l = hsl[2] / 100;
|
|
4691
|
-
let smin = s;
|
|
4692
|
-
const lmin = Math.max(l, .01);
|
|
4693
|
-
l *= 2;
|
|
4694
|
-
s *= l <= 1 ? l : 2 - l;
|
|
4695
|
-
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
4696
|
-
const v = (l + s) / 2;
|
|
4697
|
-
return [
|
|
4698
|
-
h,
|
|
4699
|
-
(l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s)) * 100,
|
|
4700
|
-
v * 100
|
|
4701
|
-
];
|
|
4702
|
-
};
|
|
4703
|
-
convert.hsv.rgb = function(hsv) {
|
|
4704
|
-
const h = hsv[0] / 60;
|
|
4705
|
-
const s = hsv[1] / 100;
|
|
4706
|
-
let v = hsv[2] / 100;
|
|
4707
|
-
const hi = Math.floor(h) % 6;
|
|
4708
|
-
const f = h - Math.floor(h);
|
|
4709
|
-
const p = 255 * v * (1 - s);
|
|
4710
|
-
const q = 255 * v * (1 - s * f);
|
|
4711
|
-
const t = 255 * v * (1 - s * (1 - f));
|
|
4712
|
-
v *= 255;
|
|
4713
|
-
switch (hi) {
|
|
4714
|
-
case 0: return [
|
|
4715
|
-
v,
|
|
4716
|
-
t,
|
|
4717
|
-
p
|
|
4718
|
-
];
|
|
4719
|
-
case 1: return [
|
|
4720
|
-
q,
|
|
4721
|
-
v,
|
|
4722
|
-
p
|
|
4723
|
-
];
|
|
4724
|
-
case 2: return [
|
|
4725
|
-
p,
|
|
4726
|
-
v,
|
|
4727
|
-
t
|
|
4728
|
-
];
|
|
4729
|
-
case 3: return [
|
|
4730
|
-
p,
|
|
4731
|
-
q,
|
|
4732
|
-
v
|
|
4733
|
-
];
|
|
4734
|
-
case 4: return [
|
|
4735
|
-
t,
|
|
4736
|
-
p,
|
|
4737
|
-
v
|
|
4738
|
-
];
|
|
4739
|
-
case 5: return [
|
|
4740
|
-
v,
|
|
4741
|
-
p,
|
|
4742
|
-
q
|
|
4743
|
-
];
|
|
4744
|
-
}
|
|
4745
|
-
};
|
|
4746
|
-
convert.hsv.hsl = function(hsv) {
|
|
4747
|
-
const h = hsv[0];
|
|
4748
|
-
const s = hsv[1] / 100;
|
|
4749
|
-
const v = hsv[2] / 100;
|
|
4750
|
-
const vmin = Math.max(v, .01);
|
|
4751
|
-
let sl;
|
|
4752
|
-
let l;
|
|
4753
|
-
l = (2 - s) * v;
|
|
4754
|
-
const lmin = (2 - s) * vmin;
|
|
4755
|
-
sl = s * vmin;
|
|
4756
|
-
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
4757
|
-
sl = sl || 0;
|
|
4758
|
-
l /= 2;
|
|
4759
|
-
return [
|
|
4760
|
-
h,
|
|
4761
|
-
sl * 100,
|
|
4762
|
-
l * 100
|
|
4763
|
-
];
|
|
4764
|
-
};
|
|
4765
|
-
convert.hwb.rgb = function(hwb) {
|
|
4766
|
-
const h = hwb[0] / 360;
|
|
4767
|
-
let wh = hwb[1] / 100;
|
|
4768
|
-
let bl = hwb[2] / 100;
|
|
4769
|
-
const ratio = wh + bl;
|
|
4770
|
-
let f;
|
|
4771
|
-
if (ratio > 1) {
|
|
4772
|
-
wh /= ratio;
|
|
4773
|
-
bl /= ratio;
|
|
4774
|
-
}
|
|
4775
|
-
const i = Math.floor(6 * h);
|
|
4776
|
-
const v = 1 - bl;
|
|
4777
|
-
f = 6 * h - i;
|
|
4778
|
-
if ((i & 1) !== 0) f = 1 - f;
|
|
4779
|
-
const n = wh + f * (v - wh);
|
|
4780
|
-
let r;
|
|
4781
|
-
let g;
|
|
4782
|
-
let b;
|
|
4783
|
-
switch (i) {
|
|
4784
|
-
default:
|
|
4785
|
-
case 6:
|
|
4786
|
-
case 0:
|
|
4787
|
-
r = v;
|
|
4788
|
-
g = n;
|
|
4789
|
-
b = wh;
|
|
4790
|
-
break;
|
|
4791
|
-
case 1:
|
|
4792
|
-
r = n;
|
|
4793
|
-
g = v;
|
|
4794
|
-
b = wh;
|
|
4795
|
-
break;
|
|
4796
|
-
case 2:
|
|
4797
|
-
r = wh;
|
|
4798
|
-
g = v;
|
|
4799
|
-
b = n;
|
|
4800
|
-
break;
|
|
4801
|
-
case 3:
|
|
4802
|
-
r = wh;
|
|
4803
|
-
g = n;
|
|
4804
|
-
b = v;
|
|
4805
|
-
break;
|
|
4806
|
-
case 4:
|
|
4807
|
-
r = n;
|
|
4808
|
-
g = wh;
|
|
4809
|
-
b = v;
|
|
4810
|
-
break;
|
|
4811
|
-
case 5:
|
|
4812
|
-
r = v;
|
|
4813
|
-
g = wh;
|
|
4814
|
-
b = n;
|
|
4815
|
-
break;
|
|
4816
|
-
}
|
|
4817
|
-
return [
|
|
4818
|
-
r * 255,
|
|
4819
|
-
g * 255,
|
|
4820
|
-
b * 255
|
|
4821
|
-
];
|
|
4822
|
-
};
|
|
4823
|
-
convert.cmyk.rgb = function(cmyk) {
|
|
4824
|
-
const c = cmyk[0] / 100;
|
|
4825
|
-
const m = cmyk[1] / 100;
|
|
4826
|
-
const y = cmyk[2] / 100;
|
|
4827
|
-
const k = cmyk[3] / 100;
|
|
4828
|
-
const r = 1 - Math.min(1, c * (1 - k) + k);
|
|
4829
|
-
const g = 1 - Math.min(1, m * (1 - k) + k);
|
|
4830
|
-
const b = 1 - Math.min(1, y * (1 - k) + k);
|
|
4831
|
-
return [
|
|
4832
|
-
r * 255,
|
|
4833
|
-
g * 255,
|
|
4834
|
-
b * 255
|
|
4835
|
-
];
|
|
4836
|
-
};
|
|
4837
|
-
convert.xyz.rgb = function(xyz) {
|
|
4838
|
-
const x = xyz[0] / 100;
|
|
4839
|
-
const y = xyz[1] / 100;
|
|
4840
|
-
const z = xyz[2] / 100;
|
|
4841
|
-
let r;
|
|
4842
|
-
let g;
|
|
4843
|
-
let b;
|
|
4844
|
-
r = x * 3.2406 + y * -1.5372 + z * -.4986;
|
|
4845
|
-
g = x * -.9689 + y * 1.8758 + z * .0415;
|
|
4846
|
-
b = x * .0557 + y * -.204 + z * 1.057;
|
|
4847
|
-
r = r > .0031308 ? 1.055 * r ** (1 / 2.4) - .055 : r * 12.92;
|
|
4848
|
-
g = g > .0031308 ? 1.055 * g ** (1 / 2.4) - .055 : g * 12.92;
|
|
4849
|
-
b = b > .0031308 ? 1.055 * b ** (1 / 2.4) - .055 : b * 12.92;
|
|
4850
|
-
r = Math.min(Math.max(0, r), 1);
|
|
4851
|
-
g = Math.min(Math.max(0, g), 1);
|
|
4852
|
-
b = Math.min(Math.max(0, b), 1);
|
|
4853
|
-
return [
|
|
4854
|
-
r * 255,
|
|
4855
|
-
g * 255,
|
|
4856
|
-
b * 255
|
|
4857
|
-
];
|
|
4858
|
-
};
|
|
4859
|
-
convert.xyz.lab = function(xyz) {
|
|
4860
|
-
let x = xyz[0];
|
|
4861
|
-
let y = xyz[1];
|
|
4862
|
-
let z = xyz[2];
|
|
4863
|
-
x /= 95.047;
|
|
4864
|
-
y /= 100;
|
|
4865
|
-
z /= 108.883;
|
|
4866
|
-
x = x > .008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
4867
|
-
y = y > .008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
4868
|
-
z = z > .008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
4869
|
-
return [
|
|
4870
|
-
116 * y - 16,
|
|
4871
|
-
500 * (x - y),
|
|
4872
|
-
200 * (y - z)
|
|
4873
|
-
];
|
|
4874
|
-
};
|
|
4875
|
-
convert.lab.xyz = function(lab) {
|
|
4876
|
-
const l = lab[0];
|
|
4877
|
-
const a = lab[1];
|
|
4878
|
-
const b = lab[2];
|
|
4879
|
-
let x;
|
|
4880
|
-
let y;
|
|
4881
|
-
let z;
|
|
4882
|
-
y = (l + 16) / 116;
|
|
4883
|
-
x = a / 500 + y;
|
|
4884
|
-
z = y - b / 200;
|
|
4885
|
-
const y2 = y ** 3;
|
|
4886
|
-
const x2 = x ** 3;
|
|
4887
|
-
const z2 = z ** 3;
|
|
4888
|
-
y = y2 > .008856 ? y2 : (y - 16 / 116) / 7.787;
|
|
4889
|
-
x = x2 > .008856 ? x2 : (x - 16 / 116) / 7.787;
|
|
4890
|
-
z = z2 > .008856 ? z2 : (z - 16 / 116) / 7.787;
|
|
4891
|
-
x *= 95.047;
|
|
4892
|
-
y *= 100;
|
|
4893
|
-
z *= 108.883;
|
|
4894
|
-
return [
|
|
4895
|
-
x,
|
|
4896
|
-
y,
|
|
4897
|
-
z
|
|
4898
|
-
];
|
|
4899
|
-
};
|
|
4900
|
-
convert.lab.lch = function(lab) {
|
|
4901
|
-
const l = lab[0];
|
|
4902
|
-
const a = lab[1];
|
|
4903
|
-
const b = lab[2];
|
|
4904
|
-
let h;
|
|
4905
|
-
h = Math.atan2(b, a) * 360 / 2 / Math.PI;
|
|
4906
|
-
if (h < 0) h += 360;
|
|
4907
|
-
return [
|
|
4908
|
-
l,
|
|
4909
|
-
Math.sqrt(a * a + b * b),
|
|
4910
|
-
h
|
|
4911
|
-
];
|
|
4912
|
-
};
|
|
4913
|
-
convert.lch.lab = function(lch) {
|
|
4914
|
-
const l = lch[0];
|
|
4915
|
-
const c = lch[1];
|
|
4916
|
-
const hr = lch[2] / 360 * 2 * Math.PI;
|
|
4917
|
-
return [
|
|
4918
|
-
l,
|
|
4919
|
-
c * Math.cos(hr),
|
|
4920
|
-
c * Math.sin(hr)
|
|
4921
|
-
];
|
|
4922
|
-
};
|
|
4923
|
-
convert.rgb.ansi16 = function(args, saturation = null) {
|
|
4924
|
-
const [r, g, b] = args;
|
|
4925
|
-
let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
|
|
4926
|
-
value = Math.round(value / 50);
|
|
4927
|
-
if (value === 0) return 30;
|
|
4928
|
-
let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
|
|
4929
|
-
if (value === 2) ansi += 60;
|
|
4930
|
-
return ansi;
|
|
4931
|
-
};
|
|
4932
|
-
convert.hsv.ansi16 = function(args) {
|
|
4933
|
-
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
|
4934
|
-
};
|
|
4935
|
-
convert.rgb.ansi256 = function(args) {
|
|
4936
|
-
const r = args[0];
|
|
4937
|
-
const g = args[1];
|
|
4938
|
-
const b = args[2];
|
|
4939
|
-
if (r === g && g === b) {
|
|
4940
|
-
if (r < 8) return 16;
|
|
4941
|
-
if (r > 248) return 231;
|
|
4942
|
-
return Math.round((r - 8) / 247 * 24) + 232;
|
|
4943
|
-
}
|
|
4944
|
-
return 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
|
|
4945
|
-
};
|
|
4946
|
-
convert.ansi16.rgb = function(args) {
|
|
4947
|
-
let color = args % 10;
|
|
4948
|
-
if (color === 0 || color === 7) {
|
|
4949
|
-
if (args > 50) color += 3.5;
|
|
4950
|
-
color = color / 10.5 * 255;
|
|
4951
|
-
return [
|
|
4952
|
-
color,
|
|
4953
|
-
color,
|
|
4954
|
-
color
|
|
4955
|
-
];
|
|
4956
|
-
}
|
|
4957
|
-
const mult = (~~(args > 50) + 1) * .5;
|
|
4958
|
-
return [
|
|
4959
|
-
(color & 1) * mult * 255,
|
|
4960
|
-
(color >> 1 & 1) * mult * 255,
|
|
4961
|
-
(color >> 2 & 1) * mult * 255
|
|
4962
|
-
];
|
|
4963
|
-
};
|
|
4964
|
-
convert.ansi256.rgb = function(args) {
|
|
4965
|
-
if (args >= 232) {
|
|
4966
|
-
const c = (args - 232) * 10 + 8;
|
|
4967
|
-
return [
|
|
4968
|
-
c,
|
|
4969
|
-
c,
|
|
4970
|
-
c
|
|
4971
|
-
];
|
|
4972
|
-
}
|
|
4973
|
-
args -= 16;
|
|
4974
|
-
let rem;
|
|
4975
|
-
return [
|
|
4976
|
-
Math.floor(args / 36) / 5 * 255,
|
|
4977
|
-
Math.floor((rem = args % 36) / 6) / 5 * 255,
|
|
4978
|
-
rem % 6 / 5 * 255
|
|
4979
|
-
];
|
|
4980
|
-
};
|
|
4981
|
-
convert.rgb.hex = function(args) {
|
|
4982
|
-
const string = (((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255)).toString(16).toUpperCase();
|
|
4983
|
-
return "000000".substring(string.length) + string;
|
|
4984
|
-
};
|
|
4985
|
-
convert.hex.rgb = function(args) {
|
|
4986
|
-
const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
4987
|
-
if (!match) return [
|
|
4988
|
-
0,
|
|
4989
|
-
0,
|
|
4990
|
-
0
|
|
4991
|
-
];
|
|
4992
|
-
let colorString = match[0];
|
|
4993
|
-
if (match[0].length === 3) colorString = colorString.split("").map((char) => {
|
|
4994
|
-
return char + char;
|
|
4995
|
-
}).join("");
|
|
4996
|
-
const integer = parseInt(colorString, 16);
|
|
4997
|
-
return [
|
|
4998
|
-
integer >> 16 & 255,
|
|
4999
|
-
integer >> 8 & 255,
|
|
5000
|
-
integer & 255
|
|
5001
|
-
];
|
|
5002
|
-
};
|
|
5003
|
-
convert.rgb.hcg = function(rgb) {
|
|
5004
|
-
const r = rgb[0] / 255;
|
|
5005
|
-
const g = rgb[1] / 255;
|
|
5006
|
-
const b = rgb[2] / 255;
|
|
5007
|
-
const max = Math.max(Math.max(r, g), b);
|
|
5008
|
-
const min = Math.min(Math.min(r, g), b);
|
|
5009
|
-
const chroma = max - min;
|
|
5010
|
-
let grayscale;
|
|
5011
|
-
let hue;
|
|
5012
|
-
if (chroma < 1) grayscale = min / (1 - chroma);
|
|
5013
|
-
else grayscale = 0;
|
|
5014
|
-
if (chroma <= 0) hue = 0;
|
|
5015
|
-
else if (max === r) hue = (g - b) / chroma % 6;
|
|
5016
|
-
else if (max === g) hue = 2 + (b - r) / chroma;
|
|
5017
|
-
else hue = 4 + (r - g) / chroma;
|
|
5018
|
-
hue /= 6;
|
|
5019
|
-
hue %= 1;
|
|
5020
|
-
return [
|
|
5021
|
-
hue * 360,
|
|
5022
|
-
chroma * 100,
|
|
5023
|
-
grayscale * 100
|
|
5024
|
-
];
|
|
5025
|
-
};
|
|
5026
|
-
convert.hsl.hcg = function(hsl) {
|
|
5027
|
-
const s = hsl[1] / 100;
|
|
5028
|
-
const l = hsl[2] / 100;
|
|
5029
|
-
const c = l < .5 ? 2 * s * l : 2 * s * (1 - l);
|
|
5030
|
-
let f = 0;
|
|
5031
|
-
if (c < 1) f = (l - .5 * c) / (1 - c);
|
|
5032
|
-
return [
|
|
5033
|
-
hsl[0],
|
|
5034
|
-
c * 100,
|
|
5035
|
-
f * 100
|
|
5036
|
-
];
|
|
5037
|
-
};
|
|
5038
|
-
convert.hsv.hcg = function(hsv) {
|
|
5039
|
-
const s = hsv[1] / 100;
|
|
5040
|
-
const v = hsv[2] / 100;
|
|
5041
|
-
const c = s * v;
|
|
5042
|
-
let f = 0;
|
|
5043
|
-
if (c < 1) f = (v - c) / (1 - c);
|
|
5044
|
-
return [
|
|
5045
|
-
hsv[0],
|
|
5046
|
-
c * 100,
|
|
5047
|
-
f * 100
|
|
5048
|
-
];
|
|
5049
|
-
};
|
|
5050
|
-
convert.hcg.rgb = function(hcg) {
|
|
5051
|
-
const h = hcg[0] / 360;
|
|
5052
|
-
const c = hcg[1] / 100;
|
|
5053
|
-
const g = hcg[2] / 100;
|
|
5054
|
-
if (c === 0) return [
|
|
5055
|
-
g * 255,
|
|
5056
|
-
g * 255,
|
|
5057
|
-
g * 255
|
|
5058
|
-
];
|
|
5059
|
-
const pure = [
|
|
5060
|
-
0,
|
|
5061
|
-
0,
|
|
5062
|
-
0
|
|
5063
|
-
];
|
|
5064
|
-
const hi = h % 1 * 6;
|
|
5065
|
-
const v = hi % 1;
|
|
5066
|
-
const w = 1 - v;
|
|
5067
|
-
let mg = 0;
|
|
5068
|
-
switch (Math.floor(hi)) {
|
|
5069
|
-
case 0:
|
|
5070
|
-
pure[0] = 1;
|
|
5071
|
-
pure[1] = v;
|
|
5072
|
-
pure[2] = 0;
|
|
5073
|
-
break;
|
|
5074
|
-
case 1:
|
|
5075
|
-
pure[0] = w;
|
|
5076
|
-
pure[1] = 1;
|
|
5077
|
-
pure[2] = 0;
|
|
5078
|
-
break;
|
|
5079
|
-
case 2:
|
|
5080
|
-
pure[0] = 0;
|
|
5081
|
-
pure[1] = 1;
|
|
5082
|
-
pure[2] = v;
|
|
5083
|
-
break;
|
|
5084
|
-
case 3:
|
|
5085
|
-
pure[0] = 0;
|
|
5086
|
-
pure[1] = w;
|
|
5087
|
-
pure[2] = 1;
|
|
5088
|
-
break;
|
|
5089
|
-
case 4:
|
|
5090
|
-
pure[0] = v;
|
|
5091
|
-
pure[1] = 0;
|
|
5092
|
-
pure[2] = 1;
|
|
5093
|
-
break;
|
|
5094
|
-
default:
|
|
5095
|
-
pure[0] = 1;
|
|
5096
|
-
pure[1] = 0;
|
|
5097
|
-
pure[2] = w;
|
|
5098
|
-
}
|
|
5099
|
-
mg = (1 - c) * g;
|
|
5100
|
-
return [
|
|
5101
|
-
(c * pure[0] + mg) * 255,
|
|
5102
|
-
(c * pure[1] + mg) * 255,
|
|
5103
|
-
(c * pure[2] + mg) * 255
|
|
5104
|
-
];
|
|
5105
|
-
};
|
|
5106
|
-
convert.hcg.hsv = function(hcg) {
|
|
5107
|
-
const c = hcg[1] / 100;
|
|
5108
|
-
const v = c + hcg[2] / 100 * (1 - c);
|
|
5109
|
-
let f = 0;
|
|
5110
|
-
if (v > 0) f = c / v;
|
|
5111
|
-
return [
|
|
5112
|
-
hcg[0],
|
|
5113
|
-
f * 100,
|
|
5114
|
-
v * 100
|
|
5115
|
-
];
|
|
5116
|
-
};
|
|
5117
|
-
convert.hcg.hsl = function(hcg) {
|
|
5118
|
-
const c = hcg[1] / 100;
|
|
5119
|
-
const l = hcg[2] / 100 * (1 - c) + .5 * c;
|
|
5120
|
-
let s = 0;
|
|
5121
|
-
if (l > 0 && l < .5) s = c / (2 * l);
|
|
5122
|
-
else if (l >= .5 && l < 1) s = c / (2 * (1 - l));
|
|
5123
|
-
return [
|
|
5124
|
-
hcg[0],
|
|
5125
|
-
s * 100,
|
|
5126
|
-
l * 100
|
|
5127
|
-
];
|
|
5128
|
-
};
|
|
5129
|
-
convert.hcg.hwb = function(hcg) {
|
|
5130
|
-
const c = hcg[1] / 100;
|
|
5131
|
-
const v = c + hcg[2] / 100 * (1 - c);
|
|
5132
|
-
return [
|
|
5133
|
-
hcg[0],
|
|
5134
|
-
(v - c) * 100,
|
|
5135
|
-
(1 - v) * 100
|
|
5136
|
-
];
|
|
5137
|
-
};
|
|
5138
|
-
convert.hwb.hcg = function(hwb) {
|
|
5139
|
-
const w = hwb[1] / 100;
|
|
5140
|
-
const v = 1 - hwb[2] / 100;
|
|
5141
|
-
const c = v - w;
|
|
5142
|
-
let g = 0;
|
|
5143
|
-
if (c < 1) g = (v - c) / (1 - c);
|
|
5144
|
-
return [
|
|
5145
|
-
hwb[0],
|
|
5146
|
-
c * 100,
|
|
5147
|
-
g * 100
|
|
5148
|
-
];
|
|
5149
|
-
};
|
|
5150
|
-
convert.apple.rgb = function(apple) {
|
|
5151
|
-
return [
|
|
5152
|
-
apple[0] / 65535 * 255,
|
|
5153
|
-
apple[1] / 65535 * 255,
|
|
5154
|
-
apple[2] / 65535 * 255
|
|
5155
|
-
];
|
|
5156
|
-
};
|
|
5157
|
-
convert.rgb.apple = function(rgb) {
|
|
5158
|
-
return [
|
|
5159
|
-
rgb[0] / 255 * 65535,
|
|
5160
|
-
rgb[1] / 255 * 65535,
|
|
5161
|
-
rgb[2] / 255 * 65535
|
|
5162
|
-
];
|
|
5163
|
-
};
|
|
5164
|
-
convert.gray.rgb = function(args) {
|
|
5165
|
-
return [
|
|
5166
|
-
args[0] / 100 * 255,
|
|
5167
|
-
args[0] / 100 * 255,
|
|
5168
|
-
args[0] / 100 * 255
|
|
5169
|
-
];
|
|
5170
|
-
};
|
|
5171
|
-
convert.gray.hsl = function(args) {
|
|
5172
|
-
return [
|
|
5173
|
-
0,
|
|
5174
|
-
0,
|
|
5175
|
-
args[0]
|
|
5176
|
-
];
|
|
5177
|
-
};
|
|
5178
|
-
convert.gray.hsv = convert.gray.hsl;
|
|
5179
|
-
convert.gray.hwb = function(gray) {
|
|
5180
|
-
return [
|
|
5181
|
-
0,
|
|
5182
|
-
100,
|
|
5183
|
-
gray[0]
|
|
5184
|
-
];
|
|
5185
|
-
};
|
|
5186
|
-
convert.gray.cmyk = function(gray) {
|
|
5187
|
-
return [
|
|
5188
|
-
0,
|
|
5189
|
-
0,
|
|
5190
|
-
0,
|
|
5191
|
-
gray[0]
|
|
5192
|
-
];
|
|
5193
|
-
};
|
|
5194
|
-
convert.gray.lab = function(gray) {
|
|
5195
|
-
return [
|
|
5196
|
-
gray[0],
|
|
5197
|
-
0,
|
|
5198
|
-
0
|
|
5199
|
-
];
|
|
5200
|
-
};
|
|
5201
|
-
convert.gray.hex = function(gray) {
|
|
5202
|
-
const val = Math.round(gray[0] / 100 * 255) & 255;
|
|
5203
|
-
const string = ((val << 16) + (val << 8) + val).toString(16).toUpperCase();
|
|
5204
|
-
return "000000".substring(string.length) + string;
|
|
5205
|
-
};
|
|
5206
|
-
convert.rgb.gray = function(rgb) {
|
|
5207
|
-
return [(rgb[0] + rgb[1] + rgb[2]) / 3 / 255 * 100];
|
|
5208
|
-
};
|
|
5209
|
-
}));
|
|
5210
|
-
var require_route = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
5211
|
-
var conversions = require_conversions();
|
|
5212
|
-
function buildGraph() {
|
|
5213
|
-
const graph = {};
|
|
5214
|
-
const models = Object.keys(conversions);
|
|
5215
|
-
for (let len = models.length, i = 0; i < len; i++) graph[models[i]] = {
|
|
5216
|
-
distance: -1,
|
|
5217
|
-
parent: null
|
|
5218
|
-
};
|
|
5219
|
-
return graph;
|
|
5220
|
-
}
|
|
5221
|
-
function deriveBFS(fromModel) {
|
|
5222
|
-
const graph = buildGraph();
|
|
5223
|
-
const queue = [fromModel];
|
|
5224
|
-
graph[fromModel].distance = 0;
|
|
5225
|
-
while (queue.length) {
|
|
5226
|
-
const current = queue.pop();
|
|
5227
|
-
const adjacents = Object.keys(conversions[current]);
|
|
5228
|
-
for (let len = adjacents.length, i = 0; i < len; i++) {
|
|
5229
|
-
const adjacent = adjacents[i];
|
|
5230
|
-
const node = graph[adjacent];
|
|
5231
|
-
if (node.distance === -1) {
|
|
5232
|
-
node.distance = graph[current].distance + 1;
|
|
5233
|
-
node.parent = current;
|
|
5234
|
-
queue.unshift(adjacent);
|
|
5235
|
-
}
|
|
5236
|
-
}
|
|
5237
|
-
}
|
|
5238
|
-
return graph;
|
|
5239
|
-
}
|
|
5240
|
-
function link(from, to) {
|
|
5241
|
-
return function(args) {
|
|
5242
|
-
return to(from(args));
|
|
5243
|
-
};
|
|
5244
|
-
}
|
|
5245
|
-
function wrapConversion(toModel, graph) {
|
|
5246
|
-
const path = [graph[toModel].parent, toModel];
|
|
5247
|
-
let fn = conversions[graph[toModel].parent][toModel];
|
|
5248
|
-
let cur = graph[toModel].parent;
|
|
5249
|
-
while (graph[cur].parent) {
|
|
5250
|
-
path.unshift(graph[cur].parent);
|
|
5251
|
-
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
5252
|
-
cur = graph[cur].parent;
|
|
5253
|
-
}
|
|
5254
|
-
fn.conversion = path;
|
|
5255
|
-
return fn;
|
|
1962
|
+
var ANSI_BACKGROUND_OFFSET = 10;
|
|
1963
|
+
var wrapAnsi16 = (offset = 0) => (code) => `\u001B[${code + offset}m`;
|
|
1964
|
+
var wrapAnsi256 = (offset = 0) => (code) => `\u001B[${38 + offset};5;${code}m`;
|
|
1965
|
+
var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`;
|
|
1966
|
+
var styles$1 = {
|
|
1967
|
+
modifier: {
|
|
1968
|
+
reset: [0, 0],
|
|
1969
|
+
bold: [1, 22],
|
|
1970
|
+
dim: [2, 22],
|
|
1971
|
+
italic: [3, 23],
|
|
1972
|
+
underline: [4, 24],
|
|
1973
|
+
overline: [53, 55],
|
|
1974
|
+
inverse: [7, 27],
|
|
1975
|
+
hidden: [8, 28],
|
|
1976
|
+
strikethrough: [9, 29]
|
|
1977
|
+
},
|
|
1978
|
+
color: {
|
|
1979
|
+
black: [30, 39],
|
|
1980
|
+
red: [31, 39],
|
|
1981
|
+
green: [32, 39],
|
|
1982
|
+
yellow: [33, 39],
|
|
1983
|
+
blue: [34, 39],
|
|
1984
|
+
magenta: [35, 39],
|
|
1985
|
+
cyan: [36, 39],
|
|
1986
|
+
white: [37, 39],
|
|
1987
|
+
blackBright: [90, 39],
|
|
1988
|
+
gray: [90, 39],
|
|
1989
|
+
grey: [90, 39],
|
|
1990
|
+
redBright: [91, 39],
|
|
1991
|
+
greenBright: [92, 39],
|
|
1992
|
+
yellowBright: [93, 39],
|
|
1993
|
+
blueBright: [94, 39],
|
|
1994
|
+
magentaBright: [95, 39],
|
|
1995
|
+
cyanBright: [96, 39],
|
|
1996
|
+
whiteBright: [97, 39]
|
|
1997
|
+
},
|
|
1998
|
+
bgColor: {
|
|
1999
|
+
bgBlack: [40, 49],
|
|
2000
|
+
bgRed: [41, 49],
|
|
2001
|
+
bgGreen: [42, 49],
|
|
2002
|
+
bgYellow: [43, 49],
|
|
2003
|
+
bgBlue: [44, 49],
|
|
2004
|
+
bgMagenta: [45, 49],
|
|
2005
|
+
bgCyan: [46, 49],
|
|
2006
|
+
bgWhite: [47, 49],
|
|
2007
|
+
bgBlackBright: [100, 49],
|
|
2008
|
+
bgGray: [100, 49],
|
|
2009
|
+
bgGrey: [100, 49],
|
|
2010
|
+
bgRedBright: [101, 49],
|
|
2011
|
+
bgGreenBright: [102, 49],
|
|
2012
|
+
bgYellowBright: [103, 49],
|
|
2013
|
+
bgBlueBright: [104, 49],
|
|
2014
|
+
bgMagentaBright: [105, 49],
|
|
2015
|
+
bgCyanBright: [106, 49],
|
|
2016
|
+
bgWhiteBright: [107, 49]
|
|
5256
2017
|
}
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
2018
|
+
};
|
|
2019
|
+
Object.keys(styles$1.modifier);
|
|
2020
|
+
var foregroundColorNames = Object.keys(styles$1.color);
|
|
2021
|
+
var backgroundColorNames = Object.keys(styles$1.bgColor);
|
|
2022
|
+
[...foregroundColorNames, ...backgroundColorNames];
|
|
2023
|
+
function assembleStyles() {
|
|
2024
|
+
const codes = /* @__PURE__ */ new Map();
|
|
2025
|
+
for (const [groupName, group] of Object.entries(styles$1)) {
|
|
2026
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
2027
|
+
styles$1[styleName] = {
|
|
2028
|
+
open: `\u001B[${style[0]}m`,
|
|
2029
|
+
close: `\u001B[${style[1]}m`
|
|
2030
|
+
};
|
|
2031
|
+
group[styleName] = styles$1[styleName];
|
|
2032
|
+
codes.set(style[0], style[1]);
|
|
5265
2033
|
}
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
var require_color_convert = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
5270
|
-
var conversions = require_conversions();
|
|
5271
|
-
var route = require_route();
|
|
5272
|
-
var convert = {};
|
|
5273
|
-
var models = Object.keys(conversions);
|
|
5274
|
-
function wrapRaw(fn) {
|
|
5275
|
-
const wrappedFn = function(...args) {
|
|
5276
|
-
const arg0 = args[0];
|
|
5277
|
-
if (arg0 === void 0 || arg0 === null) return arg0;
|
|
5278
|
-
if (arg0.length > 1) args = arg0;
|
|
5279
|
-
return fn(args);
|
|
5280
|
-
};
|
|
5281
|
-
if ("conversion" in fn) wrappedFn.conversion = fn.conversion;
|
|
5282
|
-
return wrappedFn;
|
|
5283
|
-
}
|
|
5284
|
-
function wrapRounded(fn) {
|
|
5285
|
-
const wrappedFn = function(...args) {
|
|
5286
|
-
const arg0 = args[0];
|
|
5287
|
-
if (arg0 === void 0 || arg0 === null) return arg0;
|
|
5288
|
-
if (arg0.length > 1) args = arg0;
|
|
5289
|
-
const result = fn(args);
|
|
5290
|
-
if (typeof result === "object") for (let len = result.length, i = 0; i < len; i++) result[i] = Math.round(result[i]);
|
|
5291
|
-
return result;
|
|
5292
|
-
};
|
|
5293
|
-
if ("conversion" in fn) wrappedFn.conversion = fn.conversion;
|
|
5294
|
-
return wrappedFn;
|
|
5295
|
-
}
|
|
5296
|
-
models.forEach((fromModel) => {
|
|
5297
|
-
convert[fromModel] = {};
|
|
5298
|
-
Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels });
|
|
5299
|
-
Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels });
|
|
5300
|
-
const routes = route(fromModel);
|
|
5301
|
-
Object.keys(routes).forEach((toModel) => {
|
|
5302
|
-
const fn = routes[toModel];
|
|
5303
|
-
convert[fromModel][toModel] = wrapRounded(fn);
|
|
5304
|
-
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
2034
|
+
Object.defineProperty(styles$1, groupName, {
|
|
2035
|
+
value: group,
|
|
2036
|
+
enumerable: false
|
|
5305
2037
|
});
|
|
2038
|
+
}
|
|
2039
|
+
Object.defineProperty(styles$1, "codes", {
|
|
2040
|
+
value: codes,
|
|
2041
|
+
enumerable: false
|
|
5306
2042
|
});
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5324
|
-
g,
|
|
5325
|
-
b
|
|
5326
|
-
];
|
|
5327
|
-
var setLazyProperty = (object, property, get) => {
|
|
5328
|
-
Object.defineProperty(object, property, {
|
|
5329
|
-
get: () => {
|
|
5330
|
-
const value = get();
|
|
5331
|
-
Object.defineProperty(object, property, {
|
|
5332
|
-
value,
|
|
5333
|
-
enumerable: true,
|
|
5334
|
-
configurable: true
|
|
5335
|
-
});
|
|
5336
|
-
return value;
|
|
2043
|
+
styles$1.color.close = "\x1B[39m";
|
|
2044
|
+
styles$1.bgColor.close = "\x1B[49m";
|
|
2045
|
+
styles$1.color.ansi = wrapAnsi16();
|
|
2046
|
+
styles$1.color.ansi256 = wrapAnsi256();
|
|
2047
|
+
styles$1.color.ansi16m = wrapAnsi16m();
|
|
2048
|
+
styles$1.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
2049
|
+
styles$1.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
2050
|
+
styles$1.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
2051
|
+
Object.defineProperties(styles$1, {
|
|
2052
|
+
rgbToAnsi256: {
|
|
2053
|
+
value(red, green, blue) {
|
|
2054
|
+
if (red === green && green === blue) {
|
|
2055
|
+
if (red < 8) return 16;
|
|
2056
|
+
if (red > 248) return 231;
|
|
2057
|
+
return Math.round((red - 8) / 247 * 24) + 232;
|
|
2058
|
+
}
|
|
2059
|
+
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
5337
2060
|
},
|
|
5338
|
-
enumerable:
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
|
|
5345
|
-
|
|
5346
|
-
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
|
|
5351
|
-
|
|
5352
|
-
|
|
5353
|
-
|
|
5354
|
-
|
|
5355
|
-
|
|
5356
|
-
const codes = /* @__PURE__ */ new Map();
|
|
5357
|
-
const styles = {
|
|
5358
|
-
modifier: {
|
|
5359
|
-
reset: [0, 0],
|
|
5360
|
-
bold: [1, 22],
|
|
5361
|
-
dim: [2, 22],
|
|
5362
|
-
italic: [3, 23],
|
|
5363
|
-
underline: [4, 24],
|
|
5364
|
-
inverse: [7, 27],
|
|
5365
|
-
hidden: [8, 28],
|
|
5366
|
-
strikethrough: [9, 29]
|
|
2061
|
+
enumerable: false
|
|
2062
|
+
},
|
|
2063
|
+
hexToRgb: {
|
|
2064
|
+
value(hex) {
|
|
2065
|
+
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
2066
|
+
if (!matches) return [
|
|
2067
|
+
0,
|
|
2068
|
+
0,
|
|
2069
|
+
0
|
|
2070
|
+
];
|
|
2071
|
+
let [colorString] = matches;
|
|
2072
|
+
if (colorString.length === 3) colorString = [...colorString].map((character) => character + character).join("");
|
|
2073
|
+
const integer = Number.parseInt(colorString, 16);
|
|
2074
|
+
return [
|
|
2075
|
+
integer >> 16 & 255,
|
|
2076
|
+
integer >> 8 & 255,
|
|
2077
|
+
integer & 255
|
|
2078
|
+
];
|
|
5367
2079
|
},
|
|
5368
|
-
|
|
5369
|
-
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
|
|
2080
|
+
enumerable: false
|
|
2081
|
+
},
|
|
2082
|
+
hexToAnsi256: {
|
|
2083
|
+
value: (hex) => styles$1.rgbToAnsi256(...styles$1.hexToRgb(hex)),
|
|
2084
|
+
enumerable: false
|
|
2085
|
+
},
|
|
2086
|
+
ansi256ToAnsi: {
|
|
2087
|
+
value(code) {
|
|
2088
|
+
if (code < 8) return 30 + code;
|
|
2089
|
+
if (code < 16) return 90 + (code - 8);
|
|
2090
|
+
let red;
|
|
2091
|
+
let green;
|
|
2092
|
+
let blue;
|
|
2093
|
+
if (code >= 232) {
|
|
2094
|
+
red = ((code - 232) * 10 + 8) / 255;
|
|
2095
|
+
green = red;
|
|
2096
|
+
blue = red;
|
|
2097
|
+
} else {
|
|
2098
|
+
code -= 16;
|
|
2099
|
+
const remainder = code % 36;
|
|
2100
|
+
red = Math.floor(code / 36) / 5;
|
|
2101
|
+
green = Math.floor(remainder / 6) / 5;
|
|
2102
|
+
blue = remainder % 6 / 5;
|
|
2103
|
+
}
|
|
2104
|
+
const value = Math.max(red, green, blue) * 2;
|
|
2105
|
+
if (value === 0) return 30;
|
|
2106
|
+
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
2107
|
+
if (value === 2) result += 60;
|
|
2108
|
+
return result;
|
|
5385
2109
|
},
|
|
5386
|
-
bgColor: {
|
|
5387
|
-
bgBlack: [40, 49],
|
|
5388
|
-
bgRed: [41, 49],
|
|
5389
|
-
bgGreen: [42, 49],
|
|
5390
|
-
bgYellow: [43, 49],
|
|
5391
|
-
bgBlue: [44, 49],
|
|
5392
|
-
bgMagenta: [45, 49],
|
|
5393
|
-
bgCyan: [46, 49],
|
|
5394
|
-
bgWhite: [47, 49],
|
|
5395
|
-
bgBlackBright: [100, 49],
|
|
5396
|
-
bgRedBright: [101, 49],
|
|
5397
|
-
bgGreenBright: [102, 49],
|
|
5398
|
-
bgYellowBright: [103, 49],
|
|
5399
|
-
bgBlueBright: [104, 49],
|
|
5400
|
-
bgMagentaBright: [105, 49],
|
|
5401
|
-
bgCyanBright: [106, 49],
|
|
5402
|
-
bgWhiteBright: [107, 49]
|
|
5403
|
-
}
|
|
5404
|
-
};
|
|
5405
|
-
styles.color.gray = styles.color.blackBright;
|
|
5406
|
-
styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
|
|
5407
|
-
styles.color.grey = styles.color.blackBright;
|
|
5408
|
-
styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
|
|
5409
|
-
for (const [groupName, group] of Object.entries(styles)) {
|
|
5410
|
-
for (const [styleName, style] of Object.entries(group)) {
|
|
5411
|
-
styles[styleName] = {
|
|
5412
|
-
open: `\u001B[${style[0]}m`,
|
|
5413
|
-
close: `\u001B[${style[1]}m`
|
|
5414
|
-
};
|
|
5415
|
-
group[styleName] = styles[styleName];
|
|
5416
|
-
codes.set(style[0], style[1]);
|
|
5417
|
-
}
|
|
5418
|
-
Object.defineProperty(styles, groupName, {
|
|
5419
|
-
value: group,
|
|
5420
|
-
enumerable: false
|
|
5421
|
-
});
|
|
5422
|
-
}
|
|
5423
|
-
Object.defineProperty(styles, "codes", {
|
|
5424
|
-
value: codes,
|
|
5425
2110
|
enumerable: false
|
|
5426
|
-
}
|
|
5427
|
-
|
|
5428
|
-
|
|
5429
|
-
|
|
5430
|
-
|
|
5431
|
-
|
|
5432
|
-
|
|
5433
|
-
|
|
5434
|
-
setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
|
|
5435
|
-
return styles;
|
|
5436
|
-
}
|
|
5437
|
-
Object.defineProperty(module, "exports", {
|
|
5438
|
-
enumerable: true,
|
|
5439
|
-
get: assembleStyles
|
|
5440
|
-
});
|
|
5441
|
-
}));
|
|
5442
|
-
var require_browser = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
5443
|
-
module.exports = {
|
|
5444
|
-
stdout: false,
|
|
5445
|
-
stderr: false
|
|
5446
|
-
};
|
|
5447
|
-
}));
|
|
5448
|
-
var require_util = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
5449
|
-
var stringReplaceAll = (string, substring, replacer) => {
|
|
5450
|
-
let index = string.indexOf(substring);
|
|
5451
|
-
if (index === -1) return string;
|
|
5452
|
-
const substringLength = substring.length;
|
|
5453
|
-
let endIndex = 0;
|
|
5454
|
-
let returnValue = "";
|
|
5455
|
-
do {
|
|
5456
|
-
returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
|
|
5457
|
-
endIndex = index + substringLength;
|
|
5458
|
-
index = string.indexOf(substring, endIndex);
|
|
5459
|
-
} while (index !== -1);
|
|
5460
|
-
returnValue += string.substr(endIndex);
|
|
5461
|
-
return returnValue;
|
|
5462
|
-
};
|
|
5463
|
-
var stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
|
|
5464
|
-
let endIndex = 0;
|
|
5465
|
-
let returnValue = "";
|
|
5466
|
-
do {
|
|
5467
|
-
const gotCR = string[index - 1] === "\r";
|
|
5468
|
-
returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
5469
|
-
endIndex = index + 1;
|
|
5470
|
-
index = string.indexOf("\n", endIndex);
|
|
5471
|
-
} while (index !== -1);
|
|
5472
|
-
returnValue += string.substr(endIndex);
|
|
5473
|
-
return returnValue;
|
|
5474
|
-
};
|
|
5475
|
-
module.exports = {
|
|
5476
|
-
stringReplaceAll,
|
|
5477
|
-
stringEncaseCRLFWithFirstIndex
|
|
5478
|
-
};
|
|
5479
|
-
}));
|
|
5480
|
-
var require_templates = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
5481
|
-
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;
|
|
5482
|
-
var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
|
5483
|
-
var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
|
|
5484
|
-
var ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
|
|
5485
|
-
var ESCAPES = new Map([
|
|
5486
|
-
["n", "\n"],
|
|
5487
|
-
["r", "\r"],
|
|
5488
|
-
["t", " "],
|
|
5489
|
-
["b", "\b"],
|
|
5490
|
-
["f", "\f"],
|
|
5491
|
-
["v", "\v"],
|
|
5492
|
-
["0", "\0"],
|
|
5493
|
-
["\\", "\\"],
|
|
5494
|
-
["e", "\x1B"],
|
|
5495
|
-
["a", "\x07"]
|
|
5496
|
-
]);
|
|
5497
|
-
function unescape(c) {
|
|
5498
|
-
const u = c[0] === "u";
|
|
5499
|
-
const bracket = c[1] === "{";
|
|
5500
|
-
if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) return String.fromCharCode(parseInt(c.slice(1), 16));
|
|
5501
|
-
if (u && bracket) return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
|
|
5502
|
-
return ESCAPES.get(c) || c;
|
|
5503
|
-
}
|
|
5504
|
-
function parseArguments(name, arguments_) {
|
|
5505
|
-
const results = [];
|
|
5506
|
-
const chunks = arguments_.trim().split(/\s*,\s*/g);
|
|
5507
|
-
let matches;
|
|
5508
|
-
for (const chunk of chunks) {
|
|
5509
|
-
const number = Number(chunk);
|
|
5510
|
-
if (!Number.isNaN(number)) results.push(number);
|
|
5511
|
-
else if (matches = chunk.match(STRING_REGEX)) results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
|
|
5512
|
-
else throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
|
|
5513
|
-
}
|
|
5514
|
-
return results;
|
|
5515
|
-
}
|
|
5516
|
-
function parseStyle(style) {
|
|
5517
|
-
STYLE_REGEX.lastIndex = 0;
|
|
5518
|
-
const results = [];
|
|
5519
|
-
let matches;
|
|
5520
|
-
while ((matches = STYLE_REGEX.exec(style)) !== null) {
|
|
5521
|
-
const name = matches[1];
|
|
5522
|
-
if (matches[2]) {
|
|
5523
|
-
const args = parseArguments(name, matches[2]);
|
|
5524
|
-
results.push([name].concat(args));
|
|
5525
|
-
} else results.push([name]);
|
|
5526
|
-
}
|
|
5527
|
-
return results;
|
|
5528
|
-
}
|
|
5529
|
-
function buildStyle(chalk, styles) {
|
|
5530
|
-
const enabled = {};
|
|
5531
|
-
for (const layer of styles) for (const style of layer.styles) enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
5532
|
-
let current = chalk;
|
|
5533
|
-
for (const [styleName, styles] of Object.entries(enabled)) {
|
|
5534
|
-
if (!Array.isArray(styles)) continue;
|
|
5535
|
-
if (!(styleName in current)) throw new Error(`Unknown Chalk style: ${styleName}`);
|
|
5536
|
-
current = styles.length > 0 ? current[styleName](...styles) : current[styleName];
|
|
5537
|
-
}
|
|
5538
|
-
return current;
|
|
5539
|
-
}
|
|
5540
|
-
module.exports = (chalk, temporary) => {
|
|
5541
|
-
const styles = [];
|
|
5542
|
-
const chunks = [];
|
|
5543
|
-
let chunk = [];
|
|
5544
|
-
temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
|
|
5545
|
-
if (escapeCharacter) chunk.push(unescape(escapeCharacter));
|
|
5546
|
-
else if (style) {
|
|
5547
|
-
const string = chunk.join("");
|
|
5548
|
-
chunk = [];
|
|
5549
|
-
chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string));
|
|
5550
|
-
styles.push({
|
|
5551
|
-
inverse,
|
|
5552
|
-
styles: parseStyle(style)
|
|
5553
|
-
});
|
|
5554
|
-
} else if (close) {
|
|
5555
|
-
if (styles.length === 0) throw new Error("Found extraneous } in Chalk template literal");
|
|
5556
|
-
chunks.push(buildStyle(chalk, styles)(chunk.join("")));
|
|
5557
|
-
chunk = [];
|
|
5558
|
-
styles.pop();
|
|
5559
|
-
} else chunk.push(character);
|
|
5560
|
-
});
|
|
5561
|
-
chunks.push(chunk.join(""));
|
|
5562
|
-
if (styles.length > 0) {
|
|
5563
|
-
const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
|
|
5564
|
-
throw new Error(errMessage);
|
|
5565
|
-
}
|
|
5566
|
-
return chunks.join("");
|
|
5567
|
-
};
|
|
5568
|
-
}));
|
|
5569
|
-
(/* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
5570
|
-
var ansiStyles = require_ansi_styles();
|
|
5571
|
-
var { stdout: stdoutColor, stderr: stderrColor } = require_browser();
|
|
5572
|
-
var { stringReplaceAll, stringEncaseCRLFWithFirstIndex } = require_util();
|
|
5573
|
-
var { isArray } = Array;
|
|
5574
|
-
var levelMapping = [
|
|
5575
|
-
"ansi",
|
|
5576
|
-
"ansi",
|
|
5577
|
-
"ansi256",
|
|
5578
|
-
"ansi16m"
|
|
5579
|
-
];
|
|
5580
|
-
var styles = Object.create(null);
|
|
5581
|
-
var applyOptions = (object, options = {}) => {
|
|
5582
|
-
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");
|
|
5583
|
-
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
5584
|
-
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
5585
|
-
};
|
|
5586
|
-
var ChalkClass = class {
|
|
5587
|
-
constructor(options) {
|
|
5588
|
-
return chalkFactory(options);
|
|
2111
|
+
},
|
|
2112
|
+
rgbToAnsi: {
|
|
2113
|
+
value: (red, green, blue) => styles$1.ansi256ToAnsi(styles$1.rgbToAnsi256(red, green, blue)),
|
|
2114
|
+
enumerable: false
|
|
2115
|
+
},
|
|
2116
|
+
hexToAnsi: {
|
|
2117
|
+
value: (hex) => styles$1.ansi256ToAnsi(styles$1.hexToAnsi256(hex)),
|
|
2118
|
+
enumerable: false
|
|
5589
2119
|
}
|
|
5590
|
-
};
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
2120
|
+
});
|
|
2121
|
+
return styles$1;
|
|
2122
|
+
}
|
|
2123
|
+
var ansiStyles = assembleStyles();
|
|
2124
|
+
var level = (() => {
|
|
2125
|
+
if (!("navigator" in globalThis)) return 0;
|
|
2126
|
+
if (globalThis.navigator.userAgentData) {
|
|
2127
|
+
const brand = navigator.userAgentData.brands.find(({ brand }) => brand === "Chromium");
|
|
2128
|
+
if (brand && brand.version > 93) return 3;
|
|
2129
|
+
}
|
|
2130
|
+
if (/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)) return 1;
|
|
2131
|
+
return 0;
|
|
2132
|
+
})();
|
|
2133
|
+
var colorSupport = level !== 0 && {
|
|
2134
|
+
level,
|
|
2135
|
+
hasBasic: true,
|
|
2136
|
+
has256: level >= 2,
|
|
2137
|
+
has16m: level >= 3
|
|
2138
|
+
};
|
|
2139
|
+
var supportsColor = {
|
|
2140
|
+
stdout: colorSupport,
|
|
2141
|
+
stderr: colorSupport
|
|
2142
|
+
};
|
|
2143
|
+
function stringReplaceAll(string, substring, replacer) {
|
|
2144
|
+
let index = string.indexOf(substring);
|
|
2145
|
+
if (index === -1) return string;
|
|
2146
|
+
const substringLength = substring.length;
|
|
2147
|
+
let endIndex = 0;
|
|
2148
|
+
let returnValue = "";
|
|
2149
|
+
do {
|
|
2150
|
+
returnValue += string.slice(endIndex, index) + substring + replacer;
|
|
2151
|
+
endIndex = index + substringLength;
|
|
2152
|
+
index = string.indexOf(substring, endIndex);
|
|
2153
|
+
} while (index !== -1);
|
|
2154
|
+
returnValue += string.slice(endIndex);
|
|
2155
|
+
return returnValue;
|
|
2156
|
+
}
|
|
2157
|
+
function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
|
|
2158
|
+
let endIndex = 0;
|
|
2159
|
+
let returnValue = "";
|
|
2160
|
+
do {
|
|
2161
|
+
const gotCR = string[index - 1] === "\r";
|
|
2162
|
+
returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
2163
|
+
endIndex = index + 1;
|
|
2164
|
+
index = string.indexOf("\n", endIndex);
|
|
2165
|
+
} while (index !== -1);
|
|
2166
|
+
returnValue += string.slice(endIndex);
|
|
2167
|
+
return returnValue;
|
|
2168
|
+
}
|
|
2169
|
+
var { stdout: stdoutColor, stderr: stderrColor } = supportsColor;
|
|
2170
|
+
var GENERATOR = Symbol("GENERATOR");
|
|
2171
|
+
var STYLER = Symbol("STYLER");
|
|
2172
|
+
var IS_EMPTY = Symbol("IS_EMPTY");
|
|
2173
|
+
var levelMapping = [
|
|
2174
|
+
"ansi",
|
|
2175
|
+
"ansi",
|
|
2176
|
+
"ansi256",
|
|
2177
|
+
"ansi16m"
|
|
2178
|
+
];
|
|
2179
|
+
var styles = Object.create(null);
|
|
2180
|
+
var applyOptions = (object, options = {}) => {
|
|
2181
|
+
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");
|
|
2182
|
+
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
2183
|
+
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
2184
|
+
};
|
|
2185
|
+
var chalkFactory = (options) => {
|
|
2186
|
+
const chalk = (...strings) => strings.join(" ");
|
|
2187
|
+
applyOptions(chalk, options);
|
|
2188
|
+
Object.setPrototypeOf(chalk, createChalk.prototype);
|
|
2189
|
+
return chalk;
|
|
2190
|
+
};
|
|
2191
|
+
function createChalk(options) {
|
|
2192
|
+
return chalkFactory(options);
|
|
2193
|
+
}
|
|
2194
|
+
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
|
2195
|
+
for (const [styleName, style] of Object.entries(ansiStyles)) styles[styleName] = { get() {
|
|
2196
|
+
const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
|
|
2197
|
+
Object.defineProperty(this, styleName, { value: builder });
|
|
2198
|
+
return builder;
|
|
2199
|
+
} };
|
|
2200
|
+
styles.visible = { get() {
|
|
2201
|
+
const builder = createBuilder(this, this[STYLER], true);
|
|
2202
|
+
Object.defineProperty(this, "visible", { value: builder });
|
|
2203
|
+
return builder;
|
|
2204
|
+
} };
|
|
2205
|
+
var getModelAnsi = (model, level, type, ...arguments_) => {
|
|
2206
|
+
if (model === "rgb") {
|
|
2207
|
+
if (level === "ansi16m") return ansiStyles[type].ansi16m(...arguments_);
|
|
2208
|
+
if (level === "ansi256") return ansiStyles[type].ansi256(ansiStyles.rgbToAnsi256(...arguments_));
|
|
2209
|
+
return ansiStyles[type].ansi(ansiStyles.rgbToAnsi(...arguments_));
|
|
2210
|
+
}
|
|
2211
|
+
if (model === "hex") return getModelAnsi("rgb", level, type, ...ansiStyles.hexToRgb(...arguments_));
|
|
2212
|
+
return ansiStyles[type][model](...arguments_);
|
|
2213
|
+
};
|
|
2214
|
+
for (const model of [
|
|
2215
|
+
"rgb",
|
|
2216
|
+
"hex",
|
|
2217
|
+
"ansi256"
|
|
2218
|
+
]) {
|
|
2219
|
+
styles[model] = { get() {
|
|
2220
|
+
const { level } = this;
|
|
2221
|
+
return function(...arguments_) {
|
|
2222
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansiStyles.color.close, this[STYLER]);
|
|
2223
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
5599
2224
|
};
|
|
5600
|
-
chalk.template.Instance = ChalkClass;
|
|
5601
|
-
return chalk.template;
|
|
5602
|
-
};
|
|
5603
|
-
function Chalk(options) {
|
|
5604
|
-
return chalkFactory(options);
|
|
5605
|
-
}
|
|
5606
|
-
for (const [styleName, style] of Object.entries(ansiStyles)) styles[styleName] = { get() {
|
|
5607
|
-
const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
|
|
5608
|
-
Object.defineProperty(this, styleName, { value: builder });
|
|
5609
|
-
return builder;
|
|
5610
|
-
} };
|
|
5611
|
-
styles.visible = { get() {
|
|
5612
|
-
const builder = createBuilder(this, this._styler, true);
|
|
5613
|
-
Object.defineProperty(this, "visible", { value: builder });
|
|
5614
|
-
return builder;
|
|
5615
2225
|
} };
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
"hex",
|
|
5619
|
-
"keyword",
|
|
5620
|
-
"hsl",
|
|
5621
|
-
"hsv",
|
|
5622
|
-
"hwb",
|
|
5623
|
-
"ansi",
|
|
5624
|
-
"ansi256"
|
|
5625
|
-
];
|
|
5626
|
-
for (const model of usedModels) styles[model] = { get() {
|
|
2226
|
+
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
2227
|
+
styles[bgModel] = { get() {
|
|
5627
2228
|
const { level } = this;
|
|
5628
2229
|
return function(...arguments_) {
|
|
5629
|
-
const styler = createStyler(
|
|
5630
|
-
return createBuilder(this, styler, this
|
|
2230
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansiStyles.bgColor.close, this[STYLER]);
|
|
2231
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
5631
2232
|
};
|
|
5632
2233
|
} };
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
var proto = Object.defineProperties(() => {}, {
|
|
5644
|
-
...styles,
|
|
5645
|
-
level: {
|
|
5646
|
-
enumerable: true,
|
|
5647
|
-
get() {
|
|
5648
|
-
return this._generator.level;
|
|
5649
|
-
},
|
|
5650
|
-
set(level) {
|
|
5651
|
-
this._generator.level = level;
|
|
5652
|
-
}
|
|
5653
|
-
}
|
|
5654
|
-
});
|
|
5655
|
-
var createStyler = (open, close, parent) => {
|
|
5656
|
-
let openAll;
|
|
5657
|
-
let closeAll;
|
|
5658
|
-
if (parent === void 0) {
|
|
5659
|
-
openAll = open;
|
|
5660
|
-
closeAll = close;
|
|
5661
|
-
} else {
|
|
5662
|
-
openAll = parent.openAll + open;
|
|
5663
|
-
closeAll = close + parent.closeAll;
|
|
5664
|
-
}
|
|
5665
|
-
return {
|
|
5666
|
-
open,
|
|
5667
|
-
close,
|
|
5668
|
-
openAll,
|
|
5669
|
-
closeAll,
|
|
5670
|
-
parent
|
|
5671
|
-
};
|
|
5672
|
-
};
|
|
5673
|
-
var createBuilder = (self, _styler, _isEmpty) => {
|
|
5674
|
-
const builder = (...arguments_) => {
|
|
5675
|
-
if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) return applyStyle(builder, chalkTag(builder, ...arguments_));
|
|
5676
|
-
return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
5677
|
-
};
|
|
5678
|
-
Object.setPrototypeOf(builder, proto);
|
|
5679
|
-
builder._generator = self;
|
|
5680
|
-
builder._styler = _styler;
|
|
5681
|
-
builder._isEmpty = _isEmpty;
|
|
5682
|
-
return builder;
|
|
5683
|
-
};
|
|
5684
|
-
var applyStyle = (self, string) => {
|
|
5685
|
-
if (self.level <= 0 || !string) return self._isEmpty ? "" : string;
|
|
5686
|
-
let styler = self._styler;
|
|
5687
|
-
if (styler === void 0) return string;
|
|
5688
|
-
const { openAll, closeAll } = styler;
|
|
5689
|
-
if (string.indexOf("\x1B") !== -1) while (styler !== void 0) {
|
|
5690
|
-
string = stringReplaceAll(string, styler.close, styler.open);
|
|
5691
|
-
styler = styler.parent;
|
|
2234
|
+
}
|
|
2235
|
+
var proto = Object.defineProperties(() => {}, {
|
|
2236
|
+
...styles,
|
|
2237
|
+
level: {
|
|
2238
|
+
enumerable: true,
|
|
2239
|
+
get() {
|
|
2240
|
+
return this[GENERATOR].level;
|
|
2241
|
+
},
|
|
2242
|
+
set(level) {
|
|
2243
|
+
this[GENERATOR].level = level;
|
|
5692
2244
|
}
|
|
5693
|
-
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
|
|
5697
|
-
|
|
5698
|
-
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
|
|
5703
|
-
|
|
5704
|
-
|
|
5705
|
-
|
|
2245
|
+
}
|
|
2246
|
+
});
|
|
2247
|
+
var createStyler = (open, close, parent) => {
|
|
2248
|
+
let openAll;
|
|
2249
|
+
let closeAll;
|
|
2250
|
+
if (parent === void 0) {
|
|
2251
|
+
openAll = open;
|
|
2252
|
+
closeAll = close;
|
|
2253
|
+
} else {
|
|
2254
|
+
openAll = parent.openAll + open;
|
|
2255
|
+
closeAll = close + parent.closeAll;
|
|
2256
|
+
}
|
|
2257
|
+
return {
|
|
2258
|
+
open,
|
|
2259
|
+
close,
|
|
2260
|
+
openAll,
|
|
2261
|
+
closeAll,
|
|
2262
|
+
parent
|
|
5706
2263
|
};
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
2264
|
+
};
|
|
2265
|
+
var createBuilder = (self, _styler, _isEmpty) => {
|
|
2266
|
+
const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
2267
|
+
Object.setPrototypeOf(builder, proto);
|
|
2268
|
+
builder[GENERATOR] = self;
|
|
2269
|
+
builder[STYLER] = _styler;
|
|
2270
|
+
builder[IS_EMPTY] = _isEmpty;
|
|
2271
|
+
return builder;
|
|
2272
|
+
};
|
|
2273
|
+
var applyStyle = (self, string) => {
|
|
2274
|
+
if (self.level <= 0 || !string) return self[IS_EMPTY] ? "" : string;
|
|
2275
|
+
let styler = self[STYLER];
|
|
2276
|
+
if (styler === void 0) return string;
|
|
2277
|
+
const { openAll, closeAll } = styler;
|
|
2278
|
+
if (string.includes("\x1B")) while (styler !== void 0) {
|
|
2279
|
+
string = stringReplaceAll(string, styler.close, styler.open);
|
|
2280
|
+
styler = styler.parent;
|
|
2281
|
+
}
|
|
2282
|
+
const lfIndex = string.indexOf("\n");
|
|
2283
|
+
if (lfIndex !== -1) string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
2284
|
+
return openAll + string + closeAll;
|
|
2285
|
+
};
|
|
2286
|
+
Object.defineProperties(createChalk.prototype, styles);
|
|
2287
|
+
createChalk();
|
|
2288
|
+
createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
5714
2289
|
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
5715
2290
|
var Gauge$1 = /* @__PURE__ */ function(Gauge) {
|
|
5716
2291
|
Gauge["ACTIVE_REQUEST_GAUGE"] = "a";
|
|
@@ -6560,10 +3135,10 @@ var STSOAuth2Manager = class {
|
|
|
6560
3135
|
else throw new Error(`STSOAuth2Manager:constructor: Cannot init STSOAuth2Manager - this.#options.workerFactory not specified`);
|
|
6561
3136
|
if (!import_browser.default) {
|
|
6562
3137
|
this.#worker.onmessage = (data) => {
|
|
6563
|
-
this.#LogInfoMessage(
|
|
3138
|
+
this.#LogInfoMessage(chalk$1.green(`this.#worker.onmessage = [${data}]`));
|
|
6564
3139
|
};
|
|
6565
3140
|
this.#worker.onerror = (error) => {
|
|
6566
|
-
this.#LogInfoMessage(
|
|
3141
|
+
this.#LogInfoMessage(chalk$1.green(`this.#worker.onerror = [${JSON.stringify(error)}]`));
|
|
6567
3142
|
};
|
|
6568
3143
|
}
|
|
6569
3144
|
let workerMessage;
|
|
@@ -6603,7 +3178,7 @@ var STSOAuth2Manager = class {
|
|
|
6603
3178
|
}
|
|
6604
3179
|
#ProcessMessageResponse = (data) => {
|
|
6605
3180
|
const messageResponse = data;
|
|
6606
|
-
this.#LogDebugMessage(
|
|
3181
|
+
this.#LogDebugMessage(chalk$1.yellow(`STSOAuth2Manager:#ProcessMessageResponse: message data = [${JSON.stringify(messageResponse)}]`));
|
|
6607
3182
|
if (messageResponse.messageId === -1) switch (messageResponse.command) {
|
|
6608
3183
|
case IOauth2ListenerCommand.AUTHENTICATE_EVENT:
|
|
6609
3184
|
this.#HandleAuthenticateEvent(messageResponse.payload);
|
|
@@ -6635,10 +3210,10 @@ var STSOAuth2Manager = class {
|
|
|
6635
3210
|
this.#messageHandlers[message.messageId] = (response) => {
|
|
6636
3211
|
clearTimeout(timeout);
|
|
6637
3212
|
delete this.#messageHandlers[message.messageId];
|
|
6638
|
-
this.#LogDebugMessage(
|
|
3213
|
+
this.#LogDebugMessage(chalk$1.yellow(`STSOAuth2Manager:#PostMessage: resolve callback response= [${JSON.stringify(response)}]`));
|
|
6639
3214
|
resolve(response);
|
|
6640
3215
|
};
|
|
6641
|
-
this.#LogDebugMessage(
|
|
3216
|
+
this.#LogDebugMessage(chalk$1.yellow(`STSOAuth2Manager:#PostMessage: posting message = [${JSON.stringify(message)}]`));
|
|
6642
3217
|
this.#oauth2ManagerPort.postMessage(message);
|
|
6643
3218
|
});
|
|
6644
3219
|
};
|
|
@@ -6667,10 +3242,10 @@ var STSOAuth2Manager = class {
|
|
|
6667
3242
|
}
|
|
6668
3243
|
};
|
|
6669
3244
|
#SetupRoute = (app, router) => {
|
|
6670
|
-
this.#LogDebugMessage(
|
|
3245
|
+
this.#LogDebugMessage(chalk$1.gray(`STSOAuth2Manager:#SetupRoute`));
|
|
6671
3246
|
router.beforeEach(async (to, from, next) => {
|
|
6672
3247
|
const oAuth2Manager = app.config.globalProperties.$sts[STSOAuth2ManagerPluginKey];
|
|
6673
|
-
this.#LogDebugMessage(
|
|
3248
|
+
this.#LogDebugMessage(chalk$1.gray(`beforeEach: from: [${from.path}], to: [${to.path}]`));
|
|
6674
3249
|
if (this.#GetStore().LoggedIn === false) {
|
|
6675
3250
|
this.#LogInfoMessage(`Not logged in`);
|
|
6676
3251
|
if (to.path.localeCompare(`${this.#options.uriBase}authorize`) === 0) {
|
|
@@ -6701,9 +3276,9 @@ var STSOAuth2Manager = class {
|
|
|
6701
3276
|
}
|
|
6702
3277
|
const str = to.query;
|
|
6703
3278
|
if (str[_nsshunt_stsutils.OAuth2ParameterType.CODE] || str[_nsshunt_stsutils.OAuth2ParameterType.ERROR]) {
|
|
6704
|
-
this.#LogDebugMessage(
|
|
3279
|
+
this.#LogDebugMessage(chalk$1.magenta(`STSOAuth2Manager:#SetupRoute:Processing redirect: [${JSON.stringify(str)}]`));
|
|
6705
3280
|
const retVal = await oAuth2Manager.HandleRedirect(str);
|
|
6706
|
-
this.#LogDebugMessage(
|
|
3281
|
+
this.#LogDebugMessage(chalk$1.magenta(`STSOAuth2Manager:#SetupRoute:Redirect result: [${retVal}]`));
|
|
6707
3282
|
if (retVal) {
|
|
6708
3283
|
next({
|
|
6709
3284
|
path: `${this.#options.uriBase}`,
|
|
@@ -6754,7 +3329,7 @@ var STSOAuth2Manager = class {
|
|
|
6754
3329
|
if (this.#operationSemaphore === true) {
|
|
6755
3330
|
if (retryCount > this.#maxSemaphoreRetries) throw new Error(`STSOAuth2Manager:ExecuteRefreshToken:maxSemaphoreRetries: [${this.#maxSemaphoreRetries}] exceeded.`);
|
|
6756
3331
|
await (0, _nsshunt_stsutils.Sleep)(this.#semaphoreRetrySleep);
|
|
6757
|
-
this.#LogDebugMessage(
|
|
3332
|
+
this.#LogDebugMessage(chalk$1.cyan(`STSOAuth2Manager:ExecuteRefreshToken:locked by operationSemaphore, retry count: [${retryCount}]`));
|
|
6758
3333
|
return await this.ExecuteRefreshToken(retryCount + 1);
|
|
6759
3334
|
} else {
|
|
6760
3335
|
this.#operationSemaphore = true;
|
|
@@ -6773,7 +3348,7 @@ var STSOAuth2Manager = class {
|
|
|
6773
3348
|
this.#LogDebugMessage(`STSOAuth2Manager:RestoreSession:response: [${JSON.stringify(response.payload)}]`);
|
|
6774
3349
|
return response.payload;
|
|
6775
3350
|
} catch (error) {
|
|
6776
|
-
this.#LogErrorMessage(
|
|
3351
|
+
this.#LogErrorMessage(chalk$1.red(`RestoreSession Error: ${error}`));
|
|
6777
3352
|
return false;
|
|
6778
3353
|
}
|
|
6779
3354
|
};
|
|
@@ -6785,18 +3360,18 @@ var STSOAuth2Manager = class {
|
|
|
6785
3360
|
if (!import_browser.default) window.location.replace(url);
|
|
6786
3361
|
else return response.payload.authorizeOptionsClientCopy;
|
|
6787
3362
|
} catch (error) {
|
|
6788
|
-
this.#LogErrorMessage(
|
|
3363
|
+
this.#LogErrorMessage(chalk$1.red(`Authorize Error: ${error}`));
|
|
6789
3364
|
}
|
|
6790
3365
|
return {};
|
|
6791
3366
|
};
|
|
6792
3367
|
HandleRedirect = async (queryVars) => {
|
|
6793
3368
|
try {
|
|
6794
|
-
this.#LogDebugMessage(
|
|
3369
|
+
this.#LogDebugMessage(chalk$1.magenta(`STSOAuth2Manager:HandleRedirect`));
|
|
6795
3370
|
let response = null;
|
|
6796
3371
|
if (queryVars[_nsshunt_stsutils.OAuth2ParameterType.CODE]) {
|
|
6797
3372
|
const authorizeOptions = this.#transactionStore.get(this.#STORAGE_AUTHORIZE_OPTIONS_KEY);
|
|
6798
3373
|
this.#transactionStore.remove(this.#STORAGE_AUTHORIZE_OPTIONS_KEY);
|
|
6799
|
-
this.#LogDebugMessage(
|
|
3374
|
+
this.#LogDebugMessage(chalk$1.magenta(`STSOAuth2Manager:HandleRedirect: sending HANDLE_REDIRECT command`));
|
|
6800
3375
|
response = await this.#PostMessage({
|
|
6801
3376
|
command: IOauth2ListenerCommand.HANDLE_REDIRECT,
|
|
6802
3377
|
payload: {
|
|
@@ -6808,10 +3383,10 @@ var STSOAuth2Manager = class {
|
|
|
6808
3383
|
command: IOauth2ListenerCommand.HANDLE_REDIRECT,
|
|
6809
3384
|
payload: queryVars
|
|
6810
3385
|
});
|
|
6811
|
-
this.#LogDebugMessage(
|
|
3386
|
+
this.#LogDebugMessage(chalk$1.magenta(`STSOAuth2Manager:HandleRedirect: HANDLE_REDIRECT response: [${JSON.stringify(response)}]`));
|
|
6812
3387
|
return response.payload;
|
|
6813
3388
|
} catch (error) {
|
|
6814
|
-
this.#LogErrorMessage(
|
|
3389
|
+
this.#LogErrorMessage(chalk$1.red(`HandleRedirect Error: ${error}`));
|
|
6815
3390
|
return false;
|
|
6816
3391
|
}
|
|
6817
3392
|
};
|
|
@@ -6819,7 +3394,7 @@ var STSOAuth2Manager = class {
|
|
|
6819
3394
|
try {
|
|
6820
3395
|
return (await this.#PostMessage({ command: IOauth2ListenerCommand.LOGOUT })).payload;
|
|
6821
3396
|
} catch (error) {
|
|
6822
|
-
this.#LogErrorMessage(
|
|
3397
|
+
this.#LogErrorMessage(chalk$1.red(`Logout Error: ${error}`));
|
|
6823
3398
|
return false;
|
|
6824
3399
|
}
|
|
6825
3400
|
};
|
|
@@ -6827,7 +3402,7 @@ var STSOAuth2Manager = class {
|
|
|
6827
3402
|
try {
|
|
6828
3403
|
return (await this.#PostMessage({ command: IOauth2ListenerCommand.LOGOUT })).payload;
|
|
6829
3404
|
} catch (error) {
|
|
6830
|
-
this.#LogErrorMessage(
|
|
3405
|
+
this.#LogErrorMessage(chalk$1.red(`InvokeExternalAPI Error: ${error}`));
|
|
6831
3406
|
return null;
|
|
6832
3407
|
}
|
|
6833
3408
|
};
|
|
@@ -6841,7 +3416,7 @@ var STSOAuth2Manager = class {
|
|
|
6841
3416
|
};
|
|
6842
3417
|
//#endregion
|
|
6843
3418
|
//#region node_modules/crypto-js/core.js
|
|
6844
|
-
var require_core = /* @__PURE__ */ __commonJSMin$
|
|
3419
|
+
var require_core = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
6845
3420
|
(function(root, factory) {
|
|
6846
3421
|
if (typeof exports === "object") module.exports = exports = factory();
|
|
6847
3422
|
else if (typeof define === "function" && define.amd) define([], factory);
|
|
@@ -7111,7 +3686,7 @@ var require_core = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
|
|
|
7111
3686
|
}));
|
|
7112
3687
|
//#endregion
|
|
7113
3688
|
//#region node_modules/crypto-js/sha256.js
|
|
7114
|
-
var require_sha256 = /* @__PURE__ */ __commonJSMin$
|
|
3689
|
+
var require_sha256 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
7115
3690
|
(function(root, factory) {
|
|
7116
3691
|
if (typeof exports === "object") module.exports = exports = factory(require_core());
|
|
7117
3692
|
else if (typeof define === "function" && define.amd) define(["./core"], factory);
|
|
@@ -7250,7 +3825,7 @@ var require_sha256 = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
|
|
|
7250
3825
|
}));
|
|
7251
3826
|
//#endregion
|
|
7252
3827
|
//#region node_modules/crypto-js/enc-base64.js
|
|
7253
|
-
var require_enc_base64 = /* @__PURE__ */ __commonJSMin$
|
|
3828
|
+
var require_enc_base64 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
7254
3829
|
(function(root, factory) {
|
|
7255
3830
|
if (typeof exports === "object") module.exports = exports = factory(require_core());
|
|
7256
3831
|
else if (typeof define === "function" && define.amd) define(["./core"], factory);
|
|
@@ -7311,8 +3886,8 @@ var require_enc_base64 = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
|
|
|
7311
3886
|
}));
|
|
7312
3887
|
//#endregion
|
|
7313
3888
|
//#region src/Utils/CryptoUtils.ts
|
|
7314
|
-
var import_sha256 = /* @__PURE__ */ __toESM$
|
|
7315
|
-
var import_enc_base64 = /* @__PURE__ */ __toESM$
|
|
3889
|
+
var import_sha256 = /* @__PURE__ */ __toESM$1(require_sha256(), 1);
|
|
3890
|
+
var import_enc_base64 = /* @__PURE__ */ __toESM$1(require_enc_base64(), 1);
|
|
7316
3891
|
var CryptoUtils = class {
|
|
7317
3892
|
#crypto;
|
|
7318
3893
|
constructor() {
|
|
@@ -7868,7 +4443,7 @@ var STSOAuth2Worker = class {
|
|
|
7868
4443
|
[_nsshunt_stsutils.OAuth2ParameterType.REDIRECT_URI]: this.#options.redirect_uri,
|
|
7869
4444
|
[_nsshunt_stsutils.OAuth2ParameterType.AUDIENCE]: this.#options.audience
|
|
7870
4445
|
}).withDefaultHeaders().withCredentials().withTimeout(this.#options.timeout);
|
|
7871
|
-
this.#LogDebugMessage(
|
|
4446
|
+
this.#LogDebugMessage(chalk$1.magenta(`#RestoreSession:session request detail: [${JSON.stringify(rConfig)}]`));
|
|
7872
4447
|
if (import_browser.default && this.#agentManager) rConfig.withAgentManager(this.#agentManager);
|
|
7873
4448
|
const retVal = await (0, axios.default)(rConfig.config);
|
|
7874
4449
|
if (retVal.data.status === StatusCodes.OK) {
|
|
@@ -7936,46 +4511,46 @@ var STSOAuth2Worker = class {
|
|
|
7936
4511
|
#HandleRedirect = async (payload) => {
|
|
7937
4512
|
const queryVars = payload.queryVars;
|
|
7938
4513
|
const authorizeOptions = payload.authorizeOptions;
|
|
7939
|
-
this.#LogDebugMessage(
|
|
7940
|
-
this.#LogDebugMessage(
|
|
4514
|
+
this.#LogDebugMessage(chalk$1.magenta(`#HandleRedirect: HandleRedirect`));
|
|
4515
|
+
this.#LogDebugMessage(chalk$1.magenta(`#HandleRedirect: HandleRedirect:Query Vars: [${JSON.stringify(queryVars)}]`));
|
|
7941
4516
|
if (queryVars[_nsshunt_stsutils.OAuth2ParameterType.CODE]) {
|
|
7942
4517
|
const response = queryVars;
|
|
7943
4518
|
this.#LogInfoMessage(`authorizeOptions from transaction state: [${JSON.stringify(authorizeOptions)}]`);
|
|
7944
4519
|
const redirectState = response.state;
|
|
7945
4520
|
const authorizeOptionsState = authorizeOptions.state;
|
|
7946
4521
|
if (authorizeOptionsState.localeCompare(redirectState) === 0) {
|
|
7947
|
-
this.#LogInfoMessage(
|
|
4522
|
+
this.#LogInfoMessage(chalk$1.green("redirected state (from queryVars) matched previously saved transaction authorizeOptions state"));
|
|
7948
4523
|
return await this.#GetToken(authorizeOptions, response);
|
|
7949
4524
|
} else {
|
|
7950
|
-
this.#LogErrorMessage(
|
|
7951
|
-
this.#LogErrorMessage(
|
|
7952
|
-
this.#LogErrorMessage(
|
|
4525
|
+
this.#LogErrorMessage(chalk$1.red("redirected state (from queryVars) did NOT match previously saved transaction authorizeOptions state"));
|
|
4526
|
+
this.#LogErrorMessage(chalk$1.red(`authorizeOptionsState: [${authorizeOptionsState}]`));
|
|
4527
|
+
this.#LogErrorMessage(chalk$1.red(`redirectState: [${redirectState}]`));
|
|
7953
4528
|
this.#HandleErrorEvent({ message: "State un-matched" });
|
|
7954
4529
|
return false;
|
|
7955
4530
|
}
|
|
7956
4531
|
} else if (queryVars[_nsshunt_stsutils.OAuth2ParameterType.ERROR]) {
|
|
7957
|
-
this.#LogErrorMessage(
|
|
4532
|
+
this.#LogErrorMessage(chalk$1.red(`State un-matched (1)`));
|
|
7958
4533
|
this.#HandleErrorEvent({ message: "State un-matched" });
|
|
7959
4534
|
return false;
|
|
7960
4535
|
} else {
|
|
7961
|
-
this.#LogErrorMessage(
|
|
4536
|
+
this.#LogErrorMessage(chalk$1.red(`State un-matched (2)`));
|
|
7962
4537
|
this.#HandleErrorEvent({ message: "State un-matched" });
|
|
7963
4538
|
return false;
|
|
7964
4539
|
}
|
|
7965
4540
|
};
|
|
7966
4541
|
#GetTokenFromBroker = async (authorizationCodeFlowParameters) => {
|
|
7967
|
-
this.#LogDebugMessage(
|
|
4542
|
+
this.#LogDebugMessage(chalk$1.magenta(`#GetTokenFromBroker`));
|
|
7968
4543
|
this.#clientSessionStore.remove(this.#STORAGE_SESSION_KEY);
|
|
7969
4544
|
const url = `${this.#options.brokerendpoint}:${this.#options.brokerport}${this.#options.brokerapiroot}/token`;
|
|
7970
4545
|
try {
|
|
7971
4546
|
const rConfig = new _nsshunt_stsutils.STSAxiosConfig(url, "post").withDefaultHeaders().withData(authorizationCodeFlowParameters).withCredentials().withTimeout(this.#options.timeout);
|
|
7972
|
-
this.#LogDebugMessage(
|
|
4547
|
+
this.#LogDebugMessage(chalk$1.magenta(`#GetTokenFromBroker: request config: [${JSON.stringify(rConfig)}]`));
|
|
7973
4548
|
if (import_browser.default && this.#agentManager) rConfig.withAgentManager(this.#agentManager);
|
|
7974
|
-
this.#LogDebugMessage(
|
|
4549
|
+
this.#LogDebugMessage(chalk$1.magenta(`#GetTokenFromBroker: axios API call`));
|
|
7975
4550
|
const retVal = await (0, axios.default)(rConfig.config);
|
|
7976
|
-
this.#LogDebugMessage(
|
|
4551
|
+
this.#LogDebugMessage(chalk$1.magenta(`#GetTokenFromBroker: axios API call result: [${retVal.status}]`));
|
|
7977
4552
|
if (retVal.status === StatusCodes.OK) {
|
|
7978
|
-
this.#LogDebugMessage(
|
|
4553
|
+
this.#LogDebugMessage(chalk$1.magenta(`#GetTokenFromBroker: storing tokens`));
|
|
7979
4554
|
const tokenResponse = retVal.data;
|
|
7980
4555
|
this.#HandleAuthenticateEvent(tokenResponse.id_token);
|
|
7981
4556
|
const newSessionData = { tokenResponse };
|
|
@@ -7983,18 +4558,18 @@ var STSOAuth2Worker = class {
|
|
|
7983
4558
|
this.#clientSessionStore.set(this.#STORAGE_SESSION_KEY, newSessionData);
|
|
7984
4559
|
return true;
|
|
7985
4560
|
} else if (retVal.status === StatusCodes.UNAUTHORIZED) {
|
|
7986
|
-
this.#LogDebugMessage(
|
|
4561
|
+
this.#LogDebugMessage(chalk$1.magenta(`#GetTokenFromBroker: NOT storing tokens, status: [${retVal.status}]`));
|
|
7987
4562
|
this.#HandleAuthenticateEvent(null);
|
|
7988
4563
|
return false;
|
|
7989
4564
|
} else {
|
|
7990
|
-
this.#LogDebugMessage(
|
|
4565
|
+
this.#LogDebugMessage(chalk$1.magenta(`#GetTokenFromBroker: NOT storing tokens (general error 1), status: [${retVal.status}]`));
|
|
7991
4566
|
this.#HandleAuthenticateEvent(null);
|
|
7992
|
-
this.#LogErrorMessage(
|
|
7993
|
-
this.#LogErrorMessage(
|
|
4567
|
+
this.#LogErrorMessage(chalk$1.red("Could not obtain access_token from token end-point:-"));
|
|
4568
|
+
this.#LogErrorMessage(chalk$1.red(JSON.stringify(retVal.data)));
|
|
7994
4569
|
return false;
|
|
7995
4570
|
}
|
|
7996
4571
|
} catch (error) {
|
|
7997
|
-
this.#LogErrorMessage(
|
|
4572
|
+
this.#LogErrorMessage(chalk$1.red(`#GetTokenFromBroker: NOT storing tokens (general error 2), status: [${error}]`));
|
|
7998
4573
|
this.#HandleAuthenticateEvent(null);
|
|
7999
4574
|
return false;
|
|
8000
4575
|
}
|
|
@@ -8014,10 +4589,10 @@ var STSOAuth2Worker = class {
|
|
|
8014
4589
|
return await this.#GetTokenFromBroker(authorizationCodeFlowParameters);
|
|
8015
4590
|
};
|
|
8016
4591
|
#RefreshToken = async () => {
|
|
8017
|
-
this.#LogDebugMessage(
|
|
4592
|
+
this.#LogDebugMessage(chalk$1.cyan(`STSOAuth2Worker:#RefreshToken:start`));
|
|
8018
4593
|
const sessionData = this.#clientSessionStore.get(this.#STORAGE_SESSION_KEY);
|
|
8019
4594
|
if (sessionData) {
|
|
8020
|
-
this.#LogDebugMessage(
|
|
4595
|
+
this.#LogDebugMessage(chalk$1.cyan(`STSOAuth2Worker:#RefreshToken:sessionData: [${JSON.stringify(sessionData)}]`));
|
|
8021
4596
|
const currentSessionData = sessionData.tokenResponse;
|
|
8022
4597
|
const refreshFlowParameters = {
|
|
8023
4598
|
client_id: this.#options.client_id,
|
|
@@ -8027,7 +4602,7 @@ var STSOAuth2Worker = class {
|
|
|
8027
4602
|
};
|
|
8028
4603
|
return await this.#GetTokenFromBroker(refreshFlowParameters);
|
|
8029
4604
|
} else {
|
|
8030
|
-
this.#LogErrorMessage(
|
|
4605
|
+
this.#LogErrorMessage(chalk$1.red(`STSOAuth2Worker:#RefreshToken:sessionData not found within clientSessionStore`));
|
|
8031
4606
|
return false;
|
|
8032
4607
|
}
|
|
8033
4608
|
};
|
|
@@ -8048,18 +4623,18 @@ var STSOAuth2Worker = class {
|
|
|
8048
4623
|
try {
|
|
8049
4624
|
const rConfig = new _nsshunt_stsutils.STSAxiosConfig(url, "post").withData({ sessionId }).withDefaultHeaders().withCredentials().withTimeout(this.#options.timeout);
|
|
8050
4625
|
if (import_browser.default && this.#agentManager) rConfig.withAgentManager(this.#agentManager);
|
|
8051
|
-
this.#LogDebugMessage(
|
|
4626
|
+
this.#LogDebugMessage(chalk$1.magenta(`#Logout: request config: [${rConfig}]`));
|
|
8052
4627
|
const retVal = await (0, axios.default)(rConfig.config);
|
|
8053
4628
|
if (retVal.data.status === StatusCodes.OK) return true;
|
|
8054
4629
|
else {
|
|
8055
|
-
this.#LogErrorMessage(
|
|
8056
|
-
this.#LogErrorMessage(
|
|
4630
|
+
this.#LogErrorMessage(chalk$1.red("Error during logout (1: server side)"));
|
|
4631
|
+
this.#LogErrorMessage(chalk$1.red(JSON.stringify(retVal.data)));
|
|
8057
4632
|
return false;
|
|
8058
4633
|
}
|
|
8059
4634
|
} catch (error) {
|
|
8060
|
-
this.#LogErrorMessage(
|
|
8061
|
-
this.#LogErrorMessage(
|
|
8062
|
-
this.#LogErrorMessage(
|
|
4635
|
+
this.#LogErrorMessage(chalk$1.red("Error during logout (2: server side)"));
|
|
4636
|
+
this.#LogErrorMessage(chalk$1.red(error));
|
|
4637
|
+
this.#LogErrorMessage(chalk$1.red(JSON.stringify(error)));
|
|
8063
4638
|
return false;
|
|
8064
4639
|
}
|
|
8065
4640
|
} else {
|