@andares/pdeditor 0.4.1 → 0.5.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/index.js CHANGED
@@ -1,338 +1,423 @@
1
- import { format as We, jsonToPdText as Ke, pdToJsonText as Ge } from "@andares/pdfoundation";
2
- function ye(n, a, { signal: e, edges: t } = {}) {
3
- let l, c = null;
4
- const v = t != null && t.includes("leading"), o = t == null || t.includes("trailing"), p = () => {
5
- c !== null && (n.apply(l, c), l = void 0, c = null);
6
- }, A = () => {
7
- o && p(), S();
1
+ import { hasLiteralColon as ke, matchKeyValue as we, findKeyValueSeparator as Ae, splitInlineCode as He } from "@andares/pdfoundation";
2
+ import { format as ut, jsonToPdText as ct, pdToJsonText as dt } from "@andares/pdfoundation";
3
+ function Ne(r, o, { signal: n, edges: t } = {}) {
4
+ let u, l = null;
5
+ const m = t != null && t.includes("leading"), c = t == null || t.includes("trailing"), k = () => {
6
+ l !== null && (r.apply(u, l), u = void 0, l = null);
7
+ }, P = () => {
8
+ c && k(), F();
8
9
  };
9
- let b = null;
10
- const k = () => {
11
- b != null && clearTimeout(b), b = setTimeout(() => {
12
- b = null, A();
13
- }, a);
10
+ let x = null;
11
+ const w = () => {
12
+ x != null && clearTimeout(x), x = setTimeout(() => {
13
+ x = null, P();
14
+ }, o);
14
15
  }, $ = () => {
15
- b !== null && (clearTimeout(b), b = null);
16
- }, S = () => {
17
- $(), l = void 0, c = null;
18
- }, w = () => {
19
- p();
20
- }, y = function(...f) {
21
- if (e != null && e.aborted) return;
22
- l = this, c = f;
23
- const x = b == null;
24
- k(), v && x && p();
16
+ x !== null && (clearTimeout(x), x = null);
17
+ }, F = () => {
18
+ $(), u = void 0, l = null;
19
+ }, E = () => {
20
+ k();
21
+ }, y = function(...p) {
22
+ if (n != null && n.aborted) return;
23
+ u = this, l = p;
24
+ const f = x == null;
25
+ w(), m && f && k();
25
26
  };
26
- return y.schedule = k, y.cancel = S, y.flush = w, e == null || e.addEventListener("abort", S, { once: !0 }), y;
27
+ return y.schedule = w, y.cancel = F, y.flush = E, n == null || n.addEventListener("abort", F, { once: !0 }), y;
27
28
  }
28
- const ne = { position: "relative", boxSizing: "border-box", overflow: "hidden", fontSize: "16px", fontFamily: 'Menlo, Consolas, "Liberation Mono", Monaco, "Lucida Console", monospace' }, be = { lineHeight: "inherit", whiteSpace: "pre-wrap", wordBreak: "keep-all", overflowWrap: "break-word", background: "none", position: "absolute", width: "100%", height: "100%", zIndex: "1", resize: "none", caretColor: "currentColor", padding: "inherit", outline: "none", fontSize: "inherit", fontFamily: "inherit", letterSpacing: "inherit", boxSizing: "border-box", border: "none", top: "0px", left: "0px", color: "inherit", overflow: "hidden", "-webkit-font-smoothing": "antialiased", "-webkit-text-fill-color": "transparent" }, xe = { lineHeight: "inherit", position: "relative", whiteSpace: "pre-wrap", wordBreak: "keep-all", padding: "0", width: "100%", margin: "0", pointerEvents: "none", boxSizing: "border-box", overflowWrap: "break-word", fontFamily: "inherit" }, ke = { lineHeight: "inherit", position: "absolute", width: "100%", height: "100%", whiteSpace: "pre-wrap", wordBreak: "keep-all", padding: "inherit", margin: "0", top: "0px", left: "0px", pointerEvents: "none", boxSizing: "border-box", overflowWrap: "break-word", fontFamily: "inherit" }, ge = (n) => pe(n);
29
- function re(n) {
30
- const a = Array.isArray(n) ? n : [n];
31
- return a.length === 0 ? ge : (e) => a.reduce((t, l, c) => l(t, { html: c > 0 }), e);
29
+ function be(r, o) {
30
+ const n = r, t = n.key.toLowerCase(), u = o.split("+"), l = u.slice(0, -1), m = u[u.length - 1];
31
+ return !(t !== m || l.includes("shift") !== n.shiftKey || l.includes("ctrl") !== n.ctrlKey || l.includes("alt") !== n.altKey || l.includes("meta") !== n.metaKey);
32
32
  }
33
- class we {
34
- constructor(a, e = {}) {
35
- if (this.lines = null, !a) throw new Error("selector is not defined");
36
- if (this.root = a instanceof Node ? a : document.querySelector(a), !this.root) throw new Error(`element with "${a}" selector is not exist`);
37
- const t = { value: "", styles: {}, plugins: [], highlighter: ge }, { highlighters: l, ...c } = e;
38
- this.options = { ...t, ...c, highlighter: l ? re(l) : t.highlighter }, this.options.value = this.options.value == null ? "" : String(this.options.value), this.init();
39
- }
40
- init() {
41
- this.textarea = document.createElement("textarea"), this.textarea.setAttribute("spellcheck", "false"), this.textarea.setAttribute("autocapitalize", "off"), this.textarea.setAttribute("autocorrect", "off"), this.textarea.setAttribute("autocomplete", "off"), this.pre = document.createElement("pre");
42
- const a = Object.keys(ne).concat(Object.keys(this.options.styles)).concat(["paddingLeft"]);
43
- this.initialRootStyles = {};
44
- const e = this.root.style;
45
- a.forEach((t) => {
46
- this.initialRootStyles[t] = e[t] || "";
47
- }), Object.assign(this.root.style, ne, this.options.styles), Object.assign(this.textarea.style, be), Object.assign(this.pre.style, xe), this.basePaddingLeft = this.root.style.paddingLeft || "", this.root.appendChild(this.textarea), this.root.appendChild(this.pre), this.addTextareaEvents(), this.update({ value: this.options.value }), this.updateLines();
48
- }
49
- addTextareaEvents() {
50
- this.handleEvent = (a) => {
51
- if (a.type === "keydown" && this.textarea.readOnly) return;
52
- const e = a;
53
- if (e.isComposing || e.keyCode === 229) return;
54
- const t = (function(l, c) {
55
- const { value: v, selectionStart: o, selectionEnd: p } = c.target;
56
- return l.reduce((A, b) => ({ ...A, ...b(A, c) }), { value: v, selectionStart: o, selectionEnd: p });
57
- })(this.options.plugins, a);
58
- this.update(t);
59
- }, this.textarea.addEventListener("input", this.handleEvent), this.textarea.addEventListener("keydown", this.handleEvent), this.textarea.addEventListener("compositionend", this.handleEvent);
60
- }
61
- update(a) {
62
- if (!this.textarea) return;
63
- let { value: e, selectionStart: t, selectionEnd: l } = a;
64
- e != null && (e = String(e), t == null && (t = this.textarea.selectionStart), l == null && (l = this.textarea.selectionEnd), this.textarea.value !== e && (this.textarea.value = e)), t != null && (this.textarea.selectionStart = t), l != null && (this.textarea.selectionEnd = l), e !== this.value && e != null && (this.value = e, this.render(), this.updateCallback && this.updateCallback(e));
65
- }
66
- updateOptions(a) {
67
- if (!this.textarea) return;
68
- const { highlighters: e, ...t } = a;
69
- if (this.options = { ...this.options, ...t, highlighter: e ? re(e) : this.options.highlighter }, a.styles) {
70
- const l = this.root.style;
71
- Object.keys(a.styles).forEach((c) => {
72
- c in this.initialRootStyles || (this.initialRootStyles[c] = l[c] || "");
73
- }), Object.assign(this.root.style, a.styles), ("paddingLeft" in a.styles || "padding" in a.styles) && (this.basePaddingLeft = this.root.style.paddingLeft || "");
74
- }
75
- this.lines && !this.options.lineNumbers && (N(this.lines), this.lines = null, this.root.style.paddingLeft = this.basePaddingLeft), a.value != null && this.update({ value: a.value }), this.render();
76
- }
77
- render() {
78
- const a = this.options.highlighter(this.value);
79
- this.pre.innerHTML = a + "<br/>", this.updateLines();
80
- }
81
- updateLines() {
82
- if (!this.options.lineNumbers) return;
83
- this.lines || (this.lines = document.createElement("pre"), this.root.appendChild(this.lines), Object.assign(this.lines.style, ke));
84
- const a = this.value.split(`
85
- `), e = a.length.toString().length;
86
- this.root.style.paddingLeft = `${e + 1}ch`, this.lines.innerHTML = a.map((t, l) => `${`<span class="yace-line" style="position: absolute; opacity: .3; left: 0; width: ${e}ch; text-align: right">${1 + l}</span>`}${`<span style="color: transparent; pointer-events: none">${pe(t)}</span>`}`).join(`
87
- `);
88
- }
89
- destroy() {
90
- this.textarea && (this.textarea.removeEventListener("input", this.handleEvent), this.textarea.removeEventListener("keydown", this.handleEvent), this.textarea.removeEventListener("compositionend", this.handleEvent), N(this.textarea), N(this.pre), N(this.lines), Object.assign(this.root.style, this.initialRootStyles), Object.assign(this, { textarea: null, pre: null, lines: null, updateCallback: null, handleEvent: null, initialRootStyles: null, options: null, root: null }));
91
- }
92
- onUpdate(a) {
93
- this.updateCallback = a;
94
- }
95
- }
96
- function N(n) {
97
- n && n.parentNode && n.parentNode.removeChild(n);
98
- }
99
- function pe(n) {
100
- return n.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
101
- }
102
- function B(n, a) {
103
- const e = n, t = e.key.toLowerCase(), l = a.split("+"), c = l.slice(0, -1), v = l[l.length - 1];
104
- return !(t !== v || c.includes("shift") !== e.shiftKey || c.includes("ctrl") !== e.ctrlKey || c.includes("alt") !== e.altKey || c.includes("meta") !== e.metaKey);
105
- }
106
- function ae(n, a) {
107
- var l;
108
- const t = n.slice(0, a).split(`
33
+ function Se(r, o) {
34
+ var u;
35
+ const t = r.slice(0, o).split(`
109
36
  `);
110
- return { line: t.length - 1, col: ((l = t[t.length - 1]) == null ? void 0 : l.length) ?? 0 };
37
+ return { line: t.length - 1, col: ((u = t[t.length - 1]) == null ? void 0 : u.length) ?? 0 };
111
38
  }
112
- function W(n, a, e) {
113
- var l;
39
+ function ce(r, o, n) {
40
+ var u;
114
41
  let t = 0;
115
- for (let c = 0; c < a; c++) t += (((l = n[c]) == null ? void 0 : l.length) ?? 0) + 1;
116
- return t + e;
42
+ for (let l = 0; l < o; l++) t += (((u = r[l]) == null ? void 0 : u.length) ?? 0) + 1;
43
+ return t + n;
117
44
  }
118
- function Se() {
119
- return (n, a) => {
120
- var A;
121
- if (a.type !== "keydown" || !B(a, "enter")) return;
122
- const { value: e, selectionStart: t, selectionEnd: l } = n, c = e.slice(0, t).split(`
123
- `).pop() ?? "", v = ((A = /^\s*/.exec(c)) == null ? void 0 : A[0]) ?? "";
124
- a.preventDefault();
125
- const o = /^(\s*)-(?=\s|$)/.test(c), p = `
126
- ${v}${o ? "- " : ""}`;
45
+ function Ee() {
46
+ return (r, o) => {
47
+ var P;
48
+ if (o.type !== "keydown" || !be(o, "enter")) return;
49
+ const { value: n, selectionStart: t, selectionEnd: u } = r, l = n.slice(0, t).split(`
50
+ `).pop() ?? "", m = ((P = /^\s*/.exec(l)) == null ? void 0 : P[0]) ?? "";
51
+ o.preventDefault();
52
+ const c = /^(\s*)-(?=[ ]|$)/.test(l), k = `
53
+ ${m}${c ? "- " : ""}`;
127
54
  return {
128
- value: e.slice(0, t) + p + e.slice(l),
129
- selectionStart: t + p.length,
130
- selectionEnd: t + p.length
55
+ value: n.slice(0, t) + k + n.slice(u),
56
+ selectionStart: t + k.length,
57
+ selectionEnd: t + k.length
131
58
  };
132
59
  };
133
60
  }
134
- function Ee(n) {
135
- return /^(\s*)-(?=\s|$)/.test(n);
61
+ function qe(r) {
62
+ return /^(\s*)-(?=[ ]|$)/.test(r);
136
63
  }
137
- function ie(n, a) {
138
- return n.startsWith(a) ? a.length : n.startsWith(" ") ? 1 : 0;
64
+ function $e(r, o) {
65
+ return r.startsWith(o) ? o.length : r.startsWith(" ") ? 1 : 0;
139
66
  }
140
- function $e(n) {
141
- return (a, e) => {
142
- if (e.type !== "keydown") return;
143
- const { value: t, selectionStart: l, selectionEnd: c } = a, v = t.split(`
144
- `), o = t.slice(0, l).split(`
145
- `).length - 1, p = t.slice(0, c).split(`
146
- `).length - 1, A = ae(t, l), b = ae(t, c);
147
- if (B(e, "shift+tab")) {
148
- e.preventDefault();
149
- const k = v.map(
150
- (f, x) => x >= o && x <= p ? f.slice(ie(f, n)) : f
151
- ), $ = k.join(`
67
+ function Fe(r) {
68
+ return (o, n) => {
69
+ if (n.type !== "keydown") return;
70
+ const { value: t, selectionStart: u, selectionEnd: l } = o, m = t.split(`
71
+ `), c = t.slice(0, u).split(`
72
+ `).length - 1, k = t.slice(0, l).split(`
73
+ `).length - 1, P = Se(t, u), x = Se(t, l);
74
+ if (be(n, "shift+tab")) {
75
+ n.preventDefault();
76
+ const w = m.map(
77
+ (p, f) => f >= c && f <= k ? p.slice($e(p, r)) : p
78
+ ), $ = w.join(`
152
79
  `);
153
80
  if ($ === t) return;
154
- const S = (f) => {
155
- const x = ie(v[f.line] ?? "", n);
156
- return { line: f.line, col: Math.max(0, f.col - x) };
157
- }, w = S(A), y = S(b);
81
+ const F = (p) => {
82
+ const f = $e(m[p.line] ?? "", r);
83
+ return { line: p.line, col: Math.max(0, p.col - f) };
84
+ }, E = F(P), y = F(x);
158
85
  return {
159
86
  value: $,
160
- selectionStart: W(k, w.line, w.col),
161
- selectionEnd: W(k, y.line, y.col)
87
+ selectionStart: ce(w, E.line, E.col),
88
+ selectionEnd: ce(w, y.line, y.col)
162
89
  };
163
90
  }
164
- if (B(e, "tab")) {
165
- e.preventDefault();
166
- const k = v.map((w, y) => ({ l: w, i: y })).filter(({ i: w }) => w >= o && w <= p);
167
- if (k.length > 0 && k.every(({ l: w }) => Ee(w)) || l !== c) {
168
- const w = v.map(
169
- (r, u) => u >= o && u <= p && r !== "" ? n + r : r
170
- ), y = w.join(`
171
- `), f = (r) => {
172
- const u = v[r.line] ?? "", d = r.line >= o && r.line <= p;
91
+ if (be(n, "tab")) {
92
+ n.preventDefault();
93
+ const w = m.map((E, y) => ({ l: E, i: y })).filter(({ i: E }) => E >= c && E <= k);
94
+ if (w.length > 0 && w.every(({ l: E }) => qe(E)) || u !== l) {
95
+ const E = m.map(
96
+ (i, s) => s >= c && s <= k && i !== "" ? r + i : i
97
+ ), y = E.join(`
98
+ `), p = (i) => {
99
+ const s = m[i.line] ?? "", g = i.line >= c && i.line <= k;
173
100
  return {
174
- line: r.line,
175
- col: d && u !== "" ? r.col + n.length : r.col
101
+ line: i.line,
102
+ col: g && s !== "" ? i.col + r.length : i.col
176
103
  };
177
- }, x = f(A), i = f(b);
104
+ }, f = p(P), e = p(x);
178
105
  return {
179
106
  value: y,
180
- selectionStart: W(w, x.line, x.col),
181
- selectionEnd: W(w, i.line, i.col)
107
+ selectionStart: ce(E, f.line, f.col),
108
+ selectionEnd: ce(E, e.line, e.col)
182
109
  };
183
110
  }
184
- const S = l + n.length;
111
+ const F = u + r.length;
185
112
  return {
186
- value: t.slice(0, l) + n + t.slice(c),
187
- selectionStart: S,
188
- selectionEnd: S
113
+ value: t.slice(0, u) + r + t.slice(l),
114
+ selectionStart: F,
115
+ selectionEnd: F
189
116
  };
190
117
  }
191
118
  };
192
119
  }
193
- function Ae(n) {
194
- return n.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
120
+ function ve(r) {
121
+ return r.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
122
+ }
123
+ function J(r) {
124
+ return r.replace(/\r\n?/g, `
125
+ `);
195
126
  }
196
- function Fe(n, a) {
197
- const e = Math.min(n.length, a.length);
127
+ function Be(r, o) {
128
+ const n = document.createRange();
129
+ n.selectNodeContents(r), r.replaceChildren(n.createContextualFragment(o));
130
+ }
131
+ function Ke(r, o) {
132
+ const n = Math.min(r.length, o.length);
198
133
  let t = 0;
199
- for (; t < e && n.charCodeAt(t) === a.charCodeAt(t); ) t++;
134
+ for (; t < n && r.charCodeAt(t) === o.charCodeAt(t); ) t++;
200
135
  return t;
201
136
  }
202
- function Le(n, a, e) {
203
- let t = a.language ?? "pd";
204
- const l = a.onValueChange;
205
- let c = !1;
206
- const v = a.indentUnit ?? " ", o = new we(n, {
207
- value: a.value ?? "",
208
- lineNumbers: a.lineNumbers ?? !1,
209
- styles: a.styles ?? {},
210
- highlighters: [
211
- a.highlight ? (s) => {
212
- var g;
213
- return ((g = a.highlight) == null ? void 0 : g.call(a, s, t)) ?? "";
214
- } : e(t)
215
- ],
216
- // 编辑行为:pd 语义插件(续行补 `- `/保留缩进、序列项行 Tab 整行缩进/缩出)。
217
- // 撤销/重做不在此接入 Yace history 插件(初始快照缺陷),由组件自实现(见下)。
218
- plugins: [Se(), $e(v)]
219
- });
220
- o.onUpdate((s) => {
221
- c || (r(s), l == null || l(s));
137
+ const We = /* @__PURE__ */ new Set([
138
+ "padding",
139
+ "paddingTop",
140
+ "paddingRight",
141
+ "paddingBottom",
142
+ "paddingLeft"
143
+ ]);
144
+ function Le(r) {
145
+ var t;
146
+ const o = {
147
+ top: "0px",
148
+ right: "0px",
149
+ bottom: "0px",
150
+ left: "0px"
151
+ }, n = (t = r.padding) == null ? void 0 : t.trim();
152
+ if (n) {
153
+ const u = n.split(/\s+/);
154
+ if (u.length === 1) {
155
+ const l = u[0] ?? "0px";
156
+ o.top = o.right = o.bottom = o.left = l;
157
+ } else u.length === 2 ? (o.top = o.bottom = u[0] ?? "0px", o.right = o.left = u[1] ?? "0px") : u.length === 3 ? (o.top = u[0] ?? "0px", o.right = o.left = u[1] ?? "0px", o.bottom = u[2] ?? "0px") : (o.top = u[0] ?? "0px", o.right = u[1] ?? "0px", o.bottom = u[2] ?? "0px", o.left = u[3] ?? "0px");
158
+ }
159
+ return r.paddingTop && (o.top = r.paddingTop), r.paddingRight && (o.right = r.paddingRight), r.paddingBottom && (o.bottom = r.paddingBottom), r.paddingLeft && (o.left = r.paddingLeft), o;
160
+ }
161
+ function Ge(r) {
162
+ return r.startsWith("--") ? r : r.replace(/[A-Z]/g, (o) => `-${o.toLowerCase()}`);
163
+ }
164
+ const Ce = "position:relative;display:block;box-sizing:border-box;width:100%;height:auto;max-height:inherit;overflow:hidden;text-align:start;margin:0;border:0;font-family:var(--pd-font-family,inherit);font-size:var(--pd-font-size,inherit);line-height:var(--pd-line-height,1.5);letter-spacing:var(--pd-letter-spacing,inherit);color:var(--pd-color,inherit);background:var(--pd-background,transparent);tab-size:4;font-variant-ligatures:none;font-kerning:normal;", Te = "position:absolute;left:0;top:0;width:100%;height:100%;box-sizing:border-box;margin:0;border:0;outline:none;resize:none;background:transparent;-webkit-text-fill-color:transparent;caret-color:var(--pd-caret-color,currentColor);overflow:auto;scrollbar-gutter:stable;white-space:pre-wrap;overflow-wrap:break-word;word-break:normal;font:inherit;line-height:inherit;letter-spacing:inherit;tab-size:inherit;z-index:2;", _e = "position:relative;left:auto;top:auto;width:100%;height:auto;box-sizing:border-box;margin:0;border:0;overflow:hidden;scrollbar-gutter:stable;pointer-events:none;user-select:none;white-space:pre-wrap;overflow-wrap:break-word;word-break:normal;font:inherit;line-height:inherit;letter-spacing:inherit;tab-size:inherit;color:inherit;z-index:1;", Ze = "position:absolute;left:0;top:0;width:100%;height:100%;box-sizing:border-box;margin:0;border:0;overflow:hidden;scrollbar-gutter:stable;pointer-events:none;user-select:none;white-space:pre-wrap;overflow-wrap:break-word;word-break:normal;font:inherit;line-height:inherit;letter-spacing:inherit;tab-size:inherit;color:inherit;z-index:0;", Pe = "position:absolute;left:0;top:0;width:100%;height:100%;box-sizing:border-box;margin:0;border:0;overflow:hidden;scrollbar-gutter:stable;pointer-events:none;user-select:none;white-space:pre-wrap;overflow-wrap:break-word;word-break:normal;font:inherit;line-height:inherit;letter-spacing:inherit;tab-size:inherit;color:inherit;opacity:var(--pd-placeholder-opacity,0.5);z-index:1;";
165
+ function de(r, o, n, t, u = {}) {
166
+ const l = document.createElement(r);
167
+ l.className = o, l.setAttribute("part", n), l.style.cssText = t;
168
+ for (const [m, c] of Object.entries(u)) l.setAttribute(m, c);
169
+ return l;
170
+ }
171
+ function Ve(r, o, n) {
172
+ let t = { ...o }, u = t.language ?? "pd", l = J(t.value ?? ""), m = l, c = !1, k = !1, P = !1, x = t.lineNumbers ?? !1, w = V(), $ = "", F = !1, E = 0, y = null;
173
+ const p = de("div", "pd-root", "root", Ce), f = de("pre", "pd-highlight", "highlight", _e, {
174
+ "aria-hidden": "true"
175
+ }), e = de("textarea", "pd-input", "input", Te), i = de("div", "pd-placeholder", "placeholder", Pe, {
176
+ "aria-hidden": "true"
222
177
  });
223
- const p = o.textarea;
224
- let A = !1;
225
- const b = () => {
226
- A = !0;
227
- }, k = () => {
228
- A = !1;
229
- }, $ = () => {
230
- A && (c = !0, o.update({
231
- value: p.value,
232
- selectionStart: p.selectionStart,
233
- selectionEnd: p.selectionEnd
234
- }), c = !1);
235
- };
236
- p.addEventListener("compositionstart", b), p.addEventListener("compositionend", k), p.addEventListener("input", $);
237
- const S = 5, w = [
238
- { value: o.value, selStart: -1, selEnd: -1 }
239
- ], y = [], f = () => {
240
- w.length > S + 1 && w.splice(1, 1);
241
- }, i = ye((s) => {
242
- const g = w[0];
243
- if (g !== void 0 && g.selStart < 0 && g.value !== s.value) {
244
- const h = Fe(g.value, s.value);
245
- g.selStart = h, g.selEnd = h;
178
+ let s = null;
179
+ e.spellcheck = t.spellcheck ?? !1, e.setAttribute("autocapitalize", "off"), e.setAttribute("autocorrect", "off"), e.setAttribute("autocomplete", "off"), e.setAttribute("wrap", "soft"), e.value = l, e.readOnly = t.readOnly ?? !1, e.disabled = t.disabled ?? !1, ((a) => {
180
+ a !== void 0 && a >= 0 ? e.maxLength = a : e.removeAttribute("maxlength");
181
+ })(t.maxLength), t.dir && (e.dir = t.dir), oe(), p.appendChild(f), p.appendChild(i), p.appendChild(e), r.appendChild(p), le(), Y(), I(), h();
182
+ function d() {
183
+ c || (f.scrollTop = e.scrollTop, f.scrollLeft = e.scrollLeft, s && (s.scrollTop = e.scrollTop, s.scrollLeft = e.scrollLeft));
184
+ }
185
+ function b() {
186
+ if (typeof getComputedStyle != "function") return 0;
187
+ const a = getComputedStyle(r), v = Number.parseFloat(a.paddingTop) || 0, A = Number.parseFloat(a.paddingBottom) || 0;
188
+ return Math.max(0, r.clientHeight - v - A);
189
+ }
190
+ function S() {
191
+ F ? (f.style.position = "absolute", f.style.left = "0", f.style.top = "0", f.style.height = "100%") : (f.style.position = "relative", f.style.left = "auto", f.style.top = "auto", f.style.height = "auto");
192
+ }
193
+ function h() {
194
+ if (c) return;
195
+ const a = b(), v = f.scrollHeight;
196
+ if (!F) {
197
+ a > 0 && v > a + 1 && (F = !0, S(), p.style.height = `${a}px`, d());
198
+ return;
246
199
  }
247
- const m = w.at(-1);
248
- m !== void 0 && m.value === s.value || (y.length = 0, w.push(s), f());
249
- }, 1e3), r = (s) => {
250
- const g = p.selectionStart, m = p.selectionEnd;
251
- i({ value: s, selStart: g, selEnd: m });
252
- }, u = (s) => {
253
- const g = s.selStart >= 0 ? s.selStart : s.value.length, m = s.selEnd >= 0 ? s.selEnd : s.value.length;
254
- c = !0, o.update({
255
- value: s.value,
256
- selectionStart: g,
257
- selectionEnd: m
258
- }), p.value === s.value && p.setSelectionRange(g, m), c = !1;
259
- }, d = (s) => {
260
- const g = s.ctrlKey || s.metaKey, m = s.key.toLowerCase();
261
- if (!g || m !== "z" && m !== "y") return;
262
- if (m === "y" || m === "z" && s.shiftKey) {
263
- if (i.flush(), y.length === 0) return;
264
- s.preventDefault();
265
- const E = y.pop();
266
- E !== void 0 && (w.push(E), f(), u(E));
267
- } else {
268
- if (i.flush(), w.length <= 1) return;
269
- s.preventDefault();
270
- const E = w.pop();
271
- E !== void 0 && y.push(E);
272
- const F = w.at(-1);
273
- F !== void 0 && u(F);
200
+ if (a <= 0 || v <= a + 1) {
201
+ F = !1, S(), p.style.height = "", e.scrollTop = 0;
202
+ return;
274
203
  }
275
- };
276
- return p.addEventListener("keydown", d), {
277
- setValue(s) {
278
- c = !0, o.update({ value: s }), c = !1;
204
+ const A = Number.parseFloat(p.style.height) || 0;
205
+ Math.abs(A - a) > 0.5 && (p.style.height = `${a}px`), d();
206
+ }
207
+ function T() {
208
+ if (!E) {
209
+ if (typeof requestAnimationFrame != "function") {
210
+ h();
211
+ return;
212
+ }
213
+ E = requestAnimationFrame(() => {
214
+ E = 0, h();
215
+ });
216
+ }
217
+ }
218
+ typeof ResizeObserver < "u" && (y = new ResizeObserver(() => T()), y.observe(r), y.observe(p));
219
+ const R = () => d(), H = (a, v, A) => {
220
+ var C;
221
+ l = a, m = a, ne({ value: a, selStart: v, selEnd: A }), (C = t.onValueChange) == null || C.call(t, a);
222
+ }, Q = (a) => {
223
+ if (c) return;
224
+ const v = J(e.value);
225
+ if (k || a != null && a.isComposing) {
226
+ l = v, I();
227
+ return;
228
+ }
229
+ v !== l && (l = v, I()), v !== m && H(v, e.selectionStart, e.selectionEnd);
230
+ }, ee = () => {
231
+ k = !0;
232
+ }, ie = () => {
233
+ k = !1;
234
+ const a = J(e.value);
235
+ a !== l && (l = a, I());
236
+ }, ge = Math.max(0, t.historyLimit ?? 5), te = Math.max(0, t.historyDebounce ?? 1e3), L = [
237
+ { value: l, selStart: -1, selEnd: -1 }
238
+ ], z = [], N = () => {
239
+ L.length > ge + 1 && L.splice(1, 1);
240
+ }, W = (a) => {
241
+ const v = L[0];
242
+ if (v !== void 0 && v.selStart < 0 && v.value !== a.value) {
243
+ const C = Ke(v.value, a.value);
244
+ v.selStart = C, v.selEnd = C;
245
+ }
246
+ const A = L.at(-1);
247
+ A !== void 0 && A.value === a.value || (z.length = 0, L.push(a), N());
248
+ }, D = Ne(W, te), ne = (a) => {
249
+ te === 0 ? W(a) : D(a);
250
+ }, j = (a) => {
251
+ var C;
252
+ const v = a.selStart >= 0 ? a.selStart : Math.min(a.value.length, e.selectionStart), A = a.selEnd >= 0 ? a.selEnd : v;
253
+ l = a.value, m = a.value, e.value = a.value, e.setSelectionRange(
254
+ Math.max(0, Math.min(v, a.value.length)),
255
+ Math.max(0, Math.min(A, a.value.length))
256
+ ), I(), d(), (C = t.onValueChange) == null || C.call(t, a.value);
257
+ }, K = () => {
258
+ if (D.flush(), L.length <= 1) return !1;
259
+ const a = L.pop();
260
+ a !== void 0 && z.push(a);
261
+ const v = L.at(-1);
262
+ return v !== void 0 && j(v), !0;
263
+ }, G = () => {
264
+ if (D.flush(), z.length === 0) return !1;
265
+ const a = z.pop();
266
+ return a === void 0 ? !1 : (L.push(a), N(), j(a), !0);
267
+ }, Z = (a) => {
268
+ var O;
269
+ if (c || a.isComposing || k || e.readOnly || e.disabled) return;
270
+ const v = a.ctrlKey || a.metaKey, A = a.key.toLowerCase();
271
+ if (v && (A === "z" || A === "y")) {
272
+ a.preventDefault(), A === "y" || A === "z" && a.shiftKey ? G() : K();
273
+ return;
274
+ }
275
+ if (A === "escape") {
276
+ (t.tabBehavior ?? "indent") === "indent" && (P = !0);
277
+ return;
278
+ }
279
+ if (A === "tab" && (t.tabBehavior ?? "indent") === "focus") return;
280
+ if (A === "tab" && P) {
281
+ P = !1;
282
+ return;
283
+ }
284
+ const C = {
285
+ value: l,
286
+ selectionStart: e.selectionStart,
287
+ selectionEnd: e.selectionEnd
288
+ };
289
+ let _ = C;
290
+ for (const U of fe) {
291
+ const q = U(_, a);
292
+ q && (_ = { ..._, ...q });
293
+ }
294
+ (_.value !== C.value || _.selectionStart !== C.selectionStart || _.selectionEnd !== C.selectionEnd) && (a.preventDefault(), l = _.value, e.value = _.value, e.setSelectionRange(_.selectionStart, _.selectionEnd), m = _.value, I(), ne({
295
+ value: _.value,
296
+ selStart: _.selectionStart,
297
+ selEnd: _.selectionEnd
298
+ }), (O = t.onValueChange) == null || O.call(t, _.value), d());
299
+ }, X = () => p.classList.add("pd-focused"), re = () => p.classList.remove("pd-focused");
300
+ e.addEventListener("input", Q), e.addEventListener("compositionstart", ee), e.addEventListener("compositionend", ie), e.addEventListener("scroll", R, { passive: !0 }), e.addEventListener("keydown", Z), e.addEventListener("focus", X), e.addEventListener("blur", re);
301
+ function V() {
302
+ return t.highlight ? (a) => {
303
+ var v;
304
+ return ((v = t.highlight) == null ? void 0 : v.call(t, a, u)) ?? "";
305
+ } : n(u);
306
+ }
307
+ function I() {
308
+ if (c) return;
309
+ const a = t.highlightThreshold ?? 1e5, v = l.length > a ? ve(l) : w(l);
310
+ Be(f, `${v}<br/>`), x && se(), Y(), y || T();
311
+ }
312
+ function se() {
313
+ if (!x) return;
314
+ s || (s = document.createElement("pre"), s.className = "pd-lines", s.setAttribute("part", "gutter"), s.setAttribute("aria-hidden", "true"), p.insertBefore(s, i));
315
+ const a = l.split(`
316
+ `), A = `${String(a.length).length + 1}ch`, C = Le(t.styles ?? {}), _ = `position:absolute;inset-inline-start:${C.left};width:${A};text-align:end;opacity:var(--pd-gutter-opacity,0.35);color:var(--pd-gutter-color,inherit)`, O = document.createDocumentFragment();
317
+ a.forEach((U, q) => {
318
+ const ue = document.createElement("span");
319
+ ue.className = "pd-ln", ue.style.cssText = _, ue.textContent = String(q + 1);
320
+ const he = document.createElement("span");
321
+ he.style.color = "transparent", he.textContent = U, O.append(ue, he), q < a.length - 1 && O.append(document.createTextNode(`
322
+ `));
323
+ }), O.append(document.createElement("br")), s.replaceChildren(O), A !== $ && ($ = A, le(), s.style.cssText = xe(C));
324
+ }
325
+ function Y() {
326
+ const a = t.placeholder ?? "";
327
+ i.textContent = a, i.style.display = a && l.length === 0 ? "block" : "none", a ? e.setAttribute("aria-placeholder", a) : e.removeAttribute("aria-placeholder");
328
+ }
329
+ function ye(a) {
330
+ const v = $ ? `calc(${a.left} + ${$})` : a.left;
331
+ return `padding:${a.top} ${a.right} ${a.bottom} ${v};`;
332
+ }
333
+ function pe(a, v) {
334
+ return v + ye(a);
335
+ }
336
+ function xe(a) {
337
+ return Ze + ye(a);
338
+ }
339
+ function le() {
340
+ const a = t.styles ?? {}, v = Le(a), A = Object.entries(a).filter(([C]) => !We.has(C)).map(([C, _]) => `${Ge(C)}:${_};`).join("");
341
+ p.style.cssText = Ce + A, f.style.cssText = pe(v, _e), e.style.cssText = pe(v, Te), i.style.cssText = pe(v, Pe), s && (s.style.cssText = xe(v)), S(), t.dir && (p.dir = t.dir, e.dir = t.dir, f.dir = t.dir, i.dir = t.dir, s && (s.dir = t.dir));
342
+ }
343
+ function oe() {
344
+ t.ariaLabel ? e.setAttribute("aria-label", t.ariaLabel) : e.removeAttribute("aria-label"), t.ariaLabelledby ? e.setAttribute("aria-labelledby", t.ariaLabelledby) : e.removeAttribute("aria-labelledby"), t.ariaDescribedby ? e.setAttribute("aria-describedby", t.ariaDescribedby) : e.removeAttribute("aria-describedby"), t.readOnly ? e.setAttribute("aria-readonly", "true") : e.removeAttribute("aria-readonly"), t.disabled ? e.setAttribute("aria-disabled", "true") : e.removeAttribute("aria-disabled");
345
+ }
346
+ x && se();
347
+ const fe = [Ee(), Fe(t.indentUnit ?? " ")];
348
+ return {
349
+ setValue(a, v) {
350
+ if (c || k) return;
351
+ let A = J(a);
352
+ t.maxLength !== void 0 && t.maxLength >= 0 && (A = A.slice(0, t.maxLength)), D.cancel(), l = A, m = A, e.value = A, e.setSelectionRange(A.length, A.length), ((v == null ? void 0 : v.resetHistory) ?? !0) && (L.length = 0, L.push({ value: A, selStart: -1, selEnd: -1 }), z.length = 0), I(), d();
279
353
  },
280
354
  getValue() {
281
- return o.value;
355
+ return l;
282
356
  },
283
- setLanguage(s) {
284
- t = s, o.updateOptions({
285
- highlighters: [
286
- a.highlight ? (g) => {
287
- var m;
288
- return ((m = a.highlight) == null ? void 0 : m.call(a, g, t)) ?? "";
289
- } : e(t)
290
- ]
291
- });
357
+ setLanguage(a) {
358
+ u = a, t = { ...t, language: a }, w = V(), I();
359
+ },
360
+ setPlaceholder(a) {
361
+ t = { ...t, placeholder: a }, Y();
362
+ },
363
+ setReadOnly(a) {
364
+ t = { ...t, readOnly: a }, e.readOnly = a, oe();
365
+ },
366
+ setDisabled(a) {
367
+ t = { ...t, disabled: a }, e.disabled = a, oe();
368
+ },
369
+ setLineNumbers(a) {
370
+ x !== a && (x = a, !a && s && (s.remove(), s = null, $ = ""), le(), I());
371
+ },
372
+ update(a) {
373
+ c || (t = { ...t, ...a }, a.indentUnit !== void 0 && fe.splice(0, fe.length, Ee(), Fe(a.indentUnit)), a.language !== void 0 && (u = a.language), ("highlight" in a || a.language !== void 0) && (w = V()), a.lineNumbers !== void 0 && (x = a.lineNumbers, !x && s && (s.remove(), s = null, $ = "")), a.value !== void 0 && (l = J(a.value), m = l, e.value = l, L.length = 0, L.push({ value: l, selStart: -1, selEnd: -1 }), z.length = 0), a.readOnly !== void 0 && (e.readOnly = a.readOnly), a.disabled !== void 0 && (e.disabled = a.disabled), a.maxLength !== void 0 && (a.maxLength >= 0 ? e.maxLength = a.maxLength : e.removeAttribute("maxlength")), a.spellcheck !== void 0 && (e.spellcheck = a.spellcheck), a.dir !== void 0 && (e.dir = a.dir), oe(), le(), I(), d());
374
+ },
375
+ focus() {
376
+ e.focus();
377
+ },
378
+ blur() {
379
+ e.blur();
380
+ },
381
+ undo() {
382
+ K();
383
+ },
384
+ redo() {
385
+ G();
386
+ },
387
+ insertText(a) {
388
+ var U;
389
+ if (c || e.readOnly || e.disabled) return;
390
+ const v = e.selectionStart, A = e.selectionEnd;
391
+ let C = J(a);
392
+ if (t.maxLength !== void 0 && t.maxLength >= 0) {
393
+ const q = t.maxLength - (l.length - (A - v));
394
+ if (q <= 0) return;
395
+ C.length > q && (C = C.slice(0, q));
396
+ }
397
+ const _ = l.slice(0, v) + C + l.slice(A);
398
+ l = _, m = _, e.value = _;
399
+ const O = v + C.length;
400
+ e.setSelectionRange(O, O), I(), ne({ value: _, selStart: O, selEnd: O }), (U = t.onValueChange) == null || U.call(t, _), d();
401
+ },
402
+ getSelection() {
403
+ return { start: e.selectionStart, end: e.selectionEnd };
404
+ },
405
+ setSelection(a, v = a) {
406
+ const A = (C) => Math.max(0, Math.min(l.length, Number.isFinite(C) ? C : 0));
407
+ e.setSelectionRange(A(a), A(v));
292
408
  },
293
409
  destroy() {
294
- i.cancel(), p.removeEventListener("compositionstart", b), p.removeEventListener("compositionend", k), p.removeEventListener("input", $), p.removeEventListener("keydown", d), o.destroy();
410
+ c || (c = !0, D.cancel(), y == null || y.disconnect(), E && typeof cancelAnimationFrame == "function" && cancelAnimationFrame(E), e.removeEventListener("input", Q), e.removeEventListener("compositionstart", ee), e.removeEventListener("compositionend", ie), e.removeEventListener("scroll", R), e.removeEventListener("keydown", Z), e.removeEventListener("focus", X), e.removeEventListener("blur", re), p.remove());
295
411
  },
296
- textarea: p
412
+ textarea: e,
413
+ root: p,
414
+ pre: f
297
415
  };
298
416
  }
299
- function J(n) {
300
- const a = [];
301
- let e = "", t = !1;
302
- for (const l of n)
303
- l === "`" ? t ? (a.push({ code: !0, seg: e + "`" }), e = "", t = !1) : (e && a.push({ code: !1, seg: e }), e = "`", t = !0) : e += l;
304
- return e && a.push({ code: !1, seg: e }), a;
305
- }
306
- function Y(n) {
307
- for (const { code: a, seg: e } of J(n))
308
- if (!a && (e.includes(":-") || e.includes(":-")))
309
- return !0;
310
- return !1;
311
- }
312
- function V(n) {
313
- let a = 0;
314
- for (const { code: e, seg: t } of J(n)) {
315
- if (!e) {
316
- const l = t.indexOf(":");
317
- if (l !== -1) return a + l;
318
- }
319
- a += t.length;
320
- }
321
- return -1;
417
+ function M(r) {
418
+ return r.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
322
419
  }
323
- function se(n) {
324
- if (Y(n)) return null;
325
- const a = V(n);
326
- if (a <= 0) return null;
327
- const e = n.slice(0, a), t = n.slice(a + 1);
328
- if (/\s$/.test(e) || t !== "" && !/^\s/.test(t)) return null;
329
- const l = t.trim();
330
- return { key: e.trim(), value: l === "" ? void 0 : l };
331
- }
332
- function C(n) {
333
- return n.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
334
- }
335
- const P = {
420
+ const B = {
336
421
  key: "pd-key",
337
422
  keyPunct: "pd-key-punct",
338
423
  item: "pd-item",
@@ -342,81 +427,81 @@ const P = {
342
427
  inlineCode: "pd-inline-code",
343
428
  fence: "pd-fence"
344
429
  };
345
- function Ce(n) {
346
- return `<span class="${P.inlineCode}">${C(n)}</span>`;
430
+ function Ye(r) {
431
+ return `<span class="${B.inlineCode}">${M(r)}</span>`;
347
432
  }
348
- const le = /(?:^|\s):([^\s-][^\s]*)(?=\s|$)/g;
349
- function _e(n) {
350
- let a = "", e = 0;
351
- le.lastIndex = 0;
433
+ const Re = /(?:^|\s):([^\s-][^\s]*)(?=\s|$)/g;
434
+ function Ue(r) {
435
+ let o = "", n = 0;
436
+ Re.lastIndex = 0;
352
437
  let t;
353
- for (; (t = le.exec(n)) !== null; ) {
354
- const l = /^\s/.test(t[0]) ? 1 : 0, c = t.index + l;
355
- a += C(n.slice(e, c)), a += `<span class="${P.ref}">${C(n.slice(c, t.index + t[0].length))}</span>`, e = t.index + t[0].length;
438
+ for (; (t = Re.exec(r)) !== null; ) {
439
+ const u = /^\s/.test(t[0]) ? 1 : 0, l = t.index + u;
440
+ o += M(r.slice(n, l)), o += `<span class="${B.ref}">${M(r.slice(l, t.index + t[0].length))}</span>`, n = t.index + t[0].length;
356
441
  }
357
- return a += C(n.slice(e)), a;
442
+ return o += M(r.slice(n)), o;
358
443
  }
359
- function D(n) {
360
- let a = "";
361
- for (const { code: e, seg: t } of J(n))
362
- a += e ? Ce(t) : _e(t);
363
- return a;
444
+ function ae(r) {
445
+ let o = "";
446
+ for (const { code: n, seg: t } of He(r))
447
+ o += n ? Ye(t) : Ue(t);
448
+ return o;
364
449
  }
365
- function oe(n, a, e, t) {
366
- const l = `<span class="${P.key}">${D(e)}</span>`, c = `<span class="${P.keyPunct}">:</span>`;
367
- return `${n}${a}${l}${c}${D(t)}`;
450
+ function ze(r, o, n, t) {
451
+ const u = `<span class="${B.key}">${ae(n)}</span>`, l = `<span class="${B.keyPunct}">:</span>`;
452
+ return `${r}${o}${u}${l}${ae(t)}`;
368
453
  }
369
- function Te(n) {
370
- const a = n.trim();
371
- if (/^\/\/!pd(?:\s+[^\s]+)?$/.test(a)) {
372
- const t = /^(\s*)(\/\/!pd)(\s*.*)$/.exec(n), l = (t == null ? void 0 : t[1]) ?? "", c = (t == null ? void 0 : t[2]) ?? "//!pd", v = (t == null ? void 0 : t[3]) ?? "";
373
- return `${C(l)}<span class="${P.section}">${C(c)}</span>${D(v)}`;
454
+ function Xe(r) {
455
+ const o = r.trim();
456
+ if (/^\/\/!pd(?:\s+[^\s]+)?$/.test(o)) {
457
+ const t = /^(\s*)(\/\/!pd)(\s*.*)$/.exec(r), u = (t == null ? void 0 : t[1]) ?? "", l = (t == null ? void 0 : t[2]) ?? "//!pd", m = (t == null ? void 0 : t[3]) ?? "";
458
+ return `${M(u)}<span class="${B.section}">${M(l)}</span>${ae(m)}`;
374
459
  }
375
- if (a === "---")
376
- return `<span class="${P.sep}">${C(n)}</span>`;
377
- const e = /^(\s*)(-)(?=\s|$)/.exec(n);
378
- if (e) {
379
- const t = C(e[1] ?? ""), l = (e[1] ?? "").length + 1, c = n.slice(l), v = c.trimStart(), o = c.slice(0, c.length - v.length), p = `<span class="${P.item}">-</span>`;
380
- if (!Y(v) && se(v)) {
381
- const b = V(v), k = v.slice(0, b), $ = v.slice(b + 1);
382
- return `${t}${p}${C(o)}${oe("", "", k, $)}`;
460
+ if (o === "---")
461
+ return `<span class="${B.sep}">${M(r)}</span>`;
462
+ const n = /^(\s*)(-)(?=[ ]|$)/.exec(r);
463
+ if (n) {
464
+ const t = M(n[1] ?? ""), u = (n[1] ?? "").length + 1, l = r.slice(u), m = l.trimStart(), c = l.slice(0, l.length - m.length), k = `<span class="${B.item}">-</span>`;
465
+ if (!ke(m) && we(m)) {
466
+ const x = Ae(m), w = m.slice(0, x), $ = m.slice(x + 1);
467
+ return `${t}${k}${M(c)}${ze("", "", w, $)}`;
383
468
  }
384
- return `${t}${p}${C(o)}${D(v)}`;
469
+ return `${t}${k}${M(c)}${ae(m)}`;
385
470
  }
386
- if (!Y(a) && se(a)) {
387
- const l = n.length - n.trimStart().length, c = n.slice(l), v = V(c), o = c.slice(0, v).trim(), p = c.slice(v + 1);
388
- return oe(C(n.slice(0, l)), "", o, p);
471
+ if (!ke(o) && we(o)) {
472
+ const u = r.length - r.trimStart().length, l = r.slice(u), m = Ae(l), c = l.slice(0, m).trim(), k = l.slice(m + 1);
473
+ return ze(M(r.slice(0, u)), "", c, k);
389
474
  }
390
- return D(n);
475
+ return ae(r);
391
476
  }
392
- function Pe(n) {
393
- const a = n.split(`
477
+ function Je(r) {
478
+ const o = r.split(`
394
479
  `);
395
- let e = !1;
480
+ let n = !1;
396
481
  const t = [];
397
- for (const l of a) {
398
- const c = l.trimStart();
399
- if (e) {
400
- c.startsWith("```") ? (e = !1, t.push(`<span class="${P.fence}">${C(l)}</span>`)) : t.push(C(l));
482
+ for (const u of o) {
483
+ const l = u.trimStart();
484
+ if (n) {
485
+ l.startsWith("```") ? (n = !1, t.push(`<span class="${B.fence}">${M(u)}</span>`)) : t.push(M(u));
401
486
  continue;
402
487
  }
403
- if (c.startsWith("```")) {
404
- e = !0, t.push(`<span class="${P.fence}">${C(l)}</span>`);
488
+ if (l.startsWith("```")) {
489
+ n = !0, t.push(`<span class="${B.fence}">${M(u)}</span>`);
405
490
  continue;
406
491
  }
407
- t.push(Te(l));
492
+ t.push(Xe(u));
408
493
  }
409
494
  return t.join(`
410
495
  `);
411
496
  }
412
- var ue = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
413
- function Ie(n) {
414
- return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
497
+ var De = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
498
+ function Qe(r) {
499
+ return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
415
500
  }
416
- var U = { exports: {} }, ce;
417
- function Re() {
418
- return ce || (ce = 1, (function(n) {
419
- var a = typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {};
501
+ var me = { exports: {} }, Ie;
502
+ function et() {
503
+ return Ie || (Ie = 1, (function(r) {
504
+ var o = typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {};
420
505
  /**
421
506
  * Prism: Lightweight, robust, elegant syntax highlighting
422
507
  *
@@ -425,8 +510,8 @@ function Re() {
425
510
  * @namespace
426
511
  * @public
427
512
  */
428
- var e = (function(t) {
429
- var l = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, c = 0, v = {}, o = {
513
+ var n = (function(t) {
514
+ var u = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, l = 0, m = {}, c = {
430
515
  /**
431
516
  * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
432
517
  * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
@@ -481,8 +566,8 @@ function Re() {
481
566
  * @memberof Prism
482
567
  */
483
568
  util: {
484
- encode: function i(r) {
485
- return r instanceof p ? new p(r.type, i(r.content), r.alias) : Array.isArray(r) ? r.map(i) : r.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/\u00a0/g, " ");
569
+ encode: function e(i) {
570
+ return i instanceof k ? new k(i.type, e(i.content), i.alias) : Array.isArray(i) ? i.map(e) : i.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/\u00a0/g, " ");
486
571
  },
487
572
  /**
488
573
  * Returns the name of the type of the given value.
@@ -500,8 +585,8 @@ function Re() {
500
585
  * type(String) === 'Function'
501
586
  * type(/abc+/) === 'RegExp'
502
587
  */
503
- type: function(i) {
504
- return Object.prototype.toString.call(i).slice(8, -1);
588
+ type: function(e) {
589
+ return Object.prototype.toString.call(e).slice(8, -1);
505
590
  },
506
591
  /**
507
592
  * Returns a unique number for the given object. Later calls will still return the same number.
@@ -509,8 +594,8 @@ function Re() {
509
594
  * @param {Object} obj
510
595
  * @returns {number}
511
596
  */
512
- objId: function(i) {
513
- return i.__id || Object.defineProperty(i, "__id", { value: ++c }), i.__id;
597
+ objId: function(e) {
598
+ return e.__id || Object.defineProperty(e, "__id", { value: ++l }), e.__id;
514
599
  },
515
600
  /**
516
601
  * Creates a deep clone of the given object.
@@ -522,30 +607,30 @@ function Re() {
522
607
  * @returns {T}
523
608
  * @template T
524
609
  */
525
- clone: function i(r, u) {
526
- u = u || {};
527
- var d, s;
528
- switch (o.util.type(r)) {
610
+ clone: function e(i, s) {
611
+ s = s || {};
612
+ var g, d;
613
+ switch (c.util.type(i)) {
529
614
  case "Object":
530
- if (s = o.util.objId(r), u[s])
531
- return u[s];
532
- d = /** @type {Record<string, any>} */
533
- {}, u[s] = d;
534
- for (var g in r)
535
- r.hasOwnProperty(g) && (d[g] = i(r[g], u));
615
+ if (d = c.util.objId(i), s[d])
616
+ return s[d];
617
+ g = /** @type {Record<string, any>} */
618
+ {}, s[d] = g;
619
+ for (var b in i)
620
+ i.hasOwnProperty(b) && (g[b] = e(i[b], s));
536
621
  return (
537
622
  /** @type {any} */
538
- d
623
+ g
539
624
  );
540
625
  case "Array":
541
- return s = o.util.objId(r), u[s] ? u[s] : (d = [], u[s] = d, /** @type {Array} */
626
+ return d = c.util.objId(i), s[d] ? s[d] : (g = [], s[d] = g, /** @type {Array} */
542
627
  /** @type {any} */
543
- r.forEach(function(m, h) {
544
- d[h] = i(m, u);
628
+ i.forEach(function(S, h) {
629
+ g[h] = e(S, s);
545
630
  }), /** @type {any} */
546
- d);
631
+ g);
547
632
  default:
548
- return r;
633
+ return i;
549
634
  }
550
635
  },
551
636
  /**
@@ -556,12 +641,12 @@ function Re() {
556
641
  * @param {Element} element
557
642
  * @returns {string}
558
643
  */
559
- getLanguage: function(i) {
560
- for (; i; ) {
561
- var r = l.exec(i.className);
562
- if (r)
563
- return r[1].toLowerCase();
564
- i = i.parentElement;
644
+ getLanguage: function(e) {
645
+ for (; e; ) {
646
+ var i = u.exec(e.className);
647
+ if (i)
648
+ return i[1].toLowerCase();
649
+ e = e.parentElement;
565
650
  }
566
651
  return "none";
567
652
  },
@@ -572,8 +657,8 @@ function Re() {
572
657
  * @param {string} language
573
658
  * @returns {void}
574
659
  */
575
- setLanguage: function(i, r) {
576
- i.className = i.className.replace(RegExp(l, "gi"), ""), i.classList.add("language-" + r);
660
+ setLanguage: function(e, i) {
661
+ e.className = e.className.replace(RegExp(u, "gi"), ""), e.classList.add("language-" + i);
577
662
  },
578
663
  /**
579
664
  * Returns the script element that is currently executing.
@@ -592,13 +677,13 @@ function Re() {
592
677
  );
593
678
  try {
594
679
  throw new Error();
595
- } catch (d) {
596
- var i = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(d.stack) || [])[1];
597
- if (i) {
598
- var r = document.getElementsByTagName("script");
599
- for (var u in r)
600
- if (r[u].src == i)
601
- return r[u];
680
+ } catch (g) {
681
+ var e = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(g.stack) || [])[1];
682
+ if (e) {
683
+ var i = document.getElementsByTagName("script");
684
+ for (var s in i)
685
+ if (i[s].src == e)
686
+ return i[s];
602
687
  }
603
688
  return null;
604
689
  }
@@ -622,16 +707,16 @@ function Re() {
622
707
  * @param {boolean} [defaultActivation=false]
623
708
  * @returns {boolean}
624
709
  */
625
- isActive: function(i, r, u) {
626
- for (var d = "no-" + r; i; ) {
627
- var s = i.classList;
628
- if (s.contains(r))
710
+ isActive: function(e, i, s) {
711
+ for (var g = "no-" + i; e; ) {
712
+ var d = e.classList;
713
+ if (d.contains(i))
629
714
  return !0;
630
- if (s.contains(d))
715
+ if (d.contains(g))
631
716
  return !1;
632
- i = i.parentElement;
717
+ e = e.parentElement;
633
718
  }
634
- return !!u;
719
+ return !!s;
635
720
  }
636
721
  },
637
722
  /**
@@ -645,10 +730,10 @@ function Re() {
645
730
  /**
646
731
  * The grammar for plain, unformatted text.
647
732
  */
648
- plain: v,
649
- plaintext: v,
650
- text: v,
651
- txt: v,
733
+ plain: m,
734
+ plaintext: m,
735
+ text: m,
736
+ txt: m,
652
737
  /**
653
738
  * Creates a deep copy of the language with the given id and appends the given tokens.
654
739
  *
@@ -677,11 +762,11 @@ function Re() {
677
762
  * 'color': /\b(?:red|green|blue)\b/
678
763
  * });
679
764
  */
680
- extend: function(i, r) {
681
- var u = o.util.clone(o.languages[i]);
682
- for (var d in r)
683
- u[d] = r[d];
684
- return u;
765
+ extend: function(e, i) {
766
+ var s = c.util.clone(c.languages[e]);
767
+ for (var g in i)
768
+ s[g] = i[g];
769
+ return s;
685
770
  },
686
771
  /**
687
772
  * Inserts tokens _before_ another token in a language definition or any other grammar.
@@ -758,31 +843,31 @@ function Re() {
758
843
  * @returns {Grammar} The new grammar object.
759
844
  * @public
760
845
  */
761
- insertBefore: function(i, r, u, d) {
762
- d = d || /** @type {any} */
763
- o.languages;
764
- var s = d[i], g = {};
765
- for (var m in s)
766
- if (s.hasOwnProperty(m)) {
767
- if (m == r)
768
- for (var h in u)
769
- u.hasOwnProperty(h) && (g[h] = u[h]);
770
- u.hasOwnProperty(m) || (g[m] = s[m]);
846
+ insertBefore: function(e, i, s, g) {
847
+ g = g || /** @type {any} */
848
+ c.languages;
849
+ var d = g[e], b = {};
850
+ for (var S in d)
851
+ if (d.hasOwnProperty(S)) {
852
+ if (S == i)
853
+ for (var h in s)
854
+ s.hasOwnProperty(h) && (b[h] = s[h]);
855
+ s.hasOwnProperty(S) || (b[S] = d[S]);
771
856
  }
772
- var E = d[i];
773
- return d[i] = g, o.languages.DFS(o.languages, function(F, I) {
774
- I === E && F != i && (this[F] = g);
775
- }), g;
857
+ var T = g[e];
858
+ return g[e] = b, c.languages.DFS(c.languages, function(R, H) {
859
+ H === T && R != e && (this[R] = b);
860
+ }), b;
776
861
  },
777
862
  // Traverse a language definition with Depth First Search
778
- DFS: function i(r, u, d, s) {
779
- s = s || {};
780
- var g = o.util.objId;
781
- for (var m in r)
782
- if (r.hasOwnProperty(m)) {
783
- u.call(r, m, r[m], d || m);
784
- var h = r[m], E = o.util.type(h);
785
- E === "Object" && !s[g(h)] ? (s[g(h)] = !0, i(h, u, null, s)) : E === "Array" && !s[g(h)] && (s[g(h)] = !0, i(h, u, m, s));
863
+ DFS: function e(i, s, g, d) {
864
+ d = d || {};
865
+ var b = c.util.objId;
866
+ for (var S in i)
867
+ if (i.hasOwnProperty(S)) {
868
+ s.call(i, S, i[S], g || S);
869
+ var h = i[S], T = c.util.type(h);
870
+ T === "Object" && !d[b(h)] ? (d[b(h)] = !0, e(h, s, null, d)) : T === "Array" && !d[b(h)] && (d[b(h)] = !0, e(h, s, S, d));
786
871
  }
787
872
  }
788
873
  },
@@ -799,8 +884,8 @@ function Re() {
799
884
  * @memberof Prism
800
885
  * @public
801
886
  */
802
- highlightAll: function(i, r) {
803
- o.highlightAllUnder(document, i, r);
887
+ highlightAll: function(e, i) {
888
+ c.highlightAllUnder(document, e, i);
804
889
  },
805
890
  /**
806
891
  * Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
@@ -817,15 +902,15 @@ function Re() {
817
902
  * @memberof Prism
818
903
  * @public
819
904
  */
820
- highlightAllUnder: function(i, r, u) {
821
- var d = {
822
- callback: u,
823
- container: i,
905
+ highlightAllUnder: function(e, i, s) {
906
+ var g = {
907
+ callback: s,
908
+ container: e,
824
909
  selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
825
910
  };
826
- o.hooks.run("before-highlightall", d), d.elements = Array.prototype.slice.apply(d.container.querySelectorAll(d.selector)), o.hooks.run("before-all-elements-highlight", d);
827
- for (var s = 0, g; g = d.elements[s++]; )
828
- o.highlightElement(g, r === !0, d.callback);
911
+ c.hooks.run("before-highlightall", g), g.elements = Array.prototype.slice.apply(g.container.querySelectorAll(g.selector)), c.hooks.run("before-all-elements-highlight", g);
912
+ for (var d = 0, b; b = g.elements[d++]; )
913
+ c.highlightElement(b, i === !0, g.callback);
829
914
  },
830
915
  /**
831
916
  * Highlights the code inside a single element.
@@ -855,39 +940,39 @@ function Re() {
855
940
  * @memberof Prism
856
941
  * @public
857
942
  */
858
- highlightElement: function(i, r, u) {
859
- var d = o.util.getLanguage(i), s = o.languages[d];
860
- o.util.setLanguage(i, d);
861
- var g = i.parentElement;
862
- g && g.nodeName.toLowerCase() === "pre" && o.util.setLanguage(g, d);
863
- var m = i.textContent, h = {
864
- element: i,
865
- language: d,
866
- grammar: s,
867
- code: m
943
+ highlightElement: function(e, i, s) {
944
+ var g = c.util.getLanguage(e), d = c.languages[g];
945
+ c.util.setLanguage(e, g);
946
+ var b = e.parentElement;
947
+ b && b.nodeName.toLowerCase() === "pre" && c.util.setLanguage(b, g);
948
+ var S = e.textContent, h = {
949
+ element: e,
950
+ language: g,
951
+ grammar: d,
952
+ code: S
868
953
  };
869
- function E(I) {
870
- h.highlightedCode = I, o.hooks.run("before-insert", h), h.element.innerHTML = h.highlightedCode, o.hooks.run("after-highlight", h), o.hooks.run("complete", h), u && u.call(h.element);
954
+ function T(H) {
955
+ h.highlightedCode = H, c.hooks.run("before-insert", h), h.element.innerHTML = h.highlightedCode, c.hooks.run("after-highlight", h), c.hooks.run("complete", h), s && s.call(h.element);
871
956
  }
872
- if (o.hooks.run("before-sanity-check", h), g = h.element.parentElement, g && g.nodeName.toLowerCase() === "pre" && !g.hasAttribute("tabindex") && g.setAttribute("tabindex", "0"), !h.code) {
873
- o.hooks.run("complete", h), u && u.call(h.element);
957
+ if (c.hooks.run("before-sanity-check", h), b = h.element.parentElement, b && b.nodeName.toLowerCase() === "pre" && !b.hasAttribute("tabindex") && b.setAttribute("tabindex", "0"), !h.code) {
958
+ c.hooks.run("complete", h), s && s.call(h.element);
874
959
  return;
875
960
  }
876
- if (o.hooks.run("before-highlight", h), !h.grammar) {
877
- E(o.util.encode(h.code));
961
+ if (c.hooks.run("before-highlight", h), !h.grammar) {
962
+ T(c.util.encode(h.code));
878
963
  return;
879
964
  }
880
- if (r && t.Worker) {
881
- var F = new Worker(o.filename);
882
- F.onmessage = function(I) {
883
- E(I.data);
884
- }, F.postMessage(JSON.stringify({
965
+ if (i && t.Worker) {
966
+ var R = new Worker(c.filename);
967
+ R.onmessage = function(H) {
968
+ T(H.data);
969
+ }, R.postMessage(JSON.stringify({
885
970
  language: h.language,
886
971
  code: h.code,
887
972
  immediateClose: !0
888
973
  }));
889
974
  } else
890
- E(o.highlight(h.code, h.grammar, h.language));
975
+ T(c.highlight(h.code, h.grammar, h.language));
891
976
  },
892
977
  /**
893
978
  * Low-level function, only use if you know what you’re doing. It accepts a string of text as input
@@ -909,15 +994,15 @@ function Re() {
909
994
  * @example
910
995
  * Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
911
996
  */
912
- highlight: function(i, r, u) {
913
- var d = {
914
- code: i,
915
- grammar: r,
916
- language: u
997
+ highlight: function(e, i, s) {
998
+ var g = {
999
+ code: e,
1000
+ grammar: i,
1001
+ language: s
917
1002
  };
918
- if (o.hooks.run("before-tokenize", d), !d.grammar)
919
- throw new Error('The language "' + d.language + '" has no grammar.');
920
- return d.tokens = o.tokenize(d.code, d.grammar), o.hooks.run("after-tokenize", d), p.stringify(o.util.encode(d.tokens), d.language);
1003
+ if (c.hooks.run("before-tokenize", g), !g.grammar)
1004
+ throw new Error('The language "' + g.language + '" has no grammar.');
1005
+ return g.tokens = c.tokenize(g.code, g.grammar), c.hooks.run("after-tokenize", g), k.stringify(c.util.encode(g.tokens), g.language);
921
1006
  },
922
1007
  /**
923
1008
  * This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
@@ -943,15 +1028,15 @@ function Re() {
943
1028
  * }
944
1029
  * });
945
1030
  */
946
- tokenize: function(i, r) {
947
- var u = r.rest;
948
- if (u) {
949
- for (var d in u)
950
- r[d] = u[d];
951
- delete r.rest;
1031
+ tokenize: function(e, i) {
1032
+ var s = i.rest;
1033
+ if (s) {
1034
+ for (var g in s)
1035
+ i[g] = s[g];
1036
+ delete i.rest;
952
1037
  }
953
- var s = new k();
954
- return $(s, s.head, i), b(i, s, r, s.head, 0), w(s);
1038
+ var d = new w();
1039
+ return $(d, d.head, e), x(e, d, i, d.head, 0), E(d);
955
1040
  },
956
1041
  /**
957
1042
  * @namespace
@@ -972,9 +1057,9 @@ function Re() {
972
1057
  * @param {HookCallback} callback The callback function which is given environment variables.
973
1058
  * @public
974
1059
  */
975
- add: function(i, r) {
976
- var u = o.hooks.all;
977
- u[i] = u[i] || [], u[i].push(r);
1060
+ add: function(e, i) {
1061
+ var s = c.hooks.all;
1062
+ s[e] = s[e] || [], s[e].push(i);
978
1063
  },
979
1064
  /**
980
1065
  * Runs a hook invoking all registered callbacks with the given environment variables.
@@ -985,135 +1070,135 @@ function Re() {
985
1070
  * @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
986
1071
  * @public
987
1072
  */
988
- run: function(i, r) {
989
- var u = o.hooks.all[i];
990
- if (!(!u || !u.length))
991
- for (var d = 0, s; s = u[d++]; )
992
- s(r);
1073
+ run: function(e, i) {
1074
+ var s = c.hooks.all[e];
1075
+ if (!(!s || !s.length))
1076
+ for (var g = 0, d; d = s[g++]; )
1077
+ d(i);
993
1078
  }
994
1079
  },
995
- Token: p
1080
+ Token: k
996
1081
  };
997
- t.Prism = o;
998
- function p(i, r, u, d) {
999
- this.type = i, this.content = r, this.alias = u, this.length = (d || "").length | 0;
1082
+ t.Prism = c;
1083
+ function k(e, i, s, g) {
1084
+ this.type = e, this.content = i, this.alias = s, this.length = (g || "").length | 0;
1000
1085
  }
1001
- p.stringify = function i(r, u) {
1002
- if (typeof r == "string")
1003
- return r;
1004
- if (Array.isArray(r)) {
1005
- var d = "";
1006
- return r.forEach(function(E) {
1007
- d += i(E, u);
1008
- }), d;
1086
+ k.stringify = function e(i, s) {
1087
+ if (typeof i == "string")
1088
+ return i;
1089
+ if (Array.isArray(i)) {
1090
+ var g = "";
1091
+ return i.forEach(function(T) {
1092
+ g += e(T, s);
1093
+ }), g;
1009
1094
  }
1010
- var s = {
1011
- type: r.type,
1012
- content: i(r.content, u),
1095
+ var d = {
1096
+ type: i.type,
1097
+ content: e(i.content, s),
1013
1098
  tag: "span",
1014
- classes: ["token", r.type],
1099
+ classes: ["token", i.type],
1015
1100
  attributes: {},
1016
- language: u
1017
- }, g = r.alias;
1018
- g && (Array.isArray(g) ? Array.prototype.push.apply(s.classes, g) : s.classes.push(g)), o.hooks.run("wrap", s);
1019
- var m = "";
1020
- for (var h in s.attributes)
1021
- m += " " + h + '="' + (s.attributes[h] || "").replace(/"/g, "&quot;") + '"';
1022
- return "<" + s.tag + ' class="' + s.classes.join(" ") + '"' + m + ">" + s.content + "</" + s.tag + ">";
1101
+ language: s
1102
+ }, b = i.alias;
1103
+ b && (Array.isArray(b) ? Array.prototype.push.apply(d.classes, b) : d.classes.push(b)), c.hooks.run("wrap", d);
1104
+ var S = "";
1105
+ for (var h in d.attributes)
1106
+ S += " " + h + '="' + (d.attributes[h] || "").replace(/"/g, "&quot;") + '"';
1107
+ return "<" + d.tag + ' class="' + d.classes.join(" ") + '"' + S + ">" + d.content + "</" + d.tag + ">";
1023
1108
  };
1024
- function A(i, r, u, d) {
1025
- i.lastIndex = r;
1026
- var s = i.exec(u);
1027
- if (s && d && s[1]) {
1028
- var g = s[1].length;
1029
- s.index += g, s[0] = s[0].slice(g);
1109
+ function P(e, i, s, g) {
1110
+ e.lastIndex = i;
1111
+ var d = e.exec(s);
1112
+ if (d && g && d[1]) {
1113
+ var b = d[1].length;
1114
+ d.index += b, d[0] = d[0].slice(b);
1030
1115
  }
1031
- return s;
1116
+ return d;
1032
1117
  }
1033
- function b(i, r, u, d, s, g) {
1034
- for (var m in u)
1035
- if (!(!u.hasOwnProperty(m) || !u[m])) {
1036
- var h = u[m];
1118
+ function x(e, i, s, g, d, b) {
1119
+ for (var S in s)
1120
+ if (!(!s.hasOwnProperty(S) || !s[S])) {
1121
+ var h = s[S];
1037
1122
  h = Array.isArray(h) ? h : [h];
1038
- for (var E = 0; E < h.length; ++E) {
1039
- if (g && g.cause == m + "," + E)
1123
+ for (var T = 0; T < h.length; ++T) {
1124
+ if (b && b.cause == S + "," + T)
1040
1125
  return;
1041
- var F = h[E], I = F.inside, X = !!F.lookbehind, Q = !!F.greedy, he = F.alias;
1042
- if (Q && !F.pattern.global) {
1043
- var fe = F.pattern.toString().match(/[imsuy]*$/)[0];
1044
- F.pattern = RegExp(F.pattern.source, fe + "g");
1126
+ var R = h[T], H = R.inside, Q = !!R.lookbehind, ee = !!R.greedy, ie = R.alias;
1127
+ if (ee && !R.pattern.global) {
1128
+ var ge = R.pattern.toString().match(/[imsuy]*$/)[0];
1129
+ R.pattern = RegExp(R.pattern.source, ge + "g");
1045
1130
  }
1046
- for (var ee = F.pattern || F, L = d.next, T = s; L !== r.tail && !(g && T >= g.reach); T += L.value.length, L = L.next) {
1047
- var j = L.value;
1048
- if (r.length > i.length)
1131
+ for (var te = R.pattern || R, L = g.next, z = d; L !== i.tail && !(b && z >= b.reach); z += L.value.length, L = L.next) {
1132
+ var N = L.value;
1133
+ if (i.length > e.length)
1049
1134
  return;
1050
- if (!(j instanceof p)) {
1051
- var z = 1, _;
1052
- if (Q) {
1053
- if (_ = A(ee, T, i, X), !_ || _.index >= i.length)
1135
+ if (!(N instanceof k)) {
1136
+ var W = 1, D;
1137
+ if (ee) {
1138
+ if (D = P(te, z, e, Q), !D || D.index >= e.length)
1054
1139
  break;
1055
- var M = _.index, me = _.index + _[0].length, R = T;
1056
- for (R += L.value.length; M >= R; )
1057
- L = L.next, R += L.value.length;
1058
- if (R -= L.value.length, T = R, L.value instanceof p)
1140
+ var G = D.index, ne = D.index + D[0].length, j = z;
1141
+ for (j += L.value.length; G >= j; )
1142
+ L = L.next, j += L.value.length;
1143
+ if (j -= L.value.length, z = j, L.value instanceof k)
1059
1144
  continue;
1060
- for (var O = L; O !== r.tail && (R < me || typeof O.value == "string"); O = O.next)
1061
- z++, R += O.value.length;
1062
- z--, j = i.slice(T, R), _.index -= T;
1063
- } else if (_ = A(ee, 0, j, X), !_)
1145
+ for (var K = L; K !== i.tail && (j < ne || typeof K.value == "string"); K = K.next)
1146
+ W++, j += K.value.length;
1147
+ W--, N = e.slice(z, j), D.index -= z;
1148
+ } else if (D = P(te, 0, N, Q), !D)
1064
1149
  continue;
1065
- var M = _.index, H = _[0], K = j.slice(0, M), te = j.slice(M + H.length), G = T + j.length;
1066
- g && G > g.reach && (g.reach = G);
1067
- var q = L.prev;
1068
- K && (q = $(r, q, K), T += K.length), S(r, q, z);
1069
- var ve = new p(m, I ? o.tokenize(H, I) : H, he, H);
1070
- if (L = $(r, q, ve), te && $(r, L, te), z > 1) {
1071
- var Z = {
1072
- cause: m + "," + E,
1073
- reach: G
1150
+ var G = D.index, Z = D[0], X = N.slice(0, G), re = N.slice(G + Z.length), V = z + N.length;
1151
+ b && V > b.reach && (b.reach = V);
1152
+ var I = L.prev;
1153
+ X && (I = $(i, I, X), z += X.length), F(i, I, W);
1154
+ var se = new k(S, H ? c.tokenize(Z, H) : Z, ie, Z);
1155
+ if (L = $(i, I, se), re && $(i, L, re), W > 1) {
1156
+ var Y = {
1157
+ cause: S + "," + T,
1158
+ reach: V
1074
1159
  };
1075
- b(i, r, u, L.prev, T, Z), g && Z.reach > g.reach && (g.reach = Z.reach);
1160
+ x(e, i, s, L.prev, z, Y), b && Y.reach > b.reach && (b.reach = Y.reach);
1076
1161
  }
1077
1162
  }
1078
1163
  }
1079
1164
  }
1080
1165
  }
1081
1166
  }
1082
- function k() {
1083
- var i = { value: null, prev: null, next: null }, r = { value: null, prev: i, next: null };
1084
- i.next = r, this.head = i, this.tail = r, this.length = 0;
1167
+ function w() {
1168
+ var e = { value: null, prev: null, next: null }, i = { value: null, prev: e, next: null };
1169
+ e.next = i, this.head = e, this.tail = i, this.length = 0;
1085
1170
  }
1086
- function $(i, r, u) {
1087
- var d = r.next, s = { value: u, prev: r, next: d };
1088
- return r.next = s, d.prev = s, i.length++, s;
1171
+ function $(e, i, s) {
1172
+ var g = i.next, d = { value: s, prev: i, next: g };
1173
+ return i.next = d, g.prev = d, e.length++, d;
1089
1174
  }
1090
- function S(i, r, u) {
1091
- for (var d = r.next, s = 0; s < u && d !== i.tail; s++)
1092
- d = d.next;
1093
- r.next = d, d.prev = r, i.length -= s;
1175
+ function F(e, i, s) {
1176
+ for (var g = i.next, d = 0; d < s && g !== e.tail; d++)
1177
+ g = g.next;
1178
+ i.next = g, g.prev = i, e.length -= d;
1094
1179
  }
1095
- function w(i) {
1096
- for (var r = [], u = i.head.next; u !== i.tail; )
1097
- r.push(u.value), u = u.next;
1098
- return r;
1180
+ function E(e) {
1181
+ for (var i = [], s = e.head.next; s !== e.tail; )
1182
+ i.push(s.value), s = s.next;
1183
+ return i;
1099
1184
  }
1100
1185
  if (!t.document)
1101
- return t.addEventListener && (o.disableWorkerMessageHandler || t.addEventListener("message", function(i) {
1102
- var r = JSON.parse(i.data), u = r.language, d = r.code, s = r.immediateClose;
1103
- t.postMessage(o.highlight(d, o.languages[u], u)), s && t.close();
1104
- }, !1)), o;
1105
- var y = o.util.currentScript();
1106
- y && (o.filename = y.src, y.hasAttribute("data-manual") && (o.manual = !0));
1107
- function f() {
1108
- o.manual || o.highlightAll();
1186
+ return t.addEventListener && (c.disableWorkerMessageHandler || t.addEventListener("message", function(e) {
1187
+ var i = JSON.parse(e.data), s = i.language, g = i.code, d = i.immediateClose;
1188
+ t.postMessage(c.highlight(g, c.languages[s], s)), d && t.close();
1189
+ }, !1)), c;
1190
+ var y = c.util.currentScript();
1191
+ y && (c.filename = y.src, y.hasAttribute("data-manual") && (c.manual = !0));
1192
+ function p() {
1193
+ c.manual || c.highlightAll();
1109
1194
  }
1110
- if (!o.manual) {
1111
- var x = document.readyState;
1112
- x === "loading" || x === "interactive" && y && y.defer ? document.addEventListener("DOMContentLoaded", f) : window.requestAnimationFrame ? window.requestAnimationFrame(f) : window.setTimeout(f, 16);
1195
+ if (!c.manual) {
1196
+ var f = document.readyState;
1197
+ f === "loading" || f === "interactive" && y && y.defer ? document.addEventListener("DOMContentLoaded", p) : window.requestAnimationFrame ? window.requestAnimationFrame(p) : window.setTimeout(p, 16);
1113
1198
  }
1114
- return o;
1115
- })(a);
1116
- n.exports && (n.exports = e), typeof ue < "u" && (ue.Prism = e), e.languages.markup = {
1199
+ return c;
1200
+ })(o);
1201
+ r.exports && (r.exports = n), typeof De < "u" && (De.Prism = n), n.languages.markup = {
1117
1202
  comment: {
1118
1203
  pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
1119
1204
  greedy: !0
@@ -1190,9 +1275,9 @@ function Re() {
1190
1275
  },
1191
1276
  /&#x?[\da-f]{1,8};/i
1192
1277
  ]
1193
- }, e.languages.markup.tag.inside["attr-value"].inside.entity = e.languages.markup.entity, e.languages.markup.doctype.inside["internal-subset"].inside = e.languages.markup, e.hooks.add("wrap", function(t) {
1278
+ }, n.languages.markup.tag.inside["attr-value"].inside.entity = n.languages.markup.entity, n.languages.markup.doctype.inside["internal-subset"].inside = n.languages.markup, n.hooks.add("wrap", function(t) {
1194
1279
  t.type === "entity" && (t.attributes.title = t.content.replace(/&amp;/, "&"));
1195
- }), Object.defineProperty(e.languages.markup.tag, "addInlined", {
1280
+ }), Object.defineProperty(n.languages.markup.tag, "addInlined", {
1196
1281
  /**
1197
1282
  * Adds an inlined language to markup.
1198
1283
  *
@@ -1204,34 +1289,34 @@ function Re() {
1204
1289
  * @example
1205
1290
  * addInlined('style', 'css');
1206
1291
  */
1207
- value: function(l, c) {
1208
- var v = {};
1209
- v["language-" + c] = {
1292
+ value: function(u, l) {
1293
+ var m = {};
1294
+ m["language-" + l] = {
1210
1295
  pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
1211
1296
  lookbehind: !0,
1212
- inside: e.languages[c]
1213
- }, v.cdata = /^<!\[CDATA\[|\]\]>$/i;
1214
- var o = {
1297
+ inside: n.languages[l]
1298
+ }, m.cdata = /^<!\[CDATA\[|\]\]>$/i;
1299
+ var c = {
1215
1300
  "included-cdata": {
1216
1301
  pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1217
- inside: v
1302
+ inside: m
1218
1303
  }
1219
1304
  };
1220
- o["language-" + c] = {
1305
+ c["language-" + l] = {
1221
1306
  pattern: /[\s\S]+/,
1222
- inside: e.languages[c]
1307
+ inside: n.languages[l]
1223
1308
  };
1224
- var p = {};
1225
- p[l] = {
1309
+ var k = {};
1310
+ k[u] = {
1226
1311
  pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
1227
- return l;
1312
+ return u;
1228
1313
  }), "i"),
1229
1314
  lookbehind: !0,
1230
1315
  greedy: !0,
1231
- inside: o
1232
- }, e.languages.insertBefore("markup", "cdata", p);
1316
+ inside: c
1317
+ }, n.languages.insertBefore("markup", "cdata", k);
1233
1318
  }
1234
- }), Object.defineProperty(e.languages.markup.tag, "addAttribute", {
1319
+ }), Object.defineProperty(n.languages.markup.tag, "addAttribute", {
1235
1320
  /**
1236
1321
  * Adds an pattern to highlight languages embedded in HTML attributes.
1237
1322
  *
@@ -1243,8 +1328,8 @@ function Re() {
1243
1328
  * @example
1244
1329
  * addAttribute('style', 'css');
1245
1330
  */
1246
- value: function(t, l) {
1247
- e.languages.markup.tag.inside["special-attr"].push({
1331
+ value: function(t, u) {
1332
+ n.languages.markup.tag.inside["special-attr"].push({
1248
1333
  pattern: RegExp(
1249
1334
  /(^|["'\s])/.source + "(?:" + t + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
1250
1335
  "i"
@@ -1258,8 +1343,8 @@ function Re() {
1258
1343
  value: {
1259
1344
  pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
1260
1345
  lookbehind: !0,
1261
- alias: [l, "language-" + l],
1262
- inside: e.languages[l]
1346
+ alias: [u, "language-" + u],
1347
+ inside: n.languages[u]
1263
1348
  },
1264
1349
  punctuation: [
1265
1350
  {
@@ -1273,12 +1358,12 @@ function Re() {
1273
1358
  }
1274
1359
  });
1275
1360
  }
1276
- }), e.languages.html = e.languages.markup, e.languages.mathml = e.languages.markup, e.languages.svg = e.languages.markup, e.languages.xml = e.languages.extend("markup", {}), e.languages.ssml = e.languages.xml, e.languages.atom = e.languages.xml, e.languages.rss = e.languages.xml, (function(t) {
1277
- var l = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
1361
+ }), n.languages.html = n.languages.markup, n.languages.mathml = n.languages.markup, n.languages.svg = n.languages.markup, n.languages.xml = n.languages.extend("markup", {}), n.languages.ssml = n.languages.xml, n.languages.atom = n.languages.xml, n.languages.rss = n.languages.xml, (function(t) {
1362
+ var u = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
1278
1363
  t.languages.css = {
1279
1364
  comment: /\/\*[\s\S]*?\*\//,
1280
1365
  atrule: {
1281
- pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + l.source + ")*?" + /(?:;|(?=\s*\{))/.source),
1366
+ pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + u.source + ")*?" + /(?:;|(?=\s*\{))/.source),
1282
1367
  inside: {
1283
1368
  rule: /^@[\w-]+/,
1284
1369
  "selector-function-argument": {
@@ -1295,23 +1380,23 @@ function Re() {
1295
1380
  },
1296
1381
  url: {
1297
1382
  // https://drafts.csswg.org/css-values-3/#urls
1298
- pattern: RegExp("\\burl\\((?:" + l.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
1383
+ pattern: RegExp("\\burl\\((?:" + u.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
1299
1384
  greedy: !0,
1300
1385
  inside: {
1301
1386
  function: /^url/i,
1302
1387
  punctuation: /^\(|\)$/,
1303
1388
  string: {
1304
- pattern: RegExp("^" + l.source + "$"),
1389
+ pattern: RegExp("^" + u.source + "$"),
1305
1390
  alias: "url"
1306
1391
  }
1307
1392
  }
1308
1393
  },
1309
1394
  selector: {
1310
- pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + l.source + ")*(?=\\s*\\{)"),
1395
+ pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + u.source + ")*(?=\\s*\\{)"),
1311
1396
  lookbehind: !0
1312
1397
  },
1313
1398
  string: {
1314
- pattern: l,
1399
+ pattern: u,
1315
1400
  greedy: !0
1316
1401
  },
1317
1402
  property: {
@@ -1325,9 +1410,9 @@ function Re() {
1325
1410
  },
1326
1411
  punctuation: /[(){};:,]/
1327
1412
  }, t.languages.css.atrule.inside.rest = t.languages.css;
1328
- var c = t.languages.markup;
1329
- c && (c.tag.addInlined("style", "css"), c.tag.addAttribute("style", "css"));
1330
- })(e), e.languages.clike = {
1413
+ var l = t.languages.markup;
1414
+ l && (l.tag.addInlined("style", "css"), l.tag.addAttribute("style", "css"));
1415
+ })(n), n.languages.clike = {
1331
1416
  comment: [
1332
1417
  {
1333
1418
  pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
@@ -1357,9 +1442,9 @@ function Re() {
1357
1442
  number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
1358
1443
  operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
1359
1444
  punctuation: /[{}[\];(),.:]/
1360
- }, e.languages.javascript = e.languages.extend("clike", {
1445
+ }, n.languages.javascript = n.languages.extend("clike", {
1361
1446
  "class-name": [
1362
- e.languages.clike["class-name"],
1447
+ n.languages.clike["class-name"],
1363
1448
  {
1364
1449
  pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
1365
1450
  lookbehind: !0
@@ -1390,7 +1475,7 @@ function Re() {
1390
1475
  lookbehind: !0
1391
1476
  },
1392
1477
  operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
1393
- }), e.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/, e.languages.insertBefore("javascript", "keyword", {
1478
+ }), n.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/, n.languages.insertBefore("javascript", "keyword", {
1394
1479
  regex: {
1395
1480
  pattern: RegExp(
1396
1481
  // lookbehind
@@ -1410,7 +1495,7 @@ function Re() {
1410
1495
  pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
1411
1496
  lookbehind: !0,
1412
1497
  alias: "language-regex",
1413
- inside: e.languages.regex
1498
+ inside: n.languages.regex
1414
1499
  },
1415
1500
  "regex-delimiter": /^\/|\/$/,
1416
1501
  "regex-flags": /^[a-z]+$/
@@ -1425,26 +1510,26 @@ function Re() {
1425
1510
  {
1426
1511
  pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
1427
1512
  lookbehind: !0,
1428
- inside: e.languages.javascript
1513
+ inside: n.languages.javascript
1429
1514
  },
1430
1515
  {
1431
1516
  pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
1432
1517
  lookbehind: !0,
1433
- inside: e.languages.javascript
1518
+ inside: n.languages.javascript
1434
1519
  },
1435
1520
  {
1436
1521
  pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
1437
1522
  lookbehind: !0,
1438
- inside: e.languages.javascript
1523
+ inside: n.languages.javascript
1439
1524
  },
1440
1525
  {
1441
1526
  pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
1442
1527
  lookbehind: !0,
1443
- inside: e.languages.javascript
1528
+ inside: n.languages.javascript
1444
1529
  }
1445
1530
  ],
1446
1531
  constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/
1447
- }), e.languages.insertBefore("javascript", "string", {
1532
+ }), n.languages.insertBefore("javascript", "string", {
1448
1533
  hashbang: {
1449
1534
  pattern: /^#!.*/,
1450
1535
  greedy: !0,
@@ -1466,7 +1551,7 @@ function Re() {
1466
1551
  pattern: /^\$\{|\}$/,
1467
1552
  alias: "punctuation"
1468
1553
  },
1469
- rest: e.languages.javascript
1554
+ rest: n.languages.javascript
1470
1555
  }
1471
1556
  },
1472
1557
  string: /[\s\S]+/
@@ -1478,22 +1563,22 @@ function Re() {
1478
1563
  greedy: !0,
1479
1564
  alias: "property"
1480
1565
  }
1481
- }), e.languages.insertBefore("javascript", "operator", {
1566
+ }), n.languages.insertBefore("javascript", "operator", {
1482
1567
  "literal-property": {
1483
1568
  pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
1484
1569
  lookbehind: !0,
1485
1570
  alias: "property"
1486
1571
  }
1487
- }), e.languages.markup && (e.languages.markup.tag.addInlined("script", "javascript"), e.languages.markup.tag.addAttribute(
1572
+ }), n.languages.markup && (n.languages.markup.tag.addInlined("script", "javascript"), n.languages.markup.tag.addAttribute(
1488
1573
  /on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,
1489
1574
  "javascript"
1490
- )), e.languages.js = e.languages.javascript, (function() {
1491
- if (typeof e > "u" || typeof document > "u")
1575
+ )), n.languages.js = n.languages.javascript, (function() {
1576
+ if (typeof n > "u" || typeof document > "u")
1492
1577
  return;
1493
1578
  Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector);
1494
- var t = "Loading…", l = function(y, f) {
1495
- return "✖ Error " + y + " while fetching file: " + f;
1496
- }, c = "✖ Error: File does not exist or is empty", v = {
1579
+ var t = "Loading…", u = function(y, p) {
1580
+ return "✖ Error " + y + " while fetching file: " + p;
1581
+ }, l = "✖ Error: File does not exist or is empty", m = {
1497
1582
  js: "javascript",
1498
1583
  py: "python",
1499
1584
  rb: "ruby",
@@ -1503,56 +1588,56 @@ function Re() {
1503
1588
  bat: "batch",
1504
1589
  h: "c",
1505
1590
  tex: "latex"
1506
- }, o = "data-src-status", p = "loading", A = "loaded", b = "failed", k = "pre[data-src]:not([" + o + '="' + A + '"]):not([' + o + '="' + p + '"])';
1507
- function $(y, f, x) {
1508
- var i = new XMLHttpRequest();
1509
- i.open("GET", y, !0), i.onreadystatechange = function() {
1510
- i.readyState == 4 && (i.status < 400 && i.responseText ? f(i.responseText) : i.status >= 400 ? x(l(i.status, i.statusText)) : x(c));
1511
- }, i.send(null);
1591
+ }, c = "data-src-status", k = "loading", P = "loaded", x = "failed", w = "pre[data-src]:not([" + c + '="' + P + '"]):not([' + c + '="' + k + '"])';
1592
+ function $(y, p, f) {
1593
+ var e = new XMLHttpRequest();
1594
+ e.open("GET", y, !0), e.onreadystatechange = function() {
1595
+ e.readyState == 4 && (e.status < 400 && e.responseText ? p(e.responseText) : e.status >= 400 ? f(u(e.status, e.statusText)) : f(l));
1596
+ }, e.send(null);
1512
1597
  }
1513
- function S(y) {
1514
- var f = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(y || "");
1515
- if (f) {
1516
- var x = Number(f[1]), i = f[2], r = f[3];
1517
- return i ? r ? [x, Number(r)] : [x, void 0] : [x, x];
1598
+ function F(y) {
1599
+ var p = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(y || "");
1600
+ if (p) {
1601
+ var f = Number(p[1]), e = p[2], i = p[3];
1602
+ return e ? i ? [f, Number(i)] : [f, void 0] : [f, f];
1518
1603
  }
1519
1604
  }
1520
- e.hooks.add("before-highlightall", function(y) {
1521
- y.selector += ", " + k;
1522
- }), e.hooks.add("before-sanity-check", function(y) {
1523
- var f = (
1605
+ n.hooks.add("before-highlightall", function(y) {
1606
+ y.selector += ", " + w;
1607
+ }), n.hooks.add("before-sanity-check", function(y) {
1608
+ var p = (
1524
1609
  /** @type {HTMLPreElement} */
1525
1610
  y.element
1526
1611
  );
1527
- if (f.matches(k)) {
1528
- y.code = "", f.setAttribute(o, p);
1529
- var x = f.appendChild(document.createElement("CODE"));
1530
- x.textContent = t;
1531
- var i = f.getAttribute("data-src"), r = y.language;
1532
- if (r === "none") {
1533
- var u = (/\.(\w+)$/.exec(i) || [, "none"])[1];
1534
- r = v[u] || u;
1612
+ if (p.matches(w)) {
1613
+ y.code = "", p.setAttribute(c, k);
1614
+ var f = p.appendChild(document.createElement("CODE"));
1615
+ f.textContent = t;
1616
+ var e = p.getAttribute("data-src"), i = y.language;
1617
+ if (i === "none") {
1618
+ var s = (/\.(\w+)$/.exec(e) || [, "none"])[1];
1619
+ i = m[s] || s;
1535
1620
  }
1536
- e.util.setLanguage(x, r), e.util.setLanguage(f, r);
1537
- var d = e.plugins.autoloader;
1538
- d && d.loadLanguages(r), $(
1539
- i,
1540
- function(s) {
1541
- f.setAttribute(o, A);
1542
- var g = S(f.getAttribute("data-range"));
1543
- if (g) {
1544
- var m = s.split(/\r\n?|\n/g), h = g[0], E = g[1] == null ? m.length : g[1];
1545
- h < 0 && (h += m.length), h = Math.max(0, Math.min(h - 1, m.length)), E < 0 && (E += m.length), E = Math.max(0, Math.min(E, m.length)), s = m.slice(h, E).join(`
1546
- `), f.hasAttribute("data-start") || f.setAttribute("data-start", String(h + 1));
1621
+ n.util.setLanguage(f, i), n.util.setLanguage(p, i);
1622
+ var g = n.plugins.autoloader;
1623
+ g && g.loadLanguages(i), $(
1624
+ e,
1625
+ function(d) {
1626
+ p.setAttribute(c, P);
1627
+ var b = F(p.getAttribute("data-range"));
1628
+ if (b) {
1629
+ var S = d.split(/\r\n?|\n/g), h = b[0], T = b[1] == null ? S.length : b[1];
1630
+ h < 0 && (h += S.length), h = Math.max(0, Math.min(h - 1, S.length)), T < 0 && (T += S.length), T = Math.max(0, Math.min(T, S.length)), d = S.slice(h, T).join(`
1631
+ `), p.hasAttribute("data-start") || p.setAttribute("data-start", String(h + 1));
1547
1632
  }
1548
- x.textContent = s, e.highlightElement(x);
1633
+ f.textContent = d, n.highlightElement(f);
1549
1634
  },
1550
- function(s) {
1551
- f.setAttribute(o, b), x.textContent = s;
1635
+ function(d) {
1636
+ p.setAttribute(c, x), f.textContent = d;
1552
1637
  }
1553
1638
  );
1554
1639
  }
1555
- }), e.plugins.fileHighlight = {
1640
+ }), n.plugins.fileHighlight = {
1556
1641
  /**
1557
1642
  * Executes the File Highlight plugin for all matching `pre` elements under the given container.
1558
1643
  *
@@ -1560,20 +1645,20 @@ function Re() {
1560
1645
  *
1561
1646
  * @param {ParentNode} [container=document]
1562
1647
  */
1563
- highlight: function(f) {
1564
- for (var x = (f || document).querySelectorAll(k), i = 0, r; r = x[i++]; )
1565
- e.highlightElement(r);
1648
+ highlight: function(p) {
1649
+ for (var f = (p || document).querySelectorAll(w), e = 0, i; i = f[e++]; )
1650
+ n.highlightElement(i);
1566
1651
  }
1567
1652
  };
1568
- var w = !1;
1569
- e.fileHighlight = function() {
1570
- w || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), w = !0), e.plugins.fileHighlight.highlight.apply(this, arguments);
1653
+ var E = !1;
1654
+ n.fileHighlight = function() {
1655
+ E || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), E = !0), n.plugins.fileHighlight.highlight.apply(this, arguments);
1571
1656
  };
1572
1657
  })();
1573
- })(U)), U.exports;
1658
+ })(me)), me.exports;
1574
1659
  }
1575
- var je = Re();
1576
- const de = /* @__PURE__ */ Ie(je);
1660
+ var tt = et();
1661
+ const Me = /* @__PURE__ */ Qe(tt);
1577
1662
  Prism.languages.markup = {
1578
1663
  comment: {
1579
1664
  pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
@@ -1654,8 +1739,8 @@ Prism.languages.markup = {
1654
1739
  };
1655
1740
  Prism.languages.markup.tag.inside["attr-value"].inside.entity = Prism.languages.markup.entity;
1656
1741
  Prism.languages.markup.doctype.inside["internal-subset"].inside = Prism.languages.markup;
1657
- Prism.hooks.add("wrap", function(n) {
1658
- n.type === "entity" && (n.attributes.title = n.content.replace(/&amp;/, "&"));
1742
+ Prism.hooks.add("wrap", function(r) {
1743
+ r.type === "entity" && (r.attributes.title = r.content.replace(/&amp;/, "&"));
1659
1744
  });
1660
1745
  Object.defineProperty(Prism.languages.markup.tag, "addInlined", {
1661
1746
  /**
@@ -1669,32 +1754,32 @@ Object.defineProperty(Prism.languages.markup.tag, "addInlined", {
1669
1754
  * @example
1670
1755
  * addInlined('style', 'css');
1671
1756
  */
1672
- value: function(a, e) {
1757
+ value: function(o, n) {
1673
1758
  var t = {};
1674
- t["language-" + e] = {
1759
+ t["language-" + n] = {
1675
1760
  pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
1676
1761
  lookbehind: !0,
1677
- inside: Prism.languages[e]
1762
+ inside: Prism.languages[n]
1678
1763
  }, t.cdata = /^<!\[CDATA\[|\]\]>$/i;
1679
- var l = {
1764
+ var u = {
1680
1765
  "included-cdata": {
1681
1766
  pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1682
1767
  inside: t
1683
1768
  }
1684
1769
  };
1685
- l["language-" + e] = {
1770
+ u["language-" + n] = {
1686
1771
  pattern: /[\s\S]+/,
1687
- inside: Prism.languages[e]
1772
+ inside: Prism.languages[n]
1688
1773
  };
1689
- var c = {};
1690
- c[a] = {
1774
+ var l = {};
1775
+ l[o] = {
1691
1776
  pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
1692
- return a;
1777
+ return o;
1693
1778
  }), "i"),
1694
1779
  lookbehind: !0,
1695
1780
  greedy: !0,
1696
- inside: l
1697
- }, Prism.languages.insertBefore("markup", "cdata", c);
1781
+ inside: u
1782
+ }, Prism.languages.insertBefore("markup", "cdata", l);
1698
1783
  }
1699
1784
  });
1700
1785
  Object.defineProperty(Prism.languages.markup.tag, "addAttribute", {
@@ -1709,10 +1794,10 @@ Object.defineProperty(Prism.languages.markup.tag, "addAttribute", {
1709
1794
  * @example
1710
1795
  * addAttribute('style', 'css');
1711
1796
  */
1712
- value: function(n, a) {
1797
+ value: function(r, o) {
1713
1798
  Prism.languages.markup.tag.inside["special-attr"].push({
1714
1799
  pattern: RegExp(
1715
- /(^|["'\s])/.source + "(?:" + n + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
1800
+ /(^|["'\s])/.source + "(?:" + r + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
1716
1801
  "i"
1717
1802
  ),
1718
1803
  lookbehind: !0,
@@ -1724,8 +1809,8 @@ Object.defineProperty(Prism.languages.markup.tag, "addAttribute", {
1724
1809
  value: {
1725
1810
  pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
1726
1811
  lookbehind: !0,
1727
- alias: [a, "language-" + a],
1728
- inside: Prism.languages[a]
1812
+ alias: [o, "language-" + o],
1813
+ inside: Prism.languages[o]
1729
1814
  },
1730
1815
  punctuation: [
1731
1816
  {
@@ -1747,17 +1832,17 @@ Prism.languages.xml = Prism.languages.extend("markup", {});
1747
1832
  Prism.languages.ssml = Prism.languages.xml;
1748
1833
  Prism.languages.atom = Prism.languages.xml;
1749
1834
  Prism.languages.rss = Prism.languages.xml;
1750
- (function(n) {
1751
- var a = /(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;
1752
- function e(b) {
1753
- return b = b.replace(/<inner>/g, function() {
1754
- return a;
1755
- }), RegExp(/((?:^|[^\\])(?:\\{2})*)/.source + "(?:" + b + ")");
1835
+ (function(r) {
1836
+ var o = /(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;
1837
+ function n(x) {
1838
+ return x = x.replace(/<inner>/g, function() {
1839
+ return o;
1840
+ }), RegExp(/((?:^|[^\\])(?:\\{2})*)/.source + "(?:" + x + ")");
1756
1841
  }
1757
- var t = /(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source, l = /\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g, function() {
1842
+ var t = /(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source, u = /\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g, function() {
1758
1843
  return t;
1759
- }), c = /\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;
1760
- n.languages.markdown = n.languages.extend("markup", {}), n.languages.insertBefore("markdown", "prolog", {
1844
+ }), l = /\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;
1845
+ r.languages.markdown = r.languages.extend("markup", {}), r.languages.insertBefore("markdown", "prolog", {
1761
1846
  "front-matter-block": {
1762
1847
  pattern: /(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,
1763
1848
  lookbehind: !0,
@@ -1767,7 +1852,7 @@ Prism.languages.rss = Prism.languages.xml;
1767
1852
  "front-matter": {
1768
1853
  pattern: /\S+(?:\s+\S+)*/,
1769
1854
  alias: ["yaml", "language-yaml"],
1770
- inside: n.languages.yaml
1855
+ inside: r.languages.yaml
1771
1856
  }
1772
1857
  }
1773
1858
  },
@@ -1777,33 +1862,33 @@ Prism.languages.rss = Prism.languages.xml;
1777
1862
  alias: "punctuation"
1778
1863
  },
1779
1864
  table: {
1780
- pattern: RegExp("^" + l + c + "(?:" + l + ")*", "m"),
1865
+ pattern: RegExp("^" + u + l + "(?:" + u + ")*", "m"),
1781
1866
  inside: {
1782
1867
  "table-data-rows": {
1783
- pattern: RegExp("^(" + l + c + ")(?:" + l + ")*$"),
1868
+ pattern: RegExp("^(" + u + l + ")(?:" + u + ")*$"),
1784
1869
  lookbehind: !0,
1785
1870
  inside: {
1786
1871
  "table-data": {
1787
1872
  pattern: RegExp(t),
1788
- inside: n.languages.markdown
1873
+ inside: r.languages.markdown
1789
1874
  },
1790
1875
  punctuation: /\|/
1791
1876
  }
1792
1877
  },
1793
1878
  "table-line": {
1794
- pattern: RegExp("^(" + l + ")" + c + "$"),
1879
+ pattern: RegExp("^(" + u + ")" + l + "$"),
1795
1880
  lookbehind: !0,
1796
1881
  inside: {
1797
1882
  punctuation: /\||:?-{3,}:?/
1798
1883
  }
1799
1884
  },
1800
1885
  "table-header-row": {
1801
- pattern: RegExp("^" + l + "$"),
1886
+ pattern: RegExp("^" + u + "$"),
1802
1887
  inside: {
1803
1888
  "table-header": {
1804
1889
  pattern: RegExp(t),
1805
1890
  alias: "important",
1806
- inside: n.languages.markdown
1891
+ inside: r.languages.markdown
1807
1892
  },
1808
1893
  punctuation: /\|/
1809
1894
  }
@@ -1897,7 +1982,7 @@ Prism.languages.rss = Prism.languages.xml;
1897
1982
  // **strong**
1898
1983
  // __strong__
1899
1984
  // allow one nested instance of italic text using the same delimiter
1900
- pattern: e(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),
1985
+ pattern: n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),
1901
1986
  lookbehind: !0,
1902
1987
  greedy: !0,
1903
1988
  inside: {
@@ -1914,7 +1999,7 @@ Prism.languages.rss = Prism.languages.xml;
1914
1999
  // *em*
1915
2000
  // _em_
1916
2001
  // allow one nested instance of bold text using the same delimiter
1917
- pattern: e(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),
2002
+ pattern: n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),
1918
2003
  lookbehind: !0,
1919
2004
  greedy: !0,
1920
2005
  inside: {
@@ -1931,7 +2016,7 @@ Prism.languages.rss = Prism.languages.xml;
1931
2016
  // ~~strike through~~
1932
2017
  // ~strike~
1933
2018
  // eslint-disable-next-line regexp/strict
1934
- pattern: e(/(~~?)(?:(?!~)<inner>)+\2/.source),
2019
+ pattern: n(/(~~?)(?:(?!~)<inner>)+\2/.source),
1935
2020
  lookbehind: !0,
1936
2021
  greedy: !0,
1937
2022
  inside: {
@@ -1956,7 +2041,7 @@ Prism.languages.rss = Prism.languages.xml;
1956
2041
  // [example](http://example.com "Optional title")
1957
2042
  // [example][id]
1958
2043
  // [example] [id]
1959
- pattern: e(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),
2044
+ pattern: n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),
1960
2045
  lookbehind: !0,
1961
2046
  greedy: !0,
1962
2047
  inside: {
@@ -1981,71 +2066,71 @@ Prism.languages.rss = Prism.languages.xml;
1981
2066
  }
1982
2067
  }
1983
2068
  }
1984
- }), ["url", "bold", "italic", "strike"].forEach(function(b) {
1985
- ["url", "bold", "italic", "strike", "code-snippet"].forEach(function(k) {
1986
- b !== k && (n.languages.markdown[b].inside.content.inside[k] = n.languages.markdown[k]);
2069
+ }), ["url", "bold", "italic", "strike"].forEach(function(x) {
2070
+ ["url", "bold", "italic", "strike", "code-snippet"].forEach(function(w) {
2071
+ x !== w && (r.languages.markdown[x].inside.content.inside[w] = r.languages.markdown[w]);
1987
2072
  });
1988
- }), n.hooks.add("after-tokenize", function(b) {
1989
- if (b.language !== "markdown" && b.language !== "md")
2073
+ }), r.hooks.add("after-tokenize", function(x) {
2074
+ if (x.language !== "markdown" && x.language !== "md")
1990
2075
  return;
1991
- function k($) {
2076
+ function w($) {
1992
2077
  if (!(!$ || typeof $ == "string"))
1993
- for (var S = 0, w = $.length; S < w; S++) {
1994
- var y = $[S];
2078
+ for (var F = 0, E = $.length; F < E; F++) {
2079
+ var y = $[F];
1995
2080
  if (y.type !== "code") {
1996
- k(y.content);
2081
+ w(y.content);
1997
2082
  continue;
1998
2083
  }
1999
- var f = y.content[1], x = y.content[3];
2000
- if (f && x && f.type === "code-language" && x.type === "code-block" && typeof f.content == "string") {
2001
- var i = f.content.replace(/\b#/g, "sharp").replace(/\b\+\+/g, "pp");
2002
- i = (/[a-z][\w-]*/i.exec(i) || [""])[0].toLowerCase();
2003
- var r = "language-" + i;
2004
- x.alias ? typeof x.alias == "string" ? x.alias = [x.alias, r] : x.alias.push(r) : x.alias = [r];
2084
+ var p = y.content[1], f = y.content[3];
2085
+ if (p && f && p.type === "code-language" && f.type === "code-block" && typeof p.content == "string") {
2086
+ var e = p.content.replace(/\b#/g, "sharp").replace(/\b\+\+/g, "pp");
2087
+ e = (/[a-z][\w-]*/i.exec(e) || [""])[0].toLowerCase();
2088
+ var i = "language-" + e;
2089
+ f.alias ? typeof f.alias == "string" ? f.alias = [f.alias, i] : f.alias.push(i) : f.alias = [i];
2005
2090
  }
2006
2091
  }
2007
2092
  }
2008
- k(b.tokens);
2009
- }), n.hooks.add("wrap", function(b) {
2010
- if (b.type === "code-block") {
2011
- for (var k = "", $ = 0, S = b.classes.length; $ < S; $++) {
2012
- var w = b.classes[$], y = /language-(.+)/.exec(w);
2093
+ w(x.tokens);
2094
+ }), r.hooks.add("wrap", function(x) {
2095
+ if (x.type === "code-block") {
2096
+ for (var w = "", $ = 0, F = x.classes.length; $ < F; $++) {
2097
+ var E = x.classes[$], y = /language-(.+)/.exec(E);
2013
2098
  if (y) {
2014
- k = y[1];
2099
+ w = y[1];
2015
2100
  break;
2016
2101
  }
2017
2102
  }
2018
- var f = n.languages[k];
2019
- if (f)
2020
- b.content = n.highlight(A(b.content), f, k);
2021
- else if (k && k !== "none" && n.plugins.autoloader) {
2022
- var x = "md-" + (/* @__PURE__ */ new Date()).valueOf() + "-" + Math.floor(Math.random() * 1e16);
2023
- b.attributes.id = x, n.plugins.autoloader.loadLanguages(k, function() {
2024
- var i = document.getElementById(x);
2025
- i && (i.innerHTML = n.highlight(i.textContent, n.languages[k], k));
2103
+ var p = r.languages[w];
2104
+ if (p)
2105
+ x.content = r.highlight(P(x.content), p, w);
2106
+ else if (w && w !== "none" && r.plugins.autoloader) {
2107
+ var f = "md-" + (/* @__PURE__ */ new Date()).valueOf() + "-" + Math.floor(Math.random() * 1e16);
2108
+ x.attributes.id = f, r.plugins.autoloader.loadLanguages(w, function() {
2109
+ var e = document.getElementById(f);
2110
+ e && (e.innerHTML = r.highlight(e.textContent, r.languages[w], w));
2026
2111
  });
2027
2112
  }
2028
2113
  }
2029
2114
  });
2030
- var v = RegExp(n.languages.markup.tag.pattern.source, "gi"), o = {
2115
+ var m = RegExp(r.languages.markup.tag.pattern.source, "gi"), c = {
2031
2116
  amp: "&",
2032
2117
  lt: "<",
2033
2118
  gt: ">",
2034
2119
  quot: '"'
2035
- }, p = String.fromCodePoint || String.fromCharCode;
2036
- function A(b) {
2037
- var k = b.replace(v, "");
2038
- return k = k.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi, function($, S) {
2039
- if (S = S.toLowerCase(), S[0] === "#") {
2040
- var w;
2041
- return S[1] === "x" ? w = parseInt(S.slice(2), 16) : w = Number(S.slice(1)), p(w);
2120
+ }, k = String.fromCodePoint || String.fromCharCode;
2121
+ function P(x) {
2122
+ var w = x.replace(m, "");
2123
+ return w = w.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi, function($, F) {
2124
+ if (F = F.toLowerCase(), F[0] === "#") {
2125
+ var E;
2126
+ return F[1] === "x" ? E = parseInt(F.slice(2), 16) : E = Number(F.slice(1)), k(E);
2042
2127
  } else {
2043
- var y = o[S];
2128
+ var y = c[F];
2044
2129
  return y || $;
2045
2130
  }
2046
- }), k;
2131
+ }), w;
2047
2132
  }
2048
- n.languages.md = n.languages.markdown;
2133
+ r.languages.md = r.languages.markdown;
2049
2134
  })(Prism);
2050
2135
  Prism.languages.json = {
2051
2136
  property: {
@@ -2072,20 +2157,20 @@ Prism.languages.json = {
2072
2157
  }
2073
2158
  };
2074
2159
  Prism.languages.webmanifest = Prism.languages.json;
2075
- (function(n) {
2076
- var a = /[*&][^\s[\]{},]+/, e = /!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/, t = "(?:" + e.source + "(?:[ ]+" + a.source + ")?|" + a.source + "(?:[ ]+" + e.source + ")?)", l = /(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g, function() {
2160
+ (function(r) {
2161
+ var o = /[*&][^\s[\]{},]+/, n = /!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/, t = "(?:" + n.source + "(?:[ ]+" + o.source + ")?|" + o.source + "(?:[ ]+" + n.source + ")?)", u = /(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g, function() {
2077
2162
  return /[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source;
2078
- }), c = /"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;
2079
- function v(o, p) {
2080
- p = (p || "").replace(/m/g, "") + "m";
2081
- var A = /([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g, function() {
2163
+ }), l = /"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;
2164
+ function m(c, k) {
2165
+ k = (k || "").replace(/m/g, "") + "m";
2166
+ var P = /([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g, function() {
2082
2167
  return t;
2083
2168
  }).replace(/<<value>>/g, function() {
2084
- return o;
2169
+ return c;
2085
2170
  });
2086
- return RegExp(A, p);
2171
+ return RegExp(P, k);
2087
2172
  }
2088
- n.languages.yaml = {
2173
+ r.languages.yaml = {
2089
2174
  scalar: {
2090
2175
  pattern: RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g, function() {
2091
2176
  return t;
@@ -2098,7 +2183,7 @@ Prism.languages.webmanifest = Prism.languages.json;
2098
2183
  pattern: RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g, function() {
2099
2184
  return t;
2100
2185
  }).replace(/<<key>>/g, function() {
2101
- return "(?:" + l + "|" + c + ")";
2186
+ return "(?:" + u + "|" + l + ")";
2102
2187
  })),
2103
2188
  lookbehind: !0,
2104
2189
  greedy: !0,
@@ -2110,43 +2195,43 @@ Prism.languages.webmanifest = Prism.languages.json;
2110
2195
  alias: "important"
2111
2196
  },
2112
2197
  datetime: {
2113
- pattern: v(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),
2198
+ pattern: m(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),
2114
2199
  lookbehind: !0,
2115
2200
  alias: "number"
2116
2201
  },
2117
2202
  boolean: {
2118
- pattern: v(/false|true/.source, "i"),
2203
+ pattern: m(/false|true/.source, "i"),
2119
2204
  lookbehind: !0,
2120
2205
  alias: "important"
2121
2206
  },
2122
2207
  null: {
2123
- pattern: v(/null|~/.source, "i"),
2208
+ pattern: m(/null|~/.source, "i"),
2124
2209
  lookbehind: !0,
2125
2210
  alias: "important"
2126
2211
  },
2127
2212
  string: {
2128
- pattern: v(c),
2213
+ pattern: m(l),
2129
2214
  lookbehind: !0,
2130
2215
  greedy: !0
2131
2216
  },
2132
2217
  number: {
2133
- pattern: v(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source, "i"),
2218
+ pattern: m(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source, "i"),
2134
2219
  lookbehind: !0
2135
2220
  },
2136
- tag: e,
2137
- important: a,
2221
+ tag: n,
2222
+ important: o,
2138
2223
  punctuation: /---|[:[\]{}\-,|>?]|\.\.\./
2139
- }, n.languages.yml = n.languages.yaml;
2224
+ }, r.languages.yml = r.languages.yaml;
2140
2225
  })(Prism);
2141
- function Oe(n, a) {
2142
- const e = de.languages[a];
2143
- return e ? de.highlight(n, e, a) : De(n);
2226
+ function Oe(r, o) {
2227
+ const n = Me.languages[o];
2228
+ return n ? Me.highlight(r, n, o) : nt(r);
2144
2229
  }
2145
- function De(n) {
2146
- return n.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
2230
+ function nt(r) {
2231
+ return r.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
2147
2232
  }
2148
- function ze(n) {
2149
- switch (n) {
2233
+ function je(r) {
2234
+ switch (r) {
2150
2235
  case "md":
2151
2236
  return "markdown";
2152
2237
  case "xml":
@@ -2159,20 +2244,25 @@ function ze(n) {
2159
2244
  return null;
2160
2245
  }
2161
2246
  }
2162
- function Me(n) {
2163
- return (a) => {
2164
- if (n === "pd") return Pe(a);
2165
- const e = ze(n);
2166
- return e ? Oe(a, e) : Ae(a);
2247
+ function it(r, o) {
2248
+ const n = je(o);
2249
+ return n ? Oe(r, n) : ve(r);
2250
+ }
2251
+ function rt(r) {
2252
+ return (o) => {
2253
+ if (r === "pd") return Je(o);
2254
+ const n = je(r);
2255
+ return n ? Oe(o, n) : ve(o);
2167
2256
  };
2168
2257
  }
2169
- function He(n, a = {}) {
2170
- return Le(n, a, Me);
2258
+ function st(r, o = {}) {
2259
+ return Ve(r, o, rt);
2171
2260
  }
2172
2261
  export {
2173
- He as createPdEditor,
2174
- We as format,
2175
- Ke as jsonToPdText,
2176
- Ge as pdToJsonText
2262
+ st as createPdEditor,
2263
+ ut as format,
2264
+ Je as highlightPd,
2265
+ ct as jsonToPdText,
2266
+ dt as pdToJsonText,
2267
+ it as prismHighlighter
2177
2268
  };
2178
- //# sourceMappingURL=index.js.map