@pierre/diffs 1.3.0-beta.4 → 1.3.0-beta.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 +6 -6
- package/dist/components/CodeView.d.ts.map +1 -1
- package/dist/components/CodeView.js +6 -6
- package/dist/components/CodeView.js.map +1 -1
- package/dist/components/File.d.ts +1 -0
- package/dist/components/File.d.ts.map +1 -1
- package/dist/components/File.js +26 -12
- package/dist/components/File.js.map +1 -1
- package/dist/components/FileDiff.d.ts +1 -0
- package/dist/components/FileDiff.d.ts.map +1 -1
- package/dist/components/FileDiff.js +12 -11
- package/dist/components/FileDiff.js.map +1 -1
- package/dist/components/FileStream.js +4 -2
- package/dist/components/FileStream.js.map +1 -1
- package/dist/components/UnresolvedFile.d.ts.map +1 -1
- package/dist/components/VirtualizedFile.d.ts +5 -1
- package/dist/components/VirtualizedFile.d.ts.map +1 -1
- package/dist/components/VirtualizedFile.js +82 -21
- package/dist/components/VirtualizedFile.js.map +1 -1
- package/dist/components/VirtualizedFileDiff.d.ts +6 -1
- package/dist/components/VirtualizedFileDiff.d.ts.map +1 -1
- package/dist/components/VirtualizedFileDiff.js +77 -15
- package/dist/components/VirtualizedFileDiff.js.map +1 -1
- package/dist/components/VirtulizerDevelopment.d.ts.map +1 -1
- package/dist/editor/command.d.ts +1 -1
- package/dist/editor/command.d.ts.map +1 -1
- package/dist/editor/command.js +3 -3
- package/dist/editor/command.js.map +1 -1
- package/dist/editor/editor.d.ts +31 -5
- package/dist/editor/editor.d.ts.map +1 -1
- package/dist/editor/editor.js +240 -178
- package/dist/editor/editor.js.map +1 -1
- package/dist/editor/editor2.js +1 -1
- package/dist/editor/editor2.js.map +1 -1
- package/dist/editor/index.d.ts +2 -2
- package/dist/editor/marker.d.ts +2 -2
- package/dist/editor/marker.d.ts.map +1 -1
- package/dist/editor/marker.js +2 -2
- package/dist/editor/marker.js.map +1 -1
- package/dist/editor/pieceTable.d.ts +6 -1
- package/dist/editor/pieceTable.d.ts.map +1 -1
- package/dist/editor/pieceTable.js +32 -1
- package/dist/editor/pieceTable.js.map +1 -1
- package/dist/editor/searchPanel.d.ts +12 -3
- package/dist/editor/searchPanel.d.ts.map +1 -1
- package/dist/editor/searchPanel.js +168 -54
- package/dist/editor/searchPanel.js.map +1 -1
- package/dist/editor/selection.d.ts.map +1 -1
- package/dist/editor/sprite.d.ts +2 -2
- package/dist/editor/sprite.d.ts.map +1 -1
- package/dist/editor/sprite.js +10 -3
- package/dist/editor/sprite.js.map +1 -1
- package/dist/editor/textMeasure.d.ts +1 -0
- package/dist/editor/textMeasure.d.ts.map +1 -1
- package/dist/editor/textMeasure.js +6 -0
- package/dist/editor/textMeasure.js.map +1 -1
- package/dist/editor/tokenzier.js +9 -6
- package/dist/editor/tokenzier.js.map +1 -1
- package/dist/managers/InteractionManager.js +1 -1
- package/dist/managers/InteractionManager.js.map +1 -1
- package/dist/managers/ResizeManager.js +1 -1
- package/dist/managers/ResizeManager.js.map +1 -1
- package/dist/react/CodeView.js +1 -1
- package/dist/react/jsx.d.ts.map +1 -1
- package/dist/renderers/DiffHunksRenderer.d.ts +3 -2
- package/dist/renderers/DiffHunksRenderer.d.ts.map +1 -1
- package/dist/renderers/DiffHunksRenderer.js +49 -2
- package/dist/renderers/DiffHunksRenderer.js.map +1 -1
- package/dist/renderers/FileRenderer.js +12 -0
- package/dist/renderers/FileRenderer.js.map +1 -1
- package/dist/ssr/FileDiffReact.js +1 -1
- package/dist/types.d.ts +17 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/includesFileAnnotations.d.ts +17 -0
- package/dist/utils/includesFileAnnotations.d.ts.map +1 -0
- package/dist/utils/includesFileAnnotations.js +19 -0
- package/dist/utils/includesFileAnnotations.js.map +1 -0
- package/dist/utils/parseMergeConflictDiffFromFile.js.map +1 -1
- package/dist/utils/renderDiffWithHighlighter.js +4 -2
- package/dist/utils/renderDiffWithHighlighter.js.map +1 -1
- package/dist/utils/renderFileWithHighlighter.js +4 -2
- package/dist/utils/renderFileWithHighlighter.js.map +1 -1
- package/dist/worker/{wasm-BaDzIkIn.js → wasm-qE0LgnY3.js} +2 -2
- package/dist/worker/{wasm-BaDzIkIn.js.map → wasm-qE0LgnY3.js.map} +1 -1
- package/dist/worker/worker-portable.js +289 -253
- package/dist/worker/worker-portable.js.map +1 -1
- package/dist/worker/worker.js +8 -4
- package/dist/worker/worker.js.map +1 -1
- package/package.json +4 -10
|
@@ -10,42 +10,34 @@ var __export = (all$1) => {
|
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
//#endregion
|
|
13
|
-
//#region ../../node_modules/.bun/shiki@4.0
|
|
13
|
+
//#region ../../node_modules/.bun/shiki@4.2.0/node_modules/shiki/dist/chunk-BBjsoOtd.mjs
|
|
14
14
|
var __defProp$1 = Object.defineProperty;
|
|
15
15
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
16
16
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
17
17
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
18
18
|
var __exportAll = (all$1, no_symbols) => {
|
|
19
19
|
let target = {};
|
|
20
|
-
for (var name in all$1) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
if (!no_symbols) {
|
|
27
|
-
__defProp$1(target, Symbol.toStringTag, { value: "Module" });
|
|
28
|
-
}
|
|
20
|
+
for (var name in all$1) __defProp$1(target, name, {
|
|
21
|
+
get: all$1[name],
|
|
22
|
+
enumerable: true
|
|
23
|
+
});
|
|
24
|
+
if (!no_symbols) __defProp$1(target, Symbol.toStringTag, { value: "Module" });
|
|
29
25
|
return target;
|
|
30
26
|
};
|
|
31
27
|
var __copyProps = (to, from, except, desc) => {
|
|
32
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
enumerable: !(desc = __getOwnPropDesc(from, key$1)) || desc.enumerable
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
}
|
|
28
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i$2 = 0, n = keys.length, key$1; i$2 < n; i$2++) {
|
|
29
|
+
key$1 = keys[i$2];
|
|
30
|
+
if (!__hasOwnProp.call(to, key$1) && key$1 !== except) __defProp$1(to, key$1, {
|
|
31
|
+
get: ((k$2) => from[k$2]).bind(null, key$1),
|
|
32
|
+
enumerable: !(desc = __getOwnPropDesc(from, key$1)) || desc.enumerable
|
|
33
|
+
});
|
|
42
34
|
}
|
|
43
35
|
return to;
|
|
44
36
|
};
|
|
45
37
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
46
38
|
|
|
47
39
|
//#endregion
|
|
48
|
-
//#region ../../node_modules/.bun/@shikijs+types@4.0
|
|
40
|
+
//#region ../../node_modules/.bun/@shikijs+types@4.2.0/node_modules/@shikijs/types/dist/index.mjs
|
|
49
41
|
var ShikiError$1 = class extends Error {
|
|
50
42
|
constructor(message) {
|
|
51
43
|
super(message);
|
|
@@ -2911,7 +2903,7 @@ var Registry = class {
|
|
|
2911
2903
|
var INITIAL = StateStackImpl.NULL;
|
|
2912
2904
|
|
|
2913
2905
|
//#endregion
|
|
2914
|
-
//#region ../../node_modules/.bun/@shikijs+primitive@4.0
|
|
2906
|
+
//#region ../../node_modules/.bun/@shikijs+primitive@4.2.0/node_modules/@shikijs/primitive/dist/index.mjs
|
|
2915
2907
|
function resolveColorReplacements(theme, options) {
|
|
2916
2908
|
const replacements = typeof theme === "string" ? {} : { ...theme.colorReplacements };
|
|
2917
2909
|
const themeName = typeof theme === "string" ? theme : theme.name;
|
|
@@ -2923,8 +2915,8 @@ function applyColorReplacements(color, replacements) {
|
|
|
2923
2915
|
if (!color) return color;
|
|
2924
2916
|
return replacements?.[color?.toLowerCase()] || color;
|
|
2925
2917
|
}
|
|
2926
|
-
function toArray(x$
|
|
2927
|
-
return Array.isArray(x$
|
|
2918
|
+
function toArray(x$2) {
|
|
2919
|
+
return Array.isArray(x$2) ? x$2 : [x$2];
|
|
2928
2920
|
}
|
|
2929
2921
|
/**
|
|
2930
2922
|
* Normalize a getter to a promise.
|
|
@@ -2985,9 +2977,10 @@ function isSpecialTheme(theme) {
|
|
|
2985
2977
|
* // => [['hello\n', 0], ['world', 6]]
|
|
2986
2978
|
* ```
|
|
2987
2979
|
*/
|
|
2980
|
+
const RE_NEWLINE = /(\r?\n)/g;
|
|
2988
2981
|
function splitLines$1(code, preserveEnding = false) {
|
|
2989
2982
|
if (code.length === 0) return [["", 0]];
|
|
2990
|
-
const parts = code.split(
|
|
2983
|
+
const parts = code.split(RE_NEWLINE);
|
|
2991
2984
|
let index = 0;
|
|
2992
2985
|
const lines = [];
|
|
2993
2986
|
for (let i$2 = 0; i$2 < parts.length; i$2 += 2) {
|
|
@@ -3101,7 +3094,7 @@ function normalizeTheme(rawTheme) {
|
|
|
3101
3094
|
* Resolve
|
|
3102
3095
|
*/
|
|
3103
3096
|
async function resolveLangs(langs) {
|
|
3104
|
-
return
|
|
3097
|
+
return [...new Set((await Promise.all(langs.filter((l$2) => !isSpecialLang(l$2)).map(async (lang) => await normalizeGetter(lang).then((r$3) => Array.isArray(r$3) ? r$3 : [r$3])))).flat())];
|
|
3105
3098
|
}
|
|
3106
3099
|
async function resolveThemes(themes) {
|
|
3107
3100
|
return (await Promise.all(themes.map(async (theme) => isSpecialTheme(theme) ? null : normalizeTheme(await normalizeGetter(theme))))).filter((i$2) => !!i$2);
|
|
@@ -3112,13 +3105,17 @@ function resolveLangAlias(name, alias) {
|
|
|
3112
3105
|
const resolved = new Set([name]);
|
|
3113
3106
|
while (alias[name]) {
|
|
3114
3107
|
name = alias[name];
|
|
3115
|
-
if (resolved.has(name)) throw new ShikiError$1(`Circular alias \`${
|
|
3108
|
+
if (resolved.has(name)) throw new ShikiError$1(`Circular alias \`${[...resolved].join(" -> ")} -> ${name}\``);
|
|
3116
3109
|
resolved.add(name);
|
|
3117
3110
|
}
|
|
3118
3111
|
}
|
|
3119
3112
|
return name;
|
|
3120
3113
|
}
|
|
3121
3114
|
var Registry$1 = class extends Registry {
|
|
3115
|
+
_resolver;
|
|
3116
|
+
_themes;
|
|
3117
|
+
_langs;
|
|
3118
|
+
_alias;
|
|
3122
3119
|
_resolvedThemes = /* @__PURE__ */ new Map();
|
|
3123
3120
|
_resolvedGrammars = /* @__PURE__ */ new Map();
|
|
3124
3121
|
_langMap = /* @__PURE__ */ new Map();
|
|
@@ -3197,7 +3194,7 @@ var Registry$1 = class extends Registry {
|
|
|
3197
3194
|
}
|
|
3198
3195
|
loadLanguages(langs) {
|
|
3199
3196
|
for (const lang of langs) this.resolveEmbeddedLanguages(lang);
|
|
3200
|
-
const langsGraphArray =
|
|
3197
|
+
const langsGraphArray = [...this._langGraph.entries()];
|
|
3201
3198
|
const missingLangs = langsGraphArray.filter(([_$2, lang]) => !lang);
|
|
3202
3199
|
if (missingLangs.length) {
|
|
3203
3200
|
const dependents = langsGraphArray.filter(([_$2, lang]) => {
|
|
@@ -3463,6 +3460,8 @@ function getGrammarStack(state, theme) {
|
|
|
3463
3460
|
if (!(state instanceof GrammarState)) throw new ShikiError$1("Invalid grammar state");
|
|
3464
3461
|
return state.getInternalStack(theme);
|
|
3465
3462
|
}
|
|
3463
|
+
const RE_COMMA = /,/;
|
|
3464
|
+
const RE_SPACE = / /;
|
|
3466
3465
|
/**
|
|
3467
3466
|
* Code to tokens, with a simple theme.
|
|
3468
3467
|
*/
|
|
@@ -3553,7 +3552,7 @@ function _tokenizeWithTheme(code, grammar, theme, colorMap, options) {
|
|
|
3553
3552
|
let selectors;
|
|
3554
3553
|
switch (typeof setting.scope) {
|
|
3555
3554
|
case "string":
|
|
3556
|
-
selectors = setting.scope.split(
|
|
3555
|
+
selectors = setting.scope.split(RE_COMMA).map((scope) => scope.trim());
|
|
3557
3556
|
break;
|
|
3558
3557
|
case "object":
|
|
3559
3558
|
selectors = setting.scope;
|
|
@@ -3562,7 +3561,7 @@ function _tokenizeWithTheme(code, grammar, theme, colorMap, options) {
|
|
|
3562
3561
|
}
|
|
3563
3562
|
themeSettingsSelectors.push({
|
|
3564
3563
|
settings: setting,
|
|
3565
|
-
selectors: selectors.map((selector) => selector.split(
|
|
3564
|
+
selectors: selectors.map((selector) => selector.split(RE_SPACE))
|
|
3566
3565
|
});
|
|
3567
3566
|
}
|
|
3568
3567
|
token$1.explanation = [];
|
|
@@ -3607,7 +3606,7 @@ function matchesOne(selector, scope) {
|
|
|
3607
3606
|
return selector === scope || scope.substring(0, selector.length) === selector && scope[selector.length] === ".";
|
|
3608
3607
|
}
|
|
3609
3608
|
function matches(selectors, scope, parentScopes) {
|
|
3610
|
-
if (!matchesOne(selectors
|
|
3609
|
+
if (!matchesOne(selectors.at(-1), scope)) return false;
|
|
3611
3610
|
let selectorParentIndex = selectors.length - 2;
|
|
3612
3611
|
let parentIndex = parentScopes.length - 1;
|
|
3613
3612
|
while (selectorParentIndex >= 0 && parentIndex >= 0) {
|
|
@@ -6523,7 +6522,7 @@ function serializeAttributes(state, properties) {
|
|
|
6523
6522
|
*/
|
|
6524
6523
|
function serializeAttribute(state, key$1, value) {
|
|
6525
6524
|
const info = find(state.schema, key$1);
|
|
6526
|
-
const x$
|
|
6525
|
+
const x$2 = state.settings.allowParseErrors && state.schema.space === "html" ? 0 : 1;
|
|
6527
6526
|
const y$2 = state.settings.allowDangerousCharacters ? 0 : 1;
|
|
6528
6527
|
let quote = state.quote;
|
|
6529
6528
|
/** @type {string | undefined} */
|
|
@@ -6536,14 +6535,14 @@ function serializeAttribute(state, key$1, value) {
|
|
|
6536
6535
|
if (value === null || value === undefined || value === false || typeof value === "number" && Number.isNaN(value)) {
|
|
6537
6536
|
return "";
|
|
6538
6537
|
}
|
|
6539
|
-
const name = stringifyEntities(info.attribute, Object.assign({}, state.settings.characterReferences, { subset: constants.name[x$
|
|
6538
|
+
const name = stringifyEntities(info.attribute, Object.assign({}, state.settings.characterReferences, { subset: constants.name[x$2][y$2] }));
|
|
6540
6539
|
if (value === true) return name;
|
|
6541
6540
|
value = Array.isArray(value) ? (info.commaSeparated ? stringify$1 : stringify$2)(value, { padLeft: !state.settings.tightCommaSeparatedLists }) : String(value);
|
|
6542
6541
|
if (state.settings.collapseEmptyAttributes && !value) return name;
|
|
6543
6542
|
if (state.settings.preferUnquoted) {
|
|
6544
6543
|
result = stringifyEntities(value, Object.assign({}, state.settings.characterReferences, {
|
|
6545
6544
|
attribute: true,
|
|
6546
|
-
subset: constants.unquoted[x$
|
|
6545
|
+
subset: constants.unquoted[x$2][y$2]
|
|
6547
6546
|
}));
|
|
6548
6547
|
}
|
|
6549
6548
|
if (result !== value) {
|
|
@@ -6551,7 +6550,7 @@ function serializeAttribute(state, key$1, value) {
|
|
|
6551
6550
|
quote = state.alternative;
|
|
6552
6551
|
}
|
|
6553
6552
|
result = quote + stringifyEntities(value, Object.assign({}, state.settings.characterReferences, {
|
|
6554
|
-
subset: (quote === "'" ? constants.single : constants.double)[x$
|
|
6553
|
+
subset: (quote === "'" ? constants.single : constants.double)[x$2][y$2],
|
|
6555
6554
|
attribute: true
|
|
6556
6555
|
})) + quote;
|
|
6557
6556
|
}
|
|
@@ -6759,7 +6758,8 @@ function all(parent) {
|
|
|
6759
6758
|
}
|
|
6760
6759
|
|
|
6761
6760
|
//#endregion
|
|
6762
|
-
//#region ../../node_modules/.bun/@shikijs+core@4.0
|
|
6761
|
+
//#region ../../node_modules/.bun/@shikijs+core@4.2.0/node_modules/@shikijs/core/dist/index.mjs
|
|
6762
|
+
const RE_WHITESPACE = /\s+/g;
|
|
6763
6763
|
/**
|
|
6764
6764
|
* Utility to append class to a hast node
|
|
6765
6765
|
*
|
|
@@ -6769,12 +6769,16 @@ function addClassToHast(node, className) {
|
|
|
6769
6769
|
if (!className) return node;
|
|
6770
6770
|
node.properties ||= {};
|
|
6771
6771
|
node.properties.class ||= [];
|
|
6772
|
-
if (typeof node.properties.class === "string") node.properties.class = node.properties.class.split(
|
|
6772
|
+
if (typeof node.properties.class === "string") node.properties.class = node.properties.class.split(RE_WHITESPACE);
|
|
6773
6773
|
if (!Array.isArray(node.properties.class)) node.properties.class = [];
|
|
6774
|
-
const targets = Array.isArray(className) ? className : className.split(
|
|
6774
|
+
const targets = Array.isArray(className) ? className : className.split(RE_WHITESPACE);
|
|
6775
6775
|
for (const c of targets) if (c && !node.properties.class.includes(c)) node.properties.class.push(c);
|
|
6776
6776
|
return node;
|
|
6777
6777
|
}
|
|
6778
|
+
const RE_LANG_ATTR = /:?lang=["']([^"']+)["']/g;
|
|
6779
|
+
const RE_CODE_FENCE = /(?:```|~~~)([\w-]+)/g;
|
|
6780
|
+
const RE_LATEX_BEGIN = /\\begin\{([\w-]+)\}/g;
|
|
6781
|
+
const RE_SCRIPT_LANG = /<script\s+(?:type|lang)=["']([^"']+)["']/gi;
|
|
6778
6782
|
/**
|
|
6779
6783
|
* Creates a converter between index and position in a code block.
|
|
6780
6784
|
*
|
|
@@ -6785,7 +6789,7 @@ function createPositionConverter(code) {
|
|
|
6785
6789
|
function indexToPos(index) {
|
|
6786
6790
|
if (index === code.length) return {
|
|
6787
6791
|
line: lines.length - 1,
|
|
6788
|
-
character: lines
|
|
6792
|
+
character: lines.at(-1).length
|
|
6789
6793
|
};
|
|
6790
6794
|
let character = index;
|
|
6791
6795
|
let line = 0;
|
|
@@ -6832,28 +6836,27 @@ function createPositionConverter(code) {
|
|
|
6832
6836
|
*/
|
|
6833
6837
|
function guessEmbeddedLanguages(code, _lang, highlighter$1) {
|
|
6834
6838
|
const langs = /* @__PURE__ */ new Set();
|
|
6835
|
-
for (const match of code.matchAll(
|
|
6839
|
+
for (const match of code.matchAll(RE_LANG_ATTR)) {
|
|
6836
6840
|
const lang = match[1].toLowerCase().trim();
|
|
6837
6841
|
if (lang) langs.add(lang);
|
|
6838
6842
|
}
|
|
6839
|
-
for (const match of code.matchAll(
|
|
6843
|
+
for (const match of code.matchAll(RE_CODE_FENCE)) {
|
|
6840
6844
|
const lang = match[1].toLowerCase().trim();
|
|
6841
6845
|
if (lang) langs.add(lang);
|
|
6842
6846
|
}
|
|
6843
|
-
for (const match of code.matchAll(
|
|
6847
|
+
for (const match of code.matchAll(RE_LATEX_BEGIN)) {
|
|
6844
6848
|
const lang = match[1].toLowerCase().trim();
|
|
6845
6849
|
if (lang) langs.add(lang);
|
|
6846
6850
|
}
|
|
6847
|
-
for (const match of code.matchAll(
|
|
6851
|
+
for (const match of code.matchAll(RE_SCRIPT_LANG)) {
|
|
6848
6852
|
const fullType = match[1].toLowerCase().trim();
|
|
6849
6853
|
const lang = fullType.includes("/") ? fullType.split("/").pop() : fullType;
|
|
6850
6854
|
if (lang) langs.add(lang);
|
|
6851
6855
|
}
|
|
6852
|
-
if (!highlighter$1) return
|
|
6856
|
+
if (!highlighter$1) return [...langs];
|
|
6853
6857
|
const bundle = highlighter$1.getBundledLanguages();
|
|
6854
|
-
return
|
|
6858
|
+
return [...langs].filter((l$2) => l$2 && bundle[l$2]);
|
|
6855
6859
|
}
|
|
6856
|
-
const DEFAULT_COLOR_LIGHT_DARK = "light-dark()";
|
|
6857
6860
|
const COLOR_KEYS = ["color", "background-color"];
|
|
6858
6861
|
/**
|
|
6859
6862
|
* Split a token into multiple tokens by given offsets.
|
|
@@ -6882,7 +6885,7 @@ function splitToken(token$1, offsets) {
|
|
|
6882
6885
|
* Split 2D tokens array by given breakpoints.
|
|
6883
6886
|
*/
|
|
6884
6887
|
function splitTokens(tokens, breakpoints) {
|
|
6885
|
-
const sorted =
|
|
6888
|
+
const sorted = [...breakpoints instanceof Set ? breakpoints : new Set(breakpoints)].sort((a$1, b$2) => a$1 - b$2);
|
|
6886
6889
|
if (!sorted.length) return tokens;
|
|
6887
6890
|
return tokens.map((line) => {
|
|
6888
6891
|
return line.flatMap((token$1) => {
|
|
@@ -6908,7 +6911,7 @@ function flatTokenVariants(merged, variantsOrder, cssVariablePrefix, defaultColo
|
|
|
6908
6911
|
styles.forEach((cur, idx) => {
|
|
6909
6912
|
for (const key$1 of styleKeys) {
|
|
6910
6913
|
const value = cur[key$1] || "inherit";
|
|
6911
|
-
if (idx === 0 && defaultColor && COLOR_KEYS.includes(key$1)) if (defaultColor ===
|
|
6914
|
+
if (idx === 0 && defaultColor && COLOR_KEYS.includes(key$1)) if (defaultColor === "light-dark()" && styles.length > 1) {
|
|
6912
6915
|
const lightIndex = variantsOrder.findIndex((t) => t === "light");
|
|
6913
6916
|
const darkIndex = variantsOrder.findIndex((t) => t === "dark");
|
|
6914
6917
|
if (lightIndex === -1 || darkIndex === -1) throw new ShikiError$1("When using `defaultColor: \"light-dark()\"`, you must provide both `light` and `dark` themes");
|
|
@@ -6990,7 +6993,7 @@ function transformerDecorations() {
|
|
|
6990
6993
|
code(codeEl) {
|
|
6991
6994
|
if (!this.options.decorations?.length) return;
|
|
6992
6995
|
const ctx = getContext(this);
|
|
6993
|
-
const lines =
|
|
6996
|
+
const lines = [...codeEl.children].filter((i$2) => i$2.type === "element" && i$2.tagName === "span");
|
|
6994
6997
|
if (lines.length !== ctx.converter.lines.length) throw new ShikiError$1(`Number of lines in code element (${lines.length}) does not match the number of lines in the source (${ctx.converter.lines.length}). Failed to apply decorations.`);
|
|
6995
6998
|
function applyLineSection(line, start, end, decoration) {
|
|
6996
6999
|
const lineEl = lines[line];
|
|
@@ -7150,8 +7153,8 @@ function findSequence(value, position) {
|
|
|
7150
7153
|
function parseColor(sequence) {
|
|
7151
7154
|
const colorMode = sequence.shift();
|
|
7152
7155
|
if (colorMode === "2") {
|
|
7153
|
-
const rgb = sequence.splice(0, 3).map((x$
|
|
7154
|
-
if (rgb.length !== 3 || rgb.some((x$
|
|
7156
|
+
const rgb = sequence.splice(0, 3).map((x$2) => Number.parseInt(x$2));
|
|
7157
|
+
if (rgb.length !== 3 || rgb.some((x$2) => Number.isNaN(x$2))) return;
|
|
7155
7158
|
return {
|
|
7156
7159
|
type: "rgb",
|
|
7157
7160
|
rgb
|
|
@@ -7299,7 +7302,7 @@ function createColorPalette(namedColorsMap = defaultNamedColorsMap) {
|
|
|
7299
7302
|
return namedColorsMap[name];
|
|
7300
7303
|
}
|
|
7301
7304
|
function rgbColor(rgb) {
|
|
7302
|
-
return `#${rgb.map((x$
|
|
7305
|
+
return `#${rgb.map((x$2) => Math.max(0, Math.min(x$2, 255)).toString(16).padStart(2, "0")).join("")}`;
|
|
7303
7306
|
}
|
|
7304
7307
|
let colorTable;
|
|
7305
7308
|
function getColorTable() {
|
|
@@ -7339,6 +7342,8 @@ function createColorPalette(namedColorsMap = defaultNamedColorsMap) {
|
|
|
7339
7342
|
}
|
|
7340
7343
|
return { value };
|
|
7341
7344
|
}
|
|
7345
|
+
const RE_HEX_COLOR = /#([0-9a-f]{3,8})/i;
|
|
7346
|
+
const RE_CSS_VAR_ANSI = /var\((--[\w-]+-ansi-[\w-]+)\)/;
|
|
7342
7347
|
/**
|
|
7343
7348
|
* Default ANSI palette (VSCode compatible fallbacks)
|
|
7344
7349
|
* Used when the theme does not define terminal.ansi* colors.
|
|
@@ -7400,7 +7405,7 @@ function tokenizeAnsiWithTheme(theme, fileContents, options) {
|
|
|
7400
7405
|
* Adds 50% alpha to a hex color string or the "-dim" postfix to a CSS variable
|
|
7401
7406
|
*/
|
|
7402
7407
|
function dimColor(color) {
|
|
7403
|
-
const hexMatch = color.match(
|
|
7408
|
+
const hexMatch = color.match(RE_HEX_COLOR);
|
|
7404
7409
|
if (hexMatch) {
|
|
7405
7410
|
const hex = hexMatch[1];
|
|
7406
7411
|
if (hex.length === 8) {
|
|
@@ -7420,7 +7425,7 @@ function dimColor(color) {
|
|
|
7420
7425
|
return `#${r$3}${r$3}${g}${g}${b$2}${b$2}80`;
|
|
7421
7426
|
}
|
|
7422
7427
|
}
|
|
7423
|
-
const cssVarMatch = color.match(
|
|
7428
|
+
const cssVarMatch = color.match(RE_CSS_VAR_ANSI);
|
|
7424
7429
|
if (cssVarMatch) return `var(${cssVarMatch[1]}-dim)`;
|
|
7425
7430
|
return color;
|
|
7426
7431
|
}
|
|
@@ -7458,7 +7463,7 @@ function codeToTokens(primitive, code, options) {
|
|
|
7458
7463
|
if (themes.length === 0) throw new ShikiError$1("`themes` option must not be empty");
|
|
7459
7464
|
const themeTokens = codeToTokensWithThemes(primitive, code, options, codeToTokensBase$1);
|
|
7460
7465
|
grammarState = getLastGrammarStateFromMap(themeTokens);
|
|
7461
|
-
if (defaultColor &&
|
|
7466
|
+
if (defaultColor && "light-dark()" !== defaultColor && !themes.some((t) => t.color === defaultColor)) throw new ShikiError$1(`\`themes\` option must contain the defaultColor key \`${defaultColor}\``);
|
|
7462
7467
|
const themeRegs = themes.map((t) => primitive.getTheme(t.theme));
|
|
7463
7468
|
const themesOrder = themes.map((t) => t.color);
|
|
7464
7469
|
tokens = themeTokens.map((line) => line.map((token$1) => flatTokenVariants(token$1, themesOrder, cssVariablePrefix, defaultColor, colorsRendering)));
|
|
@@ -7491,7 +7496,7 @@ function mapThemeColors(themes, themeRegs, themeColorReplacements, cssVariablePr
|
|
|
7491
7496
|
const value = applyColorReplacements(themeRegs[idx][property], themeColorReplacements[idx]) || "inherit";
|
|
7492
7497
|
const cssVar = `${cssVariablePrefix + t.color}${property === "bg" ? "-bg" : ""}:${value}`;
|
|
7493
7498
|
if (idx === 0 && defaultColor) {
|
|
7494
|
-
if (defaultColor ===
|
|
7499
|
+
if (defaultColor === "light-dark()" && themes.length > 1) {
|
|
7495
7500
|
const lightIndex = themes.findIndex((t$1) => t$1.color === "light");
|
|
7496
7501
|
const darkIndex = themes.findIndex((t$1) => t$1.color === "dark");
|
|
7497
7502
|
if (lightIndex === -1 || darkIndex === -1) throw new ShikiError$1("When using `defaultColor: \"light-dark()\"`, you must provide both `light` and `dark` themes");
|
|
@@ -7503,6 +7508,8 @@ function mapThemeColors(themes, themeRegs, themeColorReplacements, cssVariablePr
|
|
|
7503
7508
|
return null;
|
|
7504
7509
|
}).filter((i$2) => !!i$2).join(";");
|
|
7505
7510
|
}
|
|
7511
|
+
const RE_WHITESPACE_ONLY = /^\s+$/;
|
|
7512
|
+
const RE_LEADING_TRAILING_WHITESPACE = /^(\s*)(.*?)(\s*)$/;
|
|
7506
7513
|
function codeToHast(primitive, code, options, transformerContext = {
|
|
7507
7514
|
meta: {},
|
|
7508
7515
|
options,
|
|
@@ -7681,7 +7688,7 @@ function mergeWhitespaceTokens(tokens) {
|
|
|
7681
7688
|
let firstOffset;
|
|
7682
7689
|
line.forEach((token$1, idx) => {
|
|
7683
7690
|
const couldMerge = !(token$1.fontStyle && (token$1.fontStyle & FontStyle.Underline || token$1.fontStyle & FontStyle.Strikethrough));
|
|
7684
|
-
if (couldMerge && token$1.content
|
|
7691
|
+
if (couldMerge && RE_WHITESPACE_ONLY.test(token$1.content) && line[idx + 1]) {
|
|
7685
7692
|
if (firstOffset === void 0) firstOffset = token$1.offset;
|
|
7686
7693
|
carryOnContent += token$1.content;
|
|
7687
7694
|
} else if (carryOnContent) {
|
|
@@ -7704,8 +7711,8 @@ function mergeWhitespaceTokens(tokens) {
|
|
|
7704
7711
|
function splitWhitespaceTokens(tokens) {
|
|
7705
7712
|
return tokens.map((line) => {
|
|
7706
7713
|
return line.flatMap((token$1) => {
|
|
7707
|
-
if (token$1.content
|
|
7708
|
-
const match = token$1.content.match(
|
|
7714
|
+
if (RE_WHITESPACE_ONLY.test(token$1.content)) return token$1;
|
|
7715
|
+
const match = token$1.content.match(RE_LEADING_TRAILING_WHITESPACE);
|
|
7709
7716
|
if (!match) return token$1;
|
|
7710
7717
|
const [, leading, content, trailing] = match;
|
|
7711
7718
|
if (!leading && !trailing) return token$1;
|
|
@@ -7734,7 +7741,7 @@ function mergeAdjacentStyledTokens(tokens) {
|
|
|
7734
7741
|
newLine.push({ ...token$1 });
|
|
7735
7742
|
continue;
|
|
7736
7743
|
}
|
|
7737
|
-
const prevToken = newLine
|
|
7744
|
+
const prevToken = newLine.at(-1);
|
|
7738
7745
|
const prevStyle = stringifyTokenStyle(prevToken.htmlStyle || getTokenStyleObject(prevToken));
|
|
7739
7746
|
const currentStyle = stringifyTokenStyle(token$1.htmlStyle || getTokenStyleObject(token$1));
|
|
7740
7747
|
const isPrevDecorated = prevToken.fontStyle && (prevToken.fontStyle & FontStyle.Underline || prevToken.fontStyle & FontStyle.Strikethrough);
|
|
@@ -8126,9 +8133,11 @@ function createCssVariablesTheme(options = {}) {
|
|
|
8126
8133
|
}
|
|
8127
8134
|
|
|
8128
8135
|
//#endregion
|
|
8129
|
-
//#region ../../node_modules/.bun/@shikijs+engine-javascript@4.0
|
|
8136
|
+
//#region ../../node_modules/.bun/@shikijs+engine-javascript@4.2.0/node_modules/@shikijs/engine-javascript/dist/scanner-DX8LRFGE.mjs
|
|
8130
8137
|
const MAX = 4294967295;
|
|
8131
8138
|
var JavaScriptScanner = class {
|
|
8139
|
+
patterns;
|
|
8140
|
+
options;
|
|
8132
8141
|
regexps;
|
|
8133
8142
|
constructor(patterns, options = {}) {
|
|
8134
8143
|
this.patterns = patterns;
|
|
@@ -8201,7 +8210,7 @@ var JavaScriptScanner = class {
|
|
|
8201
8210
|
};
|
|
8202
8211
|
|
|
8203
8212
|
//#endregion
|
|
8204
|
-
//#region ../../node_modules/.bun/oniguruma-parser@0.12.
|
|
8213
|
+
//#region ../../node_modules/.bun/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/utils.js
|
|
8205
8214
|
function r$2(e) {
|
|
8206
8215
|
if ([...e].length !== 1) throw new Error(`Expected "${e}" to be a single code point`);
|
|
8207
8216
|
return e.codePointAt(0);
|
|
@@ -8231,7 +8240,7 @@ function u(e, t) {
|
|
|
8231
8240
|
}
|
|
8232
8241
|
|
|
8233
8242
|
//#endregion
|
|
8234
|
-
//#region ../../node_modules/.bun/oniguruma-parser@0.12.
|
|
8243
|
+
//#region ../../node_modules/.bun/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/tokenizer/tokenize.js
|
|
8235
8244
|
const m$1 = o$1`\[\^?`, b$1 = `c.? | C(?:-.?)?|${o$1`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${o$1`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${o$1`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${o$1`o\{[^\}]*\}?`}|${o$1`\d{1,3}`}`, y$1 = /[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/, C$1 = new RegExp(o$1`
|
|
8236
8245
|
\\ (?:
|
|
8237
8246
|
${b$1}
|
|
@@ -8333,7 +8342,7 @@ function F$1(e, n, t, o$2) {
|
|
|
8333
8342
|
if (a$1 === "N" || a$1 === "R") return { token: k$1("newline", t, { negate: a$1 === "N" }) };
|
|
8334
8343
|
if (a$1 === "O") return { token: k$1("any", t) };
|
|
8335
8344
|
if (a$1 === "X") return { token: k$1("text_segment", t) };
|
|
8336
|
-
const r$3 = x(t, { inCharClass: !1 });
|
|
8345
|
+
const r$3 = x$1(t, { inCharClass: !1 });
|
|
8337
8346
|
return Array.isArray(r$3) ? { tokens: r$3 } : { token: r$3 };
|
|
8338
8347
|
}
|
|
8339
8348
|
if (s$1 === "(") {
|
|
@@ -8344,13 +8353,13 @@ function F$1(e, n, t, o$2) {
|
|
|
8344
8353
|
return { lastIndex: o$2 + 1 };
|
|
8345
8354
|
}
|
|
8346
8355
|
if (/^\(\?[-imx]+[:)]$/.test(t)) return { token: L$1(t, e) };
|
|
8347
|
-
if (e.pushModX(e.getCurrentModX()), e.numOpenGroups++, t === "(" && !e.captureGroup || t === "(?:") return { token: f
|
|
8348
|
-
if (t === "(?>") return { token: f
|
|
8349
|
-
if (t === "(?=" || t === "(?!" || t === "(?<=" || t === "(?<!") return { token: f
|
|
8350
|
-
if (t === "(" && e.captureGroup || t.startsWith("(?<") && t.endsWith(">") || t.startsWith("(?'") && t.endsWith("'")) return { token: f
|
|
8356
|
+
if (e.pushModX(e.getCurrentModX()), e.numOpenGroups++, t === "(" && !e.captureGroup || t === "(?:") return { token: f("group", t) };
|
|
8357
|
+
if (t === "(?>") return { token: f("atomic", t) };
|
|
8358
|
+
if (t === "(?=" || t === "(?!" || t === "(?<=" || t === "(?<!") return { token: f(t[2] === "<" ? "lookbehind" : "lookahead", t, { negate: t.endsWith("!") }) };
|
|
8359
|
+
if (t === "(" && e.captureGroup || t.startsWith("(?<") && t.endsWith(">") || t.startsWith("(?'") && t.endsWith("'")) return { token: f("capturing", t, { ...t !== "(" && { name: t.slice(3, -1) } }) };
|
|
8351
8360
|
if (t.startsWith("(?~")) {
|
|
8352
8361
|
if (t === "(?~|") throw new Error(`Unsupported absence function kind "${t}"`);
|
|
8353
|
-
return { token: f
|
|
8362
|
+
return { token: f("absence_repeater", t) };
|
|
8354
8363
|
}
|
|
8355
8364
|
throw t === "(?(" ? new Error(`Unsupported conditional "${t}"`) : new Error(`Invalid or unsupported group option "${t}"`);
|
|
8356
8365
|
}
|
|
@@ -8399,7 +8408,7 @@ function K$1(e, n, t) {
|
|
|
8399
8408
|
};
|
|
8400
8409
|
}
|
|
8401
8410
|
function X$1(e) {
|
|
8402
|
-
if (e[0] === "\\") return x(e, { inCharClass: !0 });
|
|
8411
|
+
if (e[0] === "\\") return x$1(e, { inCharClass: !0 });
|
|
8403
8412
|
if (e[0] === "[") {
|
|
8404
8413
|
const n = /\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);
|
|
8405
8414
|
if (!n || !i.has(n.groups.name)) throw new Error(`Invalid POSIX class "${e}"`);
|
|
@@ -8410,7 +8419,7 @@ function X$1(e) {
|
|
|
8410
8419
|
}
|
|
8411
8420
|
return e === "-" ? U$1(e) : e === "&&" ? H(e) : d(r$2(e), e);
|
|
8412
8421
|
}
|
|
8413
|
-
function x(e, { inCharClass: n }) {
|
|
8422
|
+
function x$1(e, { inCharClass: n }) {
|
|
8414
8423
|
const t = e[1];
|
|
8415
8424
|
if (t === "c" || t === "C") return Z(e);
|
|
8416
8425
|
if ("dDhHsSwW".includes(t)) return q(e);
|
|
@@ -8523,7 +8532,7 @@ function Q$1(e) {
|
|
|
8523
8532
|
raw: e
|
|
8524
8533
|
};
|
|
8525
8534
|
}
|
|
8526
|
-
function f
|
|
8535
|
+
function f(e, n, t = {}) {
|
|
8527
8536
|
return {
|
|
8528
8537
|
type: "GroupOpen",
|
|
8529
8538
|
kind: e,
|
|
@@ -8584,7 +8593,7 @@ function L$1(e, n) {
|
|
|
8584
8593
|
o$2 ??= "";
|
|
8585
8594
|
const s$1 = (n.getCurrentModX() || t.includes("x")) && !o$2.includes("x"), a$1 = v(t), r$3 = v(o$2), i$2 = {};
|
|
8586
8595
|
if (a$1 && (i$2.enable = a$1), r$3 && (i$2.disable = r$3), e.endsWith(")")) return n.replaceCurrentModX(s$1), I$1("flags", e, { flags: i$2 });
|
|
8587
|
-
if (e.endsWith(":")) return n.pushModX(s$1), n.numOpenGroups++, f
|
|
8596
|
+
if (e.endsWith(":")) return n.pushModX(s$1), n.numOpenGroups++, f("group", e, { ...(a$1 || r$3) && { flags: i$2 } });
|
|
8588
8597
|
throw new Error(`Unexpected flag modifier "${e}"`);
|
|
8589
8598
|
}
|
|
8590
8599
|
function j(e) {
|
|
@@ -8728,7 +8737,7 @@ function te$1(e) {
|
|
|
8728
8737
|
}
|
|
8729
8738
|
|
|
8730
8739
|
//#endregion
|
|
8731
|
-
//#region ../../node_modules/.bun/oniguruma-parser@0.12.
|
|
8740
|
+
//#region ../../node_modules/.bun/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/parser/node-utils.js
|
|
8732
8741
|
function o(e, t) {
|
|
8733
8742
|
if (!Array.isArray(e.body)) throw new Error("Expected node with body array");
|
|
8734
8743
|
if (e.body.length !== 1) return !1;
|
|
@@ -8761,7 +8770,7 @@ const y = new Set([
|
|
|
8761
8770
|
]);
|
|
8762
8771
|
|
|
8763
8772
|
//#endregion
|
|
8764
|
-
//#region ../../node_modules/.bun/oniguruma-parser@0.12.
|
|
8773
|
+
//#region ../../node_modules/.bun/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/parser/parse.js
|
|
8765
8774
|
function J(e, r$3 = {}) {
|
|
8766
8775
|
const n = {
|
|
8767
8776
|
flags: "",
|
|
@@ -8776,30 +8785,30 @@ function J(e, r$3 = {}) {
|
|
|
8776
8785
|
singleline: !1,
|
|
8777
8786
|
...r$3.rules
|
|
8778
8787
|
}
|
|
8779
|
-
},
|
|
8788
|
+
}, o$2 = M(e, {
|
|
8780
8789
|
flags: n.flags,
|
|
8781
8790
|
rules: {
|
|
8782
8791
|
captureGroup: n.rules.captureGroup,
|
|
8783
8792
|
singleline: n.rules.singleline
|
|
8784
8793
|
}
|
|
8785
|
-
}),
|
|
8786
|
-
const u$1 =
|
|
8787
|
-
switch (
|
|
8794
|
+
}), i$2 = (p$1, N) => {
|
|
8795
|
+
const u$1 = o$2.tokens[t.nextIndex];
|
|
8796
|
+
switch (t.parent = p$1, t.nextIndex++, u$1.type) {
|
|
8788
8797
|
case "Alternator": return b();
|
|
8789
8798
|
case "Assertion": return W(u$1);
|
|
8790
|
-
case "Backreference": return X(u$1,
|
|
8799
|
+
case "Backreference": return X(u$1, t);
|
|
8791
8800
|
case "Character": return m(u$1.value, { useLastValid: !!N.isCheckingRangeEnd });
|
|
8792
|
-
case "CharacterClassHyphen": return ee(u$1,
|
|
8793
|
-
case "CharacterClassOpen": return re(u$1,
|
|
8794
|
-
case "CharacterSet": return ne(u$1,
|
|
8801
|
+
case "CharacterClassHyphen": return ee(u$1, t, N);
|
|
8802
|
+
case "CharacterClassOpen": return re(u$1, t, N);
|
|
8803
|
+
case "CharacterSet": return ne(u$1, t);
|
|
8795
8804
|
case "Directive": return I(u$1.kind, { flags: u$1.flags });
|
|
8796
|
-
case "GroupOpen": return te(u$1,
|
|
8805
|
+
case "GroupOpen": return te(u$1, t, N);
|
|
8797
8806
|
case "NamedCallout": return U(u$1.kind, u$1.tag, u$1.arguments);
|
|
8798
|
-
case "Quantifier": return oe(u$1,
|
|
8799
|
-
case "Subroutine": return ae(u$1,
|
|
8807
|
+
case "Quantifier": return oe(u$1, t);
|
|
8808
|
+
case "Subroutine": return ae(u$1, t);
|
|
8800
8809
|
default: throw new Error(`Unexpected token type "${u$1.type}"`);
|
|
8801
8810
|
}
|
|
8802
|
-
},
|
|
8811
|
+
}, t = {
|
|
8803
8812
|
capturingGroups: [],
|
|
8804
8813
|
hasNumberedRef: !1,
|
|
8805
8814
|
namedGroupsByName: new Map(),
|
|
@@ -8810,25 +8819,25 @@ function J(e, r$3 = {}) {
|
|
|
8810
8819
|
skipLookbehindValidation: n.skipLookbehindValidation,
|
|
8811
8820
|
skipPropertyNameValidation: n.skipPropertyNameValidation,
|
|
8812
8821
|
subroutines: [],
|
|
8813
|
-
tokens:
|
|
8822
|
+
tokens: o$2.tokens,
|
|
8814
8823
|
unicodePropertyMap: n.unicodePropertyMap,
|
|
8815
|
-
walk:
|
|
8816
|
-
},
|
|
8817
|
-
let
|
|
8818
|
-
for (;
|
|
8819
|
-
const p$1 =
|
|
8820
|
-
p$1.type === "Alternative" ? (
|
|
8821
|
-
}
|
|
8822
|
-
const { capturingGroups: a$1, hasNumberedRef: l$2, namedGroupsByName: c, subroutines: f$
|
|
8824
|
+
walk: i$2
|
|
8825
|
+
}, d$1 = B(T(o$2.flags));
|
|
8826
|
+
let s$1 = d$1.body[0];
|
|
8827
|
+
for (; t.nextIndex < o$2.tokens.length;) {
|
|
8828
|
+
const p$1 = i$2(s$1, {});
|
|
8829
|
+
p$1.type === "Alternative" ? (d$1.body.push(p$1), s$1 = p$1) : s$1.body.push(p$1);
|
|
8830
|
+
}
|
|
8831
|
+
const { capturingGroups: a$1, hasNumberedRef: l$2, namedGroupsByName: c, subroutines: f$1 } = t;
|
|
8823
8832
|
if (l$2 && c.size && !n.rules.captureGroup) throw new Error("Numbered backref/subroutine not allowed when using named capture");
|
|
8824
|
-
for (const { ref: p$1 } of f$
|
|
8833
|
+
for (const { ref: p$1 } of f$1) if (typeof p$1 == "number") {
|
|
8825
8834
|
if (p$1 > a$1.length) throw new Error("Subroutine uses a group number that's not defined");
|
|
8826
8835
|
p$1 && (a$1[p$1 - 1].isSubroutined = !0);
|
|
8827
8836
|
} else if (c.has(p$1)) {
|
|
8828
8837
|
if (c.get(p$1).length > 1) throw new Error(o$1`Subroutine uses a duplicate group name "\g<${p$1}>"`);
|
|
8829
8838
|
c.get(p$1)[0].isSubroutined = !0;
|
|
8830
8839
|
} else throw new Error(o$1`Subroutine uses a group name that's not defined "\g<${p$1}>"`);
|
|
8831
|
-
return
|
|
8840
|
+
return d$1;
|
|
8832
8841
|
}
|
|
8833
8842
|
function W({ kind: e }) {
|
|
8834
8843
|
return F(u({
|
|
@@ -8845,106 +8854,106 @@ function W({ kind: e }) {
|
|
|
8845
8854
|
}[e], `Unexpected assertion kind "${e}"`), { negate: e === o$1`\B` || e === o$1`\Y` });
|
|
8846
8855
|
}
|
|
8847
8856
|
function X({ raw: e }, r$3) {
|
|
8848
|
-
const n = /^\\k[<']/.test(e),
|
|
8849
|
-
const
|
|
8857
|
+
const n = /^\\k[<']/.test(e), o$2 = n ? e.slice(3, -1) : e.slice(1), i$2 = (t, d$1 = !1) => {
|
|
8858
|
+
const s$1 = r$3.capturingGroups.length;
|
|
8850
8859
|
let a$1 = !1;
|
|
8851
|
-
if (
|
|
8860
|
+
if (t > s$1) if (r$3.skipBackrefValidation) a$1 = !0;
|
|
8852
8861
|
else throw new Error(`Not enough capturing groups defined to the left "${e}"`);
|
|
8853
|
-
return r$3.hasNumberedRef = !0, k(
|
|
8862
|
+
return r$3.hasNumberedRef = !0, k(d$1 ? s$1 + 1 - t : t, { orphan: a$1 });
|
|
8854
8863
|
};
|
|
8855
8864
|
if (n) {
|
|
8856
|
-
const
|
|
8857
|
-
if (
|
|
8858
|
-
if (/[-+]/.test(
|
|
8859
|
-
if (!r$3.namedGroupsByName.has(
|
|
8860
|
-
return k(
|
|
8865
|
+
const t = /^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(o$2);
|
|
8866
|
+
if (t) return i$2(+t.groups.num, !!t.groups.sign);
|
|
8867
|
+
if (/[-+]/.test(o$2)) throw new Error(`Invalid backref name "${e}"`);
|
|
8868
|
+
if (!r$3.namedGroupsByName.has(o$2)) throw new Error(`Group name not defined to the left "${e}"`);
|
|
8869
|
+
return k(o$2);
|
|
8861
8870
|
}
|
|
8862
|
-
return
|
|
8871
|
+
return i$2(+o$2);
|
|
8863
8872
|
}
|
|
8864
8873
|
function ee(e, r$3, n) {
|
|
8865
|
-
const { tokens:
|
|
8866
|
-
if (!n.isCheckingRangeEnd &&
|
|
8867
|
-
const a$1 =
|
|
8874
|
+
const { tokens: o$2, walk: i$2 } = r$3, t = r$3.parent, d$1 = t.body.at(-1), s$1 = o$2[r$3.nextIndex];
|
|
8875
|
+
if (!n.isCheckingRangeEnd && d$1 && d$1.type !== "CharacterClass" && d$1.type !== "CharacterClassRange" && s$1 && s$1.type !== "CharacterClassOpen" && s$1.type !== "CharacterClassClose" && s$1.type !== "CharacterClassIntersector") {
|
|
8876
|
+
const a$1 = i$2(t, {
|
|
8868
8877
|
...n,
|
|
8869
8878
|
isCheckingRangeEnd: !0
|
|
8870
8879
|
});
|
|
8871
|
-
if (
|
|
8880
|
+
if (d$1.type === "Character" && a$1.type === "Character") return t.body.pop(), L(d$1, a$1);
|
|
8872
8881
|
throw new Error("Invalid character class range");
|
|
8873
8882
|
}
|
|
8874
8883
|
return m(r$2("-"));
|
|
8875
8884
|
}
|
|
8876
8885
|
function re({ negate: e }, r$3, n) {
|
|
8877
|
-
const { tokens:
|
|
8878
|
-
let
|
|
8879
|
-
for (;
|
|
8880
|
-
if (
|
|
8886
|
+
const { tokens: o$2, walk: i$2 } = r$3, t = [C()], d$1 = o$2[r$3.nextIndex];
|
|
8887
|
+
let s$1 = z(d$1);
|
|
8888
|
+
for (; s$1.type !== "CharacterClassClose";) {
|
|
8889
|
+
if (s$1.type === "CharacterClassIntersector") t.push(C()), r$3.nextIndex++;
|
|
8881
8890
|
else {
|
|
8882
|
-
const l$2 =
|
|
8883
|
-
l$2.body.push(
|
|
8891
|
+
const l$2 = t.at(-1);
|
|
8892
|
+
l$2.body.push(i$2(l$2, n));
|
|
8884
8893
|
}
|
|
8885
|
-
|
|
8894
|
+
s$1 = z(o$2[r$3.nextIndex], d$1);
|
|
8886
8895
|
}
|
|
8887
8896
|
const a$1 = C({ negate: e });
|
|
8888
|
-
return
|
|
8897
|
+
return t.length === 1 ? a$1.body = t[0].body : (a$1.kind = "intersection", a$1.body = t.map((l$2) => l$2.body.length === 1 ? l$2.body[0] : l$2)), r$3.nextIndex++, a$1;
|
|
8889
8898
|
}
|
|
8890
|
-
function ne({ kind: e, negate: r$3, value: n },
|
|
8891
|
-
const { normalizeUnknownPropertyNames:
|
|
8899
|
+
function ne({ kind: e, negate: r$3, value: n }, o$2) {
|
|
8900
|
+
const { normalizeUnknownPropertyNames: i$2, skipPropertyNameValidation: t, unicodePropertyMap: d$1 } = o$2;
|
|
8892
8901
|
if (e === "property") {
|
|
8893
|
-
const
|
|
8894
|
-
if (i.has(
|
|
8902
|
+
const s$1 = w(n);
|
|
8903
|
+
if (i.has(s$1) && !d$1?.has(s$1)) e = "posix", n = s$1;
|
|
8895
8904
|
else return Q(n, {
|
|
8896
8905
|
negate: r$3,
|
|
8897
|
-
normalizeUnknownPropertyNames:
|
|
8898
|
-
skipPropertyNameValidation:
|
|
8899
|
-
unicodePropertyMap:
|
|
8906
|
+
normalizeUnknownPropertyNames: i$2,
|
|
8907
|
+
skipPropertyNameValidation: t,
|
|
8908
|
+
unicodePropertyMap: d$1
|
|
8900
8909
|
});
|
|
8901
8910
|
}
|
|
8902
8911
|
return e === "posix" ? R(n, { negate: r$3 }) : E(e, { negate: r$3 });
|
|
8903
8912
|
}
|
|
8904
8913
|
function te(e, r$3, n) {
|
|
8905
|
-
const { tokens:
|
|
8906
|
-
if (a$1.type === "CapturingGroup" && (
|
|
8907
|
-
let p$1 = D(
|
|
8914
|
+
const { tokens: o$2, capturingGroups: i$2, namedGroupsByName: t, skipLookbehindValidation: d$1, walk: s$1 } = r$3, a$1 = ie(e), l$2 = a$1.type === "AbsenceFunction", c = $(a$1), f$1 = c && a$1.negate;
|
|
8915
|
+
if (a$1.type === "CapturingGroup" && (i$2.push(a$1), a$1.name && l$1(t, a$1.name, []).push(a$1)), l$2 && n.isInAbsenceFunction) throw new Error("Nested absence function not supported by Oniguruma");
|
|
8916
|
+
let p$1 = D(o$2[r$3.nextIndex]);
|
|
8908
8917
|
for (; p$1.type !== "GroupClose";) {
|
|
8909
8918
|
if (p$1.type === "Alternator") a$1.body.push(b()), r$3.nextIndex++;
|
|
8910
8919
|
else {
|
|
8911
|
-
const N = a$1.body.at(-1), u$1 =
|
|
8920
|
+
const N = a$1.body.at(-1), u$1 = s$1(N, {
|
|
8912
8921
|
...n,
|
|
8913
8922
|
isInAbsenceFunction: n.isInAbsenceFunction || l$2,
|
|
8914
8923
|
isInLookbehind: n.isInLookbehind || c,
|
|
8915
|
-
isInNegLookbehind: n.isInNegLookbehind || f$
|
|
8924
|
+
isInNegLookbehind: n.isInNegLookbehind || f$1
|
|
8916
8925
|
});
|
|
8917
|
-
if (N.body.push(u$1), (c || n.isInLookbehind) && !
|
|
8926
|
+
if (N.body.push(u$1), (c || n.isInLookbehind) && !d$1) {
|
|
8918
8927
|
const v$1 = "Lookbehind includes a pattern not allowed by Oniguruma";
|
|
8919
|
-
if (f$
|
|
8928
|
+
if (f$1 || n.isInNegLookbehind) {
|
|
8920
8929
|
if (M$1(u$1) || u$1.type === "CapturingGroup") throw new Error(v$1);
|
|
8921
8930
|
} else if (M$1(u$1) || $(u$1) && u$1.negate) throw new Error(v$1);
|
|
8922
8931
|
}
|
|
8923
8932
|
}
|
|
8924
|
-
p$1 = D(
|
|
8933
|
+
p$1 = D(o$2[r$3.nextIndex]);
|
|
8925
8934
|
}
|
|
8926
8935
|
return r$3.nextIndex++, a$1;
|
|
8927
8936
|
}
|
|
8928
|
-
function oe({ kind: e, min: r$3, max: n },
|
|
8929
|
-
const
|
|
8930
|
-
if (!
|
|
8931
|
-
const
|
|
8932
|
-
return
|
|
8937
|
+
function oe({ kind: e, min: r$3, max: n }, o$2) {
|
|
8938
|
+
const i$2 = o$2.parent, t = i$2.body.at(-1);
|
|
8939
|
+
if (!t || !s(t)) throw new Error("Quantifier requires a repeatable token");
|
|
8940
|
+
const d$1 = _(e, r$3, n, t);
|
|
8941
|
+
return i$2.body.pop(), d$1;
|
|
8933
8942
|
}
|
|
8934
8943
|
function ae({ raw: e }, r$3) {
|
|
8935
|
-
const { capturingGroups: n, subroutines:
|
|
8936
|
-
let
|
|
8937
|
-
const
|
|
8938
|
-
if (
|
|
8939
|
-
const
|
|
8940
|
-
if (r$3.hasNumberedRef = !0,
|
|
8941
|
-
"":
|
|
8942
|
-
"+": a$1 +
|
|
8943
|
-
"-": a$1 + 1 -
|
|
8944
|
-
}[
|
|
8945
|
-
} else
|
|
8946
|
-
const
|
|
8947
|
-
return
|
|
8944
|
+
const { capturingGroups: n, subroutines: o$2 } = r$3;
|
|
8945
|
+
let i$2 = e.slice(3, -1);
|
|
8946
|
+
const t = /^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i$2);
|
|
8947
|
+
if (t) {
|
|
8948
|
+
const s$1 = +t.groups.num, a$1 = n.length;
|
|
8949
|
+
if (r$3.hasNumberedRef = !0, i$2 = {
|
|
8950
|
+
"": s$1,
|
|
8951
|
+
"+": a$1 + s$1,
|
|
8952
|
+
"-": a$1 + 1 - s$1
|
|
8953
|
+
}[t.groups.sign], i$2 < 1) throw new Error("Invalid subroutine number");
|
|
8954
|
+
} else i$2 === "0" && (i$2 = 0);
|
|
8955
|
+
const d$1 = O(i$2);
|
|
8956
|
+
return o$2.push(d$1), d$1;
|
|
8948
8957
|
}
|
|
8949
8958
|
function G(e, r$3) {
|
|
8950
8959
|
if (e !== "repeater") throw new Error(`Unexpected absence function kind "${e}"`);
|
|
@@ -8996,9 +9005,9 @@ function m(e, r$3) {
|
|
|
8996
9005
|
...r$3
|
|
8997
9006
|
};
|
|
8998
9007
|
if (e > 1114111) {
|
|
8999
|
-
const
|
|
9008
|
+
const o$2 = e.toString(16);
|
|
9000
9009
|
if (n.useLastValid) e = 1114111;
|
|
9001
|
-
else throw e > 1310719 ? new Error(`Invalid code point out of range "\\x{${
|
|
9010
|
+
else throw e > 1310719 ? new Error(`Invalid code point out of range "\\x{${o$2}}"`) : new Error(`Invalid code point out of range in JS "\\x{${o$2}}"`);
|
|
9002
9011
|
}
|
|
9003
9012
|
return {
|
|
9004
9013
|
type: "Character",
|
|
@@ -9027,11 +9036,11 @@ function L(e, r$3) {
|
|
|
9027
9036
|
};
|
|
9028
9037
|
}
|
|
9029
9038
|
function E(e, r$3) {
|
|
9030
|
-
const n = !!r$3?.negate,
|
|
9039
|
+
const n = !!r$3?.negate, o$2 = {
|
|
9031
9040
|
type: "CharacterSet",
|
|
9032
9041
|
kind: e
|
|
9033
9042
|
};
|
|
9034
|
-
return (e === "digit" || e === "hex" || e === "newline" || e === "space" || e === "word") && (
|
|
9043
|
+
return (e === "digit" || e === "hex" || e === "newline" || e === "space" || e === "word") && (o$2.negate = n), (e === "text_segment" || e === "newline" && !n) && (o$2.variableLength = !0), o$2;
|
|
9035
9044
|
}
|
|
9036
9045
|
function I(e, r$3 = {}) {
|
|
9037
9046
|
if (e === "keep") return {
|
|
@@ -9092,14 +9101,14 @@ function R(e, r$3) {
|
|
|
9092
9101
|
negate: n
|
|
9093
9102
|
};
|
|
9094
9103
|
}
|
|
9095
|
-
function _(e, r$3, n,
|
|
9104
|
+
function _(e, r$3, n, o$2) {
|
|
9096
9105
|
if (r$3 > n) throw new Error("Invalid reversed quantifier range");
|
|
9097
9106
|
return {
|
|
9098
9107
|
type: "Quantifier",
|
|
9099
9108
|
kind: e,
|
|
9100
9109
|
min: r$3,
|
|
9101
9110
|
max: n,
|
|
9102
|
-
body:
|
|
9111
|
+
body: o$2
|
|
9103
9112
|
};
|
|
9104
9113
|
}
|
|
9105
9114
|
function B(e, r$3) {
|
|
@@ -9123,28 +9132,28 @@ function Q(e, r$3) {
|
|
|
9123
9132
|
unicodePropertyMap: null,
|
|
9124
9133
|
...r$3
|
|
9125
9134
|
};
|
|
9126
|
-
let
|
|
9127
|
-
if (!
|
|
9128
|
-
if (n.normalizeUnknownPropertyNames)
|
|
9135
|
+
let o$2 = n.unicodePropertyMap?.get(w(e));
|
|
9136
|
+
if (!o$2) {
|
|
9137
|
+
if (n.normalizeUnknownPropertyNames) o$2 = de(e);
|
|
9129
9138
|
else if (n.unicodePropertyMap && !n.skipPropertyNameValidation) throw new Error(o$1`Invalid Unicode property "\p{${e}}"`);
|
|
9130
9139
|
}
|
|
9131
9140
|
return {
|
|
9132
9141
|
type: "CharacterSet",
|
|
9133
9142
|
kind: "property",
|
|
9134
|
-
value:
|
|
9143
|
+
value: o$2 ?? e,
|
|
9135
9144
|
negate: n.negate
|
|
9136
9145
|
};
|
|
9137
9146
|
}
|
|
9138
|
-
function ie({ flags: e, kind: r$3, name: n, negate:
|
|
9147
|
+
function ie({ flags: e, kind: r$3, name: n, negate: o$2, number: i$2 }) {
|
|
9139
9148
|
switch (r$3) {
|
|
9140
9149
|
case "absence_repeater": return G("repeater");
|
|
9141
9150
|
case "atomic": return A({ atomic: !0 });
|
|
9142
|
-
case "capturing": return P(
|
|
9151
|
+
case "capturing": return P(i$2, { name: n });
|
|
9143
9152
|
case "group": return A({ flags: e });
|
|
9144
9153
|
case "lookahead":
|
|
9145
9154
|
case "lookbehind": return K({
|
|
9146
9155
|
behind: r$3 === "lookbehind",
|
|
9147
|
-
negate:
|
|
9156
|
+
negate: o$2
|
|
9148
9157
|
});
|
|
9149
9158
|
default: throw new Error(`Unexpected group kind "${r$3}"`);
|
|
9150
9159
|
}
|
|
@@ -9175,16 +9184,17 @@ function w(e) {
|
|
|
9175
9184
|
return e.replace(/[- _]+/g, "").toLowerCase();
|
|
9176
9185
|
}
|
|
9177
9186
|
function z(e, r$3) {
|
|
9178
|
-
|
|
9187
|
+
const n = r$3;
|
|
9188
|
+
return u(e, `Unclosed character class${n?.type === "Character" && n.value === 93 && n.raw === "]" ? " (started with \"]\")" : ""}`);
|
|
9179
9189
|
}
|
|
9180
9190
|
function D(e) {
|
|
9181
9191
|
return u(e, "Unclosed group");
|
|
9182
9192
|
}
|
|
9183
9193
|
|
|
9184
9194
|
//#endregion
|
|
9185
|
-
//#region ../../node_modules/.bun/oniguruma-parser@0.12.
|
|
9195
|
+
//#region ../../node_modules/.bun/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/traverser/traverse.js
|
|
9186
9196
|
function S(a$1, v$1, N = null) {
|
|
9187
|
-
function
|
|
9197
|
+
function b$2(e, s$1) {
|
|
9188
9198
|
for (let t = 0; t < e.length; t++) {
|
|
9189
9199
|
const r$3 = n(e[t], s$1, t, e);
|
|
9190
9200
|
t = Math.max(-1, t + r$3);
|
|
@@ -9199,40 +9209,39 @@ function S(a$1, v$1, N = null) {
|
|
|
9199
9209
|
container: r$3,
|
|
9200
9210
|
root: a$1,
|
|
9201
9211
|
remove() {
|
|
9202
|
-
|
|
9212
|
+
x(r$3).splice(Math.max(0, l(t) + i$2), 1), i$2--, c = !0;
|
|
9203
9213
|
},
|
|
9204
9214
|
removeAllNextSiblings() {
|
|
9205
|
-
return
|
|
9215
|
+
return x(r$3).splice(l(t) + 1);
|
|
9206
9216
|
},
|
|
9207
9217
|
removeAllPrevSiblings() {
|
|
9208
9218
|
const o$2 = l(t) + i$2;
|
|
9209
|
-
return i$2 -= o$2,
|
|
9219
|
+
return i$2 -= o$2, x(r$3).splice(0, Math.max(0, o$2));
|
|
9210
9220
|
},
|
|
9211
|
-
replaceWith(o$2,
|
|
9212
|
-
const
|
|
9213
|
-
r$3 ? r$3[Math.max(0, l(t) + i$2)] = o$2 : u(s$1, "Can't replace root node")[t] = o$2,
|
|
9221
|
+
replaceWith(o$2, m$2 = {}) {
|
|
9222
|
+
const y$2 = !!m$2.traverse;
|
|
9223
|
+
r$3 ? r$3[Math.max(0, l(t) + i$2)] = o$2 : u(s$1, "Can't replace root node")[t] = o$2, y$2 && n(o$2, s$1, t, r$3), c = !0;
|
|
9214
9224
|
},
|
|
9215
|
-
replaceWithMultiple(o$2,
|
|
9216
|
-
const
|
|
9217
|
-
if (
|
|
9225
|
+
replaceWithMultiple(o$2, m$2 = {}) {
|
|
9226
|
+
const y$2 = !!m$2.traverse;
|
|
9227
|
+
if (x(r$3).splice(Math.max(0, l(t) + i$2), 1, ...o$2), i$2 += o$2.length - 1, y$2) {
|
|
9218
9228
|
let g = 0;
|
|
9219
|
-
for (let
|
|
9229
|
+
for (let p$1 = 0; p$1 < o$2.length; p$1++) g += n(o$2[p$1], s$1, l(t) + p$1 + g, r$3);
|
|
9220
9230
|
}
|
|
9221
9231
|
c = !0;
|
|
9222
9232
|
},
|
|
9223
9233
|
skip() {
|
|
9224
9234
|
c = !0;
|
|
9225
9235
|
}
|
|
9226
|
-
}, { type:
|
|
9227
|
-
if (R$2?.(d$1, N), P$2?.(d$1, N), !c) switch (
|
|
9236
|
+
}, { type: f$1 } = e, u$1 = v$1["*"], h$1 = v$1[f$1], R$2 = typeof u$1 == "function" ? u$1 : u$1?.enter, P$2 = typeof h$1 == "function" ? h$1 : h$1?.enter;
|
|
9237
|
+
if (R$2?.(d$1, N), P$2?.(d$1, N), !c) switch (f$1) {
|
|
9228
9238
|
case "AbsenceFunction":
|
|
9229
|
-
case "CapturingGroup":
|
|
9230
|
-
case "Group":
|
|
9231
|
-
u$1(e.body, e);
|
|
9232
|
-
break;
|
|
9233
9239
|
case "Alternative":
|
|
9240
|
+
case "CapturingGroup":
|
|
9234
9241
|
case "CharacterClass":
|
|
9235
|
-
|
|
9242
|
+
case "Group":
|
|
9243
|
+
case "LookaroundAssertion":
|
|
9244
|
+
b$2(e.body, e);
|
|
9236
9245
|
break;
|
|
9237
9246
|
case "Assertion":
|
|
9238
9247
|
case "Backreference":
|
|
@@ -9245,22 +9254,19 @@ function S(a$1, v$1, N = null) {
|
|
|
9245
9254
|
case "CharacterClassRange":
|
|
9246
9255
|
n(e.min, e, "min"), n(e.max, e, "max");
|
|
9247
9256
|
break;
|
|
9248
|
-
case "LookaroundAssertion":
|
|
9249
|
-
u$1(e.body, e);
|
|
9250
|
-
break;
|
|
9251
9257
|
case "Quantifier":
|
|
9252
9258
|
n(e.body, e, "body");
|
|
9253
9259
|
break;
|
|
9254
9260
|
case "Regex":
|
|
9255
|
-
|
|
9261
|
+
b$2(e.body, e), n(e.flags, e, "flags");
|
|
9256
9262
|
break;
|
|
9257
|
-
default: throw new Error(`Unexpected node type "${
|
|
9263
|
+
default: throw new Error(`Unexpected node type "${f$1}"`);
|
|
9258
9264
|
}
|
|
9259
|
-
return
|
|
9265
|
+
return h$1?.exit?.(d$1, N), u$1?.exit?.(d$1, N), i$2;
|
|
9260
9266
|
}
|
|
9261
9267
|
return n(a$1), a$1;
|
|
9262
9268
|
}
|
|
9263
|
-
function
|
|
9269
|
+
function x(a$1) {
|
|
9264
9270
|
if (!Array.isArray(a$1)) throw new Error("Container expected");
|
|
9265
9271
|
return a$1;
|
|
9266
9272
|
}
|
|
@@ -9522,7 +9528,7 @@ function atomic(expression, data) {
|
|
|
9522
9528
|
if (captureTransfers.size) {
|
|
9523
9529
|
const newCaptureTransfers = new Map();
|
|
9524
9530
|
captureTransfers.forEach((from, to) => {
|
|
9525
|
-
newCaptureTransfers.set(to >= addedCaptureNum ? to + 1 : to, from.map((f$
|
|
9531
|
+
newCaptureTransfers.set(to >= addedCaptureNum ? to + 1 : to, from.map((f$1) => f$1 >= addedCaptureNum ? f$1 + 1 : f$1));
|
|
9526
9532
|
});
|
|
9527
9533
|
captureTransfers = newCaptureTransfers;
|
|
9528
9534
|
}
|
|
@@ -9958,18 +9964,18 @@ function mapCaptureTransfers(captureTransfers, left, reps, numCapturesAddedInExp
|
|
|
9958
9964
|
const numCapturesAddedInLeft = numCapturesInLeft * reps;
|
|
9959
9965
|
const newTo = to > recursionDelimCaptureNum + numCapturesInLeft ? to + numCapturesAddedInExpansion : to;
|
|
9960
9966
|
const newFrom = [];
|
|
9961
|
-
for (const f$
|
|
9962
|
-
if (f$
|
|
9963
|
-
newFrom.push(f$
|
|
9964
|
-
} else if (f$
|
|
9965
|
-
newFrom.push(f$
|
|
9966
|
-
} else if (f$
|
|
9967
|
+
for (const f$1 of from) {
|
|
9968
|
+
if (f$1 <= recursionDelimCaptureNum) {
|
|
9969
|
+
newFrom.push(f$1);
|
|
9970
|
+
} else if (f$1 > recursionDelimCaptureNum + numCapturesInLeft + numCapturesInRight) {
|
|
9971
|
+
newFrom.push(f$1 + numCapturesAddedInExpansion);
|
|
9972
|
+
} else if (f$1 <= recursionDelimCaptureNum + numCapturesInLeft) {
|
|
9967
9973
|
for (let i$2 = 0; i$2 <= reps; i$2++) {
|
|
9968
|
-
newFrom.push(f$
|
|
9974
|
+
newFrom.push(f$1 + numCapturesInLeft * i$2);
|
|
9969
9975
|
}
|
|
9970
9976
|
} else {
|
|
9971
9977
|
for (let i$2 = 0; i$2 <= reps; i$2++) {
|
|
9972
|
-
newFrom.push(f$
|
|
9978
|
+
newFrom.push(f$1 + numCapturesAddedInLeft + numCapturesInRight * i$2);
|
|
9973
9979
|
}
|
|
9974
9980
|
}
|
|
9975
9981
|
}
|
|
@@ -9981,36 +9987,36 @@ function mapCaptureTransfers(captureTransfers, left, reps, numCapturesAddedInExp
|
|
|
9981
9987
|
}
|
|
9982
9988
|
|
|
9983
9989
|
//#endregion
|
|
9984
|
-
//#region ../../node_modules/.bun/oniguruma-to-es@4.3.
|
|
9990
|
+
//#region ../../node_modules/.bun/oniguruma-to-es@4.3.6/node_modules/oniguruma-to-es/dist/esm/index.js
|
|
9985
9991
|
var cp = String.fromCodePoint;
|
|
9986
9992
|
var r = String.raw;
|
|
9987
|
-
var envFlags = {
|
|
9988
|
-
|
|
9989
|
-
|
|
9990
|
-
|
|
9991
|
-
|
|
9992
|
-
|
|
9993
|
-
|
|
9994
|
-
|
|
9995
|
-
|
|
9996
|
-
|
|
9997
|
-
|
|
9998
|
-
|
|
9999
|
-
|
|
10000
|
-
|
|
10001
|
-
|
|
10002
|
-
|
|
10003
|
-
|
|
10004
|
-
};
|
|
9993
|
+
var envFlags = {};
|
|
9994
|
+
var globalRegExp = globalThis.RegExp;
|
|
9995
|
+
envFlags.flagGroups = (() => {
|
|
9996
|
+
try {
|
|
9997
|
+
new globalRegExp("(?i:)");
|
|
9998
|
+
} catch {
|
|
9999
|
+
return false;
|
|
10000
|
+
}
|
|
10001
|
+
return true;
|
|
10002
|
+
})();
|
|
10003
|
+
envFlags.unicodeSets = (() => {
|
|
10004
|
+
try {
|
|
10005
|
+
new globalRegExp("[[]]", "v");
|
|
10006
|
+
} catch {
|
|
10007
|
+
return false;
|
|
10008
|
+
}
|
|
10009
|
+
return true;
|
|
10010
|
+
})();
|
|
10005
10011
|
envFlags.bugFlagVLiteralHyphenIsRange = envFlags.unicodeSets ? (() => {
|
|
10006
10012
|
try {
|
|
10007
|
-
new
|
|
10013
|
+
new globalRegExp(r`[\d\-a]`, "v");
|
|
10008
10014
|
} catch {
|
|
10009
10015
|
return true;
|
|
10010
10016
|
}
|
|
10011
10017
|
return false;
|
|
10012
10018
|
})() : false;
|
|
10013
|
-
envFlags.bugNestedClassIgnoresNegation = envFlags.unicodeSets && new
|
|
10019
|
+
envFlags.bugNestedClassIgnoresNegation = envFlags.unicodeSets && new globalRegExp("[[^a]]", "v").test("a");
|
|
10014
10020
|
function getNewCurrentFlags(current, { enable, disable }) {
|
|
10015
10021
|
return {
|
|
10016
10022
|
dotAll: !disable?.dotAll && !!(enable?.dotAll || current.dotAll),
|
|
@@ -10492,7 +10498,7 @@ var FirstPassVisitor = {
|
|
|
10492
10498
|
"spaceIsAscii",
|
|
10493
10499
|
"wordIsAscii",
|
|
10494
10500
|
"textSegmentMode"
|
|
10495
|
-
].forEach((f$
|
|
10501
|
+
].forEach((f$1) => delete node[f$1]);
|
|
10496
10502
|
Object.assign(node, {
|
|
10497
10503
|
global: false,
|
|
10498
10504
|
hasIndices: false,
|
|
@@ -10636,7 +10642,9 @@ var SecondPassVisitor = {
|
|
|
10636
10642
|
}
|
|
10637
10643
|
},
|
|
10638
10644
|
exit({ node }, { openRefs }) {
|
|
10639
|
-
openRefs.
|
|
10645
|
+
if (openRefs.get(node.number) === node) {
|
|
10646
|
+
openRefs.delete(node.number);
|
|
10647
|
+
}
|
|
10640
10648
|
}
|
|
10641
10649
|
},
|
|
10642
10650
|
Group: {
|
|
@@ -11636,7 +11644,7 @@ function toRegExpDetails(pattern, options) {
|
|
|
11636
11644
|
}
|
|
11637
11645
|
|
|
11638
11646
|
//#endregion
|
|
11639
|
-
//#region ../../node_modules/.bun/@shikijs+engine-javascript@4.0
|
|
11647
|
+
//#region ../../node_modules/.bun/@shikijs+engine-javascript@4.2.0/node_modules/@shikijs/engine-javascript/dist/engine-compile.mjs
|
|
11640
11648
|
/**
|
|
11641
11649
|
* The default regex constructor for the JavaScript RegExp engine.
|
|
11642
11650
|
*/
|
|
@@ -11664,10 +11672,11 @@ function defaultJavaScriptRegexConstructor(pattern, options) {
|
|
|
11664
11672
|
* Set `forgiving` to `true` to ignore these errors and skip any unsupported or invalid patterns.
|
|
11665
11673
|
*/
|
|
11666
11674
|
function createJavaScriptRegexEngine(options = {}) {
|
|
11667
|
-
const _options =
|
|
11675
|
+
const _options = {
|
|
11668
11676
|
target: "auto",
|
|
11669
|
-
cache: /* @__PURE__ */ new Map()
|
|
11670
|
-
|
|
11677
|
+
cache: /* @__PURE__ */ new Map(),
|
|
11678
|
+
...options
|
|
11679
|
+
};
|
|
11671
11680
|
_options.regexConstructor ||= (pattern) => defaultJavaScriptRegexConstructor(pattern, { target: _options.target });
|
|
11672
11681
|
return {
|
|
11673
11682
|
createScanner(patterns) {
|
|
@@ -11680,7 +11689,7 @@ function createJavaScriptRegexEngine(options = {}) {
|
|
|
11680
11689
|
}
|
|
11681
11690
|
|
|
11682
11691
|
//#endregion
|
|
11683
|
-
//#region ../../node_modules/.bun/@shikijs+engine-javascript@4.0
|
|
11692
|
+
//#region ../../node_modules/.bun/@shikijs+engine-javascript@4.2.0/node_modules/@shikijs/engine-javascript/dist/engine-raw.mjs
|
|
11684
11693
|
/**
|
|
11685
11694
|
* Raw JavaScript regex engine that only supports precompiled grammars.
|
|
11686
11695
|
*
|
|
@@ -11706,7 +11715,7 @@ function createJavaScriptRawEngine() {
|
|
|
11706
11715
|
}
|
|
11707
11716
|
|
|
11708
11717
|
//#endregion
|
|
11709
|
-
//#region ../../node_modules/.bun/@shikijs+engine-oniguruma@4.0
|
|
11718
|
+
//#region ../../node_modules/.bun/@shikijs+engine-oniguruma@4.2.0/node_modules/@shikijs/engine-oniguruma/dist/index.mjs
|
|
11710
11719
|
var dist_exports = /* @__PURE__ */ __export({
|
|
11711
11720
|
createOnigurumaEngine: () => createOnigurumaEngine,
|
|
11712
11721
|
getDefaultWasmLoader: () => getDefaultWasmLoader,
|
|
@@ -11725,7 +11734,7 @@ function getHeapMax() {
|
|
|
11725
11734
|
function _emscripten_get_now() {
|
|
11726
11735
|
return typeof performance !== "undefined" ? performance.now() : Date.now();
|
|
11727
11736
|
}
|
|
11728
|
-
const alignUp = (x$
|
|
11737
|
+
const alignUp = (x$2, multiple) => x$2 + (multiple - x$2 % multiple) % multiple;
|
|
11729
11738
|
async function main(init) {
|
|
11730
11739
|
let wasmMemory;
|
|
11731
11740
|
let buffer;
|
|
@@ -11808,10 +11817,10 @@ async function main(init) {
|
|
|
11808
11817
|
env: asmLibraryArg,
|
|
11809
11818
|
wasi_snapshot_preview1: asmLibraryArg
|
|
11810
11819
|
};
|
|
11811
|
-
const exports
|
|
11812
|
-
wasmMemory = exports
|
|
11820
|
+
const exports = await init(info);
|
|
11821
|
+
wasmMemory = exports.memory;
|
|
11813
11822
|
updateGlobalBufferAndViews(wasmMemory.buffer);
|
|
11814
|
-
Object.assign(binding, exports
|
|
11823
|
+
Object.assign(binding, exports);
|
|
11815
11824
|
binding.UTF8ToString = UTF8ToString;
|
|
11816
11825
|
}
|
|
11817
11826
|
await createWasm();
|
|
@@ -12130,7 +12139,7 @@ async function createOnigurumaEngine(options) {
|
|
|
12130
12139
|
}
|
|
12131
12140
|
|
|
12132
12141
|
//#endregion
|
|
12133
|
-
//#region ../../node_modules/.bun/shiki@4.0
|
|
12142
|
+
//#region ../../node_modules/.bun/shiki@4.2.0/node_modules/shiki/dist/engine-oniguruma.mjs
|
|
12134
12143
|
var engine_oniguruma_exports = /* @__PURE__ */ __exportAll({});
|
|
12135
12144
|
__reExport(engine_oniguruma_exports, dist_exports);
|
|
12136
12145
|
|
|
@@ -14560,7 +14569,10 @@ function cleanLastNewline(contents) {
|
|
|
14560
14569
|
}
|
|
14561
14570
|
|
|
14562
14571
|
//#endregion
|
|
14563
|
-
//#region ../../node_modules/.bun/@shikijs+transformers@4.0
|
|
14572
|
+
//#region ../../node_modules/.bun/@shikijs+transformers@4.2.0/node_modules/@shikijs/transformers/dist/index.mjs
|
|
14573
|
+
const RE_SPLIT_COMMENT = /(\s+\/\/)/;
|
|
14574
|
+
const RE_V1_END_COMMENT_PREFIX = /(?:\/\/|["'#]|;{1,2}|%{1,2}|--)(\s*)$/;
|
|
14575
|
+
const RE_V3_END_COMMENT_PREFIX = /(?:\/\/|#|;{1,2}|%{1,2}|--)(\s*)$/;
|
|
14564
14576
|
/**
|
|
14565
14577
|
* some comment formats have to be located at the end of line
|
|
14566
14578
|
* hence we can skip matching them for other tokens
|
|
@@ -14586,7 +14598,7 @@ function parseComments(lines, jsx, matchAlgorithm) {
|
|
|
14586
14598
|
if (token$1.type !== "text") return element$1;
|
|
14587
14599
|
const isLast = idx === line.children.length - 1;
|
|
14588
14600
|
if (!matchToken(token$1.value, isLast)) return element$1;
|
|
14589
|
-
const rawSplits = token$1.value.split(
|
|
14601
|
+
const rawSplits = token$1.value.split(RE_SPLIT_COMMENT);
|
|
14590
14602
|
if (rawSplits.length <= 1) return element$1;
|
|
14591
14603
|
let splits = [rawSplits[0]];
|
|
14592
14604
|
for (let i$2 = 1; i$2 < rawSplits.length; i$2 += 2) splits.push(rawSplits[i$2] + (rawSplits[i$2 + 1] || ""));
|
|
@@ -14692,12 +14704,22 @@ function matchToken(text$1, isLast) {
|
|
|
14692
14704
|
* For matchAlgorithm v1
|
|
14693
14705
|
*/
|
|
14694
14706
|
function v1ClearEndCommentPrefix(text$1) {
|
|
14695
|
-
const match = text$1.match(
|
|
14707
|
+
const match = text$1.match(RE_V1_END_COMMENT_PREFIX);
|
|
14696
14708
|
if (match && match[1].trim().length === 0) return text$1.slice(0, match.index);
|
|
14697
14709
|
return text$1;
|
|
14698
14710
|
}
|
|
14711
|
+
/**
|
|
14712
|
+
* Remove empty comment prefixes at line end, e.g. `// `
|
|
14713
|
+
*
|
|
14714
|
+
* For matchAlgorithm v3
|
|
14715
|
+
*/
|
|
14716
|
+
function v3ClearEndCommentPrefix(text$1) {
|
|
14717
|
+
const match = text$1.match(RE_V3_END_COMMENT_PREFIX);
|
|
14718
|
+
if (match && match[1].trim().length === 0) return text$1.slice(0, match.index).trimEnd();
|
|
14719
|
+
return text$1;
|
|
14720
|
+
}
|
|
14699
14721
|
function createCommentNotationTransformer(name, regex, onMatch, matchAlgorithm) {
|
|
14700
|
-
|
|
14722
|
+
matchAlgorithm ??= "v3";
|
|
14701
14723
|
return {
|
|
14702
14724
|
name,
|
|
14703
14725
|
code(code) {
|
|
@@ -14721,6 +14743,7 @@ function createCommentNotationTransformer(name, regex, onMatch, matchAlgorithm)
|
|
|
14721
14743
|
});
|
|
14722
14744
|
if (!replaced) continue;
|
|
14723
14745
|
if (matchAlgorithm === "v1") comment$1.info[1] = v1ClearEndCommentPrefix(comment$1.info[1]);
|
|
14746
|
+
else if (matchAlgorithm === "v3") comment$1.info[1] = v3ClearEndCommentPrefix(comment$1.info[1]);
|
|
14724
14747
|
const isEmpty = comment$1.info[1].trim().length === 0;
|
|
14725
14748
|
if (isEmpty) comment$1.info[1] = "";
|
|
14726
14749
|
if (isEmpty && comment$1.isLineCommentOnly) linesToRemove.push(comment$1.line);
|
|
@@ -14766,9 +14789,10 @@ function transformerCompactLineOptions(lineOptions = []) {
|
|
|
14766
14789
|
}
|
|
14767
14790
|
};
|
|
14768
14791
|
}
|
|
14792
|
+
const RE_HIGHLIGHT_LINES = /\{([\d,-]+)\}/;
|
|
14769
14793
|
function parseMetaHighlightString(meta) {
|
|
14770
14794
|
if (!meta) return null;
|
|
14771
|
-
const match = meta.match(
|
|
14795
|
+
const match = meta.match(RE_HIGHLIGHT_LINES);
|
|
14772
14796
|
if (!match) return null;
|
|
14773
14797
|
return match[1].split(",").flatMap((v$1) => {
|
|
14774
14798
|
const range$1 = v$1.split("-").map((n) => Number.parseInt(n, 10));
|
|
@@ -14794,9 +14818,11 @@ function transformerMetaHighlight(options = {}) {
|
|
|
14794
14818
|
}
|
|
14795
14819
|
};
|
|
14796
14820
|
}
|
|
14821
|
+
const RE_WORD_MATCH = /\/((?:\\.|[^/])+)\//g;
|
|
14822
|
+
const RE_ESCAPE_BACKSLASH = /\\(.)/g;
|
|
14797
14823
|
function parseMetaHighlightWords(meta) {
|
|
14798
14824
|
if (!meta) return [];
|
|
14799
|
-
return
|
|
14825
|
+
return [...meta.matchAll(RE_WORD_MATCH)].map((v$1) => v$1[1].replace(RE_ESCAPE_BACKSLASH, "$1"));
|
|
14800
14826
|
}
|
|
14801
14827
|
/**
|
|
14802
14828
|
* Allow using `/word/` in the code snippet meta to mark highlighted words.
|
|
@@ -14832,8 +14858,9 @@ function findAllSubstringIndexes(str, substr) {
|
|
|
14832
14858
|
}
|
|
14833
14859
|
return indexes;
|
|
14834
14860
|
}
|
|
14861
|
+
const RE_ESCAPE_SPECIAL = /[.*+?^${}()|[\]\\]/g;
|
|
14835
14862
|
function escapeRegExp(str) {
|
|
14836
|
-
return str.replace(
|
|
14863
|
+
return str.replace(RE_ESCAPE_SPECIAL, "\\$&");
|
|
14837
14864
|
}
|
|
14838
14865
|
function transformerNotationMap(options = {}, name = "@shikijs/transformers:notation-map") {
|
|
14839
14866
|
const { classMap = {}, classActivePre = void 0, classActiveCode = void 0 } = options;
|
|
@@ -14965,11 +14992,13 @@ function inheritElement(original, overrides) {
|
|
|
14965
14992
|
...overrides
|
|
14966
14993
|
};
|
|
14967
14994
|
}
|
|
14995
|
+
const RE_CODE_WORD = /\s*\[!code word:((?:\\.|[^:\]])+)(:\d+)?\]/;
|
|
14996
|
+
const RE_UNESCAPE = /\\(.)/g;
|
|
14968
14997
|
function transformerNotationWordHighlight(options = {}) {
|
|
14969
14998
|
const { classActiveWord = "highlighted-word", classActivePre = void 0 } = options;
|
|
14970
|
-
return createCommentNotationTransformer("@shikijs/transformers:notation-highlight-word",
|
|
14999
|
+
return createCommentNotationTransformer("@shikijs/transformers:notation-highlight-word", RE_CODE_WORD, function([_$2, word, range$1], _line, comment$1, lines, index) {
|
|
14971
15000
|
const lineNum = range$1 ? Number.parseInt(range$1.slice(1), 10) : lines.length;
|
|
14972
|
-
word = word.replace(
|
|
15001
|
+
word = word.replace(RE_UNESCAPE, "$1");
|
|
14973
15002
|
for (let i$2 = index; i$2 < Math.min(index + lineNum, lines.length); i$2++) highlightWordInLine.call(this, lines[i$2], comment$1, word, classActiveWord);
|
|
14974
15003
|
if (classActivePre) this.addClassToHast(this.pre, classActivePre);
|
|
14975
15004
|
return true;
|
|
@@ -15031,6 +15060,8 @@ function transformerRemoveNotationEscape() {
|
|
|
15031
15060
|
}
|
|
15032
15061
|
};
|
|
15033
15062
|
}
|
|
15063
|
+
const RE_INDENT_META = /\{indent:(\d+|false)\}/;
|
|
15064
|
+
const RE_NON_BLANK = /[^ \t]/;
|
|
15034
15065
|
/**
|
|
15035
15066
|
* Render indentations as separate tokens.
|
|
15036
15067
|
* Apply with CSS, it can be used to render indent guides visually.
|
|
@@ -15039,7 +15070,7 @@ function transformerRenderIndentGuides(options = {}) {
|
|
|
15039
15070
|
return {
|
|
15040
15071
|
name: "@shikijs/transformers:render-indent-guides",
|
|
15041
15072
|
code(hast) {
|
|
15042
|
-
const indent = Number(this.options.meta?.indent ?? this.options.meta?.__raw?.match(
|
|
15073
|
+
const indent = Number(this.options.meta?.indent ?? this.options.meta?.__raw?.match(RE_INDENT_META)?.[1] ?? options.indent ?? 2);
|
|
15043
15074
|
if (Number.isNaN(indent) || indent <= 0) return hast;
|
|
15044
15075
|
const indentRegex = new RegExp(` {${indent}}| {0,${indent - 1}}\t| {1,}$`, "g");
|
|
15045
15076
|
const emptyLines = [];
|
|
@@ -15052,7 +15083,7 @@ function transformerRenderIndentGuides(options = {}) {
|
|
|
15052
15083
|
continue;
|
|
15053
15084
|
}
|
|
15054
15085
|
const text$1 = first.children[0];
|
|
15055
|
-
const blanks = text$1.value.split(
|
|
15086
|
+
const blanks = text$1.value.split(RE_NON_BLANK, 1)[0];
|
|
15056
15087
|
const ranges = [];
|
|
15057
15088
|
for (const match of blanks.matchAll(indentRegex)) {
|
|
15058
15089
|
const start = match.index;
|
|
@@ -15127,6 +15158,7 @@ function splitSpaces(parts, type, renderContinuousSpaces = true) {
|
|
|
15127
15158
|
...parts.slice(parts.length - rightCount)
|
|
15128
15159
|
];
|
|
15129
15160
|
}
|
|
15161
|
+
const RE_SPACE_OR_TAB = /([ \t])/;
|
|
15130
15162
|
/**
|
|
15131
15163
|
* Render whitespaces as separate tokens.
|
|
15132
15164
|
* Apply with CSS, it can be used to render tabs and spaces visually.
|
|
@@ -15154,7 +15186,7 @@ function transformerRenderWhitespace(options = {}) {
|
|
|
15154
15186
|
if (position === "leading" && index !== 0) return token$1;
|
|
15155
15187
|
const node = token$1.children[0];
|
|
15156
15188
|
if (node.type !== "text" || !node.value) return token$1;
|
|
15157
|
-
const parts = splitSpaces(node.value.split(
|
|
15189
|
+
const parts = splitSpaces(node.value.split(RE_SPACE_OR_TAB).filter((i$2) => i$2.length), position === "boundary" && index === last && last !== 0 ? "trailing" : position, position !== "trailing" && position !== "leading");
|
|
15158
15190
|
if (parts.length <= 1) return token$1;
|
|
15159
15191
|
return parts.map((part) => {
|
|
15160
15192
|
const clone$1 = {
|
|
@@ -16885,7 +16917,8 @@ function renderTwoFiles({ deletionFile, additionFile, deletionInfo, additionInfo
|
|
|
16885
16917
|
transformers,
|
|
16886
16918
|
decorations: undefined,
|
|
16887
16919
|
defaultColor: false,
|
|
16888
|
-
cssVariablePrefix: formatCSSVariablePrefix("token")
|
|
16920
|
+
cssVariablePrefix: formatCSSVariablePrefix("token"),
|
|
16921
|
+
tokenizeTimeLimit: 0
|
|
16889
16922
|
} : {
|
|
16890
16923
|
...options,
|
|
16891
16924
|
lang: "text",
|
|
@@ -16893,7 +16926,8 @@ function renderTwoFiles({ deletionFile, additionFile, deletionInfo, additionInfo
|
|
|
16893
16926
|
transformers,
|
|
16894
16927
|
decorations: undefined,
|
|
16895
16928
|
defaultColor: false,
|
|
16896
|
-
cssVariablePrefix: formatCSSVariablePrefix("token")
|
|
16929
|
+
cssVariablePrefix: formatCSSVariablePrefix("token"),
|
|
16930
|
+
tokenizeTimeLimit: 0
|
|
16897
16931
|
};
|
|
16898
16932
|
})();
|
|
16899
16933
|
const deletionLines = (() => {
|
|
@@ -16986,7 +17020,8 @@ function renderFileWithHighlighter(file, highlighter$1, { theme = DEFAULT_THEMES
|
|
|
16986
17020
|
transformers,
|
|
16987
17021
|
defaultColor: false,
|
|
16988
17022
|
cssVariablePrefix: formatCSSVariablePrefix("token"),
|
|
16989
|
-
tokenizeMaxLineLength
|
|
17023
|
+
tokenizeMaxLineLength,
|
|
17024
|
+
tokenizeTimeLimit: 0
|
|
16990
17025
|
};
|
|
16991
17026
|
}
|
|
16992
17027
|
return {
|
|
@@ -16995,7 +17030,8 @@ function renderFileWithHighlighter(file, highlighter$1, { theme = DEFAULT_THEMES
|
|
|
16995
17030
|
transformers,
|
|
16996
17031
|
defaultColor: false,
|
|
16997
17032
|
cssVariablePrefix: formatCSSVariablePrefix("token"),
|
|
16998
|
-
tokenizeMaxLineLength
|
|
17033
|
+
tokenizeMaxLineLength,
|
|
17034
|
+
tokenizeTimeLimit: 0
|
|
16999
17035
|
};
|
|
17000
17036
|
})();
|
|
17001
17037
|
const highlightedLines = getLineNodes(highlighter$1.codeToHast(isWindowedHighlight ? extractWindowedFileContent(lines ?? linesFromFileContents(file.contents), startingLine, totalLines) : file.contents, hastConfig));
|
|
@@ -17131,7 +17167,7 @@ function getHighlighter(preferredHighlighter = "shiki-js") {
|
|
|
17131
17167
|
highlighter ??= createHighlighterCore({
|
|
17132
17168
|
themes: [],
|
|
17133
17169
|
langs: [],
|
|
17134
|
-
engine: preferredHighlighter === "shiki-wasm" ? createOnigurumaEngine(import("./wasm-
|
|
17170
|
+
engine: preferredHighlighter === "shiki-wasm" ? createOnigurumaEngine(import("./wasm-qE0LgnY3.js")) : createJavaScriptRegexEngine()
|
|
17135
17171
|
});
|
|
17136
17172
|
return highlighter;
|
|
17137
17173
|
}
|