@rcarls/rc-markdown-editor 0.3.2 → 0.4.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.
@@ -1,8 +1,10 @@
1
- import { css as $n, LitElement as tn, nothing as mt, html as Me, svg as ce } from "lit";
2
- import { property as j, query as $e, state as wt } from "lit/decorators.js";
1
+ import { css as Dn, LitElement as nn, nothing as Ye, html as Me, svg as he } from "lit";
2
+ import { property as U, query as $e, state as _t } from "lit/decorators.js";
3
+ import "@rcarls/rc-button/define";
3
4
  import "@rcarls/rc-select/define";
5
+ import "@rcarls/rc-toolbar/define";
4
6
  const Pt = document.createElement("i");
5
- function Ze(e) {
7
+ function Je(e) {
6
8
  const t = "&" + e + ";";
7
9
  Pt.innerHTML = t;
8
10
  const n = Pt.textContent;
@@ -21,14 +23,14 @@ function Y(e, t) {
21
23
  return e.length > 0 ? (ue(e, e.length, 0, t), e) : t;
22
24
  }
23
25
  const kt = {}.hasOwnProperty;
24
- function Dn(e) {
26
+ function Hn(e) {
25
27
  const t = {};
26
28
  let n = -1;
27
29
  for (; ++n < e.length; )
28
- Hn(t, e[n]);
30
+ Vn(t, e[n]);
29
31
  return t;
30
32
  }
31
- function Hn(e, t) {
33
+ function Vn(e, t) {
32
34
  let n;
33
35
  for (n in t) {
34
36
  const o = (kt.call(e, n) ? e[n] : void 0) || (e[n] = {}), i = t[n];
@@ -37,7 +39,7 @@ function Hn(e, t) {
37
39
  for (a in i) {
38
40
  kt.call(o, a) || (o[a] = []);
39
41
  const l = i[a];
40
- Vn(
42
+ qn(
41
43
  // @ts-expect-error Looks like a list.
42
44
  o[a],
43
45
  Array.isArray(l) ? l : l ? [l] : []
@@ -45,21 +47,21 @@ function Hn(e, t) {
45
47
  }
46
48
  }
47
49
  }
48
- function Vn(e, t) {
50
+ function qn(e, t) {
49
51
  let n = -1;
50
52
  const r = [];
51
53
  for (; ++n < t.length; )
52
54
  (t[n].add === "after" ? e : r).push(t[n]);
53
55
  ue(e, 0, 0, r);
54
56
  }
55
- function qn(e) {
57
+ function Un(e) {
56
58
  const t = {};
57
59
  let n = -1;
58
60
  for (; ++n < e.length; )
59
- Un(t, e[n]);
61
+ Wn(t, e[n]);
60
62
  return t;
61
63
  }
62
- function Un(e, t) {
64
+ function Wn(e, t) {
63
65
  let n;
64
66
  for (n in t) {
65
67
  const o = (kt.call(e, n) ? e[n] : void 0) || (e[n] = {}), i = t[n];
@@ -69,7 +71,7 @@ function Un(e, t) {
69
71
  o[a] = i[a];
70
72
  }
71
73
  }
72
- function vt(e, t) {
74
+ function wt(e, t) {
73
75
  const n = Number.parseInt(e, t);
74
76
  return (
75
77
  // C0 except for HT, LF, FF, CR, space.
@@ -82,11 +84,11 @@ function vt(e, t) {
82
84
  n > 1114111 ? "�" : String.fromCodePoint(n)
83
85
  );
84
86
  }
85
- const Wn = { '"': "quot", "&": "amp", "<": "lt", ">": "gt" };
86
- function nn(e) {
87
+ const jn = { '"': "quot", "&": "amp", "<": "lt", ">": "gt" };
88
+ function rn(e) {
87
89
  return e.replace(/["&<>]/g, t);
88
90
  function t(n) {
89
- return "&" + Wn[
91
+ return "&" + jn[
90
92
  /** @type {keyof typeof characterReferences} */
91
93
  n
92
94
  ] + ";";
@@ -95,7 +97,7 @@ function nn(e) {
95
97
  function Le(e) {
96
98
  return e.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
97
99
  }
98
- const _e = ze(/[A-Za-z]/), le = ze(/[\dA-Za-z]/), jn = ze(/[#-'*+\--9=?A-Z^-~]/);
100
+ const ve = Ae(/[A-Za-z]/), le = Ae(/[\dA-Za-z]/), Qn = Ae(/[#-'*+\--9=?A-Z^-~]/);
99
101
  function xt(e) {
100
102
  return (
101
103
  // Special whitespace codes (which have negative values), C0 and Control
@@ -103,25 +105,25 @@ function xt(e) {
103
105
  e !== null && (e < 32 || e === 127)
104
106
  );
105
107
  }
106
- const bt = ze(/\d/), Qn = ze(/[\dA-Fa-f]/), Kn = ze(/[!-/:-@[-`{-~]/);
108
+ const bt = Ae(/\d/), Kn = Ae(/[\dA-Fa-f]/), Yn = Ae(/[!-/:-@[-`{-~]/);
107
109
  function I(e) {
108
110
  return e !== null && e < -2;
109
111
  }
110
- function te(e) {
112
+ function ne(e) {
111
113
  return e !== null && (e < 0 || e === 32);
112
114
  }
113
- function M(e) {
115
+ function F(e) {
114
116
  return e === -2 || e === -1 || e === 32;
115
117
  }
116
- const Yn = ze(new RegExp("\\p{P}|\\p{S}", "u")), Xn = ze(/\s/);
117
- function ze(e) {
118
+ const Gn = Ae(new RegExp("\\p{P}|\\p{S}", "u")), Xn = Ae(/\s/);
119
+ function Ae(e) {
118
120
  return t;
119
121
  function t(n) {
120
122
  return n !== null && n > -1 && e.test(String.fromCharCode(n));
121
123
  }
122
124
  }
123
125
  function je(e, t) {
124
- const n = nn(Gn(e || ""));
126
+ const n = rn(Zn(e || ""));
125
127
  if (!t)
126
128
  return n;
127
129
  const r = n.indexOf(":"), o = n.indexOf("?"), i = n.indexOf("#"), a = n.indexOf("/");
@@ -132,7 +134,7 @@ function je(e, t) {
132
134
  t.test(n.slice(0, r)) ? n : ""
133
135
  );
134
136
  }
135
- function Gn(e) {
137
+ function Zn(e) {
136
138
  const t = [];
137
139
  let n = -1, r = 0, o = 0;
138
140
  for (; ++n < e.length; ) {
@@ -151,58 +153,58 @@ function Gn(e) {
151
153
  }
152
154
  return t.join("") + e.slice(r);
153
155
  }
154
- const Ot = {}.hasOwnProperty, Nt = /^(https?|ircs?|mailto|xmpp)$/i, Zn = /^https?$/i;
155
- function Jn(e) {
156
+ const Ot = {}.hasOwnProperty, Nt = /^(https?|ircs?|mailto|xmpp)$/i, Jn = /^https?$/i;
157
+ function er(e) {
156
158
  const t = e || {};
157
159
  let n = !0;
158
160
  const r = {}, o = [[]], i = [], a = [], s = (
159
161
  /** @type {NormalizedHtmlExtension} */
160
- qn([{
162
+ Un([{
161
163
  enter: {
162
164
  blockQuote: R,
163
165
  codeFenced: de,
164
- codeFencedFenceInfo: z,
165
- codeFencedFenceMeta: z,
166
+ codeFencedFenceInfo: A,
167
+ codeFencedFenceMeta: A,
166
168
  codeIndented: fe,
167
- codeText: G,
169
+ codeText: X,
168
170
  content: We,
169
- definition: rt,
171
+ definition: it,
170
172
  definitionDestinationString: Ve,
171
- definitionLabelString: z,
172
- definitionTitleString: z,
173
- emphasis: Ae,
173
+ definitionLabelString: A,
174
+ definitionTitleString: A,
175
+ emphasis: ze,
174
176
  htmlFlow: ae,
175
- htmlText: se,
177
+ htmlText: ce,
176
178
  image: oe,
177
- label: z,
178
- link: we,
179
+ label: A,
180
+ link: _e,
179
181
  listItemMarker: T,
180
182
  listItemValue: $,
181
183
  listOrdered: q,
182
184
  listUnordered: N,
183
- paragraph: U,
184
- reference: z,
185
+ paragraph: W,
186
+ reference: A,
185
187
  resource: Ce,
186
188
  resourceDestinationString: Ee,
187
- resourceTitleString: z,
188
- setextHeading: at,
189
+ resourceTitleString: A,
190
+ setextHeading: lt,
189
191
  strong: Re
190
192
  },
191
193
  exit: {
192
- atxHeading: ut,
193
- atxHeadingSequence: ot,
194
- autolinkEmail: Nn,
195
- autolinkProtocol: On,
194
+ atxHeading: st,
195
+ atxHeadingSequence: at,
196
+ autolinkEmail: $n,
197
+ autolinkProtocol: Nn,
196
198
  blockQuote: Q,
197
199
  characterEscapeValue: y,
198
- characterReferenceMarkerHexadecimal: At,
199
- characterReferenceMarkerNumeric: At,
200
- characterReferenceValue: Pn,
200
+ characterReferenceMarkerHexadecimal: zt,
201
+ characterReferenceMarkerNumeric: zt,
202
+ characterReferenceValue: On,
201
203
  codeFenced: d,
202
204
  codeFencedFence: ie,
203
205
  codeFencedFenceInfo: h,
204
- codeFencedFenceMeta: F,
205
- codeFlowValue: A,
206
+ codeFencedFenceMeta: M,
207
+ codeFlowValue: z,
206
208
  codeIndented: d,
207
209
  codeText: Te,
208
210
  codeTextData: y,
@@ -210,7 +212,7 @@ function Jn(e) {
210
212
  definition: Ue,
211
213
  definitionDestinationString: qe,
212
214
  definitionLabelString: He,
213
- definitionTitleString: it,
215
+ definitionTitleString: ot,
214
216
  emphasis: pe,
215
217
  hardBreakEscape: P,
216
218
  hardBreakTrailing: P,
@@ -220,52 +222,52 @@ function Jn(e) {
220
222
  htmlTextData: y,
221
223
  image: De,
222
224
  label: Be,
223
- labelText: W,
225
+ labelText: j,
224
226
  lineEnding: L,
225
227
  link: De,
226
228
  listOrdered: E,
227
229
  listUnordered: D,
228
230
  paragraph: re,
229
- reference: F,
231
+ reference: M,
230
232
  referenceString: xe,
231
- resource: F,
233
+ resource: M,
232
234
  resourceDestinationString: Fe,
233
- resourceTitleString: nt,
235
+ resourceTitleString: rt,
234
236
  setextHeading: m,
235
- setextHeadingLineSequence: st,
236
- setextHeadingText: lt,
237
+ setextHeadingLineSequence: ct,
238
+ setextHeadingText: ut,
237
239
  strong: Fn,
238
- thematicBreak: Mn
240
+ thematicBreak: Pn
239
241
  }
240
242
  }, ...t.htmlExtensions || []])
241
243
  ), u = {
242
244
  definitions: r,
243
245
  tightStack: a
244
246
  }, f = {
245
- buffer: z,
247
+ buffer: A,
246
248
  encode: k,
247
- getData: v,
249
+ getData: w,
248
250
  lineEndingIfNeeded: B,
249
251
  options: t,
250
- raw: w,
252
+ raw: _,
251
253
  resume: x,
252
254
  setData: b,
253
- tag: _
255
+ tag: v
254
256
  };
255
257
  let p = t.defaultLineEnding;
256
258
  return g;
257
259
  function g(S) {
258
260
  let C = -1, K = 0;
259
261
  const ge = [];
260
- let ye = [], ve = [];
262
+ let ye = [], we = [];
261
263
  for (; ++C < S.length; )
262
264
  !p && (S[C][1].type === "lineEnding" || S[C][1].type === "lineEndingBlank") && (p = /** @type {LineEnding} */
263
- S[C][2].sliceSerialize(S[C][1])), (S[C][1].type === "listOrdered" || S[C][1].type === "listUnordered") && (S[C][0] === "enter" ? ge.push(C) : c(S.slice(ge.pop(), C))), S[C][1].type === "definition" && (S[C][0] === "enter" ? (ve = Y(ve, S.slice(K, C)), K = C) : (ye = Y(ye, S.slice(K, C + 1)), K = C + 1));
264
- ye = Y(ye, ve), ye = Y(ye, S.slice(K)), C = -1;
265
+ S[C][2].sliceSerialize(S[C][1])), (S[C][1].type === "listOrdered" || S[C][1].type === "listUnordered") && (S[C][0] === "enter" ? ge.push(C) : c(S.slice(ge.pop(), C))), S[C][1].type === "definition" && (S[C][0] === "enter" ? (we = Y(we, S.slice(K, C)), K = C) : (ye = Y(ye, S.slice(K, C + 1)), K = C + 1));
266
+ ye = Y(ye, we), ye = Y(ye, S.slice(K)), C = -1;
265
267
  const Se = ye;
266
268
  for (s.enter.null && s.enter.null.call(f); ++C < S.length; ) {
267
- const Rt = s[Se[C][0]], Ft = Se[C][1].type, Mt = Rt[Ft];
268
- Ot.call(Rt, Ft) && Mt && Mt.call({
269
+ const Rt = s[Se[C][0]], Mt = Se[C][1].type, Ft = Rt[Mt];
270
+ Ot.call(Rt, Mt) && Ft && Ft.call({
269
271
  sliceSerialize: Se[C][2].sliceSerialize,
270
272
  ...f
271
273
  }, Se[C][1]);
@@ -274,24 +276,24 @@ function Jn(e) {
274
276
  }
275
277
  function c(S) {
276
278
  const C = S.length;
277
- let K = 0, ge = 0, ye = !1, ve;
279
+ let K = 0, ge = 0, ye = !1, we;
278
280
  for (; ++K < C; ) {
279
281
  const Se = S[K];
280
282
  if (Se[1]._container)
281
- ve = void 0, Se[0] === "enter" ? ge++ : ge--;
283
+ we = void 0, Se[0] === "enter" ? ge++ : ge--;
282
284
  else switch (Se[1].type) {
283
285
  case "listItemPrefix": {
284
- Se[0] === "exit" && (ve = !0);
286
+ Se[0] === "exit" && (we = !0);
285
287
  break;
286
288
  }
287
289
  case "linePrefix":
288
290
  break;
289
291
  case "lineEndingBlank": {
290
- Se[0] === "enter" && !ge && (ve ? ve = void 0 : ye = !0);
292
+ Se[0] === "enter" && !ge && (we ? we = void 0 : ye = !0);
291
293
  break;
292
294
  }
293
295
  default:
294
- ve = void 0;
296
+ we = void 0;
295
297
  }
296
298
  }
297
299
  S[0][1]._loose = ye;
@@ -299,23 +301,23 @@ function Jn(e) {
299
301
  function b(S, C) {
300
302
  u[S] = C;
301
303
  }
302
- function v(S) {
304
+ function w(S) {
303
305
  return u[S];
304
306
  }
305
- function z() {
307
+ function A() {
306
308
  o.push([]);
307
309
  }
308
310
  function x() {
309
311
  return o.pop().join("");
310
312
  }
311
- function _(S) {
313
+ function v(S) {
312
314
  n && (b("lastWasTag", !0), o[o.length - 1].push(S));
313
315
  }
314
- function w(S) {
316
+ function _(S) {
315
317
  b("lastWasTag"), o[o.length - 1].push(S);
316
318
  }
317
319
  function O() {
318
- w(p || `
320
+ _(p || `
319
321
  `);
320
322
  }
321
323
  function B() {
@@ -323,74 +325,74 @@ function Jn(e) {
323
325
  K === 10 || K === 13 || K === null || O();
324
326
  }
325
327
  function k(S) {
326
- return v("ignoreEncode") ? S : nn(S);
328
+ return w("ignoreEncode") ? S : rn(S);
327
329
  }
328
- function F() {
330
+ function M() {
329
331
  x();
330
332
  }
331
333
  function q(S) {
332
- a.push(!S._loose), B(), _("<ol"), b("expectFirstItem", !0);
334
+ a.push(!S._loose), B(), v("<ol"), b("expectFirstItem", !0);
333
335
  }
334
336
  function N(S) {
335
- a.push(!S._loose), B(), _("<ul"), b("expectFirstItem", !0);
337
+ a.push(!S._loose), B(), v("<ul"), b("expectFirstItem", !0);
336
338
  }
337
339
  function $(S) {
338
- if (v("expectFirstItem")) {
340
+ if (w("expectFirstItem")) {
339
341
  const C = Number.parseInt(this.sliceSerialize(S), 10);
340
- C !== 1 && _(' start="' + k(String(C)) + '"');
342
+ C !== 1 && v(' start="' + k(String(C)) + '"');
341
343
  }
342
344
  }
343
345
  function T() {
344
- v("expectFirstItem") ? _(">") : V(), B(), _("<li>"), b("expectFirstItem"), b("lastWasTag");
346
+ w("expectFirstItem") ? v(">") : V(), B(), v("<li>"), b("expectFirstItem"), b("lastWasTag");
345
347
  }
346
348
  function E() {
347
- V(), a.pop(), O(), _("</ol>");
349
+ V(), a.pop(), O(), v("</ol>");
348
350
  }
349
351
  function D() {
350
- V(), a.pop(), O(), _("</ul>");
352
+ V(), a.pop(), O(), v("</ul>");
351
353
  }
352
354
  function V() {
353
- v("lastWasTag") && !v("slurpAllLineEndings") && B(), _("</li>"), b("slurpAllLineEndings");
355
+ w("lastWasTag") && !w("slurpAllLineEndings") && B(), v("</li>"), b("slurpAllLineEndings");
354
356
  }
355
357
  function R() {
356
- a.push(!1), B(), _("<blockquote>");
358
+ a.push(!1), B(), v("<blockquote>");
357
359
  }
358
360
  function Q() {
359
- a.pop(), B(), _("</blockquote>"), b("slurpAllLineEndings");
361
+ a.pop(), B(), v("</blockquote>"), b("slurpAllLineEndings");
360
362
  }
361
- function U() {
362
- a[a.length - 1] || (B(), _("<p>")), b("slurpAllLineEndings");
363
+ function W() {
364
+ a[a.length - 1] || (B(), v("<p>")), b("slurpAllLineEndings");
363
365
  }
364
366
  function re() {
365
- a[a.length - 1] ? b("slurpAllLineEndings", !0) : _("</p>");
367
+ a[a.length - 1] ? b("slurpAllLineEndings", !0) : v("</p>");
366
368
  }
367
369
  function de() {
368
- B(), _("<pre><code"), b("fencesCount", 0);
370
+ B(), v("<pre><code"), b("fencesCount", 0);
369
371
  }
370
372
  function h() {
371
373
  const S = x();
372
- _(' class="language-' + S + '"');
374
+ v(' class="language-' + S + '"');
373
375
  }
374
376
  function ie() {
375
- const S = v("fencesCount") || 0;
376
- S || (_(">"), b("slurpOneLineEnding", !0)), b("fencesCount", S + 1);
377
+ const S = w("fencesCount") || 0;
378
+ S || (v(">"), b("slurpOneLineEnding", !0)), b("fencesCount", S + 1);
377
379
  }
378
380
  function fe() {
379
- B(), _("<pre><code>");
381
+ B(), v("<pre><code>");
380
382
  }
381
383
  function d() {
382
- const S = v("fencesCount");
383
- S !== void 0 && S < 2 && u.tightStack.length > 0 && !v("lastWasTag") && O(), v("flowCodeSeenData") && B(), _("</code></pre>"), S !== void 0 && S < 2 && B(), b("flowCodeSeenData"), b("fencesCount"), b("slurpOneLineEnding");
384
+ const S = w("fencesCount");
385
+ S !== void 0 && S < 2 && u.tightStack.length > 0 && !w("lastWasTag") && O(), w("flowCodeSeenData") && B(), v("</code></pre>"), S !== void 0 && S < 2 && B(), b("flowCodeSeenData"), b("fencesCount"), b("slurpOneLineEnding");
384
386
  }
385
387
  function oe() {
386
388
  i.push({
387
389
  image: !0
388
390
  }), n = void 0;
389
391
  }
390
- function we() {
392
+ function _e() {
391
393
  i.push({});
392
394
  }
393
- function W(S) {
395
+ function j(S) {
394
396
  i[i.length - 1].labelId = this.sliceSerialize(S);
395
397
  }
396
398
  function Be() {
@@ -400,15 +402,15 @@ function Jn(e) {
400
402
  i[i.length - 1].referenceId = this.sliceSerialize(S);
401
403
  }
402
404
  function Ce() {
403
- z(), i[i.length - 1].destination = "";
405
+ A(), i[i.length - 1].destination = "";
404
406
  }
405
407
  function Ee() {
406
- z(), b("ignoreEncode", !0);
408
+ A(), b("ignoreEncode", !0);
407
409
  }
408
410
  function Fe() {
409
411
  i[i.length - 1].destination = x(), b("ignoreEncode");
410
412
  }
411
- function nt() {
413
+ function rt() {
412
414
  i[i.length - 1].title = x();
413
415
  }
414
416
  function De() {
@@ -419,21 +421,21 @@ function Jn(e) {
419
421
  n = void 0;
420
422
  break;
421
423
  }
422
- C.image ? (_('<img src="' + je(ge.destination, t.allowDangerousProtocol ? void 0 : Zn) + '" alt="'), w(C.label), _('"')) : _('<a href="' + je(ge.destination, t.allowDangerousProtocol ? void 0 : Nt) + '"'), _(ge.title ? ' title="' + ge.title + '"' : ""), C.image ? _(" />") : (_(">"), w(C.label), _("</a>")), i.pop();
424
+ C.image ? (v('<img src="' + je(ge.destination, t.allowDangerousProtocol ? void 0 : Jn) + '" alt="'), _(C.label), v('"')) : v('<a href="' + je(ge.destination, t.allowDangerousProtocol ? void 0 : Nt) + '"'), v(ge.title ? ' title="' + ge.title + '"' : ""), C.image ? v(" />") : (v(">"), _(C.label), v("</a>")), i.pop();
423
425
  }
424
- function rt() {
425
- z(), i.push({});
426
+ function it() {
427
+ A(), i.push({});
426
428
  }
427
429
  function He(S) {
428
430
  x(), i[i.length - 1].labelId = this.sliceSerialize(S);
429
431
  }
430
432
  function Ve() {
431
- z(), b("ignoreEncode", !0);
433
+ A(), b("ignoreEncode", !0);
432
434
  }
433
435
  function qe() {
434
436
  i[i.length - 1].destination = x(), b("ignoreEncode");
435
437
  }
436
- function it() {
438
+ function ot() {
437
439
  i[i.length - 1].title = x();
438
440
  }
439
441
  function Ue() {
@@ -443,94 +445,94 @@ function Jn(e) {
443
445
  function We() {
444
446
  b("slurpAllLineEndings", !0);
445
447
  }
446
- function ot(S) {
447
- v("headingRank") || (b("headingRank", this.sliceSerialize(S).length), B(), _("<h" + v("headingRank") + ">"));
448
- }
449
- function at() {
450
- z(), b("slurpAllLineEndings");
448
+ function at(S) {
449
+ w("headingRank") || (b("headingRank", this.sliceSerialize(S).length), B(), v("<h" + w("headingRank") + ">"));
451
450
  }
452
451
  function lt() {
453
- b("slurpAllLineEndings", !0);
452
+ A(), b("slurpAllLineEndings");
454
453
  }
455
454
  function ut() {
456
- _("</h" + v("headingRank") + ">"), b("headingRank");
455
+ b("slurpAllLineEndings", !0);
457
456
  }
458
- function st(S) {
457
+ function st() {
458
+ v("</h" + w("headingRank") + ">"), b("headingRank");
459
+ }
460
+ function ct(S) {
459
461
  b("headingRank", this.sliceSerialize(S).charCodeAt(0) === 61 ? 1 : 2);
460
462
  }
461
463
  function m() {
462
464
  const S = x();
463
- B(), _("<h" + v("headingRank") + ">"), w(S), _("</h" + v("headingRank") + ">"), b("slurpAllLineEndings"), b("headingRank");
465
+ B(), v("<h" + w("headingRank") + ">"), _(S), v("</h" + w("headingRank") + ">"), b("slurpAllLineEndings"), b("headingRank");
464
466
  }
465
467
  function y(S) {
466
- w(k(this.sliceSerialize(S)));
468
+ _(k(this.sliceSerialize(S)));
467
469
  }
468
470
  function L(S) {
469
- if (!v("slurpAllLineEndings")) {
470
- if (v("slurpOneLineEnding")) {
471
+ if (!w("slurpAllLineEndings")) {
472
+ if (w("slurpOneLineEnding")) {
471
473
  b("slurpOneLineEnding");
472
474
  return;
473
475
  }
474
- if (v("inCodeText")) {
475
- w(" ");
476
+ if (w("inCodeText")) {
477
+ _(" ");
476
478
  return;
477
479
  }
478
- w(k(this.sliceSerialize(S)));
480
+ _(k(this.sliceSerialize(S)));
479
481
  }
480
482
  }
481
- function A(S) {
482
- w(k(this.sliceSerialize(S))), b("flowCodeSeenData", !0);
483
+ function z(S) {
484
+ _(k(this.sliceSerialize(S))), b("flowCodeSeenData", !0);
483
485
  }
484
486
  function P() {
485
- _("<br />");
487
+ v("<br />");
486
488
  }
487
489
  function ae() {
488
- B(), se();
490
+ B(), ce();
489
491
  }
490
492
  function be() {
491
493
  b("ignoreEncode");
492
494
  }
493
- function se() {
495
+ function ce() {
494
496
  t.allowDangerousHtml && b("ignoreEncode", !0);
495
497
  }
496
- function Ae() {
497
- _("<em>");
498
+ function ze() {
499
+ v("<em>");
498
500
  }
499
501
  function Re() {
500
- _("<strong>");
502
+ v("<strong>");
501
503
  }
502
- function G() {
503
- b("inCodeText", !0), _("<code>");
504
+ function X() {
505
+ b("inCodeText", !0), v("<code>");
504
506
  }
505
507
  function Te() {
506
- b("inCodeText"), _("</code>");
508
+ b("inCodeText"), v("</code>");
507
509
  }
508
510
  function pe() {
509
- _("</em>");
511
+ v("</em>");
510
512
  }
511
513
  function Fn() {
512
- _("</strong>");
514
+ v("</strong>");
513
515
  }
514
- function Mn() {
515
- B(), _("<hr />");
516
+ function Pn() {
517
+ B(), v("<hr />");
516
518
  }
517
- function At(S) {
519
+ function zt(S) {
518
520
  b("characterReferenceType", S.type);
519
521
  }
520
- function Pn(S) {
521
- const C = this.sliceSerialize(S), K = v("characterReferenceType") ? vt(C, v("characterReferenceType") === "characterReferenceMarkerNumeric" ? 10 : 16) : Ze(C);
522
- w(k(
522
+ function On(S) {
523
+ const C = this.sliceSerialize(S), K = w("characterReferenceType") ? wt(C, w("characterReferenceType") === "characterReferenceMarkerNumeric" ? 10 : 16) : Je(C);
524
+ _(k(
523
525
  /** @type {string} */
524
526
  K
525
527
  )), b("characterReferenceType");
526
528
  }
527
- function On(S) {
529
+ function Nn(S) {
528
530
  const C = this.sliceSerialize(S);
529
- _('<a href="' + je(C, t.allowDangerousProtocol ? void 0 : Nt) + '">'), w(k(C)), _("</a>");
531
+ v('<a href="' + je(C, t.allowDangerousProtocol ? void 0 : Nt) + '">'), _(k(C)), v("</a>");
530
532
  }
531
- function Nn(S) {
533
+ function $n(S) {
532
534
  const C = this.sliceSerialize(S);
533
- _('<a href="' + je("mailto:" + C) + '">'), w(k(C)), _("</a>");
535
+ v('<a href="' + je("mailto:" + C) + '">'), _(k(C)), v("</a>");
534
536
  }
535
537
  }
536
538
  function H(e, t, n, r) {
@@ -538,16 +540,16 @@ function H(e, t, n, r) {
538
540
  let i = 0;
539
541
  return a;
540
542
  function a(s) {
541
- return M(s) ? (e.enter(n), l(s)) : t(s);
543
+ return F(s) ? (e.enter(n), l(s)) : t(s);
542
544
  }
543
545
  function l(s) {
544
- return M(s) && i++ < o ? (e.consume(s), l) : (e.exit(n), t(s));
546
+ return F(s) && i++ < o ? (e.consume(s), l) : (e.exit(n), t(s));
545
547
  }
546
548
  }
547
- const er = {
548
- tokenize: tr
549
+ const tr = {
550
+ tokenize: nr
549
551
  };
550
- function tr(e) {
552
+ function nr(e) {
551
553
  const t = e.attempt(this.parser.constructs.contentInitial, r, o);
552
554
  let n;
553
555
  return t;
@@ -576,25 +578,25 @@ function tr(e) {
576
578
  return I(l) ? (e.consume(l), e.exit("chunkText"), i) : (e.consume(l), a);
577
579
  }
578
580
  }
579
- const nr = {
580
- tokenize: rr
581
- }, $t = {
581
+ const rr = {
582
582
  tokenize: ir
583
+ }, $t = {
584
+ tokenize: or
583
585
  };
584
- function rr(e) {
586
+ function ir(e) {
585
587
  const t = this, n = [];
586
588
  let r = 0, o, i, a;
587
589
  return l;
588
- function l(w) {
590
+ function l(_) {
589
591
  if (r < n.length) {
590
592
  const O = n[r];
591
- return t.containerState = O[1], e.attempt(O[0].continuation, s, u)(w);
593
+ return t.containerState = O[1], e.attempt(O[0].continuation, s, u)(_);
592
594
  }
593
- return u(w);
595
+ return u(_);
594
596
  }
595
- function s(w) {
597
+ function s(_) {
596
598
  if (r++, t.containerState._closeFlow) {
597
- t.containerState._closeFlow = void 0, o && _();
599
+ t.containerState._closeFlow = void 0, o && v();
598
600
  const O = t.events.length;
599
601
  let B = O, k;
600
602
  for (; B--; )
@@ -603,58 +605,58 @@ function rr(e) {
603
605
  break;
604
606
  }
605
607
  x(r);
606
- let F = O;
607
- for (; F < t.events.length; )
608
- t.events[F][1].end = {
608
+ let M = O;
609
+ for (; M < t.events.length; )
610
+ t.events[M][1].end = {
609
611
  ...k
610
- }, F++;
611
- return ue(t.events, B + 1, 0, t.events.slice(O)), t.events.length = F, u(w);
612
+ }, M++;
613
+ return ue(t.events, B + 1, 0, t.events.slice(O)), t.events.length = M, u(_);
612
614
  }
613
- return l(w);
615
+ return l(_);
614
616
  }
615
- function u(w) {
617
+ function u(_) {
616
618
  if (r === n.length) {
617
619
  if (!o)
618
- return g(w);
620
+ return g(_);
619
621
  if (o.currentConstruct && o.currentConstruct.concrete)
620
- return b(w);
622
+ return b(_);
621
623
  t.interrupt = !!(o.currentConstruct && !o._gfmTableDynamicInterruptHack);
622
624
  }
623
- return t.containerState = {}, e.check($t, f, p)(w);
625
+ return t.containerState = {}, e.check($t, f, p)(_);
624
626
  }
625
- function f(w) {
626
- return o && _(), x(r), g(w);
627
+ function f(_) {
628
+ return o && v(), x(r), g(_);
627
629
  }
628
- function p(w) {
629
- return t.parser.lazy[t.now().line] = r !== n.length, a = t.now().offset, b(w);
630
+ function p(_) {
631
+ return t.parser.lazy[t.now().line] = r !== n.length, a = t.now().offset, b(_);
630
632
  }
631
- function g(w) {
632
- return t.containerState = {}, e.attempt($t, c, b)(w);
633
+ function g(_) {
634
+ return t.containerState = {}, e.attempt($t, c, b)(_);
633
635
  }
634
- function c(w) {
635
- return r++, n.push([t.currentConstruct, t.containerState]), g(w);
636
+ function c(_) {
637
+ return r++, n.push([t.currentConstruct, t.containerState]), g(_);
636
638
  }
637
- function b(w) {
638
- if (w === null) {
639
- o && _(), x(0), e.consume(w);
639
+ function b(_) {
640
+ if (_ === null) {
641
+ o && v(), x(0), e.consume(_);
640
642
  return;
641
643
  }
642
644
  return o = o || t.parser.flow(t.now()), e.enter("chunkFlow", {
643
645
  _tokenizer: o,
644
646
  contentType: "flow",
645
647
  previous: i
646
- }), v(w);
648
+ }), w(_);
647
649
  }
648
- function v(w) {
649
- if (w === null) {
650
- z(e.exit("chunkFlow"), !0), x(0), e.consume(w);
650
+ function w(_) {
651
+ if (_ === null) {
652
+ A(e.exit("chunkFlow"), !0), x(0), e.consume(_);
651
653
  return;
652
654
  }
653
- return I(w) ? (e.consume(w), z(e.exit("chunkFlow")), r = 0, t.interrupt = void 0, l) : (e.consume(w), v);
655
+ return I(_) ? (e.consume(_), A(e.exit("chunkFlow")), r = 0, t.interrupt = void 0, l) : (e.consume(_), w);
654
656
  }
655
- function z(w, O) {
656
- const B = t.sliceStream(w);
657
- if (O && B.push(null), w.previous = i, i && (i.next = w), i = w, o.defineSkip(w.start), o.write(B), t.parser.lazy[w.start.line]) {
657
+ function A(_, O) {
658
+ const B = t.sliceStream(_);
659
+ if (O && B.push(null), _.previous = i, i && (i.next = _), i = _, o.defineSkip(_.start), o.write(B), t.parser.lazy[_.start.line]) {
658
660
  let k = o.events.length;
659
661
  for (; k--; )
660
662
  if (
@@ -664,8 +666,8 @@ function rr(e) {
664
666
  o.events[k][1].end.offset > a)
665
667
  )
666
668
  return;
667
- const F = t.events.length;
668
- let q = F, N, $;
669
+ const M = t.events.length;
670
+ let q = M, N, $;
669
671
  for (; q--; )
670
672
  if (t.events[q][0] === "exit" && t.events[q][1].type === "chunkFlow") {
671
673
  if (N) {
@@ -674,35 +676,35 @@ function rr(e) {
674
676
  }
675
677
  N = !0;
676
678
  }
677
- for (x(r), k = F; k < t.events.length; )
679
+ for (x(r), k = M; k < t.events.length; )
678
680
  t.events[k][1].end = {
679
681
  ...$
680
682
  }, k++;
681
- ue(t.events, q + 1, 0, t.events.slice(F)), t.events.length = k;
683
+ ue(t.events, q + 1, 0, t.events.slice(M)), t.events.length = k;
682
684
  }
683
685
  }
684
- function x(w) {
686
+ function x(_) {
685
687
  let O = n.length;
686
- for (; O-- > w; ) {
688
+ for (; O-- > _; ) {
687
689
  const B = n[O];
688
690
  t.containerState = B[1], B[0].exit.call(t, e);
689
691
  }
690
- n.length = w;
692
+ n.length = _;
691
693
  }
692
- function _() {
694
+ function v() {
693
695
  o.write([null]), i = void 0, o = void 0, t.containerState._closeFlow = void 0;
694
696
  }
695
697
  }
696
- function ir(e, t, n) {
698
+ function or(e, t, n) {
697
699
  return H(e, e.attempt(this.parser.constructs.document, t, n), "linePrefix", this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4);
698
700
  }
699
- function Ye(e) {
700
- if (e === null || te(e) || Xn(e))
701
+ function Ge(e) {
702
+ if (e === null || ne(e) || Xn(e))
701
703
  return 1;
702
- if (Yn(e))
704
+ if (Gn(e))
703
705
  return 2;
704
706
  }
705
- function Je(e, t, n) {
707
+ function et(e, t, n) {
706
708
  const r = [];
707
709
  let o = -1;
708
710
  for (; ++o < e.length; ) {
@@ -713,10 +715,10 @@ function Je(e, t, n) {
713
715
  }
714
716
  const yt = {
715
717
  name: "attention",
716
- resolveAll: or,
717
- tokenize: ar
718
+ resolveAll: ar,
719
+ tokenize: lr
718
720
  };
719
- function or(e, t) {
721
+ function ar(e, t) {
720
722
  let n = -1, r, o, i, a, l, s, u, f;
721
723
  for (; ++n < e.length; )
722
724
  if (e[n][0] === "enter" && e[n][1].type === "attentionSequence" && e[n][1]._close) {
@@ -763,7 +765,7 @@ function or(e, t) {
763
765
  ...a.start
764
766
  }, e[n][1].start = {
765
767
  ...l.end
766
- }, u = [], e[r][1].end.offset - e[r][1].start.offset && (u = Y(u, [["enter", e[r][1], t], ["exit", e[r][1], t]])), u = Y(u, [["enter", o, t], ["enter", a, t], ["exit", a, t], ["enter", i, t]]), u = Y(u, Je(t.parser.constructs.insideSpan.null, e.slice(r + 1, n), t)), u = Y(u, [["exit", i, t], ["enter", l, t], ["exit", l, t], ["exit", o, t]]), e[n][1].end.offset - e[n][1].start.offset ? (f = 2, u = Y(u, [["enter", e[n][1], t], ["exit", e[n][1], t]])) : f = 0, ue(e, r - 1, n - r + 3, u), n = r + u.length - f - 2;
768
+ }, u = [], e[r][1].end.offset - e[r][1].start.offset && (u = Y(u, [["enter", e[r][1], t], ["exit", e[r][1], t]])), u = Y(u, [["enter", o, t], ["enter", a, t], ["exit", a, t], ["enter", i, t]]), u = Y(u, et(t.parser.constructs.insideSpan.null, e.slice(r + 1, n), t)), u = Y(u, [["exit", i, t], ["enter", l, t], ["exit", l, t], ["exit", o, t]]), e[n][1].end.offset - e[n][1].start.offset ? (f = 2, u = Y(u, [["enter", e[n][1], t], ["exit", e[n][1], t]])) : f = 0, ue(e, r - 1, n - r + 3, u), n = r + u.length - f - 2;
767
769
  break;
768
770
  }
769
771
  }
@@ -771,8 +773,8 @@ function or(e, t) {
771
773
  e[n][1].type === "attentionSequence" && (e[n][1].type = "data");
772
774
  return e;
773
775
  }
774
- function ar(e, t) {
775
- const n = this.parser.constructs.attentionMarkers.null, r = this.previous, o = Ye(r);
776
+ function lr(e, t) {
777
+ const n = this.parser.constructs.attentionMarkers.null, r = this.previous, o = Ge(r);
776
778
  let i;
777
779
  return a;
778
780
  function a(s) {
@@ -781,25 +783,25 @@ function ar(e, t) {
781
783
  function l(s) {
782
784
  if (s === i)
783
785
  return e.consume(s), l;
784
- const u = e.exit("attentionSequence"), f = Ye(s), p = !f || f === 2 && o || n.includes(s), g = !o || o === 2 && f || n.includes(r);
786
+ const u = e.exit("attentionSequence"), f = Ge(s), p = !f || f === 2 && o || n.includes(s), g = !o || o === 2 && f || n.includes(r);
785
787
  return u._open = !!(i === 42 ? p : p && (o || !g)), u._close = !!(i === 42 ? g : g && (f || !p)), t(s);
786
788
  }
787
789
  }
788
790
  function Dt(e, t) {
789
791
  e.column += t, e.offset += t, e._bufferIndex += t;
790
792
  }
791
- const lr = {
793
+ const ur = {
792
794
  name: "autolink",
793
- tokenize: ur
795
+ tokenize: sr
794
796
  };
795
- function ur(e, t, n) {
797
+ function sr(e, t, n) {
796
798
  let r = 0;
797
799
  return o;
798
800
  function o(c) {
799
801
  return e.enter("autolink"), e.enter("autolinkMarker"), e.consume(c), e.exit("autolinkMarker"), e.enter("autolinkProtocol"), i;
800
802
  }
801
803
  function i(c) {
802
- return _e(c) ? (e.consume(c), a) : c === 64 ? n(c) : u(c);
804
+ return ve(c) ? (e.consume(c), a) : c === 64 ? n(c) : u(c);
803
805
  }
804
806
  function a(c) {
805
807
  return c === 43 || c === 45 || c === 46 || le(c) ? (r = 1, l(c)) : u(c);
@@ -811,7 +813,7 @@ function ur(e, t, n) {
811
813
  return c === 62 ? (e.exit("autolinkProtocol"), e.enter("autolinkMarker"), e.consume(c), e.exit("autolinkMarker"), e.exit("autolink"), t) : c === null || c === 32 || c === 60 || xt(c) ? n(c) : (e.consume(c), s);
812
814
  }
813
815
  function u(c) {
814
- return c === 64 ? (e.consume(c), f) : jn(c) ? (e.consume(c), u) : n(c);
816
+ return c === 64 ? (e.consume(c), f) : Qn(c) ? (e.consume(c), u) : n(c);
815
817
  }
816
818
  function f(c) {
817
819
  return le(c) ? p(c) : n(c);
@@ -827,28 +829,28 @@ function ur(e, t, n) {
827
829
  return n(c);
828
830
  }
829
831
  }
830
- const et = {
832
+ const tt = {
831
833
  partial: !0,
832
- tokenize: sr
834
+ tokenize: cr
833
835
  };
834
- function sr(e, t, n) {
836
+ function cr(e, t, n) {
835
837
  return r;
836
838
  function r(i) {
837
- return M(i) ? H(e, o, "linePrefix")(i) : o(i);
839
+ return F(i) ? H(e, o, "linePrefix")(i) : o(i);
838
840
  }
839
841
  function o(i) {
840
842
  return i === null || I(i) ? t(i) : n(i);
841
843
  }
842
844
  }
843
- const rn = {
845
+ const on = {
844
846
  continuation: {
845
- tokenize: hr
847
+ tokenize: dr
846
848
  },
847
- exit: dr,
849
+ exit: fr,
848
850
  name: "blockQuote",
849
- tokenize: cr
851
+ tokenize: hr
850
852
  };
851
- function cr(e, t, n) {
853
+ function hr(e, t, n) {
852
854
  const r = this;
853
855
  return o;
854
856
  function o(a) {
@@ -861,40 +863,40 @@ function cr(e, t, n) {
861
863
  return n(a);
862
864
  }
863
865
  function i(a) {
864
- return M(a) ? (e.enter("blockQuotePrefixWhitespace"), e.consume(a), e.exit("blockQuotePrefixWhitespace"), e.exit("blockQuotePrefix"), t) : (e.exit("blockQuotePrefix"), t(a));
866
+ return F(a) ? (e.enter("blockQuotePrefixWhitespace"), e.consume(a), e.exit("blockQuotePrefixWhitespace"), e.exit("blockQuotePrefix"), t) : (e.exit("blockQuotePrefix"), t(a));
865
867
  }
866
868
  }
867
- function hr(e, t, n) {
869
+ function dr(e, t, n) {
868
870
  const r = this;
869
871
  return o;
870
872
  function o(a) {
871
- return M(a) ? H(e, i, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(a) : i(a);
873
+ return F(a) ? H(e, i, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(a) : i(a);
872
874
  }
873
875
  function i(a) {
874
- return e.attempt(rn, t, n)(a);
876
+ return e.attempt(on, t, n)(a);
875
877
  }
876
878
  }
877
- function dr(e) {
879
+ function fr(e) {
878
880
  e.exit("blockQuote");
879
881
  }
880
- const on = {
882
+ const an = {
881
883
  name: "characterEscape",
882
- tokenize: fr
884
+ tokenize: pr
883
885
  };
884
- function fr(e, t, n) {
886
+ function pr(e, t, n) {
885
887
  return r;
886
888
  function r(i) {
887
889
  return e.enter("characterEscape"), e.enter("escapeMarker"), e.consume(i), e.exit("escapeMarker"), o;
888
890
  }
889
891
  function o(i) {
890
- return Kn(i) ? (e.enter("characterEscapeValue"), e.consume(i), e.exit("characterEscapeValue"), e.exit("characterEscape"), t) : n(i);
892
+ return Yn(i) ? (e.enter("characterEscapeValue"), e.consume(i), e.exit("characterEscapeValue"), e.exit("characterEscape"), t) : n(i);
891
893
  }
892
894
  }
893
- const an = {
895
+ const ln = {
894
896
  name: "characterReference",
895
- tokenize: pr
897
+ tokenize: gr
896
898
  };
897
- function pr(e, t, n) {
899
+ function gr(e, t, n) {
898
900
  const r = this;
899
901
  let o = 0, i, a;
900
902
  return l;
@@ -905,25 +907,25 @@ function pr(e, t, n) {
905
907
  return p === 35 ? (e.enter("characterReferenceMarkerNumeric"), e.consume(p), e.exit("characterReferenceMarkerNumeric"), u) : (e.enter("characterReferenceValue"), i = 31, a = le, f(p));
906
908
  }
907
909
  function u(p) {
908
- return p === 88 || p === 120 ? (e.enter("characterReferenceMarkerHexadecimal"), e.consume(p), e.exit("characterReferenceMarkerHexadecimal"), e.enter("characterReferenceValue"), i = 6, a = Qn, f) : (e.enter("characterReferenceValue"), i = 7, a = bt, f(p));
910
+ return p === 88 || p === 120 ? (e.enter("characterReferenceMarkerHexadecimal"), e.consume(p), e.exit("characterReferenceMarkerHexadecimal"), e.enter("characterReferenceValue"), i = 6, a = Kn, f) : (e.enter("characterReferenceValue"), i = 7, a = bt, f(p));
909
911
  }
910
912
  function f(p) {
911
913
  if (p === 59 && o) {
912
914
  const g = e.exit("characterReferenceValue");
913
- return a === le && !Ze(r.sliceSerialize(g)) ? n(p) : (e.enter("characterReferenceMarker"), e.consume(p), e.exit("characterReferenceMarker"), e.exit("characterReference"), t);
915
+ return a === le && !Je(r.sliceSerialize(g)) ? n(p) : (e.enter("characterReferenceMarker"), e.consume(p), e.exit("characterReferenceMarker"), e.exit("characterReference"), t);
914
916
  }
915
917
  return a(p) && o++ < i ? (e.consume(p), f) : n(p);
916
918
  }
917
919
  }
918
920
  const Ht = {
919
921
  partial: !0,
920
- tokenize: mr
922
+ tokenize: kr
921
923
  }, Vt = {
922
924
  concrete: !0,
923
925
  name: "codeFenced",
924
- tokenize: gr
926
+ tokenize: mr
925
927
  };
926
- function gr(e, t, n) {
928
+ function mr(e, t, n) {
927
929
  const r = this, o = {
928
930
  partial: !0,
929
931
  tokenize: B
@@ -934,19 +936,19 @@ function gr(e, t, n) {
934
936
  return u(k);
935
937
  }
936
938
  function u(k) {
937
- const F = r.events[r.events.length - 1];
938
- return i = F && F[1].type === "linePrefix" ? F[2].sliceSerialize(F[1], !0).length : 0, l = k, e.enter("codeFenced"), e.enter("codeFencedFence"), e.enter("codeFencedFenceSequence"), f(k);
939
+ const M = r.events[r.events.length - 1];
940
+ return i = M && M[1].type === "linePrefix" ? M[2].sliceSerialize(M[1], !0).length : 0, l = k, e.enter("codeFenced"), e.enter("codeFencedFence"), e.enter("codeFencedFenceSequence"), f(k);
939
941
  }
940
942
  function f(k) {
941
- return k === l ? (a++, e.consume(k), f) : a < 3 ? n(k) : (e.exit("codeFencedFenceSequence"), M(k) ? H(e, p, "whitespace")(k) : p(k));
943
+ return k === l ? (a++, e.consume(k), f) : a < 3 ? n(k) : (e.exit("codeFencedFenceSequence"), F(k) ? H(e, p, "whitespace")(k) : p(k));
942
944
  }
943
945
  function p(k) {
944
- return k === null || I(k) ? (e.exit("codeFencedFence"), r.interrupt ? t(k) : e.check(Ht, v, O)(k)) : (e.enter("codeFencedFenceInfo"), e.enter("chunkString", {
946
+ return k === null || I(k) ? (e.exit("codeFencedFence"), r.interrupt ? t(k) : e.check(Ht, w, O)(k)) : (e.enter("codeFencedFenceInfo"), e.enter("chunkString", {
945
947
  contentType: "string"
946
948
  }), g(k));
947
949
  }
948
950
  function g(k) {
949
- return k === null || I(k) ? (e.exit("chunkString"), e.exit("codeFencedFenceInfo"), p(k)) : M(k) ? (e.exit("chunkString"), e.exit("codeFencedFenceInfo"), H(e, c, "whitespace")(k)) : k === 96 && k === l ? n(k) : (e.consume(k), g);
951
+ return k === null || I(k) ? (e.exit("chunkString"), e.exit("codeFencedFenceInfo"), p(k)) : F(k) ? (e.exit("chunkString"), e.exit("codeFencedFenceInfo"), H(e, c, "whitespace")(k)) : k === 96 && k === l ? n(k) : (e.consume(k), g);
950
952
  }
951
953
  function c(k) {
952
954
  return k === null || I(k) ? p(k) : (e.enter("codeFencedFenceMeta"), e.enter("chunkString", {
@@ -956,45 +958,45 @@ function gr(e, t, n) {
956
958
  function b(k) {
957
959
  return k === null || I(k) ? (e.exit("chunkString"), e.exit("codeFencedFenceMeta"), p(k)) : k === 96 && k === l ? n(k) : (e.consume(k), b);
958
960
  }
959
- function v(k) {
960
- return e.attempt(o, O, z)(k);
961
+ function w(k) {
962
+ return e.attempt(o, O, A)(k);
961
963
  }
962
- function z(k) {
964
+ function A(k) {
963
965
  return e.enter("lineEnding"), e.consume(k), e.exit("lineEnding"), x;
964
966
  }
965
967
  function x(k) {
966
- return i > 0 && M(k) ? H(e, _, "linePrefix", i + 1)(k) : _(k);
968
+ return i > 0 && F(k) ? H(e, v, "linePrefix", i + 1)(k) : v(k);
967
969
  }
968
- function _(k) {
969
- return k === null || I(k) ? e.check(Ht, v, O)(k) : (e.enter("codeFlowValue"), w(k));
970
+ function v(k) {
971
+ return k === null || I(k) ? e.check(Ht, w, O)(k) : (e.enter("codeFlowValue"), _(k));
970
972
  }
971
- function w(k) {
972
- return k === null || I(k) ? (e.exit("codeFlowValue"), _(k)) : (e.consume(k), w);
973
+ function _(k) {
974
+ return k === null || I(k) ? (e.exit("codeFlowValue"), v(k)) : (e.consume(k), _);
973
975
  }
974
976
  function O(k) {
975
977
  return e.exit("codeFenced"), t(k);
976
978
  }
977
- function B(k, F, q) {
979
+ function B(k, M, q) {
978
980
  let N = 0;
979
981
  return $;
980
982
  function $(R) {
981
983
  return k.enter("lineEnding"), k.consume(R), k.exit("lineEnding"), T;
982
984
  }
983
985
  function T(R) {
984
- return k.enter("codeFencedFence"), M(R) ? H(k, E, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(R) : E(R);
986
+ return k.enter("codeFencedFence"), F(R) ? H(k, E, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(R) : E(R);
985
987
  }
986
988
  function E(R) {
987
989
  return R === l ? (k.enter("codeFencedFenceSequence"), D(R)) : q(R);
988
990
  }
989
991
  function D(R) {
990
- return R === l ? (N++, k.consume(R), D) : N >= a ? (k.exit("codeFencedFenceSequence"), M(R) ? H(k, V, "whitespace")(R) : V(R)) : q(R);
992
+ return R === l ? (N++, k.consume(R), D) : N >= a ? (k.exit("codeFencedFenceSequence"), F(R) ? H(k, V, "whitespace")(R) : V(R)) : q(R);
991
993
  }
992
994
  function V(R) {
993
- return R === null || I(R) ? (k.exit("codeFencedFence"), F(R)) : q(R);
995
+ return R === null || I(R) ? (k.exit("codeFencedFence"), M(R)) : q(R);
994
996
  }
995
997
  }
996
998
  }
997
- function mr(e, t, n) {
999
+ function kr(e, t, n) {
998
1000
  const r = this;
999
1001
  return o;
1000
1002
  function o(a) {
@@ -1004,14 +1006,14 @@ function mr(e, t, n) {
1004
1006
  return r.parser.lazy[r.now().line] ? n(a) : t(a);
1005
1007
  }
1006
1008
  }
1007
- const ct = {
1009
+ const ht = {
1008
1010
  name: "codeIndented",
1009
- tokenize: xr
1010
- }, kr = {
1011
- partial: !0,
1012
1011
  tokenize: br
1012
+ }, xr = {
1013
+ partial: !0,
1014
+ tokenize: yr
1013
1015
  };
1014
- function xr(e, t, n) {
1016
+ function br(e, t, n) {
1015
1017
  const r = this;
1016
1018
  return o;
1017
1019
  function o(u) {
@@ -1022,7 +1024,7 @@ function xr(e, t, n) {
1022
1024
  return f && f[1].type === "linePrefix" && f[2].sliceSerialize(f[1], !0).length >= 4 ? a(u) : n(u);
1023
1025
  }
1024
1026
  function a(u) {
1025
- return u === null ? s(u) : I(u) ? e.attempt(kr, a, s)(u) : (e.enter("codeFlowValue"), l(u));
1027
+ return u === null ? s(u) : I(u) ? e.attempt(xr, a, s)(u) : (e.enter("codeFlowValue"), l(u));
1026
1028
  }
1027
1029
  function l(u) {
1028
1030
  return u === null || I(u) ? (e.exit("codeFlowValue"), a(u)) : (e.consume(u), l);
@@ -1031,7 +1033,7 @@ function xr(e, t, n) {
1031
1033
  return e.exit("codeIndented"), t(u);
1032
1034
  }
1033
1035
  }
1034
- function br(e, t, n) {
1036
+ function yr(e, t, n) {
1035
1037
  const r = this;
1036
1038
  return o;
1037
1039
  function o(a) {
@@ -1042,13 +1044,13 @@ function br(e, t, n) {
1042
1044
  return l && l[1].type === "linePrefix" && l[2].sliceSerialize(l[1], !0).length >= 4 ? t(a) : I(a) ? o(a) : n(a);
1043
1045
  }
1044
1046
  }
1045
- const yr = {
1047
+ const Sr = {
1046
1048
  name: "codeText",
1047
1049
  previous: _r,
1048
- resolve: Sr,
1050
+ resolve: vr,
1049
1051
  tokenize: wr
1050
1052
  };
1051
- function Sr(e) {
1053
+ function vr(e) {
1052
1054
  let t = e.length - 4, n = 3, r, o;
1053
1055
  if ((e[n][1].type === "lineEnding" || e[n][1].type === "space") && (e[t][1].type === "lineEnding" || e[t][1].type === "space")) {
1054
1056
  for (r = n; ++r < t; )
@@ -1083,7 +1085,7 @@ function wr(e, t, n) {
1083
1085
  return p === 96 ? (e.consume(p), o++, f) : o === r ? (e.exit("codeTextSequence"), e.exit("codeText"), t(p)) : (i.type = "codeTextData", u(p));
1084
1086
  }
1085
1087
  }
1086
- class vr {
1088
+ class Cr {
1087
1089
  /**
1088
1090
  * @param {ReadonlyArray<T> | null | undefined} [initial]
1089
1091
  * Initial items (optional).
@@ -1255,10 +1257,10 @@ function Oe(e, t) {
1255
1257
  for (; n < t.length; )
1256
1258
  e.push(...t.slice(n, n + 1e4)), n += 1e4;
1257
1259
  }
1258
- function ln(e) {
1260
+ function un(e) {
1259
1261
  const t = {};
1260
1262
  let n = -1, r, o, i, a, l, s, u;
1261
- const f = new vr(e);
1263
+ const f = new Cr(e);
1262
1264
  for (; ++n < f.length; ) {
1263
1265
  for (; n in t; )
1264
1266
  n = t[n];
@@ -1266,7 +1268,7 @@ function ln(e) {
1266
1268
  for (; ++i < s.length && s[i][1].type !== "content"; )
1267
1269
  s[i][1].type === "chunkText" && (s[i][1]._isInFirstContentOfListItem = !0, i++);
1268
1270
  if (r[0] === "enter")
1269
- r[1].contentType && (Object.assign(t, Cr(f, n)), n = t[n], u = !0);
1271
+ r[1].contentType && (Object.assign(t, Er(f, n)), n = t[n], u = !0);
1270
1272
  else if (r[1]._container) {
1271
1273
  for (i = n, o = void 0; i--; )
1272
1274
  if (a = f.get(i), a[1].type === "lineEnding" || a[1].type === "lineEndingBlank")
@@ -1279,15 +1281,15 @@ function ln(e) {
1279
1281
  }
1280
1282
  return ue(e, 0, Number.POSITIVE_INFINITY, f.slice(0)), !u;
1281
1283
  }
1282
- function Cr(e, t) {
1284
+ function Er(e, t) {
1283
1285
  const n = e.get(t)[1], r = e.get(t)[2];
1284
1286
  let o = t - 1;
1285
1287
  const i = [];
1286
1288
  let a = n._tokenizer;
1287
1289
  a || (a = r.parser[n.contentType](n.start), n._contentTypeTextTrailing && (a._contentTypeTextTrailing = !0));
1288
1290
  const l = a.events, s = [], u = {};
1289
- let f, p, g = -1, c = n, b = 0, v = 0;
1290
- const z = [v];
1291
+ let f, p, g = -1, c = n, b = 0, w = 0;
1292
+ const A = [w];
1291
1293
  for (; c; ) {
1292
1294
  for (; e.get(++o)[1] !== c; )
1293
1295
  ;
@@ -1295,26 +1297,26 @@ function Cr(e, t) {
1295
1297
  }
1296
1298
  for (c = n; ++g < l.length; )
1297
1299
  // Find a void token that includes a break.
1298
- l[g][0] === "exit" && l[g - 1][0] === "enter" && l[g][1].type === l[g - 1][1].type && l[g][1].start.line !== l[g][1].end.line && (v = g + 1, z.push(v), c._tokenizer = void 0, c.previous = void 0, c = c.next);
1299
- for (a.events = [], c ? (c._tokenizer = void 0, c.previous = void 0) : z.pop(), g = z.length; g--; ) {
1300
- const x = l.slice(z[g], z[g + 1]), _ = i.pop();
1301
- s.push([_, _ + x.length - 1]), e.splice(_, 2, x);
1300
+ l[g][0] === "exit" && l[g - 1][0] === "enter" && l[g][1].type === l[g - 1][1].type && l[g][1].start.line !== l[g][1].end.line && (w = g + 1, A.push(w), c._tokenizer = void 0, c.previous = void 0, c = c.next);
1301
+ for (a.events = [], c ? (c._tokenizer = void 0, c.previous = void 0) : A.pop(), g = A.length; g--; ) {
1302
+ const x = l.slice(A[g], A[g + 1]), v = i.pop();
1303
+ s.push([v, v + x.length - 1]), e.splice(v, 2, x);
1302
1304
  }
1303
1305
  for (s.reverse(), g = -1; ++g < s.length; )
1304
1306
  u[b + s[g][0]] = b + s[g][1], b += s[g][1] - s[g][0] - 1;
1305
1307
  return u;
1306
1308
  }
1307
- const Er = {
1308
- resolve: Ir,
1309
- tokenize: Lr
1310
- }, Tr = {
1309
+ const Tr = {
1310
+ resolve: Lr,
1311
+ tokenize: Ar
1312
+ }, Ir = {
1311
1313
  partial: !0,
1312
- tokenize: zr
1314
+ tokenize: Br
1313
1315
  };
1314
- function Ir(e) {
1315
- return ln(e), e;
1316
+ function Lr(e) {
1317
+ return un(e), e;
1316
1318
  }
1317
- function Lr(e, t) {
1319
+ function Ar(e, t) {
1318
1320
  let n;
1319
1321
  return r;
1320
1322
  function r(l) {
@@ -1323,7 +1325,7 @@ function Lr(e, t) {
1323
1325
  }), o(l);
1324
1326
  }
1325
1327
  function o(l) {
1326
- return l === null ? i(l) : I(l) ? e.check(Tr, a, i)(l) : (e.consume(l), o);
1328
+ return l === null ? i(l) : I(l) ? e.check(Ir, a, i)(l) : (e.consume(l), o);
1327
1329
  }
1328
1330
  function i(l) {
1329
1331
  return e.exit("chunkContent"), e.exit("content"), t(l);
@@ -1335,7 +1337,7 @@ function Lr(e, t) {
1335
1337
  }), n = n.next, o;
1336
1338
  }
1337
1339
  }
1338
- function zr(e, t, n) {
1340
+ function Br(e, t, n) {
1339
1341
  const r = this;
1340
1342
  return o;
1341
1343
  function o(a) {
@@ -1348,14 +1350,14 @@ function zr(e, t, n) {
1348
1350
  return !r.parser.constructs.disable.null.includes("codeIndented") && l && l[1].type === "linePrefix" && l[2].sliceSerialize(l[1], !0).length >= 4 ? t(a) : e.interrupt(r.parser.constructs.flow, n, t)(a);
1349
1351
  }
1350
1352
  }
1351
- function un(e, t, n, r, o, i, a, l, s) {
1353
+ function sn(e, t, n, r, o, i, a, l, s) {
1352
1354
  const u = s || Number.POSITIVE_INFINITY;
1353
1355
  let f = 0;
1354
1356
  return p;
1355
1357
  function p(x) {
1356
1358
  return x === 60 ? (e.enter(r), e.enter(o), e.enter(i), e.consume(x), e.exit(i), g) : x === null || x === 32 || x === 41 || xt(x) ? n(x) : (e.enter(r), e.enter(a), e.enter(l), e.enter("chunkString", {
1357
1359
  contentType: "string"
1358
- }), v(x));
1360
+ }), w(x));
1359
1361
  }
1360
1362
  function g(x) {
1361
1363
  return x === 62 ? (e.enter(i), e.consume(x), e.exit(i), e.exit(o), e.exit(r), t) : (e.enter(l), e.enter("chunkString", {
@@ -1368,14 +1370,14 @@ function un(e, t, n, r, o, i, a, l, s) {
1368
1370
  function b(x) {
1369
1371
  return x === 60 || x === 62 || x === 92 ? (e.consume(x), c) : c(x);
1370
1372
  }
1371
- function v(x) {
1372
- return !f && (x === null || x === 41 || te(x)) ? (e.exit("chunkString"), e.exit(l), e.exit(a), e.exit(r), t(x)) : f < u && x === 40 ? (e.consume(x), f++, v) : x === 41 ? (e.consume(x), f--, v) : x === null || x === 32 || x === 40 || xt(x) ? n(x) : (e.consume(x), x === 92 ? z : v);
1373
+ function w(x) {
1374
+ return !f && (x === null || x === 41 || ne(x)) ? (e.exit("chunkString"), e.exit(l), e.exit(a), e.exit(r), t(x)) : f < u && x === 40 ? (e.consume(x), f++, w) : x === 41 ? (e.consume(x), f--, w) : x === null || x === 32 || x === 40 || xt(x) ? n(x) : (e.consume(x), x === 92 ? A : w);
1373
1375
  }
1374
- function z(x) {
1375
- return x === 40 || x === 41 || x === 92 ? (e.consume(x), v) : v(x);
1376
+ function A(x) {
1377
+ return x === 40 || x === 41 || x === 92 ? (e.consume(x), w) : w(x);
1376
1378
  }
1377
1379
  }
1378
- function sn(e, t, n, r, o, i) {
1380
+ function cn(e, t, n, r, o, i) {
1379
1381
  const a = this;
1380
1382
  let l = 0, s;
1381
1383
  return u;
@@ -1393,13 +1395,13 @@ function sn(e, t, n, r, o, i) {
1393
1395
  }), p(c));
1394
1396
  }
1395
1397
  function p(c) {
1396
- return c === null || c === 91 || c === 93 || I(c) || l++ > 999 ? (e.exit("chunkString"), f(c)) : (e.consume(c), s || (s = !M(c)), c === 92 ? g : p);
1398
+ return c === null || c === 91 || c === 93 || I(c) || l++ > 999 ? (e.exit("chunkString"), f(c)) : (e.consume(c), s || (s = !F(c)), c === 92 ? g : p);
1397
1399
  }
1398
1400
  function g(c) {
1399
1401
  return c === 91 || c === 92 || c === 93 ? (e.consume(c), l++, p) : p(c);
1400
1402
  }
1401
1403
  }
1402
- function cn(e, t, n, r, o, i) {
1404
+ function hn(e, t, n, r, o, i) {
1403
1405
  let a;
1404
1406
  return l;
1405
1407
  function l(g) {
@@ -1424,17 +1426,17 @@ function Ne(e, t) {
1424
1426
  let n;
1425
1427
  return r;
1426
1428
  function r(o) {
1427
- return I(o) ? (e.enter("lineEnding"), e.consume(o), e.exit("lineEnding"), n = !0, r) : M(o) ? H(e, r, n ? "linePrefix" : "lineSuffix")(o) : t(o);
1429
+ return I(o) ? (e.enter("lineEnding"), e.consume(o), e.exit("lineEnding"), n = !0, r) : F(o) ? H(e, r, n ? "linePrefix" : "lineSuffix")(o) : t(o);
1428
1430
  }
1429
1431
  }
1430
- const Br = {
1432
+ const zr = {
1431
1433
  name: "definition",
1432
- tokenize: Rr
1433
- }, Ar = {
1434
+ tokenize: Mr
1435
+ }, Rr = {
1434
1436
  partial: !0,
1435
1437
  tokenize: Fr
1436
1438
  };
1437
- function Rr(e, t, n) {
1439
+ function Mr(e, t, n) {
1438
1440
  const r = this;
1439
1441
  let o;
1440
1442
  return i;
@@ -1442,7 +1444,7 @@ function Rr(e, t, n) {
1442
1444
  return e.enter("definition"), a(c);
1443
1445
  }
1444
1446
  function a(c) {
1445
- return sn.call(
1447
+ return cn.call(
1446
1448
  r,
1447
1449
  e,
1448
1450
  l,
@@ -1457,10 +1459,10 @@ function Rr(e, t, n) {
1457
1459
  return o = Le(r.sliceSerialize(r.events[r.events.length - 1][1]).slice(1, -1)), c === 58 ? (e.enter("definitionMarker"), e.consume(c), e.exit("definitionMarker"), s) : n(c);
1458
1460
  }
1459
1461
  function s(c) {
1460
- return te(c) ? Ne(e, u)(c) : u(c);
1462
+ return ne(c) ? Ne(e, u)(c) : u(c);
1461
1463
  }
1462
1464
  function u(c) {
1463
- return un(
1465
+ return sn(
1464
1466
  e,
1465
1467
  f,
1466
1468
  // Note: we don’t need to reset the way `markdown-rs` does.
@@ -1473,10 +1475,10 @@ function Rr(e, t, n) {
1473
1475
  )(c);
1474
1476
  }
1475
1477
  function f(c) {
1476
- return e.attempt(Ar, p, p)(c);
1478
+ return e.attempt(Rr, p, p)(c);
1477
1479
  }
1478
1480
  function p(c) {
1479
- return M(c) ? H(e, g, "whitespace")(c) : g(c);
1481
+ return F(c) ? H(e, g, "whitespace")(c) : g(c);
1480
1482
  }
1481
1483
  function g(c) {
1482
1484
  return c === null || I(c) ? (e.exit("definition"), r.parser.defined.push(o), t(c)) : n(c);
@@ -1485,23 +1487,23 @@ function Rr(e, t, n) {
1485
1487
  function Fr(e, t, n) {
1486
1488
  return r;
1487
1489
  function r(l) {
1488
- return te(l) ? Ne(e, o)(l) : n(l);
1490
+ return ne(l) ? Ne(e, o)(l) : n(l);
1489
1491
  }
1490
1492
  function o(l) {
1491
- return cn(e, i, n, "definitionTitle", "definitionTitleMarker", "definitionTitleString")(l);
1493
+ return hn(e, i, n, "definitionTitle", "definitionTitleMarker", "definitionTitleString")(l);
1492
1494
  }
1493
1495
  function i(l) {
1494
- return M(l) ? H(e, a, "whitespace")(l) : a(l);
1496
+ return F(l) ? H(e, a, "whitespace")(l) : a(l);
1495
1497
  }
1496
1498
  function a(l) {
1497
1499
  return l === null || I(l) ? t(l) : n(l);
1498
1500
  }
1499
1501
  }
1500
- const Mr = {
1502
+ const Pr = {
1501
1503
  name: "hardBreakEscape",
1502
- tokenize: Pr
1504
+ tokenize: Or
1503
1505
  };
1504
- function Pr(e, t, n) {
1506
+ function Or(e, t, n) {
1505
1507
  return r;
1506
1508
  function r(i) {
1507
1509
  return e.enter("hardBreakEscape"), e.consume(i), o;
@@ -1510,12 +1512,12 @@ function Pr(e, t, n) {
1510
1512
  return I(i) ? (e.exit("hardBreakEscape"), t(i)) : n(i);
1511
1513
  }
1512
1514
  }
1513
- const Or = {
1515
+ const Nr = {
1514
1516
  name: "headingAtx",
1515
- resolve: Nr,
1516
- tokenize: $r
1517
+ resolve: $r,
1518
+ tokenize: Dr
1517
1519
  };
1518
- function Nr(e, t) {
1520
+ function $r(e, t) {
1519
1521
  let n = e.length - 2, r = 3, o, i;
1520
1522
  return e[r][1].type === "whitespace" && (r += 2), n - 2 > r && e[n][1].type === "whitespace" && (n -= 2), e[n][1].type === "atxHeadingSequence" && (r === n - 1 || n - 4 > r && e[n - 2][1].type === "whitespace") && (n -= r + 1 === n ? 2 : 4), n > r && (o = {
1521
1523
  type: "atxHeadingText",
@@ -1528,7 +1530,7 @@ function Nr(e, t) {
1528
1530
  contentType: "text"
1529
1531
  }, ue(e, r, n - r + 1, [["enter", o, t], ["enter", i, t], ["exit", i, t], ["exit", o, t]])), e;
1530
1532
  }
1531
- function $r(e, t, n) {
1533
+ function Dr(e, t, n) {
1532
1534
  let r = 0;
1533
1535
  return o;
1534
1536
  function o(f) {
@@ -1538,19 +1540,19 @@ function $r(e, t, n) {
1538
1540
  return e.enter("atxHeadingSequence"), a(f);
1539
1541
  }
1540
1542
  function a(f) {
1541
- return f === 35 && r++ < 6 ? (e.consume(f), a) : f === null || te(f) ? (e.exit("atxHeadingSequence"), l(f)) : n(f);
1543
+ return f === 35 && r++ < 6 ? (e.consume(f), a) : f === null || ne(f) ? (e.exit("atxHeadingSequence"), l(f)) : n(f);
1542
1544
  }
1543
1545
  function l(f) {
1544
- return f === 35 ? (e.enter("atxHeadingSequence"), s(f)) : f === null || I(f) ? (e.exit("atxHeading"), t(f)) : M(f) ? H(e, l, "whitespace")(f) : (e.enter("atxHeadingText"), u(f));
1546
+ return f === 35 ? (e.enter("atxHeadingSequence"), s(f)) : f === null || I(f) ? (e.exit("atxHeading"), t(f)) : F(f) ? H(e, l, "whitespace")(f) : (e.enter("atxHeadingText"), u(f));
1545
1547
  }
1546
1548
  function s(f) {
1547
1549
  return f === 35 ? (e.consume(f), s) : (e.exit("atxHeadingSequence"), l(f));
1548
1550
  }
1549
1551
  function u(f) {
1550
- return f === null || f === 35 || te(f) ? (e.exit("atxHeadingText"), l(f)) : (e.consume(f), u);
1552
+ return f === null || f === 35 || ne(f) ? (e.exit("atxHeadingText"), l(f)) : (e.consume(f), u);
1551
1553
  }
1552
1554
  }
1553
- const Dr = [
1555
+ const Hr = [
1554
1556
  "address",
1555
1557
  "article",
1556
1558
  "aside",
@@ -1613,25 +1615,25 @@ const Dr = [
1613
1615
  "tr",
1614
1616
  "track",
1615
1617
  "ul"
1616
- ], qt = ["pre", "script", "style", "textarea"], Hr = {
1618
+ ], qt = ["pre", "script", "style", "textarea"], Vr = {
1617
1619
  concrete: !0,
1618
1620
  name: "htmlFlow",
1619
- resolveTo: Ur,
1620
- tokenize: Wr
1621
- }, Vr = {
1622
- partial: !0,
1623
- tokenize: Qr
1621
+ resolveTo: Wr,
1622
+ tokenize: jr
1624
1623
  }, qr = {
1625
1624
  partial: !0,
1626
- tokenize: jr
1625
+ tokenize: Kr
1626
+ }, Ur = {
1627
+ partial: !0,
1628
+ tokenize: Qr
1627
1629
  };
1628
- function Ur(e) {
1630
+ function Wr(e) {
1629
1631
  let t = e.length;
1630
1632
  for (; t-- && !(e[t][0] === "enter" && e[t][1].type === "htmlFlow"); )
1631
1633
  ;
1632
1634
  return t > 1 && e[t - 2][1].type === "linePrefix" && (e[t][1].start = e[t - 2][1].start, e[t + 1][1].start = e[t - 2][1].start, e.splice(t - 2, 2)), e;
1633
1635
  }
1634
- function Wr(e, t, n) {
1636
+ function jr(e, t, n) {
1635
1637
  const r = this;
1636
1638
  let o, i, a, l, s;
1637
1639
  return u;
@@ -1642,10 +1644,10 @@ function Wr(e, t, n) {
1642
1644
  return e.enter("htmlFlow"), e.enter("htmlFlowData"), e.consume(d), p;
1643
1645
  }
1644
1646
  function p(d) {
1645
- return d === 33 ? (e.consume(d), g) : d === 47 ? (e.consume(d), i = !0, v) : d === 63 ? (e.consume(d), o = 3, r.interrupt ? t : h) : _e(d) ? (e.consume(d), a = String.fromCharCode(d), z) : n(d);
1647
+ return d === 33 ? (e.consume(d), g) : d === 47 ? (e.consume(d), i = !0, w) : d === 63 ? (e.consume(d), o = 3, r.interrupt ? t : h) : ve(d) ? (e.consume(d), a = String.fromCharCode(d), A) : n(d);
1646
1648
  }
1647
1649
  function g(d) {
1648
- return d === 45 ? (e.consume(d), o = 2, c) : d === 91 ? (e.consume(d), o = 5, l = 0, b) : _e(d) ? (e.consume(d), o = 4, r.interrupt ? t : h) : n(d);
1650
+ return d === 45 ? (e.consume(d), o = 2, c) : d === 91 ? (e.consume(d), o = 5, l = 0, b) : ve(d) ? (e.consume(d), o = 4, r.interrupt ? t : h) : n(d);
1649
1651
  }
1650
1652
  function c(d) {
1651
1653
  return d === 45 ? (e.consume(d), r.interrupt ? t : h) : n(d);
@@ -1654,54 +1656,54 @@ function Wr(e, t, n) {
1654
1656
  const oe = "CDATA[";
1655
1657
  return d === oe.charCodeAt(l++) ? (e.consume(d), l === oe.length ? r.interrupt ? t : E : b) : n(d);
1656
1658
  }
1657
- function v(d) {
1658
- return _e(d) ? (e.consume(d), a = String.fromCharCode(d), z) : n(d);
1659
+ function w(d) {
1660
+ return ve(d) ? (e.consume(d), a = String.fromCharCode(d), A) : n(d);
1659
1661
  }
1660
- function z(d) {
1661
- if (d === null || d === 47 || d === 62 || te(d)) {
1662
- const oe = d === 47, we = a.toLowerCase();
1663
- return !oe && !i && qt.includes(we) ? (o = 1, r.interrupt ? t(d) : E(d)) : Dr.includes(a.toLowerCase()) ? (o = 6, oe ? (e.consume(d), x) : r.interrupt ? t(d) : E(d)) : (o = 7, r.interrupt && !r.parser.lazy[r.now().line] ? n(d) : i ? _(d) : w(d));
1662
+ function A(d) {
1663
+ if (d === null || d === 47 || d === 62 || ne(d)) {
1664
+ const oe = d === 47, _e = a.toLowerCase();
1665
+ return !oe && !i && qt.includes(_e) ? (o = 1, r.interrupt ? t(d) : E(d)) : Hr.includes(a.toLowerCase()) ? (o = 6, oe ? (e.consume(d), x) : r.interrupt ? t(d) : E(d)) : (o = 7, r.interrupt && !r.parser.lazy[r.now().line] ? n(d) : i ? v(d) : _(d));
1664
1666
  }
1665
- return d === 45 || le(d) ? (e.consume(d), a += String.fromCharCode(d), z) : n(d);
1667
+ return d === 45 || le(d) ? (e.consume(d), a += String.fromCharCode(d), A) : n(d);
1666
1668
  }
1667
1669
  function x(d) {
1668
1670
  return d === 62 ? (e.consume(d), r.interrupt ? t : E) : n(d);
1669
1671
  }
1670
- function _(d) {
1671
- return M(d) ? (e.consume(d), _) : $(d);
1672
+ function v(d) {
1673
+ return F(d) ? (e.consume(d), v) : $(d);
1672
1674
  }
1673
- function w(d) {
1674
- return d === 47 ? (e.consume(d), $) : d === 58 || d === 95 || _e(d) ? (e.consume(d), O) : M(d) ? (e.consume(d), w) : $(d);
1675
+ function _(d) {
1676
+ return d === 47 ? (e.consume(d), $) : d === 58 || d === 95 || ve(d) ? (e.consume(d), O) : F(d) ? (e.consume(d), _) : $(d);
1675
1677
  }
1676
1678
  function O(d) {
1677
1679
  return d === 45 || d === 46 || d === 58 || d === 95 || le(d) ? (e.consume(d), O) : B(d);
1678
1680
  }
1679
1681
  function B(d) {
1680
- return d === 61 ? (e.consume(d), k) : M(d) ? (e.consume(d), B) : w(d);
1682
+ return d === 61 ? (e.consume(d), k) : F(d) ? (e.consume(d), B) : _(d);
1681
1683
  }
1682
1684
  function k(d) {
1683
- return d === null || d === 60 || d === 61 || d === 62 || d === 96 ? n(d) : d === 34 || d === 39 ? (e.consume(d), s = d, F) : M(d) ? (e.consume(d), k) : q(d);
1685
+ return d === null || d === 60 || d === 61 || d === 62 || d === 96 ? n(d) : d === 34 || d === 39 ? (e.consume(d), s = d, M) : F(d) ? (e.consume(d), k) : q(d);
1684
1686
  }
1685
- function F(d) {
1686
- return d === s ? (e.consume(d), s = null, N) : d === null || I(d) ? n(d) : (e.consume(d), F);
1687
+ function M(d) {
1688
+ return d === s ? (e.consume(d), s = null, N) : d === null || I(d) ? n(d) : (e.consume(d), M);
1687
1689
  }
1688
1690
  function q(d) {
1689
- return d === null || d === 34 || d === 39 || d === 47 || d === 60 || d === 61 || d === 62 || d === 96 || te(d) ? B(d) : (e.consume(d), q);
1691
+ return d === null || d === 34 || d === 39 || d === 47 || d === 60 || d === 61 || d === 62 || d === 96 || ne(d) ? B(d) : (e.consume(d), q);
1690
1692
  }
1691
1693
  function N(d) {
1692
- return d === 47 || d === 62 || M(d) ? w(d) : n(d);
1694
+ return d === 47 || d === 62 || F(d) ? _(d) : n(d);
1693
1695
  }
1694
1696
  function $(d) {
1695
1697
  return d === 62 ? (e.consume(d), T) : n(d);
1696
1698
  }
1697
1699
  function T(d) {
1698
- return d === null || I(d) ? E(d) : M(d) ? (e.consume(d), T) : n(d);
1700
+ return d === null || I(d) ? E(d) : F(d) ? (e.consume(d), T) : n(d);
1699
1701
  }
1700
1702
  function E(d) {
1701
- return d === 45 && o === 2 ? (e.consume(d), Q) : d === 60 && o === 1 ? (e.consume(d), U) : d === 62 && o === 4 ? (e.consume(d), ie) : d === 63 && o === 3 ? (e.consume(d), h) : d === 93 && o === 5 ? (e.consume(d), de) : I(d) && (o === 6 || o === 7) ? (e.exit("htmlFlowData"), e.check(Vr, fe, D)(d)) : d === null || I(d) ? (e.exit("htmlFlowData"), D(d)) : (e.consume(d), E);
1703
+ return d === 45 && o === 2 ? (e.consume(d), Q) : d === 60 && o === 1 ? (e.consume(d), W) : d === 62 && o === 4 ? (e.consume(d), ie) : d === 63 && o === 3 ? (e.consume(d), h) : d === 93 && o === 5 ? (e.consume(d), de) : I(d) && (o === 6 || o === 7) ? (e.exit("htmlFlowData"), e.check(qr, fe, D)(d)) : d === null || I(d) ? (e.exit("htmlFlowData"), D(d)) : (e.consume(d), E);
1702
1704
  }
1703
1705
  function D(d) {
1704
- return e.check(qr, V, fe)(d);
1706
+ return e.check(Ur, V, fe)(d);
1705
1707
  }
1706
1708
  function V(d) {
1707
1709
  return e.enter("lineEnding"), e.consume(d), e.exit("lineEnding"), R;
@@ -1712,7 +1714,7 @@ function Wr(e, t, n) {
1712
1714
  function Q(d) {
1713
1715
  return d === 45 ? (e.consume(d), h) : E(d);
1714
1716
  }
1715
- function U(d) {
1717
+ function W(d) {
1716
1718
  return d === 47 ? (e.consume(d), a = "", re) : E(d);
1717
1719
  }
1718
1720
  function re(d) {
@@ -1720,7 +1722,7 @@ function Wr(e, t, n) {
1720
1722
  const oe = a.toLowerCase();
1721
1723
  return qt.includes(oe) ? (e.consume(d), ie) : E(d);
1722
1724
  }
1723
- return _e(d) && a.length < 8 ? (e.consume(d), a += String.fromCharCode(d), re) : E(d);
1725
+ return ve(d) && a.length < 8 ? (e.consume(d), a += String.fromCharCode(d), re) : E(d);
1724
1726
  }
1725
1727
  function de(d) {
1726
1728
  return d === 93 ? (e.consume(d), h) : E(d);
@@ -1735,7 +1737,7 @@ function Wr(e, t, n) {
1735
1737
  return e.exit("htmlFlow"), t(d);
1736
1738
  }
1737
1739
  }
1738
- function jr(e, t, n) {
1740
+ function Qr(e, t, n) {
1739
1741
  const r = this;
1740
1742
  return o;
1741
1743
  function o(a) {
@@ -1745,17 +1747,17 @@ function jr(e, t, n) {
1745
1747
  return r.parser.lazy[r.now().line] ? n(a) : t(a);
1746
1748
  }
1747
1749
  }
1748
- function Qr(e, t, n) {
1750
+ function Kr(e, t, n) {
1749
1751
  return r;
1750
1752
  function r(o) {
1751
- return e.enter("lineEnding"), e.consume(o), e.exit("lineEnding"), e.attempt(et, t, n);
1753
+ return e.enter("lineEnding"), e.consume(o), e.exit("lineEnding"), e.attempt(tt, t, n);
1752
1754
  }
1753
1755
  }
1754
- const Kr = {
1756
+ const Yr = {
1755
1757
  name: "htmlText",
1756
- tokenize: Yr
1758
+ tokenize: Gr
1757
1759
  };
1758
- function Yr(e, t, n) {
1760
+ function Gr(e, t, n) {
1759
1761
  const r = this;
1760
1762
  let o, i, a;
1761
1763
  return l;
@@ -1763,16 +1765,16 @@ function Yr(e, t, n) {
1763
1765
  return e.enter("htmlText"), e.enter("htmlTextData"), e.consume(h), s;
1764
1766
  }
1765
1767
  function s(h) {
1766
- return h === 33 ? (e.consume(h), u) : h === 47 ? (e.consume(h), B) : h === 63 ? (e.consume(h), w) : _e(h) ? (e.consume(h), q) : n(h);
1768
+ return h === 33 ? (e.consume(h), u) : h === 47 ? (e.consume(h), B) : h === 63 ? (e.consume(h), _) : ve(h) ? (e.consume(h), q) : n(h);
1767
1769
  }
1768
1770
  function u(h) {
1769
- return h === 45 ? (e.consume(h), f) : h === 91 ? (e.consume(h), i = 0, b) : _e(h) ? (e.consume(h), _) : n(h);
1771
+ return h === 45 ? (e.consume(h), f) : h === 91 ? (e.consume(h), i = 0, b) : ve(h) ? (e.consume(h), v) : n(h);
1770
1772
  }
1771
1773
  function f(h) {
1772
1774
  return h === 45 ? (e.consume(h), c) : n(h);
1773
1775
  }
1774
1776
  function p(h) {
1775
- return h === null ? n(h) : h === 45 ? (e.consume(h), g) : I(h) ? (a = p, U(h)) : (e.consume(h), p);
1777
+ return h === null ? n(h) : h === 45 ? (e.consume(h), g) : I(h) ? (a = p, W(h)) : (e.consume(h), p);
1776
1778
  }
1777
1779
  function g(h) {
1778
1780
  return h === 45 ? (e.consume(h), c) : p(h);
@@ -1782,67 +1784,67 @@ function Yr(e, t, n) {
1782
1784
  }
1783
1785
  function b(h) {
1784
1786
  const ie = "CDATA[";
1785
- return h === ie.charCodeAt(i++) ? (e.consume(h), i === ie.length ? v : b) : n(h);
1787
+ return h === ie.charCodeAt(i++) ? (e.consume(h), i === ie.length ? w : b) : n(h);
1786
1788
  }
1787
- function v(h) {
1788
- return h === null ? n(h) : h === 93 ? (e.consume(h), z) : I(h) ? (a = v, U(h)) : (e.consume(h), v);
1789
+ function w(h) {
1790
+ return h === null ? n(h) : h === 93 ? (e.consume(h), A) : I(h) ? (a = w, W(h)) : (e.consume(h), w);
1789
1791
  }
1790
- function z(h) {
1791
- return h === 93 ? (e.consume(h), x) : v(h);
1792
+ function A(h) {
1793
+ return h === 93 ? (e.consume(h), x) : w(h);
1792
1794
  }
1793
1795
  function x(h) {
1794
- return h === 62 ? Q(h) : h === 93 ? (e.consume(h), x) : v(h);
1796
+ return h === 62 ? Q(h) : h === 93 ? (e.consume(h), x) : w(h);
1795
1797
  }
1796
- function _(h) {
1797
- return h === null || h === 62 ? Q(h) : I(h) ? (a = _, U(h)) : (e.consume(h), _);
1798
+ function v(h) {
1799
+ return h === null || h === 62 ? Q(h) : I(h) ? (a = v, W(h)) : (e.consume(h), v);
1798
1800
  }
1799
- function w(h) {
1800
- return h === null ? n(h) : h === 63 ? (e.consume(h), O) : I(h) ? (a = w, U(h)) : (e.consume(h), w);
1801
+ function _(h) {
1802
+ return h === null ? n(h) : h === 63 ? (e.consume(h), O) : I(h) ? (a = _, W(h)) : (e.consume(h), _);
1801
1803
  }
1802
1804
  function O(h) {
1803
- return h === 62 ? Q(h) : w(h);
1805
+ return h === 62 ? Q(h) : _(h);
1804
1806
  }
1805
1807
  function B(h) {
1806
- return _e(h) ? (e.consume(h), k) : n(h);
1808
+ return ve(h) ? (e.consume(h), k) : n(h);
1807
1809
  }
1808
1810
  function k(h) {
1809
- return h === 45 || le(h) ? (e.consume(h), k) : F(h);
1811
+ return h === 45 || le(h) ? (e.consume(h), k) : M(h);
1810
1812
  }
1811
- function F(h) {
1812
- return I(h) ? (a = F, U(h)) : M(h) ? (e.consume(h), F) : Q(h);
1813
+ function M(h) {
1814
+ return I(h) ? (a = M, W(h)) : F(h) ? (e.consume(h), M) : Q(h);
1813
1815
  }
1814
1816
  function q(h) {
1815
- return h === 45 || le(h) ? (e.consume(h), q) : h === 47 || h === 62 || te(h) ? N(h) : n(h);
1817
+ return h === 45 || le(h) ? (e.consume(h), q) : h === 47 || h === 62 || ne(h) ? N(h) : n(h);
1816
1818
  }
1817
1819
  function N(h) {
1818
- return h === 47 ? (e.consume(h), Q) : h === 58 || h === 95 || _e(h) ? (e.consume(h), $) : I(h) ? (a = N, U(h)) : M(h) ? (e.consume(h), N) : Q(h);
1820
+ return h === 47 ? (e.consume(h), Q) : h === 58 || h === 95 || ve(h) ? (e.consume(h), $) : I(h) ? (a = N, W(h)) : F(h) ? (e.consume(h), N) : Q(h);
1819
1821
  }
1820
1822
  function $(h) {
1821
1823
  return h === 45 || h === 46 || h === 58 || h === 95 || le(h) ? (e.consume(h), $) : T(h);
1822
1824
  }
1823
1825
  function T(h) {
1824
- return h === 61 ? (e.consume(h), E) : I(h) ? (a = T, U(h)) : M(h) ? (e.consume(h), T) : N(h);
1826
+ return h === 61 ? (e.consume(h), E) : I(h) ? (a = T, W(h)) : F(h) ? (e.consume(h), T) : N(h);
1825
1827
  }
1826
1828
  function E(h) {
1827
- return h === null || h === 60 || h === 61 || h === 62 || h === 96 ? n(h) : h === 34 || h === 39 ? (e.consume(h), o = h, D) : I(h) ? (a = E, U(h)) : M(h) ? (e.consume(h), E) : (e.consume(h), V);
1829
+ return h === null || h === 60 || h === 61 || h === 62 || h === 96 ? n(h) : h === 34 || h === 39 ? (e.consume(h), o = h, D) : I(h) ? (a = E, W(h)) : F(h) ? (e.consume(h), E) : (e.consume(h), V);
1828
1830
  }
1829
1831
  function D(h) {
1830
- return h === o ? (e.consume(h), o = void 0, R) : h === null ? n(h) : I(h) ? (a = D, U(h)) : (e.consume(h), D);
1832
+ return h === o ? (e.consume(h), o = void 0, R) : h === null ? n(h) : I(h) ? (a = D, W(h)) : (e.consume(h), D);
1831
1833
  }
1832
1834
  function V(h) {
1833
- return h === null || h === 34 || h === 39 || h === 60 || h === 61 || h === 96 ? n(h) : h === 47 || h === 62 || te(h) ? N(h) : (e.consume(h), V);
1835
+ return h === null || h === 34 || h === 39 || h === 60 || h === 61 || h === 96 ? n(h) : h === 47 || h === 62 || ne(h) ? N(h) : (e.consume(h), V);
1834
1836
  }
1835
1837
  function R(h) {
1836
- return h === 47 || h === 62 || te(h) ? N(h) : n(h);
1838
+ return h === 47 || h === 62 || ne(h) ? N(h) : n(h);
1837
1839
  }
1838
1840
  function Q(h) {
1839
1841
  return h === 62 ? (e.consume(h), e.exit("htmlTextData"), e.exit("htmlText"), t) : n(h);
1840
1842
  }
1841
- function U(h) {
1843
+ function W(h) {
1842
1844
  return e.exit("htmlTextData"), e.enter("lineEnding"), e.consume(h), e.exit("lineEnding"), re;
1843
1845
  }
1844
1846
  function re(h) {
1845
- return M(h) ? H(e, de, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(h) : de(h);
1847
+ return F(h) ? H(e, de, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(h) : de(h);
1846
1848
  }
1847
1849
  function de(h) {
1848
1850
  return e.enter("htmlTextData"), a(h);
@@ -1850,17 +1852,17 @@ function Yr(e, t, n) {
1850
1852
  }
1851
1853
  const Ct = {
1852
1854
  name: "labelEnd",
1853
- resolveAll: Jr,
1854
- resolveTo: ei,
1855
- tokenize: ti
1856
- }, Xr = {
1855
+ resolveAll: ei,
1856
+ resolveTo: ti,
1857
1857
  tokenize: ni
1858
- }, Gr = {
1858
+ }, Xr = {
1859
1859
  tokenize: ri
1860
1860
  }, Zr = {
1861
1861
  tokenize: ii
1862
+ }, Jr = {
1863
+ tokenize: oi
1862
1864
  };
1863
- function Jr(e) {
1865
+ function ei(e) {
1864
1866
  let t = -1;
1865
1867
  const n = [];
1866
1868
  for (; ++t < e.length; ) {
@@ -1872,7 +1874,7 @@ function Jr(e) {
1872
1874
  }
1873
1875
  return e.length !== n.length && ue(e, 0, e.length, n), e;
1874
1876
  }
1875
- function ei(e, t) {
1877
+ function ti(e, t) {
1876
1878
  let n = e.length, r = 0, o, i, a, l;
1877
1879
  for (; n--; )
1878
1880
  if (o = e[n][1], i) {
@@ -1910,9 +1912,9 @@ function ei(e, t) {
1910
1912
  ...e[a - 2][1].start
1911
1913
  }
1912
1914
  };
1913
- return l = [["enter", s, t], ["enter", u, t]], l = Y(l, e.slice(i + 1, i + r + 3)), l = Y(l, [["enter", f, t]]), l = Y(l, Je(t.parser.constructs.insideSpan.null, e.slice(i + r + 4, a - 3), t)), l = Y(l, [["exit", f, t], e[a - 2], e[a - 1], ["exit", u, t]]), l = Y(l, e.slice(a + 1)), l = Y(l, [["exit", s, t]]), ue(e, i, e.length, l), e;
1915
+ return l = [["enter", s, t], ["enter", u, t]], l = Y(l, e.slice(i + 1, i + r + 3)), l = Y(l, [["enter", f, t]]), l = Y(l, et(t.parser.constructs.insideSpan.null, e.slice(i + r + 4, a - 3), t)), l = Y(l, [["exit", f, t], e[a - 2], e[a - 1], ["exit", u, t]]), l = Y(l, e.slice(a + 1)), l = Y(l, [["exit", s, t]]), ue(e, i, e.length, l), e;
1914
1916
  }
1915
- function ti(e, t, n) {
1917
+ function ni(e, t, n) {
1916
1918
  const r = this;
1917
1919
  let o = r.events.length, i, a;
1918
1920
  for (; o--; )
@@ -1928,10 +1930,10 @@ function ti(e, t, n) {
1928
1930
  }))), e.enter("labelEnd"), e.enter("labelMarker"), e.consume(g), e.exit("labelMarker"), e.exit("labelEnd"), s) : n(g);
1929
1931
  }
1930
1932
  function s(g) {
1931
- return g === 40 ? e.attempt(Xr, f, a ? f : p)(g) : g === 91 ? e.attempt(Gr, f, a ? u : p)(g) : a ? f(g) : p(g);
1933
+ return g === 40 ? e.attempt(Xr, f, a ? f : p)(g) : g === 91 ? e.attempt(Zr, f, a ? u : p)(g) : a ? f(g) : p(g);
1932
1934
  }
1933
1935
  function u(g) {
1934
- return e.attempt(Zr, f, p)(g);
1936
+ return e.attempt(Jr, f, p)(g);
1935
1937
  }
1936
1938
  function f(g) {
1937
1939
  return t(g);
@@ -1940,38 +1942,38 @@ function ti(e, t, n) {
1940
1942
  return i._balanced = !0, n(g);
1941
1943
  }
1942
1944
  }
1943
- function ni(e, t, n) {
1945
+ function ri(e, t, n) {
1944
1946
  return r;
1945
1947
  function r(p) {
1946
1948
  return e.enter("resource"), e.enter("resourceMarker"), e.consume(p), e.exit("resourceMarker"), o;
1947
1949
  }
1948
1950
  function o(p) {
1949
- return te(p) ? Ne(e, i)(p) : i(p);
1951
+ return ne(p) ? Ne(e, i)(p) : i(p);
1950
1952
  }
1951
1953
  function i(p) {
1952
- return p === 41 ? f(p) : un(e, a, l, "resourceDestination", "resourceDestinationLiteral", "resourceDestinationLiteralMarker", "resourceDestinationRaw", "resourceDestinationString", 32)(p);
1954
+ return p === 41 ? f(p) : sn(e, a, l, "resourceDestination", "resourceDestinationLiteral", "resourceDestinationLiteralMarker", "resourceDestinationRaw", "resourceDestinationString", 32)(p);
1953
1955
  }
1954
1956
  function a(p) {
1955
- return te(p) ? Ne(e, s)(p) : f(p);
1957
+ return ne(p) ? Ne(e, s)(p) : f(p);
1956
1958
  }
1957
1959
  function l(p) {
1958
1960
  return n(p);
1959
1961
  }
1960
1962
  function s(p) {
1961
- return p === 34 || p === 39 || p === 40 ? cn(e, u, n, "resourceTitle", "resourceTitleMarker", "resourceTitleString")(p) : f(p);
1963
+ return p === 34 || p === 39 || p === 40 ? hn(e, u, n, "resourceTitle", "resourceTitleMarker", "resourceTitleString")(p) : f(p);
1962
1964
  }
1963
1965
  function u(p) {
1964
- return te(p) ? Ne(e, f)(p) : f(p);
1966
+ return ne(p) ? Ne(e, f)(p) : f(p);
1965
1967
  }
1966
1968
  function f(p) {
1967
1969
  return p === 41 ? (e.enter("resourceMarker"), e.consume(p), e.exit("resourceMarker"), e.exit("resource"), t) : n(p);
1968
1970
  }
1969
1971
  }
1970
- function ri(e, t, n) {
1972
+ function ii(e, t, n) {
1971
1973
  const r = this;
1972
1974
  return o;
1973
1975
  function o(l) {
1974
- return sn.call(r, e, i, a, "reference", "referenceMarker", "referenceString")(l);
1976
+ return cn.call(r, e, i, a, "reference", "referenceMarker", "referenceString")(l);
1975
1977
  }
1976
1978
  function i(l) {
1977
1979
  return r.parser.defined.includes(Le(r.sliceSerialize(r.events[r.events.length - 1][1]).slice(1, -1))) ? t(l) : n(l);
@@ -1980,7 +1982,7 @@ function ri(e, t, n) {
1980
1982
  return n(l);
1981
1983
  }
1982
1984
  }
1983
- function ii(e, t, n) {
1985
+ function oi(e, t, n) {
1984
1986
  return r;
1985
1987
  function r(i) {
1986
1988
  return e.enter("reference"), e.enter("referenceMarker"), e.consume(i), e.exit("referenceMarker"), o;
@@ -1989,12 +1991,12 @@ function ii(e, t, n) {
1989
1991
  return i === 93 ? (e.enter("referenceMarker"), e.consume(i), e.exit("referenceMarker"), e.exit("reference"), t) : n(i);
1990
1992
  }
1991
1993
  }
1992
- const oi = {
1994
+ const ai = {
1993
1995
  name: "labelStartImage",
1994
1996
  resolveAll: Ct.resolveAll,
1995
- tokenize: ai
1997
+ tokenize: li
1996
1998
  };
1997
- function ai(e, t, n) {
1999
+ function li(e, t, n) {
1998
2000
  const r = this;
1999
2001
  return o;
2000
2002
  function o(l) {
@@ -2007,12 +2009,12 @@ function ai(e, t, n) {
2007
2009
  return l === 94 && "_hiddenFootnoteSupport" in r.parser.constructs ? n(l) : t(l);
2008
2010
  }
2009
2011
  }
2010
- const li = {
2012
+ const ui = {
2011
2013
  name: "labelStartLink",
2012
2014
  resolveAll: Ct.resolveAll,
2013
- tokenize: ui
2015
+ tokenize: si
2014
2016
  };
2015
- function ui(e, t, n) {
2017
+ function si(e, t, n) {
2016
2018
  const r = this;
2017
2019
  return o;
2018
2020
  function o(a) {
@@ -2022,11 +2024,11 @@ function ui(e, t, n) {
2022
2024
  return a === 94 && "_hiddenFootnoteSupport" in r.parser.constructs ? n(a) : t(a);
2023
2025
  }
2024
2026
  }
2025
- const ht = {
2027
+ const dt = {
2026
2028
  name: "lineEnding",
2027
- tokenize: si
2029
+ tokenize: ci
2028
2030
  };
2029
- function si(e, t) {
2031
+ function ci(e, t) {
2030
2032
  return n;
2031
2033
  function n(r) {
2032
2034
  return e.enter("lineEnding"), e.consume(r), e.exit("lineEnding"), H(e, t, "linePrefix");
@@ -2034,9 +2036,9 @@ function si(e, t) {
2034
2036
  }
2035
2037
  const Qe = {
2036
2038
  name: "thematicBreak",
2037
- tokenize: ci
2039
+ tokenize: hi
2038
2040
  };
2039
- function ci(e, t, n) {
2041
+ function hi(e, t, n) {
2040
2042
  let r = 0, o;
2041
2043
  return i;
2042
2044
  function i(u) {
@@ -2049,24 +2051,24 @@ function ci(e, t, n) {
2049
2051
  return u === o ? (e.enter("thematicBreakSequence"), s(u)) : r >= 3 && (u === null || I(u)) ? (e.exit("thematicBreak"), t(u)) : n(u);
2050
2052
  }
2051
2053
  function s(u) {
2052
- return u === o ? (e.consume(u), r++, s) : (e.exit("thematicBreakSequence"), M(u) ? H(e, l, "whitespace")(u) : l(u));
2054
+ return u === o ? (e.consume(u), r++, s) : (e.exit("thematicBreakSequence"), F(u) ? H(e, l, "whitespace")(u) : l(u));
2053
2055
  }
2054
2056
  }
2055
- const ee = {
2057
+ const te = {
2056
2058
  continuation: {
2057
- tokenize: pi
2059
+ tokenize: gi
2058
2060
  },
2059
- exit: mi,
2061
+ exit: ki,
2060
2062
  name: "list",
2061
- tokenize: fi
2062
- }, hi = {
2063
- partial: !0,
2064
- tokenize: ki
2063
+ tokenize: pi
2065
2064
  }, di = {
2066
2065
  partial: !0,
2067
- tokenize: gi
2066
+ tokenize: xi
2067
+ }, fi = {
2068
+ partial: !0,
2069
+ tokenize: mi
2068
2070
  };
2069
- function fi(e, t, n) {
2071
+ function pi(e, t, n) {
2070
2072
  const r = this, o = r.events[r.events.length - 1];
2071
2073
  let i = o && o[1].type === "linePrefix" ? o[2].sliceSerialize(o[1], !0).length : 0, a = 0;
2072
2074
  return l;
@@ -2087,36 +2089,36 @@ function fi(e, t, n) {
2087
2089
  }
2088
2090
  function u(c) {
2089
2091
  return e.enter("listItemMarker"), e.consume(c), e.exit("listItemMarker"), r.containerState.marker = r.containerState.marker || c, e.check(
2090
- et,
2092
+ tt,
2091
2093
  // Can’t be empty when interrupting.
2092
2094
  r.interrupt ? n : f,
2093
- e.attempt(hi, g, p)
2095
+ e.attempt(di, g, p)
2094
2096
  );
2095
2097
  }
2096
2098
  function f(c) {
2097
2099
  return r.containerState.initialBlankLine = !0, i++, g(c);
2098
2100
  }
2099
2101
  function p(c) {
2100
- return M(c) ? (e.enter("listItemPrefixWhitespace"), e.consume(c), e.exit("listItemPrefixWhitespace"), g) : n(c);
2102
+ return F(c) ? (e.enter("listItemPrefixWhitespace"), e.consume(c), e.exit("listItemPrefixWhitespace"), g) : n(c);
2101
2103
  }
2102
2104
  function g(c) {
2103
2105
  return r.containerState.size = i + r.sliceSerialize(e.exit("listItemPrefix"), !0).length, t(c);
2104
2106
  }
2105
2107
  }
2106
- function pi(e, t, n) {
2108
+ function gi(e, t, n) {
2107
2109
  const r = this;
2108
- return r.containerState._closeFlow = void 0, e.check(et, o, i);
2110
+ return r.containerState._closeFlow = void 0, e.check(tt, o, i);
2109
2111
  function o(l) {
2110
2112
  return r.containerState.furtherBlankLines = r.containerState.furtherBlankLines || r.containerState.initialBlankLine, H(e, t, "listItemIndent", r.containerState.size + 1)(l);
2111
2113
  }
2112
2114
  function i(l) {
2113
- return r.containerState.furtherBlankLines || !M(l) ? (r.containerState.furtherBlankLines = void 0, r.containerState.initialBlankLine = void 0, a(l)) : (r.containerState.furtherBlankLines = void 0, r.containerState.initialBlankLine = void 0, e.attempt(di, t, a)(l));
2115
+ return r.containerState.furtherBlankLines || !F(l) ? (r.containerState.furtherBlankLines = void 0, r.containerState.initialBlankLine = void 0, a(l)) : (r.containerState.furtherBlankLines = void 0, r.containerState.initialBlankLine = void 0, e.attempt(fi, t, a)(l));
2114
2116
  }
2115
2117
  function a(l) {
2116
- return r.containerState._closeFlow = !0, r.interrupt = void 0, H(e, e.attempt(ee, t, n), "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(l);
2118
+ return r.containerState._closeFlow = !0, r.interrupt = void 0, H(e, e.attempt(te, t, n), "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(l);
2117
2119
  }
2118
2120
  }
2119
- function gi(e, t, n) {
2121
+ function mi(e, t, n) {
2120
2122
  const r = this;
2121
2123
  return H(e, o, "listItemIndent", r.containerState.size + 1);
2122
2124
  function o(i) {
@@ -2124,23 +2126,23 @@ function gi(e, t, n) {
2124
2126
  return a && a[1].type === "listItemIndent" && a[2].sliceSerialize(a[1], !0).length === r.containerState.size ? t(i) : n(i);
2125
2127
  }
2126
2128
  }
2127
- function mi(e) {
2129
+ function ki(e) {
2128
2130
  e.exit(this.containerState.type);
2129
2131
  }
2130
- function ki(e, t, n) {
2132
+ function xi(e, t, n) {
2131
2133
  const r = this;
2132
2134
  return H(e, o, "listItemPrefixWhitespace", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 5);
2133
2135
  function o(i) {
2134
2136
  const a = r.events[r.events.length - 1];
2135
- return !M(i) && a && a[1].type === "listItemPrefixWhitespace" ? t(i) : n(i);
2137
+ return !F(i) && a && a[1].type === "listItemPrefixWhitespace" ? t(i) : n(i);
2136
2138
  }
2137
2139
  }
2138
2140
  const Ut = {
2139
2141
  name: "setextUnderline",
2140
- resolveTo: xi,
2141
- tokenize: bi
2142
+ resolveTo: bi,
2143
+ tokenize: yi
2142
2144
  };
2143
- function xi(e, t) {
2145
+ function bi(e, t) {
2144
2146
  let n = e.length, r, o, i;
2145
2147
  for (; n--; )
2146
2148
  if (e[n][0] === "enter") {
@@ -2164,7 +2166,7 @@ function xi(e, t) {
2164
2166
  ...e[i][1].end
2165
2167
  }) : e[r][1] = a, e.push(["exit", a, t]), e;
2166
2168
  }
2167
- function bi(e, t, n) {
2169
+ function yi(e, t, n) {
2168
2170
  const r = this;
2169
2171
  let o;
2170
2172
  return i;
@@ -2181,22 +2183,22 @@ function bi(e, t, n) {
2181
2183
  return e.enter("setextHeadingLineSequence"), l(u);
2182
2184
  }
2183
2185
  function l(u) {
2184
- return u === o ? (e.consume(u), l) : (e.exit("setextHeadingLineSequence"), M(u) ? H(e, s, "lineSuffix")(u) : s(u));
2186
+ return u === o ? (e.consume(u), l) : (e.exit("setextHeadingLineSequence"), F(u) ? H(e, s, "lineSuffix")(u) : s(u));
2185
2187
  }
2186
2188
  function s(u) {
2187
2189
  return u === null || I(u) ? (e.exit("setextHeadingLine"), t(u)) : n(u);
2188
2190
  }
2189
2191
  }
2190
- const yi = {
2191
- tokenize: Si
2192
+ const Si = {
2193
+ tokenize: vi
2192
2194
  };
2193
- function Si(e) {
2195
+ function vi(e) {
2194
2196
  const t = this, n = e.attempt(
2195
2197
  // Try to parse a blank line.
2196
- et,
2198
+ tt,
2197
2199
  r,
2198
2200
  // Try to parse initial flow (essentially, only code).
2199
- e.attempt(this.parser.constructs.flowInitial, o, H(e, e.attempt(this.parser.constructs.flow, o, e.attempt(Er, o)), "linePrefix"))
2201
+ e.attempt(this.parser.constructs.flowInitial, o, H(e, e.attempt(this.parser.constructs.flow, o, e.attempt(Tr, o)), "linePrefix"))
2200
2202
  );
2201
2203
  return n;
2202
2204
  function r(i) {
@@ -2215,11 +2217,11 @@ function Si(e) {
2215
2217
  }
2216
2218
  }
2217
2219
  const _i = {
2218
- resolveAll: dn()
2219
- }, wi = hn("string"), vi = hn("text");
2220
- function hn(e) {
2220
+ resolveAll: fn()
2221
+ }, wi = dn("string"), Ci = dn("text");
2222
+ function dn(e) {
2221
2223
  return {
2222
- resolveAll: dn(e === "text" ? Ci : void 0),
2224
+ resolveAll: fn(e === "text" ? Ei : void 0),
2223
2225
  tokenize: t
2224
2226
  };
2225
2227
  function t(n) {
@@ -2253,7 +2255,7 @@ function hn(e) {
2253
2255
  }
2254
2256
  }
2255
2257
  }
2256
- function dn(e) {
2258
+ function fn(e) {
2257
2259
  return t;
2258
2260
  function t(n, r) {
2259
2261
  let o = -1, i;
@@ -2262,7 +2264,7 @@ function dn(e) {
2262
2264
  return e ? e(n, r) : n;
2263
2265
  }
2264
2266
  }
2265
- function Ci(e, t) {
2267
+ function Ei(e, t) {
2266
2268
  let n = 0;
2267
2269
  for (; ++n <= e.length; )
2268
2270
  if ((n === e.length || e[n][1].type === "lineEnding") && e[n - 1][1].type === "data") {
@@ -2304,71 +2306,71 @@ function Ci(e, t) {
2304
2306
  }
2305
2307
  return e;
2306
2308
  }
2307
- const Ei = {
2308
- 42: ee,
2309
- 43: ee,
2310
- 45: ee,
2311
- 48: ee,
2312
- 49: ee,
2313
- 50: ee,
2314
- 51: ee,
2315
- 52: ee,
2316
- 53: ee,
2317
- 54: ee,
2318
- 55: ee,
2319
- 56: ee,
2320
- 57: ee,
2321
- 62: rn
2322
- }, Ti = {
2323
- 91: Br
2309
+ const Ti = {
2310
+ 42: te,
2311
+ 43: te,
2312
+ 45: te,
2313
+ 48: te,
2314
+ 49: te,
2315
+ 50: te,
2316
+ 51: te,
2317
+ 52: te,
2318
+ 53: te,
2319
+ 54: te,
2320
+ 55: te,
2321
+ 56: te,
2322
+ 57: te,
2323
+ 62: on
2324
2324
  }, Ii = {
2325
- [-2]: ct,
2326
- [-1]: ct,
2327
- 32: ct
2325
+ 91: zr
2328
2326
  }, Li = {
2329
- 35: Or,
2327
+ [-2]: ht,
2328
+ [-1]: ht,
2329
+ 32: ht
2330
+ }, Ai = {
2331
+ 35: Nr,
2330
2332
  42: Qe,
2331
2333
  45: [Ut, Qe],
2332
- 60: Hr,
2334
+ 60: Vr,
2333
2335
  61: Ut,
2334
2336
  95: Qe,
2335
2337
  96: Vt,
2336
2338
  126: Vt
2337
- }, zi = {
2338
- 38: an,
2339
- 92: on
2340
2339
  }, Bi = {
2341
- [-5]: ht,
2342
- [-4]: ht,
2343
- [-3]: ht,
2344
- 33: oi,
2345
- 38: an,
2340
+ 38: ln,
2341
+ 92: an
2342
+ }, zi = {
2343
+ [-5]: dt,
2344
+ [-4]: dt,
2345
+ [-3]: dt,
2346
+ 33: ai,
2347
+ 38: ln,
2346
2348
  42: yt,
2347
- 60: [lr, Kr],
2348
- 91: li,
2349
- 92: [Mr, on],
2349
+ 60: [ur, Yr],
2350
+ 91: ui,
2351
+ 92: [Pr, an],
2350
2352
  93: Ct,
2351
2353
  95: yt,
2352
- 96: yr
2353
- }, Ai = {
2354
- null: [yt, _i]
2354
+ 96: Sr
2355
2355
  }, Ri = {
2356
+ null: [yt, _i]
2357
+ }, Mi = {
2356
2358
  null: [42, 95]
2357
2359
  }, Fi = {
2358
2360
  null: []
2359
- }, Mi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2361
+ }, Pi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2360
2362
  __proto__: null,
2361
- attentionMarkers: Ri,
2362
- contentInitial: Ti,
2363
+ attentionMarkers: Mi,
2364
+ contentInitial: Ii,
2363
2365
  disable: Fi,
2364
- document: Ei,
2365
- flow: Li,
2366
- flowInitial: Ii,
2367
- insideSpan: Ai,
2368
- string: zi,
2369
- text: Bi
2366
+ document: Ti,
2367
+ flow: Ai,
2368
+ flowInitial: Li,
2369
+ insideSpan: Ri,
2370
+ string: Bi,
2371
+ text: zi
2370
2372
  }, Symbol.toStringTag, { value: "Module" }));
2371
- function Pi(e, t, n) {
2373
+ function Oi(e, t, n) {
2372
2374
  let r = {
2373
2375
  _bufferIndex: -1,
2374
2376
  _index: 0,
@@ -2379,18 +2381,18 @@ function Pi(e, t, n) {
2379
2381
  const o = {}, i = [];
2380
2382
  let a = [], l = [];
2381
2383
  const s = {
2382
- attempt: F(B),
2383
- check: F(k),
2384
- consume: _,
2385
- enter: w,
2384
+ attempt: M(B),
2385
+ check: M(k),
2386
+ consume: v,
2387
+ enter: _,
2386
2388
  exit: O,
2387
- interrupt: F(k, {
2389
+ interrupt: M(k, {
2388
2390
  interrupt: !0
2389
2391
  })
2390
2392
  }, u = {
2391
2393
  code: null,
2392
2394
  containerState: {},
2393
- defineSkip: v,
2395
+ defineSkip: w,
2394
2396
  events: [],
2395
2397
  now: b,
2396
2398
  parser: e,
@@ -2402,13 +2404,13 @@ function Pi(e, t, n) {
2402
2404
  let f = t.tokenize.call(u, s);
2403
2405
  return t.resolveAll && i.push(t), u;
2404
2406
  function p(T) {
2405
- return a = Y(a, T), z(), a[a.length - 1] !== null ? [] : (q(t, 0), u.events = Je(i, u.events, u), u.events);
2407
+ return a = Y(a, T), A(), a[a.length - 1] !== null ? [] : (q(t, 0), u.events = et(i, u.events, u), u.events);
2406
2408
  }
2407
2409
  function g(T, E) {
2408
- return Ni(c(T), E);
2410
+ return $i(c(T), E);
2409
2411
  }
2410
2412
  function c(T) {
2411
- return Oi(a, T);
2413
+ return Ni(a, T);
2412
2414
  }
2413
2415
  function b() {
2414
2416
  const {
@@ -2426,10 +2428,10 @@ function Pi(e, t, n) {
2426
2428
  offset: R
2427
2429
  };
2428
2430
  }
2429
- function v(T) {
2431
+ function w(T) {
2430
2432
  o[T.line] = T.column, $();
2431
2433
  }
2432
- function z() {
2434
+ function A() {
2433
2435
  let T;
2434
2436
  for (; r._index < a.length; ) {
2435
2437
  const E = a[r._index];
@@ -2443,13 +2445,13 @@ function Pi(e, t, n) {
2443
2445
  function x(T) {
2444
2446
  f = f(T);
2445
2447
  }
2446
- function _(T) {
2448
+ function v(T) {
2447
2449
  I(T) ? (r.line++, r.column = 1, r.offset += T === -3 ? 2 : 1, $()) : T !== -1 && (r.column++, r.offset++), r._bufferIndex < 0 ? r._index++ : (r._bufferIndex++, r._bufferIndex === // Points w/ non-negative `_bufferIndex` reference
2448
2450
  // strings.
2449
2451
  /** @type {string} */
2450
2452
  a[r._index].length && (r._bufferIndex = -1, r._index++)), u.previous = T;
2451
2453
  }
2452
- function w(T, E) {
2454
+ function _(T, E) {
2453
2455
  const D = E || {};
2454
2456
  return D.type = T, D.start = b(), u.events.push(["enter", D, u]), l.push(D), D;
2455
2457
  }
@@ -2463,10 +2465,10 @@ function Pi(e, t, n) {
2463
2465
  function k(T, E) {
2464
2466
  E.restore();
2465
2467
  }
2466
- function F(T, E) {
2468
+ function M(T, E) {
2467
2469
  return D;
2468
2470
  function D(V, R, Q) {
2469
- let U, re, de, h;
2471
+ let W, re, de, h;
2470
2472
  return Array.isArray(V) ? (
2471
2473
  /* c8 ignore next 1 */
2472
2474
  fe(V)
@@ -2477,10 +2479,10 @@ function Pi(e, t, n) {
2477
2479
  V
2478
2480
  ])
2479
2481
  ) : ie(V);
2480
- function ie(W) {
2482
+ function ie(j) {
2481
2483
  return Be;
2482
2484
  function Be(xe) {
2483
- const Ce = xe !== null && W[xe], Ee = xe !== null && W.null, Fe = [
2485
+ const Ce = xe !== null && j[xe], Ee = xe !== null && j.null, Fe = [
2484
2486
  // To do: add more extension tests.
2485
2487
  /* c8 ignore next 2 */
2486
2488
  ...Array.isArray(Ce) ? Ce : Ce ? [Ce] : [],
@@ -2489,28 +2491,28 @@ function Pi(e, t, n) {
2489
2491
  return fe(Fe)(xe);
2490
2492
  }
2491
2493
  }
2492
- function fe(W) {
2493
- return U = W, re = 0, W.length === 0 ? Q : d(W[re]);
2494
+ function fe(j) {
2495
+ return W = j, re = 0, j.length === 0 ? Q : d(j[re]);
2494
2496
  }
2495
- function d(W) {
2497
+ function d(j) {
2496
2498
  return Be;
2497
2499
  function Be(xe) {
2498
- return h = N(), de = W, W.partial || (u.currentConstruct = W), W.name && u.parser.constructs.disable.null.includes(W.name) ? we() : W.tokenize.call(
2500
+ return h = N(), de = j, j.partial || (u.currentConstruct = j), j.name && u.parser.constructs.disable.null.includes(j.name) ? _e() : j.tokenize.call(
2499
2501
  // If we do have fields, create an object w/ `context` as its
2500
2502
  // prototype.
2501
2503
  // This allows a “live binding”, which is needed for `interrupt`.
2502
2504
  E ? Object.assign(Object.create(u), E) : u,
2503
2505
  s,
2504
2506
  oe,
2505
- we
2507
+ _e
2506
2508
  )(xe);
2507
2509
  }
2508
2510
  }
2509
- function oe(W) {
2511
+ function oe(j) {
2510
2512
  return T(de, h), R;
2511
2513
  }
2512
- function we(W) {
2513
- return h.restore(), ++re < U.length ? d(U[re]) : Q;
2514
+ function _e(j) {
2515
+ return h.restore(), ++re < W.length ? d(W[re]) : Q;
2514
2516
  }
2515
2517
  }
2516
2518
  }
@@ -2531,7 +2533,7 @@ function Pi(e, t, n) {
2531
2533
  r.line in o && r.column < 2 && (r.column = o[r.line], r.offset += o[r.line] - 1);
2532
2534
  }
2533
2535
  }
2534
- function Oi(e, t) {
2536
+ function Ni(e, t) {
2535
2537
  const n = t.start._index, r = t.start._bufferIndex, o = t.end._index, i = t.end._bufferIndex;
2536
2538
  let a;
2537
2539
  if (n === o)
@@ -2545,7 +2547,7 @@ function Oi(e, t) {
2545
2547
  }
2546
2548
  return a;
2547
2549
  }
2548
- function Ni(e, t) {
2550
+ function $i(e, t) {
2549
2551
  let n = -1;
2550
2552
  const r = [];
2551
2553
  let o;
@@ -2585,35 +2587,35 @@ function Ni(e, t) {
2585
2587
  }
2586
2588
  return r.join("");
2587
2589
  }
2588
- function fn(e) {
2590
+ function pn(e) {
2589
2591
  const r = {
2590
2592
  constructs: (
2591
2593
  /** @type {FullNormalizedExtension} */
2592
- Dn([Mi, ...(e || {}).extensions || []])
2594
+ Hn([Pi, ...(e || {}).extensions || []])
2593
2595
  ),
2594
- content: o(er),
2596
+ content: o(tr),
2595
2597
  defined: [],
2596
- document: o(nr),
2597
- flow: o(yi),
2598
+ document: o(rr),
2599
+ flow: o(Si),
2598
2600
  lazy: {},
2599
2601
  string: o(wi),
2600
- text: o(vi)
2602
+ text: o(Ci)
2601
2603
  };
2602
2604
  return r;
2603
2605
  function o(i) {
2604
2606
  return a;
2605
2607
  function a(l) {
2606
- return Pi(r, i, l);
2608
+ return Oi(r, i, l);
2607
2609
  }
2608
2610
  }
2609
2611
  }
2610
- function pn(e) {
2611
- for (; !ln(e); )
2612
+ function gn(e) {
2613
+ for (; !un(e); )
2612
2614
  ;
2613
2615
  return e;
2614
2616
  }
2615
2617
  const Wt = /[\0\t\n\r]/g;
2616
- function gn() {
2618
+ function mn() {
2617
2619
  let e = 1, t = "", n = !0, r;
2618
2620
  return o;
2619
2621
  function o(i, a, l) {
@@ -2648,10 +2650,10 @@ function gn() {
2648
2650
  return l && (r && s.push(-5), t && s.push(t), s.push(null)), s;
2649
2651
  }
2650
2652
  }
2651
- function $i(e, t, n) {
2652
- return typeof t != "string" && (n = t, t = void 0), Jn(n)(pn(fn(n).document().write(gn()(e, t, !0))));
2653
+ function Di(e, t, n) {
2654
+ return typeof t != "string" && (n = t, t = void 0), er(n)(gn(pn(n).document().write(mn()(e, t, !0))));
2653
2655
  }
2654
- function mn(e) {
2656
+ function kn(e) {
2655
2657
  let n = {}.singleTilde;
2656
2658
  const r = {
2657
2659
  name: "strikethrough",
@@ -2687,7 +2689,7 @@ function mn(e) {
2687
2689
  start: Object.assign({}, a[u][1].end),
2688
2690
  end: Object.assign({}, a[s][1].start)
2689
2691
  }, g = [["enter", f, l], ["enter", a[u][1], l], ["exit", a[u][1], l], ["enter", p, l]], c = l.parser.constructs.insideSpan.null;
2690
- c && ue(g, g.length, 0, Je(c, a.slice(u + 1, s), l)), ue(g, g.length, 0, [["exit", p, l], ["enter", a[s][1], l], ["exit", a[s][1], l], ["exit", f, l]]), ue(a, u - 1, s - u + 3, g), s = u + g.length - 2;
2692
+ c && ue(g, g.length, 0, et(c, a.slice(u + 1, s), l)), ue(g, g.length, 0, [["exit", p, l], ["enter", a[s][1], l], ["exit", a[s][1], l], ["exit", f, l]]), ue(a, u - 1, s - u + 3, g), s = u + g.length - 2;
2691
2693
  break;
2692
2694
  }
2693
2695
  }
@@ -2703,16 +2705,16 @@ function mn(e) {
2703
2705
  return u === 126 && f[f.length - 1][1].type !== "characterEscape" ? s(b) : (a.enter("strikethroughSequenceTemporary"), c(b));
2704
2706
  }
2705
2707
  function c(b) {
2706
- const v = Ye(u);
2708
+ const w = Ge(u);
2707
2709
  if (b === 126)
2708
2710
  return p > 1 ? s(b) : (a.consume(b), p++, c);
2709
2711
  if (p < 2 && !n) return s(b);
2710
- const z = a.exit("strikethroughSequenceTemporary"), x = Ye(b);
2711
- return z._open = !x || x === 2 && !!v, z._close = !v || v === 2 && !!x, l(b);
2712
+ const A = a.exit("strikethroughSequenceTemporary"), x = Ge(b);
2713
+ return A._open = !x || x === 2 && !!w, A._close = !w || w === 2 && !!x, l(b);
2712
2714
  }
2713
2715
  }
2714
2716
  }
2715
- function Di(e) {
2717
+ function Hi(e) {
2716
2718
  for (var t = 1; t < arguments.length; t++) {
2717
2719
  var n = arguments[t];
2718
2720
  for (var r in n)
@@ -2723,33 +2725,33 @@ function Di(e) {
2723
2725
  function St(e, t) {
2724
2726
  return Array(t + 1).join(e);
2725
2727
  }
2726
- function kn(e) {
2728
+ function xn(e) {
2727
2729
  return e.replace(/^\n*/, "");
2728
2730
  }
2729
- function xn(e) {
2731
+ function bn(e) {
2730
2732
  for (var t = e.length; t > 0 && e[t - 1] === `
2731
2733
  `; ) t--;
2732
2734
  return e.substring(0, t);
2733
2735
  }
2734
- function bn(e) {
2735
- return xn(kn(e));
2736
+ function yn(e) {
2737
+ return bn(xn(e));
2736
2738
  }
2737
- var Hi = ["ADDRESS", "ARTICLE", "ASIDE", "AUDIO", "BLOCKQUOTE", "BODY", "CANVAS", "CENTER", "DD", "DIR", "DIV", "DL", "DT", "FIELDSET", "FIGCAPTION", "FIGURE", "FOOTER", "FORM", "FRAMESET", "H1", "H2", "H3", "H4", "H5", "H6", "HEADER", "HGROUP", "HR", "HTML", "ISINDEX", "LI", "MAIN", "MENU", "NAV", "NOFRAMES", "NOSCRIPT", "OL", "OUTPUT", "P", "PRE", "SECTION", "TABLE", "TBODY", "TD", "TFOOT", "TH", "THEAD", "TR", "UL"];
2739
+ var Vi = ["ADDRESS", "ARTICLE", "ASIDE", "AUDIO", "BLOCKQUOTE", "BODY", "CANVAS", "CENTER", "DD", "DIR", "DIV", "DL", "DT", "FIELDSET", "FIGCAPTION", "FIGURE", "FOOTER", "FORM", "FRAMESET", "H1", "H2", "H3", "H4", "H5", "H6", "HEADER", "HGROUP", "HR", "HTML", "ISINDEX", "LI", "MAIN", "MENU", "NAV", "NOFRAMES", "NOSCRIPT", "OL", "OUTPUT", "P", "PRE", "SECTION", "TABLE", "TBODY", "TD", "TFOOT", "TH", "THEAD", "TR", "UL"];
2738
2740
  function Et(e) {
2739
- return Tt(e, Hi);
2741
+ return Tt(e, Vi);
2740
2742
  }
2741
- var yn = ["AREA", "BASE", "BR", "COL", "COMMAND", "EMBED", "HR", "IMG", "INPUT", "KEYGEN", "LINK", "META", "PARAM", "SOURCE", "TRACK", "WBR"];
2742
- function Sn(e) {
2743
- return Tt(e, yn);
2743
+ var Sn = ["AREA", "BASE", "BR", "COL", "COMMAND", "EMBED", "HR", "IMG", "INPUT", "KEYGEN", "LINK", "META", "PARAM", "SOURCE", "TRACK", "WBR"];
2744
+ function vn(e) {
2745
+ return Tt(e, Sn);
2744
2746
  }
2745
- function Vi(e) {
2746
- return wn(e, yn);
2747
+ function qi(e) {
2748
+ return wn(e, Sn);
2747
2749
  }
2748
2750
  var _n = ["A", "TABLE", "THEAD", "TBODY", "TFOOT", "TH", "TD", "IFRAME", "SCRIPT", "AUDIO", "VIDEO"];
2749
- function qi(e) {
2751
+ function Ui(e) {
2750
2752
  return Tt(e, _n);
2751
2753
  }
2752
- function Ui(e) {
2754
+ function Wi(e) {
2753
2755
  return wn(e, _n);
2754
2756
  }
2755
2757
  function Tt(e, t) {
@@ -2760,14 +2762,14 @@ function wn(e, t) {
2760
2762
  return e.getElementsByTagName(n).length;
2761
2763
  });
2762
2764
  }
2763
- var Wi = [[/\\/g, "\\\\"], [/\*/g, "\\*"], [/^-/g, "\\-"], [/^\+ /g, "\\+ "], [/^(=+)/g, "\\$1"], [/^(#{1,6}) /g, "\\$1 "], [/`/g, "\\`"], [/^~~~/g, "\\~~~"], [/\[/g, "\\["], [/\]/g, "\\]"], [/^>/g, "\\>"], [/_/g, "\\_"], [/^(\d+)\. /g, "$1\\. "]];
2764
- function vn(e) {
2765
- return Wi.reduce(function(t, n) {
2765
+ var ji = [[/\\/g, "\\\\"], [/\*/g, "\\*"], [/^-/g, "\\-"], [/^\+ /g, "\\+ "], [/^(=+)/g, "\\$1"], [/^(#{1,6}) /g, "\\$1 "], [/`/g, "\\`"], [/^~~~/g, "\\~~~"], [/\[/g, "\\["], [/\]/g, "\\]"], [/^>/g, "\\>"], [/_/g, "\\_"], [/^(\d+)\. /g, "$1\\. "]];
2766
+ function Cn(e) {
2767
+ return ji.reduce(function(t, n) {
2766
2768
  return t.replace(n[0], n[1]);
2767
2769
  }, e);
2768
2770
  }
2769
- var X = {};
2770
- X.paragraph = {
2771
+ var G = {};
2772
+ G.paragraph = {
2771
2773
  filter: "p",
2772
2774
  replacement: function(e) {
2773
2775
  return `
@@ -2777,14 +2779,14 @@ X.paragraph = {
2777
2779
  `;
2778
2780
  }
2779
2781
  };
2780
- X.lineBreak = {
2782
+ G.lineBreak = {
2781
2783
  filter: "br",
2782
2784
  replacement: function(e, t, n) {
2783
2785
  return n.br + `
2784
2786
  `;
2785
2787
  }
2786
2788
  };
2787
- X.heading = {
2789
+ G.heading = {
2788
2790
  filter: ["h1", "h2", "h3", "h4", "h5", "h6"],
2789
2791
  replacement: function(e, t, n) {
2790
2792
  var r = Number(t.nodeName.charAt(1));
@@ -2804,17 +2806,17 @@ X.heading = {
2804
2806
  `;
2805
2807
  }
2806
2808
  };
2807
- X.blockquote = {
2809
+ G.blockquote = {
2808
2810
  filter: "blockquote",
2809
2811
  replacement: function(e) {
2810
- return e = bn(e).replace(/^/gm, "> "), `
2812
+ return e = yn(e).replace(/^/gm, "> "), `
2811
2813
 
2812
2814
  ` + e + `
2813
2815
 
2814
2816
  `;
2815
2817
  }
2816
2818
  };
2817
- X.list = {
2819
+ G.list = {
2818
2820
  filter: ["ul", "ol"],
2819
2821
  replacement: function(e, t) {
2820
2822
  var n = t.parentNode;
@@ -2826,7 +2828,7 @@ X.list = {
2826
2828
  `;
2827
2829
  }
2828
2830
  };
2829
- X.listItem = {
2831
+ G.listItem = {
2830
2832
  filter: "li",
2831
2833
  replacement: function(e, t, n) {
2832
2834
  var r = n.bulletListMarker + " ", o = t.parentNode;
@@ -2835,13 +2837,13 @@ X.listItem = {
2835
2837
  r = (i ? Number(i) + a : a + 1) + ". ";
2836
2838
  }
2837
2839
  var l = /\n$/.test(e);
2838
- return e = bn(e) + (l ? `
2840
+ return e = yn(e) + (l ? `
2839
2841
  ` : ""), e = e.replace(/\n/gm, `
2840
2842
  ` + " ".repeat(r.length)), r + e + (t.nextSibling ? `
2841
2843
  ` : "");
2842
2844
  }
2843
2845
  };
2844
- X.indentedCodeBlock = {
2846
+ G.indentedCodeBlock = {
2845
2847
  filter: function(e, t) {
2846
2848
  return t.codeBlockStyle === "indented" && e.nodeName === "PRE" && e.firstChild && e.firstChild.nodeName === "CODE";
2847
2849
  },
@@ -2854,7 +2856,7 @@ X.indentedCodeBlock = {
2854
2856
  `;
2855
2857
  }
2856
2858
  };
2857
- X.fencedCodeBlock = {
2859
+ G.fencedCodeBlock = {
2858
2860
  filter: function(e, t) {
2859
2861
  return t.codeBlockStyle === "fenced" && e.nodeName === "PRE" && e.firstChild && e.firstChild.nodeName === "CODE";
2860
2862
  },
@@ -2871,7 +2873,7 @@ X.fencedCodeBlock = {
2871
2873
  `;
2872
2874
  }
2873
2875
  };
2874
- X.horizontalRule = {
2876
+ G.horizontalRule = {
2875
2877
  filter: "hr",
2876
2878
  replacement: function(e, t, n) {
2877
2879
  return `
@@ -2881,7 +2883,7 @@ X.horizontalRule = {
2881
2883
  `;
2882
2884
  }
2883
2885
  };
2884
- X.inlineLink = {
2886
+ G.inlineLink = {
2885
2887
  filter: function(e, t) {
2886
2888
  return t.linkStyle === "inlined" && e.nodeName === "A" && e.getAttribute("href");
2887
2889
  },
@@ -2890,7 +2892,7 @@ X.inlineLink = {
2890
2892
  return "[" + e + "](" + n + o + ")";
2891
2893
  }
2892
2894
  };
2893
- X.referenceLink = {
2895
+ G.referenceLink = {
2894
2896
  filter: function(e, t) {
2895
2897
  return t.linkStyle === "referenced" && e.nodeName === "A" && e.getAttribute("href");
2896
2898
  },
@@ -2922,19 +2924,19 @@ X.referenceLink = {
2922
2924
  `, this.references = []), t;
2923
2925
  }
2924
2926
  };
2925
- X.emphasis = {
2927
+ G.emphasis = {
2926
2928
  filter: ["em", "i"],
2927
2929
  replacement: function(e, t, n) {
2928
2930
  return e.trim() ? n.emDelimiter + e + n.emDelimiter : "";
2929
2931
  }
2930
2932
  };
2931
- X.strong = {
2933
+ G.strong = {
2932
2934
  filter: ["strong", "b"],
2933
2935
  replacement: function(e, t, n) {
2934
2936
  return e.trim() ? n.strongDelimiter + e + n.strongDelimiter : "";
2935
2937
  }
2936
2938
  };
2937
- X.code = {
2939
+ G.code = {
2938
2940
  filter: function(e) {
2939
2941
  var t = e.previousSibling || e.nextSibling, n = e.parentNode.nodeName === "PRE" && !t;
2940
2942
  return e.nodeName === "CODE" && !n;
@@ -2946,10 +2948,10 @@ X.code = {
2946
2948
  return n + t + e + t + n;
2947
2949
  }
2948
2950
  };
2949
- X.image = {
2951
+ G.image = {
2950
2952
  filter: "img",
2951
2953
  replacement: function(e, t) {
2952
- var n = vn(Xe(t.getAttribute("alt"))), r = It(t.getAttribute("src") || ""), o = Xe(t.getAttribute("title")), i = o ? ' "' + Lt(o) + '"' : "";
2954
+ var n = Cn(Xe(t.getAttribute("alt"))), r = It(t.getAttribute("src") || ""), o = Xe(t.getAttribute("title")), i = o ? ' "' + Lt(o) + '"' : "";
2953
2955
  return r ? "![" + n + "](" + r + i + ")" : "";
2954
2956
  }
2955
2957
  };
@@ -2964,7 +2966,7 @@ function It(e) {
2964
2966
  function Lt(e) {
2965
2967
  return e.replace(/"/g, '\\"');
2966
2968
  }
2967
- function Cn(e) {
2969
+ function En(e) {
2968
2970
  this.options = e, this._keep = [], this._remove = [], this.blankRule = {
2969
2971
  replacement: e.blankReplacement
2970
2972
  }, this.keepReplacement = e.keepReplacement, this.defaultRule = {
@@ -2972,7 +2974,7 @@ function Cn(e) {
2972
2974
  }, this.array = [];
2973
2975
  for (var t in e.rules) this.array.push(e.rules[t]);
2974
2976
  }
2975
- Cn.prototype = {
2977
+ En.prototype = {
2976
2978
  add: function(e, t) {
2977
2979
  this.array.unshift(t);
2978
2980
  },
@@ -2993,19 +2995,19 @@ Cn.prototype = {
2993
2995
  forNode: function(e) {
2994
2996
  if (e.isBlank) return this.blankRule;
2995
2997
  var t;
2996
- return (t = dt(this.array, e, this.options)) || (t = dt(this._keep, e, this.options)) || (t = dt(this._remove, e, this.options)) ? t : this.defaultRule;
2998
+ return (t = ft(this.array, e, this.options)) || (t = ft(this._keep, e, this.options)) || (t = ft(this._remove, e, this.options)) ? t : this.defaultRule;
2997
2999
  },
2998
3000
  forEach: function(e) {
2999
3001
  for (var t = 0; t < this.array.length; t++) e(this.array[t], t);
3000
3002
  }
3001
3003
  };
3002
- function dt(e, t, n) {
3004
+ function ft(e, t, n) {
3003
3005
  for (var r = 0; r < e.length; r++) {
3004
3006
  var o = e[r];
3005
- if (ji(o, t, n)) return o;
3007
+ if (Qi(o, t, n)) return o;
3006
3008
  }
3007
3009
  }
3008
- function ji(e, t, n) {
3010
+ function Qi(e, t, n) {
3009
3011
  var r = e.filter;
3010
3012
  if (typeof r == "string") {
3011
3013
  if (r === t.nodeName.toLowerCase()) return !0;
@@ -3016,7 +3018,7 @@ function ji(e, t, n) {
3016
3018
  } else
3017
3019
  throw new TypeError("`filter` needs to be a string, array, or function");
3018
3020
  }
3019
- function Qi(e) {
3021
+ function Ki(e) {
3020
3022
  var t = e.element, n = e.isBlock, r = e.isVoid, o = e.isPre || function(p) {
3021
3023
  return p.nodeName === "PRE";
3022
3024
  };
@@ -3025,39 +3027,39 @@ function Qi(e) {
3025
3027
  if (s.nodeType === 3 || s.nodeType === 4) {
3026
3028
  var u = s.data.replace(/[ \r\n\t]+/g, " ");
3027
3029
  if ((!i || / $/.test(i.data)) && !a && u[0] === " " && (u = u.substr(1)), !u) {
3028
- s = ft(s);
3030
+ s = pt(s);
3029
3031
  continue;
3030
3032
  }
3031
3033
  s.data = u, i = s;
3032
3034
  } else if (s.nodeType === 1)
3033
3035
  n(s) || s.nodeName === "BR" ? (i && (i.data = i.data.replace(/ $/, "")), i = null, a = !1) : r(s) || o(s) ? (i = null, a = !0) : i && (a = !1);
3034
3036
  else {
3035
- s = ft(s);
3037
+ s = pt(s);
3036
3038
  continue;
3037
3039
  }
3038
3040
  var f = jt(l, s, o);
3039
3041
  l = s, s = f;
3040
3042
  }
3041
- i && (i.data = i.data.replace(/ $/, ""), i.data || ft(i));
3043
+ i && (i.data = i.data.replace(/ $/, ""), i.data || pt(i));
3042
3044
  }
3043
3045
  }
3044
- function ft(e) {
3046
+ function pt(e) {
3045
3047
  var t = e.nextSibling || e.parentNode;
3046
3048
  return e.parentNode.removeChild(e), t;
3047
3049
  }
3048
3050
  function jt(e, t, n) {
3049
3051
  return e && e.parentNode === t || n(t) ? t.nextSibling || t.parentNode : t.firstChild || t.nextSibling || t.parentNode;
3050
3052
  }
3051
- var zt = typeof window < "u" ? window : {};
3052
- function Ki() {
3053
- var e = zt.DOMParser, t = !1;
3053
+ var At = typeof window < "u" ? window : {};
3054
+ function Yi() {
3055
+ var e = At.DOMParser, t = !1;
3054
3056
  try {
3055
3057
  new e().parseFromString("", "text/html") && (t = !0);
3056
3058
  } catch {
3057
3059
  }
3058
3060
  return t;
3059
3061
  }
3060
- function Yi() {
3062
+ function Gi() {
3061
3063
  var e = function() {
3062
3064
  };
3063
3065
  return Xi() ? e.prototype.parseFromString = function(t) {
@@ -3073,15 +3075,15 @@ function Xi() {
3073
3075
  try {
3074
3076
  document.implementation.createHTMLDocument("").open();
3075
3077
  } catch {
3076
- zt.ActiveXObject && (e = !0);
3078
+ At.ActiveXObject && (e = !0);
3077
3079
  }
3078
3080
  return e;
3079
3081
  }
3080
- var Gi = Ki() ? zt.DOMParser : Yi();
3081
- function Zi(e, t) {
3082
+ var Zi = Yi() ? At.DOMParser : Gi();
3083
+ function Ji(e, t) {
3082
3084
  var n;
3083
3085
  if (typeof e == "string") {
3084
- var r = Ji().parseFromString(
3086
+ var r = eo().parseFromString(
3085
3087
  // DOM parsers arrange elements in the <head> and <body>.
3086
3088
  // Wrapping in a custom element ensures elements are reliably arranged in
3087
3089
  // a single element.
@@ -3091,39 +3093,39 @@ function Zi(e, t) {
3091
3093
  n = r.getElementById("turndown-root");
3092
3094
  } else
3093
3095
  n = e.cloneNode(!0);
3094
- return Qi({
3096
+ return Ki({
3095
3097
  element: n,
3096
3098
  isBlock: Et,
3097
- isVoid: Sn,
3098
- isPre: t.preformattedCode ? eo : null
3099
+ isVoid: vn,
3100
+ isPre: t.preformattedCode ? to : null
3099
3101
  }), n;
3100
3102
  }
3101
- var pt;
3102
- function Ji() {
3103
- return pt = pt || new Gi(), pt;
3103
+ var gt;
3104
+ function eo() {
3105
+ return gt = gt || new Zi(), gt;
3104
3106
  }
3105
- function eo(e) {
3107
+ function to(e) {
3106
3108
  return e.nodeName === "PRE" || e.nodeName === "CODE";
3107
3109
  }
3108
- function to(e, t) {
3109
- return e.isBlock = Et(e), e.isCode = e.nodeName === "CODE" || e.parentNode.isCode, e.isBlank = no(e), e.flankingWhitespace = ro(e, t), e;
3110
+ function no(e, t) {
3111
+ return e.isBlock = Et(e), e.isCode = e.nodeName === "CODE" || e.parentNode.isCode, e.isBlank = ro(e), e.flankingWhitespace = io(e, t), e;
3110
3112
  }
3111
- function no(e) {
3112
- return !Sn(e) && !qi(e) && /^\s*$/i.test(e.textContent) && !Vi(e) && !Ui(e);
3113
+ function ro(e) {
3114
+ return !vn(e) && !Ui(e) && /^\s*$/i.test(e.textContent) && !qi(e) && !Wi(e);
3113
3115
  }
3114
- function ro(e, t) {
3116
+ function io(e, t) {
3115
3117
  if (e.isBlock || t.preformattedCode && e.isCode)
3116
3118
  return {
3117
3119
  leading: "",
3118
3120
  trailing: ""
3119
3121
  };
3120
- var n = io(e.textContent);
3122
+ var n = oo(e.textContent);
3121
3123
  return n.leadingAscii && Qt("left", e, t) && (n.leading = n.leadingNonAscii), n.trailingAscii && Qt("right", e, t) && (n.trailing = n.trailingNonAscii), {
3122
3124
  leading: n.leading,
3123
3125
  trailing: n.trailing
3124
3126
  };
3125
3127
  }
3126
- function io(e) {
3128
+ function oo(e) {
3127
3129
  var t = e.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);
3128
3130
  return {
3129
3131
  leading: t[1],
@@ -3140,11 +3142,11 @@ function Qt(e, t, n) {
3140
3142
  var r, o, i;
3141
3143
  return e === "left" ? (r = t.previousSibling, o = / $/) : (r = t.nextSibling, o = /^ /), r && (r.nodeType === 3 ? i = o.test(r.nodeValue) : n.preformattedCode && r.nodeName === "CODE" ? i = !1 : r.nodeType === 1 && !Et(r) && (i = o.test(r.textContent))), i;
3142
3144
  }
3143
- var oo = Array.prototype.reduce;
3144
- function Ge(e) {
3145
- if (!(this instanceof Ge)) return new Ge(e);
3145
+ var ao = Array.prototype.reduce;
3146
+ function Ze(e) {
3147
+ if (!(this instanceof Ze)) return new Ze(e);
3146
3148
  var t = {
3147
- rules: X,
3149
+ rules: G,
3148
3150
  headingStyle: "setext",
3149
3151
  hr: "* * *",
3150
3152
  bulletListMarker: "*",
@@ -3176,9 +3178,9 @@ function Ge(e) {
3176
3178
  ` : n;
3177
3179
  }
3178
3180
  };
3179
- this.options = Di({}, t, e), this.rules = new Cn(this.options);
3181
+ this.options = Hi({}, t, e), this.rules = new En(this.options);
3180
3182
  }
3181
- Ge.prototype = {
3183
+ Ze.prototype = {
3182
3184
  /**
3183
3185
  * The entry point for converting a string or DOM node to Markdown
3184
3186
  * @public
@@ -3187,11 +3189,11 @@ Ge.prototype = {
3187
3189
  * @type String
3188
3190
  */
3189
3191
  turndown: function(e) {
3190
- if (!uo(e))
3192
+ if (!so(e))
3191
3193
  throw new TypeError(e + " is not a string, or an element/document/fragment node.");
3192
3194
  if (e === "") return "";
3193
- var t = En.call(this, new Zi(e, this.options));
3194
- return ao.call(this, t);
3195
+ var t = Tn.call(this, new Ji(e, this.options));
3196
+ return lo.call(this, t);
3195
3197
  },
3196
3198
  /**
3197
3199
  * Add one or more plugins
@@ -3248,43 +3250,43 @@ Ge.prototype = {
3248
3250
  * @type String
3249
3251
  */
3250
3252
  escape: function(e) {
3251
- return vn(e);
3253
+ return Cn(e);
3252
3254
  }
3253
3255
  };
3254
- function En(e) {
3256
+ function Tn(e) {
3255
3257
  var t = this;
3256
- return oo.call(e.childNodes, function(n, r) {
3257
- r = new to(r, t.options);
3258
+ return ao.call(e.childNodes, function(n, r) {
3259
+ r = new no(r, t.options);
3258
3260
  var o = "";
3259
- return r.nodeType === 3 ? o = r.isCode ? r.nodeValue : t.escape(r.nodeValue) : r.nodeType === 1 && (o = lo.call(t, r)), Tn(n, o);
3261
+ return r.nodeType === 3 ? o = r.isCode ? r.nodeValue : t.escape(r.nodeValue) : r.nodeType === 1 && (o = uo.call(t, r)), In(n, o);
3260
3262
  }, "");
3261
3263
  }
3262
- function ao(e) {
3264
+ function lo(e) {
3263
3265
  var t = this;
3264
3266
  return this.rules.forEach(function(n) {
3265
- typeof n.append == "function" && (e = Tn(e, n.append(t.options)));
3267
+ typeof n.append == "function" && (e = In(e, n.append(t.options)));
3266
3268
  }), e.replace(/^[\t\r\n]+/, "").replace(/[\t\r\n\s]+$/, "");
3267
3269
  }
3268
- function lo(e) {
3269
- var t = this.rules.forNode(e), n = En.call(this, e), r = e.flankingWhitespace;
3270
+ function uo(e) {
3271
+ var t = this.rules.forNode(e), n = Tn.call(this, e), r = e.flankingWhitespace;
3270
3272
  return (r.leading || r.trailing) && (n = n.trim()), r.leading + t.replacement(n, e, this.options) + r.trailing;
3271
3273
  }
3272
- function Tn(e, t) {
3273
- var n = xn(e), r = kn(t), o = Math.max(e.length - n.length, t.length - r.length), i = `
3274
+ function In(e, t) {
3275
+ var n = bn(e), r = xn(t), o = Math.max(e.length - n.length, t.length - r.length), i = `
3274
3276
 
3275
3277
  `.substring(0, o);
3276
3278
  return n + i + r;
3277
3279
  }
3278
- function uo(e) {
3280
+ function so(e) {
3279
3281
  return e != null && (typeof e == "string" || e.nodeType && (e.nodeType === 1 || e.nodeType === 9 || e.nodeType === 11));
3280
3282
  }
3281
- const so = {};
3282
- function co(e, t) {
3283
- const n = so, r = typeof n.includeImageAlt == "boolean" ? n.includeImageAlt : !0, o = typeof n.includeHtml == "boolean" ? n.includeHtml : !0;
3284
- return In(e, r, o);
3283
+ const co = {};
3284
+ function ho(e, t) {
3285
+ const n = co, r = typeof n.includeImageAlt == "boolean" ? n.includeImageAlt : !0, o = typeof n.includeHtml == "boolean" ? n.includeHtml : !0;
3286
+ return Ln(e, r, o);
3285
3287
  }
3286
- function In(e, t, n) {
3287
- if (ho(e)) {
3288
+ function Ln(e, t, n) {
3289
+ if (fo(e)) {
3288
3290
  if ("value" in e)
3289
3291
  return e.type === "html" && !n ? "" : e.value;
3290
3292
  if (t && "alt" in e && e.alt)
@@ -3298,42 +3300,42 @@ function Kt(e, t, n) {
3298
3300
  const r = [];
3299
3301
  let o = -1;
3300
3302
  for (; ++o < e.length; )
3301
- r[o] = In(e[o], t, n);
3303
+ r[o] = Ln(e[o], t, n);
3302
3304
  return r.join("");
3303
3305
  }
3304
- function ho(e) {
3306
+ function fo(e) {
3305
3307
  return !!(e && typeof e == "object");
3306
3308
  }
3307
- const fo = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;
3308
- function po(e) {
3309
- return e.replace(fo, go);
3309
+ const po = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;
3310
+ function go(e) {
3311
+ return e.replace(po, mo);
3310
3312
  }
3311
- function go(e, t, n) {
3313
+ function mo(e, t, n) {
3312
3314
  if (t)
3313
3315
  return t;
3314
3316
  if (n.charCodeAt(0) === 35) {
3315
3317
  const o = n.charCodeAt(1), i = o === 120 || o === 88;
3316
- return vt(n.slice(i ? 2 : 1), i ? 16 : 10);
3318
+ return wt(n.slice(i ? 2 : 1), i ? 16 : 10);
3317
3319
  }
3318
- return Ze(n) || e;
3320
+ return Je(n) || e;
3319
3321
  }
3320
3322
  function Ke(e) {
3321
- return !e || typeof e != "object" ? "" : "position" in e || "type" in e ? Yt(e.position) : "start" in e || "end" in e ? Yt(e) : "line" in e || "column" in e ? _t(e) : "";
3323
+ return !e || typeof e != "object" ? "" : "position" in e || "type" in e ? Yt(e.position) : "start" in e || "end" in e ? Yt(e) : "line" in e || "column" in e ? vt(e) : "";
3322
3324
  }
3323
- function _t(e) {
3324
- return Xt(e && e.line) + ":" + Xt(e && e.column);
3325
+ function vt(e) {
3326
+ return Gt(e && e.line) + ":" + Gt(e && e.column);
3325
3327
  }
3326
3328
  function Yt(e) {
3327
- return _t(e && e.start) + "-" + _t(e && e.end);
3329
+ return vt(e && e.start) + "-" + vt(e && e.end);
3328
3330
  }
3329
- function Xt(e) {
3331
+ function Gt(e) {
3330
3332
  return e && typeof e == "number" ? e : 1;
3331
3333
  }
3332
- const Ln = {}.hasOwnProperty;
3333
- function Gt(e, t, n) {
3334
- return t && typeof t == "object" && (n = t, t = void 0), mo(n)(pn(fn(n).document().write(gn()(e, t, !0))));
3334
+ const An = {}.hasOwnProperty;
3335
+ function Xt(e, t, n) {
3336
+ return t && typeof t == "object" && (n = t, t = void 0), ko(n)(gn(pn(n).document().write(mn()(e, t, !0))));
3335
3337
  }
3336
- function mo(e) {
3338
+ function ko(e) {
3337
3339
  const t = {
3338
3340
  transforms: [],
3339
3341
  canContainEols: ["emphasis", "fragment", "heading", "paragraph", "strong"],
@@ -3349,7 +3351,7 @@ function mo(e) {
3349
3351
  codeFencedFenceInfo: a,
3350
3352
  codeFencedFenceMeta: a,
3351
3353
  codeIndented: i(Fe, a),
3352
- codeText: i(nt, a),
3354
+ codeText: i(rt, a),
3353
3355
  codeTextData: N,
3354
3356
  data: N,
3355
3357
  codeFlowValue: N,
@@ -3357,28 +3359,28 @@ function mo(e) {
3357
3359
  definitionDestinationString: a,
3358
3360
  definitionLabelString: a,
3359
3361
  definitionTitleString: a,
3360
- emphasis: i(rt),
3362
+ emphasis: i(it),
3361
3363
  hardBreakEscape: i(Ve),
3362
3364
  hardBreakTrailing: i(Ve),
3363
3365
  htmlFlow: i(qe, a),
3364
3366
  htmlFlowData: N,
3365
3367
  htmlText: i(qe, a),
3366
3368
  htmlTextData: N,
3367
- image: i(it),
3369
+ image: i(ot),
3368
3370
  label: a,
3369
3371
  link: i(Ue),
3370
- listItem: i(ot),
3372
+ listItem: i(at),
3371
3373
  listItemValue: g,
3372
3374
  listOrdered: i(We, p),
3373
3375
  listUnordered: i(We),
3374
- paragraph: i(at),
3376
+ paragraph: i(lt),
3375
3377
  reference: d,
3376
3378
  referenceString: a,
3377
3379
  resourceDestinationString: a,
3378
3380
  resourceTitleString: a,
3379
3381
  setextHeading: i(He),
3380
- strong: i(lt),
3381
- thematicBreak: i(st)
3382
+ strong: i(ut),
3383
+ thematicBreak: i(ct)
3382
3384
  },
3383
3385
  exit: {
3384
3386
  atxHeading: s(),
@@ -3388,12 +3390,12 @@ function mo(e) {
3388
3390
  autolinkProtocol: xe,
3389
3391
  blockQuote: s(),
3390
3392
  characterEscapeValue: $,
3391
- characterReferenceMarkerHexadecimal: we,
3392
- characterReferenceMarkerNumeric: we,
3393
- characterReferenceValue: W,
3393
+ characterReferenceMarkerHexadecimal: _e,
3394
+ characterReferenceMarkerNumeric: _e,
3395
+ characterReferenceValue: j,
3394
3396
  characterReference: Be,
3395
- codeFenced: s(z),
3396
- codeFencedFence: v,
3397
+ codeFenced: s(A),
3398
+ codeFencedFence: w,
3397
3399
  codeFencedFenceInfo: c,
3398
3400
  codeFencedFenceMeta: b,
3399
3401
  codeFlowValue: $,
@@ -3403,8 +3405,8 @@ function mo(e) {
3403
3405
  data: $,
3404
3406
  definition: s(),
3405
3407
  definitionDestinationString: O,
3406
- definitionLabelString: _,
3407
- definitionTitleString: w,
3408
+ definitionLabelString: v,
3409
+ definitionTitleString: _,
3408
3410
  emphasis: s(),
3409
3411
  hardBreakEscape: s(E),
3410
3412
  hardBreakTrailing: s(E),
@@ -3412,7 +3414,7 @@ function mo(e) {
3412
3414
  htmlFlowData: $,
3413
3415
  htmlText: s(V),
3414
3416
  htmlTextData: $,
3415
- image: s(U),
3417
+ image: s(W),
3416
3418
  label: de,
3417
3419
  labelText: re,
3418
3420
  lineEnding: T,
@@ -3426,13 +3428,13 @@ function mo(e) {
3426
3428
  resourceTitleString: ie,
3427
3429
  resource: fe,
3428
3430
  setextHeading: s(q),
3429
- setextHeadingLineSequence: F,
3431
+ setextHeadingLineSequence: M,
3430
3432
  setextHeadingText: k,
3431
3433
  strong: s(),
3432
3434
  thematicBreak: s()
3433
3435
  }
3434
3436
  };
3435
- zn(t, (e || {}).mdastExtensions || []);
3437
+ Bn(t, (e || {}).mdastExtensions || []);
3436
3438
  const n = {};
3437
3439
  return r;
3438
3440
  function r(m) {
@@ -3449,19 +3451,19 @@ function mo(e) {
3449
3451
  buffer: a,
3450
3452
  resume: f,
3451
3453
  data: n
3452
- }, A = [];
3454
+ }, z = [];
3453
3455
  let P = -1;
3454
3456
  for (; ++P < m.length; )
3455
3457
  if (m[P][1].type === "listOrdered" || m[P][1].type === "listUnordered")
3456
3458
  if (m[P][0] === "enter")
3457
- A.push(P);
3459
+ z.push(P);
3458
3460
  else {
3459
- const ae = A.pop();
3461
+ const ae = z.pop();
3460
3462
  P = o(m, ae, P);
3461
3463
  }
3462
3464
  for (P = -1; ++P < m.length; ) {
3463
3465
  const ae = t[m[P][0]];
3464
- Ln.call(ae, m[P][1].type) && ae[m[P][1].type].call(Object.assign({
3466
+ An.call(ae, m[P][1].type) && ae[m[P][1].type].call(Object.assign({
3465
3467
  sliceSerialize: m[P][2].sliceSerialize
3466
3468
  }, L), m[P][1]);
3467
3469
  }
@@ -3485,18 +3487,18 @@ function mo(e) {
3485
3487
  return y;
3486
3488
  }
3487
3489
  function o(m, y, L) {
3488
- let A = y - 1, P = -1, ae = !1, be, se, Ae, Re;
3489
- for (; ++A <= L; ) {
3490
- const G = m[A];
3491
- switch (G[1].type) {
3490
+ let z = y - 1, P = -1, ae = !1, be, ce, ze, Re;
3491
+ for (; ++z <= L; ) {
3492
+ const X = m[z];
3493
+ switch (X[1].type) {
3492
3494
  case "listUnordered":
3493
3495
  case "listOrdered":
3494
3496
  case "blockQuote": {
3495
- G[0] === "enter" ? P++ : P--, Re = void 0;
3497
+ X[0] === "enter" ? P++ : P--, Re = void 0;
3496
3498
  break;
3497
3499
  }
3498
3500
  case "lineEndingBlank": {
3499
- G[0] === "enter" && (be && !Re && !P && !Ae && (Ae = A), Re = void 0);
3501
+ X[0] === "enter" && (be && !Re && !P && !ze && (ze = z), Re = void 0);
3500
3502
  break;
3501
3503
  }
3502
3504
  case "linePrefix":
@@ -3508,27 +3510,27 @@ function mo(e) {
3508
3510
  default:
3509
3511
  Re = void 0;
3510
3512
  }
3511
- if (!P && G[0] === "enter" && G[1].type === "listItemPrefix" || P === -1 && G[0] === "exit" && (G[1].type === "listUnordered" || G[1].type === "listOrdered")) {
3513
+ if (!P && X[0] === "enter" && X[1].type === "listItemPrefix" || P === -1 && X[0] === "exit" && (X[1].type === "listUnordered" || X[1].type === "listOrdered")) {
3512
3514
  if (be) {
3513
- let Te = A;
3514
- for (se = void 0; Te--; ) {
3515
+ let Te = z;
3516
+ for (ce = void 0; Te--; ) {
3515
3517
  const pe = m[Te];
3516
3518
  if (pe[1].type === "lineEnding" || pe[1].type === "lineEndingBlank") {
3517
3519
  if (pe[0] === "exit") continue;
3518
- se && (m[se][1].type = "lineEndingBlank", ae = !0), pe[1].type = "lineEnding", se = Te;
3520
+ ce && (m[ce][1].type = "lineEndingBlank", ae = !0), pe[1].type = "lineEnding", ce = Te;
3519
3521
  } else if (!(pe[1].type === "linePrefix" || pe[1].type === "blockQuotePrefix" || pe[1].type === "blockQuotePrefixWhitespace" || pe[1].type === "blockQuoteMarker" || pe[1].type === "listItemIndent")) break;
3520
3522
  }
3521
- Ae && (!se || Ae < se) && (be._spread = !0), be.end = Object.assign({}, se ? m[se][1].start : G[1].end), m.splice(se || A, 0, ["exit", be, G[2]]), A++, L++;
3523
+ ze && (!ce || ze < ce) && (be._spread = !0), be.end = Object.assign({}, ce ? m[ce][1].start : X[1].end), m.splice(ce || z, 0, ["exit", be, X[2]]), z++, L++;
3522
3524
  }
3523
- if (G[1].type === "listItemPrefix") {
3525
+ if (X[1].type === "listItemPrefix") {
3524
3526
  const Te = {
3525
3527
  type: "listItem",
3526
3528
  _spread: !1,
3527
- start: Object.assign({}, G[1].start),
3529
+ start: Object.assign({}, X[1].start),
3528
3530
  // @ts-expect-error: we’ll add `end` in a second.
3529
3531
  end: void 0
3530
3532
  };
3531
- be = Te, m.splice(A, 0, ["enter", Te, G[2]]), A++, L++, Ae = void 0, Re = !0;
3533
+ be = Te, m.splice(z, 0, ["enter", Te, X[2]]), z++, L++, ze = void 0, Re = !0;
3532
3534
  }
3533
3535
  }
3534
3536
  }
@@ -3536,8 +3538,8 @@ function mo(e) {
3536
3538
  }
3537
3539
  function i(m, y) {
3538
3540
  return L;
3539
- function L(A) {
3540
- l.call(this, m(A), A), y && y.call(this, A);
3541
+ function L(z) {
3542
+ l.call(this, m(z), z), y && y.call(this, z);
3541
3543
  }
3542
3544
  }
3543
3545
  function a() {
@@ -3560,9 +3562,9 @@ function mo(e) {
3560
3562
  }
3561
3563
  }
3562
3564
  function u(m, y) {
3563
- const L = this.stack.pop(), A = this.tokenStack.pop();
3564
- if (A)
3565
- A[0].type !== m.type && (y ? y.call(this, m, A[0]) : (A[1] || Zt).call(this, m, A[0]));
3565
+ const L = this.stack.pop(), z = this.tokenStack.pop();
3566
+ if (z)
3567
+ z[0].type !== m.type && (y ? y.call(this, m, z[0]) : (z[1] || Zt).call(this, m, z[0]));
3566
3568
  else throw new Error("Cannot close `" + m.type + "` (" + Ke({
3567
3569
  start: m.start,
3568
3570
  end: m.end
@@ -3570,7 +3572,7 @@ function mo(e) {
3570
3572
  L.position.end = Ie(m.end);
3571
3573
  }
3572
3574
  function f() {
3573
- return co(this.stack.pop());
3575
+ return ho(this.stack.pop());
3574
3576
  }
3575
3577
  function p() {
3576
3578
  this.data.expectingFirstListItemValue = !0;
@@ -3589,10 +3591,10 @@ function mo(e) {
3589
3591
  const m = this.resume(), y = this.stack[this.stack.length - 1];
3590
3592
  y.meta = m;
3591
3593
  }
3592
- function v() {
3594
+ function w() {
3593
3595
  this.data.flowCodeInside || (this.buffer(), this.data.flowCodeInside = !0);
3594
3596
  }
3595
- function z() {
3597
+ function A() {
3596
3598
  const m = this.resume(), y = this.stack[this.stack.length - 1];
3597
3599
  y.value = m.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, ""), this.data.flowCodeInside = void 0;
3598
3600
  }
@@ -3600,11 +3602,11 @@ function mo(e) {
3600
3602
  const m = this.resume(), y = this.stack[this.stack.length - 1];
3601
3603
  y.value = m.replace(/(\r?\n|\r)$/g, "");
3602
3604
  }
3603
- function _(m) {
3605
+ function v(m) {
3604
3606
  const y = this.resume(), L = this.stack[this.stack.length - 1];
3605
3607
  L.label = y, L.identifier = Le(this.sliceSerialize(m)).toLowerCase();
3606
3608
  }
3607
- function w() {
3609
+ function _() {
3608
3610
  const m = this.resume(), y = this.stack[this.stack.length - 1];
3609
3611
  y.title = m;
3610
3612
  }
@@ -3622,7 +3624,7 @@ function mo(e) {
3622
3624
  function k() {
3623
3625
  this.data.setextHeadingSlurpLineEnding = !0;
3624
3626
  }
3625
- function F(m) {
3627
+ function M(m) {
3626
3628
  const y = this.stack[this.stack.length - 1];
3627
3629
  y.depth = this.sliceSerialize(m).codePointAt(0) === 61 ? 1 : 2;
3628
3630
  }
@@ -3631,12 +3633,12 @@ function mo(e) {
3631
3633
  }
3632
3634
  function N(m) {
3633
3635
  const L = this.stack[this.stack.length - 1].children;
3634
- let A = L[L.length - 1];
3635
- (!A || A.type !== "text") && (A = ut(), A.position = {
3636
+ let z = L[L.length - 1];
3637
+ (!z || z.type !== "text") && (z = st(), z.position = {
3636
3638
  start: Ie(m.start),
3637
3639
  // @ts-expect-error: we’ll add `end` later.
3638
3640
  end: void 0
3639
- }, L.push(A)), this.stack.push(A);
3641
+ }, L.push(z)), this.stack.push(z);
3640
3642
  }
3641
3643
  function $(m) {
3642
3644
  const y = this.stack.pop();
@@ -3675,7 +3677,7 @@ function mo(e) {
3675
3677
  delete m.identifier, delete m.label;
3676
3678
  this.data.referenceType = void 0;
3677
3679
  }
3678
- function U() {
3680
+ function W() {
3679
3681
  const m = this.stack[this.stack.length - 1];
3680
3682
  if (this.data.inReference) {
3681
3683
  const y = this.data.referenceType || "shortcut";
@@ -3686,13 +3688,13 @@ function mo(e) {
3686
3688
  }
3687
3689
  function re(m) {
3688
3690
  const y = this.sliceSerialize(m), L = this.stack[this.stack.length - 2];
3689
- L.label = po(y), L.identifier = Le(y).toLowerCase();
3691
+ L.label = go(y), L.identifier = Le(y).toLowerCase();
3690
3692
  }
3691
3693
  function de() {
3692
3694
  const m = this.stack[this.stack.length - 1], y = this.resume(), L = this.stack[this.stack.length - 1];
3693
3695
  if (this.data.inReference = !0, L.type === "link") {
3694
- const A = m.children;
3695
- L.children = A;
3696
+ const z = m.children;
3697
+ L.children = z;
3696
3698
  } else
3697
3699
  L.alt = y;
3698
3700
  }
@@ -3714,15 +3716,15 @@ function mo(e) {
3714
3716
  const y = this.resume(), L = this.stack[this.stack.length - 1];
3715
3717
  L.label = y, L.identifier = Le(this.sliceSerialize(m)).toLowerCase(), this.data.referenceType = "full";
3716
3718
  }
3717
- function we(m) {
3719
+ function _e(m) {
3718
3720
  this.data.characterReferenceType = m.type;
3719
3721
  }
3720
- function W(m) {
3722
+ function j(m) {
3721
3723
  const y = this.sliceSerialize(m), L = this.data.characterReferenceType;
3722
- let A;
3723
- L ? (A = vt(y, L === "characterReferenceMarkerNumeric" ? 10 : 16), this.data.characterReferenceType = void 0) : A = Ze(y);
3724
+ let z;
3725
+ L ? (z = wt(y, L === "characterReferenceMarkerNumeric" ? 10 : 16), this.data.characterReferenceType = void 0) : z = Je(y);
3724
3726
  const P = this.stack[this.stack.length - 1];
3725
- P.value += A;
3727
+ P.value += z;
3726
3728
  }
3727
3729
  function Be(m) {
3728
3730
  const y = this.stack.pop();
@@ -3752,7 +3754,7 @@ function mo(e) {
3752
3754
  value: ""
3753
3755
  };
3754
3756
  }
3755
- function nt() {
3757
+ function rt() {
3756
3758
  return {
3757
3759
  type: "inlineCode",
3758
3760
  value: ""
@@ -3767,7 +3769,7 @@ function mo(e) {
3767
3769
  url: ""
3768
3770
  };
3769
3771
  }
3770
- function rt() {
3772
+ function it() {
3771
3773
  return {
3772
3774
  type: "emphasis",
3773
3775
  children: []
@@ -3792,7 +3794,7 @@ function mo(e) {
3792
3794
  value: ""
3793
3795
  };
3794
3796
  }
3795
- function it() {
3797
+ function ot() {
3796
3798
  return {
3797
3799
  type: "image",
3798
3800
  title: null,
@@ -3817,7 +3819,7 @@ function mo(e) {
3817
3819
  children: []
3818
3820
  };
3819
3821
  }
3820
- function ot(m) {
3822
+ function at(m) {
3821
3823
  return {
3822
3824
  type: "listItem",
3823
3825
  spread: m._spread,
@@ -3825,25 +3827,25 @@ function mo(e) {
3825
3827
  children: []
3826
3828
  };
3827
3829
  }
3828
- function at() {
3830
+ function lt() {
3829
3831
  return {
3830
3832
  type: "paragraph",
3831
3833
  children: []
3832
3834
  };
3833
3835
  }
3834
- function lt() {
3836
+ function ut() {
3835
3837
  return {
3836
3838
  type: "strong",
3837
3839
  children: []
3838
3840
  };
3839
3841
  }
3840
- function ut() {
3842
+ function st() {
3841
3843
  return {
3842
3844
  type: "text",
3843
3845
  value: ""
3844
3846
  };
3845
3847
  }
3846
- function st() {
3848
+ function ct() {
3847
3849
  return {
3848
3850
  type: "thematicBreak"
3849
3851
  };
@@ -3856,17 +3858,17 @@ function Ie(e) {
3856
3858
  offset: e.offset
3857
3859
  };
3858
3860
  }
3859
- function zn(e, t) {
3861
+ function Bn(e, t) {
3860
3862
  let n = -1;
3861
3863
  for (; ++n < t.length; ) {
3862
3864
  const r = t[n];
3863
- Array.isArray(r) ? zn(e, r) : ko(e, r);
3865
+ Array.isArray(r) ? Bn(e, r) : xo(e, r);
3864
3866
  }
3865
3867
  }
3866
- function ko(e, t) {
3868
+ function xo(e, t) {
3867
3869
  let n;
3868
3870
  for (n in t)
3869
- if (Ln.call(t, n))
3871
+ if (An.call(t, n))
3870
3872
  switch (n) {
3871
3873
  case "canContainEols": {
3872
3874
  const r = t[n];
@@ -3898,20 +3900,20 @@ function Zt(e, t) {
3898
3900
  end: t.end
3899
3901
  }) + ") is still open");
3900
3902
  }
3901
- function xo() {
3903
+ function bo() {
3902
3904
  return {
3903
3905
  canContainEols: ["delete"],
3904
- enter: { strikethrough: bo },
3905
- exit: { strikethrough: yo }
3906
+ enter: { strikethrough: yo },
3907
+ exit: { strikethrough: So }
3906
3908
  };
3907
3909
  }
3908
- function bo(e) {
3910
+ function yo(e) {
3909
3911
  this.enter({ type: "delete", children: [] }, e);
3910
3912
  }
3911
- function yo(e) {
3913
+ function So(e) {
3912
3914
  this.exit(e);
3913
3915
  }
3914
- const Bn = (
3916
+ const zn = (
3915
3917
  // Note: overloads in JSDoc can’t yet use different `@template`s.
3916
3918
  /**
3917
3919
  * @type {(
@@ -3928,11 +3930,11 @@ const Bn = (
3928
3930
  */
3929
3931
  (function(e) {
3930
3932
  if (e == null)
3931
- return vo;
3933
+ return Co;
3932
3934
  if (typeof e == "function")
3933
- return tt(e);
3935
+ return nt(e);
3934
3936
  if (typeof e == "object")
3935
- return Array.isArray(e) ? So(e) : (
3937
+ return Array.isArray(e) ? vo(e) : (
3936
3938
  // Cast because `ReadonlyArray` goes into the above but `isArray`
3937
3939
  // narrows to `Array`.
3938
3940
  _o(
@@ -3945,12 +3947,12 @@ const Bn = (
3945
3947
  throw new Error("Expected function, string, or object as test");
3946
3948
  })
3947
3949
  );
3948
- function So(e) {
3950
+ function vo(e) {
3949
3951
  const t = [];
3950
3952
  let n = -1;
3951
3953
  for (; ++n < e.length; )
3952
- t[n] = Bn(e[n]);
3953
- return tt(r);
3954
+ t[n] = zn(e[n]);
3955
+ return nt(r);
3954
3956
  function r(...o) {
3955
3957
  let i = -1;
3956
3958
  for (; ++i < t.length; )
@@ -3963,7 +3965,7 @@ function _o(e) {
3963
3965
  /** @type {Record<string, unknown>} */
3964
3966
  e
3965
3967
  );
3966
- return tt(n);
3968
+ return nt(n);
3967
3969
  function n(r) {
3968
3970
  const o = (
3969
3971
  /** @type {Record<string, unknown>} */
@@ -3977,15 +3979,15 @@ function _o(e) {
3977
3979
  }
3978
3980
  }
3979
3981
  function wo(e) {
3980
- return tt(t);
3982
+ return nt(t);
3981
3983
  function t(n) {
3982
3984
  return n && n.type === e;
3983
3985
  }
3984
3986
  }
3985
- function tt(e) {
3987
+ function nt(e) {
3986
3988
  return t;
3987
3989
  function t(n, r, o) {
3988
- return !!(Co(n) && e.call(
3990
+ return !!(Eo(n) && e.call(
3989
3991
  this,
3990
3992
  n,
3991
3993
  typeof r == "number" ? r : void 0,
@@ -3993,17 +3995,17 @@ function tt(e) {
3993
3995
  ));
3994
3996
  }
3995
3997
  }
3996
- function vo() {
3998
+ function Co() {
3997
3999
  return !0;
3998
4000
  }
3999
- function Co(e) {
4001
+ function Eo(e) {
4000
4002
  return e !== null && typeof e == "object" && "type" in e;
4001
4003
  }
4002
- const An = [], Eo = !0, Jt = !1, To = "skip";
4003
- function Io(e, t, n, r) {
4004
+ const Rn = [], To = !0, Jt = !1, Io = "skip";
4005
+ function Lo(e, t, n, r) {
4004
4006
  let o;
4005
4007
  typeof t == "function" && typeof n != "function" ? (r = n, n = t) : o = t;
4006
- const i = Bn(o), a = r ? -1 : 1;
4008
+ const i = zn(o), a = r ? -1 : 1;
4007
4009
  l(e, void 0, [])();
4008
4010
  function l(s, u, f) {
4009
4011
  const p = (
@@ -4024,38 +4026,68 @@ function Io(e, t, n, r) {
4024
4026
  }
4025
4027
  return g;
4026
4028
  function g() {
4027
- let c = An, b, v, z;
4028
- if ((!t || i(s, u, f[f.length - 1] || void 0)) && (c = Lo(n(s, f)), c[0] === Jt))
4029
+ let c = Rn, b, w, A;
4030
+ if ((!t || i(s, u, f[f.length - 1] || void 0)) && (c = Ao(n(s, f)), c[0] === Jt))
4029
4031
  return c;
4030
4032
  if ("children" in s && s.children) {
4031
4033
  const x = (
4032
4034
  /** @type {UnistParent} */
4033
4035
  s
4034
4036
  );
4035
- if (x.children && c[0] !== To)
4036
- for (v = (r ? x.children.length : -1) + a, z = f.concat(x); v > -1 && v < x.children.length; ) {
4037
- const _ = x.children[v];
4038
- if (b = l(_, v, z)(), b[0] === Jt)
4037
+ if (x.children && c[0] !== Io)
4038
+ for (w = (r ? x.children.length : -1) + a, A = f.concat(x); w > -1 && w < x.children.length; ) {
4039
+ const v = x.children[w];
4040
+ if (b = l(v, w, A)(), b[0] === Jt)
4039
4041
  return b;
4040
- v = typeof b[1] == "number" ? b[1] : v + a;
4042
+ w = typeof b[1] == "number" ? b[1] : w + a;
4041
4043
  }
4042
4044
  }
4043
4045
  return c;
4044
4046
  }
4045
4047
  }
4046
4048
  }
4047
- function Lo(e) {
4048
- return Array.isArray(e) ? e : typeof e == "number" ? [Eo, e] : e == null ? An : [e];
4049
+ function Ao(e) {
4050
+ return Array.isArray(e) ? e : typeof e == "number" ? [To, e] : e == null ? Rn : [e];
4049
4051
  }
4050
- function gt(e, t, n, r) {
4052
+ function mt(e, t, n, r) {
4051
4053
  let o, i, a;
4052
- typeof t == "function" && typeof n != "function" ? (i = void 0, a = t, o = n) : (i = t, a = n, o = r), Io(e, i, l, o);
4054
+ typeof t == "function" && typeof n != "function" ? (i = void 0, a = t, o = n) : (i = t, a = n, o = r), Lo(e, i, l, o);
4053
4055
  function l(s, u) {
4054
4056
  const f = u[u.length - 1], p = f ? f.children.indexOf(s) : void 0;
4055
4057
  return a(s, p, f);
4056
4058
  }
4057
4059
  }
4058
- const zo = $n`
4060
+ function Bo(e, t, n) {
4061
+ const r = e.slice(0, t), o = /^```[^\n]*(?:\n|$)/gm;
4062
+ let i = null, a;
4063
+ for (; (a = o.exec(r)) !== null; )
4064
+ i = i === null ? a : null;
4065
+ if (i === null)
4066
+ return null;
4067
+ const l = i.index, s = i[0].indexOf(`
4068
+ `), u = l + (s === -1 ? i[0].length : s + 1);
4069
+ return e.slice(0, l) + "```" + n + `
4070
+ ` + e.slice(u);
4071
+ }
4072
+ function zo(e, t, n) {
4073
+ const r = e.filter(
4074
+ (a) => a.type === "mark" && a.from <= t && a.to >= n
4075
+ ), i = r.find((a) => a.className?.startsWith("rme-heading-"))?.className?.replace("rme-heading-", "");
4076
+ return {
4077
+ bold: r.some((a) => a.bold),
4078
+ italic: r.some((a) => a.italic),
4079
+ underline: r.some((a) => a.className === "rme-underline"),
4080
+ strikethrough: r.some((a) => a.className === "rme-strikethrough"),
4081
+ code: r.some((a) => a.className === "rme-code"),
4082
+ link: r.some((a) => a.className === "rme-link"),
4083
+ heading: i ?? null,
4084
+ blockquote: r.some((a) => a.className === "rme-blockquote"),
4085
+ bulletList: r.some((a) => a.className === "rme-list-bullet"),
4086
+ orderedList: r.some((a) => a.className === "rme-list-ordered"),
4087
+ codeBlock: r.some((a) => a.className === "rme-code-block")
4088
+ };
4089
+ }
4090
+ const Ro = Dn`
4059
4091
  :host {
4060
4092
  position: relative;
4061
4093
  display: flex;
@@ -4070,15 +4102,15 @@ const zo = $n`
4070
4102
  box-sizing: border-box;
4071
4103
  outline: none;
4072
4104
  /* Consumer themes via CSS custom properties */
4073
- font-family: var(--rme-font-family, inherit);
4074
- font-size: var(--rme-font-size, inherit);
4075
- line-height: var(--rme-line-height, 1.6);
4076
- padding: var(--rme-padding, 0.75em 1em);
4077
- background: var(--rme-background, Canvas);
4078
- color: var(--rme-color, CanvasText);
4079
- border: var(--rme-border, 1px solid ButtonBorder);
4080
- border-top: none;
4081
- border-radius: var(--rme-border-radius, 0 0 4px 4px);
4105
+ font-family: var(--rme-font-family, inherit);
4106
+ font-size: var(--rme-font-size, inherit);
4107
+ line-height: var(--rme-line-height, 1.6);
4108
+ padding: var(--rme-padding, 0.75em 1em);
4109
+ background: var(--rme-background, Canvas);
4110
+ color: var(--rme-color, CanvasText);
4111
+ border: var(--rme-border, 1px solid ButtonBorder);
4112
+ border-top: none;
4113
+ border-radius: var(--rme-border-radius, 0 0 4px 4px);
4082
4114
  }
4083
4115
 
4084
4116
  #rich-view:focus {
@@ -4086,11 +4118,17 @@ const zo = $n`
4086
4118
  outline-offset: -2px;
4087
4119
  }
4088
4120
 
4089
- #rich-view[hidden] { display: none; }
4121
+ #rich-view[hidden] {
4122
+ display: none;
4123
+ }
4090
4124
 
4091
4125
  /* Block-level spacing within the rich view */
4092
- #rich-view > :first-child { margin-top: 0; }
4093
- #rich-view > :last-child { margin-bottom: 0; }
4126
+ #rich-view > :first-child {
4127
+ margin-top: 0;
4128
+ }
4129
+ #rich-view > :last-child {
4130
+ margin-bottom: 0;
4131
+ }
4094
4132
 
4095
4133
  /* Source mode wrapper */
4096
4134
  #source-wrapper {
@@ -4100,7 +4138,9 @@ const zo = $n`
4100
4138
  flex-direction: column;
4101
4139
  }
4102
4140
 
4103
- #source-wrapper[hidden] { display: none; }
4141
+ #source-wrapper[hidden] {
4142
+ display: none;
4143
+ }
4104
4144
 
4105
4145
  #source-editor {
4106
4146
  flex: 1 1 auto;
@@ -4110,55 +4150,53 @@ const zo = $n`
4110
4150
  --rc-textarea-border-top: none;
4111
4151
  }
4112
4152
 
4113
- rc-editor-toolbar [role='toolbar'] {
4114
- display: flex;
4115
- flex-wrap: wrap;
4116
- align-items: center;
4117
- gap: var(--rme-toolbar-gap, 1px);
4118
- padding: 4px;
4119
- border: 1px solid ButtonBorder;
4120
- border-radius: 4px 4px 0 0;
4121
- background: Canvas;
4153
+ rc-editor-toolbar rc-toolbar {
4154
+ display: block;
4155
+ inline-size: 100%;
4156
+ --rc-toolbar-flex-wrap: wrap;
4157
+ --rc-toolbar-gap-inline: var(--rme-toolbar-gap, 1px);
4158
+ --rc-toolbar-padding-block: var(--rme-toolbar-padding, 4px);
4159
+ --rc-toolbar-padding-inline: var(--rme-toolbar-padding, 4px);
4160
+ --rc-toolbar-radius: var(--rme-toolbar-radius, 4px 4px 0 0);
4122
4161
  }
4123
4162
 
4124
- rc-editor-toolbar button {
4125
- appearance: none;
4126
- display: inline-flex;
4127
- align-items: center;
4128
- justify-content: center;
4129
- min-inline-size: var(--rme-toolbar-button-size, 2rem);
4130
- min-block-size: var(--rme-toolbar-button-size, 2rem);
4131
- padding: 0.3em;
4132
- border: 1px solid transparent;
4133
- border-radius: 3px;
4134
- background: transparent;
4135
- color: ButtonText;
4136
- font: inherit;
4137
- font-size: 0.875em;
4138
- cursor: pointer;
4139
- line-height: 1;
4163
+ rc-editor-toolbar rc-toolbar::part(root) {
4164
+ border: var(--rme-toolbar-border, 1px solid ButtonBorder);
4165
+ background: var(--rme-toolbar-background, Canvas);
4166
+ color: var(--rme-toolbar-color, CanvasText);
4140
4167
  }
4141
4168
 
4142
- rc-editor-toolbar button svg {
4143
- inline-size: 1.15em;
4144
- block-size: 1.15em;
4145
- flex-shrink: 0;
4169
+ rc-editor-toolbar rc-button {
4170
+ --rc-button-bg: var(--rme-toolbar-button-background, transparent);
4171
+ --rc-button-color: var(--rme-toolbar-button-color, ButtonText);
4172
+ --rc-button-border: var(--rme-toolbar-button-border, 1px solid transparent);
4173
+ --rc-button-radius: var(--rme-toolbar-button-radius, 3px);
4174
+ --rc-button-block-size: var(--rme-toolbar-button-size, 2rem);
4175
+ --rc-button-icon-size: var(--rme-toolbar-button-size, 2rem);
4176
+ --rc-button-padding-block: 0;
4177
+ --rc-button-padding-inline: 0;
4178
+ --rc-button-font: inherit;
4179
+ --rc-button-state-layer-bg: currentColor;
4180
+ --rc-button-hover-state-layer-opacity: var(--rme-toolbar-button-hover-opacity, 0.08);
4181
+ --rc-button-focus-state-layer-opacity: var(--rme-toolbar-button-focus-opacity, 0.12);
4182
+ --rc-button-pressed-state-layer-opacity: var(--rme-toolbar-button-pressed-opacity, 0.12);
4146
4183
  }
4147
4184
 
4148
- rc-editor-toolbar button:hover {
4149
- background: ButtonFace;
4150
- border-color: ButtonBorder;
4185
+ rc-editor-toolbar rc-button.toolbar-active {
4186
+ --rc-button-bg: var(--rme-toolbar-button-active-background, Highlight);
4187
+ --rc-button-color: var(--rme-toolbar-button-active-color, HighlightText);
4188
+ --rc-button-border: var(--rme-toolbar-button-active-border, 1px solid Highlight);
4151
4189
  }
4152
4190
 
4153
- rc-editor-toolbar button:focus-visible {
4154
- outline: 2px solid Highlight;
4155
- outline-offset: 1px;
4191
+ rc-editor-toolbar rc-button > button:focus-visible {
4192
+ outline: var(--rme-toolbar-focus-outline, 2px solid Highlight);
4193
+ outline-offset: var(--rme-toolbar-focus-outline-offset, 1px);
4156
4194
  }
4157
4195
 
4158
- rc-editor-toolbar button[aria-pressed='true'] {
4159
- background: Highlight;
4160
- color: HighlightText;
4161
- border-color: Highlight;
4196
+ rc-editor-toolbar [data-rc-button-icon] svg {
4197
+ inline-size: 1.15em;
4198
+ block-size: 1.15em;
4199
+ flex-shrink: 0;
4162
4200
  }
4163
4201
 
4164
4202
  /* Heading select */
@@ -4166,14 +4204,14 @@ const zo = $n`
4166
4204
  font-size: 0.8125em;
4167
4205
  --rc-select-padding-block: 0.25em;
4168
4206
  --rc-select-padding-inline: 0.35em;
4169
- --rc-select-border: 1px solid ButtonBorder;
4170
- --rc-select-radius: 3px;
4207
+ --rc-select-border: var(--rme-toolbar-select-border, 1px solid ButtonBorder);
4208
+ --rc-select-radius: var(--rme-toolbar-select-radius, 3px);
4171
4209
  }
4172
4210
 
4173
4211
  rc-editor-toolbar rc-select::part(trigger) {
4174
4212
  min-width: 0;
4175
- background: ButtonFace;
4176
- color: ButtonText;
4213
+ background: var(--rme-toolbar-select-background, ButtonFace);
4214
+ color: var(--rme-toolbar-select-color, ButtonText);
4177
4215
  cursor: pointer;
4178
4216
  }
4179
4217
 
@@ -4182,26 +4220,26 @@ const zo = $n`
4182
4220
  }
4183
4221
 
4184
4222
  rc-editor-toolbar rc-select.toolbar-active::part(trigger) {
4185
- background: Highlight;
4186
- color: HighlightText;
4187
- border-color: Highlight;
4223
+ background: var(--rme-toolbar-select-active-background, Highlight);
4224
+ color: var(--rme-toolbar-select-active-color, HighlightText);
4225
+ border-color: var(--rme-toolbar-select-active-border-color, Highlight);
4188
4226
  }
4189
4227
 
4190
4228
  /* Code block language input */
4191
4229
  rc-editor-toolbar .lang-input {
4192
4230
  padding: 0.25em 0.5em;
4193
- border: 1px solid ButtonBorder;
4194
- border-radius: 3px;
4195
- background: Field;
4196
- color: FieldText;
4231
+ border: var(--rme-toolbar-input-border, 1px solid ButtonBorder);
4232
+ border-radius: var(--rme-toolbar-input-radius, 3px);
4233
+ background: var(--rme-toolbar-input-background, Field);
4234
+ color: var(--rme-toolbar-input-color, FieldText);
4197
4235
  font: inherit;
4198
4236
  font-size: 0.8125em;
4199
4237
  width: 8em;
4200
4238
  }
4201
4239
 
4202
4240
  rc-editor-toolbar .lang-input:focus {
4203
- outline: 2px solid Highlight;
4204
- outline-offset: 1px;
4241
+ outline: var(--rme-toolbar-focus-outline, 2px solid Highlight);
4242
+ outline-offset: var(--rme-toolbar-focus-outline-offset, 1px);
4205
4243
  }
4206
4244
 
4207
4245
  rc-editor-toolbar .lang-input::placeholder {
@@ -4234,12 +4272,15 @@ const zo = $n`
4234
4272
  font-size: 0.875em;
4235
4273
  }
4236
4274
 
4237
- #rich-view ul, #rich-view ol {
4275
+ #rich-view ul,
4276
+ #rich-view ol {
4238
4277
  margin: 0.5em 0;
4239
4278
  padding-left: 1.75em;
4240
4279
  }
4241
4280
 
4242
- #rich-view li { margin: 0.2em 0; }
4281
+ #rich-view li {
4282
+ margin: 0.2em 0;
4283
+ }
4243
4284
 
4244
4285
  .link-popover {
4245
4286
  position: absolute;
@@ -4313,43 +4354,13 @@ const zo = $n`
4313
4354
  font-size: 0.875em;
4314
4355
  }
4315
4356
  `;
4316
- function Bo(e, t, n) {
4317
- const r = e.slice(0, t), o = /^```[^\n]*(?:\n|$)/gm;
4318
- let i = null, a;
4319
- for (; (a = o.exec(r)) !== null; )
4320
- i = i === null ? a : null;
4321
- if (i === null)
4322
- return null;
4323
- const l = i.index, s = i[0].indexOf(`
4324
- `), u = l + (s === -1 ? i[0].length : s + 1);
4325
- return e.slice(0, l) + "```" + n + `
4326
- ` + e.slice(u);
4327
- }
4328
- function Ao(e, t, n) {
4329
- const r = e.filter(
4330
- (a) => a.type === "mark" && a.from <= t && a.to >= n
4331
- ), i = r.find((a) => a.className?.startsWith("rme-heading-"))?.className?.replace("rme-heading-", "");
4332
- return {
4333
- bold: r.some((a) => a.bold),
4334
- italic: r.some((a) => a.italic),
4335
- underline: r.some((a) => a.className === "rme-underline"),
4336
- strikethrough: r.some((a) => a.className === "rme-strikethrough"),
4337
- code: r.some((a) => a.className === "rme-code"),
4338
- link: r.some((a) => a.className === "rme-link"),
4339
- heading: i ?? null,
4340
- blockquote: r.some((a) => a.className === "rme-blockquote"),
4341
- bulletList: r.some((a) => a.className === "rme-list-bullet"),
4342
- orderedList: r.some((a) => a.className === "rme-list-ordered"),
4343
- codeBlock: r.some((a) => a.className === "rme-code-block")
4344
- };
4345
- }
4346
- var Ro = Object.defineProperty, Fo = Object.getOwnPropertyDescriptor, he = (e, t, n, r) => {
4357
+ var Mo = Object.defineProperty, Fo = Object.getOwnPropertyDescriptor, se = (e, t, n, r) => {
4347
4358
  for (var o = r > 1 ? void 0 : r ? Fo(t, n) : t, i = e.length - 1, a; i >= 0; i--)
4348
4359
  (a = e[i]) && (o = (r ? a(t, n, o) : a(o)) || o);
4349
- return r && o && Ro(t, n, o), o;
4360
+ return r && o && Mo(t, n, o), o;
4350
4361
  };
4351
- const Rn = new CSSStyleSheet();
4352
- Rn.replaceSync(`
4362
+ const Mn = new CSSStyleSheet();
4363
+ Mn.replaceSync(`
4353
4364
  .rme-heading-h1,
4354
4365
  .rme-heading-h2,
4355
4366
  .rme-heading-h3,
@@ -4386,13 +4397,59 @@ Rn.replaceSync(`
4386
4397
  text-decoration: underline;
4387
4398
  }
4388
4399
  `);
4389
- const Mo = {
4400
+ const Po = {
4390
4401
  allowDangerousHtml: !0,
4391
- extensions: [mn()]
4402
+ extensions: [kn()]
4392
4403
  }, en = {
4393
- extensions: [mn()],
4394
- mdastExtensions: [xo()]
4395
- }, Pe = new Ge({
4404
+ extensions: [kn()],
4405
+ mdastExtensions: [bo()]
4406
+ }, Oo = /* @__PURE__ */ new Set([
4407
+ "A",
4408
+ "BLOCKQUOTE",
4409
+ "BR",
4410
+ "CODE",
4411
+ "DEL",
4412
+ "EM",
4413
+ "H1",
4414
+ "H2",
4415
+ "H3",
4416
+ "H4",
4417
+ "H5",
4418
+ "H6",
4419
+ "HR",
4420
+ "LI",
4421
+ "OL",
4422
+ "P",
4423
+ "PRE",
4424
+ "S",
4425
+ "STRONG",
4426
+ "U",
4427
+ "UL"
4428
+ ]);
4429
+ function No(e) {
4430
+ const t = e.trim();
4431
+ if (/^(?:#|\/|\.\/|\.\.\/)/.test(t))
4432
+ return !0;
4433
+ try {
4434
+ const n = new URL(t, document.baseURI);
4435
+ return n.protocol === "http:" || n.protocol === "https:" || n.protocol === "mailto:";
4436
+ } catch {
4437
+ return !1;
4438
+ }
4439
+ }
4440
+ function tn(e) {
4441
+ const t = new DOMParser().parseFromString(e, "text/html");
4442
+ for (const n of [...t.body.querySelectorAll("*")]) {
4443
+ if (!Oo.has(n.tagName)) {
4444
+ n.replaceWith(t.createTextNode(n.textContent ?? ""));
4445
+ continue;
4446
+ }
4447
+ for (const r of [...n.attributes])
4448
+ n.tagName === "A" && r.name === "href" && No(r.value) || n.tagName === "A" && r.name === "title" || n.tagName === "PRE" && r.name === "data-lang" || n.removeAttribute(r.name);
4449
+ }
4450
+ return t.body.innerHTML;
4451
+ }
4452
+ const Pe = new Ze({
4396
4453
  headingStyle: "atx",
4397
4454
  bulletListMarker: "-",
4398
4455
  codeBlockStyle: "fenced",
@@ -4420,7 +4477,7 @@ Pe.addRule("codeBlockWithLang", {
4420
4477
  ` + (r?.textContent ?? "") + "\n```\n\n";
4421
4478
  }
4422
4479
  });
4423
- const Po = {
4480
+ const $o = {
4424
4481
  // className applied per depth in _setupSourcePlugin, not here
4425
4482
  heading: { bold: !0 },
4426
4483
  emphasis: { italic: !0 },
@@ -4433,15 +4490,18 @@ const Po = {
4433
4490
  // GFM ~~text~~ (AST node.type === 'delete')
4434
4491
  delete: { className: "rme-strikethrough" }
4435
4492
  // list and html (underline) nodes are handled dynamically in _setupSourcePlugin
4436
- }, Bt = class Bt extends tn {
4493
+ }, Bt = class Bt extends nn {
4437
4494
  constructor() {
4438
- super(...arguments), this._defaultValue = "", this._valueInitialized = !1, this._defaultSourceMode = !1, this._sourceModeInitialized = !1, this.toolbar = !0, this.readOnly = !1, this._observer = null, this._$savedRange = null, this._activeFormats = {}, this._syncTimer = null, this._pluginApi = null, this._ignoreRichMutations = !1, this._richViewRendered = !1, this._cachedTree = null, this._firstUpdatedDone = !1, this._linkPopoverOpen = !1, this._linkPopoverHref = "", this._onSourceChange = (t) => {
4495
+ super(...arguments), this._defaultValue = "", this._valueInitialized = !1, this._defaultSourceMode = !1, this._sourceModeInitialized = !1, this.toolbar = !0, this.readOnly = !1, this._observer = null, this._$savedRange = null, this._activeFormats = {}, this._syncTimer = null, this._pluginApi = null, this._ignoreRichMutations = !1, this._richViewRendered = !1, this._cachedTree = null, this._renderedMode = null, this._firstUpdatedDone = !1, this._linkPopoverOpen = !1, this._linkPopoverHref = "", this._onSourceChange = (t) => {
4496
+ if (!this.sourceMode)
4497
+ return;
4439
4498
  const n = this._$sourceEditor?.value ?? "";
4440
4499
  n !== this.value && (this._value = n, this._syncNativeTextarea(), this._dispatchChange(n));
4441
4500
  }, this._onToolbarAction = (t) => {
4442
4501
  const { action: n, headingLevel: r, codeLanguage: o } = t.detail;
4443
4502
  if (n === "source") {
4444
- this.sourceMode = !this.sourceMode;
4503
+ const i = !this.sourceMode;
4504
+ this.sourceMode = i, this._dispatchModeChange(i ? "source" : "rich");
4445
4505
  return;
4446
4506
  }
4447
4507
  if (n === "code-block-language") {
@@ -4454,12 +4514,16 @@ const Po = {
4454
4514
  }
4455
4515
  this.sourceMode ? this._applySourceFormat(n) : this._applyRichFormat(n);
4456
4516
  }, this._onKeyDown = (t) => {
4457
- if (!t.ctrlKey && !t.metaKey) return;
4517
+ if (!t.ctrlKey && !t.metaKey)
4518
+ return;
4458
4519
  if (t.shiftKey && t.key === "S") {
4459
- t.preventDefault(), this.sourceMode = !this.sourceMode;
4520
+ t.preventDefault();
4521
+ const r = !this.sourceMode;
4522
+ this.sourceMode = r, this._dispatchModeChange(r ? "source" : "rich");
4460
4523
  return;
4461
4524
  }
4462
- if (t.shiftKey) return;
4525
+ if (t.shiftKey)
4526
+ return;
4463
4527
  let n = null;
4464
4528
  switch (t.key) {
4465
4529
  case "b":
@@ -4481,9 +4545,11 @@ const Po = {
4481
4545
  n && (t.preventDefault(), this.sourceMode ? this._applySourceFormat(n) : this._applyRichFormat(n));
4482
4546
  }, this._onSelectionChange = () => {
4483
4547
  const t = this.shadowRoot.getSelection?.() ?? window.getSelection();
4484
- if (!t || t.rangeCount === 0) return;
4548
+ if (!t || t.rangeCount === 0)
4549
+ return;
4485
4550
  const n = t.getRangeAt(0), r = n.commonAncestorContainer, o = r.nodeType === Node.TEXT_NODE ? r.parentElement : r;
4486
- if (!this._$richView?.contains(o) || (this._$savedRange = n.cloneRange(), this.sourceMode)) return;
4551
+ if (!this._$richView?.contains(o) || (this._$savedRange = n.cloneRange(), this.sourceMode))
4552
+ return;
4487
4553
  const i = o?.closest("pre");
4488
4554
  this._activeFormats = {
4489
4555
  bold: !!o?.closest("strong, b"),
@@ -4500,11 +4566,13 @@ const Po = {
4500
4566
  codeLanguage: i ? i.dataset.lang ?? "" : null
4501
4567
  }, this._pushToolbarState();
4502
4568
  }, this._onRichViewClick = (t) => {
4503
- if (!t.ctrlKey && !t.metaKey) return;
4569
+ if (!t.ctrlKey && !t.metaKey)
4570
+ return;
4504
4571
  const n = t.target.closest("a[href]");
4505
4572
  n && (t.preventDefault(), window.open(n.href, "_blank", "noopener,noreferrer"));
4506
4573
  }, this._onDocumentClick = (t) => {
4507
- if (!this._linkPopoverOpen) return;
4574
+ if (!this._linkPopoverOpen)
4575
+ return;
4508
4576
  const n = this.shadowRoot?.querySelector(".link-popover");
4509
4577
  n && t.composedPath().includes(n) || (this._linkPopoverOpen = !1);
4510
4578
  }, this._applyLink = () => {
@@ -4552,7 +4620,7 @@ const Po = {
4552
4620
  }
4553
4621
  set sourceMode(t) {
4554
4622
  const n = this._sourceMode;
4555
- this._sourceMode = t, this._sourceModeInitialized = !0, this.requestUpdate("sourceMode", n), n !== t && this._dispatchModeChange(t ? "source" : "rich");
4623
+ this._sourceMode = t, this._sourceModeInitialized = !0, this.requestUpdate("sourceMode", n);
4556
4624
  }
4557
4625
  connectedCallback() {
4558
4626
  super.connectedCallback(), document.addEventListener("selectionchange", this._onSelectionChange), document.addEventListener("click", this._onDocumentClick), this.addEventListener("keydown", this._onKeyDown);
@@ -4571,19 +4639,26 @@ const Po = {
4571
4639
  childList: !0,
4572
4640
  subtree: !0,
4573
4641
  characterData: !0
4574
- }), this._$richView.addEventListener("click", this._onRichViewClick), this._setupSourcePlugin(), this.sourceMode ? this._$sourceEditor.value = this.value : this._setRichViewContent(this.value), this._syncNativeTextarea(), this._connectLabel(), this._firstUpdatedDone = !0;
4642
+ }), this._$richView.addEventListener("click", this._onRichViewClick), this._setupSourcePlugin(), this.sourceMode ? this._$sourceEditor.value = this.value : this._setRichViewContent(this.value), this._renderedMode = this.sourceMode ? "source" : "rich", this._syncNativeTextarea(), this._connectLabel(), this._firstUpdatedDone = !0;
4575
4643
  }
4576
4644
  updated(t) {
4577
- (t.has("sourceMode") || t.has("defaultSourceMode")) && (this._firstUpdatedDone && (this.sourceMode ? this._switchToSource() : this._switchToRich()), this._pushToolbarState()), t.has("value") && !this.sourceMode && this._richViewRendered && this._setRichViewContent(this.value), t.has("_linkPopoverOpen") && this._linkPopoverOpen && (this._positionLinkPopover(), this._$linkPopoverInput?.focus(), this._$linkPopoverInput?.select());
4645
+ if (t.has("sourceMode") || t.has("defaultSourceMode")) {
4646
+ if (this._firstUpdatedDone) {
4647
+ const n = this.sourceMode ? "source" : "rich";
4648
+ n !== this._renderedMode && (n === "source" ? this._switchToSource() : this._switchToRich(), this._renderedMode = n);
4649
+ }
4650
+ this._pushToolbarState();
4651
+ }
4652
+ t.has("value") && !this.sourceMode && this._richViewRendered && this._setRichViewContent(this.value), t.has("_linkPopoverOpen") && this._linkPopoverOpen && (this._positionLinkPopover(), this._$linkPopoverInput?.focus(), this._$linkPopoverInput?.select());
4578
4653
  }
4579
4654
  render() {
4580
4655
  return Me`
4581
4656
  <slot></slot>
4582
4657
 
4583
4658
  ${this.toolbar ? Me`<rc-editor-toolbar
4584
- part="toolbar"
4585
- @rc-toolbar-action=${this._onToolbarAction}
4586
- ></rc-editor-toolbar>` : mt}
4659
+ part="toolbar"
4660
+ @rc-toolbar-action=${this._onToolbarAction}
4661
+ ></rc-editor-toolbar>` : Ye}
4587
4662
 
4588
4663
  <div
4589
4664
  id="rich-view"
@@ -4599,42 +4674,66 @@ const Po = {
4599
4674
  <rc-textarea
4600
4675
  id="source-editor"
4601
4676
  word-wrap
4677
+ ?read-only=${this.readOnly}
4602
4678
  @rc-change=${this._onSourceChange}
4603
4679
  ></rc-textarea>
4604
4680
  </div>
4605
4681
 
4606
4682
  ${this._linkPopoverOpen ? Me`
4607
- <div class="link-popover" role="dialog" aria-label="Link">
4608
- <input
4609
- type="url"
4610
- class="link-popover-input"
4611
- .value=${this._linkPopoverHref}
4612
- placeholder="https://"
4613
- aria-label="URL"
4614
- @input=${(t) => {
4683
+ <div class="link-popover" role="dialog" aria-label="Link">
4684
+ <input
4685
+ type="url"
4686
+ class="link-popover-input"
4687
+ .value=${this._linkPopoverHref}
4688
+ placeholder="https://"
4689
+ aria-label="URL"
4690
+ @input=${(t) => {
4615
4691
  this._linkPopoverHref = t.target.value;
4616
4692
  }}
4617
- @keydown=${this._onLinkPopoverKeyDown}
4618
- />
4619
- <button type="button" class="link-popover-btn" title="Apply (Enter)" @click=${this._applyLink}>↵</button>
4620
- <button type="button" class="link-popover-btn" title="Open link" ?disabled=${!this._linkPopoverHref} @click=${this._openLinkHref}>↗</button>
4621
- <button type="button" class="link-popover-btn" title="Remove link" @click=${this._removeLink}>✕</button>
4622
- </div>
4623
- ` : mt}
4693
+ @keydown=${this._onLinkPopoverKeyDown}
4694
+ />
4695
+ <button
4696
+ type="button"
4697
+ class="link-popover-btn"
4698
+ title="Apply (Enter)"
4699
+ @click=${this._applyLink}
4700
+ >
4701
+ ↵
4702
+ </button>
4703
+ <button
4704
+ type="button"
4705
+ class="link-popover-btn"
4706
+ title="Open link"
4707
+ ?disabled=${!this._linkPopoverHref}
4708
+ @click=${this._openLinkHref}
4709
+ >
4710
+ ↗
4711
+ </button>
4712
+ <button
4713
+ type="button"
4714
+ class="link-popover-btn"
4715
+ title="Remove link"
4716
+ @click=${this._removeLink}
4717
+ >
4718
+ ✕
4719
+ </button>
4720
+ </div>
4721
+ ` : Ye}
4624
4722
  `;
4625
4723
  }
4626
4724
  _setRichViewContent(t) {
4627
4725
  this._$richView && (this._ignoreRichMutations = !0, this._$richView.innerHTML = this._renderMarkdown(t), this._ignoreRichMutations = !1, this._richViewRendered = !0);
4628
4726
  }
4629
4727
  _renderMarkdown(t) {
4630
- const n = $i(t, Mo), r = Gt(t, en), o = [];
4631
- if (gt(r, "code", (l) => {
4728
+ const n = Di(t, Po), r = Xt(t, en), o = [];
4729
+ if (mt(r, "code", (l) => {
4632
4730
  o.push(l.lang ?? null);
4633
- }), o.length === 0) return n;
4731
+ }), o.length === 0)
4732
+ return tn(n);
4634
4733
  const i = new DOMParser().parseFromString(n, "text/html"), a = i.querySelectorAll("pre");
4635
4734
  return o.forEach((l, s) => {
4636
4735
  a[s] && l && (a[s].dataset.lang = l);
4637
- }), i.body.innerHTML;
4736
+ }), tn(i.body.innerHTML);
4638
4737
  }
4639
4738
  _scheduleMarkdownSync() {
4640
4739
  this.sourceMode || (this._syncTimer !== null && clearTimeout(this._syncTimer), this._syncTimer = setTimeout(() => {
@@ -4642,7 +4741,8 @@ const Po = {
4642
4741
  }, 150));
4643
4742
  }
4644
4743
  _syncMarkdownFromRichView() {
4645
- if (!this._$richView || this.sourceMode) return;
4744
+ if (!this._$richView || this.sourceMode)
4745
+ return;
4646
4746
  const t = Pe.turndown(this._$richView.innerHTML);
4647
4747
  t !== this.value && (this._value = t, this._syncNativeTextarea(), this._dispatchChange(t));
4648
4748
  }
@@ -4657,16 +4757,18 @@ const Po = {
4657
4757
  }
4658
4758
  }
4659
4759
  _switchToRich() {
4660
- if (!this._$richView) return;
4760
+ if (!this._$richView)
4761
+ return;
4661
4762
  const t = this._$sourceEditor?.value ?? this.value;
4662
4763
  this._value = t, this._setRichViewContent(t), this._syncNativeTextarea();
4663
4764
  }
4664
4765
  _setupSourcePlugin() {
4665
4766
  this._$sourceEditor.usePlugin({
4666
4767
  mount: (t) => {
4667
- this._pluginApi = t, t.adoptStyleSheet(Rn), t.onCursorMove((n, r) => {
4668
- if (!this.sourceMode) return;
4669
- const o = Ao(t.getDecorations(), n, r), i = o.codeBlock && this._cachedTree ? this._getCodeBlockLanguage(this._cachedTree, n) : null;
4768
+ this._pluginApi = t, t.adoptStyleSheet(Mn), t.onCursorMove((n, r) => {
4769
+ if (!this.sourceMode)
4770
+ return;
4771
+ const o = zo(t.getDecorations(), n, r), i = o.codeBlock && this._cachedTree ? this._getCodeBlockLanguage(this._cachedTree, n) : null;
4670
4772
  this._activeFormats = { ...o, codeLanguage: i }, this._pushToolbarState();
4671
4773
  });
4672
4774
  },
@@ -4674,12 +4776,13 @@ const Po = {
4674
4776
  this._pluginApi = null, this._cachedTree = null;
4675
4777
  },
4676
4778
  update: (t, n) => {
4677
- const r = Gt(t, en), o = [];
4678
- this._cachedTree = r, gt(
4779
+ const r = Xt(t, en), o = [];
4780
+ this._cachedTree = r, mt(
4679
4781
  r,
4680
4782
  (i) => {
4681
4783
  const a = i.position?.start.offset, l = i.position?.end.offset;
4682
- if (a === void 0 || l === void 0) return;
4784
+ if (a === void 0 || l === void 0)
4785
+ return;
4683
4786
  if (i.type === "list") {
4684
4787
  o.push({
4685
4788
  type: "mark",
@@ -4689,8 +4792,9 @@ const Po = {
4689
4792
  });
4690
4793
  return;
4691
4794
  }
4692
- const s = Po[i.type];
4693
- if (!s) return;
4795
+ const s = $o[i.type];
4796
+ if (!s)
4797
+ return;
4694
4798
  const u = { type: "mark", from: a, to: l, ...s };
4695
4799
  i.type === "heading" && i.depth && (u.className = `rme-heading-h${i.depth}`), o.push(u);
4696
4800
  }
@@ -4700,7 +4804,7 @@ const Po = {
4700
4804
  }
4701
4805
  _getCodeBlockLanguage(t, n) {
4702
4806
  let r = null;
4703
- return gt(
4807
+ return mt(
4704
4808
  t,
4705
4809
  "code",
4706
4810
  (o) => {
@@ -4710,12 +4814,20 @@ const Po = {
4710
4814
  ), r;
4711
4815
  }
4712
4816
  _applyRichFormat(t) {
4713
- if (this.readOnly || !this._$richView) return;
4817
+ if (this.readOnly || !this._$richView)
4818
+ return;
4714
4819
  if (this._$richView.focus(), this._$savedRange) {
4715
4820
  const r = window.getSelection();
4716
4821
  r && (r.removeAllRanges(), r.addRange(this._$savedRange.cloneRange()));
4717
4822
  }
4718
- if ((/* @__PURE__ */ new Set(["bold", "italic", "underline", "strikethrough", "code", "link"])).has(t)) {
4823
+ if ((/* @__PURE__ */ new Set([
4824
+ "bold",
4825
+ "italic",
4826
+ "underline",
4827
+ "strikethrough",
4828
+ "code",
4829
+ "link"
4830
+ ])).has(t)) {
4719
4831
  this._expandRichSelectionToWord();
4720
4832
  const r = window.getSelection();
4721
4833
  r?.rangeCount && (this._$savedRange = r.getRangeAt(0).cloneRange());
@@ -4759,7 +4871,8 @@ const Po = {
4759
4871
  }
4760
4872
  _applySourceFormat(t) {
4761
4873
  const n = this._$sourceEditor, r = this._pluginApi;
4762
- if (!n) return;
4874
+ if (!n)
4875
+ return;
4763
4876
  const i = {
4764
4877
  bold: ["**", "**"],
4765
4878
  italic: ["*", "*"],
@@ -4810,31 +4923,33 @@ const Po = {
4810
4923
  /** Sets the heading level on the cursor's line in source mode. null = paragraph. */
4811
4924
  _setSourceHeadingLevel(t) {
4812
4925
  const n = this._pluginApi, r = this._$sourceEditor;
4813
- if (!n || !r) return;
4926
+ if (!n || !r)
4927
+ return;
4814
4928
  const { value: o, selectionStart: i } = n, a = o.lastIndexOf(`
4815
4929
  `, i - 1) + 1, l = o.slice(a).replace(/^#{1,6} /, ""), s = t ? "#".repeat(parseInt(t[1])) + " " : "";
4816
- r.value = o.slice(0, a) + s + l + o.slice(
4817
- a + (o.slice(a).length - l.length)
4818
- );
4930
+ r.value = o.slice(0, a) + s + l + o.slice(a + (o.slice(a).length - l.length));
4819
4931
  }
4820
4932
  /** Updates the language of the code block at the cursor in source mode. */
4821
4933
  _setSourceCodeBlockLanguage(t) {
4822
4934
  const n = this._pluginApi, r = this._$sourceEditor;
4823
- if (!n || !r) return;
4935
+ if (!n || !r)
4936
+ return;
4824
4937
  const o = Bo(n.value, n.selectionStart, t);
4825
4938
  o !== null && (r.value = o);
4826
4939
  }
4827
4940
  /** Updates the `data-lang` attribute on the `<pre>` at the cursor in rich mode. */
4828
4941
  _setRichCodeBlockLanguage(t) {
4829
4942
  const n = window.getSelection();
4830
- if (!n || n.rangeCount === 0) return;
4943
+ if (!n || n.rangeCount === 0)
4944
+ return;
4831
4945
  const r = n.getRangeAt(0).commonAncestorContainer, i = (r.nodeType === Node.TEXT_NODE ? r.parentElement : r)?.closest("pre");
4832
4946
  i && (t ? i.dataset.lang = t : delete i.dataset.lang);
4833
4947
  }
4834
4948
  /** Toggles a line prefix (e.g. `'> '`, `'- '`) on the cursor's line. */
4835
4949
  _toggleLinePrefix(t) {
4836
4950
  const n = this._pluginApi, r = this._$sourceEditor;
4837
- if (!n || !r) return;
4951
+ if (!n || !r)
4952
+ return;
4838
4953
  const { value: o, selectionStart: i } = n, a = o.lastIndexOf(`
4839
4954
  `, i - 1) + 1;
4840
4955
  o.startsWith(t, a) ? r.value = o.slice(0, a) + o.slice(a + t.length) : r.value = o.slice(0, a) + t + o.slice(a);
@@ -4842,28 +4957,31 @@ const Po = {
4842
4957
  /** Wraps the current selection (or cursor line) with a fenced code block. */
4843
4958
  _toggleSourceCodeFence() {
4844
4959
  const t = this._pluginApi, n = this._$sourceEditor;
4845
- if (!t || !n) return;
4960
+ if (!t || !n)
4961
+ return;
4846
4962
  const { value: r, selectionStart: o, selectionEnd: i } = t, a = "```", l = r.lastIndexOf(`
4847
4963
  `, o - 1) + 1, s = r.indexOf(`
4848
4964
  `, i), u = s === -1 ? r.length : s, f = r.lastIndexOf(`
4849
4965
  `, l - 2), p = f === -1 ? "" : r.slice(f + 1, l - 1), g = u + 1, c = r.indexOf(`
4850
4966
  `, g), b = r.slice(g, c === -1 ? void 0 : c);
4851
4967
  if (p.trim() === a && b.trim() === a) {
4852
- const z = f === -1 ? 0 : f + 1, x = c === -1 ? r.length : c + 1, _ = r.slice(l, u);
4853
- n.value = r.slice(0, z) + _ + `
4968
+ const A = f === -1 ? 0 : f + 1, x = c === -1 ? r.length : c + 1, v = r.slice(l, u);
4969
+ n.value = r.slice(0, A) + v + `
4854
4970
  ` + r.slice(x);
4855
4971
  return;
4856
4972
  }
4857
- const v = r.slice(l, u);
4973
+ const w = r.slice(l, u);
4858
4974
  n.value = r.slice(0, l) + a + `
4859
- ` + v + `
4975
+ ` + w + `
4860
4976
  ` + a + r.slice(u);
4861
4977
  }
4862
4978
  _wrapRichSelection(t) {
4863
4979
  const n = window.getSelection();
4864
- if (!n || n.rangeCount === 0) return;
4980
+ if (!n || n.rangeCount === 0)
4981
+ return;
4865
4982
  const r = n.getRangeAt(0);
4866
- if (r.collapsed) return;
4983
+ if (r.collapsed)
4984
+ return;
4867
4985
  const o = document.createElement(t);
4868
4986
  try {
4869
4987
  r.surroundContents(o);
@@ -4875,7 +4993,8 @@ const Po = {
4875
4993
  }
4876
4994
  _toggleRichCodeBlock() {
4877
4995
  const t = window.getSelection();
4878
- if (!t || t.rangeCount === 0) return;
4996
+ if (!t || t.rangeCount === 0)
4997
+ return;
4879
4998
  const n = t.getRangeAt(0), r = n.commonAncestorContainer, o = r.nodeType === Node.TEXT_NODE ? r.parentElement : r, i = o?.closest("pre");
4880
4999
  if (i) {
4881
5000
  const u = document.createElement("p");
@@ -4897,11 +5016,13 @@ const Po = {
4897
5016
  }
4898
5017
  _pushToolbarState() {
4899
5018
  const t = this._$toolbar;
4900
- t && (t.activeBold = !!this._activeFormats.bold, t.activeItalic = !!this._activeFormats.italic, t.activeUnderline = !!this._activeFormats.underline, t.activeStrikethrough = !!this._activeFormats.strikethrough, t.activeCode = !!this._activeFormats.code, t.activeLink = !!this._activeFormats.link, t.activeHeading = this._activeFormats.heading ?? null, t.activeBlockquote = !!this._activeFormats.blockquote, t.activeBulletList = !!this._activeFormats.bulletList, t.activeOrderedList = !!this._activeFormats.orderedList, t.activeCodeBlock = !!this._activeFormats.codeBlock, t.codeLanguage = this._activeFormats.codeLanguage ?? null, t.sourceMode = this.sourceMode), this.dispatchEvent(new CustomEvent("rc-formatting-change", {
4901
- bubbles: !0,
4902
- composed: !0,
4903
- detail: { ...this._activeFormats }
4904
- }));
5019
+ t && (t.activeBold = !!this._activeFormats.bold, t.activeItalic = !!this._activeFormats.italic, t.activeUnderline = !!this._activeFormats.underline, t.activeStrikethrough = !!this._activeFormats.strikethrough, t.activeCode = !!this._activeFormats.code, t.activeLink = !!this._activeFormats.link, t.activeHeading = this._activeFormats.heading ?? null, t.activeBlockquote = !!this._activeFormats.blockquote, t.activeBulletList = !!this._activeFormats.bulletList, t.activeOrderedList = !!this._activeFormats.orderedList, t.activeCodeBlock = !!this._activeFormats.codeBlock, t.codeLanguage = this._activeFormats.codeLanguage ?? null, t.sourceMode = this.sourceMode), this.dispatchEvent(
5020
+ new CustomEvent("rc-formatting-change", {
5021
+ bubbles: !0,
5022
+ composed: !0,
5023
+ detail: { ...this._activeFormats }
5024
+ })
5025
+ );
4905
5026
  }
4906
5027
  _syncNativeTextarea() {
4907
5028
  const t = this.querySelector("textarea");
@@ -4909,77 +5030,87 @@ const Po = {
4909
5030
  }
4910
5031
  _connectLabel() {
4911
5032
  const t = this.querySelector("textarea");
4912
- if (!t) return;
5033
+ if (!t)
5034
+ return;
4913
5035
  const n = t.id ? this.querySelector(`label[for="${CSS.escape(t.id)}"]`) : null;
4914
5036
  n && this._$richView && this._$richView.setAttribute("aria-label", n.textContent?.trim() ?? ""), n?.addEventListener("click", () => {
4915
- this.sourceMode || this._$richView?.focus();
5037
+ this.sourceMode ? this._$sourceEditor?.focus() : this._$richView?.focus();
4916
5038
  });
4917
5039
  }
4918
5040
  _expandRichSelectionToWord() {
4919
5041
  const t = window.getSelection();
4920
- if (!t?.isCollapsed) return;
5042
+ if (!t?.isCollapsed)
5043
+ return;
4921
5044
  const n = t.modify;
4922
5045
  typeof n == "function" && (n.call(t, "move", "backward", "word"), n.call(t, "extend", "forward", "word"));
4923
5046
  }
4924
5047
  _positionLinkPopover() {
4925
- if (!this._$savedRange || !this._$linkPopover) return;
5048
+ if (!this._$savedRange || !this._$linkPopover)
5049
+ return;
4926
5050
  const t = this._$savedRange.getBoundingClientRect(), n = this.getBoundingClientRect();
4927
5051
  this._$linkPopover.style.top = `${t.bottom - n.top + 4}px`, this._$linkPopover.style.left = `${Math.max(0, t.left - n.left)}px`;
4928
5052
  }
4929
5053
  _dispatchChange(t) {
4930
- this.dispatchEvent(new CustomEvent("rc-change", {
4931
- bubbles: !0,
4932
- composed: !0,
4933
- detail: { value: t }
4934
- }));
5054
+ this.dispatchEvent(
5055
+ new CustomEvent("rc-change", {
5056
+ bubbles: !0,
5057
+ composed: !0,
5058
+ detail: { value: t }
5059
+ })
5060
+ );
4935
5061
  }
4936
5062
  _dispatchModeChange(t) {
4937
- this.dispatchEvent(new CustomEvent("rc-mode-change", {
4938
- bubbles: !0,
4939
- composed: !0,
4940
- detail: { mode: t }
4941
- }));
5063
+ this.dispatchEvent(
5064
+ new CustomEvent("rc-mode-change", {
5065
+ bubbles: !0,
5066
+ composed: !0,
5067
+ detail: { mode: t }
5068
+ })
5069
+ );
4942
5070
  }
4943
5071
  };
4944
- Bt.styles = zo;
4945
- let ne = Bt;
4946
- he([
4947
- j({ type: String, attribute: "default-value" })
4948
- ], ne.prototype, "defaultValue", 1);
4949
- he([
4950
- j({ type: Boolean, attribute: "default-source-mode" })
4951
- ], ne.prototype, "defaultSourceMode", 1);
4952
- he([
4953
- j({ type: Boolean, reflect: !0, attribute: "source-mode" })
4954
- ], ne.prototype, "sourceMode", 1);
4955
- he([
4956
- j({ type: Boolean, reflect: !0 })
4957
- ], ne.prototype, "toolbar", 2);
4958
- he([
4959
- j({ type: Boolean, reflect: !0, attribute: "read-only" })
4960
- ], ne.prototype, "readOnly", 2);
4961
- he([
5072
+ Bt.styles = Ro;
5073
+ let Z = Bt;
5074
+ se([
5075
+ U({ type: String, attribute: "default-value" })
5076
+ ], Z.prototype, "defaultValue", 1);
5077
+ se([
5078
+ U({ type: String })
5079
+ ], Z.prototype, "value", 1);
5080
+ se([
5081
+ U({ type: Boolean, attribute: "default-source-mode" })
5082
+ ], Z.prototype, "defaultSourceMode", 1);
5083
+ se([
5084
+ U({ type: Boolean, reflect: !0, attribute: "source-mode" })
5085
+ ], Z.prototype, "sourceMode", 1);
5086
+ se([
5087
+ U({ type: Boolean, reflect: !0 })
5088
+ ], Z.prototype, "toolbar", 2);
5089
+ se([
5090
+ U({ type: Boolean, reflect: !0, attribute: "read-only" })
5091
+ ], Z.prototype, "readOnly", 2);
5092
+ se([
4962
5093
  $e("#rich-view")
4963
- ], ne.prototype, "_$richView", 2);
4964
- he([
5094
+ ], Z.prototype, "_$richView", 2);
5095
+ se([
4965
5096
  $e("#source-editor")
4966
- ], ne.prototype, "_$sourceEditor", 2);
4967
- he([
5097
+ ], Z.prototype, "_$sourceEditor", 2);
5098
+ se([
4968
5099
  $e("rc-editor-toolbar")
4969
- ], ne.prototype, "_$toolbar", 2);
4970
- he([
5100
+ ], Z.prototype, "_$toolbar", 2);
5101
+ se([
4971
5102
  $e(".link-popover")
4972
- ], ne.prototype, "_$linkPopover", 2);
4973
- he([
5103
+ ], Z.prototype, "_$linkPopover", 2);
5104
+ se([
4974
5105
  $e(".link-popover-input")
4975
- ], ne.prototype, "_$linkPopoverInput", 2);
4976
- he([
4977
- wt()
4978
- ], ne.prototype, "_linkPopoverOpen", 2);
4979
- he([
4980
- wt()
4981
- ], ne.prototype, "_linkPopoverHref", 2);
4982
- const me = (e) => ce`
5106
+ ], Z.prototype, "_$linkPopoverInput", 2);
5107
+ se([
5108
+ _t()
5109
+ ], Z.prototype, "_linkPopoverOpen", 2);
5110
+ se([
5111
+ _t()
5112
+ ], Z.prototype, "_linkPopoverHref", 2);
5113
+ const me = (e) => he`
4983
5114
  <svg
4984
5115
  viewBox="0 0 16 16"
4985
5116
  width="1em"
@@ -4988,43 +5119,43 @@ const me = (e) => ce`
4988
5119
  focusable="false"
4989
5120
  >${e}</svg>
4990
5121
  `, ke = {
4991
- bold: me(ce`
5122
+ bold: me(he`
4992
5123
  <path fill="currentColor" d="M8.21 13c2.106 0 3.412-1.087 3.412-2.823c0-1.306-.984-2.283-2.324-2.386v-.055a2.176 2.176 0 0 0 1.852-2.14c0-1.51-1.162-2.46-3.014-2.46H3.843V13zM5.908 4.674h1.696c.963 0 1.517.451 1.517 1.244c0 .834-.629 1.32-1.73 1.32H5.908V4.673zm0 6.788V8.598h1.73c1.217 0 1.88.492 1.88 1.415c0 .943-.643 1.449-1.832 1.449H5.907z"/>
4993
5124
  `),
4994
- italic: me(ce`
5125
+ italic: me(he`
4995
5126
  <path fill="currentColor" d="M7.991 11.674L9.53 4.455c.123-.595.246-.71 1.347-.807l.11-.52H7.211l-.11.52c1.06.096 1.128.212 1.005.807L6.57 11.674c-.123.595-.246.71-1.346.806l-.11.52h3.774l.11-.52c-1.06-.095-1.129-.211-1.006-.806z"/>
4996
5127
  `),
4997
- underline: me(ce`
5128
+ underline: me(he`
4998
5129
  <path fill="currentColor" d="M5.313 3.136h-1.23V9.54c0 2.105 1.47 3.623 3.917 3.623s3.917-1.518 3.917-3.623V3.136h-1.23v6.323c0 1.49-.978 2.57-2.687 2.57s-2.687-1.08-2.687-2.57zM12.5 15h-9v-1h9z"/>
4999
5130
  `),
5000
- strikethrough: me(ce`
5131
+ strikethrough: me(he`
5001
5132
  <path fill="currentColor" d="M6.333 5.686c0 .31.083.581.27.814H5.166a2.8 2.8 0 0 1-.099-.76c0-1.627 1.436-2.768 3.48-2.768c1.969 0 3.39 1.175 3.445 2.85h-1.23c-.11-1.08-.964-1.743-2.25-1.743c-1.23 0-2.18.602-2.18 1.607zm2.194 7.478c-2.153 0-3.589-1.107-3.705-2.81h1.23c.144 1.06 1.129 1.703 2.544 1.703c1.34 0 2.31-.705 2.31-1.675c0-.827-.547-1.374-1.914-1.675L8.046 8.5H1v-1h14v1h-3.504c.468.437.675.994.675 1.697c0 1.826-1.436 2.967-3.644 2.967"/>
5002
5133
  `),
5003
- code: me(ce`
5134
+ code: me(he`
5004
5135
  <path fill="currentColor" d="M5.854 4.854a.5.5 0 1 0-.708-.708l-3.5 3.5a.5.5 0 0 0 0 .708l3.5 3.5a.5.5 0 0 0 .708-.708L2.707 8zm4.292 0a.5.5 0 0 1 .708-.708l3.5 3.5a.5.5 0 0 1 0 .708l-3.5 3.5a.5.5 0 0 1-.708-.708L13.293 8z"/>
5005
5136
  `),
5006
- link: me(ce`
5137
+ link: me(he`
5007
5138
  <g fill="currentColor">
5008
5139
  <path d="M4.715 6.542L3.343 7.914a3 3 0 1 0 4.243 4.243l1.828-1.829A3 3 0 0 0 8.586 5.5L8 6.086a1 1 0 0 0-.154.199a2 2 0 0 1 .861 3.337L6.88 11.45a2 2 0 1 1-2.83-2.83l.793-.792a4 4 0 0 1-.128-1.287z"/>
5009
5140
  <path d="M6.586 4.672A3 3 0 0 0 7.414 9.5l.775-.776a2 2 0 0 1-.896-3.346L9.12 3.55a2 2 0 1 1 2.83 2.83l-.793.792c.112.42.155.855.128 1.287l1.372-1.372a3 3 0 1 0-4.243-4.243z"/>
5010
5141
  </g>
5011
5142
  `),
5012
- blockquote: me(ce`
5143
+ blockquote: me(he`
5013
5144
  <path fill="currentColor" d="M2.5 3a.5.5 0 0 0 0 1h11a.5.5 0 0 0 0-1zm5 3a.5.5 0 0 0 0 1h6a.5.5 0 0 0 0-1zm0 3a.5.5 0 0 0 0 1h6a.5.5 0 0 0 0-1zm-5 3a.5.5 0 0 0 0 1h11a.5.5 0 0 0 0-1zm.79-5.373q.168-.117.444-.275L3.524 6q-.183.111-.452.287q-.27.176-.51.428a2.4 2.4 0 0 0-.398.562Q2 7.587 2 7.969q0 .54.217.873q.217.328.72.328q.322 0 .504-.211a.7.7 0 0 0 .188-.463q0-.345-.211-.521q-.205-.182-.568-.182h-.282q.036-.305.123-.498a1.4 1.4 0 0 1 .252-.37a2 2 0 0 1 .346-.298zm2.167 0q.17-.117.445-.275L5.692 6q-.183.111-.452.287q-.27.176-.51.428a2.4 2.4 0 0 0-.398.562q-.165.31-.164.692q0 .54.217.873q.217.328.72.328q.322 0 .504-.211a.7.7 0 0 0 .188-.463q0-.345-.211-.521q-.205-.182-.568-.182h-.282a1.8 1.8 0 0 1 .118-.492q.087-.194.257-.375a2 2 0 0 1 .346-.3z"/>
5014
5145
  `),
5015
- bulletList: me(ce`
5146
+ bulletList: me(he`
5016
5147
  <path fill="currentColor" fill-rule="evenodd" d="M5 11.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5m-3 1a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 4a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 4a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/>
5017
5148
  `),
5018
- orderedList: me(ce`
5149
+ orderedList: me(he`
5019
5150
  <g fill="currentColor">
5020
5151
  <path fill-rule="evenodd" d="M5 11.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5"/>
5021
5152
  <path d="M1.713 11.865v-.474H2c.217 0 .363-.137.363-.317c0-.185-.158-.31-.361-.31c-.223 0-.367.152-.373.31h-.59c.016-.467.373-.787.986-.787c.588-.002.954.291.957.703a.595.595 0 0 1-.492.594v.033a.615.615 0 0 1 .569.631c.003.533-.502.8-1.051.8c-.656 0-1-.37-1.008-.794h.582c.008.178.186.306.422.309c.254 0 .424-.145.422-.35c-.002-.195-.155-.348-.414-.348h-.3zm-.004-4.699h-.604v-.035c0-.408.295-.844.958-.844c.583 0 .96.326.96.756c0 .389-.257.617-.476.848l-.537.572v.03h1.054V9H1.143v-.395l.957-.99c.138-.142.293-.304.293-.508c0-.18-.147-.32-.342-.32a.33.33 0 0 0-.342.338zM2.564 5h-.635V2.924h-.031l-.598.42v-.567l.629-.443h.635z"/>
5022
5153
  </g>
5023
5154
  `),
5024
- codeBlock: me(ce`
5155
+ codeBlock: me(he`
5025
5156
  <path fill="currentColor" d="M2.114 8.063V7.9c1.005-.102 1.497-.615 1.497-1.6V4.503c0-1.094.39-1.538 1.354-1.538h.273V2h-.376C3.25 2 2.49 2.759 2.49 4.352v1.524c0 1.094-.376 1.456-1.49 1.456v1.299c1.114 0 1.49.362 1.49 1.456v1.524c0 1.593.759 2.352 2.372 2.352h.376v-.964h-.273c-.964 0-1.354-.444-1.354-1.538V9.663c0-.984-.492-1.497-1.497-1.6M13.886 7.9v.163c-1.005.103-1.497.616-1.497 1.6v1.798c0 1.094-.39 1.538-1.354 1.538h-.273v.964h.376c1.613 0 2.372-.759 2.372-2.352v-1.524c0-1.094.376-1.456 1.49-1.456V7.332c-1.114 0-1.49-.362-1.49-1.456V4.352C13.51 2.759 12.75 2 11.138 2h-.376v.964h.273c.964 0 1.354.444 1.354 1.538V6.3c0 .984.492 1.497 1.497 1.6"/>
5026
5157
  `),
5027
- source: me(ce`
5158
+ source: me(he`
5028
5159
  <g fill="currentColor">
5029
5160
  <path d="M14 3a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zM2 2a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2z"/>
5030
5161
  <path fill-rule="evenodd" d="M9.146 8.146a.5.5 0 0 1 .708 0L11.5 9.793l1.646-1.647a.5.5 0 0 1 .708.708l-2 2a.5.5 0 0 1-.708 0l-2-2a.5.5 0 0 1 0-.708"/>
@@ -5033,12 +5164,12 @@ const me = (e) => ce`
5033
5164
  </g>
5034
5165
  `)
5035
5166
  };
5036
- var Oo = Object.defineProperty, Z = (e, t, n, r) => {
5167
+ var Do = Object.defineProperty, J = (e, t, n, r) => {
5037
5168
  for (var o = void 0, i = e.length - 1, a; i >= 0; i--)
5038
5169
  (a = e[i]) && (o = a(t, n, o) || o);
5039
- return o && Oo(t, n, o), o;
5170
+ return o && Do(t, n, o), o;
5040
5171
  };
5041
- const No = [
5172
+ const Ho = [
5042
5173
  { value: "p", label: "Paragraph" },
5043
5174
  { value: "h1", label: "Heading 1" },
5044
5175
  { value: "h2", label: "Heading 2" },
@@ -5047,7 +5178,7 @@ const No = [
5047
5178
  { value: "h5", label: "Heading 5" },
5048
5179
  { value: "h6", label: "Heading 6" }
5049
5180
  ];
5050
- class J extends tn {
5181
+ class ee extends nn {
5051
5182
  constructor() {
5052
5183
  super(...arguments), this.label = "Formatting", this.activeBold = !1, this.activeItalic = !1, this.activeUnderline = !1, this.activeStrikethrough = !1, this.activeCode = !1, this.activeLink = !1, this.activeHeading = null, this.activeBlockquote = !1, this.activeBulletList = !1, this.activeOrderedList = !1, this.activeCodeBlock = !1, this.codeLanguage = null, this.sourceMode = !1, this._langInputValue = "", this._onClick = (t) => {
5053
5184
  const n = t.target.closest("button[data-action]");
@@ -5078,34 +5209,54 @@ class J extends tn {
5078
5209
  })
5079
5210
  );
5080
5211
  }
5212
+ _renderActionButton(t, n, r, o, i) {
5213
+ return Me`
5214
+ <rc-button icon-only class=${o ? "toolbar-active" : Ye}>
5215
+ <button
5216
+ type="button"
5217
+ data-action=${t}
5218
+ title=${r}
5219
+ aria-label=${n}
5220
+ aria-pressed=${String(o)}
5221
+ >
5222
+ <span data-rc-button-icon>${i}</span>
5223
+ </button>
5224
+ </rc-button>
5225
+ `;
5226
+ }
5081
5227
  render() {
5082
- const t = (n) => String(n);
5083
5228
  return Me`
5084
- <div role="toolbar" aria-label=${this.label} @click=${this._onClick}>
5085
-
5086
- <button type="button" data-action="bold"
5087
- title="Bold (Ctrl+B)" aria-label="Bold" aria-pressed=${t(this.activeBold)}
5088
- >${ke.bold}</button>
5089
-
5090
- <button type="button" data-action="italic"
5091
- title="Italic (Ctrl+I)" aria-label="Italic" aria-pressed=${t(this.activeItalic)}
5092
- >${ke.italic}</button>
5093
-
5094
- <button type="button" data-action="underline"
5095
- title="Underline (Ctrl+U)" aria-label="Underline" aria-pressed=${t(this.activeUnderline)}
5096
- >${ke.underline}</button>
5097
-
5098
- <button type="button" data-action="strikethrough"
5099
- title="Strikethrough" aria-label="Strikethrough" aria-pressed=${t(this.activeStrikethrough)}
5100
- >${ke.strikethrough}</button>
5101
-
5102
- <button type="button" data-action="code"
5103
- title="Inline Code (Ctrl+\`)" aria-label="Inline Code" aria-pressed=${t(this.activeCode)}
5104
- >${ke.code}</button>
5105
-
5106
- <button type="button" data-action="link"
5107
- title="Link (Ctrl+K)" aria-label="Link" aria-pressed=${t(this.activeLink)}
5108
- >${ke.link}</button>
5229
+ <rc-toolbar label=${this.label} @click=${this._onClick}>
5230
+ ${this._renderActionButton("bold", "Bold", "Bold (Ctrl+B)", this.activeBold, ke.bold)}
5231
+ ${this._renderActionButton(
5232
+ "italic",
5233
+ "Italic",
5234
+ "Italic (Ctrl+I)",
5235
+ this.activeItalic,
5236
+ ke.italic
5237
+ )}
5238
+ ${this._renderActionButton(
5239
+ "underline",
5240
+ "Underline",
5241
+ "Underline (Ctrl+U)",
5242
+ this.activeUnderline,
5243
+ ke.underline
5244
+ )}
5245
+ ${this._renderActionButton(
5246
+ "strikethrough",
5247
+ "Strikethrough",
5248
+ "Strikethrough",
5249
+ this.activeStrikethrough,
5250
+ ke.strikethrough
5251
+ )}
5252
+ ${this._renderActionButton(
5253
+ "code",
5254
+ "Inline Code",
5255
+ "Inline Code (Ctrl+`)",
5256
+ this.activeCode,
5257
+ ke.code
5258
+ )}
5259
+ ${this._renderActionButton("link", "Link", "Link (Ctrl+K)", this.activeLink, ke.link)}
5109
5260
 
5110
5261
  <rc-select
5111
5262
  title="Heading level"
@@ -5115,99 +5266,112 @@ class J extends tn {
5115
5266
  @rc-select-change=${this._onHeadingChange}
5116
5267
  >
5117
5268
  <select aria-label="Heading level">
5118
- ${No.map(({ value: n, label: r }) => Me`
5119
- <option value=${n}>${r}</option>
5120
- `)}
5269
+ ${Ho.map(
5270
+ ({ value: t, label: n }) => Me` <option value=${t}>${n}</option> `
5271
+ )}
5121
5272
  </select>
5122
5273
  </rc-select>
5123
5274
 
5124
- <button type="button" data-action="blockquote"
5125
- title="Blockquote" aria-label="Blockquote" aria-pressed=${t(this.activeBlockquote)}
5126
- >${ke.blockquote}</button>
5127
-
5128
- <button type="button" data-action="bullet-list"
5129
- title="Bullet List" aria-label="Bullet List" aria-pressed=${t(this.activeBulletList)}
5130
- >${ke.bulletList}</button>
5131
-
5132
- <button type="button" data-action="ordered-list"
5133
- title="Ordered List" aria-label="Ordered List" aria-pressed=${t(this.activeOrderedList)}
5134
- >${ke.orderedList}</button>
5135
-
5136
- <button type="button" data-action="code-block"
5137
- title="Code Block" aria-label="Code Block" aria-pressed=${t(this.activeCodeBlock)}
5138
- >${ke.codeBlock}</button>
5139
-
5275
+ ${this._renderActionButton(
5276
+ "blockquote",
5277
+ "Blockquote",
5278
+ "Blockquote",
5279
+ this.activeBlockquote,
5280
+ ke.blockquote
5281
+ )}
5282
+ ${this._renderActionButton(
5283
+ "bullet-list",
5284
+ "Bullet List",
5285
+ "Bullet List",
5286
+ this.activeBulletList,
5287
+ ke.bulletList
5288
+ )}
5289
+ ${this._renderActionButton(
5290
+ "ordered-list",
5291
+ "Ordered List",
5292
+ "Ordered List",
5293
+ this.activeOrderedList,
5294
+ ke.orderedList
5295
+ )}
5296
+ ${this._renderActionButton(
5297
+ "code-block",
5298
+ "Code Block",
5299
+ "Code Block",
5300
+ this.activeCodeBlock,
5301
+ ke.codeBlock
5302
+ )}
5140
5303
  ${this.activeCodeBlock && this.codeLanguage !== null ? Me`
5141
- <input
5142
- type="text"
5143
- class="lang-input"
5144
- aria-label="Code block language"
5145
- placeholder="Language"
5146
- title="Syntax language (e.g. TypeScript, Rust)"
5147
- .value=${this._langInputValue}
5148
- @input=${this._onLangInput}
5149
- @blur=${this._onLangCommit}
5150
- @keydown=${this._onLangKeyDown}
5151
- @click=${(n) => n.stopPropagation()}
5152
- />
5153
- ` : mt}
5154
-
5155
- <button type="button" data-action="source"
5156
- title="Toggle Markdown Source (Ctrl+Shift+S)" aria-label="Source Mode"
5157
- aria-pressed=${t(this.sourceMode)}
5158
- >${ke.source}</button>
5159
-
5160
- </div>
5304
+ <input
5305
+ type="text"
5306
+ class="lang-input"
5307
+ aria-label="Code block language"
5308
+ placeholder="Language"
5309
+ title="Syntax language (e.g. TypeScript, Rust)"
5310
+ .value=${this._langInputValue}
5311
+ @input=${this._onLangInput}
5312
+ @blur=${this._onLangCommit}
5313
+ @keydown=${this._onLangKeyDown}
5314
+ @click=${(t) => t.stopPropagation()}
5315
+ />
5316
+ ` : Ye}
5317
+ ${this._renderActionButton(
5318
+ "source",
5319
+ "Source Mode",
5320
+ "Toggle Markdown Source (Ctrl+Shift+S)",
5321
+ this.sourceMode,
5322
+ ke.source
5323
+ )}
5324
+ </rc-toolbar>
5161
5325
  `;
5162
5326
  }
5163
5327
  }
5164
- Z([
5165
- j({ type: String })
5166
- ], J.prototype, "label");
5167
- Z([
5168
- j({ type: Boolean, reflect: !0, attribute: "active-bold" })
5169
- ], J.prototype, "activeBold");
5170
- Z([
5171
- j({ type: Boolean, reflect: !0, attribute: "active-italic" })
5172
- ], J.prototype, "activeItalic");
5173
- Z([
5174
- j({ type: Boolean, reflect: !0, attribute: "active-underline" })
5175
- ], J.prototype, "activeUnderline");
5176
- Z([
5177
- j({ type: Boolean, reflect: !0, attribute: "active-strikethrough" })
5178
- ], J.prototype, "activeStrikethrough");
5179
- Z([
5180
- j({ type: Boolean, reflect: !0, attribute: "active-code" })
5181
- ], J.prototype, "activeCode");
5182
- Z([
5183
- j({ type: Boolean, reflect: !0, attribute: "active-link" })
5184
- ], J.prototype, "activeLink");
5185
- Z([
5186
- j({ attribute: "active-heading" })
5187
- ], J.prototype, "activeHeading");
5188
- Z([
5189
- j({ type: Boolean, reflect: !0, attribute: "active-blockquote" })
5190
- ], J.prototype, "activeBlockquote");
5191
- Z([
5192
- j({ type: Boolean, reflect: !0, attribute: "active-bullet-list" })
5193
- ], J.prototype, "activeBulletList");
5194
- Z([
5195
- j({ type: Boolean, reflect: !0, attribute: "active-ordered-list" })
5196
- ], J.prototype, "activeOrderedList");
5197
- Z([
5198
- j({ type: Boolean, reflect: !0, attribute: "active-code-block" })
5199
- ], J.prototype, "activeCodeBlock");
5200
- Z([
5201
- j({ attribute: "code-language" })
5202
- ], J.prototype, "codeLanguage");
5203
- Z([
5204
- j({ type: Boolean, reflect: !0, attribute: "source-mode" })
5205
- ], J.prototype, "sourceMode");
5206
- Z([
5207
- wt()
5208
- ], J.prototype, "_langInputValue");
5328
+ J([
5329
+ U({ type: String })
5330
+ ], ee.prototype, "label");
5331
+ J([
5332
+ U({ type: Boolean, reflect: !0, attribute: "active-bold" })
5333
+ ], ee.prototype, "activeBold");
5334
+ J([
5335
+ U({ type: Boolean, reflect: !0, attribute: "active-italic" })
5336
+ ], ee.prototype, "activeItalic");
5337
+ J([
5338
+ U({ type: Boolean, reflect: !0, attribute: "active-underline" })
5339
+ ], ee.prototype, "activeUnderline");
5340
+ J([
5341
+ U({ type: Boolean, reflect: !0, attribute: "active-strikethrough" })
5342
+ ], ee.prototype, "activeStrikethrough");
5343
+ J([
5344
+ U({ type: Boolean, reflect: !0, attribute: "active-code" })
5345
+ ], ee.prototype, "activeCode");
5346
+ J([
5347
+ U({ type: Boolean, reflect: !0, attribute: "active-link" })
5348
+ ], ee.prototype, "activeLink");
5349
+ J([
5350
+ U({ attribute: "active-heading" })
5351
+ ], ee.prototype, "activeHeading");
5352
+ J([
5353
+ U({ type: Boolean, reflect: !0, attribute: "active-blockquote" })
5354
+ ], ee.prototype, "activeBlockquote");
5355
+ J([
5356
+ U({ type: Boolean, reflect: !0, attribute: "active-bullet-list" })
5357
+ ], ee.prototype, "activeBulletList");
5358
+ J([
5359
+ U({ type: Boolean, reflect: !0, attribute: "active-ordered-list" })
5360
+ ], ee.prototype, "activeOrderedList");
5361
+ J([
5362
+ U({ type: Boolean, reflect: !0, attribute: "active-code-block" })
5363
+ ], ee.prototype, "activeCodeBlock");
5364
+ J([
5365
+ U({ attribute: "code-language" })
5366
+ ], ee.prototype, "codeLanguage");
5367
+ J([
5368
+ U({ type: Boolean, reflect: !0, attribute: "source-mode" })
5369
+ ], ee.prototype, "sourceMode");
5370
+ J([
5371
+ _t()
5372
+ ], ee.prototype, "_langInputValue");
5209
5373
  export {
5210
- J as R,
5211
- ne as a
5374
+ ee as R,
5375
+ Z as a
5212
5376
  };
5213
- //# sourceMappingURL=rc-editor-toolbar-CcTLdYIt.js.map
5377
+ //# sourceMappingURL=rc-editor-toolbar-QnCEnJ2R.js.map