@openstage/glyph-element 0.2.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/THIRD-PARTY-NOTICES.md +1505 -0
- package/dist/chunks/bash-Dw1nAEst.js +171 -0
- package/dist/chunks/bash-Dw1nAEst.js.map +1 -0
- package/dist/chunks/csharp-D8ELXkGi.js +262 -0
- package/dist/chunks/csharp-D8ELXkGi.js.map +1 -0
- package/dist/chunks/css-DQEU4whB.js +142 -0
- package/dist/chunks/css-DQEU4whB.js.map +1 -0
- package/dist/chunks/fsharp-D4SqCnMZ.js +242 -0
- package/dist/chunks/fsharp-D4SqCnMZ.js.map +1 -0
- package/dist/chunks/go-BJIB22rX.js +142 -0
- package/dist/chunks/go-BJIB22rX.js.map +1 -0
- package/dist/chunks/haskell-eGGgAkgA.js +140 -0
- package/dist/chunks/haskell-eGGgAkgA.js.map +1 -0
- package/dist/chunks/highlight-core-C0K6BIzZ.js +967 -0
- package/dist/chunks/highlight-core-C0K6BIzZ.js.map +1 -0
- package/dist/chunks/java-DHPUyZsV.js +171 -0
- package/dist/chunks/java-DHPUyZsV.js.map +1 -0
- package/dist/chunks/javascript-D_CG8suQ.js +438 -0
- package/dist/chunks/javascript-D_CG8suQ.js.map +1 -0
- package/dist/chunks/json-BD6qkh12.js +38 -0
- package/dist/chunks/json-BD6qkh12.js.map +1 -0
- package/dist/chunks/kotlin-C75rnxi-.js +203 -0
- package/dist/chunks/kotlin-C75rnxi-.js.map +1 -0
- package/dist/chunks/markdown-B6LMDWi1.js +183 -0
- package/dist/chunks/markdown-B6LMDWi1.js.map +1 -0
- package/dist/chunks/ocaml-CMtC1T-S.js +54 -0
- package/dist/chunks/ocaml-CMtC1T-S.js.map +1 -0
- package/dist/chunks/prosemirror-dAj0dboi.js +7790 -0
- package/dist/chunks/prosemirror-dAj0dboi.js.map +1 -0
- package/dist/chunks/python-ny4cvzzX.js +240 -0
- package/dist/chunks/python-ny4cvzzX.js.map +1 -0
- package/dist/chunks/rolldown-runtime-BE9Pkid1.js +13 -0
- package/dist/chunks/rust-8OMNiTht.js +171 -0
- package/dist/chunks/rust-8OMNiTht.js.map +1 -0
- package/dist/chunks/scala-BB851ZJZ.js +164 -0
- package/dist/chunks/scala-BB851ZJZ.js.map +1 -0
- package/dist/chunks/sql-CoOMeU5k.js +120 -0
- package/dist/chunks/sql-CoOMeU5k.js.map +1 -0
- package/dist/chunks/tiptap-Cb4W88fy.js +8527 -0
- package/dist/chunks/tiptap-Cb4W88fy.js.map +1 -0
- package/dist/chunks/typescript-Dh7IycF2.js +523 -0
- package/dist/chunks/typescript-Dh7IycF2.js.map +1 -0
- package/dist/chunks/vendor-B82PcruV.js +1799 -0
- package/dist/chunks/vendor-B82PcruV.js.map +1 -0
- package/dist/chunks/xml-BpsgObpu.js +168 -0
- package/dist/chunks/xml-BpsgObpu.js.map +1 -0
- package/dist/codeblock-backspace.d.ts +3 -0
- package/dist/codeblock-backspace.d.ts.map +1 -0
- package/dist/document-conversion.d.ts +29 -0
- package/dist/document-conversion.d.ts.map +1 -0
- package/dist/editor-element.d.ts +93 -0
- package/dist/editor-element.d.ts.map +1 -0
- package/dist/glyph-editor-element.js +783 -0
- package/dist/glyph-editor-element.js.map +1 -0
- package/dist/header.d.ts +18 -0
- package/dist/header.d.ts.map +1 -0
- package/dist/index.d.ts +62 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/link-dialog.d.ts +29 -0
- package/dist/link-dialog.d.ts.map +1 -0
- package/dist/safe-href.d.ts +2 -0
- package/dist/safe-href.d.ts.map +1 -0
- package/dist/slash-menu.d.ts +22 -0
- package/dist/slash-menu.d.ts.map +1 -0
- package/dist/styles.d.ts +2 -0
- package/dist/styles.d.ts.map +1 -0
- package/package.json +52 -0
|
@@ -0,0 +1,967 @@
|
|
|
1
|
+
import { n as e, t } from "./rolldown-runtime-BE9Pkid1.js";
|
|
2
|
+
var n = (/* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
3
|
+
function n(e) {
|
|
4
|
+
return e instanceof Map ? e.clear = e.delete = e.set = function() {
|
|
5
|
+
throw Error("map is read-only");
|
|
6
|
+
} : e instanceof Set && (e.add = e.clear = e.delete = function() {
|
|
7
|
+
throw Error("set is read-only");
|
|
8
|
+
}), Object.freeze(e), Object.getOwnPropertyNames(e).forEach((t) => {
|
|
9
|
+
let r = e[t], i = typeof r;
|
|
10
|
+
(i === "object" || i === "function") && !Object.isFrozen(r) && n(r);
|
|
11
|
+
}), e;
|
|
12
|
+
}
|
|
13
|
+
var r = class {
|
|
14
|
+
constructor(e) {
|
|
15
|
+
e.data === void 0 && (e.data = {}), this.data = e.data, this.isMatchIgnored = !1;
|
|
16
|
+
}
|
|
17
|
+
ignoreMatch() {
|
|
18
|
+
this.isMatchIgnored = !0;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
function i(e) {
|
|
22
|
+
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
23
|
+
}
|
|
24
|
+
function a(e, ...t) {
|
|
25
|
+
let n = Object.create(null);
|
|
26
|
+
for (let t in e) n[t] = e[t];
|
|
27
|
+
return t.forEach(function(e) {
|
|
28
|
+
for (let t in e) n[t] = e[t];
|
|
29
|
+
}), n;
|
|
30
|
+
}
|
|
31
|
+
var o = "</span>", s = (e) => !!e.scope, c = (e, { prefix: t }) => {
|
|
32
|
+
if (e.startsWith("language:")) return e.replace("language:", "language-");
|
|
33
|
+
if (e.includes(".")) {
|
|
34
|
+
let n = e.split(".");
|
|
35
|
+
return [`${t}${n.shift()}`, ...n.map((e, t) => `${e}${"_".repeat(t + 1)}`)].join(" ");
|
|
36
|
+
}
|
|
37
|
+
return `${t}${e}`;
|
|
38
|
+
}, l = class {
|
|
39
|
+
constructor(e, t) {
|
|
40
|
+
this.buffer = "", this.classPrefix = t.classPrefix, e.walk(this);
|
|
41
|
+
}
|
|
42
|
+
addText(e) {
|
|
43
|
+
this.buffer += i(e);
|
|
44
|
+
}
|
|
45
|
+
openNode(e) {
|
|
46
|
+
if (!s(e)) return;
|
|
47
|
+
let t = c(e.scope, { prefix: this.classPrefix });
|
|
48
|
+
this.span(t);
|
|
49
|
+
}
|
|
50
|
+
closeNode(e) {
|
|
51
|
+
s(e) && (this.buffer += o);
|
|
52
|
+
}
|
|
53
|
+
value() {
|
|
54
|
+
return this.buffer;
|
|
55
|
+
}
|
|
56
|
+
span(e) {
|
|
57
|
+
this.buffer += `<span class="${e}">`;
|
|
58
|
+
}
|
|
59
|
+
}, u = (e = {}) => {
|
|
60
|
+
let t = { children: [] };
|
|
61
|
+
return Object.assign(t, e), t;
|
|
62
|
+
}, d = class e {
|
|
63
|
+
constructor() {
|
|
64
|
+
this.rootNode = u(), this.stack = [this.rootNode];
|
|
65
|
+
}
|
|
66
|
+
get top() {
|
|
67
|
+
return this.stack[this.stack.length - 1];
|
|
68
|
+
}
|
|
69
|
+
get root() {
|
|
70
|
+
return this.rootNode;
|
|
71
|
+
}
|
|
72
|
+
add(e) {
|
|
73
|
+
this.top.children.push(e);
|
|
74
|
+
}
|
|
75
|
+
openNode(e) {
|
|
76
|
+
let t = u({ scope: e });
|
|
77
|
+
this.add(t), this.stack.push(t);
|
|
78
|
+
}
|
|
79
|
+
closeNode() {
|
|
80
|
+
if (this.stack.length > 1) return this.stack.pop();
|
|
81
|
+
}
|
|
82
|
+
closeAllNodes() {
|
|
83
|
+
for (; this.closeNode(););
|
|
84
|
+
}
|
|
85
|
+
toJSON() {
|
|
86
|
+
return JSON.stringify(this.rootNode, null, 4);
|
|
87
|
+
}
|
|
88
|
+
walk(e) {
|
|
89
|
+
return this.constructor._walk(e, this.rootNode);
|
|
90
|
+
}
|
|
91
|
+
static _walk(e, t) {
|
|
92
|
+
return typeof t == "string" ? e.addText(t) : t.children && (e.openNode(t), t.children.forEach((t) => this._walk(e, t)), e.closeNode(t)), e;
|
|
93
|
+
}
|
|
94
|
+
static _collapse(t) {
|
|
95
|
+
typeof t != "string" && t.children && (t.children.every((e) => typeof e == "string") ? t.children = [t.children.join("")] : t.children.forEach((t) => {
|
|
96
|
+
e._collapse(t);
|
|
97
|
+
}));
|
|
98
|
+
}
|
|
99
|
+
}, f = class extends d {
|
|
100
|
+
constructor(e) {
|
|
101
|
+
super(), this.options = e;
|
|
102
|
+
}
|
|
103
|
+
addText(e) {
|
|
104
|
+
e !== "" && this.add(e);
|
|
105
|
+
}
|
|
106
|
+
startScope(e) {
|
|
107
|
+
this.openNode(e);
|
|
108
|
+
}
|
|
109
|
+
endScope() {
|
|
110
|
+
this.closeNode();
|
|
111
|
+
}
|
|
112
|
+
__addSublanguage(e, t) {
|
|
113
|
+
let n = e.root;
|
|
114
|
+
t && (n.scope = `language:${t}`), this.add(n);
|
|
115
|
+
}
|
|
116
|
+
toHTML() {
|
|
117
|
+
return new l(this, this.options).value();
|
|
118
|
+
}
|
|
119
|
+
finalize() {
|
|
120
|
+
return this.closeAllNodes(), !0;
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
function p(e) {
|
|
124
|
+
return e ? typeof e == "string" ? e : e.source : null;
|
|
125
|
+
}
|
|
126
|
+
function m(e) {
|
|
127
|
+
return _("(?=", e, ")");
|
|
128
|
+
}
|
|
129
|
+
function h(e) {
|
|
130
|
+
return _("(?:", e, ")*");
|
|
131
|
+
}
|
|
132
|
+
function g(e) {
|
|
133
|
+
return _("(?:", e, ")?");
|
|
134
|
+
}
|
|
135
|
+
function _(...e) {
|
|
136
|
+
return e.map((e) => p(e)).join("");
|
|
137
|
+
}
|
|
138
|
+
function v(e) {
|
|
139
|
+
let t = e[e.length - 1];
|
|
140
|
+
return typeof t == "object" && t.constructor === Object ? (e.splice(e.length - 1, 1), t) : {};
|
|
141
|
+
}
|
|
142
|
+
function y(...e) {
|
|
143
|
+
return "(" + (v(e).capture ? "" : "?:") + e.map((e) => p(e)).join("|") + ")";
|
|
144
|
+
}
|
|
145
|
+
function b(e) {
|
|
146
|
+
return RegExp(e.toString() + "|").exec("").length - 1;
|
|
147
|
+
}
|
|
148
|
+
function ee(e, t) {
|
|
149
|
+
let n = e && e.exec(t);
|
|
150
|
+
return n && n.index === 0;
|
|
151
|
+
}
|
|
152
|
+
var x = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;
|
|
153
|
+
function S(e, { joinWith: t }) {
|
|
154
|
+
let n = 0;
|
|
155
|
+
return e.map((e) => {
|
|
156
|
+
n += 1;
|
|
157
|
+
let t = n, r = p(e), i = "";
|
|
158
|
+
for (; r.length > 0;) {
|
|
159
|
+
let e = x.exec(r);
|
|
160
|
+
if (!e) {
|
|
161
|
+
i += r;
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
i += r.substring(0, e.index), r = r.substring(e.index + e[0].length), e[0][0] === "\\" && e[1] ? i += "\\" + String(Number(e[1]) + t) : (i += e[0], e[0] === "(" && n++);
|
|
165
|
+
}
|
|
166
|
+
return i;
|
|
167
|
+
}).map((e) => `(${e})`).join(t);
|
|
168
|
+
}
|
|
169
|
+
var C = /\b\B/, w = "[a-zA-Z]\\w*", T = "[a-zA-Z_]\\w*", E = "\\b\\d+(\\.\\d+)?", D = "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)", O = "\\b(0b[01]+)", k = "!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", A = (e = {}) => {
|
|
170
|
+
let t = /^#![ ]*\//;
|
|
171
|
+
return e.binary && (e.begin = _(t, /.*\b/, e.binary, /\b.*/)), a({
|
|
172
|
+
scope: "meta",
|
|
173
|
+
begin: t,
|
|
174
|
+
end: /$/,
|
|
175
|
+
relevance: 0,
|
|
176
|
+
"on:begin": (e, t) => {
|
|
177
|
+
e.index !== 0 && t.ignoreMatch();
|
|
178
|
+
}
|
|
179
|
+
}, e);
|
|
180
|
+
}, j = {
|
|
181
|
+
begin: "\\\\[\\s\\S]",
|
|
182
|
+
relevance: 0
|
|
183
|
+
}, M = {
|
|
184
|
+
scope: "string",
|
|
185
|
+
begin: "'",
|
|
186
|
+
end: "'",
|
|
187
|
+
illegal: "\\n",
|
|
188
|
+
contains: [j]
|
|
189
|
+
}, N = {
|
|
190
|
+
scope: "string",
|
|
191
|
+
begin: "\"",
|
|
192
|
+
end: "\"",
|
|
193
|
+
illegal: "\\n",
|
|
194
|
+
contains: [j]
|
|
195
|
+
}, P = { begin: /\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/ }, F = function(e, t, n = {}) {
|
|
196
|
+
let r = a({
|
|
197
|
+
scope: "comment",
|
|
198
|
+
begin: e,
|
|
199
|
+
end: t,
|
|
200
|
+
contains: []
|
|
201
|
+
}, n);
|
|
202
|
+
r.contains.push({
|
|
203
|
+
scope: "doctag",
|
|
204
|
+
begin: "[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",
|
|
205
|
+
end: /(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,
|
|
206
|
+
excludeBegin: !0,
|
|
207
|
+
relevance: 0
|
|
208
|
+
});
|
|
209
|
+
let i = y("I", "a", "is", "so", "us", "to", "at", "if", "in", "it", "on", /[A-Za-z]+['](d|ve|re|ll|t|s|n)/, /[A-Za-z]+[-][a-z]+/, /[A-Za-z][a-z]{2,}/);
|
|
210
|
+
return r.contains.push({ begin: _(/[ ]+/, "(", i, /[.]?[:]?([.][ ]|[ ])/, "){3}") }), r;
|
|
211
|
+
}, I = F("//", "$"), L = F("/\\*", "\\*/"), R = F("#", "$"), z = {
|
|
212
|
+
scope: "number",
|
|
213
|
+
begin: E,
|
|
214
|
+
relevance: 0
|
|
215
|
+
}, te = {
|
|
216
|
+
scope: "number",
|
|
217
|
+
begin: D,
|
|
218
|
+
relevance: 0
|
|
219
|
+
}, ne = {
|
|
220
|
+
scope: "number",
|
|
221
|
+
begin: O,
|
|
222
|
+
relevance: 0
|
|
223
|
+
}, re = {
|
|
224
|
+
scope: "regexp",
|
|
225
|
+
begin: /\/(?=[^/\n]*\/)/,
|
|
226
|
+
end: /\/[gimuy]*/,
|
|
227
|
+
contains: [j, {
|
|
228
|
+
begin: /\[/,
|
|
229
|
+
end: /\]/,
|
|
230
|
+
relevance: 0,
|
|
231
|
+
contains: [j]
|
|
232
|
+
}]
|
|
233
|
+
}, ie = {
|
|
234
|
+
scope: "title",
|
|
235
|
+
begin: w,
|
|
236
|
+
relevance: 0
|
|
237
|
+
}, ae = {
|
|
238
|
+
scope: "title",
|
|
239
|
+
begin: T,
|
|
240
|
+
relevance: 0
|
|
241
|
+
}, oe = {
|
|
242
|
+
begin: "\\.\\s*" + T,
|
|
243
|
+
relevance: 0
|
|
244
|
+
}, B = /* @__PURE__ */ Object.freeze({
|
|
245
|
+
__proto__: null,
|
|
246
|
+
APOS_STRING_MODE: M,
|
|
247
|
+
BACKSLASH_ESCAPE: j,
|
|
248
|
+
BINARY_NUMBER_MODE: ne,
|
|
249
|
+
BINARY_NUMBER_RE: O,
|
|
250
|
+
COMMENT: F,
|
|
251
|
+
C_BLOCK_COMMENT_MODE: L,
|
|
252
|
+
C_LINE_COMMENT_MODE: I,
|
|
253
|
+
C_NUMBER_MODE: te,
|
|
254
|
+
C_NUMBER_RE: D,
|
|
255
|
+
END_SAME_AS_BEGIN: function(e) {
|
|
256
|
+
return Object.assign(e, {
|
|
257
|
+
"on:begin": (e, t) => {
|
|
258
|
+
t.data._beginMatch = e[1];
|
|
259
|
+
},
|
|
260
|
+
"on:end": (e, t) => {
|
|
261
|
+
t.data._beginMatch !== e[1] && t.ignoreMatch();
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
},
|
|
265
|
+
HASH_COMMENT_MODE: R,
|
|
266
|
+
IDENT_RE: w,
|
|
267
|
+
MATCH_NOTHING_RE: C,
|
|
268
|
+
METHOD_GUARD: oe,
|
|
269
|
+
NUMBER_MODE: z,
|
|
270
|
+
NUMBER_RE: E,
|
|
271
|
+
PHRASAL_WORDS_MODE: P,
|
|
272
|
+
QUOTE_STRING_MODE: N,
|
|
273
|
+
REGEXP_MODE: re,
|
|
274
|
+
RE_STARTERS_RE: k,
|
|
275
|
+
SHEBANG: A,
|
|
276
|
+
TITLE_MODE: ie,
|
|
277
|
+
UNDERSCORE_IDENT_RE: T,
|
|
278
|
+
UNDERSCORE_TITLE_MODE: ae
|
|
279
|
+
});
|
|
280
|
+
function se(e, t) {
|
|
281
|
+
e.input[e.index - 1] === "." && t.ignoreMatch();
|
|
282
|
+
}
|
|
283
|
+
function ce(e, t) {
|
|
284
|
+
e.className !== void 0 && (e.scope = e.className, delete e.className);
|
|
285
|
+
}
|
|
286
|
+
function le(e, t) {
|
|
287
|
+
t && e.beginKeywords && (e.begin = "\\b(" + e.beginKeywords.split(" ").join("|") + ")(?!\\.)(?=\\b|\\s)", e.__beforeBegin = se, e.keywords = e.keywords || e.beginKeywords, delete e.beginKeywords, e.relevance === void 0 && (e.relevance = 0));
|
|
288
|
+
}
|
|
289
|
+
function ue(e, t) {
|
|
290
|
+
Array.isArray(e.illegal) && (e.illegal = y(...e.illegal));
|
|
291
|
+
}
|
|
292
|
+
function de(e, t) {
|
|
293
|
+
if (e.match) {
|
|
294
|
+
if (e.begin || e.end) throw Error("begin & end are not supported with match");
|
|
295
|
+
e.begin = e.match, delete e.match;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
function fe(e, t) {
|
|
299
|
+
e.relevance === void 0 && (e.relevance = 1);
|
|
300
|
+
}
|
|
301
|
+
var pe = (e, t) => {
|
|
302
|
+
if (!e.beforeMatch) return;
|
|
303
|
+
if (e.starts) throw Error("beforeMatch cannot be used with starts");
|
|
304
|
+
let n = Object.assign({}, e);
|
|
305
|
+
Object.keys(e).forEach((t) => {
|
|
306
|
+
delete e[t];
|
|
307
|
+
}), e.keywords = n.keywords, e.begin = _(n.beforeMatch, m(n.begin)), e.starts = {
|
|
308
|
+
relevance: 0,
|
|
309
|
+
contains: [Object.assign(n, { endsParent: !0 })]
|
|
310
|
+
}, e.relevance = 0, delete n.beforeMatch;
|
|
311
|
+
}, me = [
|
|
312
|
+
"of",
|
|
313
|
+
"and",
|
|
314
|
+
"for",
|
|
315
|
+
"in",
|
|
316
|
+
"not",
|
|
317
|
+
"or",
|
|
318
|
+
"if",
|
|
319
|
+
"then",
|
|
320
|
+
"parent",
|
|
321
|
+
"list",
|
|
322
|
+
"value"
|
|
323
|
+
], he = "keyword";
|
|
324
|
+
function V(e, t, n = he) {
|
|
325
|
+
let r = Object.create(null);
|
|
326
|
+
return typeof e == "string" ? i(n, e.split(" ")) : Array.isArray(e) ? i(n, e) : Object.keys(e).forEach(function(n) {
|
|
327
|
+
Object.assign(r, V(e[n], t, n));
|
|
328
|
+
}), r;
|
|
329
|
+
function i(e, n) {
|
|
330
|
+
t && (n = n.map((e) => e.toLowerCase())), n.forEach(function(t) {
|
|
331
|
+
let n = t.split("|");
|
|
332
|
+
r[n[0]] = [e, ge(n[0], n[1])];
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
function ge(e, t) {
|
|
337
|
+
return t ? Number(t) : +!_e(e);
|
|
338
|
+
}
|
|
339
|
+
function _e(e) {
|
|
340
|
+
return me.includes(e.toLowerCase());
|
|
341
|
+
}
|
|
342
|
+
var H = {}, U = (e) => {
|
|
343
|
+
console.error(e);
|
|
344
|
+
}, W = (e, ...t) => {
|
|
345
|
+
console.log(`WARN: ${e}`, ...t);
|
|
346
|
+
}, G = (e, t) => {
|
|
347
|
+
H[`${e}/${t}`] || (console.log(`Deprecated as of ${e}. ${t}`), H[`${e}/${t}`] = !0);
|
|
348
|
+
}, K = /* @__PURE__ */ Error();
|
|
349
|
+
function q(e, t, { key: n }) {
|
|
350
|
+
let r = 0, i = e[n], a = {}, o = {};
|
|
351
|
+
for (let e = 1; e <= t.length; e++) o[e + r] = i[e], a[e + r] = !0, r += b(t[e - 1]);
|
|
352
|
+
e[n] = o, e[n]._emit = a, e[n]._multi = !0;
|
|
353
|
+
}
|
|
354
|
+
function ve(e) {
|
|
355
|
+
if (Array.isArray(e.begin)) {
|
|
356
|
+
if (e.skip || e.excludeBegin || e.returnBegin) throw U("skip, excludeBegin, returnBegin not compatible with beginScope: {}"), K;
|
|
357
|
+
if (typeof e.beginScope != "object" || e.beginScope === null) throw U("beginScope must be object"), K;
|
|
358
|
+
q(e, e.begin, { key: "beginScope" }), e.begin = S(e.begin, { joinWith: "" });
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
function ye(e) {
|
|
362
|
+
if (Array.isArray(e.end)) {
|
|
363
|
+
if (e.skip || e.excludeEnd || e.returnEnd) throw U("skip, excludeEnd, returnEnd not compatible with endScope: {}"), K;
|
|
364
|
+
if (typeof e.endScope != "object" || e.endScope === null) throw U("endScope must be object"), K;
|
|
365
|
+
q(e, e.end, { key: "endScope" }), e.end = S(e.end, { joinWith: "" });
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
function be(e) {
|
|
369
|
+
e.scope && typeof e.scope == "object" && e.scope !== null && (e.beginScope = e.scope, delete e.scope);
|
|
370
|
+
}
|
|
371
|
+
function xe(e) {
|
|
372
|
+
be(e), typeof e.beginScope == "string" && (e.beginScope = { _wrap: e.beginScope }), typeof e.endScope == "string" && (e.endScope = { _wrap: e.endScope }), ve(e), ye(e);
|
|
373
|
+
}
|
|
374
|
+
function Se(e) {
|
|
375
|
+
function t(t, n) {
|
|
376
|
+
return new RegExp(p(t), "m" + (e.case_insensitive ? "i" : "") + (e.unicodeRegex ? "u" : "") + (n ? "g" : ""));
|
|
377
|
+
}
|
|
378
|
+
class n {
|
|
379
|
+
constructor() {
|
|
380
|
+
this.matchIndexes = {}, this.regexes = [], this.matchAt = 1, this.position = 0;
|
|
381
|
+
}
|
|
382
|
+
addRule(e, t) {
|
|
383
|
+
t.position = this.position++, this.matchIndexes[this.matchAt] = t, this.regexes.push([t, e]), this.matchAt += b(e) + 1;
|
|
384
|
+
}
|
|
385
|
+
compile() {
|
|
386
|
+
this.regexes.length === 0 && (this.exec = () => null);
|
|
387
|
+
let e = this.regexes.map((e) => e[1]);
|
|
388
|
+
this.matcherRe = t(S(e, { joinWith: "|" }), !0), this.lastIndex = 0;
|
|
389
|
+
}
|
|
390
|
+
exec(e) {
|
|
391
|
+
this.matcherRe.lastIndex = this.lastIndex;
|
|
392
|
+
let t = this.matcherRe.exec(e);
|
|
393
|
+
if (!t) return null;
|
|
394
|
+
let n = t.findIndex((e, t) => t > 0 && e !== void 0), r = this.matchIndexes[n];
|
|
395
|
+
return t.splice(0, n), Object.assign(t, r);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
class r {
|
|
399
|
+
constructor() {
|
|
400
|
+
this.rules = [], this.multiRegexes = [], this.count = 0, this.lastIndex = 0, this.regexIndex = 0;
|
|
401
|
+
}
|
|
402
|
+
getMatcher(e) {
|
|
403
|
+
if (this.multiRegexes[e]) return this.multiRegexes[e];
|
|
404
|
+
let t = new n();
|
|
405
|
+
return this.rules.slice(e).forEach(([e, n]) => t.addRule(e, n)), t.compile(), this.multiRegexes[e] = t, t;
|
|
406
|
+
}
|
|
407
|
+
resumingScanAtSamePosition() {
|
|
408
|
+
return this.regexIndex !== 0;
|
|
409
|
+
}
|
|
410
|
+
considerAll() {
|
|
411
|
+
this.regexIndex = 0;
|
|
412
|
+
}
|
|
413
|
+
addRule(e, t) {
|
|
414
|
+
this.rules.push([e, t]), t.type === "begin" && this.count++;
|
|
415
|
+
}
|
|
416
|
+
exec(e) {
|
|
417
|
+
let t = this.getMatcher(this.regexIndex);
|
|
418
|
+
t.lastIndex = this.lastIndex;
|
|
419
|
+
let n = t.exec(e);
|
|
420
|
+
if (this.resumingScanAtSamePosition() && !(n && n.index === this.lastIndex)) {
|
|
421
|
+
let t = this.getMatcher(0);
|
|
422
|
+
t.lastIndex = this.lastIndex + 1, n = t.exec(e);
|
|
423
|
+
}
|
|
424
|
+
return n && (this.regexIndex += n.position + 1, this.regexIndex === this.count && this.considerAll()), n;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
function i(e) {
|
|
428
|
+
let t = new r();
|
|
429
|
+
return e.contains.forEach((e) => t.addRule(e.begin, {
|
|
430
|
+
rule: e,
|
|
431
|
+
type: "begin"
|
|
432
|
+
})), e.terminatorEnd && t.addRule(e.terminatorEnd, { type: "end" }), e.illegal && t.addRule(e.illegal, { type: "illegal" }), t;
|
|
433
|
+
}
|
|
434
|
+
function o(n, r) {
|
|
435
|
+
let a = n;
|
|
436
|
+
if (n.isCompiled) return a;
|
|
437
|
+
[
|
|
438
|
+
ce,
|
|
439
|
+
de,
|
|
440
|
+
xe,
|
|
441
|
+
pe
|
|
442
|
+
].forEach((e) => e(n, r)), e.compilerExtensions.forEach((e) => e(n, r)), n.__beforeBegin = null, [
|
|
443
|
+
le,
|
|
444
|
+
ue,
|
|
445
|
+
fe
|
|
446
|
+
].forEach((e) => e(n, r)), n.isCompiled = !0;
|
|
447
|
+
let s = null;
|
|
448
|
+
return typeof n.keywords == "object" && n.keywords.$pattern && (n.keywords = Object.assign({}, n.keywords), s = n.keywords.$pattern, delete n.keywords.$pattern), s ||= /\w+/, n.keywords &&= V(n.keywords, e.case_insensitive), a.keywordPatternRe = t(s, !0), r && (n.begin ||= /\B|\b/, a.beginRe = t(a.begin), !n.end && !n.endsWithParent && (n.end = /\B|\b/), n.end && (a.endRe = t(a.end)), a.terminatorEnd = p(a.end) || "", n.endsWithParent && r.terminatorEnd && (a.terminatorEnd += (n.end ? "|" : "") + r.terminatorEnd)), n.illegal && (a.illegalRe = t(n.illegal)), n.contains ||= [], n.contains = [].concat(...n.contains.map(function(e) {
|
|
449
|
+
return Ce(e === "self" ? n : e);
|
|
450
|
+
})), n.contains.forEach(function(e) {
|
|
451
|
+
o(e, a);
|
|
452
|
+
}), n.starts && o(n.starts, r), a.matcher = i(a), a;
|
|
453
|
+
}
|
|
454
|
+
if (e.compilerExtensions ||= [], e.contains && e.contains.includes("self")) throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");
|
|
455
|
+
return e.classNameAliases = a(e.classNameAliases || {}), o(e);
|
|
456
|
+
}
|
|
457
|
+
function J(e) {
|
|
458
|
+
return e ? e.endsWithParent || J(e.starts) : !1;
|
|
459
|
+
}
|
|
460
|
+
function Ce(e) {
|
|
461
|
+
return e.variants && !e.cachedVariants && (e.cachedVariants = e.variants.map(function(t) {
|
|
462
|
+
return a(e, { variants: null }, t);
|
|
463
|
+
})), e.cachedVariants ? e.cachedVariants : J(e) ? a(e, { starts: e.starts ? a(e.starts) : null }) : Object.isFrozen(e) ? a(e) : e;
|
|
464
|
+
}
|
|
465
|
+
var we = "11.11.1", Te = class extends Error {
|
|
466
|
+
constructor(e, t) {
|
|
467
|
+
super(e), this.name = "HTMLInjectionError", this.html = t;
|
|
468
|
+
}
|
|
469
|
+
}, Y = i, X = a, Z = Symbol("nomatch"), Ee = 7, Q = function(e) {
|
|
470
|
+
let t = Object.create(null), i = Object.create(null), a = [], o = !0, s = "Could not find the language '{}', did you forget to load/include a language module?", c = {
|
|
471
|
+
disableAutodetect: !0,
|
|
472
|
+
name: "Plain text",
|
|
473
|
+
contains: []
|
|
474
|
+
}, l = {
|
|
475
|
+
ignoreUnescapedHTML: !1,
|
|
476
|
+
throwUnescapedHTML: !1,
|
|
477
|
+
noHighlightRe: /^(no-?highlight)$/i,
|
|
478
|
+
languageDetectRe: /\blang(?:uage)?-([\w-]+)\b/i,
|
|
479
|
+
classPrefix: "hljs-",
|
|
480
|
+
cssSelector: "pre code",
|
|
481
|
+
languages: null,
|
|
482
|
+
__emitter: f
|
|
483
|
+
};
|
|
484
|
+
function u(e) {
|
|
485
|
+
return l.noHighlightRe.test(e);
|
|
486
|
+
}
|
|
487
|
+
function d(e) {
|
|
488
|
+
let t = e.className + " ";
|
|
489
|
+
t += e.parentNode ? e.parentNode.className : "";
|
|
490
|
+
let n = l.languageDetectRe.exec(t);
|
|
491
|
+
if (n) {
|
|
492
|
+
let t = M(n[1]);
|
|
493
|
+
return t || (W(s.replace("{}", n[1])), W("Falling back to no-highlight mode for this block.", e)), t ? n[1] : "no-highlight";
|
|
494
|
+
}
|
|
495
|
+
return t.split(/\s+/).find((e) => u(e) || M(e));
|
|
496
|
+
}
|
|
497
|
+
function p(e, t, n) {
|
|
498
|
+
let r = "", i = "";
|
|
499
|
+
typeof t == "object" ? (r = e, n = t.ignoreIllegals, i = t.language) : (G("10.7.0", "highlight(lang, code, ...args) has been deprecated."), G("10.7.0", "Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"), i = e, r = t), n === void 0 && (n = !0);
|
|
500
|
+
let a = {
|
|
501
|
+
code: r,
|
|
502
|
+
language: i
|
|
503
|
+
};
|
|
504
|
+
R("before:highlight", a);
|
|
505
|
+
let o = a.result ? a.result : v(a.language, a.code, n);
|
|
506
|
+
return o.code = a.code, R("after:highlight", o), o;
|
|
507
|
+
}
|
|
508
|
+
function v(e, n, i, a) {
|
|
509
|
+
let c = Object.create(null);
|
|
510
|
+
function u(e, t) {
|
|
511
|
+
return e.keywords[t];
|
|
512
|
+
}
|
|
513
|
+
function d() {
|
|
514
|
+
if (!k.keywords) {
|
|
515
|
+
j.addText(N);
|
|
516
|
+
return;
|
|
517
|
+
}
|
|
518
|
+
let e = 0;
|
|
519
|
+
k.keywordPatternRe.lastIndex = 0;
|
|
520
|
+
let t = k.keywordPatternRe.exec(N), n = "";
|
|
521
|
+
for (; t;) {
|
|
522
|
+
n += N.substring(e, t.index);
|
|
523
|
+
let r = E.case_insensitive ? t[0].toLowerCase() : t[0], i = u(k, r);
|
|
524
|
+
if (i) {
|
|
525
|
+
let [e, a] = i;
|
|
526
|
+
if (j.addText(n), n = "", c[r] = (c[r] || 0) + 1, c[r] <= Ee && (P += a), e.startsWith("_")) n += t[0];
|
|
527
|
+
else {
|
|
528
|
+
let n = E.classNameAliases[e] || e;
|
|
529
|
+
m(t[0], n);
|
|
530
|
+
}
|
|
531
|
+
} else n += t[0];
|
|
532
|
+
e = k.keywordPatternRe.lastIndex, t = k.keywordPatternRe.exec(N);
|
|
533
|
+
}
|
|
534
|
+
n += N.substring(e), j.addText(n);
|
|
535
|
+
}
|
|
536
|
+
function f() {
|
|
537
|
+
if (N === "") return;
|
|
538
|
+
let e = null;
|
|
539
|
+
if (typeof k.subLanguage == "string") {
|
|
540
|
+
if (!t[k.subLanguage]) {
|
|
541
|
+
j.addText(N);
|
|
542
|
+
return;
|
|
543
|
+
}
|
|
544
|
+
e = v(k.subLanguage, N, !0, A[k.subLanguage]), A[k.subLanguage] = e._top;
|
|
545
|
+
} else e = x(N, k.subLanguage.length ? k.subLanguage : null);
|
|
546
|
+
k.relevance > 0 && (P += e.relevance), j.__addSublanguage(e._emitter, e.language);
|
|
547
|
+
}
|
|
548
|
+
function p() {
|
|
549
|
+
k.subLanguage == null ? d() : f(), N = "";
|
|
550
|
+
}
|
|
551
|
+
function m(e, t) {
|
|
552
|
+
e !== "" && (j.startScope(t), j.addText(e), j.endScope());
|
|
553
|
+
}
|
|
554
|
+
function h(e, t) {
|
|
555
|
+
let n = 1, r = t.length - 1;
|
|
556
|
+
for (; n <= r;) {
|
|
557
|
+
if (!e._emit[n]) {
|
|
558
|
+
n++;
|
|
559
|
+
continue;
|
|
560
|
+
}
|
|
561
|
+
let r = E.classNameAliases[e[n]] || e[n], i = t[n];
|
|
562
|
+
r ? m(i, r) : (N = i, d(), N = ""), n++;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
function g(e, t) {
|
|
566
|
+
return e.scope && typeof e.scope == "string" && j.openNode(E.classNameAliases[e.scope] || e.scope), e.beginScope && (e.beginScope._wrap ? (m(N, E.classNameAliases[e.beginScope._wrap] || e.beginScope._wrap), N = "") : e.beginScope._multi && (h(e.beginScope, t), N = "")), k = Object.create(e, { parent: { value: k } }), k;
|
|
567
|
+
}
|
|
568
|
+
function _(e, t, n) {
|
|
569
|
+
let i = ee(e.endRe, n);
|
|
570
|
+
if (i) {
|
|
571
|
+
if (e["on:end"]) {
|
|
572
|
+
let n = new r(e);
|
|
573
|
+
e["on:end"](t, n), n.isMatchIgnored && (i = !1);
|
|
574
|
+
}
|
|
575
|
+
if (i) {
|
|
576
|
+
for (; e.endsParent && e.parent;) e = e.parent;
|
|
577
|
+
return e;
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
if (e.endsWithParent) return _(e.parent, t, n);
|
|
581
|
+
}
|
|
582
|
+
function y(e) {
|
|
583
|
+
return k.matcher.regexIndex === 0 ? (N += e[0], 1) : (L = !0, 0);
|
|
584
|
+
}
|
|
585
|
+
function b(e) {
|
|
586
|
+
let t = e[0], n = e.rule, i = new r(n), a = [n.__beforeBegin, n["on:begin"]];
|
|
587
|
+
for (let n of a) if (n && (n(e, i), i.isMatchIgnored)) return y(t);
|
|
588
|
+
return n.skip ? N += t : (n.excludeBegin && (N += t), p(), !n.returnBegin && !n.excludeBegin && (N = t)), g(n, e), n.returnBegin ? 0 : t.length;
|
|
589
|
+
}
|
|
590
|
+
function S(e) {
|
|
591
|
+
let t = e[0], r = n.substring(e.index), i = _(k, e, r);
|
|
592
|
+
if (!i) return Z;
|
|
593
|
+
let a = k;
|
|
594
|
+
k.endScope && k.endScope._wrap ? (p(), m(t, k.endScope._wrap)) : k.endScope && k.endScope._multi ? (p(), h(k.endScope, e)) : a.skip ? N += t : (a.returnEnd || a.excludeEnd || (N += t), p(), a.excludeEnd && (N = t));
|
|
595
|
+
do
|
|
596
|
+
k.scope && j.closeNode(), !k.skip && !k.subLanguage && (P += k.relevance), k = k.parent;
|
|
597
|
+
while (k !== i.parent);
|
|
598
|
+
return i.starts && g(i.starts, e), a.returnEnd ? 0 : t.length;
|
|
599
|
+
}
|
|
600
|
+
function C() {
|
|
601
|
+
let e = [];
|
|
602
|
+
for (let t = k; t !== E; t = t.parent) t.scope && e.unshift(t.scope);
|
|
603
|
+
e.forEach((e) => j.openNode(e));
|
|
604
|
+
}
|
|
605
|
+
let w = {};
|
|
606
|
+
function T(t, r) {
|
|
607
|
+
let a = r && r[0];
|
|
608
|
+
if (N += t, a == null) return p(), 0;
|
|
609
|
+
if (w.type === "begin" && r.type === "end" && w.index === r.index && a === "") {
|
|
610
|
+
if (N += n.slice(r.index, r.index + 1), !o) {
|
|
611
|
+
let t = /* @__PURE__ */ Error(`0 width match regex (${e})`);
|
|
612
|
+
throw t.languageName = e, t.badRule = w.rule, t;
|
|
613
|
+
}
|
|
614
|
+
return 1;
|
|
615
|
+
}
|
|
616
|
+
if (w = r, r.type === "begin") return b(r);
|
|
617
|
+
if (r.type === "illegal" && !i) {
|
|
618
|
+
let e = /* @__PURE__ */ Error("Illegal lexeme \"" + a + "\" for mode \"" + (k.scope || "<unnamed>") + "\"");
|
|
619
|
+
throw e.mode = k, e;
|
|
620
|
+
} else if (r.type === "end") {
|
|
621
|
+
let e = S(r);
|
|
622
|
+
if (e !== Z) return e;
|
|
623
|
+
}
|
|
624
|
+
if (r.type === "illegal" && a === "") return N += "\n", 1;
|
|
625
|
+
if (I > 1e5 && I > r.index * 3) throw /* @__PURE__ */ Error("potential infinite loop, way more iterations than matches");
|
|
626
|
+
return N += a, a.length;
|
|
627
|
+
}
|
|
628
|
+
let E = M(e);
|
|
629
|
+
if (!E) throw U(s.replace("{}", e)), Error("Unknown language: \"" + e + "\"");
|
|
630
|
+
let D = Se(E), O = "", k = a || D, A = {}, j = new l.__emitter(l);
|
|
631
|
+
C();
|
|
632
|
+
let N = "", P = 0, F = 0, I = 0, L = !1;
|
|
633
|
+
try {
|
|
634
|
+
if (E.__emitTokens) E.__emitTokens(n, j);
|
|
635
|
+
else {
|
|
636
|
+
for (k.matcher.considerAll();;) {
|
|
637
|
+
I++, L ? L = !1 : k.matcher.considerAll(), k.matcher.lastIndex = F;
|
|
638
|
+
let e = k.matcher.exec(n);
|
|
639
|
+
if (!e) break;
|
|
640
|
+
let t = T(n.substring(F, e.index), e);
|
|
641
|
+
F = e.index + t;
|
|
642
|
+
}
|
|
643
|
+
T(n.substring(F));
|
|
644
|
+
}
|
|
645
|
+
return j.finalize(), O = j.toHTML(), {
|
|
646
|
+
language: e,
|
|
647
|
+
value: O,
|
|
648
|
+
relevance: P,
|
|
649
|
+
illegal: !1,
|
|
650
|
+
_emitter: j,
|
|
651
|
+
_top: k
|
|
652
|
+
};
|
|
653
|
+
} catch (t) {
|
|
654
|
+
if (t.message && t.message.includes("Illegal")) return {
|
|
655
|
+
language: e,
|
|
656
|
+
value: Y(n),
|
|
657
|
+
illegal: !0,
|
|
658
|
+
relevance: 0,
|
|
659
|
+
_illegalBy: {
|
|
660
|
+
message: t.message,
|
|
661
|
+
index: F,
|
|
662
|
+
context: n.slice(F - 100, F + 100),
|
|
663
|
+
mode: t.mode,
|
|
664
|
+
resultSoFar: O
|
|
665
|
+
},
|
|
666
|
+
_emitter: j
|
|
667
|
+
};
|
|
668
|
+
if (o) return {
|
|
669
|
+
language: e,
|
|
670
|
+
value: Y(n),
|
|
671
|
+
illegal: !1,
|
|
672
|
+
relevance: 0,
|
|
673
|
+
errorRaised: t,
|
|
674
|
+
_emitter: j,
|
|
675
|
+
_top: k
|
|
676
|
+
};
|
|
677
|
+
throw t;
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
function b(e) {
|
|
681
|
+
let t = {
|
|
682
|
+
value: Y(e),
|
|
683
|
+
illegal: !1,
|
|
684
|
+
relevance: 0,
|
|
685
|
+
_top: c,
|
|
686
|
+
_emitter: new l.__emitter(l)
|
|
687
|
+
};
|
|
688
|
+
return t._emitter.addText(e), t;
|
|
689
|
+
}
|
|
690
|
+
function x(e, n) {
|
|
691
|
+
n = n || l.languages || Object.keys(t);
|
|
692
|
+
let r = b(e), i = n.filter(M).filter(P).map((t) => v(t, e, !1));
|
|
693
|
+
i.unshift(r);
|
|
694
|
+
let [a, o] = i.sort((e, t) => {
|
|
695
|
+
if (e.relevance !== t.relevance) return t.relevance - e.relevance;
|
|
696
|
+
if (e.language && t.language) {
|
|
697
|
+
if (M(e.language).supersetOf === t.language) return 1;
|
|
698
|
+
if (M(t.language).supersetOf === e.language) return -1;
|
|
699
|
+
}
|
|
700
|
+
return 0;
|
|
701
|
+
}), s = a;
|
|
702
|
+
return s.secondBest = o, s;
|
|
703
|
+
}
|
|
704
|
+
function S(e, t, n) {
|
|
705
|
+
let r = t && i[t] || n;
|
|
706
|
+
e.classList.add("hljs"), e.classList.add(`language-${r}`);
|
|
707
|
+
}
|
|
708
|
+
function C(e) {
|
|
709
|
+
let t = null, n = d(e);
|
|
710
|
+
if (u(n)) return;
|
|
711
|
+
if (R("before:highlightElement", {
|
|
712
|
+
el: e,
|
|
713
|
+
language: n
|
|
714
|
+
}), e.dataset.highlighted) {
|
|
715
|
+
console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.", e);
|
|
716
|
+
return;
|
|
717
|
+
}
|
|
718
|
+
if (e.children.length > 0 && (l.ignoreUnescapedHTML || (console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."), console.warn("https://github.com/highlightjs/highlight.js/wiki/security"), console.warn("The element with unescaped HTML:"), console.warn(e)), l.throwUnescapedHTML)) throw new Te("One of your code blocks includes unescaped HTML.", e.innerHTML);
|
|
719
|
+
t = e;
|
|
720
|
+
let r = t.textContent, i = n ? p(r, {
|
|
721
|
+
language: n,
|
|
722
|
+
ignoreIllegals: !0
|
|
723
|
+
}) : x(r);
|
|
724
|
+
e.innerHTML = i.value, e.dataset.highlighted = "yes", S(e, n, i.language), e.result = {
|
|
725
|
+
language: i.language,
|
|
726
|
+
re: i.relevance,
|
|
727
|
+
relevance: i.relevance
|
|
728
|
+
}, i.secondBest && (e.secondBest = {
|
|
729
|
+
language: i.secondBest.language,
|
|
730
|
+
relevance: i.secondBest.relevance
|
|
731
|
+
}), R("after:highlightElement", {
|
|
732
|
+
el: e,
|
|
733
|
+
result: i,
|
|
734
|
+
text: r
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
function w(e) {
|
|
738
|
+
l = X(l, e);
|
|
739
|
+
}
|
|
740
|
+
let T = () => {
|
|
741
|
+
O(), G("10.6.0", "initHighlighting() deprecated. Use highlightAll() now.");
|
|
742
|
+
};
|
|
743
|
+
function E() {
|
|
744
|
+
O(), G("10.6.0", "initHighlightingOnLoad() deprecated. Use highlightAll() now.");
|
|
745
|
+
}
|
|
746
|
+
let D = !1;
|
|
747
|
+
function O() {
|
|
748
|
+
function e() {
|
|
749
|
+
O();
|
|
750
|
+
}
|
|
751
|
+
if (document.readyState === "loading") {
|
|
752
|
+
D || window.addEventListener("DOMContentLoaded", e, !1), D = !0;
|
|
753
|
+
return;
|
|
754
|
+
}
|
|
755
|
+
document.querySelectorAll(l.cssSelector).forEach(C);
|
|
756
|
+
}
|
|
757
|
+
function k(n, r) {
|
|
758
|
+
let i = null;
|
|
759
|
+
try {
|
|
760
|
+
i = r(e);
|
|
761
|
+
} catch (e) {
|
|
762
|
+
if (U("Language definition for '{}' could not be registered.".replace("{}", n)), o) U(e);
|
|
763
|
+
else throw e;
|
|
764
|
+
i = c;
|
|
765
|
+
}
|
|
766
|
+
i.name ||= n, t[n] = i, i.rawDefinition = r.bind(null, e), i.aliases && N(i.aliases, { languageName: n });
|
|
767
|
+
}
|
|
768
|
+
function A(e) {
|
|
769
|
+
delete t[e];
|
|
770
|
+
for (let t of Object.keys(i)) i[t] === e && delete i[t];
|
|
771
|
+
}
|
|
772
|
+
function j() {
|
|
773
|
+
return Object.keys(t);
|
|
774
|
+
}
|
|
775
|
+
function M(e) {
|
|
776
|
+
return e = (e || "").toLowerCase(), t[e] || t[i[e]];
|
|
777
|
+
}
|
|
778
|
+
function N(e, { languageName: t }) {
|
|
779
|
+
typeof e == "string" && (e = [e]), e.forEach((e) => {
|
|
780
|
+
i[e.toLowerCase()] = t;
|
|
781
|
+
});
|
|
782
|
+
}
|
|
783
|
+
function P(e) {
|
|
784
|
+
let t = M(e);
|
|
785
|
+
return t && !t.disableAutodetect;
|
|
786
|
+
}
|
|
787
|
+
function F(e) {
|
|
788
|
+
e["before:highlightBlock"] && !e["before:highlightElement"] && (e["before:highlightElement"] = (t) => {
|
|
789
|
+
e["before:highlightBlock"](Object.assign({ block: t.el }, t));
|
|
790
|
+
}), e["after:highlightBlock"] && !e["after:highlightElement"] && (e["after:highlightElement"] = (t) => {
|
|
791
|
+
e["after:highlightBlock"](Object.assign({ block: t.el }, t));
|
|
792
|
+
});
|
|
793
|
+
}
|
|
794
|
+
function I(e) {
|
|
795
|
+
F(e), a.push(e);
|
|
796
|
+
}
|
|
797
|
+
function L(e) {
|
|
798
|
+
let t = a.indexOf(e);
|
|
799
|
+
t !== -1 && a.splice(t, 1);
|
|
800
|
+
}
|
|
801
|
+
function R(e, t) {
|
|
802
|
+
let n = e;
|
|
803
|
+
a.forEach(function(e) {
|
|
804
|
+
e[n] && e[n](t);
|
|
805
|
+
});
|
|
806
|
+
}
|
|
807
|
+
function z(e) {
|
|
808
|
+
return G("10.7.0", "highlightBlock will be removed entirely in v12.0"), G("10.7.0", "Please use highlightElement now."), C(e);
|
|
809
|
+
}
|
|
810
|
+
Object.assign(e, {
|
|
811
|
+
highlight: p,
|
|
812
|
+
highlightAuto: x,
|
|
813
|
+
highlightAll: O,
|
|
814
|
+
highlightElement: C,
|
|
815
|
+
highlightBlock: z,
|
|
816
|
+
configure: w,
|
|
817
|
+
initHighlighting: T,
|
|
818
|
+
initHighlightingOnLoad: E,
|
|
819
|
+
registerLanguage: k,
|
|
820
|
+
unregisterLanguage: A,
|
|
821
|
+
listLanguages: j,
|
|
822
|
+
getLanguage: M,
|
|
823
|
+
registerAliases: N,
|
|
824
|
+
autoDetection: P,
|
|
825
|
+
inherit: X,
|
|
826
|
+
addPlugin: I,
|
|
827
|
+
removePlugin: L
|
|
828
|
+
}), e.debugMode = function() {
|
|
829
|
+
o = !1;
|
|
830
|
+
}, e.safeMode = function() {
|
|
831
|
+
o = !0;
|
|
832
|
+
}, e.versionString = we, e.regex = {
|
|
833
|
+
concat: _,
|
|
834
|
+
lookahead: m,
|
|
835
|
+
either: y,
|
|
836
|
+
optional: g,
|
|
837
|
+
anyNumberOfTimes: h
|
|
838
|
+
};
|
|
839
|
+
for (let e in B) typeof B[e] == "object" && n(B[e]);
|
|
840
|
+
return Object.assign(e, B), e;
|
|
841
|
+
}, $ = Q({});
|
|
842
|
+
$.newInstance = () => Q({}), t.exports = $, $.HighlightJS = $, $.default = $;
|
|
843
|
+
})))())).default, r = {}, i = "hljs-";
|
|
844
|
+
function a(e) {
|
|
845
|
+
let t = n.newInstance();
|
|
846
|
+
return e && l(e), {
|
|
847
|
+
highlight: a,
|
|
848
|
+
highlightAuto: s,
|
|
849
|
+
listLanguages: c,
|
|
850
|
+
register: l,
|
|
851
|
+
registerAlias: u,
|
|
852
|
+
registered: d
|
|
853
|
+
};
|
|
854
|
+
function a(e, n, a) {
|
|
855
|
+
let s = a || r, c = typeof s.prefix == "string" ? s.prefix : i;
|
|
856
|
+
if (!t.getLanguage(e)) throw Error("Unknown language: `" + e + "` is not registered");
|
|
857
|
+
t.configure({
|
|
858
|
+
__emitter: o,
|
|
859
|
+
classPrefix: c
|
|
860
|
+
});
|
|
861
|
+
let l = t.highlight(n, {
|
|
862
|
+
ignoreIllegals: !0,
|
|
863
|
+
language: e
|
|
864
|
+
});
|
|
865
|
+
/* c8 ignore next 5 */
|
|
866
|
+
if (l.errorRaised) throw Error("Could not highlight with `Highlight.js`", { cause: l.errorRaised });
|
|
867
|
+
let u = l._emitter.root, d = u.data;
|
|
868
|
+
return d.language = l.language, d.relevance = l.relevance, u;
|
|
869
|
+
}
|
|
870
|
+
function s(e, n) {
|
|
871
|
+
let i = (n || r).subset || c(), o = -1, s = 0, l;
|
|
872
|
+
for (; ++o < i.length;) {
|
|
873
|
+
let r = i[o];
|
|
874
|
+
if (!t.getLanguage(r)) continue;
|
|
875
|
+
let c = a(r, e, n);
|
|
876
|
+
c.data && c.data.relevance !== void 0 && c.data.relevance > s && (s = c.data.relevance, l = c);
|
|
877
|
+
}
|
|
878
|
+
return l || {
|
|
879
|
+
type: "root",
|
|
880
|
+
children: [],
|
|
881
|
+
data: {
|
|
882
|
+
language: void 0,
|
|
883
|
+
relevance: s
|
|
884
|
+
}
|
|
885
|
+
};
|
|
886
|
+
}
|
|
887
|
+
function c() {
|
|
888
|
+
return t.listLanguages();
|
|
889
|
+
}
|
|
890
|
+
function l(e, n) {
|
|
891
|
+
if (typeof e == "string") t.registerLanguage(e, n);
|
|
892
|
+
else {
|
|
893
|
+
let n;
|
|
894
|
+
for (n in e) Object.hasOwn(e, n) && t.registerLanguage(n, e[n]);
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
function u(e, n) {
|
|
898
|
+
if (typeof e == "string") t.registerAliases(typeof n == "string" ? n : [...n], { languageName: e });
|
|
899
|
+
else {
|
|
900
|
+
let n;
|
|
901
|
+
for (n in e) if (Object.hasOwn(e, n)) {
|
|
902
|
+
let r = e[n];
|
|
903
|
+
t.registerAliases(typeof r == "string" ? r : [...r], { languageName: n });
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
function d(e) {
|
|
908
|
+
return !!t.getLanguage(e);
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
var o = class {
|
|
912
|
+
constructor(e) {
|
|
913
|
+
this.options = e, this.root = {
|
|
914
|
+
type: "root",
|
|
915
|
+
children: [],
|
|
916
|
+
data: {
|
|
917
|
+
language: void 0,
|
|
918
|
+
relevance: 0
|
|
919
|
+
}
|
|
920
|
+
}, this.stack = [this.root];
|
|
921
|
+
}
|
|
922
|
+
addText(e) {
|
|
923
|
+
if (e === "") return;
|
|
924
|
+
let t = this.stack[this.stack.length - 1], n = t.children[t.children.length - 1];
|
|
925
|
+
n && n.type === "text" ? n.value += e : t.children.push({
|
|
926
|
+
type: "text",
|
|
927
|
+
value: e
|
|
928
|
+
});
|
|
929
|
+
}
|
|
930
|
+
startScope(e) {
|
|
931
|
+
this.openNode(String(e));
|
|
932
|
+
}
|
|
933
|
+
endScope() {
|
|
934
|
+
this.closeNode();
|
|
935
|
+
}
|
|
936
|
+
__addSublanguage(e, t) {
|
|
937
|
+
let n = this.stack[this.stack.length - 1], r = e.root.children;
|
|
938
|
+
t ? n.children.push({
|
|
939
|
+
type: "element",
|
|
940
|
+
tagName: "span",
|
|
941
|
+
properties: { className: [t] },
|
|
942
|
+
children: r
|
|
943
|
+
}) : n.children.push(...r);
|
|
944
|
+
}
|
|
945
|
+
openNode(e) {
|
|
946
|
+
let t = this, n = e.split(".").map(function(e, n) {
|
|
947
|
+
return n ? e + "_".repeat(n) : t.options.classPrefix + e;
|
|
948
|
+
}), r = this.stack[this.stack.length - 1], i = {
|
|
949
|
+
type: "element",
|
|
950
|
+
tagName: "span",
|
|
951
|
+
properties: { className: n },
|
|
952
|
+
children: []
|
|
953
|
+
};
|
|
954
|
+
r.children.push(i), this.stack.push(i);
|
|
955
|
+
}
|
|
956
|
+
closeNode() {
|
|
957
|
+
this.stack.pop();
|
|
958
|
+
}
|
|
959
|
+
finalize() {}
|
|
960
|
+
toHTML() {
|
|
961
|
+
return "";
|
|
962
|
+
}
|
|
963
|
+
};
|
|
964
|
+
//#endregion
|
|
965
|
+
export { n, a as t };
|
|
966
|
+
|
|
967
|
+
//# sourceMappingURL=highlight-core-C0K6BIzZ.js.map
|