drizzle-cube 0.4.26 → 0.4.28

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.
Files changed (25) hide show
  1. package/dist/client/charts.js +1 -1
  2. package/dist/client/chunks/{analysis-builder-C2jqaLZs.js → analysis-builder-DMFoAkjT.js} +5 -5
  3. package/dist/client/chunks/{analysis-builder-C2jqaLZs.js.map → analysis-builder-DMFoAkjT.js.map} +1 -1
  4. package/dist/client/chunks/{analysis-builder-shared-Bz9oSywd.js → analysis-builder-shared-CunrT3gi.js} +2 -2
  5. package/dist/client/chunks/{analysis-builder-shared-Bz9oSywd.js.map → analysis-builder-shared-CunrT3gi.js.map} +1 -1
  6. package/dist/client/chunks/chart-markdown-BT_-MBq1.js +2721 -0
  7. package/dist/client/chunks/chart-markdown-BT_-MBq1.js.map +1 -0
  8. package/dist/client/chunks/{charts-loader-Bv-IWHVd.js → charts-loader-goTYnavu.js} +2 -2
  9. package/dist/client/chunks/{charts-loader-Bv-IWHVd.js.map → charts-loader-goTYnavu.js.map} +1 -1
  10. package/dist/client/chunks/{components-CPqnw8o8.js → components-BFgYvFq6.js} +4 -4
  11. package/dist/client/chunks/{components-CPqnw8o8.js.map → components-BFgYvFq6.js.map} +1 -1
  12. package/dist/client/chunks/schema-visualization-B97a1Ybu.js +772 -0
  13. package/dist/client/chunks/schema-visualization-B97a1Ybu.js.map +1 -0
  14. package/dist/client/components/SchemaVisualization/CubeNode.d.ts +12 -1
  15. package/dist/client/components/SchemaVisualization/FieldDetailPanel.d.ts +15 -0
  16. package/dist/client/components/SchemaVisualization/xyflowContext.d.ts +11 -0
  17. package/dist/client/components.js +1 -1
  18. package/dist/client/index.js +43 -43
  19. package/dist/client/styles.css +1 -1
  20. package/dist/client-bundle-stats.html +1 -1
  21. package/package.json +2 -2
  22. package/dist/client/chunks/chart-markdown-Du4Z2iqK.js +0 -2695
  23. package/dist/client/chunks/chart-markdown-Du4Z2iqK.js.map +0 -1
  24. package/dist/client/chunks/schema-visualization-CzOuTQDu.js +0 -563
  25. package/dist/client/chunks/schema-visualization-CzOuTQDu.js.map +0 -1
@@ -0,0 +1,2721 @@
1
+ import { jsx as qr, jsxs as Ga } from "react/jsx-runtime";
2
+ import * as mr from "react";
3
+ import Va, { useMemo as qt } from "react";
4
+ var nt;
5
+ function Za(e) {
6
+ if (!nt) if (typeof document < "u") nt = document.createElement("textarea");
7
+ else return;
8
+ var t = "&" + e + ";";
9
+ nt.innerHTML = t;
10
+ var r = nt.value;
11
+ return r !== t ? r : void 0;
12
+ }
13
+ var B = 32, S = 9, wr = 13, _ = 10, te = 96, Ne = 126, Ae = 91, rr = 94, q = 62, or = 35, Qa = 36, ot = 37, D = 45, De = 61, be = 92, xe = 42, pe = 95, oe = 60, At = 64, qe = 93, Ue = 33, Rt = 38, ze = 58, Kt = 70, zr = 102, Ct = 104, Ir = 119, Lt = 116, Yt = 112, $a = 115, en = 160, rn = 12, Aa = 44, Mt = 59, _r = 63, Ze = 46, ke = 47, Lr = 39, Br = 34, Tr = 43, Te = 124, Hr = 123, vt = 125, Ve = 40, Qe = 41, ct = 30, Ca = 31, ee = 48, re = 57, V = 65, ae = 90, Ce = 97, ge = 122, Vr = 128, xr = 32, tn = { blockQuote: 0, breakLine: 1, breakThematic: 2, codeBlock: 3, codeInline: 4, footnote: 5, footnoteReference: 6, frontmatter: 7, gfmTask: 8, heading: 9, htmlBlock: 10, htmlComment: 11, htmlSelfClosing: 12, image: 13, link: 14, orderedList: 15, paragraph: 16, ref: 17, refCollection: 18, table: 19, text: 20, textFormatted: 21, unorderedList: 22 }, x = tn;
14
+ function an(e) {
15
+ if (!Vt(e, "---")) return null;
16
+ let t = 3;
17
+ for (; t < e.length && (e[t] === " " || e[t] === " "); ) t++;
18
+ if (t < e.length && e[t] === "\r" && t++, t >= e.length || e[t] !== `
19
+ `) return null;
20
+ t++;
21
+ let r = !1;
22
+ for (; t < e.length; ) {
23
+ let a = t;
24
+ for (; t < e.length && e[t] !== `
25
+ ` && e[t] !== "\r"; ) t++;
26
+ if (t >= e.length) break;
27
+ let n = t;
28
+ if (e[t] === "\r" && t++, t < e.length && e[t] === `
29
+ ` && t++, Vt(e, "---", a)) return { endPos: t, hasValidYaml: r };
30
+ let l = e.indexOf(":", a);
31
+ l !== -1 && l < n && (r = !0);
32
+ }
33
+ return null;
34
+ }
35
+ var nn = /&([a-zA-Z0-9]+|#[0-9]{1,7}|#x[0-9a-fA-F]{1,6});/gi, ln = { class: "className", for: "htmlFor", allowfullscreen: "allowFullScreen", allowtransparency: "allowTransparency", autocomplete: "autoComplete", autofocus: "autoFocus", autoplay: "autoPlay", cellpadding: "cellPadding", cellspacing: "cellSpacing", charset: "charSet", classid: "classId", colspan: "colSpan", contenteditable: "contentEditable", contextmenu: "contextMenu", crossorigin: "crossOrigin", enctype: "encType", formaction: "formAction", formenctype: "formEncType", formmethod: "formMethod", formnovalidate: "formNoValidate", formtarget: "formTarget", frameborder: "frameBorder", hreflang: "hrefLang", inputmode: "inputMode", keyparams: "keyParams", keytype: "keyType", marginheight: "marginHeight", marginwidth: "marginWidth", maxlength: "maxLength", mediagroup: "mediaGroup", minlength: "minLength", novalidate: "noValidate", radiogroup: "radioGroup", readonly: "readOnly", rowspan: "rowSpan", spellcheck: "spellCheck", srcdoc: "srcDoc", srclang: "srcLang", srcset: "srcSet", tabindex: "tabIndex", usemap: "useMap", viewbox: "viewBox" };
36
+ function je(e) {
37
+ var t = {};
38
+ for (var r in e) {
39
+ var a = r.toLowerCase(), n = ln[a];
40
+ if (n) t[n] = e[r];
41
+ else {
42
+ var l = r.indexOf(":");
43
+ l !== -1 ? t[r.slice(0, l) + r[l + 1].toUpperCase() + r.slice(l + 2)] = e[r] : t[r] = e[r];
44
+ }
45
+ }
46
+ return t;
47
+ }
48
+ var on = /(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s|^<(div|p|h[1-6]|ul|ol|li|blockquote|pre|table|thead|tbody|tr|td|th|dl|dt|dd|hr|address|article|aside|details|dialog|figure|figcaption|footer|form|header|main|menu|nav|section|summary|textarea|fieldset|legend|center|dir|hgroup|marquee|search|output|template)\b)/i;
49
+ function pt(e) {
50
+ return e.indexOf("&") === -1 ? e : e.replace(nn, (t, r) => {
51
+ var a = Za(r);
52
+ if (a) return a;
53
+ if (r[0] === "#") {
54
+ var n = r[1] === "x" || r[1] === "X" ? parseInt(r.slice(2), 16) : parseInt(r.slice(1), 10);
55
+ return n === 0 || n >= 55296 && n <= 57343 || n > 1114111 ? "�" : n <= 65535 ? String.fromCharCode(n) : String.fromCharCode(55296 + (n - 65536 >> 10), 56320 + (n - 65536 & 1023));
56
+ }
57
+ return t;
58
+ });
59
+ }
60
+ var Gt = /(javascript|vbscript|data(?!:image)):/i;
61
+ function It(e) {
62
+ if (Gt.test(e)) return null;
63
+ if (e.indexOf("%") === -1) return e;
64
+ try {
65
+ let t = decodeURIComponent(e).replace(/[^A-Za-z0-9/:]/g, "");
66
+ if (Gt.test(t)) return null;
67
+ } catch {
68
+ return null;
69
+ }
70
+ return e;
71
+ }
72
+ var Je = {}, Fe, Se;
73
+ for (Fe = [192, 193, 194, 195, 196, 197, 224, 225, 226, 227, 228, 229, 230, 198], Se = 0; Se < Fe.length; Se++) Je[Fe[Se]] = "a";
74
+ for (Je[231] = Je[199] = "c", Je[240] = Je[208] = "d", Fe = [200, 201, 202, 203, 233, 232, 234, 235], Se = 0; Se < Fe.length; Se++) Je[Fe[Se]] = "e";
75
+ for (Fe = [207, 239, 206, 238, 205, 237, 204, 236], Se = 0; Se < Fe.length; Se++) Je[Fe[Se]] = "i";
76
+ for (Je[209] = Je[241] = "n", Fe = [248, 216, 339, 338, 213, 245, 212, 244, 211, 243, 210, 242], Se = 0; Se < Fe.length; Se++) Je[Fe[Se]] = "o";
77
+ for (Fe = [220, 252, 219, 251, 218, 250, 217, 249], Se = 0; Se < Fe.length; Se++) Je[Fe[Se]] = "u";
78
+ Je[376] = Je[255] = Je[221] = Je[253] = "y";
79
+ function ir(e) {
80
+ for (var t = e.toLowerCase(), r = "", a = -1, n = 0; n < t.length; n++) {
81
+ var l = t.charCodeAt(n);
82
+ if (l < Vr && (hn[l] & (Bt | va)) !== 0) a < 0 && (a = n);
83
+ else if (l === B || l === D) a >= 0 && (r += t.slice(a, n), a = -1), r += "-";
84
+ else {
85
+ a >= 0 && (r += t.slice(a, n), a = -1);
86
+ var i = Je[l];
87
+ i && (r += i);
88
+ }
89
+ }
90
+ return a >= 0 && (r += t.slice(a)), r;
91
+ }
92
+ function Vt(e, t, r) {
93
+ return e.startsWith(t, r);
94
+ }
95
+ var Zt = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "param", "source", "track", "wbr", "circle", "ellipse", "line", "path", "polygon", "polyline", "rect", "use", "stop", "animate", "set"]);
96
+ function Zr(e) {
97
+ let t = e.toLowerCase();
98
+ if (Zt.has(t)) return !0;
99
+ let r = t.indexOf(":");
100
+ return r !== -1 ? (t = t.slice(r + 1), Zt.has(t)) : !1;
101
+ }
102
+ var Kr = 1, lt = 2, Bt = 4, va = 8, Qt = 16, $t = 32, cn = 64, ea = 1, fn = 2, dn = 3, sn = 4, hn = (function() {
103
+ let e = new Uint8Array(128), t;
104
+ for (e[S] = Kr | $t, e[_] = Kr | Qt, e[rn] = Kr, e[wr] = Kr | Qt, e[B] = Kr | $t, t = Ue; t <= ke; t++) e[t] = lt;
105
+ for (t = ze; t <= At; t++) e[t] = lt;
106
+ for (t = Ae; t <= te; t++) e[t] = lt;
107
+ for (t = Hr; t <= Ne; t++) e[t] = lt;
108
+ for (t = ee; t <= re; t++) e[t] = va;
109
+ for (t = V; t <= ae; t++) e[t] = Bt | cn;
110
+ for (t = Ce; t <= ge; t++) e[t] = Bt;
111
+ return e;
112
+ })();
113
+ (function() {
114
+ let e = new Uint8Array(128);
115
+ return e[be] = fn, e[Ae] = sn, e[xe] = e[pe] = e[Ne] = e[De] = dn, e[te] = e[oe] = e[At] = e[qe] = e[_] = e[B] = e[Ue] = ea, e[zr] = e[Ct] = e[Ir] = ea, e;
116
+ })();
117
+ var Er = [];
118
+ function un(e) {
119
+ var t = e.indexOf("\r"), r = e.indexOf("\0");
120
+ if (t === -1 && r === -1) return e;
121
+ var a = e.length;
122
+ Er.length = 0;
123
+ var n = 0, l = 0;
124
+ for (t === -1 ? l = r : r === -1 ? l = t : l = t < r ? t : r; l < a; l++) {
125
+ var i = e.charCodeAt(l);
126
+ i === wr ? (n < l && Er.push(e.slice(n, l)), l + 1 < a && e.charCodeAt(l + 1) === _ && l++, Er.push(`
127
+ `), n = l + 1) : i === 0 && (n < l && Er.push(e.slice(n, l)), Er.push("�"), n = l + 1);
128
+ }
129
+ return n < a && Er.push(e.slice(n)), Er.join("");
130
+ }
131
+ function Tt(e, t, r) {
132
+ for (var a = e, n = t.split("."), l = 0; l < n.length && (a = a?.[n[l]], a !== void 0); ) l++;
133
+ return a || r;
134
+ }
135
+ function An(e) {
136
+ for (var t = !1, r = 0; r < e.length; r++) {
137
+ var a = e.charCodeAt(r);
138
+ if (a <= B || a === Br || a === ot || a === oe || a === q || a === Ae || a === be || a === qe || a === rr || a === te || a >= 123) {
139
+ t = !0;
140
+ break;
141
+ }
142
+ }
143
+ if (!t) return e;
144
+ for (var n = "", r = 0; r < e.length; r++) {
145
+ var a = e.charCodeAt(r);
146
+ if (a === ot && r + 2 < e.length) {
147
+ var l = e.charCodeAt(r + 1), i = e.charCodeAt(r + 2);
148
+ if ((l >= ee && l <= re || l >= V && l <= Kt || l >= Ce && l <= zr) && (i >= ee && i <= re || i >= V && i <= Kt || i >= Ce && i <= zr)) {
149
+ n += e[r] + e[r + 1] + e[r + 2], r += 2;
150
+ continue;
151
+ }
152
+ }
153
+ n += encodeURI(e[r]);
154
+ }
155
+ return n;
156
+ }
157
+ function Cn(...e) {
158
+ return e.filter(Boolean).join(" ");
159
+ }
160
+ var vn = /* @__PURE__ */ new Set(["title", "textarea", "style", "xmp", "iframe", "noembed", "noframes", "script", "plaintext"]), ft = /<(\/?)(title|textarea|style|xmp|iframe|noembed|noframes|script|plaintext)(\s|>|\/)/gi;
161
+ function ra(e) {
162
+ return vn.has(e.toLowerCase());
163
+ }
164
+ function pn(e) {
165
+ return ft.lastIndex = 0, ft.test(e);
166
+ }
167
+ function ta(e) {
168
+ return ft.lastIndex = 0, e.replace(ft, function(t, r, a, n) {
169
+ return "&lt;" + r + a + n;
170
+ });
171
+ }
172
+ var gn = /^<([a-zA-Z][a-zA-Z0-9-]*)\s[^>]*>/, mn = /^<[A-Z]/, Nt = ["script", "pre", "style", "textarea"], Qr = new Set(Nt), xn = /<(?:pre|script|style|textarea)\b/i, yn = /* @__PURE__ */ new Set(["table", "thead", "tbody", "tfoot", "tr", "td", "th"]), pa = new Uint8Array(128);
173
+ (function() {
174
+ for (var e = [te, xe, pe, Ne, De, Ae, Ue, oe, be, Ca, Ct, Ir, zr], t = 0; t < e.length; t++) pa[e[t]] = 1;
175
+ })();
176
+ var aa = /([a-zA-Z_][a-zA-Z0-9_-]*)=(?:"([^"]*)"|'([^']*)')/g;
177
+ function kn(e) {
178
+ return Qr.has(e);
179
+ }
180
+ function bn(e) {
181
+ return xn.test(e);
182
+ }
183
+ function ga(e, t, r) {
184
+ for (var a = t, n = r; a < n && (e.charCodeAt(a) === B || e.charCodeAt(a) === S); ) a++;
185
+ if (a >= n) return !1;
186
+ e.charCodeAt(a) === Te && a++;
187
+ for (var l = 0; a < n; ) {
188
+ for (; a < n && (e.charCodeAt(a) === B || e.charCodeAt(a) === S); ) a++;
189
+ if (a >= n) break;
190
+ if (e.charCodeAt(a) === Te && l > 0) {
191
+ for (var i = a + 1; i < n && (e.charCodeAt(i) === B || e.charCodeAt(i) === S); ) i++;
192
+ if (i >= n) return !0;
193
+ }
194
+ if (e.charCodeAt(a) === ze && a++, a >= n || e.charCodeAt(a) !== D) return !1;
195
+ for (; a < n && e.charCodeAt(a) === D; ) a++;
196
+ for (a < n && e.charCodeAt(a) === ze && a++, l++; a < n && (e.charCodeAt(a) === B || e.charCodeAt(a) === S); ) a++;
197
+ if (a < n) if (e.charCodeAt(a) === Te) a++;
198
+ else return !1;
199
+ }
200
+ return l > 0;
201
+ }
202
+ function hr(e, t) {
203
+ if (e.charCodeAt(t) !== oe) return null;
204
+ let r = t + 1, a = e.length, n = !1;
205
+ e.charCodeAt(r) === ke && (r++, n = !0);
206
+ let l = r, i = e.charCodeAt(r);
207
+ if (!(i >= Ce && i <= ge || i >= V && i <= ae)) return null;
208
+ for (; r < a && (e.charCodeAt(r) >= Ce && e.charCodeAt(r) <= ge || e.charCodeAt(r) >= V && e.charCodeAt(r) <= ae || e.charCodeAt(r) >= ee && e.charCodeAt(r) <= re || e.charCodeAt(r) === D); ) r++;
209
+ let o = e.slice(l, r);
210
+ if (!o) return null;
211
+ let c = r;
212
+ for (; r < a && (e.charCodeAt(r) === B || e.charCodeAt(r) === S || e.charCodeAt(r) === _); ) r++;
213
+ let f = e.slice(c, r);
214
+ if (r === c && r < a) {
215
+ var d = e.charCodeAt(r);
216
+ if (d !== q && d !== ke) return null;
217
+ }
218
+ let h = r, A = {}, C = !1;
219
+ for (; r < a; ) {
220
+ let O = e.charCodeAt(r);
221
+ if (O === q) {
222
+ let N = e.slice(h, r);
223
+ return { tag: o, attrs: A, selfClosing: !1, end: r + 1, rawAttrs: N, whitespaceBeforeAttrs: f, isClosing: n, hasSpaceBeforeSlash: C };
224
+ }
225
+ if (O === B || O === S || O === _) {
226
+ r++;
227
+ continue;
228
+ }
229
+ if (O === ke && r + 1 < a && e.charCodeAt(r + 1) === q) {
230
+ let N = e.slice(h, r);
231
+ return C = r > h && e.charCodeAt(r - 1) === B, { tag: o, attrs: A, selfClosing: !0, end: r + 2, rawAttrs: N, whitespaceBeforeAttrs: f, isClosing: n, hasSpaceBeforeSlash: C };
232
+ }
233
+ var g = r, s = e.charCodeAt(r);
234
+ if (!(s >= Ce && s <= ge || s >= V && s <= ae || s === pe || s === ze)) return null;
235
+ for (r++; r < a; ) {
236
+ var u = e.charCodeAt(r);
237
+ if (u >= Ce && u <= ge || u >= V && u <= ae || u >= ee && u <= re || u === pe || u === Ze || u === ze || u === D) r++;
238
+ else break;
239
+ }
240
+ for (var v = e.slice(g, r); r < a && (e.charCodeAt(r) === B || e.charCodeAt(r) === S); ) r++;
241
+ if (e.charCodeAt(r) !== De) {
242
+ A[v] = "";
243
+ continue;
244
+ }
245
+ for (r++; r < a && (e.charCodeAt(r) === B || e.charCodeAt(r) === S); ) r++;
246
+ var m = e.charCodeAt(r);
247
+ if (m === Br || m === Lr) {
248
+ r++;
249
+ for (var y = r; r < a && e.charCodeAt(r) !== m; ) r++;
250
+ if (r >= a) return null;
251
+ if (A[v] = e.slice(y, r), r++, r < a) {
252
+ var T = e.charCodeAt(r);
253
+ if (T !== B && T !== S && T !== _ && T !== q && T !== ke) return null;
254
+ }
255
+ } else if (m === Hr) {
256
+ var L = 1, y = r;
257
+ for (r++; r < a && L > 0; ) {
258
+ var u = e.charCodeAt(r);
259
+ u === Hr ? L++ : u === vt && L--, r++;
260
+ }
261
+ A[v] = e.slice(y, r);
262
+ } else {
263
+ for (var y = r; r < a; ) {
264
+ var p = e.charCodeAt(r);
265
+ if (p === B || p === S || p === q || p === _ || p === Br || p === Lr || p === De || p === oe || p === te) break;
266
+ r++;
267
+ }
268
+ if (r === y) return null;
269
+ A[v] = e.slice(y, r);
270
+ }
271
+ }
272
+ return null;
273
+ }
274
+ function ma(e, t, r) {
275
+ for (var a = 0, n = e.length, l = !1, i = !1; a < n; ) {
276
+ for (var o = e.indexOf(`
277
+ `, a), c = o < 0 ? n : o, f = a, d = 0; f < c && d < 4; ) if (e.charCodeAt(f) === B) d++, f++;
278
+ else if (e.charCodeAt(f) === S) d += 4, f++;
279
+ else break;
280
+ if (f >= c) {
281
+ l = !1, a = o < 0 ? n : o + 1;
282
+ continue;
283
+ }
284
+ if (d < 4) {
285
+ var h = e.charCodeAt(f);
286
+ if (h === te || h === Ne) {
287
+ for (var A = h, C = 0, g = f; g < c && e.charCodeAt(g) === A; ) C++, g++;
288
+ if (C >= 3) {
289
+ var s = !0;
290
+ if (A === te) {
291
+ for (var u = g; u < c; u++) if (e.charCodeAt(u) === te) {
292
+ s = !1;
293
+ break;
294
+ }
295
+ }
296
+ if (s) {
297
+ l = !1;
298
+ for (var v = o < 0 ? n : o + 1; v < n; ) {
299
+ for (var m = v, y = 0; m < n && y < 4; ) {
300
+ var T = e.charCodeAt(m);
301
+ if (T === B) y++, m++;
302
+ else if (T === S) y += 4, m++;
303
+ else break;
304
+ }
305
+ if (y < 4 && m < n && e.charCodeAt(m) === A) {
306
+ for (var L = 0; m < n && e.charCodeAt(m) === A; ) L++, m++;
307
+ if (L >= C) {
308
+ for (; m < n && (e.charCodeAt(m) === B || e.charCodeAt(m) === S); ) m++;
309
+ if (m >= n || e.charCodeAt(m) === _) {
310
+ a = m >= n ? n : m + 1;
311
+ break;
312
+ }
313
+ }
314
+ }
315
+ for (; v < n && e.charCodeAt(v) !== _; ) v++;
316
+ v < n && v++;
317
+ }
318
+ v >= n && (a = n, i = !0);
319
+ continue;
320
+ }
321
+ }
322
+ }
323
+ }
324
+ for (var p = f; p < c && e.charCodeAt(p) === q; ) {
325
+ p++, p < c && e.charCodeAt(p) === B && p++;
326
+ for (var O = 0; p < c && O < 4; ) if (e.charCodeAt(p) === B) O++, p++;
327
+ else if (e.charCodeAt(p) === S) O += 4, p++;
328
+ else break;
329
+ if (O >= 4) break;
330
+ l = !1;
331
+ }
332
+ if (!l && d < 4 && p < c && e.charCodeAt(p) === Ae && !(p + 1 < n && e.charCodeAt(p + 1) === rr)) {
333
+ var N = xa(e, p, t);
334
+ if (N) {
335
+ a = N, l = !1;
336
+ continue;
337
+ }
338
+ }
339
+ var P = e.charCodeAt(f);
340
+ if (P === or && d < 4) l = !1;
341
+ else if (d < 4 && (P === D || P === xe || P === pe)) {
342
+ for (var w = f, E = 0; w < c; ) {
343
+ var H = e.charCodeAt(w);
344
+ if (H === P) E++;
345
+ else if (H !== B && H !== S) break;
346
+ w++;
347
+ }
348
+ l = !(E >= 3 && w >= c);
349
+ } else l = !0;
350
+ a = o < 0 ? n : o + 1;
351
+ }
352
+ return i;
353
+ }
354
+ function xa(e, t, r) {
355
+ let a = e.length;
356
+ if (e.charCodeAt(t) !== Ae) return null;
357
+ let n = t + 1 < a && e.charCodeAt(t + 1) === rr, l = t + 1;
358
+ for (; l < a; ) {
359
+ var i = e.charCodeAt(l);
360
+ if (i === qe) {
361
+ l++;
362
+ break;
363
+ }
364
+ if (i === Ae) return null;
365
+ i === be && l + 1 < a && l++, l++;
366
+ }
367
+ if (l > a || e.charCodeAt(l - 1) !== qe) return null;
368
+ let o = e.slice(t + 1, l - 1);
369
+ if (o.length > 999) return null;
370
+ let c = it(o);
371
+ if (!c || l >= a || e.charCodeAt(l) !== ze) return null;
372
+ l++;
373
+ let f = !1;
374
+ for (; l < a; ) {
375
+ let J = e.charCodeAt(l);
376
+ if (J === B || J === S) l++;
377
+ else if (J === _ && !f) f = !0, l++;
378
+ else break;
379
+ }
380
+ if (n) {
381
+ let J = e.indexOf(`
382
+ `, l), z = J < 0 ? a : J, R = e.slice(l, z).trim();
383
+ return r[c] = { target: R, title: void 0 }, J < 0 ? a : J + 1;
384
+ }
385
+ var d;
386
+ if (l < a && e.charCodeAt(l) === oe) {
387
+ l++;
388
+ for (var h = l; l < a && e.charCodeAt(l) !== q && e.charCodeAt(l) !== _; ) e.charCodeAt(l) === be && l + 1 < a && l++, l++;
389
+ if (l >= a || e.charCodeAt(l) !== q) return null;
390
+ d = e.slice(h, l), l++;
391
+ for (var A = e.indexOf(`
392
+ `, l), C = A < 0 ? a : A, g = l; g < C && (e.charCodeAt(g) === B || e.charCodeAt(g) === S); ) g++;
393
+ if (g < C) {
394
+ if (g === l) return null;
395
+ var s = e.charCodeAt(g);
396
+ if (s !== Br && s !== Lr && s !== Ve) return null;
397
+ }
398
+ } else {
399
+ for (var h = l, u = 0; l < a; ) {
400
+ var i = e.charCodeAt(l);
401
+ if (i === Ve) u++;
402
+ else if (i === Qe) {
403
+ if (u === 0) break;
404
+ u--;
405
+ } else {
406
+ if (i === B || i === S || i === _) break;
407
+ i === be && l + 1 < a && l++;
408
+ }
409
+ l++;
410
+ }
411
+ if (d = e.slice(h, l), !d) return null;
412
+ }
413
+ for (; l < a && (e.charCodeAt(l) === B || e.charCodeAt(l) === S); ) l++;
414
+ var v = e.indexOf(`
415
+ `, l), m = v < 0 ? a : v, y, T = !1, L = l, p = l;
416
+ if (l === m && l < a) for (p = l + 1; p < a && (e.charCodeAt(p) === B || e.charCodeAt(p) === S); ) p++;
417
+ if (p < a) {
418
+ var O = e.charCodeAt(p);
419
+ if (O === Br || O === Lr || O === Ve) {
420
+ for (var N = O === Ve ? 41 : O, P = p + 1, w = P; P < a; ) {
421
+ var E = e.charCodeAt(P);
422
+ if (E === N) {
423
+ for (var H = P + 1; H < a && (e.charCodeAt(H) === B || e.charCodeAt(H) === S); ) H++;
424
+ (H >= a || e.charCodeAt(H) === _) && (y = e.slice(w, P), T = !0, L = H < a ? H + 1 : a);
425
+ break;
426
+ }
427
+ if (E === be && P + 1 < a) {
428
+ P += 2;
429
+ continue;
430
+ }
431
+ if (E === _ && P + 1 < a && e.charCodeAt(P + 1) === _) break;
432
+ P++;
433
+ }
434
+ if (!T && p === l) return null;
435
+ }
436
+ }
437
+ if (T) return r[c] || (r[c] = { target: Jr(d), title: y !== void 0 ? pt(Jr(y)) : y }), L;
438
+ for (; l < m && (e.charCodeAt(l) === B || e.charCodeAt(l) === S); ) l++;
439
+ return l < m ? null : (r[c] || (r[c] = { target: Jr(d), title: y }), v < 0 ? a : v + 1);
440
+ }
441
+ var Mr = 1, na = 2, $ = 4, ya = 8, wn = 16, er = 32, pr = 64, X = new Uint8Array(128);
442
+ X[B] = Mr, X[S] = Mr, X[_] = Mr | na, X[wr] = Mr | na, X[or] = er | $, X[q] = er | $, X[D] = er | pr | $, X[Tr] = er | $, X[xe] = er | pr | $, X[pe] = er | pr | $, X[te] = er | pr | $, X[Ne] = er | pr | $, X[oe] = er | pr | $, X[Ae] = pr | $, X[Ue] = pr | $, X[Te] = er | $;
443
+ for (let e = ee; e <= re; e++) X[e] = wn | er;
444
+ for (let e = V; e <= ae; e++) X[e] = ya;
445
+ for (let e = Ce; e <= ge; e++) X[e] = ya;
446
+ X[be] = $, X[qe] = $, X[Ve] = $, X[Qe] = $, X[ze] = $, X[Br] = $, X[Lr] = $, X[Rt] = $, X[De] = $, X[Qa] = $, X[ot] = $, X[Aa] = $, X[Ze] = $, X[ke] = $, X[Mt] = $, X[_r] = $, X[At] = $, X[rr] = $, X[Hr] = $, X[vt] = $;
447
+ function la(e) {
448
+ if (e.indexOf("[") < 0 && e.indexOf("]") < 0) return !1;
449
+ for (var t = 0; t < e.length; t++) {
450
+ if (e.charCodeAt(t) === be) {
451
+ t++;
452
+ continue;
453
+ }
454
+ if (e.charCodeAt(t) === Ae || e.charCodeAt(t) === qe) return !0;
455
+ }
456
+ return !1;
457
+ }
458
+ function it(e) {
459
+ var t = e.replace(/\s+/g, " ").trim();
460
+ return t.indexOf("ẞ") !== -1 ? t.replace(/\u1E9E/g, "ss").toLowerCase() : t.toLowerCase();
461
+ }
462
+ function Jt(e) {
463
+ return e < Vr ? X[e] : e === en ? Mr : 0;
464
+ }
465
+ function Jr(e) {
466
+ return e.replace(/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g, "$1");
467
+ }
468
+ function ie(e, t) {
469
+ var r = e.indexOf(`
470
+ `, t);
471
+ return r < 0 ? e.length : r;
472
+ }
473
+ function j(e, t) {
474
+ let r = ie(e, t);
475
+ return r < e.length ? r + 1 : r;
476
+ }
477
+ function Gr(e, t, r) {
478
+ for (; t < r; ) {
479
+ let a = e.charCodeAt(t);
480
+ if (a !== B && a !== S) break;
481
+ t++;
482
+ }
483
+ return t;
484
+ }
485
+ function ia(e, t) {
486
+ let r = j(e, t);
487
+ for (; r < e.length; ) {
488
+ let a = ie(e, r);
489
+ if (We(e, r, a)) return r;
490
+ r = j(e, r);
491
+ }
492
+ return e.length;
493
+ }
494
+ function ur(e, t, r, a) {
495
+ let n = 0;
496
+ for (; t + n < r && e.charCodeAt(t + n) === a; ) n++;
497
+ return n;
498
+ }
499
+ var le = 0, ne = 0;
500
+ function me(e, t, r) {
501
+ for (le = 0, ne = 0; t + ne < r; ) {
502
+ let a = e.charCodeAt(t + ne);
503
+ if (a === S) le += 4 - le % 4;
504
+ else if (a === B) le++;
505
+ else break;
506
+ ne++;
507
+ }
508
+ }
509
+ function We(e, t, r) {
510
+ return Gr(e, t, r) >= r;
511
+ }
512
+ function ka(e, t, r, a) {
513
+ let n = ie(e, t);
514
+ if (me(e, t, n), le > 3) return null;
515
+ let l = t + ne;
516
+ if (e.charCodeAt(l) !== or) return null;
517
+ let i = ur(e, l, n, 35);
518
+ if (i < 1 || i > 6 || (l += i, l < n && e.charCodeAt(l) !== B && e.charCodeAt(l) !== S)) return null;
519
+ l = Gr(e, l, n);
520
+ for (var o = n; o > l && e.charCodeAt(o - 1) === B; ) o--;
521
+ for (var c = o; o > l && e.charCodeAt(o - 1) === or; ) o--;
522
+ if (o < c) if (o === l || e.charCodeAt(o - 1) === B) for (; o > l && e.charCodeAt(o - 1) === B; ) o--;
523
+ else o = c;
524
+ let f = e.slice(l, o), d = _e(f, 0, f.length, r, a), h = (a?.slugify || ir)(f);
525
+ return { node: { type: x.heading, level: i, children: d, id: h }, end: j(e, n) };
526
+ }
527
+ function Ln(e, t, r) {
528
+ var a = e.charCodeAt(t);
529
+ if (a !== De && a !== D) return !1;
530
+ for (var n = t; n < r && e.charCodeAt(n) === a; ) n++;
531
+ for (; n < r && (e.charCodeAt(n) === B || e.charCodeAt(n) === S); ) n++;
532
+ return n >= r;
533
+ }
534
+ function kr(e, t) {
535
+ let r = ie(e, t);
536
+ if (me(e, t, r), le > 3) return null;
537
+ let a = t + ne, n = e.charCodeAt(a);
538
+ if (n !== D && n !== xe && n !== pe) return null;
539
+ let l = 0;
540
+ for (; a < r; ) {
541
+ let i = e.charCodeAt(a);
542
+ if (i === n) l++;
543
+ else if (i !== B && i !== S) return null;
544
+ a++;
545
+ }
546
+ return l < 3 ? null : { node: { type: x.breakThematic }, end: j(e, r) };
547
+ }
548
+ function Bn(e, t, r) {
549
+ let a = ie(e, t);
550
+ if (me(e, t, a), le > 3) return null;
551
+ let n = le, l = t + ne, i = e.charCodeAt(l);
552
+ if (i !== te && i !== Ne) return null;
553
+ let o = ur(e, l, a, i);
554
+ if (o < 3) return null;
555
+ l += o;
556
+ let c = Gr(e, l, a), f = a;
557
+ if (i === te) {
558
+ for (let N = c; N < a; N++) if (e.charCodeAt(N) === te) return null;
559
+ }
560
+ for (; f > c && (e.charCodeAt(f - 1) === B || e.charCodeAt(f - 1) === S); ) f--;
561
+ let d = e.slice(c, f), h = "", A = "", C = d.indexOf(" ");
562
+ C === -1 ? h = d : (h = d.slice(0, C), A = d.slice(C + 1).trim()), h = Jr(h);
563
+ var g = void 0;
564
+ if (A) {
565
+ aa.lastIndex = 0;
566
+ for (var s; (s = aa.exec(A)) !== null; ) g || (g = {}), g[s[1]] = s[2] !== void 0 ? s[2] : s[3];
567
+ }
568
+ let u = j(e, a), v = u, m = e.length;
569
+ for (; v < e.length; ) {
570
+ let N = ie(e, v);
571
+ if (me(e, v, N), le < 4) {
572
+ let P = v + ne;
573
+ var y = ur(e, P, N, i);
574
+ if (y >= o) {
575
+ let w = P + y;
576
+ if (We(e, w, N)) {
577
+ m = j(e, N);
578
+ break;
579
+ }
580
+ }
581
+ }
582
+ v = j(e, N);
583
+ }
584
+ var T;
585
+ if (n === 0) T = v > u && e.charCodeAt(v - 1) === _ ? e.slice(u, v - 1) : e.slice(u, v);
586
+ else {
587
+ T = "";
588
+ for (var L = u; L < v; ) {
589
+ var p = ie(e, L);
590
+ me(e, L, p);
591
+ var O = Math.min(ne, n);
592
+ T += e.slice(L + O, p) + `
593
+ `, L = j(e, p);
594
+ }
595
+ T.length > 0 && T.charCodeAt(T.length - 1) === _ && (T = T.slice(0, -1));
596
+ }
597
+ return { node: { type: x.codeBlock, lang: h || void 0, text: T, infoString: A || void 0, attrs: g }, end: m };
598
+ }
599
+ function Tn(e, t) {
600
+ let r = ie(e, t);
601
+ if (me(e, t, r), le < 4) return null;
602
+ let a = "", n = t;
603
+ for (; n < e.length; ) {
604
+ let C = ie(e, n);
605
+ if (me(e, n, C), We(e, n, C)) {
606
+ for (var l = 0, i = j(e, C); i < e.length; ) {
607
+ var o = ie(e, i);
608
+ if (We(e, i, o)) {
609
+ l++, i = j(e, o);
610
+ continue;
611
+ }
612
+ if (me(e, i, o), le >= 4) {
613
+ for (var c = 0; c <= l; c++) a += `
614
+ `;
615
+ n = i;
616
+ break;
617
+ }
618
+ break;
619
+ }
620
+ if (n !== i) break;
621
+ continue;
622
+ }
623
+ if (le < 4) break;
624
+ let g = 0, s = 0;
625
+ var f = 0;
626
+ for (let u = n; u < C && s < 4; u++) {
627
+ if (e.charCodeAt(u) === S) {
628
+ var d = 4 - s % 4;
629
+ s + d > 4 && (f = s + d - 4), s += d;
630
+ } else s++;
631
+ g++;
632
+ }
633
+ var h = "";
634
+ if (f > 0) for (var A = 0; A < f; A++) h += " ";
635
+ h += e.slice(n + g, C), a += h + `
636
+ `, n = j(e, C);
637
+ }
638
+ for (; a.length > 0 && a.charCodeAt(a.length - 1) === _; ) a = a.slice(0, -1);
639
+ for (; a.length > 0 && a.charCodeAt(a.length - 1) === _; ) a = a.slice(0, -1);
640
+ return a ? { node: { type: x.codeBlock, text: a }, end: n } : null;
641
+ }
642
+ function Nn(e, t, r, a) {
643
+ let n = ie(e, t);
644
+ if (me(e, t, n), le > 3) return null;
645
+ let l = t + ne;
646
+ if (e.charCodeAt(l) !== q) return null;
647
+ let i = "", o = t, c, f = !1, d = !1, h = !1;
648
+ for (; o < e.length; ) {
649
+ let b = ie(e, o);
650
+ me(e, o, b);
651
+ let Z = o + ne;
652
+ if (e.charCodeAt(Z) === q) {
653
+ let K = Z + 1;
654
+ var A = le + 1, C = !1;
655
+ if (K < b) {
656
+ var g = e.charCodeAt(K);
657
+ g === B ? (K++, A++, C = !0) : g === S && (C = !0);
658
+ }
659
+ for (var s = "", u = !1, v = K; v < b; v++) if (e.charCodeAt(v) === S) {
660
+ u = !0;
661
+ break;
662
+ }
663
+ if (u) {
664
+ var m = A;
665
+ if (C && K < b && e.charCodeAt(K) === S) {
666
+ for (var y = 4 - m % 4, T = 0; T < y - 1; T++) s += " ";
667
+ m += y, K++;
668
+ }
669
+ for (var L = K; L < b; L++) if (e.charCodeAt(L) === S) {
670
+ for (var p = 4 - m % 4, O = 0; O < p; O++) s += " ";
671
+ m += p;
672
+ } else s += e[L], m++;
673
+ } else s = e.slice(K, b);
674
+ if (!i && !c) {
675
+ let M = s.match(/^\[!([A-Za-z]+)\]\s*$/);
676
+ if (M) {
677
+ c = M[1].toUpperCase(), o = j(e, b);
678
+ continue;
679
+ }
680
+ }
681
+ i += s + `
682
+ `;
683
+ var N = s.trimStart();
684
+ N.startsWith("```") || N.startsWith("~~~") ? h = !h : s.startsWith(" ") || s.startsWith(" ") ? h = !0 : N.length > 0 && !h && (h = !1), d = N.length > 0, o = j(e, b);
685
+ } else if (i && !We(e, o, b) && d) {
686
+ if (le < 4) {
687
+ var P = o + ne, w = P < b ? e.charCodeAt(P) : 0;
688
+ if (w === or || w === q || w === te || w === Ne || w === oe || (w === D || w === xe || w === pe) && kr(e, o) || (w === D || w === xe || w === Tr) && P + 1 < b && (e.charCodeAt(P + 1) === B || e.charCodeAt(P + 1) === S)) break;
689
+ if (w >= ee && w <= re) {
690
+ for (var E = P; E < b && e.charCodeAt(E) >= ee && e.charCodeAt(E) <= re; ) E++;
691
+ if (E < b && (e.charCodeAt(E) === Ze || e.charCodeAt(E) === Qe)) break;
692
+ }
693
+ }
694
+ if (h) break;
695
+ i += e.slice(o, b) + `
696
+ `, f = !0, o = j(e, b);
697
+ } else break;
698
+ }
699
+ if (!i && !c) return null;
700
+ var { inBlockQuote: H, f: J } = r;
701
+ r.inBlockQuote = !0, f && (r.f = !0);
702
+ let z = br(i || "", r, a);
703
+ r.inBlockQuote = H, r.f = J;
704
+ let R = { type: x.blockQuote, children: z };
705
+ return c && (R.alert = c), { node: R, end: o };
706
+ }
707
+ function ba(e, t, r) {
708
+ for (var a = 0, n = t; n < r; n++) e.charCodeAt(n) === S ? a += 4 - a % 4 : a++;
709
+ return a;
710
+ }
711
+ function gr(e, t, r) {
712
+ if (me(e, t, r), le > 3) return null;
713
+ var a = t + ne;
714
+ if (a >= r) return null;
715
+ var n = e.charCodeAt(a), l = le, i = a;
716
+ if (n === D || n === xe || n === Tr) {
717
+ if (i = a + 1, i < r && e.charCodeAt(i) !== B && e.charCodeAt(i) !== S && e.charCodeAt(i) !== _) return null;
718
+ } else if (n >= ee && n <= re) {
719
+ for (var o = a; o < r && o - a < 9; ) {
720
+ var c = e.charCodeAt(o);
721
+ if (c < ee || c > re) break;
722
+ o++;
723
+ }
724
+ if (o > a && o < r) {
725
+ var f = e.charCodeAt(o);
726
+ if (f === Ze || f === Qe) {
727
+ if (i = o + 1, i < r && e.charCodeAt(i) !== B && e.charCodeAt(i) !== S && e.charCodeAt(i) !== _) return null;
728
+ } else return null;
729
+ } else return null;
730
+ } else return null;
731
+ var d = i, h = ba(e, t, i), A = 0, C = d, g = h;
732
+ if (d >= r) return { ordered: n >= ee && n <= re, marker: n >= ee && n <= re ? e[o] : e[a], start: n >= ee && n <= re ? parseInt(e.slice(a, o), 10) : void 0, contentStart: d, contentCol: h + 1, markerCol: l, isEmpty: !0 };
733
+ for (; C < r && (e.charCodeAt(C) === B || e.charCodeAt(C) === S); ) {
734
+ if (e.charCodeAt(C) === S) {
735
+ var s = 4 - g % 4;
736
+ g += s;
737
+ } else g++;
738
+ C++, A++;
739
+ }
740
+ var u = C >= r, v = g - h;
741
+ return u || v > 4 ? (g = h + 1, C = d + 1, A = 1) : A === 0 && (g = h + 1, C = d, A = 1), { ordered: n >= ee && n <= re, marker: n >= ee && n <= re ? e[o] : e[a], start: n >= ee && n <= re ? parseInt(e.slice(a, o), 10) : void 0, contentStart: C, contentCol: g, markerCol: l, isEmpty: u };
742
+ }
743
+ var dt = 0;
744
+ function Sn(e, t, r, a) {
745
+ var n = 0, l = t;
746
+ for (dt = 0; l < r && n < a; ) {
747
+ var i = e.charCodeAt(l);
748
+ if (i === S) {
749
+ var o = 4 - n % 4;
750
+ if (n + o > a) {
751
+ dt = n + o - a, l++, n = a;
752
+ break;
753
+ }
754
+ n += o;
755
+ } else if (i === B) n++;
756
+ else break;
757
+ l++;
758
+ }
759
+ return l;
760
+ }
761
+ function oa(e, t, r, a) {
762
+ var n = ie(e, t), l = gr(e, t, n);
763
+ if (!l) return null;
764
+ var i = [], o = t, c = l.contentCol, f = "", d = l.isEmpty, h = !1, A = !1;
765
+ if (!l.isEmpty) {
766
+ for (var C = !1, g = l.contentStart; g < n; g++) if (e.charCodeAt(g) === S) {
767
+ C = !0;
768
+ break;
769
+ }
770
+ if (C) {
771
+ var s = "", u = ba(e, t, l.contentStart), v = u - l.contentCol;
772
+ if (v > 0) for (var m = 0; m < v; m++) s += " ";
773
+ for (var y = l.contentStart; y < n; y++) if (e.charCodeAt(y) === S) {
774
+ for (var T = 4 - u % 4, L = 0; L < T; L++) s += " ";
775
+ u += T;
776
+ } else s += e[y], u++;
777
+ f = s + `
778
+ `;
779
+ } else f = e.slice(l.contentStart, n) + `
780
+ `;
781
+ }
782
+ for (o = j(e, n); o < e.length; ) {
783
+ var p = ie(e, o);
784
+ me(e, o, p);
785
+ var O = e.charCodeAt(o + ne);
786
+ if (le < c && (O === D || O === xe || O === pe) && le <= 3 && kr(e, o)) break;
787
+ var N = gr(e, o, p);
788
+ if (N && N.ordered === l.ordered && N.marker === l.marker && N.markerCol < c) {
789
+ i.push({ contentCol: c, raw: f, hasBlankAfter: h, isEmpty: d }), h && (A = !0), c = N.contentCol, d = N.isEmpty, h = !1, f = N.isEmpty ? "" : e.slice(N.contentStart, p) + `
790
+ `, o = j(e, p);
791
+ continue;
792
+ }
793
+ if (We(e, o, p)) {
794
+ f += `
795
+ `, o = j(e, p);
796
+ for (var P = !1, w = 0; w < f.length; w++) {
797
+ var E = f.charCodeAt(w);
798
+ if (E !== _ && E !== wr && E !== B && E !== S) {
799
+ P = !0;
800
+ break;
801
+ }
802
+ }
803
+ if (d && !P) if (o < e.length) {
804
+ var H = ie(e, o), J = gr(e, o, H);
805
+ if (!J || J.ordered !== l.ordered || J.marker !== l.marker) break;
806
+ h = !0;
807
+ } else break;
808
+ if (o < e.length) {
809
+ var z = ie(e, o);
810
+ me(e, o, z);
811
+ var R = e.charCodeAt(o + ne);
812
+ if ((R === D || R === xe || R === pe) && le <= 3 && kr(e, o)) break;
813
+ var b = gr(e, o, z);
814
+ if (b && b.ordered === l.ordered && b.marker === l.marker && b.markerCol < c) {
815
+ h = !0;
816
+ continue;
817
+ }
818
+ if (!We(e, o, z) && le < c) break;
819
+ }
820
+ continue;
821
+ }
822
+ if (le >= c) {
823
+ var Z = Sn(e, o, p, c);
824
+ if (dt > 0) {
825
+ for (var K = "", M = c, se = 0; se < dt; se++) K += " ", M++;
826
+ for (var fe = Z; fe < p; fe++) if (e.charCodeAt(fe) === S) {
827
+ for (var Pe = 4 - M % 4, Y = 0; Y < Pe; Y++) K += " ";
828
+ M += Pe;
829
+ } else K += e[fe], M++;
830
+ f += K + `
831
+ `;
832
+ } else f += e.slice(Z, p) + `
833
+ `;
834
+ o = j(e, p);
835
+ continue;
836
+ }
837
+ for (var he = !1, U = 0; U < f.length; U++) {
838
+ var G = f.charCodeAt(U);
839
+ if (G !== _ && G !== wr && G !== B && G !== S) {
840
+ he = !0;
841
+ break;
842
+ }
843
+ }
844
+ if (!h && he && !d) {
845
+ var Re = o + ne, ce = e.charCodeAt(Re), $e = ce === or || ce === q || ce === oe || ce === te || ce === Ne || (ce === D || ce === xe || ce === pe || ce === Tr) && (kr(e, o) !== null || gr(e, o, p) !== null) || ce >= ee && ce <= re && gr(e, o, p) !== null;
846
+ if (!$e) {
847
+ f += "" + e.slice(Re, p) + `
848
+ `, o = j(e, p);
849
+ continue;
850
+ }
851
+ }
852
+ break;
853
+ }
854
+ if (i.push({ contentCol: c, raw: f, hasBlankAfter: h, isEmpty: d }), i.length === 0) return null;
855
+ var ue = A;
856
+ if (!ue) for (var we = 0; we < i.length; we++) {
857
+ if (i[we].hasBlankAfter && we < i.length - 1) {
858
+ ue = !0;
859
+ break;
860
+ }
861
+ if (!i[we].isEmpty) {
862
+ for (var I = i[we].raw, k = I.length, F = 0, ve = !1, Ee = !1, ye = !1, de = !1, Oe = 0, He = 0, W = -1; F < k; ) {
863
+ var Q = I.indexOf(`
864
+ `, F);
865
+ if (Q < 0 && (Q = k), de) {
866
+ me(I, F, Q);
867
+ for (var Le = I.slice(F + ne, Q), cr = 0; cr < Le.length && Le.charCodeAt(cr) === Oe; ) cr++;
868
+ cr >= He && Le.slice(cr).trim() === "" && (de = !1), F = Q < k ? Q + 1 : k;
869
+ continue;
870
+ }
871
+ if (We(I, F, Q)) {
872
+ W >= 0 ? ye = !0 : ve && (Ee = !0), F = Q < k ? Q + 1 : k;
873
+ continue;
874
+ }
875
+ if (me(I, F, Q), W >= 0) {
876
+ if (le >= W) {
877
+ F = Q < k ? Q + 1 : k;
878
+ continue;
879
+ }
880
+ var tr = gr(I, F, Q);
881
+ if (tr && tr.markerCol < W && tr.contentCol <= W) {
882
+ F = Q < k ? Q + 1 : k;
883
+ continue;
884
+ }
885
+ if (tr) {
886
+ F = Q < k ? Q + 1 : k;
887
+ continue;
888
+ }
889
+ W = -1, ye && (Ee = !0, ye = !1);
890
+ }
891
+ var Fr = I.slice(F + ne, Q), Ke = Fr.charCodeAt(0);
892
+ if ((Ke === te || Ke === Ne) && le <= 3) {
893
+ for (var Ye = 0; Ye < Fr.length && Fr.charCodeAt(Ye) === Ke; ) Ye++;
894
+ if (Ye >= 3) {
895
+ if (Ee && ve) {
896
+ ue = !0;
897
+ break;
898
+ }
899
+ de = !0, Oe = Ke, He = Ye, ve = !0, F = Q < k ? Q + 1 : k;
900
+ continue;
901
+ }
902
+ }
903
+ var Ar = le <= 3 ? gr(I, F, Q) : null;
904
+ if (Ar && ve) {
905
+ if (Ee) {
906
+ ue = !0;
907
+ break;
908
+ }
909
+ W = Ar.contentCol, ye = !1, F = Q < k ? Q + 1 : k, ve = !0;
910
+ continue;
911
+ }
912
+ if (Ee) {
913
+ ue = !0;
914
+ break;
915
+ }
916
+ ve = !0, F = Q < k ? Q + 1 : k;
917
+ }
918
+ if (ue) break;
919
+ }
920
+ }
921
+ for (var ar = [], Ge = 0; Ge < i.length; Ge++) {
922
+ for (var nr = i[Ge], Cr = nr.raw, fr = Cr.length; fr > 0 && Cr.charCodeAt(fr - 1) === _; ) fr--;
923
+ var Me = fr < Cr.length ? Cr.slice(0, fr) : Cr, Ur = null;
924
+ if (Me.length >= 3 && Me.charCodeAt(0) === Ae) {
925
+ var Nr = Me[1];
926
+ (Nr === " " || Nr === "x" || Nr === "X") && Me.charCodeAt(2) === qe && (Ur = { type: x.gfmTask, completed: Nr === "x" || Nr === "X" }, Me = Me.slice(3));
927
+ }
928
+ var Be;
929
+ if (nr.isEmpty && Me.trim() === "") Be = [];
930
+ else if (ue) {
931
+ var lr = r.inList;
932
+ r.inList = !0, Be = br(Me, r, a), r.inList = lr;
933
+ } else {
934
+ var dr = r.inList;
935
+ if (r.inList = !0, Be = br(Me, r, a), r.inList = dr, Be.length === 1 && Be[0].type === x.paragraph) Be = Be[0].children;
936
+ else {
937
+ for (var Dr = [], Sr = 0; Sr < Be.length; Sr++) if (Be[Sr].type === x.paragraph) for (var $r = Be[Sr].children, Wr = 0; Wr < $r.length; Wr++) Dr.push($r[Wr]);
938
+ else Dr.push(Be[Sr]);
939
+ Be = Dr;
940
+ }
941
+ }
942
+ Ur ? ar.push([Ur, { type: x.text, text: " " }, ...Be]) : ar.push(Be);
943
+ }
944
+ return { node: { type: l.ordered ? x.orderedList : x.unorderedList, start: l.ordered ? l.start : void 0, items: ar }, end: o };
945
+ }
946
+ var st = /* @__PURE__ */ new Set(["address", "article", "aside", "base", "basefont", "blockquote", "body", "caption", "center", "col", "colgroup", "dd", "details", "dialog", "dir", "div", "dl", "dt", "fieldset", "figcaption", "figure", "footer", "form", "frame", "frameset", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hr", "html", "iframe", "legend", "li", "link", "main", "menu", "menuitem", "nav", "noframes", "ol", "optgroup", "option", "p", "param", "search", "section", "summary", "table", "tbody", "td", "tfoot", "th", "thead", "title", "tr", "track", "ul"]);
947
+ function sr(e, t, r) {
948
+ let a = {};
949
+ for (let [i, o] of Object.entries(e)) {
950
+ let c = i, f = i.toLowerCase();
951
+ if (f === "style" && typeof o == "string") {
952
+ let d = {}, h = [], A = 0, C = 0;
953
+ for (let s = 0; s < o.length; s++) {
954
+ let u = o.charCodeAt(s);
955
+ u === Ve ? A++ : u === Qe ? A-- : u === Mt && A === 0 && (h.push(o.slice(C, s)), C = s + 1);
956
+ }
957
+ C < o.length && h.push(o.slice(C));
958
+ let g = !1;
959
+ h.forEach((s) => {
960
+ let u = s.indexOf(":");
961
+ if (u === -1) return;
962
+ let v = s.slice(0, u).trim(), m = s.slice(u + 1).trim();
963
+ if (v && m) {
964
+ if (/url\s*\(\s*(javascript|vbscript|data:(?!image\/))/i.test(m)) {
965
+ g = !0;
966
+ return;
967
+ }
968
+ let y = v.indexOf("-") !== -1 ? v.replace(/-([a-z])/g, (T, L) => L.toUpperCase()) : v;
969
+ d[y] = m;
970
+ }
971
+ }), !g && Object.keys(d).length > 0 && (a[c] = d);
972
+ } else if ((f === "href" || f === "src") && r?.sanitizer) {
973
+ let d = r.sanitizer(o, t, f);
974
+ d !== null && (a[c] = d);
975
+ } else if (o === "") a[c] = !0;
976
+ else if (o.length >= 2 && o.charCodeAt(0) === Hr && o.charCodeAt(o.length - 1) === vt) {
977
+ var n = o.slice(1, -1);
978
+ if (n.length > 0) {
979
+ var l = n.charCodeAt(0);
980
+ if (l === Ae || l === Hr) try {
981
+ a[c] = JSON.parse(n);
982
+ continue;
983
+ } catch {
984
+ }
985
+ }
986
+ if (n === "true") {
987
+ a[c] = !0;
988
+ continue;
989
+ }
990
+ if (n === "false") {
991
+ a[c] = !1;
992
+ continue;
993
+ }
994
+ if (r?.evalUnserializableExpressions) try {
995
+ a[c] = (0, eval)("(" + n + ")");
996
+ continue;
997
+ } catch {
998
+ }
999
+ a[c] = n;
1000
+ } else a[c] = o;
1001
+ }
1002
+ return a;
1003
+ }
1004
+ function yr(e, t, r) {
1005
+ let a = t.length;
1006
+ var n = t.charCodeAt(0);
1007
+ n >= V && n <= ae && (n += xr);
1008
+ for (let i = r; i <= e.length - a; i++) {
1009
+ var l = e.charCodeAt(i);
1010
+ if (l >= V && l <= ae && (l += xr), l !== n) continue;
1011
+ let o = !0;
1012
+ for (let c = 1; c < a; c++) {
1013
+ let f = e.charCodeAt(i + c), d = t.charCodeAt(c);
1014
+ if (f >= V && f <= ae && (f += xr), d >= V && d <= ae && (d += xr), f !== d) {
1015
+ o = !1;
1016
+ break;
1017
+ }
1018
+ }
1019
+ if (o) return i;
1020
+ }
1021
+ return -1;
1022
+ }
1023
+ function Pn(e, t, r) {
1024
+ let a = t.length;
1025
+ var n = t.charCodeAt(0);
1026
+ n >= V && n <= ae && (n += xr);
1027
+ for (let i = Math.min(r, e.length - a); i >= 0; i--) {
1028
+ var l = e.charCodeAt(i);
1029
+ if (l >= V && l <= ae && (l += xr), l !== n) continue;
1030
+ let o = !0;
1031
+ for (let c = 1; c < a; c++) {
1032
+ let f = e.charCodeAt(i + c), d = t.charCodeAt(c);
1033
+ if (f >= V && f <= ae && (f += xr), d >= V && d <= ae && (d += xr), f !== d) {
1034
+ o = !1;
1035
+ break;
1036
+ }
1037
+ }
1038
+ if (o) return i;
1039
+ }
1040
+ return -1;
1041
+ }
1042
+ var ht = -1;
1043
+ function St(e, t, r) {
1044
+ let a = r.toLowerCase(), n = "<" + a, l = "</" + a, i = 1, o = t, c = e.length;
1045
+ for (ht = -1; o < c && i > 0; ) {
1046
+ let h = yr(e, n, o), A = yr(e, l, o);
1047
+ if (A === -1) return -1;
1048
+ if (h !== -1 && h < A) {
1049
+ let C = hr(e, h);
1050
+ C ? (C.tag.toLowerCase() === a && !C.isClosing && !C.selfClosing && !Zr(C.tag) && i++, o = C.end) : o = h + 1;
1051
+ } else {
1052
+ var f = A + l.length, d = f < c ? e.charCodeAt(f) : 62;
1053
+ if ((d === q || d === B || d === S || d === _) && (i--, i === 0)) {
1054
+ ht = A;
1055
+ let C = A + l.length;
1056
+ for (; C < c && e.charCodeAt(C) !== q; ) C++;
1057
+ return C + 1;
1058
+ }
1059
+ o = A + 1;
1060
+ }
1061
+ }
1062
+ return -1;
1063
+ }
1064
+ function wa(e, t, r, a) {
1065
+ if (a.ignoreHTMLBlocks || a.disableParsingRawHTML) return null;
1066
+ var n = ie(e, t);
1067
+ if (me(e, t, n), le > 3 && !r.inHTML) return null;
1068
+ var l = t + ne;
1069
+ if (e.charCodeAt(l) !== oe) return null;
1070
+ var i = e.indexOf(">", l + 1);
1071
+ if (i !== -1 && i < n) {
1072
+ var o = e.slice(l + 1, i);
1073
+ if (/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(o) || /^[^\s@]+@[^\s@]+$/.test(o)) return null;
1074
+ }
1075
+ var c = En(e, l);
1076
+ if (c >= 1 && c <= 5) {
1077
+ var f = e.length;
1078
+ if (c === 1) {
1079
+ for (var d = e.length, h = 0; h < Nt.length; h++) {
1080
+ var A = yr(e, "</" + Nt[h] + ">", l);
1081
+ A >= 0 && A < d && (d = A);
1082
+ }
1083
+ if (d < e.length) {
1084
+ var C = e.indexOf(">", d);
1085
+ f = C >= 0 ? j(e, C + 1) : e.length;
1086
+ }
1087
+ } else {
1088
+ var g = c === 2 ? "-->" : c === 3 ? "?>" : c === 4 ? ">" : "]]>", s = e.indexOf(g, l);
1089
+ s >= 0 && (f = j(e, s + g.length));
1090
+ }
1091
+ var u = e.slice(l, f);
1092
+ if (c >= 2) return { node: { type: x.htmlComment, text: u, raw: !0, endPos: f }, end: f };
1093
+ var v = "div", m = u.match(/^<\/?([a-zA-Z][a-zA-Z0-9-]*)/);
1094
+ m && (v = m[1]);
1095
+ var y = hr(e, l), T = {}, L;
1096
+ y && !y.isClosing && (T = sr(y.attrs, v, a), L = y.whitespaceBeforeAttrs + y.rawAttrs);
1097
+ var p = [], O = v.toLowerCase(), N = "</" + O, P = yr(u, N, 0), w = u, E = "";
1098
+ if (y && y.isClosing) for (w = u.slice(y.end - l); w.length > 0 && w.charCodeAt(w.length - 1) === _; ) w = w.slice(0, -1);
1099
+ else if (y && !y.isClosing) {
1100
+ var H = y.end - l;
1101
+ if (P !== -1) for (w = u.slice(H), w.charCodeAt(0) === _ && (w = w.slice(1)); w.length > 0 && w.charCodeAt(w.length - 1) === _; ) w = w.slice(0, -1);
1102
+ else for (w = u; w.length > 0 && w.charCodeAt(w.length - 1) === _; ) w = w.slice(0, -1);
1103
+ if (P !== -1) {
1104
+ var J = u.slice(H, P);
1105
+ E = J.trim();
1106
+ }
1107
+ }
1108
+ var z = y ? y.isClosing : !1;
1109
+ return { node: { type: x.htmlBlock, tag: v, attrs: T, e: L, children: p, a: w, text: E, c: !0, b: z, endPos: f, canInterruptParagraph: !0 }, end: f };
1110
+ }
1111
+ if (c === 6 || c === 7) {
1112
+ var R = ia(e, t), b = R < e.length ? R : e.length, Z = e.slice(l, b), K = R < e.length ? j(e, R) : e.length, M = hr(e, l);
1113
+ if (M) {
1114
+ var se = M.tag, fe = se.toLowerCase(), Pe = M.isClosing;
1115
+ if (Pe) {
1116
+ var Y = e.slice(M.end, b);
1117
+ return { node: { type: x.htmlBlock, tag: se, attrs: {}, children: [], a: Y, text: Y, c: !0, b: !0, endPos: b, canInterruptParagraph: c === 6 }, end: K };
1118
+ }
1119
+ if (M.selfClosing || Zr(se)) return { node: { type: x.htmlBlock, tag: se, attrs: sr(M.attrs, se, a), e: M.whitespaceBeforeAttrs + M.rawAttrs, children: [], a: "", text: "", c: !1, b: !1, endPos: M.end, canInterruptParagraph: c === 6 }, end: j(e, M.end) };
1120
+ var he = r.d || 0, U = e.slice(l, b), G = -1, Re = -1;
1121
+ if (he < 10) {
1122
+ for (var ce = "</" + fe, $e = M.end - l, ue = 1, we = $e; we < U.length && ue > 0; ) {
1123
+ var I = yr(U, "<" + fe, we), k = yr(U, ce, we);
1124
+ if (k === -1) break;
1125
+ if (I !== -1 && I < k) {
1126
+ var F = I + fe.length + 1;
1127
+ if (F < U.length) {
1128
+ var ve = U.charCodeAt(F);
1129
+ (ve === B || ve === S || ve === _ || ve === q || ve === ke) && ue++;
1130
+ }
1131
+ we = I + 1;
1132
+ } else {
1133
+ var Ee = k + ce.length;
1134
+ if (Ee < U.length) {
1135
+ var ye = U.charCodeAt(Ee);
1136
+ if ((ye === q || ye === B || ye === S || ye === _) && (ue--, ue === 0)) {
1137
+ G = k;
1138
+ for (var de = Ee; de < U.length && U.charCodeAt(de) !== q; ) de++;
1139
+ Re = de + 1;
1140
+ break;
1141
+ }
1142
+ } else if (ue--, ue === 0) {
1143
+ G = k, Re = U.length;
1144
+ break;
1145
+ }
1146
+ we = k + 1;
1147
+ }
1148
+ }
1149
+ var Oe = !1;
1150
+ if (G === -1 && c === 6 && !M.isClosing && !yn.has(fe)) {
1151
+ var He = St(e, M.end, fe);
1152
+ if (He !== -1) {
1153
+ var W = ht, Q = e.substring(M.end, W);
1154
+ if (Q.indexOf(`
1155
+
1156
+ `) !== -1) {
1157
+ var Le = ie(e, He);
1158
+ b = Le, K = j(e, Le), U = e.slice(l, b), Z = e.slice(l, b), G = W - l, Re = He - l, Oe = !0;
1159
+ }
1160
+ }
1161
+ }
1162
+ }
1163
+ var cr = M.rawAttrs.indexOf(`
1164
+ `) !== -1 || M.whitespaceBeforeAttrs.indexOf(`
1165
+ `) !== -1, tr = !1;
1166
+ if (G !== -1) {
1167
+ var Fr = U.slice(Re).trim();
1168
+ tr = Fr.length === 0;
1169
+ }
1170
+ var Ke = !1, Ye = b, Ar = K;
1171
+ if (G !== -1) {
1172
+ var ar = l + Re, Ge = ie(e, ar - 1);
1173
+ if (ar < Ge) {
1174
+ for (var nr = ar; nr < Ge && (e.charCodeAt(nr) === B || e.charCodeAt(nr) === S); ) nr++;
1175
+ if (nr < Ge && e.charCodeAt(nr) === oe) {
1176
+ var Cr = hr(e, nr);
1177
+ Cr && !Cr.isClosing && (Ke = !0, Ye = ar, Ar = ar, tr = !0);
1178
+ }
1179
+ }
1180
+ if (!Ke) {
1181
+ var fr = j(e, Ge);
1182
+ if (fr < b) {
1183
+ for (var Me = fr; Me < b && (e.charCodeAt(Me) === B || e.charCodeAt(Me) === S); ) Me++;
1184
+ if (Me < b && e.charCodeAt(Me) === oe) {
1185
+ var Ur = hr(e, Me);
1186
+ Ur && (Ke = !0, Ye = Ge, Ar = fr, tr = !0);
1187
+ }
1188
+ }
1189
+ }
1190
+ if (!Ke && r.inHTML) {
1191
+ Ke = !0, Ye = Ge, Ar = j(e, Ge);
1192
+ var Nr = e.slice(ar, Ge).trim();
1193
+ tr = Nr.length === 0;
1194
+ }
1195
+ }
1196
+ var Be = [], lr = "";
1197
+ if (G !== -1) {
1198
+ lr = U.slice(M.end - l, G);
1199
+ var dr = lr.trim();
1200
+ if (dr) {
1201
+ var { inline: Dr, inHTML: Sr, d: $r } = r;
1202
+ r.inHTML = !0, r.d = he + 1;
1203
+ var Wr = fe === "p";
1204
+ if (Wr) r.inline = !0, Be = _e(dr, 0, dr.length, r, a);
1205
+ else {
1206
+ var Ta = lr.indexOf(`
1207
+
1208
+ `) !== -1, Na = /^(\s{0,3}#[#\s]|\s{0,3}[-*+]\s|\s{0,3}\d+\.\s|\s{0,3}>\s|\s{0,3}```)/m.test(dr), _t = /^<([a-z][^ >/\n\r]*) ?([^>]*?)>/im.test(dr), Sa = Ta || Na || r.inHTML && _t;
1209
+ Sa || _t ? (r.inline = !1, Be = br(lr, r, a)) : (r.inline = !0, Be = _e(dr, 0, dr.length, r, a));
1210
+ }
1211
+ r.inline = Dr, r.inHTML = Sr, r.d = $r;
1212
+ }
1213
+ }
1214
+ var Ft = !1;
1215
+ if (c === 6 && G !== -1 && !r.inHTML && !cr) {
1216
+ var mt = lr, Pa = /<[a-zA-Z][^>]*>/.test(mt), Ea = /\n\n/.test(mt) || /^(\s{0,3}#[#\s]|\s{0,3}[-*+]\s|\s{0,3}\d+\.\s|\s{0,3}>\s|\s{0,3}```)/m.test(mt);
1217
+ Pa && !Ea && (Ft = !0);
1218
+ }
1219
+ var Oa = r.inHTML || c === 7 || cr || !tr || Ft;
1220
+ if (Oa) {
1221
+ var Xe;
1222
+ if (G !== -1 && Ke) {
1223
+ var Ut = !1;
1224
+ if (r.inHTML && Re < U.length) {
1225
+ for (var et = Re; et < U.length && U.charCodeAt(et) !== _; ) et++;
1226
+ var xt = U.slice(Re, et).trim();
1227
+ Ut = xt.length > 1 && xt.charCodeAt(0) === oe && xt.charCodeAt(1) !== ke;
1228
+ }
1229
+ Xe = Ut ? U.slice(M.end - l) : lr;
1230
+ } else (c === 7 || r.inHTML) && G !== -1 ? (Xe = U.slice(M.end - l), Xe.charCodeAt(0) === _ && (Xe = Xe.slice(1))) : Ke ? Xe = e.slice(l, Ye) : cr ? Xe = Z : (Xe = U.slice(M.end - l), Xe.charCodeAt(0) === _ && (Xe = Xe.slice(1)));
1231
+ return { node: { type: x.htmlBlock, tag: se, attrs: sr(M.attrs, se, a), e: M.whitespaceBeforeAttrs + M.rawAttrs, children: Be, a: Xe, text: Xe, c: !0, b: !1, endPos: Ye, canInterruptParagraph: c === 6 }, end: Ar };
1232
+ }
1233
+ return { node: { type: x.htmlBlock, tag: se, attrs: sr(M.attrs, se, a), e: M.whitespaceBeforeAttrs + M.rawAttrs, children: Be, a: Oe ? "" : lr, text: lr, c: !1, b: !1, endPos: Ye, canInterruptParagraph: c === 6 }, end: Ar };
1234
+ }
1235
+ var rt = Z.match(/^<(\/?)([a-zA-Z][a-zA-Z0-9-]*)/), Ha = rt ? rt[2] : "div", Dt = rt ? rt[1] === "/" : !1, yt = Z;
1236
+ if (Dt) {
1237
+ var Wt = Z.indexOf(">");
1238
+ Wt !== -1 && (yt = Z.slice(Wt + 1));
1239
+ }
1240
+ return { node: { type: x.htmlBlock, tag: Ha, attrs: {}, children: [], a: yt, text: yt, c: !0, b: Dt, endPos: b, canInterruptParagraph: c === 6 }, end: K };
1241
+ }
1242
+ var Ie = hr(e, l);
1243
+ if (!Ie) return null;
1244
+ var vr = Ie.tag, kt = vr.toLowerCase(), Xt = vr.charCodeAt(0), tt = Xt >= V && Xt <= ae;
1245
+ if (!tt && !st.has(kt) && !Qr.has(kt) && !kt.includes("-")) return null;
1246
+ if (Ie.isClosing) return { node: { type: x.htmlSelfClosing, tag: vr, attrs: {}, endPos: Ie.end, b: !0, a: e.slice(l, Ie.end) }, end: Ie.end };
1247
+ var Pr = St(e, Ie.end, vr), Xr = [];
1248
+ if (Pr !== -1) {
1249
+ var Ra = ht, at = e.slice(Ie.end, Ra), jr = at.trim();
1250
+ if (jr) {
1251
+ var Ma = at.indexOf(`
1252
+
1253
+ `) !== -1, Ia = /^(\s{0,3}#[#\s]|\s{0,3}[-*+]\s|\s{0,3}\d+\.\s|\s{0,3}>\s|\s{0,3}```)/m.test(jr), Ja = /^<([a-z][^ >/\n\r]*) ?([^>]*?)>/im.test(jr), za = r.inline, _a = r.inHTML, Fa = r.d;
1254
+ r.inHTML = !0, r.d = (r.d || 0) + 1, Ma || Ia || Ja ? (r.inline = !1, Xr = br(at, r, a)) : (r.inline = !0, Xr = _e(jr, 0, jr.length, r, a)), r.inline = za, r.inHTML = _a, r.d = Fa;
1255
+ }
1256
+ var Ua = ie(e, Pr), Da = e.slice(Pr, Ua).trim(), bt = Da ? Pr : j(e, Pr), jt = tt ? e.slice(l, Pr) : e.slice(l, bt), Wa = tt ? Pr : bt;
1257
+ return { node: { type: x.htmlBlock, tag: vr, attrs: sr(Ie.attrs, vr, a), e: Ie.whitespaceBeforeAttrs + Ie.rawAttrs, children: Xr, a: jt, text: tt ? at : jt, c: !0, b: !1, endPos: Wa, canInterruptParagraph: !1 }, end: bt };
1258
+ }
1259
+ var Rr = ia(e, Ie.end), Xa = Rr < e.length ? j(e, Rr) : Rr, wt = e.slice(Ie.end, Rr);
1260
+ if (wt.trim()) {
1261
+ var { inline: ja, inHTML: qa, d: Ka } = r;
1262
+ r.inline = !1, r.inHTML = !0, r.d = (r.d || 0) + 1, Xr = br(wt, r, a), r.inline = ja, r.inHTML = qa, r.d = Ka;
1263
+ }
1264
+ var Ya = e.slice(Ie.end, Rr);
1265
+ return { node: { type: x.htmlBlock, tag: vr, attrs: sr(Ie.attrs, vr, a), e: Ie.whitespaceBeforeAttrs + Ie.rawAttrs, children: Xr, a: Ya, text: wt, c: !0, b: !1, endPos: Rr, canInterruptParagraph: !1 }, end: Xa };
1266
+ }
1267
+ function En(e, t) {
1268
+ if (e.charCodeAt(t) !== oe) return 0;
1269
+ var r = t + 1, a = e.length;
1270
+ if (e.charCodeAt(r) === Ue && e.charCodeAt(r + 1) === D && e.charCodeAt(r + 2) === D) return 2;
1271
+ if (e.charCodeAt(r) === _r) return 3;
1272
+ if (e.charCodeAt(r) === Ue) {
1273
+ var n = e.charCodeAt(r + 1);
1274
+ if (n >= V && n <= ae) return 4;
1275
+ if (e.slice(r + 1, r + 8) === "[CDATA[") return 5;
1276
+ }
1277
+ for (var l = e.charCodeAt(r) === ke, i = l ? r + 1 : r, o = i; o < a; ) {
1278
+ var c = e.charCodeAt(o);
1279
+ if (c >= V && c <= ae || c >= Ce && c <= ge || c >= ee && c <= re || c === D) o++;
1280
+ else break;
1281
+ }
1282
+ if (o === i) return 0;
1283
+ var f = e.slice(i, o);
1284
+ if (Qr.has(f.toLowerCase())) {
1285
+ if (l) return 0;
1286
+ var d = e.charCodeAt(o);
1287
+ return d === B || d === S || d === q || d === _ || o >= a ? 1 : 0;
1288
+ }
1289
+ if (st.has(f.toLowerCase())) {
1290
+ if (l) {
1291
+ for (var h = o; h < a && (e.charCodeAt(h) === B || e.charCodeAt(h) === S); ) h++;
1292
+ return h < a && e.charCodeAt(h) === q ? 6 : 0;
1293
+ }
1294
+ var A = o < a ? e.charCodeAt(o) : -1;
1295
+ return A === B || A === S || A === q || A === _ || A === ke || A === -1 ? 6 : 0;
1296
+ }
1297
+ if (l) {
1298
+ for (var C = o; C < a && (e.charCodeAt(C) === B || e.charCodeAt(C) === S); ) C++;
1299
+ if (C < a && e.charCodeAt(C) === q) {
1300
+ var g = ie(e, t), s = e.slice(C + 1, g).trim();
1301
+ if (s === "") return 7;
1302
+ }
1303
+ } else {
1304
+ var u = ie(e, t), v = hr(e, t);
1305
+ if (v && v.end <= u) {
1306
+ var m = e.slice(v.end, u).trim();
1307
+ if (m === "") return 7;
1308
+ }
1309
+ }
1310
+ return 0;
1311
+ }
1312
+ function ca(e, t, r) {
1313
+ for (var a = 0, n = e.length; a < n && (e.charCodeAt(a) === B || e.charCodeAt(a) === S); ) a++;
1314
+ for (; n > a && (e.charCodeAt(n - 1) === B || e.charCodeAt(n - 1) === S); ) n--;
1315
+ a < n && e.charCodeAt(a) === Te && a++, n > a && e.charCodeAt(n - 1) === Te && (n - 2 < a || e.charCodeAt(n - 2) !== be) && n--;
1316
+ for (var l = [], i = a, o = !1, c = [], f = a; f < n; ) {
1317
+ var d = e.charCodeAt(f);
1318
+ if (d === be && f + 1 < n) {
1319
+ e.charCodeAt(f + 1) === Te ? (o || (o = !0, c = []), c.push(e.slice(i, f)), c.push("|"), f += 2, i = f) : f += 2;
1320
+ continue;
1321
+ }
1322
+ if (d === te) {
1323
+ for (var h = 0; f < n && e.charCodeAt(f) === te; ) h++, f++;
1324
+ for (var A = !1; f < n && !A; ) {
1325
+ for (var C = 0; f < n && e.charCodeAt(f) === te; ) C++, f++;
1326
+ C === h ? A = !0 : C === 0 && f++;
1327
+ }
1328
+ continue;
1329
+ }
1330
+ if (d === Te) {
1331
+ var g = o ? (c.push(e.slice(i, f)), c.join("")) : e.slice(i, f);
1332
+ l.push(g.trim()), f++, i = f, o = !1, c = [];
1333
+ continue;
1334
+ }
1335
+ f++;
1336
+ }
1337
+ var s = o ? (c.push(e.slice(i, n)), c.join("")) : e.slice(i, n);
1338
+ return l.push(s.trim()), l.map(function(u) {
1339
+ var v = u.indexOf("\\|") !== -1 ? u.replace(/\\\|/g, "|") : u;
1340
+ return _e(v, 0, v.length, t, r);
1341
+ });
1342
+ }
1343
+ function fa(e, t, r, a) {
1344
+ let n = ie(e, t);
1345
+ var l = e.indexOf("|", t);
1346
+ if (l < 0 || l >= n) return null;
1347
+ let i = j(e, n);
1348
+ if (i >= e.length) return null;
1349
+ let o = ie(e, i);
1350
+ if (!ga(e, i, o)) return null;
1351
+ let c = e.slice(t, n), f = e.slice(i, o);
1352
+ for (var d = [], h = 0, A = f.length; h < A && (f.charCodeAt(h) === B || f.charCodeAt(h) === S); ) h++;
1353
+ for (h < A && f.charCodeAt(h) === Te && h++; h < A; ) {
1354
+ for (; h < A && (f.charCodeAt(h) === B || f.charCodeAt(h) === S); ) h++;
1355
+ if (h >= A || f.charCodeAt(h) === Te) break;
1356
+ var C = f.charCodeAt(h) === ze;
1357
+ for (C && h++; h < A && f.charCodeAt(h) === D; ) h++;
1358
+ var g = h < A && f.charCodeAt(h) === ze;
1359
+ for (g && h++, d.push(C && g ? "center" : g ? "right" : C ? "left" : null); h < A && (f.charCodeAt(h) === B || f.charCodeAt(h) === S); ) h++;
1360
+ h < A && f.charCodeAt(h) === Te && h++;
1361
+ }
1362
+ let s = ca(c, r, a);
1363
+ if (d.length !== s.length) return null;
1364
+ let u = [], v = j(e, o);
1365
+ for (; v < e.length; ) {
1366
+ let O = ie(e, v), N = e.slice(v, O);
1367
+ if (We(e, v, O)) break;
1368
+ if (me(e, v, O), le < 4) {
1369
+ var m = e.charCodeAt(v + ne);
1370
+ if (m === q || m === or || (m === D || m === xe || m === pe) && kr(e, v)) break;
1371
+ if (m === te || m === Ne) {
1372
+ for (var y = v + ne, T = 0; y < O && e.charCodeAt(y) === m; ) T++, y++;
1373
+ if (T >= 3) break;
1374
+ }
1375
+ }
1376
+ u.push(ca(N, r, a)), v = j(e, O);
1377
+ }
1378
+ if ((a.streaming || a.optimizeForStreaming) && u.length === 0) return null;
1379
+ for (var L = s.length, p = 0; p < u.length; p++) if (u[p].length < L) for (; u[p].length < L; ) u[p].push([]);
1380
+ else u[p].length > L && (u[p].length = L);
1381
+ return { node: { type: x.table, header: s, cells: u, align: d }, end: v };
1382
+ }
1383
+ function On(e, t, r) {
1384
+ var a = ie(e, t);
1385
+ if (me(e, t, a), le > 3) return null;
1386
+ var n = t + ne;
1387
+ if (e.charCodeAt(n) !== Ae) return null;
1388
+ if (n + 1 < e.length && e.charCodeAt(n + 1) === rr) {
1389
+ var l = Hn(e, n, r);
1390
+ return l || null;
1391
+ }
1392
+ r.refs || (r.refs = {});
1393
+ var i = xa(e, n, r.refs);
1394
+ return i === null ? null : { node: { type: x.refCollection }, end: i };
1395
+ }
1396
+ function Hn(e, t, r) {
1397
+ var a = e.length;
1398
+ if (e.charCodeAt(t) !== Ae || t + 1 >= a || e.charCodeAt(t + 1) !== rr) return null;
1399
+ for (var n = t + 2, l = n; n < a && e.charCodeAt(n) !== qe; ) {
1400
+ if (e.charCodeAt(n) === _) return null;
1401
+ n++;
1402
+ }
1403
+ if (n >= a) return null;
1404
+ var i = ("^" + e.slice(l, n)).toLowerCase();
1405
+ if (n++, n >= a || e.charCodeAt(n) !== ze) return null;
1406
+ for (n++; n < a && (e.charCodeAt(n) === B || e.charCodeAt(n) === S); ) n++;
1407
+ if (n < a && e.charCodeAt(n) === _) for (n++; n < a && (e.charCodeAt(n) === B || e.charCodeAt(n) === S); ) n++;
1408
+ var o = e.indexOf(`
1409
+ `, n);
1410
+ o < 0 && (o = a);
1411
+ for (var c = e.slice(n, o).trim(), f = o < a ? o + 1 : a; f < a; ) {
1412
+ var d = ie(e, f);
1413
+ if (me(e, f, d), le >= 2 && !We(e, f, d)) c += `
1414
+ ` + e.slice(f, d), f = j(e, d);
1415
+ else if (We(e, f, d)) {
1416
+ var h = j(e, d);
1417
+ if (h < a) {
1418
+ var A = ie(e, h);
1419
+ if (me(e, h, A), le >= 2) {
1420
+ c += `
1421
+ `, f = j(e, d);
1422
+ continue;
1423
+ }
1424
+ }
1425
+ break;
1426
+ } else break;
1427
+ }
1428
+ return r.refs[i] || (r.refs[i] = { target: c, title: void 0 }), { node: { type: x.footnote }, end: f };
1429
+ }
1430
+ function Rn(e, t, r, a) {
1431
+ let n = t, l = 0, i = 0, o = -1;
1432
+ for (; n < e.length; ) {
1433
+ let E = o >= 0 ? o : ie(e, n);
1434
+ if (o = -1, We(e, n, E)) break;
1435
+ if (me(e, n, E), le < 4 && i > 0 && !r.f) {
1436
+ let J = e.charCodeAt(n + ne);
1437
+ if (J === De || J === D) {
1438
+ let z = n + ne;
1439
+ for (; z < E && e.charCodeAt(z) === J; ) z++;
1440
+ for (; z < E && (e.charCodeAt(z) === B || e.charCodeAt(z) === S); ) z++;
1441
+ if (z >= E) {
1442
+ l = J === De ? 1 : 2, n = j(e, E);
1443
+ break;
1444
+ }
1445
+ }
1446
+ }
1447
+ i = E;
1448
+ let H = j(e, E);
1449
+ if (H < e.length) {
1450
+ if (e.charCodeAt(H) === ct) {
1451
+ var c = ie(e, H);
1452
+ n = j(e, c), i = c;
1453
+ continue;
1454
+ }
1455
+ let J = ie(e, H);
1456
+ if (o = J, me(e, H, J), le < 4) {
1457
+ let z = e.charCodeAt(H + ne);
1458
+ if (z === q) {
1459
+ n = H;
1460
+ break;
1461
+ }
1462
+ if (z === or && ka(e, H, r, a)) {
1463
+ n = H;
1464
+ break;
1465
+ }
1466
+ if (z === te || z === Ne) {
1467
+ for (var f = H + ne, d = 0; f < J && e.charCodeAt(f) === z; ) d++, f++;
1468
+ if (d >= 3) {
1469
+ n = H;
1470
+ break;
1471
+ }
1472
+ }
1473
+ if (z === oe) {
1474
+ var h = H + ne + 1, A = h < J ? e.charCodeAt(h) : 0, C = A === Ue || A === _r;
1475
+ if (!C && A === ke) {
1476
+ for (var g = h + 1, s = g; s < J && (e.charCodeAt(s) >= V && e.charCodeAt(s) <= ae || e.charCodeAt(s) >= Ce && e.charCodeAt(s) <= ge || e.charCodeAt(s) >= ee && e.charCodeAt(s) <= re || e.charCodeAt(s) === D); ) s++;
1477
+ s > g && (C = st.has(e.slice(g, s).toLowerCase()));
1478
+ } else if (!C) {
1479
+ for (var u = h; u < J && (e.charCodeAt(u) >= V && e.charCodeAt(u) <= ae || e.charCodeAt(u) >= Ce && e.charCodeAt(u) <= ge || e.charCodeAt(u) >= ee && e.charCodeAt(u) <= re || e.charCodeAt(u) === D); ) u++;
1480
+ if (u > h) {
1481
+ var v = e.slice(h, u).toLowerCase();
1482
+ C = st.has(v) || Qr.has(v);
1483
+ }
1484
+ }
1485
+ if (C && wa(e, H, r, a)) {
1486
+ n = H;
1487
+ break;
1488
+ }
1489
+ }
1490
+ if (z === D || z === xe || z === Tr) {
1491
+ let R = H + ne + 1;
1492
+ if (R < J && (e.charCodeAt(R) === B || e.charCodeAt(R) === S)) {
1493
+ var m = Gr(e, R, J);
1494
+ if (m < J && !kr(e, H)) {
1495
+ n = H;
1496
+ break;
1497
+ }
1498
+ }
1499
+ }
1500
+ if (z >= ee && z <= re) {
1501
+ let R = H + ne;
1502
+ for (; R < J && e.charCodeAt(R) >= ee && e.charCodeAt(R) <= re; ) R++;
1503
+ if (R < J && (e.charCodeAt(R) === Ze || e.charCodeAt(R) === Qe) && R - (H + ne) === 1 && e.charCodeAt(H + ne) === 49) {
1504
+ var y = R + 1;
1505
+ if (y < J && (e.charCodeAt(y) === B || e.charCodeAt(y) === S)) {
1506
+ var T = Gr(e, y, J);
1507
+ if (T < J) {
1508
+ n = H;
1509
+ break;
1510
+ }
1511
+ }
1512
+ }
1513
+ }
1514
+ if (z === Te) {
1515
+ let R = j(e, J);
1516
+ if (R < e.length) {
1517
+ let b = ie(e, R);
1518
+ if (ga(e, R, b)) {
1519
+ n = H;
1520
+ break;
1521
+ }
1522
+ }
1523
+ }
1524
+ if ((z === D || z === xe || z === pe) && kr(e, H)) {
1525
+ if (z !== D) {
1526
+ n = H;
1527
+ break;
1528
+ }
1529
+ let R = H + ne;
1530
+ for (; R < J && e.charCodeAt(R) === D; ) R++;
1531
+ for (; R < J && (e.charCodeAt(R) === B || e.charCodeAt(R) === S); ) R++;
1532
+ if (R < J) {
1533
+ n = H;
1534
+ break;
1535
+ }
1536
+ }
1537
+ }
1538
+ }
1539
+ n = j(e, E);
1540
+ }
1541
+ for (var L = l ? i : n; L > t && (e.charCodeAt(L - 1) === _ || e.charCodeAt(L - 1) === wr || e.charCodeAt(L - 1) === B || e.charCodeAt(L - 1) === S); ) L--;
1542
+ for (var p = t; p < L && (e.charCodeAt(p) === B || e.charCodeAt(p) === S); ) p++;
1543
+ if (p >= L) return null;
1544
+ for (var O = !1, N = p; N < L; N++) if (e.charCodeAt(N) === ct) {
1545
+ O = !0;
1546
+ break;
1547
+ }
1548
+ var P = O ? e.slice(p, L).replace(/\u001E/g, "") : e.slice(p, L);
1549
+ if (!P) return null;
1550
+ let w = Mn(P, 0, P.length, r, a);
1551
+ if (l) {
1552
+ let E = (a?.slugify || ir)(P);
1553
+ return { node: { type: x.heading, level: l, children: w, id: E }, end: n };
1554
+ }
1555
+ return { node: { type: x.paragraph, children: w }, end: n };
1556
+ }
1557
+ function Mn(e, t, r, a, n) {
1558
+ var l = e.indexOf(`
1559
+ `, t);
1560
+ if (l < 0 || l >= r) return _e(e, t, r, a, n);
1561
+ for (var i = "", o = t, c = t; c < r; ) {
1562
+ var f = e.charCodeAt(c);
1563
+ if (f === te) {
1564
+ var d = gt(e, c, r);
1565
+ if (d > c) {
1566
+ for (var h = !1, A = c; A < d; A++) if (e.charCodeAt(A) === _) {
1567
+ h = !0;
1568
+ break;
1569
+ }
1570
+ h && (i += e.slice(o, c), i += e.slice(c, d).replace(/\n/g, " "), o = d), c = d;
1571
+ continue;
1572
+ }
1573
+ }
1574
+ if (f === oe) {
1575
+ var C = La(e, c, r);
1576
+ if (C > c) {
1577
+ c = C;
1578
+ continue;
1579
+ }
1580
+ }
1581
+ if (f === _) {
1582
+ var g = !1, s = 0;
1583
+ if (c > t && e.charCodeAt(c - 1) === be) g = !0, s = 1;
1584
+ else {
1585
+ for (var u = 0, v = c - 1; v >= t && e.charCodeAt(v) === B; ) u++, v--;
1586
+ u >= 2 && (g = !0, s = u);
1587
+ }
1588
+ if (g) i += e.slice(o, c - s), i += "";
1589
+ else {
1590
+ for (var m = c; m > o && e.charCodeAt(m - 1) === B; ) m--;
1591
+ i += e.slice(o, m) + `
1592
+ `;
1593
+ }
1594
+ for (c++; c < r && e.charCodeAt(c) === B; ) c++;
1595
+ o = c;
1596
+ continue;
1597
+ }
1598
+ c++;
1599
+ }
1600
+ return o < r && (i += e.slice(o, r)), _e(i, 0, i.length, a, n);
1601
+ }
1602
+ function In(e, t, r) {
1603
+ if (e.charCodeAt(t) !== te) return null;
1604
+ let a = ur(e, t, r, 96), n = t + a;
1605
+ for (; n < r; ) {
1606
+ let l = e.indexOf("`", n);
1607
+ if (l < 0 || l >= r) return null;
1608
+ let i = ur(e, l, r, 96);
1609
+ if (i === a) {
1610
+ let o = e.slice(t + a, l);
1611
+ return o = o.replace(/\n/g, " "), o.length > 0 && o[0] === " " && o[o.length - 1] === " " && o.trim().length > 0 && (o = o.slice(1, -1)), { node: { type: x.codeInline, text: o }, end: l + i };
1612
+ }
1613
+ n = l + i;
1614
+ }
1615
+ return null;
1616
+ }
1617
+ function gt(e, t, r) {
1618
+ if (e.charCodeAt(t) !== te) return t;
1619
+ let a = ur(e, t, r, 96), n = t + a;
1620
+ for (; n < r; ) {
1621
+ let l = e.indexOf("`", n);
1622
+ if (l < 0 || l >= r) return t;
1623
+ let i = ur(e, l, r, 96);
1624
+ if (i === a) return l + i;
1625
+ n = l + i;
1626
+ }
1627
+ return t;
1628
+ }
1629
+ function La(e, t, r) {
1630
+ if (e.charCodeAt(t) !== oe) return t;
1631
+ if (t + 1 < r && e.charCodeAt(t + 1) === ke) {
1632
+ let f = t + 2;
1633
+ for (; f < r && e.charCodeAt(f) !== q; ) f++;
1634
+ return f < r ? f + 1 : t;
1635
+ }
1636
+ if (t + 3 < r && e.charCodeAt(t + 1) === Ue && e.charCodeAt(t + 2) === D && e.charCodeAt(t + 3) === D) {
1637
+ let f = e.indexOf("-->", t + 4);
1638
+ return f >= 0 ? f + 3 : t;
1639
+ }
1640
+ let a = t + 1, n = a;
1641
+ for (; a < r; ) {
1642
+ let f = e.charCodeAt(a);
1643
+ if (f >= V && f <= ae || f >= Ce && f <= ge || f >= ee && f <= re || f === D) a++;
1644
+ else break;
1645
+ }
1646
+ if (a === n) return t;
1647
+ let l = e.slice(n, a).toLowerCase(), i = !1;
1648
+ for (; a < r; ) {
1649
+ let f = e.charCodeAt(a);
1650
+ if (f === q) {
1651
+ a++;
1652
+ break;
1653
+ }
1654
+ if (f === ke && a + 1 < r && e.charCodeAt(a + 1) === q) {
1655
+ a += 2, i = !0;
1656
+ break;
1657
+ }
1658
+ if (f === Br || f === Lr) {
1659
+ var o = f;
1660
+ for (a++; a < r && e.charCodeAt(a) !== o; ) a++;
1661
+ a < r && a++;
1662
+ continue;
1663
+ }
1664
+ if (f === _) return t;
1665
+ a++;
1666
+ }
1667
+ if (i || Zr(l)) return a;
1668
+ let c = 1;
1669
+ for (; a < r && c > 0; ) if (e.charCodeAt(a) === oe) if (a + 1 < r && e.charCodeAt(a + 1) === ke) {
1670
+ let f = a + 2, d = f;
1671
+ for (; d < r && (e.charCodeAt(d) >= V && e.charCodeAt(d) <= ae || e.charCodeAt(d) >= Ce && e.charCodeAt(d) <= ge); ) d++;
1672
+ if (e.slice(f, d).toLowerCase() === l) {
1673
+ for (; d < r && e.charCodeAt(d) !== q; ) d++;
1674
+ if (d < r && d++, c--, c === 0) return d;
1675
+ }
1676
+ a = d;
1677
+ } else {
1678
+ let f = a + 1, d = f;
1679
+ for (; d < r && (e.charCodeAt(d) >= V && e.charCodeAt(d) <= ae || e.charCodeAt(d) >= Ce && e.charCodeAt(d) <= ge); ) d++;
1680
+ e.slice(f, d).toLowerCase() === l && c++, a++;
1681
+ }
1682
+ else a++;
1683
+ return a;
1684
+ }
1685
+ function Jn(e, t, r, a, n) {
1686
+ if (e.charCodeAt(t) !== Ne || t + 1 >= r || e.charCodeAt(t + 1) !== Ne) return null;
1687
+ let l = t + 2;
1688
+ for (; l + 1 < r; ) {
1689
+ let i = e.charCodeAt(l);
1690
+ if (i === te) {
1691
+ let o = gt(e, l, r);
1692
+ if (o > l) {
1693
+ l = o;
1694
+ continue;
1695
+ }
1696
+ }
1697
+ if (i === Ne && e.charCodeAt(l + 1) === Ne) {
1698
+ let o = e.slice(t + 2, l), c = _e(o, 0, o.length, a, n);
1699
+ return { node: { type: x.textFormatted, tag: "del", children: c }, end: l + 2 };
1700
+ }
1701
+ i === be && l + 1 < r && l++, l++;
1702
+ }
1703
+ return null;
1704
+ }
1705
+ function zn(e, t, r, a, n) {
1706
+ if (e.charCodeAt(t) !== De || t + 1 >= r || e.charCodeAt(t + 1) !== De) return null;
1707
+ let l = t + 2;
1708
+ for (; l + 1 < r; ) {
1709
+ let i = e.charCodeAt(l);
1710
+ if (i === te) {
1711
+ let o = gt(e, l, r);
1712
+ if (o > l) {
1713
+ l = o;
1714
+ continue;
1715
+ }
1716
+ }
1717
+ if (i === De && e.charCodeAt(l + 1) === De && l > t + 2) {
1718
+ let o = e.slice(t + 2, l), c = _e(o, 0, o.length, a, n);
1719
+ return { node: { type: x.textFormatted, tag: "mark", children: c }, end: l + 2 };
1720
+ }
1721
+ i === be && l + 1 < r && l++, l++;
1722
+ }
1723
+ return null;
1724
+ }
1725
+ var _n = /[\p{P}\p{S}]/u;
1726
+ function da(e, t, r) {
1727
+ return e < Vr ? !!(Jt(e) & $) : _n.test(t[r]);
1728
+ }
1729
+ function sa(e, t, r) {
1730
+ return e < Vr ? !!(Jt(e) & Mr) : new RegExp("\\p{Zs}", "u").test(t[r]);
1731
+ }
1732
+ function Fn(e, t, r) {
1733
+ var a = e.charCodeAt(t);
1734
+ if (a !== xe && a !== pe) return null;
1735
+ var n = ur(e, t, r, a);
1736
+ if (n === 0) return null;
1737
+ var l = t > 0 ? e.charCodeAt(t - 1) : 32, i = t + n < r ? e.charCodeAt(t + n) : 32, o = sa(l, e, t - 1), c = sa(i, e, t + n), f = t > 0 ? da(l, e, t - 1) : !1, d = t + n < r ? da(i, e, t + n) : !1, h = !c && (!d || o || f), A = !o && (!f || c || d), C, g;
1738
+ return a === xe ? (C = h, g = A) : (C = h && (!A || f), g = A && (!h || d)), { len: n, canOpen: C, canClose: g };
1739
+ }
1740
+ function Un(e, t, r, a) {
1741
+ if (t.length !== 0) {
1742
+ for (var n = [], l = 0; l < 12; l++) n[l] = -1;
1743
+ for (var i = 0; i < t.length; ) {
1744
+ var o = t[i];
1745
+ if (!o.active || !o.canClose) {
1746
+ i++;
1747
+ continue;
1748
+ }
1749
+ for (var c = o.ch === xe ? 0 : 1, f = c * 6 + o.len % 3 * 2 + (o.canOpen ? 1 : 0), d = n[f] !== void 0 ? n[f] : -1, h = -1, A = i - 1; A > d; A--) {
1750
+ var C = t[A];
1751
+ if (!(!C.active || C.ch !== o.ch || !C.canOpen) && !((o.canOpen || C.canClose) && (C.len + o.len) % 3 === 0 && C.len % 3 !== 0)) {
1752
+ h = A;
1753
+ break;
1754
+ }
1755
+ }
1756
+ if (h < 0) {
1757
+ n[f] = i - 1, !o.canOpen && (o.active = !1), i++;
1758
+ continue;
1759
+ }
1760
+ var g = t[h], s = g.len >= 2 && o.len >= 2, u = s ? 2 : 1;
1761
+ g.len -= u, o.len -= u;
1762
+ var v = e[g.idx], m = e[o.idx];
1763
+ v.text = v.text.slice(0, v.text.length - u), m.text = m.text.slice(u);
1764
+ var y = g.idx + 1, T = o.idx, L = e.slice(y, T), p = { type: x.textFormatted, tag: s ? "strong" : "em", children: L };
1765
+ e.splice(y, T - y, p);
1766
+ for (var O = T - y - 1, N = 0; N < t.length; N++) t[N].idx > g.idx && (t[N].idx -= O);
1767
+ for (var P = h + 1; P < i; P++) t[P].active = !1;
1768
+ if (g.len === 0 && (g.active = !1, v.text === "")) {
1769
+ e.splice(g.idx, 1);
1770
+ for (var w = 0; w < t.length; w++) t[w].idx > g.idx ? t[w].idx-- : t[w].idx === g.idx && (t[w].idx = -1);
1771
+ }
1772
+ if (o.len === 0) {
1773
+ o.active = !1;
1774
+ var E = o.idx;
1775
+ if (m.text === "") {
1776
+ e.splice(E, 1);
1777
+ for (var H = 0; H < t.length; H++) t[H].idx > E ? t[H].idx-- : t[H].idx === E && (t[H].idx = -1);
1778
+ }
1779
+ } else continue;
1780
+ i++;
1781
+ }
1782
+ for (var J = 0, z = 0; z < e.length; z++) {
1783
+ var R = e[z];
1784
+ if (R.type === x.text) {
1785
+ var b = R;
1786
+ if (b.text === "") continue;
1787
+ if (J > 0 && e[J - 1].type === x.text) {
1788
+ e[J - 1].text += b.text;
1789
+ continue;
1790
+ }
1791
+ }
1792
+ e[J++] = R;
1793
+ }
1794
+ e.length = J;
1795
+ }
1796
+ }
1797
+ function ha(e, t, r, a, n) {
1798
+ let l = e.charCodeAt(t) === Ue, i = l ? t + 1 : t;
1799
+ if (e.charCodeAt(i) !== Ae) return null;
1800
+ var o = e.indexOf("]", i + 1);
1801
+ if (o < 0 || o >= r) return null;
1802
+ for (var c = i + 1, f = -1, d = 1; c < r && d > 0; ) {
1803
+ var h = e.charCodeAt(c);
1804
+ if (h === be && c + 1 < r) {
1805
+ c += 2;
1806
+ continue;
1807
+ }
1808
+ if (h === te) {
1809
+ var A = gt(e, c, r);
1810
+ if (A > c) {
1811
+ c = A;
1812
+ continue;
1813
+ }
1814
+ }
1815
+ if (h === oe) {
1816
+ var C = Ba(e, c, r);
1817
+ if (C) {
1818
+ c = C.end;
1819
+ continue;
1820
+ }
1821
+ var g = La(e, c, r);
1822
+ if (g > c) {
1823
+ c = g;
1824
+ continue;
1825
+ }
1826
+ }
1827
+ h === Ae ? d++ : h === qe && d--, c++;
1828
+ }
1829
+ if (d !== 0) return null;
1830
+ var s = c - 1, u = e.slice(i + 1, s), v = c < r ? e.charCodeAt(c) : 0, m = !1;
1831
+ if (v === Ve) {
1832
+ var y = !0;
1833
+ for (c++; c < r && (e.charCodeAt(c) === B || e.charCodeAt(c) === _); ) c++;
1834
+ var T = "", L = c;
1835
+ if (c < r && e.charCodeAt(c) === oe) {
1836
+ for (c++, L = c; L < r && e.charCodeAt(L) !== q; ) {
1837
+ if (e.charCodeAt(L) === be && L + 1 < r) {
1838
+ L += 2;
1839
+ continue;
1840
+ }
1841
+ if (e.charCodeAt(L) === _) {
1842
+ y = !1;
1843
+ break;
1844
+ }
1845
+ L++;
1846
+ }
1847
+ y && (L >= r || e.charCodeAt(L) !== q) && (y = !1), y && (T = e.slice(c, L), L++);
1848
+ } else if (y) {
1849
+ for (var p = 0; L < r; ) {
1850
+ var O = e.charCodeAt(L);
1851
+ if (O === be && L + 1 < r) {
1852
+ L += 2;
1853
+ continue;
1854
+ }
1855
+ if (O === Ve) p++;
1856
+ else if (O === Qe) {
1857
+ if (p === 0) break;
1858
+ p--;
1859
+ } else if (O === B || O === _) break;
1860
+ L++;
1861
+ }
1862
+ T = e.slice(c, L);
1863
+ }
1864
+ if (y) {
1865
+ for (c = L; c < r && (e.charCodeAt(c) === B || e.charCodeAt(c) === _); ) c++;
1866
+ var N;
1867
+ if (c < r) {
1868
+ var P = e.charCodeAt(c);
1869
+ if (P === Br || P === Lr || P === Ve) {
1870
+ var w = P === Ve ? 41 : P;
1871
+ c++;
1872
+ for (var E = c; c < r && e.charCodeAt(c) !== w; ) e.charCodeAt(c) === be && c + 1 < r && c++, c++;
1873
+ c >= r ? y = !1 : (N = e.slice(E, c), c++);
1874
+ }
1875
+ }
1876
+ if (y) {
1877
+ for (; c < r && (e.charCodeAt(c) === B || e.charCodeAt(c) === _); ) c++;
1878
+ (c >= r || e.charCodeAt(c) !== Qe) && (y = !1);
1879
+ }
1880
+ }
1881
+ if (y) {
1882
+ c++, T = Jr(T), N !== void 0 && (N = pt(Jr(N)));
1883
+ var H = n?.sanitizer || It, J = H(T, l ? "img" : "a", l ? "src" : "href"), z = J === null ? null : T;
1884
+ if (l) {
1885
+ var R = _e(u, 0, u.length, a, n), b = ut(R);
1886
+ return { node: { type: x.image, target: z, alt: b, title: N }, end: c };
1887
+ } else {
1888
+ var Z = a.inAnchor;
1889
+ a.inAnchor = !0;
1890
+ var U = Z ? [{ type: x.text, text: u }] : _e(u, 0, u.length, a, n);
1891
+ return a.inAnchor = Z, !a.inAnchor && Pt(U) ? null : { node: { type: x.link, target: z, title: N, children: U }, end: c };
1892
+ }
1893
+ } else c = s + 1, m = !0;
1894
+ }
1895
+ var K = "", M = c;
1896
+ if (!m && v === Ae) {
1897
+ var se = c + 1;
1898
+ M = se;
1899
+ for (var fe = !1; M < r && e.charCodeAt(M) !== qe; ) {
1900
+ if (e.charCodeAt(M) === be && M + 1 < r) {
1901
+ M += 2;
1902
+ continue;
1903
+ }
1904
+ if (e.charCodeAt(M) === Ae) {
1905
+ fe = !0;
1906
+ break;
1907
+ }
1908
+ M++;
1909
+ }
1910
+ if (fe || M >= r) return null;
1911
+ var Pe = e.slice(se, M);
1912
+ if (Pe.trim()) K = it(Pe);
1913
+ else {
1914
+ if (la(u)) return null;
1915
+ K = it(u);
1916
+ }
1917
+ M = M + 1;
1918
+ } else {
1919
+ if (la(u)) return null;
1920
+ K = it(u);
1921
+ }
1922
+ var Y = a.refs[K];
1923
+ if (!Y) return null;
1924
+ if (l) return { node: { type: x.image, target: Y.target, alt: ut(_e(u, 0, u.length, a, n)), title: Y.title }, end: M };
1925
+ var he = a.inAnchor;
1926
+ a.inAnchor = !0;
1927
+ var U = he ? [{ type: x.text, text: u }] : _e(u, 0, u.length, a, n);
1928
+ return a.inAnchor = he, !a.inAnchor && Pt(U) ? null : { node: { type: x.link, target: Y.target, title: Y.title, children: U }, end: M };
1929
+ }
1930
+ function Ba(e, t, r) {
1931
+ if (e.charCodeAt(t) !== oe) return null;
1932
+ for (var a = t + 1; a < r; ) {
1933
+ var n = e.charCodeAt(a);
1934
+ if (n === q) break;
1935
+ if (n === B || n === _ || n === wr || n === oe) return null;
1936
+ a++;
1937
+ }
1938
+ if (a >= r || e.charCodeAt(a) !== q) return null;
1939
+ var l = e.slice(t + 1, a), i = l.match(/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^\x00-\x20]*)$/);
1940
+ return i ? { node: { type: x.link, target: l, children: [{ type: x.text, text: l }] }, end: a + 1 } : l.indexOf("@") !== -1 && /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(l) ? { node: { type: x.link, target: "mailto:" + l, children: [{ type: x.text, text: l }] }, end: a + 1 } : null;
1941
+ }
1942
+ function Dn(e, t, r, a) {
1943
+ if (e.charCodeAt(t) !== Ae || t + 1 >= r || e.charCodeAt(t + 1) !== rr) return null;
1944
+ let n = t + 2;
1945
+ for (; n < r && e.charCodeAt(n) !== qe && e.charCodeAt(n) !== _; ) n++;
1946
+ if (n >= r || e.charCodeAt(n) !== qe) return null;
1947
+ let l = e.slice(t + 2, n);
1948
+ return l ? { node: { type: x.footnoteReference, target: "#" + ir(l), text: l }, end: n + 1 } : null;
1949
+ }
1950
+ function Wn(e, t, r, a) {
1951
+ if (a.disableBareUrls) return null;
1952
+ var n = "", l = !1, i = e.charCodeAt(t);
1953
+ if (i === Ct || i === 72 ? t + 8 <= r && e.charCodeAt(t + 1) === Lt && e.charCodeAt(t + 2) === Lt && e.charCodeAt(t + 3) === Yt && (e.charCodeAt(t + 4) === $a && e.charCodeAt(t + 5) === ze && e.charCodeAt(t + 6) === ke && e.charCodeAt(t + 7) === ke ? n = "https://" : e.charCodeAt(t + 4) === ze && e.charCodeAt(t + 5) === ke && e.charCodeAt(t + 6) === ke && (n = "http://")) : i === zr || i === 70 ? t + 6 <= r && e.charCodeAt(t + 1) === Lt && e.charCodeAt(t + 2) === Yt && e.charCodeAt(t + 3) === ze && e.charCodeAt(t + 4) === ke && e.charCodeAt(t + 5) === ke && (n = "ftp://") : (i === Ir || i === 87) && t + 4 <= r && e.charCodeAt(t + 1) === Ir && e.charCodeAt(t + 2) === Ir && e.charCodeAt(t + 3) === Ze && (n = "www.", l = !0), !n) return null;
1954
+ let o = t + n.length;
1955
+ for (; o < r; ) {
1956
+ let p = e.charCodeAt(o);
1957
+ if (p === B || p === _ || p === S || p === wr || p === oe || p === q) break;
1958
+ o++;
1959
+ }
1960
+ for (var c = 0, f = 0, d = t; d < o; d++) {
1961
+ var h = e.charCodeAt(d);
1962
+ h === Ve ? c++ : h === Qe && f++;
1963
+ }
1964
+ let A = o;
1965
+ for (; A > t + n.length; ) {
1966
+ let p = e.charCodeAt(A - 1);
1967
+ if (p === Ze || p === Aa || p === ze || p === Ue || p === _r || p === Qe) {
1968
+ if (p === Qe) {
1969
+ if (c >= f) break;
1970
+ f--;
1971
+ }
1972
+ A--;
1973
+ } else if (p === Mt) {
1974
+ for (var C = A - 2; C > t && (e.charCodeAt(C) >= V && e.charCodeAt(C) <= ae || e.charCodeAt(C) >= Ce && e.charCodeAt(C) <= ge || e.charCodeAt(C) >= ee && e.charCodeAt(C) <= re); ) C--;
1975
+ C >= t && e.charCodeAt(C) === Rt ? A = C : A--;
1976
+ } else break;
1977
+ }
1978
+ if (A <= t + n.length) return null;
1979
+ var g = t + (l ? 4 : n.length), s = e.indexOf("/", g);
1980
+ if ((s < 0 || s > A) && (s = A), l && e.indexOf(".", g) === -1) return null;
1981
+ for (var u = -1, v = -1, m = s - 1; m >= g; m--) if (e.charCodeAt(m) === Ze) if (u < 0) u = m;
1982
+ else {
1983
+ v = m;
1984
+ break;
1985
+ }
1986
+ for (var y = v >= 0 ? v + 1 : g, m = y; m < s; m++) if (e.charCodeAt(m) === pe) return null;
1987
+ var T = e.slice(t, A), L = l ? "http://" + T : T;
1988
+ return { node: { type: x.link, target: L, children: [{ type: x.text, text: T }] }, end: A };
1989
+ }
1990
+ function Xn(e, t, r, a) {
1991
+ if (a.disableBareUrls) return null;
1992
+ for (var n = t, l = n; n < r; ) {
1993
+ var i = e.charCodeAt(n);
1994
+ if (i >= V && i <= ae || i >= Ce && i <= ge || i >= ee && i <= re || i === Ze || i === Ue || i === or || i === 36 || i === ot || i === Rt || i === Lr || i === xe || i === Tr || i === ke || i === De || i === _r || i === rr || i === pe || i === te || i === Hr || i === Te || i === vt || i === Ne || i === D) n++;
1995
+ else break;
1996
+ }
1997
+ if (n === l || n >= r || e.charCodeAt(n) !== At) return null;
1998
+ n++;
1999
+ for (var o = n, c = -1, f = n; n < r; ) {
2000
+ var i = e.charCodeAt(n);
2001
+ if (i >= V && i <= ae || i >= Ce && i <= ge || i >= ee && i <= re) n++;
2002
+ else if ((i === D || i === pe) && n > o) n++;
2003
+ else if (i === Ze) {
2004
+ if (n === o) break;
2005
+ var d = e.charCodeAt(n - 1);
2006
+ if (d === D || d === pe || n - f > 63) break;
2007
+ if (n + 1 < r) {
2008
+ var h = e.charCodeAt(n + 1);
2009
+ if (h >= V && h <= ae || h >= Ce && h <= ge || h >= ee && h <= re) c = n, f = n + 1, n++;
2010
+ else break;
2011
+ } else break;
2012
+ } else break;
2013
+ }
2014
+ if (n - f > 63 || c < 0) return null;
2015
+ var A = e.charCodeAt(n - 1);
2016
+ if (!(A >= V && A <= ae || A >= Ce && A <= ge || A >= ee && A <= re) || n <= c + 1) return null;
2017
+ for (var C = -1, g = c - 1; g >= o; g--) if (e.charCodeAt(g) === Ze) {
2018
+ C = g;
2019
+ break;
2020
+ }
2021
+ for (var s = C >= 0 ? C + 1 : o, g = s; g < n; g++) if (e.charCodeAt(g) === pe) return null;
2022
+ var u = e.slice(t, n);
2023
+ return { node: { type: x.link, target: "mailto:" + u, children: [{ type: x.text, text: u }] }, end: n };
2024
+ }
2025
+ function Pt(e) {
2026
+ for (var t = 0; t < e.length; t++) if (e[t].type === x.link || "children" in e[t] && Array.isArray(e[t].children) && Pt(e[t].children)) return !0;
2027
+ return !1;
2028
+ }
2029
+ function ut(e) {
2030
+ for (var t = "", r = 0; r < e.length; r++) {
2031
+ var a = e[r];
2032
+ a.type === x.text ? t += a.text : a.type === x.breakLine ? t += " " : a.type === x.codeInline ? t += a.text : "children" in a && Array.isArray(a.children) ? t += ut(a.children) : a.type === x.image ? t += a.alt || "" : a.type === x.link && (t += ut(a.children));
2033
+ }
2034
+ return t;
2035
+ }
2036
+ function Or(e) {
2037
+ let t = e.includes("&") ? pt(e) : e;
2038
+ return { type: x.text, text: t };
2039
+ }
2040
+ function jn(e, t, r, a, n) {
2041
+ if (e.charCodeAt(t) !== oe) return null;
2042
+ var l = t + 1;
2043
+ if (l >= r) return null;
2044
+ var i = e.charCodeAt(l);
2045
+ if (i === Ue && l + 1 < r && e.charCodeAt(l + 1) === D && l + 2 < r && e.charCodeAt(l + 2) === D) {
2046
+ var o = l + 3;
2047
+ if (o < r && e.charCodeAt(o) === q) return { node: { type: x.htmlComment, text: "", endsWithGreaterThan: !0 }, end: o + 1 };
2048
+ if (o + 1 < r && e.charCodeAt(o) === D && e.charCodeAt(o + 1) === q) return { node: { type: x.htmlComment, text: "-", endsWithGreaterThan: !0 }, end: o + 2 };
2049
+ var c = e.indexOf("-->", o);
2050
+ return c !== -1 && c <= r - 3 ? { node: { type: x.htmlComment, text: e.slice(t + 4, c) }, end: c + 3 } : null;
2051
+ }
2052
+ if (i === _r) {
2053
+ var f = e.indexOf("?>", l + 1);
2054
+ return f !== -1 && f < r ? { node: { type: x.htmlSelfClosing, tag: "?", attrs: {}, a: e.slice(t, f + 2) }, end: f + 2 } : null;
2055
+ }
2056
+ if (i === Ue && l + 1 < r) {
2057
+ var d = e.charCodeAt(l + 1);
2058
+ if (d === Ae && e.slice(l + 1, l + 8) === "[CDATA[") {
2059
+ var h = e.indexOf("]]>", l + 8);
2060
+ return h !== -1 && h < r ? { node: { type: x.htmlSelfClosing, tag: "![CDATA[", attrs: {}, a: e.slice(t, h + 3) }, end: h + 3 } : null;
2061
+ }
2062
+ if (d >= V && d <= ae) {
2063
+ var A = e.indexOf(">", l + 2);
2064
+ return A !== -1 && A < r ? { node: { type: x.htmlSelfClosing, tag: "!" + e.slice(l + 1, A), attrs: {}, a: e.slice(t, A + 1) }, end: A + 1 } : null;
2065
+ }
2066
+ }
2067
+ if (i === ke) {
2068
+ var C = l + 1;
2069
+ if (C >= r) return null;
2070
+ var g = e.charCodeAt(C);
2071
+ if (!(g >= V && g <= ae || g >= Ce && g <= ge)) return null;
2072
+ for (C++; C < r; ) {
2073
+ var s = e.charCodeAt(C);
2074
+ if (s >= V && s <= ae || s >= Ce && s <= ge || s >= ee && s <= re || s === D) C++;
2075
+ else break;
2076
+ }
2077
+ for (; C < r && (e.charCodeAt(C) === B || e.charCodeAt(C) === S || e.charCodeAt(C) === _); ) C++;
2078
+ if (C < r && e.charCodeAt(C) === q) {
2079
+ var u = e.slice(l + 1, C).trim();
2080
+ return { node: { type: x.htmlSelfClosing, tag: u, attrs: {}, a: e.slice(t, C + 1), b: !0 }, end: C + 1 };
2081
+ }
2082
+ return null;
2083
+ }
2084
+ if (!(i >= V && i <= ae || i >= Ce && i <= ge)) return null;
2085
+ var v = hr(e, t);
2086
+ if (!v) return null;
2087
+ var m = v.tag, y = m.toLowerCase(), T = v.selfClosing;
2088
+ if (T || Zr(m)) return { node: { type: x.htmlSelfClosing, tag: m, attrs: sr(v.attrs, m, n), a: e.slice(t, v.end) }, end: v.end };
2089
+ var L = Qr.has(y), p = St(e.slice(0, r), v.end, m);
2090
+ if (p === -1) return { node: { type: x.htmlSelfClosing, tag: m, attrs: sr(v.attrs, m, n), a: e.slice(t, v.end) }, end: v.end };
2091
+ var O = Pn(e, "</" + y, p), N = e.slice(v.end, O), P = [];
2092
+ if (L) N.trim() && (P = [{ type: x.text, text: N }]);
2093
+ else {
2094
+ var w = N.trim();
2095
+ if (w) {
2096
+ var { inAnchor: E, inline: H } = a;
2097
+ y === "a" && (a.inAnchor = !0);
2098
+ var J = w.indexOf(`
2099
+
2100
+ `) !== -1 || /^#{1,6}\s/.test(w);
2101
+ J ? (a.inline = !1, P = br(w, a, n)) : P = _e(w, 0, w.length, a, n), a.inAnchor = E, a.inline = H;
2102
+ }
2103
+ }
2104
+ return { node: { type: x.htmlBlock, tag: m, attrs: sr(v.attrs, m, n), e: v.rawAttrs, children: P, text: N, c: !1 }, end: p };
2105
+ }
2106
+ var qn = 200, Yr = 0;
2107
+ function _e(e, t, r, a, n) {
2108
+ if (Yr++, Yr > qn) return Yr--, [{ type: x.text, text: e.slice(t, r) }];
2109
+ let l = a;
2110
+ if (n.streaming || n.optimizeForStreaming) {
2111
+ let I = function(de, Oe) {
2112
+ for (var He = 1, W = Oe + 1; W < de.length; W++) {
2113
+ var Q = de.charCodeAt(W);
2114
+ if (Q === Ae) He++;
2115
+ else if (Q === qe && (He--, He === 0)) return W;
2116
+ }
2117
+ return -1;
2118
+ }, k = e.slice(t, r), F = k;
2119
+ for (var i = 0, o = 0, c = 0, f = 0, d = 0, h = -1, A = -1, C = -1, g = -1, s = -1, u = 0; u < k.length; u++) {
2120
+ var v = k.charCodeAt(u);
2121
+ v === xe ? u + 1 < k.length && k.charCodeAt(u + 1) === xe ? (i++, h = u, u++) : (o++, A = u) : v === pe ? u + 1 < k.length && k.charCodeAt(u + 1) === pe ? (c++, C = u, u++) : (f++, g = u) : v === Ne && u + 1 < k.length && k.charCodeAt(u + 1) === Ne && (d++, s = u, u++);
2122
+ }
2123
+ var m = [];
2124
+ d % 2 === 1 && s >= 0 && m.push([s, 2]), c % 2 === 1 && C >= 0 && m.push([C, 2]), f % 2 === 1 && g >= 0 && m.push([g, 1]), i % 2 === 1 && h >= 0 && m.push([h, 2]), o % 2 === 1 && A >= 0 && m.push([A, 1]), m.sort(function(de, Oe) {
2125
+ return Oe[0] - de[0];
2126
+ });
2127
+ for (var y = 0; y < m.length; y++) {
2128
+ var T = m[y][0], L = m[y][1];
2129
+ k = k.slice(0, T) + k.slice(T + L);
2130
+ }
2131
+ let ve = 0, Ee = -1;
2132
+ for (let de = 0; de < k.length; de++) k.charCodeAt(de) === te && (ve++, Ee = de);
2133
+ if (ve % 2 === 1 && Ee !== -1) {
2134
+ let de = !1, Oe = -1, He = 0;
2135
+ for (; He < k.length; ) k.charCodeAt(He) === te && (de ? (de = !1, Oe = -1) : (Oe = He, de = !0)), He++;
2136
+ de && Oe !== -1 && (k = k.slice(0, Oe));
2137
+ }
2138
+ for (var p = !0; p; ) {
2139
+ p = !1;
2140
+ for (var O = -1, N = -1, P = -1, w = !1, E = 0; E < k.length; E++) {
2141
+ var H = k.charCodeAt(E);
2142
+ if (H === Ae && (E === 0 || k.charCodeAt(E - 1) !== be)) {
2143
+ var J = E > 0 && k.charCodeAt(E - 1) === Ue, z = J ? E - 1 : E, R = I(k, E);
2144
+ if (R === -1) O = z, w = J, N = E + 1, P = k.length;
2145
+ else {
2146
+ var b = R + 1;
2147
+ if (b >= k.length) O = z, w = J, N = E + 1, P = R;
2148
+ else if (k.charCodeAt(b) === Ve) {
2149
+ var Z = k.indexOf(")", b + 1);
2150
+ Z === -1 ? (O = z, w = J, N = E + 1, P = R, E = k.length) : E = Z;
2151
+ } else if (k.charCodeAt(b) === Ae) {
2152
+ var K = k.indexOf("]", b + 1);
2153
+ K === -1 ? (O = z, w = J, N = E + 1, P = R, E = k.length) : E = K;
2154
+ } else E = R;
2155
+ }
2156
+ }
2157
+ }
2158
+ if (O >= 0) {
2159
+ var M = w ? "" : k.slice(N, P);
2160
+ k = k.slice(0, O) + M, p = !0;
2161
+ }
2162
+ }
2163
+ let ye = k.match(/<([A-Z][A-Za-z0-9]*)(?:\s[^>]*)?>([^<]*)$/);
2164
+ if (ye && ye.index !== void 0) {
2165
+ for (var se = !1, fe = 0, Pe = 0; Pe < ye.index; Pe++) k.charCodeAt(Pe) === te && fe++;
2166
+ if (se = fe % 2 === 1, !se) {
2167
+ let de = ye[1];
2168
+ yr(k, "</" + de, 0) === -1 && (k = k.replace(/<[A-Z][A-Za-z0-9]*(?:\s[^>]*)?>([^<]*)$/, "$1"));
2169
+ }
2170
+ }
2171
+ k !== F && (e = e.slice(0, t) + k, r = t + k.length);
2172
+ }
2173
+ let Y = [];
2174
+ var he = [];
2175
+ let U = t;
2176
+ var G = n.disableAutoLink || n.disableBareUrls || l.inAnchor ? -1 : e.indexOf("@", t);
2177
+ for (G >= r && (G = -1); t < r; ) {
2178
+ let I = e.charCodeAt(t), k = null;
2179
+ if (I === te) {
2180
+ if (k = In(e, t, r), !k) {
2181
+ var Re = ur(e, t, r, te);
2182
+ t += Re - 1;
2183
+ }
2184
+ } else if (I === xe || I === pe) {
2185
+ var ce = Fn(e, t, r);
2186
+ if (ce) {
2187
+ if (ce.canOpen || ce.canClose) {
2188
+ t > U && Y.push(Or(e.slice(U, t)));
2189
+ var $e = e.slice(t, t + ce.len), ue = Or($e);
2190
+ he.push({ idx: Y.length, ch: I, len: ce.len, canOpen: ce.canOpen, canClose: ce.canClose, active: !0 }), Y.push(ue), t += ce.len, U = t;
2191
+ continue;
2192
+ }
2193
+ t += ce.len - 1;
2194
+ }
2195
+ } else I === Ne ? k = Jn(e, t, r, l, n) : I === De ? k = zn(e, t, r, l, n) : I === Ae ? (t + 1 < r && e.charCodeAt(t + 1) === rr && (k = Dn(e, t, r)), k || (k = ha(e, t, r, l, n))) : I === Ue && t + 1 < r && e.charCodeAt(t + 1) === Ae ? k = ha(e, t, r, l, n) : I === oe ? (k = Ba(e, t, r), !k && !n.disableParsingRawHTML && !n.ignoreHTMLBlocks && (k = jn(e, t, r, l, n))) : (I === Ct || I === Ir || I === zr) && !l.inAnchor && !n.disableAutoLink && (t === 0 || e.charCodeAt(t - 1) !== oe) && (k = Wn(e, t, r, n));
2196
+ if (!k && G >= 0 && G - t <= 64 && !l.inAnchor && !n.disableAutoLink && !n.disableBareUrls && (I >= V && I <= ae || I >= Ce && I <= ge || I >= ee && I <= re) && (k = Xn(e, t, r, n), !k && t >= G && (G = e.indexOf("@", t + 1), G >= r && (G = -1))), I === Ca) {
2197
+ t > U && Y.push(Or(e.slice(U, t))), Y.push({ type: x.breakLine }), t++, U = t;
2198
+ continue;
2199
+ }
2200
+ if (k) t > U && Y.push(Or(e.slice(U, t))), Y.push(k.node), t = k.end, U = t;
2201
+ else {
2202
+ if (I === be && t + 1 < r) {
2203
+ let F = e.charCodeAt(t + 1);
2204
+ if (Jt(F) & $) {
2205
+ t > U && Y.push(Or(e.slice(U, t))), Y.push(Or(e[t + 1])), t += 2, U = t;
2206
+ continue;
2207
+ }
2208
+ }
2209
+ if (t++, G < 0 || G - t > 64) for (; t < r; ) {
2210
+ var we = e.charCodeAt(t);
2211
+ if (we < Vr && !pa[we]) t++;
2212
+ else break;
2213
+ }
2214
+ }
2215
+ }
2216
+ if (r > U) {
2217
+ let I = e.slice(U, r);
2218
+ (n.streaming || n.optimizeForStreaming) && (I = I.replace(/\*\*([^*]+)$/, "$1"), I.match(/\*[^*]+$/) && (I = I.replace(/\*([^*]+)$/, "$1")), I = I.replace(/__([^_]+)$/, "$1"), I.match(/_[^_]+$/) && (I = I.replace(/_([^_]+)$/, "$1")), I = I.replace(/~~([^~]+)$/, "$1"), I = I.replace(/\[([^\]]+)$/, "$1"), I = I.replace(/\[([^\]]+)\]\([^)]*$/, "$1")), I && Y.push(Or(I));
2219
+ }
2220
+ return he.length > 0 && Un(Y, he), Yr--, Y;
2221
+ }
2222
+ var Kn = 500;
2223
+ function br(e, t, r) {
2224
+ var a = t.g || 0;
2225
+ if (a > Kn) return [{ type: x.text, text: e }];
2226
+ if (t.g = a + 1, (r.streaming || r.optimizeForStreaming) && !t.h) {
2227
+ var n = e.length;
2228
+ n > 0 && e.charCodeAt(n - 1) === _ && n--;
2229
+ for (var l = n; l > 0 && e.charCodeAt(l - 1) !== _; ) l--;
2230
+ if (l > 0 && e.charCodeAt(l) === Te) {
2231
+ for (var i = !0, o = l; o < n; o++) {
2232
+ var c = e.charCodeAt(o);
2233
+ if (c !== B && c !== S && c !== D && c !== ze && c !== Te) {
2234
+ i = !1;
2235
+ break;
2236
+ }
2237
+ }
2238
+ if (i) {
2239
+ for (var f = l - 1; f > 0 && e.charCodeAt(f - 1) !== _; ) f--;
2240
+ e.charCodeAt(f) === Te && (e = e.slice(0, f).trimEnd());
2241
+ }
2242
+ }
2243
+ var d = e.trim(), h = d.lastIndexOf(`
2244
+ `), A = h === -1 ? d : d.slice(h + 1);
2245
+ if (A.length > 0 && A.charCodeAt(0) === Te) {
2246
+ for (var C = !1, g = !1, s = 1; s < A.length; s++) {
2247
+ var u = A.charCodeAt(s);
2248
+ u === Te && (C = !0), u === D && (g = !0);
2249
+ }
2250
+ C && g && (e = h === -1 ? "" : e.slice(0, e.lastIndexOf(A)).trimEnd());
2251
+ }
2252
+ for (var v = -1, m = -1, y = -1, T = e.length - 1; T >= 0; T--) if (e.charCodeAt(T) === oe) {
2253
+ var L = T + 1 < e.length ? e.charCodeAt(T + 1) : 0;
2254
+ if (L >= V && L <= ae || L >= Ce && L <= ge) {
2255
+ for (var p = T + 2; p < e.length; ) {
2256
+ var O = e.charCodeAt(p);
2257
+ if (O >= V && O <= ae || O >= Ce && O <= ge || O >= ee && O <= re) p++;
2258
+ else break;
2259
+ }
2260
+ for (var N = p; N < e.length && e.charCodeAt(N) !== q; ) N++;
2261
+ if (N < e.length) {
2262
+ for (var P = !1, w = N + 1; w < e.length; w++) if (e.charCodeAt(w) === oe) {
2263
+ P = !0;
2264
+ break;
2265
+ }
2266
+ P || (v = T, m = p, y = N + 1);
2267
+ }
2268
+ }
2269
+ break;
2270
+ }
2271
+ if (v >= 0) {
2272
+ for (var E = 0, H = 0; H < v; H++) e.charCodeAt(H) === te && E++;
2273
+ if (E % 2 === 0) {
2274
+ var J = e.slice(v + 1, m);
2275
+ yr(e, "</" + J, 0) === -1 && (e = e.slice(0, v) + e.slice(y));
2276
+ }
2277
+ }
2278
+ for (var z = e.length; z > 0 && e.charCodeAt(z - 1) === _; ) z--;
2279
+ if (z > 0) {
2280
+ for (var R = z; R > 0 && e.charCodeAt(R - 1) !== _; ) R--;
2281
+ for (var b = R, Z = 0; b < z && e.charCodeAt(b) === B && Z < 3; ) b++, Z++;
2282
+ if (R > 0 && b < z && Ln(e, b, z)) {
2283
+ for (var K = R - 1, M = K; M > 0 && e.charCodeAt(M - 1) !== _; ) M--;
2284
+ We(e, M, K) || (e = e.slice(0, R).trimEnd());
2285
+ }
2286
+ }
2287
+ var se = e.length;
2288
+ if (se > 0) {
2289
+ for (var fe = e.lastIndexOf(`
2290
+ `), Pe = fe === -1 ? 0 : fe + 1, Y = se, he = Pe, U = 0; he < Y && e.charCodeAt(he) === B && U < 3; ) he++, U++;
2291
+ if (he < Y) {
2292
+ var G = e.charCodeAt(he), Re = !1;
2293
+ if (G === xe || G === D || G === Tr) {
2294
+ var ce = he + 1;
2295
+ if (ce >= Y || e.charCodeAt(ce) === B || e.charCodeAt(ce) === S) {
2296
+ for (var $e = ce; $e < Y && (e.charCodeAt($e) === B || e.charCodeAt($e) === S); ) $e++;
2297
+ $e >= Y && (Re = !0);
2298
+ }
2299
+ } else if (G >= ee && G <= re) {
2300
+ for (var ue = he; ue < Y && e.charCodeAt(ue) >= ee && e.charCodeAt(ue) <= re; ) ue++;
2301
+ if (ue < Y && (e.charCodeAt(ue) === Ze || e.charCodeAt(ue) === Qe)) {
2302
+ var we = ue + 1;
2303
+ if (we >= Y || e.charCodeAt(we) === B || e.charCodeAt(we) === S) {
2304
+ for (var I = we; I < Y && (e.charCodeAt(I) === B || e.charCodeAt(I) === S); ) I++;
2305
+ I >= Y && (Re = !0);
2306
+ }
2307
+ }
2308
+ }
2309
+ Re && (e = e.slice(0, Pe).trimEnd());
2310
+ }
2311
+ }
2312
+ }
2313
+ if (t.inline) return _e(e, 0, e.length, t, r);
2314
+ let k = [], F = 0, ve = e.length;
2315
+ if (F === 0 && e.startsWith("---")) {
2316
+ let W = an(e);
2317
+ if (W && W.hasValidYaml) {
2318
+ if (r.preserveFrontmatter !== !1) {
2319
+ let Q = e.slice(0, W.endPos).trimEnd();
2320
+ k.push({ type: x.frontmatter, text: Q });
2321
+ }
2322
+ F = W.endPos;
2323
+ }
2324
+ }
2325
+ for (; F < ve; ) {
2326
+ for (var Ee = e.indexOf(`
2327
+ `, F), ye = Ee < 0 ? ve : Ee; F < ve && We(e, F, ye); ) F = ye < ve ? ye + 1 : ye, F < ve && (Ee = e.indexOf(`
2328
+ `, F), ye = Ee < 0 ? ve : Ee);
2329
+ if (F >= ve) break;
2330
+ e.charCodeAt(F), me(e, F, ye);
2331
+ let W = null;
2332
+ if (e.charCodeAt(F) !== ct && le >= 4 && !t.inHTML) W = Tn(e, F);
2333
+ else if (e.charCodeAt(F) !== ct) {
2334
+ let Q = F + ne, Le = e.charCodeAt(Q);
2335
+ Le === or ? W = ka(e, F, t, r) : Le === q ? W = Nn(e, F, t, r) : Le === te || Le === Ne ? W = Bn(e, F) : Le === D || Le === xe || Le === pe ? (W = kr(e, F), !W && (W = oa(e, F, t, r))) : Le === Tr || Le >= ee && Le <= re ? W = oa(e, F, t, r) : Le === oe ? W = wa(e, F, t, r) : Le === Te ? W = fa(e, F, t, r) : Le === Ae && (W = On(e, F, t));
2336
+ }
2337
+ if (!W) {
2338
+ for (var de = !1, Oe = F; Oe < ye; Oe++) if (e.charCodeAt(Oe) === Te) {
2339
+ de = !0;
2340
+ break;
2341
+ }
2342
+ de && (W = fa(e, F, t, r));
2343
+ }
2344
+ if (W || (W = Rn(e, F, t, r)), W) W.node.type !== x.refCollection && k.push(W.node), F = W.end;
2345
+ else {
2346
+ var He = e.indexOf(`
2347
+ `, F);
2348
+ F = He < 0 ? ve : He + 1;
2349
+ }
2350
+ }
2351
+ return t.g = a, k;
2352
+ }
2353
+ function Yn(e, t, r, a) {
2354
+ var n = hr(e, t);
2355
+ return n ? { tagName: n.tag, tagLower: n.tag.toLowerCase(), attrs: n.rawAttrs, whitespaceBeforeAttrs: n.whitespaceBeforeAttrs, isSelfClosing: n.selfClosing, hasSpaceBeforeSlash: n.hasSpaceBeforeSlash, isClosing: n.isClosing, hasNewline: n.whitespaceBeforeAttrs.includes(`
2356
+ `) || n.rawAttrs.includes(`
2357
+ `), endPos: n.end } : null;
2358
+ }
2359
+ function zt(e, t, r) {
2360
+ Yr = 0, e = un(e), !t.refs && (t.refs = {}), t.h = ma(e, t.refs);
2361
+ let a = br(e, t, r);
2362
+ return t.refs && Object.keys(t.refs).length > 0 ? [{ type: x.refCollection, refs: t.refs }, ...a] : a;
2363
+ }
2364
+ var Gn = /^\n+/, Et;
2365
+ try {
2366
+ Et = mr.createElement("div").$$typeof;
2367
+ } catch {
2368
+ Et = /* @__PURE__ */ Symbol.for("react.transitional.element");
2369
+ }
2370
+ function Ot(e, t, r) {
2371
+ var a = { $$typeof: Et, type: e, key: r != null ? "" + r : null, ref: null, props: t, i: null };
2372
+ return a;
2373
+ }
2374
+ var Vn = typeof mr.createContext < "u" ? mr.createContext(void 0) : void 0;
2375
+ function ua(e, t, r, a, n, l, i, o) {
2376
+ switch (e.type) {
2377
+ case x.blockQuote: {
2378
+ let s = { key: r.key };
2379
+ return e.alert && (s.className = "markdown-alert-" + l(e.alert.toLowerCase(), ir), e.children.unshift({ attrs: {}, children: [{ type: x.text, text: e.alert }], c: !0, type: x.htmlBlock, tag: "header" })), a("blockquote", s, t(e.children, r));
2380
+ }
2381
+ case x.breakLine:
2382
+ return a("br", { key: r.key });
2383
+ case x.breakThematic:
2384
+ return a("hr", { key: r.key });
2385
+ case x.frontmatter:
2386
+ return o.preserveFrontmatter ? a("pre", { key: r.key }, e.text) : null;
2387
+ case x.codeBlock:
2388
+ let g = e.lang ? pt(e.lang) : "";
2389
+ return a("pre", { key: r.key }, a("code", { ...je(e.attrs || {}), className: g ? `language-${g} lang-${g}` : "" }, e.text));
2390
+ case x.codeInline:
2391
+ return a("code", { key: r.key }, e.text);
2392
+ case x.footnoteReference:
2393
+ return a("a", { key: r.key, href: n(e.target, "a", "href") || void 0 }, a("sup", { key: r.key }, e.text));
2394
+ case x.gfmTask:
2395
+ return a("input", { checked: e.completed, key: r.key, readOnly: !0, type: "checkbox" });
2396
+ case x.heading:
2397
+ return a(`h${e.level}`, { id: e.id, key: r.key }, t(e.children, r));
2398
+ case x.htmlBlock: {
2399
+ let s = e;
2400
+ if (o.tagfilter && ra(s.tag)) {
2401
+ var c = "";
2402
+ if (s.attrs) for (var f in s.attrs) {
2403
+ var d = s.attrs[f];
2404
+ d === !0 ? c += " " + f : d != null && d !== !1 && (c += " " + f + '="' + String(d) + '"');
2405
+ }
2406
+ return a("span", { key: r.key }, "<" + s.tag + c + ">");
2407
+ }
2408
+ if (s.a && s.c) {
2409
+ let u = function(b) {
2410
+ if ((b.type === x.htmlSelfClosing || b.type === x.htmlBlock) && b.b) return [];
2411
+ if (b.type === x.paragraph) {
2412
+ let Z = b.children;
2413
+ return Z ? Z.flatMap(u) : [];
2414
+ }
2415
+ return b.type === x.text ? b.text?.trim() ? [b] : [] : b.type === x.htmlBlock && b.children ? [{ ...b, children: b.children?.flatMap(u) }] : [b];
2416
+ }, v = function(b) {
2417
+ for (var Z = 0; Z < b.length; Z++) b[Z].type === x.htmlBlock && (b[Z].c = !1), "children" in b[Z] && b[Z].children && v(b[Z].children);
2418
+ }, m = function(b, Z) {
2419
+ for (var K = 0; K < b.length; K++) {
2420
+ var M = b[K];
2421
+ if (M.type === x.paragraph && M.children) for (var se = M.children, fe = 0; fe < se.length; fe++) {
2422
+ var Pe = se[fe];
2423
+ if (Pe.type === x.htmlSelfClosing && Pe.b && Pe.tag.toLowerCase() === Z) {
2424
+ var Y = b.slice(0, K);
2425
+ fe > 0 && Y.push({ type: x.paragraph, children: se.slice(0, fe) });
2426
+ var he = [];
2427
+ if (fe + 1 < se.length) {
2428
+ var U = se.slice(fe + 1);
2429
+ U = U.filter(function(G) {
2430
+ return !(G.type === x.htmlSelfClosing && G.b);
2431
+ }), U.length > 0 && (he = U);
2432
+ }
2433
+ return he = he.concat(b.slice(K + 1)), { found: !0, beforeClose: Y, afterClose: he };
2434
+ }
2435
+ }
2436
+ if ((M.type === x.htmlSelfClosing || M.type === x.htmlBlock) && M.b && M.tag.toLowerCase() === Z) return { found: !0, beforeClose: b.slice(0, K), afterClose: b.slice(K + 1) };
2437
+ }
2438
+ return { found: !1, beforeClose: b, afterClose: [] };
2439
+ }, y = s.tag.toLowerCase(), T = kn(y), L = s.children && s.children.length > 0, p = /<[a-z][^>]{0,100}>/i.test(s.a);
2440
+ if (T) {
2441
+ let b = s.a.replace(new RegExp("\\s*</" + y + ">\\s*$", "i"), "");
2442
+ return o.tagfilter && (b = ta(b)), p ? a(e.tag, { key: r.key, ...je(e.attrs || {}), dangerouslySetInnerHTML: { __html: b } }) : a(e.tag, { key: r.key, ...je(e.attrs || {}) }, b);
2443
+ }
2444
+ let O = new RegExp(`^<${s.tag}(\\s|>)`, "i").test(s.a);
2445
+ if (L && !O && o.tagfilter && pn(s.a)) return a(e.tag, { key: r.key, ...je(e.attrs || {}) }, t(s.children, r));
2446
+ if (bn(s.a)) {
2447
+ let b = o.tagfilter ? ta(s.a) : s.a;
2448
+ return a(e.tag, { key: r.key, ...je(e.attrs || {}), dangerouslySetInnerHTML: { __html: b } });
2449
+ }
2450
+ let N = { slugify: (b) => l(b, ir), sanitizer: n, tagfilter: !0 }, P = s.a.replace(/>\s+</g, "><").replace(/\n+/g, " ").trim();
2451
+ if (new RegExp(`^<${s.tag}(\\s[^>]*)?>(\\s*</${s.tag}>)?$`, "i").test(P)) return s.children && s.children.length > 0 ? a(e.tag, { key: r.key, ...je(e.attrs || {}) }, t(s.children, r)) : a(e.tag, { key: r.key, ...je(e.attrs || {}) });
2452
+ let w = zt(P, { inline: !1, refs: i, inHTML: !1 }, N);
2453
+ v(w);
2454
+ let E = s.tag.toLowerCase(), H = "</" + E + ">", J = new RegExp(`^<${s.tag}(\\s|>)`, "i").test(P), z = P.toLowerCase().trimEnd().endsWith(H), R = J && z;
2455
+ if (R && L) return a(e.tag, { key: r.key, ...je(e.attrs || {}) }, t(s.children, r));
2456
+ if (R) return t(w.flatMap(u), r);
2457
+ var h = m(w, E);
2458
+ if (h.found && h.afterClose.length > 0) {
2459
+ var A = h.beforeClose.flatMap(u), C = h.afterClose.flatMap(u);
2460
+ return Ot(mr.Fragment, { children: [a(e.tag, { key: r.key, ...je(e.attrs || {}) }, t(A, r)), t(C, r)] }, null);
2461
+ }
2462
+ return a(e.tag, { key: r.key, ...je(e.attrs || {}) }, t(w.flatMap(u), r));
2463
+ }
2464
+ return Zr(e.tag) ? a(e.tag, { key: r.key, ...je(e.attrs || {}) }) : a(e.tag, { key: r.key, ...je(e.attrs || {}) }, e.children ? t(e.children, r) : "");
2465
+ }
2466
+ case x.htmlSelfClosing: {
2467
+ let s = e;
2468
+ if (o.tagfilter && ra(s.tag)) {
2469
+ var c = "";
2470
+ if (s.attrs) for (var f in s.attrs) {
2471
+ var d = s.attrs[f];
2472
+ d === !0 ? c += " " + f : d != null && d !== !1 && (c += " " + f + '="' + String(d) + '"');
2473
+ }
2474
+ return a("span", { key: r.key }, "<" + s.tag + c + " />");
2475
+ }
2476
+ return a(e.tag, { key: r.key, ...je(e.attrs || {}) });
2477
+ }
2478
+ case x.image: {
2479
+ let s = e.target != null ? n(e.target, "img", "src") : null;
2480
+ return a("img", { key: r.key, alt: e.alt && e.alt.length > 0 ? e.alt : void 0, title: e.title || void 0, src: s || void 0 });
2481
+ }
2482
+ case x.link: {
2483
+ let s = { key: r.key };
2484
+ return e.target != null && (s.href = An(e.target)), e.title && (s.title = e.title), a("a", s, t(e.children, r));
2485
+ }
2486
+ case x.table: {
2487
+ let s = e;
2488
+ return a("table", { key: r.key }, a("thead", null, a("tr", null, s.header.map(function(u, v) {
2489
+ return a("th", { key: v, style: s.align[v] == null ? {} : { textAlign: s.align[v] } }, t(u, r));
2490
+ }))), a("tbody", null, s.cells.map(function(u, v) {
2491
+ return a("tr", { key: v }, u.map(function(m, y) {
2492
+ return a("td", { key: y, style: s.align[y] == null ? {} : { textAlign: s.align[y] } }, t(m, r));
2493
+ }));
2494
+ })));
2495
+ }
2496
+ case x.text:
2497
+ return e.text;
2498
+ case x.textFormatted:
2499
+ return a(e.tag, { key: r.key }, t(e.children, r));
2500
+ case x.orderedList:
2501
+ case x.unorderedList: {
2502
+ let s = e.type === x.orderedList ? "ol" : "ul";
2503
+ return a(s, { key: r.key, start: e.type === x.orderedList ? e.start : void 0 }, e.items.map(function(u, v) {
2504
+ return a("li", { key: v }, t(u, r));
2505
+ }));
2506
+ }
2507
+ case x.paragraph:
2508
+ return a("p", { key: r.key }, t(e.children, r));
2509
+ case x.ref:
2510
+ return null;
2511
+ default:
2512
+ return null;
2513
+ }
2514
+ }
2515
+ var Zn = (e, t, r, a, n, l) => {
2516
+ var i = (c) => c.map(function(f) {
2517
+ return "text" in f ? f.text : "";
2518
+ }), o = (c, f = {}) => {
2519
+ var d = (f.renderDepth || 0) + 1;
2520
+ if (d > 2500) return i(c);
2521
+ f.renderDepth = d;
2522
+ for (var h = f.key, A = [], C = !1, g = 0; g < c.length; g++) {
2523
+ f.key = g;
2524
+ var s;
2525
+ if (e) {
2526
+ var u = ua.bind(null, c[g], o, f, t, r, a, n, l);
2527
+ s = e(u, c[g], o, f);
2528
+ } else s = ua(c[g], o, f, t, r, a, n, l);
2529
+ var v = typeof s == "string";
2530
+ if (v && C) A[A.length - 1] += s;
2531
+ else if (s !== null) if (Array.isArray(s)) for (var m = 0; m < s.length; m++) A.push(s[m]);
2532
+ else A.push(s);
2533
+ C = v;
2534
+ }
2535
+ return f.key = h, f.renderDepth = d - 1, A;
2536
+ };
2537
+ return o;
2538
+ }, Qn = (e, t) => {
2539
+ let r = Tt(t, e, void 0);
2540
+ return r ? typeof r == "function" || typeof r == "object" && "render" in r ? r : Tt(t, `${e}.component`, e) : e;
2541
+ };
2542
+ function $n(e, t) {
2543
+ let r = { ...t || {} };
2544
+ r.overrides = r.overrides || {};
2545
+ let a = r.slugify || ir, n = r.sanitizer || It, l = r.createElement, i = r.overrides && Object.keys(r.overrides).length > 0, o = (v) => Ht(v, { ...r, wrapper: null });
2546
+ function c(v, m, ...y) {
2547
+ var T = m || {};
2548
+ for (var L in T) {
2549
+ var p = T[L];
2550
+ if (typeof p == "string" && p.length > 0 && p.charCodeAt(0) === oe && (gn.test(p) || mn.test(p) || Yn(p, 0))) {
2551
+ var O = o(p.trim());
2552
+ T[L] = L === "innerHTML" && Array.isArray(O) ? O[0] : O;
2553
+ }
2554
+ }
2555
+ var N = v;
2556
+ if (i) {
2557
+ var P = Tt(r.overrides, v + ".props", {});
2558
+ N = Qn(v, r.overrides), T = { ...T, ...P, className: Cn(T.className, P.className) || void 0 };
2559
+ }
2560
+ if (!l) {
2561
+ var w = T.key;
2562
+ return w != null && delete T.key, y.length === 1 ? T.children = y[0] : y.length > 1 && (T.children = y), Ot(N, T, w);
2563
+ }
2564
+ return l(N, T, ...y);
2565
+ }
2566
+ let f = { ...r, slugify: (v) => a(v, ir), sanitizer: n, tagfilter: r.tagfilter !== !1 }, d = e[0] && e[0].type === x.refCollection ? e[0].refs : {}, h = Zn(r.renderRule, c, n, a, d, r), A = h(e, { inline: r.forceInline, refs: d }), C = [];
2567
+ for (let v in d) v.charCodeAt(0) === rr && C.push({ identifier: v, footnote: d[v].target });
2568
+ if (C.length && A.push(c("footer", { key: "footer" }, C.map(function(v) {
2569
+ let m = v.identifier.charCodeAt(0) === rr ? v.identifier.slice(1) : v.identifier, y = zt(v.footnote, { inline: !0, refs: d }, f);
2570
+ return c("div", { id: a(m, ir), key: v.identifier }, m + ": ", h(y, { inline: !0, refs: d }));
2571
+ }))), r.wrapper === null) return A;
2572
+ let g = r.wrapper || (r.forceInline ? "span" : "div"), s;
2573
+ if (A.length > 1 || r.forceWrapper) s = A;
2574
+ else return A.length === 1 ? A[0] : null;
2575
+ var u = r.wrapperProps ? { ...r.wrapperProps } : {};
2576
+ return u.children = s, Ot(g, u, "outer");
2577
+ }
2578
+ function Ht(e = "", t = {}) {
2579
+ let r = { ...t || {} };
2580
+ r.overrides = r.overrides || {};
2581
+ let a = r.slugify || ir, n = r.sanitizer || It;
2582
+ function l(o) {
2583
+ let c = r.forceInline || !r.forceBlock && !on.test(o), f = { ...r, slugify: (A) => a(A, ir), sanitizer: n, tagfilter: r.tagfilter !== !1 };
2584
+ c || ma(o, i);
2585
+ let d = o;
2586
+ if (!c) {
2587
+ let A = d.length;
2588
+ for (; A > 0 && (d[A - 1] === `
2589
+ ` || d[A - 1] === "\r"); ) A--;
2590
+ d = d.slice(0, A), d = `${d.replace(Gn, "")}
2591
+
2592
+ `;
2593
+ }
2594
+ if (r.optimizeForStreaming) {
2595
+ let A = d.lastIndexOf("<");
2596
+ A !== -1 && d.slice(A).indexOf(">") === -1 && (d = d.slice(0, A));
2597
+ }
2598
+ let h = zt(c ? o : d, { inline: c, refs: i }, f);
2599
+ return $n(h, { ...f, forceInline: c });
2600
+ }
2601
+ let i = {};
2602
+ return l(e);
2603
+ }
2604
+ var el = ({ children: e, options: t, ...r }) => {
2605
+ if (!(typeof mr.useContext < "u")) {
2606
+ let i = { ...t, overrides: { ...t?.overrides }, wrapperProps: { ...t?.wrapperProps, ...r } };
2607
+ return Ht(e ?? "", i);
2608
+ }
2609
+ let a = mr.useContext(Vn), n = mr.useMemo(() => ({ ...a, ...t, overrides: { ...a?.overrides, ...t?.overrides }, wrapperProps: { ...a?.wrapperProps, ...t?.wrapperProps, ...r } }), [a, t, r]), l = e ?? "";
2610
+ return mr.useMemo(() => Ht(l, n), [l, n]);
2611
+ }, rl = el, tl = rl;
2612
+ const al = Va.memo(function({
2613
+ displayConfig: t = {},
2614
+ height: r = "100%",
2615
+ colorPalette: a
2616
+ }) {
2617
+ const n = t.content || "", l = t.accentColorIndex ?? 0, i = t.fontSize || "medium", o = t.alignment || "left", c = !!t.transparentBackground, f = t.accentBorder || "none", d = qt(() => a?.colors && l < a.colors.length ? a.colors[l] : "#8884d8", [a, l]), h = {
2618
+ small: "dc:text-sm",
2619
+ medium: "dc:text-lg",
2620
+ large: "dc:text-xl"
2621
+ }, A = {
2622
+ left: "dc:text-left",
2623
+ center: "dc:text-center",
2624
+ right: "dc:text-right"
2625
+ }, C = {
2626
+ small: { 1: "dc:text-lg", 2: "dc:text-base", 3: "dc:text-sm" },
2627
+ medium: { 1: "dc:text-3xl", 2: "dc:text-2xl", 3: "dc:text-xl" },
2628
+ large: { 1: "dc:text-5xl", 2: "dc:text-4xl", 3: "dc:text-3xl" }
2629
+ }, g = { 1: "dc:mb-4", 2: "dc:mb-3", 3: "dc:mb-2" }, s = qt(() => ({
2630
+ overrides: {
2631
+ h1: {
2632
+ props: {
2633
+ className: `dc:font-bold ${C[i]?.[1] || "dc:text-3xl"} ${g[1]}`,
2634
+ style: { color: d }
2635
+ }
2636
+ },
2637
+ h2: {
2638
+ props: {
2639
+ className: `dc:font-bold ${C[i]?.[2] || "dc:text-2xl"} ${g[2]}`,
2640
+ style: { color: d }
2641
+ }
2642
+ },
2643
+ h3: {
2644
+ props: {
2645
+ className: `dc:font-bold ${C[i]?.[3] || "dc:text-xl"} ${g[3]}`,
2646
+ style: { color: d }
2647
+ }
2648
+ },
2649
+ p: { props: { className: "dc:mb-3 dc:leading-relaxed text-dc-text" } },
2650
+ strong: { props: { className: "dc:font-bold text-dc-text" } },
2651
+ em: { props: { className: "dc:italic text-dc-text" } },
2652
+ a: {
2653
+ props: {
2654
+ className: "dc:hover:underline dc:transition-colors",
2655
+ target: "_blank",
2656
+ rel: "nofollow noopener noreferrer",
2657
+ style: { color: d }
2658
+ }
2659
+ },
2660
+ code: { props: { className: "dc:px-1 dc:py-0.5 dc:rounded dc:text-xs bg-dc-surface-secondary text-dc-accent dc:font-mono" } },
2661
+ pre: { props: { className: "dc:rounded-lg dc:p-3 dc:my-2 dc:overflow-x-auto dc:text-xs bg-dc-surface-secondary text-dc-text dc:font-mono" } },
2662
+ ul: { props: { className: "dc:list-disc dc:ml-6 dc:mb-3 text-dc-text dc:space-y-1" } },
2663
+ ol: { props: { className: "dc:list-decimal dc:ml-6 dc:mb-3 text-dc-text dc:space-y-1" } },
2664
+ li: { props: { className: "dc:mb-1 text-dc-text" } },
2665
+ blockquote: { props: { className: "dc:border-l-4 border-dc-accent dc:pl-3 dc:my-2 dc:italic text-dc-text-secondary" } },
2666
+ hr: {
2667
+ props: {
2668
+ className: "dc:my-4 dc:border-none",
2669
+ style: { height: "2px", backgroundColor: d, opacity: 0.3 }
2670
+ }
2671
+ },
2672
+ table: { props: { className: "dc:w-full dc:border-collapse dc:my-3 dc:text-sm" } },
2673
+ thead: { props: { className: "bg-dc-surface-secondary" } },
2674
+ th: { props: { className: "dc:px-3 dc:py-2 dc:text-left dc:font-semibold dc:text-xs text-dc-text-secondary dc:uppercase dc:tracking-wider border-dc-border dc:border-b" } },
2675
+ td: { props: { className: "dc:px-3 dc:py-2 text-dc-text border-dc-border dc:border-b" } },
2676
+ tr: { props: { className: "dc:hover:opacity-80" } }
2677
+ }
2678
+ }), [d, i]);
2679
+ if (!n.trim())
2680
+ return c ? null : /* @__PURE__ */ qr(
2681
+ "div",
2682
+ {
2683
+ className: "dc:flex dc:items-center dc:justify-center dc:w-full dc:h-full",
2684
+ style: {
2685
+ height: r === "100%" ? "100%" : r
2686
+ },
2687
+ children: /* @__PURE__ */ Ga("div", { className: "dc:text-center text-dc-text-muted", children: [
2688
+ /* @__PURE__ */ qr("div", { className: "dc:text-sm dc:font-semibold dc:mb-1", children: "No content" }),
2689
+ /* @__PURE__ */ qr("div", { className: "dc:text-xs text-dc-text-secondary", children: "Add markdown content in the chart configuration" })
2690
+ ] })
2691
+ }
2692
+ );
2693
+ const u = {};
2694
+ if (f !== "none") {
2695
+ const v = `border${f.charAt(0).toUpperCase() + f.slice(1)}`;
2696
+ if (u[v] = `4px solid ${d}`, c) {
2697
+ const m = `padding${f.charAt(0).toUpperCase() + f.slice(1)}`;
2698
+ f === "left" && (u[m] = "12px");
2699
+ }
2700
+ }
2701
+ return /* @__PURE__ */ qr(
2702
+ "div",
2703
+ {
2704
+ className: `dc:w-full dc:overflow-auto ${c ? "" : "dc:p-4 "}${h[i] || "dc:text-lg"} ${A[o] || "dc:text-left"}`,
2705
+ style: {
2706
+ height: r === "100%" ? "100%" : r,
2707
+ ...u
2708
+ },
2709
+ children: /* @__PURE__ */ qr(tl, { options: s, children: n })
2710
+ }
2711
+ );
2712
+ }), il = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2713
+ __proto__: null,
2714
+ default: al
2715
+ }, Symbol.toStringTag, { value: "Module" }));
2716
+ export {
2717
+ al as M,
2718
+ tl as N,
2719
+ il as a
2720
+ };
2721
+ //# sourceMappingURL=chart-markdown-BT_-MBq1.js.map