@jsenv/core 40.3.3 → 40.5.0

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.
@@ -1,2069 +0,0 @@
1
- import process from "node:process";
2
- import os from "node:os";
3
- import tty from "node:tty";
4
-
5
- // From: https://github.com/sindresorhus/has-flag/blob/main/index.js
6
- /// function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {
7
- function hasFlag$2(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) {
8
- const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
9
- const position = argv.indexOf(prefix + flag);
10
- const terminatorPosition = argv.indexOf('--');
11
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
12
- }
13
-
14
- const {env: env$2} = process;
15
-
16
- let flagForceColor$2;
17
- if (
18
- hasFlag$2('no-color')
19
- || hasFlag$2('no-colors')
20
- || hasFlag$2('color=false')
21
- || hasFlag$2('color=never')
22
- ) {
23
- flagForceColor$2 = 0;
24
- } else if (
25
- hasFlag$2('color')
26
- || hasFlag$2('colors')
27
- || hasFlag$2('color=true')
28
- || hasFlag$2('color=always')
29
- ) {
30
- flagForceColor$2 = 1;
31
- }
32
-
33
- function envForceColor$2() {
34
- if (!('FORCE_COLOR' in env$2)) {
35
- return;
36
- }
37
-
38
- if (env$2.FORCE_COLOR === 'true') {
39
- return 1;
40
- }
41
-
42
- if (env$2.FORCE_COLOR === 'false') {
43
- return 0;
44
- }
45
-
46
- if (env$2.FORCE_COLOR.length === 0) {
47
- return 1;
48
- }
49
-
50
- const level = Math.min(Number.parseInt(env$2.FORCE_COLOR, 10), 3);
51
-
52
- if (![0, 1, 2, 3].includes(level)) {
53
- return;
54
- }
55
-
56
- return level;
57
- }
58
-
59
- function translateLevel$2(level) {
60
- if (level === 0) {
61
- return false;
62
- }
63
-
64
- return {
65
- level,
66
- hasBasic: true,
67
- has256: level >= 2,
68
- has16m: level >= 3,
69
- };
70
- }
71
-
72
- function _supportsColor$2(haveStream, {streamIsTTY, sniffFlags = true} = {}) {
73
- const noFlagForceColor = envForceColor$2();
74
- if (noFlagForceColor !== undefined) {
75
- flagForceColor$2 = noFlagForceColor;
76
- }
77
-
78
- const forceColor = sniffFlags ? flagForceColor$2 : noFlagForceColor;
79
-
80
- if (forceColor === 0) {
81
- return 0;
82
- }
83
-
84
- if (sniffFlags) {
85
- if (hasFlag$2('color=16m')
86
- || hasFlag$2('color=full')
87
- || hasFlag$2('color=truecolor')) {
88
- return 3;
89
- }
90
-
91
- if (hasFlag$2('color=256')) {
92
- return 2;
93
- }
94
- }
95
-
96
- // Check for Azure DevOps pipelines.
97
- // Has to be above the `!streamIsTTY` check.
98
- if ('TF_BUILD' in env$2 && 'AGENT_NAME' in env$2) {
99
- return 1;
100
- }
101
-
102
- if (haveStream && !streamIsTTY && forceColor === undefined) {
103
- return 0;
104
- }
105
-
106
- const min = forceColor || 0;
107
-
108
- if (env$2.TERM === 'dumb') {
109
- return min;
110
- }
111
-
112
- if (process.platform === 'win32') {
113
- // Windows 10 build 10586 is the first Windows release that supports 256 colors.
114
- // Windows 10 build 14931 is the first release that supports 16m/TrueColor.
115
- const osRelease = os.release().split('.');
116
- if (
117
- Number(osRelease[0]) >= 10
118
- && Number(osRelease[2]) >= 10_586
119
- ) {
120
- return Number(osRelease[2]) >= 14_931 ? 3 : 2;
121
- }
122
-
123
- return 1;
124
- }
125
-
126
- if ('CI' in env$2) {
127
- if (['GITHUB_ACTIONS', 'GITEA_ACTIONS', 'CIRCLECI'].some(key => key in env$2)) {
128
- return 3;
129
- }
130
-
131
- if (['TRAVIS', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env$2) || env$2.CI_NAME === 'codeship') {
132
- return 1;
133
- }
134
-
135
- return min;
136
- }
137
-
138
- if ('TEAMCITY_VERSION' in env$2) {
139
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env$2.TEAMCITY_VERSION) ? 1 : 0;
140
- }
141
-
142
- if (env$2.COLORTERM === 'truecolor') {
143
- return 3;
144
- }
145
-
146
- if (env$2.TERM === 'xterm-kitty') {
147
- return 3;
148
- }
149
-
150
- if ('TERM_PROGRAM' in env$2) {
151
- const version = Number.parseInt((env$2.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
152
-
153
- switch (env$2.TERM_PROGRAM) {
154
- case 'iTerm.app': {
155
- return version >= 3 ? 3 : 2;
156
- }
157
-
158
- case 'Apple_Terminal': {
159
- return 2;
160
- }
161
- // No default
162
- }
163
- }
164
-
165
- if (/-256(color)?$/i.test(env$2.TERM)) {
166
- return 2;
167
- }
168
-
169
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env$2.TERM)) {
170
- return 1;
171
- }
172
-
173
- if ('COLORTERM' in env$2) {
174
- return 1;
175
- }
176
-
177
- return min;
178
- }
179
-
180
- function createSupportsColor$2(stream, options = {}) {
181
- const level = _supportsColor$2(stream, {
182
- streamIsTTY: stream && stream.isTTY,
183
- ...options,
184
- });
185
-
186
- return translateLevel$2(level);
187
- }
188
-
189
- ({
190
- stdout: createSupportsColor$2({isTTY: tty.isatty(1)}),
191
- stderr: createSupportsColor$2({isTTY: tty.isatty(2)}),
192
- });
193
-
194
- function isUnicodeSupported$2() {
195
- const {env} = process;
196
- const {TERM, TERM_PROGRAM} = env;
197
-
198
- if (process.platform !== 'win32') {
199
- return TERM !== 'linux'; // Linux console (kernel)
200
- }
201
-
202
- return Boolean(env.WT_SESSION) // Windows Terminal
203
- || Boolean(env.TERMINUS_SUBLIME) // Terminus (<0.2.27)
204
- || env.ConEmuTask === '{cmd::Cmder}' // ConEmu and cmder
205
- || TERM_PROGRAM === 'Terminus-Sublime'
206
- || TERM_PROGRAM === 'vscode'
207
- || TERM === 'xterm-256color'
208
- || TERM === 'alacritty'
209
- || TERM === 'rxvt-unicode'
210
- || TERM === 'rxvt-unicode-256color'
211
- || env.TERMINAL_EMULATOR === 'JetBrains-JediTerm';
212
- }
213
-
214
- const r$2 = String.raw;
215
- const seq$2 = r$2`(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})`;
216
- const sTags$2 = r$2`\u{E0061}-\u{E007A}`;
217
- const emojiRegex$2 = () => new RegExp(r$2`[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[${sTags$2}]{2}[\u{E0030}-\u{E0039}${sTags$2}]{1,3}\u{E007F}|${seq$2}(?:\u200D${seq$2})*`, 'gu');
218
-
219
- // Generated code.
220
-
221
- function isAmbiguous$2(x) {
222
- return x === 0xA1
223
- || x === 0xA4
224
- || x === 0xA7
225
- || x === 0xA8
226
- || x === 0xAA
227
- || x === 0xAD
228
- || x === 0xAE
229
- || x >= 0xB0 && x <= 0xB4
230
- || x >= 0xB6 && x <= 0xBA
231
- || x >= 0xBC && x <= 0xBF
232
- || x === 0xC6
233
- || x === 0xD0
234
- || x === 0xD7
235
- || x === 0xD8
236
- || x >= 0xDE && x <= 0xE1
237
- || x === 0xE6
238
- || x >= 0xE8 && x <= 0xEA
239
- || x === 0xEC
240
- || x === 0xED
241
- || x === 0xF0
242
- || x === 0xF2
243
- || x === 0xF3
244
- || x >= 0xF7 && x <= 0xFA
245
- || x === 0xFC
246
- || x === 0xFE
247
- || x === 0x101
248
- || x === 0x111
249
- || x === 0x113
250
- || x === 0x11B
251
- || x === 0x126
252
- || x === 0x127
253
- || x === 0x12B
254
- || x >= 0x131 && x <= 0x133
255
- || x === 0x138
256
- || x >= 0x13F && x <= 0x142
257
- || x === 0x144
258
- || x >= 0x148 && x <= 0x14B
259
- || x === 0x14D
260
- || x === 0x152
261
- || x === 0x153
262
- || x === 0x166
263
- || x === 0x167
264
- || x === 0x16B
265
- || x === 0x1CE
266
- || x === 0x1D0
267
- || x === 0x1D2
268
- || x === 0x1D4
269
- || x === 0x1D6
270
- || x === 0x1D8
271
- || x === 0x1DA
272
- || x === 0x1DC
273
- || x === 0x251
274
- || x === 0x261
275
- || x === 0x2C4
276
- || x === 0x2C7
277
- || x >= 0x2C9 && x <= 0x2CB
278
- || x === 0x2CD
279
- || x === 0x2D0
280
- || x >= 0x2D8 && x <= 0x2DB
281
- || x === 0x2DD
282
- || x === 0x2DF
283
- || x >= 0x300 && x <= 0x36F
284
- || x >= 0x391 && x <= 0x3A1
285
- || x >= 0x3A3 && x <= 0x3A9
286
- || x >= 0x3B1 && x <= 0x3C1
287
- || x >= 0x3C3 && x <= 0x3C9
288
- || x === 0x401
289
- || x >= 0x410 && x <= 0x44F
290
- || x === 0x451
291
- || x === 0x2010
292
- || x >= 0x2013 && x <= 0x2016
293
- || x === 0x2018
294
- || x === 0x2019
295
- || x === 0x201C
296
- || x === 0x201D
297
- || x >= 0x2020 && x <= 0x2022
298
- || x >= 0x2024 && x <= 0x2027
299
- || x === 0x2030
300
- || x === 0x2032
301
- || x === 0x2033
302
- || x === 0x2035
303
- || x === 0x203B
304
- || x === 0x203E
305
- || x === 0x2074
306
- || x === 0x207F
307
- || x >= 0x2081 && x <= 0x2084
308
- || x === 0x20AC
309
- || x === 0x2103
310
- || x === 0x2105
311
- || x === 0x2109
312
- || x === 0x2113
313
- || x === 0x2116
314
- || x === 0x2121
315
- || x === 0x2122
316
- || x === 0x2126
317
- || x === 0x212B
318
- || x === 0x2153
319
- || x === 0x2154
320
- || x >= 0x215B && x <= 0x215E
321
- || x >= 0x2160 && x <= 0x216B
322
- || x >= 0x2170 && x <= 0x2179
323
- || x === 0x2189
324
- || x >= 0x2190 && x <= 0x2199
325
- || x === 0x21B8
326
- || x === 0x21B9
327
- || x === 0x21D2
328
- || x === 0x21D4
329
- || x === 0x21E7
330
- || x === 0x2200
331
- || x === 0x2202
332
- || x === 0x2203
333
- || x === 0x2207
334
- || x === 0x2208
335
- || x === 0x220B
336
- || x === 0x220F
337
- || x === 0x2211
338
- || x === 0x2215
339
- || x === 0x221A
340
- || x >= 0x221D && x <= 0x2220
341
- || x === 0x2223
342
- || x === 0x2225
343
- || x >= 0x2227 && x <= 0x222C
344
- || x === 0x222E
345
- || x >= 0x2234 && x <= 0x2237
346
- || x === 0x223C
347
- || x === 0x223D
348
- || x === 0x2248
349
- || x === 0x224C
350
- || x === 0x2252
351
- || x === 0x2260
352
- || x === 0x2261
353
- || x >= 0x2264 && x <= 0x2267
354
- || x === 0x226A
355
- || x === 0x226B
356
- || x === 0x226E
357
- || x === 0x226F
358
- || x === 0x2282
359
- || x === 0x2283
360
- || x === 0x2286
361
- || x === 0x2287
362
- || x === 0x2295
363
- || x === 0x2299
364
- || x === 0x22A5
365
- || x === 0x22BF
366
- || x === 0x2312
367
- || x >= 0x2460 && x <= 0x24E9
368
- || x >= 0x24EB && x <= 0x254B
369
- || x >= 0x2550 && x <= 0x2573
370
- || x >= 0x2580 && x <= 0x258F
371
- || x >= 0x2592 && x <= 0x2595
372
- || x === 0x25A0
373
- || x === 0x25A1
374
- || x >= 0x25A3 && x <= 0x25A9
375
- || x === 0x25B2
376
- || x === 0x25B3
377
- || x === 0x25B6
378
- || x === 0x25B7
379
- || x === 0x25BC
380
- || x === 0x25BD
381
- || x === 0x25C0
382
- || x === 0x25C1
383
- || x >= 0x25C6 && x <= 0x25C8
384
- || x === 0x25CB
385
- || x >= 0x25CE && x <= 0x25D1
386
- || x >= 0x25E2 && x <= 0x25E5
387
- || x === 0x25EF
388
- || x === 0x2605
389
- || x === 0x2606
390
- || x === 0x2609
391
- || x === 0x260E
392
- || x === 0x260F
393
- || x === 0x261C
394
- || x === 0x261E
395
- || x === 0x2640
396
- || x === 0x2642
397
- || x === 0x2660
398
- || x === 0x2661
399
- || x >= 0x2663 && x <= 0x2665
400
- || x >= 0x2667 && x <= 0x266A
401
- || x === 0x266C
402
- || x === 0x266D
403
- || x === 0x266F
404
- || x === 0x269E
405
- || x === 0x269F
406
- || x === 0x26BF
407
- || x >= 0x26C6 && x <= 0x26CD
408
- || x >= 0x26CF && x <= 0x26D3
409
- || x >= 0x26D5 && x <= 0x26E1
410
- || x === 0x26E3
411
- || x === 0x26E8
412
- || x === 0x26E9
413
- || x >= 0x26EB && x <= 0x26F1
414
- || x === 0x26F4
415
- || x >= 0x26F6 && x <= 0x26F9
416
- || x === 0x26FB
417
- || x === 0x26FC
418
- || x === 0x26FE
419
- || x === 0x26FF
420
- || x === 0x273D
421
- || x >= 0x2776 && x <= 0x277F
422
- || x >= 0x2B56 && x <= 0x2B59
423
- || x >= 0x3248 && x <= 0x324F
424
- || x >= 0xE000 && x <= 0xF8FF
425
- || x >= 0xFE00 && x <= 0xFE0F
426
- || x === 0xFFFD
427
- || x >= 0x1F100 && x <= 0x1F10A
428
- || x >= 0x1F110 && x <= 0x1F12D
429
- || x >= 0x1F130 && x <= 0x1F169
430
- || x >= 0x1F170 && x <= 0x1F18D
431
- || x === 0x1F18F
432
- || x === 0x1F190
433
- || x >= 0x1F19B && x <= 0x1F1AC
434
- || x >= 0xE0100 && x <= 0xE01EF
435
- || x >= 0xF0000 && x <= 0xFFFFD
436
- || x >= 0x100000 && x <= 0x10FFFD;
437
- }
438
-
439
- function isFullWidth$2(x) {
440
- return x === 0x3000
441
- || x >= 0xFF01 && x <= 0xFF60
442
- || x >= 0xFFE0 && x <= 0xFFE6;
443
- }
444
-
445
- function isWide$2(x) {
446
- return x >= 0x1100 && x <= 0x115F
447
- || x === 0x231A
448
- || x === 0x231B
449
- || x === 0x2329
450
- || x === 0x232A
451
- || x >= 0x23E9 && x <= 0x23EC
452
- || x === 0x23F0
453
- || x === 0x23F3
454
- || x === 0x25FD
455
- || x === 0x25FE
456
- || x === 0x2614
457
- || x === 0x2615
458
- || x >= 0x2630 && x <= 0x2637
459
- || x >= 0x2648 && x <= 0x2653
460
- || x === 0x267F
461
- || x >= 0x268A && x <= 0x268F
462
- || x === 0x2693
463
- || x === 0x26A1
464
- || x === 0x26AA
465
- || x === 0x26AB
466
- || x === 0x26BD
467
- || x === 0x26BE
468
- || x === 0x26C4
469
- || x === 0x26C5
470
- || x === 0x26CE
471
- || x === 0x26D4
472
- || x === 0x26EA
473
- || x === 0x26F2
474
- || x === 0x26F3
475
- || x === 0x26F5
476
- || x === 0x26FA
477
- || x === 0x26FD
478
- || x === 0x2705
479
- || x === 0x270A
480
- || x === 0x270B
481
- || x === 0x2728
482
- || x === 0x274C
483
- || x === 0x274E
484
- || x >= 0x2753 && x <= 0x2755
485
- || x === 0x2757
486
- || x >= 0x2795 && x <= 0x2797
487
- || x === 0x27B0
488
- || x === 0x27BF
489
- || x === 0x2B1B
490
- || x === 0x2B1C
491
- || x === 0x2B50
492
- || x === 0x2B55
493
- || x >= 0x2E80 && x <= 0x2E99
494
- || x >= 0x2E9B && x <= 0x2EF3
495
- || x >= 0x2F00 && x <= 0x2FD5
496
- || x >= 0x2FF0 && x <= 0x2FFF
497
- || x >= 0x3001 && x <= 0x303E
498
- || x >= 0x3041 && x <= 0x3096
499
- || x >= 0x3099 && x <= 0x30FF
500
- || x >= 0x3105 && x <= 0x312F
501
- || x >= 0x3131 && x <= 0x318E
502
- || x >= 0x3190 && x <= 0x31E5
503
- || x >= 0x31EF && x <= 0x321E
504
- || x >= 0x3220 && x <= 0x3247
505
- || x >= 0x3250 && x <= 0xA48C
506
- || x >= 0xA490 && x <= 0xA4C6
507
- || x >= 0xA960 && x <= 0xA97C
508
- || x >= 0xAC00 && x <= 0xD7A3
509
- || x >= 0xF900 && x <= 0xFAFF
510
- || x >= 0xFE10 && x <= 0xFE19
511
- || x >= 0xFE30 && x <= 0xFE52
512
- || x >= 0xFE54 && x <= 0xFE66
513
- || x >= 0xFE68 && x <= 0xFE6B
514
- || x >= 0x16FE0 && x <= 0x16FE4
515
- || x === 0x16FF0
516
- || x === 0x16FF1
517
- || x >= 0x17000 && x <= 0x187F7
518
- || x >= 0x18800 && x <= 0x18CD5
519
- || x >= 0x18CFF && x <= 0x18D08
520
- || x >= 0x1AFF0 && x <= 0x1AFF3
521
- || x >= 0x1AFF5 && x <= 0x1AFFB
522
- || x === 0x1AFFD
523
- || x === 0x1AFFE
524
- || x >= 0x1B000 && x <= 0x1B122
525
- || x === 0x1B132
526
- || x >= 0x1B150 && x <= 0x1B152
527
- || x === 0x1B155
528
- || x >= 0x1B164 && x <= 0x1B167
529
- || x >= 0x1B170 && x <= 0x1B2FB
530
- || x >= 0x1D300 && x <= 0x1D356
531
- || x >= 0x1D360 && x <= 0x1D376
532
- || x === 0x1F004
533
- || x === 0x1F0CF
534
- || x === 0x1F18E
535
- || x >= 0x1F191 && x <= 0x1F19A
536
- || x >= 0x1F200 && x <= 0x1F202
537
- || x >= 0x1F210 && x <= 0x1F23B
538
- || x >= 0x1F240 && x <= 0x1F248
539
- || x === 0x1F250
540
- || x === 0x1F251
541
- || x >= 0x1F260 && x <= 0x1F265
542
- || x >= 0x1F300 && x <= 0x1F320
543
- || x >= 0x1F32D && x <= 0x1F335
544
- || x >= 0x1F337 && x <= 0x1F37C
545
- || x >= 0x1F37E && x <= 0x1F393
546
- || x >= 0x1F3A0 && x <= 0x1F3CA
547
- || x >= 0x1F3CF && x <= 0x1F3D3
548
- || x >= 0x1F3E0 && x <= 0x1F3F0
549
- || x === 0x1F3F4
550
- || x >= 0x1F3F8 && x <= 0x1F43E
551
- || x === 0x1F440
552
- || x >= 0x1F442 && x <= 0x1F4FC
553
- || x >= 0x1F4FF && x <= 0x1F53D
554
- || x >= 0x1F54B && x <= 0x1F54E
555
- || x >= 0x1F550 && x <= 0x1F567
556
- || x === 0x1F57A
557
- || x === 0x1F595
558
- || x === 0x1F596
559
- || x === 0x1F5A4
560
- || x >= 0x1F5FB && x <= 0x1F64F
561
- || x >= 0x1F680 && x <= 0x1F6C5
562
- || x === 0x1F6CC
563
- || x >= 0x1F6D0 && x <= 0x1F6D2
564
- || x >= 0x1F6D5 && x <= 0x1F6D7
565
- || x >= 0x1F6DC && x <= 0x1F6DF
566
- || x === 0x1F6EB
567
- || x === 0x1F6EC
568
- || x >= 0x1F6F4 && x <= 0x1F6FC
569
- || x >= 0x1F7E0 && x <= 0x1F7EB
570
- || x === 0x1F7F0
571
- || x >= 0x1F90C && x <= 0x1F93A
572
- || x >= 0x1F93C && x <= 0x1F945
573
- || x >= 0x1F947 && x <= 0x1F9FF
574
- || x >= 0x1FA70 && x <= 0x1FA7C
575
- || x >= 0x1FA80 && x <= 0x1FA89
576
- || x >= 0x1FA8F && x <= 0x1FAC6
577
- || x >= 0x1FACE && x <= 0x1FADC
578
- || x >= 0x1FADF && x <= 0x1FAE9
579
- || x >= 0x1FAF0 && x <= 0x1FAF8
580
- || x >= 0x20000 && x <= 0x2FFFD
581
- || x >= 0x30000 && x <= 0x3FFFD;
582
- }
583
-
584
- function validate$2(codePoint) {
585
- if (!Number.isSafeInteger(codePoint)) {
586
- throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
587
- }
588
- }
589
-
590
- function eastAsianWidth$2(codePoint, {ambiguousAsWide = false} = {}) {
591
- validate$2(codePoint);
592
-
593
- if (
594
- isFullWidth$2(codePoint)
595
- || isWide$2(codePoint)
596
- || (ambiguousAsWide && isAmbiguous$2(codePoint))
597
- ) {
598
- return 2;
599
- }
600
-
601
- return 1;
602
- }
603
-
604
- /* globals WorkerGlobalScope, DedicatedWorkerGlobalScope, SharedWorkerGlobalScope, ServiceWorkerGlobalScope */
605
-
606
- const isBrowser$2 = globalThis.window?.document !== undefined;
607
-
608
- globalThis.process?.versions?.node !== undefined;
609
-
610
- globalThis.process?.versions?.bun !== undefined;
611
-
612
- globalThis.Deno?.version?.deno !== undefined;
613
-
614
- globalThis.process?.versions?.electron !== undefined;
615
-
616
- globalThis.navigator?.userAgent?.includes('jsdom') === true;
617
-
618
- typeof WorkerGlobalScope !== 'undefined' && globalThis instanceof WorkerGlobalScope;
619
-
620
- typeof DedicatedWorkerGlobalScope !== 'undefined' && globalThis instanceof DedicatedWorkerGlobalScope;
621
-
622
- typeof SharedWorkerGlobalScope !== 'undefined' && globalThis instanceof SharedWorkerGlobalScope;
623
-
624
- typeof ServiceWorkerGlobalScope !== 'undefined' && globalThis instanceof ServiceWorkerGlobalScope;
625
-
626
- // Note: I'm intentionally not DRYing up the other variables to keep them "lazy".
627
- const platform$2 = globalThis.navigator?.userAgentData?.platform;
628
-
629
- platform$2 === 'macOS'
630
- || globalThis.navigator?.platform === 'MacIntel' // Even on Apple silicon Macs.
631
- || globalThis.navigator?.userAgent?.includes(' Mac ') === true
632
- || globalThis.process?.platform === 'darwin';
633
-
634
- platform$2 === 'Windows'
635
- || globalThis.navigator?.platform === 'Win32'
636
- || globalThis.process?.platform === 'win32';
637
-
638
- platform$2 === 'Linux'
639
- || globalThis.navigator?.platform?.startsWith('Linux') === true
640
- || globalThis.navigator?.userAgent?.includes(' Linux ') === true
641
- || globalThis.process?.platform === 'linux';
642
-
643
- platform$2 === 'Android'
644
- || globalThis.navigator?.platform === 'Android'
645
- || globalThis.navigator?.userAgent?.includes(' Android ') === true
646
- || globalThis.process?.platform === 'android';
647
-
648
- const ESC$2 = '\u001B[';
649
-
650
- !isBrowser$2 && process.env.TERM_PROGRAM === 'Apple_Terminal';
651
- const isWindows$2 = !isBrowser$2 && process.platform === 'win32';
652
-
653
- isBrowser$2 ? () => {
654
- throw new Error('`process.cwd()` only works in Node.js, not the browser.');
655
- } : process.cwd;
656
-
657
- const cursorUp$2 = (count = 1) => ESC$2 + count + 'A';
658
-
659
- const cursorLeft$2 = ESC$2 + 'G';
660
-
661
- const eraseLines$2 = count => {
662
- let clear = '';
663
-
664
- for (let i = 0; i < count; i++) {
665
- clear += eraseLine$2 + (i < count - 1 ? cursorUp$2() : '');
666
- }
667
-
668
- if (count) {
669
- clear += cursorLeft$2;
670
- }
671
-
672
- return clear;
673
- };
674
- const eraseLine$2 = ESC$2 + '2K';
675
- const eraseScreen$2 = ESC$2 + '2J';
676
-
677
- const clearTerminal$2 = isWindows$2
678
- ? `${eraseScreen$2}${ESC$2}0f`
679
- // 1. Erases the screen (Only done in case `2` is not supported)
680
- // 2. Erases the whole screen including scrollback buffer
681
- // 3. Moves cursor to the top-left position
682
- // More info: https://www.real-world-systems.com/docs/ANSIcode.html
683
- : `${eraseScreen$2}${ESC$2}3J${ESC$2}H`;
684
-
685
- // From: https://github.com/sindresorhus/has-flag/blob/main/index.js
686
- /// function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {
687
- function hasFlag$1(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) {
688
- const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
689
- const position = argv.indexOf(prefix + flag);
690
- const terminatorPosition = argv.indexOf('--');
691
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
692
- }
693
-
694
- const {env: env$1} = process;
695
-
696
- let flagForceColor$1;
697
- if (
698
- hasFlag$1('no-color')
699
- || hasFlag$1('no-colors')
700
- || hasFlag$1('color=false')
701
- || hasFlag$1('color=never')
702
- ) {
703
- flagForceColor$1 = 0;
704
- } else if (
705
- hasFlag$1('color')
706
- || hasFlag$1('colors')
707
- || hasFlag$1('color=true')
708
- || hasFlag$1('color=always')
709
- ) {
710
- flagForceColor$1 = 1;
711
- }
712
-
713
- function envForceColor$1() {
714
- if (!('FORCE_COLOR' in env$1)) {
715
- return;
716
- }
717
-
718
- if (env$1.FORCE_COLOR === 'true') {
719
- return 1;
720
- }
721
-
722
- if (env$1.FORCE_COLOR === 'false') {
723
- return 0;
724
- }
725
-
726
- if (env$1.FORCE_COLOR.length === 0) {
727
- return 1;
728
- }
729
-
730
- const level = Math.min(Number.parseInt(env$1.FORCE_COLOR, 10), 3);
731
-
732
- if (![0, 1, 2, 3].includes(level)) {
733
- return;
734
- }
735
-
736
- return level;
737
- }
738
-
739
- function translateLevel$1(level) {
740
- if (level === 0) {
741
- return false;
742
- }
743
-
744
- return {
745
- level,
746
- hasBasic: true,
747
- has256: level >= 2,
748
- has16m: level >= 3,
749
- };
750
- }
751
-
752
- function _supportsColor$1(haveStream, {streamIsTTY, sniffFlags = true} = {}) {
753
- const noFlagForceColor = envForceColor$1();
754
- if (noFlagForceColor !== undefined) {
755
- flagForceColor$1 = noFlagForceColor;
756
- }
757
-
758
- const forceColor = sniffFlags ? flagForceColor$1 : noFlagForceColor;
759
-
760
- if (forceColor === 0) {
761
- return 0;
762
- }
763
-
764
- if (sniffFlags) {
765
- if (hasFlag$1('color=16m')
766
- || hasFlag$1('color=full')
767
- || hasFlag$1('color=truecolor')) {
768
- return 3;
769
- }
770
-
771
- if (hasFlag$1('color=256')) {
772
- return 2;
773
- }
774
- }
775
-
776
- // Check for Azure DevOps pipelines.
777
- // Has to be above the `!streamIsTTY` check.
778
- if ('TF_BUILD' in env$1 && 'AGENT_NAME' in env$1) {
779
- return 1;
780
- }
781
-
782
- if (haveStream && !streamIsTTY && forceColor === undefined) {
783
- return 0;
784
- }
785
-
786
- const min = forceColor || 0;
787
-
788
- if (env$1.TERM === 'dumb') {
789
- return min;
790
- }
791
-
792
- if (process.platform === 'win32') {
793
- // Windows 10 build 10586 is the first Windows release that supports 256 colors.
794
- // Windows 10 build 14931 is the first release that supports 16m/TrueColor.
795
- const osRelease = os.release().split('.');
796
- if (
797
- Number(osRelease[0]) >= 10
798
- && Number(osRelease[2]) >= 10_586
799
- ) {
800
- return Number(osRelease[2]) >= 14_931 ? 3 : 2;
801
- }
802
-
803
- return 1;
804
- }
805
-
806
- if ('CI' in env$1) {
807
- if (['GITHUB_ACTIONS', 'GITEA_ACTIONS', 'CIRCLECI'].some(key => key in env$1)) {
808
- return 3;
809
- }
810
-
811
- if (['TRAVIS', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env$1) || env$1.CI_NAME === 'codeship') {
812
- return 1;
813
- }
814
-
815
- return min;
816
- }
817
-
818
- if ('TEAMCITY_VERSION' in env$1) {
819
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env$1.TEAMCITY_VERSION) ? 1 : 0;
820
- }
821
-
822
- if (env$1.COLORTERM === 'truecolor') {
823
- return 3;
824
- }
825
-
826
- if (env$1.TERM === 'xterm-kitty') {
827
- return 3;
828
- }
829
-
830
- if ('TERM_PROGRAM' in env$1) {
831
- const version = Number.parseInt((env$1.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
832
-
833
- switch (env$1.TERM_PROGRAM) {
834
- case 'iTerm.app': {
835
- return version >= 3 ? 3 : 2;
836
- }
837
-
838
- case 'Apple_Terminal': {
839
- return 2;
840
- }
841
- // No default
842
- }
843
- }
844
-
845
- if (/-256(color)?$/i.test(env$1.TERM)) {
846
- return 2;
847
- }
848
-
849
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env$1.TERM)) {
850
- return 1;
851
- }
852
-
853
- if ('COLORTERM' in env$1) {
854
- return 1;
855
- }
856
-
857
- return min;
858
- }
859
-
860
- function createSupportsColor$1(stream, options = {}) {
861
- const level = _supportsColor$1(stream, {
862
- streamIsTTY: stream && stream.isTTY,
863
- ...options,
864
- });
865
-
866
- return translateLevel$1(level);
867
- }
868
-
869
- ({
870
- stdout: createSupportsColor$1({isTTY: tty.isatty(1)}),
871
- stderr: createSupportsColor$1({isTTY: tty.isatty(2)}),
872
- });
873
-
874
- function isUnicodeSupported$1() {
875
- const {env} = process;
876
- const {TERM, TERM_PROGRAM} = env;
877
-
878
- if (process.platform !== 'win32') {
879
- return TERM !== 'linux'; // Linux console (kernel)
880
- }
881
-
882
- return Boolean(env.WT_SESSION) // Windows Terminal
883
- || Boolean(env.TERMINUS_SUBLIME) // Terminus (<0.2.27)
884
- || env.ConEmuTask === '{cmd::Cmder}' // ConEmu and cmder
885
- || TERM_PROGRAM === 'Terminus-Sublime'
886
- || TERM_PROGRAM === 'vscode'
887
- || TERM === 'xterm-256color'
888
- || TERM === 'alacritty'
889
- || TERM === 'rxvt-unicode'
890
- || TERM === 'rxvt-unicode-256color'
891
- || env.TERMINAL_EMULATOR === 'JetBrains-JediTerm';
892
- }
893
-
894
- function ansiRegex({onlyFirst = false} = {}) {
895
- // Valid string terminator sequences are BEL, ESC\, and 0x9c
896
- const ST = '(?:\\u0007|\\u001B\\u005C|\\u009C)';
897
- const pattern = [
898
- `[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?${ST})`,
899
- '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))',
900
- ].join('|');
901
-
902
- return new RegExp(pattern, onlyFirst ? undefined : 'g');
903
- }
904
-
905
- const regex = ansiRegex();
906
-
907
- function stripAnsi(string) {
908
- if (typeof string !== 'string') {
909
- throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
910
- }
911
-
912
- // Even though the regex is global, we don't need to reset the `.lastIndex`
913
- // because unlike `.exec()` and `.test()`, `.replace()` does it automatically
914
- // and doing it manually has a performance penalty.
915
- return string.replace(regex, '');
916
- }
917
-
918
- const r$1 = String.raw;
919
- const seq$1 = r$1`(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})`;
920
- const sTags$1 = r$1`\u{E0061}-\u{E007A}`;
921
- const emojiRegex$1 = () => new RegExp(r$1`[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[${sTags$1}]{2}[\u{E0030}-\u{E0039}${sTags$1}]{1,3}\u{E007F}|${seq$1}(?:\u200D${seq$1})*`, 'gu');
922
-
923
- // Generated code.
924
-
925
- function isAmbiguous$1(x) {
926
- return x === 0xA1
927
- || x === 0xA4
928
- || x === 0xA7
929
- || x === 0xA8
930
- || x === 0xAA
931
- || x === 0xAD
932
- || x === 0xAE
933
- || x >= 0xB0 && x <= 0xB4
934
- || x >= 0xB6 && x <= 0xBA
935
- || x >= 0xBC && x <= 0xBF
936
- || x === 0xC6
937
- || x === 0xD0
938
- || x === 0xD7
939
- || x === 0xD8
940
- || x >= 0xDE && x <= 0xE1
941
- || x === 0xE6
942
- || x >= 0xE8 && x <= 0xEA
943
- || x === 0xEC
944
- || x === 0xED
945
- || x === 0xF0
946
- || x === 0xF2
947
- || x === 0xF3
948
- || x >= 0xF7 && x <= 0xFA
949
- || x === 0xFC
950
- || x === 0xFE
951
- || x === 0x101
952
- || x === 0x111
953
- || x === 0x113
954
- || x === 0x11B
955
- || x === 0x126
956
- || x === 0x127
957
- || x === 0x12B
958
- || x >= 0x131 && x <= 0x133
959
- || x === 0x138
960
- || x >= 0x13F && x <= 0x142
961
- || x === 0x144
962
- || x >= 0x148 && x <= 0x14B
963
- || x === 0x14D
964
- || x === 0x152
965
- || x === 0x153
966
- || x === 0x166
967
- || x === 0x167
968
- || x === 0x16B
969
- || x === 0x1CE
970
- || x === 0x1D0
971
- || x === 0x1D2
972
- || x === 0x1D4
973
- || x === 0x1D6
974
- || x === 0x1D8
975
- || x === 0x1DA
976
- || x === 0x1DC
977
- || x === 0x251
978
- || x === 0x261
979
- || x === 0x2C4
980
- || x === 0x2C7
981
- || x >= 0x2C9 && x <= 0x2CB
982
- || x === 0x2CD
983
- || x === 0x2D0
984
- || x >= 0x2D8 && x <= 0x2DB
985
- || x === 0x2DD
986
- || x === 0x2DF
987
- || x >= 0x300 && x <= 0x36F
988
- || x >= 0x391 && x <= 0x3A1
989
- || x >= 0x3A3 && x <= 0x3A9
990
- || x >= 0x3B1 && x <= 0x3C1
991
- || x >= 0x3C3 && x <= 0x3C9
992
- || x === 0x401
993
- || x >= 0x410 && x <= 0x44F
994
- || x === 0x451
995
- || x === 0x2010
996
- || x >= 0x2013 && x <= 0x2016
997
- || x === 0x2018
998
- || x === 0x2019
999
- || x === 0x201C
1000
- || x === 0x201D
1001
- || x >= 0x2020 && x <= 0x2022
1002
- || x >= 0x2024 && x <= 0x2027
1003
- || x === 0x2030
1004
- || x === 0x2032
1005
- || x === 0x2033
1006
- || x === 0x2035
1007
- || x === 0x203B
1008
- || x === 0x203E
1009
- || x === 0x2074
1010
- || x === 0x207F
1011
- || x >= 0x2081 && x <= 0x2084
1012
- || x === 0x20AC
1013
- || x === 0x2103
1014
- || x === 0x2105
1015
- || x === 0x2109
1016
- || x === 0x2113
1017
- || x === 0x2116
1018
- || x === 0x2121
1019
- || x === 0x2122
1020
- || x === 0x2126
1021
- || x === 0x212B
1022
- || x === 0x2153
1023
- || x === 0x2154
1024
- || x >= 0x215B && x <= 0x215E
1025
- || x >= 0x2160 && x <= 0x216B
1026
- || x >= 0x2170 && x <= 0x2179
1027
- || x === 0x2189
1028
- || x >= 0x2190 && x <= 0x2199
1029
- || x === 0x21B8
1030
- || x === 0x21B9
1031
- || x === 0x21D2
1032
- || x === 0x21D4
1033
- || x === 0x21E7
1034
- || x === 0x2200
1035
- || x === 0x2202
1036
- || x === 0x2203
1037
- || x === 0x2207
1038
- || x === 0x2208
1039
- || x === 0x220B
1040
- || x === 0x220F
1041
- || x === 0x2211
1042
- || x === 0x2215
1043
- || x === 0x221A
1044
- || x >= 0x221D && x <= 0x2220
1045
- || x === 0x2223
1046
- || x === 0x2225
1047
- || x >= 0x2227 && x <= 0x222C
1048
- || x === 0x222E
1049
- || x >= 0x2234 && x <= 0x2237
1050
- || x === 0x223C
1051
- || x === 0x223D
1052
- || x === 0x2248
1053
- || x === 0x224C
1054
- || x === 0x2252
1055
- || x === 0x2260
1056
- || x === 0x2261
1057
- || x >= 0x2264 && x <= 0x2267
1058
- || x === 0x226A
1059
- || x === 0x226B
1060
- || x === 0x226E
1061
- || x === 0x226F
1062
- || x === 0x2282
1063
- || x === 0x2283
1064
- || x === 0x2286
1065
- || x === 0x2287
1066
- || x === 0x2295
1067
- || x === 0x2299
1068
- || x === 0x22A5
1069
- || x === 0x22BF
1070
- || x === 0x2312
1071
- || x >= 0x2460 && x <= 0x24E9
1072
- || x >= 0x24EB && x <= 0x254B
1073
- || x >= 0x2550 && x <= 0x2573
1074
- || x >= 0x2580 && x <= 0x258F
1075
- || x >= 0x2592 && x <= 0x2595
1076
- || x === 0x25A0
1077
- || x === 0x25A1
1078
- || x >= 0x25A3 && x <= 0x25A9
1079
- || x === 0x25B2
1080
- || x === 0x25B3
1081
- || x === 0x25B6
1082
- || x === 0x25B7
1083
- || x === 0x25BC
1084
- || x === 0x25BD
1085
- || x === 0x25C0
1086
- || x === 0x25C1
1087
- || x >= 0x25C6 && x <= 0x25C8
1088
- || x === 0x25CB
1089
- || x >= 0x25CE && x <= 0x25D1
1090
- || x >= 0x25E2 && x <= 0x25E5
1091
- || x === 0x25EF
1092
- || x === 0x2605
1093
- || x === 0x2606
1094
- || x === 0x2609
1095
- || x === 0x260E
1096
- || x === 0x260F
1097
- || x === 0x261C
1098
- || x === 0x261E
1099
- || x === 0x2640
1100
- || x === 0x2642
1101
- || x === 0x2660
1102
- || x === 0x2661
1103
- || x >= 0x2663 && x <= 0x2665
1104
- || x >= 0x2667 && x <= 0x266A
1105
- || x === 0x266C
1106
- || x === 0x266D
1107
- || x === 0x266F
1108
- || x === 0x269E
1109
- || x === 0x269F
1110
- || x === 0x26BF
1111
- || x >= 0x26C6 && x <= 0x26CD
1112
- || x >= 0x26CF && x <= 0x26D3
1113
- || x >= 0x26D5 && x <= 0x26E1
1114
- || x === 0x26E3
1115
- || x === 0x26E8
1116
- || x === 0x26E9
1117
- || x >= 0x26EB && x <= 0x26F1
1118
- || x === 0x26F4
1119
- || x >= 0x26F6 && x <= 0x26F9
1120
- || x === 0x26FB
1121
- || x === 0x26FC
1122
- || x === 0x26FE
1123
- || x === 0x26FF
1124
- || x === 0x273D
1125
- || x >= 0x2776 && x <= 0x277F
1126
- || x >= 0x2B56 && x <= 0x2B59
1127
- || x >= 0x3248 && x <= 0x324F
1128
- || x >= 0xE000 && x <= 0xF8FF
1129
- || x >= 0xFE00 && x <= 0xFE0F
1130
- || x === 0xFFFD
1131
- || x >= 0x1F100 && x <= 0x1F10A
1132
- || x >= 0x1F110 && x <= 0x1F12D
1133
- || x >= 0x1F130 && x <= 0x1F169
1134
- || x >= 0x1F170 && x <= 0x1F18D
1135
- || x === 0x1F18F
1136
- || x === 0x1F190
1137
- || x >= 0x1F19B && x <= 0x1F1AC
1138
- || x >= 0xE0100 && x <= 0xE01EF
1139
- || x >= 0xF0000 && x <= 0xFFFFD
1140
- || x >= 0x100000 && x <= 0x10FFFD;
1141
- }
1142
-
1143
- function isFullWidth$1(x) {
1144
- return x === 0x3000
1145
- || x >= 0xFF01 && x <= 0xFF60
1146
- || x >= 0xFFE0 && x <= 0xFFE6;
1147
- }
1148
-
1149
- function isWide$1(x) {
1150
- return x >= 0x1100 && x <= 0x115F
1151
- || x === 0x231A
1152
- || x === 0x231B
1153
- || x === 0x2329
1154
- || x === 0x232A
1155
- || x >= 0x23E9 && x <= 0x23EC
1156
- || x === 0x23F0
1157
- || x === 0x23F3
1158
- || x === 0x25FD
1159
- || x === 0x25FE
1160
- || x === 0x2614
1161
- || x === 0x2615
1162
- || x >= 0x2630 && x <= 0x2637
1163
- || x >= 0x2648 && x <= 0x2653
1164
- || x === 0x267F
1165
- || x >= 0x268A && x <= 0x268F
1166
- || x === 0x2693
1167
- || x === 0x26A1
1168
- || x === 0x26AA
1169
- || x === 0x26AB
1170
- || x === 0x26BD
1171
- || x === 0x26BE
1172
- || x === 0x26C4
1173
- || x === 0x26C5
1174
- || x === 0x26CE
1175
- || x === 0x26D4
1176
- || x === 0x26EA
1177
- || x === 0x26F2
1178
- || x === 0x26F3
1179
- || x === 0x26F5
1180
- || x === 0x26FA
1181
- || x === 0x26FD
1182
- || x === 0x2705
1183
- || x === 0x270A
1184
- || x === 0x270B
1185
- || x === 0x2728
1186
- || x === 0x274C
1187
- || x === 0x274E
1188
- || x >= 0x2753 && x <= 0x2755
1189
- || x === 0x2757
1190
- || x >= 0x2795 && x <= 0x2797
1191
- || x === 0x27B0
1192
- || x === 0x27BF
1193
- || x === 0x2B1B
1194
- || x === 0x2B1C
1195
- || x === 0x2B50
1196
- || x === 0x2B55
1197
- || x >= 0x2E80 && x <= 0x2E99
1198
- || x >= 0x2E9B && x <= 0x2EF3
1199
- || x >= 0x2F00 && x <= 0x2FD5
1200
- || x >= 0x2FF0 && x <= 0x2FFF
1201
- || x >= 0x3001 && x <= 0x303E
1202
- || x >= 0x3041 && x <= 0x3096
1203
- || x >= 0x3099 && x <= 0x30FF
1204
- || x >= 0x3105 && x <= 0x312F
1205
- || x >= 0x3131 && x <= 0x318E
1206
- || x >= 0x3190 && x <= 0x31E5
1207
- || x >= 0x31EF && x <= 0x321E
1208
- || x >= 0x3220 && x <= 0x3247
1209
- || x >= 0x3250 && x <= 0xA48C
1210
- || x >= 0xA490 && x <= 0xA4C6
1211
- || x >= 0xA960 && x <= 0xA97C
1212
- || x >= 0xAC00 && x <= 0xD7A3
1213
- || x >= 0xF900 && x <= 0xFAFF
1214
- || x >= 0xFE10 && x <= 0xFE19
1215
- || x >= 0xFE30 && x <= 0xFE52
1216
- || x >= 0xFE54 && x <= 0xFE66
1217
- || x >= 0xFE68 && x <= 0xFE6B
1218
- || x >= 0x16FE0 && x <= 0x16FE4
1219
- || x === 0x16FF0
1220
- || x === 0x16FF1
1221
- || x >= 0x17000 && x <= 0x187F7
1222
- || x >= 0x18800 && x <= 0x18CD5
1223
- || x >= 0x18CFF && x <= 0x18D08
1224
- || x >= 0x1AFF0 && x <= 0x1AFF3
1225
- || x >= 0x1AFF5 && x <= 0x1AFFB
1226
- || x === 0x1AFFD
1227
- || x === 0x1AFFE
1228
- || x >= 0x1B000 && x <= 0x1B122
1229
- || x === 0x1B132
1230
- || x >= 0x1B150 && x <= 0x1B152
1231
- || x === 0x1B155
1232
- || x >= 0x1B164 && x <= 0x1B167
1233
- || x >= 0x1B170 && x <= 0x1B2FB
1234
- || x >= 0x1D300 && x <= 0x1D356
1235
- || x >= 0x1D360 && x <= 0x1D376
1236
- || x === 0x1F004
1237
- || x === 0x1F0CF
1238
- || x === 0x1F18E
1239
- || x >= 0x1F191 && x <= 0x1F19A
1240
- || x >= 0x1F200 && x <= 0x1F202
1241
- || x >= 0x1F210 && x <= 0x1F23B
1242
- || x >= 0x1F240 && x <= 0x1F248
1243
- || x === 0x1F250
1244
- || x === 0x1F251
1245
- || x >= 0x1F260 && x <= 0x1F265
1246
- || x >= 0x1F300 && x <= 0x1F320
1247
- || x >= 0x1F32D && x <= 0x1F335
1248
- || x >= 0x1F337 && x <= 0x1F37C
1249
- || x >= 0x1F37E && x <= 0x1F393
1250
- || x >= 0x1F3A0 && x <= 0x1F3CA
1251
- || x >= 0x1F3CF && x <= 0x1F3D3
1252
- || x >= 0x1F3E0 && x <= 0x1F3F0
1253
- || x === 0x1F3F4
1254
- || x >= 0x1F3F8 && x <= 0x1F43E
1255
- || x === 0x1F440
1256
- || x >= 0x1F442 && x <= 0x1F4FC
1257
- || x >= 0x1F4FF && x <= 0x1F53D
1258
- || x >= 0x1F54B && x <= 0x1F54E
1259
- || x >= 0x1F550 && x <= 0x1F567
1260
- || x === 0x1F57A
1261
- || x === 0x1F595
1262
- || x === 0x1F596
1263
- || x === 0x1F5A4
1264
- || x >= 0x1F5FB && x <= 0x1F64F
1265
- || x >= 0x1F680 && x <= 0x1F6C5
1266
- || x === 0x1F6CC
1267
- || x >= 0x1F6D0 && x <= 0x1F6D2
1268
- || x >= 0x1F6D5 && x <= 0x1F6D7
1269
- || x >= 0x1F6DC && x <= 0x1F6DF
1270
- || x === 0x1F6EB
1271
- || x === 0x1F6EC
1272
- || x >= 0x1F6F4 && x <= 0x1F6FC
1273
- || x >= 0x1F7E0 && x <= 0x1F7EB
1274
- || x === 0x1F7F0
1275
- || x >= 0x1F90C && x <= 0x1F93A
1276
- || x >= 0x1F93C && x <= 0x1F945
1277
- || x >= 0x1F947 && x <= 0x1F9FF
1278
- || x >= 0x1FA70 && x <= 0x1FA7C
1279
- || x >= 0x1FA80 && x <= 0x1FA89
1280
- || x >= 0x1FA8F && x <= 0x1FAC6
1281
- || x >= 0x1FACE && x <= 0x1FADC
1282
- || x >= 0x1FADF && x <= 0x1FAE9
1283
- || x >= 0x1FAF0 && x <= 0x1FAF8
1284
- || x >= 0x20000 && x <= 0x2FFFD
1285
- || x >= 0x30000 && x <= 0x3FFFD;
1286
- }
1287
-
1288
- function validate$1(codePoint) {
1289
- if (!Number.isSafeInteger(codePoint)) {
1290
- throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
1291
- }
1292
- }
1293
-
1294
- function eastAsianWidth$1(codePoint, {ambiguousAsWide = false} = {}) {
1295
- validate$1(codePoint);
1296
-
1297
- if (
1298
- isFullWidth$1(codePoint)
1299
- || isWide$1(codePoint)
1300
- || (ambiguousAsWide && isAmbiguous$1(codePoint))
1301
- ) {
1302
- return 2;
1303
- }
1304
-
1305
- return 1;
1306
- }
1307
-
1308
- /* globals WorkerGlobalScope, DedicatedWorkerGlobalScope, SharedWorkerGlobalScope, ServiceWorkerGlobalScope */
1309
-
1310
- const isBrowser$1 = globalThis.window?.document !== undefined;
1311
-
1312
- globalThis.process?.versions?.node !== undefined;
1313
-
1314
- globalThis.process?.versions?.bun !== undefined;
1315
-
1316
- globalThis.Deno?.version?.deno !== undefined;
1317
-
1318
- globalThis.process?.versions?.electron !== undefined;
1319
-
1320
- globalThis.navigator?.userAgent?.includes('jsdom') === true;
1321
-
1322
- typeof WorkerGlobalScope !== 'undefined' && globalThis instanceof WorkerGlobalScope;
1323
-
1324
- typeof DedicatedWorkerGlobalScope !== 'undefined' && globalThis instanceof DedicatedWorkerGlobalScope;
1325
-
1326
- typeof SharedWorkerGlobalScope !== 'undefined' && globalThis instanceof SharedWorkerGlobalScope;
1327
-
1328
- typeof ServiceWorkerGlobalScope !== 'undefined' && globalThis instanceof ServiceWorkerGlobalScope;
1329
-
1330
- // Note: I'm intentionally not DRYing up the other variables to keep them "lazy".
1331
- const platform$1 = globalThis.navigator?.userAgentData?.platform;
1332
-
1333
- platform$1 === 'macOS'
1334
- || globalThis.navigator?.platform === 'MacIntel' // Even on Apple silicon Macs.
1335
- || globalThis.navigator?.userAgent?.includes(' Mac ') === true
1336
- || globalThis.process?.platform === 'darwin';
1337
-
1338
- platform$1 === 'Windows'
1339
- || globalThis.navigator?.platform === 'Win32'
1340
- || globalThis.process?.platform === 'win32';
1341
-
1342
- platform$1 === 'Linux'
1343
- || globalThis.navigator?.platform?.startsWith('Linux') === true
1344
- || globalThis.navigator?.userAgent?.includes(' Linux ') === true
1345
- || globalThis.process?.platform === 'linux';
1346
-
1347
- platform$1 === 'Android'
1348
- || globalThis.navigator?.platform === 'Android'
1349
- || globalThis.navigator?.userAgent?.includes(' Android ') === true
1350
- || globalThis.process?.platform === 'android';
1351
-
1352
- const ESC$1 = '\u001B[';
1353
-
1354
- !isBrowser$1 && process.env.TERM_PROGRAM === 'Apple_Terminal';
1355
- const isWindows$1 = !isBrowser$1 && process.platform === 'win32';
1356
-
1357
- isBrowser$1 ? () => {
1358
- throw new Error('`process.cwd()` only works in Node.js, not the browser.');
1359
- } : process.cwd;
1360
-
1361
- const cursorUp$1 = (count = 1) => ESC$1 + count + 'A';
1362
-
1363
- const cursorLeft$1 = ESC$1 + 'G';
1364
-
1365
- const eraseLines$1 = count => {
1366
- let clear = '';
1367
-
1368
- for (let i = 0; i < count; i++) {
1369
- clear += eraseLine$1 + (i < count - 1 ? cursorUp$1() : '');
1370
- }
1371
-
1372
- if (count) {
1373
- clear += cursorLeft$1;
1374
- }
1375
-
1376
- return clear;
1377
- };
1378
- const eraseLine$1 = ESC$1 + '2K';
1379
- const eraseScreen$1 = ESC$1 + '2J';
1380
-
1381
- const clearTerminal$1 = isWindows$1
1382
- ? `${eraseScreen$1}${ESC$1}0f`
1383
- // 1. Erases the screen (Only done in case `2` is not supported)
1384
- // 2. Erases the whole screen including scrollback buffer
1385
- // 3. Moves cursor to the top-left position
1386
- // More info: https://www.real-world-systems.com/docs/ANSIcode.html
1387
- : `${eraseScreen$1}${ESC$1}3J${ESC$1}H`;
1388
-
1389
- // From: https://github.com/sindresorhus/has-flag/blob/main/index.js
1390
- /// function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {
1391
- function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) {
1392
- const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
1393
- const position = argv.indexOf(prefix + flag);
1394
- const terminatorPosition = argv.indexOf('--');
1395
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
1396
- }
1397
-
1398
- const {env} = process;
1399
-
1400
- let flagForceColor;
1401
- if (
1402
- hasFlag('no-color')
1403
- || hasFlag('no-colors')
1404
- || hasFlag('color=false')
1405
- || hasFlag('color=never')
1406
- ) {
1407
- flagForceColor = 0;
1408
- } else if (
1409
- hasFlag('color')
1410
- || hasFlag('colors')
1411
- || hasFlag('color=true')
1412
- || hasFlag('color=always')
1413
- ) {
1414
- flagForceColor = 1;
1415
- }
1416
-
1417
- function envForceColor() {
1418
- if (!('FORCE_COLOR' in env)) {
1419
- return;
1420
- }
1421
-
1422
- if (env.FORCE_COLOR === 'true') {
1423
- return 1;
1424
- }
1425
-
1426
- if (env.FORCE_COLOR === 'false') {
1427
- return 0;
1428
- }
1429
-
1430
- if (env.FORCE_COLOR.length === 0) {
1431
- return 1;
1432
- }
1433
-
1434
- const level = Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
1435
-
1436
- if (![0, 1, 2, 3].includes(level)) {
1437
- return;
1438
- }
1439
-
1440
- return level;
1441
- }
1442
-
1443
- function translateLevel(level) {
1444
- if (level === 0) {
1445
- return false;
1446
- }
1447
-
1448
- return {
1449
- level,
1450
- hasBasic: true,
1451
- has256: level >= 2,
1452
- has16m: level >= 3,
1453
- };
1454
- }
1455
-
1456
- function _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {
1457
- const noFlagForceColor = envForceColor();
1458
- if (noFlagForceColor !== undefined) {
1459
- flagForceColor = noFlagForceColor;
1460
- }
1461
-
1462
- const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
1463
-
1464
- if (forceColor === 0) {
1465
- return 0;
1466
- }
1467
-
1468
- if (sniffFlags) {
1469
- if (hasFlag('color=16m')
1470
- || hasFlag('color=full')
1471
- || hasFlag('color=truecolor')) {
1472
- return 3;
1473
- }
1474
-
1475
- if (hasFlag('color=256')) {
1476
- return 2;
1477
- }
1478
- }
1479
-
1480
- // Check for Azure DevOps pipelines.
1481
- // Has to be above the `!streamIsTTY` check.
1482
- if ('TF_BUILD' in env && 'AGENT_NAME' in env) {
1483
- return 1;
1484
- }
1485
-
1486
- if (haveStream && !streamIsTTY && forceColor === undefined) {
1487
- return 0;
1488
- }
1489
-
1490
- const min = forceColor || 0;
1491
-
1492
- if (env.TERM === 'dumb') {
1493
- return min;
1494
- }
1495
-
1496
- if (process.platform === 'win32') {
1497
- // Windows 10 build 10586 is the first Windows release that supports 256 colors.
1498
- // Windows 10 build 14931 is the first release that supports 16m/TrueColor.
1499
- const osRelease = os.release().split('.');
1500
- if (
1501
- Number(osRelease[0]) >= 10
1502
- && Number(osRelease[2]) >= 10_586
1503
- ) {
1504
- return Number(osRelease[2]) >= 14_931 ? 3 : 2;
1505
- }
1506
-
1507
- return 1;
1508
- }
1509
-
1510
- if ('CI' in env) {
1511
- if (['GITHUB_ACTIONS', 'GITEA_ACTIONS', 'CIRCLECI'].some(key => key in env)) {
1512
- return 3;
1513
- }
1514
-
1515
- if (['TRAVIS', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
1516
- return 1;
1517
- }
1518
-
1519
- return min;
1520
- }
1521
-
1522
- if ('TEAMCITY_VERSION' in env) {
1523
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
1524
- }
1525
-
1526
- if (env.COLORTERM === 'truecolor') {
1527
- return 3;
1528
- }
1529
-
1530
- if (env.TERM === 'xterm-kitty') {
1531
- return 3;
1532
- }
1533
-
1534
- if ('TERM_PROGRAM' in env) {
1535
- const version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
1536
-
1537
- switch (env.TERM_PROGRAM) {
1538
- case 'iTerm.app': {
1539
- return version >= 3 ? 3 : 2;
1540
- }
1541
-
1542
- case 'Apple_Terminal': {
1543
- return 2;
1544
- }
1545
- // No default
1546
- }
1547
- }
1548
-
1549
- if (/-256(color)?$/i.test(env.TERM)) {
1550
- return 2;
1551
- }
1552
-
1553
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
1554
- return 1;
1555
- }
1556
-
1557
- if ('COLORTERM' in env) {
1558
- return 1;
1559
- }
1560
-
1561
- return min;
1562
- }
1563
-
1564
- function createSupportsColor(stream, options = {}) {
1565
- const level = _supportsColor(stream, {
1566
- streamIsTTY: stream && stream.isTTY,
1567
- ...options,
1568
- });
1569
-
1570
- return translateLevel(level);
1571
- }
1572
-
1573
- ({
1574
- stdout: createSupportsColor({isTTY: tty.isatty(1)}),
1575
- stderr: createSupportsColor({isTTY: tty.isatty(2)}),
1576
- });
1577
-
1578
- function isUnicodeSupported() {
1579
- const {env} = process;
1580
- const {TERM, TERM_PROGRAM} = env;
1581
-
1582
- if (process.platform !== 'win32') {
1583
- return TERM !== 'linux'; // Linux console (kernel)
1584
- }
1585
-
1586
- return Boolean(env.WT_SESSION) // Windows Terminal
1587
- || Boolean(env.TERMINUS_SUBLIME) // Terminus (<0.2.27)
1588
- || env.ConEmuTask === '{cmd::Cmder}' // ConEmu and cmder
1589
- || TERM_PROGRAM === 'Terminus-Sublime'
1590
- || TERM_PROGRAM === 'vscode'
1591
- || TERM === 'xterm-256color'
1592
- || TERM === 'alacritty'
1593
- || TERM === 'rxvt-unicode'
1594
- || TERM === 'rxvt-unicode-256color'
1595
- || env.TERMINAL_EMULATOR === 'JetBrains-JediTerm';
1596
- }
1597
-
1598
- const r = String.raw;
1599
- const seq = r`(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})`;
1600
- const sTags = r`\u{E0061}-\u{E007A}`;
1601
- const emojiRegex = () => new RegExp(r`[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[${sTags}]{2}[\u{E0030}-\u{E0039}${sTags}]{1,3}\u{E007F}|${seq}(?:\u200D${seq})*`, 'gu');
1602
-
1603
- // Generated code.
1604
-
1605
- function isAmbiguous(x) {
1606
- return x === 0xA1
1607
- || x === 0xA4
1608
- || x === 0xA7
1609
- || x === 0xA8
1610
- || x === 0xAA
1611
- || x === 0xAD
1612
- || x === 0xAE
1613
- || x >= 0xB0 && x <= 0xB4
1614
- || x >= 0xB6 && x <= 0xBA
1615
- || x >= 0xBC && x <= 0xBF
1616
- || x === 0xC6
1617
- || x === 0xD0
1618
- || x === 0xD7
1619
- || x === 0xD8
1620
- || x >= 0xDE && x <= 0xE1
1621
- || x === 0xE6
1622
- || x >= 0xE8 && x <= 0xEA
1623
- || x === 0xEC
1624
- || x === 0xED
1625
- || x === 0xF0
1626
- || x === 0xF2
1627
- || x === 0xF3
1628
- || x >= 0xF7 && x <= 0xFA
1629
- || x === 0xFC
1630
- || x === 0xFE
1631
- || x === 0x101
1632
- || x === 0x111
1633
- || x === 0x113
1634
- || x === 0x11B
1635
- || x === 0x126
1636
- || x === 0x127
1637
- || x === 0x12B
1638
- || x >= 0x131 && x <= 0x133
1639
- || x === 0x138
1640
- || x >= 0x13F && x <= 0x142
1641
- || x === 0x144
1642
- || x >= 0x148 && x <= 0x14B
1643
- || x === 0x14D
1644
- || x === 0x152
1645
- || x === 0x153
1646
- || x === 0x166
1647
- || x === 0x167
1648
- || x === 0x16B
1649
- || x === 0x1CE
1650
- || x === 0x1D0
1651
- || x === 0x1D2
1652
- || x === 0x1D4
1653
- || x === 0x1D6
1654
- || x === 0x1D8
1655
- || x === 0x1DA
1656
- || x === 0x1DC
1657
- || x === 0x251
1658
- || x === 0x261
1659
- || x === 0x2C4
1660
- || x === 0x2C7
1661
- || x >= 0x2C9 && x <= 0x2CB
1662
- || x === 0x2CD
1663
- || x === 0x2D0
1664
- || x >= 0x2D8 && x <= 0x2DB
1665
- || x === 0x2DD
1666
- || x === 0x2DF
1667
- || x >= 0x300 && x <= 0x36F
1668
- || x >= 0x391 && x <= 0x3A1
1669
- || x >= 0x3A3 && x <= 0x3A9
1670
- || x >= 0x3B1 && x <= 0x3C1
1671
- || x >= 0x3C3 && x <= 0x3C9
1672
- || x === 0x401
1673
- || x >= 0x410 && x <= 0x44F
1674
- || x === 0x451
1675
- || x === 0x2010
1676
- || x >= 0x2013 && x <= 0x2016
1677
- || x === 0x2018
1678
- || x === 0x2019
1679
- || x === 0x201C
1680
- || x === 0x201D
1681
- || x >= 0x2020 && x <= 0x2022
1682
- || x >= 0x2024 && x <= 0x2027
1683
- || x === 0x2030
1684
- || x === 0x2032
1685
- || x === 0x2033
1686
- || x === 0x2035
1687
- || x === 0x203B
1688
- || x === 0x203E
1689
- || x === 0x2074
1690
- || x === 0x207F
1691
- || x >= 0x2081 && x <= 0x2084
1692
- || x === 0x20AC
1693
- || x === 0x2103
1694
- || x === 0x2105
1695
- || x === 0x2109
1696
- || x === 0x2113
1697
- || x === 0x2116
1698
- || x === 0x2121
1699
- || x === 0x2122
1700
- || x === 0x2126
1701
- || x === 0x212B
1702
- || x === 0x2153
1703
- || x === 0x2154
1704
- || x >= 0x215B && x <= 0x215E
1705
- || x >= 0x2160 && x <= 0x216B
1706
- || x >= 0x2170 && x <= 0x2179
1707
- || x === 0x2189
1708
- || x >= 0x2190 && x <= 0x2199
1709
- || x === 0x21B8
1710
- || x === 0x21B9
1711
- || x === 0x21D2
1712
- || x === 0x21D4
1713
- || x === 0x21E7
1714
- || x === 0x2200
1715
- || x === 0x2202
1716
- || x === 0x2203
1717
- || x === 0x2207
1718
- || x === 0x2208
1719
- || x === 0x220B
1720
- || x === 0x220F
1721
- || x === 0x2211
1722
- || x === 0x2215
1723
- || x === 0x221A
1724
- || x >= 0x221D && x <= 0x2220
1725
- || x === 0x2223
1726
- || x === 0x2225
1727
- || x >= 0x2227 && x <= 0x222C
1728
- || x === 0x222E
1729
- || x >= 0x2234 && x <= 0x2237
1730
- || x === 0x223C
1731
- || x === 0x223D
1732
- || x === 0x2248
1733
- || x === 0x224C
1734
- || x === 0x2252
1735
- || x === 0x2260
1736
- || x === 0x2261
1737
- || x >= 0x2264 && x <= 0x2267
1738
- || x === 0x226A
1739
- || x === 0x226B
1740
- || x === 0x226E
1741
- || x === 0x226F
1742
- || x === 0x2282
1743
- || x === 0x2283
1744
- || x === 0x2286
1745
- || x === 0x2287
1746
- || x === 0x2295
1747
- || x === 0x2299
1748
- || x === 0x22A5
1749
- || x === 0x22BF
1750
- || x === 0x2312
1751
- || x >= 0x2460 && x <= 0x24E9
1752
- || x >= 0x24EB && x <= 0x254B
1753
- || x >= 0x2550 && x <= 0x2573
1754
- || x >= 0x2580 && x <= 0x258F
1755
- || x >= 0x2592 && x <= 0x2595
1756
- || x === 0x25A0
1757
- || x === 0x25A1
1758
- || x >= 0x25A3 && x <= 0x25A9
1759
- || x === 0x25B2
1760
- || x === 0x25B3
1761
- || x === 0x25B6
1762
- || x === 0x25B7
1763
- || x === 0x25BC
1764
- || x === 0x25BD
1765
- || x === 0x25C0
1766
- || x === 0x25C1
1767
- || x >= 0x25C6 && x <= 0x25C8
1768
- || x === 0x25CB
1769
- || x >= 0x25CE && x <= 0x25D1
1770
- || x >= 0x25E2 && x <= 0x25E5
1771
- || x === 0x25EF
1772
- || x === 0x2605
1773
- || x === 0x2606
1774
- || x === 0x2609
1775
- || x === 0x260E
1776
- || x === 0x260F
1777
- || x === 0x261C
1778
- || x === 0x261E
1779
- || x === 0x2640
1780
- || x === 0x2642
1781
- || x === 0x2660
1782
- || x === 0x2661
1783
- || x >= 0x2663 && x <= 0x2665
1784
- || x >= 0x2667 && x <= 0x266A
1785
- || x === 0x266C
1786
- || x === 0x266D
1787
- || x === 0x266F
1788
- || x === 0x269E
1789
- || x === 0x269F
1790
- || x === 0x26BF
1791
- || x >= 0x26C6 && x <= 0x26CD
1792
- || x >= 0x26CF && x <= 0x26D3
1793
- || x >= 0x26D5 && x <= 0x26E1
1794
- || x === 0x26E3
1795
- || x === 0x26E8
1796
- || x === 0x26E9
1797
- || x >= 0x26EB && x <= 0x26F1
1798
- || x === 0x26F4
1799
- || x >= 0x26F6 && x <= 0x26F9
1800
- || x === 0x26FB
1801
- || x === 0x26FC
1802
- || x === 0x26FE
1803
- || x === 0x26FF
1804
- || x === 0x273D
1805
- || x >= 0x2776 && x <= 0x277F
1806
- || x >= 0x2B56 && x <= 0x2B59
1807
- || x >= 0x3248 && x <= 0x324F
1808
- || x >= 0xE000 && x <= 0xF8FF
1809
- || x >= 0xFE00 && x <= 0xFE0F
1810
- || x === 0xFFFD
1811
- || x >= 0x1F100 && x <= 0x1F10A
1812
- || x >= 0x1F110 && x <= 0x1F12D
1813
- || x >= 0x1F130 && x <= 0x1F169
1814
- || x >= 0x1F170 && x <= 0x1F18D
1815
- || x === 0x1F18F
1816
- || x === 0x1F190
1817
- || x >= 0x1F19B && x <= 0x1F1AC
1818
- || x >= 0xE0100 && x <= 0xE01EF
1819
- || x >= 0xF0000 && x <= 0xFFFFD
1820
- || x >= 0x100000 && x <= 0x10FFFD;
1821
- }
1822
-
1823
- function isFullWidth(x) {
1824
- return x === 0x3000
1825
- || x >= 0xFF01 && x <= 0xFF60
1826
- || x >= 0xFFE0 && x <= 0xFFE6;
1827
- }
1828
-
1829
- function isWide(x) {
1830
- return x >= 0x1100 && x <= 0x115F
1831
- || x === 0x231A
1832
- || x === 0x231B
1833
- || x === 0x2329
1834
- || x === 0x232A
1835
- || x >= 0x23E9 && x <= 0x23EC
1836
- || x === 0x23F0
1837
- || x === 0x23F3
1838
- || x === 0x25FD
1839
- || x === 0x25FE
1840
- || x === 0x2614
1841
- || x === 0x2615
1842
- || x >= 0x2630 && x <= 0x2637
1843
- || x >= 0x2648 && x <= 0x2653
1844
- || x === 0x267F
1845
- || x >= 0x268A && x <= 0x268F
1846
- || x === 0x2693
1847
- || x === 0x26A1
1848
- || x === 0x26AA
1849
- || x === 0x26AB
1850
- || x === 0x26BD
1851
- || x === 0x26BE
1852
- || x === 0x26C4
1853
- || x === 0x26C5
1854
- || x === 0x26CE
1855
- || x === 0x26D4
1856
- || x === 0x26EA
1857
- || x === 0x26F2
1858
- || x === 0x26F3
1859
- || x === 0x26F5
1860
- || x === 0x26FA
1861
- || x === 0x26FD
1862
- || x === 0x2705
1863
- || x === 0x270A
1864
- || x === 0x270B
1865
- || x === 0x2728
1866
- || x === 0x274C
1867
- || x === 0x274E
1868
- || x >= 0x2753 && x <= 0x2755
1869
- || x === 0x2757
1870
- || x >= 0x2795 && x <= 0x2797
1871
- || x === 0x27B0
1872
- || x === 0x27BF
1873
- || x === 0x2B1B
1874
- || x === 0x2B1C
1875
- || x === 0x2B50
1876
- || x === 0x2B55
1877
- || x >= 0x2E80 && x <= 0x2E99
1878
- || x >= 0x2E9B && x <= 0x2EF3
1879
- || x >= 0x2F00 && x <= 0x2FD5
1880
- || x >= 0x2FF0 && x <= 0x2FFF
1881
- || x >= 0x3001 && x <= 0x303E
1882
- || x >= 0x3041 && x <= 0x3096
1883
- || x >= 0x3099 && x <= 0x30FF
1884
- || x >= 0x3105 && x <= 0x312F
1885
- || x >= 0x3131 && x <= 0x318E
1886
- || x >= 0x3190 && x <= 0x31E5
1887
- || x >= 0x31EF && x <= 0x321E
1888
- || x >= 0x3220 && x <= 0x3247
1889
- || x >= 0x3250 && x <= 0xA48C
1890
- || x >= 0xA490 && x <= 0xA4C6
1891
- || x >= 0xA960 && x <= 0xA97C
1892
- || x >= 0xAC00 && x <= 0xD7A3
1893
- || x >= 0xF900 && x <= 0xFAFF
1894
- || x >= 0xFE10 && x <= 0xFE19
1895
- || x >= 0xFE30 && x <= 0xFE52
1896
- || x >= 0xFE54 && x <= 0xFE66
1897
- || x >= 0xFE68 && x <= 0xFE6B
1898
- || x >= 0x16FE0 && x <= 0x16FE4
1899
- || x === 0x16FF0
1900
- || x === 0x16FF1
1901
- || x >= 0x17000 && x <= 0x187F7
1902
- || x >= 0x18800 && x <= 0x18CD5
1903
- || x >= 0x18CFF && x <= 0x18D08
1904
- || x >= 0x1AFF0 && x <= 0x1AFF3
1905
- || x >= 0x1AFF5 && x <= 0x1AFFB
1906
- || x === 0x1AFFD
1907
- || x === 0x1AFFE
1908
- || x >= 0x1B000 && x <= 0x1B122
1909
- || x === 0x1B132
1910
- || x >= 0x1B150 && x <= 0x1B152
1911
- || x === 0x1B155
1912
- || x >= 0x1B164 && x <= 0x1B167
1913
- || x >= 0x1B170 && x <= 0x1B2FB
1914
- || x >= 0x1D300 && x <= 0x1D356
1915
- || x >= 0x1D360 && x <= 0x1D376
1916
- || x === 0x1F004
1917
- || x === 0x1F0CF
1918
- || x === 0x1F18E
1919
- || x >= 0x1F191 && x <= 0x1F19A
1920
- || x >= 0x1F200 && x <= 0x1F202
1921
- || x >= 0x1F210 && x <= 0x1F23B
1922
- || x >= 0x1F240 && x <= 0x1F248
1923
- || x === 0x1F250
1924
- || x === 0x1F251
1925
- || x >= 0x1F260 && x <= 0x1F265
1926
- || x >= 0x1F300 && x <= 0x1F320
1927
- || x >= 0x1F32D && x <= 0x1F335
1928
- || x >= 0x1F337 && x <= 0x1F37C
1929
- || x >= 0x1F37E && x <= 0x1F393
1930
- || x >= 0x1F3A0 && x <= 0x1F3CA
1931
- || x >= 0x1F3CF && x <= 0x1F3D3
1932
- || x >= 0x1F3E0 && x <= 0x1F3F0
1933
- || x === 0x1F3F4
1934
- || x >= 0x1F3F8 && x <= 0x1F43E
1935
- || x === 0x1F440
1936
- || x >= 0x1F442 && x <= 0x1F4FC
1937
- || x >= 0x1F4FF && x <= 0x1F53D
1938
- || x >= 0x1F54B && x <= 0x1F54E
1939
- || x >= 0x1F550 && x <= 0x1F567
1940
- || x === 0x1F57A
1941
- || x === 0x1F595
1942
- || x === 0x1F596
1943
- || x === 0x1F5A4
1944
- || x >= 0x1F5FB && x <= 0x1F64F
1945
- || x >= 0x1F680 && x <= 0x1F6C5
1946
- || x === 0x1F6CC
1947
- || x >= 0x1F6D0 && x <= 0x1F6D2
1948
- || x >= 0x1F6D5 && x <= 0x1F6D7
1949
- || x >= 0x1F6DC && x <= 0x1F6DF
1950
- || x === 0x1F6EB
1951
- || x === 0x1F6EC
1952
- || x >= 0x1F6F4 && x <= 0x1F6FC
1953
- || x >= 0x1F7E0 && x <= 0x1F7EB
1954
- || x === 0x1F7F0
1955
- || x >= 0x1F90C && x <= 0x1F93A
1956
- || x >= 0x1F93C && x <= 0x1F945
1957
- || x >= 0x1F947 && x <= 0x1F9FF
1958
- || x >= 0x1FA70 && x <= 0x1FA7C
1959
- || x >= 0x1FA80 && x <= 0x1FA89
1960
- || x >= 0x1FA8F && x <= 0x1FAC6
1961
- || x >= 0x1FACE && x <= 0x1FADC
1962
- || x >= 0x1FADF && x <= 0x1FAE9
1963
- || x >= 0x1FAF0 && x <= 0x1FAF8
1964
- || x >= 0x20000 && x <= 0x2FFFD
1965
- || x >= 0x30000 && x <= 0x3FFFD;
1966
- }
1967
-
1968
- function validate(codePoint) {
1969
- if (!Number.isSafeInteger(codePoint)) {
1970
- throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
1971
- }
1972
- }
1973
-
1974
- function eastAsianWidth(codePoint, {ambiguousAsWide = false} = {}) {
1975
- validate(codePoint);
1976
-
1977
- if (
1978
- isFullWidth(codePoint)
1979
- || isWide(codePoint)
1980
- || (ambiguousAsWide && isAmbiguous(codePoint))
1981
- ) {
1982
- return 2;
1983
- }
1984
-
1985
- return 1;
1986
- }
1987
-
1988
- /* globals WorkerGlobalScope, DedicatedWorkerGlobalScope, SharedWorkerGlobalScope, ServiceWorkerGlobalScope */
1989
-
1990
- const isBrowser = globalThis.window?.document !== undefined;
1991
-
1992
- globalThis.process?.versions?.node !== undefined;
1993
-
1994
- globalThis.process?.versions?.bun !== undefined;
1995
-
1996
- globalThis.Deno?.version?.deno !== undefined;
1997
-
1998
- globalThis.process?.versions?.electron !== undefined;
1999
-
2000
- globalThis.navigator?.userAgent?.includes('jsdom') === true;
2001
-
2002
- typeof WorkerGlobalScope !== 'undefined' && globalThis instanceof WorkerGlobalScope;
2003
-
2004
- typeof DedicatedWorkerGlobalScope !== 'undefined' && globalThis instanceof DedicatedWorkerGlobalScope;
2005
-
2006
- typeof SharedWorkerGlobalScope !== 'undefined' && globalThis instanceof SharedWorkerGlobalScope;
2007
-
2008
- typeof ServiceWorkerGlobalScope !== 'undefined' && globalThis instanceof ServiceWorkerGlobalScope;
2009
-
2010
- // Note: I'm intentionally not DRYing up the other variables to keep them "lazy".
2011
- const platform = globalThis.navigator?.userAgentData?.platform;
2012
-
2013
- platform === 'macOS'
2014
- || globalThis.navigator?.platform === 'MacIntel' // Even on Apple silicon Macs.
2015
- || globalThis.navigator?.userAgent?.includes(' Mac ') === true
2016
- || globalThis.process?.platform === 'darwin';
2017
-
2018
- platform === 'Windows'
2019
- || globalThis.navigator?.platform === 'Win32'
2020
- || globalThis.process?.platform === 'win32';
2021
-
2022
- platform === 'Linux'
2023
- || globalThis.navigator?.platform?.startsWith('Linux') === true
2024
- || globalThis.navigator?.userAgent?.includes(' Linux ') === true
2025
- || globalThis.process?.platform === 'linux';
2026
-
2027
- platform === 'Android'
2028
- || globalThis.navigator?.platform === 'Android'
2029
- || globalThis.navigator?.userAgent?.includes(' Android ') === true
2030
- || globalThis.process?.platform === 'android';
2031
-
2032
- const ESC = '\u001B[';
2033
-
2034
- !isBrowser && process.env.TERM_PROGRAM === 'Apple_Terminal';
2035
- const isWindows = !isBrowser && process.platform === 'win32';
2036
-
2037
- isBrowser ? () => {
2038
- throw new Error('`process.cwd()` only works in Node.js, not the browser.');
2039
- } : process.cwd;
2040
-
2041
- const cursorUp = (count = 1) => ESC + count + 'A';
2042
-
2043
- const cursorLeft = ESC + 'G';
2044
-
2045
- const eraseLines = count => {
2046
- let clear = '';
2047
-
2048
- for (let i = 0; i < count; i++) {
2049
- clear += eraseLine + (i < count - 1 ? cursorUp() : '');
2050
- }
2051
-
2052
- if (count) {
2053
- clear += cursorLeft;
2054
- }
2055
-
2056
- return clear;
2057
- };
2058
- const eraseLine = ESC + '2K';
2059
- const eraseScreen = ESC + '2J';
2060
-
2061
- const clearTerminal = isWindows
2062
- ? `${eraseScreen}${ESC}0f`
2063
- // 1. Erases the screen (Only done in case `2` is not supported)
2064
- // 2. Erases the whole screen including scrollback buffer
2065
- // 3. Moves cursor to the top-left position
2066
- // More info: https://www.real-world-systems.com/docs/ANSIcode.html
2067
- : `${eraseScreen}${ESC}3J${ESC}H`;
2068
-
2069
- export { clearTerminal$2 as clearTerminal, clearTerminal$1, clearTerminal as clearTerminal$2, createSupportsColor$2 as createSupportsColor, createSupportsColor$1, createSupportsColor as createSupportsColor$2, eastAsianWidth$2 as eastAsianWidth, eastAsianWidth$1, eastAsianWidth as eastAsianWidth$2, emojiRegex$2 as emojiRegex, emojiRegex$1, emojiRegex as emojiRegex$2, eraseLines$2 as eraseLines, eraseLines$1, eraseLines as eraseLines$2, isUnicodeSupported$2 as isUnicodeSupported, isUnicodeSupported$1, isUnicodeSupported as isUnicodeSupported$2, stripAnsi };