vite-plugin-norg 1.1.4 → 1.1.5
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/README.md +8 -1
- package/dist/luau-DtBSxLyz.js +6 -0
- package/dist/move-DSb5dTSj.js +6 -0
- package/dist/nushell-CQi4NV-2.js +6 -0
- package/dist/plugin/index.js +783 -771
- package/dist/swift-9UzSvamq.js +6 -0
- package/dist/vite_plugin_norg_parser-RX0Xxbfo.js +171 -0
- package/package.json +1 -1
- package/dist/luau-BeoZWRh5.js +0 -6
- package/dist/move-653S600C.js +0 -6
- package/dist/nushell-Be2rueDv.js +0 -6
- package/dist/swift-8xUxuAbm.js +0 -6
- package/dist/vite_plugin_norg_parser-CTgOgVxt.js +0 -170
package/dist/plugin/index.js
CHANGED
|
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
import { createFilter as Ar } from "vite";
|
|
5
|
-
let
|
|
5
|
+
let ql;
|
|
6
6
|
let __tla = (async () => {
|
|
7
7
|
var _a2, _b;
|
|
8
8
|
function v(t, e, n) {
|
|
@@ -41,7 +41,7 @@ let __tla = (async () => {
|
|
|
41
41
|
value: t
|
|
42
42
|
}), s;
|
|
43
43
|
}
|
|
44
|
-
class
|
|
44
|
+
class oe extends Error {
|
|
45
45
|
constructor() {
|
|
46
46
|
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
47
47
|
}
|
|
@@ -52,7 +52,7 @@ let __tla = (async () => {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
const Nn = {};
|
|
55
|
-
function
|
|
55
|
+
function J(t) {
|
|
56
56
|
return Nn;
|
|
57
57
|
}
|
|
58
58
|
function Nr(t) {
|
|
@@ -96,10 +96,7 @@ let __tla = (async () => {
|
|
|
96
96
|
configurable: true
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
return Object.create(Object.getPrototypeOf(t), Object.getOwnPropertyDescriptors(t));
|
|
101
|
-
}
|
|
102
|
-
function Z(t, e, n) {
|
|
99
|
+
function Y(t, e, n) {
|
|
103
100
|
Object.defineProperty(t, e, {
|
|
104
101
|
value: n,
|
|
105
102
|
writable: true,
|
|
@@ -107,7 +104,7 @@ let __tla = (async () => {
|
|
|
107
104
|
configurable: true
|
|
108
105
|
});
|
|
109
106
|
}
|
|
110
|
-
function
|
|
107
|
+
function Q(...t) {
|
|
111
108
|
const e = {};
|
|
112
109
|
for (const n of t) {
|
|
113
110
|
const r = Object.getOwnPropertyDescriptors(n);
|
|
@@ -123,7 +120,7 @@ let __tla = (async () => {
|
|
|
123
120
|
function Le(t) {
|
|
124
121
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
125
122
|
}
|
|
126
|
-
const
|
|
123
|
+
const Er = kt(() => {
|
|
127
124
|
var _a3;
|
|
128
125
|
if (typeof navigator < "u" && ((_a3 = navigator == null ? void 0 : navigator.userAgent) == null ? void 0 : _a3.includes("Cloudflare"))) return false;
|
|
129
126
|
try {
|
|
@@ -143,17 +140,19 @@ let __tla = (async () => {
|
|
|
143
140
|
function xn(t) {
|
|
144
141
|
return me(t) ? {
|
|
145
142
|
...t
|
|
146
|
-
} : t
|
|
143
|
+
} : Array.isArray(t) ? [
|
|
144
|
+
...t
|
|
145
|
+
] : t;
|
|
147
146
|
}
|
|
148
|
-
const
|
|
147
|
+
const xr = /* @__PURE__ */ new Set([
|
|
149
148
|
"string",
|
|
150
149
|
"number",
|
|
151
150
|
"symbol"
|
|
152
151
|
]);
|
|
153
|
-
function
|
|
152
|
+
function Lr(t) {
|
|
154
153
|
return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
155
154
|
}
|
|
156
|
-
function
|
|
155
|
+
function Z(t, e, n) {
|
|
157
156
|
const r = new t._zod.constr(e ?? t._zod.def);
|
|
158
157
|
return (!e || (n == null ? void 0 : n.parent)) && (r._zod.parent = t), r;
|
|
159
158
|
}
|
|
@@ -172,25 +171,25 @@ let __tla = (async () => {
|
|
|
172
171
|
error: () => e.error
|
|
173
172
|
} : e;
|
|
174
173
|
}
|
|
175
|
-
function
|
|
174
|
+
function Or(t) {
|
|
176
175
|
return Object.keys(t).filter((e) => t[e]._zod.optin === "optional" && t[e]._zod.optout === "optional");
|
|
177
176
|
}
|
|
178
|
-
function
|
|
179
|
-
const n = t._zod.def, r =
|
|
177
|
+
function Ir(t, e) {
|
|
178
|
+
const n = t._zod.def, r = Q(t._zod.def, {
|
|
180
179
|
get shape() {
|
|
181
180
|
const o = {};
|
|
182
181
|
for (const i in e) {
|
|
183
182
|
if (!(i in n.shape)) throw new Error(`Unrecognized key: "${i}"`);
|
|
184
183
|
e[i] && (o[i] = n.shape[i]);
|
|
185
184
|
}
|
|
186
|
-
return
|
|
185
|
+
return Y(this, "shape", o), o;
|
|
187
186
|
},
|
|
188
187
|
checks: []
|
|
189
188
|
});
|
|
190
|
-
return
|
|
189
|
+
return Z(t, r);
|
|
191
190
|
}
|
|
192
|
-
function
|
|
193
|
-
const n = t._zod.def, r =
|
|
191
|
+
function zr(t, e) {
|
|
192
|
+
const n = t._zod.def, r = Q(t._zod.def, {
|
|
194
193
|
get shape() {
|
|
195
194
|
const o = {
|
|
196
195
|
...t._zod.def.shape
|
|
@@ -199,29 +198,29 @@ let __tla = (async () => {
|
|
|
199
198
|
if (!(i in n.shape)) throw new Error(`Unrecognized key: "${i}"`);
|
|
200
199
|
e[i] && delete o[i];
|
|
201
200
|
}
|
|
202
|
-
return
|
|
201
|
+
return Y(this, "shape", o), o;
|
|
203
202
|
},
|
|
204
203
|
checks: []
|
|
205
204
|
});
|
|
206
|
-
return
|
|
205
|
+
return Z(t, r);
|
|
207
206
|
}
|
|
208
|
-
function
|
|
207
|
+
function Mr(t, e) {
|
|
209
208
|
if (!me(e)) throw new Error("Invalid input to extend: expected a plain object");
|
|
210
209
|
const n = t._zod.def.checks;
|
|
211
210
|
if (n && n.length > 0) throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
|
|
212
|
-
const o =
|
|
211
|
+
const o = Q(t._zod.def, {
|
|
213
212
|
get shape() {
|
|
214
213
|
const i = {
|
|
215
214
|
...t._zod.def.shape,
|
|
216
215
|
...e
|
|
217
216
|
};
|
|
218
|
-
return
|
|
217
|
+
return Y(this, "shape", i), i;
|
|
219
218
|
},
|
|
220
219
|
checks: []
|
|
221
220
|
});
|
|
222
|
-
return
|
|
221
|
+
return Z(t, o);
|
|
223
222
|
}
|
|
224
|
-
function
|
|
223
|
+
function $r(t, e) {
|
|
225
224
|
if (!me(e)) throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
226
225
|
const n = {
|
|
227
226
|
...t._zod.def,
|
|
@@ -230,30 +229,30 @@ let __tla = (async () => {
|
|
|
230
229
|
...t._zod.def.shape,
|
|
231
230
|
...e
|
|
232
231
|
};
|
|
233
|
-
return
|
|
232
|
+
return Y(this, "shape", r), r;
|
|
234
233
|
},
|
|
235
234
|
checks: t._zod.def.checks
|
|
236
235
|
};
|
|
237
|
-
return
|
|
236
|
+
return Z(t, n);
|
|
238
237
|
}
|
|
239
|
-
function
|
|
240
|
-
const n =
|
|
238
|
+
function jr(t, e) {
|
|
239
|
+
const n = Q(t._zod.def, {
|
|
241
240
|
get shape() {
|
|
242
241
|
const r = {
|
|
243
242
|
...t._zod.def.shape,
|
|
244
243
|
...e._zod.def.shape
|
|
245
244
|
};
|
|
246
|
-
return
|
|
245
|
+
return Y(this, "shape", r), r;
|
|
247
246
|
},
|
|
248
247
|
get catchall() {
|
|
249
248
|
return e._zod.def.catchall;
|
|
250
249
|
},
|
|
251
250
|
checks: []
|
|
252
251
|
});
|
|
253
|
-
return
|
|
252
|
+
return Z(t, n);
|
|
254
253
|
}
|
|
255
|
-
function
|
|
256
|
-
const r =
|
|
254
|
+
function Dr(t, e, n) {
|
|
255
|
+
const r = Q(e._zod.def, {
|
|
257
256
|
get shape() {
|
|
258
257
|
const o = e._zod.def.shape, i = {
|
|
259
258
|
...o
|
|
@@ -269,14 +268,14 @@ let __tla = (async () => {
|
|
|
269
268
|
type: "optional",
|
|
270
269
|
innerType: o[s]
|
|
271
270
|
}) : o[s];
|
|
272
|
-
return
|
|
271
|
+
return Y(this, "shape", i), i;
|
|
273
272
|
},
|
|
274
273
|
checks: []
|
|
275
274
|
});
|
|
276
|
-
return
|
|
275
|
+
return Z(e, r);
|
|
277
276
|
}
|
|
278
|
-
function
|
|
279
|
-
const r =
|
|
277
|
+
function Br(t, e, n) {
|
|
278
|
+
const r = Q(e._zod.def, {
|
|
280
279
|
get shape() {
|
|
281
280
|
const o = e._zod.def.shape, i = {
|
|
282
281
|
...o
|
|
@@ -292,13 +291,13 @@ let __tla = (async () => {
|
|
|
292
291
|
type: "nonoptional",
|
|
293
292
|
innerType: o[s]
|
|
294
293
|
});
|
|
295
|
-
return
|
|
294
|
+
return Y(this, "shape", i), i;
|
|
296
295
|
},
|
|
297
296
|
checks: []
|
|
298
297
|
});
|
|
299
|
-
return
|
|
298
|
+
return Z(e, r);
|
|
300
299
|
}
|
|
301
|
-
function
|
|
300
|
+
function ne(t, e = 0) {
|
|
302
301
|
var _a3;
|
|
303
302
|
if (t.aborted === true) return true;
|
|
304
303
|
for (let n = e; n < t.issues.length; n++) if (((_a3 = t.issues[n]) == null ? void 0 : _a3.continue) !== true) return true;
|
|
@@ -313,7 +312,7 @@ let __tla = (async () => {
|
|
|
313
312
|
function Se(t) {
|
|
314
313
|
return typeof t == "string" ? t : t == null ? void 0 : t.message;
|
|
315
314
|
}
|
|
316
|
-
function
|
|
315
|
+
function X(t, e, n) {
|
|
317
316
|
var _a3, _b2, _c, _d, _e2, _f;
|
|
318
317
|
const r = {
|
|
319
318
|
...t,
|
|
@@ -353,7 +352,7 @@ let __tla = (async () => {
|
|
|
353
352
|
}, In = v("$ZodError", On), zn = v("$ZodError", On, {
|
|
354
353
|
Parent: Error
|
|
355
354
|
});
|
|
356
|
-
function
|
|
355
|
+
function Gr(t, e = (n) => n.message) {
|
|
357
356
|
const n = {}, r = [];
|
|
358
357
|
for (const o of t.issues) o.path.length > 0 ? (n[o.path[0]] = n[o.path[0]] || [], n[o.path[0]].push(e(o))) : r.push(e(o));
|
|
359
358
|
return {
|
|
@@ -361,7 +360,7 @@ let __tla = (async () => {
|
|
|
361
360
|
fieldErrors: n
|
|
362
361
|
};
|
|
363
362
|
}
|
|
364
|
-
function
|
|
363
|
+
function Ur(t, e) {
|
|
365
364
|
const n = e || function(i) {
|
|
366
365
|
return i.message;
|
|
367
366
|
}, r = {
|
|
@@ -400,9 +399,9 @@ let __tla = (async () => {
|
|
|
400
399
|
value: n,
|
|
401
400
|
issues: []
|
|
402
401
|
}, i);
|
|
403
|
-
if (s instanceof Promise) throw new
|
|
402
|
+
if (s instanceof Promise) throw new oe();
|
|
404
403
|
if (s.issues.length) {
|
|
405
|
-
const l = new ((o == null ? void 0 : o.Err) ?? t)(s.issues.map((a) =>
|
|
404
|
+
const l = new ((o == null ? void 0 : o.Err) ?? t)(s.issues.map((a) => X(a, i, J())));
|
|
406
405
|
throw En(l, o == null ? void 0 : o.callee), l;
|
|
407
406
|
}
|
|
408
407
|
return s.value;
|
|
@@ -417,7 +416,7 @@ let __tla = (async () => {
|
|
|
417
416
|
issues: []
|
|
418
417
|
}, i);
|
|
419
418
|
if (s instanceof Promise && (s = await s), s.issues.length) {
|
|
420
|
-
const l = new ((o == null ? void 0 : o.Err) ?? t)(s.issues.map((a) =>
|
|
419
|
+
const l = new ((o == null ? void 0 : o.Err) ?? t)(s.issues.map((a) => X(a, i, J())));
|
|
421
420
|
throw En(l, o == null ? void 0 : o.callee), l;
|
|
422
421
|
}
|
|
423
422
|
return s.value;
|
|
@@ -431,15 +430,15 @@ let __tla = (async () => {
|
|
|
431
430
|
value: n,
|
|
432
431
|
issues: []
|
|
433
432
|
}, o);
|
|
434
|
-
if (i instanceof Promise) throw new
|
|
433
|
+
if (i instanceof Promise) throw new oe();
|
|
435
434
|
return i.issues.length ? {
|
|
436
435
|
success: false,
|
|
437
|
-
error: new (t ?? In)(i.issues.map((s) =>
|
|
436
|
+
error: new (t ?? In)(i.issues.map((s) => X(s, o, J())))
|
|
438
437
|
} : {
|
|
439
438
|
success: true,
|
|
440
439
|
data: i.value
|
|
441
440
|
};
|
|
442
|
-
},
|
|
441
|
+
}, Fr = We(zn), Ze = (t) => async (e, n, r) => {
|
|
443
442
|
const o = r ? Object.assign(r, {
|
|
444
443
|
async: true
|
|
445
444
|
}) : {
|
|
@@ -451,43 +450,43 @@ let __tla = (async () => {
|
|
|
451
450
|
}, o);
|
|
452
451
|
return i instanceof Promise && (i = await i), i.issues.length ? {
|
|
453
452
|
success: false,
|
|
454
|
-
error: new t(i.issues.map((s) =>
|
|
453
|
+
error: new t(i.issues.map((s) => X(s, o, J())))
|
|
455
454
|
} : {
|
|
456
455
|
success: true,
|
|
457
456
|
data: i.value
|
|
458
457
|
};
|
|
459
|
-
},
|
|
458
|
+
}, Hr = Ze(zn), Wr = (t) => (e, n, r) => {
|
|
460
459
|
const o = r ? Object.assign(r, {
|
|
461
460
|
direction: "backward"
|
|
462
461
|
}) : {
|
|
463
462
|
direction: "backward"
|
|
464
463
|
};
|
|
465
464
|
return Rt(t)(e, n, o);
|
|
466
|
-
},
|
|
465
|
+
}, Zr = (t) => (e, n, r) => Rt(t)(e, n, r), qr = (t) => async (e, n, r) => {
|
|
467
466
|
const o = r ? Object.assign(r, {
|
|
468
467
|
direction: "backward"
|
|
469
468
|
}) : {
|
|
470
469
|
direction: "backward"
|
|
471
470
|
};
|
|
472
471
|
return At(t)(e, n, o);
|
|
473
|
-
},
|
|
472
|
+
}, Vr = (t) => async (e, n, r) => At(t)(e, n, r), Kr = (t) => (e, n, r) => {
|
|
474
473
|
const o = r ? Object.assign(r, {
|
|
475
474
|
direction: "backward"
|
|
476
475
|
}) : {
|
|
477
476
|
direction: "backward"
|
|
478
477
|
};
|
|
479
478
|
return We(t)(e, n, o);
|
|
480
|
-
},
|
|
479
|
+
}, Jr = (t) => (e, n, r) => We(t)(e, n, r), Xr = (t) => async (e, n, r) => {
|
|
481
480
|
const o = r ? Object.assign(r, {
|
|
482
481
|
direction: "backward"
|
|
483
482
|
}) : {
|
|
484
483
|
direction: "backward"
|
|
485
484
|
};
|
|
486
485
|
return Ze(t)(e, n, o);
|
|
487
|
-
},
|
|
486
|
+
}, Yr = (t) => async (e, n, r) => Ze(t)(e, n, r), le = v("$ZodCheck", (t, e) => {
|
|
488
487
|
var n;
|
|
489
488
|
t._zod ?? (t._zod = {}), t._zod.def = e, (n = t._zod).onattach ?? (n.onattach = []);
|
|
490
|
-
}),
|
|
489
|
+
}), Qr = v("$ZodCheckMaxLength", (t, e) => {
|
|
491
490
|
var n;
|
|
492
491
|
le.init(t, e), (n = t._zod.def).when ?? (n.when = (r) => {
|
|
493
492
|
const o = r.value;
|
|
@@ -509,7 +508,7 @@ let __tla = (async () => {
|
|
|
509
508
|
continue: !e.abort
|
|
510
509
|
});
|
|
511
510
|
};
|
|
512
|
-
}),
|
|
511
|
+
}), eo = v("$ZodCheckMinLength", (t, e) => {
|
|
513
512
|
var n;
|
|
514
513
|
le.init(t, e), (n = t._zod.def).when ?? (n.when = (r) => {
|
|
515
514
|
const o = r.value;
|
|
@@ -531,7 +530,7 @@ let __tla = (async () => {
|
|
|
531
530
|
continue: !e.abort
|
|
532
531
|
});
|
|
533
532
|
};
|
|
534
|
-
}),
|
|
533
|
+
}), to = v("$ZodCheckLengthEquals", (t, e) => {
|
|
535
534
|
var n;
|
|
536
535
|
le.init(t, e), (n = t._zod.def).when ?? (n.when = (r) => {
|
|
537
536
|
const o = r.value;
|
|
@@ -559,12 +558,12 @@ let __tla = (async () => {
|
|
|
559
558
|
continue: !e.abort
|
|
560
559
|
});
|
|
561
560
|
};
|
|
562
|
-
}),
|
|
561
|
+
}), no = v("$ZodCheckOverwrite", (t, e) => {
|
|
563
562
|
le.init(t, e), t._zod.check = (n) => {
|
|
564
563
|
n.value = e.tx(n.value);
|
|
565
564
|
};
|
|
566
565
|
});
|
|
567
|
-
class
|
|
566
|
+
class ro {
|
|
568
567
|
constructor(e = []) {
|
|
569
568
|
this.content = [], this.indent = 0, this && (this.args = e);
|
|
570
569
|
}
|
|
@@ -594,14 +593,14 @@ let __tla = (async () => {
|
|
|
594
593
|
`));
|
|
595
594
|
}
|
|
596
595
|
}
|
|
597
|
-
const
|
|
596
|
+
const oo = {
|
|
598
597
|
major: 4,
|
|
599
598
|
minor: 1,
|
|
600
|
-
patch:
|
|
599
|
+
patch: 11
|
|
601
600
|
}, E = v("$ZodType", (t, e) => {
|
|
602
601
|
var _a3;
|
|
603
602
|
var n;
|
|
604
|
-
t ?? (t = {}), t._zod.def = e, t._zod.bag = t._zod.bag || {}, t._zod.version =
|
|
603
|
+
t ?? (t = {}), t._zod.def = e, t._zod.bag = t._zod.bag || {}, t._zod.version = oo;
|
|
605
604
|
const r = [
|
|
606
605
|
...t._zod.def.checks ?? []
|
|
607
606
|
];
|
|
@@ -612,27 +611,27 @@ let __tla = (async () => {
|
|
|
612
611
|
});
|
|
613
612
|
else {
|
|
614
613
|
const o = (s, l, a) => {
|
|
615
|
-
let c =
|
|
614
|
+
let c = ne(s), u;
|
|
616
615
|
for (const p of l) {
|
|
617
616
|
if (p._zod.def.when) {
|
|
618
617
|
if (!p._zod.def.when(s)) continue;
|
|
619
618
|
} else if (c) continue;
|
|
620
|
-
const
|
|
621
|
-
if (
|
|
622
|
-
if (u ||
|
|
623
|
-
await
|
|
619
|
+
const h = s.issues.length, d = p._zod.check(s);
|
|
620
|
+
if (d instanceof Promise && (a == null ? void 0 : a.async) === false) throw new oe();
|
|
621
|
+
if (u || d instanceof Promise) u = (u ?? Promise.resolve()).then(async () => {
|
|
622
|
+
await d, s.issues.length !== h && (c || (c = ne(s, h)));
|
|
624
623
|
});
|
|
625
624
|
else {
|
|
626
|
-
if (s.issues.length ===
|
|
627
|
-
c || (c =
|
|
625
|
+
if (s.issues.length === h) continue;
|
|
626
|
+
c || (c = ne(s, h));
|
|
628
627
|
}
|
|
629
628
|
}
|
|
630
629
|
return u ? u.then(() => s) : s;
|
|
631
630
|
}, i = (s, l, a) => {
|
|
632
|
-
if (
|
|
631
|
+
if (ne(s)) return s.aborted = true, s;
|
|
633
632
|
const c = o(l, r, a);
|
|
634
633
|
if (c instanceof Promise) {
|
|
635
|
-
if (a.async === false) throw new
|
|
634
|
+
if (a.async === false) throw new oe();
|
|
636
635
|
return c.then((u) => t._zod.parse(u, a));
|
|
637
636
|
}
|
|
638
637
|
return t._zod.parse(c, a);
|
|
@@ -651,7 +650,7 @@ let __tla = (async () => {
|
|
|
651
650
|
}
|
|
652
651
|
const a = t._zod.parse(s, l);
|
|
653
652
|
if (a instanceof Promise) {
|
|
654
|
-
if (l.async === false) throw new
|
|
653
|
+
if (l.async === false) throw new oe();
|
|
655
654
|
return a.then((c) => o(c, r, l));
|
|
656
655
|
}
|
|
657
656
|
return o(a, r, l);
|
|
@@ -661,14 +660,14 @@ let __tla = (async () => {
|
|
|
661
660
|
validate: (o) => {
|
|
662
661
|
var _a4;
|
|
663
662
|
try {
|
|
664
|
-
const i =
|
|
663
|
+
const i = Fr(t, o);
|
|
665
664
|
return i.success ? {
|
|
666
665
|
value: i.data
|
|
667
666
|
} : {
|
|
668
667
|
issues: (_a4 = i.error) == null ? void 0 : _a4.issues
|
|
669
668
|
};
|
|
670
669
|
} catch {
|
|
671
|
-
return
|
|
670
|
+
return Hr(t, o).then((s) => {
|
|
672
671
|
var _a5;
|
|
673
672
|
return s.success ? {
|
|
674
673
|
value: s.data
|
|
@@ -681,11 +680,11 @@ let __tla = (async () => {
|
|
|
681
680
|
vendor: "zod",
|
|
682
681
|
version: 1
|
|
683
682
|
};
|
|
684
|
-
}),
|
|
683
|
+
}), io = v("$ZodAny", (t, e) => {
|
|
685
684
|
E.init(t, e), t._zod.parse = (n) => n;
|
|
686
|
-
}),
|
|
685
|
+
}), so = v("$ZodUnknown", (t, e) => {
|
|
687
686
|
E.init(t, e), t._zod.parse = (n) => n;
|
|
688
|
-
}),
|
|
687
|
+
}), ao = v("$ZodNever", (t, e) => {
|
|
689
688
|
E.init(t, e), t._zod.parse = (n, r) => (n.issues.push({
|
|
690
689
|
expected: "never",
|
|
691
690
|
code: "invalid_type",
|
|
@@ -696,7 +695,7 @@ let __tla = (async () => {
|
|
|
696
695
|
function Ht(t, e, n) {
|
|
697
696
|
t.issues.length && e.issues.push(...Ln(n, t.issues)), e.value[n] = t.value;
|
|
698
697
|
}
|
|
699
|
-
const
|
|
698
|
+
const lo = v("$ZodArray", (t, e) => {
|
|
700
699
|
E.init(t, e), t._zod.parse = (n, r) => {
|
|
701
700
|
const o = n.value;
|
|
702
701
|
if (!Array.isArray(o)) return n.issues.push({
|
|
@@ -721,9 +720,10 @@ let __tla = (async () => {
|
|
|
721
720
|
t.issues.length && e.issues.push(...Ln(n, t.issues)), t.value === void 0 ? n in r && (e.value[n] = void 0) : e.value[n] = t.value;
|
|
722
721
|
}
|
|
723
722
|
function Mn(t) {
|
|
723
|
+
var _a3, _b2, _c, _d;
|
|
724
724
|
const e = Object.keys(t.shape);
|
|
725
|
-
for (const r of e) if (!t.shape[r]._zod.traits.has("$ZodType")) throw new Error(`Invalid element at key "${r}": expected a Zod schema`);
|
|
726
|
-
const n =
|
|
725
|
+
for (const r of e) if (!((_d = (_c = (_b2 = (_a3 = t.shape) == null ? void 0 : _a3[r]) == null ? void 0 : _b2._zod) == null ? void 0 : _c.traits) == null ? void 0 : _d.has("$ZodType"))) throw new Error(`Invalid element at key "${r}": expected a Zod schema`);
|
|
726
|
+
const n = Or(t.shape);
|
|
727
727
|
return {
|
|
728
728
|
...t,
|
|
729
729
|
keys: e,
|
|
@@ -744,7 +744,7 @@ let __tla = (async () => {
|
|
|
744
744
|
value: e[u],
|
|
745
745
|
issues: []
|
|
746
746
|
}, r);
|
|
747
|
-
p instanceof Promise ? t.push(p.then((
|
|
747
|
+
p instanceof Promise ? t.push(p.then((h) => Oe(h, n, u, e))) : Oe(p, n, u, e);
|
|
748
748
|
}
|
|
749
749
|
return s.length && n.issues.push({
|
|
750
750
|
code: "unrecognized_keys",
|
|
@@ -753,46 +753,59 @@ let __tla = (async () => {
|
|
|
753
753
|
inst: i
|
|
754
754
|
}), t.length ? Promise.all(t).then(() => n) : n;
|
|
755
755
|
}
|
|
756
|
-
const
|
|
757
|
-
|
|
758
|
-
|
|
756
|
+
const co = v("$ZodObject", (t, e) => {
|
|
757
|
+
var _a3;
|
|
758
|
+
if (E.init(t, e), !((_a3 = Object.getOwnPropertyDescriptor(e, "shape")) == null ? void 0 : _a3.get)) {
|
|
759
|
+
const l = e.shape;
|
|
760
|
+
Object.defineProperty(e, "shape", {
|
|
761
|
+
get: () => {
|
|
762
|
+
const a = {
|
|
763
|
+
...l
|
|
764
|
+
};
|
|
765
|
+
return Object.defineProperty(e, "shape", {
|
|
766
|
+
value: a
|
|
767
|
+
}), a;
|
|
768
|
+
}
|
|
769
|
+
});
|
|
770
|
+
}
|
|
771
|
+
const r = kt(() => Mn(e));
|
|
759
772
|
P(t._zod, "propValues", () => {
|
|
760
|
-
const
|
|
761
|
-
for (const
|
|
762
|
-
const
|
|
763
|
-
if (
|
|
764
|
-
|
|
765
|
-
for (const
|
|
773
|
+
const l = e.shape, a = {};
|
|
774
|
+
for (const c in l) {
|
|
775
|
+
const u = l[c]._zod;
|
|
776
|
+
if (u.values) {
|
|
777
|
+
a[c] ?? (a[c] = /* @__PURE__ */ new Set());
|
|
778
|
+
for (const p of u.values) a[c].add(p);
|
|
766
779
|
}
|
|
767
780
|
}
|
|
768
|
-
return
|
|
781
|
+
return a;
|
|
769
782
|
});
|
|
770
|
-
const
|
|
771
|
-
let
|
|
772
|
-
t._zod.parse = (
|
|
773
|
-
|
|
774
|
-
const
|
|
775
|
-
if (!
|
|
783
|
+
const o = Le, i = e.catchall;
|
|
784
|
+
let s;
|
|
785
|
+
t._zod.parse = (l, a) => {
|
|
786
|
+
s ?? (s = r.value);
|
|
787
|
+
const c = l.value;
|
|
788
|
+
if (!o(c)) return l.issues.push({
|
|
776
789
|
expected: "object",
|
|
777
790
|
code: "invalid_type",
|
|
778
|
-
input:
|
|
791
|
+
input: c,
|
|
779
792
|
inst: t
|
|
780
|
-
}),
|
|
781
|
-
|
|
782
|
-
const
|
|
783
|
-
for (const
|
|
784
|
-
const
|
|
785
|
-
value:
|
|
793
|
+
}), l;
|
|
794
|
+
l.value = {};
|
|
795
|
+
const u = [], p = s.shape;
|
|
796
|
+
for (const h of s.keys) {
|
|
797
|
+
const m = p[h]._zod.run({
|
|
798
|
+
value: c[h],
|
|
786
799
|
issues: []
|
|
787
|
-
},
|
|
788
|
-
|
|
800
|
+
}, a);
|
|
801
|
+
m instanceof Promise ? u.push(m.then((w) => Oe(w, l, h, c))) : Oe(m, l, h, c);
|
|
789
802
|
}
|
|
790
|
-
return
|
|
803
|
+
return i ? $n(u, c, l, a, r.value, t) : u.length ? Promise.all(u).then(() => l) : l;
|
|
791
804
|
};
|
|
792
|
-
}),
|
|
793
|
-
|
|
794
|
-
const n = t._zod.parse, r = kt(() => Mn(e)), o = (
|
|
795
|
-
const
|
|
805
|
+
}), uo = v("$ZodObjectJIT", (t, e) => {
|
|
806
|
+
co.init(t, e);
|
|
807
|
+
const n = t._zod.parse, r = kt(() => Mn(e)), o = (h) => {
|
|
808
|
+
const d = new ro([
|
|
796
809
|
"shape",
|
|
797
810
|
"payload",
|
|
798
811
|
"ctx"
|
|
@@ -800,14 +813,14 @@ let __tla = (async () => {
|
|
|
800
813
|
const k = Ft(b);
|
|
801
814
|
return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
|
802
815
|
};
|
|
803
|
-
|
|
816
|
+
d.write("const input = payload.value;");
|
|
804
817
|
const _ = /* @__PURE__ */ Object.create(null);
|
|
805
818
|
let y = 0;
|
|
806
819
|
for (const b of m.keys) _[b] = `key_${y++}`;
|
|
807
|
-
|
|
820
|
+
d.write("const newResult = {};");
|
|
808
821
|
for (const b of m.keys) {
|
|
809
822
|
const k = _[b], C = Ft(b);
|
|
810
|
-
|
|
823
|
+
d.write(`const ${k} = ${w(b)};`), d.write(`
|
|
811
824
|
if (${k}.issues.length) {
|
|
812
825
|
payload.issues = payload.issues.concat(${k}.issues.map(iss => ({
|
|
813
826
|
...iss,
|
|
@@ -815,6 +828,7 @@ let __tla = (async () => {
|
|
|
815
828
|
})));
|
|
816
829
|
}
|
|
817
830
|
|
|
831
|
+
|
|
818
832
|
if (${k}.value === undefined) {
|
|
819
833
|
if (${C} in input) {
|
|
820
834
|
newResult[${C}] = undefined;
|
|
@@ -822,37 +836,38 @@ let __tla = (async () => {
|
|
|
822
836
|
} else {
|
|
823
837
|
newResult[${C}] = ${k}.value;
|
|
824
838
|
}
|
|
839
|
+
|
|
825
840
|
`);
|
|
826
841
|
}
|
|
827
|
-
|
|
828
|
-
const g =
|
|
829
|
-
return (b, k) => g(
|
|
842
|
+
d.write("payload.value = newResult;"), d.write("return payload;");
|
|
843
|
+
const g = d.compile();
|
|
844
|
+
return (b, k) => g(h, b, k);
|
|
830
845
|
};
|
|
831
846
|
let i;
|
|
832
|
-
const s = Le, l = !Nn.jitless, c = l &&
|
|
847
|
+
const s = Le, l = !Nn.jitless, c = l && Er.value, u = e.catchall;
|
|
833
848
|
let p;
|
|
834
|
-
t._zod.parse = (
|
|
849
|
+
t._zod.parse = (h, d) => {
|
|
835
850
|
p ?? (p = r.value);
|
|
836
|
-
const m =
|
|
837
|
-
return s(m) ? l && c && (
|
|
851
|
+
const m = h.value;
|
|
852
|
+
return s(m) ? l && c && (d == null ? void 0 : d.async) === false && d.jitless !== true ? (i || (i = o(e.shape)), h = i(h, d), u ? $n([], m, h, d, p, t) : h) : n(h, d) : (h.issues.push({
|
|
838
853
|
expected: "object",
|
|
839
854
|
code: "invalid_type",
|
|
840
855
|
input: m,
|
|
841
856
|
inst: t
|
|
842
|
-
}),
|
|
857
|
+
}), h);
|
|
843
858
|
};
|
|
844
859
|
});
|
|
845
860
|
function Wt(t, e, n, r) {
|
|
846
861
|
for (const i of t) if (i.issues.length === 0) return e.value = i.value, e;
|
|
847
|
-
const o = t.filter((i) => !
|
|
862
|
+
const o = t.filter((i) => !ne(i));
|
|
848
863
|
return o.length === 1 ? (e.value = o[0].value, o[0]) : (e.issues.push({
|
|
849
864
|
code: "invalid_union",
|
|
850
865
|
input: e.value,
|
|
851
866
|
inst: n,
|
|
852
|
-
errors: t.map((i) => i.issues.map((s) =>
|
|
867
|
+
errors: t.map((i) => i.issues.map((s) => X(s, r, J())))
|
|
853
868
|
}), e);
|
|
854
869
|
}
|
|
855
|
-
const
|
|
870
|
+
const po = v("$ZodUnion", (t, e) => {
|
|
856
871
|
E.init(t, e), P(t._zod, "optin", () => e.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), P(t._zod, "optout", () => e.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), P(t._zod, "values", () => {
|
|
857
872
|
if (e.options.every((o) => o._zod.values)) return new Set(e.options.flatMap((o) => Array.from(o._zod.values)));
|
|
858
873
|
}), P(t._zod, "pattern", () => {
|
|
@@ -879,7 +894,7 @@ let __tla = (async () => {
|
|
|
879
894
|
}
|
|
880
895
|
return s ? Promise.all(l).then((a) => Wt(a, o, t, i)) : Wt(l, o, t, i);
|
|
881
896
|
};
|
|
882
|
-
}),
|
|
897
|
+
}), ho = v("$ZodIntersection", (t, e) => {
|
|
883
898
|
E.init(t, e), t._zod.parse = (n, r) => {
|
|
884
899
|
const o = n.value, i = e.left._zod.run({
|
|
885
900
|
value: o,
|
|
@@ -952,15 +967,15 @@ let __tla = (async () => {
|
|
|
952
967
|
};
|
|
953
968
|
}
|
|
954
969
|
function Zt(t, e, n) {
|
|
955
|
-
if (e.issues.length && t.issues.push(...e.issues), n.issues.length && t.issues.push(...n.issues),
|
|
970
|
+
if (e.issues.length && t.issues.push(...e.issues), n.issues.length && t.issues.push(...n.issues), ne(t)) return t;
|
|
956
971
|
const r = ct(e.value, n.value);
|
|
957
972
|
if (!r.valid) throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);
|
|
958
973
|
return t.value = r.data, t;
|
|
959
974
|
}
|
|
960
|
-
const
|
|
975
|
+
const mo = v("$ZodEnum", (t, e) => {
|
|
961
976
|
E.init(t, e);
|
|
962
977
|
const n = Nr(e.entries), r = new Set(n);
|
|
963
|
-
t._zod.values = r, t._zod.pattern = new RegExp(`^(${n.filter((o) =>
|
|
978
|
+
t._zod.values = r, t._zod.pattern = new RegExp(`^(${n.filter((o) => xr.has(typeof o)).map((o) => typeof o == "string" ? Lr(o) : o.toString()).join("|")})$`), t._zod.parse = (o, i) => {
|
|
964
979
|
const s = o.value;
|
|
965
980
|
return r.has(s) || o.issues.push({
|
|
966
981
|
code: "invalid_value",
|
|
@@ -969,12 +984,12 @@ let __tla = (async () => {
|
|
|
969
984
|
inst: t
|
|
970
985
|
}), o;
|
|
971
986
|
};
|
|
972
|
-
}),
|
|
987
|
+
}), fo = v("$ZodTransform", (t, e) => {
|
|
973
988
|
E.init(t, e), t._zod.parse = (n, r) => {
|
|
974
989
|
if (r.direction === "backward") throw new An(t.constructor.name);
|
|
975
990
|
const o = e.transform(n.value, n);
|
|
976
991
|
if (r.async) return (o instanceof Promise ? o : Promise.resolve(o)).then((s) => (n.value = s, n));
|
|
977
|
-
if (o instanceof Promise) throw new
|
|
992
|
+
if (o instanceof Promise) throw new oe();
|
|
978
993
|
return n.value = o, n;
|
|
979
994
|
};
|
|
980
995
|
});
|
|
@@ -984,7 +999,7 @@ let __tla = (async () => {
|
|
|
984
999
|
value: void 0
|
|
985
1000
|
} : t;
|
|
986
1001
|
}
|
|
987
|
-
const
|
|
1002
|
+
const go = v("$ZodOptional", (t, e) => {
|
|
988
1003
|
E.init(t, e), t._zod.optin = "optional", t._zod.optout = "optional", P(t._zod, "values", () => e.innerType._zod.values ? /* @__PURE__ */ new Set([
|
|
989
1004
|
...e.innerType._zod.values,
|
|
990
1005
|
void 0
|
|
@@ -998,7 +1013,7 @@ let __tla = (async () => {
|
|
|
998
1013
|
}
|
|
999
1014
|
return n.value === void 0 ? n : e.innerType._zod.run(n, r);
|
|
1000
1015
|
};
|
|
1001
|
-
}),
|
|
1016
|
+
}), yo = v("$ZodNullable", (t, e) => {
|
|
1002
1017
|
E.init(t, e), P(t._zod, "optin", () => e.innerType._zod.optin), P(t._zod, "optout", () => e.innerType._zod.optout), P(t._zod, "pattern", () => {
|
|
1003
1018
|
const n = e.innerType._zod.pattern;
|
|
1004
1019
|
return n ? new RegExp(`^(${Tt(n.source)}|null)$`) : void 0;
|
|
@@ -1006,7 +1021,7 @@ let __tla = (async () => {
|
|
|
1006
1021
|
...e.innerType._zod.values,
|
|
1007
1022
|
null
|
|
1008
1023
|
]) : void 0), t._zod.parse = (n, r) => n.value === null ? n : e.innerType._zod.run(n, r);
|
|
1009
|
-
}),
|
|
1024
|
+
}), _o = v("$ZodDefault", (t, e) => {
|
|
1010
1025
|
E.init(t, e), t._zod.optin = "optional", P(t._zod, "values", () => e.innerType._zod.values), t._zod.parse = (n, r) => {
|
|
1011
1026
|
if (r.direction === "backward") return e.innerType._zod.run(n, r);
|
|
1012
1027
|
if (n.value === void 0) return n.value = e.defaultValue, n;
|
|
@@ -1017,9 +1032,9 @@ let __tla = (async () => {
|
|
|
1017
1032
|
function Vt(t, e) {
|
|
1018
1033
|
return t.value === void 0 && (t.value = e.defaultValue), t;
|
|
1019
1034
|
}
|
|
1020
|
-
const
|
|
1035
|
+
const bo = v("$ZodPrefault", (t, e) => {
|
|
1021
1036
|
E.init(t, e), t._zod.optin = "optional", P(t._zod, "values", () => e.innerType._zod.values), t._zod.parse = (n, r) => (r.direction === "backward" || n.value === void 0 && (n.value = e.defaultValue), e.innerType._zod.run(n, r));
|
|
1022
|
-
}),
|
|
1037
|
+
}), wo = v("$ZodNonOptional", (t, e) => {
|
|
1023
1038
|
E.init(t, e), P(t._zod, "values", () => {
|
|
1024
1039
|
const n = e.innerType._zod.values;
|
|
1025
1040
|
return n ? new Set([
|
|
@@ -1038,25 +1053,25 @@ let __tla = (async () => {
|
|
|
1038
1053
|
inst: e
|
|
1039
1054
|
}), t;
|
|
1040
1055
|
}
|
|
1041
|
-
const
|
|
1056
|
+
const vo = v("$ZodCatch", (t, e) => {
|
|
1042
1057
|
E.init(t, e), P(t._zod, "optin", () => e.innerType._zod.optin), P(t._zod, "optout", () => e.innerType._zod.optout), P(t._zod, "values", () => e.innerType._zod.values), t._zod.parse = (n, r) => {
|
|
1043
1058
|
if (r.direction === "backward") return e.innerType._zod.run(n, r);
|
|
1044
1059
|
const o = e.innerType._zod.run(n, r);
|
|
1045
1060
|
return o instanceof Promise ? o.then((i) => (n.value = i.value, i.issues.length && (n.value = e.catchValue({
|
|
1046
1061
|
...n,
|
|
1047
1062
|
error: {
|
|
1048
|
-
issues: i.issues.map((s) =>
|
|
1063
|
+
issues: i.issues.map((s) => X(s, r, J()))
|
|
1049
1064
|
},
|
|
1050
1065
|
input: n.value
|
|
1051
1066
|
}), n.issues = []), n)) : (n.value = o.value, o.issues.length && (n.value = e.catchValue({
|
|
1052
1067
|
...n,
|
|
1053
1068
|
error: {
|
|
1054
|
-
issues: o.issues.map((i) =>
|
|
1069
|
+
issues: o.issues.map((i) => X(i, r, J()))
|
|
1055
1070
|
},
|
|
1056
1071
|
input: n.value
|
|
1057
1072
|
}), n.issues = []), n);
|
|
1058
1073
|
};
|
|
1059
|
-
}),
|
|
1074
|
+
}), So = v("$ZodPipe", (t, e) => {
|
|
1060
1075
|
E.init(t, e), P(t._zod, "values", () => e.in._zod.values), P(t._zod, "optin", () => e.in._zod.optin), P(t._zod, "optout", () => e.out._zod.optout), P(t._zod, "propValues", () => e.in._zod.propValues), t._zod.parse = (n, r) => {
|
|
1061
1076
|
if (r.direction === "backward") {
|
|
1062
1077
|
const i = e.out._zod.run(n, r);
|
|
@@ -1072,7 +1087,7 @@ let __tla = (async () => {
|
|
|
1072
1087
|
issues: t.issues
|
|
1073
1088
|
}, n);
|
|
1074
1089
|
}
|
|
1075
|
-
const
|
|
1090
|
+
const ko = v("$ZodReadonly", (t, e) => {
|
|
1076
1091
|
E.init(t, e), P(t._zod, "propValues", () => e.innerType._zod.propValues), P(t._zod, "values", () => e.innerType._zod.values), P(t._zod, "optin", () => e.innerType._zod.optin), P(t._zod, "optout", () => e.innerType._zod.optout), t._zod.parse = (n, r) => {
|
|
1077
1092
|
if (r.direction === "backward") return e.innerType._zod.run(n, r);
|
|
1078
1093
|
const o = e.innerType._zod.run(n, r);
|
|
@@ -1082,7 +1097,7 @@ let __tla = (async () => {
|
|
|
1082
1097
|
function Jt(t) {
|
|
1083
1098
|
return t.value = Object.freeze(t.value), t;
|
|
1084
1099
|
}
|
|
1085
|
-
const
|
|
1100
|
+
const Co = v("$ZodCustom", (t, e) => {
|
|
1086
1101
|
le.init(t, e), E.init(t, e), t._zod.parse = (n, r) => n, t._zod.check = (n) => {
|
|
1087
1102
|
const r = n.value, o = e.fn(r);
|
|
1088
1103
|
if (o instanceof Promise) return o.then((i) => Xt(i, n, r, t));
|
|
@@ -1103,9 +1118,9 @@ let __tla = (async () => {
|
|
|
1103
1118
|
r._zod.def.params && (o.params = r._zod.def.params), e.issues.push(fe(o));
|
|
1104
1119
|
}
|
|
1105
1120
|
}
|
|
1106
|
-
class
|
|
1121
|
+
class To {
|
|
1107
1122
|
constructor() {
|
|
1108
|
-
this._map = /* @__PURE__ */ new
|
|
1123
|
+
this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
|
|
1109
1124
|
}
|
|
1110
1125
|
add(e, ...n) {
|
|
1111
1126
|
const r = n[0];
|
|
@@ -1116,7 +1131,7 @@ let __tla = (async () => {
|
|
|
1116
1131
|
return this;
|
|
1117
1132
|
}
|
|
1118
1133
|
clear() {
|
|
1119
|
-
return this._map = /* @__PURE__ */ new
|
|
1134
|
+
return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this;
|
|
1120
1135
|
}
|
|
1121
1136
|
remove(e) {
|
|
1122
1137
|
const n = this._map.get(e);
|
|
@@ -1141,61 +1156,61 @@ let __tla = (async () => {
|
|
|
1141
1156
|
return this._map.has(e);
|
|
1142
1157
|
}
|
|
1143
1158
|
}
|
|
1144
|
-
function
|
|
1145
|
-
return new
|
|
1159
|
+
function Po() {
|
|
1160
|
+
return new To();
|
|
1146
1161
|
}
|
|
1147
|
-
const Ce =
|
|
1148
|
-
function
|
|
1162
|
+
const Ce = Po();
|
|
1163
|
+
function Ro(t) {
|
|
1149
1164
|
return new t({
|
|
1150
1165
|
type: "any"
|
|
1151
1166
|
});
|
|
1152
1167
|
}
|
|
1153
|
-
function
|
|
1168
|
+
function Ao(t) {
|
|
1154
1169
|
return new t({
|
|
1155
1170
|
type: "unknown"
|
|
1156
1171
|
});
|
|
1157
1172
|
}
|
|
1158
|
-
function
|
|
1173
|
+
function No(t, e) {
|
|
1159
1174
|
return new t({
|
|
1160
1175
|
type: "never",
|
|
1161
1176
|
...D(e)
|
|
1162
1177
|
});
|
|
1163
1178
|
}
|
|
1164
|
-
function
|
|
1165
|
-
return new
|
|
1179
|
+
function Eo(t, e) {
|
|
1180
|
+
return new Qr({
|
|
1166
1181
|
check: "max_length",
|
|
1167
1182
|
...D(e),
|
|
1168
1183
|
maximum: t
|
|
1169
1184
|
});
|
|
1170
1185
|
}
|
|
1171
1186
|
function Yt(t, e) {
|
|
1172
|
-
return new
|
|
1187
|
+
return new eo({
|
|
1173
1188
|
check: "min_length",
|
|
1174
1189
|
...D(e),
|
|
1175
1190
|
minimum: t
|
|
1176
1191
|
});
|
|
1177
1192
|
}
|
|
1178
|
-
function
|
|
1179
|
-
return new
|
|
1193
|
+
function xo(t, e) {
|
|
1194
|
+
return new to({
|
|
1180
1195
|
check: "length_equals",
|
|
1181
1196
|
...D(e),
|
|
1182
1197
|
length: t
|
|
1183
1198
|
});
|
|
1184
1199
|
}
|
|
1185
|
-
function
|
|
1186
|
-
return new
|
|
1200
|
+
function Lo(t) {
|
|
1201
|
+
return new no({
|
|
1187
1202
|
check: "overwrite",
|
|
1188
1203
|
tx: t
|
|
1189
1204
|
});
|
|
1190
1205
|
}
|
|
1191
|
-
function
|
|
1206
|
+
function Oo(t, e, n) {
|
|
1192
1207
|
return new t({
|
|
1193
1208
|
type: "array",
|
|
1194
1209
|
element: e,
|
|
1195
1210
|
...D(n)
|
|
1196
1211
|
});
|
|
1197
1212
|
}
|
|
1198
|
-
function
|
|
1213
|
+
function Io(t, e, n) {
|
|
1199
1214
|
return new t({
|
|
1200
1215
|
type: "custom",
|
|
1201
1216
|
check: "custom",
|
|
@@ -1203,8 +1218,8 @@ let __tla = (async () => {
|
|
|
1203
1218
|
...D(n)
|
|
1204
1219
|
});
|
|
1205
1220
|
}
|
|
1206
|
-
function
|
|
1207
|
-
const e =
|
|
1221
|
+
function zo(t) {
|
|
1222
|
+
const e = Mo((n) => (n.addIssue = (r) => {
|
|
1208
1223
|
if (typeof r == "string") n.issues.push(fe(r, n.value, e._zod.def));
|
|
1209
1224
|
else {
|
|
1210
1225
|
const o = r;
|
|
@@ -1213,20 +1228,20 @@ let __tla = (async () => {
|
|
|
1213
1228
|
}, t(n.value, n)));
|
|
1214
1229
|
return e;
|
|
1215
1230
|
}
|
|
1216
|
-
function
|
|
1231
|
+
function Mo(t, e) {
|
|
1217
1232
|
const n = new le({
|
|
1218
1233
|
check: "custom",
|
|
1219
1234
|
...D(e)
|
|
1220
1235
|
});
|
|
1221
1236
|
return n._zod.check = t, n;
|
|
1222
1237
|
}
|
|
1223
|
-
const
|
|
1238
|
+
const $o = (t, e) => {
|
|
1224
1239
|
In.init(t, e), t.name = "ZodError", Object.defineProperties(t, {
|
|
1225
1240
|
format: {
|
|
1226
|
-
value: (n) =>
|
|
1241
|
+
value: (n) => Ur(t, n)
|
|
1227
1242
|
},
|
|
1228
1243
|
flatten: {
|
|
1229
|
-
value: (n) =>
|
|
1244
|
+
value: (n) => Gr(t, n)
|
|
1230
1245
|
},
|
|
1231
1246
|
addIssue: {
|
|
1232
1247
|
value: (n) => {
|
|
@@ -1244,12 +1259,11 @@ let __tla = (async () => {
|
|
|
1244
1259
|
}
|
|
1245
1260
|
}
|
|
1246
1261
|
});
|
|
1247
|
-
}, G = v("ZodError",
|
|
1262
|
+
}, G = v("ZodError", $o, {
|
|
1248
1263
|
Parent: Error
|
|
1249
|
-
}),
|
|
1264
|
+
}), jo = Rt(G), Do = At(G), Bo = We(G), Go = Ze(G), Uo = Wr(G), Fo = Zr(G), Ho = qr(G), Wo = Vr(G), Zo = Kr(G), qo = Jr(G), Vo = Xr(G), Ko = Yr(G), O = v("ZodType", (t, e) => (E.init(t, e), t.def = e, t.type = e.type, Object.defineProperty(t, "_def", {
|
|
1250
1265
|
value: e
|
|
1251
|
-
}), t.check = (...n) => t.clone({
|
|
1252
|
-
...e,
|
|
1266
|
+
}), t.check = (...n) => t.clone(Q(e, {
|
|
1253
1267
|
checks: [
|
|
1254
1268
|
...e.checks ?? [],
|
|
1255
1269
|
...n.map((r) => typeof r == "function" ? {
|
|
@@ -1262,14 +1276,14 @@ let __tla = (async () => {
|
|
|
1262
1276
|
}
|
|
1263
1277
|
} : r)
|
|
1264
1278
|
]
|
|
1265
|
-
}), t.clone = (n, r) =>
|
|
1279
|
+
})), t.clone = (n, r) => Z(t, n, r), t.brand = () => t, t.register = ((n, r) => (n.add(t, r), t)), t.parse = (n, r) => jo(t, n, r, {
|
|
1266
1280
|
callee: t.parse
|
|
1267
|
-
}), t.safeParse = (n, r) =>
|
|
1281
|
+
}), t.safeParse = (n, r) => Bo(t, n, r), t.parseAsync = async (n, r) => Do(t, n, r, {
|
|
1268
1282
|
callee: t.parseAsync
|
|
1269
|
-
}), t.safeParseAsync = async (n, r) =>
|
|
1283
|
+
}), t.safeParseAsync = async (n, r) => Go(t, n, r), t.spa = t.safeParseAsync, t.encode = (n, r) => Uo(t, n, r), t.decode = (n, r) => Fo(t, n, r), t.encodeAsync = async (n, r) => Ho(t, n, r), t.decodeAsync = async (n, r) => Wo(t, n, r), t.safeEncode = (n, r) => Zo(t, n, r), t.safeDecode = (n, r) => qo(t, n, r), t.safeEncodeAsync = async (n, r) => Vo(t, n, r), t.safeDecodeAsync = async (n, r) => Ko(t, n, r), t.refine = (n, r) => t.check(Si(n, r)), t.superRefine = (n) => t.check(ki(n)), t.overwrite = (n) => t.check(Lo(n)), t.optional = () => en(t), t.nullable = () => tn(t), t.nullish = () => en(tn(t)), t.nonoptional = (n) => fi(t, n), t.array = () => ti(t), t.or = (n) => ii([
|
|
1270
1284
|
t,
|
|
1271
1285
|
n
|
|
1272
|
-
]), t.and = (n) =>
|
|
1286
|
+
]), t.and = (n) => ai(t, n), t.transform = (n) => nn(t, ci(n)), t.default = (n) => hi(t, n), t.prefault = (n) => mi(t, n), t.catch = (n) => yi(t, n), t.pipe = (n) => nn(t, n), t.readonly = () => wi(t), t.describe = (n) => {
|
|
1273
1287
|
const r = t.clone();
|
|
1274
1288
|
return Ce.add(r, {
|
|
1275
1289
|
description: n
|
|
@@ -1284,32 +1298,32 @@ let __tla = (async () => {
|
|
|
1284
1298
|
if (n.length === 0) return Ce.get(t);
|
|
1285
1299
|
const r = t.clone();
|
|
1286
1300
|
return Ce.add(r, n[0]), r;
|
|
1287
|
-
}, t.isOptional = () => t.safeParse(void 0).success, t.isNullable = () => t.safeParse(null).success, t)),
|
|
1288
|
-
|
|
1301
|
+
}, t.isOptional = () => t.safeParse(void 0).success, t.isNullable = () => t.safeParse(null).success, t)), Jo = v("ZodAny", (t, e) => {
|
|
1302
|
+
io.init(t, e), O.init(t, e);
|
|
1289
1303
|
});
|
|
1290
1304
|
function Qe() {
|
|
1291
|
-
return
|
|
1305
|
+
return Ro(Jo);
|
|
1292
1306
|
}
|
|
1293
|
-
const
|
|
1294
|
-
|
|
1307
|
+
const Xo = v("ZodUnknown", (t, e) => {
|
|
1308
|
+
so.init(t, e), O.init(t, e);
|
|
1295
1309
|
});
|
|
1296
1310
|
function Qt() {
|
|
1297
|
-
return
|
|
1311
|
+
return Ao(Xo);
|
|
1298
1312
|
}
|
|
1299
|
-
const
|
|
1300
|
-
|
|
1313
|
+
const Yo = v("ZodNever", (t, e) => {
|
|
1314
|
+
ao.init(t, e), O.init(t, e);
|
|
1301
1315
|
});
|
|
1302
|
-
function
|
|
1303
|
-
return
|
|
1316
|
+
function Qo(t) {
|
|
1317
|
+
return No(Yo, t);
|
|
1304
1318
|
}
|
|
1305
|
-
const
|
|
1306
|
-
|
|
1319
|
+
const ei = v("ZodArray", (t, e) => {
|
|
1320
|
+
lo.init(t, e), O.init(t, e), t.element = e.element, t.min = (n, r) => t.check(Yt(n, r)), t.nonempty = (n) => t.check(Yt(1, n)), t.max = (n, r) => t.check(Eo(n, r)), t.length = (n, r) => t.check(xo(n, r)), t.unwrap = () => t.element;
|
|
1307
1321
|
});
|
|
1308
|
-
function
|
|
1309
|
-
return
|
|
1322
|
+
function ti(t, e) {
|
|
1323
|
+
return Oo(ei, t, e);
|
|
1310
1324
|
}
|
|
1311
|
-
const
|
|
1312
|
-
|
|
1325
|
+
const ni = v("ZodObject", (t, e) => {
|
|
1326
|
+
uo.init(t, e), O.init(t, e), P(t, "shape", () => e.shape), t.keyof = () => jn(Object.keys(t._zod.def.shape)), t.catchall = (n) => t.clone({
|
|
1313
1327
|
...t._zod.def,
|
|
1314
1328
|
catchall: n
|
|
1315
1329
|
}), t.passthrough = () => t.clone({
|
|
@@ -1320,44 +1334,42 @@ let __tla = (async () => {
|
|
|
1320
1334
|
catchall: Qt()
|
|
1321
1335
|
}), t.strict = () => t.clone({
|
|
1322
1336
|
...t._zod.def,
|
|
1323
|
-
catchall:
|
|
1337
|
+
catchall: Qo()
|
|
1324
1338
|
}), t.strip = () => t.clone({
|
|
1325
1339
|
...t._zod.def,
|
|
1326
1340
|
catchall: void 0
|
|
1327
|
-
}), t.extend = (n) =>
|
|
1341
|
+
}), t.extend = (n) => Mr(t, n), t.safeExtend = (n) => $r(t, n), t.merge = (n) => jr(t, n), t.pick = (n) => Ir(t, n), t.omit = (n) => zr(t, n), t.partial = (...n) => Dr(Dn, t, n[0]), t.required = (...n) => Br(Bn, t, n[0]);
|
|
1328
1342
|
});
|
|
1329
|
-
function
|
|
1343
|
+
function ri(t, e) {
|
|
1330
1344
|
const n = {
|
|
1331
1345
|
type: "object",
|
|
1332
|
-
|
|
1333
|
-
return Z(this, "shape", t ? Er(t) : {}), this.shape;
|
|
1334
|
-
},
|
|
1346
|
+
shape: t ?? {},
|
|
1335
1347
|
...D(e)
|
|
1336
1348
|
};
|
|
1337
|
-
return new
|
|
1349
|
+
return new ni(n);
|
|
1338
1350
|
}
|
|
1339
|
-
const
|
|
1340
|
-
|
|
1351
|
+
const oi = v("ZodUnion", (t, e) => {
|
|
1352
|
+
po.init(t, e), O.init(t, e), t.options = e.options;
|
|
1341
1353
|
});
|
|
1342
|
-
function
|
|
1343
|
-
return new
|
|
1354
|
+
function ii(t, e) {
|
|
1355
|
+
return new oi({
|
|
1344
1356
|
type: "union",
|
|
1345
1357
|
options: t,
|
|
1346
1358
|
...D(e)
|
|
1347
1359
|
});
|
|
1348
1360
|
}
|
|
1349
|
-
const
|
|
1350
|
-
|
|
1361
|
+
const si = v("ZodIntersection", (t, e) => {
|
|
1362
|
+
ho.init(t, e), O.init(t, e);
|
|
1351
1363
|
});
|
|
1352
|
-
function
|
|
1353
|
-
return new
|
|
1364
|
+
function ai(t, e) {
|
|
1365
|
+
return new si({
|
|
1354
1366
|
type: "intersection",
|
|
1355
1367
|
left: t,
|
|
1356
1368
|
right: e
|
|
1357
1369
|
});
|
|
1358
1370
|
}
|
|
1359
1371
|
const ut = v("ZodEnum", (t, e) => {
|
|
1360
|
-
|
|
1372
|
+
mo.init(t, e), O.init(t, e), t.enum = e.entries, t.options = Object.values(e.entries);
|
|
1361
1373
|
const n = new Set(Object.keys(e.entries));
|
|
1362
1374
|
t.extract = (r, o) => {
|
|
1363
1375
|
const i = {};
|
|
@@ -1394,8 +1406,8 @@ let __tla = (async () => {
|
|
|
1394
1406
|
...D(e)
|
|
1395
1407
|
});
|
|
1396
1408
|
}
|
|
1397
|
-
const
|
|
1398
|
-
|
|
1409
|
+
const li = v("ZodTransform", (t, e) => {
|
|
1410
|
+
fo.init(t, e), O.init(t, e), t._zod.parse = (n, r) => {
|
|
1399
1411
|
if (r.direction === "backward") throw new An(t.constructor.name);
|
|
1400
1412
|
n.addIssue = (i) => {
|
|
1401
1413
|
if (typeof i == "string") n.issues.push(fe(i, n.value, e));
|
|
@@ -1408,14 +1420,14 @@ let __tla = (async () => {
|
|
|
1408
1420
|
return o instanceof Promise ? o.then((i) => (n.value = i, n)) : (n.value = o, n);
|
|
1409
1421
|
};
|
|
1410
1422
|
});
|
|
1411
|
-
function
|
|
1412
|
-
return new
|
|
1423
|
+
function ci(t) {
|
|
1424
|
+
return new li({
|
|
1413
1425
|
type: "transform",
|
|
1414
1426
|
transform: t
|
|
1415
1427
|
});
|
|
1416
1428
|
}
|
|
1417
1429
|
const Dn = v("ZodOptional", (t, e) => {
|
|
1418
|
-
|
|
1430
|
+
go.init(t, e), O.init(t, e), t.unwrap = () => t._zod.def.innerType;
|
|
1419
1431
|
});
|
|
1420
1432
|
function en(t) {
|
|
1421
1433
|
return new Dn({
|
|
@@ -1423,20 +1435,20 @@ let __tla = (async () => {
|
|
|
1423
1435
|
innerType: t
|
|
1424
1436
|
});
|
|
1425
1437
|
}
|
|
1426
|
-
const
|
|
1427
|
-
|
|
1438
|
+
const ui = v("ZodNullable", (t, e) => {
|
|
1439
|
+
yo.init(t, e), O.init(t, e), t.unwrap = () => t._zod.def.innerType;
|
|
1428
1440
|
});
|
|
1429
1441
|
function tn(t) {
|
|
1430
|
-
return new
|
|
1442
|
+
return new ui({
|
|
1431
1443
|
type: "nullable",
|
|
1432
1444
|
innerType: t
|
|
1433
1445
|
});
|
|
1434
1446
|
}
|
|
1435
|
-
const
|
|
1436
|
-
|
|
1447
|
+
const pi = v("ZodDefault", (t, e) => {
|
|
1448
|
+
_o.init(t, e), O.init(t, e), t.unwrap = () => t._zod.def.innerType, t.removeDefault = t.unwrap;
|
|
1437
1449
|
});
|
|
1438
|
-
function
|
|
1439
|
-
return new
|
|
1450
|
+
function hi(t, e) {
|
|
1451
|
+
return new pi({
|
|
1440
1452
|
type: "default",
|
|
1441
1453
|
innerType: t,
|
|
1442
1454
|
get defaultValue() {
|
|
@@ -1444,11 +1456,11 @@ let __tla = (async () => {
|
|
|
1444
1456
|
}
|
|
1445
1457
|
});
|
|
1446
1458
|
}
|
|
1447
|
-
const
|
|
1448
|
-
|
|
1459
|
+
const di = v("ZodPrefault", (t, e) => {
|
|
1460
|
+
bo.init(t, e), O.init(t, e), t.unwrap = () => t._zod.def.innerType;
|
|
1449
1461
|
});
|
|
1450
|
-
function
|
|
1451
|
-
return new
|
|
1462
|
+
function mi(t, e) {
|
|
1463
|
+
return new di({
|
|
1452
1464
|
type: "prefault",
|
|
1453
1465
|
innerType: t,
|
|
1454
1466
|
get defaultValue() {
|
|
@@ -1457,64 +1469,64 @@ let __tla = (async () => {
|
|
|
1457
1469
|
});
|
|
1458
1470
|
}
|
|
1459
1471
|
const Bn = v("ZodNonOptional", (t, e) => {
|
|
1460
|
-
|
|
1472
|
+
wo.init(t, e), O.init(t, e), t.unwrap = () => t._zod.def.innerType;
|
|
1461
1473
|
});
|
|
1462
|
-
function
|
|
1474
|
+
function fi(t, e) {
|
|
1463
1475
|
return new Bn({
|
|
1464
1476
|
type: "nonoptional",
|
|
1465
1477
|
innerType: t,
|
|
1466
1478
|
...D(e)
|
|
1467
1479
|
});
|
|
1468
1480
|
}
|
|
1469
|
-
const
|
|
1470
|
-
|
|
1481
|
+
const gi = v("ZodCatch", (t, e) => {
|
|
1482
|
+
vo.init(t, e), O.init(t, e), t.unwrap = () => t._zod.def.innerType, t.removeCatch = t.unwrap;
|
|
1471
1483
|
});
|
|
1472
|
-
function
|
|
1473
|
-
return new
|
|
1484
|
+
function yi(t, e) {
|
|
1485
|
+
return new gi({
|
|
1474
1486
|
type: "catch",
|
|
1475
1487
|
innerType: t,
|
|
1476
1488
|
catchValue: typeof e == "function" ? e : () => e
|
|
1477
1489
|
});
|
|
1478
1490
|
}
|
|
1479
|
-
const
|
|
1480
|
-
|
|
1491
|
+
const _i = v("ZodPipe", (t, e) => {
|
|
1492
|
+
So.init(t, e), O.init(t, e), t.in = e.in, t.out = e.out;
|
|
1481
1493
|
});
|
|
1482
1494
|
function nn(t, e) {
|
|
1483
|
-
return new
|
|
1495
|
+
return new _i({
|
|
1484
1496
|
type: "pipe",
|
|
1485
1497
|
in: t,
|
|
1486
1498
|
out: e
|
|
1487
1499
|
});
|
|
1488
1500
|
}
|
|
1489
|
-
const
|
|
1490
|
-
|
|
1501
|
+
const bi = v("ZodReadonly", (t, e) => {
|
|
1502
|
+
ko.init(t, e), O.init(t, e), t.unwrap = () => t._zod.def.innerType;
|
|
1491
1503
|
});
|
|
1492
|
-
function
|
|
1493
|
-
return new
|
|
1504
|
+
function wi(t) {
|
|
1505
|
+
return new bi({
|
|
1494
1506
|
type: "readonly",
|
|
1495
1507
|
innerType: t
|
|
1496
1508
|
});
|
|
1497
1509
|
}
|
|
1498
|
-
const
|
|
1499
|
-
|
|
1510
|
+
const vi = v("ZodCustom", (t, e) => {
|
|
1511
|
+
Co.init(t, e), O.init(t, e);
|
|
1500
1512
|
});
|
|
1501
|
-
function
|
|
1502
|
-
return
|
|
1513
|
+
function Si(t, e = {}) {
|
|
1514
|
+
return Io(vi, t, e);
|
|
1503
1515
|
}
|
|
1504
|
-
function
|
|
1505
|
-
return
|
|
1516
|
+
function ki(t) {
|
|
1517
|
+
return zo(t);
|
|
1506
1518
|
}
|
|
1507
1519
|
let Te = null;
|
|
1508
|
-
async function
|
|
1520
|
+
async function Ci() {
|
|
1509
1521
|
if (Te) return Te;
|
|
1510
1522
|
try {
|
|
1511
|
-
const t = await import("../vite_plugin_norg_parser-
|
|
1523
|
+
const t = await import("../vite_plugin_norg_parser-RX0Xxbfo.js");
|
|
1512
1524
|
return await t.default(), Te = t.parse_norg, Te;
|
|
1513
1525
|
} catch (t) {
|
|
1514
1526
|
throw new Error(`Failed to load norg parser: ${t}`);
|
|
1515
1527
|
}
|
|
1516
1528
|
}
|
|
1517
|
-
const
|
|
1529
|
+
const Ti = ({ html: t, metadata: e }) => {
|
|
1518
1530
|
const n = JSON.stringify(e ?? {}), r = JSON.stringify(t);
|
|
1519
1531
|
return [
|
|
1520
1532
|
`export const metadata = ${n};`,
|
|
@@ -1523,7 +1535,7 @@ let __tla = (async () => {
|
|
|
1523
1535
|
].join(`
|
|
1524
1536
|
`);
|
|
1525
1537
|
};
|
|
1526
|
-
function
|
|
1538
|
+
function Pi({ html: t, metadata: e }) {
|
|
1527
1539
|
const n = JSON.stringify(e ?? {});
|
|
1528
1540
|
return [
|
|
1529
1541
|
"<script>",
|
|
@@ -1536,7 +1548,7 @@ let __tla = (async () => {
|
|
|
1536
1548
|
].join(`
|
|
1537
1549
|
`);
|
|
1538
1550
|
}
|
|
1539
|
-
function
|
|
1551
|
+
function Ri({ html: t, metadata: e }) {
|
|
1540
1552
|
const n = JSON.stringify(e ?? {}), r = JSON.stringify(t);
|
|
1541
1553
|
return [
|
|
1542
1554
|
'import React from "react";',
|
|
@@ -1552,18 +1564,18 @@ let __tla = (async () => {
|
|
|
1552
1564
|
super(e), this.name = "ShikiError";
|
|
1553
1565
|
}
|
|
1554
1566
|
};
|
|
1555
|
-
function
|
|
1567
|
+
function Ai(t) {
|
|
1556
1568
|
return Nt(t);
|
|
1557
1569
|
}
|
|
1558
1570
|
function Nt(t) {
|
|
1559
|
-
return Array.isArray(t) ?
|
|
1571
|
+
return Array.isArray(t) ? Ni(t) : t instanceof RegExp ? t : typeof t == "object" ? Ei(t) : t;
|
|
1560
1572
|
}
|
|
1561
|
-
function
|
|
1573
|
+
function Ni(t) {
|
|
1562
1574
|
let e = [];
|
|
1563
1575
|
for (let n = 0, r = t.length; n < r; n++) e[n] = Nt(t[n]);
|
|
1564
1576
|
return e;
|
|
1565
1577
|
}
|
|
1566
|
-
function
|
|
1578
|
+
function Ei(t) {
|
|
1567
1579
|
let e = {};
|
|
1568
1580
|
for (let n in t) e[n] = Nt(t[n]);
|
|
1569
1581
|
return e;
|
|
@@ -1638,10 +1650,10 @@ let __tla = (async () => {
|
|
|
1638
1650
|
this._colorMap = t, this._defaults = e, this._root = n;
|
|
1639
1651
|
}
|
|
1640
1652
|
static createFromRawTheme(t, e) {
|
|
1641
|
-
return this.createFromParsedTheme(
|
|
1653
|
+
return this.createFromParsedTheme(Oi(t), e);
|
|
1642
1654
|
}
|
|
1643
1655
|
static createFromParsedTheme(t, e) {
|
|
1644
|
-
return
|
|
1656
|
+
return zi(t, e);
|
|
1645
1657
|
}
|
|
1646
1658
|
getColorMap() {
|
|
1647
1659
|
return this._colorMap.getColorMap();
|
|
@@ -1651,7 +1663,7 @@ let __tla = (async () => {
|
|
|
1651
1663
|
}
|
|
1652
1664
|
match(t) {
|
|
1653
1665
|
if (t === null) return this._defaults;
|
|
1654
|
-
const e = t.scopeName, r = this._cachedMatchRoot.get(e).find((o) =>
|
|
1666
|
+
const e = t.scopeName, r = this._cachedMatchRoot.get(e).find((o) => xi(t.parent, o.parentScopes));
|
|
1655
1667
|
return r ? new qn(r.fontStyle, r.foreground, r.background) : null;
|
|
1656
1668
|
}
|
|
1657
1669
|
}, tt = class Ee {
|
|
@@ -1689,7 +1701,7 @@ let __tla = (async () => {
|
|
|
1689
1701
|
return r === e ? n.reverse() : void 0;
|
|
1690
1702
|
}
|
|
1691
1703
|
};
|
|
1692
|
-
function
|
|
1704
|
+
function xi(t, e) {
|
|
1693
1705
|
if (e.length === 0) return true;
|
|
1694
1706
|
for (let n = 0; n < e.length; n++) {
|
|
1695
1707
|
let r = e[n], o = false;
|
|
@@ -1697,7 +1709,7 @@ let __tla = (async () => {
|
|
|
1697
1709
|
if (n === e.length - 1) return false;
|
|
1698
1710
|
r = e[++n], o = true;
|
|
1699
1711
|
}
|
|
1700
|
-
for (; t && !
|
|
1712
|
+
for (; t && !Li(t.scopeName, r); ) {
|
|
1701
1713
|
if (o) return false;
|
|
1702
1714
|
t = t.parent;
|
|
1703
1715
|
}
|
|
@@ -1706,7 +1718,7 @@ let __tla = (async () => {
|
|
|
1706
1718
|
}
|
|
1707
1719
|
return true;
|
|
1708
1720
|
}
|
|
1709
|
-
function
|
|
1721
|
+
function Li(t, e) {
|
|
1710
1722
|
return e === t || t.startsWith(e) && t[e.length] === ".";
|
|
1711
1723
|
}
|
|
1712
1724
|
var qn = class {
|
|
@@ -1714,7 +1726,7 @@ let __tla = (async () => {
|
|
|
1714
1726
|
this.fontStyle = t, this.foregroundId = e, this.backgroundId = n;
|
|
1715
1727
|
}
|
|
1716
1728
|
};
|
|
1717
|
-
function
|
|
1729
|
+
function Oi(t) {
|
|
1718
1730
|
if (!t) return [];
|
|
1719
1731
|
if (!t.settings || !Array.isArray(t.settings)) return [];
|
|
1720
1732
|
let e = t.settings, n = [], r = 0;
|
|
@@ -1732,7 +1744,7 @@ let __tla = (async () => {
|
|
|
1732
1744
|
if (typeof s.settings.fontStyle == "string") {
|
|
1733
1745
|
a = 0;
|
|
1734
1746
|
let p = s.settings.fontStyle.split(" ");
|
|
1735
|
-
for (let
|
|
1747
|
+
for (let h = 0, d = p.length; h < d; h++) switch (p[h]) {
|
|
1736
1748
|
case "italic":
|
|
1737
1749
|
a = a | 1;
|
|
1738
1750
|
break;
|
|
@@ -1751,19 +1763,19 @@ let __tla = (async () => {
|
|
|
1751
1763
|
typeof s.settings.foreground == "string" && rn(s.settings.foreground) && (c = s.settings.foreground);
|
|
1752
1764
|
let u = null;
|
|
1753
1765
|
typeof s.settings.background == "string" && rn(s.settings.background) && (u = s.settings.background);
|
|
1754
|
-
for (let p = 0,
|
|
1766
|
+
for (let p = 0, h = l.length; p < h; p++) {
|
|
1755
1767
|
let m = l[p].trim().split(" "), w = m[m.length - 1], _ = null;
|
|
1756
|
-
m.length > 1 && (_ = m.slice(0, m.length - 1), _.reverse()), n[r++] = new
|
|
1768
|
+
m.length > 1 && (_ = m.slice(0, m.length - 1), _.reverse()), n[r++] = new Ii(w, _, o, a, c, u);
|
|
1757
1769
|
}
|
|
1758
1770
|
}
|
|
1759
1771
|
return n;
|
|
1760
1772
|
}
|
|
1761
|
-
var
|
|
1773
|
+
var Ii = class {
|
|
1762
1774
|
constructor(t, e, n, r, o, i) {
|
|
1763
1775
|
this.scope = t, this.parentScopes = e, this.index = n, this.fontStyle = r, this.foreground = o, this.background = i;
|
|
1764
1776
|
}
|
|
1765
1777
|
}, z = ((t) => (t[t.NotSet = -1] = "NotSet", t[t.None = 0] = "None", t[t.Italic = 1] = "Italic", t[t.Bold = 2] = "Bold", t[t.Underline = 4] = "Underline", t[t.Strikethrough = 8] = "Strikethrough", t))(z || {});
|
|
1766
|
-
function
|
|
1778
|
+
function zi(t, e) {
|
|
1767
1779
|
t.sort((a, c) => {
|
|
1768
1780
|
let u = Fn(a.scope, c.scope);
|
|
1769
1781
|
return u !== 0 || (u = Hn(a.parentScopes, c.parentScopes), u !== 0) ? u : a.index - c.index;
|
|
@@ -1773,14 +1785,14 @@ let __tla = (async () => {
|
|
|
1773
1785
|
let a = t.shift();
|
|
1774
1786
|
a.fontStyle !== -1 && (n = a.fontStyle), a.foreground !== null && (r = a.foreground), a.background !== null && (o = a.background);
|
|
1775
1787
|
}
|
|
1776
|
-
let i = new
|
|
1788
|
+
let i = new Mi(e), s = new qn(n, i.getId(r), i.getId(o)), l = new ji(new pt(0, null, -1, 0, 0), []);
|
|
1777
1789
|
for (let a = 0, c = t.length; a < c; a++) {
|
|
1778
1790
|
let u = t[a];
|
|
1779
1791
|
l.insert(0, u.scope, u.parentScopes, u.fontStyle, i.getId(u.foreground), i.getId(u.background));
|
|
1780
1792
|
}
|
|
1781
1793
|
return new Ie(i, s, l);
|
|
1782
1794
|
}
|
|
1783
|
-
var
|
|
1795
|
+
var Mi = class {
|
|
1784
1796
|
constructor(t) {
|
|
1785
1797
|
__publicField(this, "_isFrozen");
|
|
1786
1798
|
__publicField(this, "_lastColorId");
|
|
@@ -1802,14 +1814,14 @@ let __tla = (async () => {
|
|
|
1802
1814
|
getColorMap() {
|
|
1803
1815
|
return this._id2color.slice(0);
|
|
1804
1816
|
}
|
|
1805
|
-
},
|
|
1817
|
+
}, $i = Object.freeze([]), pt = class Vn {
|
|
1806
1818
|
constructor(e, n, r, o, i) {
|
|
1807
1819
|
__publicField(this, "scopeDepth");
|
|
1808
1820
|
__publicField(this, "parentScopes");
|
|
1809
1821
|
__publicField(this, "fontStyle");
|
|
1810
1822
|
__publicField(this, "foreground");
|
|
1811
1823
|
__publicField(this, "background");
|
|
1812
|
-
this.scopeDepth = e, this.parentScopes = n ||
|
|
1824
|
+
this.scopeDepth = e, this.parentScopes = n || $i, this.fontStyle = r, this.foreground = o, this.background = i;
|
|
1813
1825
|
}
|
|
1814
1826
|
clone() {
|
|
1815
1827
|
return new Vn(this.scopeDepth, this.parentScopes, this.fontStyle, this.foreground, this.background);
|
|
@@ -1822,7 +1834,7 @@ let __tla = (async () => {
|
|
|
1822
1834
|
acceptOverwrite(e, n, r, o) {
|
|
1823
1835
|
this.scopeDepth > e ? console.log("how did this happen?") : this.scopeDepth = e, n !== -1 && (this.fontStyle = n), r !== 0 && (this.foreground = r), o !== 0 && (this.background = o);
|
|
1824
1836
|
}
|
|
1825
|
-
},
|
|
1837
|
+
}, ji = class ht {
|
|
1826
1838
|
constructor(e, n = [], r = {}) {
|
|
1827
1839
|
__publicField(this, "_rulesWithParentScopes");
|
|
1828
1840
|
this._mainRule = e, this._children = r, this._rulesWithParentScopes = n;
|
|
@@ -1869,7 +1881,7 @@ let __tla = (async () => {
|
|
|
1869
1881
|
}
|
|
1870
1882
|
r === -1 && (r = this._mainRule.fontStyle), o === 0 && (o = this._mainRule.foreground), i === 0 && (i = this._mainRule.background), this._rulesWithParentScopes.push(new pt(e, n, r, o, i));
|
|
1871
1883
|
}
|
|
1872
|
-
},
|
|
1884
|
+
}, ae = class B {
|
|
1873
1885
|
static toBinaryStr(e) {
|
|
1874
1886
|
return e.toString(2).padStart(32, "0");
|
|
1875
1887
|
}
|
|
@@ -1902,12 +1914,12 @@ let __tla = (async () => {
|
|
|
1902
1914
|
return (e & 4278190080) >>> 24;
|
|
1903
1915
|
}
|
|
1904
1916
|
static set(e, n, r, o, i, s, l) {
|
|
1905
|
-
let a = B.getLanguageId(e), c = B.getTokenType(e), u = B.containsBalancedBrackets(e) ? 1 : 0, p = B.getFontStyle(e),
|
|
1906
|
-
return n !== 0 && (a = n), r !== 8 && (c = r), o !== null && (u = o ? 1 : 0), i !== -1 && (p = i), s !== 0 && (
|
|
1917
|
+
let a = B.getLanguageId(e), c = B.getTokenType(e), u = B.containsBalancedBrackets(e) ? 1 : 0, p = B.getFontStyle(e), h = B.getForeground(e), d = B.getBackground(e);
|
|
1918
|
+
return n !== 0 && (a = n), r !== 8 && (c = r), o !== null && (u = o ? 1 : 0), i !== -1 && (p = i), s !== 0 && (h = s), l !== 0 && (d = l), (a << 0 | c << 8 | u << 10 | p << 11 | h << 15 | d << 24) >>> 0;
|
|
1907
1919
|
}
|
|
1908
1920
|
};
|
|
1909
1921
|
function ze(t, e) {
|
|
1910
|
-
const n = [], r =
|
|
1922
|
+
const n = [], r = Di(t);
|
|
1911
1923
|
let o = r.next();
|
|
1912
1924
|
for (; o !== null; ) {
|
|
1913
1925
|
let a = 0;
|
|
@@ -1973,7 +1985,7 @@ let __tla = (async () => {
|
|
|
1973
1985
|
function on(t) {
|
|
1974
1986
|
return !!t && !!t.match(/[\w\.:]+/);
|
|
1975
1987
|
}
|
|
1976
|
-
function
|
|
1988
|
+
function Di(t) {
|
|
1977
1989
|
let e = /([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g, n = e.exec(t);
|
|
1978
1990
|
return {
|
|
1979
1991
|
next: () => {
|
|
@@ -1993,14 +2005,14 @@ let __tla = (async () => {
|
|
|
1993
2005
|
toKey() {
|
|
1994
2006
|
return this.scopeName;
|
|
1995
2007
|
}
|
|
1996
|
-
},
|
|
2008
|
+
}, Bi = class {
|
|
1997
2009
|
constructor(t, e) {
|
|
1998
2010
|
this.scopeName = t, this.ruleName = e;
|
|
1999
2011
|
}
|
|
2000
2012
|
toKey() {
|
|
2001
2013
|
return `${this.scopeName}#${this.ruleName}`;
|
|
2002
2014
|
}
|
|
2003
|
-
},
|
|
2015
|
+
}, Gi = class {
|
|
2004
2016
|
constructor() {
|
|
2005
2017
|
__publicField(this, "_references", []);
|
|
2006
2018
|
__publicField(this, "_seenReferenceKeys", /* @__PURE__ */ new Set());
|
|
@@ -2013,7 +2025,7 @@ let __tla = (async () => {
|
|
|
2013
2025
|
const e = t.toKey();
|
|
2014
2026
|
this._seenReferenceKeys.has(e) || (this._seenReferenceKeys.add(e), this._references.push(t));
|
|
2015
2027
|
}
|
|
2016
|
-
},
|
|
2028
|
+
}, Ui = class {
|
|
2017
2029
|
constructor(t, e) {
|
|
2018
2030
|
__publicField(this, "seenFullScopeRequests", /* @__PURE__ */ new Set());
|
|
2019
2031
|
__publicField(this, "seenPartialScopeRequests", /* @__PURE__ */ new Set());
|
|
@@ -2025,8 +2037,8 @@ let __tla = (async () => {
|
|
|
2025
2037
|
processQueue() {
|
|
2026
2038
|
const t = this.Q;
|
|
2027
2039
|
this.Q = [];
|
|
2028
|
-
const e = new
|
|
2029
|
-
for (const n of t)
|
|
2040
|
+
const e = new Gi();
|
|
2041
|
+
for (const n of t) Fi(n, this.initialScopeName, this.repo, e);
|
|
2030
2042
|
for (const n of e.references) if (n instanceof ge) {
|
|
2031
2043
|
if (this.seenFullScopeRequests.has(n.scopeName)) continue;
|
|
2032
2044
|
this.seenFullScopeRequests.add(n.scopeName), this.Q.push(n);
|
|
@@ -2036,7 +2048,7 @@ let __tla = (async () => {
|
|
|
2036
2048
|
}
|
|
2037
2049
|
}
|
|
2038
2050
|
};
|
|
2039
|
-
function
|
|
2051
|
+
function Fi(t, e, n, r) {
|
|
2040
2052
|
const o = n.lookup(t.scopeName);
|
|
2041
2053
|
if (!o) {
|
|
2042
2054
|
if (t.scopeName === e) throw new Error(`No grammar provided for <${e}>`);
|
|
@@ -2109,47 +2121,47 @@ let __tla = (async () => {
|
|
|
2109
2121
|
repository: o
|
|
2110
2122
|
};
|
|
2111
2123
|
s.kind === 4 ? dt(s.ruleName, a, n) : xe(a, n);
|
|
2112
|
-
} else s.kind === 4 ? n.add(new
|
|
2124
|
+
} else s.kind === 4 ? n.add(new Bi(s.scopeName, s.ruleName)) : n.add(new ge(s.scopeName));
|
|
2113
2125
|
break;
|
|
2114
2126
|
}
|
|
2115
2127
|
}
|
|
2116
2128
|
}
|
|
2117
|
-
var
|
|
2129
|
+
var Hi = class {
|
|
2118
2130
|
constructor() {
|
|
2119
2131
|
__publicField(this, "kind", 0);
|
|
2120
2132
|
}
|
|
2121
|
-
},
|
|
2133
|
+
}, Wi = class {
|
|
2122
2134
|
constructor() {
|
|
2123
2135
|
__publicField(this, "kind", 1);
|
|
2124
2136
|
}
|
|
2125
|
-
},
|
|
2137
|
+
}, Zi = class {
|
|
2126
2138
|
constructor(t) {
|
|
2127
2139
|
__publicField(this, "kind", 2);
|
|
2128
2140
|
this.ruleName = t;
|
|
2129
2141
|
}
|
|
2130
|
-
},
|
|
2142
|
+
}, qi = class {
|
|
2131
2143
|
constructor(t) {
|
|
2132
2144
|
__publicField(this, "kind", 3);
|
|
2133
2145
|
this.scopeName = t;
|
|
2134
2146
|
}
|
|
2135
|
-
},
|
|
2147
|
+
}, Vi = class {
|
|
2136
2148
|
constructor(t, e) {
|
|
2137
2149
|
__publicField(this, "kind", 4);
|
|
2138
2150
|
this.scopeName = t, this.ruleName = e;
|
|
2139
2151
|
}
|
|
2140
2152
|
};
|
|
2141
2153
|
function Jn(t) {
|
|
2142
|
-
if (t === "$base") return new
|
|
2143
|
-
if (t === "$self") return new
|
|
2154
|
+
if (t === "$base") return new Hi();
|
|
2155
|
+
if (t === "$self") return new Wi();
|
|
2144
2156
|
const e = t.indexOf("#");
|
|
2145
|
-
if (e === -1) return new
|
|
2146
|
-
if (e === 0) return new
|
|
2157
|
+
if (e === -1) return new qi(t);
|
|
2158
|
+
if (e === 0) return new Zi(t.substring(1));
|
|
2147
2159
|
{
|
|
2148
2160
|
const n = t.substring(0, e), r = t.substring(e + 1);
|
|
2149
|
-
return new
|
|
2161
|
+
return new Vi(n, r);
|
|
2150
2162
|
}
|
|
2151
2163
|
}
|
|
2152
|
-
var
|
|
2164
|
+
var Ki = /\\(\d+)/, sn = /\\(\d+)/g, Ji = -1, Xn = -2;
|
|
2153
2165
|
var we = class {
|
|
2154
2166
|
constructor(t, e, n, r) {
|
|
2155
2167
|
__publicField(this, "$location");
|
|
@@ -2170,7 +2182,7 @@ let __tla = (async () => {
|
|
|
2170
2182
|
getContentName(t, e) {
|
|
2171
2183
|
return !this._contentNameIsCapturing || this._contentName === null ? this._contentName : Pe.replaceCaptures(this._contentName, t, e);
|
|
2172
2184
|
}
|
|
2173
|
-
},
|
|
2185
|
+
}, Xi = class extends we {
|
|
2174
2186
|
constructor(t, e, n, r, o) {
|
|
2175
2187
|
super(t, e, n, r);
|
|
2176
2188
|
__publicField(this, "retokenizeCapturedWithRuleId");
|
|
@@ -2187,7 +2199,7 @@ let __tla = (async () => {
|
|
|
2187
2199
|
compileAG(t, e, n, r) {
|
|
2188
2200
|
throw new Error("Not supported!");
|
|
2189
2201
|
}
|
|
2190
|
-
},
|
|
2202
|
+
}, Yi = class extends we {
|
|
2191
2203
|
constructor(t, e, n, r, o) {
|
|
2192
2204
|
super(t, e, n, null);
|
|
2193
2205
|
__publicField(this, "_match");
|
|
@@ -2332,11 +2344,11 @@ let __tla = (async () => {
|
|
|
2332
2344
|
}
|
|
2333
2345
|
}, Yn = class I {
|
|
2334
2346
|
static createCaptureRule(e, n, r, o, i) {
|
|
2335
|
-
return e.registerRule((s) => new
|
|
2347
|
+
return e.registerRule((s) => new Xi(n, s, r, o, i));
|
|
2336
2348
|
}
|
|
2337
2349
|
static getCompiledRuleId(e, n, r) {
|
|
2338
2350
|
return e.id || n.registerRule((o) => {
|
|
2339
|
-
if (e.id = o, e.match) return new
|
|
2351
|
+
if (e.id = o, e.match) return new Yi(e.$vscodeTextmateLocation, e.id, e.name, e.match, I._compileCaptures(e.captures, n, r));
|
|
2340
2352
|
if (typeof e.begin > "u") {
|
|
2341
2353
|
e.repository && (r = Gn({}, r, e.repository));
|
|
2342
2354
|
let i = e.patterns;
|
|
@@ -2386,11 +2398,11 @@ let __tla = (async () => {
|
|
|
2386
2398
|
break;
|
|
2387
2399
|
case 3:
|
|
2388
2400
|
case 4:
|
|
2389
|
-
const p = c.scopeName,
|
|
2390
|
-
if (
|
|
2391
|
-
let m =
|
|
2392
|
-
m && (a = I.getCompiledRuleId(m, n,
|
|
2393
|
-
} else a = I.getCompiledRuleId(
|
|
2401
|
+
const p = c.scopeName, h = c.kind === 4 ? c.ruleName : null, d = n.getExternalGrammar(p, r);
|
|
2402
|
+
if (d) if (h) {
|
|
2403
|
+
let m = d.repository[h];
|
|
2404
|
+
m && (a = I.getCompiledRuleId(m, n, d.repository));
|
|
2405
|
+
} else a = I.getCompiledRuleId(d.repository.$self, n, d.repository);
|
|
2394
2406
|
break;
|
|
2395
2407
|
}
|
|
2396
2408
|
} else a = I.getCompiledRuleId(l, n, r);
|
|
@@ -2422,7 +2434,7 @@ let __tla = (async () => {
|
|
|
2422
2434
|
}
|
|
2423
2435
|
this.hasAnchor = s, o === 0 ? this.source = e : (i.push(e.substring(o, r)), this.source = i.join(""));
|
|
2424
2436
|
} else this.hasAnchor = false, this.source = e;
|
|
2425
|
-
this.hasAnchor ? this._anchorCache = this._buildAnchorCache() : this._anchorCache = null, this.ruleId = n, typeof this.source == "string" ? this.hasBackReferences =
|
|
2437
|
+
this.hasAnchor ? this._anchorCache = this._buildAnchorCache() : this._anchorCache = null, this.ruleId = n, typeof this.source == "string" ? this.hasBackReferences = Ki.test(this.source) : this.hasBackReferences = false;
|
|
2426
2438
|
}
|
|
2427
2439
|
clone() {
|
|
2428
2440
|
return new Qn(this.source, this.ruleId);
|
|
@@ -2519,7 +2531,7 @@ let __tla = (async () => {
|
|
|
2519
2531
|
constructor(t, e) {
|
|
2520
2532
|
this.languageId = t, this.tokenType = e;
|
|
2521
2533
|
}
|
|
2522
|
-
},
|
|
2534
|
+
}, Qi = (_a2 = class {
|
|
2523
2535
|
constructor(e, n) {
|
|
2524
2536
|
__publicField(this, "_defaultAttributes");
|
|
2525
2537
|
__publicField(this, "_embeddedLanguagesMatcher");
|
|
@@ -2527,7 +2539,7 @@ let __tla = (async () => {
|
|
|
2527
2539
|
const n = this._scopeToLanguage(e), r = this._toStandardTokenType(e);
|
|
2528
2540
|
return new nt(n, r);
|
|
2529
2541
|
}));
|
|
2530
|
-
this._defaultAttributes = new nt(e, 8), this._embeddedLanguagesMatcher = new
|
|
2542
|
+
this._defaultAttributes = new nt(e, 8), this._embeddedLanguagesMatcher = new es(Object.entries(n || {}));
|
|
2531
2543
|
}
|
|
2532
2544
|
getDefaultAttributes() {
|
|
2533
2545
|
return this._defaultAttributes;
|
|
@@ -2553,7 +2565,7 @@ let __tla = (async () => {
|
|
|
2553
2565
|
}
|
|
2554
2566
|
throw new Error("Unexpected match for standard token type!");
|
|
2555
2567
|
}
|
|
2556
|
-
}, __publicField(_a2, "_NULL_SCOPE_METADATA", new nt(0, 0)), __publicField(_a2, "STANDARD_TOKEN_TYPE_REGEXP", /\b(comment|string|regex|meta\.embedded)\b/), _a2),
|
|
2568
|
+
}, __publicField(_a2, "_NULL_SCOPE_METADATA", new nt(0, 0)), __publicField(_a2, "STANDARD_TOKEN_TYPE_REGEXP", /\b(comment|string|regex|meta\.embedded)\b/), _a2), es = class {
|
|
2557
2569
|
constructor(t) {
|
|
2558
2570
|
__publicField(this, "values");
|
|
2559
2571
|
__publicField(this, "scopesRegExp");
|
|
@@ -2580,23 +2592,23 @@ let __tla = (async () => {
|
|
|
2580
2592
|
const a = e.content.length;
|
|
2581
2593
|
let c = false, u = -1;
|
|
2582
2594
|
if (s) {
|
|
2583
|
-
const
|
|
2584
|
-
o =
|
|
2595
|
+
const d = ts(t, e, n, r, o, i);
|
|
2596
|
+
o = d.stack, r = d.linePos, n = d.isFirstLine, u = d.anchorPosition;
|
|
2585
2597
|
}
|
|
2586
2598
|
const p = Date.now();
|
|
2587
2599
|
for (; !c; ) {
|
|
2588
2600
|
if (l !== 0 && Date.now() - p > l) return new cn(o, true);
|
|
2589
|
-
|
|
2601
|
+
h();
|
|
2590
2602
|
}
|
|
2591
2603
|
return new cn(o, false);
|
|
2592
|
-
function
|
|
2593
|
-
const
|
|
2594
|
-
if (!
|
|
2604
|
+
function h() {
|
|
2605
|
+
const d = ns(t, e, n, r, o, u);
|
|
2606
|
+
if (!d) {
|
|
2595
2607
|
i.produce(o, a), c = true;
|
|
2596
2608
|
return;
|
|
2597
2609
|
}
|
|
2598
|
-
const m =
|
|
2599
|
-
if (w ===
|
|
2610
|
+
const m = d.captureIndices, w = d.matchedRuleId, _ = m && m.length > 0 ? m[0].end > r : false;
|
|
2611
|
+
if (w === Ji) {
|
|
2600
2612
|
const y = o.getRule(t);
|
|
2601
2613
|
i.produce(o, m[0].start), o = o.withContentNameScopesList(o.nameScopesList), he(t, e, n, o, i, y.endCaptures, m), i.produce(o, m[0].end);
|
|
2602
2614
|
const g = o;
|
|
@@ -2611,16 +2623,16 @@ let __tla = (async () => {
|
|
|
2611
2623
|
if (o = o.push(w, r, u, m[0].end === a, null, k, k), y instanceof mt) {
|
|
2612
2624
|
const C = y;
|
|
2613
2625
|
he(t, e, n, o, i, C.beginCaptures, m), i.produce(o, m[0].end), u = m[0].end;
|
|
2614
|
-
const M = C.getContentName(e.content, m),
|
|
2615
|
-
if (o = o.withContentNameScopesList(
|
|
2626
|
+
const M = C.getContentName(e.content, m), q = k.pushAttributed(M, t);
|
|
2627
|
+
if (o = o.withContentNameScopesList(q), C.endHasBackReferences && (o = o.withEndRule(C.getEndWithResolvedBackReferences(e.content, m))), !_ && g.hasSameRuleAs(o)) {
|
|
2616
2628
|
o = o.pop(), i.produce(o, a), c = true;
|
|
2617
2629
|
return;
|
|
2618
2630
|
}
|
|
2619
2631
|
} else if (y instanceof $e) {
|
|
2620
2632
|
const C = y;
|
|
2621
2633
|
he(t, e, n, o, i, C.beginCaptures, m), i.produce(o, m[0].end), u = m[0].end;
|
|
2622
|
-
const M = C.getContentName(e.content, m),
|
|
2623
|
-
if (o = o.withContentNameScopesList(
|
|
2634
|
+
const M = C.getContentName(e.content, m), q = k.pushAttributed(M, t);
|
|
2635
|
+
if (o = o.withContentNameScopesList(q), C.whileHasBackReferences && (o = o.withEndRule(C.getWhileWithResolvedBackReferences(e.content, m))), !_ && g.hasSameRuleAs(o)) {
|
|
2624
2636
|
o = o.pop(), i.produce(o, a), c = true;
|
|
2625
2637
|
return;
|
|
2626
2638
|
}
|
|
@@ -2632,7 +2644,7 @@ let __tla = (async () => {
|
|
|
2632
2644
|
m[0].end > r && (r = m[0].end, n = false);
|
|
2633
2645
|
}
|
|
2634
2646
|
}
|
|
2635
|
-
function
|
|
2647
|
+
function ts(t, e, n, r, o, i) {
|
|
2636
2648
|
let s = o.beginRuleCapturedEOL ? 0 : -1;
|
|
2637
2649
|
const l = [];
|
|
2638
2650
|
for (let a = o; a; a = a.pop()) {
|
|
@@ -2643,7 +2655,7 @@ let __tla = (async () => {
|
|
|
2643
2655
|
});
|
|
2644
2656
|
}
|
|
2645
2657
|
for (let a = l.pop(); a; a = l.pop()) {
|
|
2646
|
-
const { ruleScanner: c, findOptions: u } =
|
|
2658
|
+
const { ruleScanner: c, findOptions: u } = is(a.rule, t, a.stack.endRule, n, r === s), p = c.findNextMatchSync(e, r, u);
|
|
2647
2659
|
if (p) {
|
|
2648
2660
|
if (p.ruleId !== Xn) {
|
|
2649
2661
|
o = a.stack.pop();
|
|
@@ -2662,27 +2674,27 @@ let __tla = (async () => {
|
|
|
2662
2674
|
isFirstLine: n
|
|
2663
2675
|
};
|
|
2664
2676
|
}
|
|
2665
|
-
function
|
|
2666
|
-
const s =
|
|
2677
|
+
function ns(t, e, n, r, o, i) {
|
|
2678
|
+
const s = rs(t, e, n, r, o, i), l = t.getInjections();
|
|
2667
2679
|
if (l.length === 0) return s;
|
|
2668
|
-
const a =
|
|
2680
|
+
const a = os(l, t, e, n, r, o, i);
|
|
2669
2681
|
if (!a) return s;
|
|
2670
2682
|
if (!s) return a;
|
|
2671
2683
|
const c = s.captureIndices[0].start, u = a.captureIndices[0].start;
|
|
2672
2684
|
return u < c || a.priorityMatch && u === c ? a : s;
|
|
2673
2685
|
}
|
|
2674
|
-
function
|
|
2686
|
+
function rs(t, e, n, r, o, i) {
|
|
2675
2687
|
const s = o.getRule(t), { ruleScanner: l, findOptions: a } = tr(s, t, o.endRule, n, r === i), c = l.findNextMatchSync(e, r, a);
|
|
2676
2688
|
return c ? {
|
|
2677
2689
|
captureIndices: c.captureIndices,
|
|
2678
2690
|
matchedRuleId: c.ruleId
|
|
2679
2691
|
} : null;
|
|
2680
2692
|
}
|
|
2681
|
-
function
|
|
2693
|
+
function os(t, e, n, r, o, i, s) {
|
|
2682
2694
|
let l = Number.MAX_VALUE, a = null, c, u = 0;
|
|
2683
2695
|
const p = i.contentNameScopesList.getScopeNames();
|
|
2684
|
-
for (let
|
|
2685
|
-
const m = t[
|
|
2696
|
+
for (let h = 0, d = t.length; h < d; h++) {
|
|
2697
|
+
const m = t[h];
|
|
2686
2698
|
if (!m.matcher(p)) continue;
|
|
2687
2699
|
const w = e.getRule(m.ruleId), { ruleScanner: _, findOptions: y } = tr(w, e, null, r, o === s), g = _.findNextMatchSync(n, o, y);
|
|
2688
2700
|
if (!g) continue;
|
|
@@ -2701,7 +2713,7 @@ let __tla = (async () => {
|
|
|
2701
2713
|
findOptions: 0
|
|
2702
2714
|
};
|
|
2703
2715
|
}
|
|
2704
|
-
function
|
|
2716
|
+
function is(t, e, n, r, o) {
|
|
2705
2717
|
return {
|
|
2706
2718
|
ruleScanner: t.compileWhileAG(e, n, r, o),
|
|
2707
2719
|
findOptions: 0
|
|
@@ -2711,34 +2723,34 @@ let __tla = (async () => {
|
|
|
2711
2723
|
if (i.length === 0) return;
|
|
2712
2724
|
const l = e.content, a = Math.min(i.length, s.length), c = [], u = s[0].end;
|
|
2713
2725
|
for (let p = 0; p < a; p++) {
|
|
2714
|
-
const
|
|
2715
|
-
if (
|
|
2716
|
-
const
|
|
2717
|
-
if (
|
|
2718
|
-
if (
|
|
2719
|
-
for (; c.length > 0 && c[c.length - 1].endPos <=
|
|
2720
|
-
if (c.length > 0 ? o.produceFromScopes(c[c.length - 1].scopes,
|
|
2721
|
-
const w =
|
|
2722
|
-
er(t, k, n &&
|
|
2726
|
+
const h = i[p];
|
|
2727
|
+
if (h === null) continue;
|
|
2728
|
+
const d = s[p];
|
|
2729
|
+
if (d.length === 0) continue;
|
|
2730
|
+
if (d.start > u) break;
|
|
2731
|
+
for (; c.length > 0 && c[c.length - 1].endPos <= d.start; ) o.produceFromScopes(c[c.length - 1].scopes, c[c.length - 1].endPos), c.pop();
|
|
2732
|
+
if (c.length > 0 ? o.produceFromScopes(c[c.length - 1].scopes, d.start) : o.produce(r, d.start), h.retokenizeCapturedWithRuleId) {
|
|
2733
|
+
const w = h.getName(l, s), _ = r.contentNameScopesList.pushAttributed(w, t), y = h.getContentName(l, s), g = _.pushAttributed(y, t), b = r.push(h.retokenizeCapturedWithRuleId, d.start, -1, false, null, _, g), k = t.createOnigString(l.substring(0, d.end));
|
|
2734
|
+
er(t, k, n && d.start === 0, d.start, b, o, false, 0), Kn(k);
|
|
2723
2735
|
continue;
|
|
2724
2736
|
}
|
|
2725
|
-
const m =
|
|
2737
|
+
const m = h.getName(l, s);
|
|
2726
2738
|
if (m !== null) {
|
|
2727
2739
|
const _ = (c.length > 0 ? c[c.length - 1].scopes : r.contentNameScopesList).pushAttributed(m, t);
|
|
2728
|
-
c.push(new
|
|
2740
|
+
c.push(new ss(_, d.end));
|
|
2729
2741
|
}
|
|
2730
2742
|
}
|
|
2731
2743
|
for (; c.length > 0; ) o.produceFromScopes(c[c.length - 1].scopes, c[c.length - 1].endPos), c.pop();
|
|
2732
2744
|
}
|
|
2733
|
-
var
|
|
2745
|
+
var ss = class {
|
|
2734
2746
|
constructor(t, e) {
|
|
2735
2747
|
__publicField(this, "scopes");
|
|
2736
2748
|
__publicField(this, "endPos");
|
|
2737
2749
|
this.scopes = t, this.endPos = e;
|
|
2738
2750
|
}
|
|
2739
2751
|
};
|
|
2740
|
-
function
|
|
2741
|
-
return new
|
|
2752
|
+
function as(t, e, n, r, o, i, s, l) {
|
|
2753
|
+
return new cs(t, e, n, r, o, i, s, l);
|
|
2742
2754
|
}
|
|
2743
2755
|
function un(t, e, n, r, o) {
|
|
2744
2756
|
const i = ze(e, je), s = Yn.getCompiledRuleId(n, r, o.repository);
|
|
@@ -2754,17 +2766,17 @@ let __tla = (async () => {
|
|
|
2754
2766
|
if (e.length < t.length) return false;
|
|
2755
2767
|
let n = 0;
|
|
2756
2768
|
return t.every((r) => {
|
|
2757
|
-
for (let o = n; o < e.length; o++) if (
|
|
2769
|
+
for (let o = n; o < e.length; o++) if (ls(e[o], r)) return n = o + 1, true;
|
|
2758
2770
|
return false;
|
|
2759
2771
|
});
|
|
2760
2772
|
}
|
|
2761
|
-
function
|
|
2773
|
+
function ls(t, e) {
|
|
2762
2774
|
if (!t) return false;
|
|
2763
2775
|
if (t === e) return true;
|
|
2764
2776
|
const n = e.length;
|
|
2765
2777
|
return t.length > n && t.substr(0, n) === e && t[n] === ".";
|
|
2766
2778
|
}
|
|
2767
|
-
var
|
|
2779
|
+
var cs = class {
|
|
2768
2780
|
constructor(t, e, n, r, o, i, s, l) {
|
|
2769
2781
|
__publicField(this, "_rootId");
|
|
2770
2782
|
__publicField(this, "_lastRuleId");
|
|
@@ -2775,7 +2787,7 @@ let __tla = (async () => {
|
|
|
2775
2787
|
__publicField(this, "_injections");
|
|
2776
2788
|
__publicField(this, "_basicScopeAttributesProvider");
|
|
2777
2789
|
__publicField(this, "_tokenTypeMatchers");
|
|
2778
|
-
if (this._rootScopeName = t, this.balancedBracketSelectors = i, this._onigLib = l, this._basicScopeAttributesProvider = new
|
|
2790
|
+
if (this._rootScopeName = t, this.balancedBracketSelectors = i, this._onigLib = l, this._basicScopeAttributesProvider = new Qi(n, r), this._rootId = -1, this._lastRuleId = 0, this._ruleId2desc = [
|
|
2779
2791
|
null
|
|
2780
2792
|
], this._includedGrammars = {}, this._grammarRepository = s, this._grammar = pn(e, null), this._injections = null, this._tokenTypeMatchers = [], o) for (const a of Object.keys(o)) {
|
|
2781
2793
|
const c = ze(a, je);
|
|
@@ -2857,13 +2869,13 @@ let __tla = (async () => {
|
|
|
2857
2869
|
let o;
|
|
2858
2870
|
if (!e || e === gt.NULL) {
|
|
2859
2871
|
o = true;
|
|
2860
|
-
const c = this._basicScopeAttributesProvider.getDefaultAttributes(), u = this.themeProvider.getDefaults(), p =
|
|
2861
|
-
let
|
|
2862
|
-
|
|
2872
|
+
const c = this._basicScopeAttributesProvider.getDefaultAttributes(), u = this.themeProvider.getDefaults(), p = ae.set(0, c.languageId, c.tokenType, null, u.fontStyle, u.foregroundId, u.backgroundId), h = this.getRule(this._rootId).getName(null, null);
|
|
2873
|
+
let d;
|
|
2874
|
+
h ? d = de.createRootAndLookUpScopeName(h, p, this) : d = de.createRoot("unknown", p), e = new gt(null, this._rootId, -1, -1, false, null, d, d);
|
|
2863
2875
|
} else o = false, e.reset();
|
|
2864
2876
|
t = t + `
|
|
2865
2877
|
`;
|
|
2866
|
-
const i = this.createOnigString(t), s = i.content.length, l = new
|
|
2878
|
+
const i = this.createOnigString(t), s = i.content.length, l = new ps(n, t, this._tokenTypeMatchers, this.balancedBracketSelectors), a = er(this, i, o, 0, e, l, true, r);
|
|
2867
2879
|
return Kn(i), {
|
|
2868
2880
|
lineLength: s,
|
|
2869
2881
|
lineTokens: l,
|
|
@@ -2873,7 +2885,7 @@ let __tla = (async () => {
|
|
|
2873
2885
|
}
|
|
2874
2886
|
};
|
|
2875
2887
|
function pn(t, e) {
|
|
2876
|
-
return t =
|
|
2888
|
+
return t = Ai(t), t.repository = t.repository || {}, t.repository.$self = {
|
|
2877
2889
|
$vscodeTextmateLocation: t.$vscodeTextmateLocation,
|
|
2878
2890
|
patterns: t.patterns,
|
|
2879
2891
|
name: t.scopeName
|
|
@@ -2913,7 +2925,7 @@ let __tla = (async () => {
|
|
|
2913
2925
|
}
|
|
2914
2926
|
static mergeAttributes(e, n, r) {
|
|
2915
2927
|
let o = -1, i = 0, s = 0;
|
|
2916
|
-
return r !== null && (o = r.fontStyle, i = r.foregroundId, s = r.backgroundId),
|
|
2928
|
+
return r !== null && (o = r.fontStyle, i = r.foregroundId, s = r.backgroundId), ae.set(e, n.languageId, n.tokenType, null, o, i, s);
|
|
2917
2929
|
}
|
|
2918
2930
|
pushAttributed(e, n) {
|
|
2919
2931
|
if (e === null) return this;
|
|
@@ -3024,7 +3036,7 @@ let __tla = (async () => {
|
|
|
3024
3036
|
const r = de.fromExtension((e == null ? void 0 : e.nameScopesList) ?? null, n.nameScopesList);
|
|
3025
3037
|
return new _b(e, n.ruleId, n.enterPos ?? -1, n.anchorPos ?? -1, n.beginRuleCapturedEOL, n.endRule, r, de.fromExtension(r, n.contentNameScopesList));
|
|
3026
3038
|
}
|
|
3027
|
-
}, __publicField(_b, "NULL", new _b(null, 0, 0, 0, false, null, null, null)), _b),
|
|
3039
|
+
}, __publicField(_b, "NULL", new _b(null, 0, 0, 0, false, null, null, null)), _b), us = class {
|
|
3028
3040
|
constructor(t, e) {
|
|
3029
3041
|
__publicField(this, "balancedBracketScopes");
|
|
3030
3042
|
__publicField(this, "unbalancedBracketScopes");
|
|
@@ -3042,7 +3054,7 @@ let __tla = (async () => {
|
|
|
3042
3054
|
for (const e of this.balancedBracketScopes) if (e(t)) return true;
|
|
3043
3055
|
return this.allowAny;
|
|
3044
3056
|
}
|
|
3045
|
-
},
|
|
3057
|
+
}, ps = class {
|
|
3046
3058
|
constructor(t, e, n, r) {
|
|
3047
3059
|
__publicField(this, "_emitBinaryTokens");
|
|
3048
3060
|
__publicField(this, "_lineText");
|
|
@@ -3062,10 +3074,10 @@ let __tla = (async () => {
|
|
|
3062
3074
|
let r = (t == null ? void 0 : t.tokenAttributes) ?? 0, o = false;
|
|
3063
3075
|
if (((_a3 = this.balancedBracketSelectors) == null ? void 0 : _a3.matchesAlways) && (o = true), this._tokenTypeOverrides.length > 0 || this.balancedBracketSelectors && !this.balancedBracketSelectors.matchesAlways && !this.balancedBracketSelectors.matchesNever) {
|
|
3064
3076
|
const i = (t == null ? void 0 : t.getScopeNames()) ?? [];
|
|
3065
|
-
for (const s of this._tokenTypeOverrides) s.matcher(i) && (r =
|
|
3077
|
+
for (const s of this._tokenTypeOverrides) s.matcher(i) && (r = ae.set(r, 0, s.type, null, -1, 0, 0));
|
|
3066
3078
|
this.balancedBracketSelectors && (o = this.balancedBracketSelectors.match(i));
|
|
3067
3079
|
}
|
|
3068
|
-
if (o && (r =
|
|
3080
|
+
if (o && (r = ae.set(r, 0, 8, o, -1, 0, 0)), this._binaryTokens.length > 0 && this._binaryTokens[this._binaryTokens.length - 1] === r) {
|
|
3069
3081
|
this._lastTokenEndIndex = e;
|
|
3070
3082
|
return;
|
|
3071
3083
|
}
|
|
@@ -3088,7 +3100,7 @@ let __tla = (async () => {
|
|
|
3088
3100
|
for (let r = 0, o = this._binaryTokens.length; r < o; r++) n[r] = this._binaryTokens[r];
|
|
3089
3101
|
return n;
|
|
3090
3102
|
}
|
|
3091
|
-
},
|
|
3103
|
+
}, hs = class {
|
|
3092
3104
|
constructor(t, e) {
|
|
3093
3105
|
__publicField(this, "_grammars", /* @__PURE__ */ new Map());
|
|
3094
3106
|
__publicField(this, "_rawGrammars", /* @__PURE__ */ new Map());
|
|
@@ -3124,16 +3136,16 @@ let __tla = (async () => {
|
|
|
3124
3136
|
if (!this._grammars.has(t)) {
|
|
3125
3137
|
let i = this._rawGrammars.get(t);
|
|
3126
3138
|
if (!i) return null;
|
|
3127
|
-
this._grammars.set(t,
|
|
3139
|
+
this._grammars.set(t, as(t, i, e, n, r, o, this, this._onigLib));
|
|
3128
3140
|
}
|
|
3129
3141
|
return this._grammars.get(t);
|
|
3130
3142
|
}
|
|
3131
|
-
},
|
|
3143
|
+
}, ds = class {
|
|
3132
3144
|
constructor(e) {
|
|
3133
3145
|
__publicField(this, "_options");
|
|
3134
3146
|
__publicField(this, "_syncRegistry");
|
|
3135
3147
|
__publicField(this, "_ensureGrammarCache");
|
|
3136
|
-
this._options = e, this._syncRegistry = new
|
|
3148
|
+
this._options = e, this._syncRegistry = new hs(Ie.createFromRawTheme(e.theme, e.colorMap), e.onigLib), this._ensureGrammarCache = /* @__PURE__ */ new Map();
|
|
3137
3149
|
}
|
|
3138
3150
|
dispose() {
|
|
3139
3151
|
this._syncRegistry.dispose();
|
|
@@ -3150,13 +3162,13 @@ let __tla = (async () => {
|
|
|
3150
3162
|
});
|
|
3151
3163
|
}
|
|
3152
3164
|
loadGrammarWithConfiguration(e, n, r) {
|
|
3153
|
-
return this._loadGrammar(e, n, r.embeddedLanguages, r.tokenTypes, new
|
|
3165
|
+
return this._loadGrammar(e, n, r.embeddedLanguages, r.tokenTypes, new us(r.balancedBracketSelectors || [], r.unbalancedBracketSelectors || []));
|
|
3154
3166
|
}
|
|
3155
3167
|
loadGrammar(e) {
|
|
3156
3168
|
return this._loadGrammar(e, 0, null, null, null);
|
|
3157
3169
|
}
|
|
3158
3170
|
_loadGrammar(e, n, r, o, i) {
|
|
3159
|
-
const s = new
|
|
3171
|
+
const s = new Ui(this._syncRegistry, e);
|
|
3160
3172
|
for (; s.Q.length > 0; ) s.Q.map((l) => this._loadSingleGrammar(l.scopeName)), s.processQueue();
|
|
3161
3173
|
return this._grammarForScopeName(e, n, r, o, i);
|
|
3162
3174
|
}
|
|
@@ -3177,7 +3189,7 @@ let __tla = (async () => {
|
|
|
3177
3189
|
return this._syncRegistry.grammarForScopeName(e, n, r, o, i);
|
|
3178
3190
|
}
|
|
3179
3191
|
}, yt = gt.NULL;
|
|
3180
|
-
const
|
|
3192
|
+
const ms = [
|
|
3181
3193
|
"area",
|
|
3182
3194
|
"base",
|
|
3183
3195
|
"basefont",
|
|
@@ -3232,17 +3244,17 @@ let __tla = (async () => {
|
|
|
3232
3244
|
$.prototype.property = "";
|
|
3233
3245
|
$.prototype.spaceSeparated = false;
|
|
3234
3246
|
$.prototype.space = void 0;
|
|
3235
|
-
let
|
|
3236
|
-
const S =
|
|
3237
|
-
function
|
|
3238
|
-
return 2 ** ++
|
|
3247
|
+
let fs = 0;
|
|
3248
|
+
const S = ee(), R = ee(), bt = ee(), f = ee(), T = ee(), ie = ee(), j = ee();
|
|
3249
|
+
function ee() {
|
|
3250
|
+
return 2 ** ++fs;
|
|
3239
3251
|
}
|
|
3240
3252
|
const wt = Object.freeze(Object.defineProperty({
|
|
3241
3253
|
__proto__: null,
|
|
3242
3254
|
boolean: S,
|
|
3243
3255
|
booleanish: R,
|
|
3244
3256
|
commaOrSpaceSeparated: j,
|
|
3245
|
-
commaSeparated:
|
|
3257
|
+
commaSeparated: ie,
|
|
3246
3258
|
number: f,
|
|
3247
3259
|
overloadedBoolean: bt,
|
|
3248
3260
|
spaceSeparated: T
|
|
@@ -3332,7 +3344,7 @@ let __tla = (async () => {
|
|
|
3332
3344
|
function ir(t, e) {
|
|
3333
3345
|
return or(t, e.toLowerCase());
|
|
3334
3346
|
}
|
|
3335
|
-
const
|
|
3347
|
+
const gs = ce({
|
|
3336
3348
|
attributes: {
|
|
3337
3349
|
acceptcharset: "accept-charset",
|
|
3338
3350
|
classname: "class",
|
|
@@ -3347,7 +3359,7 @@ let __tla = (async () => {
|
|
|
3347
3359
|
],
|
|
3348
3360
|
properties: {
|
|
3349
3361
|
abbr: null,
|
|
3350
|
-
accept:
|
|
3362
|
+
accept: ie,
|
|
3351
3363
|
acceptCharset: T,
|
|
3352
3364
|
accessKey: T,
|
|
3353
3365
|
action: null,
|
|
@@ -3374,7 +3386,7 @@ let __tla = (async () => {
|
|
|
3374
3386
|
contentEditable: R,
|
|
3375
3387
|
controls: S,
|
|
3376
3388
|
controlsList: T,
|
|
3377
|
-
coords: f |
|
|
3389
|
+
coords: f | ie,
|
|
3378
3390
|
crossOrigin: null,
|
|
3379
3391
|
data: null,
|
|
3380
3392
|
dateTime: null,
|
|
@@ -3641,7 +3653,7 @@ let __tla = (async () => {
|
|
|
3641
3653
|
},
|
|
3642
3654
|
space: "html",
|
|
3643
3655
|
transform: ir
|
|
3644
|
-
}),
|
|
3656
|
+
}), ys = ce({
|
|
3645
3657
|
attributes: {
|
|
3646
3658
|
accentHeight: "accent-height",
|
|
3647
3659
|
alignmentBaseline: "alignment-baseline",
|
|
@@ -3899,9 +3911,9 @@ let __tla = (async () => {
|
|
|
3899
3911
|
from: null,
|
|
3900
3912
|
fx: null,
|
|
3901
3913
|
fy: null,
|
|
3902
|
-
g1:
|
|
3903
|
-
g2:
|
|
3904
|
-
glyphName:
|
|
3914
|
+
g1: ie,
|
|
3915
|
+
g2: ie,
|
|
3916
|
+
glyphName: ie,
|
|
3905
3917
|
glyphOrientationHorizontal: null,
|
|
3906
3918
|
glyphOrientationVertical: null,
|
|
3907
3919
|
glyphRef: null,
|
|
@@ -4230,19 +4242,19 @@ let __tla = (async () => {
|
|
|
4230
4242
|
transform(t, e) {
|
|
4231
4243
|
return "xml:" + e.slice(3).toLowerCase();
|
|
4232
4244
|
}
|
|
4233
|
-
}),
|
|
4234
|
-
function
|
|
4245
|
+
}), _s = /[A-Z]/g, dn = /-[a-z]/g, bs = /^data[-\w.:]+$/i;
|
|
4246
|
+
function ws(t, e) {
|
|
4235
4247
|
const n = _t(e);
|
|
4236
4248
|
let r = e, o = $;
|
|
4237
4249
|
if (n in t.normal) return t.property[t.normal[n]];
|
|
4238
|
-
if (n.length > 4 && n.slice(0, 4) === "data" &&
|
|
4250
|
+
if (n.length > 4 && n.slice(0, 4) === "data" && bs.test(e)) {
|
|
4239
4251
|
if (e.charAt(4) === "-") {
|
|
4240
|
-
const i = e.slice(5).replace(dn,
|
|
4252
|
+
const i = e.slice(5).replace(dn, Ss);
|
|
4241
4253
|
r = "data" + i.charAt(0).toUpperCase() + i.slice(1);
|
|
4242
4254
|
} else {
|
|
4243
4255
|
const i = e.slice(4);
|
|
4244
4256
|
if (!dn.test(i)) {
|
|
4245
|
-
let s = i.replace(
|
|
4257
|
+
let s = i.replace(_s, vs);
|
|
4246
4258
|
s.charAt(0) !== "-" && (s = "-" + s), e = "data" + s;
|
|
4247
4259
|
}
|
|
4248
4260
|
}
|
|
@@ -4250,26 +4262,26 @@ let __tla = (async () => {
|
|
|
4250
4262
|
}
|
|
4251
4263
|
return new o(r, e);
|
|
4252
4264
|
}
|
|
4253
|
-
function
|
|
4265
|
+
function vs(t) {
|
|
4254
4266
|
return "-" + t.toLowerCase();
|
|
4255
4267
|
}
|
|
4256
|
-
function
|
|
4268
|
+
function Ss(t) {
|
|
4257
4269
|
return t.charAt(1).toUpperCase();
|
|
4258
4270
|
}
|
|
4259
|
-
const
|
|
4271
|
+
const ks = nr([
|
|
4260
4272
|
rr,
|
|
4261
|
-
|
|
4273
|
+
gs,
|
|
4262
4274
|
sr,
|
|
4263
4275
|
ar,
|
|
4264
4276
|
lr
|
|
4265
4277
|
], "html"), cr = nr([
|
|
4266
4278
|
rr,
|
|
4267
|
-
|
|
4279
|
+
ys,
|
|
4268
4280
|
sr,
|
|
4269
4281
|
ar,
|
|
4270
4282
|
lr
|
|
4271
4283
|
], "svg"), mn = {}.hasOwnProperty;
|
|
4272
|
-
function
|
|
4284
|
+
function Cs(t, e) {
|
|
4273
4285
|
const n = e || {};
|
|
4274
4286
|
function r(o, ...i) {
|
|
4275
4287
|
let s = r.invalid;
|
|
@@ -4282,10 +4294,10 @@ let __tla = (async () => {
|
|
|
4282
4294
|
}
|
|
4283
4295
|
return r.handlers = n.handlers || {}, r.invalid = n.invalid, r.unknown = n.unknown, r;
|
|
4284
4296
|
}
|
|
4285
|
-
const
|
|
4286
|
-
function
|
|
4287
|
-
if (t = t.replace(e.subset ?
|
|
4288
|
-
return t.replace(
|
|
4297
|
+
const Ts = /["&'<>`]/g, Ps = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, Rs = /[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g, As = /[|\\{}()[\]^$+*?.]/g, fn = /* @__PURE__ */ new WeakMap();
|
|
4298
|
+
function Ns(t, e) {
|
|
4299
|
+
if (t = t.replace(e.subset ? Es(e.subset) : Ts, r), e.subset || e.escapeOnly) return t;
|
|
4300
|
+
return t.replace(Ps, n).replace(Rs, r);
|
|
4289
4301
|
function n(o, i, s) {
|
|
4290
4302
|
return e.format((o.charCodeAt(0) - 55296) * 1024 + o.charCodeAt(1) - 56320 + 65536, s.charCodeAt(i + 2), e);
|
|
4291
4303
|
}
|
|
@@ -4293,27 +4305,27 @@ let __tla = (async () => {
|
|
|
4293
4305
|
return e.format(o.charCodeAt(0), s.charCodeAt(i + 1), e);
|
|
4294
4306
|
}
|
|
4295
4307
|
}
|
|
4296
|
-
function
|
|
4308
|
+
function Es(t) {
|
|
4297
4309
|
let e = fn.get(t);
|
|
4298
|
-
return e || (e =
|
|
4310
|
+
return e || (e = xs(t), fn.set(t, e)), e;
|
|
4299
4311
|
}
|
|
4300
|
-
function
|
|
4312
|
+
function xs(t) {
|
|
4301
4313
|
const e = [];
|
|
4302
4314
|
let n = -1;
|
|
4303
|
-
for (; ++n < t.length; ) e.push(t[n].replace(
|
|
4315
|
+
for (; ++n < t.length; ) e.push(t[n].replace(As, "\\$&"));
|
|
4304
4316
|
return new RegExp("(?:" + e.join("|") + ")", "g");
|
|
4305
4317
|
}
|
|
4306
|
-
const
|
|
4307
|
-
function
|
|
4318
|
+
const Ls = /[\dA-Fa-f]/;
|
|
4319
|
+
function Os(t, e, n) {
|
|
4308
4320
|
const r = "&#x" + t.toString(16).toUpperCase();
|
|
4309
|
-
return n && e && !
|
|
4321
|
+
return n && e && !Ls.test(String.fromCharCode(e)) ? r : r + ";";
|
|
4310
4322
|
}
|
|
4311
|
-
const
|
|
4312
|
-
function
|
|
4323
|
+
const Is = /\d/;
|
|
4324
|
+
function zs(t, e, n) {
|
|
4313
4325
|
const r = "&#" + String(t);
|
|
4314
|
-
return n && e && !
|
|
4326
|
+
return n && e && !Is.test(String.fromCharCode(e)) ? r : r + ";";
|
|
4315
4327
|
}
|
|
4316
|
-
const
|
|
4328
|
+
const Ms = [
|
|
4317
4329
|
"AElig",
|
|
4318
4330
|
"AMP",
|
|
4319
4331
|
"Aacute",
|
|
@@ -4673,7 +4685,7 @@ let __tla = (async () => {
|
|
|
4673
4685
|
lsaquo: "\u2039",
|
|
4674
4686
|
rsaquo: "\u203A",
|
|
4675
4687
|
euro: "\u20AC"
|
|
4676
|
-
},
|
|
4688
|
+
}, $s = [
|
|
4677
4689
|
"cent",
|
|
4678
4690
|
"copy",
|
|
4679
4691
|
"divide",
|
|
@@ -4685,45 +4697,45 @@ let __tla = (async () => {
|
|
|
4685
4697
|
], ur = {}.hasOwnProperty, vt = {};
|
|
4686
4698
|
let Re;
|
|
4687
4699
|
for (Re in ot) ur.call(ot, Re) && (vt[ot[Re]] = Re);
|
|
4688
|
-
const
|
|
4689
|
-
function
|
|
4700
|
+
const js = /[^\dA-Za-z]/;
|
|
4701
|
+
function Ds(t, e, n, r) {
|
|
4690
4702
|
const o = String.fromCharCode(t);
|
|
4691
4703
|
if (ur.call(vt, o)) {
|
|
4692
4704
|
const i = vt[o], s = "&" + i;
|
|
4693
|
-
return n &&
|
|
4705
|
+
return n && Ms.includes(i) && !$s.includes(i) && (!r || e && e !== 61 && js.test(String.fromCharCode(e))) ? s : s + ";";
|
|
4694
4706
|
}
|
|
4695
4707
|
return "";
|
|
4696
4708
|
}
|
|
4697
|
-
function
|
|
4698
|
-
let r =
|
|
4699
|
-
if ((n.useNamedReferences || n.useShortestReferences) && (o =
|
|
4700
|
-
const i =
|
|
4709
|
+
function Bs(t, e, n) {
|
|
4710
|
+
let r = Os(t, e, n.omitOptionalSemicolons), o;
|
|
4711
|
+
if ((n.useNamedReferences || n.useShortestReferences) && (o = Ds(t, e, n.omitOptionalSemicolons, n.attribute)), (n.useShortestReferences || !o) && n.useShortestReferences) {
|
|
4712
|
+
const i = zs(t, e, n.omitOptionalSemicolons);
|
|
4701
4713
|
i.length < r.length && (r = i);
|
|
4702
4714
|
}
|
|
4703
4715
|
return o && (!n.useShortestReferences || o.length < r.length) ? o : r;
|
|
4704
4716
|
}
|
|
4705
|
-
function
|
|
4706
|
-
return
|
|
4707
|
-
format:
|
|
4717
|
+
function se(t, e) {
|
|
4718
|
+
return Ns(t, Object.assign({
|
|
4719
|
+
format: Bs
|
|
4708
4720
|
}, e));
|
|
4709
4721
|
}
|
|
4710
|
-
const
|
|
4722
|
+
const Gs = /^>|^->|<!--|-->|--!>|<!-$/g, Us = [
|
|
4711
4723
|
">"
|
|
4712
|
-
],
|
|
4724
|
+
], Fs = [
|
|
4713
4725
|
"<",
|
|
4714
4726
|
">"
|
|
4715
4727
|
];
|
|
4716
|
-
function
|
|
4717
|
-
return r.settings.bogusComments ? "<?" +
|
|
4718
|
-
subset:
|
|
4719
|
-
})) + ">" : "<!--" + t.value.replace(
|
|
4728
|
+
function Hs(t, e, n, r) {
|
|
4729
|
+
return r.settings.bogusComments ? "<?" + se(t.value, Object.assign({}, r.settings.characterReferences, {
|
|
4730
|
+
subset: Us
|
|
4731
|
+
})) + ">" : "<!--" + t.value.replace(Gs, o) + "-->";
|
|
4720
4732
|
function o(i) {
|
|
4721
|
-
return
|
|
4722
|
-
subset:
|
|
4733
|
+
return se(i, Object.assign({}, r.settings.characterReferences, {
|
|
4734
|
+
subset: Fs
|
|
4723
4735
|
}));
|
|
4724
4736
|
}
|
|
4725
4737
|
}
|
|
4726
|
-
function
|
|
4738
|
+
function Ws(t, e, n, r) {
|
|
4727
4739
|
return "<!" + (r.settings.upperDoctype ? "DOCTYPE" : "doctype") + (r.settings.tightDoctype ? "" : " ") + "html>";
|
|
4728
4740
|
}
|
|
4729
4741
|
function gn(t, e) {
|
|
@@ -4733,86 +4745,86 @@ let __tla = (async () => {
|
|
|
4733
4745
|
for (; o !== -1; ) r++, o = n.indexOf(e, o + e.length);
|
|
4734
4746
|
return r;
|
|
4735
4747
|
}
|
|
4736
|
-
function
|
|
4748
|
+
function Zs(t, e) {
|
|
4737
4749
|
const n = e || {};
|
|
4738
4750
|
return (t[t.length - 1] === "" ? [
|
|
4739
4751
|
...t,
|
|
4740
4752
|
""
|
|
4741
4753
|
] : t).join((n.padRight ? " " : "") + "," + (n.padLeft === false ? "" : " ")).trim();
|
|
4742
4754
|
}
|
|
4743
|
-
function
|
|
4755
|
+
function qs(t) {
|
|
4744
4756
|
return t.join(" ").trim();
|
|
4745
4757
|
}
|
|
4746
|
-
const
|
|
4758
|
+
const Vs = /[ \t\n\f\r]/g;
|
|
4747
4759
|
function xt(t) {
|
|
4748
4760
|
return typeof t == "object" ? t.type === "text" ? yn(t.value) : false : yn(t);
|
|
4749
4761
|
}
|
|
4750
4762
|
function yn(t) {
|
|
4751
|
-
return t.replace(
|
|
4763
|
+
return t.replace(Vs, "") === "";
|
|
4752
4764
|
}
|
|
4753
|
-
const x = hr(1), pr = hr(-1),
|
|
4765
|
+
const x = hr(1), pr = hr(-1), Ks = [];
|
|
4754
4766
|
function hr(t) {
|
|
4755
4767
|
return e;
|
|
4756
4768
|
function e(n, r, o) {
|
|
4757
|
-
const i = n ? n.children :
|
|
4769
|
+
const i = n ? n.children : Ks;
|
|
4758
4770
|
let s = (r || 0) + t, l = i[s];
|
|
4759
4771
|
if (!o) for (; l && xt(l); ) s += t, l = i[s];
|
|
4760
4772
|
return l;
|
|
4761
4773
|
}
|
|
4762
4774
|
}
|
|
4763
|
-
const
|
|
4775
|
+
const Js = {}.hasOwnProperty;
|
|
4764
4776
|
function dr(t) {
|
|
4765
4777
|
return e;
|
|
4766
4778
|
function e(n, r, o) {
|
|
4767
|
-
return
|
|
4779
|
+
return Js.call(t, n.tagName) && t[n.tagName](n, r, o);
|
|
4768
4780
|
}
|
|
4769
4781
|
}
|
|
4770
4782
|
const Lt = dr({
|
|
4771
|
-
body:
|
|
4783
|
+
body: Ys,
|
|
4772
4784
|
caption: it,
|
|
4773
4785
|
colgroup: it,
|
|
4774
|
-
dd:
|
|
4775
|
-
dt:
|
|
4786
|
+
dd: na,
|
|
4787
|
+
dt: ta,
|
|
4776
4788
|
head: it,
|
|
4777
|
-
html:
|
|
4778
|
-
li:
|
|
4779
|
-
optgroup:
|
|
4780
|
-
option:
|
|
4781
|
-
p:
|
|
4789
|
+
html: Xs,
|
|
4790
|
+
li: ea,
|
|
4791
|
+
optgroup: ra,
|
|
4792
|
+
option: oa,
|
|
4793
|
+
p: Qs,
|
|
4782
4794
|
rp: _n,
|
|
4783
4795
|
rt: _n,
|
|
4784
|
-
tbody:
|
|
4796
|
+
tbody: sa,
|
|
4785
4797
|
td: bn,
|
|
4786
|
-
tfoot:
|
|
4798
|
+
tfoot: aa,
|
|
4787
4799
|
th: bn,
|
|
4788
|
-
thead:
|
|
4789
|
-
tr:
|
|
4800
|
+
thead: ia,
|
|
4801
|
+
tr: la
|
|
4790
4802
|
});
|
|
4791
4803
|
function it(t, e, n) {
|
|
4792
4804
|
const r = x(n, e, true);
|
|
4793
4805
|
return !r || r.type !== "comment" && !(r.type === "text" && xt(r.value.charAt(0)));
|
|
4794
4806
|
}
|
|
4795
|
-
function
|
|
4807
|
+
function Xs(t, e, n) {
|
|
4796
4808
|
const r = x(n, e);
|
|
4797
4809
|
return !r || r.type !== "comment";
|
|
4798
4810
|
}
|
|
4799
|
-
function
|
|
4811
|
+
function Ys(t, e, n) {
|
|
4800
4812
|
const r = x(n, e);
|
|
4801
4813
|
return !r || r.type !== "comment";
|
|
4802
4814
|
}
|
|
4803
|
-
function
|
|
4815
|
+
function Qs(t, e, n) {
|
|
4804
4816
|
const r = x(n, e);
|
|
4805
4817
|
return r ? r.type === "element" && (r.tagName === "address" || r.tagName === "article" || r.tagName === "aside" || r.tagName === "blockquote" || r.tagName === "details" || r.tagName === "div" || r.tagName === "dl" || r.tagName === "fieldset" || r.tagName === "figcaption" || r.tagName === "figure" || r.tagName === "footer" || r.tagName === "form" || r.tagName === "h1" || r.tagName === "h2" || r.tagName === "h3" || r.tagName === "h4" || r.tagName === "h5" || r.tagName === "h6" || r.tagName === "header" || r.tagName === "hgroup" || r.tagName === "hr" || r.tagName === "main" || r.tagName === "menu" || r.tagName === "nav" || r.tagName === "ol" || r.tagName === "p" || r.tagName === "pre" || r.tagName === "section" || r.tagName === "table" || r.tagName === "ul") : !n || !(n.type === "element" && (n.tagName === "a" || n.tagName === "audio" || n.tagName === "del" || n.tagName === "ins" || n.tagName === "map" || n.tagName === "noscript" || n.tagName === "video"));
|
|
4806
4818
|
}
|
|
4807
|
-
function
|
|
4819
|
+
function ea(t, e, n) {
|
|
4808
4820
|
const r = x(n, e);
|
|
4809
4821
|
return !r || r.type === "element" && r.tagName === "li";
|
|
4810
4822
|
}
|
|
4811
|
-
function
|
|
4823
|
+
function ta(t, e, n) {
|
|
4812
4824
|
const r = x(n, e);
|
|
4813
4825
|
return !!(r && r.type === "element" && (r.tagName === "dt" || r.tagName === "dd"));
|
|
4814
4826
|
}
|
|
4815
|
-
function
|
|
4827
|
+
function na(t, e, n) {
|
|
4816
4828
|
const r = x(n, e);
|
|
4817
4829
|
return !r || r.type === "element" && (r.tagName === "dt" || r.tagName === "dd");
|
|
4818
4830
|
}
|
|
@@ -4820,26 +4832,26 @@ let __tla = (async () => {
|
|
|
4820
4832
|
const r = x(n, e);
|
|
4821
4833
|
return !r || r.type === "element" && (r.tagName === "rp" || r.tagName === "rt");
|
|
4822
4834
|
}
|
|
4823
|
-
function
|
|
4835
|
+
function ra(t, e, n) {
|
|
4824
4836
|
const r = x(n, e);
|
|
4825
4837
|
return !r || r.type === "element" && r.tagName === "optgroup";
|
|
4826
4838
|
}
|
|
4827
|
-
function
|
|
4839
|
+
function oa(t, e, n) {
|
|
4828
4840
|
const r = x(n, e);
|
|
4829
4841
|
return !r || r.type === "element" && (r.tagName === "option" || r.tagName === "optgroup");
|
|
4830
4842
|
}
|
|
4831
|
-
function
|
|
4843
|
+
function ia(t, e, n) {
|
|
4832
4844
|
const r = x(n, e);
|
|
4833
4845
|
return !!(r && r.type === "element" && (r.tagName === "tbody" || r.tagName === "tfoot"));
|
|
4834
4846
|
}
|
|
4835
|
-
function
|
|
4847
|
+
function sa(t, e, n) {
|
|
4836
4848
|
const r = x(n, e);
|
|
4837
4849
|
return !r || r.type === "element" && (r.tagName === "tbody" || r.tagName === "tfoot");
|
|
4838
4850
|
}
|
|
4839
|
-
function
|
|
4851
|
+
function aa(t, e, n) {
|
|
4840
4852
|
return !x(n, e);
|
|
4841
4853
|
}
|
|
4842
|
-
function
|
|
4854
|
+
function la(t, e, n) {
|
|
4843
4855
|
const r = x(n, e);
|
|
4844
4856
|
return !r || r.type === "element" && r.tagName === "tr";
|
|
4845
4857
|
}
|
|
@@ -4847,18 +4859,18 @@ let __tla = (async () => {
|
|
|
4847
4859
|
const r = x(n, e);
|
|
4848
4860
|
return !r || r.type === "element" && (r.tagName === "td" || r.tagName === "th");
|
|
4849
4861
|
}
|
|
4850
|
-
const
|
|
4851
|
-
body:
|
|
4852
|
-
colgroup:
|
|
4853
|
-
head:
|
|
4854
|
-
html:
|
|
4855
|
-
tbody:
|
|
4862
|
+
const ca = dr({
|
|
4863
|
+
body: ha,
|
|
4864
|
+
colgroup: da,
|
|
4865
|
+
head: pa,
|
|
4866
|
+
html: ua,
|
|
4867
|
+
tbody: ma
|
|
4856
4868
|
});
|
|
4857
|
-
function
|
|
4869
|
+
function ua(t) {
|
|
4858
4870
|
const e = x(t, -1);
|
|
4859
4871
|
return !e || e.type !== "comment";
|
|
4860
4872
|
}
|
|
4861
|
-
function
|
|
4873
|
+
function pa(t) {
|
|
4862
4874
|
const e = /* @__PURE__ */ new Set();
|
|
4863
4875
|
for (const r of t.children) if (r.type === "element" && (r.tagName === "base" || r.tagName === "title")) {
|
|
4864
4876
|
if (e.has(r.tagName)) return false;
|
|
@@ -4867,15 +4879,15 @@ let __tla = (async () => {
|
|
|
4867
4879
|
const n = t.children[0];
|
|
4868
4880
|
return !n || n.type === "element";
|
|
4869
4881
|
}
|
|
4870
|
-
function
|
|
4882
|
+
function ha(t) {
|
|
4871
4883
|
const e = x(t, -1, true);
|
|
4872
4884
|
return !e || e.type !== "comment" && !(e.type === "text" && xt(e.value.charAt(0))) && !(e.type === "element" && (e.tagName === "meta" || e.tagName === "link" || e.tagName === "script" || e.tagName === "style" || e.tagName === "template"));
|
|
4873
4885
|
}
|
|
4874
|
-
function
|
|
4886
|
+
function da(t, e, n) {
|
|
4875
4887
|
const r = pr(n, e), o = x(t, -1, true);
|
|
4876
4888
|
return n && r && r.type === "element" && r.tagName === "colgroup" && Lt(r, n.children.indexOf(r), n) ? false : !!(o && o.type === "element" && o.tagName === "col");
|
|
4877
4889
|
}
|
|
4878
|
-
function
|
|
4890
|
+
function ma(t, e, n) {
|
|
4879
4891
|
const r = pr(n, e), o = x(t, -1);
|
|
4880
4892
|
return n && r && r.type === "element" && (r.tagName === "thead" || r.tagName === "tbody") && Lt(r, n.children.indexOf(r), n) ? false : !!(o && o.type === "element" && o.tagName === "tr");
|
|
4881
4893
|
}
|
|
@@ -4929,21 +4941,21 @@ let __tla = (async () => {
|
|
|
4929
4941
|
]
|
|
4930
4942
|
]
|
|
4931
4943
|
};
|
|
4932
|
-
function
|
|
4944
|
+
function fa(t, e, n, r) {
|
|
4933
4945
|
const o = r.schema, i = o.space === "svg" ? false : r.settings.omitOptionalTags;
|
|
4934
4946
|
let s = o.space === "svg" ? r.settings.closeEmptyElements : r.settings.voids.includes(t.tagName.toLowerCase());
|
|
4935
4947
|
const l = [];
|
|
4936
4948
|
let a;
|
|
4937
4949
|
o.space === "html" && t.tagName === "svg" && (r.schema = cr);
|
|
4938
|
-
const c =
|
|
4939
|
-
return r.schema = o, u && (s = false), (c || !i || !
|
|
4950
|
+
const c = ga(r, t.properties), u = r.all(o.space === "html" && t.tagName === "template" ? t.content : t);
|
|
4951
|
+
return r.schema = o, u && (s = false), (c || !i || !ca(t, e, n)) && (l.push("<", t.tagName, c ? " " + c : ""), s && (o.space === "svg" || r.settings.closeSelfClosing) && (a = c.charAt(c.length - 1), (!r.settings.tightSelfClosing || a === "/" || a && a !== '"' && a !== "'") && l.push(" "), l.push("/")), l.push(">")), l.push(u), !s && (!i || !Lt(t, e, n)) && l.push("</" + t.tagName + ">"), l.join("");
|
|
4940
4952
|
}
|
|
4941
|
-
function
|
|
4953
|
+
function ga(t, e) {
|
|
4942
4954
|
const n = [];
|
|
4943
4955
|
let r = -1, o;
|
|
4944
4956
|
if (e) {
|
|
4945
4957
|
for (o in e) if (e[o] !== null && e[o] !== void 0) {
|
|
4946
|
-
const i =
|
|
4958
|
+
const i = ya(t, o, e[o]);
|
|
4947
4959
|
i && n.push(i);
|
|
4948
4960
|
}
|
|
4949
4961
|
}
|
|
@@ -4953,64 +4965,64 @@ let __tla = (async () => {
|
|
|
4953
4965
|
}
|
|
4954
4966
|
return n.join("");
|
|
4955
4967
|
}
|
|
4956
|
-
function
|
|
4957
|
-
const r =
|
|
4968
|
+
function ya(t, e, n) {
|
|
4969
|
+
const r = ws(t.schema, e), o = t.settings.allowParseErrors && t.schema.space === "html" ? 0 : 1, i = t.settings.allowDangerousCharacters ? 0 : 1;
|
|
4958
4970
|
let s = t.quote, l;
|
|
4959
4971
|
if (r.overloadedBoolean && (n === r.attribute || n === "") ? n = true : (r.boolean || r.overloadedBoolean) && (typeof n != "string" || n === r.attribute || n === "") && (n = !!n), n == null || n === false || typeof n == "number" && Number.isNaN(n)) return "";
|
|
4960
|
-
const a =
|
|
4972
|
+
const a = se(r.attribute, Object.assign({}, t.settings.characterReferences, {
|
|
4961
4973
|
subset: Ae.name[o][i]
|
|
4962
4974
|
}));
|
|
4963
|
-
return n === true || (n = Array.isArray(n) ? (r.commaSeparated ?
|
|
4975
|
+
return n === true || (n = Array.isArray(n) ? (r.commaSeparated ? Zs : qs)(n, {
|
|
4964
4976
|
padLeft: !t.settings.tightCommaSeparatedLists
|
|
4965
|
-
}) : String(n), t.settings.collapseEmptyAttributes && !n) ? a : (t.settings.preferUnquoted && (l =
|
|
4977
|
+
}) : String(n), t.settings.collapseEmptyAttributes && !n) ? a : (t.settings.preferUnquoted && (l = se(n, Object.assign({}, t.settings.characterReferences, {
|
|
4966
4978
|
attribute: true,
|
|
4967
4979
|
subset: Ae.unquoted[o][i]
|
|
4968
|
-
}))), l !== n && (t.settings.quoteSmart && gn(n, s) > gn(n, t.alternative) && (s = t.alternative), l = s +
|
|
4980
|
+
}))), l !== n && (t.settings.quoteSmart && gn(n, s) > gn(n, t.alternative) && (s = t.alternative), l = s + se(n, Object.assign({}, t.settings.characterReferences, {
|
|
4969
4981
|
subset: (s === "'" ? Ae.single : Ae.double)[o][i],
|
|
4970
4982
|
attribute: true
|
|
4971
4983
|
})) + s), a + (l && "=" + l));
|
|
4972
4984
|
}
|
|
4973
|
-
const
|
|
4985
|
+
const _a = [
|
|
4974
4986
|
"<",
|
|
4975
4987
|
"&"
|
|
4976
4988
|
];
|
|
4977
4989
|
function mr(t, e, n, r) {
|
|
4978
|
-
return n && n.type === "element" && (n.tagName === "script" || n.tagName === "style") ? t.value :
|
|
4979
|
-
subset:
|
|
4990
|
+
return n && n.type === "element" && (n.tagName === "script" || n.tagName === "style") ? t.value : se(t.value, Object.assign({}, r.settings.characterReferences, {
|
|
4991
|
+
subset: _a
|
|
4980
4992
|
}));
|
|
4981
4993
|
}
|
|
4982
|
-
function
|
|
4994
|
+
function ba(t, e, n, r) {
|
|
4983
4995
|
return r.settings.allowDangerousHtml ? t.value : mr(t, e, n, r);
|
|
4984
4996
|
}
|
|
4985
|
-
function
|
|
4997
|
+
function wa(t, e, n, r) {
|
|
4986
4998
|
return r.all(t);
|
|
4987
4999
|
}
|
|
4988
|
-
const
|
|
4989
|
-
invalid:
|
|
4990
|
-
unknown:
|
|
5000
|
+
const va = Cs("type", {
|
|
5001
|
+
invalid: Sa,
|
|
5002
|
+
unknown: ka,
|
|
4991
5003
|
handlers: {
|
|
4992
|
-
comment:
|
|
4993
|
-
doctype:
|
|
4994
|
-
element:
|
|
4995
|
-
raw:
|
|
4996
|
-
root:
|
|
5004
|
+
comment: Hs,
|
|
5005
|
+
doctype: Ws,
|
|
5006
|
+
element: fa,
|
|
5007
|
+
raw: ba,
|
|
5008
|
+
root: wa,
|
|
4997
5009
|
text: mr
|
|
4998
5010
|
}
|
|
4999
5011
|
});
|
|
5000
|
-
function
|
|
5012
|
+
function Sa(t) {
|
|
5001
5013
|
throw new Error("Expected node, not `" + t + "`");
|
|
5002
5014
|
}
|
|
5003
|
-
function
|
|
5015
|
+
function ka(t) {
|
|
5004
5016
|
const e = t;
|
|
5005
5017
|
throw new Error("Cannot compile unknown node `" + e.type + "`");
|
|
5006
5018
|
}
|
|
5007
|
-
const
|
|
5008
|
-
function
|
|
5009
|
-
const n = e ||
|
|
5019
|
+
const Ca = {}, Ta = {}, Pa = [];
|
|
5020
|
+
function Ra(t, e) {
|
|
5021
|
+
const n = e || Ca, r = n.quote || '"', o = r === '"' ? "'" : '"';
|
|
5010
5022
|
if (r !== '"' && r !== "'") throw new Error("Invalid quote `" + r + "`, expected `'` or `\"`");
|
|
5011
5023
|
return {
|
|
5012
|
-
one:
|
|
5013
|
-
all:
|
|
5024
|
+
one: Aa,
|
|
5025
|
+
all: Na,
|
|
5014
5026
|
settings: {
|
|
5015
5027
|
omitOptionalTags: n.omitOptionalTags || false,
|
|
5016
5028
|
allowParseErrors: n.allowParseErrors || false,
|
|
@@ -5025,12 +5037,12 @@ let __tla = (async () => {
|
|
|
5025
5037
|
tightSelfClosing: n.tightSelfClosing || false,
|
|
5026
5038
|
collapseEmptyAttributes: n.collapseEmptyAttributes || false,
|
|
5027
5039
|
allowDangerousHtml: n.allowDangerousHtml || false,
|
|
5028
|
-
voids: n.voids ||
|
|
5029
|
-
characterReferences: n.characterReferences ||
|
|
5040
|
+
voids: n.voids || ms,
|
|
5041
|
+
characterReferences: n.characterReferences || Ta,
|
|
5030
5042
|
closeSelfClosing: n.closeSelfClosing || false,
|
|
5031
5043
|
closeEmptyElements: n.closeEmptyElements || false
|
|
5032
5044
|
},
|
|
5033
|
-
schema: n.space === "svg" ? cr :
|
|
5045
|
+
schema: n.space === "svg" ? cr : ks,
|
|
5034
5046
|
quote: r,
|
|
5035
5047
|
alternative: o
|
|
5036
5048
|
}.one(Array.isArray(t) ? {
|
|
@@ -5038,11 +5050,11 @@ let __tla = (async () => {
|
|
|
5038
5050
|
children: t
|
|
5039
5051
|
} : t, void 0, void 0);
|
|
5040
5052
|
}
|
|
5041
|
-
function
|
|
5042
|
-
return
|
|
5053
|
+
function Aa(t, e, n) {
|
|
5054
|
+
return va(t, e, n, this);
|
|
5043
5055
|
}
|
|
5044
|
-
function
|
|
5045
|
-
const e = [], n = t && t.children ||
|
|
5056
|
+
function Na(t) {
|
|
5057
|
+
const e = [], n = t && t.children || Pa;
|
|
5046
5058
|
let r = -1;
|
|
5047
5059
|
for (; ++r < n.length; ) e[r] = this.one(n[r], r, t);
|
|
5048
5060
|
return e.join("");
|
|
@@ -5057,7 +5069,7 @@ let __tla = (async () => {
|
|
|
5057
5069
|
function W(t, e) {
|
|
5058
5070
|
return t && ((e == null ? void 0 : e[t == null ? void 0 : t.toLowerCase()]) || t);
|
|
5059
5071
|
}
|
|
5060
|
-
function
|
|
5072
|
+
function Ea(t) {
|
|
5061
5073
|
return Array.isArray(t) ? t : [
|
|
5062
5074
|
t
|
|
5063
5075
|
];
|
|
@@ -5104,7 +5116,7 @@ let __tla = (async () => {
|
|
|
5104
5116
|
}
|
|
5105
5117
|
return o;
|
|
5106
5118
|
}
|
|
5107
|
-
function
|
|
5119
|
+
function xa(t) {
|
|
5108
5120
|
const e = qe(t, true).map(([o]) => o);
|
|
5109
5121
|
function n(o) {
|
|
5110
5122
|
if (o === t.length) return {
|
|
@@ -5132,7 +5144,7 @@ let __tla = (async () => {
|
|
|
5132
5144
|
posToIndex: r
|
|
5133
5145
|
};
|
|
5134
5146
|
}
|
|
5135
|
-
function
|
|
5147
|
+
function La(t, e, n) {
|
|
5136
5148
|
const r = /* @__PURE__ */ new Set();
|
|
5137
5149
|
for (const i of t.matchAll(/lang=["']([\w-]+)["']/g)) r.add(i[1]);
|
|
5138
5150
|
for (const i of t.matchAll(/(?:```|~~~)([\w-]+)/g)) r.add(i[1]);
|
|
@@ -5141,11 +5153,11 @@ let __tla = (async () => {
|
|
|
5141
5153
|
const o = n.getBundledLanguages();
|
|
5142
5154
|
return Array.from(r).filter((i) => i && o[i]);
|
|
5143
5155
|
}
|
|
5144
|
-
const zt = "light-dark()",
|
|
5156
|
+
const zt = "light-dark()", Oa = [
|
|
5145
5157
|
"color",
|
|
5146
5158
|
"background-color"
|
|
5147
5159
|
];
|
|
5148
|
-
function
|
|
5160
|
+
function Ia(t, e) {
|
|
5149
5161
|
let n = 0;
|
|
5150
5162
|
const r = [];
|
|
5151
5163
|
for (const o of e) o > n && r.push({
|
|
@@ -5159,32 +5171,32 @@ let __tla = (async () => {
|
|
|
5159
5171
|
offset: t.offset + n
|
|
5160
5172
|
}), r;
|
|
5161
5173
|
}
|
|
5162
|
-
function
|
|
5174
|
+
function za(t, e) {
|
|
5163
5175
|
const n = Array.from(e instanceof Set ? e : new Set(e)).sort((r, o) => r - o);
|
|
5164
5176
|
return n.length ? t.map((r) => r.flatMap((o) => {
|
|
5165
5177
|
const i = n.filter((s) => o.offset < s && s < o.offset + o.content.length).map((s) => s - o.offset).sort((s, l) => s - l);
|
|
5166
|
-
return i.length ?
|
|
5178
|
+
return i.length ? Ia(o, i) : o;
|
|
5167
5179
|
})) : t;
|
|
5168
5180
|
}
|
|
5169
|
-
function
|
|
5181
|
+
function Ma(t, e, n, r, o = "css-vars") {
|
|
5170
5182
|
const i = {
|
|
5171
5183
|
content: t.content,
|
|
5172
5184
|
explanation: t.explanation,
|
|
5173
5185
|
offset: t.offset
|
|
5174
5186
|
}, s = e.map((u) => Be(t.variants[u])), l = new Set(s.flatMap((u) => Object.keys(u))), a = {}, c = (u, p) => {
|
|
5175
|
-
const
|
|
5176
|
-
return n + e[u] + (p === "color" ? "" :
|
|
5187
|
+
const h = p === "color" ? "" : p === "background-color" ? "-bg" : `-${p}`;
|
|
5188
|
+
return n + e[u] + (p === "color" ? "" : h);
|
|
5177
5189
|
};
|
|
5178
5190
|
return s.forEach((u, p) => {
|
|
5179
|
-
for (const
|
|
5180
|
-
const
|
|
5181
|
-
if (p === 0 && r &&
|
|
5191
|
+
for (const h of l) {
|
|
5192
|
+
const d = u[h] || "inherit";
|
|
5193
|
+
if (p === 0 && r && Oa.includes(h)) if (r === zt && s.length > 1) {
|
|
5182
5194
|
const m = e.findIndex((g) => g === "light"), w = e.findIndex((g) => g === "dark");
|
|
5183
5195
|
if (m === -1 || w === -1) throw new A('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');
|
|
5184
|
-
const _ = s[m][
|
|
5185
|
-
a[
|
|
5186
|
-
} else a[
|
|
5187
|
-
else o === "css-vars" && (a[c(p,
|
|
5196
|
+
const _ = s[m][h] || "inherit", y = s[w][h] || "inherit";
|
|
5197
|
+
a[h] = `light-dark(${_}, ${y})`, o === "css-vars" && (a[c(p, h)] = d);
|
|
5198
|
+
} else a[h] = d;
|
|
5199
|
+
else o === "css-vars" && (a[c(p, h)] = d);
|
|
5188
5200
|
}
|
|
5189
5201
|
}), i.htmlStyle = a, i;
|
|
5190
5202
|
}
|
|
@@ -5231,7 +5243,7 @@ let __tla = (async () => {
|
|
|
5231
5243
|
return this._stacks[this.theme];
|
|
5232
5244
|
}
|
|
5233
5245
|
static initial(e, n) {
|
|
5234
|
-
return new ue(Object.fromEntries(
|
|
5246
|
+
return new ue(Object.fromEntries(Ea(n).map((r) => [
|
|
5235
5247
|
r,
|
|
5236
5248
|
yt
|
|
5237
5249
|
])), e);
|
|
@@ -5240,7 +5252,7 @@ let __tla = (async () => {
|
|
|
5240
5252
|
return this._stacks[e];
|
|
5241
5253
|
}
|
|
5242
5254
|
getScopes(e = this.theme) {
|
|
5243
|
-
return
|
|
5255
|
+
return $a(this._stacks[e]);
|
|
5244
5256
|
}
|
|
5245
5257
|
toJSON() {
|
|
5246
5258
|
return {
|
|
@@ -5251,7 +5263,7 @@ let __tla = (async () => {
|
|
|
5251
5263
|
};
|
|
5252
5264
|
}
|
|
5253
5265
|
}
|
|
5254
|
-
function
|
|
5266
|
+
function $a(t) {
|
|
5255
5267
|
const e = [], n = /* @__PURE__ */ new Set();
|
|
5256
5268
|
function r(o) {
|
|
5257
5269
|
var _a3;
|
|
@@ -5262,11 +5274,11 @@ let __tla = (async () => {
|
|
|
5262
5274
|
}
|
|
5263
5275
|
return r(t), e;
|
|
5264
5276
|
}
|
|
5265
|
-
function
|
|
5277
|
+
function ja(t, e) {
|
|
5266
5278
|
if (!(t instanceof ue)) throw new A("Invalid grammar state");
|
|
5267
5279
|
return t.getInternalStack(e);
|
|
5268
5280
|
}
|
|
5269
|
-
function
|
|
5281
|
+
function Da() {
|
|
5270
5282
|
const t = /* @__PURE__ */ new WeakMap();
|
|
5271
5283
|
function e(n) {
|
|
5272
5284
|
if (!t.has(n.meta)) {
|
|
@@ -5289,12 +5301,12 @@ let __tla = (async () => {
|
|
|
5289
5301
|
};
|
|
5290
5302
|
}
|
|
5291
5303
|
};
|
|
5292
|
-
const o =
|
|
5304
|
+
const o = xa(n.source), i = (n.options.decorations || []).map((s) => ({
|
|
5293
5305
|
...s,
|
|
5294
5306
|
start: r(s.start),
|
|
5295
5307
|
end: r(s.end)
|
|
5296
5308
|
}));
|
|
5297
|
-
|
|
5309
|
+
Ba(i), t.set(n.meta, {
|
|
5298
5310
|
decorations: i,
|
|
5299
5311
|
converter: o,
|
|
5300
5312
|
source: n.source
|
|
@@ -5311,22 +5323,22 @@ let __tla = (async () => {
|
|
|
5311
5323
|
s.start.offset,
|
|
5312
5324
|
s.end.offset
|
|
5313
5325
|
]);
|
|
5314
|
-
return
|
|
5326
|
+
return za(n, o);
|
|
5315
5327
|
},
|
|
5316
5328
|
code(n) {
|
|
5317
5329
|
var _a3;
|
|
5318
5330
|
if (!((_a3 = this.options.decorations) == null ? void 0 : _a3.length)) return;
|
|
5319
5331
|
const r = e(this), o = Array.from(n.children).filter((u) => u.type === "element" && u.tagName === "span");
|
|
5320
5332
|
if (o.length !== r.converter.lines.length) throw new A(`Number of lines in code element (${o.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);
|
|
5321
|
-
function i(u, p,
|
|
5333
|
+
function i(u, p, h, d) {
|
|
5322
5334
|
const m = o[u];
|
|
5323
5335
|
let w = "", _ = -1, y = -1;
|
|
5324
|
-
if (p === 0 && (_ = 0),
|
|
5325
|
-
if (_ === -1) throw new A(`Failed to find start index for decoration ${JSON.stringify(
|
|
5326
|
-
if (y === -1) throw new A(`Failed to find end index for decoration ${JSON.stringify(
|
|
5336
|
+
if (p === 0 && (_ = 0), h === 0 && (y = 0), h === Number.POSITIVE_INFINITY && (y = m.children.length), _ === -1 || y === -1) for (let b = 0; b < m.children.length; b++) w += wr(m.children[b]), _ === -1 && w.length === p && (_ = b + 1), y === -1 && w.length === h && (y = b + 1);
|
|
5337
|
+
if (_ === -1) throw new A(`Failed to find start index for decoration ${JSON.stringify(d.start)}`);
|
|
5338
|
+
if (y === -1) throw new A(`Failed to find end index for decoration ${JSON.stringify(d.end)}`);
|
|
5327
5339
|
const g = m.children.slice(_, y);
|
|
5328
|
-
if (!
|
|
5329
|
-
else if (!
|
|
5340
|
+
if (!d.alwaysWrap && g.length === m.children.length) l(m, d, "line");
|
|
5341
|
+
else if (!d.alwaysWrap && g.length === 1 && g[0].type === "element") l(g[0], d, "token");
|
|
5330
5342
|
else {
|
|
5331
5343
|
const b = {
|
|
5332
5344
|
type: "element",
|
|
@@ -5334,36 +5346,36 @@ let __tla = (async () => {
|
|
|
5334
5346
|
properties: {},
|
|
5335
5347
|
children: g
|
|
5336
5348
|
};
|
|
5337
|
-
l(b,
|
|
5349
|
+
l(b, d, "wrapper"), m.children.splice(_, g.length, b);
|
|
5338
5350
|
}
|
|
5339
5351
|
}
|
|
5340
5352
|
function s(u, p) {
|
|
5341
5353
|
o[u] = l(o[u], p, "line");
|
|
5342
5354
|
}
|
|
5343
|
-
function l(u, p,
|
|
5355
|
+
function l(u, p, h) {
|
|
5344
5356
|
var _a4;
|
|
5345
|
-
const
|
|
5357
|
+
const d = p.properties || {}, m = p.transform || ((w) => w);
|
|
5346
5358
|
return u.tagName = p.tagName || "span", u.properties = {
|
|
5347
5359
|
...u.properties,
|
|
5348
|
-
...
|
|
5360
|
+
...d,
|
|
5349
5361
|
class: u.properties.class
|
|
5350
|
-
}, ((_a4 = p.properties) == null ? void 0 : _a4.class) && _r(u, p.properties.class), u = m(u,
|
|
5362
|
+
}, ((_a4 = p.properties) == null ? void 0 : _a4.class) && _r(u, p.properties.class), u = m(u, h) || u, u;
|
|
5351
5363
|
}
|
|
5352
5364
|
const a = [], c = r.decorations.sort((u, p) => p.start.offset - u.start.offset || u.end.offset - p.end.offset);
|
|
5353
5365
|
for (const u of c) {
|
|
5354
|
-
const { start: p, end:
|
|
5355
|
-
if (p.line ===
|
|
5356
|
-
else if (p.line <
|
|
5366
|
+
const { start: p, end: h } = u;
|
|
5367
|
+
if (p.line === h.line) i(p.line, p.character, h.character, u);
|
|
5368
|
+
else if (p.line < h.line) {
|
|
5357
5369
|
i(p.line, p.character, Number.POSITIVE_INFINITY, u);
|
|
5358
|
-
for (let
|
|
5359
|
-
i(
|
|
5370
|
+
for (let d = p.line + 1; d < h.line; d++) a.unshift(() => s(d, u));
|
|
5371
|
+
i(h.line, 0, h.character, u);
|
|
5360
5372
|
}
|
|
5361
5373
|
}
|
|
5362
5374
|
a.forEach((u) => u());
|
|
5363
5375
|
}
|
|
5364
5376
|
};
|
|
5365
5377
|
}
|
|
5366
|
-
function
|
|
5378
|
+
function Ba(t) {
|
|
5367
5379
|
for (let e = 0; e < t.length; e++) {
|
|
5368
5380
|
const n = t[e];
|
|
5369
5381
|
if (n.start.offset > n.end.offset) throw new A(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);
|
|
@@ -5379,19 +5391,19 @@ let __tla = (async () => {
|
|
|
5379
5391
|
function wr(t) {
|
|
5380
5392
|
return t.type === "text" ? t.value : t.type === "element" ? t.children.map(wr).join("") : "";
|
|
5381
5393
|
}
|
|
5382
|
-
const
|
|
5383
|
-
|
|
5394
|
+
const Ga = [
|
|
5395
|
+
Da()
|
|
5384
5396
|
];
|
|
5385
5397
|
function Ge(t) {
|
|
5386
|
-
const e =
|
|
5398
|
+
const e = Ua(t.transformers || []);
|
|
5387
5399
|
return [
|
|
5388
5400
|
...e.pre,
|
|
5389
5401
|
...e.normal,
|
|
5390
5402
|
...e.post,
|
|
5391
|
-
...
|
|
5403
|
+
...Ga
|
|
5392
5404
|
];
|
|
5393
5405
|
}
|
|
5394
|
-
function
|
|
5406
|
+
function Ua(t) {
|
|
5395
5407
|
const e = [], n = [], r = [];
|
|
5396
5408
|
for (const o of t) switch (o.enforce) {
|
|
5397
5409
|
case "pre":
|
|
@@ -5409,7 +5421,7 @@ let __tla = (async () => {
|
|
|
5409
5421
|
normal: r
|
|
5410
5422
|
};
|
|
5411
5423
|
}
|
|
5412
|
-
var
|
|
5424
|
+
var K = [
|
|
5413
5425
|
"black",
|
|
5414
5426
|
"red",
|
|
5415
5427
|
"green",
|
|
@@ -5435,7 +5447,7 @@ let __tla = (async () => {
|
|
|
5435
5447
|
8: "hidden",
|
|
5436
5448
|
9: "strikethrough"
|
|
5437
5449
|
};
|
|
5438
|
-
function
|
|
5450
|
+
function Fa(t, e) {
|
|
5439
5451
|
const n = t.indexOf("\x1B", e);
|
|
5440
5452
|
if (n !== -1 && t[n + 1] === "[") {
|
|
5441
5453
|
const r = t.indexOf("m", n);
|
|
@@ -5465,7 +5477,7 @@ let __tla = (async () => {
|
|
|
5465
5477
|
};
|
|
5466
5478
|
}
|
|
5467
5479
|
}
|
|
5468
|
-
function
|
|
5480
|
+
function Ha(t) {
|
|
5469
5481
|
const e = [];
|
|
5470
5482
|
for (; t.length > 0; ) {
|
|
5471
5483
|
const n = t.shift();
|
|
@@ -5491,7 +5503,7 @@ let __tla = (async () => {
|
|
|
5491
5503
|
type: "setForegroundColor",
|
|
5492
5504
|
value: {
|
|
5493
5505
|
type: "named",
|
|
5494
|
-
name:
|
|
5506
|
+
name: K[r - 30]
|
|
5495
5507
|
}
|
|
5496
5508
|
});
|
|
5497
5509
|
else if (r === 38) {
|
|
@@ -5507,7 +5519,7 @@ let __tla = (async () => {
|
|
|
5507
5519
|
type: "setBackgroundColor",
|
|
5508
5520
|
value: {
|
|
5509
5521
|
type: "named",
|
|
5510
|
-
name:
|
|
5522
|
+
name: K[r - 40]
|
|
5511
5523
|
}
|
|
5512
5524
|
});
|
|
5513
5525
|
else if (r === 48) {
|
|
@@ -5528,33 +5540,33 @@ let __tla = (async () => {
|
|
|
5528
5540
|
type: "setForegroundColor",
|
|
5529
5541
|
value: {
|
|
5530
5542
|
type: "named",
|
|
5531
|
-
name:
|
|
5543
|
+
name: K[r - 90 + 8]
|
|
5532
5544
|
}
|
|
5533
5545
|
}) : r >= 100 && r <= 107 && e.push({
|
|
5534
5546
|
type: "setBackgroundColor",
|
|
5535
5547
|
value: {
|
|
5536
5548
|
type: "named",
|
|
5537
|
-
name:
|
|
5549
|
+
name: K[r - 100 + 8]
|
|
5538
5550
|
}
|
|
5539
5551
|
});
|
|
5540
5552
|
}
|
|
5541
5553
|
return e;
|
|
5542
5554
|
}
|
|
5543
|
-
function
|
|
5555
|
+
function Wa() {
|
|
5544
5556
|
let t = null, e = null, n = /* @__PURE__ */ new Set();
|
|
5545
5557
|
return {
|
|
5546
5558
|
parse(r) {
|
|
5547
5559
|
const o = [];
|
|
5548
5560
|
let i = 0;
|
|
5549
5561
|
do {
|
|
5550
|
-
const s =
|
|
5562
|
+
const s = Fa(r, i), l = s.sequence ? r.substring(i, s.startPosition) : r.substring(i);
|
|
5551
5563
|
if (l.length > 0 && o.push({
|
|
5552
5564
|
value: l,
|
|
5553
5565
|
foreground: t,
|
|
5554
5566
|
background: e,
|
|
5555
5567
|
decorations: new Set(n)
|
|
5556
5568
|
}), s.sequence) {
|
|
5557
|
-
const a =
|
|
5569
|
+
const a = Ha(s.sequence);
|
|
5558
5570
|
for (const c of a) c.type === "resetAll" ? (t = null, e = null, n.clear()) : c.type === "resetForegroundColor" ? t = null : c.type === "resetBackgroundColor" ? e = null : c.type === "resetDecoration" && n.delete(c.value);
|
|
5559
5571
|
for (const c of a) c.type === "setForegroundColor" ? t = c.value : c.type === "setBackgroundColor" ? e = c.value : c.type === "setDecoration" && n.add(c.value);
|
|
5560
5572
|
}
|
|
@@ -5564,7 +5576,7 @@ let __tla = (async () => {
|
|
|
5564
5576
|
}
|
|
5565
5577
|
};
|
|
5566
5578
|
}
|
|
5567
|
-
var
|
|
5579
|
+
var Za = {
|
|
5568
5580
|
black: "#000000",
|
|
5569
5581
|
red: "#bb0000",
|
|
5570
5582
|
green: "#00bb00",
|
|
@@ -5582,7 +5594,7 @@ let __tla = (async () => {
|
|
|
5582
5594
|
brightCyan: "#55ffff",
|
|
5583
5595
|
brightWhite: "#ffffff"
|
|
5584
5596
|
};
|
|
5585
|
-
function
|
|
5597
|
+
function qa(t = Za) {
|
|
5586
5598
|
function e(l) {
|
|
5587
5599
|
return t[l];
|
|
5588
5600
|
}
|
|
@@ -5593,7 +5605,7 @@ let __tla = (async () => {
|
|
|
5593
5605
|
function o() {
|
|
5594
5606
|
if (r) return r;
|
|
5595
5607
|
r = [];
|
|
5596
|
-
for (let c = 0; c <
|
|
5608
|
+
for (let c = 0; c < K.length; c++) r.push(e(K[c]));
|
|
5597
5609
|
let l = [
|
|
5598
5610
|
0,
|
|
5599
5611
|
95,
|
|
@@ -5632,17 +5644,17 @@ let __tla = (async () => {
|
|
|
5632
5644
|
value: s
|
|
5633
5645
|
};
|
|
5634
5646
|
}
|
|
5635
|
-
function
|
|
5636
|
-
const r = De(t, n), o = qe(e), i =
|
|
5647
|
+
function Va(t, e, n) {
|
|
5648
|
+
const r = De(t, n), o = qe(e), i = qa(Object.fromEntries(K.map((l) => {
|
|
5637
5649
|
var _a3;
|
|
5638
5650
|
return [
|
|
5639
5651
|
l,
|
|
5640
5652
|
(_a3 = t.colors) == null ? void 0 : _a3[`terminal.ansi${l[0].toUpperCase()}${l.substring(1)}`]
|
|
5641
5653
|
];
|
|
5642
|
-
}))), s =
|
|
5654
|
+
}))), s = Wa();
|
|
5643
5655
|
return o.map((l) => s.parse(l[0]).map((a) => {
|
|
5644
5656
|
let c, u;
|
|
5645
|
-
a.decorations.has("reverse") ? (c = a.background ? i.value(a.background) : t.bg, u = a.foreground ? i.value(a.foreground) : t.fg) : (c = a.foreground ? i.value(a.foreground) : t.fg, u = a.background ? i.value(a.background) : void 0), c = W(c, r), u = W(u, r), a.decorations.has("dim") && (c =
|
|
5657
|
+
a.decorations.has("reverse") ? (c = a.background ? i.value(a.background) : t.bg, u = a.foreground ? i.value(a.foreground) : t.fg) : (c = a.foreground ? i.value(a.foreground) : t.fg, u = a.background ? i.value(a.background) : void 0), c = W(c, r), u = W(u, r), a.decorations.has("dim") && (c = Ka(c));
|
|
5646
5658
|
let p = z.None;
|
|
5647
5659
|
return a.decorations.has("bold") && (p |= z.Bold), a.decorations.has("italic") && (p |= z.Italic), a.decorations.has("underline") && (p |= z.Underline), a.decorations.has("strikethrough") && (p |= z.Strikethrough), {
|
|
5648
5660
|
content: a.value,
|
|
@@ -5653,7 +5665,7 @@ let __tla = (async () => {
|
|
|
5653
5665
|
};
|
|
5654
5666
|
}));
|
|
5655
5667
|
}
|
|
5656
|
-
function
|
|
5668
|
+
function Ka(t) {
|
|
5657
5669
|
const e = t.match(/#([0-9a-f]{3})([0-9a-f]{3})?([0-9a-f]{2})?/);
|
|
5658
5670
|
if (e) if (e[3]) {
|
|
5659
5671
|
const r = Math.round(Number.parseInt(e[3], 16) / 2).toString(16).padStart(2, "0");
|
|
@@ -5671,15 +5683,15 @@ let __tla = (async () => {
|
|
|
5671
5683
|
}
|
|
5672
5684
|
]);
|
|
5673
5685
|
const { theme: i, colorMap: s } = t.setTheme(o);
|
|
5674
|
-
if (r === "ansi") return
|
|
5686
|
+
if (r === "ansi") return Va(i, e, n);
|
|
5675
5687
|
const l = t.getLanguage(r);
|
|
5676
5688
|
if (n.grammarState) {
|
|
5677
5689
|
if (n.grammarState.lang !== l.name) throw new A(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${l.name}"`);
|
|
5678
5690
|
if (!n.grammarState.themes.includes(i.name)) throw new A(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`);
|
|
5679
5691
|
}
|
|
5680
|
-
return
|
|
5692
|
+
return Xa(e, l, i, s, n);
|
|
5681
5693
|
}
|
|
5682
|
-
function
|
|
5694
|
+
function Ja(...t) {
|
|
5683
5695
|
if (t.length === 2) return be(t[1]);
|
|
5684
5696
|
const [e, n, r = {}] = t, { lang: o = "text", theme: i = e.getLoadedThemes()[0] } = r;
|
|
5685
5697
|
if (Ot(o) || It(i)) throw new A("Plain language does not have grammar state");
|
|
@@ -5687,20 +5699,20 @@ let __tla = (async () => {
|
|
|
5687
5699
|
const { theme: s, colorMap: l } = e.setTheme(i), a = e.getLanguage(o);
|
|
5688
5700
|
return new ue(Ue(n, a, s, l, r).stateStack, a.name, s.name);
|
|
5689
5701
|
}
|
|
5690
|
-
function
|
|
5702
|
+
function Xa(t, e, n, r, o) {
|
|
5691
5703
|
const i = Ue(t, e, n, r, o), s = new ue(Ue(t, e, n, r, o).stateStack, e.name, n.name);
|
|
5692
5704
|
return Ve(i.tokens, s), i.tokens;
|
|
5693
5705
|
}
|
|
5694
5706
|
function Ue(t, e, n, r, o) {
|
|
5695
5707
|
const i = De(n, o), { tokenizeMaxLineLength: s = 0, tokenizeTimeLimit: l = 500 } = o, a = qe(t);
|
|
5696
|
-
let c = o.grammarState ?
|
|
5708
|
+
let c = o.grammarState ? ja(o.grammarState, n.name) ?? yt : o.grammarContextCode != null ? Ue(o.grammarContextCode, e, n, r, {
|
|
5697
5709
|
...o,
|
|
5698
5710
|
grammarState: void 0,
|
|
5699
5711
|
grammarContextCode: void 0
|
|
5700
5712
|
}).stateStack : yt, u = [];
|
|
5701
5713
|
const p = [];
|
|
5702
|
-
for (let
|
|
5703
|
-
const [m, w] = a[
|
|
5714
|
+
for (let h = 0, d = a.length; h < d; h++) {
|
|
5715
|
+
const [m, w] = a[h];
|
|
5704
5716
|
if (m === "") {
|
|
5705
5717
|
u = [], p.push([]);
|
|
5706
5718
|
continue;
|
|
@@ -5720,10 +5732,10 @@ let __tla = (async () => {
|
|
|
5720
5732
|
o.includeExplanation && (_ = e.tokenizeLine(m, c, l), y = _.tokens, g = 0);
|
|
5721
5733
|
const b = e.tokenizeLine2(m, c, l), k = b.tokens.length / 2;
|
|
5722
5734
|
for (let C = 0; C < k; C++) {
|
|
5723
|
-
const M = b.tokens[2 * C],
|
|
5724
|
-
if (M ===
|
|
5725
|
-
const Dt = b.tokens[2 * C + 1], Pr = W(r[
|
|
5726
|
-
content: m.substring(M,
|
|
5735
|
+
const M = b.tokens[2 * C], q = C + 1 < k ? b.tokens[2 * C + 2] : m.length;
|
|
5736
|
+
if (M === q) continue;
|
|
5737
|
+
const Dt = b.tokens[2 * C + 1], Pr = W(r[ae.getForeground(Dt)], i), Rr = ae.getFontStyle(Dt), Xe = {
|
|
5738
|
+
content: m.substring(M, q),
|
|
5727
5739
|
offset: w + M,
|
|
5728
5740
|
color: Pr,
|
|
5729
5741
|
fontStyle: Rr
|
|
@@ -5731,29 +5743,29 @@ let __tla = (async () => {
|
|
|
5731
5743
|
if (o.includeExplanation) {
|
|
5732
5744
|
const Bt = [];
|
|
5733
5745
|
if (o.includeExplanation !== "scopeName") for (const H of n.settings) {
|
|
5734
|
-
let
|
|
5746
|
+
let te;
|
|
5735
5747
|
switch (typeof H.scope) {
|
|
5736
5748
|
case "string":
|
|
5737
|
-
|
|
5749
|
+
te = H.scope.split(/,/).map((Ye) => Ye.trim());
|
|
5738
5750
|
break;
|
|
5739
5751
|
case "object":
|
|
5740
|
-
|
|
5752
|
+
te = H.scope;
|
|
5741
5753
|
break;
|
|
5742
5754
|
default:
|
|
5743
5755
|
continue;
|
|
5744
5756
|
}
|
|
5745
5757
|
Bt.push({
|
|
5746
5758
|
settings: H,
|
|
5747
|
-
selectors:
|
|
5759
|
+
selectors: te.map((Ye) => Ye.split(/ /))
|
|
5748
5760
|
});
|
|
5749
5761
|
}
|
|
5750
5762
|
Xe.explanation = [];
|
|
5751
5763
|
let Gt = 0;
|
|
5752
|
-
for (; M + Gt <
|
|
5753
|
-
const H = y[g],
|
|
5754
|
-
Gt +=
|
|
5755
|
-
content:
|
|
5756
|
-
scopes: o.includeExplanation === "scopeName" ?
|
|
5764
|
+
for (; M + Gt < q; ) {
|
|
5765
|
+
const H = y[g], te = m.substring(H.startIndex, H.endIndex);
|
|
5766
|
+
Gt += te.length, Xe.explanation.push({
|
|
5767
|
+
content: te,
|
|
5768
|
+
scopes: o.includeExplanation === "scopeName" ? Ya(H.scopes) : Qa(Bt, H.scopes)
|
|
5757
5769
|
}), g += 1;
|
|
5758
5770
|
}
|
|
5759
5771
|
}
|
|
@@ -5766,18 +5778,18 @@ let __tla = (async () => {
|
|
|
5766
5778
|
stateStack: c
|
|
5767
5779
|
};
|
|
5768
5780
|
}
|
|
5769
|
-
function
|
|
5781
|
+
function Ya(t) {
|
|
5770
5782
|
return t.map((e) => ({
|
|
5771
5783
|
scopeName: e
|
|
5772
5784
|
}));
|
|
5773
5785
|
}
|
|
5774
|
-
function
|
|
5786
|
+
function Qa(t, e) {
|
|
5775
5787
|
const n = [];
|
|
5776
5788
|
for (let r = 0, o = e.length; r < o; r++) {
|
|
5777
5789
|
const i = e[r];
|
|
5778
5790
|
n[r] = {
|
|
5779
5791
|
scopeName: i,
|
|
5780
|
-
themeMatches:
|
|
5792
|
+
themeMatches: tl(t, i, e.slice(0, r))
|
|
5781
5793
|
};
|
|
5782
5794
|
}
|
|
5783
5795
|
return n;
|
|
@@ -5785,15 +5797,15 @@ let __tla = (async () => {
|
|
|
5785
5797
|
function vn(t, e) {
|
|
5786
5798
|
return t === e || e.substring(0, t.length) === t && e[t.length] === ".";
|
|
5787
5799
|
}
|
|
5788
|
-
function
|
|
5800
|
+
function el(t, e, n) {
|
|
5789
5801
|
if (!vn(t[t.length - 1], e)) return false;
|
|
5790
5802
|
let r = t.length - 2, o = n.length - 1;
|
|
5791
5803
|
for (; r >= 0 && o >= 0; ) vn(t[r], n[o]) && (r -= 1), o -= 1;
|
|
5792
5804
|
return r === -1;
|
|
5793
5805
|
}
|
|
5794
|
-
function
|
|
5806
|
+
function tl(t, e, n) {
|
|
5795
5807
|
const r = [];
|
|
5796
|
-
for (const { selectors: o, settings: i } of t) for (const s of o) if (
|
|
5808
|
+
for (const { selectors: o, settings: i } of t) for (const s of o) if (el(s, e, n)) {
|
|
5797
5809
|
r.push(i);
|
|
5798
5810
|
break;
|
|
5799
5811
|
}
|
|
@@ -5813,16 +5825,16 @@ let __tla = (async () => {
|
|
|
5813
5825
|
state: u,
|
|
5814
5826
|
theme: p
|
|
5815
5827
|
};
|
|
5816
|
-
}), i =
|
|
5817
|
-
const
|
|
5828
|
+
}), i = nl(...o.map((a) => a.tokens)), s = i[0].map((a, c) => a.map((u, p) => {
|
|
5829
|
+
const h = {
|
|
5818
5830
|
content: u.content,
|
|
5819
5831
|
variants: {},
|
|
5820
5832
|
offset: u.offset
|
|
5821
5833
|
};
|
|
5822
|
-
return "includeExplanation" in n && n.includeExplanation && (
|
|
5823
|
-
const { content: w, explanation: _, offset: y, ...g } =
|
|
5824
|
-
|
|
5825
|
-
}),
|
|
5834
|
+
return "includeExplanation" in n && n.includeExplanation && (h.explanation = u.explanation), i.forEach((d, m) => {
|
|
5835
|
+
const { content: w, explanation: _, offset: y, ...g } = d[c][p];
|
|
5836
|
+
h.variants[r[m].color] = g;
|
|
5837
|
+
}), h;
|
|
5826
5838
|
})), l = o[0].state ? new ue(Object.fromEntries(o.map((a) => {
|
|
5827
5839
|
var _a3;
|
|
5828
5840
|
return [
|
|
@@ -5832,7 +5844,7 @@ let __tla = (async () => {
|
|
|
5832
5844
|
})), o[0].state.lang) : void 0;
|
|
5833
5845
|
return l && Ve(s, l), s;
|
|
5834
5846
|
}
|
|
5835
|
-
function
|
|
5847
|
+
function nl(...t) {
|
|
5836
5848
|
const e = t.map(() => []), n = t.length;
|
|
5837
5849
|
for (let r = 0; r < t[0].length; r++) {
|
|
5838
5850
|
const o = t.map((a) => a[r]), i = e.map(() => []);
|
|
@@ -5858,17 +5870,17 @@ let __tla = (async () => {
|
|
|
5858
5870
|
function Fe(t, e, n) {
|
|
5859
5871
|
let r, o, i, s, l, a;
|
|
5860
5872
|
if ("themes" in n) {
|
|
5861
|
-
const { defaultColor: c = "light", cssVariablePrefix: u = "--shiki-", colorsRendering: p = "css-vars" } = n,
|
|
5873
|
+
const { defaultColor: c = "light", cssVariablePrefix: u = "--shiki-", colorsRendering: p = "css-vars" } = n, h = Object.entries(n.themes).filter((y) => y[1]).map((y) => ({
|
|
5862
5874
|
color: y[0],
|
|
5863
5875
|
theme: y[1]
|
|
5864
5876
|
})).sort((y, g) => y.color === c ? -1 : g.color === c ? 1 : 0);
|
|
5865
|
-
if (
|
|
5866
|
-
const
|
|
5867
|
-
if (a = be(
|
|
5868
|
-
const m =
|
|
5869
|
-
i =
|
|
5870
|
-
const _ =
|
|
5871
|
-
o = Sn(
|
|
5877
|
+
if (h.length === 0) throw new A("`themes` option must not be empty");
|
|
5878
|
+
const d = vr(t, e, n);
|
|
5879
|
+
if (a = be(d), c && zt !== c && !h.find((y) => y.color === c)) throw new A(`\`themes\` option must contain the defaultColor key \`${c}\``);
|
|
5880
|
+
const m = h.map((y) => t.getTheme(y.theme)), w = h.map((y) => y.color);
|
|
5881
|
+
i = d.map((y) => y.map((g) => Ma(g, w, u, c, p))), a && Ve(i, a);
|
|
5882
|
+
const _ = h.map((y) => De(y.theme, n));
|
|
5883
|
+
o = Sn(h, m, _, u, c, "fg", p), r = Sn(h, m, _, u, c, "bg", p), s = `shiki-themes ${m.map((y) => y.name).join(" ")}`, l = c ? void 0 : [
|
|
5872
5884
|
o,
|
|
5873
5885
|
r
|
|
5874
5886
|
].join(";");
|
|
@@ -5892,10 +5904,10 @@ let __tla = (async () => {
|
|
|
5892
5904
|
const c = W(e[a][i], n[a]) || "inherit", u = `${r + l.color}${i === "bg" ? "-bg" : ""}:${c}`;
|
|
5893
5905
|
if (a === 0 && o) {
|
|
5894
5906
|
if (o === zt && t.length > 1) {
|
|
5895
|
-
const p = t.findIndex((w) => w.color === "light"),
|
|
5896
|
-
if (p === -1 ||
|
|
5897
|
-
const
|
|
5898
|
-
return `light-dark(${
|
|
5907
|
+
const p = t.findIndex((w) => w.color === "light"), h = t.findIndex((w) => w.color === "dark");
|
|
5908
|
+
if (p === -1 || h === -1) throw new A('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');
|
|
5909
|
+
const d = W(e[p][i], n[p]) || "inherit", m = W(e[h][i], n[h]) || "inherit";
|
|
5910
|
+
return `light-dark(${d}, ${m});${u}`;
|
|
5899
5911
|
}
|
|
5900
5912
|
return c;
|
|
5901
5913
|
}
|
|
@@ -5912,24 +5924,24 @@ let __tla = (async () => {
|
|
|
5912
5924
|
let o = e;
|
|
5913
5925
|
for (const m of Ge(n)) o = ((_a3 = m.preprocess) == null ? void 0 : _a3.call(r, o, n)) || o;
|
|
5914
5926
|
let { tokens: i, fg: s, bg: l, themeName: a, rootStyle: c, grammarState: u } = Fe(t, o, n);
|
|
5915
|
-
const { mergeWhitespaces: p = true, mergeSameStyleTokens:
|
|
5916
|
-
p === true ? i =
|
|
5917
|
-
const
|
|
5927
|
+
const { mergeWhitespaces: p = true, mergeSameStyleTokens: h = false } = n;
|
|
5928
|
+
p === true ? i = ol(i) : p === "never" && (i = il(i)), h && (i = sl(i));
|
|
5929
|
+
const d = {
|
|
5918
5930
|
...r,
|
|
5919
5931
|
get source() {
|
|
5920
5932
|
return o;
|
|
5921
5933
|
}
|
|
5922
5934
|
};
|
|
5923
|
-
for (const m of Ge(n)) i = ((_b2 = m.tokens) == null ? void 0 : _b2.call(
|
|
5924
|
-
return
|
|
5935
|
+
for (const m of Ge(n)) i = ((_b2 = m.tokens) == null ? void 0 : _b2.call(d, i)) || i;
|
|
5936
|
+
return rl(i, {
|
|
5925
5937
|
...n,
|
|
5926
5938
|
fg: s,
|
|
5927
5939
|
bg: l,
|
|
5928
5940
|
themeName: a,
|
|
5929
5941
|
rootStyle: c
|
|
5930
|
-
},
|
|
5942
|
+
}, d, u);
|
|
5931
5943
|
}
|
|
5932
|
-
function
|
|
5944
|
+
function rl(t, e, n, r = be(t)) {
|
|
5933
5945
|
var _a3, _b2, _c;
|
|
5934
5946
|
const o = Ge(e), i = [], s = {
|
|
5935
5947
|
type: "root",
|
|
@@ -5953,7 +5965,7 @@ let __tla = (async () => {
|
|
|
5953
5965
|
properties: {},
|
|
5954
5966
|
children: i
|
|
5955
5967
|
};
|
|
5956
|
-
const p = [],
|
|
5968
|
+
const p = [], h = {
|
|
5957
5969
|
...n,
|
|
5958
5970
|
structure: l,
|
|
5959
5971
|
addClassToHast: _r,
|
|
@@ -6015,24 +6027,24 @@ let __tla = (async () => {
|
|
|
6015
6027
|
};
|
|
6016
6028
|
const k = St(g.htmlStyle || Be(g));
|
|
6017
6029
|
k && (b.properties.style = k);
|
|
6018
|
-
for (const C of o) b = ((_a4 = C == null ? void 0 : C.span) == null ? void 0 : _a4.call(
|
|
6030
|
+
for (const C of o) b = ((_a4 = C == null ? void 0 : C.span) == null ? void 0 : _a4.call(h, b, w + 1, y, _, g)) || b;
|
|
6019
6031
|
l === "inline" ? s.children.push(b) : l === "classic" && _.children.push(b), y += g.content.length;
|
|
6020
6032
|
}
|
|
6021
6033
|
if (l === "classic") {
|
|
6022
|
-
for (const g of o) _ = ((_b3 = g == null ? void 0 : g.line) == null ? void 0 : _b3.call(
|
|
6034
|
+
for (const g of o) _ = ((_b3 = g == null ? void 0 : g.line) == null ? void 0 : _b3.call(h, _, w + 1)) || _;
|
|
6023
6035
|
p.push(_), i.push(_);
|
|
6024
6036
|
}
|
|
6025
6037
|
}), l === "classic") {
|
|
6026
|
-
for (const m of o) u = ((_a3 = m == null ? void 0 : m.code) == null ? void 0 : _a3.call(
|
|
6038
|
+
for (const m of o) u = ((_a3 = m == null ? void 0 : m.code) == null ? void 0 : _a3.call(h, u)) || u;
|
|
6027
6039
|
c.children.push(u);
|
|
6028
|
-
for (const m of o) c = ((_b2 = m == null ? void 0 : m.pre) == null ? void 0 : _b2.call(
|
|
6040
|
+
for (const m of o) c = ((_b2 = m == null ? void 0 : m.pre) == null ? void 0 : _b2.call(h, c)) || c;
|
|
6029
6041
|
s.children.push(c);
|
|
6030
6042
|
}
|
|
6031
|
-
let
|
|
6032
|
-
for (const m of o)
|
|
6033
|
-
return r && Ve(
|
|
6043
|
+
let d = s;
|
|
6044
|
+
for (const m of o) d = ((_c = m == null ? void 0 : m.root) == null ? void 0 : _c.call(h, d)) || d;
|
|
6045
|
+
return r && Ve(d, r), d;
|
|
6034
6046
|
}
|
|
6035
|
-
function
|
|
6047
|
+
function ol(t) {
|
|
6036
6048
|
return t.map((e) => {
|
|
6037
6049
|
const n = [];
|
|
6038
6050
|
let r = "", o = 0;
|
|
@@ -6049,7 +6061,7 @@ let __tla = (async () => {
|
|
|
6049
6061
|
}), n;
|
|
6050
6062
|
});
|
|
6051
6063
|
}
|
|
6052
|
-
function
|
|
6064
|
+
function il(t) {
|
|
6053
6065
|
return t.map((e) => e.flatMap((n) => {
|
|
6054
6066
|
if (n.content.match(/^\s+$/)) return n;
|
|
6055
6067
|
const r = n.content.match(/^(\s*)(.*?)(\s*)$/);
|
|
@@ -6072,7 +6084,7 @@ let __tla = (async () => {
|
|
|
6072
6084
|
}), l;
|
|
6073
6085
|
}));
|
|
6074
6086
|
}
|
|
6075
|
-
function
|
|
6087
|
+
function sl(t) {
|
|
6076
6088
|
return t.map((e) => {
|
|
6077
6089
|
const n = [];
|
|
6078
6090
|
for (const r of e) {
|
|
@@ -6090,8 +6102,8 @@ let __tla = (async () => {
|
|
|
6090
6102
|
return n;
|
|
6091
6103
|
});
|
|
6092
6104
|
}
|
|
6093
|
-
const
|
|
6094
|
-
function
|
|
6105
|
+
const al = Ra;
|
|
6106
|
+
function ll(t, e, n) {
|
|
6095
6107
|
var _a3;
|
|
6096
6108
|
const r = {
|
|
6097
6109
|
meta: {},
|
|
@@ -6099,7 +6111,7 @@ let __tla = (async () => {
|
|
|
6099
6111
|
codeToHast: (i, s) => He(t, i, s),
|
|
6100
6112
|
codeToTokens: (i, s) => Fe(t, i, s)
|
|
6101
6113
|
};
|
|
6102
|
-
let o =
|
|
6114
|
+
let o = al(He(t, e, n, r));
|
|
6103
6115
|
for (const i of Ge(n)) o = ((_a3 = i.postprocess) == null ? void 0 : _a3.call(r, o, n)) || o;
|
|
6104
6116
|
return o;
|
|
6105
6117
|
}
|
|
@@ -6177,16 +6189,16 @@ let __tla = (async () => {
|
|
|
6177
6189
|
async function kr(t) {
|
|
6178
6190
|
return (await Promise.all(t.map(async (n) => yr(n) ? null : $t(await fr(n))))).filter((n) => !!n);
|
|
6179
6191
|
}
|
|
6180
|
-
let
|
|
6181
|
-
function
|
|
6182
|
-
e >
|
|
6192
|
+
let cl = 3;
|
|
6193
|
+
function ul(t, e = 3) {
|
|
6194
|
+
e > cl || console.trace(`[SHIKI DEPRECATE]: ${t}`);
|
|
6183
6195
|
}
|
|
6184
|
-
let
|
|
6196
|
+
let re = class extends Error {
|
|
6185
6197
|
constructor(e) {
|
|
6186
6198
|
super(e), this.name = "ShikiError";
|
|
6187
6199
|
}
|
|
6188
6200
|
};
|
|
6189
|
-
class
|
|
6201
|
+
class pl extends ds {
|
|
6190
6202
|
constructor(e, n, r, o = {}) {
|
|
6191
6203
|
super(e);
|
|
6192
6204
|
__publicField(this, "_resolvedThemes", /* @__PURE__ */ new Map());
|
|
@@ -6220,7 +6232,7 @@ let __tla = (async () => {
|
|
|
6220
6232
|
e
|
|
6221
6233
|
]);
|
|
6222
6234
|
for (; this._alias[e]; ) {
|
|
6223
|
-
if (e = this._alias[e], n.has(e)) throw new
|
|
6235
|
+
if (e = this._alias[e], n.has(e)) throw new re(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);
|
|
6224
6236
|
n.add(e);
|
|
6225
6237
|
}
|
|
6226
6238
|
}
|
|
@@ -6259,7 +6271,7 @@ let __tla = (async () => {
|
|
|
6259
6271
|
var _a3;
|
|
6260
6272
|
return s && ((_a3 = s.embeddedLangs) == null ? void 0 : _a3.some((l) => r.map(([a]) => a).includes(l)));
|
|
6261
6273
|
}).filter((i) => !r.includes(i));
|
|
6262
|
-
throw new
|
|
6274
|
+
throw new re(`Missing languages ${r.map(([i]) => `\`${i}\``).join(", ")}, required by ${o.map(([i]) => `\`${i}\``).join(", ")}`);
|
|
6263
6275
|
}
|
|
6264
6276
|
for (const [o, i] of n) this._resolver.addLanguage(i);
|
|
6265
6277
|
for (const [o, i] of n) this.loadLanguage(i);
|
|
@@ -6276,7 +6288,7 @@ let __tla = (async () => {
|
|
|
6276
6288
|
if (this._langMap.set(e.name, e), this._langGraph.set(e.name, e), e.embeddedLangs) for (const n of e.embeddedLangs) this._langGraph.set(n, this._langMap.get(n));
|
|
6277
6289
|
}
|
|
6278
6290
|
}
|
|
6279
|
-
class
|
|
6291
|
+
class hl {
|
|
6280
6292
|
constructor(e, n) {
|
|
6281
6293
|
__publicField(this, "_langs", /* @__PURE__ */ new Map());
|
|
6282
6294
|
__publicField(this, "_scopeToLang", /* @__PURE__ */ new Map());
|
|
@@ -6317,16 +6329,16 @@ let __tla = (async () => {
|
|
|
6317
6329
|
}
|
|
6318
6330
|
}
|
|
6319
6331
|
let pe = 0;
|
|
6320
|
-
function
|
|
6332
|
+
function dl(t) {
|
|
6321
6333
|
pe += 1, t.warnings !== false && pe >= 10 && pe % 10 === 0 && console.warn(`[Shiki] ${pe} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);
|
|
6322
6334
|
let e = false;
|
|
6323
|
-
if (!t.engine) throw new
|
|
6324
|
-
const n = (t.langs || []).flat(1), r = (t.themes || []).flat(1).map($t), o = new
|
|
6335
|
+
if (!t.engine) throw new re("`engine` option is required for synchronous mode");
|
|
6336
|
+
const n = (t.langs || []).flat(1), r = (t.themes || []).flat(1).map($t), o = new hl(t.engine, n), i = new pl(o, r, n, t.langAlias);
|
|
6325
6337
|
let s;
|
|
6326
6338
|
function l(g) {
|
|
6327
6339
|
_();
|
|
6328
6340
|
const b = i.getGrammar(typeof g == "string" ? g : g.name);
|
|
6329
|
-
if (!b) throw new
|
|
6341
|
+
if (!b) throw new re(`Language \`${g}\` not found, you may need to load it first`);
|
|
6330
6342
|
return b;
|
|
6331
6343
|
}
|
|
6332
6344
|
function a(g) {
|
|
@@ -6339,7 +6351,7 @@ let __tla = (async () => {
|
|
|
6339
6351
|
};
|
|
6340
6352
|
_();
|
|
6341
6353
|
const b = i.getTheme(g);
|
|
6342
|
-
if (!b) throw new
|
|
6354
|
+
if (!b) throw new re(`Theme \`${g}\` not found, you may need to load it first`);
|
|
6343
6355
|
return b;
|
|
6344
6356
|
}
|
|
6345
6357
|
function c(g) {
|
|
@@ -6358,11 +6370,11 @@ let __tla = (async () => {
|
|
|
6358
6370
|
function p() {
|
|
6359
6371
|
return _(), i.getLoadedLanguages();
|
|
6360
6372
|
}
|
|
6361
|
-
function
|
|
6373
|
+
function h(...g) {
|
|
6362
6374
|
_(), i.loadLanguages(g.flat(1));
|
|
6363
6375
|
}
|
|
6364
|
-
async function
|
|
6365
|
-
return
|
|
6376
|
+
async function d(...g) {
|
|
6377
|
+
return h(await Sr(g));
|
|
6366
6378
|
}
|
|
6367
6379
|
function m(...g) {
|
|
6368
6380
|
_();
|
|
@@ -6372,7 +6384,7 @@ let __tla = (async () => {
|
|
|
6372
6384
|
return _(), m(await kr(g));
|
|
6373
6385
|
}
|
|
6374
6386
|
function _() {
|
|
6375
|
-
if (e) throw new
|
|
6387
|
+
if (e) throw new re("Shiki instance has been disposed");
|
|
6376
6388
|
}
|
|
6377
6389
|
function y() {
|
|
6378
6390
|
e || (e = true, i.dispose(), pe -= 1);
|
|
@@ -6383,44 +6395,44 @@ let __tla = (async () => {
|
|
|
6383
6395
|
getLanguage: l,
|
|
6384
6396
|
getLoadedThemes: u,
|
|
6385
6397
|
getLoadedLanguages: p,
|
|
6386
|
-
loadLanguage:
|
|
6387
|
-
loadLanguageSync:
|
|
6398
|
+
loadLanguage: d,
|
|
6399
|
+
loadLanguageSync: h,
|
|
6388
6400
|
loadTheme: w,
|
|
6389
6401
|
loadThemeSync: m,
|
|
6390
6402
|
dispose: y,
|
|
6391
6403
|
[Symbol.dispose]: y
|
|
6392
6404
|
};
|
|
6393
6405
|
}
|
|
6394
|
-
async function
|
|
6395
|
-
t.engine ||
|
|
6406
|
+
async function ml(t) {
|
|
6407
|
+
t.engine || ul("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");
|
|
6396
6408
|
const [e, n, r] = await Promise.all([
|
|
6397
6409
|
kr(t.themes || []),
|
|
6398
6410
|
Sr(t.langs || []),
|
|
6399
6411
|
t.engine
|
|
6400
6412
|
]);
|
|
6401
|
-
return
|
|
6413
|
+
return dl({
|
|
6402
6414
|
...t,
|
|
6403
6415
|
themes: e,
|
|
6404
6416
|
langs: n,
|
|
6405
6417
|
engine: r
|
|
6406
6418
|
});
|
|
6407
6419
|
}
|
|
6408
|
-
async function
|
|
6409
|
-
const e = await
|
|
6420
|
+
async function fl(t) {
|
|
6421
|
+
const e = await ml(t);
|
|
6410
6422
|
return {
|
|
6411
|
-
getLastGrammarState: (...n) =>
|
|
6423
|
+
getLastGrammarState: (...n) => Ja(e, ...n),
|
|
6412
6424
|
codeToTokensBase: (n, r) => Mt(e, n, r),
|
|
6413
6425
|
codeToTokensWithThemes: (n, r) => vr(e, n, r),
|
|
6414
6426
|
codeToTokens: (n, r) => Fe(e, n, r),
|
|
6415
6427
|
codeToHast: (n, r) => He(e, n, r),
|
|
6416
|
-
codeToHtml: (n, r) =>
|
|
6428
|
+
codeToHtml: (n, r) => ll(e, n, r),
|
|
6417
6429
|
getBundledLanguages: () => ({}),
|
|
6418
6430
|
getBundledThemes: () => ({}),
|
|
6419
6431
|
...e,
|
|
6420
6432
|
getInternalContext: () => e
|
|
6421
6433
|
};
|
|
6422
6434
|
}
|
|
6423
|
-
function
|
|
6435
|
+
function gl(t) {
|
|
6424
6436
|
const e = t.langs, n = t.themes, r = t.engine;
|
|
6425
6437
|
async function o(i) {
|
|
6426
6438
|
function s(p) {
|
|
@@ -6428,22 +6440,22 @@ let __tla = (async () => {
|
|
|
6428
6440
|
if (typeof p == "string") {
|
|
6429
6441
|
if (gr(p)) return [];
|
|
6430
6442
|
p = ((_a3 = i.langAlias) == null ? void 0 : _a3[p]) || p;
|
|
6431
|
-
const
|
|
6432
|
-
if (!
|
|
6433
|
-
return
|
|
6443
|
+
const h = e[p];
|
|
6444
|
+
if (!h) throw new A(`Language \`${p}\` is not included in this bundle. You may want to load it from external source.`);
|
|
6445
|
+
return h;
|
|
6434
6446
|
}
|
|
6435
6447
|
return p;
|
|
6436
6448
|
}
|
|
6437
6449
|
function l(p) {
|
|
6438
6450
|
if (yr(p)) return "none";
|
|
6439
6451
|
if (typeof p == "string") {
|
|
6440
|
-
const
|
|
6441
|
-
if (!
|
|
6442
|
-
return
|
|
6452
|
+
const h = n[p];
|
|
6453
|
+
if (!h) throw new A(`Theme \`${p}\` is not included in this bundle. You may want to load it from external source.`);
|
|
6454
|
+
return h;
|
|
6443
6455
|
}
|
|
6444
6456
|
return p;
|
|
6445
6457
|
}
|
|
6446
|
-
const a = (i.themes ?? []).map((p) => l(p)), c = (i.langs ?? []).map((p) => s(p)), u = await
|
|
6458
|
+
const a = (i.themes ?? []).map((p) => l(p)), c = (i.langs ?? []).map((p) => s(p)), u = await fl({
|
|
6447
6459
|
engine: i.engine ?? r(),
|
|
6448
6460
|
...i,
|
|
6449
6461
|
themes: a,
|
|
@@ -6467,7 +6479,7 @@ let __tla = (async () => {
|
|
|
6467
6479
|
}
|
|
6468
6480
|
return o;
|
|
6469
6481
|
}
|
|
6470
|
-
function
|
|
6482
|
+
function yl(t) {
|
|
6471
6483
|
let e;
|
|
6472
6484
|
async function n(r = {}) {
|
|
6473
6485
|
if (e) {
|
|
@@ -6484,8 +6496,8 @@ let __tla = (async () => {
|
|
|
6484
6496
|
}
|
|
6485
6497
|
return n;
|
|
6486
6498
|
}
|
|
6487
|
-
function
|
|
6488
|
-
const n =
|
|
6499
|
+
function _l(t, e) {
|
|
6500
|
+
const n = yl(t);
|
|
6489
6501
|
async function r(o, i) {
|
|
6490
6502
|
var _a3;
|
|
6491
6503
|
const s = await n({
|
|
@@ -7200,7 +7212,7 @@ let __tla = (async () => {
|
|
|
7200
7212
|
{
|
|
7201
7213
|
id: "luau",
|
|
7202
7214
|
name: "Luau",
|
|
7203
|
-
import: (() => import("../luau-
|
|
7215
|
+
import: (() => import("../luau-DtBSxLyz.js"))
|
|
7204
7216
|
},
|
|
7205
7217
|
{
|
|
7206
7218
|
id: "make",
|
|
@@ -7262,7 +7274,7 @@ let __tla = (async () => {
|
|
|
7262
7274
|
{
|
|
7263
7275
|
id: "move",
|
|
7264
7276
|
name: "Move",
|
|
7265
|
-
import: (() => import("../move-
|
|
7277
|
+
import: (() => import("../move-DSb5dTSj.js"))
|
|
7266
7278
|
},
|
|
7267
7279
|
{
|
|
7268
7280
|
id: "narrat",
|
|
@@ -7301,7 +7313,7 @@ let __tla = (async () => {
|
|
|
7301
7313
|
aliases: [
|
|
7302
7314
|
"nu"
|
|
7303
7315
|
],
|
|
7304
|
-
import: (() => import("../nushell-
|
|
7316
|
+
import: (() => import("../nushell-CQi4NV-2.js"))
|
|
7305
7317
|
},
|
|
7306
7318
|
{
|
|
7307
7319
|
id: "objective-c",
|
|
@@ -7622,7 +7634,7 @@ let __tla = (async () => {
|
|
|
7622
7634
|
{
|
|
7623
7635
|
id: "swift",
|
|
7624
7636
|
name: "Swift",
|
|
7625
|
-
import: (() => import("../swift-
|
|
7637
|
+
import: (() => import("../swift-9UzSvamq.js"))
|
|
7626
7638
|
},
|
|
7627
7639
|
{
|
|
7628
7640
|
id: "system-verilog",
|
|
@@ -7856,19 +7868,19 @@ let __tla = (async () => {
|
|
|
7856
7868
|
name: "Zig",
|
|
7857
7869
|
import: (() => import("../zig-Vm0PO9wB.js"))
|
|
7858
7870
|
}
|
|
7859
|
-
],
|
|
7871
|
+
], bl = Object.fromEntries(Cr.map((t) => [
|
|
7860
7872
|
t.id,
|
|
7861
7873
|
t.import
|
|
7862
|
-
])),
|
|
7874
|
+
])), wl = Object.fromEntries(Cr.flatMap((t) => {
|
|
7863
7875
|
var _a3;
|
|
7864
7876
|
return ((_a3 = t.aliases) == null ? void 0 : _a3.map((e) => [
|
|
7865
7877
|
e,
|
|
7866
7878
|
t.import
|
|
7867
7879
|
])) || [];
|
|
7868
|
-
})),
|
|
7869
|
-
...
|
|
7870
|
-
...
|
|
7871
|
-
},
|
|
7880
|
+
})), vl = {
|
|
7881
|
+
...bl,
|
|
7882
|
+
...wl
|
|
7883
|
+
}, Sl = [
|
|
7872
7884
|
{
|
|
7873
7885
|
id: "andromeeda",
|
|
7874
7886
|
displayName: "Andromeeda",
|
|
@@ -8229,7 +8241,7 @@ let __tla = (async () => {
|
|
|
8229
8241
|
type: "light",
|
|
8230
8242
|
import: (() => import("../vitesse-light-CcmG315c.js"))
|
|
8231
8243
|
}
|
|
8232
|
-
],
|
|
8244
|
+
], kl = Object.fromEntries(Sl.map((t) => [
|
|
8233
8245
|
t.id,
|
|
8234
8246
|
t.import
|
|
8235
8247
|
]));
|
|
@@ -8238,61 +8250,61 @@ let __tla = (async () => {
|
|
|
8238
8250
|
super(e), this.name = "ShikiError";
|
|
8239
8251
|
}
|
|
8240
8252
|
}
|
|
8241
|
-
function
|
|
8253
|
+
function Cl() {
|
|
8242
8254
|
return 2147483648;
|
|
8243
8255
|
}
|
|
8244
|
-
function
|
|
8256
|
+
function Tl() {
|
|
8245
8257
|
return typeof performance < "u" ? performance.now() : Date.now();
|
|
8246
8258
|
}
|
|
8247
|
-
const
|
|
8248
|
-
async function
|
|
8259
|
+
const Pl = (t, e) => t + (e - t % e) % e;
|
|
8260
|
+
async function Rl(t) {
|
|
8249
8261
|
let e, n;
|
|
8250
8262
|
const r = {};
|
|
8251
|
-
function o(
|
|
8252
|
-
n =
|
|
8263
|
+
function o(d) {
|
|
8264
|
+
n = d, r.HEAPU8 = new Uint8Array(d), r.HEAPU32 = new Uint32Array(d);
|
|
8253
8265
|
}
|
|
8254
|
-
function i(
|
|
8255
|
-
r.HEAPU8.copyWithin(
|
|
8266
|
+
function i(d, m, w) {
|
|
8267
|
+
r.HEAPU8.copyWithin(d, m, m + w);
|
|
8256
8268
|
}
|
|
8257
|
-
function s(
|
|
8269
|
+
function s(d) {
|
|
8258
8270
|
try {
|
|
8259
|
-
return e.grow(
|
|
8271
|
+
return e.grow(d - n.byteLength + 65535 >>> 16), o(e.buffer), 1;
|
|
8260
8272
|
} catch {
|
|
8261
8273
|
}
|
|
8262
8274
|
}
|
|
8263
|
-
function l(
|
|
8275
|
+
function l(d) {
|
|
8264
8276
|
const m = r.HEAPU8.length;
|
|
8265
|
-
|
|
8266
|
-
const w =
|
|
8267
|
-
if (
|
|
8277
|
+
d = d >>> 0;
|
|
8278
|
+
const w = Cl();
|
|
8279
|
+
if (d > w) return false;
|
|
8268
8280
|
for (let _ = 1; _ <= 4; _ *= 2) {
|
|
8269
8281
|
let y = m * (1 + 0.2 / _);
|
|
8270
|
-
y = Math.min(y,
|
|
8271
|
-
const g = Math.min(w,
|
|
8282
|
+
y = Math.min(y, d + 100663296);
|
|
8283
|
+
const g = Math.min(w, Pl(Math.max(d, y), 65536));
|
|
8272
8284
|
if (s(g)) return true;
|
|
8273
8285
|
}
|
|
8274
8286
|
return false;
|
|
8275
8287
|
}
|
|
8276
8288
|
const a = typeof TextDecoder < "u" ? new TextDecoder("utf8") : void 0;
|
|
8277
|
-
function c(
|
|
8289
|
+
function c(d, m, w = 1024) {
|
|
8278
8290
|
const _ = m + w;
|
|
8279
8291
|
let y = m;
|
|
8280
|
-
for (;
|
|
8281
|
-
if (y - m > 16 &&
|
|
8292
|
+
for (; d[y] && !(y >= _); ) ++y;
|
|
8293
|
+
if (y - m > 16 && d.buffer && a) return a.decode(d.subarray(m, y));
|
|
8282
8294
|
let g = "";
|
|
8283
8295
|
for (; m < y; ) {
|
|
8284
|
-
let b =
|
|
8296
|
+
let b = d[m++];
|
|
8285
8297
|
if (!(b & 128)) {
|
|
8286
8298
|
g += String.fromCharCode(b);
|
|
8287
8299
|
continue;
|
|
8288
8300
|
}
|
|
8289
|
-
const k =
|
|
8301
|
+
const k = d[m++] & 63;
|
|
8290
8302
|
if ((b & 224) === 192) {
|
|
8291
8303
|
g += String.fromCharCode((b & 31) << 6 | k);
|
|
8292
8304
|
continue;
|
|
8293
8305
|
}
|
|
8294
|
-
const C =
|
|
8295
|
-
if ((b & 240) === 224 ? b = (b & 15) << 12 | k << 6 | C : b = (b & 7) << 18 | k << 12 | C << 6 |
|
|
8306
|
+
const C = d[m++] & 63;
|
|
8307
|
+
if ((b & 240) === 224 ? b = (b & 15) << 12 | k << 6 | C : b = (b & 7) << 18 | k << 12 | C << 6 | d[m++] & 63, b < 65536) g += String.fromCharCode(b);
|
|
8296
8308
|
else {
|
|
8297
8309
|
const M = b - 65536;
|
|
8298
8310
|
g += String.fromCharCode(55296 | M >> 10, 56320 | M & 1023);
|
|
@@ -8300,32 +8312,32 @@ let __tla = (async () => {
|
|
|
8300
8312
|
}
|
|
8301
8313
|
return g;
|
|
8302
8314
|
}
|
|
8303
|
-
function u(
|
|
8304
|
-
return
|
|
8315
|
+
function u(d, m) {
|
|
8316
|
+
return d ? c(r.HEAPU8, d, m) : "";
|
|
8305
8317
|
}
|
|
8306
8318
|
const p = {
|
|
8307
|
-
emscripten_get_now:
|
|
8319
|
+
emscripten_get_now: Tl,
|
|
8308
8320
|
emscripten_memcpy_big: i,
|
|
8309
8321
|
emscripten_resize_heap: l,
|
|
8310
8322
|
fd_write: () => 0
|
|
8311
8323
|
};
|
|
8312
|
-
async function
|
|
8324
|
+
async function h() {
|
|
8313
8325
|
const m = await t({
|
|
8314
8326
|
env: p,
|
|
8315
8327
|
wasi_snapshot_preview1: p
|
|
8316
8328
|
});
|
|
8317
8329
|
e = m.memory, o(e.buffer), Object.assign(r, m), r.UTF8ToString = u;
|
|
8318
8330
|
}
|
|
8319
|
-
return await
|
|
8331
|
+
return await h(), r;
|
|
8320
8332
|
}
|
|
8321
|
-
var
|
|
8333
|
+
var Al = Object.defineProperty, Nl = (t, e, n) => e in t ? Al(t, e, {
|
|
8322
8334
|
enumerable: true,
|
|
8323
8335
|
configurable: true,
|
|
8324
8336
|
writable: true,
|
|
8325
8337
|
value: n
|
|
8326
|
-
}) : t[e] = n, N = (t, e, n) =>
|
|
8338
|
+
}) : t[e] = n, N = (t, e, n) => Nl(t, typeof e != "symbol" ? e + "" : e, n);
|
|
8327
8339
|
let L = null;
|
|
8328
|
-
function
|
|
8340
|
+
function El(t) {
|
|
8329
8341
|
throw new jt(t.UTF8ToString(t.getLastOnigError()));
|
|
8330
8342
|
}
|
|
8331
8343
|
class Ke {
|
|
@@ -8339,12 +8351,12 @@ let __tla = (async () => {
|
|
|
8339
8351
|
let a = 0;
|
|
8340
8352
|
for (let c = 0; c < n; c++) {
|
|
8341
8353
|
const u = e.charCodeAt(c);
|
|
8342
|
-
let p = u,
|
|
8354
|
+
let p = u, h = false;
|
|
8343
8355
|
if (u >= 55296 && u <= 56319 && c + 1 < n) {
|
|
8344
|
-
const
|
|
8345
|
-
|
|
8356
|
+
const d = e.charCodeAt(c + 1);
|
|
8357
|
+
d >= 56320 && d <= 57343 && (p = (u - 55296 << 10) + 65536 | d - 56320, h = true);
|
|
8346
8358
|
}
|
|
8347
|
-
o && (i[c] = a,
|
|
8359
|
+
o && (i[c] = a, h && (i[c + 1] = a), p <= 127 ? s[a + 0] = c : p <= 2047 ? (s[a + 0] = c, s[a + 1] = c) : p <= 65535 ? (s[a + 0] = c, s[a + 1] = c, s[a + 2] = c) : (s[a + 0] = c, s[a + 1] = c, s[a + 2] = c, s[a + 3] = c)), p <= 127 ? l[a++] = p : p <= 2047 ? (l[a++] = 192 | (p & 1984) >>> 6, l[a++] = 128 | (p & 63) >>> 0) : p <= 65535 ? (l[a++] = 224 | (p & 61440) >>> 12, l[a++] = 128 | (p & 4032) >>> 6, l[a++] = 128 | (p & 63) >>> 0) : (l[a++] = 240 | (p & 1835008) >>> 18, l[a++] = 128 | (p & 258048) >>> 12, l[a++] = 128 | (p & 4032) >>> 6, l[a++] = 128 | (p & 63) >>> 0), h && c++;
|
|
8348
8360
|
}
|
|
8349
8361
|
this.utf16Length = n, this.utf8Length = r, this.utf16Value = e, this.utf8Value = l, this.utf16OffsetToUtf8 = i, this.utf8OffsetToUtf16 = s;
|
|
8350
8362
|
}
|
|
@@ -8387,7 +8399,7 @@ let __tla = (async () => {
|
|
|
8387
8399
|
N(Je, "_sharedPtr", 0);
|
|
8388
8400
|
N(Je, "_sharedPtrInUse", false);
|
|
8389
8401
|
let Tr = Je;
|
|
8390
|
-
class
|
|
8402
|
+
class xl {
|
|
8391
8403
|
constructor(e) {
|
|
8392
8404
|
if (N(this, "_onigBinding"), N(this, "_ptr"), !L) throw new jt("Must invoke loadWasm first.");
|
|
8393
8405
|
const n = [], r = [];
|
|
@@ -8401,7 +8413,7 @@ let __tla = (async () => {
|
|
|
8401
8413
|
L.HEAPU32.set(r, i / 4);
|
|
8402
8414
|
const s = L.createOnigScanner(o, i, e.length);
|
|
8403
8415
|
for (let l = 0, a = e.length; l < a; l++) L.ofree(n[l]);
|
|
8404
|
-
L.ofree(i), L.ofree(o), s === 0 &&
|
|
8416
|
+
L.ofree(i), L.ofree(o), s === 0 && El(L), this._onigBinding = L, this._ptr = s;
|
|
8405
8417
|
}
|
|
8406
8418
|
dispose() {
|
|
8407
8419
|
this._onigBinding.freeOnigScanner(this._ptr);
|
|
@@ -8421,12 +8433,12 @@ let __tla = (async () => {
|
|
|
8421
8433
|
const l = i.HEAPU32;
|
|
8422
8434
|
let a = s / 4;
|
|
8423
8435
|
const c = l[a++], u = l[a++], p = [];
|
|
8424
|
-
for (let
|
|
8425
|
-
const
|
|
8426
|
-
p[
|
|
8427
|
-
start:
|
|
8436
|
+
for (let h = 0; h < u; h++) {
|
|
8437
|
+
const d = e.convertUtf8OffsetToUtf16(l[a++]), m = e.convertUtf8OffsetToUtf16(l[a++]);
|
|
8438
|
+
p[h] = {
|
|
8439
|
+
start: d,
|
|
8428
8440
|
end: m,
|
|
8429
|
-
length: m -
|
|
8441
|
+
length: m - d
|
|
8430
8442
|
};
|
|
8431
8443
|
}
|
|
8432
8444
|
return {
|
|
@@ -8435,29 +8447,29 @@ let __tla = (async () => {
|
|
|
8435
8447
|
};
|
|
8436
8448
|
}
|
|
8437
8449
|
}
|
|
8438
|
-
function
|
|
8450
|
+
function Ll(t) {
|
|
8439
8451
|
return typeof t.instantiator == "function";
|
|
8440
8452
|
}
|
|
8441
|
-
function
|
|
8453
|
+
function Ol(t) {
|
|
8442
8454
|
return typeof t.default == "function";
|
|
8443
8455
|
}
|
|
8444
|
-
function
|
|
8456
|
+
function Il(t) {
|
|
8445
8457
|
return typeof t.data < "u";
|
|
8446
8458
|
}
|
|
8447
|
-
function
|
|
8459
|
+
function zl(t) {
|
|
8448
8460
|
return typeof Response < "u" && t instanceof Response;
|
|
8449
8461
|
}
|
|
8450
|
-
function
|
|
8462
|
+
function Ml(t) {
|
|
8451
8463
|
var _a3;
|
|
8452
8464
|
return typeof ArrayBuffer < "u" && (t instanceof ArrayBuffer || ArrayBuffer.isView(t)) || typeof Buffer < "u" && ((_a3 = Buffer.isBuffer) == null ? void 0 : _a3.call(Buffer, t)) || typeof SharedArrayBuffer < "u" && t instanceof SharedArrayBuffer || typeof Uint32Array < "u" && t instanceof Uint32Array;
|
|
8453
8465
|
}
|
|
8454
8466
|
let Ne;
|
|
8455
|
-
function
|
|
8467
|
+
function $l(t) {
|
|
8456
8468
|
if (Ne) return Ne;
|
|
8457
8469
|
async function e() {
|
|
8458
|
-
L = await
|
|
8470
|
+
L = await Rl(async (n) => {
|
|
8459
8471
|
let r = t;
|
|
8460
|
-
return r = await r, typeof r == "function" && (r = await r(n)), typeof r == "function" && (r = await r(n)),
|
|
8472
|
+
return r = await r, typeof r == "function" && (r = await r(n)), typeof r == "function" && (r = await r(n)), Ll(r) ? r = await r.instantiator(n) : Ol(r) ? r = await r.default(n) : (Il(r) && (r = r.data), zl(r) ? typeof WebAssembly.instantiateStreaming == "function" ? r = await jl(r)(n) : r = await Dl(r)(n) : Ml(r) ? r = await at(r)(n) : r instanceof WebAssembly.Module ? r = await at(r)(n) : "default" in r && r.default instanceof WebAssembly.Module && (r = await at(r.default)(n))), "instance" in r && (r = r.instance), "exports" in r && (r = r.exports), r;
|
|
8461
8473
|
});
|
|
8462
8474
|
}
|
|
8463
8475
|
return Ne = e(), Ne;
|
|
@@ -8465,32 +8477,32 @@ let __tla = (async () => {
|
|
|
8465
8477
|
function at(t) {
|
|
8466
8478
|
return (e) => WebAssembly.instantiate(t, e);
|
|
8467
8479
|
}
|
|
8468
|
-
function
|
|
8480
|
+
function jl(t) {
|
|
8469
8481
|
return (e) => WebAssembly.instantiateStreaming(t, e);
|
|
8470
8482
|
}
|
|
8471
|
-
function
|
|
8483
|
+
function Dl(t) {
|
|
8472
8484
|
return async (e) => {
|
|
8473
8485
|
const n = await t.arrayBuffer();
|
|
8474
8486
|
return WebAssembly.instantiate(n, e);
|
|
8475
8487
|
};
|
|
8476
8488
|
}
|
|
8477
|
-
async function
|
|
8478
|
-
return t && await
|
|
8489
|
+
async function Bl(t) {
|
|
8490
|
+
return t && await $l(t), {
|
|
8479
8491
|
createScanner(e) {
|
|
8480
|
-
return new
|
|
8492
|
+
return new xl(e.map((n) => typeof n == "string" ? n : n.source));
|
|
8481
8493
|
},
|
|
8482
8494
|
createString(e) {
|
|
8483
8495
|
return new Tr(e);
|
|
8484
8496
|
}
|
|
8485
8497
|
};
|
|
8486
8498
|
}
|
|
8487
|
-
const
|
|
8488
|
-
langs:
|
|
8489
|
-
themes:
|
|
8490
|
-
engine: () =>
|
|
8491
|
-
}), { codeToHtml: Pn } =
|
|
8492
|
-
guessEmbeddedLanguages:
|
|
8493
|
-
}),
|
|
8499
|
+
const Gl = gl({
|
|
8500
|
+
langs: vl,
|
|
8501
|
+
themes: kl,
|
|
8502
|
+
engine: () => Bl(import("../wasm-DQxwEHae.js"))
|
|
8503
|
+
}), { codeToHtml: Pn } = _l(Gl, {
|
|
8504
|
+
guessEmbeddedLanguages: La
|
|
8505
|
+
}), Ul = ri({
|
|
8494
8506
|
mode: jn([
|
|
8495
8507
|
"html",
|
|
8496
8508
|
"svelte",
|
|
@@ -8500,12 +8512,12 @@ let __tla = (async () => {
|
|
|
8500
8512
|
exclude: Qe().optional(),
|
|
8501
8513
|
shikiOptions: Qe().optional()
|
|
8502
8514
|
}), Rn = {
|
|
8503
|
-
html:
|
|
8504
|
-
svelte:
|
|
8505
|
-
react:
|
|
8515
|
+
html: Ti,
|
|
8516
|
+
svelte: Pi,
|
|
8517
|
+
react: Ri
|
|
8506
8518
|
};
|
|
8507
|
-
|
|
8508
|
-
const e =
|
|
8519
|
+
ql = function(t) {
|
|
8520
|
+
const e = Ul.parse(t), { include: n, exclude: r, mode: o, shikiOptions: i } = e, s = Ar(n, r), l = {
|
|
8509
8521
|
themes: {
|
|
8510
8522
|
light: "github-light",
|
|
8511
8523
|
dark: "github-dark"
|
|
@@ -8515,14 +8527,14 @@ let __tla = (async () => {
|
|
|
8515
8527
|
let a = null;
|
|
8516
8528
|
const c = async () => {
|
|
8517
8529
|
if (!a) try {
|
|
8518
|
-
a = await
|
|
8519
|
-
} catch (
|
|
8520
|
-
throw new Error(`Failed to load norg parser: ${
|
|
8530
|
+
a = await Ci();
|
|
8531
|
+
} catch (h) {
|
|
8532
|
+
throw new Error(`Failed to load norg parser: ${h}`);
|
|
8521
8533
|
}
|
|
8522
8534
|
return a;
|
|
8523
|
-
}, u = (
|
|
8524
|
-
const
|
|
8525
|
-
let w =
|
|
8535
|
+
}, u = (h) => h.replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&").replace(/"/g, '"').replace(/'/g, "'").replace(/'/g, "'").replace(///g, "/").replace(/`/g, "`").replace(/&#(\d+);/g, (d, m) => String.fromCharCode(m)).replace(/&#x([0-9a-fA-F]+);/g, (d, m) => String.fromCharCode(parseInt(m, 16))), p = async (h) => {
|
|
8536
|
+
const d = /<pre(?:\s+class="lang-(\w+)")?><code(?:\s+class="lang-\w+")?>([^]*?)<\/code><\/pre>/g, m = h.matchAll(d);
|
|
8537
|
+
let w = h;
|
|
8526
8538
|
for (const [_, y, g] of m) {
|
|
8527
8539
|
const b = u(g), k = y ? y.toLowerCase() : "text";
|
|
8528
8540
|
try {
|
|
@@ -8548,39 +8560,39 @@ let __tla = (async () => {
|
|
|
8548
8560
|
return {
|
|
8549
8561
|
name: "vite-plugin-norg",
|
|
8550
8562
|
enforce: "pre",
|
|
8551
|
-
async resolveId(
|
|
8552
|
-
if (!
|
|
8553
|
-
const m = await this.resolve(
|
|
8563
|
+
async resolveId(h, d) {
|
|
8564
|
+
if (!h.endsWith(".norg")) return null;
|
|
8565
|
+
const m = await this.resolve(h, d, {
|
|
8554
8566
|
skipSelf: true
|
|
8555
8567
|
});
|
|
8556
8568
|
return m ? m.id : null;
|
|
8557
8569
|
},
|
|
8558
|
-
async load(
|
|
8559
|
-
if (s(
|
|
8560
|
-
const { readFile:
|
|
8570
|
+
async load(h) {
|
|
8571
|
+
if (s(h)) try {
|
|
8572
|
+
const { readFile: d } = await import("node:fs/promises").then(async (m2) => {
|
|
8561
8573
|
await m2.__tla;
|
|
8562
8574
|
return m2;
|
|
8563
|
-
}), m = await c(), w = await h
|
|
8575
|
+
}), m = await c(), w = await d(h, "utf-8"), _ = m(w), y = u(await p(_.html));
|
|
8564
8576
|
return Rn[o]({
|
|
8565
8577
|
..._,
|
|
8566
8578
|
html: y
|
|
8567
8579
|
});
|
|
8568
|
-
} catch (
|
|
8569
|
-
this.error(new Error(`Failed to parse norg file ${
|
|
8580
|
+
} catch (d) {
|
|
8581
|
+
this.error(new Error(`Failed to parse norg file ${h}: ${d}`));
|
|
8570
8582
|
}
|
|
8571
8583
|
},
|
|
8572
|
-
async handleHotUpdate(
|
|
8573
|
-
if (!s(
|
|
8574
|
-
const
|
|
8575
|
-
|
|
8584
|
+
async handleHotUpdate(h) {
|
|
8585
|
+
if (!s(h.file) || !h.file.endsWith(".norg")) return;
|
|
8586
|
+
const d = h.read;
|
|
8587
|
+
h.read = async function() {
|
|
8576
8588
|
try {
|
|
8577
|
-
const m = await
|
|
8589
|
+
const m = await d(), _ = (await c())(m), y = u(await p(_.html));
|
|
8578
8590
|
return Rn[o]({
|
|
8579
8591
|
..._,
|
|
8580
8592
|
html: y
|
|
8581
8593
|
});
|
|
8582
8594
|
} catch (m) {
|
|
8583
|
-
throw new Error(`Failed to parse norg file ${
|
|
8595
|
+
throw new Error(`Failed to parse norg file ${h.file}: ${m}`);
|
|
8584
8596
|
}
|
|
8585
8597
|
};
|
|
8586
8598
|
}
|
|
@@ -8589,6 +8601,6 @@ let __tla = (async () => {
|
|
|
8589
8601
|
})();
|
|
8590
8602
|
export {
|
|
8591
8603
|
__tla,
|
|
8592
|
-
|
|
8593
|
-
|
|
8604
|
+
ql as default,
|
|
8605
|
+
ql as norgPlugin
|
|
8594
8606
|
};
|