@republicroad/seal-editor 1.32.0 → 1.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bash-Dfpezy65.js +2 -0
- package/dist/c-BdHHW7PX.js +5 -0
- package/dist/c-BdHHW7PX.js.map +1 -0
- package/dist/c-lfOsiBpu.js +2 -0
- package/dist/core-CAYwPm3F.js +4984 -0
- package/dist/core-CAYwPm3F.js.map +1 -0
- package/dist/cpp-BGootNWJ.js +15 -0
- package/dist/cpp-BGootNWJ.js.map +1 -0
- package/dist/cpp-DvjZUDSj.js +2 -0
- package/dist/csharp-RRkgh3c4.js +5 -0
- package/dist/csharp-RRkgh3c4.js.map +1 -0
- package/dist/css-BbwcBM_4.js +2 -0
- package/dist/css-HuzvwXs-.js +5 -0
- package/dist/css-HuzvwXs-.js.map +1 -0
- package/dist/diff-D0WgTNQn.js +5 -0
- package/dist/diff-D0WgTNQn.js.map +1 -0
- package/dist/docker-DMpUQ2UE.js +5 -0
- package/dist/docker-DMpUQ2UE.js.map +1 -0
- package/dist/engine-javascript-DkCwfYjr.js +2393 -0
- package/dist/engine-javascript-DkCwfYjr.js.map +1 -0
- package/dist/github-dark-C85MA6EW.js +6 -0
- package/dist/github-dark-C85MA6EW.js.map +1 -0
- package/dist/github-light-Dzg0sEwI.js +6 -0
- package/dist/github-light-Dzg0sEwI.js.map +1 -0
- package/dist/go-BEdBk4fh.js +5 -0
- package/dist/go-BEdBk4fh.js.map +1 -0
- package/dist/graphql-C4UuinIq.js +2 -0
- package/dist/graphql-DcYBXWWL.js +16 -0
- package/dist/graphql-DcYBXWWL.js.map +1 -0
- package/dist/html-BH9giSUA.js +2 -0
- package/dist/html-Ctxsat8s.js +12 -0
- package/dist/html-Ctxsat8s.js.map +1 -0
- package/dist/i18n-Cgv8cs-o.js +665 -0
- package/dist/i18n-Cgv8cs-o.js.map +1 -0
- package/dist/index.d.ts +66 -6
- package/dist/index.js +5947 -6525
- package/dist/index.js.map +1 -1
- package/dist/java-CNN5-pjU.js +5 -0
- package/dist/java-CNN5-pjU.js.map +1 -0
- package/dist/java-CaG1IqbK.js +2 -0
- package/dist/javascript--0qAxhnA.js +2 -0
- package/dist/javascript-Bk0bJ4nQ.js +5 -0
- package/dist/javascript-Bk0bJ4nQ.js.map +1 -0
- package/dist/json-DFt_0dbD.js +5 -0
- package/dist/json-DFt_0dbD.js.map +1 -0
- package/dist/json-DVwBUiza.js +2 -0
- package/dist/jsx-DkJfxbAs.js +5 -0
- package/dist/jsx-DkJfxbAs.js.map +1 -0
- package/dist/jsx-cVAJ0Z2c.js +2 -0
- package/dist/kotlin-CQsNEM2o.js +5 -0
- package/dist/kotlin-CQsNEM2o.js.map +1 -0
- package/dist/markdown-nUtTZkU8.js +5 -0
- package/dist/markdown-nUtTZkU8.js.map +1 -0
- package/dist/php-CQpsnvwU.js +20 -0
- package/dist/php-CQpsnvwU.js.map +1 -0
- package/dist/python-D0AaDoWC.js +5 -0
- package/dist/python-D0AaDoWC.js.map +1 -0
- package/dist/rolldown-runtime-B0aSnxlc.js +20 -0
- package/dist/ruby-lBDztqPf.js +34 -0
- package/dist/ruby-lBDztqPf.js.map +1 -0
- package/dist/rust-BrRMzTsN.js +5 -0
- package/dist/rust-BrRMzTsN.js.map +1 -0
- package/dist/schema.d.ts +6 -6
- package/dist/scss-CoGT9c_3.js +7 -0
- package/dist/scss-CoGT9c_3.js.map +1 -0
- package/dist/shellscript-B2AvTo4A.js +5 -0
- package/dist/shellscript-B2AvTo4A.js.map +1 -0
- package/dist/shellscript-Dfpezy65.js +2 -0
- package/dist/simulate-run-detail-CxwpdDne.js +1013 -0
- package/dist/simulate-run-detail-CxwpdDne.js.map +1 -0
- package/dist/sql-D_W5grEC.js +2 -0
- package/dist/sql-q7LBKUMn.js +5 -0
- package/dist/sql-q7LBKUMn.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/swift-B7Z-rXzN.js +5 -0
- package/dist/swift-B7Z-rXzN.js.map +1 -0
- package/dist/toml-CIQJnU5u.js +5 -0
- package/dist/toml-CIQJnU5u.js.map +1 -0
- package/dist/tsx-BqSm8fWw.js +5 -0
- package/dist/tsx-BqSm8fWw.js.map +1 -0
- package/dist/tsx-DiMnnori.js +2 -0
- package/dist/typescript-C4BXhs_3.js +5 -0
- package/dist/typescript-C4BXhs_3.js.map +1 -0
- package/dist/typescript-DFf19o_s.js +2 -0
- package/dist/vue-DnpuW72P.js +23 -0
- package/dist/vue-DnpuW72P.js.map +1 -0
- package/dist/xml-C-8BjZCy.js +7 -0
- package/dist/xml-C-8BjZCy.js.map +1 -0
- package/dist/yaml-BZ3x6E3N.js +5 -0
- package/dist/yaml-BZ3x6E3N.js.map +1 -0
- package/dist/yaml-BswqmnDe.js +2 -0
- package/package.json +2 -1
|
@@ -0,0 +1,2393 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@shikijs+engine-javascript@4.4.3/node_modules/@shikijs/engine-javascript/dist/scanner-DX8LRFGE.mjs
|
|
2
|
+
var e = 4294967295, t = class {
|
|
3
|
+
patterns;
|
|
4
|
+
options;
|
|
5
|
+
regexps;
|
|
6
|
+
constructor(e, t = {}) {
|
|
7
|
+
this.patterns = e, this.options = t;
|
|
8
|
+
let { forgiving: n = !1, cache: r, regexConstructor: i } = t;
|
|
9
|
+
if (!i) throw Error("Option `regexConstructor` is not provided");
|
|
10
|
+
this.regexps = e.map((e) => {
|
|
11
|
+
if (typeof e != "string") return e;
|
|
12
|
+
let t = r?.get(e);
|
|
13
|
+
if (t) {
|
|
14
|
+
if (t instanceof RegExp) return t;
|
|
15
|
+
if (n) return null;
|
|
16
|
+
throw t;
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
let t = i(e);
|
|
20
|
+
return r?.set(e, t), t;
|
|
21
|
+
} catch (t) {
|
|
22
|
+
if (r?.set(e, t), n) return null;
|
|
23
|
+
throw t;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
findNextMatchSync(t, n, r) {
|
|
28
|
+
let i = typeof t == "string" ? t : t.content, a = [];
|
|
29
|
+
function o(t, n, r = 0) {
|
|
30
|
+
return {
|
|
31
|
+
index: t,
|
|
32
|
+
captureIndices: n.indices.map((t) => t == null ? {
|
|
33
|
+
start: e,
|
|
34
|
+
end: e,
|
|
35
|
+
length: 0
|
|
36
|
+
} : {
|
|
37
|
+
start: t[0] + r,
|
|
38
|
+
end: t[1] + r,
|
|
39
|
+
length: t[1] - t[0]
|
|
40
|
+
})
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
for (let e = 0; e < this.regexps.length; e++) {
|
|
44
|
+
let t = this.regexps[e];
|
|
45
|
+
if (t) try {
|
|
46
|
+
t.lastIndex = n;
|
|
47
|
+
let r = t.exec(i);
|
|
48
|
+
if (!r) continue;
|
|
49
|
+
if (r.index === n) return o(e, r, 0);
|
|
50
|
+
a.push([
|
|
51
|
+
e,
|
|
52
|
+
r,
|
|
53
|
+
0
|
|
54
|
+
]);
|
|
55
|
+
} catch (e) {
|
|
56
|
+
if (this.options.forgiving) continue;
|
|
57
|
+
throw e;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (a.length) {
|
|
61
|
+
let e = Math.min(...a.map((e) => e[1].index));
|
|
62
|
+
for (let [t, n, r] of a) if (n.index === e) return o(t, n, r);
|
|
63
|
+
}
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region ../../node_modules/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/utils.js
|
|
69
|
+
function n(e) {
|
|
70
|
+
if ([...e].length !== 1) throw Error(`Expected "${e}" to be a single code point`);
|
|
71
|
+
return e.codePointAt(0);
|
|
72
|
+
}
|
|
73
|
+
function r(e, t, n) {
|
|
74
|
+
return e.has(t) || e.set(t, n), e.get(t);
|
|
75
|
+
}
|
|
76
|
+
var i = /* @__PURE__ */ new Set([
|
|
77
|
+
"alnum",
|
|
78
|
+
"alpha",
|
|
79
|
+
"ascii",
|
|
80
|
+
"blank",
|
|
81
|
+
"cntrl",
|
|
82
|
+
"digit",
|
|
83
|
+
"graph",
|
|
84
|
+
"lower",
|
|
85
|
+
"print",
|
|
86
|
+
"punct",
|
|
87
|
+
"space",
|
|
88
|
+
"upper",
|
|
89
|
+
"word",
|
|
90
|
+
"xdigit"
|
|
91
|
+
]), a = String.raw;
|
|
92
|
+
function o(e, t) {
|
|
93
|
+
if (e == null) throw Error(t ?? "Value expected");
|
|
94
|
+
return e;
|
|
95
|
+
}
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region ../../node_modules/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/tokenizer/tokenize.js
|
|
98
|
+
var s = a`\[\^?`, c = `c.? | C(?:-.?)?|${a`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${a`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${a`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${a`o\{[^\}]*\}?`}|${a`\d{1,3}`}`, l = /[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/, u = new RegExp(a`
|
|
99
|
+
\\ (?:
|
|
100
|
+
${c}
|
|
101
|
+
| [gk]<[^>]*>?
|
|
102
|
+
| [gk]'[^']*'?
|
|
103
|
+
| .
|
|
104
|
+
)
|
|
105
|
+
| \( (?:
|
|
106
|
+
\? (?:
|
|
107
|
+
[:=!>({]
|
|
108
|
+
| <[=!]
|
|
109
|
+
| <[^>]*>
|
|
110
|
+
| '[^']*'
|
|
111
|
+
| ~\|?
|
|
112
|
+
| #(?:[^)\\]|\\.?)*
|
|
113
|
+
| [^:)]*[:)]
|
|
114
|
+
)?
|
|
115
|
+
| \*[^\)]*\)?
|
|
116
|
+
)?
|
|
117
|
+
| (?:${l.source})+
|
|
118
|
+
| ${s}
|
|
119
|
+
| .
|
|
120
|
+
`.replace(/\s+/g, ""), "gsu"), d = new RegExp(a`
|
|
121
|
+
\\ (?:
|
|
122
|
+
${c}
|
|
123
|
+
| .
|
|
124
|
+
)
|
|
125
|
+
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
126
|
+
| ${s}
|
|
127
|
+
| &&
|
|
128
|
+
| .
|
|
129
|
+
`.replace(/\s+/g, ""), "gsu");
|
|
130
|
+
function f(e, t = {}) {
|
|
131
|
+
let n = {
|
|
132
|
+
flags: "",
|
|
133
|
+
...t,
|
|
134
|
+
rules: {
|
|
135
|
+
captureGroup: !1,
|
|
136
|
+
singleline: !1,
|
|
137
|
+
...t.rules
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
if (typeof e != "string") throw Error("String expected as pattern");
|
|
141
|
+
let r = ve(n.flags), i = [r.extended], a = {
|
|
142
|
+
captureGroup: n.rules.captureGroup,
|
|
143
|
+
getCurrentModX() {
|
|
144
|
+
return i.at(-1);
|
|
145
|
+
},
|
|
146
|
+
numOpenGroups: 0,
|
|
147
|
+
popModX() {
|
|
148
|
+
i.pop();
|
|
149
|
+
},
|
|
150
|
+
pushModX(e) {
|
|
151
|
+
i.push(e);
|
|
152
|
+
},
|
|
153
|
+
replaceCurrentModX(e) {
|
|
154
|
+
i[i.length - 1] = e;
|
|
155
|
+
},
|
|
156
|
+
singleline: n.rules.singleline
|
|
157
|
+
}, o = [], s;
|
|
158
|
+
for (u.lastIndex = 0; s = u.exec(e);) {
|
|
159
|
+
let t = p(a, e, s[0], u.lastIndex);
|
|
160
|
+
t.tokens ? o.push(...t.tokens) : t.token && o.push(t.token), t.lastIndex !== void 0 && (u.lastIndex = t.lastIndex);
|
|
161
|
+
}
|
|
162
|
+
let c = [], l = 0;
|
|
163
|
+
o.filter((e) => e.type === "GroupOpen").forEach((e) => {
|
|
164
|
+
e.kind === "capturing" ? e.number = ++l : e.raw === "(" && c.push(e);
|
|
165
|
+
}), l || c.forEach((e, t) => {
|
|
166
|
+
e.kind = "capturing", e.number = t + 1;
|
|
167
|
+
});
|
|
168
|
+
let d = l || c.length;
|
|
169
|
+
return {
|
|
170
|
+
tokens: o.map((e) => e.type === "EscapedNumber" ? be(e, d) : e).flat(),
|
|
171
|
+
flags: r
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
function p(e, t, r, i) {
|
|
175
|
+
let [o, s] = r;
|
|
176
|
+
if (r === "[" || r === "[^") {
|
|
177
|
+
let e = m(t, r, i);
|
|
178
|
+
return {
|
|
179
|
+
tokens: e.tokens,
|
|
180
|
+
lastIndex: e.lastIndex
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
if (o === "\\") {
|
|
184
|
+
if ("AbBGyYzZ".includes(s)) return { token: v(r, r) };
|
|
185
|
+
if (/^\\g[<']/.test(r)) {
|
|
186
|
+
if (!/^\\g(?:<[^>]+>|'[^']+')$/.test(r)) throw Error(`Invalid group name "${r}"`);
|
|
187
|
+
return { token: ce(r) };
|
|
188
|
+
}
|
|
189
|
+
if (/^\\k[<']/.test(r)) {
|
|
190
|
+
if (!/^\\k(?:<[^>]+>|'[^']+')$/.test(r)) throw Error(`Invalid group name "${r}"`);
|
|
191
|
+
return { token: y(r) };
|
|
192
|
+
}
|
|
193
|
+
if (s === "K") return { token: re("keep", r) };
|
|
194
|
+
if (s === "N" || s === "R") return { token: S("newline", r, { negate: s === "N" }) };
|
|
195
|
+
if (s === "O") return { token: S("any", r) };
|
|
196
|
+
if (s === "X") return { token: S("text_segment", r) };
|
|
197
|
+
let e = g(r, { inCharClass: !1 });
|
|
198
|
+
return Array.isArray(e) ? { tokens: e } : { token: e };
|
|
199
|
+
}
|
|
200
|
+
if (o === "(") {
|
|
201
|
+
if (s === "*") return { token: pe(r) };
|
|
202
|
+
if (r === "(?{") throw Error(`Unsupported callout "${r}"`);
|
|
203
|
+
if (r.startsWith("(?#")) {
|
|
204
|
+
if (t[i] !== ")") throw Error("Unclosed comment group \"(?#\"");
|
|
205
|
+
return { lastIndex: i + 1 };
|
|
206
|
+
}
|
|
207
|
+
if (/^\(\?[-imx]+[:)]$/.test(r)) return { token: fe(r, e) };
|
|
208
|
+
if (e.pushModX(e.getCurrentModX()), e.numOpenGroups++, r === "(" && !e.captureGroup || r === "(?:") return { token: C("group", r) };
|
|
209
|
+
if (r === "(?>") return { token: C("atomic", r) };
|
|
210
|
+
if (r === "(?=" || r === "(?!" || r === "(?<=" || r === "(?<!") return { token: C(r[2] === "<" ? "lookbehind" : "lookahead", r, { negate: r.endsWith("!") }) };
|
|
211
|
+
if (r === "(" && e.captureGroup || r.startsWith("(?<") && r.endsWith(">") || r.startsWith("(?'") && r.endsWith("'")) return { token: C("capturing", r, { ...r !== "(" && { name: r.slice(3, -1) } }) };
|
|
212
|
+
if (r.startsWith("(?~")) {
|
|
213
|
+
if (r === "(?~|") throw Error(`Unsupported absence function kind "${r}"`);
|
|
214
|
+
return { token: C("absence_repeater", r) };
|
|
215
|
+
}
|
|
216
|
+
throw Error(r === "(?(" ? `Unsupported conditional "${r}"` : `Invalid or unsupported group option "${r}"`);
|
|
217
|
+
}
|
|
218
|
+
if (r === ")") {
|
|
219
|
+
if (e.popModX(), e.numOpenGroups--, e.numOpenGroups < 0) throw Error("Unmatched \")\"");
|
|
220
|
+
return { token: ae(r) };
|
|
221
|
+
}
|
|
222
|
+
if (e.getCurrentModX()) {
|
|
223
|
+
if (r === "#") {
|
|
224
|
+
let e = t.indexOf("\n", i);
|
|
225
|
+
return { lastIndex: e === -1 ? t.length : e };
|
|
226
|
+
}
|
|
227
|
+
if (/^\s$/.test(r)) {
|
|
228
|
+
let e = /\s+/y;
|
|
229
|
+
return e.lastIndex = i, { lastIndex: e.exec(t) ? e.lastIndex : i };
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
return r === "." ? { token: S("dot", r) } : r === "^" || r === "$" ? { token: v(e.singleline ? {
|
|
233
|
+
"^": a`\A`,
|
|
234
|
+
$: a`\Z`
|
|
235
|
+
}[r] : r, r) } : r === "|" ? { token: _(r) } : l.test(r) ? { tokens: xe(r) } : { token: b(n(r), r) };
|
|
236
|
+
}
|
|
237
|
+
function m(e, t, n) {
|
|
238
|
+
let r = [ne(t[1] === "^", t)], i = 1, a;
|
|
239
|
+
for (d.lastIndex = n; a = d.exec(e);) {
|
|
240
|
+
let e = a[0];
|
|
241
|
+
if (e[0] === "[" && e[1] !== ":") i++, r.push(ne(e[1] === "^", e));
|
|
242
|
+
else if (e === "]") {
|
|
243
|
+
if (r.at(-1).type === "CharacterClassOpen") r.push(b(93, e));
|
|
244
|
+
else if (i--, r.push(x(e)), !i) break;
|
|
245
|
+
} else {
|
|
246
|
+
let t = h(e);
|
|
247
|
+
Array.isArray(t) ? r.push(...t) : r.push(t);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
return {
|
|
251
|
+
tokens: r,
|
|
252
|
+
lastIndex: d.lastIndex || e.length
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
function h(e) {
|
|
256
|
+
if (e[0] === "\\") return g(e, { inCharClass: !0 });
|
|
257
|
+
if (e[0] === "[") {
|
|
258
|
+
let t = /\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);
|
|
259
|
+
if (!t || !i.has(t.groups.name)) throw Error(`Invalid POSIX class "${e}"`);
|
|
260
|
+
return S("posix", e, {
|
|
261
|
+
value: t.groups.name,
|
|
262
|
+
negate: !!t.groups.negate
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
return e === "-" ? ee(e) : e === "&&" ? te(e) : b(n(e), e);
|
|
266
|
+
}
|
|
267
|
+
function g(e, { inCharClass: t }) {
|
|
268
|
+
let r = e[1];
|
|
269
|
+
if (r === "c" || r === "C") return de(e);
|
|
270
|
+
if ("dDhHsSwW".includes(r)) return he(e);
|
|
271
|
+
if (e.startsWith(a`\o{`)) throw Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);
|
|
272
|
+
if (/^\\[pP]\{/.test(e)) {
|
|
273
|
+
if (e.length === 3) throw Error(`Incomplete or invalid Unicode property "${e}"`);
|
|
274
|
+
return ge(e);
|
|
275
|
+
}
|
|
276
|
+
if (/^\\x[89A-Fa-f]\p{AHex}/u.test(e)) try {
|
|
277
|
+
let t = e.split(/\\x/).slice(1).map((e) => parseInt(e, 16)), r = new TextDecoder("utf-8", {
|
|
278
|
+
ignoreBOM: !0,
|
|
279
|
+
fatal: !0
|
|
280
|
+
}).decode(new Uint8Array(t)), i = new TextEncoder();
|
|
281
|
+
return [...r].map((e) => {
|
|
282
|
+
let t = [...i.encode(e)].map((e) => `\\x${e.toString(16)}`).join("");
|
|
283
|
+
return b(n(e), t);
|
|
284
|
+
});
|
|
285
|
+
} catch {
|
|
286
|
+
throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`);
|
|
287
|
+
}
|
|
288
|
+
if (r === "u" || r === "x") return b(ye(e), e);
|
|
289
|
+
if (ue.has(r)) return b(ue.get(r), e);
|
|
290
|
+
if (/\d/.test(r)) return ie(t, e);
|
|
291
|
+
if (e === "\\") throw Error(a`Incomplete escape "\"`);
|
|
292
|
+
if (r === "M") throw Error(`Unsupported meta "${e}"`);
|
|
293
|
+
if ([...e].length === 2) return b(e.codePointAt(1), e);
|
|
294
|
+
throw Error(`Unexpected escape "${e}"`);
|
|
295
|
+
}
|
|
296
|
+
function _(e) {
|
|
297
|
+
return {
|
|
298
|
+
type: "Alternator",
|
|
299
|
+
raw: e
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
function v(e, t) {
|
|
303
|
+
return {
|
|
304
|
+
type: "Assertion",
|
|
305
|
+
kind: e,
|
|
306
|
+
raw: t
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
function y(e) {
|
|
310
|
+
return {
|
|
311
|
+
type: "Backreference",
|
|
312
|
+
raw: e
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
function b(e, t) {
|
|
316
|
+
return {
|
|
317
|
+
type: "Character",
|
|
318
|
+
value: e,
|
|
319
|
+
raw: t
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
function x(e) {
|
|
323
|
+
return {
|
|
324
|
+
type: "CharacterClassClose",
|
|
325
|
+
raw: e
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
function ee(e) {
|
|
329
|
+
return {
|
|
330
|
+
type: "CharacterClassHyphen",
|
|
331
|
+
raw: e
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
function te(e) {
|
|
335
|
+
return {
|
|
336
|
+
type: "CharacterClassIntersector",
|
|
337
|
+
raw: e
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
function ne(e, t) {
|
|
341
|
+
return {
|
|
342
|
+
type: "CharacterClassOpen",
|
|
343
|
+
negate: e,
|
|
344
|
+
raw: t
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
function S(e, t, n = {}) {
|
|
348
|
+
return {
|
|
349
|
+
type: "CharacterSet",
|
|
350
|
+
kind: e,
|
|
351
|
+
...n,
|
|
352
|
+
raw: t
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
function re(e, t, n = {}) {
|
|
356
|
+
return e === "keep" ? {
|
|
357
|
+
type: "Directive",
|
|
358
|
+
kind: e,
|
|
359
|
+
raw: t
|
|
360
|
+
} : {
|
|
361
|
+
type: "Directive",
|
|
362
|
+
kind: e,
|
|
363
|
+
flags: o(n.flags),
|
|
364
|
+
raw: t
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
function ie(e, t) {
|
|
368
|
+
return {
|
|
369
|
+
type: "EscapedNumber",
|
|
370
|
+
inCharClass: e,
|
|
371
|
+
raw: t
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
function ae(e) {
|
|
375
|
+
return {
|
|
376
|
+
type: "GroupClose",
|
|
377
|
+
raw: e
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
function C(e, t, n = {}) {
|
|
381
|
+
return {
|
|
382
|
+
type: "GroupOpen",
|
|
383
|
+
kind: e,
|
|
384
|
+
...n,
|
|
385
|
+
raw: t
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
function oe(e, t, n, r) {
|
|
389
|
+
return {
|
|
390
|
+
type: "NamedCallout",
|
|
391
|
+
kind: e,
|
|
392
|
+
tag: t,
|
|
393
|
+
arguments: n,
|
|
394
|
+
raw: r
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
function se(e, t, n, r) {
|
|
398
|
+
return {
|
|
399
|
+
type: "Quantifier",
|
|
400
|
+
kind: e,
|
|
401
|
+
min: t,
|
|
402
|
+
max: n,
|
|
403
|
+
raw: r
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
function ce(e) {
|
|
407
|
+
return {
|
|
408
|
+
type: "Subroutine",
|
|
409
|
+
raw: e
|
|
410
|
+
};
|
|
411
|
+
}
|
|
412
|
+
var le = /* @__PURE__ */ new Set([
|
|
413
|
+
"COUNT",
|
|
414
|
+
"CMP",
|
|
415
|
+
"ERROR",
|
|
416
|
+
"FAIL",
|
|
417
|
+
"MAX",
|
|
418
|
+
"MISMATCH",
|
|
419
|
+
"SKIP",
|
|
420
|
+
"TOTAL_COUNT"
|
|
421
|
+
]), ue = /* @__PURE__ */ new Map([
|
|
422
|
+
["a", 7],
|
|
423
|
+
["b", 8],
|
|
424
|
+
["e", 27],
|
|
425
|
+
["f", 12],
|
|
426
|
+
["n", 10],
|
|
427
|
+
["r", 13],
|
|
428
|
+
["t", 9],
|
|
429
|
+
["v", 11]
|
|
430
|
+
]);
|
|
431
|
+
function de(e) {
|
|
432
|
+
let t = e[1] === "c" ? e[2] : e[3];
|
|
433
|
+
if (!t || !/[A-Za-z]/.test(t)) throw Error(`Unsupported control character "${e}"`);
|
|
434
|
+
return b(n(t.toUpperCase()) - 64, e);
|
|
435
|
+
}
|
|
436
|
+
function fe(e, t) {
|
|
437
|
+
let { on: n, off: r } = /^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;
|
|
438
|
+
r ??= "";
|
|
439
|
+
let i = (t.getCurrentModX() || n.includes("x")) && !r.includes("x"), a = _e(n), o = _e(r), s = {};
|
|
440
|
+
if (a && (s.enable = a), o && (s.disable = o), e.endsWith(")")) return t.replaceCurrentModX(i), re("flags", e, { flags: s });
|
|
441
|
+
if (e.endsWith(":")) return t.pushModX(i), t.numOpenGroups++, C("group", e, { ...(a || o) && { flags: s } });
|
|
442
|
+
throw Error(`Unexpected flag modifier "${e}"`);
|
|
443
|
+
}
|
|
444
|
+
function pe(e) {
|
|
445
|
+
let t = /\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);
|
|
446
|
+
if (!t) throw Error(`Incomplete or invalid named callout "${e}"`);
|
|
447
|
+
let { name: n, tag: r, args: i } = t.groups;
|
|
448
|
+
if (!n) throw Error(`Invalid named callout "${e}"`);
|
|
449
|
+
if (r === "") throw Error(`Named callout tag with empty value not allowed "${e}"`);
|
|
450
|
+
let a = i ? i.split(",").filter((e) => e !== "").map((e) => /^[+-]?\d+$/.test(e) ? +e : e) : [], [o, s, c] = a, l = le.has(n) ? n.toLowerCase() : "custom";
|
|
451
|
+
switch (l) {
|
|
452
|
+
case "fail":
|
|
453
|
+
case "mismatch":
|
|
454
|
+
case "skip":
|
|
455
|
+
if (a.length > 0) throw Error(`Named callout arguments not allowed "${a}"`);
|
|
456
|
+
break;
|
|
457
|
+
case "error":
|
|
458
|
+
if (a.length > 1) throw Error(`Named callout allows only one argument "${a}"`);
|
|
459
|
+
if (typeof o == "string") throw Error(`Named callout argument must be a number "${o}"`);
|
|
460
|
+
break;
|
|
461
|
+
case "max":
|
|
462
|
+
if (!a.length || a.length > 2) throw Error(`Named callout must have one or two arguments "${a}"`);
|
|
463
|
+
if (typeof o == "string" && !/^[A-Za-z_]\w*$/.test(o)) throw Error(`Named callout argument one must be a tag or number "${o}"`);
|
|
464
|
+
if (a.length === 2 && (typeof s == "number" || !/^[<>X]$/.test(s))) throw Error(`Named callout optional argument two must be '<', '>', or 'X' "${s}"`);
|
|
465
|
+
break;
|
|
466
|
+
case "count":
|
|
467
|
+
case "total_count":
|
|
468
|
+
if (a.length > 1) throw Error(`Named callout allows only one argument "${a}"`);
|
|
469
|
+
if (a.length === 1 && (typeof o == "number" || !/^[<>X]$/.test(o))) throw Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);
|
|
470
|
+
break;
|
|
471
|
+
case "cmp":
|
|
472
|
+
if (a.length !== 3) throw Error(`Named callout must have three arguments "${a}"`);
|
|
473
|
+
if (typeof o == "string" && !/^[A-Za-z_]\w*$/.test(o)) throw Error(`Named callout argument one must be a tag or number "${o}"`);
|
|
474
|
+
if (typeof s == "number" || !/^(?:[<>!=]=|[<>])$/.test(s)) throw Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${s}"`);
|
|
475
|
+
if (typeof c == "string" && !/^[A-Za-z_]\w*$/.test(c)) throw Error(`Named callout argument three must be a tag or number "${c}"`);
|
|
476
|
+
break;
|
|
477
|
+
case "custom": throw Error(`Undefined callout name "${n}"`);
|
|
478
|
+
default: throw Error(`Unexpected named callout kind "${l}"`);
|
|
479
|
+
}
|
|
480
|
+
return oe(l, r ?? null, i?.split(",") ?? null, e);
|
|
481
|
+
}
|
|
482
|
+
function me(e) {
|
|
483
|
+
let t = null, n, r;
|
|
484
|
+
if (e[0] === "{") {
|
|
485
|
+
let { minStr: i, maxStr: a } = /^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups, o = 1e5;
|
|
486
|
+
if (+i > o || a && +a > o) throw Error("Quantifier value unsupported in Oniguruma");
|
|
487
|
+
if (n = +i, r = a === void 0 ? +i : a === "" ? 1 / 0 : +a, n > r && (t = "possessive", [n, r] = [r, n]), e.endsWith("?")) {
|
|
488
|
+
if (t === "possessive") throw Error("Unsupported possessive interval quantifier chain with \"?\"");
|
|
489
|
+
t = "lazy";
|
|
490
|
+
} else t ||= "greedy";
|
|
491
|
+
} else n = +(e[0] === "+"), r = e[0] === "?" ? 1 : 1 / 0, t = e[1] === "+" ? "possessive" : e[1] === "?" ? "lazy" : "greedy";
|
|
492
|
+
return se(t, n, r, e);
|
|
493
|
+
}
|
|
494
|
+
function he(e) {
|
|
495
|
+
let t = e[1].toLowerCase();
|
|
496
|
+
return S({
|
|
497
|
+
d: "digit",
|
|
498
|
+
h: "hex",
|
|
499
|
+
s: "space",
|
|
500
|
+
w: "word"
|
|
501
|
+
}[t], e, { negate: e[1] !== t });
|
|
502
|
+
}
|
|
503
|
+
function ge(e) {
|
|
504
|
+
let { p: t, neg: n, value: r } = /^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;
|
|
505
|
+
return S("property", e, {
|
|
506
|
+
value: r,
|
|
507
|
+
negate: t === "P" && !n || t === "p" && !!n
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
function _e(e) {
|
|
511
|
+
let t = {};
|
|
512
|
+
return e.includes("i") && (t.ignoreCase = !0), e.includes("m") && (t.dotAll = !0), e.includes("x") && (t.extended = !0), Object.keys(t).length ? t : null;
|
|
513
|
+
}
|
|
514
|
+
function ve(e) {
|
|
515
|
+
let t = {
|
|
516
|
+
ignoreCase: !1,
|
|
517
|
+
dotAll: !1,
|
|
518
|
+
extended: !1,
|
|
519
|
+
digitIsAscii: !1,
|
|
520
|
+
posixIsAscii: !1,
|
|
521
|
+
spaceIsAscii: !1,
|
|
522
|
+
wordIsAscii: !1,
|
|
523
|
+
textSegmentMode: null
|
|
524
|
+
};
|
|
525
|
+
for (let n = 0; n < e.length; n++) {
|
|
526
|
+
let r = e[n];
|
|
527
|
+
if (!"imxDPSWy".includes(r)) throw Error(`Invalid flag "${r}"`);
|
|
528
|
+
if (r === "y") {
|
|
529
|
+
if (!/^y{[gw]}/.test(e.slice(n))) throw Error("Invalid or unspecified flag \"y\" mode");
|
|
530
|
+
t.textSegmentMode = e[n + 2] === "g" ? "grapheme" : "word", n += 3;
|
|
531
|
+
continue;
|
|
532
|
+
}
|
|
533
|
+
t[{
|
|
534
|
+
i: "ignoreCase",
|
|
535
|
+
m: "dotAll",
|
|
536
|
+
x: "extended",
|
|
537
|
+
D: "digitIsAscii",
|
|
538
|
+
P: "posixIsAscii",
|
|
539
|
+
S: "spaceIsAscii",
|
|
540
|
+
W: "wordIsAscii"
|
|
541
|
+
}[r]] = !0;
|
|
542
|
+
}
|
|
543
|
+
return t;
|
|
544
|
+
}
|
|
545
|
+
function ye(e) {
|
|
546
|
+
if (/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e)) throw Error(`Incomplete or invalid escape "${e}"`);
|
|
547
|
+
let t = e[2] === "{" ? /^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(e).groups.hex : e.slice(2);
|
|
548
|
+
return parseInt(t, 16);
|
|
549
|
+
}
|
|
550
|
+
function be(e, t) {
|
|
551
|
+
let { raw: r, inCharClass: i } = e, o = r.slice(1);
|
|
552
|
+
if (!i && (o !== "0" && o.length === 1 || o[0] !== "0" && +o <= t)) return [y(r)];
|
|
553
|
+
let s = [], c = o.match(/^[0-7]+|\d/g);
|
|
554
|
+
for (let e = 0; e < c.length; e++) {
|
|
555
|
+
let t = c[e], i;
|
|
556
|
+
if (e === 0 && t !== "8" && t !== "9") {
|
|
557
|
+
if (i = parseInt(t, 8), i > 127) throw Error(a`Octal encoded byte above 177 unsupported "${r}"`);
|
|
558
|
+
} else i = n(t);
|
|
559
|
+
s.push(b(i, (e === 0 ? "\\" : "") + t));
|
|
560
|
+
}
|
|
561
|
+
return s;
|
|
562
|
+
}
|
|
563
|
+
function xe(e) {
|
|
564
|
+
let t = [], n = new RegExp(l, "gy"), r;
|
|
565
|
+
for (; r = n.exec(e);) {
|
|
566
|
+
let e = r[0];
|
|
567
|
+
if (e[0] === "{") {
|
|
568
|
+
let r = /^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(e);
|
|
569
|
+
if (r) {
|
|
570
|
+
let { min: i, max: a } = r.groups;
|
|
571
|
+
if (+i > +a && e.endsWith("?")) {
|
|
572
|
+
n.lastIndex--, t.push(me(e.slice(0, -1)));
|
|
573
|
+
continue;
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
t.push(me(e));
|
|
578
|
+
}
|
|
579
|
+
return t;
|
|
580
|
+
}
|
|
581
|
+
//#endregion
|
|
582
|
+
//#region ../../node_modules/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/parser/node-utils.js
|
|
583
|
+
function Se(e, t) {
|
|
584
|
+
if (!Array.isArray(e.body)) throw Error("Expected node with body array");
|
|
585
|
+
if (e.body.length !== 1) return !1;
|
|
586
|
+
let n = e.body[0];
|
|
587
|
+
return !t || Object.keys(t).every((e) => t[e] === n[e]);
|
|
588
|
+
}
|
|
589
|
+
function Ce(e) {
|
|
590
|
+
return we.has(e.type);
|
|
591
|
+
}
|
|
592
|
+
var we = /* @__PURE__ */ new Set([
|
|
593
|
+
"AbsenceFunction",
|
|
594
|
+
"Backreference",
|
|
595
|
+
"CapturingGroup",
|
|
596
|
+
"Character",
|
|
597
|
+
"CharacterClass",
|
|
598
|
+
"CharacterSet",
|
|
599
|
+
"Group",
|
|
600
|
+
"Quantifier",
|
|
601
|
+
"Subroutine"
|
|
602
|
+
]);
|
|
603
|
+
//#endregion
|
|
604
|
+
//#region ../../node_modules/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/parser/parse.js
|
|
605
|
+
function Te(e, t = {}) {
|
|
606
|
+
let n = {
|
|
607
|
+
flags: "",
|
|
608
|
+
normalizeUnknownPropertyNames: !1,
|
|
609
|
+
skipBackrefValidation: !1,
|
|
610
|
+
skipLookbehindValidation: !1,
|
|
611
|
+
skipPropertyNameValidation: !1,
|
|
612
|
+
unicodePropertyMap: null,
|
|
613
|
+
...t,
|
|
614
|
+
rules: {
|
|
615
|
+
captureGroup: !1,
|
|
616
|
+
singleline: !1,
|
|
617
|
+
...t.rules
|
|
618
|
+
}
|
|
619
|
+
}, r = f(e, {
|
|
620
|
+
flags: n.flags,
|
|
621
|
+
rules: {
|
|
622
|
+
captureGroup: n.rules.captureGroup,
|
|
623
|
+
singleline: n.rules.singleline
|
|
624
|
+
}
|
|
625
|
+
}), i = (e, t) => {
|
|
626
|
+
let n = r.tokens[o.nextIndex];
|
|
627
|
+
switch (o.parent = e, o.nextIndex++, n.type) {
|
|
628
|
+
case "Alternator": return w();
|
|
629
|
+
case "Assertion": return Ee(n);
|
|
630
|
+
case "Backreference": return De(n, o);
|
|
631
|
+
case "Character": return T(n.value, { useLastValid: !!t.isCheckingRangeEnd });
|
|
632
|
+
case "CharacterClassHyphen": return Oe(n, o, t);
|
|
633
|
+
case "CharacterClassOpen": return ke(n, o, t);
|
|
634
|
+
case "CharacterSet": return Ae(n, o);
|
|
635
|
+
case "Directive": return Be(n.kind, { flags: n.flags });
|
|
636
|
+
case "GroupOpen": return je(n, o, t);
|
|
637
|
+
case "NamedCallout": return He(n.kind, n.tag, n.arguments);
|
|
638
|
+
case "Quantifier": return Me(n, o);
|
|
639
|
+
case "Subroutine": return Ne(n, o);
|
|
640
|
+
default: throw Error(`Unexpected token type "${n.type}"`);
|
|
641
|
+
}
|
|
642
|
+
}, o = {
|
|
643
|
+
capturingGroups: [],
|
|
644
|
+
hasNumberedRef: !1,
|
|
645
|
+
namedGroupsByName: /* @__PURE__ */ new Map(),
|
|
646
|
+
nextIndex: 0,
|
|
647
|
+
normalizeUnknownPropertyNames: n.normalizeUnknownPropertyNames,
|
|
648
|
+
parent: null,
|
|
649
|
+
skipBackrefValidation: n.skipBackrefValidation,
|
|
650
|
+
skipLookbehindValidation: n.skipLookbehindValidation,
|
|
651
|
+
skipPropertyNameValidation: n.skipPropertyNameValidation,
|
|
652
|
+
subroutines: [],
|
|
653
|
+
tokens: r.tokens,
|
|
654
|
+
unicodePropertyMap: n.unicodePropertyMap,
|
|
655
|
+
walk: i
|
|
656
|
+
}, s = Ge(Ve(r.flags)), c = s.body[0];
|
|
657
|
+
for (; o.nextIndex < r.tokens.length;) {
|
|
658
|
+
let e = i(c, {});
|
|
659
|
+
e.type === "Alternative" ? (s.body.push(e), c = e) : c.body.push(e);
|
|
660
|
+
}
|
|
661
|
+
let { capturingGroups: l, hasNumberedRef: u, namedGroupsByName: d, subroutines: p } = o;
|
|
662
|
+
if (u && d.size && !n.rules.captureGroup) throw Error("Numbered backref/subroutine not allowed when using named capture");
|
|
663
|
+
for (let { ref: e } of p) if (typeof e == "number") {
|
|
664
|
+
if (e > l.length) throw Error("Subroutine uses a group number that's not defined");
|
|
665
|
+
e && (l[e - 1].isSubroutined = !0);
|
|
666
|
+
} else if (d.has(e)) {
|
|
667
|
+
if (d.get(e).length > 1) throw Error(a`Subroutine uses a duplicate group name "\g<${e}>"`);
|
|
668
|
+
d.get(e)[0].isSubroutined = !0;
|
|
669
|
+
} else throw Error(a`Subroutine uses a group name that's not defined "\g<${e}>"`);
|
|
670
|
+
return s;
|
|
671
|
+
}
|
|
672
|
+
function Ee({ kind: e }) {
|
|
673
|
+
return Fe(o({
|
|
674
|
+
"^": "line_start",
|
|
675
|
+
$: "line_end",
|
|
676
|
+
"\\A": "string_start",
|
|
677
|
+
"\\b": "word_boundary",
|
|
678
|
+
"\\B": "word_boundary",
|
|
679
|
+
"\\G": "search_start",
|
|
680
|
+
"\\y": "text_segment_boundary",
|
|
681
|
+
"\\Y": "text_segment_boundary",
|
|
682
|
+
"\\z": "string_end",
|
|
683
|
+
"\\Z": "string_end_newline"
|
|
684
|
+
}[e], `Unexpected assertion kind "${e}"`), { negate: e === a`\B` || e === a`\Y` });
|
|
685
|
+
}
|
|
686
|
+
function De({ raw: e }, t) {
|
|
687
|
+
let n = /^\\k[<']/.test(e), r = n ? e.slice(3, -1) : e.slice(1), i = (n, r = !1) => {
|
|
688
|
+
let i = t.capturingGroups.length, a = !1;
|
|
689
|
+
if (n > i) {
|
|
690
|
+
if (t.skipBackrefValidation) a = !0;
|
|
691
|
+
else throw Error(`Not enough capturing groups defined to the left "${e}"`);
|
|
692
|
+
}
|
|
693
|
+
return t.hasNumberedRef = !0, Ie(r ? i + 1 - n : n, { orphan: a });
|
|
694
|
+
};
|
|
695
|
+
if (n) {
|
|
696
|
+
let n = /^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);
|
|
697
|
+
if (n) return i(+n.groups.num, !!n.groups.sign);
|
|
698
|
+
if (/[-+]/.test(r)) throw Error(`Invalid backref name "${e}"`);
|
|
699
|
+
if (!t.namedGroupsByName.has(r)) throw Error(`Group name not defined to the left "${e}"`);
|
|
700
|
+
return Ie(r);
|
|
701
|
+
}
|
|
702
|
+
return i(+r);
|
|
703
|
+
}
|
|
704
|
+
function Oe(e, t, r) {
|
|
705
|
+
let { tokens: i, walk: a } = t, o = t.parent, s = o.body.at(-1), c = i[t.nextIndex];
|
|
706
|
+
if (!r.isCheckingRangeEnd && s && s.type !== "CharacterClass" && s.type !== "CharacterClassRange" && c && c.type !== "CharacterClassOpen" && c.type !== "CharacterClassClose" && c.type !== "CharacterClassIntersector") {
|
|
707
|
+
let e = a(o, {
|
|
708
|
+
...r,
|
|
709
|
+
isCheckingRangeEnd: !0
|
|
710
|
+
});
|
|
711
|
+
if (s.type === "Character" && e.type === "Character") return o.body.pop(), Re(s, e);
|
|
712
|
+
throw Error("Invalid character class range");
|
|
713
|
+
}
|
|
714
|
+
return T(n("-"));
|
|
715
|
+
}
|
|
716
|
+
function ke({ negate: e }, t, n) {
|
|
717
|
+
let { tokens: r, walk: i } = t, a = [E()], o = r[t.nextIndex], s = $e(o);
|
|
718
|
+
for (; s.type !== "CharacterClassClose";) {
|
|
719
|
+
if (s.type === "CharacterClassIntersector") a.push(E()), t.nextIndex++;
|
|
720
|
+
else {
|
|
721
|
+
let e = a.at(-1);
|
|
722
|
+
e.body.push(i(e, n));
|
|
723
|
+
}
|
|
724
|
+
s = $e(r[t.nextIndex], o);
|
|
725
|
+
}
|
|
726
|
+
let c = E({ negate: e });
|
|
727
|
+
return a.length === 1 ? c.body = a[0].body : (c.kind = "intersection", c.body = a.map((e) => e.body.length === 1 ? e.body[0] : e)), t.nextIndex++, c;
|
|
728
|
+
}
|
|
729
|
+
function Ae({ kind: e, negate: t, value: n }, r) {
|
|
730
|
+
let { normalizeUnknownPropertyNames: a, skipPropertyNameValidation: o, unicodePropertyMap: s } = r;
|
|
731
|
+
if (e === "property") {
|
|
732
|
+
let r = j(n);
|
|
733
|
+
if (i.has(r) && !s?.has(r)) e = "posix", n = r;
|
|
734
|
+
else return k(n, {
|
|
735
|
+
negate: t,
|
|
736
|
+
normalizeUnknownPropertyNames: a,
|
|
737
|
+
skipPropertyNameValidation: o,
|
|
738
|
+
unicodePropertyMap: s
|
|
739
|
+
});
|
|
740
|
+
}
|
|
741
|
+
return e === "posix" ? Ue(n, { negate: t }) : ze(e, { negate: t });
|
|
742
|
+
}
|
|
743
|
+
function je(e, t, n) {
|
|
744
|
+
let { tokens: i, capturingGroups: a, namedGroupsByName: o, skipLookbehindValidation: s, walk: c } = t, l = qe(e), u = l.type === "AbsenceFunction", d = Xe(l), f = d && l.negate;
|
|
745
|
+
if (l.type === "CapturingGroup" && (a.push(l), l.name && r(o, l.name, []).push(l)), u && n.isInAbsenceFunction) throw Error("Nested absence function not supported by Oniguruma");
|
|
746
|
+
let p = et(i[t.nextIndex]);
|
|
747
|
+
for (; p.type !== "GroupClose";) {
|
|
748
|
+
if (p.type === "Alternator") l.body.push(w()), t.nextIndex++;
|
|
749
|
+
else {
|
|
750
|
+
let e = l.body.at(-1), t = c(e, {
|
|
751
|
+
...n,
|
|
752
|
+
isInAbsenceFunction: n.isInAbsenceFunction || u,
|
|
753
|
+
isInLookbehind: n.isInLookbehind || d,
|
|
754
|
+
isInNegLookbehind: n.isInNegLookbehind || f
|
|
755
|
+
});
|
|
756
|
+
if (e.body.push(t), (d || n.isInLookbehind) && !s) {
|
|
757
|
+
let e = "Lookbehind includes a pattern not allowed by Oniguruma";
|
|
758
|
+
if (f || n.isInNegLookbehind) {
|
|
759
|
+
if (Ye(t) || t.type === "CapturingGroup") throw Error(e);
|
|
760
|
+
} else if (Ye(t) || Xe(t) && t.negate) throw Error(e);
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
p = et(i[t.nextIndex]);
|
|
764
|
+
}
|
|
765
|
+
return t.nextIndex++, l;
|
|
766
|
+
}
|
|
767
|
+
function Me({ kind: e, min: t, max: n }, r) {
|
|
768
|
+
let i = r.parent, a = i.body.at(-1);
|
|
769
|
+
if (!a || !Ce(a)) throw Error("Quantifier requires a repeatable token");
|
|
770
|
+
let o = We(e, t, n, a);
|
|
771
|
+
return i.body.pop(), o;
|
|
772
|
+
}
|
|
773
|
+
function Ne({ raw: e }, t) {
|
|
774
|
+
let { capturingGroups: n, subroutines: r } = t, i = e.slice(3, -1), a = /^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);
|
|
775
|
+
if (a) {
|
|
776
|
+
let e = +a.groups.num, r = n.length;
|
|
777
|
+
if (t.hasNumberedRef = !0, i = {
|
|
778
|
+
"": e,
|
|
779
|
+
"+": r + e,
|
|
780
|
+
"-": r + 1 - e
|
|
781
|
+
}[a.groups.sign], i < 1) throw Error("Invalid subroutine number");
|
|
782
|
+
} else i === "0" && (i = 0);
|
|
783
|
+
let o = Ke(i);
|
|
784
|
+
return r.push(o), o;
|
|
785
|
+
}
|
|
786
|
+
function Pe(e, t) {
|
|
787
|
+
if (e !== "repeater") throw Error(`Unexpected absence function kind "${e}"`);
|
|
788
|
+
return {
|
|
789
|
+
type: "AbsenceFunction",
|
|
790
|
+
kind: e,
|
|
791
|
+
body: A(t?.body)
|
|
792
|
+
};
|
|
793
|
+
}
|
|
794
|
+
function w(e) {
|
|
795
|
+
return {
|
|
796
|
+
type: "Alternative",
|
|
797
|
+
body: Je(e?.body)
|
|
798
|
+
};
|
|
799
|
+
}
|
|
800
|
+
function Fe(e, t) {
|
|
801
|
+
let n = {
|
|
802
|
+
type: "Assertion",
|
|
803
|
+
kind: e
|
|
804
|
+
};
|
|
805
|
+
return (e === "word_boundary" || e === "text_segment_boundary") && (n.negate = !!t?.negate), n;
|
|
806
|
+
}
|
|
807
|
+
function Ie(e, t) {
|
|
808
|
+
let n = !!t?.orphan;
|
|
809
|
+
return {
|
|
810
|
+
type: "Backreference",
|
|
811
|
+
ref: e,
|
|
812
|
+
...n && { orphan: n }
|
|
813
|
+
};
|
|
814
|
+
}
|
|
815
|
+
function Le(e, t) {
|
|
816
|
+
let n = {
|
|
817
|
+
name: void 0,
|
|
818
|
+
isSubroutined: !1,
|
|
819
|
+
...t
|
|
820
|
+
};
|
|
821
|
+
if (n.name !== void 0 && !Ze(n.name)) throw Error(`Group name "${n.name}" invalid in Oniguruma`);
|
|
822
|
+
return {
|
|
823
|
+
type: "CapturingGroup",
|
|
824
|
+
number: e,
|
|
825
|
+
...n.name && { name: n.name },
|
|
826
|
+
...n.isSubroutined && { isSubroutined: n.isSubroutined },
|
|
827
|
+
body: A(t?.body)
|
|
828
|
+
};
|
|
829
|
+
}
|
|
830
|
+
function T(e, t) {
|
|
831
|
+
let n = {
|
|
832
|
+
useLastValid: !1,
|
|
833
|
+
...t
|
|
834
|
+
};
|
|
835
|
+
if (e > 1114111) {
|
|
836
|
+
let t = e.toString(16);
|
|
837
|
+
if (n.useLastValid) e = 1114111;
|
|
838
|
+
else throw Error(e > 1310719 ? `Invalid code point out of range "\\x{${t}}"` : `Invalid code point out of range in JS "\\x{${t}}"`);
|
|
839
|
+
}
|
|
840
|
+
return {
|
|
841
|
+
type: "Character",
|
|
842
|
+
value: e
|
|
843
|
+
};
|
|
844
|
+
}
|
|
845
|
+
function E(e) {
|
|
846
|
+
let t = {
|
|
847
|
+
kind: "union",
|
|
848
|
+
negate: !1,
|
|
849
|
+
...e
|
|
850
|
+
};
|
|
851
|
+
return {
|
|
852
|
+
type: "CharacterClass",
|
|
853
|
+
kind: t.kind,
|
|
854
|
+
negate: t.negate,
|
|
855
|
+
body: Je(e?.body)
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
function Re(e, t) {
|
|
859
|
+
if (t.value < e.value) throw Error("Character class range out of order");
|
|
860
|
+
return {
|
|
861
|
+
type: "CharacterClassRange",
|
|
862
|
+
min: e,
|
|
863
|
+
max: t
|
|
864
|
+
};
|
|
865
|
+
}
|
|
866
|
+
function ze(e, t) {
|
|
867
|
+
let n = !!t?.negate, r = {
|
|
868
|
+
type: "CharacterSet",
|
|
869
|
+
kind: e
|
|
870
|
+
};
|
|
871
|
+
return (e === "digit" || e === "hex" || e === "newline" || e === "space" || e === "word") && (r.negate = n), (e === "text_segment" || e === "newline" && !n) && (r.variableLength = !0), r;
|
|
872
|
+
}
|
|
873
|
+
function Be(e, t = {}) {
|
|
874
|
+
if (e === "keep") return {
|
|
875
|
+
type: "Directive",
|
|
876
|
+
kind: e
|
|
877
|
+
};
|
|
878
|
+
if (e === "flags") return {
|
|
879
|
+
type: "Directive",
|
|
880
|
+
kind: e,
|
|
881
|
+
flags: o(t.flags)
|
|
882
|
+
};
|
|
883
|
+
throw Error(`Unexpected directive kind "${e}"`);
|
|
884
|
+
}
|
|
885
|
+
function Ve(e) {
|
|
886
|
+
return {
|
|
887
|
+
type: "Flags",
|
|
888
|
+
...e
|
|
889
|
+
};
|
|
890
|
+
}
|
|
891
|
+
function D(e) {
|
|
892
|
+
let t = e?.atomic, n = e?.flags;
|
|
893
|
+
if (t && n) throw Error("Atomic group cannot have flags");
|
|
894
|
+
return {
|
|
895
|
+
type: "Group",
|
|
896
|
+
...t && { atomic: t },
|
|
897
|
+
...n && { flags: n },
|
|
898
|
+
body: A(e?.body)
|
|
899
|
+
};
|
|
900
|
+
}
|
|
901
|
+
function O(e) {
|
|
902
|
+
let t = {
|
|
903
|
+
behind: !1,
|
|
904
|
+
negate: !1,
|
|
905
|
+
...e
|
|
906
|
+
};
|
|
907
|
+
return {
|
|
908
|
+
type: "LookaroundAssertion",
|
|
909
|
+
kind: t.behind ? "lookbehind" : "lookahead",
|
|
910
|
+
negate: t.negate,
|
|
911
|
+
body: A(e?.body)
|
|
912
|
+
};
|
|
913
|
+
}
|
|
914
|
+
function He(e, t, n) {
|
|
915
|
+
return {
|
|
916
|
+
type: "NamedCallout",
|
|
917
|
+
kind: e,
|
|
918
|
+
tag: t,
|
|
919
|
+
arguments: n
|
|
920
|
+
};
|
|
921
|
+
}
|
|
922
|
+
function Ue(e, t) {
|
|
923
|
+
let n = !!t?.negate;
|
|
924
|
+
if (!i.has(e)) throw Error(`Invalid POSIX class "${e}"`);
|
|
925
|
+
return {
|
|
926
|
+
type: "CharacterSet",
|
|
927
|
+
kind: "posix",
|
|
928
|
+
value: e,
|
|
929
|
+
negate: n
|
|
930
|
+
};
|
|
931
|
+
}
|
|
932
|
+
function We(e, t, n, r) {
|
|
933
|
+
if (t > n) throw Error("Invalid reversed quantifier range");
|
|
934
|
+
return {
|
|
935
|
+
type: "Quantifier",
|
|
936
|
+
kind: e,
|
|
937
|
+
min: t,
|
|
938
|
+
max: n,
|
|
939
|
+
body: r
|
|
940
|
+
};
|
|
941
|
+
}
|
|
942
|
+
function Ge(e, t) {
|
|
943
|
+
return {
|
|
944
|
+
type: "Regex",
|
|
945
|
+
body: A(t?.body),
|
|
946
|
+
flags: e
|
|
947
|
+
};
|
|
948
|
+
}
|
|
949
|
+
function Ke(e) {
|
|
950
|
+
return {
|
|
951
|
+
type: "Subroutine",
|
|
952
|
+
ref: e
|
|
953
|
+
};
|
|
954
|
+
}
|
|
955
|
+
function k(e, t) {
|
|
956
|
+
let n = {
|
|
957
|
+
negate: !1,
|
|
958
|
+
normalizeUnknownPropertyNames: !1,
|
|
959
|
+
skipPropertyNameValidation: !1,
|
|
960
|
+
unicodePropertyMap: null,
|
|
961
|
+
...t
|
|
962
|
+
}, r = n.unicodePropertyMap?.get(j(e));
|
|
963
|
+
if (!r) {
|
|
964
|
+
if (n.normalizeUnknownPropertyNames) r = Qe(e);
|
|
965
|
+
else if (n.unicodePropertyMap && !n.skipPropertyNameValidation) throw Error(a`Invalid Unicode property "\p{${e}}"`);
|
|
966
|
+
}
|
|
967
|
+
return {
|
|
968
|
+
type: "CharacterSet",
|
|
969
|
+
kind: "property",
|
|
970
|
+
value: r ?? e,
|
|
971
|
+
negate: n.negate
|
|
972
|
+
};
|
|
973
|
+
}
|
|
974
|
+
function qe({ flags: e, kind: t, name: n, negate: r, number: i }) {
|
|
975
|
+
switch (t) {
|
|
976
|
+
case "absence_repeater": return Pe("repeater");
|
|
977
|
+
case "atomic": return D({ atomic: !0 });
|
|
978
|
+
case "capturing": return Le(i, { name: n });
|
|
979
|
+
case "group": return D({ flags: e });
|
|
980
|
+
case "lookahead":
|
|
981
|
+
case "lookbehind": return O({
|
|
982
|
+
behind: t === "lookbehind",
|
|
983
|
+
negate: r
|
|
984
|
+
});
|
|
985
|
+
default: throw Error(`Unexpected group kind "${t}"`);
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
function A(e) {
|
|
989
|
+
if (e === void 0) e = [w()];
|
|
990
|
+
else if (!Array.isArray(e) || !e.length || !e.every((e) => e.type === "Alternative")) throw Error("Invalid body; expected array of one or more Alternative nodes");
|
|
991
|
+
return e;
|
|
992
|
+
}
|
|
993
|
+
function Je(e) {
|
|
994
|
+
if (e === void 0) e = [];
|
|
995
|
+
else if (!Array.isArray(e) || !e.every((e) => !!e.type)) throw Error("Invalid body; expected array of nodes");
|
|
996
|
+
return e;
|
|
997
|
+
}
|
|
998
|
+
function Ye(e) {
|
|
999
|
+
return e.type === "LookaroundAssertion" && e.kind === "lookahead";
|
|
1000
|
+
}
|
|
1001
|
+
function Xe(e) {
|
|
1002
|
+
return e.type === "LookaroundAssertion" && e.kind === "lookbehind";
|
|
1003
|
+
}
|
|
1004
|
+
function Ze(e) {
|
|
1005
|
+
return /^[\p{Alpha}\p{Pc}][^)]*$/u.test(e);
|
|
1006
|
+
}
|
|
1007
|
+
function Qe(e) {
|
|
1008
|
+
return e.trim().replace(/[- _]+/g, "_").replace(/[A-Z][a-z]+(?=[A-Z])/g, "$&_").replace(/[A-Za-z]+/g, (e) => e[0].toUpperCase() + e.slice(1).toLowerCase());
|
|
1009
|
+
}
|
|
1010
|
+
function j(e) {
|
|
1011
|
+
return e.replace(/[- _]+/g, "").toLowerCase();
|
|
1012
|
+
}
|
|
1013
|
+
function $e(e, t) {
|
|
1014
|
+
let n = t;
|
|
1015
|
+
return o(e, `Unclosed character class${n?.type === "Character" && n.value === 93 && n.raw === "]" ? " (started with \"]\")" : ""}`);
|
|
1016
|
+
}
|
|
1017
|
+
function et(e) {
|
|
1018
|
+
return o(e, "Unclosed group");
|
|
1019
|
+
}
|
|
1020
|
+
//#endregion
|
|
1021
|
+
//#region ../../node_modules/.pnpm/oniguruma-parser@0.12.2/node_modules/oniguruma-parser/dist/traverser/traverse.js
|
|
1022
|
+
function M(e, t, n = null) {
|
|
1023
|
+
function r(e, t) {
|
|
1024
|
+
for (let n = 0; n < e.length; n++) {
|
|
1025
|
+
let r = i(e[n], t, n, e);
|
|
1026
|
+
n = Math.max(-1, n + r);
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
function i(a, s = null, c = null, l = null) {
|
|
1030
|
+
let u = 0, d = !1, f = {
|
|
1031
|
+
node: a,
|
|
1032
|
+
parent: s,
|
|
1033
|
+
key: c,
|
|
1034
|
+
container: l,
|
|
1035
|
+
root: e,
|
|
1036
|
+
remove() {
|
|
1037
|
+
N(l).splice(Math.max(0, P(c) + u), 1), u--, d = !0;
|
|
1038
|
+
},
|
|
1039
|
+
removeAllNextSiblings() {
|
|
1040
|
+
return N(l).splice(P(c) + 1);
|
|
1041
|
+
},
|
|
1042
|
+
removeAllPrevSiblings() {
|
|
1043
|
+
let e = P(c) + u;
|
|
1044
|
+
return u -= e, N(l).splice(0, Math.max(0, e));
|
|
1045
|
+
},
|
|
1046
|
+
replaceWith(e, t = {}) {
|
|
1047
|
+
let n = !!t.traverse;
|
|
1048
|
+
l ? l[Math.max(0, P(c) + u)] = e : o(s, "Can't replace root node")[c] = e, n && i(e, s, c, l), d = !0;
|
|
1049
|
+
},
|
|
1050
|
+
replaceWithMultiple(e, t = {}) {
|
|
1051
|
+
let n = !!t.traverse;
|
|
1052
|
+
if (N(l).splice(Math.max(0, P(c) + u), 1, ...e), u += e.length - 1, n) {
|
|
1053
|
+
let t = 0;
|
|
1054
|
+
for (let n = 0; n < e.length; n++) t += i(e[n], s, P(c) + n + t, l);
|
|
1055
|
+
}
|
|
1056
|
+
d = !0;
|
|
1057
|
+
},
|
|
1058
|
+
skip() {
|
|
1059
|
+
d = !0;
|
|
1060
|
+
}
|
|
1061
|
+
}, { type: p } = a, m = t["*"], h = t[p], g = typeof m == "function" ? m : m?.enter, _ = typeof h == "function" ? h : h?.enter;
|
|
1062
|
+
if (g?.(f, n), _?.(f, n), !d) switch (p) {
|
|
1063
|
+
case "AbsenceFunction":
|
|
1064
|
+
case "Alternative":
|
|
1065
|
+
case "CapturingGroup":
|
|
1066
|
+
case "CharacterClass":
|
|
1067
|
+
case "Group":
|
|
1068
|
+
case "LookaroundAssertion":
|
|
1069
|
+
r(a.body, a);
|
|
1070
|
+
break;
|
|
1071
|
+
case "Assertion":
|
|
1072
|
+
case "Backreference":
|
|
1073
|
+
case "Character":
|
|
1074
|
+
case "CharacterSet":
|
|
1075
|
+
case "Directive":
|
|
1076
|
+
case "Flags":
|
|
1077
|
+
case "NamedCallout":
|
|
1078
|
+
case "Subroutine": break;
|
|
1079
|
+
case "CharacterClassRange":
|
|
1080
|
+
i(a.min, a, "min"), i(a.max, a, "max");
|
|
1081
|
+
break;
|
|
1082
|
+
case "Quantifier":
|
|
1083
|
+
i(a.body, a, "body");
|
|
1084
|
+
break;
|
|
1085
|
+
case "Regex":
|
|
1086
|
+
r(a.body, a), i(a.flags, a, "flags");
|
|
1087
|
+
break;
|
|
1088
|
+
default: throw Error(`Unexpected node type "${p}"`);
|
|
1089
|
+
}
|
|
1090
|
+
return h?.exit?.(f, n), m?.exit?.(f, n), u;
|
|
1091
|
+
}
|
|
1092
|
+
return i(e), e;
|
|
1093
|
+
}
|
|
1094
|
+
function N(e) {
|
|
1095
|
+
if (!Array.isArray(e)) throw Error("Container expected");
|
|
1096
|
+
return e;
|
|
1097
|
+
}
|
|
1098
|
+
function P(e) {
|
|
1099
|
+
if (typeof e != "number") throw Error("Numeric key expected");
|
|
1100
|
+
return e;
|
|
1101
|
+
}
|
|
1102
|
+
//#endregion
|
|
1103
|
+
//#region ../../node_modules/.pnpm/regex@6.1.0/node_modules/regex/src/utils-internals.js
|
|
1104
|
+
var tt = String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;
|
|
1105
|
+
function nt(e, t) {
|
|
1106
|
+
for (let n = 0; n < e.length; n++) e[n] >= t && e[n]++;
|
|
1107
|
+
}
|
|
1108
|
+
function rt(e, t, n, r) {
|
|
1109
|
+
return e.slice(0, t) + r + e.slice(t + n.length);
|
|
1110
|
+
}
|
|
1111
|
+
//#endregion
|
|
1112
|
+
//#region ../../node_modules/.pnpm/regex-utilities@2.3.0/node_modules/regex-utilities/src/index.js
|
|
1113
|
+
var F = Object.freeze({
|
|
1114
|
+
DEFAULT: "DEFAULT",
|
|
1115
|
+
CHAR_CLASS: "CHAR_CLASS"
|
|
1116
|
+
});
|
|
1117
|
+
function I(e, t, n, r) {
|
|
1118
|
+
let i = new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`, "gsu"), a = [!1], o = 0, s = "";
|
|
1119
|
+
for (let t of e.matchAll(i)) {
|
|
1120
|
+
let { 0: e, groups: { $skip: i } } = t;
|
|
1121
|
+
if (!i && (!r || r === F.DEFAULT == !o)) {
|
|
1122
|
+
n instanceof Function ? s += n(t, {
|
|
1123
|
+
context: o ? F.CHAR_CLASS : F.DEFAULT,
|
|
1124
|
+
negated: a[a.length - 1]
|
|
1125
|
+
}) : s += n;
|
|
1126
|
+
continue;
|
|
1127
|
+
}
|
|
1128
|
+
e[0] === "[" ? (o++, a.push(e[1] === "^")) : e === "]" && o && (o--, a.pop()), s += e;
|
|
1129
|
+
}
|
|
1130
|
+
return s;
|
|
1131
|
+
}
|
|
1132
|
+
function it(e, t, n, r) {
|
|
1133
|
+
I(e, t, n, r);
|
|
1134
|
+
}
|
|
1135
|
+
function at(e, t, n = 0, r) {
|
|
1136
|
+
if (!new RegExp(t, "su").test(e)) return null;
|
|
1137
|
+
let i = RegExp(`${t}|(?<$skip>\\\\?.)`, "gsu");
|
|
1138
|
+
i.lastIndex = n;
|
|
1139
|
+
let a = 0, o;
|
|
1140
|
+
for (; o = i.exec(e);) {
|
|
1141
|
+
let { 0: e, groups: { $skip: t } } = o;
|
|
1142
|
+
if (!t && (!r || r === F.DEFAULT == !a)) return o;
|
|
1143
|
+
e === "[" ? a++ : e === "]" && a && a--, i.lastIndex == o.index && i.lastIndex++;
|
|
1144
|
+
}
|
|
1145
|
+
return null;
|
|
1146
|
+
}
|
|
1147
|
+
function L(e, t, n) {
|
|
1148
|
+
return !!at(e, t, 0, n);
|
|
1149
|
+
}
|
|
1150
|
+
function ot(e, t) {
|
|
1151
|
+
let n = /\\?./gsu;
|
|
1152
|
+
n.lastIndex = t;
|
|
1153
|
+
let r = e.length, i = 0, a = 1, o;
|
|
1154
|
+
for (; o = n.exec(e);) {
|
|
1155
|
+
let [e] = o;
|
|
1156
|
+
if (e === "[") i++;
|
|
1157
|
+
else if (i) e === "]" && i--;
|
|
1158
|
+
else if (e === "(") a++;
|
|
1159
|
+
else if (e === ")" && (a--, !a)) {
|
|
1160
|
+
r = o.index;
|
|
1161
|
+
break;
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
return e.slice(t, r);
|
|
1165
|
+
}
|
|
1166
|
+
//#endregion
|
|
1167
|
+
//#region ../../node_modules/.pnpm/regex@6.1.0/node_modules/regex/src/atomic.js
|
|
1168
|
+
var st = new RegExp(String.raw`(?<noncapturingStart>${tt})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`, "gsu");
|
|
1169
|
+
function ct(e, t) {
|
|
1170
|
+
let n = t?.hiddenCaptures ?? [], r = t?.captureTransfers ?? /* @__PURE__ */ new Map();
|
|
1171
|
+
if (!/\(\?>/.test(e)) return {
|
|
1172
|
+
pattern: e,
|
|
1173
|
+
captureTransfers: r,
|
|
1174
|
+
hiddenCaptures: n
|
|
1175
|
+
};
|
|
1176
|
+
let i = [0], a = [], o = 0, s = 0, c = NaN, l;
|
|
1177
|
+
do {
|
|
1178
|
+
l = !1;
|
|
1179
|
+
let t = 0, u = 0, d = !1, f;
|
|
1180
|
+
for (st.lastIndex = Number.isNaN(c) ? 0 : c + 7; f = st.exec(e);) {
|
|
1181
|
+
let { 0: p, index: m, groups: { capturingStart: h, noncapturingStart: g } } = f;
|
|
1182
|
+
if (p === "[") t++;
|
|
1183
|
+
else if (t) p === "]" && t--;
|
|
1184
|
+
else if (p === "(?>" && !d) c = m, d = !0;
|
|
1185
|
+
else if (d && g) u++;
|
|
1186
|
+
else if (h) d ? u++ : (o++, i.push(o + s));
|
|
1187
|
+
else if (p === ")" && d) {
|
|
1188
|
+
if (!u) {
|
|
1189
|
+
s++;
|
|
1190
|
+
let t = o + s;
|
|
1191
|
+
if (e = `${e.slice(0, c)}(?:(?=(${e.slice(c + 3, m)}))<$$${t}>)${e.slice(m + 1)}`, l = !0, a.push(t), nt(n, t), r.size) {
|
|
1192
|
+
let e = /* @__PURE__ */ new Map();
|
|
1193
|
+
r.forEach((n, r) => {
|
|
1194
|
+
e.set(r >= t ? r + 1 : r, n.map((e) => e >= t ? e + 1 : e));
|
|
1195
|
+
}), r = e;
|
|
1196
|
+
}
|
|
1197
|
+
break;
|
|
1198
|
+
}
|
|
1199
|
+
u--;
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
} while (l);
|
|
1203
|
+
return n.push(...a), e = I(e, String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`, ({ 0: e, groups: { backrefNum: t, wrappedBackrefNum: n } }) => {
|
|
1204
|
+
if (t) {
|
|
1205
|
+
let n = +t;
|
|
1206
|
+
if (n > i.length - 1) throw Error(`Backref "${e}" greater than number of captures`);
|
|
1207
|
+
return `\\${i[n]}`;
|
|
1208
|
+
}
|
|
1209
|
+
return `\\${n}`;
|
|
1210
|
+
}, F.DEFAULT), {
|
|
1211
|
+
pattern: e,
|
|
1212
|
+
captureTransfers: r,
|
|
1213
|
+
hiddenCaptures: n
|
|
1214
|
+
};
|
|
1215
|
+
}
|
|
1216
|
+
var lt = String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`, R = new RegExp(String.raw`
|
|
1217
|
+
\\(?: \d+
|
|
1218
|
+
| c[A-Za-z]
|
|
1219
|
+
| [gk]<[^>]+>
|
|
1220
|
+
| [pPu]\{[^\}]+\}
|
|
1221
|
+
| u[A-Fa-f\d]{4}
|
|
1222
|
+
| x[A-Fa-f\d]{2}
|
|
1223
|
+
)
|
|
1224
|
+
| \((?: \? (?: [:=!>]
|
|
1225
|
+
| <(?:[=!]|[^>]+>)
|
|
1226
|
+
| [A-Za-z\-]+:
|
|
1227
|
+
| \(DEFINE\)
|
|
1228
|
+
))?
|
|
1229
|
+
| (?<qBase>${lt})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
1230
|
+
| \\?.
|
|
1231
|
+
`.replace(/\s+/g, ""), "gsu");
|
|
1232
|
+
function ut(e) {
|
|
1233
|
+
if (!RegExp(`${lt}\\+`).test(e)) return { pattern: e };
|
|
1234
|
+
let t = [], n = null, r = null, i = "", a = 0, o;
|
|
1235
|
+
for (R.lastIndex = 0; o = R.exec(e);) {
|
|
1236
|
+
let { 0: s, index: c, groups: { qBase: l, qMod: u, invalidQ: d } } = o;
|
|
1237
|
+
if (s === "[") a || (r = c), a++;
|
|
1238
|
+
else if (s === "]") a ? a-- : r = null;
|
|
1239
|
+
else if (!a) {
|
|
1240
|
+
if (u === "+" && i && !i.startsWith("(")) {
|
|
1241
|
+
if (d) throw Error(`Invalid quantifier "${s}"`);
|
|
1242
|
+
let t = -1;
|
|
1243
|
+
if (/^\{\d+\}$/.test(l)) e = rt(e, c + l.length, u, "");
|
|
1244
|
+
else {
|
|
1245
|
+
if (i === ")" || i === "]") {
|
|
1246
|
+
let t = i === ")" ? n : r;
|
|
1247
|
+
if (t === null) throw Error(`Invalid unmatched "${i}"`);
|
|
1248
|
+
e = `${e.slice(0, t)}(?>${e.slice(t, c)}${l})${e.slice(c + s.length)}`;
|
|
1249
|
+
} else e = `${e.slice(0, c - i.length)}(?>${i}${l})${e.slice(c + s.length)}`;
|
|
1250
|
+
t += 4;
|
|
1251
|
+
}
|
|
1252
|
+
R.lastIndex += t;
|
|
1253
|
+
} else s[0] === "(" ? t.push(c) : s === ")" && (n = t.length ? t.pop() : null);
|
|
1254
|
+
}
|
|
1255
|
+
i = s;
|
|
1256
|
+
}
|
|
1257
|
+
return { pattern: e };
|
|
1258
|
+
}
|
|
1259
|
+
//#endregion
|
|
1260
|
+
//#region ../../node_modules/.pnpm/regex-recursion@6.0.2/node_modules/regex-recursion/src/index.js
|
|
1261
|
+
var z = String.raw, dt = z`\(\?R=(?<rDepth>[^\)]+)\)|${z`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`}`, B = z`\(\?<(?![=!])(?<captureName>[^>]+)>`, ft = z`${B}|(?<unnamed>\()(?!\?)`, V = new RegExp(z`${B}|${dt}|\(\?|\\?.`, "gsu"), pt = "Cannot use multiple overlapping recursions";
|
|
1262
|
+
function mt(e, t) {
|
|
1263
|
+
let { hiddenCaptures: n, mode: r } = {
|
|
1264
|
+
hiddenCaptures: [],
|
|
1265
|
+
mode: "plugin",
|
|
1266
|
+
...t
|
|
1267
|
+
}, i = t?.captureTransfers ?? /* @__PURE__ */ new Map();
|
|
1268
|
+
if (!new RegExp(dt, "su").test(e)) return {
|
|
1269
|
+
pattern: e,
|
|
1270
|
+
captureTransfers: i,
|
|
1271
|
+
hiddenCaptures: n
|
|
1272
|
+
};
|
|
1273
|
+
if (r === "plugin" && L(e, z`\(\?\(DEFINE\)`, F.DEFAULT)) throw Error("DEFINE groups cannot be used with recursion");
|
|
1274
|
+
let a = [], o = L(e, z`\\[1-9]`, F.DEFAULT), s = /* @__PURE__ */ new Map(), c = [], l = !1, u = 0, d = 0, f;
|
|
1275
|
+
for (V.lastIndex = 0; f = V.exec(e);) {
|
|
1276
|
+
let { 0: t, groups: { captureName: p, rDepth: m, gRNameOrNum: h, gRDepth: g } } = f;
|
|
1277
|
+
if (t === "[") u++;
|
|
1278
|
+
else if (u) t === "]" && u--;
|
|
1279
|
+
else {
|
|
1280
|
+
if (m) {
|
|
1281
|
+
if (ht(m), l) throw Error(pt);
|
|
1282
|
+
if (o) throw Error(`${r === "external" ? "Backrefs" : "Numbered backrefs"} cannot be used with global recursion`);
|
|
1283
|
+
let t = e.slice(0, f.index), s = e.slice(V.lastIndex);
|
|
1284
|
+
if (L(s, dt, F.DEFAULT)) throw Error(pt);
|
|
1285
|
+
let c = m - 1;
|
|
1286
|
+
e = gt(t, s, c, !1, n, a, d), i = yt(i, t, c, a.length, 0, d);
|
|
1287
|
+
break;
|
|
1288
|
+
}
|
|
1289
|
+
if (h) {
|
|
1290
|
+
ht(g);
|
|
1291
|
+
let u = !1;
|
|
1292
|
+
for (let e of c) if (e.name === h || e.num === +h) {
|
|
1293
|
+
if (u = !0, e.hasRecursedWithin) throw Error(pt);
|
|
1294
|
+
break;
|
|
1295
|
+
}
|
|
1296
|
+
if (!u) throw Error(z`Recursive \g cannot be used outside the referenced group "${r === "external" ? h : z`\g<${h}&R=${g}>`}"`);
|
|
1297
|
+
let p = s.get(h), m = ot(e, p);
|
|
1298
|
+
if (o && L(m, z`${B}|\((?!\?)`, F.DEFAULT)) throw Error(`${r === "external" ? "Backrefs" : "Numbered backrefs"} cannot be used with recursion of capturing groups`);
|
|
1299
|
+
let _ = e.slice(p, f.index), v = m.slice(_.length + t.length), y = a.length, b = g - 1, x = gt(_, v, b, !0, n, a, d);
|
|
1300
|
+
i = yt(i, _, b, a.length - y, y, d), e = `${e.slice(0, p)}${x}${e.slice(p + m.length)}`, V.lastIndex += x.length - t.length - _.length - v.length, c.forEach((e) => e.hasRecursedWithin = !0), l = !0;
|
|
1301
|
+
} else if (p) d++, s.set(String(d), V.lastIndex), s.set(p, V.lastIndex), c.push({
|
|
1302
|
+
num: d,
|
|
1303
|
+
name: p
|
|
1304
|
+
});
|
|
1305
|
+
else if (t[0] === "(") {
|
|
1306
|
+
let e = t === "(";
|
|
1307
|
+
e && (d++, s.set(String(d), V.lastIndex)), c.push(e ? { num: d } : {});
|
|
1308
|
+
} else t === ")" && c.pop();
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
return n.push(...a), {
|
|
1312
|
+
pattern: e,
|
|
1313
|
+
captureTransfers: i,
|
|
1314
|
+
hiddenCaptures: n
|
|
1315
|
+
};
|
|
1316
|
+
}
|
|
1317
|
+
function ht(e) {
|
|
1318
|
+
let t = `Max depth must be integer between 2 and 100; used ${e}`;
|
|
1319
|
+
if (!/^[1-9]\d*$/.test(e) || (e = +e, e < 2 || e > 100)) throw Error(t);
|
|
1320
|
+
}
|
|
1321
|
+
function gt(e, t, n, r, i, a, o) {
|
|
1322
|
+
let s = /* @__PURE__ */ new Set();
|
|
1323
|
+
r && it(e + t, B, ({ groups: { captureName: e } }) => {
|
|
1324
|
+
s.add(e);
|
|
1325
|
+
}, F.DEFAULT);
|
|
1326
|
+
let c = [
|
|
1327
|
+
n,
|
|
1328
|
+
r ? s : null,
|
|
1329
|
+
i,
|
|
1330
|
+
a,
|
|
1331
|
+
o
|
|
1332
|
+
];
|
|
1333
|
+
return `${e}${_t(`(?:${e}`, "forward", ...c)}(?:)${_t(`${t})`, "backward", ...c)}${t}`;
|
|
1334
|
+
}
|
|
1335
|
+
function _t(e, t, n, r, i, a, o) {
|
|
1336
|
+
let s = (e) => t === "forward" ? e + 2 : n - e + 2 - 1, c = "";
|
|
1337
|
+
for (let t = 0; t < n; t++) {
|
|
1338
|
+
let n = s(t);
|
|
1339
|
+
c += I(e, z`${ft}|\\k<(?<backref>[^>]+)>`, ({ 0: e, groups: { captureName: t, unnamed: s, backref: c } }) => {
|
|
1340
|
+
if (c && r && !r.has(c)) return e;
|
|
1341
|
+
let l = `_$${n}`;
|
|
1342
|
+
if (s || t) {
|
|
1343
|
+
let n = o + a.length + 1;
|
|
1344
|
+
return a.push(n), vt(i, n), s ? e : `(?<${t}${l}>`;
|
|
1345
|
+
}
|
|
1346
|
+
return z`\k<${c}${l}>`;
|
|
1347
|
+
}, F.DEFAULT);
|
|
1348
|
+
}
|
|
1349
|
+
return c;
|
|
1350
|
+
}
|
|
1351
|
+
function vt(e, t) {
|
|
1352
|
+
for (let n = 0; n < e.length; n++) e[n] >= t && e[n]++;
|
|
1353
|
+
}
|
|
1354
|
+
function yt(e, t, n, r, i, a) {
|
|
1355
|
+
if (e.size && r) {
|
|
1356
|
+
let o = 0;
|
|
1357
|
+
it(t, ft, () => o++, F.DEFAULT);
|
|
1358
|
+
let s = a - o + i, c = /* @__PURE__ */ new Map();
|
|
1359
|
+
return e.forEach((e, t) => {
|
|
1360
|
+
let i = (r - o * n) / n, a = o * n, l = t > s + o ? t + r : t, u = [];
|
|
1361
|
+
for (let t of e) if (t <= s) u.push(t);
|
|
1362
|
+
else if (t > s + o + i) u.push(t + r);
|
|
1363
|
+
else if (t <= s + o) for (let e = 0; e <= n; e++) u.push(t + o * e);
|
|
1364
|
+
else for (let e = 0; e <= n; e++) u.push(t + a + i * e);
|
|
1365
|
+
c.set(l, u);
|
|
1366
|
+
}), c;
|
|
1367
|
+
}
|
|
1368
|
+
return e;
|
|
1369
|
+
}
|
|
1370
|
+
//#endregion
|
|
1371
|
+
//#region ../../node_modules/.pnpm/oniguruma-to-es@4.3.6/node_modules/oniguruma-to-es/dist/esm/index.js
|
|
1372
|
+
var H = String.fromCodePoint, U = String.raw, W = {}, G = globalThis.RegExp;
|
|
1373
|
+
W.flagGroups = (() => {
|
|
1374
|
+
try {
|
|
1375
|
+
new G("(?i:)");
|
|
1376
|
+
} catch {
|
|
1377
|
+
return !1;
|
|
1378
|
+
}
|
|
1379
|
+
return !0;
|
|
1380
|
+
})(), W.unicodeSets = (() => {
|
|
1381
|
+
try {
|
|
1382
|
+
new G("[[]]", "v");
|
|
1383
|
+
} catch {
|
|
1384
|
+
return !1;
|
|
1385
|
+
}
|
|
1386
|
+
return !0;
|
|
1387
|
+
})(), W.bugFlagVLiteralHyphenIsRange = W.unicodeSets ? (() => {
|
|
1388
|
+
try {
|
|
1389
|
+
new G(U`[\d\-a]`, "v");
|
|
1390
|
+
} catch {
|
|
1391
|
+
return !0;
|
|
1392
|
+
}
|
|
1393
|
+
return !1;
|
|
1394
|
+
})() : !1, W.bugNestedClassIgnoresNegation = W.unicodeSets && new G("[[^a]]", "v").test("a");
|
|
1395
|
+
function K(e, { enable: t, disable: n }) {
|
|
1396
|
+
return {
|
|
1397
|
+
dotAll: !n?.dotAll && !!(t?.dotAll || e.dotAll),
|
|
1398
|
+
ignoreCase: !n?.ignoreCase && !!(t?.ignoreCase || e.ignoreCase)
|
|
1399
|
+
};
|
|
1400
|
+
}
|
|
1401
|
+
function q(e, t, n) {
|
|
1402
|
+
return e.has(t) || e.set(t, n), e.get(t);
|
|
1403
|
+
}
|
|
1404
|
+
function bt(e, t) {
|
|
1405
|
+
return St[e] >= St[t];
|
|
1406
|
+
}
|
|
1407
|
+
function xt(e, t) {
|
|
1408
|
+
if (e == null) throw Error(t ?? "Value expected");
|
|
1409
|
+
return e;
|
|
1410
|
+
}
|
|
1411
|
+
var St = {
|
|
1412
|
+
ES2025: 2025,
|
|
1413
|
+
ES2024: 2024,
|
|
1414
|
+
ES2018: 2018
|
|
1415
|
+
}, Ct = {
|
|
1416
|
+
auto: "auto",
|
|
1417
|
+
ES2025: "ES2025",
|
|
1418
|
+
ES2024: "ES2024",
|
|
1419
|
+
ES2018: "ES2018"
|
|
1420
|
+
};
|
|
1421
|
+
function wt(e = {}) {
|
|
1422
|
+
if ({}.toString.call(e) !== "[object Object]") throw Error("Unexpected options");
|
|
1423
|
+
if (e.target !== void 0 && !Ct[e.target]) throw Error(`Unexpected target "${e.target}"`);
|
|
1424
|
+
let t = {
|
|
1425
|
+
accuracy: "default",
|
|
1426
|
+
avoidSubclass: !1,
|
|
1427
|
+
flags: "",
|
|
1428
|
+
global: !1,
|
|
1429
|
+
hasIndices: !1,
|
|
1430
|
+
lazyCompileLength: Infinity,
|
|
1431
|
+
target: "auto",
|
|
1432
|
+
verbose: !1,
|
|
1433
|
+
...e,
|
|
1434
|
+
rules: {
|
|
1435
|
+
allowOrphanBackrefs: !1,
|
|
1436
|
+
asciiWordBoundaries: !1,
|
|
1437
|
+
captureGroup: !1,
|
|
1438
|
+
recursionLimit: 20,
|
|
1439
|
+
singleline: !1,
|
|
1440
|
+
...e.rules
|
|
1441
|
+
}
|
|
1442
|
+
};
|
|
1443
|
+
return t.target === "auto" && (t.target = W.flagGroups ? "ES2025" : W.unicodeSets ? "ES2024" : "ES2018"), t;
|
|
1444
|
+
}
|
|
1445
|
+
var Tt = "[ -\r ]", Et = /* @__PURE__ */ new Set([H(304), H(305)]), J = U`[\p{L}\p{M}\p{N}\p{Pc}]`;
|
|
1446
|
+
function Dt(e) {
|
|
1447
|
+
if (Et.has(e)) return [e];
|
|
1448
|
+
let t = /* @__PURE__ */ new Set(), n = e.toLowerCase(), r = n.toUpperCase(), i = jt.get(n), a = kt.get(n), o = At.get(n);
|
|
1449
|
+
return [...r].length === 1 && t.add(r), o && t.add(o), i && t.add(i), t.add(n), a && t.add(a), [...t];
|
|
1450
|
+
}
|
|
1451
|
+
var Ot = /* @__PURE__ */ new Map("C Other\nCc Control cntrl\nCf Format\nCn Unassigned\nCo Private_Use\nCs Surrogate\nL Letter\nLC Cased_Letter\nLl Lowercase_Letter\nLm Modifier_Letter\nLo Other_Letter\nLt Titlecase_Letter\nLu Uppercase_Letter\nM Mark Combining_Mark\nMc Spacing_Mark\nMe Enclosing_Mark\nMn Nonspacing_Mark\nN Number\nNd Decimal_Number digit\nNl Letter_Number\nNo Other_Number\nP Punctuation punct\nPc Connector_Punctuation\nPd Dash_Punctuation\nPe Close_Punctuation\nPf Final_Punctuation\nPi Initial_Punctuation\nPo Other_Punctuation\nPs Open_Punctuation\nS Symbol\nSc Currency_Symbol\nSk Modifier_Symbol\nSm Math_Symbol\nSo Other_Symbol\nZ Separator\nZl Line_Separator\nZp Paragraph_Separator\nZs Space_Separator\nASCII\nASCII_Hex_Digit AHex\nAlphabetic Alpha\nAny\nAssigned\nBidi_Control Bidi_C\nBidi_Mirrored Bidi_M\nCase_Ignorable CI\nCased\nChanges_When_Casefolded CWCF\nChanges_When_Casemapped CWCM\nChanges_When_Lowercased CWL\nChanges_When_NFKC_Casefolded CWKCF\nChanges_When_Titlecased CWT\nChanges_When_Uppercased CWU\nDash\nDefault_Ignorable_Code_Point DI\nDeprecated Dep\nDiacritic Dia\nEmoji\nEmoji_Component EComp\nEmoji_Modifier EMod\nEmoji_Modifier_Base EBase\nEmoji_Presentation EPres\nExtended_Pictographic ExtPict\nExtender Ext\nGrapheme_Base Gr_Base\nGrapheme_Extend Gr_Ext\nHex_Digit Hex\nIDS_Binary_Operator IDSB\nIDS_Trinary_Operator IDST\nID_Continue IDC\nID_Start IDS\nIdeographic Ideo\nJoin_Control Join_C\nLogical_Order_Exception LOE\nLowercase Lower\nMath\nNoncharacter_Code_Point NChar\nPattern_Syntax Pat_Syn\nPattern_White_Space Pat_WS\nQuotation_Mark QMark\nRadical\nRegional_Indicator RI\nSentence_Terminal STerm\nSoft_Dotted SD\nTerminal_Punctuation Term\nUnified_Ideograph UIdeo\nUppercase Upper\nVariation_Selector VS\nWhite_Space space\nXID_Continue XIDC\nXID_Start XIDS".split(/\s/).map((e) => [j(e), e])), kt = /* @__PURE__ */ new Map([["s", H(383)], [H(383), "s"]]), At = /* @__PURE__ */ new Map([
|
|
1452
|
+
[H(223), H(7838)],
|
|
1453
|
+
[H(107), H(8490)],
|
|
1454
|
+
[H(229), H(8491)],
|
|
1455
|
+
[H(969), H(8486)]
|
|
1456
|
+
]), jt = new Map([
|
|
1457
|
+
Y(453),
|
|
1458
|
+
Y(456),
|
|
1459
|
+
Y(459),
|
|
1460
|
+
Y(498),
|
|
1461
|
+
...Pt(8072, 8079),
|
|
1462
|
+
...Pt(8088, 8095),
|
|
1463
|
+
...Pt(8104, 8111),
|
|
1464
|
+
Y(8124),
|
|
1465
|
+
Y(8140),
|
|
1466
|
+
Y(8188)
|
|
1467
|
+
]), Mt = /* @__PURE__ */ new Map([
|
|
1468
|
+
["alnum", U`[\p{Alpha}\p{Nd}]`],
|
|
1469
|
+
["alpha", U`\p{Alpha}`],
|
|
1470
|
+
["ascii", U`\p{ASCII}`],
|
|
1471
|
+
["blank", U`[\p{Zs}\t]`],
|
|
1472
|
+
["cntrl", U`\p{Cc}`],
|
|
1473
|
+
["digit", U`\p{Nd}`],
|
|
1474
|
+
["graph", U`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],
|
|
1475
|
+
["lower", U`\p{Lower}`],
|
|
1476
|
+
["print", U`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],
|
|
1477
|
+
["punct", U`[\p{P}\p{S}]`],
|
|
1478
|
+
["space", U`\p{space}`],
|
|
1479
|
+
["upper", U`\p{Upper}`],
|
|
1480
|
+
["word", U`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],
|
|
1481
|
+
["xdigit", U`\p{AHex}`]
|
|
1482
|
+
]);
|
|
1483
|
+
function Nt(e, t) {
|
|
1484
|
+
let n = [];
|
|
1485
|
+
for (let r = e; r <= t; r++) n.push(r);
|
|
1486
|
+
return n;
|
|
1487
|
+
}
|
|
1488
|
+
function Y(e) {
|
|
1489
|
+
let t = H(e);
|
|
1490
|
+
return [t.toLowerCase(), t];
|
|
1491
|
+
}
|
|
1492
|
+
function Pt(e, t) {
|
|
1493
|
+
return Nt(e, t).map((e) => Y(e));
|
|
1494
|
+
}
|
|
1495
|
+
var Ft = /* @__PURE__ */ new Set([
|
|
1496
|
+
"Lower",
|
|
1497
|
+
"Lowercase",
|
|
1498
|
+
"Upper",
|
|
1499
|
+
"Uppercase",
|
|
1500
|
+
"Ll",
|
|
1501
|
+
"Lowercase_Letter",
|
|
1502
|
+
"Lt",
|
|
1503
|
+
"Titlecase_Letter",
|
|
1504
|
+
"Lu",
|
|
1505
|
+
"Uppercase_Letter"
|
|
1506
|
+
]);
|
|
1507
|
+
function It(e, t) {
|
|
1508
|
+
let n = {
|
|
1509
|
+
accuracy: "default",
|
|
1510
|
+
asciiWordBoundaries: !1,
|
|
1511
|
+
avoidSubclass: !1,
|
|
1512
|
+
bestEffortTarget: "ES2025",
|
|
1513
|
+
...t
|
|
1514
|
+
};
|
|
1515
|
+
Bt(e);
|
|
1516
|
+
let r = {
|
|
1517
|
+
accuracy: n.accuracy,
|
|
1518
|
+
asciiWordBoundaries: n.asciiWordBoundaries,
|
|
1519
|
+
avoidSubclass: n.avoidSubclass,
|
|
1520
|
+
flagDirectivesByAlt: /* @__PURE__ */ new Map(),
|
|
1521
|
+
jsGroupNameMap: /* @__PURE__ */ new Map(),
|
|
1522
|
+
minTargetEs2024: bt(n.bestEffortTarget, "ES2024"),
|
|
1523
|
+
passedLookbehind: !1,
|
|
1524
|
+
strategy: null,
|
|
1525
|
+
subroutineRefMap: /* @__PURE__ */ new Map(),
|
|
1526
|
+
supportedGNodes: /* @__PURE__ */ new Set(),
|
|
1527
|
+
digitIsAscii: e.flags.digitIsAscii,
|
|
1528
|
+
spaceIsAscii: e.flags.spaceIsAscii,
|
|
1529
|
+
wordIsAscii: e.flags.wordIsAscii
|
|
1530
|
+
};
|
|
1531
|
+
M(e, Lt, r);
|
|
1532
|
+
let i = {
|
|
1533
|
+
dotAll: e.flags.dotAll,
|
|
1534
|
+
ignoreCase: e.flags.ignoreCase
|
|
1535
|
+
}, a = {
|
|
1536
|
+
currentFlags: i,
|
|
1537
|
+
prevFlags: null,
|
|
1538
|
+
globalFlags: i,
|
|
1539
|
+
groupOriginByCopy: /* @__PURE__ */ new Map(),
|
|
1540
|
+
groupsByName: /* @__PURE__ */ new Map(),
|
|
1541
|
+
multiplexCapturesToLeftByRef: /* @__PURE__ */ new Map(),
|
|
1542
|
+
openRefs: /* @__PURE__ */ new Map(),
|
|
1543
|
+
reffedNodesByReferencer: /* @__PURE__ */ new Map(),
|
|
1544
|
+
subroutineRefMap: r.subroutineRefMap
|
|
1545
|
+
};
|
|
1546
|
+
return M(e, Rt, a), M(e, zt, {
|
|
1547
|
+
groupsByName: a.groupsByName,
|
|
1548
|
+
highestOrphanBackref: 0,
|
|
1549
|
+
numCapturesToLeft: 0,
|
|
1550
|
+
reffedNodesByReferencer: a.reffedNodesByReferencer
|
|
1551
|
+
}), e._originMap = a.groupOriginByCopy, e._strategy = r.strategy, e;
|
|
1552
|
+
}
|
|
1553
|
+
var Lt = {
|
|
1554
|
+
AbsenceFunction({ node: e, parent: t, replaceWith: n }) {
|
|
1555
|
+
let { body: r, kind: i } = e;
|
|
1556
|
+
if (i === "repeater") {
|
|
1557
|
+
let e = D();
|
|
1558
|
+
e.body[0].body.push(O({
|
|
1559
|
+
negate: !0,
|
|
1560
|
+
body: r
|
|
1561
|
+
}), k("Any"));
|
|
1562
|
+
let i = D();
|
|
1563
|
+
i.body[0].body.push(We("greedy", 0, Infinity, e)), n(Q(i, t), { traverse: !0 });
|
|
1564
|
+
} else throw Error("Unsupported absence function \"(?~|\"");
|
|
1565
|
+
},
|
|
1566
|
+
Alternative: {
|
|
1567
|
+
enter({ node: e, parent: t, key: n }, { flagDirectivesByAlt: r }) {
|
|
1568
|
+
let i = e.body.filter((e) => e.kind === "flags");
|
|
1569
|
+
for (let e = n + 1; e < t.body.length; e++) {
|
|
1570
|
+
let n = t.body[e];
|
|
1571
|
+
q(r, n, []).push(...i);
|
|
1572
|
+
}
|
|
1573
|
+
},
|
|
1574
|
+
exit({ node: e }, { flagDirectivesByAlt: t }) {
|
|
1575
|
+
if (t.get(e)?.length) {
|
|
1576
|
+
let n = qt(t.get(e));
|
|
1577
|
+
if (n) {
|
|
1578
|
+
let t = D({ flags: n });
|
|
1579
|
+
t.body[0].body = e.body, e.body = [Q(t, e)];
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1583
|
+
},
|
|
1584
|
+
Assertion({ node: e, parent: t, key: n, container: r, root: i, remove: a, replaceWith: o }, s) {
|
|
1585
|
+
let { kind: c, negate: l } = e, { asciiWordBoundaries: u, avoidSubclass: d, supportedGNodes: f, wordIsAscii: p } = s;
|
|
1586
|
+
if (c === "text_segment_boundary") throw Error(`Unsupported text segment boundary "\\${l ? "Y" : "y"}"`);
|
|
1587
|
+
if (c === "line_end") o(Q(O({ body: [w({ body: [Fe("string_end")] }), w({ body: [T(10)] })] }), t));
|
|
1588
|
+
else if (c === "line_start") o(Q(X(U`(?<=\A|\n(?!\z))`, { skipLookbehindValidation: !0 }), t));
|
|
1589
|
+
else if (c === "search_start") {
|
|
1590
|
+
if (f.has(e)) i.flags.sticky = !0, a();
|
|
1591
|
+
else {
|
|
1592
|
+
let e = r[n - 1];
|
|
1593
|
+
if (e && $t(e)) o(Q(O({ negate: !0 }), t));
|
|
1594
|
+
else if (d) throw Error(U`Uses "\G" in a way that requires a subclass`);
|
|
1595
|
+
else o(Z(Fe("string_start"), t)), s.strategy = "clip_search";
|
|
1596
|
+
}
|
|
1597
|
+
} else if (c !== "string_end" && c !== "string_start") {
|
|
1598
|
+
if (c === "string_end_newline") o(Q(X(U`(?=\n?\z)`), t));
|
|
1599
|
+
else if (c === "word_boundary") {
|
|
1600
|
+
if (!p && !u) {
|
|
1601
|
+
let e = `(?:(?<=${J})(?!${J})|(?<!${J})(?=${J}))`, n = `(?:(?<=${J})(?=${J})|(?<!${J})(?!${J}))`;
|
|
1602
|
+
o(Q(X(l ? n : e), t));
|
|
1603
|
+
}
|
|
1604
|
+
} else throw Error(`Unexpected assertion kind "${c}"`);
|
|
1605
|
+
}
|
|
1606
|
+
},
|
|
1607
|
+
Backreference({ node: e }, { jsGroupNameMap: t }) {
|
|
1608
|
+
let { ref: n } = e;
|
|
1609
|
+
typeof n == "string" && !tn(n) && (n = Kt(n, t), e.ref = n);
|
|
1610
|
+
},
|
|
1611
|
+
CapturingGroup({ node: e }, { jsGroupNameMap: t, subroutineRefMap: n }) {
|
|
1612
|
+
let { name: r } = e;
|
|
1613
|
+
r && !tn(r) && (r = Kt(r, t), e.name = r), n.set(e.number, e), r && n.set(r, e);
|
|
1614
|
+
},
|
|
1615
|
+
CharacterClassRange({ node: e, parent: t, replaceWith: n }) {
|
|
1616
|
+
t.kind === "intersection" && n(Q(E({ body: [e] }), t), { traverse: !0 });
|
|
1617
|
+
},
|
|
1618
|
+
CharacterSet({ node: e, parent: t, replaceWith: n }, { accuracy: r, minTargetEs2024: i, digitIsAscii: a, spaceIsAscii: o, wordIsAscii: s }) {
|
|
1619
|
+
let { kind: c, negate: l, value: u } = e;
|
|
1620
|
+
if (a && (c === "digit" || u === "digit")) {
|
|
1621
|
+
n(Z(ze("digit", { negate: l }), t));
|
|
1622
|
+
return;
|
|
1623
|
+
}
|
|
1624
|
+
if (o && (c === "space" || u === "space")) {
|
|
1625
|
+
n(Q(nn(X(Tt), l), t));
|
|
1626
|
+
return;
|
|
1627
|
+
}
|
|
1628
|
+
if (s && (c === "word" || u === "word")) {
|
|
1629
|
+
n(Z(ze("word", { negate: l }), t));
|
|
1630
|
+
return;
|
|
1631
|
+
}
|
|
1632
|
+
if (c === "any") n(Z(k("Any"), t));
|
|
1633
|
+
else if (c === "digit") n(Z(k("Nd", { negate: l }), t));
|
|
1634
|
+
else if (c !== "dot") {
|
|
1635
|
+
if (c === "text_segment") {
|
|
1636
|
+
if (r === "strict") throw Error(U`Use of "\X" requires non-strict accuracy`);
|
|
1637
|
+
let e = "\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?", a = U`\p{RI}{2}|${e}(?:\u200D${e})*`;
|
|
1638
|
+
n(Q(X(U`(?>\r\n|${i ? U`\p{RGI_Emoji}` : a}|\P{M}\p{M}*)`, { skipPropertyNameValidation: !0 }), t));
|
|
1639
|
+
} else if (c === "hex") n(Z(k("AHex", { negate: l }), t));
|
|
1640
|
+
else if (c === "newline") n(Q(X(l ? "[^\n]" : "(?>\r\n?|[\n\v\f
\u2028\u2029])"), t));
|
|
1641
|
+
else if (c === "posix") {
|
|
1642
|
+
if (!i && (u === "graph" || u === "print")) {
|
|
1643
|
+
if (r === "strict") throw Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);
|
|
1644
|
+
let e = {
|
|
1645
|
+
graph: "!-~",
|
|
1646
|
+
print: " -~"
|
|
1647
|
+
}[u];
|
|
1648
|
+
l && (e = `\0-${H(e.codePointAt(0) - 1)}${H(e.codePointAt(2) + 1)}-\u{10FFFF}`), n(Q(X(`[${e}]`), t));
|
|
1649
|
+
} else n(Q(nn(X(Mt.get(u)), l), t));
|
|
1650
|
+
} else if (c === "property") Ot.has(j(u)) || (e.key = "sc");
|
|
1651
|
+
else if (c === "space") n(Z(k("space", { negate: l }), t));
|
|
1652
|
+
else if (c === "word") n(Q(nn(X(J), l), t));
|
|
1653
|
+
else throw Error(`Unexpected character set kind "${c}"`);
|
|
1654
|
+
}
|
|
1655
|
+
},
|
|
1656
|
+
Directive({ node: e, parent: t, root: n, remove: r, replaceWith: i, removeAllPrevSiblings: a, removeAllNextSiblings: o }) {
|
|
1657
|
+
let { kind: s, flags: c } = e;
|
|
1658
|
+
if (s === "flags") {
|
|
1659
|
+
if (!c.enable && !c.disable) r();
|
|
1660
|
+
else {
|
|
1661
|
+
let e = D({ flags: c });
|
|
1662
|
+
e.body[0].body = o(), i(Q(e, t), { traverse: !0 });
|
|
1663
|
+
}
|
|
1664
|
+
} else if (s === "keep") {
|
|
1665
|
+
let e = n.body[0], r = n.body.length === 1 && Se(e, { type: "Group" }) && e.body[0].body.length === 1 ? e.body[0] : n;
|
|
1666
|
+
if (t.parent !== r || r.body.length > 1) throw Error(U`Uses "\K" in a way that's unsupported`);
|
|
1667
|
+
let o = O({ behind: !0 });
|
|
1668
|
+
o.body[0].body = a(), i(Q(o, t));
|
|
1669
|
+
} else throw Error(`Unexpected directive kind "${s}"`);
|
|
1670
|
+
},
|
|
1671
|
+
Flags({ node: e, parent: t }) {
|
|
1672
|
+
if (e.posixIsAscii) throw Error("Unsupported flag \"P\"");
|
|
1673
|
+
if (e.textSegmentMode === "word") throw Error("Unsupported flag \"y{w}\"");
|
|
1674
|
+
[
|
|
1675
|
+
"digitIsAscii",
|
|
1676
|
+
"extended",
|
|
1677
|
+
"posixIsAscii",
|
|
1678
|
+
"spaceIsAscii",
|
|
1679
|
+
"wordIsAscii",
|
|
1680
|
+
"textSegmentMode"
|
|
1681
|
+
].forEach((t) => delete e[t]), Object.assign(e, {
|
|
1682
|
+
global: !1,
|
|
1683
|
+
hasIndices: !1,
|
|
1684
|
+
multiline: !1,
|
|
1685
|
+
sticky: e.sticky ?? !1
|
|
1686
|
+
}), t.options = {
|
|
1687
|
+
disable: {
|
|
1688
|
+
x: !0,
|
|
1689
|
+
n: !0
|
|
1690
|
+
},
|
|
1691
|
+
force: { v: !0 }
|
|
1692
|
+
};
|
|
1693
|
+
},
|
|
1694
|
+
Group({ node: e }) {
|
|
1695
|
+
if (!e.flags) return;
|
|
1696
|
+
let { enable: t, disable: n } = e.flags;
|
|
1697
|
+
t?.extended && delete t.extended, n?.extended && delete n.extended, t?.dotAll && n?.dotAll && delete t.dotAll, t?.ignoreCase && n?.ignoreCase && delete t.ignoreCase, t && !Object.keys(t).length && delete e.flags.enable, n && !Object.keys(n).length && delete e.flags.disable, !e.flags.enable && !e.flags.disable && delete e.flags;
|
|
1698
|
+
},
|
|
1699
|
+
LookaroundAssertion({ node: e }, t) {
|
|
1700
|
+
let { kind: n } = e;
|
|
1701
|
+
n === "lookbehind" && (t.passedLookbehind = !0);
|
|
1702
|
+
},
|
|
1703
|
+
NamedCallout({ node: e, parent: t, replaceWith: n }) {
|
|
1704
|
+
let { kind: r } = e;
|
|
1705
|
+
if (r === "fail") n(Q(O({ negate: !0 }), t));
|
|
1706
|
+
else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`);
|
|
1707
|
+
},
|
|
1708
|
+
Quantifier({ node: e }) {
|
|
1709
|
+
if (e.body.type === "Quantifier") {
|
|
1710
|
+
let t = D();
|
|
1711
|
+
t.body[0].body.push(e.body), e.body = Q(t, e);
|
|
1712
|
+
}
|
|
1713
|
+
},
|
|
1714
|
+
Regex: {
|
|
1715
|
+
enter({ node: e }, { supportedGNodes: t }) {
|
|
1716
|
+
let n = [], r = !1, i = !1;
|
|
1717
|
+
for (let t of e.body) if (t.body.length === 1 && t.body[0].kind === "search_start") t.body.pop();
|
|
1718
|
+
else {
|
|
1719
|
+
let e = Xt(t.body);
|
|
1720
|
+
e ? (r = !0, Array.isArray(e) ? n.push(...e) : n.push(e)) : i = !0;
|
|
1721
|
+
}
|
|
1722
|
+
r && !i && n.forEach((e) => t.add(e));
|
|
1723
|
+
},
|
|
1724
|
+
exit(e, { accuracy: t, passedLookbehind: n, strategy: r }) {
|
|
1725
|
+
if (t === "strict" && n && r) throw Error(U`Uses "\G" in a way that requires non-strict accuracy`);
|
|
1726
|
+
}
|
|
1727
|
+
},
|
|
1728
|
+
Subroutine({ node: e }, { jsGroupNameMap: t }) {
|
|
1729
|
+
let { ref: n } = e;
|
|
1730
|
+
typeof n == "string" && !tn(n) && (n = Kt(n, t), e.ref = n);
|
|
1731
|
+
}
|
|
1732
|
+
}, Rt = {
|
|
1733
|
+
Backreference({ node: e }, { multiplexCapturesToLeftByRef: t, reffedNodesByReferencer: n }) {
|
|
1734
|
+
let { orphan: r, ref: i } = e;
|
|
1735
|
+
r || n.set(e, [...t.get(i).map(({ node: e }) => e)]);
|
|
1736
|
+
},
|
|
1737
|
+
CapturingGroup: {
|
|
1738
|
+
enter({ node: e, parent: t, replaceWith: n, skip: r }, { groupOriginByCopy: i, groupsByName: a, multiplexCapturesToLeftByRef: o, openRefs: s, reffedNodesByReferencer: c }) {
|
|
1739
|
+
let l = i.get(e);
|
|
1740
|
+
if (l && s.has(e.number)) {
|
|
1741
|
+
let r = Z(Wt(e.number), t);
|
|
1742
|
+
c.set(r, s.get(e.number)), n(r);
|
|
1743
|
+
return;
|
|
1744
|
+
}
|
|
1745
|
+
s.set(e.number, e), o.set(e.number, []), e.name && q(o, e.name, []);
|
|
1746
|
+
let u = o.get(e.name ?? e.number);
|
|
1747
|
+
for (let t = 0; t < u.length; t++) {
|
|
1748
|
+
let n = u[t];
|
|
1749
|
+
if (l === n.node || l && l === n.origin || e === n.origin) {
|
|
1750
|
+
u.splice(t, 1);
|
|
1751
|
+
break;
|
|
1752
|
+
}
|
|
1753
|
+
}
|
|
1754
|
+
if (o.get(e.number).push({
|
|
1755
|
+
node: e,
|
|
1756
|
+
origin: l
|
|
1757
|
+
}), e.name && o.get(e.name).push({
|
|
1758
|
+
node: e,
|
|
1759
|
+
origin: l
|
|
1760
|
+
}), e.name) {
|
|
1761
|
+
let t = q(a, e.name, /* @__PURE__ */ new Map()), n = !1;
|
|
1762
|
+
if (l) n = !0;
|
|
1763
|
+
else for (let e of t.values()) if (!e.hasDuplicateNameToRemove) {
|
|
1764
|
+
n = !0;
|
|
1765
|
+
break;
|
|
1766
|
+
}
|
|
1767
|
+
a.get(e.name).set(e, {
|
|
1768
|
+
node: e,
|
|
1769
|
+
hasDuplicateNameToRemove: n
|
|
1770
|
+
});
|
|
1771
|
+
}
|
|
1772
|
+
},
|
|
1773
|
+
exit({ node: e }, { openRefs: t }) {
|
|
1774
|
+
t.get(e.number) === e && t.delete(e.number);
|
|
1775
|
+
}
|
|
1776
|
+
},
|
|
1777
|
+
Group: {
|
|
1778
|
+
enter({ node: e }, t) {
|
|
1779
|
+
t.prevFlags = t.currentFlags, e.flags && (t.currentFlags = K(t.currentFlags, e.flags));
|
|
1780
|
+
},
|
|
1781
|
+
exit(e, t) {
|
|
1782
|
+
t.currentFlags = t.prevFlags;
|
|
1783
|
+
}
|
|
1784
|
+
},
|
|
1785
|
+
Subroutine({ node: e, parent: t, replaceWith: n }, r) {
|
|
1786
|
+
let { isRecursive: i, ref: a } = e;
|
|
1787
|
+
if (i) {
|
|
1788
|
+
let n = t;
|
|
1789
|
+
for (; (n = n.parent) && (n.type !== "CapturingGroup" || n.name !== a && n.number !== a););
|
|
1790
|
+
r.reffedNodesByReferencer.set(e, n);
|
|
1791
|
+
return;
|
|
1792
|
+
}
|
|
1793
|
+
let o = r.subroutineRefMap.get(a), s = a === 0, c = s ? Wt(0) : Ut(o, r.groupOriginByCopy, null), l = c;
|
|
1794
|
+
if (!s) {
|
|
1795
|
+
let e = qt(Gt(o, (e) => e.type === "Group" && !!e.flags)), t = e ? K(r.globalFlags, e) : r.globalFlags;
|
|
1796
|
+
Vt(t, r.currentFlags) || (l = D({ flags: Jt(t) }), l.body[0].body.push(c));
|
|
1797
|
+
}
|
|
1798
|
+
n(Q(l, t), { traverse: !s });
|
|
1799
|
+
}
|
|
1800
|
+
}, zt = {
|
|
1801
|
+
Backreference({ node: e, parent: t, replaceWith: n }, r) {
|
|
1802
|
+
if (e.orphan) {
|
|
1803
|
+
r.highestOrphanBackref = Math.max(r.highestOrphanBackref, e.ref);
|
|
1804
|
+
return;
|
|
1805
|
+
}
|
|
1806
|
+
let i = r.reffedNodesByReferencer.get(e).filter((t) => Ht(t, e));
|
|
1807
|
+
i.length ? i.length > 1 ? n(Q(D({
|
|
1808
|
+
atomic: !0,
|
|
1809
|
+
body: i.reverse().map((e) => w({ body: [Ie(e.number)] }))
|
|
1810
|
+
}), t)) : e.ref = i[0].number : n(Q(O({ negate: !0 }), t));
|
|
1811
|
+
},
|
|
1812
|
+
CapturingGroup({ node: e }, t) {
|
|
1813
|
+
e.number = ++t.numCapturesToLeft, e.name && t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove && delete e.name;
|
|
1814
|
+
},
|
|
1815
|
+
Regex: { exit({ node: e }, t) {
|
|
1816
|
+
let n = Math.max(t.highestOrphanBackref - t.numCapturesToLeft, 0);
|
|
1817
|
+
for (let t = 0; t < n; t++) {
|
|
1818
|
+
let t = Le();
|
|
1819
|
+
e.body.at(-1).body.push(t);
|
|
1820
|
+
}
|
|
1821
|
+
} },
|
|
1822
|
+
Subroutine({ node: e }, t) {
|
|
1823
|
+
e.isRecursive && e.ref !== 0 && (e.ref = t.reffedNodesByReferencer.get(e).number);
|
|
1824
|
+
}
|
|
1825
|
+
};
|
|
1826
|
+
function Bt(e) {
|
|
1827
|
+
M(e, { "*"({ node: e, parent: t }) {
|
|
1828
|
+
e.parent = t;
|
|
1829
|
+
} });
|
|
1830
|
+
}
|
|
1831
|
+
function Vt(e, t) {
|
|
1832
|
+
return e.dotAll === t.dotAll && e.ignoreCase === t.ignoreCase;
|
|
1833
|
+
}
|
|
1834
|
+
function Ht(e, t) {
|
|
1835
|
+
let n = t;
|
|
1836
|
+
do {
|
|
1837
|
+
if (n.type === "Regex") return !1;
|
|
1838
|
+
if (n.type === "Alternative") continue;
|
|
1839
|
+
if (n === e) return !1;
|
|
1840
|
+
let t = Yt(n.parent);
|
|
1841
|
+
for (let r of t) {
|
|
1842
|
+
if (r === n) break;
|
|
1843
|
+
if (r === e || Zt(r, e)) return !0;
|
|
1844
|
+
}
|
|
1845
|
+
} while (n = n.parent);
|
|
1846
|
+
throw Error("Unexpected path");
|
|
1847
|
+
}
|
|
1848
|
+
function Ut(e, t, n, r) {
|
|
1849
|
+
let i = Array.isArray(e) ? [] : {};
|
|
1850
|
+
for (let [a, o] of Object.entries(e)) a === "parent" ? i.parent = Array.isArray(n) ? r : n : o && typeof o == "object" ? i[a] = Ut(o, t, i, n) : (a === "type" && o === "CapturingGroup" && t.set(i, t.get(e) ?? e), i[a] = o);
|
|
1851
|
+
return i;
|
|
1852
|
+
}
|
|
1853
|
+
function Wt(e) {
|
|
1854
|
+
let t = Ke(e);
|
|
1855
|
+
return t.isRecursive = !0, t;
|
|
1856
|
+
}
|
|
1857
|
+
function Gt(e, t) {
|
|
1858
|
+
let n = [];
|
|
1859
|
+
for (; e = e.parent;) (!t || t(e)) && n.push(e);
|
|
1860
|
+
return n;
|
|
1861
|
+
}
|
|
1862
|
+
function Kt(e, t) {
|
|
1863
|
+
if (t.has(e)) return t.get(e);
|
|
1864
|
+
let n = `$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/gu, "_")}`;
|
|
1865
|
+
return t.set(e, n), n;
|
|
1866
|
+
}
|
|
1867
|
+
function qt(e) {
|
|
1868
|
+
let t = ["dotAll", "ignoreCase"], n = {
|
|
1869
|
+
enable: {},
|
|
1870
|
+
disable: {}
|
|
1871
|
+
};
|
|
1872
|
+
return e.forEach(({ flags: e }) => {
|
|
1873
|
+
t.forEach((t) => {
|
|
1874
|
+
e.enable?.[t] && (delete n.disable[t], n.enable[t] = !0), e.disable?.[t] && (n.disable[t] = !0);
|
|
1875
|
+
});
|
|
1876
|
+
}), Object.keys(n.enable).length || delete n.enable, Object.keys(n.disable).length || delete n.disable, n.enable || n.disable ? n : null;
|
|
1877
|
+
}
|
|
1878
|
+
function Jt({ dotAll: e, ignoreCase: t }) {
|
|
1879
|
+
let n = {};
|
|
1880
|
+
return (e || t) && (n.enable = {}, e && (n.enable.dotAll = !0), t && (n.enable.ignoreCase = !0)), (!e || !t) && (n.disable = {}, !e && (n.disable.dotAll = !0), !t && (n.disable.ignoreCase = !0)), n;
|
|
1881
|
+
}
|
|
1882
|
+
function Yt(e) {
|
|
1883
|
+
if (!e) throw Error("Node expected");
|
|
1884
|
+
let { body: t } = e;
|
|
1885
|
+
return Array.isArray(t) ? t : t ? [t] : null;
|
|
1886
|
+
}
|
|
1887
|
+
function Xt(e) {
|
|
1888
|
+
let t = e.find((e) => e.kind === "search_start" || en(e, { negate: !1 }) || !Qt(e));
|
|
1889
|
+
if (!t) return null;
|
|
1890
|
+
if (t.kind === "search_start") return t;
|
|
1891
|
+
if (t.type === "LookaroundAssertion") return t.body[0].body[0];
|
|
1892
|
+
if (t.type === "CapturingGroup" || t.type === "Group") {
|
|
1893
|
+
let e = [];
|
|
1894
|
+
for (let n of t.body) {
|
|
1895
|
+
let t = Xt(n.body);
|
|
1896
|
+
if (!t) return null;
|
|
1897
|
+
Array.isArray(t) ? e.push(...t) : e.push(t);
|
|
1898
|
+
}
|
|
1899
|
+
return e;
|
|
1900
|
+
}
|
|
1901
|
+
return null;
|
|
1902
|
+
}
|
|
1903
|
+
function Zt(e, t) {
|
|
1904
|
+
let n = Yt(e) ?? [];
|
|
1905
|
+
for (let e of n) if (e === t || Zt(e, t)) return !0;
|
|
1906
|
+
return !1;
|
|
1907
|
+
}
|
|
1908
|
+
function Qt({ type: e }) {
|
|
1909
|
+
return e === "Assertion" || e === "Directive" || e === "LookaroundAssertion";
|
|
1910
|
+
}
|
|
1911
|
+
function $t(e) {
|
|
1912
|
+
let t = [
|
|
1913
|
+
"Character",
|
|
1914
|
+
"CharacterClass",
|
|
1915
|
+
"CharacterSet"
|
|
1916
|
+
];
|
|
1917
|
+
return t.includes(e.type) || e.type === "Quantifier" && e.min && t.includes(e.body.type);
|
|
1918
|
+
}
|
|
1919
|
+
function en(e, t) {
|
|
1920
|
+
let n = {
|
|
1921
|
+
negate: null,
|
|
1922
|
+
...t
|
|
1923
|
+
};
|
|
1924
|
+
return e.type === "LookaroundAssertion" && (n.negate === null || e.negate === n.negate) && e.body.length === 1 && Se(e.body[0], {
|
|
1925
|
+
type: "Assertion",
|
|
1926
|
+
kind: "search_start"
|
|
1927
|
+
});
|
|
1928
|
+
}
|
|
1929
|
+
function tn(e) {
|
|
1930
|
+
return /^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e);
|
|
1931
|
+
}
|
|
1932
|
+
function X(e, t) {
|
|
1933
|
+
let n = Te(e, {
|
|
1934
|
+
...t,
|
|
1935
|
+
unicodePropertyMap: Ot
|
|
1936
|
+
}).body;
|
|
1937
|
+
return n.length > 1 || n[0].body.length > 1 ? D({ body: n }) : n[0].body[0];
|
|
1938
|
+
}
|
|
1939
|
+
function nn(e, t) {
|
|
1940
|
+
return e.negate = t, e;
|
|
1941
|
+
}
|
|
1942
|
+
function Z(e, t) {
|
|
1943
|
+
return e.parent = t, e;
|
|
1944
|
+
}
|
|
1945
|
+
function Q(e, t) {
|
|
1946
|
+
return Bt(e), e.parent = t, e;
|
|
1947
|
+
}
|
|
1948
|
+
function rn(e, t) {
|
|
1949
|
+
let n = wt(t), r = bt(n.target, "ES2024"), i = bt(n.target, "ES2025"), a = n.rules.recursionLimit;
|
|
1950
|
+
if (!Number.isInteger(a) || a < 2 || a > 20) throw Error("Invalid recursionLimit; use 2-20");
|
|
1951
|
+
let o = null, s = null;
|
|
1952
|
+
if (!i) {
|
|
1953
|
+
let t = [e.flags.ignoreCase];
|
|
1954
|
+
M(e, an, {
|
|
1955
|
+
getCurrentModI: () => t.at(-1),
|
|
1956
|
+
popModI() {
|
|
1957
|
+
t.pop();
|
|
1958
|
+
},
|
|
1959
|
+
pushModI(e) {
|
|
1960
|
+
t.push(e);
|
|
1961
|
+
},
|
|
1962
|
+
setHasCasedChar() {
|
|
1963
|
+
t.at(-1) ? o = !0 : s = !0;
|
|
1964
|
+
}
|
|
1965
|
+
});
|
|
1966
|
+
}
|
|
1967
|
+
let c = {
|
|
1968
|
+
dotAll: e.flags.dotAll,
|
|
1969
|
+
ignoreCase: !(!e.flags.ignoreCase && !o || s)
|
|
1970
|
+
}, l = e, u = {
|
|
1971
|
+
accuracy: n.accuracy,
|
|
1972
|
+
appliedGlobalFlags: c,
|
|
1973
|
+
captureMap: /* @__PURE__ */ new Map(),
|
|
1974
|
+
currentFlags: {
|
|
1975
|
+
dotAll: e.flags.dotAll,
|
|
1976
|
+
ignoreCase: e.flags.ignoreCase
|
|
1977
|
+
},
|
|
1978
|
+
inCharClass: !1,
|
|
1979
|
+
lastNode: l,
|
|
1980
|
+
originMap: e._originMap,
|
|
1981
|
+
recursionLimit: a,
|
|
1982
|
+
useAppliedIgnoreCase: !!(!i && o && s),
|
|
1983
|
+
useFlagMods: i,
|
|
1984
|
+
useFlagV: r,
|
|
1985
|
+
verbose: n.verbose
|
|
1986
|
+
};
|
|
1987
|
+
function d(e) {
|
|
1988
|
+
return u.lastNode = l, l = e, xt(on[e.type], `Unexpected node type "${e.type}"`)(e, u, d);
|
|
1989
|
+
}
|
|
1990
|
+
let f = {
|
|
1991
|
+
pattern: e.body.map(d).join("|"),
|
|
1992
|
+
flags: d(e.flags),
|
|
1993
|
+
options: { ...e.options }
|
|
1994
|
+
};
|
|
1995
|
+
return r || (delete f.options.force.v, f.options.disable.v = !0, f.options.unicodeSetsPlugin = null), f._captureTransfers = /* @__PURE__ */ new Map(), f._hiddenCaptures = [], u.captureMap.forEach((e, t) => {
|
|
1996
|
+
e.hidden && f._hiddenCaptures.push(t), e.transferTo && q(f._captureTransfers, e.transferTo, []).push(t);
|
|
1997
|
+
}), f;
|
|
1998
|
+
}
|
|
1999
|
+
var an = {
|
|
2000
|
+
"*": {
|
|
2001
|
+
enter({ node: e }, t) {
|
|
2002
|
+
if (_n(e)) {
|
|
2003
|
+
let n = t.getCurrentModI();
|
|
2004
|
+
t.pushModI(e.flags ? K({ ignoreCase: n }, e.flags).ignoreCase : n);
|
|
2005
|
+
}
|
|
2006
|
+
},
|
|
2007
|
+
exit({ node: e }, t) {
|
|
2008
|
+
_n(e) && t.popModI();
|
|
2009
|
+
}
|
|
2010
|
+
},
|
|
2011
|
+
Backreference(e, t) {
|
|
2012
|
+
t.setHasCasedChar();
|
|
2013
|
+
},
|
|
2014
|
+
Character({ node: e }, t) {
|
|
2015
|
+
fn(H(e.value)) && t.setHasCasedChar();
|
|
2016
|
+
},
|
|
2017
|
+
CharacterClassRange({ node: e, skip: t }, n) {
|
|
2018
|
+
t(), pn(e, { firstOnly: !0 }).length && n.setHasCasedChar();
|
|
2019
|
+
},
|
|
2020
|
+
CharacterSet({ node: e }, t) {
|
|
2021
|
+
e.kind === "property" && Ft.has(e.value) && t.setHasCasedChar();
|
|
2022
|
+
}
|
|
2023
|
+
}, on = {
|
|
2024
|
+
Alternative({ body: e }, t, n) {
|
|
2025
|
+
return e.map(n).join("");
|
|
2026
|
+
},
|
|
2027
|
+
Assertion({ kind: e, negate: t }) {
|
|
2028
|
+
if (e === "string_end") return "$";
|
|
2029
|
+
if (e === "string_start") return "^";
|
|
2030
|
+
if (e === "word_boundary") return t ? U`\B` : U`\b`;
|
|
2031
|
+
throw Error(`Unexpected assertion kind "${e}"`);
|
|
2032
|
+
},
|
|
2033
|
+
Backreference({ ref: e }, t) {
|
|
2034
|
+
if (typeof e != "number") throw Error("Unexpected named backref in transformed AST");
|
|
2035
|
+
if (!t.useFlagMods && t.accuracy === "strict" && t.currentFlags.ignoreCase && !t.captureMap.get(e).ignoreCase) throw Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");
|
|
2036
|
+
return "\\" + e;
|
|
2037
|
+
},
|
|
2038
|
+
CapturingGroup(e, t, n) {
|
|
2039
|
+
let { body: r, name: i, number: a } = e, o = { ignoreCase: t.currentFlags.ignoreCase }, s = t.originMap.get(e);
|
|
2040
|
+
return s && (o.hidden = !0, a > s.number && (o.transferTo = s.number)), t.captureMap.set(a, o), `(${i ? `?<${i}>` : ""}${r.map(n).join("|")})`;
|
|
2041
|
+
},
|
|
2042
|
+
Character({ value: e }, t) {
|
|
2043
|
+
let n = H(e), r = $(e, {
|
|
2044
|
+
escDigit: t.lastNode.type === "Backreference",
|
|
2045
|
+
inCharClass: t.inCharClass,
|
|
2046
|
+
useFlagV: t.useFlagV
|
|
2047
|
+
});
|
|
2048
|
+
if (r !== n) return r;
|
|
2049
|
+
if (t.useAppliedIgnoreCase && t.currentFlags.ignoreCase && fn(n)) {
|
|
2050
|
+
let e = Dt(n);
|
|
2051
|
+
return t.inCharClass ? e.join("") : e.length > 1 ? `[${e.join("")}]` : e[0];
|
|
2052
|
+
}
|
|
2053
|
+
return n;
|
|
2054
|
+
},
|
|
2055
|
+
CharacterClass(e, t, n) {
|
|
2056
|
+
let { kind: r, negate: i, parent: a } = e, { body: o } = e;
|
|
2057
|
+
if (r === "intersection" && !t.useFlagV) throw Error("Use of character class intersection requires min target ES2024");
|
|
2058
|
+
W.bugFlagVLiteralHyphenIsRange && t.useFlagV && o.some(yn) && (o = [T(45), ...o.filter((e) => !yn(e))]);
|
|
2059
|
+
let s = () => `[${i ? "^" : ""}${o.map(n).join(r === "intersection" ? "&&" : "")}]`;
|
|
2060
|
+
if (!t.inCharClass) {
|
|
2061
|
+
if ((!t.useFlagV || W.bugNestedClassIgnoresNegation) && !i) {
|
|
2062
|
+
let t = o.filter((e) => e.type === "CharacterClass" && e.kind === "union" && e.negate);
|
|
2063
|
+
if (t.length) {
|
|
2064
|
+
let r = D(), i = r.body[0];
|
|
2065
|
+
return r.parent = a, i.parent = r, o = o.filter((e) => !t.includes(e)), e.body = o, o.length ? (e.parent = i, i.body.push(e)) : r.body.pop(), t.forEach((e) => {
|
|
2066
|
+
let t = w({ body: [e] });
|
|
2067
|
+
e.parent = t, t.parent = r, r.body.push(t);
|
|
2068
|
+
}), n(r);
|
|
2069
|
+
}
|
|
2070
|
+
}
|
|
2071
|
+
t.inCharClass = !0;
|
|
2072
|
+
let r = s();
|
|
2073
|
+
return t.inCharClass = !1, r;
|
|
2074
|
+
}
|
|
2075
|
+
let c = o[0];
|
|
2076
|
+
if (r === "union" && !i && c && ((!t.useFlagV || !t.verbose) && a.kind === "union" && !(W.bugFlagVLiteralHyphenIsRange && t.useFlagV) || !t.verbose && a.kind === "intersection" && o.length === 1 && c.type !== "CharacterClassRange")) return o.map(n).join("");
|
|
2077
|
+
if (!t.useFlagV && a.type === "CharacterClass") throw Error("Uses nested character class in a way that requires min target ES2024");
|
|
2078
|
+
return s();
|
|
2079
|
+
},
|
|
2080
|
+
CharacterClassRange(e, t) {
|
|
2081
|
+
let n = e.min.value, r = e.max.value, i = {
|
|
2082
|
+
escDigit: !1,
|
|
2083
|
+
inCharClass: !0,
|
|
2084
|
+
useFlagV: t.useFlagV
|
|
2085
|
+
}, a = $(n, i), o = $(r, i), s = /* @__PURE__ */ new Set();
|
|
2086
|
+
return t.useAppliedIgnoreCase && t.currentFlags.ignoreCase && mn(pn(e)).forEach((e) => {
|
|
2087
|
+
s.add(Array.isArray(e) ? `${$(e[0], i)}-${$(e[1], i)}` : $(e, i));
|
|
2088
|
+
}), `${a}-${o}${[...s].join("")}`;
|
|
2089
|
+
},
|
|
2090
|
+
CharacterSet({ kind: e, negate: t, value: n, key: r }, i) {
|
|
2091
|
+
if (e === "dot") return i.currentFlags.dotAll ? i.appliedGlobalFlags.dotAll || i.useFlagMods ? "." : "[^]" : U`[^\n]`;
|
|
2092
|
+
if (e === "digit") return t ? U`\D` : U`\d`;
|
|
2093
|
+
if (e === "property") {
|
|
2094
|
+
if (i.useAppliedIgnoreCase && i.currentFlags.ignoreCase && Ft.has(n)) throw Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);
|
|
2095
|
+
return `${t ? U`\P` : U`\p`}{${r ? `${r}=` : ""}${n}}`;
|
|
2096
|
+
}
|
|
2097
|
+
if (e === "word") return t ? U`\W` : U`\w`;
|
|
2098
|
+
throw Error(`Unexpected character set kind "${e}"`);
|
|
2099
|
+
},
|
|
2100
|
+
Flags(e, t) {
|
|
2101
|
+
return (t.appliedGlobalFlags.ignoreCase ? "i" : "") + (e.dotAll ? "s" : "") + (e.sticky ? "y" : "");
|
|
2102
|
+
},
|
|
2103
|
+
Group({ atomic: e, body: t, flags: n, parent: r }, i, a) {
|
|
2104
|
+
let o = i.currentFlags;
|
|
2105
|
+
n && (i.currentFlags = K(o, n));
|
|
2106
|
+
let s = t.map(a).join("|"), c = !i.verbose && t.length === 1 && r.type !== "Quantifier" && !e && (!i.useFlagMods || !n) ? s : `(?${hn(e, n, i.useFlagMods)}${s})`;
|
|
2107
|
+
return i.currentFlags = o, c;
|
|
2108
|
+
},
|
|
2109
|
+
LookaroundAssertion({ body: e, kind: t, negate: n }, r, i) {
|
|
2110
|
+
return `(?${`${t === "lookahead" ? "" : "<"}${n ? "!" : "="}`}${e.map(i).join("|")})`;
|
|
2111
|
+
},
|
|
2112
|
+
Quantifier(e, t, n) {
|
|
2113
|
+
return n(e.body) + gn(e);
|
|
2114
|
+
},
|
|
2115
|
+
Subroutine({ isRecursive: e, ref: t }, n) {
|
|
2116
|
+
if (!e) throw Error("Unexpected non-recursive subroutine in transformed AST");
|
|
2117
|
+
let r = n.recursionLimit;
|
|
2118
|
+
return t === 0 ? `(?R=${r})` : U`\g<${t}&R=${r}>`;
|
|
2119
|
+
}
|
|
2120
|
+
}, sn = /* @__PURE__ */ new Set([
|
|
2121
|
+
"$",
|
|
2122
|
+
"(",
|
|
2123
|
+
")",
|
|
2124
|
+
"*",
|
|
2125
|
+
"+",
|
|
2126
|
+
".",
|
|
2127
|
+
"?",
|
|
2128
|
+
"[",
|
|
2129
|
+
"\\",
|
|
2130
|
+
"]",
|
|
2131
|
+
"^",
|
|
2132
|
+
"{",
|
|
2133
|
+
"|",
|
|
2134
|
+
"}"
|
|
2135
|
+
]), cn = /* @__PURE__ */ new Set([
|
|
2136
|
+
"-",
|
|
2137
|
+
"\\",
|
|
2138
|
+
"]",
|
|
2139
|
+
"^",
|
|
2140
|
+
"["
|
|
2141
|
+
]), ln = /* @__PURE__ */ new Set(/* @__PURE__ */ "()-/[\\]^{|}!#$%&*+,.:;<=>?@`~".split("")), un = /* @__PURE__ */ new Map([
|
|
2142
|
+
[9, U`\t`],
|
|
2143
|
+
[10, U`\n`],
|
|
2144
|
+
[11, U`\v`],
|
|
2145
|
+
[12, U`\f`],
|
|
2146
|
+
[13, U`\r`],
|
|
2147
|
+
[8232, U`\u2028`],
|
|
2148
|
+
[8233, U`\u2029`],
|
|
2149
|
+
[65279, U`\uFEFF`]
|
|
2150
|
+
]), dn = /^\p{Cased}$/u;
|
|
2151
|
+
function fn(e) {
|
|
2152
|
+
return dn.test(e);
|
|
2153
|
+
}
|
|
2154
|
+
function pn(e, t) {
|
|
2155
|
+
let n = !!t?.firstOnly, r = e.min.value, i = e.max.value, a = [];
|
|
2156
|
+
if (r < 65 && (i === 65535 || i >= 131071) || r === 65536 && i >= 131071) return a;
|
|
2157
|
+
for (let e = r; e <= i; e++) {
|
|
2158
|
+
let t = H(e);
|
|
2159
|
+
if (!fn(t)) continue;
|
|
2160
|
+
let o = Dt(t).filter((e) => {
|
|
2161
|
+
let t = e.codePointAt(0);
|
|
2162
|
+
return t < r || t > i;
|
|
2163
|
+
});
|
|
2164
|
+
if (o.length && (a.push(...o), n)) break;
|
|
2165
|
+
}
|
|
2166
|
+
return a;
|
|
2167
|
+
}
|
|
2168
|
+
function $(e, { escDigit: t, inCharClass: n, useFlagV: r }) {
|
|
2169
|
+
if (un.has(e)) return un.get(e);
|
|
2170
|
+
if (e < 32 || e > 126 && e < 160 || e > 262143 || t && vn(e)) return e > 255 ? `\\u{${e.toString(16).toUpperCase()}}` : `\\x${e.toString(16).toUpperCase().padStart(2, "0")}`;
|
|
2171
|
+
let i = n ? r ? ln : cn : sn, a = H(e);
|
|
2172
|
+
return (i.has(a) ? "\\" : "") + a;
|
|
2173
|
+
}
|
|
2174
|
+
function mn(e) {
|
|
2175
|
+
let t = e.map((e) => e.codePointAt(0)).sort((e, t) => e - t), n = [], r = null;
|
|
2176
|
+
for (let e = 0; e < t.length; e++) t[e + 1] === t[e] + 1 ? r ??= t[e] : r === null ? n.push(t[e]) : (n.push([r, t[e]]), r = null);
|
|
2177
|
+
return n;
|
|
2178
|
+
}
|
|
2179
|
+
function hn(e, t, n) {
|
|
2180
|
+
if (e) return ">";
|
|
2181
|
+
let r = "";
|
|
2182
|
+
if (t && n) {
|
|
2183
|
+
let { enable: e, disable: n } = t;
|
|
2184
|
+
r = (e?.ignoreCase ? "i" : "") + (e?.dotAll ? "s" : "") + (n ? "-" : "") + (n?.ignoreCase ? "i" : "") + (n?.dotAll ? "s" : "");
|
|
2185
|
+
}
|
|
2186
|
+
return `${r}:`;
|
|
2187
|
+
}
|
|
2188
|
+
function gn({ kind: e, max: t, min: n }) {
|
|
2189
|
+
let r;
|
|
2190
|
+
return r = !n && t === 1 ? "?" : !n && t === Infinity ? "*" : n === 1 && t === Infinity ? "+" : n === t ? `{${n}}` : `{${n},${t === Infinity ? "" : t}}`, r + {
|
|
2191
|
+
greedy: "",
|
|
2192
|
+
lazy: "?",
|
|
2193
|
+
possessive: "+"
|
|
2194
|
+
}[e];
|
|
2195
|
+
}
|
|
2196
|
+
function _n({ type: e }) {
|
|
2197
|
+
return e === "CapturingGroup" || e === "Group" || e === "LookaroundAssertion";
|
|
2198
|
+
}
|
|
2199
|
+
function vn(e) {
|
|
2200
|
+
return e > 47 && e < 58;
|
|
2201
|
+
}
|
|
2202
|
+
function yn({ type: e, value: t }) {
|
|
2203
|
+
return e === "Character" && t === 45;
|
|
2204
|
+
}
|
|
2205
|
+
var bn = class e extends RegExp {
|
|
2206
|
+
#e = /* @__PURE__ */ new Map();
|
|
2207
|
+
#t = null;
|
|
2208
|
+
#n;
|
|
2209
|
+
#r = null;
|
|
2210
|
+
#i = null;
|
|
2211
|
+
rawOptions = {};
|
|
2212
|
+
get source() {
|
|
2213
|
+
return this.#n || "(?:)";
|
|
2214
|
+
}
|
|
2215
|
+
constructor(t, n, r) {
|
|
2216
|
+
let i = !!r?.lazyCompile;
|
|
2217
|
+
if (t instanceof RegExp) {
|
|
2218
|
+
if (r) throw Error("Cannot provide options when copying a regexp");
|
|
2219
|
+
let i = t;
|
|
2220
|
+
super(i, n), this.#n = i.source, i instanceof e && (this.#e = i.#e, this.#r = i.#r, this.#i = i.#i, this.rawOptions = i.rawOptions);
|
|
2221
|
+
} else {
|
|
2222
|
+
let e = {
|
|
2223
|
+
hiddenCaptures: [],
|
|
2224
|
+
strategy: null,
|
|
2225
|
+
transfers: [],
|
|
2226
|
+
...r
|
|
2227
|
+
};
|
|
2228
|
+
super(i ? "" : t, n), this.#n = t, this.#e = Sn(e.hiddenCaptures, e.transfers), this.#i = e.strategy, this.rawOptions = r ?? {};
|
|
2229
|
+
}
|
|
2230
|
+
i || (this.#t = this);
|
|
2231
|
+
}
|
|
2232
|
+
exec(t) {
|
|
2233
|
+
if (!this.#t) {
|
|
2234
|
+
let { lazyCompile: t, ...n } = this.rawOptions;
|
|
2235
|
+
this.#t = new e(this.#n, this.flags, n);
|
|
2236
|
+
}
|
|
2237
|
+
let n = this.global || this.sticky, r = this.lastIndex;
|
|
2238
|
+
if (this.#i === "clip_search" && n && r) {
|
|
2239
|
+
this.lastIndex = 0;
|
|
2240
|
+
let e = this.#a(t.slice(r));
|
|
2241
|
+
return e && (xn(e, r, t, this.hasIndices), this.lastIndex += r), e;
|
|
2242
|
+
}
|
|
2243
|
+
return this.#a(t);
|
|
2244
|
+
}
|
|
2245
|
+
#a(e) {
|
|
2246
|
+
this.#t.lastIndex = this.lastIndex;
|
|
2247
|
+
let t = super.exec.call(this.#t, e);
|
|
2248
|
+
if (this.lastIndex = this.#t.lastIndex, !t || !this.#e.size) return t;
|
|
2249
|
+
let n = [...t];
|
|
2250
|
+
t.length = 1;
|
|
2251
|
+
let r;
|
|
2252
|
+
this.hasIndices && (r = [...t.indices], t.indices.length = 1);
|
|
2253
|
+
let i = [0];
|
|
2254
|
+
for (let e = 1; e < n.length; e++) {
|
|
2255
|
+
let { hidden: a, transferTo: o } = this.#e.get(e) ?? {};
|
|
2256
|
+
if (a ? i.push(null) : (i.push(t.length), t.push(n[e]), this.hasIndices && t.indices.push(r[e])), o && n[e] !== void 0) {
|
|
2257
|
+
let a = i[o];
|
|
2258
|
+
if (!a) throw Error(`Invalid capture transfer to "${a}"`);
|
|
2259
|
+
if (t[a] = n[e], this.hasIndices && (t.indices[a] = r[e]), t.groups) {
|
|
2260
|
+
this.#r ||= Cn(this.source);
|
|
2261
|
+
let i = this.#r.get(o);
|
|
2262
|
+
i && (t.groups[i] = n[e], this.hasIndices && (t.indices.groups[i] = r[e]));
|
|
2263
|
+
}
|
|
2264
|
+
}
|
|
2265
|
+
}
|
|
2266
|
+
return t;
|
|
2267
|
+
}
|
|
2268
|
+
};
|
|
2269
|
+
function xn(e, t, n, r) {
|
|
2270
|
+
if (e.index += t, e.input = n, r) {
|
|
2271
|
+
let n = e.indices;
|
|
2272
|
+
for (let e = 0; e < n.length; e++) {
|
|
2273
|
+
let r = n[e];
|
|
2274
|
+
r && (n[e] = [r[0] + t, r[1] + t]);
|
|
2275
|
+
}
|
|
2276
|
+
let r = n.groups;
|
|
2277
|
+
r && Object.keys(r).forEach((e) => {
|
|
2278
|
+
let n = r[e];
|
|
2279
|
+
n && (r[e] = [n[0] + t, n[1] + t]);
|
|
2280
|
+
});
|
|
2281
|
+
}
|
|
2282
|
+
}
|
|
2283
|
+
function Sn(e, t) {
|
|
2284
|
+
let n = /* @__PURE__ */ new Map();
|
|
2285
|
+
for (let t of e) n.set(t, { hidden: !0 });
|
|
2286
|
+
for (let [e, r] of t) for (let t of r) q(n, t, {}).transferTo = e;
|
|
2287
|
+
return n;
|
|
2288
|
+
}
|
|
2289
|
+
function Cn(e) {
|
|
2290
|
+
let t = /(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu, n = /* @__PURE__ */ new Map(), r = 0, i = 0, a;
|
|
2291
|
+
for (; a = t.exec(e);) {
|
|
2292
|
+
let { 0: e, groups: { capture: t, name: o } } = a;
|
|
2293
|
+
e === "[" ? r++ : r ? e === "]" && r-- : t && (i++, o && n.set(i, o));
|
|
2294
|
+
}
|
|
2295
|
+
return n;
|
|
2296
|
+
}
|
|
2297
|
+
function wn(e, t) {
|
|
2298
|
+
let n = Tn(e, t);
|
|
2299
|
+
return n.options ? new bn(n.pattern, n.flags, n.options) : new RegExp(n.pattern, n.flags);
|
|
2300
|
+
}
|
|
2301
|
+
function Tn(e, t) {
|
|
2302
|
+
let n = wt(t), r = It(Te(e, {
|
|
2303
|
+
flags: n.flags,
|
|
2304
|
+
normalizeUnknownPropertyNames: !0,
|
|
2305
|
+
rules: {
|
|
2306
|
+
captureGroup: n.rules.captureGroup,
|
|
2307
|
+
singleline: n.rules.singleline
|
|
2308
|
+
},
|
|
2309
|
+
skipBackrefValidation: n.rules.allowOrphanBackrefs,
|
|
2310
|
+
unicodePropertyMap: Ot
|
|
2311
|
+
}), {
|
|
2312
|
+
accuracy: n.accuracy,
|
|
2313
|
+
asciiWordBoundaries: n.rules.asciiWordBoundaries,
|
|
2314
|
+
avoidSubclass: n.avoidSubclass,
|
|
2315
|
+
bestEffortTarget: n.target
|
|
2316
|
+
}), i = rn(r, n), a = mt(i.pattern, {
|
|
2317
|
+
captureTransfers: i._captureTransfers,
|
|
2318
|
+
hiddenCaptures: i._hiddenCaptures,
|
|
2319
|
+
mode: "external"
|
|
2320
|
+
}), o = ct(ut(a.pattern).pattern, {
|
|
2321
|
+
captureTransfers: a.captureTransfers,
|
|
2322
|
+
hiddenCaptures: a.hiddenCaptures
|
|
2323
|
+
}), s = {
|
|
2324
|
+
pattern: o.pattern,
|
|
2325
|
+
flags: `${n.hasIndices ? "d" : ""}${n.global ? "g" : ""}${i.flags}${i.options.disable.v ? "u" : "v"}`
|
|
2326
|
+
};
|
|
2327
|
+
if (n.avoidSubclass) {
|
|
2328
|
+
if (n.lazyCompileLength !== Infinity) throw Error("Lazy compilation requires subclass");
|
|
2329
|
+
} else {
|
|
2330
|
+
let e = o.hiddenCaptures.sort((e, t) => e - t), t = Array.from(o.captureTransfers), i = r._strategy, a = s.pattern.length >= n.lazyCompileLength;
|
|
2331
|
+
(e.length || t.length || i || a) && (s.options = {
|
|
2332
|
+
...e.length && { hiddenCaptures: e },
|
|
2333
|
+
...t.length && { transfers: t },
|
|
2334
|
+
...i && { strategy: i },
|
|
2335
|
+
...a && { lazyCompile: a }
|
|
2336
|
+
});
|
|
2337
|
+
}
|
|
2338
|
+
return s;
|
|
2339
|
+
}
|
|
2340
|
+
//#endregion
|
|
2341
|
+
//#region ../../node_modules/.pnpm/@shikijs+engine-javascript@4.4.3/node_modules/@shikijs/engine-javascript/dist/engine-compile.mjs
|
|
2342
|
+
function En(e, t) {
|
|
2343
|
+
return wn(e, {
|
|
2344
|
+
global: !0,
|
|
2345
|
+
hasIndices: !0,
|
|
2346
|
+
lazyCompileLength: 3e3,
|
|
2347
|
+
rules: {
|
|
2348
|
+
allowOrphanBackrefs: !0,
|
|
2349
|
+
asciiWordBoundaries: !0,
|
|
2350
|
+
captureGroup: !0,
|
|
2351
|
+
recursionLimit: 5,
|
|
2352
|
+
singleline: !0
|
|
2353
|
+
},
|
|
2354
|
+
...t
|
|
2355
|
+
});
|
|
2356
|
+
}
|
|
2357
|
+
function Dn(e = {}) {
|
|
2358
|
+
let n = {
|
|
2359
|
+
target: "auto",
|
|
2360
|
+
cache: /* @__PURE__ */ new Map(),
|
|
2361
|
+
...e
|
|
2362
|
+
};
|
|
2363
|
+
return n.regexConstructor ||= (e) => En(e, { target: n.target }), {
|
|
2364
|
+
createScanner(e) {
|
|
2365
|
+
return new t(e, n);
|
|
2366
|
+
},
|
|
2367
|
+
createString(e) {
|
|
2368
|
+
return { content: e };
|
|
2369
|
+
}
|
|
2370
|
+
};
|
|
2371
|
+
}
|
|
2372
|
+
//#endregion
|
|
2373
|
+
//#region ../../node_modules/.pnpm/@shikijs+engine-javascript@4.4.3/node_modules/@shikijs/engine-javascript/dist/engine-raw.mjs
|
|
2374
|
+
function On() {
|
|
2375
|
+
let e = {
|
|
2376
|
+
cache: /* @__PURE__ */ new Map(),
|
|
2377
|
+
regexConstructor: () => {
|
|
2378
|
+
throw Error("JavaScriptRawEngine: only support precompiled grammar");
|
|
2379
|
+
}
|
|
2380
|
+
};
|
|
2381
|
+
return {
|
|
2382
|
+
createScanner(n) {
|
|
2383
|
+
return new t(n, e);
|
|
2384
|
+
},
|
|
2385
|
+
createString(e) {
|
|
2386
|
+
return { content: e };
|
|
2387
|
+
}
|
|
2388
|
+
};
|
|
2389
|
+
}
|
|
2390
|
+
//#endregion
|
|
2391
|
+
export { t as JavaScriptScanner, On as createJavaScriptRawEngine, Dn as createJavaScriptRegexEngine, En as defaultJavaScriptRegexConstructor };
|
|
2392
|
+
|
|
2393
|
+
//# sourceMappingURL=engine-javascript-DkCwfYjr.js.map
|