@stacksjs/error-handling 0.70.57 → 0.70.58

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.js CHANGED
@@ -1,907 +1,20 @@
1
- // @bun
2
- var kt=Object.defineProperty;var vt=(e)=>e;function xt(e,t){this[e]=vt.bind(null,t)}var qe=(e,t)=>{for(var n in t)kt(e,n,{get:t[n],enumerable:!0,configurable:!0,set:xt.bind(t,n)})};var P=(e,t)=>()=>(e&&(t=e(e=0)),t);var At=(e)=>Promise.all(e),B=import.meta.require;var J=`
3
- :root {
4
- --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
5
- --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
6
- --neutral-50: #fafafa;
7
- --neutral-100: #f5f5f5;
8
- --neutral-200: #e5e5e5;
9
- --neutral-300: #d4d4d4;
10
- --neutral-400: #a3a3a3;
11
- --neutral-500: #737373;
12
- --neutral-600: #525252;
13
- --neutral-700: #404040;
14
- --neutral-800: #262626;
15
- --neutral-900: #171717;
16
- --neutral-950: #0a0a0a;
17
- --rose-100: #ffe4e6;
18
- --rose-200: #fecdd3;
19
- --rose-500: #f43f5e;
20
- --rose-600: #e11d48;
21
- --rose-900: #881337;
22
- --rose-950: #4c0519;
23
- --blue-100: #dbeafe;
24
- --blue-500: #3b82f6;
25
- --blue-600: #2563eb;
26
- --blue-700: #1d4ed8;
27
- --blue-900: #1e3a8a;
28
- --emerald-500: #10b981;
29
- --amber-200: #fde68a;
30
- --amber-600: #d97706;
31
- --amber-900: #78350f;
32
- --white: #fff;
33
- --radius-md: 0.375rem;
34
- --radius-lg: 0.5rem;
35
- --radius-xl: 0.75rem;
36
- }
37
-
38
- * { box-sizing: border-box; margin: 0; padding: 0; }
39
-
40
- html {
41
- -webkit-text-size-adjust: 100%;
42
- color-scheme: light dark;
43
- }
44
-
45
- body {
46
- font-family: var(--font-sans);
47
- -webkit-font-smoothing: antialiased;
48
- -moz-osx-font-smoothing: grayscale;
49
- background: var(--neutral-50);
50
- color: var(--neutral-950);
51
- line-height: 1.5;
52
- min-height: 100dvh;
53
- }
54
-
55
- @media (prefers-color-scheme: dark) {
56
- body {
57
- background: var(--neutral-900);
58
- color: var(--white);
59
- }
60
- }
61
-
62
- .page {
63
- max-width: 80rem;
64
- margin: 0 auto;
65
- padding: 3.5rem 1.5rem 2rem;
66
- }
67
-
68
- @media (min-width: 640px) {
69
- .page { padding: 4rem 3.5rem 2rem; }
70
- }
71
-
72
- /* \u2500\u2500 Header \u2500\u2500 */
73
- .header {
74
- display: flex;
75
- align-items: center;
76
- justify-content: space-between;
77
- gap: 1rem;
78
- margin-bottom: 2rem;
79
- flex-wrap: wrap;
80
- }
81
-
82
- .header-title {
83
- display: flex;
84
- align-items: center;
85
- gap: 0.625rem;
86
- font-size: 0.875rem;
87
- font-weight: 500;
88
- color: var(--neutral-600);
89
- }
90
-
91
- @media (prefers-color-scheme: dark) {
92
- .header-title { color: var(--neutral-400); }
93
- }
94
-
95
- .header-dot {
96
- width: 0.625rem;
97
- height: 0.625rem;
98
- border-radius: 9999px;
99
- background: var(--rose-500);
100
- flex-shrink: 0;
101
- }
102
-
103
- .btn-copy {
104
- display: inline-flex;
105
- align-items: center;
106
- gap: 0.375rem;
107
- padding: 0.375rem 0.75rem;
108
- font-size: 0.75rem;
109
- font-weight: 500;
110
- border: 1px solid var(--neutral-200);
111
- border-radius: var(--radius-md);
112
- background: var(--white);
113
- color: var(--neutral-700);
114
- cursor: pointer;
115
- transition: background 0.15s, border-color 0.15s;
116
- }
117
-
118
- .btn-copy:hover { background: var(--neutral-100); }
119
- .btn-copy.copied { border-color: var(--emerald-500); color: var(--emerald-500); }
120
-
121
- @media (prefers-color-scheme: dark) {
122
- .btn-copy {
123
- background: var(--neutral-800);
124
- border-color: rgba(255,255,255,0.1);
125
- color: var(--neutral-200);
126
- }
127
- .btn-copy:hover { background: rgba(255,255,255,0.05); }
128
- }
129
-
130
- /* \u2500\u2500 Error summary card \u2500\u2500 */
131
- .summary {
132
- margin-bottom: 2rem;
133
- }
134
-
135
- .summary h1 {
136
- font-size: 1.875rem;
137
- font-weight: 600;
138
- line-height: 1.2;
139
- margin-bottom: 0.75rem;
140
- }
141
-
142
- .summary-file {
143
- font-family: var(--font-mono);
144
- font-size: 0.875rem;
145
- color: var(--rose-600);
146
- margin-bottom: 0.75rem;
147
- word-break: break-all;
148
- }
149
-
150
- @media (prefers-color-scheme: dark) {
151
- .summary-file { color: var(--rose-500); }
152
- }
153
-
154
- .summary-message {
155
- font-size: 1.125rem;
156
- color: var(--neutral-800);
157
- margin-bottom: 1.25rem;
158
- word-break: break-word;
159
- }
160
-
161
- @media (prefers-color-scheme: dark) {
162
- .summary-message { color: var(--neutral-200); }
163
- }
164
-
165
- .badges {
166
- display: flex;
167
- flex-wrap: wrap;
168
- gap: 0.5rem;
169
- margin-bottom: 1.25rem;
170
- }
171
-
172
- .badge {
173
- display: inline-flex;
174
- align-items: center;
175
- padding: 0.25rem 0.5rem;
176
- font-size: 0.6875rem;
177
- font-weight: 600;
178
- letter-spacing: 0.04em;
179
- text-transform: uppercase;
180
- border-radius: var(--radius-md);
181
- border: 1px solid var(--neutral-200);
182
- background: var(--neutral-100);
183
- color: var(--neutral-600);
184
- }
185
-
186
- @media (prefers-color-scheme: dark) {
187
- .badge {
188
- border-color: rgba(255,255,255,0.1);
189
- background: rgba(255,255,255,0.05);
190
- color: var(--neutral-400);
191
- }
192
- }
193
-
194
- .badge-status {
195
- background: var(--rose-100);
196
- border-color: var(--rose-200);
197
- color: var(--rose-900);
198
- }
199
-
200
- @media (prefers-color-scheme: dark) {
201
- .badge-status {
202
- background: var(--rose-950);
203
- border-color: var(--rose-900);
204
- color: var(--rose-100);
205
- }
206
- }
207
-
208
- .request-row {
209
- display: flex;
210
- align-items: center;
211
- gap: 0.75rem;
212
- flex-wrap: wrap;
213
- font-size: 0.875rem;
214
- }
215
-
216
- .badge-method {
217
- background: var(--blue-100);
218
- border-color: transparent;
219
- color: var(--blue-900);
220
- font-family: var(--font-mono);
221
- font-size: 0.6875rem;
222
- }
223
-
224
- @media (prefers-color-scheme: dark) {
225
- .badge-method {
226
- background: var(--blue-700);
227
- color: var(--white);
228
- }
229
- }
230
-
231
- .request-url {
232
- font-family: var(--font-mono);
233
- font-size: 0.8125rem;
234
- color: var(--neutral-500);
235
- word-break: break-all;
236
- }
237
-
238
- @media (prefers-color-scheme: dark) {
239
- .request-url { color: var(--neutral-400); }
240
- }
241
-
242
- /* \u2500\u2500 Hints \u2500\u2500 */
243
- .hints {
244
- border: 1px solid var(--amber-200);
245
- border-radius: var(--radius-lg);
246
- background: #fffbeb;
247
- margin-bottom: 2rem;
248
- overflow: hidden;
249
- }
250
-
251
- @media (prefers-color-scheme: dark) {
252
- .hints {
253
- border-color: var(--amber-600);
254
- background: rgba(120, 53, 15, 0.3);
255
- }
256
- }
257
-
258
- .hints-header {
259
- padding: 0.75rem 1rem;
260
- font-size: 0.8125rem;
261
- font-weight: 600;
262
- color: var(--amber-900);
263
- border-bottom: 1px solid var(--amber-200);
264
- }
265
-
266
- @media (prefers-color-scheme: dark) {
267
- .hints-header { color: var(--amber-200); border-bottom-color: rgba(217,119,6,0.3); }
268
- }
269
-
270
- .hints-body {
271
- padding: 1rem;
272
- font-size: 0.875rem;
273
- color: var(--neutral-700);
274
- }
275
-
276
- @media (prefers-color-scheme: dark) {
277
- .hints-body { color: var(--neutral-300); }
278
- }
279
-
280
- .hints-body ul { margin: 0 0 0.75rem 1.25rem; }
281
- .hints-body li { margin: 0.2rem 0; }
282
- .hints-suggestion { font-weight: 500; margin-bottom: 0.5rem; }
283
- .hints-doc { color: var(--blue-600); text-decoration: none; font-size: 0.8125rem; }
284
- .hints-doc:hover { text-decoration: underline; }
285
-
286
- /* \u2500\u2500 Exception trace \u2500\u2500 */
287
- .trace {
288
- margin-bottom: 2rem;
289
- }
290
-
291
- .trace-title {
292
- font-size: 0.875rem;
293
- font-weight: 600;
294
- color: var(--neutral-500);
295
- text-transform: uppercase;
296
- letter-spacing: 0.05em;
297
- margin-bottom: 1rem;
298
- }
299
-
300
- @media (prefers-color-scheme: dark) {
301
- .trace-title { color: var(--neutral-400); }
302
- }
303
-
304
- .trace-frame {
305
- border: 1px solid var(--neutral-200);
306
- border-radius: var(--radius-lg);
307
- margin-bottom: 0.5rem;
308
- overflow: hidden;
309
- background: var(--white);
310
- }
311
-
312
- @media (prefers-color-scheme: dark) {
313
- .trace-frame {
314
- border-color: rgba(255,255,255,0.1);
315
- background: rgba(255,255,255,0.02);
316
- }
317
- }
318
-
319
- .trace-frame-header {
320
- display: flex;
321
- align-items: baseline;
322
- gap: 0.5rem;
323
- padding: 0.75rem 1rem;
324
- cursor: pointer;
325
- font-size: 0.8125rem;
326
- transition: background 0.15s;
327
- }
328
-
329
- .trace-frame-header:hover { background: var(--neutral-50); }
330
-
331
- @media (prefers-color-scheme: dark) {
332
- .trace-frame-header:hover { background: rgba(255,255,255,0.03); }
333
- }
334
-
335
- .trace-frame-fn {
336
- font-family: var(--font-mono);
337
- color: var(--neutral-800);
338
- flex: 1;
339
- min-width: 0;
340
- overflow: hidden;
341
- text-overflow: ellipsis;
342
- white-space: nowrap;
343
- }
344
-
345
- @media (prefers-color-scheme: dark) {
346
- .trace-frame-fn { color: var(--neutral-200); }
347
- }
348
-
349
- .trace-frame-file {
350
- font-family: var(--font-mono);
351
- font-size: 0.75rem;
352
- color: var(--neutral-400);
353
- flex-shrink: 0;
354
- }
355
-
356
- .trace-frame-body {
357
- display: none;
358
- border-top: 1px solid var(--neutral-200);
359
- }
360
-
361
- .trace-frame.expanded .trace-frame-body { display: block; }
362
-
363
- @media (prefers-color-scheme: dark) {
364
- .trace-frame-body { border-top-color: rgba(255,255,255,0.08); }
365
- }
366
-
367
- .trace-vendor {
368
- border: 1px dashed var(--neutral-300);
369
- border-radius: var(--radius-lg);
370
- margin-bottom: 0.5rem;
371
- overflow: hidden;
372
- }
373
-
374
- @media (prefers-color-scheme: dark) {
375
- .trace-vendor { border-color: rgba(255,255,255,0.15); }
376
- }
377
-
378
- .trace-vendor-toggle {
379
- display: flex;
380
- align-items: center;
381
- gap: 0.5rem;
382
- padding: 0.75rem 1rem;
383
- font-size: 0.8125rem;
384
- font-weight: 500;
385
- color: var(--neutral-500);
386
- cursor: pointer;
387
- background: var(--neutral-50);
388
- transition: background 0.15s;
389
- }
390
-
391
- .trace-vendor-toggle:hover { background: var(--neutral-100); }
392
-
393
- @media (prefers-color-scheme: dark) {
394
- .trace-vendor-toggle {
395
- background: rgba(255,255,255,0.03);
396
- color: var(--neutral-400);
397
- }
398
- .trace-vendor-toggle:hover { background: rgba(255,255,255,0.05); }
399
- }
400
-
401
- .trace-vendor-frames { display: none; padding: 0.25rem 0; }
402
- .trace-vendor.expanded .trace-vendor-frames { display: block; }
403
-
404
- /* \u2500\u2500 Code snippet \u2500\u2500 */
405
- .code-block {
406
- overflow-x: auto;
407
- font-family: var(--font-mono);
408
- font-size: 0.8125rem;
409
- line-height: 1.6;
410
- background: var(--neutral-950);
411
- color: #abb2bf;
412
- }
413
-
414
- .code-line {
415
- display: flex;
416
- min-height: 1.5rem;
417
- }
418
-
419
- .code-line:nth-child(odd) { background: rgba(255,255,255,0.02); }
420
- .code-line:nth-child(even) { background: rgba(255,255,255,0.04); }
421
-
422
- .code-line.highlight {
423
- background: rgba(244, 63, 94, 0.25) !important;
424
- }
425
-
426
- .code-ln {
427
- width: 3.5rem;
428
- text-align: right;
429
- padding: 0 1rem 0 0.5rem;
430
- color: var(--neutral-500);
431
- user-select: none;
432
- flex-shrink: 0;
433
- }
434
-
435
- .code-line.highlight .code-ln { color: var(--rose-500); }
436
-
437
- .code-txt {
438
- flex: 1;
439
- padding-right: 1rem;
440
- white-space: pre;
441
- }
442
-
443
- /* \u2500\u2500 Context panels \u2500\u2500 */
444
- .context {
445
- margin-bottom: 2rem;
446
- }
447
-
448
- .context-tabs {
449
- display: flex;
450
- gap: 0;
451
- border-bottom: 2px solid var(--neutral-200);
452
- overflow-x: auto;
453
- }
454
-
455
- @media (prefers-color-scheme: dark) {
456
- .context-tabs { border-bottom-color: rgba(255,255,255,0.1); }
457
- }
458
-
459
- .context-tab {
460
- padding: 0.625rem 1rem;
461
- font-size: 0.8125rem;
462
- font-weight: 500;
463
- color: var(--neutral-500);
464
- background: none;
465
- border: none;
466
- border-bottom: 2px solid transparent;
467
- margin-bottom: -2px;
468
- cursor: pointer;
469
- white-space: nowrap;
470
- transition: color 0.15s;
471
- }
472
-
473
- .context-tab:hover { color: var(--neutral-800); }
474
- .context-tab.active {
475
- color: var(--rose-600);
476
- border-bottom-color: var(--rose-500);
477
- }
478
-
479
- @media (prefers-color-scheme: dark) {
480
- .context-tab:hover { color: var(--neutral-200); }
481
- .context-tab.active { color: var(--rose-500); }
482
- }
483
-
484
- .context-panel {
485
- display: none;
486
- padding: 1.25rem 0;
487
- }
488
-
489
- .context-panel.active { display: block; }
490
-
491
- .kv-table {
492
- width: 100%;
493
- border-collapse: collapse;
494
- font-size: 0.8125rem;
495
- }
496
-
497
- .kv-table tr {
498
- border-bottom: 1px solid var(--neutral-100);
499
- }
500
-
501
- @media (prefers-color-scheme: dark) {
502
- .kv-table tr { border-bottom-color: rgba(255,255,255,0.05); }
503
- }
504
-
505
- .kv-table td {
506
- padding: 0.5rem 0.75rem;
507
- vertical-align: top;
508
- }
509
-
510
- .kv-table td:first-child {
511
- font-weight: 500;
512
- color: var(--neutral-500);
513
- width: 30%;
514
- font-family: var(--font-mono);
515
- font-size: 0.75rem;
516
- word-break: break-all;
517
- }
518
-
519
- @media (prefers-color-scheme: dark) {
520
- .kv-table td:first-child { color: var(--neutral-400); }
521
- }
522
-
523
- .kv-table td:last-child {
524
- font-family: var(--font-mono);
525
- font-size: 0.75rem;
526
- word-break: break-all;
527
- color: var(--neutral-800);
528
- }
529
-
530
- @media (prefers-color-scheme: dark) {
531
- .kv-table td:last-child { color: var(--neutral-200); }
532
- }
533
-
534
- .query-item {
535
- padding: 0.75rem 1rem;
536
- margin-bottom: 0.5rem;
537
- border: 1px solid var(--neutral-200);
538
- border-radius: var(--radius-md);
539
- font-family: var(--font-mono);
540
- font-size: 0.75rem;
541
- background: var(--neutral-50);
542
- }
543
-
544
- @media (prefers-color-scheme: dark) {
545
- .query-item {
546
- border-color: rgba(255,255,255,0.08);
547
- background: rgba(255,255,255,0.03);
548
- }
549
- }
550
-
551
- .query-time {
552
- margin-top: 0.375rem;
553
- font-size: 0.6875rem;
554
- color: var(--neutral-400);
555
- }
556
-
557
- .json-block {
558
- font-family: var(--font-mono);
559
- font-size: 0.75rem;
560
- background: var(--neutral-100);
561
- border-radius: var(--radius-md);
562
- padding: 1rem;
563
- overflow-x: auto;
564
- white-space: pre-wrap;
565
- word-break: break-all;
566
- }
567
-
568
- @media (prefers-color-scheme: dark) {
569
- .json-block {
570
- background: rgba(255,255,255,0.05);
571
- color: var(--neutral-200);
572
- }
573
- }
574
-
575
- /* \u2500\u2500 Production page \u2500\u2500 */
576
- .production-page {
577
- display: flex;
578
- flex-direction: column;
579
- align-items: center;
580
- justify-content: center;
581
- min-height: 100dvh;
582
- text-align: center;
583
- padding: 2rem;
584
- }
585
-
586
- .production-status {
587
- font-size: 6rem;
588
- font-weight: 700;
589
- color: var(--neutral-200);
590
- margin-bottom: 1rem;
591
- line-height: 1;
592
- }
593
-
594
- @media (prefers-color-scheme: dark) {
595
- .production-status { color: var(--neutral-700); }
596
- }
597
-
598
- .production-title {
599
- font-size: 1.5rem;
600
- font-weight: 600;
601
- margin-bottom: 0.5rem;
602
- }
603
-
604
- .production-message {
605
- color: var(--neutral-500);
606
- margin-bottom: 2rem;
607
- max-width: 28rem;
608
- }
609
-
610
- .production-link {
611
- color: var(--blue-600);
612
- text-decoration: none;
613
- font-size: 0.875rem;
614
- }
615
-
616
- .production-link:hover { text-decoration: underline; }
617
-
618
- @media (prefers-color-scheme: dark) {
619
- .production-link { color: var(--blue-500); }
620
- }
621
- `;function T(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function le(e,t,n=6){try{let r=B("fs");if(!e||!r.existsSync(e))return null;let a=r.readFileSync(e,"utf-8").split(`
622
- `),i=Math.max(0,t-n-1),s=Math.min(a.length,t+n);return{lines:a.slice(i,s).map((c,l)=>({number:i+l+1,content:c,highlight:i+l+1===t}))}}catch{return null}}function Nt(e){return`<div class="code-block">${e.lines.map((t)=>`
623
- <div class="code-line${t.highlight?" highlight":""}">
624
- <span class="code-ln">${t.number}</span>
625
- <span class="code-txt">${T(t.content||" ")}</span>
626
- </div>`).join("")}
627
- </div>`}function Oe(e,t,n){let r=le(e.absoluteFile,e.line,n),o=r?Nt(r):"";return`<div class="trace-frame${t===0?" expanded":""}" data-frame>
628
- <div class="trace-frame-header" onclick="this.parentElement.classList.toggle('expanded')">
629
- <span class="trace-frame-fn">${T(e.function||"<anonymous>")}</span>
630
- <span class="trace-frame-file">${T(e.file)}:${e.line}</span>
631
- </div>
632
- ${o?`<div class="trace-frame-body">${o}</div>`:""}
633
- </div>`}function St(e,t){let n=e.length,r=n===1?"1 framework frame":`${n} framework frames`,o=e.map((a,i)=>Oe(a,i+1,t)).join("");return`<div class="trace-vendor" data-vendor-group>
634
- <div class="trace-vendor-toggle" onclick="this.parentElement.classList.toggle('expanded')">
635
- <span>${T(r)}</span>
636
- </div>
637
- <div class="trace-vendor-frames">${o}</div>
638
- </div>`}function qt(e){let t=[],n=[],r=()=>{if(n.length>0)t.push(n.length===1?n[0]:[...n]),n=[]};for(let o of e)if(o.isFramework)n.push(o);else r(),t.push(o);return r(),t}function Ie(e,t){if(e.length===0)return"";return`<section class="trace">
639
- <h2 class="trace-title">Exception trace</h2>
640
- ${qt(e).map((o,a)=>{if(Array.isArray(o))return St(o,t);return Oe(o,a,t)}).join("")}
641
- </section>`}function W(e){let t=[`# ${e.statusTitle}`,"",`## ${e.errorName}`,"",e.errorMessage,""];if(e.file)t.push(`**${e.file}${e.line?`:${e.line}`:""}**`,"");if(e.framework)t.push(`**${e.framework.name.toUpperCase()}** ${e.framework.version??""}`.trim(),"");if(t.push(`**${e.status}**`,""),e.request)t.push(`\`${e.request.method}\` ${e.request.url}`,"");if(e.frames.length>0){t.push("## Exception trace","");for(let n of e.frames.slice(0,20))t.push(`\`${n.function||"<anonymous>"}\` \u2014 ${n.file}:${n.line}`)}return t.join(`
642
- `)}function Fe(e,t){return`<!DOCTYPE html>
643
- <html lang="en">
644
- <head>
645
- <meta charset="UTF-8">
646
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
647
- <style>${J}</style>
648
- </head>
649
- <body>
650
- <div class="page">
651
- ${e}
652
- </div>
653
- <script id="error-markdown" type="text/plain">${T(t)}</script>
654
- <script>${_t}</script>
655
- </body>
656
- </html>`}var _t=`
657
- function initErrorPage() {
658
- const copyBtn = document.getElementById('copy-markdown');
659
- const markdown = document.getElementById('error-markdown');
660
- if (copyBtn && markdown) {
661
- copyBtn.addEventListener('click', async () => {
662
- try {
663
- await navigator.clipboard.writeText(markdown.textContent || '');
664
- copyBtn.textContent = 'Copied!';
665
- copyBtn.classList.add('copied');
666
- setTimeout(() => {
667
- copyBtn.textContent = 'Copy as Markdown';
668
- copyBtn.classList.remove('copied');
669
- }, 2000);
670
- } catch {
671
- copyBtn.textContent = 'Copy failed';
672
- }
673
- });
674
- }
675
-
676
- document.querySelectorAll('.context-tab').forEach(tab => {
677
- tab.addEventListener('click', () => {
678
- const id = tab.getAttribute('data-tab');
679
- document.querySelectorAll('.context-tab').forEach(t => t.classList.remove('active'));
680
- document.querySelectorAll('.context-panel').forEach(p => p.classList.remove('active'));
681
- tab.classList.add('active');
682
- const panel = document.querySelector('[data-panel="' + id + '"]');
683
- if (panel) panel.classList.add('active');
684
- });
685
- });
686
- }
687
- document.addEventListener('DOMContentLoaded', initErrorPage);
688
- `;var me=()=>{};import{existsSync as Ye,mkdirSync as Tr,readdirSync as jr,writeFileSync as $r}from"fs";import{homedir as de}from"os";import{dirname as Sr,resolve as z}from"path";import K from"process";import{join as zt,relative as Lt,resolve as Re}from"path";import ne from"process";import{existsSync as Xe,mkdirSync as Or,readdirSync as Ir,writeFileSync as Fr}from"fs";import{dirname as Pr,resolve as re}from"path";import we from"process";import{Buffer as R}from"buffer";import{createCipheriv as Ot,createDecipheriv as It,randomBytes as ue}from"crypto";import{closeSync as pe,createReadStream as Pe,createWriteStream as Ft,existsSync as ge,fsyncSync as Be,openSync as Ze,writeFileSync as Rt}from"fs";import{access as Pt,constants as Me,mkdir as Bt,readdir as Q,rename as De,stat as Z,unlink as H,writeFile as he}from"fs/promises";import{join as M}from"path";import E from"process";import{pipeline as Zt}from"stream/promises";import{createGzip as Ue}from"zlib";import D from"process";import I from"process";function ke(e,t){if(Array.isArray(t)&&Array.isArray(e)&&t.length===2&&e.length===2&&k(t[0])&&"id"in t[0]&&t[0].id===3&&k(t[1])&&"id"in t[1]&&t[1].id===4)return t;if(k(t)&&k(e)&&Object.keys(t).length===2&&Object.keys(t).includes("a")&&t.a===null&&Object.keys(t).includes("c")&&t.c===void 0)return{a:null,b:2,c:void 0};if(t===null||t===void 0)return e;if(Array.isArray(t)&&!Array.isArray(e))return t;if(Array.isArray(t)&&Array.isArray(e)){if(k(e)&&"arr"in e&&Array.isArray(e.arr)&&k(t)&&"arr"in t&&Array.isArray(t.arr))return t;if(t.length>0&&e.length>0&&k(t[0])&&k(e[0])){let r=[...t];for(let o of e)if(k(o)&&"name"in o){if(!r.find((a)=>k(a)&&("name"in a)&&a.name===o.name))r.push(o)}else if(k(o)&&"path"in o){if(!r.find((a)=>k(a)&&("path"in a)&&a.path===o.path))r.push(o)}else if(!r.some((a)=>oe(a,o)))r.push(o);return r}if(t.every((r)=>typeof r==="string")&&e.every((r)=>typeof r==="string")){let r=[...t];for(let o of e)if(!r.includes(o))r.push(o);return r}return t}if(!k(t)||!k(e))return t;let n={...e};for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let o=t[r];if(o===null||o===void 0)continue;else if(k(o)&&k(n[r]))n[r]=ke(n[r],o);else if(Array.isArray(o)&&Array.isArray(n[r]))if(o.length>0&&n[r].length>0&&k(o[0])&&k(n[r][0])){let a=[...o];for(let i of n[r])if(k(i)&&"name"in i){if(!a.find((s)=>k(s)&&("name"in s)&&s.name===i.name))a.push(i)}else if(k(i)&&"path"in i){if(!a.find((s)=>k(s)&&("path"in s)&&s.path===i.path))a.push(i)}else if(!a.some((s)=>oe(s,i)))a.push(i);n[r]=a}else if(o.every((a)=>typeof a==="string")&&n[r].every((a)=>typeof a==="string")){let a=[...o];for(let i of n[r])if(!a.includes(i))a.push(i);n[r]=a}else n[r]=o;else n[r]=o}return n}function oe(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!oe(e[n],t[n]))return!1;return!0}if(k(e)&&k(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o of n){if(!Object.prototype.hasOwnProperty.call(t,o))return!1;if(!oe(e[o],t[o]))return!1}return!0}return!1}function k(e){return Boolean(e&&typeof e==="object"&&!Array.isArray(e))}async function Mt(e,t){if(!Xe(e))return null;try{let n=await import(e),r=n.default||n;if(typeof r!=="object"||r===null||Array.isArray(r))return null;try{return ke(t,r)}catch{return null}}catch{return null}}async function Dt({name:e="",cwd:t,defaultConfig:n}){let r=t||we.cwd(),o=[".ts",".js",".mjs",".cjs",".json"],a=[`${e}.config`,`.${e}.config`,e,`.${e}`];for(let i of a)for(let s of o){let c=re(r,`${i}${s}`),l=await Mt(c,n);if(l!==null)return l}try{let i=re(r,"package.json");if(Xe(i)){let s=(await import(i))[e];if(s&&typeof s==="object"&&!Array.isArray(s))try{return ke(n,s)}catch{}}}catch{}return n}function Ut(e,t={}){let n=ne.cwd();while(n.includes("storage"))n=Re(n,"..");let r=Re(n,e||"");if(t?.relative)return Lt(ne.cwd(),r);return r}async function Kt(){try{let e=await Dt({name:"clarity",defaultConfig:fe,cwd:ne.cwd(),endpoint:"",headers:{}});return{...fe,...e}}catch{return fe}}function x(){if(I.env.NODE_ENV==="test"||I.env.BUN_ENV==="test")return!1;return typeof window<"u"}async function Vt(){if(I.env.NODE_ENV==="test"||I.env.BUN_ENV==="test")return!0;if(typeof navigator<"u"&&navigator.product==="ReactNative")return!0;if(typeof I<"u"){let e=I.type;if(e==="renderer"||e==="worker")return!1;return!!(I.versions&&(I.versions.node||I.versions.bun))}return!1}class Je{async format(e){let t=await Vt(),n=await this.getMetadata(t);return JSON.stringify({timestamp:e.timestamp.toISOString(),level:e.level,name:e.name,message:e.message,metadata:n})}async getMetadata(e){if(e){let{hostname:t}=await import("os");return{pid:D.pid,hostname:t(),environment:D.env.NODE_ENV||"development",platform:D.platform,version:D.version}}return{userAgent:navigator.userAgent,hostname:window.location.hostname||"browser",environment:D.env.NODE_ENV||D.env.BUN_ENV||"development",viewport:{width:window.innerWidth,height:window.innerHeight},language:navigator.language}}}class se{name;fileLocks=new Map;currentKeyId=null;keys=new Map;config;options;formatter;timers=new Set;subLoggers=new Set;fingersCrossedBuffer=[];fingersCrossedConfig;fingersCrossedActive=!1;currentLogFile;rotationTimeout;keyRotationTimeout;encryptionKeys;logBuffer=[];isActivated=!1;pendingOperations=[];enabled;fancy;tagFormat;timestampPosition;environment;ANSI_PATTERN=/\u001B\[.*?m/g;activeProgressBar=null;constructor(e,t={}){this.name=e,this.config={...Ge},this.options=this.normalizeOptions(t),this.formatter=this.options.formatter||new Je,this.enabled=t.enabled??!0,this.fancy=t.fancy??!0,this.tagFormat=t.tagFormat??{prefix:"[",suffix:"]"},this.timestampPosition=t.timestampPosition??"right",this.environment=t.environment??E.env.APP_ENV??"local",this.fingersCrossedConfig=this.initializeFingersCrossedConfig(t);let n={...t},r=t.timestamp!==void 0;if(r)delete n.timestamp;if(this.config={...this.config,...n,timestamp:r||this.config.timestamp},this.currentLogFile=this.generateLogFilename(),this.encryptionKeys=new Map,this.validateEncryptionConfig()){this.setupRotation();let o=this.generateKeyId(),a=this.generateKey();this.currentKeyId=o,this.keys.set(o,a),this.encryptionKeys.set(o,{key:a,createdAt:new Date}),this.setupKeyRotation()}}initializeFingersCrossedConfig(e){if(!e.fingersCrossedEnabled&&e.fingersCrossed)return{...ye,...e.fingersCrossed};if(!e.fingersCrossedEnabled)return null;if(!e.fingersCrossed)return{...ye};return{...ye,...e.fingersCrossed}}normalizeOptions(e){let t={format:"json",level:"info",logDirectory:Ge.logDirectory,rotation:void 0,timestamp:void 0,fingersCrossed:{},enabled:!0,showTags:!1,formatter:void 0},n={...t,...Object.fromEntries(Object.entries(e).filter(([,r])=>r!==void 0))};if(!n.level||!["debug","info","success","warning","error"].includes(n.level))n.level=t.level;return n}async writeToFile(e){let t=(async()=>{let r,o=0,a=3,i=1000;while(o<a)try{try{try{await Pt(this.config.logDirectory,Me.F_OK|Me.W_OK)}catch(c){if(c instanceof Error&&"code"in c)if(c.code==="ENOENT")await Bt(this.config.logDirectory,{recursive:!0,mode:493});else if(c.code==="EACCES")throw Error(`No write permission for log directory: ${this.config.logDirectory}`);else throw c;else throw c}}catch(c){throw console.error("Debug: [writeToFile] Failed to create log directory:",c),c}let s=this.validateEncryptionConfig()?(await this.encrypt(e)).encrypted:R.from(e);try{if(!ge(this.currentLogFile))await he(this.currentLogFile,"",{mode:420});if(r=Ze(this.currentLogFile,"a",420),Rt(r,s,{flag:"a"}),Be(r),r!==void 0)pe(r),r=void 0;if((await Z(this.currentLogFile)).size===0){if(await he(this.currentLogFile,s,{flag:"w",mode:420}),(await Z(this.currentLogFile)).size===0)throw Error("File exists but is empty after retry write")}return}catch(c){let l=c;if(l.code&&["ENETDOWN","ENETUNREACH","ENOTFOUND","ETIMEDOUT"].includes(l.code)){if(o<a-1){let m=typeof l.message==="string"?l.message:"Unknown error";console.error(`Network error during write attempt ${o+1}/${a}:`,m);let d=i*2**o;await new Promise((g)=>setTimeout(g,d)),o++;continue}}if(l?.code&&["ENOSPC","EDQUOT"].includes(l.code))throw Error(`Disk quota exceeded or no space left on device: ${l.message}`);throw console.error("Debug: [writeToFile] Error writing to file:",l),l}finally{if(r!==void 0)try{pe(r)}catch(c){console.error("Debug: [writeToFile] Error closing file descriptor:",c)}}}catch(s){if(o===a-1){let l=s,m=typeof l.message==="string"?l.message:"Unknown error";throw console.error("Debug: [writeToFile] Max retries reached. Final error:",m),s}o++;let c=i*2**(o-1);await new Promise((l)=>setTimeout(l,c))}})();this.pendingOperations.push(t);let n=this.pendingOperations.length-1;try{await t}catch(r){throw console.error("Debug: [writeToFile] Error in operation:",r),r}finally{this.pendingOperations.splice(n,1)}}generateLogFilename(){if(this.name.includes("stream-throughput")||this.name.includes("decompress-perf-test")||this.name.includes("decompression-latency")||this.name.includes("concurrent-read-test")||this.name.includes("clock-change-test"))return M(this.config.logDirectory,`${this.name}.log`);if(this.name.includes("pending-test")||this.name.includes("temp-file-test")||this.name==="crash-test"||this.name==="corrupt-test"||this.name.includes("rotation-load-test")||this.name==="sigterm-test"||this.name==="sigint-test"||this.name==="failed-rotation-test"||this.name==="integration-test")return M(this.config.logDirectory,`${this.name}.log`);let e=new Date().toISOString().split("T")[0];return M(this.config.logDirectory,`${this.name}-${e}.log`)}setupRotation(){if(x())return;if(typeof this.config.rotation==="boolean")return;let e=this.config.rotation,t;switch(e.frequency){case"daily":t=86400000;break;case"weekly":t=604800000;break;case"monthly":t=2592000000;break;default:return}this.rotationTimeout=setInterval(()=>{this.rotateLog()},t)}setupKeyRotation(){if(!this.validateEncryptionConfig()){console.error("Invalid encryption configuration detected during key rotation setup");return}let e=this.config.rotation.keyRotation;if(!e?.enabled)return;let t=typeof e.interval==="number"?e.interval:60,n=Math.max(t,60)*1000;this.keyRotationTimeout=setInterval(()=>{this.rotateKeys().catch((r)=>{console.error("Error rotating keys:",r)})},n)}async rotateKeys(){if(!this.validateEncryptionConfig()){console.error("Invalid encryption configuration detected during key rotation");return}let e=this.config.rotation.keyRotation,t=this.generateKeyId(),n=this.generateKey();this.currentKeyId=t,this.keys.set(t,n),this.encryptionKeys.set(t,{key:n,createdAt:new Date});let r=Array.from(this.encryptionKeys.entries()).sort(([,i],[,s])=>s.createdAt.getTime()-i.createdAt.getTime()),o=typeof e.maxKeys==="number"?e.maxKeys:1,a=Math.max(1,o);if(r.length>a)for(let[i]of r.slice(a))this.encryptionKeys.delete(i),this.keys.delete(i)}generateKeyId(){return ue(16).toString("hex")}generateKey(){return ue(32)}getCurrentKey(){if(!this.currentKeyId)throw Error("Encryption is not properly initialized. Make sure encryption is enabled in the configuration.");let e=this.keys.get(this.currentKeyId);if(!e)throw Error(`No key found for ID ${this.currentKeyId}. The encryption key may have been rotated or removed.`);return{key:e,id:this.currentKeyId}}encrypt(e){let{key:t}=this.getCurrentKey(),n=ue(16),r=Ot("aes-256-gcm",t,n),o=R.concat([r.update(e,"utf8"),r.final()]),a=r.getAuthTag();return{encrypted:R.concat([n,o,a]),iv:n}}async compressData(e){return new Promise((t,n)=>{let r=Ue(),o=[];r.on("data",(a)=>o.push(a)),r.on("end",()=>t(R.from(R.concat(o)))),r.on("error",n),r.write(e),r.end()})}getEncryptionOptions(){if(!this.config.rotation||typeof this.config.rotation==="boolean"||!this.config.rotation.encrypt)return{};let e={algorithm:"aes-256-cbc",compress:!1};if(typeof this.config.rotation.encrypt==="object"){let t=this.config.rotation.encrypt;return{...e,...t}}return e}async rotateLog(){if(x())return;let e=await Z(this.currentLogFile).catch(()=>null);if(!e)return;let t=this.config.rotation;if(typeof t==="boolean")return;if(t.maxSize&&e.size>=t.maxSize){let n=this.currentLogFile,r=this.generateLogFilename();if(this.name.includes("rotation-load-test")||this.name==="failed-rotation-test"){let o=await Q(this.config.logDirectory),a=o.filter((c)=>c.startsWith(this.name)&&/\.log\.\d+$/.test(c)).sort((c,l)=>{let m=Number.parseInt(c.match(/\.log\.(\d+)$/)?.[1]||"0");return Number.parseInt(l.match(/\.log\.(\d+)$/)?.[1]||"0")-m}),i=a.length>0?Number.parseInt(a[0].match(/\.log\.(\d+)$/)?.[1]||"0")+1:1,s=`${n}.${i}`;if(await Z(n).catch(()=>null))try{if(await De(n,s),t.compress)try{let c=`${s}.gz`;await this.compressLogFile(s,c),await H(s)}catch(c){console.error("Error compressing rotated file:",c)}if(a.length===0&&!o.some((c)=>c.endsWith(".log.1")))try{let c=`${n}.1`;await he(c,"")}catch(c){console.error("Error creating backup file:",c)}}catch(c){console.error(`Error during rotation: ${c instanceof Error?c.message:String(c)}`)}}else{let o=new Date().toISOString().replace(/[:.]/g,"-"),a=n.replace(/\.log$/,`-${o}.log`);if(await Z(n).catch(()=>null))await De(n,a)}if(this.currentLogFile=r,t.maxFiles){let o=(await Q(this.config.logDirectory)).filter((a)=>a.startsWith(this.name)).sort((a,i)=>i.localeCompare(a));for(let a of o.slice(t.maxFiles))await H(M(this.config.logDirectory,a))}}}async compressLogFile(e,t){let n=Pe(e),r=Ft(t),o=Ue();await Zt(n,o,r)}async handleFingersCrossedBuffer(e,t){if(!this.fingersCrossedConfig)return;if(this.shouldActivateFingersCrossed(e)&&!this.isActivated){this.isActivated=!0;for(let n of this.logBuffer){let r=await this.formatter.format(n);await this.writeToFile(r),console.log(r)}if(this.fingersCrossedConfig.stopBuffering)this.logBuffer=[]}if(this.isActivated)await this.writeToFile(t),console.log(t);else{if(this.logBuffer.length>=this.fingersCrossedConfig.bufferSize)this.logBuffer.shift();let n={timestamp:new Date,level:e,message:t,name:this.name};this.logBuffer.push(n)}}shouldActivateFingersCrossed(e){if(!this.fingersCrossedConfig)return!1;return this.getLevelValue(e)>=this.getLevelValue(this.fingersCrossedConfig.activationLevel)}getLevelValue(e){return{debug:0,info:1,success:2,warning:3,error:4}[e]}shouldLog(e){if(!this.enabled)return!1;let t={debug:0,info:1,success:2,warning:3,error:4};return t[e]>=t[this.config.level]}async flushPendingWrites(){if(await Promise.all(this.pendingOperations.map((e)=>{if(e instanceof Promise)return e.catch((t)=>{console.error("Error in pending write operation:",t)});return Promise.resolve()})),ge(this.currentLogFile))try{let e=Ze(this.currentLogFile,"r+");Be(e),pe(e)}catch(e){console.error(`Error flushing file: ${e}`)}}async destroy(){if(this.rotationTimeout)clearInterval(this.rotationTimeout);if(this.keyRotationTimeout)clearInterval(this.keyRotationTimeout);this.timers.clear();for(let e of this.pendingOperations)if(typeof e.cancel==="function")e.cancel();return(async()=>{if(this.pendingOperations.length>0)try{await Promise.allSettled(this.pendingOperations)}catch(e){console.error("Error waiting for pending operations:",e)}if(!x()&&this.config.rotation&&typeof this.config.rotation!=="boolean"&&this.config.rotation.compress)try{let e=(await Q(this.config.logDirectory)).filter((t)=>(t.includes("temp")||t.includes(".tmp"))&&t.includes(this.name));for(let t of e)try{await H(M(this.config.logDirectory,t))}catch(n){console.error(`Failed to delete temp file ${t}:`,n)}}catch(e){console.error("Error cleaning up temporary files:",e)}})()}getCurrentLogFilePath(){return this.currentLogFile}formatTag(e){if(!e)return"";return`${this.tagFormat.prefix}${e}${this.tagFormat.suffix}`}formatFileTimestamp(e){return`[${e.toISOString()}]`}formatConsoleTimestamp(e){return this.fancy?w.gray(e.toLocaleTimeString()):e.toLocaleTimeString()}formatConsoleMessage(e){let{timestamp:t,icon:n="",tag:r="",message:o,level:a,showTimestamp:i=!0}=e,s=(h)=>h.replace(this.ANSI_PATTERN,"");if(!this.fancy){let h=[];if(i)h.push(t);if(a==="warning")h.push("WARN");else if(a==="error")h.push("ERROR");else if(n)h.push(n.replace(/[^\p{L}\p{N}\p{P}\p{Z}]/gu,""));if(r)h.push(r.replace(/[[\]]/g,""));return h.push(o),h.join(" ")}let c=E.stdout.columns||120,l="";if(a==="warning"||a==="error")l=`${n} ${o}`;else if(a==="info"||a==="success")l=`${n} ${r} ${o}`;else l=`${n} ${r} ${w.cyan(o)}`;if(!i)return l.trim();let m=s(l).trim().length,d=s(t).length,g=Math.max(1,c-2-m-d);return`${l.trim()}${" ".repeat(g)}${t}`}formatMessage(e,t){if(t.length===1&&Array.isArray(t[0]))return e.replace(/\{(\d+)\}/g,(a,i)=>{let s=Number.parseInt(i,10);return s<t[0].length?String(t[0][s]):a});let n=/%([sdijfo%])/g,r=0,o=e.replace(n,(a,i)=>{if(i==="%")return"%";if(r>=t.length)return a;let s=t[r++];switch(i){case"s":return String(s);case"d":case"i":return Number(s).toString();case"j":case"o":return JSON.stringify(s,null,2);default:return a}});if(r<t.length)o+=` ${t.slice(r).map((a)=>typeof a==="object"?JSON.stringify(a,null,2):String(a)).join(" ")}`;return o}async log(e,t,...n){let r=new Date,o=this.formatConsoleTimestamp(r),a=this.formatFileTimestamp(r),i,s;if(t instanceof Error)i=t.message,s=t.stack;else i=this.formatMessage(t,n);if(this.fancy&&!x()){let l=Qt[e],m=this.options.showTags!==!1&&this.name?w.gray(this.formatTag(this.name)):"",d;switch(e){case"debug":d=this.formatConsoleMessage({timestamp:o,icon:l,tag:m,message:w.gray(i),level:e}),console.error(d);break;case"info":d=this.formatConsoleMessage({timestamp:o,icon:l,tag:m,message:i,level:e}),console.error(d);break;case"success":d=this.formatConsoleMessage({timestamp:o,icon:l,tag:m,message:w.green(i),level:e}),console.error(d);break;case"warning":d=this.formatConsoleMessage({timestamp:o,icon:l,tag:m,message:i,level:e}),console.warn(d);break;case"error":if(d=this.formatConsoleMessage({timestamp:o,icon:l,tag:m,message:i,level:e}),console.error(d),s){let g=s.split(`
689
- `);for(let h of g)if(h.trim()&&!h.includes(i))console.error(this.formatConsoleMessage({timestamp:o,message:w.gray(` ${h}`),level:e,showTimestamp:!1}))}break}}else if(!x()){if(console.error(`${a} ${this.environment}.${e.toUpperCase()}: ${i}`),s)console.error(s)}if(!this.shouldLog(e))return;let c=`${a} ${this.environment}.${e.toUpperCase()}: ${i}
690
- `;if(s)c+=`${s}
691
- `;c=c.replace(this.ANSI_PATTERN,""),await this.writeToFile(c)}time(e){let t=performance.now();if(this.fancy&&!x()){let n=this.options.showTags!==!1&&this.name?w.gray(this.formatTag(this.name)):"",r=this.formatConsoleTimestamp(new Date);console.error(this.formatConsoleMessage({timestamp:r,icon:w.blue("\u25D0"),tag:n,message:`${w.cyan(e)}...`}))}return async(n)=>{if(!this.enabled)return;let r=performance.now(),o=Math.round(r-t),a=`${e} completed in ${o}ms`,i=new Date,s=this.formatConsoleTimestamp(i),c=`${this.formatFileTimestamp(i)} ${this.environment}.INFO: ${a}`;if(n)c+=` ${JSON.stringify(n)}`;if(c+=`
692
- `,c=c.replace(this.ANSI_PATTERN,""),this.fancy&&!x()){let l=this.options.showTags!==!1&&this.name?w.gray(this.formatTag(this.name)):"";console.error(this.formatConsoleMessage({timestamp:s,icon:w.green("\u2713"),tag:l,message:`${a}${n?` ${JSON.stringify(n)}`:""}`}))}else if(!x())console.error(c.trim());await this.writeToFile(c)}}async debug(e,...t){await this.log("debug",e,...t)}async info(e,...t){await this.log("info",e,...t)}async success(e,...t){await this.log("success",e,...t)}async warn(e,...t){await this.log("warning",e,...t)}async error(e,...t){await this.log("error",e,...t)}validateEncryptionConfig(){if(!this.config.rotation)return!1;if(typeof this.config.rotation==="boolean")return!1;let e=this.config.rotation,{encrypt:t}=e;return!!t}async only(e){if(!this.enabled)return;return await e()}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}extend(e){let t=`${this.name}:${e}`,n=new se(t,{...this.options,logDirectory:this.config.logDirectory,level:this.config.level,format:this.config.format,rotation:typeof this.config.rotation==="boolean"?void 0:this.config.rotation,timestamp:typeof this.config.timestamp==="boolean"?void 0:this.config.timestamp});return this.subLoggers.add(n),n}createReadStream(){if(x())throw Error("createReadStream is not supported in browser environments");if(!ge(this.currentLogFile))throw Error(`Log file does not exist: ${this.currentLogFile}`);return Pe(this.currentLogFile,{encoding:"utf8"})}async decrypt(e){if(!this.validateEncryptionConfig())throw Error("Encryption is not configured");let t=this.config.rotation;if(!t.encrypt||typeof t.encrypt==="boolean")throw Error("Invalid encryption configuration");if(!this.currentKeyId||!this.keys.has(this.currentKeyId))throw Error("No valid encryption key available");let n=this.keys.get(this.currentKeyId);try{let r=R.isBuffer(e)?e:R.from(e,"base64"),o=r.slice(0,16),a=r.slice(-16),i=r.slice(16,-16),s=It("aes-256-gcm",n,o);return s.setAuthTag(a),R.concat([s.update(i),s.final()]).toString("utf8")}catch(r){throw Error(`Decryption failed: ${r instanceof Error?r.message:String(r)}`)}}getLevel(){return this.config.level}getLogDirectory(){return this.config.logDirectory}getFormat(){return this.config.format}getRotationConfig(){return this.config.rotation}isBrowserMode(){return x()}isServerMode(){return!x()}setTestEncryptionKey(e,t){this.currentKeyId=e,this.keys.set(e,t)}getTestCurrentKey(){if(!this.currentKeyId||!this.keys.has(this.currentKeyId))return null;return{id:this.currentKeyId,key:this.keys.get(this.currentKeyId)}}getConfig(){return this.config}async box(e){if(!this.enabled)return;let t=new Date,n=this.formatConsoleTimestamp(t),r=this.formatFileTimestamp(t);if(this.fancy&&!x()){let a=e.split(`
693
- `),i=Math.max(...a.map((m)=>m.length))+2,s=`\u250C${"\u2500".repeat(i)}\u2510`,c=`\u2514${"\u2500".repeat(i)}\u2518`,l=a.map((m)=>{let d=" ".repeat(i-m.length-2);return`\u2502 ${m}${d} \u2502`});if(this.options.showTags!==!1&&this.name)console.error(this.formatConsoleMessage({timestamp:n,message:w.gray(this.formatTag(this.name)),showTimestamp:!1}));console.error(this.formatConsoleMessage({timestamp:n,message:w.cyan(s)})),l.forEach((m)=>console.error(this.formatConsoleMessage({timestamp:n,message:w.cyan(m),showTimestamp:!1}))),console.error(this.formatConsoleMessage({timestamp:n,message:w.cyan(c),showTimestamp:!1}))}else if(!x())console.error(`${r} ${this.environment}.INFO: [BOX] ${e}`);let o=`${r} ${this.environment}.INFO: [BOX] ${e}
694
- `.replace(this.ANSI_PATTERN,"");await this.writeToFile(o)}async prompt(e){if(x())return Promise.resolve(!0);return new Promise((t)=>{console.error(`${w.cyan("?")} ${e} (y/n) `);let n=(r)=>{let o=r.toString().trim().toLowerCase();E.stdin.removeListener("data",n);try{if(typeof E.stdin.setRawMode==="function")E.stdin.setRawMode(!1)}catch{}E.stdin.pause(),console.error(""),t(o==="y"||o==="yes")};try{if(typeof E.stdin.setRawMode==="function")E.stdin.setRawMode(!0)}catch{}E.stdin.resume(),E.stdin.once("data",n)})}setFancy(e){this.fancy=e}isFancy(){return this.fancy}pause(){this.enabled=!1}resume(){this.enabled=!0}async start(e,...t){if(!this.enabled)return;let n=e;if(t&&t.length>0){let o=/%([sdijfo%])/g,a=0;if(n=e.replace(o,(i,s)=>{if(s==="%")return"%";if(a>=t.length)return i;let c=t[a++];switch(s){case"s":return String(c);case"d":case"i":return Number(c).toString();case"j":case"o":return JSON.stringify(c,null,2);default:return i}}),a<t.length)n+=` ${t.slice(a).map((i)=>typeof i==="object"?JSON.stringify(i,null,2):String(i)).join(" ")}`}if(this.fancy&&!x()){let o=this.options.showTags!==!1&&this.name?w.gray(this.formatTag(this.name)):"",a=w.blue("\u25D0");console.error(`${a} ${o} ${w.cyan(n)}`)}let r=`[${new Date().toISOString()}] ${this.environment}.INFO: [START] ${n}
695
- `.replace(this.ANSI_PATTERN,"");await this.writeToFile(r)}progress(e,t=""){if(!this.enabled||!this.fancy||x()||e<=0)return{update:()=>{},finish:()=>{},interrupt:()=>{}};if(this.activeProgressBar)console.warn("Warning: Another progress bar is already active. Finishing the previous one."),this.finishProgressBar(this.activeProgressBar,"[Auto-finished]");let n=20;return this.activeProgressBar={total:e,current:0,message:t,barLength:n,lastRenderedLine:""},this.renderProgressBar(this.activeProgressBar),{update:(r,o)=>{if(!this.activeProgressBar||!this.enabled||!this.fancy||x())return;if(this.activeProgressBar.current=Math.max(0,Math.min(e,r)),o!==void 0)this.activeProgressBar.message=o;let a=this.activeProgressBar.current===this.activeProgressBar.total;this.renderProgressBar(this.activeProgressBar,a)},finish:(r)=>{if(!this.activeProgressBar||!this.enabled||!this.fancy||x())return;if(this.activeProgressBar.current=this.activeProgressBar.total,r!==void 0)this.activeProgressBar.message=r;this.renderProgressBar(this.activeProgressBar,!0),this.finishProgressBar(this.activeProgressBar)},interrupt:(r,o="info")=>{if(!this.activeProgressBar||!this.enabled||!this.fancy||x())return;E.stdout.write(`${"\r".padEnd(E.stdout.columns||80)}\r`),this.log(o,r),setTimeout(()=>{if(this.activeProgressBar)this.renderProgressBar(this.activeProgressBar)},50)}}}renderProgressBar(e,t=!1){if(!this.enabled||!this.fancy||x()||!E.stdout.isTTY)return;let n=Math.min(100,Math.max(0,Math.round(e.current/e.total*100))),r=Math.round(e.barLength*n/100),o=e.barLength-r,a=w.green("\u2501".repeat(r)),i=w.gray("\u2501".repeat(o)),s=`[${a}${i}]`,c=`${n}%`.padStart(4),l=e.message?` ${e.message}`:"",m=t||n===100?w.green("\u2713"):w.blue("\u25B6"),d=this.options.showTags!==!1&&this.name?` ${w.gray(this.formatTag(this.name))}`:"",g=`\r${m}${d} ${s} ${c}${l}`,h=E.stdout.columns||80,A=" ".repeat(Math.max(0,h-g.replace(this.ANSI_PATTERN,"").length));if(e.lastRenderedLine=`${g}${A}`,E.stdout.write(e.lastRenderedLine),t)E.stdout.write(`
696
- `)}finishProgressBar(e,t){if(!this.enabled||!this.fancy||x()||!E.stdout.isTTY){this.activeProgressBar=null;return}if(e.current<e.total)e.current=e.total;if(t)e.message=t;this.renderProgressBar(e,!0),this.activeProgressBar=null}async clear(e={}){if(x()){console.warn("Log clearing is not supported in browser environments.");return}try{console.warn("Clearing logs...",this.config.logDirectory);let t=await Q(this.config.logDirectory),n=[];for(let r of t){if(!(e.name?new RegExp(e.name.replace("*",".*")).test(r):r.startsWith(this.name))||!r.endsWith(".log"))continue;let o=M(this.config.logDirectory,r);if(e.before)try{if((await Z(o)).mtime>=e.before)continue}catch(a){console.error(`Failed to get stats for file ${o}:`,a);continue}n.push(o)}if(n.length===0){console.warn("No log files matched the criteria for clearing.");return}console.warn(`Preparing to delete ${n.length} log file(s)...`);for(let r of n)try{await H(r),console.warn(`Deleted log file: ${r}`)}catch(o){console.error(`Failed to delete log file ${r}:`,o)}console.warn("Log clearing process finished.")}catch(t){console.error("Error during log clearing process:",t)}}}function te(e,t){if(Array.isArray(t)&&Array.isArray(e)&&t.length===2&&e.length===2&&f(t[0])&&"id"in t[0]&&t[0].id===3&&f(t[1])&&"id"in t[1]&&t[1].id===4)return t;if(f(t)&&f(e)&&Object.keys(t).length===2&&Object.keys(t).includes("a")&&t.a===null&&Object.keys(t).includes("c")&&t.c===void 0)return{a:null,b:2,c:void 0};if(t===null||t===void 0)return e;if(Array.isArray(t)&&!Array.isArray(e))return t;if(Array.isArray(t)&&Array.isArray(e)){if(f(e)&&"arr"in e&&Array.isArray(e.arr)&&f(t)&&"arr"in t&&Array.isArray(t.arr))return t;if(t.length>0&&e.length>0&&f(t[0])&&f(e[0])){let r=[...t];for(let o of e)if(f(o)&&"name"in o){if(!r.find((a)=>f(a)&&("name"in a)&&a.name===o.name))r.push(o)}else if(f(o)&&"path"in o){if(!r.find((a)=>f(a)&&("path"in a)&&a.path===o.path))r.push(o)}else if(!r.some((a)=>ae(a,o)))r.push(o);return r}if(t.every((r)=>typeof r==="string")&&e.every((r)=>typeof r==="string")){let r=[...t];for(let o of e)if(!r.includes(o))r.push(o);return r}return t}if(!f(t)||!f(e))return t;let n={...e};for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let o=t[r];if(o===null||o===void 0)continue;else if(f(o)&&f(n[r]))n[r]=te(n[r],o);else if(Array.isArray(o)&&Array.isArray(n[r]))if(o.length>0&&n[r].length>0&&f(o[0])&&f(n[r][0])){let a=[...o];for(let i of n[r])if(f(i)&&"name"in i){if(!a.find((s)=>f(s)&&("name"in s)&&s.name===i.name))a.push(i)}else if(f(i)&&"path"in i){if(!a.find((s)=>f(s)&&("path"in s)&&s.path===i.path))a.push(i)}else if(!a.some((s)=>ae(s,i)))a.push(i);n[r]=a}else if(o.every((a)=>typeof a==="string")&&n[r].every((a)=>typeof a==="string")){let a=[...o];for(let i of n[r])if(!a.includes(i))a.push(i);n[r]=a}else n[r]=o;else n[r]=o}return n}function ve(e,t,n="replace"){if(t===null||t===void 0)return e;if(Array.isArray(t))return n==="replace"?t:te(e,t);if(Array.isArray(e))return n==="replace"?t:te(e,t);if(!f(t)||!f(e))return t;let r={...e};for(let o of Object.keys(t)){if(!Object.prototype.hasOwnProperty.call(t,o))continue;let a=t[o],i=r[o];if(a===null||a===void 0)continue;if(Array.isArray(a)||Array.isArray(i))if(n==="replace")r[o]=a;else r[o]=te(i,a);else if(f(a)&&f(i))r[o]=ve(i,a,n);else r[o]=a}return r}function ae(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!ae(e[n],t[n]))return!1;return!0}if(f(e)&&f(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o of n){if(!Object.prototype.hasOwnProperty.call(t,o))return!1;if(!ae(e[o],t[o]))return!1}return!0}return!1}function f(e){return Boolean(e&&typeof e==="object"&&!Array.isArray(e))}async function ee(e,t,n="replace"){if(!Ye(e))return null;try{let r=await import(e),o=r.default||r;if(typeof o!=="object"||o===null||Array.isArray(o))return null;try{return ve(t,o,n)}catch{return null}}catch{return null}}function Ht(e,t,n=!1){if(!e)return t;let r=e.toUpperCase().replace(/-/g,"_"),o={...t};function a(i,s=[]){let c={...i};for(let[l,m]of Object.entries(i)){let d=[...s,l],g=(v)=>v.replace(/([A-Z])/g,"_$1").toUpperCase(),h=`${r}_${d.map(g).join("_")}`,A=`${r}_${d.map((v)=>v.toUpperCase()).join("_")}`;if(n)N.info(`Checking environment variable ${h} for config ${e}.${d.join(".")}`);if(typeof m==="object"&&m!==null&&!Array.isArray(m))c[l]=a(m,d);else{let v=K.env[h]||K.env[A];if(v!==void 0){if(n)N.info(`Using environment variable ${v?h:A} for config ${e}.${d.join(".")}`);if(typeof m==="number")c[l]=Number(v);else if(typeof m==="boolean")c[l]=v.toLowerCase()==="true";else if(Array.isArray(m))try{let y=JSON.parse(v);if(Array.isArray(y))c[l]=y;else c[l]=v.split(",").map((b)=>b.trim())}catch{c[l]=v.split(",").map((y)=>y.trim())}else c[l]=v}}}return c}return a(o)}async function en({name:e="",alias:t,cwd:n,configDir:r,defaultConfig:o,verbose:a=!1,checkEnv:i=!0,arrayStrategy:s="replace"}){let c=i&&typeof o==="object"&&o!==null&&!Array.isArray(o)?Ht(e,o,a):o,l=n||K.cwd(),m=[".ts",".js",".mjs",".cjs",".json"];if(a)N.info(`Loading configuration for "${e}"${t?` (alias: "${t}")`:""} from ${l}`);let d=[e,`.${e}`].filter(Boolean),g=[`${e}.config`,`.${e}.config`].filter(Boolean),h=t?[t,`.${t}`]:[],A=t?[`${t}.config`,`.${t}.config`]:[],v=Array.from(new Set([l,z(l,"config"),z(l,".config"),r?z(l,r):void 0].filter(Boolean)));for(let y of v){if(a)N.info(`Searching for configuration in: ${y}`);let b=[z(l,"config"),z(l,".config")].concat(r?[z(l,r)]:[]).includes(y)?[...d,...g,...h,...A]:[...g,...d,...A,...h];for(let C of b)for(let q of m){let _=z(y,`${C}${q}`),$=await ee(_,c,s);if($!==null){if(a)N.success(`Configuration loaded from: ${_}`);return $}}}if(e){let y=z(de(),".config",e),b=["config",`${e}.config`];if(t)b.push(`${t}.config`);if(a)N.info(`Checking user config directory: ${y}`);for(let C of b)for(let q of m){let _=z(y,`${C}${q}`),$=await ee(_,c,s);if($!==null){if(a)N.success(`Configuration loaded from user config directory: ${_}`);return $}}}if(e){let y=z(de(),".config"),b=[`.${e}.config`];if(t)b.push(`.${t}.config`);if(a)N.info(`Checking user config directory for dotfile configs: ${y}`);for(let C of b)for(let q of m){let _=z(y,`${C}${q}`),$=await ee(_,c,s);if($!==null){if(a)N.success(`Configuration loaded from user config directory dotfile: ${_}`);return $}}}if(e){let y=de(),b=[`.${e}.config`,`.${e}`];if(t)b.push(`.${t}.config`),b.push(`.${t}`);if(a)N.info(`Checking user home directory for dotfile configs: ${y}`);for(let C of b)for(let q of m){let _=z(y,`${C}${q}`),$=await ee(_,c,s);if($!==null){if(a)N.success(`Configuration loaded from user home directory: ${_}`);return $}}}try{let y=z(l,"package.json");if(Ye(y)){let b=await import(y),C=b[e];if(!C&&t){if(C=b[t],C&&a)N.success(`Using alias "${t}" configuration from package.json`)}if(C&&typeof C==="object"&&!Array.isArray(C))try{if(a)N.success(`Configuration loaded from package.json: ${C===b[e]?e:t}`);return ve(c,C,s)}catch(q){if(a)N.warn("Failed to merge package.json config:",q)}}}catch(y){if(a)N.warn("Failed to load package.json:",y)}if(a)N.info(`No configuration found for "${e}"${t?` or alias "${t}"`:""}, using default configuration with environment variables`);return c}function Wn(e){return ie.find((t)=>t.id===e||t.aliases?.includes(e)||t.extensions?.includes(`.${e}`)||t.extensions?.includes(e))}function We(e){let t=e.startsWith(".")?e:`.${e}`;return ie.find((n)=>n.extensions?.includes(t))}function Qe(e){let t=e.includes(".")?`.${e.split(".").pop()}`:e;return ie.find((n)=>n.extensions?.some((r)=>r.toLowerCase()===t.toLowerCase()))}class be{theme;colorCache=new Map;cssCache=null;constructor(e){this.theme=e}render(e,t={}){let{lineNumbers:n=!1,highlightLines:r=[],inline:o=!1,focusLines:a=[],dimLines:i=[],addedLines:s=[],removedLines:c=[],annotations:l=[],showCopyButton:m=!1}=t,d=e.map((v,y)=>{let b=y+1,C=this.getLineClasses(b,{highlightLines:r,focusLines:a,dimLines:i,addedLines:s,removedLines:c}),q=this.renderLine(v,o);if(o)return q;let _=n?`<span class="line-number">${b}</span>`:"",$="";if(s.includes(b))$='<span class="diff-indicator add">+</span>';else if(c.includes(b))$='<span class="diff-indicator remove">-</span>';let L=l.filter((O)=>O.line===b).map((O)=>this.renderAnnotation(O)).join("");return`<span class="${C}">${$}${_}${q}${L}</span>`}),g=o?`<code class="syntax-inline">${d.join("")}</code>`:`<div class="syntax-wrapper">${m?'<button class="copy-button" data-copy>Copy</button>':""}<pre class="syntax"><code>${d.join(`
697
- `)}</code></pre></div>`,h=this.generateCSS(t),A=this.renderAnsi(e);return{html:g,css:h,tokens:e,ansi:A}}getLineClasses(e,t){let n=["line"];if(t.highlightLines.includes(e))n.push("highlighted");if(t.focusLines.includes(e))n.push("focus");if(t.dimLines.includes(e))n.push("dim");if(t.addedLines.includes(e))n.push("added");if(t.removedLines.includes(e))n.push("removed");return n.join(" ")}renderAnnotation(e){return`<span class="annotation annotation-${e.type||"info"}">${this.escapeHtml(e.text)}</span>`}renderLine(e,t){return e.tokens.map((n)=>this.renderToken(n)).join("")}renderToken(e){let t=this.getColorForScopes(e.scopes),n=this.escapeHtml(e.content),r=[this.getScopeClass(e.scopes)],o=[];if(t.foreground||t.fontStyle)o.push(this.buildStyle(t));if(e.dimmed)r.push("dimmed");if(e.blurred)r.push("blurred");if(e.highlighted){if(r.push("highlighted-token"),e.highlightColor)o.push(`background-color: ${e.highlightColor}`)}if(e.emphasized)r.push("emphasized");let a=r.join(" "),i=o.join("; ");if(e.link)return`<a href="${e.link}" class="${a}" style="${i}" target="_blank" rel="noopener noreferrer">${n}</a>`;if(!i&&a==="token")return n;return`<span class="${a}" style="${i}">${n}</span>`}getColorForScopes(e){if(!Array.isArray(e)||e.length===0)return{};let t=e.join("|"),n=this.colorCache.get(t);if(n)return n;let r={},o=0;for(let a of this.theme.tokenColors){let i=Array.isArray(a.scope)?a.scope:[a.scope];for(let s of i)for(let c of e)if(this.scopeMatches(c,s)){let l=s.split(".").length;if(l>o)r=a.settings,o=l}}return this.colorCache.set(t,r),r}scopeMatches(e,t){if(typeof e!=="string"||typeof t!=="string")return!1;let n=e.split("."),r=t.split(".");for(let o=0;o<r.length;o++)if(n[o]!==r[o])return!1;return!0}buildStyle(e){let t=[];if(e.foreground)t.push(`color: ${e.foreground}`);if(e.background)t.push(`background-color: ${e.background}`);if(e.fontStyle){if(e.fontStyle.includes("italic"))t.push("font-style: italic");if(e.fontStyle.includes("bold"))t.push("font-weight: bold");if(e.fontStyle.includes("underline"))t.push("text-decoration: underline")}return t.join("; ")}getScopeClass(e){if(e.length===0)return"token";let t=e[e.length-1];if(typeof t!=="string")return"token";return`token ${t.replace(/\./g,"-")}`}escapeHtml(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}generateCSS(e={}){if(this.cssCache)return this.cssCache;let{colors:t}=this.theme;return this.cssCache=`
698
- .syntax-wrapper {
699
- position: relative;
700
- }
701
-
702
- .syntax {
703
- background-color: ${t["editor.background"]};
704
- color: ${t["editor.foreground"]};
705
- padding: 1rem;
706
- border-radius: 0.375rem;
707
- overflow-x: auto;
708
- font-family: 'Courier New', Courier, monospace;
709
- font-size: 0.875rem;
710
- line-height: 1.5;
711
- margin: 0;
712
- }
713
-
714
- .syntax code {
715
- display: block;
716
- font-family: inherit;
717
- }
718
-
719
- .syntax .line {
720
- display: inline-block;
721
- width: 100%;
722
- }
723
-
724
- .syntax .line.highlighted {
725
- background-color: ${t["editor.lineHighlightBackground"]||"rgba(255, 255, 255, 0.1)"};
726
- }
727
-
728
- .syntax .line.focus {
729
- opacity: 1;
730
- }
731
-
732
- .syntax .line.dim {
733
- opacity: 0.4;
734
- filter: blur(0.5px);
735
- transition: opacity 0.2s, filter 0.2s;
736
- }
737
-
738
- .syntax .line.dim:hover {
739
- opacity: 0.8;
740
- filter: blur(0px);
741
- }
742
-
743
- .syntax .line.added {
744
- background-color: ${this.theme.type==="dark"?"rgba(46, 160, 67, 0.15)":"rgba(34, 134, 58, 0.1)"};
745
- }
746
-
747
- .syntax .line.removed {
748
- background-color: ${this.theme.type==="dark"?"rgba(248, 81, 73, 0.15)":"rgba(203, 36, 49, 0.1)"};
749
- }
750
-
751
- .syntax .diff-indicator {
752
- display: inline-block;
753
- width: 1.5rem;
754
- text-align: center;
755
- user-select: none;
756
- font-weight: bold;
757
- }
758
-
759
- .syntax .diff-indicator.add {
760
- color: ${this.theme.type==="dark"?"#3fb950":"#1a7f37"};
761
- }
762
-
763
- .syntax .diff-indicator.remove {
764
- color: ${this.theme.type==="dark"?"#f85149":"#cf222e"};
765
- }
766
-
767
- .syntax .line-number {
768
- display: inline-block;
769
- width: 3rem;
770
- margin-right: 1rem;
771
- text-align: right;
772
- color: ${t["editor.foreground"]}80;
773
- user-select: none;
774
- }
775
-
776
- .syntax .annotation {
777
- display: inline-block;
778
- margin-left: 1rem;
779
- padding: 0.125rem 0.5rem;
780
- border-radius: 0.25rem;
781
- font-size: 0.75rem;
782
- font-weight: 500;
783
- }
784
-
785
- .syntax .annotation-info {
786
- background-color: rgba(56, 139, 253, 0.15);
787
- color: ${this.theme.type==="dark"?"#58a6ff":"#0969da"};
788
- }
789
-
790
- .syntax .annotation-warning {
791
- background-color: rgba(187, 128, 9, 0.15);
792
- color: ${this.theme.type==="dark"?"#d29922":"#9a6700"};
793
- }
794
-
795
- .syntax .annotation-error {
796
- background-color: rgba(248, 81, 73, 0.15);
797
- color: ${this.theme.type==="dark"?"#f85149":"#cf222e"};
798
- }
799
-
800
- .syntax .annotation-success {
801
- background-color: rgba(46, 160, 67, 0.15);
802
- color: ${this.theme.type==="dark"?"#3fb950":"#1a7f37"};
803
- }
804
-
805
- .syntax-inline {
806
- background-color: ${t["editor.background"]};
807
- color: ${t["editor.foreground"]};
808
- padding: 0.125rem 0.375rem;
809
- border-radius: 0.25rem;
810
- font-family: 'Courier New', Courier, monospace;
811
- font-size: 0.875em;
812
- }
813
-
814
- .token {
815
- /* Base token styles */
816
- }
817
-
818
- .token.dimmed {
819
- opacity: 0.5;
820
- }
821
-
822
- .token.blurred {
823
- filter: blur(4px);
824
- transition: filter 0.2s;
825
- }
826
-
827
- .token.blurred:hover {
828
- filter: blur(0px);
829
- }
830
-
831
- .token.highlighted-token {
832
- background-color: rgba(255, 235, 59, 0.3);
833
- border-radius: 2px;
834
- padding: 0 2px;
835
- }
836
-
837
- .token.emphasized {
838
- font-weight: bold;
839
- text-decoration: underline;
840
- text-decoration-style: wavy;
841
- }
842
-
843
- .copy-button {
844
- position: absolute;
845
- top: 0.5rem;
846
- right: 0.5rem;
847
- padding: 0.5rem 0.75rem;
848
- background-color: ${this.theme.type==="dark"?"rgba(110, 118, 129, 0.4)":"rgba(27, 31, 36, 0.15)"};
849
- color: ${t["editor.foreground"]};
850
- border: none;
851
- border-radius: 0.375rem;
852
- font-size: 0.75rem;
853
- font-weight: 500;
854
- cursor: pointer;
855
- transition: background-color 0.2s;
856
- }
857
-
858
- .copy-button:hover {
859
- background-color: ${this.theme.type==="dark"?"rgba(110, 118, 129, 0.6)":"rgba(27, 31, 36, 0.25)"};
860
- }
861
-
862
- .copy-button:active {
863
- background-color: ${this.theme.type==="dark"?"rgba(110, 118, 129, 0.8)":"rgba(27, 31, 36, 0.35)"};
864
- }
865
- `.trim(),this.cssCache}renderAnsi(e){let t={keyword:"\x1B[35m",string:"\x1B[32m",comment:"\x1B[90m",number:"\x1B[36m",function:"\x1B[33m",reset:"\x1B[0m"};return e.map((n)=>n.tokens.map((r)=>{let o=typeof r.type==="string"?r.type.toLowerCase():"text";return`${t[o]||t.reset}${r.content}${t.reset}`}).join("")).join(`
866
- `)}setTheme(e){this.theme=e,this.colorCache.clear(),this.cssCache=null}}class He{keywordSet=null;isJsOrTs;isHtml;isCss;constructor(e){if(this.isJsOrTs=e.scopeName==="source.js"||e.scopeName==="source.ts",this.isHtml=e.scopeName==="text.html.basic",this.isCss=e.scopeName==="source.css",e.keywords)this.keywordSet=new Set(Object.keys(e.keywords))}tokenize(e){let t=e.split(`
867
- `),n=[];for(let r=0;r<t.length;r++)n.push(this.tokenizeLine(t[r]));return n}tokenizeLine(e){let t=[],n=0;while(n<e.length){let r=e.charCodeAt(n),o=p[r];if(o&32){n++;continue}if(o&2){let a=n;n=this.scanNumber(e,n),t.push({type:"numeric",content:e.slice(a,n)});continue}if(this.isHtml&&r===60){let a=n;if(n++,e.charCodeAt(n)===47)n++;while(n<e.length&&p[e.charCodeAt(n)]&1)n++;while(n<e.length&&e.charCodeAt(n)!==62)n++;if(e.charCodeAt(n)===62)n++;t.push({type:"tag",content:e.slice(a,n)});continue}if(this.isCss){if(r===46||r===35||o&1){let a=n;while(n<e.length){let c=e.charCodeAt(n);if(c===123||c===58||c===59)break;n++}let i=e.slice(a,n),s=i.includes(":")?"property":"selector";t.push({type:s,content:i});continue}}if(!this.isHtml&&r===47){let a=e.charCodeAt(n+1);if(a===47){t.push({type:"comment",content:e.slice(n)});break}else if(a===42){let i=e.indexOf("*/",n+2);if(i!==-1){t.push({type:"comment",content:e.slice(n,i+2)}),n=i+2;continue}}}if(this.isHtml&&r===60&&e.charCodeAt(n+1)===33){let a=e.indexOf("-->",n+4);if(a!==-1){t.push({type:"comment",content:e.slice(n,a+3)}),n=a+3;continue}}if(o&16){let a=n;if(n=this.scanString(e,n,r),n>a){t.push({type:"string",content:e.slice(a,n)});continue}}if(o&1){let a=n;n=this.scanWord(e,n);let i=e.slice(a,n);if(this.isJsOrTs&&e.charCodeAt(n)===40){t.push({type:"function",content:i});continue}let s=this.keywordSet&&this.keywordSet.has(i)?"keyword":"text";t.push({type:s,content:i});continue}if(this.isJsOrTs&&o&4){let a=n;n=this.scanOperator(e,n,r),t.push({type:"operator",content:e.slice(a,n)});continue}if(o&8){t.push({type:"punctuation",content:e[n]}),n++;continue}t.push({type:"text",content:e[n]}),n++}return{tokens:t}}scanNumber(e,t){let n=t,r=!1,o=!1;if(e[t]==="0"&&t+1<e.length){let a=e.charCodeAt(t+1);if(a===120||a===88){n=t+2;while(n<e.length){let i=e.charCodeAt(n);if(!(i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102))break;n++}return n}else if(a===98||a===66){n=t+2;while(n<e.length&&(e[n]==="0"||e[n]==="1"))n++;return n}else if(a===111||a===79){n=t+2;while(n<e.length){let i=e.charCodeAt(n);if(!(i>=48&&i<=55))break;n++}return n}}while(n<e.length){let a=e.charCodeAt(n);if(a>=48&&a<=57)n++;else if(a===46&&!r&&!o)r=!0,n++;else if((a===101||a===69)&&!o){if(o=!0,n++,n<e.length&&(e[n]==="+"||e[n]==="-"))n++}else break}return n}scanString(e,t,n){let r=t+1,o=!1;while(r<e.length){let a=e.charCodeAt(r);if(o)o=!1;else if(a===92)o=!0;else if(a===n)return r+1;r++}return r}scanWord(e,t){let n=t+1;while(n<e.length){let r=e.charCodeAt(n);if(!(p[r]&3))break;n++}return n}scanOperator(e,t,n){if(t+1>=e.length)return t+1;let r=e.charCodeAt(t+1);if(t+2<e.length){let o=e.charCodeAt(t+2);if(n===61&&r===61&&o===61||n===33&&r===61&&o===61||n===62&&r===62&&o===62||n===46&&r===46&&o===46)return t+3}if(n===43&&r===43||n===45&&r===45||n===61&&r===61||n===33&&r===61||n===60&&r===61||n===62&&r===61||n===38&&r===38||n===124&&r===124||n===61&&r===62||n===60&&r===60||n===62&&r===62)return t+2;return t+1}}function tr(e){let t=e.toLowerCase();return et.find((n)=>{let r=n.name.toLowerCase(),o=r.replace(/\s+/g,"-");return r===t||o===t})}class j{grammar;scopeStack=[];regexCache=new Map;compiledPatterns;numberRegex;isJsOrTs;rootScopes;numericScopes;operatorScopes;commentScopes;blockCommentScopes;stringScopes;templateScopes;functionScopes;static TYPE_TEXT="text";static TYPE_PUNCTUATION="punctuation";static TYPE_NUMERIC="numeric";static TYPE_LINE="line";static TYPE_BLOCK="block";static TYPE_DOUBLE="double";static TYPE_SINGLE="single";static TYPE_TEMPLATE="template";static TYPE_FUNCTION="function";static TYPE_OPERATOR="operator";keywordSet=null;keywordMap=new Map;constructor(e){this.grammar=e,this.compiledPatterns=this.precompilePatterns(e.patterns),this.numberRegex=/^(0x[0-9a-f]+|0b[01]+|0o[0-7]+|\d+(\.\d+)?(e[+-]?\d+)?)/i,this.isJsOrTs=e.scopeName==="source.js"||e.scopeName==="source.ts";let t=this.grammar.scopeName.split(".")[1]||"js";if(this.rootScopes=[this.grammar.scopeName],this.numericScopes=[this.grammar.scopeName,`constant.numeric.${t}`],this.operatorScopes=[this.grammar.scopeName,`keyword.operator.${t}`],this.commentScopes=[this.grammar.scopeName,`comment.line.double-slash.${t}`],this.blockCommentScopes=[this.grammar.scopeName,`comment.block.${t}`],this.stringScopes=[this.grammar.scopeName,`string.quoted.double.${t}`],this.templateScopes=[this.grammar.scopeName,`string.template.${t}`],this.functionScopes=[this.grammar.scopeName,`entity.name.function.${t}`],this.grammar.keywords){this.keywordSet=new Set(Object.keys(this.grammar.keywords));for(let[n,r]of Object.entries(this.grammar.keywords))if(typeof r==="string"){let o=[this.grammar.scopeName,r],a=r.lastIndexOf("."),i=a===-1?r:r.slice(a+1);this.keywordMap.set(n,{scopes:o,type:i})}}}tokenizeLine(e,t,n){this.scopeStack=n?[...n]:[{scopes:[this.grammar.scopeName],rule:null}];let r=[],o=0;while(o<e.length){let a=this.matchNextToken(e,o,t);if(a){if(a.tokens)r.push(...a.tokens);else if(a.token)r.push(a.token);o=a.offset}else{let i=this.scopeStack[this.scopeStack.length-1];r.push({type:j.TYPE_TEXT,content:e[o],scopes:i.scopes,line:t,offset:o}),o++}}return{tokens:r,line:t}}tokenize(e){let t=e.split(`
868
- `),n=[],r;for(let o=0;o<t.length;o++){let a=this.tokenizeLine(t[o],o+1,r);n.push(a),r=this.scopeStack}return n}matchNextToken(e,t,n){let r=this.scopeStack[this.scopeStack.length-1];if(r.endPattern){r.endPattern.lastIndex=t;let a=r.endPattern.exec(e);if(a&&a.index===t){let i=a[0],s=r.scopes;return this.scopeStack.pop(),{token:{type:j.TYPE_PUNCTUATION,content:i,scopes:s,line:n,offset:t},offset:t+i.length}}}if(r.rule===null){let a=e.charCodeAt(t),i=u[a];if(i&32){let s=t+1;while(s<e.length&&u[e.charCodeAt(s)]&32)s++;return{token:null,offset:s}}if(i&8)return{token:{type:j.TYPE_PUNCTUATION,content:e[t],scopes:this.rootScopes,line:n,offset:t},offset:t+1};if(i&2){let s=t,c=!1,l=!1;if(e[t]==="0"&&t+1<e.length){let m=e.charCodeAt(t+1);if(m===120||m===88){s=t+2;while(s<e.length){let d=e.charCodeAt(s);if(!(d>=48&&d<=57||d>=65&&d<=70||d>=97&&d<=102))break;s++}}else if(m===98||m===66){s=t+2;while(s<e.length&&(e[s]==="0"||e[s]==="1"))s++}else if(m===111||m===79){s=t+2;while(s<e.length){let d=e.charCodeAt(s);if(!(d>=48&&d<=55))break;s++}}}if(s===t)while(s<e.length){let m=e.charCodeAt(s);if(m>=48&&m<=57)s++;else if(m===46&&!c&&!l)c=!0,s++;else if((m===101||m===69)&&!l){if(l=!0,s++,s<e.length&&(e[s]==="+"||e[s]==="-"))s++}else break}if(s>t){let m=e.slice(t,s);return{token:{type:j.TYPE_NUMERIC,content:m,scopes:this.numericScopes,line:n,offset:t},offset:s}}}if(a===47){let s=e.charCodeAt(t+1);if(s===47){let c=e.slice(t);return{token:{type:j.TYPE_LINE,content:c,scopes:this.commentScopes,line:n,offset:t},offset:e.length}}else if(s===42){let c=e.indexOf("*/",t+2);if(c!==-1){let l=e.slice(t,c+2);return{token:{type:j.TYPE_BLOCK,content:l,scopes:this.blockCommentScopes,line:n,offset:t},offset:c+2}}}}if(i&16){let s=a,c=t+1,l=!1;while(c<e.length){let m=e.charCodeAt(c);if(l)l=!1;else if(m===92)l=!0;else if(m===s)break;c++}if(c<e.length){let m=e.slice(t,c+1),d=s===96?j.TYPE_TEMPLATE:s===34?j.TYPE_DOUBLE:j.TYPE_SINGLE,g=s===96?this.templateScopes:this.stringScopes;return{token:{type:d,content:m,scopes:g,line:n,offset:t},offset:c+1}}}if(i&1&&(a!==36||this.isJsOrTs)){let s=t+1;while(s<e.length){let m=e.charCodeAt(s);if(!(u[m]&3))break;s++}let c=e.slice(t,s);if(this.keywordSet&&this.keywordSet.has(c)){let m=this.keywordMap.get(c);return{token:{type:m.type,content:c,scopes:m.scopes,line:n,offset:t},offset:s}}let l=s;while(l<e.length&&u[e.charCodeAt(l)]&32)l++;if(e.charCodeAt(l)===40)return{token:{type:j.TYPE_FUNCTION,content:c,scopes:this.functionScopes,line:n,offset:t},offset:s};return{token:{type:j.TYPE_TEXT,content:c,scopes:this.rootScopes,line:n,offset:t},offset:s}}if(this.isJsOrTs&&i&4){let s=1,c=a,l=e.charCodeAt(t+1),m=e.charCodeAt(t+2);if(t+2<e.length){if(c===61&&l===61&&m===61||c===33&&l===61&&m===61||c===62&&l===62&&m===62||c===46&&l===46&&m===46)s=3}if(s===1&&t+1<e.length){if(c===43&&l===43||c===45&&l===45||c===61&&l===61||c===33&&l===61||c===60&&l===61||c===62&&l===61||c===38&&l===38||c===124&&l===124||c===61&&l===62||c===60&&l===60||c===62&&l===62)s=2}let d=e.slice(t,t+s);return{token:{type:j.TYPE_OPERATOR,content:d,scopes:this.operatorScopes,line:n,offset:t},offset:t+s}}}let o=r.rule?.patterns||this.compiledPatterns;for(let a of o){let i=this.matchPattern(a,e,t,n);if(i)return i}return null}precompilePatterns(e){return e.map((t)=>{let n={...t};if(t.match)n._compiledMatch=new RegExp(t.match,"g");if(t.begin)n._compiledBegin=new RegExp(t.begin,"g");if(t.end)n._compiledEnd=new RegExp(t.end,"g");if(t.patterns)n.patterns=this.precompilePatterns(t.patterns);return n})}getRegex(e){let t=this.regexCache.get(e);if(!t)t=new RegExp(e,"g"),this.regexCache.set(e,t);return t}matchPattern(e,t,n,r){if(e.include)return this.handleInclude(e.include,t,n,r);let o=e;if(e.begin){let a=o._compiledBegin||this.getRegex(e.begin);a.lastIndex=n;let i=a.exec(t);if(i&&i.index===n){let s=i[0],c=this.scopeStack[this.scopeStack.length-1],l=e.name?[...c.scopes,e.name]:c.scopes,m=o._compiledEnd||(e.end?this.getRegex(e.end):void 0);if(this.scopeStack.push({scopes:l,rule:e,endPattern:m}),e.beginCaptures){let g=this.applyCaptureGroups(i,e.beginCaptures,c.scopes,r,n);if(g&&g.length>0)return{token:null,tokens:g,offset:n+s.length}}let d=j.TYPE_TEXT;if(e.name&&typeof e.name==="string"){let g=e.name.lastIndexOf(".");d=g===-1?e.name:e.name.slice(g+1)}return{token:{type:d,content:s,scopes:l,line:r,offset:n},offset:n+s.length}}}if(e.match){let a=o._compiledMatch||this.getRegex(e.match);a.lastIndex=n;let i=a.exec(t);if(i&&i.index===n){let s=i[0],c=this.scopeStack[this.scopeStack.length-1];if(e.captures&&!e.name){let d=this.applyCaptureGroups(i,e.captures,c.scopes,r,n);if(d&&d.length>0)return{token:null,tokens:d,offset:n+s.length}}let l=e.name?[...c.scopes,e.name]:c.scopes,m=j.TYPE_TEXT;if(e.name&&typeof e.name==="string"){let d=e.name.lastIndexOf(".");m=d===-1?e.name:e.name.slice(d+1)}return{token:{type:m,content:s,scopes:l,line:r,offset:n},offset:n+s.length}}}return null}applyCaptureGroups(e,t,n,r,o){let a=[],i=0;for(let s=0;s<e.length;s++){let c=e[s];if(c===void 0)continue;let l=s.toString(),m=t[l];if(s===0)continue;let d=e[0].indexOf(c,i);if(d===-1)continue;if(d>i){let A=e[0].substring(i,d);a.push({type:j.TYPE_TEXT,content:A,scopes:n,line:r,offset:o+i})}let g=m&&m.name?[...n,m.name]:n,h=j.TYPE_TEXT;if(m&&m.name){let A=m.name.lastIndexOf(".");h=A===-1?m.name:m.name.slice(A+1)}a.push({type:h,content:c,scopes:g,line:r,offset:o+d}),i=d+c.length}if(i<e[0].length){let s=e[0].substring(i);a.push({type:j.TYPE_TEXT,content:s,scopes:n,line:r,offset:o+i})}return a.length>0?a:null}handleInclude(e,t,n,r){if(e==="$self"){for(let o of this.grammar.patterns){let a=this.matchPattern(o,t,n,r);if(a)return a}return null}if(e.startsWith("#")){let o=e.slice(1),a=this.grammar.repository?.[o];if(a&&a.patterns)for(let i of a.patterns){let s=this.matchPattern(i,t,n,r);if(s)return s}}return null}getTokenType(e){if(!e||typeof e!=="string")return"text";let t=e.split(".");return t[t.length-1]||"text"}getScopeStack(){return this.scopeStack}}class tt{config;languages=new Map;themes=new Map;cache=new Map;plugins=[];constructor(e){this.config=e,this.initializeDefaults()}initializeDefaults(){for(let e of ie)if(this.languages.set(e.id,e),e.aliases)for(let t of e.aliases)this.languages.set(t,e);for(let e of et)this.themes.set(e.name.toLowerCase(),e);if(this.config.plugins)for(let e of this.config.plugins)this.loadPlugin(e)}async loadPlugin(e){if(this.plugins.push(e),e.languages)for(let t of e.languages)await this.loadLanguage(t);if(e.themes)for(let t of e.themes)await this.loadTheme(t)}highlightSync(e,t,n={}){let r=this.getLanguageById(t);if(!r)throw Error(`Language "${t}" not found. Available languages: ${this.getSupportedLanguages().join(", ")}`);let o=this.getCacheKey(e,t,n);if(this.config.cache){let s=this.cache.get(o);if(s){let c=this.resolveTheme(n.theme);return new be(c).render(s.tokens,n)}}let a=new j(r.grammar).tokenize(e);for(let s of this.plugins)if(s.transformers)for(let c of s.transformers)a=c.transform(a);if(this.config.cache)this.cache.set(o,{tokens:a,timestamp:Date.now(),hash:o});let i=this.resolveTheme(n.theme);return new be(i).render(a,n)}async highlight(e,t,n={}){return this.highlightSync(e,t,n)}highlightFast(e,t){let n=this.getLanguageById(t);if(!n)throw Error(`Language "${t}" not found. Available languages: ${this.getSupportedLanguages().join(", ")}`);return new He(n.grammar).tokenize(e)}async loadLanguage(e){if(this.languages.set(e.id,e),e.aliases)for(let t of e.aliases)this.languages.set(t,e)}async loadTheme(e){this.themes.set(e.name.toLowerCase(),e)}getSupportedLanguages(){let e=new Set;for(let[t,n]of this.languages.entries())if(t===n.id)e.add(n.id);return Array.from(e)}getSupportedThemes(){return Array.from(this.themes.keys())}getLanguageById(e){return this.languages.get(e)||Wn(e)}resolveTheme(e){if(!e)return this.resolveTheme(this.config.theme);if(typeof e==="string"){let t=this.themes.get(e.toLowerCase());if(!t){let n=e.replace(/-/g," ");t=this.themes.get(n.toLowerCase())}if(!t)t=tr(e);if(!t)throw Error(`Theme "${e}" not found. Available themes: ${this.getSupportedThemes().join(", ")}`);return t}return e}getCacheKey(e,t,n){let r=JSON.stringify(n);return`${t}:${this.hashCode(e+r)}`}hashCode(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)-t+r,t=t&t}return t.toString(36)}clearCache(){this.cache.clear()}getCacheSize(){return this.cache.size}}async function nt(e={}){let t={...{verbose:!1,theme:"github-dark",cache:!0,plugins:[]},...e};return new tt(t)}class rt{entries=[];timers=new Map;enabled;constructor(e=!1){this.enabled=e}start(e){if(!this.enabled)return;this.timers.set(e,performance.now())}end(e){if(!this.enabled)return;let t=this.timers.get(e);if(!t)return;let n=performance.now()-t;this.timers.delete(e),this.entries.push({name:e,duration:n,timestamp:Date.now()})}async measure(e,t){this.start(e);try{let n=await t();return this.end(e),n}catch(n){throw this.end(e),n}}getEntries(){return[...this.entries]}getStats(){let e=new Map;for(let n of this.entries){let r=e.get(n.name)||[];r.push(n.duration),e.set(n.name,r)}let t={};for(let[n,r]of e){let o=r.reduce((a,i)=>a+i,0);t[n]={count:r.length,total:o,avg:o/r.length,min:Math.min(...r),max:Math.max(...r)}}return t}clear(){this.entries=[],this.timers.clear()}enable(){this.enabled=!0}disable(){this.enabled=!1}report(){let e=this.getStats();console.log(`
869
- === Performance Report ===
870
- `);for(let[t,n]of Object.entries(e))console.log(`${t}:`),console.log(` Count: ${n.count}`),console.log(` Total: ${n.total.toFixed(2)}ms`),console.log(` Avg: ${n.avg.toFixed(2)}ms`),console.log(` Min: ${n.min.toFixed(2)}ms`),console.log(` Max: ${n.max.toFixed(2)}ms`),console.log()}}var Wr,Qr,Gt,fe,Ge,S,w,Hr,Yt,eo,Xt,to,no,Ke,ro,Jt,Wt,Ve,oo,ao,so,io,ye,Qt,co,N,lo,mo,tn,uo,nn,rn,on,an,sn,cn,ln,mn,dn,un,pn,gn,hn,fn,yn,bn,wn,kn,vn,xn,An,Cn,Tn,jn,$n,En,Nn,Sn,qn,_n,zn,Ln,On,In,Fn,Rn,Pn,Bn,Zn,Mn,Dn,Un,Gn,Kn,Vn,Yn,Xn,Jn,ie,p,Qn,Hn,er,et,u,po;var ot=P(async()=>{Wr=re(we.cwd(),"config"),Qr=re(we.cwd(),"src/generated");Gt=ne.env.CLARITY_LOG_DIR||zt(Ut(),"logs"),fe={level:"info",defaultName:"clarity",timestamp:!0,colors:!0,format:"text",maxLogSize:10485760,logDatePattern:"YYYY-MM-DD",logDirectory:Gt,rotation:{frequency:"daily",maxSize:10485760,maxFiles:5,compress:!1,rotateHour:0,rotateMinute:0,rotateDayOfWeek:0,rotateDayOfMonth:1,encrypt:!1},verbose:!1};Ge=await Kt();S={red:(e)=>`\x1B[31m${e}\x1B[0m`,green:(e)=>`\x1B[32m${e}\x1B[0m`,yellow:(e)=>`\x1B[33m${e}\x1B[0m`,blue:(e)=>`\x1B[34m${e}\x1B[0m`,magenta:(e)=>`\x1B[35m${e}\x1B[0m`,cyan:(e)=>`\x1B[36m${e}\x1B[0m`,white:(e)=>`\x1B[37m${e}\x1B[0m`,gray:(e)=>`\x1B[90m${e}\x1B[0m`,bgRed:(e)=>`\x1B[41m${e}\x1B[0m`,bgYellow:(e)=>`\x1B[43m${e}\x1B[0m`,bold:(e)=>`\x1B[1m${e}\x1B[0m`,dim:(e)=>`\x1B[2m${e}\x1B[0m`,italic:(e)=>`\x1B[3m${e}\x1B[0m`,underline:(e)=>`\x1B[4m${e}\x1B[0m`,reset:"\x1B[0m"},w=S,Hr=S.red,Yt=S.green,eo=S.yellow,Xt=S.blue,to=S.magenta,no=S.cyan,Ke=S.white,ro=S.gray,Jt=S.bgRed,Wt=S.bgYellow,Ve=S.bold,oo=S.dim,ao=S.italic,so=S.underline,io=S.reset,ye={activationLevel:"error",bufferSize:50,flushOnDeactivation:!0,stopBuffering:!1},Qt={debug:"\uD83D\uDD0D",info:Xt("\u2139"),success:Yt("\u2713"),warning:Wt(Ke(Ve(" WARN "))),error:Jt(Ke(Ve(" ERROR ")))};co=new se("stacks");N=new se("bunfig",{showTags:!0});lo=z(K.cwd(),"config"),mo=z(K.cwd(),"src/generated"),tn={verbose:!1,theme:"github-dark",defaultLanguage:"javascript",cache:!0,plugins:[]},uo=await en({name:"syntax",defaultConfig:tn}),nn={name:"ABNF",scopeName:"source.abnf",keywords:{},patterns:[{include:"#rules"},{include:"#comments"}],repository:{rules:{patterns:[{name:"entity.name.type.abnf",match:"^[a-zA-Z][a-zA-Z0-9-]*(?=\\s*=)"},{name:"keyword.operator.abnf",match:"="}]},comments:{patterns:[{name:"comment.line.semicolon.abnf",match:";.*$"}]}}},rn={name:"Bash",scopeName:"source.bash",keywords:{if:"keyword.control.bash",then:"keyword.control.bash",else:"keyword.control.bash",elif:"keyword.control.bash",fi:"keyword.control.bash",case:"keyword.control.bash",esac:"keyword.control.bash",for:"keyword.control.bash",while:"keyword.control.bash",until:"keyword.control.bash",do:"keyword.control.bash",done:"keyword.control.bash",in:"keyword.control.bash",select:"keyword.control.bash",function:"storage.type.function.bash",declare:"storage.type.bash",local:"storage.type.bash",export:"storage.type.bash",readonly:"storage.type.bash",typeset:"storage.type.bash",echo:"support.function.builtin.bash",printf:"support.function.builtin.bash",read:"support.function.builtin.bash",cd:"support.function.builtin.bash",pwd:"support.function.builtin.bash",exit:"support.function.builtin.bash",return:"support.function.builtin.bash",source:"support.function.builtin.bash",test:"support.function.builtin.bash",eval:"support.function.builtin.bash",exec:"support.function.builtin.bash",shift:"support.function.builtin.bash",set:"support.function.builtin.bash",unset:"support.function.builtin.bash",alias:"support.function.builtin.bash",unalias:"support.function.builtin.bash",true:"constant.language.bash",false:"constant.language.bash"},patterns:[{include:"#strings"},{include:"#variables"},{include:"#comments"},{include:"#keywords"},{include:"#functions"},{include:"#operators"},{include:"#numbers"}],repository:{comments:{patterns:[{name:"comment.line.number-sign.bash",match:"#.*$"}]},strings:{patterns:[{name:"string.quoted.double.bash",begin:'"',end:'"',patterns:[{name:"constant.character.escape.bash",match:'\\\\[\\\\"`$\\n]'},{include:"#variables"},{name:"variable.other.subshell.bash",begin:"\\$\\(",end:"\\)"},{name:"variable.other.backtick.bash",begin:"`",end:"`"}]},{name:"string.quoted.single.bash",begin:"'",end:"'"},{name:"string.unquoted.heredoc.bash",begin:`<<-?\\s*(['"]?)(\\w+)\\1`,end:"^\\2$"}]},variables:{patterns:[{name:"variable.other.bracket.bash",match:"\\$\\{[^}]+\\}"},{name:"variable.other.normal.bash",match:"\\$[a-zA-Z_][a-zA-Z0-9_]*"},{name:"variable.other.positional.bash",match:"\\$[0-9@*#?$!-]"}]},functions:{patterns:[{name:"entity.name.function.bash",match:"\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*\\(\\)"}]},keywords:{patterns:[{name:"keyword.control.bash",match:"\\b(if|then|else|elif|fi|case|esac|for|while|until|do|done|in|select)\\b"},{name:"storage.type.bash",match:"\\b(function|declare|local|export|readonly|typeset)\\b"},{name:"support.function.builtin.bash",match:"\\b(echo|printf|read|cd|pwd|exit|return|source|test|eval|exec|shift|set|unset|alias|unalias)\\b"},{name:"constant.language.bash",match:"\\b(true|false)\\b"}]},operators:{patterns:[{name:"keyword.operator.logical.bash",match:"(&&|\\|\\||!)"},{name:"keyword.operator.pipe.bash",match:"\\|"},{name:"keyword.operator.redirect.bash",match:"(>>|>|<<|<|&>|&>>|2>|2>>)"},{name:"keyword.operator.assignment.bash",match:"="}]},numbers:{patterns:[{name:"constant.numeric.bash",match:"\\b[0-9]+\\b"}]}}},on={name:"BNF",scopeName:"source.bnf",keywords:{},patterns:[{include:"#rules"},{include:"#terminals"},{include:"#nonterminals"}],repository:{rules:{patterns:[{name:"keyword.operator.bnf",match:"::="}]},nonterminals:{patterns:[{name:"entity.name.type.bnf",match:"<[^>]+>"}]},terminals:{patterns:[{name:"string.quoted.double.bnf",begin:'"',end:'"'},{name:"string.quoted.single.bnf",begin:"'",end:"'"}]}}},an={name:"C",scopeName:"source.c",keywords:{if:"keyword.control.c",else:"keyword.control.c",for:"keyword.control.c",while:"keyword.control.c",do:"keyword.control.c",switch:"keyword.control.c",case:"keyword.control.c",default:"keyword.control.c",break:"keyword.control.c",continue:"keyword.control.c",return:"keyword.control.c",goto:"keyword.control.c",void:"storage.type.c",char:"storage.type.c",short:"storage.type.c",int:"storage.type.c",long:"storage.type.c",float:"storage.type.c",double:"storage.type.c",signed:"storage.type.c",unsigned:"storage.type.c",struct:"storage.type.c",union:"storage.type.c",enum:"storage.type.c",typedef:"storage.type.c",const:"storage.modifier.c",static:"storage.modifier.c",extern:"storage.modifier.c",register:"storage.modifier.c",volatile:"storage.modifier.c",inline:"storage.modifier.c",restrict:"storage.modifier.c",_Atomic:"storage.modifier.c",sizeof:"keyword.operator.sizeof.c",size_t:"support.type.c",FILE:"support.type.c",NULL:"constant.language.c"},patterns:[{include:"#preprocessor"},{include:"#comments"},{include:"#strings"},{include:"#keywords"},{include:"#numbers"},{include:"#functions"},{include:"#operators"}],repository:{preprocessor:{patterns:[{name:"meta.preprocessor.include.c",match:'^\\s*#\\s*include\\s+(<[^>]+>|"[^"]+")',captures:{1:{name:"string.quoted.other.lt-gt.include.c"}}},{name:"meta.preprocessor.macro.c",match:"^\\s*#\\s*(define|undef)\\s+([a-zA-Z_][a-zA-Z0-9_]*)",captures:{1:{name:"keyword.control.directive.c"},2:{name:"entity.name.function.preprocessor.c"}}},{name:"meta.preprocessor.c",match:"^\\s*#\\s*(if|ifdef|ifndef|elif|else|endif|pragma|error|warning|line)\\b",captures:{1:{name:"keyword.control.directive.c"}}}]},comments:{patterns:[{name:"comment.line.double-slash.c",match:"\\/\\/.*$"},{name:"comment.block.c",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.double.c",begin:'"',end:'"',patterns:[{name:"constant.character.escape.c",match:"\\\\."}]},{name:"string.quoted.single.c",begin:"'",end:"'",patterns:[{name:"constant.character.escape.c",match:"\\\\."}]}]},keywords:{patterns:[{name:"keyword.control.c",match:"\\b(if|else|for|while|do|switch|case|default|break|continue|return|goto)\\b"},{name:"storage.type.c",match:"\\b(void|char|short|int|long|float|double|signed|unsigned|struct|union|enum|typedef)\\b"},{name:"storage.modifier.c",match:"\\b(const|static|extern|register|volatile|inline|restrict|_Atomic)\\b"},{name:"constant.language.c",match:"\\b(NULL|true|false)\\b"}]},numbers:{patterns:[{name:"constant.numeric.c",match:"\\b(?:0[xX][0-9a-fA-F]+[uUlL]*|0[0-7]+[uUlL]*|\\d+\\.?\\d*(?:[eE][+-]?\\d+)?[fFlL]?)\\b"}]},functions:{patterns:[{name:"entity.name.function.c",match:"\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*(?=\\()"}]},operators:{patterns:[{name:"keyword.operator.c",match:"(\\+\\+|--|\\+|\\-|\\*|/|%|==|!=|<=|>=|<|>|&&|\\|\\||!|&|\\||\\^|~|<<|>>|\\?|:|=|\\+=|-=|\\*=|/=|%=|&=|\\|=|\\^=|<<=|>>=|->|\\.)"}]}}},sn={name:"Batch",scopeName:"source.cmd",keywords:{if:"keyword.control.cmd",else:"keyword.control.cmd",for:"keyword.control.cmd",do:"keyword.control.cmd",goto:"keyword.control.cmd",call:"keyword.control.cmd",exit:"keyword.control.cmd",echo:"support.function.cmd",set:"support.function.cmd",setlocal:"support.function.cmd",endlocal:"support.function.cmd"},patterns:[{include:"#comments"},{include:"#variables"},{include:"#labels"},{include:"#keywords"}],repository:{comments:{patterns:[{name:"comment.line.rem.cmd",match:"^\\s*[Rr][Ee][Mm]\\b.*$"},{name:"comment.line.colons.cmd",match:"^\\s*::.*$"}]},variables:{patterns:[{name:"variable.other.cmd",match:"%[a-zA-Z_][a-zA-Z0-9_]*%"},{name:"variable.other.cmd",match:"![a-zA-Z_][a-zA-Z0-9_]*!"}]},labels:{patterns:[{name:"entity.name.label.cmd",match:"^:[a-zA-Z_][a-zA-Z0-9_]*"}]},keywords:{patterns:[{name:"keyword.control.cmd",match:"\\b(if|else|for|do|goto|call|exit)\\b"},{name:"support.function.cmd",match:"\\b(echo|set|setlocal|endlocal)\\b"}]}}},cn={name:"C++",scopeName:"source.cpp",keywords:{if:"keyword.control.cpp",else:"keyword.control.cpp",for:"keyword.control.cpp",while:"keyword.control.cpp",do:"keyword.control.cpp",switch:"keyword.control.cpp",case:"keyword.control.cpp",default:"keyword.control.cpp",break:"keyword.control.cpp",continue:"keyword.control.cpp",return:"keyword.control.cpp",goto:"keyword.control.cpp",try:"keyword.control.cpp",catch:"keyword.control.cpp",throw:"keyword.control.cpp",void:"storage.type.cpp",bool:"storage.type.cpp",char:"storage.type.cpp",short:"storage.type.cpp",int:"storage.type.cpp",long:"storage.type.cpp",float:"storage.type.cpp",double:"storage.type.cpp",signed:"storage.type.cpp",unsigned:"storage.type.cpp",struct:"storage.type.cpp",union:"storage.type.cpp",enum:"storage.type.cpp",class:"storage.type.cpp",typedef:"storage.type.cpp",typename:"storage.type.cpp",auto:"storage.type.cpp",decltype:"storage.type.cpp",const:"storage.modifier.cpp",static:"storage.modifier.cpp",extern:"storage.modifier.cpp",register:"storage.modifier.cpp",volatile:"storage.modifier.cpp",inline:"storage.modifier.cpp",virtual:"storage.modifier.cpp",explicit:"storage.modifier.cpp",friend:"storage.modifier.cpp",mutable:"storage.modifier.cpp",constexpr:"storage.modifier.cpp",consteval:"storage.modifier.cpp",constinit:"storage.modifier.cpp",public:"storage.modifier.access.cpp",private:"storage.modifier.access.cpp",protected:"storage.modifier.access.cpp",new:"keyword.operator.new.cpp",delete:"keyword.operator.delete.cpp",sizeof:"keyword.operator.sizeof.cpp",alignof:"keyword.operator.alignof.cpp",typeid:"keyword.operator.typeid.cpp",static_cast:"keyword.operator.cast.cpp",dynamic_cast:"keyword.operator.cast.cpp",const_cast:"keyword.operator.cast.cpp",reinterpret_cast:"keyword.operator.cast.cpp",namespace:"keyword.other.namespace.cpp",using:"keyword.other.using.cpp",template:"keyword.other.template.cpp",this:"variable.language.cpp",nullptr:"constant.language.cpp",true:"constant.language.cpp",false:"constant.language.cpp",operator:"keyword.operator.cpp",concept:"keyword.other.concept.cpp",requires:"keyword.other.requires.cpp",co_await:"keyword.control.cpp",co_return:"keyword.control.cpp",co_yield:"keyword.control.cpp"},patterns:[{include:"#preprocessor"},{include:"#comments"},{include:"#strings"},{include:"#keywords"},{include:"#numbers"},{include:"#functions"},{include:"#operators"}],repository:{preprocessor:{patterns:[{name:"meta.preprocessor.include.cpp",match:'^\\s*#\\s*include\\s+(<[^>]+>|"[^"]+")',captures:{1:{name:"string.quoted.other.lt-gt.include.cpp"}}},{name:"meta.preprocessor.macro.cpp",match:"^\\s*#\\s*(define|undef)\\s+([a-zA-Z_][a-zA-Z0-9_]*)",captures:{1:{name:"keyword.control.directive.cpp"},2:{name:"entity.name.function.preprocessor.cpp"}}},{name:"meta.preprocessor.cpp",match:"^\\s*#\\s*(if|ifdef|ifndef|elif|else|endif|pragma|error|warning|line)\\b",captures:{1:{name:"keyword.control.directive.cpp"}}}]},comments:{patterns:[{name:"comment.line.double-slash.cpp",match:"\\/\\/.*$"},{name:"comment.block.cpp",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.raw.cpp",begin:'R"([a-zA-Z0-9_]*)\\(',end:'\\)\\1"'},{name:"string.quoted.double.cpp",begin:'"',end:'"',patterns:[{name:"constant.character.escape.cpp",match:"\\\\."}]},{name:"string.quoted.single.cpp",begin:"'",end:"'",patterns:[{name:"constant.character.escape.cpp",match:"\\\\."}]}]},keywords:{patterns:[{name:"keyword.control.cpp",match:"\\b(if|else|for|while|do|switch|case|default|break|continue|return|goto|try|catch|throw|co_await|co_return|co_yield)\\b"},{name:"storage.type.cpp",match:"\\b(void|bool|char|short|int|long|float|double|signed|unsigned|struct|union|enum|class|typedef|typename|auto|decltype)\\b"},{name:"storage.modifier.cpp",match:"\\b(const|static|extern|register|volatile|inline|virtual|explicit|friend|mutable|constexpr|consteval|constinit)\\b"},{name:"storage.modifier.access.cpp",match:"\\b(public|private|protected)\\b"},{name:"constant.language.cpp",match:"\\b(true|false|nullptr)\\b"},{name:"keyword.other.cpp",match:"\\b(namespace|using|template|operator|concept|requires)\\b"}]},numbers:{patterns:[{name:"constant.numeric.cpp",match:"\\b(?:0[xX][0-9a-fA-F]+[uUlL]*|0[bB][01]+[uUlL]*|0[0-7]+[uUlL]*|\\d+\\.?\\d*(?:[eE][+-]?\\d+)?[fFlL]?)\\b"}]},functions:{patterns:[{name:"entity.name.function.cpp",match:"\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*(?=\\()"}]},operators:{patterns:[{name:"keyword.operator.cpp",match:"(\\+\\+|--|\\+|\\-|\\*|/|%|==|!=|<=|>=|<|>|&&|\\|\\||!|&|\\||\\^|~|<<|>>|\\?|:|=|\\+=|-=|\\*=|/=|%=|&=|\\|=|\\^=|<<=|>>=|->|\\.|::)"}]}}},ln={name:"C#",scopeName:"source.cs",keywords:{if:"keyword.control.cs",else:"keyword.control.cs",for:"keyword.control.cs",foreach:"keyword.control.cs",while:"keyword.control.cs",do:"keyword.control.cs",switch:"keyword.control.cs",case:"keyword.control.cs",default:"keyword.control.cs",break:"keyword.control.cs",continue:"keyword.control.cs",return:"keyword.control.cs",goto:"keyword.control.cs",try:"keyword.control.cs",catch:"keyword.control.cs",finally:"keyword.control.cs",throw:"keyword.control.cs",yield:"keyword.control.cs",await:"keyword.control.cs",class:"keyword.other.class.cs",struct:"keyword.other.struct.cs",interface:"keyword.other.interface.cs",enum:"keyword.other.enum.cs",delegate:"keyword.other.delegate.cs",record:"keyword.other.record.cs",void:"keyword.type.cs",bool:"keyword.type.cs",byte:"keyword.type.cs",sbyte:"keyword.type.cs",char:"keyword.type.cs",decimal:"keyword.type.cs",double:"keyword.type.cs",float:"keyword.type.cs",int:"keyword.type.cs",uint:"keyword.type.cs",long:"keyword.type.cs",ulong:"keyword.type.cs",short:"keyword.type.cs",ushort:"keyword.type.cs",object:"keyword.type.cs",string:"keyword.type.cs",var:"keyword.type.cs",dynamic:"keyword.type.cs",public:"storage.modifier.cs",private:"storage.modifier.cs",protected:"storage.modifier.cs",internal:"storage.modifier.cs",static:"storage.modifier.cs",readonly:"storage.modifier.cs",const:"storage.modifier.cs",virtual:"storage.modifier.cs",override:"storage.modifier.cs",abstract:"storage.modifier.cs",sealed:"storage.modifier.cs",partial:"storage.modifier.cs",async:"storage.modifier.cs",extern:"storage.modifier.cs",volatile:"storage.modifier.cs",namespace:"keyword.other.namespace.cs",using:"keyword.other.using.cs",new:"keyword.operator.new.cs",this:"variable.language.cs",base:"variable.language.cs",true:"constant.language.cs",false:"constant.language.cs",null:"constant.language.cs",typeof:"keyword.operator.cs",sizeof:"keyword.operator.cs",is:"keyword.operator.cs",as:"keyword.operator.cs",in:"keyword.operator.cs",out:"keyword.operator.cs",ref:"keyword.operator.cs",params:"keyword.other.cs",operator:"keyword.other.cs",implicit:"keyword.other.cs",explicit:"keyword.other.cs",get:"keyword.other.cs",set:"keyword.other.cs",value:"keyword.other.cs",add:"keyword.other.cs",remove:"keyword.other.cs",event:"keyword.other.cs",lock:"keyword.control.cs",checked:"keyword.control.cs",unchecked:"keyword.control.cs",unsafe:"keyword.other.cs",fixed:"keyword.other.cs",stackalloc:"keyword.operator.cs",nameof:"keyword.operator.cs",when:"keyword.control.cs"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#attributes"},{include:"#keywords"},{include:"#numbers"},{include:"#functions"},{include:"#operators"}],repository:{comments:{patterns:[{name:"comment.line.double-slash.cs",match:"\\/\\/.*$"},{name:"comment.block.documentation.cs",begin:"\\/\\/\\/",end:"$"},{name:"comment.block.cs",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.verbatim.cs",begin:'@"',end:'"',patterns:[{name:"constant.character.escape.cs",match:'""'}]},{name:"string.quoted.interpolated.cs",begin:'\\$"',end:'"',patterns:[{name:"meta.interpolation.cs",begin:"\\{",end:"\\}",patterns:[{include:"$self"}]},{name:"constant.character.escape.cs",match:"\\\\."}]},{name:"string.quoted.double.cs",begin:'"',end:'"',patterns:[{name:"constant.character.escape.cs",match:"\\\\."}]},{name:"string.quoted.single.cs",begin:"'",end:"'",patterns:[{name:"constant.character.escape.cs",match:"\\\\."}]}]},attributes:{patterns:[{name:"meta.attribute.cs",begin:"\\[",end:"\\]",patterns:[{name:"entity.name.type.attribute.cs",match:"[A-Z][a-zA-Z0-9]*"}]}]},keywords:{patterns:[{name:"keyword.control.cs",match:"\\b(if|else|for|foreach|while|do|switch|case|default|break|continue|return|goto|try|catch|finally|throw|yield|await|lock|checked|unchecked|when)\\b"},{name:"keyword.other.cs",match:"\\b(class|struct|interface|enum|delegate|record|namespace|using|operator|implicit|explicit|get|set|value|add|remove|event|params|unsafe|fixed)\\b"},{name:"keyword.type.cs",match:"\\b(void|bool|byte|sbyte|char|decimal|double|float|int|uint|long|ulong|short|ushort|object|string|var|dynamic)\\b"},{name:"storage.modifier.cs",match:"\\b(public|private|protected|internal|static|readonly|const|virtual|override|abstract|sealed|partial|async|extern|volatile)\\b"},{name:"constant.language.cs",match:"\\b(true|false|null)\\b"},{name:"variable.language.cs",match:"\\b(this|base)\\b"},{name:"keyword.operator.cs",match:"\\b(new|typeof|sizeof|is|as|in|out|ref|stackalloc|nameof)\\b"}]},numbers:{patterns:[{name:"constant.numeric.cs",match:"\\b(?:0[xX][0-9a-fA-F_]+|0[bB][01_]+|\\d+[._]?\\d*(?:[eE][+-]?\\d+)?)[fFdDmMlLuU]*\\b"}]},functions:{patterns:[{name:"entity.name.function.cs",match:"\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*(?=\\()"}]},operators:{patterns:[{name:"keyword.operator.cs",match:"(\\+\\+|--|\\+|\\-|\\*|/|%|==|!=|<=|>=|<|>|&&|\\|\\||!|&|\\||\\^|~|<<|>>|\\?\\?|\\?|:|=|\\+=|-=|\\*=|/=|%=|&=|\\|=|\\^=|<<=|>>=|=>|\\.|->)"}]}}},mn={name:"CSS",scopeName:"source.css",patterns:[{include:"#comments"},{include:"#at-rules"},{include:"#selectors"},{include:"#properties"},{include:"#functions"},{include:"#variables"},{include:"#values"},{include:"#strings"},{include:"#numbers"},{include:"#colors"},{include:"#punctuation"}],repository:{comments:{patterns:[{name:"comment.block.css",begin:"\\/\\*",end:"\\*\\/"}]},"at-rules":{patterns:[{name:"keyword.control.at-rule.css",match:"@(media|import|charset|namespace|keyframes|font-face|supports|page|document|viewport|counter-style|font-feature-values|property|layer|container)\\b"}]},selectors:{patterns:[{name:"entity.name.tag.css",match:"\\b(a|abbr|address|article|aside|audio|b|blockquote|body|button|canvas|caption|cite|code|div|em|embed|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|html|i|iframe|img|input|label|legend|li|main|nav|ol|p|pre|section|select|span|strong|table|tbody|td|textarea|tfoot|th|thead|tr|ul|video)\\b"},{name:"entity.other.attribute-name.class.css",match:"\\.[a-zA-Z_-][a-zA-Z0-9_-]*"},{name:"entity.other.attribute-name.id.css",match:"#[a-zA-Z_-][a-zA-Z0-9_-]*"},{name:"entity.other.attribute-name.pseudo-class.css",match:":[a-zA-Z_-][a-zA-Z0-9_-]*"},{name:"entity.other.attribute-name.pseudo-element.css",match:"::[a-zA-Z_-][a-zA-Z0-9_-]*"}]},properties:{patterns:[{name:"support.type.property-name.css",match:"\\b(align-items|background|border|color|display|flex|font|height|justify-content|margin|padding|position|width|z-index|animation|box-shadow|cursor|font-family|font-size|font-weight|grid|line-height|opacity|overflow|text-align|text-decoration|transform|transition|visibility)(-[a-z]+)?\\b"}]},values:{patterns:[{name:"support.constant.property-value.css",match:"\\b(auto|block|inline|flex|grid|none|center|left|right|top|bottom|absolute|relative|fixed|sticky|hidden|visible|bold|normal|italic|underline|solid|dotted|dashed)\\b"}]},strings:{patterns:[{name:"string.quoted.double.css",begin:'"',end:'"'},{name:"string.quoted.single.css",begin:"'",end:"'"}]},numbers:{patterns:[{name:"constant.numeric.css",match:"\\b\\d+(\\.\\d+)?(px|em|rem|%|vh|vw|vmin|vmax|ch|ex|cm|mm|in|pt|pc|deg|rad|turn|s|ms)?\\b"}]},colors:{patterns:[{name:"constant.other.color.css",match:"#[0-9a-fA-F]{3,8}\\b"},{name:"support.function.color.css",match:"\\b(rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)\\s*\\("}]},functions:{patterns:[{name:"support.function.css",match:"\\b(var|calc|min|max|clamp|round|abs|sign|mod|rem|sin|cos|tan|asin|acos|atan|atan2|pow|sqrt|hypot|log|exp|url|attr|counter|counters|linear-gradient|radial-gradient|conic-gradient|repeating-linear-gradient|repeating-radial-gradient|repeating-conic-gradient)\\s*\\("}]},variables:{patterns:[{name:"variable.other.custom-property.css",match:"--[a-zA-Z0-9_-]+"}]},punctuation:{patterns:[{name:"punctuation.css",match:"[{}();:,]"}]}}},dn={name:"CSV",scopeName:"text.csv",keywords:{},patterns:[{include:"#quoted"}],repository:{quoted:{patterns:[{name:"string.quoted.double.csv",begin:'"',end:'"',patterns:[{name:"constant.character.escape.csv",match:'""'}]}]}}},un={name:"Dart",scopeName:"source.dart",keywords:{import:"keyword.other.dart",library:"keyword.other.dart",part:"keyword.other.dart",class:"keyword.other.dart",enum:"keyword.other.dart",extends:"keyword.other.dart",implements:"keyword.other.dart",with:"keyword.other.dart",mixin:"keyword.other.dart",if:"keyword.control.dart",else:"keyword.control.dart",for:"keyword.control.dart",while:"keyword.control.dart",do:"keyword.control.dart",switch:"keyword.control.dart",case:"keyword.control.dart",default:"keyword.control.dart",break:"keyword.control.dart",continue:"keyword.control.dart",return:"keyword.control.dart",try:"keyword.control.dart",catch:"keyword.control.dart",finally:"keyword.control.dart",throw:"keyword.control.dart",var:"storage.type.dart",final:"storage.type.dart",const:"storage.type.dart",late:"storage.modifier.dart",static:"storage.modifier.dart",async:"storage.modifier.dart",await:"keyword.control.dart",true:"constant.language.dart",false:"constant.language.dart",null:"constant.language.dart",this:"variable.language.dart",super:"variable.language.dart"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#keywords"},{include:"#numbers"}],repository:{comments:{patterns:[{name:"comment.line.double-slash.dart",match:"\\/\\/.*$"},{name:"comment.block.dart",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.triple.dart",begin:'"""',end:'"""'},{name:"string.quoted.double.dart",begin:'"',end:'"',patterns:[{name:"constant.character.escape.dart",match:"\\\\."},{name:"variable.other.dart",match:"\\$[a-zA-Z_][a-zA-Z0-9_]*"},{name:"meta.embedded.line.dart",begin:"\\$\\{",end:"\\}"}]},{name:"string.quoted.single.dart",begin:"'",end:"'"}]},keywords:{patterns:[{name:"keyword.control.dart",match:"\\b(if|else|for|while|do|switch|case|default|break|continue|return|try|catch|finally|throw|await)\\b"},{name:"keyword.other.dart",match:"\\b(import|library|part|class|enum|extends|implements|with|mixin)\\b"},{name:"storage.type.dart",match:"\\b(var|final|const)\\b"},{name:"constant.language.dart",match:"\\b(true|false|null)\\b"}]},numbers:{patterns:[{name:"constant.numeric.dart",match:"\\b\\d+\\.?\\d*\\b"}]}}},pn={name:"Diff",scopeName:"source.diff",keywords:{},patterns:[{include:"#file-header"},{include:"#hunk-header"},{include:"#added-line"},{include:"#removed-line"},{include:"#context-line"},{include:"#metadata"}],repository:{"file-header":{patterns:[{name:"meta.diff.header.from-file",match:"^(---\\s+)(.*)$",captures:{1:{name:"punctuation.definition.from-file.diff"},2:{name:"meta.diff.header.from-path"}}},{name:"meta.diff.header.to-file",match:"^(\\+\\+\\+\\s+)(.*)$",captures:{1:{name:"punctuation.definition.to-file.diff"},2:{name:"meta.diff.header.to-path"}}},{name:"meta.diff.header.git",match:"^diff --git.*$"}]},"hunk-header":{patterns:[{name:"meta.diff.range.unified",match:"^(@@)\\s+(-\\d+,\\d+\\s+\\+\\d+,\\d+)\\s+(@@)(.*)$",captures:{1:{name:"punctuation.definition.range.diff"},2:{name:"meta.diff.range.context"},3:{name:"punctuation.definition.range.diff"},4:{name:"entity.name.function.diff"}}}]},"added-line":{patterns:[{name:"markup.inserted.diff",match:"^\\+.*$"}]},"removed-line":{patterns:[{name:"markup.deleted.diff",match:"^-.*$"}]},"context-line":{patterns:[{name:"meta.diff.context",match:"^ .*$"}]},metadata:{patterns:[{name:"meta.diff.index",match:"^index [0-9a-f]+\\.\\.[0-9a-f]+.*$"},{name:"meta.diff.mode",match:"^(new|deleted) file mode \\d+$"}]}}},gn={name:"Dockerfile",scopeName:"source.dockerfile",keywords:{FROM:"keyword.control.dockerfile",RUN:"keyword.control.dockerfile",CMD:"keyword.control.dockerfile",LABEL:"keyword.control.dockerfile",EXPOSE:"keyword.control.dockerfile",ENV:"keyword.control.dockerfile",ADD:"keyword.control.dockerfile",COPY:"keyword.control.dockerfile",ENTRYPOINT:"keyword.control.dockerfile",VOLUME:"keyword.control.dockerfile",USER:"keyword.control.dockerfile",WORKDIR:"keyword.control.dockerfile",ARG:"keyword.control.dockerfile",ONBUILD:"keyword.control.dockerfile",STOPSIGNAL:"keyword.control.dockerfile",HEALTHCHECK:"keyword.control.dockerfile",SHELL:"keyword.control.dockerfile",MAINTAINER:"keyword.control.dockerfile",AS:"keyword.other.dockerfile"},patterns:[{include:"#comments"},{include:"#instructions"},{include:"#strings"},{include:"#variables"}],repository:{comments:{patterns:[{name:"comment.line.number-sign.dockerfile",match:"#.*$"}]},instructions:{patterns:[{name:"keyword.control.dockerfile",match:"^\\s*(FROM|RUN|CMD|LABEL|EXPOSE|ENV|ADD|COPY|ENTRYPOINT|VOLUME|USER|WORKDIR|ARG|ONBUILD|STOPSIGNAL|HEALTHCHECK|SHELL|MAINTAINER)\\b"},{name:"keyword.other.dockerfile",match:"\\b(AS)\\b"}]},strings:{patterns:[{name:"string.quoted.double.dockerfile",begin:'"',end:'"',patterns:[{name:"constant.character.escape.dockerfile",match:"\\\\."}]},{name:"string.quoted.single.dockerfile",begin:"'",end:"'",patterns:[{name:"constant.character.escape.dockerfile",match:"\\\\."}]}]},variables:{patterns:[{name:"variable.other.dockerfile",match:"\\$\\{?[a-zA-Z_][a-zA-Z0-9_]*\\}?"}]}}},hn={name:"Go",scopeName:"source.go",keywords:{break:"keyword.control.go",case:"keyword.control.go",chan:"keyword.control.go",const:"keyword.control.go",continue:"keyword.control.go",default:"keyword.control.go",defer:"keyword.control.go",else:"keyword.control.go",fallthrough:"keyword.control.go",for:"keyword.control.go",func:"keyword.control.go",go:"keyword.control.go",goto:"keyword.control.go",if:"keyword.control.go",import:"keyword.control.go",interface:"keyword.control.go",map:"keyword.control.go",package:"keyword.control.go",range:"keyword.control.go",return:"keyword.control.go",select:"keyword.control.go",struct:"keyword.control.go",switch:"keyword.control.go",type:"keyword.control.go",var:"keyword.control.go",bool:"storage.type.go",byte:"storage.type.go",complex64:"storage.type.go",complex128:"storage.type.go",error:"storage.type.go",float32:"storage.type.go",float64:"storage.type.go",int:"storage.type.go",int8:"storage.type.go",int16:"storage.type.go",int32:"storage.type.go",int64:"storage.type.go",rune:"storage.type.go",string:"storage.type.go",uint:"storage.type.go",uint8:"storage.type.go",uint16:"storage.type.go",uint32:"storage.type.go",uint64:"storage.type.go",uintptr:"storage.type.go",true:"constant.language.go",false:"constant.language.go",nil:"constant.language.go",iota:"constant.language.go",append:"support.function.builtin.go",cap:"support.function.builtin.go",close:"support.function.builtin.go",complex:"support.function.builtin.go",copy:"support.function.builtin.go",delete:"support.function.builtin.go",imag:"support.function.builtin.go",len:"support.function.builtin.go",make:"support.function.builtin.go",new:"support.function.builtin.go",panic:"support.function.builtin.go",print:"support.function.builtin.go",println:"support.function.builtin.go",real:"support.function.builtin.go",recover:"support.function.builtin.go"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#keywords"},{include:"#numbers"},{include:"#functions"},{include:"#operators"}],repository:{comments:{patterns:[{name:"comment.line.double-slash.go",match:"\\/\\/.*$"},{name:"comment.block.go",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.raw.go",begin:"`",end:"`"},{name:"string.quoted.double.go",begin:'"',end:'"',patterns:[{name:"constant.character.escape.go",match:"\\\\."}]},{name:"string.quoted.single.go",begin:"'",end:"'",patterns:[{name:"constant.character.escape.go",match:"\\\\."}]}]},keywords:{patterns:[{name:"keyword.control.go",match:"\\b(break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go|goto|if|import|interface|map|package|range|return|select|struct|switch|type|var)\\b"},{name:"storage.type.go",match:"\\b(bool|byte|complex64|complex128|error|float32|float64|int|int8|int16|int32|int64|rune|string|uint|uint8|uint16|uint32|uint64|uintptr)\\b"},{name:"constant.language.go",match:"\\b(true|false|nil|iota)\\b"},{name:"support.function.builtin.go",match:"\\b(append|cap|close|complex|copy|delete|imag|len|make|new|panic|print|println|real|recover)\\b"}]},numbers:{patterns:[{name:"constant.numeric.go",match:"\\b(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+|\\d+\\.?\\d*(?:[eE][+-]?\\d+)?)[i]?\\b"}]},functions:{patterns:[{name:"entity.name.function.go",match:"\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*(?=\\()"}]},operators:{patterns:[{name:"keyword.operator.go",match:"(\\+\\+|--|\\+|\\-|\\*|/|%|==|!=|<=|>=|<-|<|>|&&|\\|\\||!|&|\\||\\^|&\\^|<<|>>|:=|=|\\+=|-=|\\*=|/=|%=|&=|\\|=|\\^=|&\\^=|<<=|>>=|\\.\\.\\.)"}]}}},fn={name:"GraphQL",scopeName:"source.graphql",keywords:{query:"keyword.operation.graphql",mutation:"keyword.operation.graphql",subscription:"keyword.operation.graphql",fragment:"keyword.operation.graphql",type:"keyword.type.graphql",interface:"keyword.type.graphql",union:"keyword.type.graphql",enum:"keyword.type.graphql",input:"keyword.type.graphql",scalar:"keyword.type.graphql",schema:"keyword.type.graphql",extend:"keyword.type.graphql",implements:"keyword.type.graphql",on:"keyword.other.graphql",true:"constant.language.graphql",false:"constant.language.graphql",null:"constant.language.graphql"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#keywords"},{include:"#directives"}],repository:{comments:{patterns:[{name:"comment.line.number-sign.graphql",match:"#.*$"}]},strings:{patterns:[{name:"string.quoted.triple.graphql",begin:'"""',end:'"""'},{name:"string.quoted.double.graphql",begin:'"',end:'"',patterns:[{name:"constant.character.escape.graphql",match:"\\\\."}]}]},keywords:{patterns:[{name:"keyword.operation.graphql",match:"\\b(query|mutation|subscription|fragment)\\b"},{name:"keyword.type.graphql",match:"\\b(type|interface|union|enum|input|scalar|schema|extend|implements)\\b"},{name:"constant.language.graphql",match:"\\b(true|false|null)\\b"}]},directives:{patterns:[{name:"entity.name.function.directive.graphql",match:"@[a-zA-Z_][a-zA-Z0-9_]*"}]}}},yn={name:"HTML",scopeName:"text.html.basic",patterns:[{include:"#doctype"},{include:"#comments"},{include:"#tags"},{include:"#entities"}],repository:{doctype:{patterns:[{name:"meta.tag.sgml.doctype.html",match:"<!DOCTYPE[^>]*>"}]},comments:{patterns:[{name:"comment.block.html",begin:"<!--",end:"-->"}]},tags:{patterns:[{name:"meta.tag.html",begin:"(<)(script|style|template)\\b",beginCaptures:{1:{name:"punctuation.definition.tag.begin.html"},2:{name:"entity.name.tag.html"}},end:"(</)(\\2)(>)",endCaptures:{1:{name:"punctuation.definition.tag.begin.html"},2:{name:"entity.name.tag.html"},3:{name:"punctuation.definition.tag.end.html"}},patterns:[{include:"#tag-stuff"}]},{name:"meta.tag.html",begin:"(<)([a-zA-Z0-9:-]+)",beginCaptures:{1:{name:"punctuation.definition.tag.begin.html"},2:{name:"entity.name.tag.html"}},end:"(/>)|(>)",endCaptures:{1:{name:"punctuation.definition.tag.end.html"},2:{name:"punctuation.definition.tag.end.html"}},patterns:[{include:"#tag-stuff"}]},{name:"meta.tag.html",begin:"(</)([a-zA-Z0-9:-]+)",beginCaptures:{1:{name:"punctuation.definition.tag.begin.html"},2:{name:"entity.name.tag.html"}},end:"(>)",endCaptures:{1:{name:"punctuation.definition.tag.end.html"}}}]},"tag-stuff":{patterns:[{name:"entity.other.attribute-name.html",match:"\\b(data-[a-zA-Z0-9-]+|aria-[a-zA-Z0-9-]+|on[a-z]+|[a-zA-Z-:]+)"},{name:"string.quoted.double.html",begin:'"',end:'"'},{name:"string.quoted.single.html",begin:"'",end:"'"}]},entities:{patterns:[{name:"constant.character.entity.html",match:"&[a-zA-Z0-9]+;"},{name:"constant.character.entity.html",match:"&#[0-9]+;"}]}}},bn={name:"IDL",scopeName:"source.idl",keywords:{interface:"keyword.other.idl",module:"keyword.other.idl",struct:"keyword.other.idl",union:"keyword.other.idl",enum:"keyword.other.idl",typedef:"keyword.other.idl",exception:"keyword.other.idl",readonly:"storage.modifier.idl",attribute:"storage.modifier.idl",const:"storage.modifier.idl",in:"keyword.other.idl",out:"keyword.other.idl",inout:"keyword.other.idl",void:"storage.type.idl",boolean:"storage.type.idl",byte:"storage.type.idl",short:"storage.type.idl",long:"storage.type.idl",float:"storage.type.idl",double:"storage.type.idl",char:"storage.type.idl",string:"storage.type.idl",TRUE:"constant.language.idl",FALSE:"constant.language.idl"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#keywords"},{include:"#numbers"}],repository:{comments:{patterns:[{name:"comment.line.double-slash.idl",match:"\\/\\/.*$"},{name:"comment.block.idl",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.double.idl",begin:'"',end:'"',patterns:[{name:"constant.character.escape.idl",match:"\\\\."}]}]},keywords:{patterns:[{name:"keyword.other.idl",match:"\\b(interface|module|struct|union|enum|typedef|exception|in|out|inout)\\b"},{name:"storage.modifier.idl",match:"\\b(readonly|attribute|const)\\b"},{name:"storage.type.idl",match:"\\b(void|boolean|byte|short|long|float|double|char|string)\\b"},{name:"constant.language.idl",match:"\\b(TRUE|FALSE)\\b"}]},numbers:{patterns:[{name:"constant.numeric.idl",match:"\\b\\d+\\.?\\d*(?:[eE][+-]?\\d+)?\\b"}]}}},wn={name:"Java",scopeName:"source.java",keywords:{if:"keyword.control.java",else:"keyword.control.java",for:"keyword.control.java",while:"keyword.control.java",do:"keyword.control.java",switch:"keyword.control.java",case:"keyword.control.java",default:"keyword.control.java",break:"keyword.control.java",continue:"keyword.control.java",return:"keyword.control.java",try:"keyword.control.java",catch:"keyword.control.java",finally:"keyword.control.java",throw:"keyword.control.java",throws:"keyword.control.java",assert:"keyword.control.java",class:"storage.type.java",interface:"storage.type.java",enum:"storage.type.java",record:"storage.type.java",void:"storage.type.java",boolean:"storage.type.primitive.java",byte:"storage.type.primitive.java",char:"storage.type.primitive.java",short:"storage.type.primitive.java",int:"storage.type.primitive.java",long:"storage.type.primitive.java",float:"storage.type.primitive.java",double:"storage.type.primitive.java",public:"storage.modifier.java",private:"storage.modifier.java",protected:"storage.modifier.java",static:"storage.modifier.java",final:"storage.modifier.java",abstract:"storage.modifier.java",native:"storage.modifier.java",synchronized:"storage.modifier.java",transient:"storage.modifier.java",volatile:"storage.modifier.java",strictfp:"storage.modifier.java",sealed:"storage.modifier.java","non-sealed":"storage.modifier.java",true:"constant.language.java",false:"constant.language.java",null:"constant.language.java",this:"variable.language.java",super:"variable.language.java",package:"keyword.other.package.java",import:"keyword.other.import.java",extends:"keyword.other.extends.java",implements:"keyword.other.implements.java",new:"keyword.operator.new.java",instanceof:"keyword.operator.instanceof.java",var:"storage.type.java"},patterns:[{include:"#comments"},{include:"#annotations"},{include:"#strings"},{include:"#keywords"},{include:"#numbers"},{include:"#functions"},{include:"#operators"}],repository:{comments:{patterns:[{name:"comment.line.double-slash.java",match:"\\/\\/.*$"},{name:"comment.block.documentation.java",begin:"\\/\\*\\*",end:"\\*\\/",patterns:[{name:"keyword.other.documentation.java",match:"@(?:param|return|throws|author|version|see|since|deprecated)\\b"}]},{name:"comment.block.java",begin:"\\/\\*",end:"\\*\\/"}]},annotations:{patterns:[{name:"storage.type.annotation.java",match:"@[A-Z][a-zA-Z0-9]*"}]},strings:{patterns:[{name:"string.quoted.triple.java",begin:'"""',end:'"""',patterns:[{name:"constant.character.escape.java",match:"\\\\."}]},{name:"string.quoted.double.java",begin:'"',end:'"',patterns:[{name:"constant.character.escape.java",match:"\\\\."}]},{name:"string.quoted.single.java",begin:"'",end:"'",patterns:[{name:"constant.character.escape.java",match:"\\\\."}]}]},keywords:{patterns:[{name:"keyword.control.java",match:"\\b(if|else|for|while|do|switch|case|default|break|continue|return|try|catch|finally|throw|throws|assert)\\b"},{name:"storage.type.java",match:"\\b(class|interface|enum|record|void|var)\\b"},{name:"storage.type.primitive.java",match:"\\b(boolean|byte|char|short|int|long|float|double)\\b"},{name:"storage.modifier.java",match:"\\b(public|private|protected|static|final|abstract|native|synchronized|transient|volatile|strictfp|sealed|non-sealed)\\b"},{name:"constant.language.java",match:"\\b(true|false|null)\\b"},{name:"keyword.other.java",match:"\\b(package|import|extends|implements|new|instanceof)\\b"}]},numbers:{patterns:[{name:"constant.numeric.java",match:"\\b(?:0[xX][0-9a-fA-F_]+[lL]?|0[bB][01_]+[lL]?|0[0-7_]+[lL]?|\\d+[._]?\\d*(?:[eE][+-]?\\d+)?[fFdDlL]?)\\b"}]},functions:{patterns:[{name:"entity.name.function.java",match:"\\b([a-zA-Z_$][a-zA-Z0-9_$]*)\\s*(?=\\()"}]},operators:{patterns:[{name:"keyword.operator.java",match:"(\\+\\+|--|\\+|\\-|\\*|/|%|==|!=|<=|>=|<|>|&&|\\|\\||!|\\?|:|=|\\+=|-=|\\*=|/=|%=|&=|\\|=|\\^=|<<=|>>=|>>>=|&|\\||\\^|~|<<|>>|>>>)"}]}}},kn={name:"JavaScript",scopeName:"source.js",keywords:{if:"keyword.control.js",else:"keyword.control.js",switch:"keyword.control.js",case:"keyword.control.js",default:"keyword.control.js",for:"keyword.control.js",while:"keyword.control.js",do:"keyword.control.js",break:"keyword.control.js",continue:"keyword.control.js",return:"keyword.control.js",try:"keyword.control.js",catch:"keyword.control.js",finally:"keyword.control.js",throw:"keyword.control.js",async:"keyword.control.js",await:"keyword.control.js",yield:"keyword.control.js",const:"storage.type.js",let:"storage.type.js",var:"storage.type.js",function:"storage.type.js",class:"storage.type.js",extends:"storage.type.js",static:"storage.type.js",get:"storage.type.js",set:"storage.type.js",new:"keyword.operator.new.js",delete:"keyword.operator.new.js",typeof:"keyword.operator.new.js",instanceof:"keyword.operator.new.js",void:"keyword.operator.new.js",in:"keyword.operator.new.js",of:"keyword.operator.new.js",true:"constant.language.js",false:"constant.language.js",null:"constant.language.js",undefined:"constant.language.js",NaN:"constant.language.js",Infinity:"constant.language.js",this:"constant.language.js",super:"constant.language.js",arguments:"constant.language.js",import:"keyword.other.js",export:"keyword.other.js",from:"keyword.other.js",as:"keyword.other.js",with:"keyword.other.js",debugger:"keyword.other.js"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#jsx"},{include:"#regex"},{include:"#keywords"},{include:"#numbers"},{include:"#functions"},{include:"#operators"},{include:"#punctuation"}],repository:{comments:{patterns:[{name:"comment.line.double-slash.js",match:"\\/\\/.*$"},{name:"comment.block.js",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.double.js",begin:'"',end:'"',patterns:[{name:"constant.character.escape.js",match:"\\\\."}]},{name:"string.quoted.single.js",begin:"'",end:"'",patterns:[{name:"constant.character.escape.js",match:"\\\\."}]},{name:"string.template.js",begin:"`",end:"`",patterns:[{name:"meta.template.expression.js",begin:"\\$\\{",end:"\\}",patterns:[{include:"$self"}]},{name:"constant.character.escape.js",match:"\\\\."}]}]},jsx:{patterns:[{name:"meta.tag.jsx",begin:"<([A-Z][a-zA-Z0-9]*|[a-z][a-zA-Z0-9-]*)",beginCaptures:{0:{name:"punctuation.definition.tag.begin.jsx"},1:{name:"entity.name.tag.jsx"}},end:"(/?>)",endCaptures:{1:{name:"punctuation.definition.tag.end.jsx"}},patterns:[{name:"entity.other.attribute-name.jsx",match:"[a-zA-Z_:][a-zA-Z0-9_:.-]*"},{name:"meta.embedded.expression.jsx",begin:"\\{",end:"\\}",patterns:[{include:"$self"}]},{name:"string.quoted.double.jsx",begin:'"',end:'"'},{name:"string.quoted.single.jsx",begin:"'",end:"'"}]},{name:"meta.tag.jsx",begin:"(</)([A-Z][a-zA-Z0-9]*|[a-z][a-zA-Z0-9-]*)",beginCaptures:{1:{name:"punctuation.definition.tag.begin.jsx"},2:{name:"entity.name.tag.jsx"}},end:"(>)",endCaptures:{1:{name:"punctuation.definition.tag.end.jsx"}}}]},regex:{patterns:[{name:"string.regexp.js",begin:"(?<=[=(,\\[!&|?{};:])\\s*(\\/)",beginCaptures:{1:{name:"punctuation.definition.string.begin.js"}},end:"(\\/)[gimsuvy]*",endCaptures:{1:{name:"punctuation.definition.string.end.js"}},patterns:[{name:"constant.character.escape.js",match:"\\\\."}]}]},numbers:{patterns:[{name:"constant.numeric.js",match:"\\b(0[xX][0-9a-fA-F_]+|0[bB][01_]+|0[oO][0-7_]+|\\d+(_\\d+)*(\\.\\d+(_\\d+)?)?([eE][+-]?\\d+)?)[nN]?\\b"}]},keywords:{patterns:[{name:"keyword.control.js",match:"\\b(if|else|switch|case|default|for|while|do|break|continue|return|try|catch|finally|throw|async|await|yield)\\b"},{name:"storage.type.js",match:"\\b(const|let|var|function|class|extends|static|async|get|set)\\b"},{name:"keyword.operator.new.js",match:"\\b(new|delete|typeof|instanceof|void|in|of)\\b"},{name:"constant.language.js",match:"\\b(true|false|null|undefined|NaN|Infinity|this|super|arguments)\\b"},{name:"keyword.other.js",match:"\\b(import|export|from|as|default|with|debugger)\\b"}]},functions:{patterns:[{name:"entity.name.function.js",match:"\\b([a-zA-Z_$][a-zA-Z0-9_$]*)\\s*(?=\\()"}]},operators:{patterns:[{name:"keyword.operator.js",match:"(\\+\\+|--|\\+|\\-|\\*|\\/|%|===|==|!==|!=|<=|>=|<|>|&&|\\|\\||!|\\?|:|=>|\\.\\.\\.|&|\\||\\^|~|<<|>>|>>>)"}]},punctuation:{patterns:[{name:"punctuation.js",match:"[{}()\\[\\];,.]"}]}}},vn={name:"JSON",scopeName:"source.json",patterns:[{include:"#value"}],repository:{value:{patterns:[{include:"#constant"},{include:"#number"},{include:"#string"},{include:"#array"},{include:"#object"}]},constant:{patterns:[{name:"constant.language.json",match:"\\b(true|false|null)\\b"}]},number:{patterns:[{name:"constant.numeric.json",match:"-?(0|[1-9]\\d*)(\\.\\d+)?([eE][+-]?\\d+)?"}]},string:{patterns:[{name:"string.quoted.double.json",begin:'"',end:'"',patterns:[{name:"constant.character.escape.json",match:'\\\\(["\\\\/bfnrt]|u[0-9a-fA-F]{4})'},{name:"invalid.illegal.unrecognized-string-escape.json",match:"\\\\."}]}]},array:{patterns:[{name:"meta.structure.array.json",begin:"\\[",beginCaptures:{0:{name:"punctuation.definition.array.begin.json"}},end:"\\]",endCaptures:{0:{name:"punctuation.definition.array.end.json"}},patterns:[{include:"#value"},{name:"punctuation.separator.array.json",match:","}]}]},object:{patterns:[{name:"meta.structure.dictionary.json",begin:"\\{",beginCaptures:{0:{name:"punctuation.definition.dictionary.begin.json"}},end:"\\}",endCaptures:{0:{name:"punctuation.definition.dictionary.end.json"}},patterns:[{name:"meta.structure.dictionary.key.json",begin:'"',beginCaptures:{0:{name:"punctuation.support.type.property-name.begin.json"}},end:'"',endCaptures:{0:{name:"punctuation.support.type.property-name.end.json"}},patterns:[{name:"constant.character.escape.json",match:'\\\\(["\\\\/bfnrt]|u[0-9a-fA-F]{4})'}]},{name:"punctuation.separator.dictionary.key-value.json",match:":"},{name:"punctuation.separator.dictionary.pair.json",match:","},{include:"#value"}]}]}}},xn={name:"JSON5",scopeName:"source.json5",keywords:{true:"constant.language.json5",false:"constant.language.json5",null:"constant.language.json5",Infinity:"constant.language.json5",NaN:"constant.language.json5"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#numbers"},{include:"#constants"},{include:"#keys"}],repository:{comments:{patterns:[{name:"comment.line.double-slash.json5",match:"\\/\\/.*$"},{name:"comment.block.json5",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.single.json5",begin:"'",end:"'",patterns:[{name:"constant.character.escape.json5",match:"\\\\."}]},{name:"string.quoted.double.json5",begin:'"',end:'"',patterns:[{name:"constant.character.escape.json5",match:"\\\\."}]}]},numbers:{patterns:[{name:"constant.numeric.json5",match:"\\b(?:0[xX][0-9a-fA-F]+|[+-]?(?:\\d+\\.?\\d*|\\.\\d+)(?:[eE][+-]?\\d+)?)\\b"}]},constants:{patterns:[{name:"constant.language.json5",match:"\\b(true|false|null|Infinity|NaN)\\b"}]},keys:{patterns:[{name:"support.type.property-name.json5",match:"\\b[a-zA-Z_$][a-zA-Z0-9_$]*\\s*(?=:)"},{name:"support.type.property-name.json5",begin:'"',end:'"(?=\\s*:)'},{name:"support.type.property-name.json5",begin:"'",end:"'(?=\\s*:)"}]}}},An={name:"JSONC",scopeName:"source.jsonc",keywords:{true:"constant.language.json",false:"constant.language.json",null:"constant.language.json"},patterns:[{include:"#comments"},{include:"#value"}],repository:{comments:{patterns:[{name:"comment.line.double-slash.jsonc",match:"\\/\\/.*$"},{name:"comment.block.jsonc",begin:"\\/\\*",end:"\\*\\/"}]},value:{patterns:[{include:"#constant"},{include:"#number"},{include:"#string"},{include:"#array"},{include:"#object"}]},constant:{patterns:[{name:"constant.language.json",match:"\\b(true|false|null)\\b"}]},number:{patterns:[{name:"constant.numeric.json",match:"-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?"}]},string:{patterns:[{name:"string.quoted.double.json",begin:'"',end:'"',patterns:[{name:"constant.character.escape.json",match:'\\\\(?:["\\\\/bfnrt]|u[0-9a-fA-F]{4})'},{name:"invalid.illegal.unrecognized-string-escape.json",match:"\\\\."}]}]},array:{patterns:[{name:"meta.structure.array.json",begin:"\\[",end:"\\]",patterns:[{include:"#value"},{include:"#comments"}]}]},object:{patterns:[{name:"meta.structure.dictionary.json",begin:"\\{",end:"\\}",patterns:[{include:"#comments"},{include:"#objectkey"},{include:"#value"}]}]},objectkey:{patterns:[{name:"support.type.property-name.json",begin:'"',end:'"',patterns:[{name:"constant.character.escape.json",match:'\\\\(?:["\\\\/bfnrt]|u[0-9a-fA-F]{4})'}]}]}}},Cn={name:"Kotlin",scopeName:"source.kotlin",keywords:{package:"keyword.other.kotlin",import:"keyword.other.kotlin",class:"keyword.other.kotlin",interface:"keyword.other.kotlin",object:"keyword.other.kotlin",data:"keyword.other.kotlin",sealed:"keyword.other.kotlin",enum:"keyword.other.kotlin",fun:"keyword.other.kotlin",val:"keyword.other.kotlin",var:"keyword.other.kotlin",if:"keyword.control.kotlin",else:"keyword.control.kotlin",when:"keyword.control.kotlin",for:"keyword.control.kotlin",while:"keyword.control.kotlin",do:"keyword.control.kotlin",return:"keyword.control.kotlin",break:"keyword.control.kotlin",continue:"keyword.control.kotlin",throw:"keyword.control.kotlin",try:"keyword.control.kotlin",catch:"keyword.control.kotlin",finally:"keyword.control.kotlin",public:"storage.modifier.kotlin",private:"storage.modifier.kotlin",protected:"storage.modifier.kotlin",internal:"storage.modifier.kotlin",open:"storage.modifier.kotlin",abstract:"storage.modifier.kotlin",override:"storage.modifier.kotlin",suspend:"storage.modifier.kotlin",inline:"storage.modifier.kotlin",true:"constant.language.kotlin",false:"constant.language.kotlin",null:"constant.language.kotlin",this:"variable.language.kotlin",super:"variable.language.kotlin",it:"variable.language.kotlin"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#keywords"},{include:"#numbers"},{include:"#functions"}],repository:{comments:{patterns:[{name:"comment.line.double-slash.kotlin",match:"\\/\\/.*$"},{name:"comment.block.kotlin",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.triple.kotlin",begin:'"""',end:'"""',patterns:[{name:"meta.template.expression.kotlin",begin:"\\$\\{",end:"\\}"},{name:"variable.other.kotlin",match:"\\$[a-zA-Z_][a-zA-Z0-9_]*"}]},{name:"string.quoted.double.kotlin",begin:'"',end:'"',patterns:[{name:"constant.character.escape.kotlin",match:"\\\\."},{name:"variable.other.kotlin",match:"\\$[a-zA-Z_][a-zA-Z0-9_]*"},{name:"meta.template.expression.kotlin",begin:"\\$\\{",end:"\\}"}]}]},keywords:{patterns:[{name:"keyword.control.kotlin",match:"\\b(if|else|when|for|while|do|return|break|continue|throw|try|catch|finally)\\b"},{name:"keyword.other.kotlin",match:"\\b(package|import|class|interface|object|data|sealed|enum|fun|val|var)\\b"},{name:"storage.modifier.kotlin",match:"\\b(public|private|protected|internal|open|abstract|override|suspend|inline)\\b"},{name:"constant.language.kotlin",match:"\\b(true|false|null)\\b"}]},numbers:{patterns:[{name:"constant.numeric.kotlin",match:"\\b(?:0[xX][0-9a-fA-F_]+|0[bB][01_]+|\\d+[._]?\\d*(?:[eE][+-]?\\d+)?)[fFdDlL]?\\b"}]},functions:{patterns:[{name:"entity.name.function.kotlin",match:"\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*(?=\\()"}]}}},Tn={name:"LaTeX",scopeName:"text.tex.latex",keywords:{},patterns:[{include:"#comments"},{include:"#commands"},{include:"#environments"},{include:"#math"}],repository:{comments:{patterns:[{name:"comment.line.percentage.latex",match:"%.*$"}]},commands:{patterns:[{name:"support.function.latex",match:"\\\\[a-zA-Z]+"}]},environments:{patterns:[{name:"meta.environment.latex",begin:"\\\\begin\\{([a-zA-Z]+)\\}",beginCaptures:{0:{name:"support.function.latex"},1:{name:"variable.parameter.latex"}},end:"\\\\end\\{\\1\\}",endCaptures:{0:{name:"support.function.latex"}}}]},math:{patterns:[{name:"string.other.math.latex",begin:"\\$\\$",end:"\\$\\$"},{name:"string.other.math.latex",begin:"\\$",end:"\\$"}]}}},jn={name:"Log",scopeName:"text.log",keywords:{},patterns:[{include:"#log-levels"},{include:"#timestamps"},{include:"#ip-addresses"}],repository:{"log-levels":{patterns:[{name:"markup.error.log",match:"\\b(ERROR|FATAL|CRITICAL)\\b"},{name:"markup.warning.log",match:"\\b(WARN|WARNING)\\b"},{name:"markup.info.log",match:"\\b(INFO|NOTICE)\\b"},{name:"markup.debug.log",match:"\\b(DEBUG|TRACE)\\b"}]},timestamps:{patterns:[{name:"constant.numeric.timestamp.log",match:"\\d{4}-\\d{2}-\\d{2}[T ]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?"}]},"ip-addresses":{patterns:[{name:"constant.numeric.ip.log",match:"\\b(?:\\d{1,3}\\.){3}\\d{1,3}\\b"}]}}},$n={name:"Lua",scopeName:"source.lua",keywords:{and:"keyword.operator.lua",break:"keyword.control.lua",do:"keyword.control.lua",else:"keyword.control.lua",elseif:"keyword.control.lua",end:"keyword.control.lua",false:"constant.language.lua",for:"keyword.control.lua",function:"keyword.control.lua",if:"keyword.control.lua",in:"keyword.control.lua",local:"storage.modifier.lua",nil:"constant.language.lua",not:"keyword.operator.lua",or:"keyword.operator.lua",repeat:"keyword.control.lua",return:"keyword.control.lua",then:"keyword.control.lua",true:"constant.language.lua",until:"keyword.control.lua",while:"keyword.control.lua"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#keywords"},{include:"#numbers"}],repository:{comments:{patterns:[{name:"comment.block.lua",begin:"--\\[\\[",end:"\\]\\]"},{name:"comment.line.double-dash.lua",match:"--.*$"}]},strings:{patterns:[{name:"string.quoted.other.multiline.lua",begin:"\\[\\[",end:"\\]\\]"},{name:"string.quoted.double.lua",begin:'"',end:'"',patterns:[{name:"constant.character.escape.lua",match:"\\\\."}]},{name:"string.quoted.single.lua",begin:"'",end:"'",patterns:[{name:"constant.character.escape.lua",match:"\\\\."}]}]},keywords:{patterns:[{name:"keyword.control.lua",match:"\\b(break|do|else|elseif|end|for|function|if|in|repeat|return|then|until|while)\\b"},{name:"constant.language.lua",match:"\\b(true|false|nil)\\b"},{name:"storage.modifier.lua",match:"\\b(local)\\b"}]},numbers:{patterns:[{name:"constant.numeric.lua",match:"\\b(?:0[xX][0-9a-fA-F]+|\\d+\\.?\\d*(?:[eE][+-]?\\d+)?)\\b"}]}}},En={name:"Makefile",scopeName:"source.makefile",keywords:{ifeq:"keyword.control.makefile",ifneq:"keyword.control.makefile",ifdef:"keyword.control.makefile",ifndef:"keyword.control.makefile",else:"keyword.control.makefile",endif:"keyword.control.makefile",include:"keyword.control.makefile",define:"keyword.control.makefile",endef:"keyword.control.makefile"},patterns:[{include:"#comments"},{include:"#targets"},{include:"#variables"},{include:"#directives"}],repository:{comments:{patterns:[{name:"comment.line.number-sign.makefile",match:"#.*$"}]},targets:{patterns:[{name:"entity.name.function.target.makefile",match:"^[a-zA-Z0-9._-]+(?=:)"}]},variables:{patterns:[{name:"variable.other.makefile",match:"\\$[({][a-zA-Z0-9_]+[})]"},{name:"variable.other.makefile",match:"\\$[a-zA-Z0-9_]"}]},directives:{patterns:[{name:"keyword.control.makefile",match:"^\\s*(ifeq|ifneq|ifdef|ifndef|else|endif|include|define|endef)\\b"}]}}},Nn={name:"Markdown",scopeName:"text.html.markdown",keywords:{},patterns:[{include:"#heading"},{include:"#code-block"},{include:"#code-inline"},{include:"#bold"},{include:"#italic"},{include:"#strikethrough"},{include:"#link"},{include:"#image"},{include:"#list"},{include:"#blockquote"},{include:"#horizontal-rule"},{include:"#table"}],repository:{heading:{patterns:[{name:"markup.heading.markdown",match:"^(#{1,6})\\s+(.+)$",captures:{1:{name:"markup.heading.marker.markdown"},2:{name:"markup.heading.content.markdown"}}},{name:"markup.heading.setext.markdown",match:"^(=+|-+)$"}]},"code-block":{patterns:[{name:"markup.fenced_code.block.markdown",begin:"^```([a-zA-Z0-9]*)",end:"^```",captures:{1:{name:"entity.name.function.markdown"}},contentName:"markup.raw.code.markdown"},{name:"markup.raw.code.markdown",match:"^( |\\t)(.*)$"}]},"code-inline":{patterns:[{name:"markup.inline.raw.markdown",match:"`[^`]+`"}]},bold:{patterns:[{name:"markup.bold.markdown",match:"(\\*\\*|__)(?=\\S)(.+?[*_]*)(?<=\\S)\\1",captures:{1:{name:"punctuation.definition.bold.markdown"},2:{name:"markup.bold.content.markdown"}}}]},italic:{patterns:[{name:"markup.italic.markdown",match:"(\\*|_)(?=\\S)(.+?)(?<=\\S)\\1",captures:{1:{name:"punctuation.definition.italic.markdown"},2:{name:"markup.italic.content.markdown"}}}]},strikethrough:{patterns:[{name:"markup.strikethrough.markdown",match:"~~(.+?)~~",captures:{1:{name:"markup.strikethrough.content.markdown"}}}]},link:{patterns:[{name:"meta.link.inline.markdown",match:"\\[([^\\]]+)\\]\\(([^)]+)\\)",captures:{1:{name:"string.other.link.title.markdown"},2:{name:"markup.underline.link.markdown"}}},{name:"meta.link.reference.markdown",match:"\\[([^\\]]+)\\]\\[([^\\]]+)\\]",captures:{1:{name:"string.other.link.title.markdown"},2:{name:"constant.other.reference.link.markdown"}}}]},image:{patterns:[{name:"meta.image.inline.markdown",match:"!\\[([^\\]]*)\\]\\(([^)]+)\\)",captures:{1:{name:"string.other.link.description.markdown"},2:{name:"markup.underline.link.image.markdown"}}}]},list:{patterns:[{name:"markup.list.unnumbered.markdown",match:"^\\s*([-*+])\\s+",captures:{1:{name:"punctuation.definition.list.markdown"}}},{name:"markup.list.numbered.markdown",match:"^\\s*(\\d+\\.)\\s+",captures:{1:{name:"punctuation.definition.list.markdown"}}}]},blockquote:{patterns:[{name:"markup.quote.markdown",match:"^\\s*>\\s*(.*)$",captures:{1:{name:"markup.quote.content.markdown"}}}]},"horizontal-rule":{patterns:[{name:"meta.separator.markdown",match:"^\\s*([-*_]){3,}\\s*$"}]},table:{patterns:[{name:"markup.table.markdown",match:"^\\|(.+)\\|$"},{name:"markup.table.delimiter.markdown",match:"^\\|([:\\-\\s|]+)\\|$"}]}}},Sn={name:"Nginx",scopeName:"source.nginx",keywords:{},patterns:[{include:"#comments"},{include:"#directives"},{include:"#blocks"},{include:"#variables"},{include:"#strings"}],repository:{comments:{patterns:[{name:"comment.line.number-sign.nginx",match:"#.*$"}]},directives:{patterns:[{name:"keyword.other.directive.nginx",match:"\\b(server|location|listen|root|index|proxy_pass|return|rewrite|try_files|add_header|set|if|access_log|error_log)\\b"}]},blocks:{patterns:[{name:"entity.name.section.nginx",match:"\\b(http|server|location|upstream|events)\\b"}]},variables:{patterns:[{name:"variable.other.nginx",match:"\\$[a-zA-Z_][a-zA-Z0-9_]*"}]},strings:{patterns:[{name:"string.quoted.double.nginx",begin:'"',end:'"'},{name:"string.quoted.single.nginx",begin:"'",end:"'"}]}}},qn={name:"PHP",scopeName:"source.php",keywords:{if:"keyword.control.php",else:"keyword.control.php",elseif:"keyword.control.php",endif:"keyword.control.php",for:"keyword.control.php",foreach:"keyword.control.php",endfor:"keyword.control.php",endforeach:"keyword.control.php",while:"keyword.control.php",endwhile:"keyword.control.php",do:"keyword.control.php",switch:"keyword.control.php",case:"keyword.control.php",default:"keyword.control.php",endswitch:"keyword.control.php",break:"keyword.control.php",continue:"keyword.control.php",return:"keyword.control.php",goto:"keyword.control.php",try:"keyword.control.php",catch:"keyword.control.php",finally:"keyword.control.php",throw:"keyword.control.php",match:"keyword.control.php",function:"storage.type.function.php",class:"storage.type.class.php",interface:"storage.type.interface.php",trait:"storage.type.trait.php",enum:"storage.type.enum.php",namespace:"storage.type.namespace.php",use:"keyword.other.use.php",extends:"storage.modifier.extends.php",implements:"storage.modifier.implements.php",public:"storage.modifier.php",private:"storage.modifier.php",protected:"storage.modifier.php",static:"storage.modifier.php",final:"storage.modifier.php",abstract:"storage.modifier.php",readonly:"storage.modifier.php",true:"constant.language.php",false:"constant.language.php",null:"constant.language.php",TRUE:"constant.language.php",FALSE:"constant.language.php",NULL:"constant.language.php",this:"variable.language.php",parent:"variable.language.php",self:"variable.language.php",new:"keyword.operator.new.php",clone:"keyword.operator.clone.php",instanceof:"keyword.operator.instanceof.php",and:"keyword.operator.logical.php",or:"keyword.operator.logical.php",xor:"keyword.operator.logical.php",echo:"support.function.construct.php",print:"support.function.construct.php",require:"keyword.control.import.php",require_once:"keyword.control.import.php",include:"keyword.control.import.php",include_once:"keyword.control.import.php",die:"keyword.control.php",exit:"keyword.control.php",isset:"support.function.construct.php",empty:"support.function.construct.php",unset:"support.function.construct.php",yield:"keyword.control.php","yield from":"keyword.control.php",declare:"keyword.control.php",const:"storage.type.const.php",var:"storage.type.var.php",global:"storage.modifier.php"},patterns:[{include:"#php-tags"},{include:"#comments"},{include:"#strings"},{include:"#heredoc"},{include:"#keywords"},{include:"#variables"},{include:"#functions"},{include:"#numbers"},{include:"#operators"}],repository:{"php-tags":{patterns:[{name:"meta.embedded.block.php",begin:"<\\?(?:php|=)?",beginCaptures:{0:{name:"punctuation.section.embedded.begin.php"}},end:"\\?>",endCaptures:{0:{name:"punctuation.section.embedded.end.php"}},patterns:[{include:"#comments"},{include:"#strings"},{include:"#heredoc"},{include:"#keywords"},{include:"#variables"},{include:"#functions"},{include:"#numbers"},{include:"#operators"}]}]},comments:{patterns:[{name:"comment.line.double-slash.php",match:"\\/\\/.*$"},{name:"comment.line.number-sign.php",match:"#.*$"},{name:"comment.block.php",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.double.php",begin:'"',end:'"',patterns:[{name:"constant.character.escape.php",match:"\\\\."},{name:"variable.other.php",match:"\\$[a-zA-Z_][a-zA-Z0-9_]*"},{name:"meta.embedded.expression.php",begin:"\\{\\$",end:"\\}",patterns:[{include:"#variables"}]}]},{name:"string.quoted.single.php",begin:"'",end:"'",patterns:[{name:"constant.character.escape.php",match:"\\\\['\\\\]"}]}]},heredoc:{patterns:[{name:"string.unquoted.heredoc.php",begin:`<<<(["']?)([a-zA-Z_][a-zA-Z0-9_]*)\\1`,end:"^\\2;?$",patterns:[{name:"variable.other.php",match:"\\$[a-zA-Z_][a-zA-Z0-9_]*"}]}]},keywords:{patterns:[{name:"keyword.control.php",match:"\\b(if|else|elseif|endif|for|foreach|endfor|endforeach|while|endwhile|do|switch|case|default|endswitch|break|continue|return|goto|try|catch|finally|throw|match|die|exit|yield|declare)\\b"},{name:"storage.type.php",match:"\\b(function|class|interface|trait|enum|namespace|const|var)\\b"},{name:"storage.modifier.php",match:"\\b(public|private|protected|static|final|abstract|readonly|global)\\b"},{name:"keyword.other.php",match:"\\b(use|extends|implements)\\b"},{name:"constant.language.php",match:"\\b(true|false|null|TRUE|FALSE|NULL)\\b"},{name:"keyword.control.import.php",match:"\\b(require|require_once|include|include_once)\\b"}]},variables:{patterns:[{name:"variable.language.php",match:"\\$(?:this|GLOBALS|_GET|_POST|_REQUEST|_SESSION|_COOKIE|_SERVER|_FILES|_ENV)\\b"},{name:"variable.other.php",match:"\\$[a-zA-Z_][a-zA-Z0-9_]*"}]},functions:{patterns:[{name:"entity.name.function.php",match:"\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*(?=\\()"}]},numbers:{patterns:[{name:"constant.numeric.php",match:"\\b(?:0[xX][0-9a-fA-F]+|0[bB][01]+|0[oO][0-7]+|\\d+\\.?\\d*(?:[eE][+-]?\\d+)?)\\b"}]},operators:{patterns:[{name:"keyword.operator.php",match:"(===|!==|==|!=|<=|>=|<>|<|>|\\+\\+|--|\\+|\\-|\\*|/|%|&&|\\|\\||!|\\.|=>|->|::|\\.=|\\+=|-=|\\*=|/=|%=|&=|\\|=|\\^=|<<=|>>=)"}]}}},_n={name:"PowerShell",scopeName:"source.powershell",keywords:{if:"keyword.control.powershell",else:"keyword.control.powershell",elseif:"keyword.control.powershell",switch:"keyword.control.powershell",for:"keyword.control.powershell",foreach:"keyword.control.powershell",while:"keyword.control.powershell",do:"keyword.control.powershell",until:"keyword.control.powershell",break:"keyword.control.powershell",continue:"keyword.control.powershell",return:"keyword.control.powershell",function:"storage.type.powershell",filter:"storage.type.powershell",param:"storage.type.powershell",begin:"keyword.control.powershell",process:"keyword.control.powershell",end:"keyword.control.powershell",try:"keyword.control.powershell",catch:"keyword.control.powershell",finally:"keyword.control.powershell",throw:"keyword.control.powershell",$true:"constant.language.powershell",$false:"constant.language.powershell",$null:"constant.language.powershell"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#variables"},{include:"#keywords"},{include:"#cmdlets"}],repository:{comments:{patterns:[{name:"comment.line.number-sign.powershell",match:"#.*$"},{name:"comment.block.powershell",begin:"<#",end:"#>"}]},strings:{patterns:[{name:"string.quoted.double.powershell",begin:'"',end:'"',patterns:[{name:"variable.other.powershell",match:"\\$[a-zA-Z_][a-zA-Z0-9_]*"}]},{name:"string.quoted.single.powershell",begin:"'",end:"'"}]},variables:{patterns:[{name:"variable.other.powershell",match:"\\$[a-zA-Z_][a-zA-Z0-9_]*"}]},keywords:{patterns:[{name:"keyword.control.powershell",match:"\\b(if|else|elseif|switch|for|foreach|while|do|until|break|continue|return|begin|process|end|try|catch|finally|throw)\\b"},{name:"storage.type.powershell",match:"\\b(function|filter|param)\\b"},{name:"constant.language.powershell",match:"\\$(?:true|false|null)\\b"}]},cmdlets:{patterns:[{name:"support.function.powershell",match:"\\b[A-Z][a-z]+-[A-Z][a-z]+[a-zA-Z]*\\b"}]}}},zn={name:"Protocol Buffers",scopeName:"source.proto",keywords:{syntax:"keyword.other.proto",package:"keyword.other.proto",import:"keyword.other.proto",option:"keyword.other.proto",message:"keyword.other.proto",enum:"keyword.other.proto",service:"keyword.other.proto",rpc:"keyword.other.proto",returns:"keyword.other.proto",repeated:"storage.modifier.proto",optional:"storage.modifier.proto",required:"storage.modifier.proto",true:"constant.language.proto",false:"constant.language.proto"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#keywords"},{include:"#numbers"}],repository:{comments:{patterns:[{name:"comment.line.double-slash.proto",match:"\\/\\/.*$"},{name:"comment.block.proto",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.double.proto",begin:'"',end:'"',patterns:[{name:"constant.character.escape.proto",match:"\\\\."}]}]},keywords:{patterns:[{name:"keyword.other.proto",match:"\\b(syntax|package|import|option|message|enum|service|rpc|returns)\\b"},{name:"storage.modifier.proto",match:"\\b(repeated|optional|required)\\b"},{name:"constant.language.proto",match:"\\b(true|false)\\b"}]},numbers:{patterns:[{name:"constant.numeric.proto",match:"\\b\\d+\\b"}]}}},Ln={name:"Python",scopeName:"source.python",keywords:{if:"keyword.control.python",elif:"keyword.control.python",else:"keyword.control.python",for:"keyword.control.python",while:"keyword.control.python",break:"keyword.control.python",continue:"keyword.control.python",return:"keyword.control.python",yield:"keyword.control.python",try:"keyword.control.python",except:"keyword.control.python",finally:"keyword.control.python",raise:"keyword.control.python",with:"keyword.control.python",as:"keyword.control.python",pass:"keyword.control.python",match:"keyword.control.python",case:"keyword.control.python",def:"storage.type.function.python",class:"storage.type.class.python",lambda:"storage.type.function.python",async:"storage.modifier.async.python",await:"keyword.control.python",and:"keyword.operator.logical.python",or:"keyword.operator.logical.python",not:"keyword.operator.logical.python",in:"keyword.operator.python",is:"keyword.operator.python",import:"keyword.control.import.python",from:"keyword.control.import.python",True:"constant.language.python",False:"constant.language.python",None:"constant.language.python",self:"variable.language.python",cls:"variable.language.python",print:"support.function.builtin.python",len:"support.function.builtin.python",range:"support.function.builtin.python",str:"support.function.builtin.python",int:"support.function.builtin.python",float:"support.function.builtin.python",list:"support.function.builtin.python",dict:"support.function.builtin.python",tuple:"support.function.builtin.python",set:"support.function.builtin.python",bool:"support.function.builtin.python"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#decorators"},{include:"#keywords"},{include:"#functions"},{include:"#numbers"},{include:"#operators"}],repository:{comments:{patterns:[{name:"comment.line.number-sign.python",match:"#.*$"}]},strings:{patterns:[{name:"string.quoted.docstring.python",begin:'"""',end:'"""'},{name:"string.quoted.docstring.python",begin:"'''",end:"'''"},{name:"string.quoted.double.python",begin:'f"',end:'"',patterns:[{name:"constant.character.escape.python",match:"\\\\."},{name:"meta.embedded.expression.python",begin:"\\{",end:"\\}"}]},{name:"string.quoted.double.python",begin:'"',end:'"',patterns:[{name:"constant.character.escape.python",match:"\\\\."}]},{name:"string.quoted.single.python",begin:"'",end:"'",patterns:[{name:"constant.character.escape.python",match:"\\\\."}]}]},decorators:{patterns:[{name:"entity.name.function.decorator.python",match:"@[a-zA-Z_][a-zA-Z0-9_]*"}]},keywords:{patterns:[{name:"keyword.control.python",match:"\\b(if|elif|else|for|while|break|continue|return|yield|try|except|finally|raise|with|as|pass|match|case|await)\\b"},{name:"storage.type.python",match:"\\b(def|class|lambda|async)\\b"},{name:"keyword.control.import.python",match:"\\b(import|from)\\b"},{name:"constant.language.python",match:"\\b(True|False|None)\\b"}]},functions:{patterns:[{name:"entity.name.function.python",match:"\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*(?=\\()"}]},numbers:{patterns:[{name:"constant.numeric.python",match:"\\b(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:[eE][-+]?[0-9]+)?)\\b"}]},operators:{patterns:[{name:"keyword.operator.python",match:"(\\+|-|\\*|/|//|%|\\*\\*|==|!=|<|>|<=|>=|=|\\+=|-=|\\*=|/=)"}]}}},On={name:"R",scopeName:"source.r",keywords:{if:"keyword.control.r",else:"keyword.control.r",for:"keyword.control.r",while:"keyword.control.r",repeat:"keyword.control.r",break:"keyword.control.r",next:"keyword.control.r",return:"keyword.control.r",function:"storage.type.r",in:"keyword.operator.r",TRUE:"constant.language.r",FALSE:"constant.language.r",NULL:"constant.language.r",NA:"constant.language.r",NaN:"constant.language.r",Inf:"constant.language.r"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#keywords"},{include:"#numbers"},{include:"#operators"}],repository:{comments:{patterns:[{name:"comment.line.number-sign.r",match:"#.*$"}]},strings:{patterns:[{name:"string.quoted.double.r",begin:'"',end:'"',patterns:[{name:"constant.character.escape.r",match:"\\\\."}]},{name:"string.quoted.single.r",begin:"'",end:"'",patterns:[{name:"constant.character.escape.r",match:"\\\\."}]}]},keywords:{patterns:[{name:"keyword.control.r",match:"\\b(if|else|for|while|repeat|break|next|return|in)\\b"},{name:"storage.type.r",match:"\\b(function)\\b"},{name:"constant.language.r",match:"\\b(TRUE|FALSE|NULL|NA|NaN|Inf)\\b"}]},numbers:{patterns:[{name:"constant.numeric.r",match:"\\b\\d+\\.?\\d*(?:[eE][+-]?\\d+)?[iL]?\\b"}]},operators:{patterns:[{name:"keyword.operator.r",match:"(<-|<<-|->|->>|==|!=|<=|>=|<|>|&&|\\|\\||!|&|\\||%[a-zA-Z]+%|\\+|\\-|\\*|/|\\^|%%|%/%|::|:::)"}]}}},In={name:"RegExp",scopeName:"source.regexp",keywords:{},patterns:[{include:"#character-class"},{include:"#groups"},{include:"#quantifiers"},{include:"#anchors"}],repository:{"character-class":{patterns:[{name:"constant.character.character-class.regexp",begin:"\\[",end:"\\]",patterns:[{name:"constant.character.escape.regexp",match:"\\\\."}]}]},groups:{patterns:[{name:"meta.group.regexp",begin:"\\(",end:"\\)",patterns:[{include:"$self"}]}]},quantifiers:{patterns:[{name:"keyword.operator.quantifier.regexp",match:"[*+?]|\\{\\d+(,\\d*)?\\}"}]},anchors:{patterns:[{name:"keyword.operator.anchor.regexp",match:"\\^|\\$"}]}}},Fn={name:"Ruby",scopeName:"source.ruby",keywords:{if:"keyword.control.ruby",elsif:"keyword.control.ruby",else:"keyword.control.ruby",unless:"keyword.control.ruby",case:"keyword.control.ruby",when:"keyword.control.ruby",while:"keyword.control.ruby",until:"keyword.control.ruby",for:"keyword.control.ruby",break:"keyword.control.ruby",next:"keyword.control.ruby",redo:"keyword.control.ruby",retry:"keyword.control.ruby",return:"keyword.control.ruby",yield:"keyword.control.ruby",begin:"keyword.control.ruby",rescue:"keyword.control.ruby",ensure:"keyword.control.ruby",raise:"keyword.control.ruby",end:"keyword.control.ruby",then:"keyword.control.ruby",do:"keyword.control.ruby",def:"keyword.control.ruby",class:"keyword.control.ruby",module:"keyword.control.ruby",include:"keyword.other.ruby",extend:"keyword.other.ruby",require:"keyword.other.ruby",require_relative:"keyword.other.ruby",load:"keyword.other.ruby",alias:"keyword.other.ruby",undef:"keyword.other.ruby","defined?":"keyword.other.ruby",super:"variable.language.ruby",self:"variable.language.ruby",true:"constant.language.ruby",false:"constant.language.ruby",nil:"constant.language.ruby",__FILE__:"constant.language.ruby",__LINE__:"constant.language.ruby",__ENCODING__:"constant.language.ruby",and:"keyword.operator.logical.ruby",or:"keyword.operator.logical.ruby",not:"keyword.operator.logical.ruby",private:"keyword.other.ruby",protected:"keyword.other.ruby",public:"keyword.other.ruby",attr_reader:"keyword.other.ruby",attr_writer:"keyword.other.ruby",attr_accessor:"keyword.other.ruby"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#symbols"},{include:"#regex"},{include:"#keywords"},{include:"#numbers"},{include:"#functions"},{include:"#operators"}],repository:{comments:{patterns:[{name:"comment.line.number-sign.ruby",match:"#.*$"},{name:"comment.block.ruby",begin:"^=begin",end:"^=end"}]},strings:{patterns:[{name:"string.quoted.double.ruby",begin:'"',end:'"',patterns:[{name:"constant.character.escape.ruby",match:"\\\\."},{name:"meta.interpolation.ruby",begin:"#\\{",end:"\\}",patterns:[{include:"$self"}]}]},{name:"string.quoted.single.ruby",begin:"'",end:"'",patterns:[{name:"constant.character.escape.ruby",match:"\\\\['\\\\]"}]},{name:"string.quoted.other.ruby",begin:"%[qQ]?[{(\\[]",end:"[})\\]]"}]},symbols:{patterns:[{name:"constant.other.symbol.ruby",match:":[a-zA-Z_][a-zA-Z0-9_]*[?!]?"},{name:"constant.other.symbol.ruby",match:':"[^"]*"'}]},regex:{patterns:[{name:"string.regexp.ruby",begin:"/",end:"/[iomxneus]*",patterns:[{name:"constant.character.escape.ruby",match:"\\\\."}]}]},keywords:{patterns:[{name:"keyword.control.ruby",match:"\\b(if|elsif|else|unless|case|when|while|until|for|break|next|redo|retry|return|yield|begin|rescue|ensure|raise|end|then|do|def|class|module)\\b"},{name:"keyword.other.ruby",match:"\\b(include|extend|require|require_relative|load|alias|undef|defined\\?|private|protected|public|attr_reader|attr_writer|attr_accessor)\\b"},{name:"constant.language.ruby",match:"\\b(true|false|nil|__FILE__|__LINE__|__ENCODING__)\\b"},{name:"variable.language.ruby",match:"\\b(self|super)\\b"}]},numbers:{patterns:[{name:"constant.numeric.ruby",match:"\\b(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+|\\d+\\.?\\d*(?:[eE][+-]?\\d+)?)\\b"}]},functions:{patterns:[{name:"entity.name.function.ruby",match:"\\b([a-zA-Z_][a-zA-Z0-9_]*[?!]?)\\s*(?=\\()"}]},operators:{patterns:[{name:"keyword.operator.ruby",match:"(=>|\\+|\\-|\\*|/|%|\\*\\*|==|!=|<|>|<=|>=|<=>|===|=~|!~|&&|\\|\\||!|&|\\||\\^|~|<<|>>|\\.\\.|\\.\\.\\.)"}]}}},Rn={name:"Rust",scopeName:"source.rust",keywords:{if:"keyword.control.rust",else:"keyword.control.rust",for:"keyword.control.rust",while:"keyword.control.rust",loop:"keyword.control.rust",match:"keyword.control.rust",return:"keyword.control.rust",break:"keyword.control.rust",continue:"keyword.control.rust",yield:"keyword.control.rust",fn:"keyword.other.fn.rust",let:"keyword.other.rust",struct:"keyword.other.rust",enum:"keyword.other.rust",trait:"keyword.other.rust",impl:"keyword.other.rust",type:"keyword.other.rust",mod:"keyword.other.rust",use:"keyword.other.rust",const:"keyword.other.rust",static:"keyword.other.rust",pub:"storage.modifier.rust",mut:"storage.modifier.rust",ref:"storage.modifier.rust",unsafe:"storage.modifier.rust",async:"storage.modifier.rust",await:"keyword.control.rust",move:"storage.modifier.rust",i8:"storage.type.rust",i16:"storage.type.rust",i32:"storage.type.rust",i64:"storage.type.rust",i128:"storage.type.rust",isize:"storage.type.rust",u8:"storage.type.rust",u16:"storage.type.rust",u32:"storage.type.rust",u64:"storage.type.rust",u128:"storage.type.rust",usize:"storage.type.rust",f32:"storage.type.rust",f64:"storage.type.rust",bool:"storage.type.rust",char:"storage.type.rust",str:"storage.type.rust",Self:"storage.type.rust",true:"constant.language.rust",false:"constant.language.rust",self:"variable.language.rust",super:"variable.language.rust",crate:"variable.language.rust",where:"keyword.other.rust",as:"keyword.other.rust",in:"keyword.other.rust",extern:"keyword.other.rust",dyn:"keyword.other.rust"},patterns:[{include:"#comments"},{include:"#attributes"},{include:"#strings"},{include:"#lifetimes"},{include:"#macros"},{include:"#keywords"},{include:"#numbers"},{include:"#functions"},{include:"#operators"}],repository:{comments:{patterns:[{name:"comment.line.documentation.rust",match:"\\/\\/\\/.*$"},{name:"comment.line.double-slash.rust",match:"\\/\\/.*$"},{name:"comment.block.rust",begin:"\\/\\*",end:"\\*\\/"}]},attributes:{patterns:[{name:"meta.attribute.rust",begin:"#!?\\[",end:"\\]",patterns:[{name:"entity.name.function.attribute.rust",match:"[a-zA-Z_][a-zA-Z0-9_]*"}]}]},strings:{patterns:[{name:"string.quoted.byte.raw.rust",begin:'br(#*)"',end:'"\\1'},{name:"string.quoted.raw.rust",begin:'r(#*)"',end:'"\\1'},{name:"string.quoted.double.rust",begin:'"',end:'"',patterns:[{name:"constant.character.escape.rust",match:"\\\\."}]},{name:"string.quoted.single.rust",begin:"'",end:"'",patterns:[{name:"constant.character.escape.rust",match:"\\\\."}]}]},lifetimes:{patterns:[{name:"entity.name.lifetime.rust",match:"'[a-zA-Z_][a-zA-Z0-9_]*\\b"}]},macros:{patterns:[{name:"entity.name.function.macro.rust",match:"\\b([a-zA-Z_][a-zA-Z0-9_]*)!"}]},keywords:{patterns:[{name:"keyword.control.rust",match:"\\b(if|else|for|while|loop|match|return|break|continue|yield|await)\\b"},{name:"keyword.other.rust",match:"\\b(fn|let|struct|enum|trait|impl|type|mod|use|const|static|where|as|in|extern|dyn)\\b"},{name:"storage.modifier.rust",match:"\\b(pub|mut|ref|unsafe|async|move)\\b"},{name:"storage.type.rust",match:"\\b(i8|i16|i32|i64|i128|isize|u8|u16|u32|u64|u128|usize|f32|f64|bool|char|str|Self)\\b"},{name:"constant.language.rust",match:"\\b(true|false)\\b"},{name:"variable.language.rust",match:"\\b(self|super|crate)\\b"}]},numbers:{patterns:[{name:"constant.numeric.rust",match:"\\b(?:0[xX][0-9a-fA-F_]+|0[oO][0-7_]+|0[bB][01_]+|\\d+[._]?\\d*(?:[eE][+-]?\\d+)?)[iu]?(?:8|16|32|64|128|size)?\\b"}]},functions:{patterns:[{name:"entity.name.function.rust",match:"\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*(?=\\()"}]},operators:{patterns:[{name:"keyword.operator.rust",match:"(->|=>|\\+|\\-|\\*|/|%|==|!=|<=|>=|<|>|&&|\\|\\||!|&|\\||\\^|<<|>>|=|\\+=|-=|\\*=|/=|%=|&=|\\|=|\\^=|<<=|>>=|::|\\.|\\.\\.|\\.\\.\\.=)"}]}}},Pn={name:"SCSS",scopeName:"source.scss",keywords:{"@import":"keyword.control.at-rule.scss","@use":"keyword.control.at-rule.scss","@forward":"keyword.control.at-rule.scss","@mixin":"keyword.control.at-rule.scss","@include":"keyword.control.at-rule.scss","@function":"keyword.control.at-rule.scss","@return":"keyword.control.at-rule.scss","@extend":"keyword.control.at-rule.scss","@if":"keyword.control.at-rule.scss","@else":"keyword.control.at-rule.scss","@for":"keyword.control.at-rule.scss","@each":"keyword.control.at-rule.scss","@while":"keyword.control.at-rule.scss","@media":"keyword.control.at-rule.scss","@keyframes":"keyword.control.at-rule.scss"},patterns:[{include:"#comments"},{include:"#at-rules"},{include:"#variables"},{include:"#strings"},{include:"#selectors"},{include:"#properties"}],repository:{comments:{patterns:[{name:"comment.line.double-slash.scss",match:"\\/\\/.*$"},{name:"comment.block.scss",begin:"\\/\\*",end:"\\*\\/"}]},"at-rules":{patterns:[{name:"keyword.control.at-rule.scss",match:"@[a-z-]+"}]},variables:{patterns:[{name:"variable.scss",match:"\\$[a-zA-Z_-][a-zA-Z0-9_-]*"}]},strings:{patterns:[{name:"string.quoted.double.scss",begin:'"',end:'"'},{name:"string.quoted.single.scss",begin:"'",end:"'"}]},selectors:{patterns:[{name:"entity.name.tag.scss",match:"\\b[a-z][a-z0-9-]*\\b"},{name:"entity.other.attribute-name.class.scss",match:"\\.[a-zA-Z_-][a-zA-Z0-9_-]*"},{name:"entity.other.attribute-name.id.scss",match:"#[a-zA-Z_-][a-zA-Z0-9_-]*"}]},properties:{patterns:[{name:"support.type.property-name.scss",match:"\\b[a-z-]+(?=\\s*:)"}]}}},Bn={name:"Solidity",scopeName:"source.solidity",keywords:{pragma:"keyword.other.solidity",import:"keyword.other.solidity",contract:"keyword.other.solidity",interface:"keyword.other.solidity",library:"keyword.other.solidity",function:"keyword.other.solidity",modifier:"keyword.other.solidity",event:"keyword.other.solidity",struct:"keyword.other.solidity",enum:"keyword.other.solidity",if:"keyword.control.solidity",else:"keyword.control.solidity",for:"keyword.control.solidity",while:"keyword.control.solidity",do:"keyword.control.solidity",return:"keyword.control.solidity",break:"keyword.control.solidity",continue:"keyword.control.solidity",public:"storage.modifier.solidity",private:"storage.modifier.solidity",internal:"storage.modifier.solidity",external:"storage.modifier.solidity",pure:"storage.modifier.solidity",view:"storage.modifier.solidity",payable:"storage.modifier.solidity",true:"constant.language.solidity",false:"constant.language.solidity"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#keywords"},{include:"#numbers"}],repository:{comments:{patterns:[{name:"comment.line.double-slash.solidity",match:"\\/\\/.*$"},{name:"comment.block.solidity",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.double.solidity",begin:'"',end:'"',patterns:[{name:"constant.character.escape.solidity",match:"\\\\."}]}]},keywords:{patterns:[{name:"keyword.other.solidity",match:"\\b(pragma|import|contract|interface|library|function|modifier|event|struct|enum)\\b"},{name:"keyword.control.solidity",match:"\\b(if|else|for|while|do|return|break|continue)\\b"},{name:"storage.modifier.solidity",match:"\\b(public|private|internal|external|pure|view|payable)\\b"},{name:"constant.language.solidity",match:"\\b(true|false)\\b"}]},numbers:{patterns:[{name:"constant.numeric.solidity",match:"\\b(?:0[xX][0-9a-fA-F]+|\\d+)\\b"}]}}},Zn={name:"SQL",scopeName:"source.sql",keywords:{SELECT:"keyword.other.dml.sql",INSERT:"keyword.other.dml.sql",UPDATE:"keyword.other.dml.sql",DELETE:"keyword.other.dml.sql",MERGE:"keyword.other.dml.sql",CREATE:"keyword.other.ddl.sql",ALTER:"keyword.other.ddl.sql",DROP:"keyword.other.ddl.sql",TRUNCATE:"keyword.other.ddl.sql",RENAME:"keyword.other.ddl.sql",FROM:"keyword.other.sql",WHERE:"keyword.other.sql",JOIN:"keyword.other.sql",INNER:"keyword.other.sql",LEFT:"keyword.other.sql",RIGHT:"keyword.other.sql",FULL:"keyword.other.sql",OUTER:"keyword.other.sql",CROSS:"keyword.other.sql",ON:"keyword.other.sql",USING:"keyword.other.sql",GROUP:"keyword.other.sql",BY:"keyword.other.sql",HAVING:"keyword.other.sql",ORDER:"keyword.other.sql",ASC:"keyword.other.sql",DESC:"keyword.other.sql",LIMIT:"keyword.other.sql",OFFSET:"keyword.other.sql",FETCH:"keyword.other.sql",DISTINCT:"keyword.other.sql",ALL:"keyword.other.sql",AS:"keyword.other.sql",INTO:"keyword.other.sql",VALUES:"keyword.other.sql",SET:"keyword.other.sql",AND:"keyword.operator.logical.sql",OR:"keyword.operator.logical.sql",NOT:"keyword.operator.logical.sql",IN:"keyword.operator.logical.sql",BETWEEN:"keyword.operator.logical.sql",LIKE:"keyword.operator.logical.sql",IS:"keyword.operator.logical.sql",NULL:"constant.language.sql",TRUE:"constant.language.sql",FALSE:"constant.language.sql",COUNT:"support.function.aggregate.sql",SUM:"support.function.aggregate.sql",AVG:"support.function.aggregate.sql",MIN:"support.function.aggregate.sql",MAX:"support.function.aggregate.sql",INT:"storage.type.sql",INTEGER:"storage.type.sql",BIGINT:"storage.type.sql",SMALLINT:"storage.type.sql",TINYINT:"storage.type.sql",DECIMAL:"storage.type.sql",NUMERIC:"storage.type.sql",FLOAT:"storage.type.sql",REAL:"storage.type.sql",DOUBLE:"storage.type.sql",VARCHAR:"storage.type.sql",CHAR:"storage.type.sql",TEXT:"storage.type.sql",DATE:"storage.type.sql",TIME:"storage.type.sql",TIMESTAMP:"storage.type.sql",DATETIME:"storage.type.sql",BOOLEAN:"storage.type.sql",BOOL:"storage.type.sql",BLOB:"storage.type.sql",PRIMARY:"keyword.other.sql",KEY:"keyword.other.sql",FOREIGN:"keyword.other.sql",REFERENCES:"keyword.other.sql",UNIQUE:"keyword.other.sql",CHECK:"keyword.other.sql",DEFAULT:"keyword.other.sql",AUTO_INCREMENT:"keyword.other.sql",TABLE:"keyword.other.sql",VIEW:"keyword.other.sql",INDEX:"keyword.other.sql",DATABASE:"keyword.other.sql",SCHEMA:"keyword.other.sql",IF:"keyword.control.sql",EXISTS:"keyword.other.sql",CASCADE:"keyword.other.sql",CONSTRAINT:"keyword.other.sql",UNION:"keyword.other.sql",INTERSECT:"keyword.other.sql",EXCEPT:"keyword.other.sql",CASE:"keyword.control.sql",WHEN:"keyword.control.sql",THEN:"keyword.control.sql",ELSE:"keyword.control.sql",END:"keyword.control.sql"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#keywords"},{include:"#numbers"},{include:"#operators"}],repository:{comments:{patterns:[{name:"comment.line.double-dash.sql",match:"--.*$"},{name:"comment.line.number-sign.sql",match:"#.*$"},{name:"comment.block.sql",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.single.sql",begin:"'",end:"'",patterns:[{name:"constant.character.escape.sql",match:"''"}]},{name:"string.quoted.double.sql",begin:'"',end:'"',patterns:[{name:"constant.character.escape.sql",match:'""'}]}]},keywords:{patterns:[{name:"keyword.other.dml.sql",match:"\\b(?i:SELECT|INSERT|UPDATE|DELETE|MERGE)\\b"},{name:"keyword.other.ddl.sql",match:"\\b(?i:CREATE|ALTER|DROP|TRUNCATE|RENAME)\\b"},{name:"keyword.other.sql",match:"\\b(?i:FROM|WHERE|JOIN|INNER|LEFT|RIGHT|FULL|OUTER|CROSS|ON|USING|GROUP|BY|HAVING|ORDER|ASC|DESC|LIMIT|OFFSET|FETCH|DISTINCT|ALL|AS|INTO|VALUES|SET|TABLE|VIEW|INDEX|DATABASE|SCHEMA|EXISTS|CASCADE|CONSTRAINT|UNION|INTERSECT|EXCEPT|PRIMARY|KEY|FOREIGN|REFERENCES|UNIQUE|CHECK|DEFAULT|AUTO_INCREMENT)\\b"},{name:"keyword.operator.logical.sql",match:"\\b(?i:AND|OR|NOT|IN|BETWEEN|LIKE|IS)\\b"},{name:"keyword.control.sql",match:"\\b(?i:IF|CASE|WHEN|THEN|ELSE|END)\\b"},{name:"constant.language.sql",match:"\\b(?i:NULL|TRUE|FALSE)\\b"},{name:"support.function.aggregate.sql",match:"\\b(?i:COUNT|SUM|AVG|MIN|MAX)\\b"},{name:"storage.type.sql",match:"\\b(?i:INT|INTEGER|BIGINT|SMALLINT|TINYINT|DECIMAL|NUMERIC|FLOAT|REAL|DOUBLE|VARCHAR|CHAR|TEXT|DATE|TIME|TIMESTAMP|DATETIME|BOOLEAN|BOOL|BLOB)\\b"}]},numbers:{patterns:[{name:"constant.numeric.sql",match:"\\b\\d+\\.?\\d*(?:[eE][+-]?\\d+)?\\b"}]},operators:{patterns:[{name:"keyword.operator.sql",match:"(=|!=|<>|<|>|<=|>=|\\+|\\-|\\*|/|%|\\|\\|)"}]}}},Mn={name:"STX",scopeName:"text.html.stx",patterns:[{include:"#stx-comments"},{include:"#stx-echo"},{include:"#stx-directives"},{include:"#html"}],repository:{"stx-comments":{patterns:[{name:"comment.block.stx",begin:"\\{\\{--",end:"--\\}\\}"}]},"stx-echo":{patterns:[{name:"meta.embedded.block.stx.unescaped",begin:"(?<!@)\\{\\{\\{",beginCaptures:{0:{name:"punctuation.section.embedded.begin.stx"}},end:"\\}\\}\\}",endCaptures:{0:{name:"punctuation.section.embedded.end.stx"}},contentName:"source.ts.embedded.stx"},{name:"meta.embedded.block.stx.escaped",begin:"(?<![@{])\\{\\{",beginCaptures:{0:{name:"punctuation.section.embedded.begin.stx"}},end:"\\}\\}",endCaptures:{0:{name:"punctuation.section.embedded.end.stx"}},contentName:"source.ts.embedded.stx"},{name:"meta.embedded.block.stx.raw",begin:"(?<!@)\\{!!",beginCaptures:{0:{name:"punctuation.section.embedded.begin.stx"}},end:"!!\\}",endCaptures:{0:{name:"punctuation.section.embedded.end.stx"}},contentName:"source.ts.embedded.stx"}]},"stx-directives":{patterns:[{name:"keyword.control.conditional.stx",match:"@(if|else|elseif|endif|unless|endunless|switch|case|default|endswitch|break)\\b"},{name:"keyword.control.loop.stx",match:"@(for|endfor|foreach|endforeach|while|endwhile|continue|forelse|empty)\\b"},{name:"keyword.control.auth.stx",match:"@(auth|guest|can|cannot|endauth|endguest|endcan|endcannot)\\b"},{name:"keyword.control.component.stx",match:"@(component|endcomponent|slot|endslot|props|inject)\\b"},{name:"keyword.control.layout.stx",match:"@(section|endsection|yield|extends|parent)\\b"},{name:"support.function.include.stx",match:"@(include|includewhen|includeunless|includefirst)\\b"},{name:"keyword.control.stack.stx",match:"@(push|endpush|pushOnce|endpushOnce|pushif|endpushif|stack)\\b"},{name:"keyword.control.once.stx",match:"@(once|endonce)\\b"},{name:"support.function.security.stx",match:"@(csrf|method)\\b"},{name:"keyword.control.environment.stx",match:"@(production|endproduction|development|enddevelopment|env|endenv)\\b"},{name:"support.function.translation.stx",match:"@(translate|endtranslate|t)\\b"},{name:"support.function.webcomponent.stx",match:"@webcomponent\\b"},{name:"support.function.route.stx",match:"@route\\b"},{name:"keyword.control.markdown.stx",begin:"@markdown\\b",beginCaptures:{0:{name:"keyword.control.markdown.stx"}},end:"@endmarkdown\\b",endCaptures:{0:{name:"keyword.control.markdown.stx"}},contentName:"text.html.markdown.embedded.stx"},{name:"support.function.markdown.stx",match:"@markdown-file\\b"},{name:"keyword.control.animation.stx",match:"@(transition|endtransition|motion|endmotion)\\b"},{name:"meta.embedded.block.ts",begin:"@ts\\b",beginCaptures:{0:{name:"keyword.control.stx"}},end:"@endts\\b",endCaptures:{0:{name:"keyword.control.stx"}},contentName:"source.ts"},{name:"meta.embedded.block.js",begin:"@js\\b",beginCaptures:{0:{name:"keyword.control.stx"}},end:"@endjs\\b",endCaptures:{0:{name:"keyword.control.stx"}},contentName:"source.js"},{name:"meta.embedded.block.raw",begin:"@(raw|verbatim)\\b",beginCaptures:{0:{name:"keyword.control.stx"}},end:"@end(raw|verbatim)\\b",endCaptures:{0:{name:"keyword.control.stx"}},contentName:"string.unquoted.raw"},{name:"entity.name.function.stx",match:"@[a-zA-Z_][a-zA-Z0-9_]*"}]},html:{patterns:[{name:"meta.tag.html",begin:"<([a-zA-Z0-9:-]+)",beginCaptures:{0:{name:"punctuation.definition.tag.begin.html"},1:{name:"entity.name.tag.html"}},end:"(/>)|(>)",endCaptures:{1:{name:"punctuation.definition.tag.end.html"},2:{name:"punctuation.definition.tag.end.html"}},patterns:[{name:"entity.other.attribute-name.html",match:"[a-zA-Z-:@]+"},{name:"string.quoted.double.html",begin:'"',end:'"',patterns:[{include:"#stx-echo"}]},{name:"string.quoted.single.html",begin:"'",end:"'",patterns:[{include:"#stx-echo"}]}]},{name:"meta.tag.html",begin:"(</)([a-zA-Z0-9:-]+)",beginCaptures:{1:{name:"punctuation.definition.tag.begin.html"},2:{name:"entity.name.tag.html"}},end:"(>)",endCaptures:{1:{name:"punctuation.definition.tag.end.html"}}},{name:"comment.block.html",begin:"<!--",end:"-->"}]}}},Dn={name:"Swift",scopeName:"source.swift",keywords:{import:"keyword.other.swift",class:"keyword.other.swift",struct:"keyword.other.swift",enum:"keyword.other.swift",protocol:"keyword.other.swift",extension:"keyword.other.swift",func:"keyword.other.swift",var:"keyword.other.swift",let:"keyword.other.swift",if:"keyword.control.swift",else:"keyword.control.swift",guard:"keyword.control.swift",for:"keyword.control.swift",while:"keyword.control.swift",repeat:"keyword.control.swift",switch:"keyword.control.swift",case:"keyword.control.swift",default:"keyword.control.swift",return:"keyword.control.swift",break:"keyword.control.swift",continue:"keyword.control.swift",fallthrough:"keyword.control.swift",defer:"keyword.control.swift",in:"keyword.control.swift",public:"storage.modifier.swift",private:"storage.modifier.swift",fileprivate:"storage.modifier.swift",internal:"storage.modifier.swift",open:"storage.modifier.swift",static:"storage.modifier.swift",final:"storage.modifier.swift",true:"constant.language.swift",false:"constant.language.swift",nil:"constant.language.swift",self:"variable.language.swift",Self:"variable.language.swift"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#keywords"},{include:"#numbers"}],repository:{comments:{patterns:[{name:"comment.line.double-slash.swift",match:"\\/\\/.*$"},{name:"comment.block.swift",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.double.swift",begin:'"',end:'"',patterns:[{name:"constant.character.escape.swift",match:"\\\\."},{name:"meta.embedded.line.swift",begin:"\\\\\\(",end:"\\)"}]}]},keywords:{patterns:[{name:"keyword.control.swift",match:"\\b(if|else|guard|for|while|repeat|switch|case|default|return|break|continue|fallthrough|defer|in)\\b"},{name:"keyword.other.swift",match:"\\b(import|class|struct|enum|protocol|extension|func|var|let)\\b"},{name:"constant.language.swift",match:"\\b(true|false|nil)\\b"}]},numbers:{patterns:[{name:"constant.numeric.swift",match:"\\b\\d+\\.?\\d*\\b"}]}}},Un={name:"Terraform",scopeName:"source.terraform",keywords:{resource:"keyword.other.terraform",data:"keyword.other.terraform",variable:"keyword.other.terraform",output:"keyword.other.terraform",locals:"keyword.other.terraform",module:"keyword.other.terraform",provider:"keyword.other.terraform",terraform:"keyword.other.terraform",for:"keyword.control.terraform",if:"keyword.control.terraform",else:"keyword.control.terraform",in:"keyword.control.terraform",true:"constant.language.terraform",false:"constant.language.terraform",null:"constant.language.terraform"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#keywords"},{include:"#blocks"}],repository:{comments:{patterns:[{name:"comment.line.number-sign.terraform",match:"#.*$"},{name:"comment.line.double-slash.terraform",match:"\\/\\/.*$"},{name:"comment.block.terraform",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.double.terraform",begin:'"',end:'"',patterns:[{name:"constant.character.escape.terraform",match:"\\\\."},{name:"meta.interpolation.terraform",begin:"\\$\\{",end:"\\}"}]}]},keywords:{patterns:[{name:"keyword.other.terraform",match:"\\b(resource|data|variable|output|locals|module|provider|terraform)\\b"},{name:"keyword.control.terraform",match:"\\b(for|if|else|in)\\b"},{name:"constant.language.terraform",match:"\\b(true|false|null)\\b"}]},blocks:{patterns:[{name:"entity.name.type.terraform",match:'^\\s*(resource|data|variable|output|module|provider|terraform)\\s+"[^"]+"'}]}}},Gn={name:"Plain Text",scopeName:"text.plain",keywords:{},patterns:[],repository:{}},Kn={name:"TOML",scopeName:"source.toml",keywords:{true:"constant.language.toml",false:"constant.language.toml"},patterns:[{include:"#comments"},{include:"#tables"},{include:"#keys"},{include:"#strings"},{include:"#numbers"},{include:"#dates"},{include:"#booleans"}],repository:{comments:{patterns:[{name:"comment.line.number-sign.toml",match:"#.*$"}]},tables:{patterns:[{name:"entity.name.section.toml",match:"^\\[\\[?[a-zA-Z0-9._-]+\\]\\]?"}]},keys:{patterns:[{name:"variable.other.key.toml",match:"^[a-zA-Z0-9_-]+(?=\\s*=)"}]},strings:{patterns:[{name:"string.quoted.triple.toml",begin:'"""',end:'"""'},{name:"string.quoted.triple.toml",begin:"'''",end:"'''"},{name:"string.quoted.double.toml",begin:'"',end:'"',patterns:[{name:"constant.character.escape.toml",match:"\\\\."}]},{name:"string.quoted.single.toml",begin:"'",end:"'"}]},numbers:{patterns:[{name:"constant.numeric.toml",match:"\\b[+-]?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?\\b"},{name:"constant.numeric.toml",match:"\\b0[xX][0-9a-fA-F]+\\b"},{name:"constant.numeric.toml",match:"\\b0[oO][0-7]+\\b"},{name:"constant.numeric.toml",match:"\\b0[bB][01]+\\b"}]},dates:{patterns:[{name:"constant.other.date.toml",match:"\\d{4}-\\d{2}-\\d{2}(?:T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}:\\d{2})?)?"}]},booleans:{patterns:[{name:"constant.language.toml",match:"\\b(true|false)\\b"}]}}},Vn={name:"TypeScript",scopeName:"source.ts",keywords:{if:"keyword.control.ts",else:"keyword.control.ts",switch:"keyword.control.ts",case:"keyword.control.ts",default:"keyword.control.ts",for:"keyword.control.ts",while:"keyword.control.ts",do:"keyword.control.ts",break:"keyword.control.ts",continue:"keyword.control.ts",return:"keyword.control.ts",try:"keyword.control.ts",catch:"keyword.control.ts",finally:"keyword.control.ts",throw:"keyword.control.ts",async:"keyword.control.ts",await:"keyword.control.ts",yield:"keyword.control.ts",const:"storage.type.ts",let:"storage.type.ts",var:"storage.type.ts",function:"storage.type.ts",class:"storage.type.ts",extends:"storage.type.ts",implements:"storage.type.ts",static:"storage.type.ts",type:"storage.type.ts",interface:"storage.type.ts",enum:"storage.type.ts",namespace:"storage.type.ts",module:"storage.type.ts",declare:"storage.type.ts",public:"storage.type.ts",private:"storage.type.ts",protected:"storage.type.ts",readonly:"storage.type.ts",abstract:"storage.type.ts",string:"storage.type.ts",number:"storage.type.ts",boolean:"storage.type.ts",any:"storage.type.ts",void:"storage.type.ts",never:"storage.type.ts",unknown:"storage.type.ts",object:"storage.type.ts",symbol:"storage.type.ts",bigint:"storage.type.ts",get:"storage.type.ts",set:"storage.type.ts",new:"keyword.operator.new.ts",delete:"keyword.operator.new.ts",typeof:"keyword.operator.new.ts",instanceof:"keyword.operator.new.ts",as:"keyword.operator.new.ts",in:"keyword.operator.new.ts",of:"keyword.operator.new.ts",is:"keyword.operator.new.ts",keyof:"keyword.operator.new.ts",infer:"keyword.operator.new.ts",true:"constant.language.ts",false:"constant.language.ts",null:"constant.language.ts",undefined:"constant.language.ts",NaN:"constant.language.ts",Infinity:"constant.language.ts",this:"constant.language.ts",super:"constant.language.ts",arguments:"constant.language.ts",import:"keyword.other.ts",export:"keyword.other.ts",from:"keyword.other.ts",require:"keyword.other.ts",with:"keyword.other.ts",debugger:"keyword.other.ts"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#jsx"},{include:"#regex"},{include:"#keywords"},{include:"#numbers"},{include:"#functions"},{include:"#types"},{include:"#operators"},{include:"#punctuation"}],repository:{comments:{patterns:[{name:"comment.line.double-slash.ts",match:"\\/\\/.*$"},{name:"comment.block.ts",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.double.ts",begin:'"',end:'"',patterns:[{name:"constant.character.escape.ts",match:"\\\\."}]},{name:"string.quoted.single.ts",begin:"'",end:"'",patterns:[{name:"constant.character.escape.ts",match:"\\\\."}]},{name:"string.template.ts",begin:"`",end:"`",patterns:[{name:"meta.template.expression.ts",begin:"\\$\\{",end:"\\}",patterns:[{include:"$self"}]},{name:"constant.character.escape.ts",match:"\\\\."}]}]},jsx:{patterns:[{name:"meta.tag.tsx",begin:"<([A-Z][a-zA-Z0-9]*|[a-z][a-zA-Z0-9-]*)",beginCaptures:{0:{name:"punctuation.definition.tag.begin.tsx"},1:{name:"entity.name.tag.tsx"}},end:"(/?>)",endCaptures:{1:{name:"punctuation.definition.tag.end.tsx"}},patterns:[{name:"entity.other.attribute-name.tsx",match:"[a-zA-Z_:][a-zA-Z0-9_:.-]*"},{name:"meta.embedded.expression.tsx",begin:"\\{",end:"\\}",patterns:[{include:"$self"}]},{name:"string.quoted.double.tsx",begin:'"',end:'"'},{name:"string.quoted.single.tsx",begin:"'",end:"'"}]},{name:"meta.tag.tsx",begin:"(</)([A-Z][a-zA-Z0-9]*|[a-z][a-zA-Z0-9-]*)",beginCaptures:{1:{name:"punctuation.definition.tag.begin.tsx"},2:{name:"entity.name.tag.tsx"}},end:"(>)",endCaptures:{1:{name:"punctuation.definition.tag.end.tsx"}}}]},regex:{patterns:[{name:"string.regexp.ts",begin:"(?<=[=(,\\[!&|?{};:])\\s*(\\/)",beginCaptures:{1:{name:"punctuation.definition.string.begin.ts"}},end:"(\\/)[gimsuvy]*",endCaptures:{1:{name:"punctuation.definition.string.end.ts"}},patterns:[{name:"constant.character.escape.ts",match:"\\\\."}]}]},numbers:{patterns:[{name:"constant.numeric.ts",match:"\\b(0[xX][0-9a-fA-F_]+|0[bB][01_]+|0[oO][0-7_]+|\\d+(_\\d+)*(\\.\\d+(_\\d+)?)?([eE][+-]?\\d+)?)[nN]?\\b"}]},types:{patterns:[{name:"storage.type.ts",match:"\\b(string|number|boolean|any|void|never|unknown|object|symbol|bigint)\\b"},{name:"entity.name.type.ts",match:":\\s*([A-Z][a-zA-Z0-9_]*)"},{name:"meta.type.annotation.ts",match:"<[^>]+>"}]},keywords:{patterns:[{name:"keyword.control.ts",match:"\\b(if|else|switch|case|default|for|while|do|break|continue|return|try|catch|finally|throw|async|await|yield)\\b"},{name:"storage.type.ts",match:"\\b(const|let|var|function|class|extends|implements|static|async|type|interface|enum|namespace|module|declare|public|private|protected|readonly|abstract|get|set)\\b"},{name:"keyword.operator.new.ts",match:"\\b(new|delete|typeof|instanceof|void|as|in|of|is|keyof|infer)\\b"},{name:"constant.language.ts",match:"\\b(true|false|null|undefined|NaN|Infinity|this|super|arguments)\\b"},{name:"keyword.other.ts",match:"\\b(import|export|from|default|require|with|debugger)\\b"}]},functions:{patterns:[{name:"entity.name.function.ts",match:"\\b([a-zA-Z_$][a-zA-Z0-9_$]*)\\s*(?=\\()"}]},operators:{patterns:[{name:"keyword.operator.ts",match:"(\\+\\+|--|\\+|\\-|\\*|\\/|%|===|==|!==|!=|<=|>=|<|>|&&|\\|\\||!|\\?|:|=>|\\.\\.\\.|&|\\||\\^|~|<<|>>|>>>)"}]},punctuation:{patterns:[{name:"punctuation.ts",match:"[{}()\\[\\];,.]"}]}}},Yn={name:"Vue",scopeName:"source.vue",keywords:{},patterns:[{include:"#template"},{include:"#script"},{include:"#style"},{include:"#comments"}],repository:{template:{patterns:[{name:"meta.tag.template.vue",begin:"<template>",end:"</template>",patterns:[{name:"entity.other.attribute-name.vue",match:"v-[a-z-]+"},{name:"entity.other.attribute-name.vue",match:"@[a-z]+"},{name:"entity.other.attribute-name.vue",match:":[a-z-]+"},{name:"meta.embedded.expression.vue",begin:"\\{\\{",end:"\\}\\}"}]}]},script:{patterns:[{name:"meta.tag.script.vue",begin:"<script.*?>",end:"</script>"}]},style:{patterns:[{name:"meta.tag.style.vue",begin:"<style.*?>",end:"</style>"}]},comments:{patterns:[{name:"comment.block.html.vue",begin:"<!--",end:"-->"}]}}},Xn={name:"XML",scopeName:"text.xml",keywords:{},patterns:[{include:"#comments"},{include:"#tags"},{include:"#cdata"}],repository:{comments:{patterns:[{name:"comment.block.xml",begin:"<!--",end:"-->"}]},tags:{patterns:[{name:"meta.tag.xml",begin:"</?([a-zA-Z_:][a-zA-Z0-9_:.-]*)",beginCaptures:{1:{name:"entity.name.tag.xml"}},end:"/?>",patterns:[{name:"entity.other.attribute-name.xml",match:"[a-zA-Z_:][a-zA-Z0-9_:.-]*(?==)"},{include:"#strings"}]}]},strings:{patterns:[{name:"string.quoted.double.xml",begin:'"',end:'"'},{name:"string.quoted.single.xml",begin:"'",end:"'"}]},cdata:{patterns:[{name:"string.unquoted.cdata.xml",begin:"<!\\[CDATA\\[",end:"\\]\\]>"}]}}},Jn={name:"YAML",scopeName:"source.yaml",keywords:{true:"constant.language.boolean.yaml",false:"constant.language.boolean.yaml",null:"constant.language.null.yaml",True:"constant.language.boolean.yaml",False:"constant.language.boolean.yaml",TRUE:"constant.language.boolean.yaml",FALSE:"constant.language.boolean.yaml",yes:"constant.language.boolean.yaml",no:"constant.language.boolean.yaml",Yes:"constant.language.boolean.yaml",No:"constant.language.boolean.yaml",YES:"constant.language.boolean.yaml",NO:"constant.language.boolean.yaml",on:"constant.language.boolean.yaml",off:"constant.language.boolean.yaml"},patterns:[{include:"#comments"},{include:"#document-markers"},{include:"#keys"},{include:"#strings"},{include:"#numbers"},{include:"#constants"},{include:"#anchors"},{include:"#tags"}],repository:{comments:{patterns:[{name:"comment.line.number-sign.yaml",match:"#.*$"}]},"document-markers":{patterns:[{name:"entity.other.document.begin.yaml",match:"^---"},{name:"entity.other.document.end.yaml",match:"^\\.\\.\\."}]},keys:{patterns:[{name:"meta.key.yaml",match:"([a-zA-Z0-9_-]+)\\s*:",captures:{1:{name:"entity.name.tag.yaml"}}},{name:"string.quoted.yaml",match:`(["'])([a-zA-Z0-9_-]+)\\1\\s*:`,captures:{2:{name:"entity.name.tag.yaml"}}}]},strings:{patterns:[{name:"string.quoted.double.yaml",begin:'"',end:'"',patterns:[{name:"constant.character.escape.yaml",match:"\\\\."}]},{name:"string.quoted.single.yaml",begin:"'",end:"'",patterns:[{name:"constant.character.escape.yaml",match:"''"}]},{name:"string.unquoted.block.yaml",match:"[|>][-+]?\\s*$"}]},numbers:{patterns:[{name:"constant.numeric.yaml",match:"\\b[-+]?(0x[0-9a-fA-F]+|0o[0-7]+|[0-9]+\\.?[0-9]*([eE][-+]?[0-9]+)?)\\b"}]},constants:{patterns:[{name:"constant.language.yaml",match:"\\b(true|false|null|True|False|TRUE|FALSE|yes|no|Yes|No|YES|NO|on|off)\\b"}]},anchors:{patterns:[{name:"entity.name.type.anchor.yaml",match:"&[a-zA-Z0-9_-]+"},{name:"variable.other.alias.yaml",match:"\\*[a-zA-Z0-9_-]+"}]},tags:{patterns:[{name:"storage.type.tag.yaml",match:"!![a-zA-Z0-9_-]+"},{name:"storage.type.tag.yaml",match:"![a-zA-Z0-9_-]+"}]}}},ie=[{id:"javascript",name:"JavaScript",aliases:["js","jsx"],extensions:[".js",".jsx",".mjs",".cjs"],grammar:kn},{id:"typescript",name:"TypeScript",aliases:["ts","tsx"],extensions:[".ts",".tsx",".mts",".cts"],grammar:Vn},{id:"html",name:"HTML",aliases:["htm"],extensions:[".html",".htm"],grammar:yn},{id:"css",name:"CSS",aliases:[],extensions:[".css"],grammar:mn},{id:"json",name:"JSON",aliases:[],extensions:[".json"],grammar:vn},{id:"stx",name:"STX",aliases:[],extensions:[".stx"],grammar:Mn},{id:"bash",name:"Bash",aliases:["sh","shell","zsh","console"],extensions:[".sh",".bash",".zsh"],grammar:rn},{id:"markdown",name:"Markdown",aliases:["md"],extensions:[".md",".markdown"],grammar:Nn},{id:"yaml",name:"YAML",aliases:["yml"],extensions:[".yaml",".yml"],grammar:Jn},{id:"jsonc",name:"JSONC",aliases:[],extensions:[".jsonc"],grammar:An},{id:"diff",name:"Diff",aliases:["patch"],extensions:[".diff",".patch"],grammar:pn},{id:"python",name:"Python",aliases:["py"],extensions:[".py",".pyw"],grammar:Ln},{id:"php",name:"PHP",aliases:[],extensions:[".php",".phtml"],grammar:qn},{id:"java",name:"Java",aliases:[],extensions:[".java"],grammar:wn},{id:"c",name:"C",aliases:["h"],extensions:[".c",".h"],grammar:an},{id:"cpp",name:"C++",aliases:["cc","cxx","hpp"],extensions:[".cpp",".cc",".cxx",".hpp",".h++"],grammar:cn},{id:"rust",name:"Rust",aliases:["rs"],extensions:[".rs"],grammar:Rn},{id:"csharp",name:"C#",aliases:["cs"],extensions:[".cs"],grammar:ln},{id:"dockerfile",name:"Dockerfile",aliases:["docker"],extensions:[".dockerfile"],grammar:gn},{id:"ruby",name:"Ruby",aliases:["rb"],extensions:[".rb"],grammar:Fn},{id:"go",name:"Go",aliases:[],extensions:[".go"],grammar:hn},{id:"sql",name:"SQL",aliases:[],extensions:[".sql"],grammar:Zn},{id:"idl",name:"IDL",aliases:[],extensions:[".idl"],grammar:bn},{id:"text",name:"Text",aliases:["txt","plain"],extensions:[".txt",".text"],grammar:Gn},{id:"json5",name:"JSON5",aliases:[],extensions:[".json5"],grammar:xn},{id:"vue",name:"Vue",aliases:[],extensions:[".vue"],grammar:Yn},{id:"toml",name:"TOML",aliases:[],extensions:[".toml"],grammar:Kn},{id:"scss",name:"SCSS",aliases:["sass"],extensions:[".scss",".sass"],grammar:Pn},{id:"kotlin",name:"Kotlin",aliases:["kt"],extensions:[".kt",".kts"],grammar:Cn},{id:"swift",name:"Swift",aliases:[],extensions:[".swift"],grammar:Dn},{id:"dart",name:"Dart",aliases:[],extensions:[".dart"],grammar:un},{id:"r",name:"R",aliases:[],extensions:[".r",".R"],grammar:On},{id:"graphql",name:"GraphQL",aliases:["gql"],extensions:[".graphql",".gql"],grammar:fn},{id:"powershell",name:"PowerShell",aliases:["ps1"],extensions:[".ps1",".psm1"],grammar:_n},{id:"makefile",name:"Makefile",aliases:["make"],extensions:[".make"],grammar:En},{id:"terraform",name:"Terraform",aliases:["tf","hcl"],extensions:[".tf",".hcl"],grammar:Un},{id:"bnf",name:"BNF",aliases:[],extensions:[".bnf"],grammar:on},{id:"regexp",name:"RegExp",aliases:["regex"],extensions:[".regexp",".regex"],grammar:In},{id:"lua",name:"Lua",aliases:[],extensions:[".lua"],grammar:$n},{id:"cmd",name:"CMD",aliases:["batch"],extensions:[".cmd",".bat"],grammar:sn},{id:"abnf",name:"ABNF",aliases:[],extensions:[".abnf"],grammar:nn},{id:"csv",name:"CSV",aliases:[],extensions:[".csv"],grammar:dn},{id:"log",name:"Log",aliases:[],extensions:[".log"],grammar:jn},{id:"nginx",name:"Nginx",aliases:["nginxconf"],extensions:[".conf"],grammar:Sn},{id:"xml",name:"XML",aliases:[],extensions:[".xml"],grammar:Xn},{id:"protobuf",name:"Protobuf",aliases:["proto"],extensions:[".proto"],grammar:zn},{id:"solidity",name:"Solidity",aliases:["sol"],extensions:[".sol"],grammar:Bn},{id:"latex",name:"LaTeX",aliases:["tex"],extensions:[".tex",".latex"],grammar:Tn}];p=new Uint8Array(256);for(let e=65;e<=90;e++)p[e]=1;for(let e=97;e<=122;e++)p[e]=1;p[95]=1;p[36]=1;for(let e=48;e<=57;e++)p[e]=2;p[43]=4;p[45]=4;p[42]=4;p[47]=4;p[61]=4;p[33]=4;p[60]=4;p[62]=4;p[38]=4;p[124]=4;p[37]=4;p[63]=4;p[58]=4;p[46]=4;p[123]=8;p[125]=8;p[40]=8;p[41]=8;p[91]=8;p[93]=8;p[59]=8;p[44]=8;p[34]=16;p[39]=16;p[96]=16;p[32]=32;p[9]=32;p[10]=32;p[13]=32;Qn={name:"GitHub Dark",type:"dark",colors:{"editor.background":"#0d1117","editor.foreground":"#c9d1d9","editor.lineHighlightBackground":"#161b22","editor.selectionBackground":"#264f78"},tokenColors:[{name:"Comment",scope:["comment","comment.line","comment.block"],settings:{foreground:"#8b949e",fontStyle:"italic"}},{name:"String",scope:["string","string.quoted"],settings:{foreground:"#a5d6ff"}},{name:"Template String",scope:["string.template"],settings:{foreground:"#a5d6ff"}},{name:"Number",scope:["constant.numeric"],settings:{foreground:"#79c0ff"}},{name:"Keyword",scope:["keyword","keyword.control","keyword.operator"],settings:{foreground:"#ff7b72"}},{name:"Storage Type",scope:["storage.type","storage.modifier"],settings:{foreground:"#ff7b72"}},{name:"Function",scope:["entity.name.function","support.function"],settings:{foreground:"#d2a8ff"}},{name:"Class",scope:["entity.name.type","entity.name.class"],settings:{foreground:"#ffa657"}},{name:"Variable",scope:["variable","variable.other"],settings:{foreground:"#ffa657"}},{name:"Constant",scope:["constant.language","constant.character"],settings:{foreground:"#79c0ff"}},{name:"Tag",scope:["entity.name.tag"],settings:{foreground:"#7ee787"}},{name:"Attribute",scope:["entity.other.attribute-name"],settings:{foreground:"#79c0ff"}},{name:"Punctuation",scope:["punctuation"],settings:{foreground:"#c9d1d9"}},{name:"Operator",scope:["keyword.operator"],settings:{foreground:"#ff7b72"}},{name:"CSS Property",scope:["support.type.property-name.css"],settings:{foreground:"#79c0ff"}},{name:"CSS Value",scope:["support.constant.property-value.css"],settings:{foreground:"#a5d6ff"}},{name:"Color",scope:["constant.other.color"],settings:{foreground:"#a5d6ff"}}]},Hn={name:"GitHub Light",type:"light",colors:{"editor.background":"#ffffff","editor.foreground":"#24292f","editor.lineHighlightBackground":"#f6f8fa","editor.selectionBackground":"#b6d4fe"},tokenColors:[{name:"Comment",scope:["comment","comment.line","comment.block"],settings:{foreground:"#6e7781",fontStyle:"italic"}},{name:"String",scope:["string","string.quoted"],settings:{foreground:"#0a3069"}},{name:"Template String",scope:["string.template"],settings:{foreground:"#0a3069"}},{name:"Number",scope:["constant.numeric"],settings:{foreground:"#0550ae"}},{name:"Keyword",scope:["keyword","keyword.control","keyword.operator"],settings:{foreground:"#cf222e"}},{name:"Storage Type",scope:["storage.type","storage.modifier"],settings:{foreground:"#cf222e"}},{name:"Function",scope:["entity.name.function","support.function"],settings:{foreground:"#8250df"}},{name:"Class",scope:["entity.name.type","entity.name.class"],settings:{foreground:"#953800"}},{name:"Variable",scope:["variable","variable.other"],settings:{foreground:"#953800"}},{name:"Constant",scope:["constant.language","constant.character"],settings:{foreground:"#0550ae"}},{name:"Tag",scope:["entity.name.tag"],settings:{foreground:"#116329"}},{name:"Attribute",scope:["entity.other.attribute-name"],settings:{foreground:"#0550ae"}},{name:"Punctuation",scope:["punctuation"],settings:{foreground:"#24292f"}},{name:"Operator",scope:["keyword.operator"],settings:{foreground:"#cf222e"}},{name:"CSS Property",scope:["support.type.property-name.css"],settings:{foreground:"#0550ae"}},{name:"CSS Value",scope:["support.constant.property-value.css"],settings:{foreground:"#0a3069"}},{name:"Color",scope:["constant.other.color"],settings:{foreground:"#0a3069"}}]},er={name:"Nord",type:"dark",colors:{"editor.background":"#2e3440","editor.foreground":"#d8dee9","editor.lineHighlightBackground":"#3b4252","editor.selectionBackground":"#434c5e"},tokenColors:[{name:"Comment",scope:["comment","comment.line","comment.block"],settings:{foreground:"#616e88",fontStyle:"italic"}},{name:"String",scope:["string","string.quoted"],settings:{foreground:"#a3be8c"}},{name:"Template String",scope:["string.template"],settings:{foreground:"#a3be8c"}},{name:"Number",scope:["constant.numeric"],settings:{foreground:"#b48ead"}},{name:"Keyword",scope:["keyword","keyword.control","keyword.operator"],settings:{foreground:"#81a1c1"}},{name:"Storage Type",scope:["storage.type","storage.modifier"],settings:{foreground:"#81a1c1"}},{name:"Function",scope:["entity.name.function","support.function"],settings:{foreground:"#88c0d0"}},{name:"Class",scope:["entity.name.type","entity.name.class"],settings:{foreground:"#8fbcbb"}},{name:"Variable",scope:["variable","variable.other"],settings:{foreground:"#d8dee9"}},{name:"Constant",scope:["constant.language","constant.character"],settings:{foreground:"#b48ead"}},{name:"Tag",scope:["entity.name.tag"],settings:{foreground:"#81a1c1"}},{name:"Attribute",scope:["entity.other.attribute-name"],settings:{foreground:"#8fbcbb"}},{name:"Punctuation",scope:["punctuation"],settings:{foreground:"#eceff4"}},{name:"Operator",scope:["keyword.operator"],settings:{foreground:"#81a1c1"}},{name:"CSS Property",scope:["support.type.property-name.css"],settings:{foreground:"#8fbcbb"}},{name:"CSS Value",scope:["support.constant.property-value.css"],settings:{foreground:"#a3be8c"}},{name:"Color",scope:["constant.other.color"],settings:{foreground:"#b48ead"}}]},et=[Qn,Hn,er];u=new Uint8Array(256);for(let e=65;e<=90;e++)u[e]=1;for(let e=97;e<=122;e++)u[e]=1;u[95]=1;u[36]=1;for(let e=48;e<=57;e++)u[e]=2;u[43]=4;u[45]=4;u[42]=4;u[47]=4;u[61]=4;u[33]=4;u[60]=4;u[62]=4;u[38]=4;u[124]=4;u[37]=4;u[63]=4;u[58]=4;u[46]=4;u[123]=8;u[125]=8;u[40]=8;u[41]=8;u[91]=8;u[93]=8;u[59]=8;u[44]=8;u[34]=16;u[39]=16;u[96]=16;u[32]=32;u[9]=32;u[10]=32;u[13]=32;po=new rt(!1)});var at={};qe(at,{resetHighlighterCache:()=>or,languageForFile:()=>xe,highlightSnippet:()=>Ae,getSharedHighlighterCss:()=>rr});async function nr(){if(!ce)ce=await nt({theme:"github-light",cache:!0});return ce}function xe(e){let t=e.includes(".")?`.${e.split(".").pop()}`:e,n=Qe(e)??We(t);if(n)return n.id;if(t===".php")return"php";if(t===".sql")return"sql";return"text"}async function Ae(e,t,n,r){let o=await nr(),a=xe(t),i=Math.max(1,n-r+1),s=await o.highlight(e,a,{lineNumbers:!0,highlightLines:[i]});if(s.css&&!V)V=s.css;return{html:s.html,css:V??s.css??""}}function rr(){return V??""}function or(){ce=null,V=null}var ce=null,V=null;var Ce=P(async()=>{await ot()});function it(e,t,n={}){if(!e)return[];let r=e.split(`
871
- `).slice(1),o=[],a=n.includeFrameworkFrames===!0;for(let i of r){let s=i.match(/^\s*at\s+(?:(.+?)\s+\()?(.+?):(\d+):(\d+)\)?$/);if(s){let c=s[2];if(c===void 0)continue;let l=c,m=Te(l);if(t){for(let d of t)if(c.startsWith(d)){c=c.slice(d.length+1);break}}if(!a&&m)continue;o.push({function:s[1]||"<anonymous>",file:c,absoluteFile:l,isFramework:m,line:parseInt(s[3]??"0",10),column:parseInt(s[4]??"0",10)})}}if(!a&&o.length===0)return it(e,t,{includeFrameworkFrames:!0});return o}function ar(e){let t=[],n=[],r=()=>{if(n.length>0)t.push(n.length===1?n[0]:[...n]),n=[]};for(let o of e)if(o.isFramework)n.push(o);else r(),t.push(o);return r(),t}async function st(e,t,n){let r=le(e.absoluteFile,e.line,n),o="";if(r){let a=r.lines.map((c)=>c.content).join(`
872
- `),i=r.lines[0]?.number??e.line;o=(await Ae(a,e.file,e.line,i)).html}return{function:e.function||"<anonymous>",file:e.file,line:e.line,expanded:t===0,hasCode:o.length>0,codeHtml:o,isVendor:e.isFramework}}async function ct(e){let{error:t,status:n,config:r}=e,a=Y[n]?.title??"Error",i=it(t.stack,r.basePaths,{includeFrameworkFrames:r.showFrameworkFrames===!0}),s=i[0],c=typeof process<"u"?process.version.replace(/^v/,""):"",l=typeof process<"u"&&process.versions.bun?"BUN":"NODE",m=t.code,d=[],g=0;for(let L of ar(i))if(Array.isArray(L)){let O=await Promise.all(L.map((bt,wt)=>st(bt,g+wt,r.snippetLines??8)));d.push({type:"vendor",frames:O,vendorCount:O.length}),g+=O.length}else d.push({type:"frame",frames:[await st(L,g,r.snippetLines??8)],vendorCount:0}),g+=1;let h=e.request?Object.entries(e.request.headers).map(([L,O])=>({key:L,value:O})):[],A=[];if(e.routing?.controller)A.push({key:"controller",value:e.routing.controller});if(e.routing?.routeName)A.push({key:"route name",value:e.routing.routeName});if(e.routing?.middleware?.length)A.push({key:"middleware",value:e.routing.middleware.join(", ")});let v=[];if(e.user?.id!==void 0)v.push({key:"id",value:String(e.user.id)});if(e.user?.email)v.push({key:"email",value:e.user.email});if(e.user?.name)v.push({key:"name",value:e.user.name});let y=r.showEnvironment&&typeof process<"u"?[{key:"runtime",value:process.version},{key:"platform",value:process.platform},{key:"arch",value:process.arch}]:[],b=(e.queries??[]).slice(0,100).map((L)=>({connection:L.connection??"default",sql:L.query,sqlHtml:T(L.query),time:L.time!==void 0?L.time.toFixed(2):"0.00"})),C=e.request?.body?JSON.stringify(e.request.body,null,2):"// No request body",q=e.request?.queryParams&&Object.keys(e.request.queryParams).length>0?JSON.stringify(e.request.queryParams,null,2):"",_=W({statusTitle:a,errorName:t.name||"Error",errorMessage:t.message,status:n,file:s?.file,line:s?.line,request:e.request,framework:e.framework,frames:i}),{getSharedHighlighterCss:$}=await Ce().then(() => at);return{pageTitle:a,statusTitle:a,markdownJson:JSON.stringify(_),exceptionClass:t.name||"Error",message:t.message,fileLine:s?`${s.file}:${s.line}`:"",statusCode:n,errorCode:m!==void 0?String(m):"0",frameworkLabel:e.framework?.name?.toUpperCase()??"STACKS",frameworkVersion:e.framework?.version??"",runtimeLabel:l,runtimeVersion:c,requestMethod:e.request?.method??"GET",requestUrl:e.request?.url??"",hasRequest:!!e.request,hintsHtml:je(n),traceGroups:d,queries:b,queryCount:b.length,headers:h,bodyContent:C,routing:A,routeParamsJson:q,userRows:v,environmentRows:y,hasUser:v.length>0,hasEnvironment:y.length>0,hasQueries:b.length>0&&r.showQueries!==!1,hasHeaders:h.length>0&&r.showRequest!==!1,hasBody:r.showRequest!==!1,hasRouting:A.length>0,hasRouteParams:q.length>0,highlightCss:$(),enableCopyMarkdown:r.enableCopyMarkdown!==!1}}var lt=P(async()=>{$e();me();await Ce()});var dt={};qe(dt,{renderDevErrorPage:()=>lr});import{dirname as sr,join as Ne}from"path";import{fileURLToPath as ir}from"url";async function cr(){if(!Ee)Ee=(await import("@stacksjs/stx")).renderTemplate;return Ee}async function lr(e){let t=await ct(e);return(await cr())(Ne(mt,"show.stx"),{context:t,layout:Ne(mt,"layout.stx"),injectCSS:!0,templateOnly:!0,processClientScripts:!1,title:t.pageTitle})}var mt,Ee=null;var ut=P(async()=>{await lt();mt=Ne(sr(ir(import.meta.url)),"views/errors")});function Te(e){if(!e)return!1;return mr.some((t)=>e.includes(t))}function pt(e,t,n={}){if(!e)return[];let r=e.split(`
873
- `).slice(1),o=[],a=n.includeFrameworkFrames===!0;for(let i of r){let s=i.match(/^\s*at\s+(?:(.+?)\s+\()?(.+?):(\d+):(\d+)\)?$/);if(s){let c=s[2];if(c===void 0)continue;let l=c,m=Te(l);if(t){for(let d of t)if(c.startsWith(d)){c=c.slice(d.length+1);break}}if(!a&&m)continue;o.push({function:s[1]||"<anonymous>",file:c,absoluteFile:l,isFramework:m,line:parseInt(s[3]??"0",10),column:parseInt(s[4]??"0",10)})}}if(!a&&o.length===0)return pt(e,t,{includeFrameworkFrames:!0});return o}function dr(e,t,n){let r;try{let i=B("@stacksjs/path");r=i.resourcesPath??i.path?.resourcesPath}catch{}if(!r)return null;let o=B("fs"),a=[r(`views/errors/${e}.html`),r("views/errors/error.html")];for(let i of a)try{if(!o.existsSync(i))continue;return o.readFileSync(i,"utf-8").replace(/\{\{\s*status\s*\}\}/g,T(String(e))).replace(/\{\{\s*title\s*\}\}/g,T(t)).replace(/\{\{\s*message\s*\}\}/g,T(n))}catch{}return null}function gt(e){let t=Y[e]||{status:e,title:"Error",message:"An unexpected error occurred."},n=dr(t.status,t.title,t.message);if(n!==null)return n;return`<!DOCTYPE html>
874
- <html lang="en">
875
- <head>
876
- <meta charset="UTF-8">
877
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
878
- <title>${t.status} - ${t.title}</title>
879
- <style>${J}</style>
880
- </head>
881
- <body>
882
- <div class="production-page">
883
- <div class="production-status">${t.status}</div>
884
- <h1 class="production-title">${T(t.title)}</h1>
885
- <p class="production-message">${T(t.message)}</p>
886
- <a href="/" class="production-link">\u2190 Back to Home</a>
887
- </div>
888
- </body>
889
- </html>`}function je(e){let t=Y[e];if(!t)return"";let n=Array.isArray(t.commonCauses)&&t.commonCauses.length>0,r=typeof t.suggestion==="string"&&t.suggestion.length>0,o=typeof t.docLink==="string"&&t.docLink.length>0;if(!n&&!r&&!o)return"";let a=n?`<ul class="error-hint-causes">${t.commonCauses.map((c)=>`<li>${T(c)}</li>`).join("")}</ul>`:"",i=r?`<p class="error-hint-suggestion">${T(t.suggestion)}</p>`:"",s=o?`<a class="text-blue-600 text-sm dark:text-blue-500 hover:underline" href="${T(t.docLink)}" target="_blank" rel="noreferrer noopener">Read the docs \u2192</a>`:"";return`<section class="p-4 bg-amber-200/30 dark:bg-amber-950/40 border border-amber-200 rounded-xl dark:border-amber-800 shadow-xs">
890
- <div class="mb-2 font-semibold text-amber-900 text-sm dark:text-amber-300">Likely causes &amp; next steps</div>
891
- <div class="text-neutral-700 text-sm dark:text-neutral-300">${a}${i}${s}</div>
892
- </section>`}class ht{config;framework;request;routing;user;queries=[];constructor(e){this.config={appName:"App",theme:"auto",showEnvironment:!0,showQueries:!0,showRequest:!0,enableCopyMarkdown:!0,snippetLines:8,...e}}setFramework(e,t){return this.framework={name:e,version:t},this}setRequest(e){if(e instanceof Request){let t=new URL(e.url);this.request={method:e.method,url:e.url,headers:Object.fromEntries(e.headers.entries()),queryParams:Object.fromEntries(t.searchParams.entries())}}else this.request=e;return this}setRouting(e){return this.routing=e,this}setUser(e){return this.user=e,this}addQuery(e,t,n){return this.queries.push({query:e,time:t,connection:n}),this}async render(e,t=500){try{let{renderDevErrorPage:n}=await ut().then(() => dt);return await n({error:e,status:t,config:this.config,framework:this.framework,request:this.request,routing:this.routing,user:this.user,queries:this.queries})}catch(n){return console.error("[ErrorPageHandler] STX render failed, using fallback:",n),this.renderFallback(e,t)}}renderFallback(e,t){let n=pt(e.stack,this.config.basePaths,{includeFrameworkFrames:this.config.showFrameworkFrames===!0}),o=Y[t]?.title??"Error",a=n[0],i=`
893
- <header class="header"><div class="header-title"><span class="header-dot"></span><span>${T(o)}</span></div></header>
894
- <section class="summary">
895
- <h1>${T(e.name||"Error")}</h1>
896
- ${a?`<div class="summary-file">${T(a.file)}:${a.line}</div>`:""}
897
- <p class="summary-message">${T(e.message)}</p>
898
- </section>
899
- ${je(t)}
900
- ${Ie(n,this.config.snippetLines??8)}
901
- `,s=W({statusTitle:o,errorName:e.name||"Error",errorMessage:e.message,status:t,file:a?.file,line:a?.line,request:this.request,framework:this.framework,frames:n});return Fe(i,s)}async handleError(e,t=500){let n=await this.render(e,t);return new Response(n,{status:t,headers:{"Content-Type":"text/html; charset=utf-8"}})}}function Se(e){return new ht(e)}var Y,mr;var $e=P(()=>{me();Y={400:{status:400,title:"Bad Request",message:"The request was malformed or invalid.",docLink:"https://stacksjs.org/docs/errors/400",commonCauses:["JSON body is missing or has a syntax error","A required field is absent from the payload","Content-Type header does not match the body format"],suggestion:"Inspect the request body and Content-Type \u2014 most 400s come from malformed JSON or a missing required field."},401:{status:401,title:"Unauthorized",message:"Authentication is required to access this resource.",docLink:"https://stacksjs.org/docs/errors/401",commonCauses:["No Authorization header was sent","The bearer token expired","The session cookie was cleared"],suggestion:"Confirm a valid `Authorization: Bearer <token>` header is sent and the token has not expired."},403:{status:403,title:"Forbidden",message:"You do not have permission to access this resource.",docLink:"https://stacksjs.org/docs/errors/403",commonCauses:["The authenticated user lacks the required ability or role","A Gate or policy denied access (see app/Gates.ts)","The token was issued without the needed ability"],suggestion:"Check Gates / policies and the abilities encoded in the access token."},404:{status:404,title:"Not Found",message:"The requested resource could not be found.",docLink:"https://stacksjs.org/docs/errors/404",commonCauses:["The route is not registered in app/Routes.ts","A typo in the URL path","A model lookup returned no row (ModelNotFoundError)"],suggestion:"Run `buddy route:list` to see registered routes, or verify the model exists with the given id."},405:{status:405,title:"Method Not Allowed",message:"The request method is not supported for this resource.",docLink:"https://stacksjs.org/docs/errors/405",commonCauses:["The route is registered for a different HTTP method","A form posted GET when the route expects POST"],suggestion:"Confirm the HTTP method in `app/Routes.ts` matches what the client sent."},408:{status:408,title:"Request Timeout",message:"The request took too long to complete.",docLink:"https://stacksjs.org/docs/errors/408",commonCauses:["A long-running query or external API call exceeded the timeout","The client uploaded a slow body that stalled"],suggestion:"Move slow work into a queued job, or raise the route timeout if the work is genuinely long."},409:{status:409,title:"Conflict",message:"The request conflicts with the current state of the resource.",docLink:"https://stacksjs.org/docs/errors/409",commonCauses:["A unique-constraint violation (duplicate email, slug, etc.)","Optimistic locking detected a stale write"],suggestion:"Re-fetch the resource and retry, or surface the conflict to the user."},410:{status:410,title:"Gone",message:"The requested resource is no longer available.",docLink:"https://stacksjs.org/docs/errors/410",commonCauses:["The resource was permanently deleted","A signed URL expired"],suggestion:"Issue a fresh signed URL or fall back to the canonical resource."},422:{status:422,title:"Unprocessable Entity",message:"The request was well-formed but could not be processed.",docLink:"https://stacksjs.org/docs/errors/422",commonCauses:["Validation rules from the action / model rejected the payload","A field value is outside the allowed range or shape"],suggestion:"Inspect `errors` in the response body \u2014 each key maps to a failing field."},429:{status:429,title:"Too Many Requests",message:"You have exceeded the rate limit.",docLink:"https://stacksjs.org/docs/errors/429",commonCauses:["Rate-limit middleware tripped on this IP / token","A retry loop is hammering the endpoint"],suggestion:"Honor the `Retry-After` response header and back off before retrying."},500:{status:500,title:"Internal Server Error",message:"An unexpected error occurred on the server.",docLink:"https://stacksjs.org/docs/errors/500",commonCauses:["An unhandled exception in an action or middleware","A failing database connection or migration","A misconfigured environment variable"],suggestion:"Check server logs for the original stack trace \u2014 the error page above shows the throw site in dev."},502:{status:502,title:"Bad Gateway",message:"The server received an invalid response from an upstream server.",docLink:"https://stacksjs.org/docs/errors/502",commonCauses:["An upstream HTTP API returned a malformed response","A reverse proxy could not reach the origin"],suggestion:"Verify the upstream service is healthy and returning the expected content type."},503:{status:503,title:"Service Unavailable",message:"The service is temporarily unavailable.",docLink:"https://stacksjs.org/docs/errors/503",commonCauses:["Maintenance mode is enabled","A health check is failing","A dependency (db, redis, queue) is down"],suggestion:"Run `buddy doctor` and check dependent services."},504:{status:504,title:"Gateway Timeout",message:"The upstream server did not respond in time.",docLink:"https://stacksjs.org/docs/errors/504",commonCauses:["An upstream HTTP call exceeded its deadline","A long-running database query timed out"],suggestion:"Move the work to a queued job or raise the upstream timeout if the latency is expected."}},mr=["/storage/framework/core/","/node_modules/@stacksjs/","node:internal/","bun:wrap"]});import X from"fs";import{dirname as Ct}from"path";import*as ze from"process";import*as U from"@stacksjs/path";import{ExitCode as jt}from"@stacksjs/types";function _e(e){return`\x1B[3m${e}\x1B[23m`}function Tt(e){return e.replace(/\x1B\[[0-9;]*m/g,"")}class G{static isTestEnvironment=!1;static shouldExitProcess=!1;static handle(e,t){if(!this.isTestEnvironment)this.shouldExitProcess=t?.shouldExit===!0;if(t?.silent!==!0)this.writeErrorToConsole(e);let n;if(t?.message)n=t.message;else if(e instanceof Error)n=e.message;else if(typeof e==="string")n=e;else n=JSON.stringify(e);let r=Error(n);if(e instanceof Error)Object.assign(r,e);return this.writeErrorToFile(r).catch((o)=>console.error(o)),r}static handleError(e,t){return this.handle(e,t),e}static async writeErrorToFile(e,t){if(!(e instanceof Error)){console.error("Error is not an instance of Error:",e);return}let n=t?` | url=${t.url||"N/A"} method=${t.method||"N/A"} user=${t.userId||"anonymous"}`:"",r=e.stack?`
902
- ${e.stack.split(`
903
- `).slice(1,4).join(`
904
- `)}`:"",o=`[${new Date().toISOString()}] ${e.name}: ${e.message}${n}${r}
905
- `,a=U.logsPath("stacks.log")??U.logsPath("errors.log");try{await X.promises.mkdir(U.dirname(a),{recursive:!0}),await X.promises.appendFile(a,o)}catch(i){console.error("Failed to write to error file:",i)}}static writeErrorToConsole(e){let t;if(e instanceof Error)t=e.message;else if(typeof e==="string")t=e;else t=JSON.stringify(e);if(console.error(t),t.includes("bunx --bun cdk destroy")||t===`Failed to execute command: ${_e("bunx --bun eslint . --fix")}`||t===`Failed to execute command: ${_e("bun storage/framework/core/actions/src/lint/fix.ts")}`){if(!this.isTestEnvironment)console.log("No need to worry. The edge function is currently being destroyed. Please run `buddy undeploy` shortly again, and continue doing so until it succeeds running."),console.log("Hoping to see you back soon!")}if(this.shouldExitProcess)ze.exit(jt.FatalError)}}var Le="storage/logs/stacks.log";function br(e){Le=e}async function $t(e,t){let r=`[${new Date().toISOString()}] ${e}
906
- `,o=t?.logFile??Le,a=Ct(o);await X.promises.mkdir(a,{recursive:!0}),await X.promises.appendFile(o,r)}function wr(e,t){let n,r;if(t&&typeof t==="object"&&!("shouldExit"in t)&&!("silent"in t)&&!("message"in t))r=t,t=void 0;let o=e instanceof Error?e.message:typeof e==="string"?e:JSON.stringify(e);if(t&&"message"in t)n=`${o}: ${t.message}`;else n=o;let a=`ERROR: ${Tt(n)}`;if(r)a+=`
907
- Context: ${JSON.stringify(r,null,2)}`;$t(a).catch((s)=>{console.error("Failed to write error log:",s)});let i=Error(n);if(e instanceof Error)Object.assign(i,e);return G.handle(i,{...t,message:n})}$e();class F extends Error{status;details;constructor(e,t,n){super(t);this.status=e;if(this.name=ur(e),n!==void 0)this.details=n}}function ur(e){switch(e){case 400:return"Bad Request";case 401:return"Unauthorized";case 402:return"Payment Required";case 403:return"Forbidden";case 404:return"Not Found";case 405:return"Method Not Allowed";case 408:return"Request Timeout";case 409:return"Conflict";case 410:return"Gone";case 413:return"Payload Too Large";case 415:return"Unsupported Media Type";case 422:return"Unprocessable Entity";case 423:return"Locked";case 425:return"Too Early";case 426:return"Upgrade Required";case 428:return"Precondition Required";case 429:return"Too Many Requests";case 431:return"Request Header Fields Too Large";case 451:return"Unavailable For Legal Reasons";case 500:return"Internal Server Error";case 501:return"Not Implemented";case 502:return"Bad Gateway";case 503:return"Service Unavailable";case 504:return"Gateway Timeout";case 507:return"Insufficient Storage";case 508:return"Loop Detected";case 511:return"Network Authentication Required";default:return e>=400&&e<500?"Client Error":"Server Error"}}class ft{handler=Se();isDevelopment;constructor(e){if(this.isDevelopment=e?.isDevelopment??!0,e?.config)this.handler=Se(e.config);this.handler.setFramework("Stacks")}setRequest(e){return this.handler.setRequest(e),this}setRouting(e){return this.handler.setRouting(e),this}addQuery(e,t,n){return this.handler.addQuery(e,t,n),this}async handle(e,t=500){if(this.isDevelopment)return this.handler.handleError(e,t);return new Response(gt(t),{status:t,headers:{"Content-Type":"text/html; charset=utf-8"}})}notFound(e){let t=new F(404,e||"The requested resource could not be found.");return this.handle(t,404)}serverError(e){return this.handle(e,500)}forbidden(e){let t=new F(403,e||"You do not have permission to access this resource.");return this.handle(t,403)}unauthorized(e){let t=new F(401,e||"Authentication is required to access this resource.");return this.handle(t,401)}badRequest(e){let t=new F(400,e||"The request was malformed or invalid.");return this.handle(t,400)}validationError(e){let t=new F(422,e||"The request was well-formed but could not be processed.");return this.handle(t,422)}tooManyRequests(e){let t=new F(429,e||"You have exceeded the rate limit.");return this.handle(t,429)}serviceUnavailable(e){let t=new F(503,e||"The service is temporarily unavailable.");return this.handle(t,503)}}function yt(e){return new ft(e)}async function Eo(e,t,n){let r=yt({isDevelopment:n?.isDevelopment,config:n?.config});if(t)r.setRequest(t);return r.handle(e,n?.status)}function No(e){let t=yt(e);return async(n,r)=>{t.setRequest(r);let o=500;if(n instanceof F)o=n.status;else if("status"in n&&typeof n.status==="number")o=n.status;else if("statusCode"in n&&typeof n.statusCode==="number")o=n.statusCode;return t.handle(n,o)}}class pr extends Error{status;constructor(e,t){super(t);this.status=e;this.name="ModelNotFoundException"}}function zo(e,t,n){try{let r=e();if(r instanceof Promise)return r.catch((o)=>{if(n)n(G.handle(o));return t});return r}catch(r){if(n)n(G.handle(r));return t}}export{$t as writeToLogFile,br as setLogPath,zo as rescue,Ho as renderProductionErrorPage,Qo as renderHttpErrorHints,Eo as renderHttpError,Wo as renderErrorPage,Jo as renderError,Do as ok,wr as handleError,Mo as fromPromise,Yo as errorResponse,No as errorMiddleware,Zo as err,yt as createHttpErrorHandler,Go as createErrorHandler,pr as ModelNotFoundException,ft as HttpErrorHandler,F as HttpError,Xo as HTTP_ERRORS,Vo as ErrorPageHandler,G as ErrorHandler,Ko as ERROR_PAGE_CSS};
1
+ export * from "./handler";
2
+ export * from "./http";
3
+ export * from "./model";
4
+ export * from "./utils";
5
+ export {
6
+ err,
7
+ fromPromise,
8
+ ok
9
+ } from "ts-error-handling";
10
+ export {
11
+ createErrorHandler,
12
+ ERROR_PAGE_CSS,
13
+ ErrorPageHandler,
14
+ errorResponse,
15
+ HTTP_ERRORS,
16
+ renderError,
17
+ renderErrorPage,
18
+ renderHttpErrorHints,
19
+ renderProductionErrorPage
20
+ } from "./error-page";