@powerduck/md-editor 0.8.5 → 0.9.1

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.mjs CHANGED
@@ -1,13 +1,13 @@
1
- import { Compartment as Be, EditorState as Ht } from "@codemirror/state";
1
+ import { Compartment as Be, EditorState as Ft } from "@codemirror/state";
2
2
  import { EditorView as ge, keymap as $e, lineNumbers as Ue } from "@codemirror/view";
3
3
  import { history as zt, defaultKeymap as Kt, historyKeymap as Gt } from "@codemirror/commands";
4
4
  import { markdown as qt } from "@codemirror/lang-markdown";
5
5
  import { languages as Wt } from "@codemirror/language-data";
6
6
  import Yt from "markdown-it";
7
- import Fe from "katex";
7
+ import He from "katex";
8
8
  class Zt {
9
9
  constructor(e, t = {}) {
10
- this.dropdown = null, this.items = [], this.selectedIndex = 0, this.trigger = null, this.searchAbort = null, this.destroyed = !1, this.view = e, this.options = {
10
+ this.dropdown = null, this.items = [], this.selectedIndex = 0, this.trigger = null, this.activeHead = 0, this.searchAbort = null, this.destroyed = !1, this.view = e, this.options = {
11
11
  onMentionSearch: t.onMentionSearch ?? (() => []),
12
12
  onMentionSelect: t.onMentionSelect ?? ((i) => `@${i.label}`),
13
13
  minChars: t.minChars ?? 0,
@@ -81,7 +81,7 @@ class Zt {
81
81
  }
82
82
  show() {
83
83
  if (this.trigger) {
84
- if (!this.dropdown) {
84
+ if (this.activeHead = this.view.state.selection.main.head, !this.dropdown) {
85
85
  this.dropdown = document.createElement("div"), this.dropdown.className = "md-editor-mention-dropdown", this.dropdown.setAttribute("role", "listbox");
86
86
  const e = this.view.dom.closest(".md-editor-root"), t = (e == null ? void 0 : e.getAttribute("data-theme")) ?? "light";
87
87
  this.dropdown.setAttribute("data-theme", t), document.body.appendChild(this.dropdown);
@@ -104,7 +104,9 @@ class Zt {
104
104
  s.className = "md-editor-mention-desc", s.textContent = e.description, r.appendChild(s);
105
105
  }
106
106
  i.appendChild(r), i.addEventListener("mousedown", (s) => {
107
- s.preventDefault(), this.selectItem(t);
107
+ s.preventDefault(), s.stopPropagation(), this.selectItem(t);
108
+ }), i.addEventListener("click", (s) => {
109
+ s.preventDefault(), s.stopPropagation(), this.selectItem(t);
108
110
  }), i.addEventListener("mouseenter", () => {
109
111
  this.selectedIndex = t, this.renderDropdown();
110
112
  }), this.dropdown.appendChild(i);
@@ -119,17 +121,13 @@ class Zt {
119
121
  r + t.height > i - 8 && (r = e.top - t.height - 4), a = Math.max(8, Math.min(a, window.innerWidth - t.width - 8)), this.dropdown.style.top = `${r}px`, this.dropdown.style.left = `${a}px`;
120
122
  }
121
123
  selectItem(e) {
122
- const t = this.items[e];
123
- if (!t || !this.trigger) return;
124
- const i = this.options.onMentionSelect(t), { head: r } = this.view.state.selection.main;
125
- this.view.dispatch({
126
- changes: {
127
- from: this.trigger.from,
128
- to: r,
129
- insert: i
130
- },
131
- selection: { anchor: this.trigger.from + i.length }
132
- }), this.hide(), this.view.focus();
124
+ const t = this.items[e], i = this.trigger;
125
+ if (!t || !i) return;
126
+ const r = this.options.onMentionSelect(t), a = i.from, s = this.activeHead;
127
+ this.view.focus(), this.view.dispatch({
128
+ changes: { from: a, to: s, insert: r },
129
+ selection: { anchor: a + r.length }
130
+ }), this.hide();
133
131
  }
134
132
  hide() {
135
133
  var e;
@@ -139,15 +137,32 @@ class Zt {
139
137
  this.destroyed = !0, this.hide();
140
138
  }
141
139
  }
142
- class Xt {
140
+ async function Vt(n) {
141
+ const e = await fetch(n, { mode: "cors" });
142
+ if (!e.ok) throw new Error(`HTTP ${e.status}`);
143
+ const t = await e.text();
144
+ return Xt(t, n);
145
+ }
146
+ function Xt(n, e) {
147
+ var c, l, d, h, p, m, y;
148
+ const t = {}, i = new DOMParser().parseFromString(n, "text/html"), a = ((c = i.querySelector('meta[property="og:title"]')) == null ? void 0 : c.getAttribute("content")) ?? ((l = i.querySelector("title")) == null ? void 0 : l.textContent) ?? void 0;
149
+ a && (t.title = a.trim());
150
+ const s = ((d = i.querySelector('meta[property="og:description"]')) == null ? void 0 : d.getAttribute("content")) ?? ((h = i.querySelector('meta[name="description"]')) == null ? void 0 : h.getAttribute("content"));
151
+ s && (t.description = s.trim());
152
+ const o = ((p = i.querySelector('meta[property="og:image"]')) == null ? void 0 : p.getAttribute("content")) ?? ((m = i.querySelector('meta[property="og:image:secure_url"]')) == null ? void 0 : m.getAttribute("content")) ?? ((y = i.querySelector('meta[name="twitter:image"]')) == null ? void 0 : y.getAttribute("content"));
153
+ return o && (t.thumbnail = o.startsWith("http") ? o : new URL(o, e).href), t;
154
+ }
155
+ class Qt {
143
156
  constructor(e, t = {}) {
144
- this.dropdown = null, this.items = [], this.selectedIndex = 0, this.trigger = null, this.searchAbort = null, this.destroyed = !1, this.view = e, this.options = {
157
+ this.dropdown = null, this.items = [], this.selectedIndex = 0, this.trigger = null, this.activeHead = 0, this.searchAbort = null, this.destroyed = !1, this.view = e, this.options = {
145
158
  onDocSearch: t.onDocSearch ?? (() => []),
146
159
  insertStyle: t.insertStyle ?? "auto",
147
160
  triggerChar: t.triggerChar ?? "/",
148
161
  minChars: t.minChars ?? 0,
149
162
  maxItems: t.maxItems ?? 8,
150
- onFetchDocMeta: t.onFetchDocMeta
163
+ // Use the built-in fetch+DOMParser fetcher unless the consumer provides
164
+ // their own (e.g. a backend proxy to avoid CORS).
165
+ onFetchDocMeta: t.onFetchDocMeta ?? Vt
151
166
  };
152
167
  }
153
168
  /** Called on every CodeMirror update. */
@@ -211,7 +226,7 @@ class Xt {
211
226
  }
212
227
  show() {
213
228
  if (this.trigger) {
214
- if (!this.dropdown) {
229
+ if (this.activeHead = this.view.state.selection.main.head, !this.dropdown) {
215
230
  this.dropdown = document.createElement("div"), this.dropdown.className = "md-editor-doclink-dropdown", this.dropdown.setAttribute("role", "listbox");
216
231
  const e = this.view.dom.closest(".md-editor-root"), t = (e == null ? void 0 : e.getAttribute("data-theme")) ?? "light";
217
232
  this.dropdown.setAttribute("data-theme", t), document.body.appendChild(this.dropdown);
@@ -241,7 +256,9 @@ class Xt {
241
256
  s.textContent = e.url;
242
257
  }
243
258
  r.appendChild(s), i.appendChild(r), i.addEventListener("mousedown", (o) => {
244
- o.preventDefault(), this.selectItem(t);
259
+ o.preventDefault(), o.stopPropagation(), this.selectItem(t);
260
+ }), i.addEventListener("click", (o) => {
261
+ o.preventDefault(), o.stopPropagation(), this.selectItem(t);
245
262
  }), i.addEventListener("mouseenter", () => {
246
263
  this.selectedIndex = t, this.renderDropdown();
247
264
  }), this.dropdown.appendChild(i);
@@ -256,17 +273,17 @@ class Xt {
256
273
  r + t.height > i - 8 && (r = e.top - t.height - 4), a = Math.max(8, Math.min(a, window.innerWidth - t.width - 8)), this.dropdown.style.top = `${r}px`, this.dropdown.style.left = `${a}px`;
257
274
  }
258
275
  async selectItem(e) {
259
- const t = this.items[e];
260
- if (!t || !this.trigger) return;
261
- const { head: i } = this.view.state.selection.main, r = this.trigger.from;
262
- this.view.dispatch({
263
- changes: { from: r, to: i, insert: "" }
276
+ const t = this.items[e], i = this.trigger;
277
+ if (!t || !i) return;
278
+ const r = i.from, a = this.activeHead;
279
+ this.view.focus(), this.view.dispatch({
280
+ changes: { from: r, to: a, insert: "" }
264
281
  });
265
- const a = await this.buildInsertion(t);
282
+ const s = await this.buildInsertion(t);
266
283
  this.view.dispatch({
267
- changes: { from: r, insert: a },
268
- selection: { anchor: r + a.length }
269
- }), this.hide(), this.view.focus();
284
+ changes: { from: r, insert: s },
285
+ selection: { anchor: r + s.length }
286
+ }), this.hide();
270
287
  }
271
288
  /**
272
289
  * Build the markdown insertion string for a selected document.
@@ -281,7 +298,7 @@ class Xt {
281
298
  thumbnail: e.thumbnail,
282
299
  description: e.description
283
300
  };
284
- if ((!i.thumbnail || !i.description) && this.options.onFetchDocMeta)
301
+ if (!i.thumbnail || !i.description)
285
302
  try {
286
303
  const o = await this.options.onFetchDocMeta(e.url);
287
304
  i = {
@@ -310,16 +327,16 @@ class Xt {
310
327
  this.destroyed = !0, this.hide();
311
328
  }
312
329
  }
313
- const Vt = /^:::doc-link\s+(\S+)(?:\s+(.+))?$/, Qt = /^:::\s*$/;
314
- function Jt(n) {
330
+ const Jt = /^:::doc-link\s+(\S+)(?:\s+(.+))?$/, jt = /^:::\s*$/;
331
+ function en(n) {
315
332
  n.block.ruler.before("fence", "doclink_block", (e, t, i, r) => {
316
- const s = e.src.slice(e.bMarks[t], e.eMarks[t]).match(Vt);
333
+ const s = e.src.slice(e.bMarks[t], e.eMarks[t]).match(Jt);
317
334
  if (!s) return !1;
318
335
  const o = s[1] ?? "";
319
336
  let c = t + 1, l = !1;
320
337
  for (; c < i; ) {
321
- const b = e.src.slice(e.bMarks[c], e.eMarks[c]);
322
- if (Qt.test(b.trim())) {
338
+ const f = e.src.slice(e.bMarks[c], e.eMarks[c]);
339
+ if (jt.test(f.trim())) {
323
340
  l = !0;
324
341
  break;
325
342
  }
@@ -328,19 +345,19 @@ function Jt(n) {
328
345
  if (!l) return !1;
329
346
  if (r) return !0;
330
347
  const d = e.src.slice(e.bMarks[t + 1], e.bMarks[c]).split(`
331
- `).map((b) => b.trim()).filter((b) => b.length > 0);
332
- let h = "", g = "";
348
+ `).map((f) => f.trim()).filter((f) => f.length > 0);
349
+ let h = "", p = "";
333
350
  const m = [];
334
- for (const b of d)
335
- if (b.startsWith("# "))
336
- h = b.slice(2).trim();
337
- else if (b.startsWith("![thumbnail](")) {
338
- const w = b.match(/^!\[thumbnail\]\((.+)\)$/);
339
- w && (g = w[1] ?? "");
351
+ for (const f of d)
352
+ if (f.startsWith("# "))
353
+ h = f.slice(2).trim();
354
+ else if (f.startsWith("![thumbnail](")) {
355
+ const v = f.match(/^!\[thumbnail\]\((.+)\)$/);
356
+ v && (p = v[1] ?? "");
340
357
  } else
341
- m.push(b);
358
+ m.push(f);
342
359
  const y = e.push("doclink_block", "div", 0);
343
- return y.content = JSON.stringify({ url: o, title: h, thumbnail: g, description: m.join(" ") }), e.line = c + 1, !0;
360
+ return y.content = JSON.stringify({ url: o, title: h, thumbnail: p, description: m.join(" ") }), e.line = c + 1, !0;
344
361
  }), n.renderer.rules.doclink_block = (e, t) => {
345
362
  const i = e[t];
346
363
  if (!i) return "";
@@ -356,17 +373,17 @@ function Jt(n) {
356
373
  l = new URL(a).hostname;
357
374
  } catch {
358
375
  }
359
- const d = o ? `<div class="md-editor-doclink-card-thumb"><img src="${He(o)}" alt="" loading="lazy" /></div>` : "";
360
- return `<a class="md-editor-doclink-card" href="${He(a)}" target="_blank" rel="noopener noreferrer"><div class="md-editor-doclink-card-body"><div class="md-editor-doclink-card-title">${Te(s)}</div>` + (c ? `<div class="md-editor-doclink-card-desc">${Te(c)}</div>` : "") + `<div class="md-editor-doclink-card-url">${Te(l)}</div></div>` + d + "</a>";
376
+ const d = o ? `<div class="md-editor-doclink-card-thumb"><img src="${Fe(o)}" alt="" loading="lazy" /></div>` : "";
377
+ return `<a class="md-editor-doclink-card" href="${Fe(a)}" target="_blank" rel="noopener noreferrer"><div class="md-editor-doclink-card-body"><div class="md-editor-doclink-card-title">${Te(s)}</div>` + (c ? `<div class="md-editor-doclink-card-desc">${Te(c)}</div>` : "") + `<div class="md-editor-doclink-card-url">${Te(l)}</div></div>` + d + "</a>";
361
378
  };
362
379
  }
363
380
  function Te(n) {
364
381
  return n.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
365
382
  }
366
- function He(n) {
383
+ function Fe(n) {
367
384
  return n.replace(/"/g, "&quot;").replace(/</g, "&lt;");
368
385
  }
369
- class jt {
386
+ class tn {
370
387
  constructor(e, t) {
371
388
  var r, a;
372
389
  this.lineNumbersCompartment = new Be(), this.customKeymapCompartment = new Be(), this.mention = null, this.docLink = null, this.onImageFile = t.onImageFile;
@@ -398,9 +415,9 @@ class jt {
398
415
  })
399
416
  ];
400
417
  this.view = new ge({
401
- state: Ht.create({ doc: t.value ?? "", extensions: i }),
418
+ state: Ft.create({ doc: t.value ?? "", extensions: i }),
402
419
  parent: e
403
- }), (r = t.mention) != null && r.onMentionSearch && (this.mention = new Zt(this.view, t.mention)), (a = t.docLink) != null && a.onDocSearch && (this.docLink = new Xt(this.view, t.docLink));
420
+ }), (r = t.mention) != null && r.onMentionSearch && (this.mention = new Zt(this.view, t.mention)), (a = t.docLink) != null && a.onDocSearch && (this.docLink = new Qt(this.view, t.docLink));
404
421
  }
405
422
  handlePaste(e) {
406
423
  var i, r;
@@ -522,17 +539,13 @@ class jt {
522
539
  */
523
540
  toggleTaskList() {
524
541
  const { from: e, to: t } = this.view.state.selection.main, i = this.view.state.doc.lineAt(e), r = this.view.state.doc.lineAt(t), a = [];
525
- for (let d = i.number; d <= r.number; d++)
526
- a.push(this.view.state.doc.line(d).text);
527
- const s = a.every(
528
- (d) => /^- \[[ xX]\]\s/.test(d) || /^- \[[ xX]\]$/.test(d)
529
- ), o = a.every(
530
- (d) => /^- \[ \]\s/.test(d) || /^- \[ \]$/.test(d)
531
- ), l = a.map((d) => s ? o ? d.replace(/^- \[ \](\s?)/, "- [x]$1") : d.replace(/^- \[[xX]\](\s?)/, "- [ ]$1") : /^-(\s|$)/.test(d) ? d.replace(/^-(\s?)/, "- [ ]$1") : `- [ ] ${d}`).join(`
542
+ for (let p = i.number; p <= r.number; p++)
543
+ a.push(this.view.state.doc.line(p).text);
544
+ const s = /^- \[\s*(?:[xX])?\s*\](\s|$)/, o = /^- \[\s*\](\s|$)/, c = a.every((p) => s.test(p)), l = a.every((p) => o.test(p)), h = a.map((p) => c ? l ? p.replace(/^- \[\s*\](\s?)/, "- [x]$1") : p.replace(/^- \[\s*[xX]\s*\](\s?)/, "- [ ]$1") : /^-(\s|$)/.test(p) ? p.replace(/^-(\s?)/, "- [ ]$1") : `- [ ] ${p}`).join(`
532
545
  `);
533
546
  this.view.dispatch({
534
- changes: { from: i.from, to: r.to, insert: l },
535
- selection: { anchor: i.from, head: i.from + l.length }
547
+ changes: { from: i.from, to: r.to, insert: h },
548
+ selection: { anchor: i.from, head: i.from + h.length }
536
549
  }), this.view.focus();
537
550
  }
538
551
  destroy() {
@@ -540,11 +553,11 @@ class jt {
540
553
  (e = this.mention) == null || e.destroy(), (t = this.docLink) == null || t.destroy(), this.view.destroy();
541
554
  }
542
555
  }
543
- const en = /^\$([^$\n]+?)\$/;
544
- function tn(n) {
556
+ const nn = /^\$([^$\n]+?)\$/;
557
+ function rn(n) {
545
558
  return /^[\d.,]+$/.test(n.trim());
546
559
  }
547
- function nn(n) {
560
+ function sn(n) {
548
561
  n.block.ruler.before("fence", "math_block", (e, t, i, r) => {
549
562
  const a = e.src.slice(e.bMarks[t], e.eMarks[t]);
550
563
  if (!a.startsWith("$$")) return !1;
@@ -570,7 +583,7 @@ function nn(n) {
570
583
  var r;
571
584
  const i = ((r = e[t]) == null ? void 0 : r.content) ?? "";
572
585
  try {
573
- return `<div class="md-editor-math-block">${Fe.renderToString(i, {
586
+ return `<div class="md-editor-math-block">${He.renderToString(i, {
574
587
  displayMode: !0,
575
588
  throwOnError: !1,
576
589
  strict: !1
@@ -580,10 +593,10 @@ function nn(n) {
580
593
  }
581
594
  }, n.inline.ruler.after("escape", "math_inline", (e, t) => {
582
595
  if (e.src[e.pos] !== "$" || e.src[e.pos + 1] === "$") return !1;
583
- const i = e.src.slice(e.pos).match(en);
596
+ const i = e.src.slice(e.pos).match(nn);
584
597
  if (!i) return !1;
585
598
  const r = i[1] ?? "";
586
- if (tn(r)) return !1;
599
+ if (rn(r)) return !1;
587
600
  if (t) return !0;
588
601
  const a = e.push("math_inline", "span", 0);
589
602
  return a.content = r, a.markup = "$", e.pos += i[0].length, !0;
@@ -591,7 +604,7 @@ function nn(n) {
591
604
  var r;
592
605
  const i = ((r = e[t]) == null ? void 0 : r.content) ?? "";
593
606
  try {
594
- return Fe.renderToString(i, {
607
+ return He.renderToString(i, {
595
608
  displayMode: !1,
596
609
  throwOnError: !1,
597
610
  strict: !1
@@ -613,7 +626,7 @@ typeof globalThis.ResizeObserver > "u" && (globalThis.ResizeObserver = class {
613
626
  }
614
627
  });
615
628
  let Ke = 0;
616
- function rn(n) {
629
+ function on(n) {
617
630
  n.block.ruler.before(
618
631
  "fence",
619
632
  "mindmap_fence",
@@ -622,13 +635,13 @@ function rn(n) {
622
635
  if (!l) return !1;
623
636
  if (a) return !0;
624
637
  const d = l[1].length;
625
- let h = i + 1, g = 1;
638
+ let h = i + 1, p = 1;
626
639
  for (; h < r; ) {
627
- const b = t.bMarks[h] + t.tShift[h], w = t.eMarks[h], O = t.src.slice(b, w).match(/^(`{3,})\s*(.*)$/);
640
+ const f = t.bMarks[h] + t.tShift[h], v = t.eMarks[h], O = t.src.slice(f, v).match(/^(`{3,})\s*(.*)$/);
628
641
  if (O && O[1].length >= d) {
629
642
  if (O[2].trim())
630
- g++;
631
- else if (g--, g === 0) break;
643
+ p++;
644
+ else if (p--, p === 0) break;
632
645
  }
633
646
  h++;
634
647
  }
@@ -657,8 +670,8 @@ function rn(n) {
657
670
  return e(t, i, r, a, s);
658
671
  };
659
672
  }
660
- const sn = 600, on = 320;
661
- async function an(n) {
673
+ const an = 600, cn = 320;
674
+ async function ln(n) {
662
675
  const e = n.querySelectorAll(
663
676
  ".md-editor-mindmap:not([data-hydrated])"
664
677
  );
@@ -670,14 +683,14 @@ async function an(n) {
670
683
  s.setAttribute("data-hydrated", "1");
671
684
  const o = decodeURIComponent(s.dataset.source ?? "") || "- Empty mindmap", { root: c } = a.transform(o);
672
685
  s.innerHTML = "";
673
- const l = s.clientWidth > 0 ? s.clientWidth : sn, d = s.clientHeight > 0 ? s.clientHeight : on, h = document.createElementNS("http://www.w3.org/2000/svg", "svg");
686
+ const l = s.clientWidth > 0 ? s.clientWidth : an, d = s.clientHeight > 0 ? s.clientHeight : cn, h = document.createElementNS("http://www.w3.org/2000/svg", "svg");
674
687
  h.setAttribute("width", String(l)), h.setAttribute("height", String(d)), h.style.width = "100%", h.style.height = "100%", h.style.display = "block", s.appendChild(h);
675
- const g = r.create(h, { autoFit: !1 }, c), m = () => {
688
+ const p = r.create(h, { autoFit: !1 }, c), m = () => {
676
689
  try {
677
- const b = h.querySelector("g");
678
- if (b) {
679
- const w = b.getAttribute("transform") || "";
680
- (!w || w.includes("NaN")) && b.setAttribute(
690
+ const f = h.querySelector("g");
691
+ if (f) {
692
+ const v = f.getAttribute("transform") || "";
693
+ (!v || v.includes("NaN")) && f.setAttribute(
681
694
  "transform",
682
695
  `translate(40, ${d / 2}) scale(1)`
683
696
  );
@@ -685,17 +698,17 @@ async function an(n) {
685
698
  } catch {
686
699
  }
687
700
  };
688
- m(), (typeof requestAnimationFrame == "function" ? requestAnimationFrame : (b) => setTimeout(b, 16))(() => {
689
- var b;
701
+ m(), (typeof requestAnimationFrame == "function" ? requestAnimationFrame : (f) => setTimeout(f, 16))(() => {
702
+ var f;
690
703
  try {
691
- const w = h.getBoundingClientRect();
692
- w.width > 0 && w.height > 0 && ((b = g.fit) == null || b.call(g), m());
704
+ const v = h.getBoundingClientRect();
705
+ v.width > 0 && v.height > 0 && ((f = p.fit) == null || f.call(p), m());
693
706
  } catch {
694
707
  }
695
708
  });
696
709
  }
697
710
  }
698
- function cn(n) {
711
+ function dn(n) {
699
712
  return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
700
713
  }
701
714
  function it(n) {
@@ -732,7 +745,7 @@ function Q(n, ...e) {
732
745
  }), /** @type {T} */
733
746
  t;
734
747
  }
735
- const ln = "</span>", qe = (n) => !!n.scope, dn = (n, { prefix: e }) => {
748
+ const un = "</span>", qe = (n) => !!n.scope, hn = (n, { prefix: e }) => {
736
749
  if (n.startsWith("language:"))
737
750
  return n.replace("language:", "language-");
738
751
  if (n.includes(".")) {
@@ -744,7 +757,7 @@ const ln = "</span>", qe = (n) => !!n.scope, dn = (n, { prefix: e }) => {
744
757
  }
745
758
  return `${e}${n}`;
746
759
  };
747
- class un {
760
+ class pn {
748
761
  /**
749
762
  * Creates a new HTMLRenderer
750
763
  *
@@ -767,7 +780,7 @@ class un {
767
780
  * @param {Node} node */
768
781
  openNode(e) {
769
782
  if (!qe(e)) return;
770
- const t = dn(
783
+ const t = hn(
771
784
  e.scope,
772
785
  { prefix: this.classPrefix }
773
786
  );
@@ -778,7 +791,7 @@ class un {
778
791
  *
779
792
  * @param {Node} node */
780
793
  closeNode(e) {
781
- qe(e) && (this.buffer += ln);
794
+ qe(e) && (this.buffer += un);
782
795
  }
783
796
  /**
784
797
  * returns the accumulated buffer
@@ -851,7 +864,7 @@ class Ae {
851
864
  }));
852
865
  }
853
866
  }
854
- class hn extends Ae {
867
+ class gn extends Ae {
855
868
  /**
856
869
  * @param {*} options
857
870
  */
@@ -880,7 +893,7 @@ class hn extends Ae {
880
893
  t && (i.scope = `language:${t}`), this.add(i);
881
894
  }
882
895
  toHTML() {
883
- return new un(this, this.options).value();
896
+ return new pn(this, this.options).value();
884
897
  }
885
898
  finalize() {
886
899
  return this.closeAllNodes(), !0;
@@ -892,30 +905,30 @@ function de(n) {
892
905
  function st(n) {
893
906
  return te("(?=", n, ")");
894
907
  }
895
- function pn(n) {
908
+ function mn(n) {
896
909
  return te("(?:", n, ")*");
897
910
  }
898
- function gn(n) {
911
+ function fn(n) {
899
912
  return te("(?:", n, ")?");
900
913
  }
901
914
  function te(...n) {
902
915
  return n.map((t) => de(t)).join("");
903
916
  }
904
- function mn(n) {
917
+ function bn(n) {
905
918
  const e = n[n.length - 1];
906
919
  return typeof e == "object" && e.constructor === Object ? (n.splice(n.length - 1, 1), e) : {};
907
920
  }
908
921
  function ye(...n) {
909
- return "(" + (mn(n).capture ? "" : "?:") + n.map((i) => de(i)).join("|") + ")";
922
+ return "(" + (bn(n).capture ? "" : "?:") + n.map((i) => de(i)).join("|") + ")";
910
923
  }
911
924
  function ot(n) {
912
925
  return new RegExp(n.toString() + "|").exec("").length - 1;
913
926
  }
914
- function fn(n, e) {
927
+ function _n(n, e) {
915
928
  const t = n && n.exec(e);
916
929
  return t && t.index === 0;
917
930
  }
918
- const bn = new RegExp(ye(
931
+ const En = new RegExp(ye(
919
932
  /\[(?:[^\\\]]|\\.)*\]/,
920
933
  // a character class, inside which ( and \ lose their meaning
921
934
  /\(\?<(?![=!])[^>]+>/,
@@ -936,7 +949,7 @@ function xe(n, { joinWith: e }) {
936
949
  const r = t;
937
950
  let a = de(i), s = "";
938
951
  for (; a.length > 0; ) {
939
- const o = bn.exec(a);
952
+ const o = En.exec(a);
940
953
  if (!o) {
941
954
  s += a;
942
955
  break;
@@ -946,7 +959,7 @@ function xe(n, { joinWith: e }) {
946
959
  return s;
947
960
  }).map((i) => `(${i})`).join(e);
948
961
  }
949
- const _n = /\b\B/, at = "[a-zA-Z]\\w*", Ce = "[a-zA-Z_]\\w*", ct = "\\b\\d+(\\.\\d+)?", lt = "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)", dt = "\\b(0b[01]+)", En = "!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", yn = (n = {}) => {
962
+ const yn = /\b\B/, at = "[a-zA-Z]\\w*", Ce = "[a-zA-Z_]\\w*", ct = "\\b\\d+(\\.\\d+)?", lt = "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)", dt = "\\b(0b[01]+)", wn = "!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", vn = (n = {}) => {
950
963
  const e = /^#![ ]*\//;
951
964
  return n.binary && (n.begin = te(
952
965
  e,
@@ -966,19 +979,19 @@ const _n = /\b\B/, at = "[a-zA-Z]\\w*", Ce = "[a-zA-Z_]\\w*", ct = "\\b\\d+(\\.\
966
979
  }, ue = {
967
980
  begin: "\\\\[\\s\\S]",
968
981
  relevance: 0
969
- }, wn = {
982
+ }, kn = {
970
983
  scope: "string",
971
984
  begin: "'",
972
985
  end: "'",
973
986
  illegal: "\\n",
974
987
  contains: [ue]
975
- }, vn = {
988
+ }, Nn = {
976
989
  scope: "string",
977
990
  begin: '"',
978
991
  end: '"',
979
992
  illegal: "\\n",
980
993
  contains: [ue]
981
- }, kn = {
994
+ }, Tn = {
982
995
  begin: /\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/
983
996
  }, we = function(n, e, t = {}) {
984
997
  const i = Q(
@@ -1046,19 +1059,19 @@ const _n = /\b\B/, at = "[a-zA-Z]\\w*", Ce = "[a-zA-Z_]\\w*", ct = "\\b\\d+(\\.\
1046
1059
  // look for 3 words in a row
1047
1060
  }
1048
1061
  ), i;
1049
- }, Nn = we("//", "$"), Tn = we("/\\*", "\\*/"), Sn = we("#", "$"), An = {
1062
+ }, Sn = we("//", "$"), An = we("/\\*", "\\*/"), xn = we("#", "$"), Cn = {
1050
1063
  scope: "number",
1051
1064
  begin: ct,
1052
1065
  relevance: 0
1053
- }, xn = {
1066
+ }, Mn = {
1054
1067
  scope: "number",
1055
1068
  begin: lt,
1056
1069
  relevance: 0
1057
- }, Cn = {
1070
+ }, Rn = {
1058
1071
  scope: "number",
1059
1072
  begin: dt,
1060
1073
  relevance: 0
1061
- }, Mn = {
1074
+ }, On = {
1062
1075
  scope: "regexp",
1063
1076
  begin: /\/(?=[^/\n]*\/)/,
1064
1077
  end: /\/[gimuy]*/,
@@ -1071,19 +1084,19 @@ const _n = /\b\B/, at = "[a-zA-Z]\\w*", Ce = "[a-zA-Z_]\\w*", ct = "\\b\\d+(\\.\
1071
1084
  contains: [ue]
1072
1085
  }
1073
1086
  ]
1074
- }, Rn = {
1087
+ }, In = {
1075
1088
  scope: "title",
1076
1089
  begin: at,
1077
1090
  relevance: 0
1078
- }, On = {
1091
+ }, Ln = {
1079
1092
  scope: "title",
1080
1093
  begin: Ce,
1081
1094
  relevance: 0
1082
- }, In = {
1095
+ }, Dn = {
1083
1096
  // excludes method names from keyword processing
1084
1097
  begin: "\\.\\s*" + Ce,
1085
1098
  relevance: 0
1086
- }, Ln = function(n) {
1099
+ }, Pn = function(n) {
1087
1100
  return Object.assign(
1088
1101
  n,
1089
1102
  {
@@ -1100,53 +1113,53 @@ const _n = /\b\B/, at = "[a-zA-Z]\\w*", Ce = "[a-zA-Z_]\\w*", ct = "\\b\\d+(\\.\
1100
1113
  };
1101
1114
  var me = /* @__PURE__ */ Object.freeze({
1102
1115
  __proto__: null,
1103
- APOS_STRING_MODE: wn,
1116
+ APOS_STRING_MODE: kn,
1104
1117
  BACKSLASH_ESCAPE: ue,
1105
- BINARY_NUMBER_MODE: Cn,
1118
+ BINARY_NUMBER_MODE: Rn,
1106
1119
  BINARY_NUMBER_RE: dt,
1107
1120
  COMMENT: we,
1108
- C_BLOCK_COMMENT_MODE: Tn,
1109
- C_LINE_COMMENT_MODE: Nn,
1110
- C_NUMBER_MODE: xn,
1121
+ C_BLOCK_COMMENT_MODE: An,
1122
+ C_LINE_COMMENT_MODE: Sn,
1123
+ C_NUMBER_MODE: Mn,
1111
1124
  C_NUMBER_RE: lt,
1112
- END_SAME_AS_BEGIN: Ln,
1113
- HASH_COMMENT_MODE: Sn,
1125
+ END_SAME_AS_BEGIN: Pn,
1126
+ HASH_COMMENT_MODE: xn,
1114
1127
  IDENT_RE: at,
1115
- MATCH_NOTHING_RE: _n,
1116
- METHOD_GUARD: In,
1117
- NUMBER_MODE: An,
1128
+ MATCH_NOTHING_RE: yn,
1129
+ METHOD_GUARD: Dn,
1130
+ NUMBER_MODE: Cn,
1118
1131
  NUMBER_RE: ct,
1119
- PHRASAL_WORDS_MODE: kn,
1120
- QUOTE_STRING_MODE: vn,
1121
- REGEXP_MODE: Mn,
1122
- RE_STARTERS_RE: En,
1123
- SHEBANG: yn,
1124
- TITLE_MODE: Rn,
1132
+ PHRASAL_WORDS_MODE: Tn,
1133
+ QUOTE_STRING_MODE: Nn,
1134
+ REGEXP_MODE: On,
1135
+ RE_STARTERS_RE: wn,
1136
+ SHEBANG: vn,
1137
+ TITLE_MODE: In,
1125
1138
  UNDERSCORE_IDENT_RE: Ce,
1126
- UNDERSCORE_TITLE_MODE: On
1139
+ UNDERSCORE_TITLE_MODE: Ln
1127
1140
  });
1128
- function Dn(n, e) {
1141
+ function Bn(n, e) {
1129
1142
  n.input[n.index - 1] === "." && e.ignoreMatch();
1130
1143
  }
1131
- function Pn(n, e) {
1144
+ function $n(n, e) {
1132
1145
  n.className !== void 0 && (n.scope = n.className, delete n.className);
1133
1146
  }
1134
- function Bn(n, e) {
1135
- e && n.beginKeywords && (n.begin = "\\b(" + n.beginKeywords.split(" ").join("|") + ")(?!\\.)(?=\\b|\\s)", n.__beforeBegin = Dn, n.keywords = n.keywords || n.beginKeywords, delete n.beginKeywords, n.relevance === void 0 && (n.relevance = 0));
1147
+ function Un(n, e) {
1148
+ e && n.beginKeywords && (n.begin = "\\b(" + n.beginKeywords.split(" ").join("|") + ")(?!\\.)(?=\\b|\\s)", n.__beforeBegin = Bn, n.keywords = n.keywords || n.beginKeywords, delete n.beginKeywords, n.relevance === void 0 && (n.relevance = 0));
1136
1149
  }
1137
- function $n(n, e) {
1150
+ function Hn(n, e) {
1138
1151
  Array.isArray(n.illegal) && (n.illegal = ye(...n.illegal));
1139
1152
  }
1140
- function Un(n, e) {
1153
+ function Fn(n, e) {
1141
1154
  if (n.match) {
1142
1155
  if (n.begin || n.end) throw new Error("begin & end are not supported with match");
1143
1156
  n.begin = n.match, delete n.match;
1144
1157
  }
1145
1158
  }
1146
- function Fn(n, e) {
1159
+ function zn(n, e) {
1147
1160
  n.relevance === void 0 && (n.relevance = 1);
1148
1161
  }
1149
- const Hn = (n, e) => {
1162
+ const Kn = (n, e) => {
1150
1163
  if (!n.beforeMatch) return;
1151
1164
  if (n.starts) throw new Error("beforeMatch cannot be used with starts");
1152
1165
  const t = Object.assign({}, n);
@@ -1158,7 +1171,7 @@ const Hn = (n, e) => {
1158
1171
  Object.assign(t, { endsParent: !0 })
1159
1172
  ]
1160
1173
  }, n.relevance = 0, delete t.beforeMatch;
1161
- }, zn = [
1174
+ }, Gn = [
1162
1175
  "of",
1163
1176
  "and",
1164
1177
  "for",
@@ -1173,8 +1186,8 @@ const Hn = (n, e) => {
1173
1186
  // common variable name
1174
1187
  "value"
1175
1188
  // common variable name
1176
- ], Kn = "keyword";
1177
- function ut(n, e, t = Kn) {
1189
+ ], qn = "keyword";
1190
+ function ut(n, e, t = qn) {
1178
1191
  const i = /* @__PURE__ */ Object.create(null);
1179
1192
  return typeof n == "string" ? r(t, n.split(" ")) : Array.isArray(n) ? r(t, n) : Object.keys(n).forEach(function(a) {
1180
1193
  Object.assign(
@@ -1185,15 +1198,15 @@ function ut(n, e, t = Kn) {
1185
1198
  function r(a, s) {
1186
1199
  e && (s = s.map((o) => o.toLowerCase())), s.forEach(function(o) {
1187
1200
  const c = o.split("|");
1188
- i[c[0]] = [a, Gn(c[0], c[1])];
1201
+ i[c[0]] = [a, Wn(c[0], c[1])];
1189
1202
  });
1190
1203
  }
1191
1204
  }
1192
- function Gn(n, e) {
1193
- return e ? Number(e) : qn(n) ? 0 : 1;
1205
+ function Wn(n, e) {
1206
+ return e ? Number(e) : Yn(n) ? 0 : 1;
1194
1207
  }
1195
- function qn(n) {
1196
- return zn.includes(n.toLowerCase());
1208
+ function Yn(n) {
1209
+ return Gn.includes(n.toLowerCase());
1197
1210
  }
1198
1211
  const Ye = {}, ee = (n) => {
1199
1212
  console.error(n);
@@ -1209,7 +1222,7 @@ function ht(n, e, { key: t }) {
1209
1222
  s[o + i] = r[o], a[o + i] = !0, i += ot(e[o - 1]);
1210
1223
  n[t] = s, n[t]._emit = a, n[t]._multi = !0;
1211
1224
  }
1212
- function Wn(n) {
1225
+ function Zn(n) {
1213
1226
  if (Array.isArray(n.begin)) {
1214
1227
  if (n.skip || n.excludeBegin || n.returnBegin)
1215
1228
  throw ee("skip, excludeBegin, returnBegin not compatible with beginScope: {}"), _e;
@@ -1218,7 +1231,7 @@ function Wn(n) {
1218
1231
  ht(n, n.begin, { key: "beginScope" }), n.begin = xe(n.begin, { joinWith: "" });
1219
1232
  }
1220
1233
  }
1221
- function Yn(n) {
1234
+ function Vn(n) {
1222
1235
  if (Array.isArray(n.end)) {
1223
1236
  if (n.skip || n.excludeEnd || n.returnEnd)
1224
1237
  throw ee("skip, excludeEnd, returnEnd not compatible with endScope: {}"), _e;
@@ -1227,13 +1240,13 @@ function Yn(n) {
1227
1240
  ht(n, n.end, { key: "endScope" }), n.end = xe(n.end, { joinWith: "" });
1228
1241
  }
1229
1242
  }
1230
- function Zn(n) {
1243
+ function Xn(n) {
1231
1244
  n.scope && typeof n.scope == "object" && n.scope !== null && (n.beginScope = n.scope, delete n.scope);
1232
1245
  }
1233
- function Xn(n) {
1234
- Zn(n), typeof n.beginScope == "string" && (n.beginScope = { _wrap: n.beginScope }), typeof n.endScope == "string" && (n.endScope = { _wrap: n.endScope }), Wn(n), Yn(n);
1246
+ function Qn(n) {
1247
+ Xn(n), typeof n.beginScope == "string" && (n.beginScope = { _wrap: n.beginScope }), typeof n.endScope == "string" && (n.endScope = { _wrap: n.endScope }), Zn(n), Vn(n);
1235
1248
  }
1236
- function Vn(n) {
1249
+ function Jn(n) {
1237
1250
  function e(s, o) {
1238
1251
  return new RegExp(
1239
1252
  de(s),
@@ -1259,7 +1272,7 @@ function Vn(n) {
1259
1272
  const c = this.matcherRe.exec(o);
1260
1273
  if (!c)
1261
1274
  return null;
1262
- const l = c.findIndex((h, g) => g > 0 && h !== void 0), d = this.matchIndexes[l];
1275
+ const l = c.findIndex((h, p) => p > 0 && h !== void 0), d = this.matchIndexes[l];
1263
1276
  return c.splice(0, l), Object.assign(c, d);
1264
1277
  }
1265
1278
  }
@@ -1306,26 +1319,26 @@ function Vn(n) {
1306
1319
  );
1307
1320
  if (s.isCompiled) return c;
1308
1321
  [
1309
- Pn,
1322
+ $n,
1310
1323
  // do this early so compiler extensions generally don't have to worry about
1311
1324
  // the distinction between match/begin
1312
- Un,
1313
- Xn,
1314
- Hn
1325
+ Fn,
1326
+ Qn,
1327
+ Kn
1315
1328
  ].forEach((d) => d(s, o)), n.compilerExtensions.forEach((d) => d(s, o)), s.__beforeBegin = null, [
1316
- Bn,
1329
+ Un,
1317
1330
  // do this later so compiler extensions that come earlier have access to the
1318
1331
  // raw array if they wanted to perhaps manipulate it, etc.
1319
- $n,
1332
+ Hn,
1320
1333
  // default to 1 relevance if not specified
1321
- Fn
1334
+ zn
1322
1335
  ].forEach((d) => d(s, o)), s.isCompiled = !0;
1323
1336
  let l = null;
1324
1337
  return typeof s.keywords == "object" && s.keywords.$pattern && (s.keywords = Object.assign({}, s.keywords), l = s.keywords.$pattern, delete s.keywords.$pattern), l = l || /\w+/, s.keywords && (s.keywords = ut(s.keywords, n.case_insensitive)), c.keywordPatternRe = e(l, !0), o && (s.begin || (s.begin = /\B|\b/), c.beginRe = e(c.begin), !s.end && !s.endsWithParent && (s.end = /\B|\b/), s.end && (c.endRe = e(c.end)), c.terminatorEnd = de(c.end) || "", s.endsWithParent && o.terminatorEnd && (c.terminatorEnd += (s.end ? "|" : "") + o.terminatorEnd)), s.illegal && (c.illegalRe = e(
1325
1338
  /** @type {RegExp | string} */
1326
1339
  s.illegal
1327
1340
  )), s.contains || (s.contains = []), s.contains = [].concat(...s.contains.map(function(d) {
1328
- return Qn(d === "self" ? s : d);
1341
+ return jn(d === "self" ? s : d);
1329
1342
  })), s.contains.forEach(function(d) {
1330
1343
  a(
1331
1344
  /** @type Mode */
@@ -1344,18 +1357,18 @@ function Vn(n) {
1344
1357
  function pt(n) {
1345
1358
  return n ? n.endsWithParent || pt(n.starts) : !1;
1346
1359
  }
1347
- function Qn(n) {
1360
+ function jn(n) {
1348
1361
  return n.variants && !n.cachedVariants && (n.cachedVariants = n.variants.map(function(e) {
1349
1362
  return Q(n, { variants: null }, e);
1350
1363
  })), n.cachedVariants ? n.cachedVariants : pt(n) ? Q(n, { starts: n.starts ? Q(n.starts) : null }) : Object.isFrozen(n) ? Q(n) : n;
1351
1364
  }
1352
- var Jn = "11.12.0";
1353
- class jn extends Error {
1365
+ var ei = "11.12.0";
1366
+ class ti extends Error {
1354
1367
  constructor(e, t) {
1355
1368
  super(e), this.name = "HTMLInjectionError", this.html = t;
1356
1369
  }
1357
1370
  }
1358
- const Se = rt, Xe = Q, Ve = Symbol("nomatch"), ei = 7, gt = function(n) {
1371
+ const Se = rt, Ve = Q, Xe = Symbol("nomatch"), ni = 7, gt = function(n) {
1359
1372
  const e = /* @__PURE__ */ Object.create(null), t = /* @__PURE__ */ Object.create(null), i = [];
1360
1373
  let r = !0;
1361
1374
  const a = "Could not find the language '{}', did you forget to load/include a language module?", s = { disableAutodetect: !0, name: "Plain text", contains: [] };
@@ -1369,7 +1382,7 @@ const Se = rt, Xe = Q, Ve = Symbol("nomatch"), ei = 7, gt = function(n) {
1369
1382
  languages: null,
1370
1383
  // beta configuration options, subject to change, welcome to discuss
1371
1384
  // https://github.com/highlightjs/highlight.js/issues/1086
1372
- __emitter: hn
1385
+ __emitter: gn
1373
1386
  };
1374
1387
  function c(u) {
1375
1388
  return o.noHighlightRe.test(u);
@@ -1377,206 +1390,206 @@ const Se = rt, Xe = Q, Ve = Symbol("nomatch"), ei = 7, gt = function(n) {
1377
1390
  function l(u) {
1378
1391
  let _ = u.className + " ";
1379
1392
  _ += u.parentNode ? u.parentNode.className : "";
1380
- const f = o.languageDetectRe.exec(_);
1381
- if (f) {
1382
- const k = $(f[1]);
1383
- return k || (Ze(a.replace("{}", f[1])), Ze("Falling back to no-highlight mode for this block.", u)), k ? f[1] : "no-highlight";
1393
+ const b = o.languageDetectRe.exec(_);
1394
+ if (b) {
1395
+ const k = $(b[1]);
1396
+ return k || (Ze(a.replace("{}", b[1])), Ze("Falling back to no-highlight mode for this block.", u)), k ? b[1] : "no-highlight";
1384
1397
  }
1385
1398
  return _.split(/\s+/).find((k) => c(k) || $(k));
1386
1399
  }
1387
- function d(u, _, f) {
1400
+ function d(u, _, b) {
1388
1401
  let k = "", T = "";
1389
- typeof _ == "object" ? (k = u, f = _.ignoreIllegals, T = _.language) : (ne("10.7.0", "highlight(lang, code, ...args) has been deprecated."), ne("10.7.0", `Please use highlight(code, options) instead.
1390
- https://github.com/highlightjs/highlight.js/issues/2277`), T = u, k = _), f === void 0 && (f = !0);
1402
+ typeof _ == "object" ? (k = u, b = _.ignoreIllegals, T = _.language) : (ne("10.7.0", "highlight(lang, code, ...args) has been deprecated."), ne("10.7.0", `Please use highlight(code, options) instead.
1403
+ https://github.com/highlightjs/highlight.js/issues/2277`), T = u, k = _), b === void 0 && (b = !0);
1391
1404
  const P = {
1392
1405
  code: k,
1393
1406
  language: T
1394
1407
  };
1395
- V("before:highlight", P);
1396
- const z = P.result ? P.result : h(P.language, P.code, f);
1397
- return z.code = P.code, V("after:highlight", z), z;
1408
+ X("before:highlight", P);
1409
+ const z = P.result ? P.result : h(P.language, P.code, b);
1410
+ return z.code = P.code, X("after:highlight", z), z;
1398
1411
  }
1399
- function h(u, _, f, k) {
1412
+ function h(u, _, b, k) {
1400
1413
  const T = /* @__PURE__ */ Object.create(null);
1401
- function P(p, E) {
1402
- return p.keywords[E];
1414
+ function P(g, E) {
1415
+ return g.keywords[E];
1403
1416
  }
1404
1417
  function z() {
1405
- if (!v.keywords) {
1406
- H.addText(C);
1418
+ if (!w.keywords) {
1419
+ F.addText(M);
1407
1420
  return;
1408
1421
  }
1409
- let p = 0;
1410
- v.keywordPatternRe.lastIndex = 0;
1411
- let E = v.keywordPatternRe.exec(C), N = "";
1422
+ let g = 0;
1423
+ w.keywordPatternRe.lastIndex = 0;
1424
+ let E = w.keywordPatternRe.exec(M), N = "";
1412
1425
  for (; E; ) {
1413
- N += C.substring(p, E.index);
1414
- const A = Y.case_insensitive ? E[0].toLowerCase() : E[0], K = P(v, A);
1426
+ N += M.substring(g, E.index);
1427
+ const x = Y.case_insensitive ? E[0].toLowerCase() : E[0], K = P(w, x);
1415
1428
  if (K) {
1416
1429
  const [Z, Ut] = K;
1417
- if (H.addText(N), N = "", T[A] = (T[A] || 0) + 1, T[A] <= ei && (pe += Ut), Z.startsWith("_"))
1430
+ if (F.addText(N), N = "", T[x] = (T[x] || 0) + 1, T[x] <= ni && (pe += Ut), Z.startsWith("_"))
1418
1431
  N += E[0];
1419
1432
  else {
1420
- const Ft = Y.classNameAliases[Z] || Z;
1421
- W(E[0], Ft);
1433
+ const Ht = Y.classNameAliases[Z] || Z;
1434
+ W(E[0], Ht);
1422
1435
  }
1423
1436
  } else
1424
1437
  N += E[0];
1425
- p = v.keywordPatternRe.lastIndex, E = v.keywordPatternRe.exec(C);
1438
+ g = w.keywordPatternRe.lastIndex, E = w.keywordPatternRe.exec(M);
1426
1439
  }
1427
- N += C.substring(p), H.addText(N);
1440
+ N += M.substring(g), F.addText(N);
1428
1441
  }
1429
1442
  function q() {
1430
- if (C === "") return;
1431
- let p = null;
1432
- if (typeof v.subLanguage == "string") {
1433
- if (!e[v.subLanguage]) {
1434
- H.addText(C);
1443
+ if (M === "") return;
1444
+ let g = null;
1445
+ if (typeof w.subLanguage == "string") {
1446
+ if (!e[w.subLanguage]) {
1447
+ F.addText(M);
1435
1448
  return;
1436
1449
  }
1437
- p = h(v.subLanguage, C, !0, Pe[v.subLanguage]), Pe[v.subLanguage] = /** @type {CompiledMode} */
1438
- p._top;
1450
+ g = h(w.subLanguage, M, !0, Pe[w.subLanguage]), Pe[w.subLanguage] = /** @type {CompiledMode} */
1451
+ g._top;
1439
1452
  } else
1440
- p = m(C, v.subLanguage.length ? v.subLanguage : null);
1441
- v.relevance > 0 && (pe += p.relevance), H.__addSublanguage(p._emitter, p.language);
1453
+ g = m(M, w.subLanguage.length ? w.subLanguage : null);
1454
+ w.relevance > 0 && (pe += g.relevance), F.__addSublanguage(g._emitter, g.language);
1442
1455
  }
1443
1456
  function G() {
1444
- v.subLanguage != null ? q() : z(), C = "";
1457
+ w.subLanguage != null ? q() : z(), M = "";
1445
1458
  }
1446
- function W(p, E) {
1447
- p !== "" && (H.startScope(E), H.addText(p), H.endScope());
1459
+ function W(g, E) {
1460
+ g !== "" && (F.startScope(E), F.addText(g), F.endScope());
1448
1461
  }
1449
- function Oe(p, E) {
1462
+ function Oe(g, E) {
1450
1463
  let N = 1;
1451
- const A = E.length - 1;
1452
- for (; N <= A; ) {
1453
- if (!p._emit[N]) {
1464
+ const x = E.length - 1;
1465
+ for (; N <= x; ) {
1466
+ if (!g._emit[N]) {
1454
1467
  N++;
1455
1468
  continue;
1456
1469
  }
1457
- const K = Y.classNameAliases[p[N]] || p[N], Z = E[N];
1458
- K ? W(Z, K) : (C = Z, z(), C = ""), N++;
1470
+ const K = Y.classNameAliases[g[N]] || g[N], Z = E[N];
1471
+ K ? W(Z, K) : (M = Z, z(), M = ""), N++;
1459
1472
  }
1460
1473
  }
1461
- function Ie(p, E) {
1462
- return p.scope && typeof p.scope == "string" && H.openNode(Y.classNameAliases[p.scope] || p.scope), p.beginScope && (p.beginScope._wrap ? (W(C, Y.classNameAliases[p.beginScope._wrap] || p.beginScope._wrap), C = "") : p.beginScope._multi && (Oe(p.beginScope, E), C = "")), v = Object.create(p, { parent: { value: v } }), v;
1474
+ function Ie(g, E) {
1475
+ return g.scope && typeof g.scope == "string" && F.openNode(Y.classNameAliases[g.scope] || g.scope), g.beginScope && (g.beginScope._wrap ? (W(M, Y.classNameAliases[g.beginScope._wrap] || g.beginScope._wrap), M = "") : g.beginScope._multi && (Oe(g.beginScope, E), M = "")), w = Object.create(g, { parent: { value: w } }), w;
1463
1476
  }
1464
- function Le(p, E, N) {
1465
- let A = fn(p.endRe, N);
1466
- if (A) {
1467
- if (p["on:end"]) {
1468
- const K = new Ge(p);
1469
- p["on:end"](E, K), K.isMatchIgnored && (A = !1);
1477
+ function Le(g, E, N) {
1478
+ let x = _n(g.endRe, N);
1479
+ if (x) {
1480
+ if (g["on:end"]) {
1481
+ const K = new Ge(g);
1482
+ g["on:end"](E, K), K.isMatchIgnored && (x = !1);
1470
1483
  }
1471
- if (A) {
1472
- for (; p.endsParent && p.parent; )
1473
- p = p.parent;
1474
- return p;
1484
+ if (x) {
1485
+ for (; g.endsParent && g.parent; )
1486
+ g = g.parent;
1487
+ return g;
1475
1488
  }
1476
1489
  }
1477
- if (p.endsWithParent)
1478
- return Le(p.parent, E, N);
1490
+ if (g.endsWithParent)
1491
+ return Le(g.parent, E, N);
1479
1492
  }
1480
- function Lt(p) {
1481
- return v.matcher.regexIndex === 0 ? (C += p[0], 1) : (Ne = !0, 0);
1493
+ function Lt(g) {
1494
+ return w.matcher.regexIndex === 0 ? (M += g[0], 1) : (Ne = !0, 0);
1482
1495
  }
1483
- function Dt(p) {
1484
- const E = p[0], N = p.rule, A = new Ge(N), K = [N.__beforeBegin, N["on:begin"]];
1496
+ function Dt(g) {
1497
+ const E = g[0], N = g.rule, x = new Ge(N), K = [N.__beforeBegin, N["on:begin"]];
1485
1498
  for (const Z of K)
1486
- if (Z && (Z(p, A), A.isMatchIgnored))
1499
+ if (Z && (Z(g, x), x.isMatchIgnored))
1487
1500
  return Lt(E);
1488
- return N.skip ? C += E : (N.excludeBegin && (C += E), G(), !N.returnBegin && !N.excludeBegin && (C = E)), Ie(N, p), N.returnBegin ? 0 : E.length;
1501
+ return N.skip ? M += E : (N.excludeBegin && (M += E), G(), !N.returnBegin && !N.excludeBegin && (M = E)), Ie(N, g), N.returnBegin ? 0 : E.length;
1489
1502
  }
1490
- function Pt(p) {
1491
- const E = p[0], N = _.substring(p.index), A = Le(v, p, N);
1492
- if (!A)
1493
- return Ve;
1494
- const K = v;
1495
- v.endScope && v.endScope._wrap ? (G(), W(E, v.endScope._wrap)) : v.endScope && v.endScope._multi ? (G(), Oe(v.endScope, p)) : K.skip ? C += E : (K.returnEnd || K.excludeEnd || (C += E), G(), K.excludeEnd && (C = E));
1503
+ function Pt(g) {
1504
+ const E = g[0], N = _.substring(g.index), x = Le(w, g, N);
1505
+ if (!x)
1506
+ return Xe;
1507
+ const K = w;
1508
+ w.endScope && w.endScope._wrap ? (G(), W(E, w.endScope._wrap)) : w.endScope && w.endScope._multi ? (G(), Oe(w.endScope, g)) : K.skip ? M += E : (K.returnEnd || K.excludeEnd || (M += E), G(), K.excludeEnd && (M = E));
1496
1509
  do
1497
- v.scope && H.closeNode(), !v.skip && !v.subLanguage && (pe += v.relevance), v = v.parent;
1498
- while (v !== A.parent);
1499
- return A.starts && Ie(A.starts, p), K.returnEnd ? 0 : E.length;
1510
+ w.scope && F.closeNode(), !w.skip && !w.subLanguage && (pe += w.relevance), w = w.parent;
1511
+ while (w !== x.parent);
1512
+ return x.starts && Ie(x.starts, g), K.returnEnd ? 0 : E.length;
1500
1513
  }
1501
1514
  function Bt() {
1502
- const p = [];
1503
- for (let E = v; E !== Y; E = E.parent)
1504
- E.scope && p.unshift(E.scope);
1505
- p.forEach((E) => H.openNode(E));
1515
+ const g = [];
1516
+ for (let E = w; E !== Y; E = E.parent)
1517
+ E.scope && g.unshift(E.scope);
1518
+ g.forEach((E) => F.openNode(E));
1506
1519
  }
1507
1520
  let he = {};
1508
- function De(p, E) {
1521
+ function De(g, E) {
1509
1522
  const N = E && E[0];
1510
- if (C += p, N == null)
1523
+ if (M += g, N == null)
1511
1524
  return G(), 0;
1512
1525
  if (he.type === "begin" && E.type === "end" && he.index === E.index && N === "") {
1513
- if (C += _.slice(E.index, E.index + 1), !r) {
1514
- const A = new Error(`0 width match regex (${u})`);
1515
- throw A.languageName = u, A.badRule = he.rule, A;
1526
+ if (M += _.slice(E.index, E.index + 1), !r) {
1527
+ const x = new Error(`0 width match regex (${u})`);
1528
+ throw x.languageName = u, x.badRule = he.rule, x;
1516
1529
  }
1517
1530
  return 1;
1518
1531
  }
1519
1532
  if (he = E, E.type === "begin")
1520
1533
  return Dt(E);
1521
- if (E.type === "illegal" && !f) {
1522
- const A = new Error('Illegal lexeme "' + N + '" for mode "' + (v.scope || "<unnamed>") + '"');
1523
- throw A.mode = v, A;
1534
+ if (E.type === "illegal" && !b) {
1535
+ const x = new Error('Illegal lexeme "' + N + '" for mode "' + (w.scope || "<unnamed>") + '"');
1536
+ throw x.mode = w, x;
1524
1537
  } else if (E.type === "end") {
1525
- const A = Pt(E);
1526
- if (A !== Ve)
1527
- return A;
1538
+ const x = Pt(E);
1539
+ if (x !== Xe)
1540
+ return x;
1528
1541
  }
1529
1542
  if (E.type === "illegal" && N === "")
1530
- return E.index === _.length || (C += `
1543
+ return E.index === _.length || (M += `
1531
1544
  `), 1;
1532
1545
  if (ke > 1e5 && ke > E.index * 3)
1533
1546
  throw new Error("potential infinite loop, way more iterations than matches");
1534
- return C += N, N.length;
1547
+ return M += N, N.length;
1535
1548
  }
1536
1549
  const Y = $(u);
1537
1550
  if (!Y)
1538
1551
  throw ee(a.replace("{}", u)), new Error('Unknown language: "' + u + '"');
1539
- const $t = Vn(Y);
1540
- let ve = "", v = k || $t;
1541
- const Pe = {}, H = new o.__emitter(o);
1552
+ const $t = Jn(Y);
1553
+ let ve = "", w = k || $t;
1554
+ const Pe = {}, F = new o.__emitter(o);
1542
1555
  Bt();
1543
- let C = "", pe = 0, j = 0, ke = 0, Ne = !1;
1556
+ let M = "", pe = 0, j = 0, ke = 0, Ne = !1;
1544
1557
  try {
1545
1558
  if (Y.__emitTokens)
1546
- Y.__emitTokens(_, H);
1559
+ Y.__emitTokens(_, F);
1547
1560
  else {
1548
- for (v.matcher.considerAll(); ; ) {
1549
- ke++, Ne ? Ne = !1 : v.matcher.considerAll(), v.matcher.lastIndex = j;
1550
- const p = v.matcher.exec(_);
1551
- if (!p) break;
1552
- const E = _.substring(j, p.index), N = De(E, p);
1553
- j = p.index + N;
1561
+ for (w.matcher.considerAll(); ; ) {
1562
+ ke++, Ne ? Ne = !1 : w.matcher.considerAll(), w.matcher.lastIndex = j;
1563
+ const g = w.matcher.exec(_);
1564
+ if (!g) break;
1565
+ const E = _.substring(j, g.index), N = De(E, g);
1566
+ j = g.index + N;
1554
1567
  }
1555
1568
  De(_.substring(j));
1556
1569
  }
1557
- return H.finalize(), ve = H.toHTML(), {
1570
+ return F.finalize(), ve = F.toHTML(), {
1558
1571
  language: u,
1559
1572
  value: ve,
1560
1573
  relevance: pe,
1561
1574
  illegal: !1,
1562
- _emitter: H,
1563
- _top: v
1575
+ _emitter: F,
1576
+ _top: w
1564
1577
  };
1565
- } catch (p) {
1566
- if (p.message && p.message.includes("Illegal"))
1578
+ } catch (g) {
1579
+ if (g.message && g.message.includes("Illegal"))
1567
1580
  return {
1568
1581
  language: u,
1569
1582
  value: Se(_),
1570
1583
  illegal: !0,
1571
1584
  relevance: 0,
1572
1585
  _illegalBy: {
1573
- message: p.message,
1586
+ message: g.message,
1574
1587
  index: j,
1575
1588
  context: _.slice(j - 100, j + 100),
1576
- mode: p.mode,
1589
+ mode: g.mode,
1577
1590
  resultSoFar: ve
1578
1591
  },
1579
- _emitter: H
1592
+ _emitter: F
1580
1593
  };
1581
1594
  if (r)
1582
1595
  return {
@@ -1584,14 +1597,14 @@ https://github.com/highlightjs/highlight.js/issues/2277`), T = u, k = _), f ===
1584
1597
  value: Se(_),
1585
1598
  illegal: !1,
1586
1599
  relevance: 0,
1587
- errorRaised: p,
1588
- _emitter: H,
1589
- _top: v
1600
+ errorRaised: g,
1601
+ _emitter: F,
1602
+ _top: w
1590
1603
  };
1591
- throw p;
1604
+ throw g;
1592
1605
  }
1593
1606
  }
1594
- function g(u) {
1607
+ function p(u) {
1595
1608
  const _ = {
1596
1609
  value: Se(u),
1597
1610
  illegal: !1,
@@ -1603,10 +1616,10 @@ https://github.com/highlightjs/highlight.js/issues/2277`), T = u, k = _), f ===
1603
1616
  }
1604
1617
  function m(u, _) {
1605
1618
  _ = _ || o.languages || Object.keys(e);
1606
- const f = g(u), k = _.filter($).filter(X).map(
1619
+ const b = p(u), k = _.filter($).filter(V).map(
1607
1620
  (G) => h(G, u, !1)
1608
1621
  );
1609
- k.unshift(f);
1622
+ k.unshift(b);
1610
1623
  const T = k.sort((G, W) => {
1611
1624
  if (G.relevance !== W.relevance) return W.relevance - G.relevance;
1612
1625
  if (G.language && W.language) {
@@ -1619,29 +1632,29 @@ https://github.com/highlightjs/highlight.js/issues/2277`), T = u, k = _), f ===
1619
1632
  }), [P, z] = T, q = P;
1620
1633
  return q.secondBest = z, q;
1621
1634
  }
1622
- function y(u, _, f) {
1623
- const k = _ && t[_] || f;
1635
+ function y(u, _, b) {
1636
+ const k = _ && t[_] || b;
1624
1637
  u.classList.add("hljs"), u.classList.add(`language-${k}`);
1625
1638
  }
1626
- function b(u) {
1639
+ function f(u) {
1627
1640
  let _ = null;
1628
- const f = l(u);
1629
- if (c(f)) return;
1630
- if (V(
1641
+ const b = l(u);
1642
+ if (c(b)) return;
1643
+ if (X(
1631
1644
  "before:highlightElement",
1632
- { el: u, language: f }
1645
+ { el: u, language: b }
1633
1646
  ), u.dataset.highlighted) {
1634
1647
  console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.", u);
1635
1648
  return;
1636
1649
  }
1637
1650
  if (u.children.length > 0 && (o.ignoreUnescapedHTML || (console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."), console.warn("https://github.com/highlightjs/highlight.js/wiki/security"), console.warn("The element with unescaped HTML:"), console.warn(u)), o.throwUnescapedHTML))
1638
- throw new jn(
1651
+ throw new ti(
1639
1652
  "One of your code blocks includes unescaped HTML.",
1640
1653
  u.innerHTML
1641
1654
  );
1642
1655
  _ = u;
1643
- const k = _.textContent, T = f ? d(k, { language: f, ignoreIllegals: !0 }) : m(k);
1644
- u.innerHTML = T.value, u.dataset.highlighted = "yes", y(u, f, T.language), u.result = {
1656
+ const k = _.textContent, T = b ? d(k, { language: b, ignoreIllegals: !0 }) : m(k);
1657
+ u.innerHTML = T.value, u.dataset.highlighted = "yes", y(u, b, T.language), u.result = {
1645
1658
  language: T.language,
1646
1659
  // TODO: remove with version 11.0
1647
1660
  re: T.relevance,
@@ -1649,40 +1662,40 @@ https://github.com/highlightjs/highlight.js/issues/2277`), T = u, k = _), f ===
1649
1662
  }, T.secondBest && (u.secondBest = {
1650
1663
  language: T.secondBest.language,
1651
1664
  relevance: T.secondBest.relevance
1652
- }), V("after:highlightElement", { el: u, result: T, text: k });
1665
+ }), X("after:highlightElement", { el: u, result: T, text: k });
1653
1666
  }
1654
- function w(u) {
1655
- o = Xe(o, u);
1667
+ function v(u) {
1668
+ o = Ve(o, u);
1656
1669
  }
1657
- const M = () => {
1658
- x(), ne("10.6.0", "initHighlighting() deprecated. Use highlightAll() now.");
1670
+ const S = () => {
1671
+ C(), ne("10.6.0", "initHighlighting() deprecated. Use highlightAll() now.");
1659
1672
  };
1660
1673
  function O() {
1661
- x(), ne("10.6.0", "initHighlightingOnLoad() deprecated. Use highlightAll() now.");
1674
+ C(), ne("10.6.0", "initHighlightingOnLoad() deprecated. Use highlightAll() now.");
1662
1675
  }
1663
1676
  let U = !1;
1664
- function x() {
1677
+ function C() {
1665
1678
  function u() {
1666
- x();
1679
+ C();
1667
1680
  }
1668
1681
  if (document.readyState === "loading") {
1669
1682
  U || window.addEventListener("DOMContentLoaded", u, !1), U = !0;
1670
1683
  return;
1671
1684
  }
1672
- document.querySelectorAll(o.cssSelector).forEach(b);
1685
+ document.querySelectorAll(o.cssSelector).forEach(f);
1673
1686
  }
1674
1687
  function I(u, _) {
1675
- let f = null;
1688
+ let b = null;
1676
1689
  try {
1677
- f = _(n);
1690
+ b = _(n);
1678
1691
  } catch (k) {
1679
1692
  if (ee("Language definition for '{}' could not be registered.".replace("{}", u)), r)
1680
1693
  ee(k);
1681
1694
  else
1682
1695
  throw k;
1683
- f = s;
1696
+ b = s;
1684
1697
  }
1685
- f.name || (f.name = u), e[u] = f, f.rawDefinition = _.bind(null, n), f.aliases && F(f.aliases, { languageName: u });
1698
+ b.name || (b.name = u), e[u] = b, b.rawDefinition = _.bind(null, n), b.aliases && H(b.aliases, { languageName: u });
1686
1699
  }
1687
1700
  function D(u) {
1688
1701
  delete e[u];
@@ -1695,12 +1708,12 @@ https://github.com/highlightjs/highlight.js/issues/2277`), T = u, k = _), f ===
1695
1708
  function $(u) {
1696
1709
  return u = (u || "").toLowerCase(), e[u] || e[t[u]];
1697
1710
  }
1698
- function F(u, { languageName: _ }) {
1699
- typeof u == "string" && (u = [u]), u.forEach((f) => {
1700
- t[f.toLowerCase()] = _;
1711
+ function H(u, { languageName: _ }) {
1712
+ typeof u == "string" && (u = [u]), u.forEach((b) => {
1713
+ t[b.toLowerCase()] = _;
1701
1714
  });
1702
1715
  }
1703
- function X(u) {
1716
+ function V(u) {
1704
1717
  const _ = $(u);
1705
1718
  return _ && !_.disableAutodetect;
1706
1719
  }
@@ -1722,54 +1735,54 @@ https://github.com/highlightjs/highlight.js/issues/2277`), T = u, k = _), f ===
1722
1735
  const _ = i.indexOf(u);
1723
1736
  _ !== -1 && i.splice(_, 1);
1724
1737
  }
1725
- function V(u, _) {
1726
- const f = u;
1738
+ function X(u, _) {
1739
+ const b = u;
1727
1740
  i.forEach(function(k) {
1728
- k[f] && k[f](_);
1741
+ k[b] && k[b](_);
1729
1742
  });
1730
1743
  }
1731
1744
  function ce(u) {
1732
- return ne("10.7.0", "highlightBlock will be removed entirely in v12.0"), ne("10.7.0", "Please use highlightElement now."), b(u);
1745
+ return ne("10.7.0", "highlightBlock will be removed entirely in v12.0"), ne("10.7.0", "Please use highlightElement now."), f(u);
1733
1746
  }
1734
1747
  Object.assign(n, {
1735
1748
  highlight: d,
1736
1749
  highlightAuto: m,
1737
- highlightAll: x,
1738
- highlightElement: b,
1750
+ highlightAll: C,
1751
+ highlightElement: f,
1739
1752
  // TODO: Remove with v12 API
1740
1753
  highlightBlock: ce,
1741
- configure: w,
1742
- initHighlighting: M,
1754
+ configure: v,
1755
+ initHighlighting: S,
1743
1756
  initHighlightingOnLoad: O,
1744
1757
  registerLanguage: I,
1745
1758
  unregisterLanguage: D,
1746
1759
  listLanguages: B,
1747
1760
  getLanguage: $,
1748
- registerAliases: F,
1749
- autoDetection: X,
1750
- inherit: Xe,
1761
+ registerAliases: H,
1762
+ autoDetection: V,
1763
+ inherit: Ve,
1751
1764
  addPlugin: oe,
1752
1765
  removePlugin: ae
1753
1766
  }), n.debugMode = function() {
1754
1767
  r = !1;
1755
1768
  }, n.safeMode = function() {
1756
1769
  r = !0;
1757
- }, n.versionString = Jn, n.regex = {
1770
+ }, n.versionString = ei, n.regex = {
1758
1771
  concat: te,
1759
1772
  lookahead: st,
1760
1773
  either: ye,
1761
- optional: gn,
1762
- anyNumberOfTimes: pn
1774
+ optional: fn,
1775
+ anyNumberOfTimes: mn
1763
1776
  };
1764
1777
  for (const u in me)
1765
1778
  typeof me[u] == "object" && it(me[u]);
1766
1779
  return Object.assign(n, me), n;
1767
1780
  }, se = gt({});
1768
1781
  se.newInstance = () => gt({});
1769
- var ti = se;
1782
+ var ii = se;
1770
1783
  se.HighlightJS = se;
1771
1784
  se.default = se;
1772
- const S = /* @__PURE__ */ cn(ti), Qe = "[A-Za-z$_][0-9A-Za-z$_]*", ni = [
1785
+ const A = /* @__PURE__ */ dn(ii), Qe = "[A-Za-z$_][0-9A-Za-z$_]*", ri = [
1773
1786
  "as",
1774
1787
  // for exports
1775
1788
  "in",
@@ -1814,7 +1827,7 @@ const S = /* @__PURE__ */ cn(ti), Qe = "[A-Za-z$_][0-9A-Za-z$_]*", ni = [
1814
1827
  "extends",
1815
1828
  // It's reached stage 3, which is "recommended for implementation":
1816
1829
  "using"
1817
- ], ii = [
1830
+ ], si = [
1818
1831
  "true",
1819
1832
  "false",
1820
1833
  "null",
@@ -1898,7 +1911,7 @@ const S = /* @__PURE__ */ cn(ti), Qe = "[A-Za-z$_][0-9A-Za-z$_]*", ni = [
1898
1911
  "encodeURIComponent",
1899
1912
  "escape",
1900
1913
  "unescape"
1901
- ], ri = [
1914
+ ], oi = [
1902
1915
  "arguments",
1903
1916
  "this",
1904
1917
  "super",
@@ -1911,15 +1924,15 @@ const S = /* @__PURE__ */ cn(ti), Qe = "[A-Za-z$_][0-9A-Za-z$_]*", ni = [
1911
1924
  "self",
1912
1925
  "global"
1913
1926
  // Node.js
1914
- ], si = [].concat(
1927
+ ], ai = [].concat(
1915
1928
  bt,
1916
1929
  mt,
1917
1930
  ft
1918
1931
  );
1919
1932
  function _t(n) {
1920
- const e = n.regex, t = (f, { after: k }) => {
1921
- const T = "</" + f[0].slice(1);
1922
- return f.input.indexOf(T, k) !== -1;
1933
+ const e = n.regex, t = (b, { after: k }) => {
1934
+ const T = "</" + b[0].slice(1);
1935
+ return b.input.indexOf(T, k) !== -1;
1923
1936
  }, i = Qe, r = {
1924
1937
  begin: "<>",
1925
1938
  end: "</>"
@@ -1930,8 +1943,8 @@ function _t(n) {
1930
1943
  * @param {RegExpMatchArray} match
1931
1944
  * @param {CallbackResponse} response
1932
1945
  */
1933
- isTrulyOpeningTag: (f, k) => {
1934
- const T = f[0].length + f.index, P = f.input[T];
1946
+ isTrulyOpeningTag: (b, k) => {
1947
+ const T = b[0].length + b.index, P = b.input[T];
1935
1948
  if (
1936
1949
  // HTML should not include another raw `<` inside a tag
1937
1950
  // nested type?
@@ -1943,9 +1956,9 @@ function _t(n) {
1943
1956
  k.ignoreMatch();
1944
1957
  return;
1945
1958
  }
1946
- P === ">" && (t(f, { after: T }) || k.ignoreMatch());
1959
+ P === ">" && (t(b, { after: T }) || k.ignoreMatch());
1947
1960
  let z;
1948
- const q = f.input.substring(T);
1961
+ const q = b.input.substring(T);
1949
1962
  if (z = q.match(/^\s*=/)) {
1950
1963
  k.ignoreMatch();
1951
1964
  return;
@@ -1957,10 +1970,10 @@ function _t(n) {
1957
1970
  }
1958
1971
  }, o = {
1959
1972
  $pattern: Qe,
1960
- keyword: ni,
1961
- literal: ii,
1962
- built_in: si,
1963
- "variable.language": ri
1973
+ keyword: ri,
1974
+ literal: si,
1975
+ built_in: ai,
1976
+ "variable.language": oi
1964
1977
  }, c = "[0-9](_?[0-9])*", l = `\\.(${c})`, d = "0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*", h = {
1965
1978
  className: "number",
1966
1979
  variants: [
@@ -1978,7 +1991,7 @@ function _t(n) {
1978
1991
  { begin: "\\b0[0-7]+n?\\b" }
1979
1992
  ],
1980
1993
  relevance: 0
1981
- }, g = {
1994
+ }, p = {
1982
1995
  className: "subst",
1983
1996
  begin: "\\$\\{",
1984
1997
  end: "\\}",
@@ -1993,7 +2006,7 @@ function _t(n) {
1993
2006
  returnEnd: !1,
1994
2007
  contains: [
1995
2008
  n.BACKSLASH_ESCAPE,
1996
- g
2009
+ p
1997
2010
  ],
1998
2011
  subLanguage: "xml"
1999
2012
  }
@@ -2005,11 +2018,11 @@ function _t(n) {
2005
2018
  returnEnd: !1,
2006
2019
  contains: [
2007
2020
  n.BACKSLASH_ESCAPE,
2008
- g
2021
+ p
2009
2022
  ],
2010
2023
  subLanguage: "css"
2011
2024
  }
2012
- }, b = {
2025
+ }, f = {
2013
2026
  begin: ".?gql`",
2014
2027
  end: "",
2015
2028
  starts: {
@@ -2017,17 +2030,17 @@ function _t(n) {
2017
2030
  returnEnd: !1,
2018
2031
  contains: [
2019
2032
  n.BACKSLASH_ESCAPE,
2020
- g
2033
+ p
2021
2034
  ],
2022
2035
  subLanguage: "graphql"
2023
2036
  }
2024
- }, w = {
2037
+ }, v = {
2025
2038
  className: "string",
2026
2039
  begin: "`",
2027
2040
  end: "`",
2028
2041
  contains: [
2029
2042
  n.BACKSLASH_ESCAPE,
2030
- g
2043
+ p
2031
2044
  ]
2032
2045
  }, O = {
2033
2046
  className: "comment",
@@ -2079,8 +2092,8 @@ function _t(n) {
2079
2092
  n.QUOTE_STRING_MODE,
2080
2093
  m,
2081
2094
  y,
2082
- b,
2083
- w,
2095
+ f,
2096
+ v,
2084
2097
  // Skip numbers when they are part of a variable name
2085
2098
  { match: /\$\d+/ },
2086
2099
  h
@@ -2088,7 +2101,7 @@ function _t(n) {
2088
2101
  // See https://github.com/highlightjs/highlight.js/issues/3288
2089
2102
  // hljs.REGEXP_MODE
2090
2103
  ];
2091
- g.contains = U.concat({
2104
+ p.contains = U.concat({
2092
2105
  // we need to pair up {} inside our subst to prevent
2093
2106
  // it from ending too early by matching another }
2094
2107
  begin: /\{/,
@@ -2098,13 +2111,13 @@ function _t(n) {
2098
2111
  "self"
2099
2112
  ].concat(U)
2100
2113
  });
2101
- const x = [].concat(O, g.contains), I = x.concat([
2114
+ const C = [].concat(O, p.contains), I = C.concat([
2102
2115
  // eat recursive parens in sub expressions
2103
2116
  {
2104
2117
  begin: /(\s*)\(/,
2105
2118
  end: /\)/,
2106
2119
  keywords: o,
2107
- contains: ["self"].concat(x)
2120
+ contains: ["self"].concat(C)
2108
2121
  }
2109
2122
  ]), D = {
2110
2123
  className: "params",
@@ -2173,12 +2186,12 @@ function _t(n) {
2173
2186
  ...ft
2174
2187
  ]
2175
2188
  }
2176
- }, F = {
2189
+ }, H = {
2177
2190
  label: "use_strict",
2178
2191
  className: "meta",
2179
2192
  relevance: 10,
2180
2193
  begin: /^\s*['"]use (strict|asm)['"]/
2181
- }, X = {
2194
+ }, V = {
2182
2195
  variants: [
2183
2196
  {
2184
2197
  match: [
@@ -2208,8 +2221,8 @@ function _t(n) {
2208
2221
  match: /\b[A-Z][A-Z_0-9]+\b/,
2209
2222
  className: "variable.constant"
2210
2223
  };
2211
- function oe(f) {
2212
- return e.concat("(?!", f.join("|"), ")");
2224
+ function oe(b) {
2225
+ return e.concat("(?!", b.join("|"), ")");
2213
2226
  }
2214
2227
  const ae = {
2215
2228
  match: e.concat(
@@ -2219,13 +2232,13 @@ function _t(n) {
2219
2232
  "super",
2220
2233
  "import",
2221
2234
  "await"
2222
- ].map((f) => `${f}\\s*\\(`)),
2235
+ ].map((b) => `${b}\\s*\\(`)),
2223
2236
  i,
2224
2237
  e.lookahead(/\s*\(/)
2225
2238
  ),
2226
2239
  className: "title.function",
2227
2240
  relevance: 0
2228
- }, V = {
2241
+ }, X = {
2229
2242
  begin: e.concat(/\./, e.lookahead(
2230
2243
  e.concat(i, /(?![0-9A-Za-z$_(])/)
2231
2244
  )),
@@ -2285,13 +2298,13 @@ function _t(n) {
2285
2298
  binary: "node",
2286
2299
  relevance: 5
2287
2300
  }),
2288
- F,
2301
+ H,
2289
2302
  n.APOS_STRING_MODE,
2290
2303
  n.QUOTE_STRING_MODE,
2291
2304
  m,
2292
2305
  y,
2293
- b,
2294
- w,
2306
+ f,
2307
+ v,
2295
2308
  O,
2296
2309
  // Skip numbers when they are part of a variable name
2297
2310
  { match: /\$\d+/ },
@@ -2378,7 +2391,7 @@ function _t(n) {
2378
2391
  }
2379
2392
  ]
2380
2393
  },
2381
- X,
2394
+ V,
2382
2395
  {
2383
2396
  // prevent this from getting swallowed up by function
2384
2397
  // since they appear "function like"
@@ -2402,7 +2415,7 @@ function _t(n) {
2402
2415
  match: /\.\.\./,
2403
2416
  relevance: 0
2404
2417
  },
2405
- V,
2418
+ X,
2406
2419
  // hack: prevents detection of keywords in some circumstances
2407
2420
  // .keyword()
2408
2421
  // $keyword = x
@@ -2573,10 +2586,10 @@ const Ee = "[A-Za-z$_][0-9A-Za-z$_]*", Et = [
2573
2586
  wt,
2574
2587
  vt
2575
2588
  );
2576
- function oi(n) {
2577
- const e = n.regex, t = (f, { after: k }) => {
2578
- const T = "</" + f[0].slice(1);
2579
- return f.input.indexOf(T, k) !== -1;
2589
+ function ci(n) {
2590
+ const e = n.regex, t = (b, { after: k }) => {
2591
+ const T = "</" + b[0].slice(1);
2592
+ return b.input.indexOf(T, k) !== -1;
2580
2593
  }, i = Ee, r = {
2581
2594
  begin: "<>",
2582
2595
  end: "</>"
@@ -2587,8 +2600,8 @@ function oi(n) {
2587
2600
  * @param {RegExpMatchArray} match
2588
2601
  * @param {CallbackResponse} response
2589
2602
  */
2590
- isTrulyOpeningTag: (f, k) => {
2591
- const T = f[0].length + f.index, P = f.input[T];
2603
+ isTrulyOpeningTag: (b, k) => {
2604
+ const T = b[0].length + b.index, P = b.input[T];
2592
2605
  if (
2593
2606
  // HTML should not include another raw `<` inside a tag
2594
2607
  // nested type?
@@ -2600,9 +2613,9 @@ function oi(n) {
2600
2613
  k.ignoreMatch();
2601
2614
  return;
2602
2615
  }
2603
- P === ">" && (t(f, { after: T }) || k.ignoreMatch());
2616
+ P === ">" && (t(b, { after: T }) || k.ignoreMatch());
2604
2617
  let z;
2605
- const q = f.input.substring(T);
2618
+ const q = b.input.substring(T);
2606
2619
  if (z = q.match(/^\s*=/)) {
2607
2620
  k.ignoreMatch();
2608
2621
  return;
@@ -2635,7 +2648,7 @@ function oi(n) {
2635
2648
  { begin: "\\b0[0-7]+n?\\b" }
2636
2649
  ],
2637
2650
  relevance: 0
2638
- }, g = {
2651
+ }, p = {
2639
2652
  className: "subst",
2640
2653
  begin: "\\$\\{",
2641
2654
  end: "\\}",
@@ -2650,7 +2663,7 @@ function oi(n) {
2650
2663
  returnEnd: !1,
2651
2664
  contains: [
2652
2665
  n.BACKSLASH_ESCAPE,
2653
- g
2666
+ p
2654
2667
  ],
2655
2668
  subLanguage: "xml"
2656
2669
  }
@@ -2662,11 +2675,11 @@ function oi(n) {
2662
2675
  returnEnd: !1,
2663
2676
  contains: [
2664
2677
  n.BACKSLASH_ESCAPE,
2665
- g
2678
+ p
2666
2679
  ],
2667
2680
  subLanguage: "css"
2668
2681
  }
2669
- }, b = {
2682
+ }, f = {
2670
2683
  begin: ".?gql`",
2671
2684
  end: "",
2672
2685
  starts: {
@@ -2674,17 +2687,17 @@ function oi(n) {
2674
2687
  returnEnd: !1,
2675
2688
  contains: [
2676
2689
  n.BACKSLASH_ESCAPE,
2677
- g
2690
+ p
2678
2691
  ],
2679
2692
  subLanguage: "graphql"
2680
2693
  }
2681
- }, w = {
2694
+ }, v = {
2682
2695
  className: "string",
2683
2696
  begin: "`",
2684
2697
  end: "`",
2685
2698
  contains: [
2686
2699
  n.BACKSLASH_ESCAPE,
2687
- g
2700
+ p
2688
2701
  ]
2689
2702
  }, O = {
2690
2703
  className: "comment",
@@ -2736,8 +2749,8 @@ function oi(n) {
2736
2749
  n.QUOTE_STRING_MODE,
2737
2750
  m,
2738
2751
  y,
2739
- b,
2740
- w,
2752
+ f,
2753
+ v,
2741
2754
  // Skip numbers when they are part of a variable name
2742
2755
  { match: /\$\d+/ },
2743
2756
  h
@@ -2745,7 +2758,7 @@ function oi(n) {
2745
2758
  // See https://github.com/highlightjs/highlight.js/issues/3288
2746
2759
  // hljs.REGEXP_MODE
2747
2760
  ];
2748
- g.contains = U.concat({
2761
+ p.contains = U.concat({
2749
2762
  // we need to pair up {} inside our subst to prevent
2750
2763
  // it from ending too early by matching another }
2751
2764
  begin: /\{/,
@@ -2755,13 +2768,13 @@ function oi(n) {
2755
2768
  "self"
2756
2769
  ].concat(U)
2757
2770
  });
2758
- const x = [].concat(O, g.contains), I = x.concat([
2771
+ const C = [].concat(O, p.contains), I = C.concat([
2759
2772
  // eat recursive parens in sub expressions
2760
2773
  {
2761
2774
  begin: /(\s*)\(/,
2762
2775
  end: /\)/,
2763
2776
  keywords: o,
2764
- contains: ["self"].concat(x)
2777
+ contains: ["self"].concat(C)
2765
2778
  }
2766
2779
  ]), D = {
2767
2780
  className: "params",
@@ -2830,12 +2843,12 @@ function oi(n) {
2830
2843
  ...vt
2831
2844
  ]
2832
2845
  }
2833
- }, F = {
2846
+ }, H = {
2834
2847
  label: "use_strict",
2835
2848
  className: "meta",
2836
2849
  relevance: 10,
2837
2850
  begin: /^\s*['"]use (strict|asm)['"]/
2838
- }, X = {
2851
+ }, V = {
2839
2852
  variants: [
2840
2853
  {
2841
2854
  match: [
@@ -2865,8 +2878,8 @@ function oi(n) {
2865
2878
  match: /\b[A-Z][A-Z_0-9]+\b/,
2866
2879
  className: "variable.constant"
2867
2880
  };
2868
- function oe(f) {
2869
- return e.concat("(?!", f.join("|"), ")");
2881
+ function oe(b) {
2882
+ return e.concat("(?!", b.join("|"), ")");
2870
2883
  }
2871
2884
  const ae = {
2872
2885
  match: e.concat(
@@ -2876,13 +2889,13 @@ function oi(n) {
2876
2889
  "super",
2877
2890
  "import",
2878
2891
  "await"
2879
- ].map((f) => `${f}\\s*\\(`)),
2892
+ ].map((b) => `${b}\\s*\\(`)),
2880
2893
  i,
2881
2894
  e.lookahead(/\s*\(/)
2882
2895
  ),
2883
2896
  className: "title.function",
2884
2897
  relevance: 0
2885
- }, V = {
2898
+ }, X = {
2886
2899
  begin: e.concat(/\./, e.lookahead(
2887
2900
  e.concat(i, /(?![0-9A-Za-z$_(])/)
2888
2901
  )),
@@ -2942,13 +2955,13 @@ function oi(n) {
2942
2955
  binary: "node",
2943
2956
  relevance: 5
2944
2957
  }),
2945
- F,
2958
+ H,
2946
2959
  n.APOS_STRING_MODE,
2947
2960
  n.QUOTE_STRING_MODE,
2948
2961
  m,
2949
2962
  y,
2950
- b,
2951
- w,
2963
+ f,
2964
+ v,
2952
2965
  O,
2953
2966
  // Skip numbers when they are part of a variable name
2954
2967
  { match: /\$\d+/ },
@@ -3035,7 +3048,7 @@ function oi(n) {
3035
3048
  }
3036
3049
  ]
3037
3050
  },
3038
- X,
3051
+ V,
3039
3052
  {
3040
3053
  // prevent this from getting swallowed up by function
3041
3054
  // since they appear "function like"
@@ -3059,7 +3072,7 @@ function oi(n) {
3059
3072
  match: /\.\.\./,
3060
3073
  relevance: 0
3061
3074
  },
3062
- V,
3075
+ X,
3063
3076
  // hack: prevents detection of keywords in some circumstances
3064
3077
  // .keyword()
3065
3078
  // $keyword = x
@@ -3084,7 +3097,7 @@ function oi(n) {
3084
3097
  };
3085
3098
  }
3086
3099
  function St(n) {
3087
- const e = n.regex, t = oi(n), i = Ee, r = [
3100
+ const e = n.regex, t = ci(n), i = Ee, r = [
3088
3101
  "any",
3089
3102
  "void",
3090
3103
  "number",
@@ -3141,22 +3154,22 @@ function St(n) {
3141
3154
  }, d = {
3142
3155
  className: "meta",
3143
3156
  begin: "@" + i
3144
- }, h = (b, w, M) => {
3145
- const O = b.contains.findIndex((U) => U.label === w);
3157
+ }, h = (f, v, S) => {
3158
+ const O = f.contains.findIndex((U) => U.label === v);
3146
3159
  if (O === -1)
3147
3160
  throw new Error("can not find mode to replace");
3148
- b.contains.splice(O, 1, M);
3161
+ f.contains.splice(O, 1, S);
3149
3162
  };
3150
3163
  Object.assign(t.keywords, l), t.exports.PARAMS_CONTAINS.push(d);
3151
- const g = t.contains.find((b) => b.scope === "attr"), m = Object.assign(
3164
+ const p = t.contains.find((f) => f.scope === "attr"), m = Object.assign(
3152
3165
  {},
3153
- g,
3166
+ p,
3154
3167
  { match: e.concat(i, e.lookahead(/\s*\?:/)) }
3155
3168
  );
3156
3169
  t.exports.PARAMS_CONTAINS.push([
3157
3170
  t.exports.CLASS_REFERENCE,
3158
3171
  // class reference for highlighting the params types
3159
- g,
3172
+ p,
3160
3173
  // highlight the params key
3161
3174
  m
3162
3175
  // Added for optional property assignment highlighting
@@ -3167,7 +3180,7 @@ function St(n) {
3167
3180
  m
3168
3181
  // Added for optional property assignment highlighting
3169
3182
  ]), h(t, "shebang", n.SHEBANG()), h(t, "use_strict", o);
3170
- const y = t.contains.find((b) => b.label === "func.def");
3183
+ const y = t.contains.find((f) => f.label === "func.def");
3171
3184
  return y.relevance = 0, Object.assign(t, {
3172
3185
  name: "TypeScript",
3173
3186
  aliases: [
@@ -3409,7 +3422,7 @@ function At(n) {
3409
3422
  n.APOS_STRING_MODE,
3410
3423
  n.QUOTE_STRING_MODE
3411
3424
  ]
3412
- }, g = "[0-9](_?[0-9])*", m = `(\\b(${g}))?\\.(${g})|\\b(${g})\\.`, y = `\\b|${i.join("|")}`, b = {
3425
+ }, p = "[0-9](_?[0-9])*", m = `(\\b(${p}))?\\.(${p})|\\b(${p})\\.`, y = `\\b|${i.join("|")}`, f = {
3413
3426
  className: "number",
3414
3427
  relevance: 0,
3415
3428
  variants: [
@@ -3424,7 +3437,7 @@ function At(n) {
3424
3437
  // because both MUST contain a decimal point and so cannot be confused with
3425
3438
  // the interior part of an identifier
3426
3439
  {
3427
- begin: `(\\b(${g})|(${m}))[eE][+-]?(${g})[jJ]?(?=${y})`
3440
+ begin: `(\\b(${p})|(${m}))[eE][+-]?(${p})[jJ]?(?=${y})`
3428
3441
  },
3429
3442
  {
3430
3443
  begin: `(${m})[jJ]?`
@@ -3450,10 +3463,10 @@ function At(n) {
3450
3463
  // imagnumber (digitpart-based)
3451
3464
  // https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals
3452
3465
  {
3453
- begin: `\\b(${g})[jJ](?=${y})`
3466
+ begin: `\\b(${p})[jJ](?=${y})`
3454
3467
  }
3455
3468
  ]
3456
- }, w = {
3469
+ }, v = {
3457
3470
  className: "comment",
3458
3471
  begin: e.lookahead(/# type:/),
3459
3472
  end: /$/,
@@ -3470,7 +3483,7 @@ function At(n) {
3470
3483
  endsWithParent: !0
3471
3484
  }
3472
3485
  ]
3473
- }, M = {
3486
+ }, S = {
3474
3487
  className: "params",
3475
3488
  variants: [
3476
3489
  // Exclude params in functions without params
@@ -3488,7 +3501,7 @@ function At(n) {
3488
3501
  contains: [
3489
3502
  "self",
3490
3503
  c,
3491
- b,
3504
+ f,
3492
3505
  h,
3493
3506
  n.HASH_COMMENT_MODE
3494
3507
  ]
@@ -3497,7 +3510,7 @@ function At(n) {
3497
3510
  };
3498
3511
  return l.contains = [
3499
3512
  h,
3500
- b,
3513
+ f,
3501
3514
  c
3502
3515
  ], {
3503
3516
  name: "Python",
@@ -3511,7 +3524,7 @@ function At(n) {
3511
3524
  illegal: /(<\/|\?)|=>/,
3512
3525
  contains: [
3513
3526
  c,
3514
- b,
3527
+ f,
3515
3528
  {
3516
3529
  // very common convention
3517
3530
  scope: "variable.language",
@@ -3525,7 +3538,7 @@ function At(n) {
3525
3538
  },
3526
3539
  { match: /\bor\b/, scope: "keyword" },
3527
3540
  h,
3528
- w,
3541
+ v,
3529
3542
  n.HASH_COMMENT_MODE,
3530
3543
  {
3531
3544
  match: [
@@ -3537,7 +3550,7 @@ function At(n) {
3537
3550
  1: "keyword",
3538
3551
  3: "title.function"
3539
3552
  },
3540
- contains: [M]
3553
+ contains: [S]
3541
3554
  },
3542
3555
  {
3543
3556
  variants: [
@@ -3571,20 +3584,20 @@ function At(n) {
3571
3584
  begin: /^[\t ]*@/,
3572
3585
  end: /(?=#)|$/,
3573
3586
  contains: [
3574
- b,
3575
- M,
3587
+ f,
3588
+ S,
3576
3589
  h
3577
3590
  ]
3578
3591
  }
3579
3592
  ]
3580
3593
  };
3581
3594
  }
3582
- const ai = "([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity", ci = {
3595
+ const li = "([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity", di = {
3583
3596
  scope: "number",
3584
- match: ai,
3597
+ match: li,
3585
3598
  relevance: 0
3586
3599
  };
3587
- function li(n) {
3600
+ function ui(n) {
3588
3601
  const e = {
3589
3602
  className: "attr",
3590
3603
  begin: /(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,
@@ -3613,7 +3626,7 @@ function li(n) {
3613
3626
  n.APOS_STRING_MODE,
3614
3627
  n.QUOTE_STRING_MODE,
3615
3628
  r,
3616
- ci,
3629
+ di,
3617
3630
  n.C_LINE_COMMENT_MODE,
3618
3631
  n.C_BLOCK_COMMENT_MODE
3619
3632
  ],
@@ -3700,7 +3713,7 @@ function Me(n) {
3700
3713
  n.NUMBER_MODE,
3701
3714
  t
3702
3715
  ]
3703
- }, g = [
3716
+ }, p = [
3704
3717
  "fish",
3705
3718
  "bash",
3706
3719
  "zsh",
@@ -3711,7 +3724,7 @@ function Me(n) {
3711
3724
  "dash",
3712
3725
  "scsh"
3713
3726
  ], m = n.SHEBANG({
3714
- binary: `(${g.join("|")})`,
3727
+ binary: `(${p.join("|")})`,
3715
3728
  relevance: 10
3716
3729
  }), y = {
3717
3730
  className: "function",
@@ -3719,7 +3732,7 @@ function Me(n) {
3719
3732
  returnBegin: !0,
3720
3733
  contains: [n.inherit(n.TITLE_MODE, { begin: /\w[\w\d_]*/ })],
3721
3734
  relevance: 0
3722
- }, b = [
3735
+ }, f = [
3723
3736
  "if",
3724
3737
  "then",
3725
3738
  "else",
@@ -3737,10 +3750,10 @@ function Me(n) {
3737
3750
  "coproc",
3738
3751
  "function",
3739
3752
  "select"
3740
- ], w = [
3753
+ ], v = [
3741
3754
  "true",
3742
3755
  "false"
3743
- ], M = { match: /(\/[a-z._-]+)+/ }, O = [
3756
+ ], S = { match: /(\/[a-z._-]+)+/ }, O = [
3744
3757
  "break",
3745
3758
  "cd",
3746
3759
  "continue",
@@ -3782,7 +3795,7 @@ function Me(n) {
3782
3795
  "typeset",
3783
3796
  "ulimit",
3784
3797
  "unalias"
3785
- ], x = [
3798
+ ], C = [
3786
3799
  "autoload",
3787
3800
  "bg",
3788
3801
  "bindkey",
@@ -3964,15 +3977,15 @@ function Me(n) {
3964
3977
  ],
3965
3978
  keywords: {
3966
3979
  $pattern: /\b[a-z][a-z0-9._-]+\b/,
3967
- keyword: b,
3968
- literal: w,
3980
+ keyword: f,
3981
+ literal: v,
3969
3982
  built_in: [
3970
3983
  ...O,
3971
3984
  ...U,
3972
3985
  // Shell modifiers
3973
3986
  "set",
3974
3987
  "shopt",
3975
- ...x,
3988
+ ...C,
3976
3989
  ...I
3977
3990
  ]
3978
3991
  },
@@ -3985,7 +3998,7 @@ function Me(n) {
3985
3998
  h,
3986
3999
  a,
3987
4000
  s,
3988
- M,
4001
+ S,
3989
4002
  o,
3990
4003
  c,
3991
4004
  l,
@@ -3994,7 +4007,7 @@ function Me(n) {
3994
4007
  ]
3995
4008
  };
3996
4009
  }
3997
- const di = (n) => ({
4010
+ const hi = (n) => ({
3998
4011
  IMPORTANT: {
3999
4012
  scope: "meta",
4000
4013
  begin: "!important"
@@ -4031,7 +4044,7 @@ const di = (n) => ({
4031
4044
  className: "attr",
4032
4045
  begin: /--[A-Za-z_][A-Za-z0-9_-]*/
4033
4046
  }
4034
- }), ui = [
4047
+ }), pi = [
4035
4048
  "a",
4036
4049
  "abbr",
4037
4050
  "address",
@@ -4109,7 +4122,7 @@ const di = (n) => ({
4109
4122
  "ul",
4110
4123
  "var",
4111
4124
  "video"
4112
- ], hi = [
4125
+ ], gi = [
4113
4126
  "defs",
4114
4127
  "g",
4115
4128
  "marker",
@@ -4151,10 +4164,10 @@ const di = (n) => ({
4151
4164
  "tspan",
4152
4165
  "foreignObject",
4153
4166
  "clipPath"
4154
- ], pi = [
4155
- ...ui,
4156
- ...hi
4157
- ], gi = [
4167
+ ], mi = [
4168
+ ...pi,
4169
+ ...gi
4170
+ ], fi = [
4158
4171
  "any-hover",
4159
4172
  "any-pointer",
4160
4173
  "aspect-ratio",
@@ -4189,7 +4202,7 @@ const di = (n) => ({
4189
4202
  "max-width",
4190
4203
  "min-height",
4191
4204
  "max-height"
4192
- ].sort().reverse(), mi = [
4205
+ ].sort().reverse(), bi = [
4193
4206
  "active",
4194
4207
  "any-link",
4195
4208
  "blank",
@@ -4263,7 +4276,7 @@ const di = (n) => ({
4263
4276
  "visited",
4264
4277
  "where"
4265
4278
  // where()
4266
- ].sort().reverse(), fi = [
4279
+ ].sort().reverse(), _i = [
4267
4280
  "after",
4268
4281
  "backdrop",
4269
4282
  "before",
@@ -4278,7 +4291,7 @@ const di = (n) => ({
4278
4291
  "selection",
4279
4292
  "slotted",
4280
4293
  "spelling-error"
4281
- ].sort().reverse(), bi = [
4294
+ ].sort().reverse(), Ei = [
4282
4295
  "accent-color",
4283
4296
  "align-content",
4284
4297
  "align-items",
@@ -4801,8 +4814,8 @@ const di = (n) => ({
4801
4814
  "z-index",
4802
4815
  "zoom"
4803
4816
  ].sort().reverse();
4804
- function _i(n) {
4805
- const e = n.regex, t = di(n), i = { begin: /-(webkit|moz|ms|o)-(?=[a-z])/ }, r = "and or not only", a = /@-?\w[\w]*(-\w+)*/, s = "[a-zA-Z-][a-zA-Z0-9_-]*", o = [
4817
+ function yi(n) {
4818
+ const e = n.regex, t = hi(n), i = { begin: /-(webkit|moz|ms|o)-(?=[a-z])/ }, r = "and or not only", a = /@-?\w[\w]*(-\w+)*/, s = "[a-zA-Z-][a-zA-Z0-9_-]*", o = [
4806
4819
  n.APOS_STRING_MODE,
4807
4820
  n.QUOTE_STRING_MODE
4808
4821
  ];
@@ -4836,8 +4849,8 @@ function _i(n) {
4836
4849
  {
4837
4850
  className: "selector-pseudo",
4838
4851
  variants: [
4839
- { begin: ":(" + mi.join("|") + ")" },
4840
- { begin: ":(:)?(" + fi.join("|") + ")" }
4852
+ { begin: ":(" + bi.join("|") + ")" },
4853
+ { begin: ":(:)?(" + _i.join("|") + ")" }
4841
4854
  ]
4842
4855
  },
4843
4856
  // we may actually need this (12/2020)
@@ -4849,7 +4862,7 @@ function _i(n) {
4849
4862
  t.CSS_VARIABLE,
4850
4863
  {
4851
4864
  className: "attribute",
4852
- begin: "\\b(" + bi.join("|") + ")\\b"
4865
+ begin: "\\b(" + Ei.join("|") + ")\\b"
4853
4866
  },
4854
4867
  // attribute values
4855
4868
  {
@@ -4905,7 +4918,7 @@ function _i(n) {
4905
4918
  keywords: {
4906
4919
  $pattern: /[a-z-]+/,
4907
4920
  keyword: r,
4908
- attribute: gi.join(" ")
4921
+ attribute: fi.join(" ")
4909
4922
  },
4910
4923
  contains: [
4911
4924
  {
@@ -4920,7 +4933,7 @@ function _i(n) {
4920
4933
  },
4921
4934
  {
4922
4935
  className: "selector-tag",
4923
- begin: "\\b(" + pi.join("|") + ")\\b"
4936
+ begin: "\\b(" + mi.join("|") + ")\\b"
4924
4937
  }
4925
4938
  ]
4926
4939
  };
@@ -5134,7 +5147,7 @@ function Re(n) {
5134
5147
  ]
5135
5148
  };
5136
5149
  }
5137
- function Ei(n) {
5150
+ function wi(n) {
5138
5151
  const e = n.regex, t = n.COMMENT("--", "$"), i = {
5139
5152
  scope: "string",
5140
5153
  variants: [
@@ -5666,7 +5679,7 @@ function Ei(n) {
5666
5679
  "localtime",
5667
5680
  "current_timestamp",
5668
5681
  "localtimestamp"
5669
- ], g = [
5682
+ ], p = [
5670
5683
  "create table",
5671
5684
  "insert into",
5672
5685
  "primary key",
@@ -5686,14 +5699,14 @@ function Ei(n) {
5686
5699
  ], m = d, y = [
5687
5700
  ...l,
5688
5701
  ...c
5689
- ].filter((I) => !d.includes(I)), b = {
5702
+ ].filter((I) => !d.includes(I)), f = {
5690
5703
  scope: "variable",
5691
5704
  match: /@[a-z0-9][a-z0-9_]*/
5692
- }, w = {
5705
+ }, v = {
5693
5706
  scope: "operator",
5694
5707
  match: /[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,
5695
5708
  relevance: 0
5696
- }, M = {
5709
+ }, S = {
5697
5710
  match: e.concat(/\b/, e.either(...m), /\s*\(/),
5698
5711
  relevance: 0,
5699
5712
  keywords: { built_in: m }
@@ -5707,15 +5720,15 @@ function Ei(n) {
5707
5720
  }
5708
5721
  const U = {
5709
5722
  scope: "keyword",
5710
- match: O(g),
5723
+ match: O(p),
5711
5724
  relevance: 0
5712
5725
  };
5713
- function x(I, {
5726
+ function C(I, {
5714
5727
  exceptions: D,
5715
5728
  when: B
5716
5729
  } = {}) {
5717
5730
  const $ = B;
5718
- return D = D || [], I.map((F) => F.match(/\|\d+$/) || D.includes(F) ? F : $(F) ? `${F}|0` : F);
5731
+ return D = D || [], I.map((H) => H.match(/\|\d+$/) || D.includes(H) ? H : $(H) ? `${H}|0` : H);
5719
5732
  }
5720
5733
  return {
5721
5734
  name: "SQL",
@@ -5724,7 +5737,7 @@ function Ei(n) {
5724
5737
  illegal: /[{}]|<\//,
5725
5738
  keywords: {
5726
5739
  $pattern: /\b[\w\.]+/,
5727
- keyword: x(y, { when: (I) => I.length < 3 }),
5740
+ keyword: C(y, { when: (I) => I.length < 3 }),
5728
5741
  literal: a,
5729
5742
  type: o,
5730
5743
  built_in: h
@@ -5735,14 +5748,14 @@ function Ei(n) {
5735
5748
  match: O(s)
5736
5749
  },
5737
5750
  U,
5738
- M,
5739
- b,
5751
+ S,
5752
+ f,
5740
5753
  i,
5741
5754
  r,
5742
5755
  n.C_NUMBER_MODE,
5743
5756
  n.C_BLOCK_COMMENT_MODE,
5744
5757
  t,
5745
- w
5758
+ v
5746
5759
  ]
5747
5760
  };
5748
5761
  }
@@ -5817,7 +5830,7 @@ function xt(n) {
5817
5830
  end: /"/
5818
5831
  },
5819
5832
  { begin: /[^\s,{}[\]]+/ }
5820
- ] }), g = {
5833
+ ] }), p = {
5821
5834
  className: "number",
5822
5835
  begin: "\\b" + "[0-9]{4}(-[0-9][0-9]){0,2}" + "([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?" + "(\\.[0-9]*)?" + "([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?" + "\\b"
5823
5836
  }, m = {
@@ -5832,13 +5845,13 @@ function xt(n) {
5832
5845
  contains: [m],
5833
5846
  illegal: "\\n",
5834
5847
  relevance: 0
5835
- }, b = {
5848
+ }, f = {
5836
5849
  begin: "\\[",
5837
5850
  end: "\\]",
5838
5851
  contains: [m],
5839
5852
  illegal: "\\n",
5840
5853
  relevance: 0
5841
- }, w = [
5854
+ }, v = [
5842
5855
  i,
5843
5856
  {
5844
5857
  className: "meta",
@@ -5906,7 +5919,7 @@ function xt(n) {
5906
5919
  beginKeywords: e,
5907
5920
  keywords: { literal: e }
5908
5921
  },
5909
- g,
5922
+ p,
5910
5923
  // numbers are any valid C-style number that
5911
5924
  // sit isolated from other words
5912
5925
  {
@@ -5915,15 +5928,15 @@ function xt(n) {
5915
5928
  relevance: 0
5916
5929
  },
5917
5930
  y,
5918
- b,
5931
+ f,
5919
5932
  a,
5920
5933
  s
5921
- ], M = [...w];
5922
- return M.pop(), M.push(o), m.contains = M, {
5934
+ ], S = [...v];
5935
+ return S.pop(), S.push(o), m.contains = S, {
5923
5936
  name: "YAML",
5924
5937
  case_insensitive: !0,
5925
5938
  aliases: ["yml"],
5926
- contains: w
5939
+ contains: v
5927
5940
  };
5928
5941
  }
5929
5942
  function Ct(n) {
@@ -6072,8 +6085,8 @@ function Ct(n) {
6072
6085
  relevance: 0
6073
6086
  }
6074
6087
  ]
6075
- }, h = n.inherit(l, { contains: [] }), g = n.inherit(d, { contains: [] });
6076
- l.contains.push(g), d.contains.push(h);
6088
+ }, h = n.inherit(l, { contains: [] }), p = n.inherit(d, { contains: [] });
6089
+ l.contains.push(p), d.contains.push(h);
6077
6090
  let m = [
6078
6091
  t,
6079
6092
  c
@@ -6082,9 +6095,9 @@ function Ct(n) {
6082
6095
  l,
6083
6096
  d,
6084
6097
  h,
6085
- g
6086
- ].forEach((M) => {
6087
- M.contains = M.contains.concat(m);
6098
+ p
6099
+ ].forEach((S) => {
6100
+ S.contains = S.contains.concat(m);
6088
6101
  }), m = m.concat(l, d), {
6089
6102
  name: "Markdown",
6090
6103
  aliases: [
@@ -6138,7 +6151,7 @@ function Ct(n) {
6138
6151
  ]
6139
6152
  };
6140
6153
  }
6141
- function yi(n) {
6154
+ function vi(n) {
6142
6155
  const a = {
6143
6156
  keyword: [
6144
6157
  "break",
@@ -6633,12 +6646,12 @@ var re = "[0-9](_*[0-9])*", fe = `\\.(${re})`, be = "[0-9a-fA-F](_*[0-9a-fA-F])*
6633
6646
  function Rt(n, e, t) {
6634
6647
  return t === -1 ? "" : n.replace(e, (i) => Rt(n, e, t - 1));
6635
6648
  }
6636
- function wi(n) {
6649
+ function ki(n) {
6637
6650
  const e = n.regex, t = "[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*", i = "(?:(?:\\s*\\[\\s*])+)?", r = t + "<@@@>" + i, s = "(?:" + ("\\?(?:\\s+(?:extends|super)\\s+" + r + ")?") + "|" + r + ")", o = Rt(
6638
6651
  "(?:\\s*<\\s*" + s + "(?:\\s*,\\s*" + s + ")*\\s*>)?",
6639
6652
  /<@@@>/g,
6640
6653
  2
6641
- ), g = {
6654
+ ), p = {
6642
6655
  keyword: [
6643
6656
  "synchronized",
6644
6657
  "abstract",
@@ -6719,7 +6732,7 @@ function wi(n) {
6719
6732
  className: "params",
6720
6733
  begin: /\(/,
6721
6734
  end: /\)/,
6722
- keywords: g,
6735
+ keywords: p,
6723
6736
  relevance: 0,
6724
6737
  contains: [n.C_BLOCK_COMMENT_MODE],
6725
6738
  endsParent: !0
@@ -6727,7 +6740,7 @@ function wi(n) {
6727
6740
  return {
6728
6741
  name: "Java",
6729
6742
  aliases: ["jsp"],
6730
- keywords: g,
6743
+ keywords: p,
6731
6744
  illegal: /<\/|#/,
6732
6745
  contains: [
6733
6746
  n.COMMENT(
@@ -6828,13 +6841,13 @@ function wi(n) {
6828
6841
  1: "type",
6829
6842
  3: "title.function"
6830
6843
  },
6831
- keywords: g,
6844
+ keywords: p,
6832
6845
  contains: [
6833
6846
  {
6834
6847
  className: "params",
6835
6848
  begin: /\(/,
6836
6849
  end: /\)/,
6837
- keywords: g,
6850
+ keywords: p,
6838
6851
  relevance: 0,
6839
6852
  contains: [
6840
6853
  m,
@@ -6853,7 +6866,7 @@ function wi(n) {
6853
6866
  ]
6854
6867
  };
6855
6868
  }
6856
- function vi(n) {
6869
+ function Ni(n) {
6857
6870
  const e = n.regex, t = n.COMMENT("//", "$", { contains: [{ begin: /\\\n/ }] }), i = "decltype\\(auto\\)", r = "[a-zA-Z_]\\w*::", s = "(" + i + "|" + e.optional(r) + "[a-zA-Z_]\\w*" + e.optional("<[^<>]+>") + ")", o = e.concat(/\batomic_/, e.either(
6858
6871
  "bool",
6859
6872
  "char",
@@ -6930,7 +6943,7 @@ function vi(n) {
6930
6943
  { match: /(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/ }
6931
6944
  ],
6932
6945
  relevance: 0
6933
- }, g = {
6946
+ }, p = {
6934
6947
  scope: "meta",
6935
6948
  begin: /#\s*include\b/,
6936
6949
  end: /$/,
@@ -6963,13 +6976,13 @@ function vi(n) {
6963
6976
  n.C_BLOCK_COMMENT_MODE
6964
6977
  ]
6965
6978
  }, y = [
6966
- g,
6979
+ p,
6967
6980
  m
6968
- ], b = {
6981
+ ], f = {
6969
6982
  className: "title",
6970
6983
  begin: e.optional(r) + n.IDENT_RE,
6971
6984
  relevance: 0
6972
- }, w = e.optional(r) + n.IDENT_RE + "\\s*\\(", M = 12, x = {
6985
+ }, v = e.optional(r) + n.IDENT_RE + "\\s*\\(", S = 12, C = {
6973
6986
  keyword: [
6974
6987
  "asm",
6975
6988
  "auto",
@@ -7078,35 +7091,35 @@ function vi(n) {
7078
7091
  end: /;/
7079
7092
  }
7080
7093
  ],
7081
- keywords: x,
7094
+ keywords: C,
7082
7095
  contains: I.concat([
7083
7096
  {
7084
7097
  begin: /\(/,
7085
7098
  end: /\)/,
7086
- keywords: x,
7099
+ keywords: C,
7087
7100
  contains: I.concat(["self"]),
7088
7101
  relevance: 0
7089
7102
  }
7090
7103
  ]),
7091
7104
  relevance: 0
7092
7105
  }, B = {
7093
- begin: "(" + s + "[\\*&\\s]+){1," + M + "}" + w,
7106
+ begin: "(" + s + "[\\*&\\s]+){1," + S + "}" + v,
7094
7107
  returnBegin: !0,
7095
7108
  end: /[{;=]/,
7096
7109
  excludeEnd: !0,
7097
- keywords: x,
7110
+ keywords: C,
7098
7111
  illegal: /[^\w\s\*&:<>.]/,
7099
7112
  contains: [
7100
7113
  {
7101
7114
  // to prevent it from being confused as the function title
7102
7115
  begin: i,
7103
- keywords: x,
7116
+ keywords: C,
7104
7117
  relevance: 0
7105
7118
  },
7106
7119
  {
7107
- begin: w,
7120
+ begin: v,
7108
7121
  returnBegin: !0,
7109
- contains: [n.inherit(b, { className: "title.function" })],
7122
+ contains: [n.inherit(f, { className: "title.function" })],
7110
7123
  relevance: 0
7111
7124
  },
7112
7125
  // allow for multiple declarations, e.g.:
@@ -7119,7 +7132,7 @@ function vi(n) {
7119
7132
  className: "params",
7120
7133
  begin: /\(/,
7121
7134
  end: /\)/,
7122
- keywords: x,
7135
+ keywords: C,
7123
7136
  relevance: 0,
7124
7137
  contains: [
7125
7138
  t,
@@ -7131,7 +7144,7 @@ function vi(n) {
7131
7144
  {
7132
7145
  begin: /\(/,
7133
7146
  end: /\)/,
7134
- keywords: x,
7147
+ keywords: C,
7135
7148
  relevance: 0,
7136
7149
  contains: [
7137
7150
  "self",
@@ -7153,7 +7166,7 @@ function vi(n) {
7153
7166
  return {
7154
7167
  name: "C",
7155
7168
  aliases: ["h"],
7156
- keywords: x,
7169
+ keywords: C,
7157
7170
  // Until differentiations are added between `c` and `cpp`, `c` will
7158
7171
  // not be auto-detected to avoid auto-detect conflicts between C and C++
7159
7172
  disableAutodetect: !0,
@@ -7166,7 +7179,7 @@ function vi(n) {
7166
7179
  ...y,
7167
7180
  {
7168
7181
  begin: n.IDENT_RE + "::",
7169
- keywords: x
7182
+ keywords: C
7170
7183
  },
7171
7184
  {
7172
7185
  className: "class",
@@ -7182,7 +7195,7 @@ function vi(n) {
7182
7195
  exports: {
7183
7196
  preprocessor: m,
7184
7197
  strings: d,
7185
- keywords: x
7198
+ keywords: C
7186
7199
  }
7187
7200
  };
7188
7201
  }
@@ -7246,7 +7259,7 @@ function Ot(n) {
7246
7259
  t,
7247
7260
  n.C_BLOCK_COMMENT_MODE
7248
7261
  ]
7249
- }, g = {
7262
+ }, p = {
7250
7263
  className: "meta",
7251
7264
  begin: /#\s*[a-z]+\b/,
7252
7265
  end: /$/,
@@ -7262,12 +7275,12 @@ function Ot(n) {
7262
7275
  ]
7263
7276
  }, m = [
7264
7277
  h,
7265
- g
7278
+ p
7266
7279
  ], y = {
7267
7280
  className: "title",
7268
7281
  begin: e.optional(r) + n.IDENT_RE,
7269
7282
  relevance: 0
7270
- }, b = e.optional(r) + n.IDENT_RE + "\\s*\\(", w = 12, M = [
7283
+ }, f = e.optional(r) + n.IDENT_RE + "\\s*\\(", v = 12, S = [
7271
7284
  "alignas",
7272
7285
  "alignof",
7273
7286
  "and",
@@ -7430,7 +7443,7 @@ function Ot(n) {
7430
7443
  "weak_ptr",
7431
7444
  "wstring",
7432
7445
  "wstring_view"
7433
- ], x = [
7446
+ ], C = [
7434
7447
  "abort",
7435
7448
  "abs",
7436
7449
  "acos",
@@ -7533,7 +7546,7 @@ function Ot(n) {
7533
7546
  "vsprintf"
7534
7547
  ], B = {
7535
7548
  type: O,
7536
- keyword: M,
7549
+ keyword: S,
7537
7550
  literal: [
7538
7551
  "NULL",
7539
7552
  "false",
@@ -7548,15 +7561,15 @@ function Ot(n) {
7548
7561
  relevance: 0,
7549
7562
  keywords: {
7550
7563
  // Only for relevance, not highlighting.
7551
- _hint: x
7564
+ _hint: C
7552
7565
  },
7553
7566
  begin: e.concat(
7554
7567
  /\b/,
7555
- `(?!${M.join("|")})`,
7568
+ `(?!${S.join("|")})`,
7556
7569
  n.IDENT_RE,
7557
7570
  e.lookahead(/(<[^<>]+>|)\s*\(/)
7558
7571
  )
7559
- }, F = [
7572
+ }, H = [
7560
7573
  $,
7561
7574
  ...m,
7562
7575
  o,
@@ -7564,7 +7577,7 @@ function Ot(n) {
7564
7577
  n.C_BLOCK_COMMENT_MODE,
7565
7578
  d,
7566
7579
  l
7567
- ], X = {
7580
+ ], V = {
7568
7581
  // This mode covers expression context where we can't expect a function
7569
7582
  // definition and shouldn't highlight anything that looks like one:
7570
7583
  // `return some()`, `else if()`, `(x*sum(1, 2))`
@@ -7583,19 +7596,19 @@ function Ot(n) {
7583
7596
  }
7584
7597
  ],
7585
7598
  keywords: B,
7586
- contains: F.concat([
7599
+ contains: H.concat([
7587
7600
  {
7588
7601
  begin: /\(/,
7589
7602
  end: /\)/,
7590
7603
  keywords: B,
7591
- contains: F.concat(["self"]),
7604
+ contains: H.concat(["self"]),
7592
7605
  relevance: 0
7593
7606
  }
7594
7607
  ]),
7595
7608
  relevance: 0
7596
7609
  }, J = {
7597
7610
  className: "function",
7598
- begin: "(" + s + "[\\*&\\s]+){1," + w + "}" + b,
7611
+ begin: "(" + s + "[\\*&\\s]+){1," + v + "}" + f,
7599
7612
  returnBegin: !0,
7600
7613
  end: /[{;=]/,
7601
7614
  excludeEnd: !0,
@@ -7609,7 +7622,7 @@ function Ot(n) {
7609
7622
  relevance: 0
7610
7623
  },
7611
7624
  {
7612
- begin: b,
7625
+ begin: f,
7613
7626
  returnBegin: !0,
7614
7627
  contains: [y],
7615
7628
  relevance: 0
@@ -7685,10 +7698,10 @@ function Ot(n) {
7685
7698
  illegal: "</",
7686
7699
  classNameAliases: { "function.dispatch": "built_in" },
7687
7700
  contains: [].concat(
7688
- X,
7701
+ V,
7689
7702
  J,
7690
7703
  $,
7691
- F,
7704
+ H,
7692
7705
  [
7693
7706
  ...m,
7694
7707
  {
@@ -7721,128 +7734,128 @@ function Ot(n) {
7721
7734
  )
7722
7735
  };
7723
7736
  }
7724
- S.registerLanguage("javascript", _t);
7725
- S.registerLanguage("js", _t);
7726
- S.registerLanguage("typescript", St);
7727
- S.registerLanguage("ts", St);
7728
- S.registerLanguage("python", At);
7729
- S.registerLanguage("py", At);
7730
- S.registerLanguage("json", li);
7731
- S.registerLanguage("bash", Me);
7732
- S.registerLanguage("sh", Me);
7733
- S.registerLanguage("shell", Me);
7734
- S.registerLanguage("css", _i);
7735
- S.registerLanguage("xml", Re);
7736
- S.registerLanguage("html", Re);
7737
- S.registerLanguage("svg", Re);
7738
- S.registerLanguage("sql", Ei);
7739
- S.registerLanguage("yaml", xt);
7740
- S.registerLanguage("yml", xt);
7741
- S.registerLanguage("markdown", Ct);
7742
- S.registerLanguage("md", Ct);
7743
- S.registerLanguage("go", yi);
7744
- S.registerLanguage("rust", Mt);
7745
- S.registerLanguage("rs", Mt);
7746
- S.registerLanguage("java", wi);
7747
- S.registerLanguage("c", vi);
7748
- S.registerLanguage("cpp", Ot);
7749
- S.registerLanguage("c++", Ot);
7750
- const ki = /* @__PURE__ */ new Set(["mindmap"]);
7737
+ A.registerLanguage("javascript", _t);
7738
+ A.registerLanguage("js", _t);
7739
+ A.registerLanguage("typescript", St);
7740
+ A.registerLanguage("ts", St);
7741
+ A.registerLanguage("python", At);
7742
+ A.registerLanguage("py", At);
7743
+ A.registerLanguage("json", ui);
7744
+ A.registerLanguage("bash", Me);
7745
+ A.registerLanguage("sh", Me);
7746
+ A.registerLanguage("shell", Me);
7747
+ A.registerLanguage("css", yi);
7748
+ A.registerLanguage("xml", Re);
7749
+ A.registerLanguage("html", Re);
7750
+ A.registerLanguage("svg", Re);
7751
+ A.registerLanguage("sql", wi);
7752
+ A.registerLanguage("yaml", xt);
7753
+ A.registerLanguage("yml", xt);
7754
+ A.registerLanguage("markdown", Ct);
7755
+ A.registerLanguage("md", Ct);
7756
+ A.registerLanguage("go", vi);
7757
+ A.registerLanguage("rust", Mt);
7758
+ A.registerLanguage("rs", Mt);
7759
+ A.registerLanguage("java", ki);
7760
+ A.registerLanguage("c", Ni);
7761
+ A.registerLanguage("cpp", Ot);
7762
+ A.registerLanguage("c++", Ot);
7763
+ const Ti = /* @__PURE__ */ new Set(["mindmap"]);
7751
7764
  function le(n) {
7752
7765
  return n.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
7753
7766
  }
7754
- function Ni(n, e = {}) {
7755
- const t = new Set(e.reservedLanguages ?? ki), i = n.renderer.rules.fence ? n.renderer.rules.fence.bind(n.renderer.rules) : (r, a, s, o, c) => c.renderToken(r, a, s);
7767
+ function Si(n, e = {}) {
7768
+ const t = new Set(e.reservedLanguages ?? Ti), i = n.renderer.rules.fence ? n.renderer.rules.fence.bind(n.renderer.rules) : (r, a, s, o, c) => c.renderToken(r, a, s);
7756
7769
  n.renderer.rules.fence = (r, a, s, o, c) => {
7757
- var b;
7770
+ var f;
7758
7771
  const l = r[a];
7759
7772
  if (!l) return i(r, a, s, o, c);
7760
- const h = ((b = l.info.trim().split(/\s+/)[0]) == null ? void 0 : b.toLowerCase()) ?? "";
7773
+ const h = ((f = l.info.trim().split(/\s+/)[0]) == null ? void 0 : f.toLowerCase()) ?? "";
7761
7774
  if (t.has(h))
7762
7775
  return i(r, a, s, o, c);
7763
- const g = l.content;
7776
+ const p = l.content;
7764
7777
  let m, y = h || "text";
7765
- if (h && S.getLanguage(h))
7778
+ if (h && A.getLanguage(h))
7766
7779
  try {
7767
- m = S.highlight(g, {
7780
+ m = A.highlight(p, {
7768
7781
  language: h,
7769
7782
  ignoreIllegals: !0
7770
7783
  }).value;
7771
7784
  } catch {
7772
- m = le(g);
7785
+ m = le(p);
7773
7786
  }
7774
7787
  else if (h)
7775
7788
  try {
7776
- const w = S.highlightAuto(g);
7777
- m = w.value, y = w.language || h;
7789
+ const v = A.highlightAuto(p);
7790
+ m = v.value, y = v.language || h;
7778
7791
  } catch {
7779
- m = le(g);
7792
+ m = le(p);
7780
7793
  }
7781
7794
  else
7782
7795
  try {
7783
- const w = S.highlightAuto(g);
7784
- m = w.value, y = w.language || "text";
7796
+ const v = A.highlightAuto(p);
7797
+ m = v.value, y = v.language || "text";
7785
7798
  } catch {
7786
- m = le(g);
7799
+ m = le(p);
7787
7800
  }
7788
7801
  return `<div class="md-editor-codeblock"><div class="md-editor-codeblock-header"><span class="md-editor-codeblock-lights"><span class="md-editor-codeblock-dot md-editor-codeblock-dot--red"></span><span class="md-editor-codeblock-dot md-editor-codeblock-dot--yellow"></span><span class="md-editor-codeblock-dot md-editor-codeblock-dot--green"></span></span><span class="md-editor-codeblock-lang">${le(y)}</span><button type="button" class="md-editor-codeblock-copy" aria-label="Copy code">Copy</button></div><pre class="md-editor-codeblock-pre"><code class="language-${le(y)}">${m}</code></pre></div>`;
7789
7802
  };
7790
7803
  }
7791
- const Ti = [".mp4", ".webm", ".ogg", ".mov", ".m4v", ".avi", ".mkv"], Si = [
7804
+ const Ai = [".mp4", ".webm", ".ogg", ".mov", ".m4v", ".avi", ".mkv"], xi = [
7792
7805
  /(?:youtube\.com\/watch\?[^ ]*v=|youtu\.be\/|youtube\.com\/embed\/|youtube\.com\/shorts\/|youtube\.com\/v\/)([a-zA-Z0-9_-]{11})/,
7793
7806
  /^([a-zA-Z0-9_-]{11})$/
7794
7807
  ];
7795
- function Ai(n) {
7808
+ function Ci(n) {
7796
7809
  const e = n.trim();
7797
7810
  if (!e) return null;
7798
- for (const t of Si) {
7811
+ for (const t of xi) {
7799
7812
  const i = e.match(t);
7800
7813
  if (i && i[1]) return i[1];
7801
7814
  }
7802
7815
  return null;
7803
7816
  }
7804
- function xi(n, e = "YouTube video") {
7817
+ function Mi(n, e = "YouTube video") {
7805
7818
  const t = `https://img.youtube.com/vi/${n}/hqdefault.jpg`, i = `https://www.youtube.com/watch?v=${n}`;
7806
7819
  return `[![${e}](${t})](${i})`;
7807
7820
  }
7808
- function Ci(n) {
7821
+ function Ri(n) {
7809
7822
  const e = n.toLowerCase().split("?")[0] ?? "";
7810
- return Ti.some((t) => e.endsWith(t));
7823
+ return Ai.some((t) => e.endsWith(t));
7811
7824
  }
7812
7825
  function je(n, e = "image") {
7813
7826
  return `![${e}](${n})`;
7814
7827
  }
7815
- function Mi(n, e = "video") {
7828
+ function Oi(n, e = "video") {
7816
7829
  return `![${e}](${n})`;
7817
7830
  }
7818
- function Ri(n) {
7831
+ function Ii(n) {
7819
7832
  const e = n.renderer.rules.image ? n.renderer.rules.image.bind(n.renderer.rules) : (t, i, r, a, s) => s.renderToken(t, i, r);
7820
7833
  n.renderer.rules.image = (t, i, r, a, s) => {
7821
7834
  const o = t[i];
7822
7835
  if (!o) return e(t, i, r, a, s);
7823
7836
  const c = o.attrGet("src") ?? "";
7824
- if (Ci(c)) {
7837
+ if (Ri(c)) {
7825
7838
  const l = o.content || "";
7826
7839
  return `<video src="${c}" controls class="md-editor-video" title="${l}">${l}</video>`;
7827
7840
  }
7828
7841
  return e(t, i, r, a, s);
7829
7842
  };
7830
7843
  }
7831
- const Oi = /* @__PURE__ */ new Set([
7844
+ const Li = /* @__PURE__ */ new Set([
7832
7845
  "notice",
7833
7846
  "info",
7834
7847
  "tip",
7835
7848
  "warning",
7836
7849
  "danger",
7837
7850
  "success"
7838
- ]), Ii = /^:::(\w+)(?:\s+(.+))?$/, Li = /^:::\s*$/, et = {
7851
+ ]), Di = /^:::(\w+)(?:\s+(.+))?$/, Pi = /^:::\s*$/, et = {
7839
7852
  notice: "Notice",
7840
7853
  info: "Info",
7841
7854
  tip: "Tip",
7842
7855
  warning: "Warning",
7843
7856
  danger: "Danger",
7844
7857
  success: "Success"
7845
- }, Di = {
7858
+ }, Bi = {
7846
7859
  notice: "i",
7847
7860
  info: "i",
7848
7861
  tip: "✓",
@@ -7850,16 +7863,16 @@ const Oi = /* @__PURE__ */ new Set([
7850
7863
  danger: "✕",
7851
7864
  success: "✓"
7852
7865
  };
7853
- function Pi(n) {
7866
+ function $i(n) {
7854
7867
  n.block.ruler.before("fence", "tips_block", (e, t, i, r) => {
7855
- const s = e.src.slice(e.bMarks[t], e.eMarks[t]).match(Ii);
7868
+ const s = e.src.slice(e.bMarks[t], e.eMarks[t]).match(Di);
7856
7869
  if (!s) return !1;
7857
7870
  const o = (s[1] ?? "").toLowerCase();
7858
- if (!Oi.has(o)) return !1;
7871
+ if (!Li.has(o)) return !1;
7859
7872
  let c = t + 1, l = !1;
7860
7873
  for (; c < i; ) {
7861
7874
  const y = e.src.slice(e.bMarks[c], e.eMarks[c]);
7862
- if (Li.test(y.trim())) {
7875
+ if (Pi.test(y.trim())) {
7863
7876
  l = !0;
7864
7877
  break;
7865
7878
  }
@@ -7867,19 +7880,19 @@ function Pi(n) {
7867
7880
  }
7868
7881
  if (!l) return !1;
7869
7882
  if (r) return !0;
7870
- const d = s[2] ?? et[o] ?? o, h = e.src.slice(e.bMarks[t + 1], e.bMarks[c]).trim(), g = n.render(h), m = e.push("tips_block", "div", 0);
7871
- return m.content = g, m.info = o, m.markup = d, e.line = c + 1, !0;
7883
+ const d = s[2] ?? et[o] ?? o, h = e.src.slice(e.bMarks[t + 1], e.bMarks[c]).trim(), p = n.render(h), m = e.push("tips_block", "div", 0);
7884
+ return m.content = p, m.info = o, m.markup = d, e.line = c + 1, !0;
7872
7885
  }), n.renderer.rules.tips_block = (e, t) => {
7873
7886
  const i = e[t];
7874
7887
  if (!i) return "";
7875
- const r = i.info ?? "notice", a = i.markup ?? et[r] ?? "Notice", s = Di[r] ?? "i", o = i.content ?? "";
7876
- return `<div class="md-editor-tip md-editor-tip--${r}"><div class="md-editor-tip-header"><span class="md-editor-tip-icon">${s}</span><span class="md-editor-tip-title">${Bi(a)}</span></div><div class="md-editor-tip-body">${o}</div></div>`;
7888
+ const r = i.info ?? "notice", a = i.markup ?? et[r] ?? "Notice", s = Bi[r] ?? "i", o = i.content ?? "";
7889
+ return `<div class="md-editor-tip md-editor-tip--${r}"><div class="md-editor-tip-header"><span class="md-editor-tip-icon">${s}</span><span class="md-editor-tip-title">${Ui(a)}</span></div><div class="md-editor-tip-body">${o}</div></div>`;
7877
7890
  };
7878
7891
  }
7879
- function Bi(n) {
7892
+ function Ui(n) {
7880
7893
  return n.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
7881
7894
  }
7882
- function $i(n) {
7895
+ function Hi(n) {
7883
7896
  const e = n.renderer.rules.list_item_open;
7884
7897
  n.renderer.rules.list_item_open = (t, i, r, a, s) => {
7885
7898
  var l, d;
@@ -7895,15 +7908,16 @@ function $i(n) {
7895
7908
  if (((d = t[h]) == null ? void 0 : d.type) === "list_item_close") break;
7896
7909
  }
7897
7910
  if (c && c.content) {
7898
- const h = c.content, g = /^\[\s\]\s/.test(h), m = /^\[[xX]\]\s/.test(h);
7899
- if (g || m) {
7900
- if (c.content = h.replace(/^\[[ xX]\]\s/, ""), c.children && c.children.length > 0) {
7901
- const w = c.children[0];
7902
- w && w.type === "text" && (w.content = w.content.replace(/^\[[ xX]\]\s/, ""));
7911
+ const h = c.content, p = /^\[\s*\]\s/.test(h), m = /^\[\s*[xX]\s*\]\s/.test(h);
7912
+ if (p || m) {
7913
+ const y = /^\[\s*(?:[xX])?\s*\]\s/;
7914
+ if (c.content = h.replace(y, ""), c.children && c.children.length > 0) {
7915
+ const S = c.children[0];
7916
+ S && S.type === "text" && (S.content = S.content.replace(y, ""));
7903
7917
  }
7904
7918
  o.attrSet("class", "task-list-item");
7905
- const y = `<input type="checkbox" disabled${g ? " checked" : ""} /> `;
7906
- return (e ? e(t, i, r, a, s) : s.renderToken(t, i, r)) + y;
7919
+ const f = `<input type="checkbox" disabled${p ? " checked" : ""} /> `;
7920
+ return (e ? e(t, i, r, a, s) : s.renderToken(t, i, r)) + f;
7907
7921
  }
7908
7922
  }
7909
7923
  return e ? e(t, i, r, a, s) : s.renderToken(t, i, r);
@@ -7916,9 +7930,9 @@ class It {
7916
7930
  linkify: !0,
7917
7931
  breaks: e.breaks ?? !1,
7918
7932
  typographer: !0
7919
- }), e.math !== !1 && nn(this.md), this.mindmapEnabled = e.mindmap !== !1, this.mindmapEnabled && rn(this.md), e.codeHighlight !== !1 && Ni(this.md, {
7933
+ }), e.math !== !1 && sn(this.md), this.mindmapEnabled = e.mindmap !== !1, this.mindmapEnabled && on(this.md), e.codeHighlight !== !1 && Si(this.md, {
7920
7934
  reservedLanguages: this.mindmapEnabled ? ["mindmap"] : []
7921
- }), e.tips !== !1 && Pi(this.md), $i(this.md), Jt(this.md), Ri(this.md);
7935
+ }), e.tips !== !1 && $i(this.md), Hi(this.md), en(this.md), Ii(this.md);
7922
7936
  }
7923
7937
  render(e) {
7924
7938
  return this.md.render(e || "");
@@ -7928,13 +7942,13 @@ class It {
7928
7942
  * mindmap placeholders into real SVG diagrams.
7929
7943
  */
7930
7944
  async hydrate(e) {
7931
- this.mindmapEnabled && await an(e);
7945
+ this.mindmapEnabled && await ln(e);
7932
7946
  }
7933
7947
  }
7934
- function ir(n, e = {}) {
7948
+ function or(n, e = {}) {
7935
7949
  return new It(e).render(n);
7936
7950
  }
7937
- class Ui {
7951
+ class Fi {
7938
7952
  constructor(e) {
7939
7953
  this.buttons = /* @__PURE__ */ new Map(), this.el = document.createElement("div"), this.el.className = "md-editor-toolbar", this.el.setAttribute("role", "toolbar");
7940
7954
  for (const t of e) {
@@ -7968,7 +7982,7 @@ function tt(n) {
7968
7982
  wordCount: e ? e.split(/\s+/).length : 0
7969
7983
  };
7970
7984
  }
7971
- class Fi {
7985
+ class zi {
7972
7986
  constructor(e) {
7973
7987
  this.el = document.createElement("div"), this.el.className = "md-editor-statusbar", this.countEl = document.createElement("span"), this.blockEl = document.createElement("span"), this.blockEl.className = "md-editor-statusbar-muted", this.refreshBtn = document.createElement("button"), this.refreshBtn.type = "button", this.refreshBtn.className = "md-editor-statusbar-refresh", this.refreshBtn.textContent = "Refresh preview", this.refreshBtn.style.display = "none", this.refreshBtn.addEventListener("click", e.onRefreshPreview), this.el.appendChild(this.countEl), this.el.appendChild(this.blockEl), this.el.appendChild(this.refreshBtn);
7974
7988
  }
@@ -7979,26 +7993,25 @@ class Fi {
7979
7993
  this.refreshBtn.onclick = null, this.el.remove();
7980
7994
  }
7981
7995
  }
7982
- const Hi = /^ {0,3}#{1,6}\s/, zi = /^ {0,3}(`{3,}|~{3,})/;
7983
- function Ki(n) {
7996
+ const Ki = /^ {0,3}#{1,6}\s/, Gi = /^ {0,3}(`{3,}|~{3,})(.*)$/, qi = /^ {0,3}(`{3,}|~{3,})\s*$/;
7997
+ function Wi(n) {
7984
7998
  let e = 5381;
7985
7999
  for (let t = 0; t < n.length; t++)
7986
8000
  e = e * 33 ^ n.charCodeAt(t);
7987
8001
  return (e >>> 0).toString(36) + ":" + n.length;
7988
8002
  }
7989
- function Gi(n) {
7990
- var o;
8003
+ function Yi(n) {
7991
8004
  const e = n.split(`
7992
8005
  `), t = [];
7993
- let i = [], r = !1, a = "";
8006
+ let i = [], r = !1, a = "", s = 0;
7994
8007
  for (const c of e) {
7995
- const l = c.match(zi);
8008
+ const l = c.match(Gi);
7996
8009
  if (l) {
7997
- const d = ((o = l[1]) == null ? void 0 : o[0]) ?? "";
7998
- r ? d === a && (r = !1) : (r = !0, a = d), i.push(c);
8010
+ const d = l[1] ?? "", h = d[0] ?? "", p = d.length;
8011
+ r ? h === a && p >= s && qi.test(c) && (r = !1) : (r = !0, a = h, s = p), i.push(c);
7999
8012
  continue;
8000
8013
  }
8001
- if (!r && Hi.test(c) && i.length > 0) {
8014
+ if (!r && Ki.test(c) && i.length > 0) {
8002
8015
  t.push(i.join(`
8003
8016
  `)), i = [c];
8004
8017
  continue;
@@ -8007,18 +8020,18 @@ function Gi(n) {
8007
8020
  }
8008
8021
  i.length > 0 && t.push(i.join(`
8009
8022
  `)), t.length === 0 && t.push("");
8010
- const s = /* @__PURE__ */ new Map();
8023
+ const o = /* @__PURE__ */ new Map();
8011
8024
  return t.map((c) => {
8012
- const l = Ki(c), d = (s.get(l) ?? 0) + 1;
8013
- return s.set(l, d), { key: `${l}#${d}`, hash: l, source: c };
8025
+ const l = Wi(c), d = (o.get(l) ?? 0) + 1;
8026
+ return o.set(l, d), { key: `${l}#${d}`, hash: l, source: c };
8014
8027
  });
8015
8028
  }
8016
- class qi {
8029
+ class Zi {
8017
8030
  constructor(e, t, i = 800) {
8018
8031
  this.container = e, this.renderBlock = t, this.maxCacheEntries = i, this.nodeByKey = /* @__PURE__ */ new Map(), this.htmlByHash = /* @__PURE__ */ new Map(), this.prevBlocks = [];
8019
8032
  }
8020
8033
  update(e) {
8021
- const t = Gi(e), i = document.createDocumentFragment(), r = /* @__PURE__ */ new Map();
8034
+ const t = Yi(e), i = document.createDocumentFragment(), r = /* @__PURE__ */ new Map();
8022
8035
  let a = 0;
8023
8036
  for (const s of t) {
8024
8037
  let o = this.nodeByKey.get(s.key);
@@ -8048,7 +8061,7 @@ class qi {
8048
8061
  this.container.innerHTML = "", this.nodeByKey.clear(), this.htmlByHash.clear(), this.prevBlocks = [];
8049
8062
  }
8050
8063
  }
8051
- function Wi(n, e) {
8064
+ function Vi(n, e) {
8052
8065
  let t, i;
8053
8066
  const r = (...a) => {
8054
8067
  i = a, t !== void 0 && clearTimeout(t), t = setTimeout(() => {
@@ -8061,15 +8074,15 @@ function Wi(n, e) {
8061
8074
  t !== void 0 && (clearTimeout(t), t = void 0, i && n(...i));
8062
8075
  }, r;
8063
8076
  }
8064
- function Yi(n, e = 120, t = 600) {
8077
+ function Xi(n, e = 120, t = 600) {
8065
8078
  const i = Math.max(0, n), r = Math.floor(i / 2e4) * 60;
8066
8079
  return Math.min(t, e + r);
8067
8080
  }
8068
- function rr(n, e = 300) {
8081
+ function ar(n, e = 300) {
8069
8082
  const t = window;
8070
8083
  return typeof t.requestIdleCallback == "function" ? t.requestIdleCallback(n, { timeout: e }) : window.setTimeout(n, 0);
8071
8084
  }
8072
- function sr(n) {
8085
+ function cr(n) {
8073
8086
  const e = window;
8074
8087
  typeof e.cancelIdleCallback == "function" ? e.cancelIdleCallback(n) : clearTimeout(n);
8075
8088
  }
@@ -8210,7 +8223,7 @@ class ie {
8210
8223
  this.hide(), this.destroyed = !0, this.inputs.clear();
8211
8224
  }
8212
8225
  }
8213
- const Zi = [
8226
+ const Qi = [
8214
8227
  { action: "bold", key: "Mod-b", description: "Bold" },
8215
8228
  { action: "italic", key: "Mod-i", description: "Italic" },
8216
8229
  { action: "heading", key: "Mod-Alt-1", description: "Heading" },
@@ -8224,7 +8237,7 @@ const Zi = [
8224
8237
  { action: "preview", key: "Mod-Alt-p", description: "Toggle preview" },
8225
8238
  { action: "theme", key: "Mod-Shift-l", description: "Toggle theme" }
8226
8239
  ];
8227
- function or(n, e) {
8240
+ function lr(n, e) {
8228
8241
  var c;
8229
8242
  const t = n.toLowerCase().split("-");
8230
8243
  let i = "", r = !1, a = !1, s = !1, o = !1;
@@ -8252,7 +8265,7 @@ function or(n, e) {
8252
8265
  }
8253
8266
  return !(e.ctrlKey !== r || e.metaKey !== a || e.altKey !== s || e.shiftKey !== o || e.key.toLowerCase() !== i);
8254
8267
  }
8255
- function ar(n) {
8268
+ function dr(n) {
8256
8269
  var i;
8257
8270
  const e = ((i = navigator.platform) == null ? void 0 : i.toLowerCase().includes("mac")) ?? !1;
8258
8271
  return n.split("-").map((r) => {
@@ -8273,7 +8286,7 @@ function ar(n) {
8273
8286
  }
8274
8287
  }).join("+");
8275
8288
  }
8276
- function Xi(n) {
8289
+ function Ji(n) {
8277
8290
  var i;
8278
8291
  const e = ((i = navigator.platform) == null ? void 0 : i.toLowerCase().includes("mac")) ?? !1;
8279
8292
  return n.split("-").map((r) => {
@@ -8328,17 +8341,17 @@ const nt = {
8328
8341
  ---
8329
8342
  `, "", ""]
8330
8343
  };
8331
- class cr {
8344
+ class ur {
8332
8345
  constructor(e, t = {}) {
8333
8346
  this.previewPane = null, this.incremental = null, this.toolbar = null, this.statusBar = null, this.activePopup = null, this.scheduledRender = null, this.scheduledWait = 0;
8334
8347
  const i = typeof e == "string" ? document.querySelector(e) : e;
8335
8348
  if (!i) throw new Error("MarkdownEditor: mount container not found");
8336
- this.container = i, this.mode = t.mode ?? "simple", this.theme = t.theme ?? "light", this.showPreview = t.preview ?? !0, this.autoPreview = t.autoPreview ?? !0, this.renderDebounceOpt = t.renderDebounce, this.onChange = t.onChange, this.onImageUpload = t.onImageUpload, this.toolbarConfig = t.toolbar, this.shortcuts = Zi, this.container.classList.add("md-editor-root", `md-editor-mode-${this.mode}`), this.container.setAttribute("data-theme", this.theme), this.renderer = new It({
8349
+ this.container = i, this.mode = t.mode ?? "simple", this.theme = t.theme ?? "light", this.showPreview = t.preview ?? !0, this.autoPreview = t.autoPreview ?? !0, this.renderDebounceOpt = t.renderDebounce, this.onChange = t.onChange, this.onImageUpload = t.onImageUpload, this.toolbarConfig = t.toolbar, this.shortcuts = Qi, this.container.classList.add("md-editor-root", `md-editor-mode-${this.mode}`), this.container.setAttribute("data-theme", this.theme), this.renderer = new It({
8337
8350
  math: t.math ?? !0,
8338
8351
  mindmap: t.mindmap ?? !0,
8339
8352
  codeHighlight: t.codeHighlight ?? !0,
8340
8353
  tips: t.tips ?? !0
8341
- }), this.buildLayout(), this.codeEditor = new jt(this.editorPane, {
8354
+ }), this.buildLayout(), this.codeEditor = new tn(this.editorPane, {
8342
8355
  value: t.value ?? "",
8343
8356
  lineNumbers: this.mode === "complex",
8344
8357
  onChange: (r) => {
@@ -8348,7 +8361,7 @@ class cr {
8348
8361
  onImageFile: (r) => this.handleImageFile(r),
8349
8362
  mention: t.mention,
8350
8363
  docLink: t.docLink
8351
- }), this.setupKeyboardShortcuts(), this.mode === "complex" && (this.buildToolbar(), this.buildStatusBar()), this.previewPane && (this.previewPane.classList.add("markdown-body"), this.incremental = new qi(
8364
+ }), this.setupKeyboardShortcuts(), this.mode === "complex" && (this.buildToolbar(), this.buildStatusBar()), this.previewPane && (this.previewPane.classList.add("markdown-body"), this.incremental = new Zi(
8352
8365
  this.previewPane,
8353
8366
  (r) => this.renderer.render(r)
8354
8367
  ), this.setupCopyHandler()), this.renderPreview(t.value ?? ""), this.updateStatusBar(t.value ?? "");
@@ -8388,10 +8401,10 @@ class cr {
8388
8401
  "Toggle theme",
8389
8402
  this.theme === "dark" ? R.sun : R.moon,
8390
8403
  () => this.setTheme(this.theme === "dark" ? "light" : "dark")
8391
- ), this.toolbar = new Ui(e), this.container.insertBefore(this.toolbar.el, this.body);
8404
+ ), this.toolbar = new Fi(e), this.container.insertBefore(this.toolbar.el, this.body);
8392
8405
  }
8393
8406
  buildStatusBar() {
8394
- this.statusBar = new Fi({
8407
+ this.statusBar = new zi({
8395
8408
  onRefreshPreview: () => this.renderPreview(this.codeEditor.getValue())
8396
8409
  }), this.container.appendChild(this.statusBar.el);
8397
8410
  }
@@ -8472,7 +8485,7 @@ class cr {
8472
8485
  ],
8473
8486
  onSubmit: (i) => {
8474
8487
  const r = i.url ?? "";
8475
- r && this.codeEditor.insertAtCursor(Mi(r, i.alt || "video"));
8488
+ r && this.codeEditor.insertAtCursor(Oi(r, i.alt || "video"));
8476
8489
  }
8477
8490
  }), this.activePopup.show();
8478
8491
  }
@@ -8490,8 +8503,8 @@ class cr {
8490
8503
  }
8491
8504
  ],
8492
8505
  onSubmit: (i) => {
8493
- const r = i.url ?? "", a = Ai(r);
8494
- a && this.codeEditor.insertAtCursor(xi(a));
8506
+ const r = i.url ?? "", a = Ci(r);
8507
+ a && this.codeEditor.insertAtCursor(Mi(a));
8495
8508
  }
8496
8509
  }), this.activePopup.show();
8497
8510
  }
@@ -8546,7 +8559,7 @@ ${r}
8546
8559
  i.innerHTML = '<div class="md-editor-help-list">' + this.shortcuts.map(
8547
8560
  (o) => `<div class="md-editor-help-row">
8548
8561
  <span class="md-editor-help-desc">${o.description}</span>
8549
- <span class="md-editor-help-keys">${Xi(o.key)}</span>
8562
+ <span class="md-editor-help-keys">${Ji(o.key)}</span>
8550
8563
  </div>`
8551
8564
  ).join("") + '</div><div class="md-editor-help-section-title">Syntax</div><div class="md-editor-help-list">' + s.map(
8552
8565
  (o) => `<div class="md-editor-help-row">
@@ -8656,12 +8669,12 @@ Your ${c.key.toLowerCase()} content here.
8656
8669
  // ---------- Render scheduling (performance core) ----------
8657
8670
  requestPreviewRender(e) {
8658
8671
  var i, r;
8659
- const t = this.renderDebounceOpt === !1 ? 0 : this.renderDebounceOpt ?? Yi(e.length);
8672
+ const t = this.renderDebounceOpt === !1 ? 0 : this.renderDebounceOpt ?? Xi(e.length);
8660
8673
  if (t === 0) {
8661
8674
  (i = this.scheduledRender) == null || i.cancel(), this.scheduledRender = null, this.renderPreview(e);
8662
8675
  return;
8663
8676
  }
8664
- (!this.scheduledRender || this.scheduledWait !== t) && ((r = this.scheduledRender) == null || r.cancel(), this.scheduledRender = Wi((a) => this.renderPreview(a), t), this.scheduledWait = t), this.scheduledRender(e);
8677
+ (!this.scheduledRender || this.scheduledWait !== t) && ((r = this.scheduledRender) == null || r.cancel(), this.scheduledRender = Vi((a) => this.renderPreview(a), t), this.scheduledWait = t), this.scheduledRender(e);
8665
8678
  }
8666
8679
  renderPreview(e) {
8667
8680
  if (!this.previewPane || !this.incremental) return;
@@ -8724,28 +8737,28 @@ Your ${c.key.toLowerCase()} content here.
8724
8737
  }
8725
8738
  }
8726
8739
  export {
8727
- jt as CodeEditor,
8728
- Zi as DEFAULT_SHORTCUTS,
8729
- qi as IncrementalRenderer,
8730
- cr as MarkdownEditor,
8740
+ tn as CodeEditor,
8741
+ Qi as DEFAULT_SHORTCUTS,
8742
+ Zi as IncrementalRenderer,
8743
+ ur as MarkdownEditor,
8731
8744
  ie as Popup,
8732
8745
  It as Renderer,
8733
- Fi as StatusBar,
8734
- Ui as Toolbar,
8735
- Yi as adaptiveDebounceMs,
8736
- sr as cancelIdle,
8746
+ zi as StatusBar,
8747
+ Fi as Toolbar,
8748
+ Xi as adaptiveDebounceMs,
8749
+ cr as cancelIdle,
8737
8750
  tt as countText,
8738
- Wi as debounce,
8739
- Ai as extractYouTubeId,
8740
- ar as formatShortcut,
8741
- Xi as formatShortcutHtml,
8751
+ Vi as debounce,
8752
+ Ci as extractYouTubeId,
8753
+ dr as formatShortcut,
8754
+ Ji as formatShortcutHtml,
8742
8755
  R as icons,
8743
8756
  je as imageMarkdown,
8744
- Ci as isVideoFile,
8745
- or as matchShortcut,
8746
- ir as renderMarkdown,
8747
- rr as scheduleIdle,
8748
- Gi as splitIntoBlocks,
8749
- Mi as videoMarkdown,
8750
- xi as youTubeEmbedMarkdown
8757
+ Ri as isVideoFile,
8758
+ lr as matchShortcut,
8759
+ or as renderMarkdown,
8760
+ ar as scheduleIdle,
8761
+ Yi as splitIntoBlocks,
8762
+ Oi as videoMarkdown,
8763
+ Mi as youTubeEmbedMarkdown
8751
8764
  };